text
stringlengths 2
1.04M
| meta
dict |
|---|---|
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">Contact Us</h2>
<h3 class="section-subheading text-muted">Tell us what you need.</h3>
<h4 class="section-subheading text-muted">For all inquiries, please contact <a href="mailto:sales@chubbs.solutions?Subject=Website%20Inquiry" target="_top">Sales</a>.</h4>
</div>
</div>
</div>
</section>
|
{
"content_hash": "2c347bfaacd47af57a2f1956ee2a09bf",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 191,
"avg_line_length": 49.81818181818182,
"alnum_prop": 0.5492700729927007,
"repo_name": "ChubbsSolutions/chubbssolutions.github.io",
"id": "a00086b9cc99a8981bbdda687bfbc0f3a9b4760e",
"size": "548",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/contact.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "17598"
},
{
"name": "HTML",
"bytes": "349860"
},
{
"name": "JavaScript",
"bytes": "85512"
},
{
"name": "PHP",
"bytes": "2183"
},
{
"name": "Ruby",
"bytes": "715"
}
],
"symlink_target": ""
}
|
[](https://travis-ci.org/LightTable/LightTable)
[](https://semaphoreci.com/lighttable/lighttable)
[](https://ci.appveyor.com/project/prertik/lighttable-1rj5p)
[](https://circleci.com/gh/LightTable/LightTable)
[](https://codecov.io/gh/LightTable/LightTable)

[](https://repology.org/metapackage/lighttable/versions)
[](https://gitter.im/LightTable/LightTable?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://www.codeshelter.co/)
Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything a [Chromium browser](http://www.chromium.org/) can.
### This is a development branch and is not clean like `master` and can have many breakages.
## Downloads
Prebuilt binaries are available through [lighttable.com](http://lighttable.com). To build and use a developer version of Light Table [see these instructions](doc/developer-install.md).
For OSX users, the install process involves the following steps until we officially sign our OSX App:
* In Finder, Ctrl-click on LightTable.app/ and select Open.
* When you see [this prompt](https://cloud.githubusercontent.com/assets/11994/11731454/85181e90-9f69-11e5-9c65-f6aa4228005c.png) about LightTable being unidentified, click Open.
* If Ctrl-click doesn't work for you, open System Preferences > Security & Privacy > General, temporarily change "Allow apps downloaded from:" to Anywhere and double click on LightTable.app.
## Documentation
* See [docs.lighttable.com](http://docs.lighttable.com/) for official user documentation and tutorials.
* See the [community wiki](https://github.com/LightTable/LightTable/wiki) which includes a [User FAQ](https://github.com/LightTable/LightTable/wiki/FAQ) and a [For Users page](https://github.com/LightTable/LightTable/wiki/For-Users) for additional links.
* For a typical Light Table workflow, [read this](doc/workflow.md).
* To understand how Light Table works, read about its [BOT architecture](doc/BOT.md).
* See [Light Table's API docs](http://lighttable.github.io/LightTable/api/index.html) to see what
plugin authors have access to.
* If you're a user coming from vim or emacs see the [For Vim Users](https://github.com/LightTable/LightTable/wiki/For-Vim-Users) and [For Emacs Users](https://github.com/LightTable/LightTable/wiki/For-Emacs-Users) guides.
## Plugins
Light Table has a powerful plugin system that allows almost any aspect of the editor to be extended and customized. With over [100+ plugins](https://github.com/LightTable/plugin-metadata), the community is able to offer eval support for new languages, create domain-specific IDEs and much more. If you're interested in writing your own plugin, see the [Write a Plugin](http://docs.lighttable.com/#write-a-plugin) and [Submit a Plugin](http://docs.lighttable.com/#submit-a-plugin) docs. For an example ClojureScript plugin, see [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier).
## Community
Want to ask a question or just say hi? Please do :). Our mailing list is the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). We also hang out in `#lighttable` on Freenode IRC.
## For Developers
LightTable is primarily written in [ClojureScript](http://clojure.org/clojurescript). If you aren't familiar with it, check out [David Nolen's tutorial](https://github.com/swannodette/lt-cljs-tutorial).
In order to develop for Light Table, you will need to [install a developer version of Light Table](doc/developer-install.md). For more information, read [CONTRIBUTING.md](https://github.com/LightTable/LightTable/blob/master/CONTRIBUTING.md#code-contributions) and [For Developers](https://github.com/LightTable/LightTable/wiki/For-Developers).
## License
All files in this project are under the [LICENSE.md](LICENSE.md) license unless otherwise stated in the file or by a dependency's license file.
## Credits
Big thanks to all our [contributors](https://github.com/LightTable/LightTable/graphs/contributors)!
Thanks of course to Kodowa for all they have done for Light Table and also to Cognitect for providing friday contributions for one of the core team members.
|
{
"content_hash": "b1f90704e67e2865bcfc6b9c5a9add55",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 608,
"avg_line_length": 84.9322033898305,
"alnum_prop": 0.7806824985032927,
"repo_name": "LightTable/LightTable",
"id": "d7a410f1a9908613670fa299d92f038573bc97f7",
"size": "5025",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "README.md",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "93976"
},
{
"name": "Clojure",
"bytes": "549061"
},
{
"name": "HTML",
"bytes": "1563"
},
{
"name": "JavaScript",
"bytes": "60231"
},
{
"name": "Shell",
"bytes": "8903"
}
],
"symlink_target": ""
}
|
const {Subject} = require('rxjs')
const {notifyFrom, notifyTo} = require('./config')
const email$ = new Subject()
const notify = ({subject, content}) => email$.next({from: notifyFrom, to: notifyTo, subject, content})
module.exports = {email$, notify}
|
{
"content_hash": "6ec9d55986987afd58372fae9cb47099",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 102,
"avg_line_length": 31.75,
"alnum_prop": 0.6889763779527559,
"repo_name": "openforis/sepal",
"id": "6735a91f51869e29c2ccf3ccb11477b782386e04",
"size": "254",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/sys-monitor/src/email.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "164580"
},
{
"name": "Dockerfile",
"bytes": "29267"
},
{
"name": "EQ",
"bytes": "55"
},
{
"name": "Groovy",
"bytes": "962064"
},
{
"name": "HTML",
"bytes": "28191"
},
{
"name": "Handlebars",
"bytes": "10739"
},
{
"name": "Java",
"bytes": "75320"
},
{
"name": "JavaScript",
"bytes": "2766345"
},
{
"name": "Python",
"bytes": "11261"
},
{
"name": "R",
"bytes": "1219"
},
{
"name": "Shell",
"bytes": "87864"
}
],
"symlink_target": ""
}
|
#import <IDEKit/IDEKeyBinding.h>
@interface IDETextKeyBinding : IDEKeyBinding
{
}
+ (unsigned long long)_defaultMaxNumberOfShortcuts;
- (id)commandIdentifier;
@end
|
{
"content_hash": "677a1cc879ec22a233111b752004a832",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 13.076923076923077,
"alnum_prop": 0.7647058823529411,
"repo_name": "orta/AxeMode",
"id": "df5e4ffbbd285bae12fad650fdd2c2ab9f2532f7",
"size": "308",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "XcodeHeaders/IDEKit/IDETextKeyBinding.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2710"
},
{
"name": "C++",
"bytes": "7889"
},
{
"name": "Objective-C",
"bytes": "2838233"
}
],
"symlink_target": ""
}
|
package org.camunda.bpm.engine.rest;
import static io.restassured.RestAssured.given;
import static io.restassured.path.json.JsonPath.from;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.Response.Status;
import org.camunda.bpm.engine.AuthorizationException;
import org.camunda.bpm.engine.ManagementService;
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.exception.NotFoundException;
import org.camunda.bpm.engine.impl.calendar.DateTimeUtil;
import org.camunda.bpm.engine.management.JobDefinition;
import org.camunda.bpm.engine.management.JobDefinitionQuery;
import org.camunda.bpm.engine.management.UpdateJobDefinitionSuspensionStateSelectBuilder;
import org.camunda.bpm.engine.management.UpdateJobDefinitionSuspensionStateTenantBuilder;
import org.camunda.bpm.engine.rest.exception.InvalidRequestException;
import org.camunda.bpm.engine.rest.exception.RestException;
import org.camunda.bpm.engine.rest.helper.MockJobDefinitionBuilder;
import org.camunda.bpm.engine.rest.helper.MockProvider;
import org.camunda.bpm.engine.rest.util.container.TestContainerRule;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.mockito.InOrder;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
public class JobDefinitionRestServiceInteractionTest extends AbstractRestServiceTest {
@ClassRule
public static TestContainerRule rule = new TestContainerRule();
protected static final String JOB_DEFINITION_RESOURCE_URL = TEST_RESOURCE_ROOT_PATH + "/job-definition";
protected static final String SINGLE_JOB_DEFINITION_RESOURCE_URL = JOB_DEFINITION_RESOURCE_URL + "/{id}";
protected static final String SINGLE_JOB_DEFINITION_SUSPENDED_URL = SINGLE_JOB_DEFINITION_RESOURCE_URL + "/suspended";
protected static final String JOB_DEFINITION_SUSPENDED_URL = JOB_DEFINITION_RESOURCE_URL + "/suspended";
protected static final String JOB_DEFINITION_RETRIES_URL = SINGLE_JOB_DEFINITION_RESOURCE_URL + "/retries";
protected static final String JOB_DEFINITION_PRIORITY_URL = SINGLE_JOB_DEFINITION_RESOURCE_URL + "/jobPriority";
private ProcessEngine namedProcessEngine;
private ManagementService mockManagementService;
private UpdateJobDefinitionSuspensionStateTenantBuilder mockSuspensionStateBuilder;
private UpdateJobDefinitionSuspensionStateSelectBuilder mockSuspensionStateSelectBuilder;
private JobDefinitionQuery mockQuery;
@Before
public void setUpRuntimeData() {
mockManagementService = mock(ManagementService.class);
namedProcessEngine = getProcessEngine(MockProvider.EXAMPLE_PROCESS_ENGINE_NAME);
when(namedProcessEngine.getManagementService()).thenReturn(mockManagementService);
List<JobDefinition> mockJobDefinitions = Collections.singletonList(MockProvider.createMockJobDefinition());
mockQuery = setUpMockJobDefinitionQuery(mockJobDefinitions);
mockSuspensionStateSelectBuilder = mock(UpdateJobDefinitionSuspensionStateSelectBuilder.class);
when(mockManagementService.updateJobDefinitionSuspensionState()).thenReturn(mockSuspensionStateSelectBuilder);
mockSuspensionStateBuilder = mock(UpdateJobDefinitionSuspensionStateTenantBuilder.class);
when(mockSuspensionStateSelectBuilder.byJobDefinitionId(anyString())).thenReturn(mockSuspensionStateBuilder);
when(mockSuspensionStateSelectBuilder.byProcessDefinitionId(anyString())).thenReturn(mockSuspensionStateBuilder);
when(mockSuspensionStateSelectBuilder.byProcessDefinitionKey(anyString())).thenReturn(mockSuspensionStateBuilder);
}
private JobDefinitionQuery setUpMockJobDefinitionQuery(List<JobDefinition> mockedJobDefinitions) {
JobDefinitionQuery sampleJobDefinitionQuery = mock(JobDefinitionQuery.class);
when(sampleJobDefinitionQuery.list()).thenReturn(mockedJobDefinitions);
when(sampleJobDefinitionQuery.count()).thenReturn((long) mockedJobDefinitions.size());
if(mockedJobDefinitions.size() == 1) {
when(sampleJobDefinitionQuery.singleResult()).thenReturn(mockedJobDefinitions.get(0));
}
when(sampleJobDefinitionQuery.jobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID)).thenReturn(sampleJobDefinitionQuery);
when(processEngine.getManagementService().createJobDefinitionQuery()).thenReturn(sampleJobDefinitionQuery);
when(mockManagementService.createJobDefinitionQuery()).thenReturn(sampleJobDefinitionQuery);
return sampleJobDefinitionQuery;
}
@Test
public void testSimpleJobDefinitionGet() {
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.then()
.expect()
.statusCode(Status.OK.getStatusCode())
.body("id", equalTo(MockProvider.EXAMPLE_JOB_DEFINITION_ID))
.body("processDefinitionId", equalTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID))
.body("processDefinitionKey", equalTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY))
.body("jobType", equalTo(MockProvider.EXAMPLE_JOB_TYPE))
.body("jobConfiguration", equalTo(MockProvider.EXAMPLE_JOB_CONFIG))
.body("activityId", equalTo(MockProvider.EXAMPLE_ACTIVITY_ID))
.body("suspended", equalTo(MockProvider.EXAMPLE_JOB_DEFINITION_IS_SUSPENDED))
.body("overridingJobPriority", equalTo(MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY))
.body("tenantId", equalTo(null))
.body("deploymentId", equalTo(MockProvider.EXAMPLE_JOB_DEFINITION_DEPLOYMENT_ID))
.when()
.get(SINGLE_JOB_DEFINITION_RESOURCE_URL);
InOrder inOrder = inOrder(mockQuery);
inOrder.verify(mockQuery).jobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
inOrder.verify(mockQuery).singleResult();
}
@Test
public void testJobDefinitionGetNullJobPriority() {
// given
JobDefinition mockJobDefinition = new MockJobDefinitionBuilder()
.id(MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.jobPriority(null)
.build();
when(mockQuery.singleResult()).thenReturn(mockJobDefinition);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.then()
.expect()
.statusCode(Status.OK.getStatusCode())
.body("id", equalTo(MockProvider.EXAMPLE_JOB_DEFINITION_ID))
.body("jobPriority", nullValue())
.when()
.get(SINGLE_JOB_DEFINITION_RESOURCE_URL);
}
@Test
public void testJobDefinitionGetIdDoesntExist() {
JobDefinitionQuery invalidQueryNonExistingJobDefinition;
invalidQueryNonExistingJobDefinition = mock(JobDefinitionQuery.class);
when(mockManagementService.createJobDefinitionQuery()
.jobDefinitionId(MockProvider.NON_EXISTING_JOB_DEFINITION_ID))
.thenReturn(invalidQueryNonExistingJobDefinition);
when(invalidQueryNonExistingJobDefinition.singleResult()).thenReturn(null);
String jobDefinitionId = MockProvider.NON_EXISTING_JOB_DEFINITION_ID;
given()
.pathParam("id", jobDefinitionId)
.then()
.expect()
.statusCode(Status.NOT_FOUND.getStatusCode())
.contentType(ContentType.JSON)
.body("type", equalTo(InvalidRequestException.class.getSimpleName()))
.body("message", equalTo("Job Definition with id " + jobDefinitionId + " does not exist"))
.when()
.get(SINGLE_JOB_DEFINITION_RESOURCE_URL);
}
@Test
public void testActivateJobDefinitionExcludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", false);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testDelayedActivateJobDefinitionExcludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", false);
params.put("executionDate", MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(false);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateJobDefinitionIncludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", true);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testDelayedActivateJobDefinitionIncludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", true);
params.put("executionDate", MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateThrowProcessEngineException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", false);
String expectedMessage = "expectedMessage";
doThrow(new ProcessEngineException(expectedMessage))
.when(mockSuspensionStateBuilder)
.activate();
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(ProcessEngineException.class.getSimpleName()))
.body("message", is(expectedMessage))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateNonParseableDateFormat() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", false);
params.put("executionDate", "a");
String expectedMessage = "Invalid format: \"a\"";
String exceptionMessage = "The suspension state of Job Definition with id " + MockProvider.NON_EXISTING_JOB_DEFINITION_ID + " could not be updated due to: " + expectedMessage;
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(exceptionMessage))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByIdThrowsAuthorizationException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", false);
String expectedMessage = "expectedMessage";
doThrow(new AuthorizationException(expectedMessage))
.when(mockSuspensionStateBuilder)
.activate();
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.contentType(ContentType.JSON)
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(expectedMessage))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionExcludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", false);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).includeJobs(false);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testDelayedSuspendJobDefinitionExcludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", false);
params.put("executionDate", MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(false);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendJobDefinitionIncludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", true);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testDelayedSuspendJobDefinitionIncludingInstances() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", true);
params.put("executionDate", MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_JOB_DEFINITION_DELAYED_EXECUTION);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendThrowsProcessEngineException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", false);
String expectedMessage = "expectedMessage";
doThrow(new ProcessEngineException(expectedMessage))
.when(mockSuspensionStateBuilder)
.suspend();
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(ProcessEngineException.class.getSimpleName()))
.body("message", is(expectedMessage))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendNonParseableDateFormat() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", false);
params.put("executionDate", "a");
String expectedMessage = "Invalid format: \"a\"";
String exceptionMessage = "The suspension state of Job Definition with id " + MockProvider.NON_EXISTING_JOB_DEFINITION_ID + " could not be updated due to: " + expectedMessage;
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(exceptionMessage))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendWithMultipleByParameters() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
String message = "Only one of jobDefinitionId, processDefinitionId or processDefinitionKey should be set to update the suspension state.";
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByIdThrowsAuthorizationException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", false);
String expectedMessage = "expectedMessage";
doThrow(new AuthorizationException(expectedMessage))
.when(mockSuspensionStateBuilder)
.suspend();
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.contentType(ContentType.JSON)
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(expectedMessage))
.when()
.put(SINGLE_JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKey() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKeyIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testDelayedActivateJobDefinitionByProcessDefinitionKey() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testDelayedActivateJobDefinitionByProcessDefinitionKeyIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKeyWithUnparseableDate() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("executionDate", "a");
String message = "Could not update the suspension state of Job Definitions due to: Invalid format: \"a\"";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKeyWithException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
String expectedException = "expectedException";
doThrow(new ProcessEngineException(expectedException))
.when(mockSuspensionStateBuilder)
.activate();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(ProcessEngineException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKeyWithAuthorizationException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
String expectedException = "expectedException";
doThrow(new AuthorizationException(expectedException))
.when(mockSuspensionStateBuilder)
.activate();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKeyAndTenantId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("processDefinitionTenantId", MockProvider.EXAMPLE_TENANT_ID);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).processDefinitionTenantId(MockProvider.EXAMPLE_TENANT_ID);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateJobDefinitionByProcessDefinitionKeyWithoutTenantId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("processDefinitionWithoutTenantId", true);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).processDefinitionWithoutTenantId();
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKey() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKeyIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testDelayedSuspendJobDefinitionByProcessDefinitionKey() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testDelayedSuspendJobDefinitionByProcessDefinitionKeyIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKeyWithUnparseableDate() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("executionDate", "a");
String message = "Could not update the suspension state of Job Definitions due to: Invalid format: \"a\"";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKeyWithException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
String expectedException = "expectedException";
doThrow(new ProcessEngineException(expectedException))
.when(mockSuspensionStateBuilder)
.suspend();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(ProcessEngineException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKeyWithAuthorizationException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
String expectedException = "expectedException";
doThrow(new AuthorizationException(expectedException))
.when(mockSuspensionStateBuilder)
.suspend();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKeyAndTenantId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("processDefinitionTenantId", MockProvider.EXAMPLE_TENANT_ID);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).processDefinitionTenantId(MockProvider.EXAMPLE_TENANT_ID);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionKeyWithoutTenantId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionKey", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
params.put("processDefinitionWithoutTenantId", true);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY);
verify(mockSuspensionStateBuilder).processDefinitionWithoutTenantId();
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testActivateJobDefinitionByProcessDefinitionId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateJobDefinitionByProcessDefinitionIdIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testDelayedActivateJobDefinitionByProcessDefinitionId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testDelayedActivateJobDefinitionByProcessDefinitionIdIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("includeJobs", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).activate();
}
@Test
public void testActivateJobDefinitionByProcessDefinitionIdWithUnparseableDate() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("executionDate", "a");
String message = "Could not update the suspension state of Job Definitions due to: Invalid format: \"a\"";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByProcessDefinitionIdWithException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
String expectedException = "expectedException";
doThrow(new ProcessEngineException(expectedException))
.when(mockSuspensionStateBuilder)
.activate();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(ProcessEngineException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByProcessDefinitionIdWithAuthorizationException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
String expectedException = "expectedException";
doThrow(new AuthorizationException(expectedException))
.when(mockSuspensionStateBuilder)
.activate();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionIdIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testDelayedSuspendJobDefinitionByProcessDefinitionId() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testDelayedSuspendJobDefinitionByProcessDefinitionIdIncludingInstaces() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("includeJobs", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("executionDate", MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
Date executionDate = DateTimeUtil.parseDate(MockProvider.EXAMPLE_PROCESS_DEFINITION_DELAYED_EXECUTION);
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
verify(mockSuspensionStateSelectBuilder).byProcessDefinitionId(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
verify(mockSuspensionStateBuilder).executionDate(executionDate);
verify(mockSuspensionStateBuilder).includeJobs(true);
verify(mockSuspensionStateBuilder).suspend();
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionIdWithUnparseableDate() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
params.put("executionDate", "a");
String message = "Could not update the suspension state of Job Definitions due to: Invalid format: \"a\"";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionIdWithException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
String expectedException = "expectedException";
doThrow(new ProcessEngineException(expectedException))
.when(mockSuspensionStateBuilder)
.suspend();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(ProcessEngineException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByProcessDefinitionIdWithAuthorizationException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("processDefinitionId", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
String expectedException = "expectedException";
doThrow(new AuthorizationException(expectedException))
.when(mockSuspensionStateBuilder)
.suspend();
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(expectedException))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testActivateJobDefinitionByIdShouldThrowException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", false);
params.put("jobDefinitionId", MockProvider.EXAMPLE_JOB_DEFINITION_ID);
String message = "Either processDefinitionId or processDefinitionKey can be set to update the suspension state.";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByIdShouldThrowException() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
params.put("jobDefinitionId", MockProvider.EXAMPLE_JOB_DEFINITION_ID);
String message = "Either processDefinitionId or processDefinitionKey can be set to update the suspension state.";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSuspendJobDefinitionByNothing() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("suspended", true);
String message = "Either jobDefinitionId, processDefinitionId or processDefinitionKey should be set to update the suspension state.";
given()
.contentType(ContentType.JSON)
.body(params)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", is(InvalidRequestException.class.getSimpleName()))
.body("message", is(message))
.when()
.put(JOB_DEFINITION_SUSPENDED_URL);
}
@Test
public void testSetJobRetries() {
Map<String, Object> retriesVariableJson = new HashMap<String, Object>();
retriesVariableJson.put("retries", MockProvider.EXAMPLE_JOB_RETRIES);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(retriesVariableJson)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_RETRIES_URL);
verify(mockManagementService).setJobRetriesByJobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID, MockProvider.EXAMPLE_JOB_RETRIES);
}
@Test
public void testSetJobRetriesExceptionExpected() {
String expectedMessage = "expected exception message";
doThrow(new ProcessEngineException(expectedMessage))
.when(mockManagementService)
.setJobRetriesByJobDefinitionId(MockProvider.NON_EXISTING_JOB_DEFINITION_ID, MockProvider.EXAMPLE_JOB_RETRIES);
Map<String, Object> retriesVariableJson = new HashMap<String, Object>();
retriesVariableJson.put("retries", MockProvider.EXAMPLE_JOB_RETRIES);
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(retriesVariableJson)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", equalTo(InvalidRequestException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_RETRIES_URL);
verify(mockManagementService).setJobRetriesByJobDefinitionId(MockProvider.NON_EXISTING_JOB_DEFINITION_ID, MockProvider.EXAMPLE_JOB_RETRIES);
}
@Test
public void testSetJobRetriesAuthorizationException() {
String expectedMessage = "expected exception message";
doThrow(new AuthorizationException(expectedMessage))
.when(mockManagementService)
.setJobRetriesByJobDefinitionId(MockProvider.NON_EXISTING_JOB_DEFINITION_ID, MockProvider.EXAMPLE_JOB_RETRIES);
Map<String, Object> retriesVariableJson = new HashMap<String, Object>();
retriesVariableJson.put("retries", MockProvider.EXAMPLE_JOB_RETRIES);
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(retriesVariableJson)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", equalTo(AuthorizationException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_RETRIES_URL);
}
@Test
public void testSetJobPriority() {
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
verify(mockManagementService).setOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID,
MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY, false);
}
@Test
public void testSetJobPriorityToExtremeValue() {
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", Long.MAX_VALUE);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
verify(mockManagementService).setOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID,
Long.MAX_VALUE, false);
}
@Test
public void testSetJobPriorityIncludeExistingJobs() {
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY);
priorityJson.put("includeJobs", true);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
verify(mockManagementService).setOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID,
MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY, true);
}
@Test
public void testSetJobPriorityExceptionExpected() {
String expectedMessage = "expected exception message";
doThrow(new ProcessEngineException(expectedMessage))
.when(mockManagementService)
.setOverridingJobPriorityForJobDefinition(eq(MockProvider.EXAMPLE_JOB_DEFINITION_ID),
eq(MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY), anyBoolean());
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", equalTo(RestException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
verify(mockManagementService).setOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID,
MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY, false);
}
@Test
public void testSetNonExistingJobDefinitionPriority() {
String expectedMessage = "expected exception message";
doThrow(new NotFoundException(expectedMessage))
.when(mockManagementService)
.setOverridingJobPriorityForJobDefinition(eq(MockProvider.NON_EXISTING_JOB_DEFINITION_ID),
eq(MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY), anyBoolean());
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY);
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.NOT_FOUND.getStatusCode())
.body("type", equalTo(InvalidRequestException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
}
@Test
public void testSetJobPriorityAuthorizationException() {
String expectedMessage = "expected exception message";
doThrow(new AuthorizationException(expectedMessage))
.when(mockManagementService)
.setOverridingJobPriorityForJobDefinition(eq(MockProvider.EXAMPLE_JOB_DEFINITION_ID),
eq(MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY), anyBoolean());
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", equalTo(AuthorizationException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
}
@Test
public void testResetJobPriority() {
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", null);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.NO_CONTENT.getStatusCode())
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
verify(mockManagementService).clearOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
}
@Test
public void testResetJobPriorityIncludeJobsNotAllowed() {
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", null);
priorityJson.put("includeJobs", true);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.BAD_REQUEST.getStatusCode())
.body("type", equalTo(InvalidRequestException.class.getSimpleName()))
.body("message", equalTo("Cannot reset priority for job definition " + MockProvider.EXAMPLE_JOB_DEFINITION_ID
+ " with includeJobs=true"))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
}
@Test
public void testResetJobPriorityExceptionExpected() {
String expectedMessage = "expected exception message";
doThrow(new ProcessEngineException(expectedMessage))
.when(mockManagementService).clearOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", null);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", equalTo(RestException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
}
@Test
public void testResetNonExistingJobDefinitionPriority() {
String expectedMessage = "expected exception message";
doThrow(new NotFoundException(expectedMessage))
.when(mockManagementService).clearOverridingJobPriorityForJobDefinition(MockProvider.NON_EXISTING_JOB_DEFINITION_ID);
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", null);
given()
.pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.NOT_FOUND.getStatusCode())
.body("type", equalTo(InvalidRequestException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
}
@Test
public void testResetJobPriorityAuthorizationException() {
String expectedMessage = "expected exception message";
doThrow(new AuthorizationException(expectedMessage))
.when(mockManagementService).clearOverridingJobPriorityForJobDefinition(MockProvider.EXAMPLE_JOB_DEFINITION_ID);
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", null);
given()
.pathParam("id", MockProvider.EXAMPLE_JOB_DEFINITION_ID)
.contentType(ContentType.JSON)
.body(priorityJson)
.then()
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", equalTo(AuthorizationException.class.getSimpleName()))
.body("message", equalTo(expectedMessage))
.when()
.put(JOB_DEFINITION_PRIORITY_URL);
}
@Test
public void testTenantIdListParameter() {
mockQuery = setUpMockJobDefinitionQuery(createMockJobDefinitionsTwoTenants());
Response response = given()
.queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID_LIST)
.then().expect()
.statusCode(Status.OK.getStatusCode())
.when()
.get(JOB_DEFINITION_RESOURCE_URL);
verify(mockQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID, MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
verify(mockQuery).list();
String content = response.asString();
List<String> jobDefinitions = from(content).getList("");
assertThat(jobDefinitions).hasSize(2);
String returnedTenantId1 = from(content).getString("[0].tenantId");
String returnedTenantId2 = from(content).getString("[1].tenantId");
assertThat(returnedTenantId1).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
assertThat(returnedTenantId2).isEqualTo(MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
}
@Test
public void testTenantIdListPostParameter() {
mockQuery = setUpMockJobDefinitionQuery(createMockJobDefinitionsTwoTenants());
Map<String, Object> queryParameters = new HashMap<String, Object>();
queryParameters.put("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID_LIST.split(","));
Response response = given()
.contentType(POST_JSON_CONTENT_TYPE)
.body(queryParameters)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.post(JOB_DEFINITION_RESOURCE_URL);
verify(mockQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID, MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
verify(mockQuery).list();
String content = response.asString();
List<String> jobDefinitions = from(content).getList("");
assertThat(jobDefinitions).hasSize(2);
String returnedTenantId1 = from(content).getString("[0].tenantId");
String returnedTenantId2 = from(content).getString("[1].tenantId");
assertThat(returnedTenantId1).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
assertThat(returnedTenantId2).isEqualTo(MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
}
private List<JobDefinition> createMockJobDefinitionsTwoTenants() {
return Arrays.asList(
MockProvider.mockJobDefinition().tenantId(MockProvider.EXAMPLE_TENANT_ID).build(),
MockProvider.mockJobDefinition().tenantId(MockProvider.ANOTHER_EXAMPLE_TENANT_ID).build());
}
}
|
{
"content_hash": "404f4d8ad7b1d14ea7343e63bb666dd1",
"timestamp": "",
"source": "github",
"line_count": 1660,
"max_line_length": 179,
"avg_line_length": 37.38734939759036,
"alnum_prop": 0.7196719462481672,
"repo_name": "ingorichtsmeier/camunda-bpm-platform",
"id": "ed19d2309e7ab0bb95f801b2732a96690398807e",
"size": "62870",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/JobDefinitionRestServiceInteractionTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8608"
},
{
"name": "CSS",
"bytes": "5486"
},
{
"name": "Fluent",
"bytes": "3111"
},
{
"name": "FreeMarker",
"bytes": "1442812"
},
{
"name": "Groovy",
"bytes": "1904"
},
{
"name": "HTML",
"bytes": "961289"
},
{
"name": "Java",
"bytes": "44047866"
},
{
"name": "JavaScript",
"bytes": "3063613"
},
{
"name": "Less",
"bytes": "154956"
},
{
"name": "Python",
"bytes": "192"
},
{
"name": "Ruby",
"bytes": "60"
},
{
"name": "SQLPL",
"bytes": "44180"
},
{
"name": "Shell",
"bytes": "11634"
}
],
"symlink_target": ""
}
|
.class public final Landroid/support/v4/util/Pools;
.super Ljava/lang/Object;
.source "Pools.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroid/support/v4/util/Pools$SynchronizedPool;,
Landroid/support/v4/util/Pools$SimplePool;,
Landroid/support/v4/util/Pools$Pool;
}
.end annotation
# direct methods
.method private constructor <init>()V
.registers 1
.prologue
.line 69
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 71
return-void
.end method
|
{
"content_hash": "2199051b05187dc68a1adcc0fd991caf",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 57,
"avg_line_length": 21.423076923076923,
"alnum_prop": 0.6912028725314183,
"repo_name": "shenxdtw/PokemonGo-Plugin",
"id": "b6d3b2f3cd02f8d17ba6086044a91456fffa6049",
"size": "557",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "PokemonGo_Smali/android/support/v4/util/Pools.smali",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Smali",
"bytes": "35925787"
}
],
"symlink_target": ""
}
|
package com.datacraftcoords.event;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.WorldType;
import net.minecraft.world.chunk.Chunk;
import com.datacraftcoords.Do;
import com.datacraftcoords.HUDUtil;
import com.datacraftcoords.MyMessage;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
@SuppressWarnings("unused")
public class renderOverlayRight {
//public static String daConfig;
/** Enables/Disables this Mod */
//public static boolean Enabled;
//public static boolean chunkEnabled;
//public static boolean LightEnabled;
private static int width;
private static int height;
private static int varY;
public static void renderItRight(boolean Enabled, boolean chunkEnabled, boolean LightEnabled) {
int varX = 2;
// ScaledResolution
ScaledResolution res = new ScaledResolution(mc);//, mc.displayWidth, mc.displayHeight);
FontRenderer fontRenderer = mc.fontRendererObj;
width = res.getScaledWidth();
height = res.getScaledHeight();
int fHeight = fontRenderer.FONT_HEIGHT;
int sWidth = fontRenderer.getStringWidth("stringVar");
int sWidth2 = res.getScaledWidth() - 2 - sWidth;
boolean alignLeft = true;
boolean alignRight = false;
boolean alignTop = false;
/** If potionEffects move display down */
int varY = 2;
int varY2 = 12;
int DaEffect = HUDUtil.PotionEffectType();
// -1 = null
// 0 = no effects
// 1 = Good Effects
if(DaEffect == 1){
varY = 2 + 33;
varY2 = 12 + 33;
}
// 2 = bad Effects
if(DaEffect == 2){
varY = 2 + 60;
varY2 = 12 + 60;
}
/** Gets Biome, and compares it to nether. Then alters the coords displayed based on results */
String varBiome = getBiome();
if(!varBiome.equals("Hell") && !varBiome.equals("The End")){
/** We are NOT in the Nether so display Overworld, and Nether Coords. */
String coordinateString = "{x}, {y}, {z}";
coordinateString = coordinateString.replace("{x}", Integer.toString(GetXCoordinate()));
coordinateString = coordinateString.replace("{y}", Integer.toString(GetYCoordinate()));
coordinateString = coordinateString.replace("{z}", Integer.toString(GetZCoordinate()));
/** Display Overworld coords */
String owCoord1 = TextFormatting.YELLOW + "O: " + coordinateString + " " + TextFormatting.RED + yawCalc() + TextFormatting.WHITE + " T:" + CalculateMessageForInfoLine(null);
sWidth = fontRenderer.getStringWidth(owCoord1);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord1, varX, varY, 0xffffff);
String coordinateString2 = "{x}, {y}, {z}";
coordinateString2 = coordinateString2.replace("{x}", Integer.toString(GetXCoordinate() / 8));
coordinateString2 = coordinateString2.replace("{y}", Integer.toString(GetYCoordinate()));
coordinateString2 = coordinateString2.replace("{z}", Integer.toString(GetZCoordinate() / 8));
/** Display Nether Coords, Overworld Dived by 8*/
String owCoord2 = TextFormatting.LIGHT_PURPLE + "N: " + coordinateString2 + TextFormatting.GREEN + " XP: " + getXP();
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY2, 0xffffff);
//System.out.println("Biome " + varBiome + " - coord1 " + coordinateString + " - coord2 " + coordinateString2);
}
else if(varBiome.equals("Hell")){
/** We ARE in the Nether so display Nether, and Overworld Coords. */
String coordinateString3 = "{x}, {y}, {z}";
coordinateString3 = coordinateString3.replace("{x}", Integer.toString(GetXCoordinate()));
coordinateString3 = coordinateString3.replace("{y}", Integer.toString(GetYCoordinate()));
coordinateString3 = coordinateString3.replace("{z}", Integer.toString(GetZCoordinate()));
/** Display Nether Coords */
String owCoord1 = TextFormatting.LIGHT_PURPLE + "N: " + coordinateString3 + " " + TextFormatting.RED + yawCalc() + TextFormatting.WHITE + " T:" + CalculateMessageForInfoLine(null);
sWidth = fontRenderer.getStringWidth(owCoord1);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord1, varX, varY, 0xffffff);
String coordinateString4 = "{x}, {y}, {z}";
coordinateString4 = coordinateString4.replace("{x}", Integer.toString((GetXCoordinate() * 8)));
coordinateString4 = coordinateString4.replace("{y}", Integer.toString(GetYCoordinate()));
coordinateString4 = coordinateString4.replace("{z}", Integer.toString((GetZCoordinate() * 8)));
/** Display Overworld Coords, Nether Multiplied by 8 */
String owCoord2 = TextFormatting.YELLOW + "O: " + coordinateString4 + TextFormatting.GREEN + " XP: " + getXP();
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY2, 0xffffff);
//System.out.println("Biome " + varBiome + " - coord3 " + coordinateString3 + " - coord4 " + coordinateString4);
}
else if(varBiome.equals("The End")){
/** We ARE in the End so display End, and Overworld Coords. */
String coordinateString3 = "{x}, {y}, {z}";
coordinateString3 = coordinateString3.replace("{x}", Integer.toString(GetXCoordinate()));
coordinateString3 = coordinateString3.replace("{y}", Integer.toString(GetYCoordinate()));
coordinateString3 = coordinateString3.replace("{z}", Integer.toString(GetZCoordinate()));
/** Display Nether Coords */
String owCoord1 = TextFormatting.LIGHT_PURPLE + "E: " + coordinateString3 + " " + TextFormatting.RED + yawCalc() + TextFormatting.WHITE + " T:" + CalculateMessageForInfoLine(null);
sWidth = fontRenderer.getStringWidth(owCoord1);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord1, varX, varY, 0xffffff);
String owCoord2 = "" + TextFormatting.GREEN + " XP: " + getXP();
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY2, 0xffffff);
}
//Minecraft.getMinecraft().fontRendererObj.drawString("" + coordFormat + "", 2, 2, 0xffffff);
/**
*
* Display Biome
*
*/
String owCoord1 = "B: " + getBiome() + "";
sWidth = fontRenderer.getStringWidth(owCoord1);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord1, varX, varY2 + 10, 0xffffff);
/**
*
* Get Chunk coordinates
*
*/
int chunkX = GetXCoordinate() / 16;
int chunkY = GetYCoordinate() / 16;
int chunkZ = GetZCoordinate() / 16;
int inChunkX = GetXCoordinate() % 16;
int inChunkY = GetYCoordinate() % 16;
int inChunkZ = GetZCoordinate() % 16;
String daChunk = ("" + Integer.toString(inChunkX) + " " + Integer.toString(inChunkY) + " " + Integer.toString(inChunkZ) + " in " + Integer.toString(chunkX) + " " + Integer.toString(chunkY) + " " + Integer.toString(chunkZ));
if(chunkEnabled){
/**
* Check if enabled by Server Plugin. TODO:
*/
if(MyMessage.plgCIenabled){
String owCoord2 = "C: " + daChunk + "";
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY2 + 20, 0xffffff);
}
}
/**
*
* Get Light Level
*
*/
if (LightEnabled){
/**
* Check if Enabled by Server Plugin TODO:
*/
if(MyMessage.plgLLenabled){
BlockPos blockpos = new BlockPos(mc.getRenderViewEntity().posX, mc.getRenderViewEntity().getEntityBoundingBox().minY, mc.getRenderViewEntity().posZ);
//arraylist.add("Light: " + chunk.getLightSubtracted(blockpos, 0) + " (" + chunk.getLightFor(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos) + " block)");
Chunk chunk = mc.theWorld.getChunkFromBlockCoords(blockpos);
String daLight = "L: " + chunk.getLightSubtracted(blockpos, 0);
daLight = daLight + " (S: " + chunk.getLightFor(EnumSkyBlock.SKY, blockpos) ;
int blockLight = chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos);
if (blockLight < 8){
daLight = daLight + ", " + TextFormatting.RED + "B: " + blockLight + TextFormatting.WHITE + ")";
}
else {
daLight = daLight + ", B: " + blockLight + ")";
}
if(chunkEnabled){
//mc.fontRendererObj.drawStringWithShadow("" + daLight, varX, 42, 0xffffff);
varY = varY2 + 30; //42
}
else {
//mc.fontRendererObj.drawStringWithShadow("" + daLight, varX, 32, 0xffffff);
varY = varY2 + 20; //32
}
String owCoord2 = "" + daLight;
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY, 0xffffff);
}
}
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK && mc.objectMouseOver.getBlockPos() != null)
{
BlockPos blockpos1 = mc.objectMouseOver.getBlockPos();
String daLook = String.format("L @: %d %d %d", new Object[] {Integer.valueOf(blockpos1.getX()), Integer.valueOf(blockpos1.getY()), Integer.valueOf(blockpos1.getZ())});
String owCoord2 = "" + daLook;
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY2 + 50, 0xffffff);
}
// TODO test code
/**
*
* Get and Display block name, and variant if applicable
*
*/
String list = getDebugInfoRight();
String delims = "[?]+";
String[] tokens = list.split(delims);
int i = 0;
String daBlockType = tokens[0];
String daBlockVar = "";
if (1 < tokens.length){
daBlockVar = tokens[1];
}
//daBlockVar = String.valueOf(list.size());
String owCoord2 = "" + daBlockType + " " + daBlockVar;
sWidth = fontRenderer.getStringWidth(owCoord2);
varX = res.getScaledWidth() - 2 - sWidth;
mc.fontRendererObj.drawStringWithShadow(owCoord2, varX, varY2 + 40, 0xffffff);
}
protected static Minecraft mc = Minecraft.getMinecraft();
//String yawCalc = "" + (MathHelper.floor_double((double) (mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3);
/** Get Direction we are facing N S E W */
public static double getYaw(){
return (double) (MathHelper.floor_double((double) (mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3);
}
public static String yawCalc(){
double var1 = getYaw();
String var2 = "";
if(var1 == 0){
var2 = "S +Z";
}
else if(var1 == 1){
var2 = "W -X";
}
else if(var1 == 2){
var2 = "N -Z";
}
else if(var1 == 3){
var2 = "E +X";
}
return var2;
}
/** Get XP, Current to Next Level */
public static String getXP(){
return (String) "" + String.valueOf((int) Math.ceil(mc.thePlayer.experience * mc.thePlayer.xpBarCap())) + "/" + mc.thePlayer.xpBarCap();
}
/** Get Biome */
public static String getBiome()
{
return (String) "" + mc.thePlayer.worldObj.getBiomeGenForCoords(mc.thePlayer.getPosition()).getBiomeName();
}
/** Get Player Coordinates */
public static int GetXCoordinate()
{
return (int) Math.floor(mc.thePlayer.posX);
}
public static int GetYCoordinate()
{
return (int) Math.floor(mc.thePlayer.posY);
}
public static int GetZCoordinate()
{
return (int) Math.floor(mc.thePlayer.posZ);
}
public static int GetEyeCoordinate()
{
return (int) Math.floor(mc.thePlayer.eyeHeight);//mc.thePlayer.posY
}
private static long mobSpawningStartTime = 13187;
//mobs stop spawning at: 22813
//mobs start to burn at: 23600
private static long mobSpawningStopTime = 23600;
/**
* Calculates time
* @return time if the Clock is enabled, otherwise "".
*/
public static String CalculateMessageForInfoLine(String infoLineMessageUpToThisPoint)
{
if (true)
{
//0 game time is 6am, so add 6000
long time = (mc.theWorld.getWorldTime() + 6000) % 24000;
long hours = time / 1000;
long seconds = (long)((time % 1000) * (60.0/1000.0));
if(IsNight())
{
String nighttimeClockString = TextFormatting.GRAY + String.format("%02d", hours) + ":" + String.format("%02d", seconds);
return nighttimeClockString;
}
else
{
String daytimeClockString = TextFormatting.YELLOW + String.format("%02d", hours) + ":" + String.format("%02d", seconds);
return daytimeClockString;
}
}
return "";
}
public static boolean IsNight()
{
long time = (mc.theWorld.getWorldTime()) % 24000;
return time >= mobSpawningStartTime && time < mobSpawningStopTime;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public static String getDebugInfoRight()
{
ArrayList arraylist = Lists.newArrayList(new String[] {String.format("")});
String daBlockInfo = "";
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK && mc.objectMouseOver.getBlockPos() != null)
{
BlockPos blockpos = mc.objectMouseOver.getBlockPos();
IBlockState iblockstate = mc.theWorld.getBlockState(blockpos);
if (mc.theWorld.getWorldType() != WorldType.DEBUG_WORLD)
{
iblockstate = iblockstate.getBlock().getActualState(iblockstate, mc.theWorld, blockpos);
}
Entry entry;
String s;
//String datest = String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock()));
arraylist.add(String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock())));
for (Iterator iterator = iblockstate.getProperties().entrySet().iterator(); iterator.hasNext(); arraylist.add(((IProperty)entry.getKey()).getName() + ": " + s))
{
entry = (Entry)iterator.next();
s = ((Comparable)entry.getValue()).toString();
if (entry.getValue() == Boolean.TRUE)
{
s = TextFormatting.GREEN + s;
}
else if (entry.getValue() == Boolean.FALSE)
{
s = TextFormatting.RED + s;
}
}
List list = arraylist;
String s1 = "";//(String)list.get(0);
String s11 = (String)list.get(1);
String daBlockType = "";
String daBlockVar = "";
for (int i = 0; i < list.size(); ++i)
{
String s2 = (String)list.get(i);
if (!Strings.isNullOrEmpty(s2))
{
if(s2.contains("minecraft")){
daBlockType = s2.replace("minecraft:", "");
}
else if(s2.contains("variant")){
daBlockVar = s2.replace("variant:", "");
daBlockVar = daBlockVar.replace(" ", "");
}
//s1 = s1 + s2;
}
}
if(daBlockVar.equals(daBlockType)){
daBlockVar = "";
daBlockType = "mc: " + daBlockType;
}
else if(!daBlockVar.equals(daBlockType) && !daBlockVar.equals("")){
daBlockVar = "v: " + daBlockVar;
daBlockType = "mc: " + daBlockType;
}
else {
daBlockType = "mc: " + daBlockType;
}
daBlockInfo = daBlockType;
daBlockInfo = daBlockInfo + "?" + daBlockVar;
}
return daBlockInfo;
}
}
|
{
"content_hash": "f41ffdde3d6d55fa962c00f90420e109",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 226,
"avg_line_length": 40.84964200477327,
"alnum_prop": 0.6089039495209161,
"repo_name": "JoelGodOfwar/joelsimplecoords",
"id": "978b3529ca1a8bd882ac15611b8b1c99de436225",
"size": "17116",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "1.9/java/com/datacraftcoords/event/renderOverlayRight.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "64752"
}
],
"symlink_target": ""
}
|
package com.streakapi.crm.datatype;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"email",
"isOwner"
})
public class Owner {
@JsonProperty("email")
private String email;
@JsonProperty("isOwner")
private Boolean isOwner;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
/**
*
* @return
* The email
*/
@JsonProperty("email")
public String getEmail() {
return email;
}
/**
*
* @param email
* The email
*/
@JsonProperty("email")
public void setEmail(String email) {
this.email = email;
}
public Owner withEmail(String email) {
this.email = email;
return this;
}
/**
*
* @return
* The isOwner
*/
@JsonProperty("isOwner")
public Boolean getIsOwner() {
return isOwner;
}
/**
*
* @param isOwner
* The isOwner
*/
@JsonProperty("isOwner")
public void setIsOwner(Boolean isOwner) {
this.isOwner = isOwner;
}
public Owner withIsOwner(Boolean isOwner) {
this.isOwner = isOwner;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Owner withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Owner [");
if (email != null) {
builder.append("email=");
builder.append(email);
builder.append(", ");
}
if (isOwner != null) {
builder.append("isOwner=");
builder.append(isOwner);
builder.append(", ");
}
if (additionalProperties != null) {
builder.append("additionalProperties=");
builder.append(additionalProperties);
}
builder.append("]");
return builder.toString();
}
}
|
{
"content_hash": "cf74c252001acd83d3871d6f7cdb8462",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 85,
"avg_line_length": 23.316239316239315,
"alnum_prop": 0.6099706744868035,
"repo_name": "dingy007/JStreakAPI",
"id": "54bab40197fa9e27a52d0ba1c3800bf2f2c00315",
"size": "2728",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/streakapi/crm/datatype/Owner.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "149712"
}
],
"symlink_target": ""
}
|
package org.hawkular.alerts.api.model.action;
import java.io.Serializable;
import org.hawkular.alerts.api.model.event.Event;
import org.hawkular.alerts.api.model.event.Thin;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
/**
* An action is the abstract concept of a consequence of an event.
*
* An Action object represents a particular action linked with a specific event.
* Action objects are generated by the Alerts engine and processed by plugins.
* An Action object stores the eventId property and optionally may contain the full Event object.
* An Action may store the result of the processing by a plugin.
*
* @author Jay Shaughnessy
* @author Lucas Ponce
*/
public class Action extends ActionDefinition implements Serializable {
@JsonInclude
private String eventId;
@JsonInclude
private long ctime;
@Thin
@JsonInclude(Include.NON_NULL)
private Event event;
@JsonInclude(Include.NON_NULL)
private String result;
public Action() {
}
public Action(String tenantId, String actionPlugin, String actionId, Event event) {
super(tenantId, actionPlugin, actionId);
this.event = event;
if (event != null) {
this.eventId = event.getId();
}
this.ctime = System.currentTimeMillis();
}
public Event getEvent() {
return event;
}
public void setEvent(Event event) {
this.event = event;
}
public String getEventId() {
return eventId;
}
public void setEventId(String eventId) {
this.eventId = eventId;
}
public long getCtime() {
return ctime;
}
public void setCtime(long ctime) {
this.ctime = ctime;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
Action action = (Action) o;
if (ctime != action.ctime) return false;
if (eventId != null ? !eventId.equals(action.eventId) : action.eventId != null) return false;
if (event != null ? !event.equals(action.event) : action.event != null) return false;
return result != null ? result.equals(action.result) : action.result == null;
}
@Override
public int hashCode() {
int result1 = super.hashCode();
result1 = 31 * result1 + (eventId != null ? eventId.hashCode() : 0);
result1 = 31 * result1 + (int) (ctime ^ (ctime >>> 32));
result1 = 31 * result1 + (event != null ? event.hashCode() : 0);
result1 = 31 * result1 + (result != null ? result.hashCode() : 0);
return result1;
}
@Override
public String toString() {
return "Action" + '[' +
"eventId='" + eventId + '\'' +
", ctime=" + ctime +
", event=" + event +
", result='" + result + '\'' +
']';
}
}
|
{
"content_hash": "3521e11342b5eae1051a28e8046be537",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 101,
"avg_line_length": 27.42241379310345,
"alnum_prop": 0.6086136435083307,
"repo_name": "tsegismont/hawkular-alerts",
"id": "5a90b2a374179ff62ec9bd0ef4ebea546dcdcb68",
"size": "3863",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "hawkular-alerts-api/src/main/java/org/hawkular/alerts/api/model/action/Action.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "73552"
},
{
"name": "Groovy",
"bytes": "172090"
},
{
"name": "Java",
"bytes": "1644026"
},
{
"name": "Shell",
"bytes": "1593"
},
{
"name": "XSLT",
"bytes": "34109"
}
],
"symlink_target": ""
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "d9e29c1a628ae59ecb5d1d9f0c43f24d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "4d0d019dbeaf40621feea7c7657351790d546521",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Asparagaceae/Albuca/Albuca virens/ Syn. Ornithogalum otavense/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Verizon Wireless Cost Estimation</title>
<meta name="description" content="A few weeks ago, my 2-year contract came due for a phone upgrade. Seeing as how I was on an iPhone 4 and Apple’s recent OS upgrades have sucked the life cle...">
<link rel="stylesheet" href="/css/tufte.css">
<!-- Google Fonts loaded here depending on setting in _data/options.yml true loads font, blank does not-->
<link href='//fonts.googleapis.com/css?family=Lato:400,400italic' rel='stylesheet' type='text/css'>
<!-- Load up MathJax script if needed ... specify in /_data/options.yml file-->
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="canonical" href="http://www.thetrainingset.com/articles/15/Verizon-Wireless-Calculator">
<link rel="alternate" type="application/rss+xml" title="The Training Set" href="http://www.thetrainingset.com/feed.xml" />
</head>
<body>
<!--- Header and nav template site-wide -->
<header>
<nav class="group">
<!--<a href="/"><img class="badge" src="/assets/img/badge_1.png" alt="CH"></a>-->
<a href="/">The Training Set</a>
<a href="/my-elec-use/">My Electricity Use</a>
<a href="/tags/">Articles</a>
<a href="/the-work/">The Work</a>
<a href="/about/">About</a>
<a href="/subscribe/">Subscribe</a>
</nav>
</header>
<article class="group">
<h1>Verizon Wireless Cost Estimation</h1>
<p class="subtitle">May 21, 2015</p>
<p>A few weeks ago, my 2-year contract came due for a phone upgrade. Seeing as how I was on an iPhone 4 and Apple’s recent OS upgrades have sucked the life clean out of it, I was looking forward to purchasing a new phone with the hopes that the new one will last beyond the 2-year cycle. I was going to purchase an iPhone 6, and I knew (or so I thought) what it would cost up front if I were to sign on a new 2-year contract. Simple, straight-forward. No sales pitches necessary.</p>
<p>Then I entered the Verizon Wireless store.</p>
<p>Within a few moments of arrival and signing in, my name was called and I was paired with a sales rep. Whilst hovering over me, he quickly moved the conversation from the phone itself to something called the <a href="http://www.verizonwireless.com/support/verizon-edge-faqs/">Edge plan</a>. I hadn’t bothered looking at the Edge plan before coming to the store - from the marketing material it seemed that it was targeted at customers interested in upgrading their phone more rapidly than every two years. I do not count myself in that category, so I didn’t bother looking into it.</p>
<p>The salesman threw so many numbers at me that my head was spinning. He was claiming that I could get some accessory package essentially for free by switching to the Edge program. I couldn’t follow any of his logic, and I was only marginally clearer on the details when the manager attempted to explain the costs to me. I walked out of the store frustrated and not wanting to commit there and then.</p>
<p>I figure I can’t have been the only Verizon customer to have experienced this recently. In order to figure out what the actual costs were and whether I’d actually save money I made a quick calculator for my family and I to use. I’m sharing it here in case it helps others.</p>
<p>It’s pretty simple for now, and assumes you aren’t taking the bait and trying to upgrade your phone more frequently than two years. The white boxes are entry cells: select the phone you want, enter your typical monthly service costs, and enter the percent down payment on the phone you’d like to make if you’re considering the Edge program. The box to the right gives your estimated monthly bill (bold black text) and the total cost over two years for your options (in bold red text).</p>
<p>
<iframe src="https://docs.google.com/spreadsheets/d/1uHdFLi_sEbyXN573mBUnqQPJdWCfkjuve-smumsCrXE/pubhtml?widget=true&headers=false" width="90%" height="400"></iframe>
</p>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-58835878-1', 'auto');
ga('send', 'pageview');
</script>
</article>
<span class="print-footer">Verizon Wireless Cost Estimation - May 21, 2015 - Justin Elszasz</span>
<footer>
<hr class="slender">
<ul class="footer-links">
<li><a href="mailto:thetrainingset@gmail.com"><span class="icon-mail"></span></a></li>
<li>
<a href="//www.twitter.com/thetrainingset"><span class="icon-twitter"></span></a>
</li>
<li>
<a href="//github.com/jtelszasz"><span class="icon-github"></span></a>
</li>
<li>
<a href="/feed"><span class="icon-feed"></span></a>
</li>
<li>
<a href="//www.linkedin.com/in/justinelszasz"><span class="icon-feed"></span></a>
</li>
</ul>
<div class="credits">
<span>© 2016 JUSTIN ELSZASZ</span></br> <br>
<span>This site created with the <a href="//github.com/clayh53/tufte-jekyll">Tufte theme</a> in <a href="//jekyllrb.com">Jekyll</a>.</span>
</div>
</footer>
</body>
</html>
|
{
"content_hash": "4c899100932ef59c0d48734192501851",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 590,
"avg_line_length": 41.09929078014184,
"alnum_prop": 0.6686798964624676,
"repo_name": "jtelszasz/the-training-set",
"id": "821efd512a6cdc2f4bd18342335ee3954fd39aa4",
"size": "5819",
"binary": false,
"copies": "2",
"ref": "refs/heads/gh-pages",
"path": "articles/15/Verizon-Wireless-Calculator.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19048"
},
{
"name": "HTML",
"bytes": "469316"
}
],
"symlink_target": ""
}
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/base/directory_lister.h"
#include <algorithm>
#include <vector>
#include "base/file_util.h"
#include "base/i18n/file_util_icu.h"
#include "base/message_loop.h"
#include "base/platform_thread.h"
#include "net/base/net_errors.h"
namespace net {
static const int kFilesPerEvent = 8;
class DirectoryDataEvent : public Task {
public:
explicit DirectoryDataEvent(DirectoryLister* d) : lister(d), error(0) {
// Allocations of the FindInfo aren't super cheap, so reserve space.
data.reserve(64);
}
void Run() {
if (data.empty()) {
lister->OnDone(error);
return;
}
lister->OnReceivedData(&data[0], static_cast<int>(data.size()));
}
scoped_refptr<DirectoryLister> lister;
std::vector<file_util::FileEnumerator::FindInfo> data;
int error;
};
// Comparator for sorting FindInfo's. This uses the locale aware filename
// comparison function on the filenames for sorting in the user's locale.
static bool CompareFindInfo(const file_util::FileEnumerator::FindInfo& a,
const file_util::FileEnumerator::FindInfo& b) {
bool a_is_directory = file_util::FileEnumerator::IsDirectory(a);
bool b_is_directory = file_util::FileEnumerator::IsDirectory(b);
if (a_is_directory != b_is_directory)
return a_is_directory;
#if defined(OS_WIN)
return file_util::LocaleAwareCompareFilenames(FilePath(a.cFileName),
FilePath(b.cFileName));
#elif defined(OS_POSIX)
return file_util::LocaleAwareCompareFilenames(FilePath(a.filename),
FilePath(b.filename));
#endif
}
DirectoryLister::DirectoryLister(const FilePath& dir,
DirectoryListerDelegate* delegate)
: dir_(dir),
delegate_(delegate),
message_loop_(NULL),
thread_(kNullThreadHandle) {
DCHECK(!dir.value().empty());
}
DirectoryLister::~DirectoryLister() {
if (thread_) {
PlatformThread::Join(thread_);
}
}
bool DirectoryLister::Start() {
// spawn a thread to enumerate the specified directory
// pass events back to the current thread
message_loop_ = MessageLoop::current();
DCHECK(message_loop_) << "calling thread must have a message loop";
AddRef(); // the thread will release us when it is done
if (!PlatformThread::Create(0, this, &thread_)) {
Release();
return false;
}
return true;
}
void DirectoryLister::Cancel() {
canceled_.Set();
if (thread_) {
PlatformThread::Join(thread_);
thread_ = kNullThreadHandle;
}
}
void DirectoryLister::ThreadMain() {
DirectoryDataEvent* e = new DirectoryDataEvent(this);
if (!file_util::DirectoryExists(dir_)) {
e->error = net::ERR_FILE_NOT_FOUND;
message_loop_->PostTask(FROM_HERE, e);
Release();
return;
}
file_util::FileEnumerator file_enum(dir_, false,
static_cast<file_util::FileEnumerator::FILE_TYPE>(
file_util::FileEnumerator::FILES |
file_util::FileEnumerator::DIRECTORIES |
file_util::FileEnumerator::INCLUDE_DOT_DOT));
while (!canceled_.IsSet() && !(file_enum.Next().value().empty())) {
e->data.push_back(file_util::FileEnumerator::FindInfo());
file_enum.GetFindInfo(&e->data[e->data.size() - 1]);
/* TODO(brettw) bug 24107: It would be nice to send incremental updates.
We gather them all so they can be sorted, but eventually the sorting
should be done from JS to give more flexibility in the page. When we do
that, we can uncomment this to send incremental updates to the page.
if (++e->count == kFilesPerEvent) {
message_loop_->PostTask(FROM_HERE, e);
e = new DirectoryDataEvent(this);
}
*/
}
if (!e->data.empty()) {
// Sort the results. See the TODO above (this sort should be removed and we
// should do it from JS).
std::sort(e->data.begin(), e->data.end(), CompareFindInfo);
message_loop_->PostTask(FROM_HERE, e);
e = new DirectoryDataEvent(this);
}
// Notify done
Release();
message_loop_->PostTask(FROM_HERE, e);
}
void DirectoryLister::OnReceivedData(
const file_util::FileEnumerator::FindInfo* data, int count) {
// Since the delegate can clear itself during the OnListFile callback, we
// need to null check it during each iteration of the loop. Similarly, it is
// necessary to check the canceled_ flag to avoid sending data to a delegate
// who doesn't want anymore.
for (int i = 0; !canceled_.IsSet() && delegate_ && i < count; ++i)
delegate_->OnListFile(data[i]);
}
void DirectoryLister::OnDone(int error) {
// If canceled is set, we need to report some kind of error,
// but don't overwrite the error condition if it is already set.
if (!error && canceled_.IsSet())
error = net::ERR_ABORTED;
if (delegate_)
delegate_->OnListDone(error);
}
} // namespace net
|
{
"content_hash": "c97703b75ce5d3860023cf528e4333ec",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 79,
"avg_line_length": 30.6890243902439,
"alnum_prop": 0.6626266640174846,
"repo_name": "rwatson/chromium-capsicum",
"id": "ef3130bce29cc5fa9e9ba0caa57528e1e3dd39e8",
"size": "5033",
"binary": false,
"copies": "1",
"ref": "refs/heads/chromium-capsicum",
"path": "net/base/directory_lister.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
<header class="navbar navbar-inverse navbar-static-top" id="top" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".select2-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="./" class="navbar-brand">Select2</a>
</div>
<nav class="collapse navbar-collapse select2-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li{% if page.slug == "home" %} class="active"{% endif %}>
<a href="./">Home</a>
</li>
<li{% if page.slug == "examples" %} class="active"{% endif %}>
<a href="./examples.html">Examples</a>
</li>
<li{% if page.slug == "options" %} class="active"{% endif %}>
<a href="./options.html">Options</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Topics
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="https://github.com/select2/select2/releases">
Release notes
</a>
</li>
<li{% if page.slug == "announcements-4.0" %} class="active"{% endif %}>
<a href="./announcements-4.0.html">4.0 Announcement</a>
</li>
</ul>
</li>
<li{% if page.slug == "community" %} class="active"{% endif %}>
<a href="./community.html">Community</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/select2/select2">
<i class="fa fa-github"></i>
GitHub
</a>
</li>
</ul>
</nav>
</div>
</header>
|
{
"content_hash": "3b5d3fcda223a5b871bdc72fedeabd2c",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 122,
"avg_line_length": 30.90909090909091,
"alnum_prop": 0.5852941176470589,
"repo_name": "umeku/KunstmaanBundlesCMS",
"id": "bf8f4ab8882bd344e233b16b3c261972055e7303",
"size": "1700",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Kunstmaan/AdminBundle/Resources/ui/vendor_bower/select2/docs/_includes/navigation.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "538052"
},
{
"name": "Cucumber",
"bytes": "21766"
},
{
"name": "HTML",
"bytes": "257121"
},
{
"name": "JavaScript",
"bytes": "3383624"
},
{
"name": "PHP",
"bytes": "2554207"
},
{
"name": "PowerShell",
"bytes": "161"
},
{
"name": "Ruby",
"bytes": "76"
},
{
"name": "Shell",
"bytes": "4144"
}
],
"symlink_target": ""
}
|
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class EmployeeDocument extends Model
{
protected $table='employee-document';
public $timestamps=false;
}
|
{
"content_hash": "5f26004c209a83fb37f8bb8fc1f69e86",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 41,
"avg_line_length": 16.09090909090909,
"alnum_prop": 0.751412429378531,
"repo_name": "SovietBerkut/ADM",
"id": "e72b6079f341120867cc04e2d56fa9fbdca67174",
"size": "177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/EmployeeDocument.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "943"
},
{
"name": "CSS",
"bytes": "23738"
},
{
"name": "HTML",
"bytes": "639744"
},
{
"name": "JavaScript",
"bytes": "14169180"
},
{
"name": "PHP",
"bytes": "714811"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
using NUnit.Compatibility;
using NUnit.Framework.Interfaces;
using NUnit.Framework.Internal;
using NUnit.Framework.Internal.Execution;
using NUnit.Tests;
using NUnit.Tests.Assemblies;
using NUnit.TestUtilities;
using NUnit.Framework.Internal.Filters;
namespace NUnit.Framework.Api
{
// Functional tests of the TestAssemblyRunner and all subordinate classes
public class TestAssemblyRunnerTests : ITestListener
{
private const string MOCK_ASSEMBLY_FILE = "mock-assembly.dll";
#if NETCOREAPP1_1
private const string COULD_NOT_LOAD_MSG = "The system cannot find the file specified.";
#else
private const string COULD_NOT_LOAD_MSG = "Could not load";
#endif
private const string BAD_FILE = "mock-assembly.pdb";
private const string SLOW_TESTS_FILE = "slow-nunit-tests.dll";
private const string MISSING_FILE = "junk.dll";
private static readonly string MOCK_ASSEMBLY_NAME = typeof(MockAssembly).GetTypeInfo().Assembly.FullName;
private const string INVALID_FILTER_ELEMENT_MESSAGE = "Invalid filter element: {0}";
private static readonly IDictionary<string, object> EMPTY_SETTINGS = new Dictionary<string, object>();
private ITestAssemblyRunner _runner;
private int _testStartedCount;
private int _testFinishedCount;
private int _testOutputCount;
private int _successCount;
private int _failCount;
private int _skipCount;
private int _inconclusiveCount;
[SetUp]
public void CreateRunner()
{
_runner = new NUnitTestAssemblyRunner(new DefaultTestAssemblyBuilder());
_testStartedCount = 0;
_testFinishedCount = 0;
_testOutputCount = 0;
_successCount = 0;
_failCount = 0;
_skipCount = 0;
_inconclusiveCount = 0;
}
#region Load
[Test]
public void Load_GoodFile_ReturnsRunnableSuite()
{
var result = LoadMockAssembly();
Assert.That(result.IsSuite);
Assert.That(result, Is.TypeOf<TestAssembly>());
Assert.That(result.Name, Is.EqualTo(MOCK_ASSEMBLY_FILE));
Assert.That(result.RunState, Is.EqualTo(Interfaces.RunState.Runnable));
Assert.That(result.TestCaseCount, Is.EqualTo(MockAssembly.Tests));
}
[Test, SetUICulture("en-US")]
public void Load_FileNotFound_ReturnsNonRunnableSuite()
{
var result = _runner.Load(MISSING_FILE, EMPTY_SETTINGS);
Assert.That(result.IsSuite);
Assert.That(result, Is.TypeOf<TestAssembly>());
Assert.That(result.Name, Is.EqualTo(MISSING_FILE));
Assert.That(result.RunState, Is.EqualTo(Interfaces.RunState.NotRunnable));
Assert.That(result.TestCaseCount, Is.EqualTo(0));
Assert.That(result.Properties.Get(PropertyNames.SkipReason),
Does.StartWith(COULD_NOT_LOAD_MSG));
}
[Test, SetUICulture("en-US")]
public void Load_BadFile_ReturnsNonRunnableSuite()
{
var result = _runner.Load(BAD_FILE, EMPTY_SETTINGS);
Assert.That(result.IsSuite);
Assert.That(result, Is.TypeOf<TestAssembly>());
Assert.That(result.Name, Is.EqualTo(BAD_FILE));
Assert.That(result.RunState, Is.EqualTo(Interfaces.RunState.NotRunnable));
Assert.That(result.TestCaseCount, Is.EqualTo(0));
Assert.That(result.Properties.Get(PropertyNames.SkipReason),
Does.StartWith("Could not load").And.Contains(BAD_FILE));
}
#endregion
#region CountTestCases
[Test]
public void CountTestCases_AfterLoad_ReturnsCorrectCount()
{
LoadMockAssembly();
Assert.That(_runner.CountTestCases(TestFilter.Empty), Is.EqualTo(MockAssembly.Tests));
}
[Test]
public void CountTestCases_WithoutLoad_ThrowsInvalidOperation()
{
var ex = Assert.Throws<InvalidOperationException>(
() => _runner.CountTestCases(TestFilter.Empty));
Assert.That(ex.Message, Is.EqualTo("The CountTestCases method was called but no test has been loaded"));
}
[Test]
public void CountTestCases_FileNotFound_ReturnsZero()
{
_runner.Load(MISSING_FILE, EMPTY_SETTINGS);
Assert.That(_runner.CountTestCases(TestFilter.Empty), Is.EqualTo(0));
}
[Test]
public void CountTestCases_BadFile_ReturnsZero()
{
_runner.Load(BAD_FILE, EMPTY_SETTINGS);
Assert.That(_runner.CountTestCases(TestFilter.Empty), Is.EqualTo(0));
}
#endregion
#region ExploreTests
[Test]
public void ExploreTests_WithoutLoad_ThrowsInvalidOperation()
{
var ex = Assert.Throws<InvalidOperationException>(
() => _runner.ExploreTests(TestFilter.Empty));
Assert.That(ex.Message, Is.EqualTo("The ExploreTests method was called but no test has been loaded"));
}
[Test]
public void ExploreTests_FileNotFound_ReturnsZeroTests()
{
_runner.Load(MISSING_FILE, EMPTY_SETTINGS);
var explorer = _runner.ExploreTests(TestFilter.Empty);
Assert.That(explorer.TestCaseCount, Is.EqualTo(0));
}
[Test]
public void ExploreTests_BadFile_ReturnsZeroTests()
{
_runner.Load(BAD_FILE, EMPTY_SETTINGS);
var explorer = _runner.ExploreTests(TestFilter.Empty);
Assert.That(explorer.TestCaseCount, Is.EqualTo(0));
}
[Test]
public void ExploreTests_AfterLoad_ReturnsCorrectCount()
{
LoadMockAssembly();
var explorer = _runner.ExploreTests(TestFilter.Empty);
Assert.That(explorer.TestCaseCount, Is.EqualTo(MockAssembly.Tests));
}
[Test]
public void ExploreTest_AfterLoad_ReturnsSameTestCount()
{
LoadMockAssembly();
var explorer = _runner.ExploreTests(TestFilter.Empty);
Assert.That(explorer.TestCaseCount, Is.EqualTo(_runner.CountTestCases(TestFilter.Empty)));
}
[Test]
public void ExploreTests_AfterLoad_WithFilter_ReturnCorrectCount()
{
LoadMockAssembly();
ITestFilter filter = new CategoryFilter("FixtureCategory");
var explorer = _runner.ExploreTests(filter);
Assert.That(explorer.TestCaseCount, Is.EqualTo(MockTestFixture.Tests));
}
[Test]
public void ExploreTests_AfterLoad_WithFilter_ReturnSameTestCount()
{
LoadMockAssembly();
ITestFilter filter = new CategoryFilter("FixtureCategory");
var explorer = _runner.ExploreTests(filter);
Assert.That(explorer.TestCaseCount, Is.EqualTo(_runner.CountTestCases(filter)));
}
#endregion
#region Run
[Test]
public void Run_AfterLoad_ReturnsRunnableSuite()
{
LoadMockAssembly();
var result = _runner.Run(TestListener.NULL, TestFilter.Empty);
Assert.That(result.Test.IsSuite);
Assert.That(result.Test, Is.TypeOf<TestAssembly>());
Assert.That(result.Test.RunState, Is.EqualTo(RunState.Runnable));
Assert.That(result.Test.TestCaseCount, Is.EqualTo(MockAssembly.Tests));
Assert.That(result.ResultState, Is.EqualTo(ResultState.ChildFailure));
Assert.That(result.PassCount, Is.EqualTo(MockAssembly.Passed));
Assert.That(result.FailCount, Is.EqualTo(MockAssembly.Failed));
Assert.That(result.WarningCount, Is.EqualTo(MockAssembly.Warnings));
Assert.That(result.SkipCount, Is.EqualTo(MockAssembly.Skipped));
Assert.That(result.InconclusiveCount, Is.EqualTo(MockAssembly.Inconclusive));
}
[Test]
public void Run_AfterLoad_SendsExpectedEvents()
{
LoadMockAssembly();
_runner.Run(this, TestFilter.Empty);
Assert.That(_testStartedCount, Is.EqualTo(MockAssembly.TestStartedEvents));
Assert.That(_testFinishedCount, Is.EqualTo(MockAssembly.TestFinishedEvents));
Assert.That(_testOutputCount, Is.EqualTo(MockAssembly.TestOutputEvents));
Assert.That(_successCount, Is.EqualTo(MockAssembly.Passed));
Assert.That(_failCount, Is.EqualTo(MockAssembly.Failed));
Assert.That(_skipCount, Is.EqualTo(MockAssembly.Skipped));
Assert.That(_inconclusiveCount, Is.EqualTo(MockAssembly.Inconclusive));
}
[Test]
public void Run_WithoutLoad_ReturnsError()
{
var ex = Assert.Throws<InvalidOperationException>(
() => _runner.Run(TestListener.NULL, TestFilter.Empty));
Assert.That(ex.Message, Is.EqualTo("The Run method was called but no test has been loaded"));
}
[Test, SetUICulture("en-US")]
public void Run_FileNotFound_ReturnsNonRunnableSuite()
{
_runner.Load(MISSING_FILE, EMPTY_SETTINGS);
var result = _runner.Run(TestListener.NULL, TestFilter.Empty);
Assert.That(result.Test.IsSuite);
Assert.That(result.Test, Is.TypeOf<TestAssembly>());
Assert.That(result.Test.RunState, Is.EqualTo(RunState.NotRunnable));
Assert.That(result.Test.TestCaseCount, Is.EqualTo(0));
Assert.That(result.ResultState, Is.EqualTo(ResultState.NotRunnable.WithSite(FailureSite.SetUp)));
Assert.That(result.Message,
Does.StartWith(COULD_NOT_LOAD_MSG));
}
[Test]
public void RunTestsAction_WithInvalidFilterElement_ThrowsArgumentException()
{
LoadMockAssembly();
var ex = Assert.Throws<ArgumentException>(() =>
{
TestFilter.FromXml("<filter><invalidElement>foo</invalidElement></filter>");
});
Assert.That(ex.Message, Does.StartWith(string.Format(INVALID_FILTER_ELEMENT_MESSAGE, "invalidElement")));
}
[Test]
public void Run_WithParameters()
{
var dict = new Dictionary<string, string>();
dict.Add("X", "5");
dict.Add("Y", "7");
var settings = new Dictionary<string, object>();
settings.Add("TestParametersDictionary", dict);
LoadMockAssembly(settings);
var result = _runner.Run(TestListener.NULL, TestFilter.Empty);
CheckParameterOutput(result);
}
[Test]
public void Run_WithLegacyParameters()
{
var settings = new Dictionary<string, object>();
settings.Add("TestParameters", "X=5;Y=7");
LoadMockAssembly(settings);
var result = _runner.Run(TestListener.NULL, TestFilter.Empty);
CheckParameterOutput(result);
}
[Test, SetUICulture("en-US")]
public void Run_BadFile_ReturnsNonRunnableSuite()
{
_runner.Load(BAD_FILE, EMPTY_SETTINGS);
var result = _runner.Run(TestListener.NULL, TestFilter.Empty);
Assert.That(result.Test.IsSuite);
Assert.That(result.Test, Is.TypeOf<TestAssembly>());
Assert.That(result.Test.RunState, Is.EqualTo(RunState.NotRunnable));
Assert.That(result.Test.TestCaseCount, Is.EqualTo(0));
Assert.That(result.ResultState, Is.EqualTo(ResultState.NotRunnable.WithSite(FailureSite.SetUp)));
Assert.That(result.Message,
Does.StartWith("Could not load"));
}
#endregion
#region RunAsync
[Test]
public void RunAsync_AfterLoad_ReturnsRunnableSuite()
{
LoadMockAssembly();
_runner.RunAsync(TestListener.NULL, TestFilter.Empty);
_runner.WaitForCompletion(Timeout.Infinite);
Assert.NotNull(_runner.Result, "No result returned");
Assert.That(_runner.Result.Test.IsSuite);
Assert.That(_runner.Result.Test, Is.TypeOf<TestAssembly>());
Assert.That(_runner.Result.Test.RunState, Is.EqualTo(RunState.Runnable));
Assert.That(_runner.Result.Test.TestCaseCount, Is.EqualTo(MockAssembly.Tests));
Assert.That(_runner.Result.ResultState, Is.EqualTo(ResultState.ChildFailure));
Assert.That(_runner.Result.PassCount, Is.EqualTo(MockAssembly.Passed));
Assert.That(_runner.Result.FailCount, Is.EqualTo(MockAssembly.Failed));
Assert.That(_runner.Result.SkipCount, Is.EqualTo(MockAssembly.Skipped));
Assert.That(_runner.Result.InconclusiveCount, Is.EqualTo(MockAssembly.Inconclusive));
}
[Test]
public void RunAsync_AfterLoad_SendsExpectedEvents()
{
LoadMockAssembly();
_runner.RunAsync(this, TestFilter.Empty);
_runner.WaitForCompletion(Timeout.Infinite);
Assert.That(_testStartedCount, Is.EqualTo(MockAssembly.Tests - IgnoredFixture.Tests - BadFixture.Tests - ExplicitFixture.Tests));
Assert.That(_testFinishedCount, Is.EqualTo(MockAssembly.Tests));
Assert.That(_successCount, Is.EqualTo(MockAssembly.Passed));
Assert.That(_failCount, Is.EqualTo(MockAssembly.Failed));
Assert.That(_skipCount, Is.EqualTo(MockAssembly.Skipped));
Assert.That(_inconclusiveCount, Is.EqualTo(MockAssembly.Inconclusive));
}
[Test]
public void RunAsync_WithoutLoad_ReturnsError()
{
var ex = Assert.Throws<InvalidOperationException>(
() => _runner.RunAsync(TestListener.NULL, TestFilter.Empty));
Assert.That(ex.Message, Is.EqualTo("The Run method was called but no test has been loaded"));
}
[Test, SetUICulture("en-US")]
public void RunAsync_FileNotFound_ReturnsNonRunnableSuite()
{
_runner.Load(MISSING_FILE, EMPTY_SETTINGS);
_runner.RunAsync(TestListener.NULL, TestFilter.Empty);
_runner.WaitForCompletion(Timeout.Infinite);
Assert.NotNull(_runner.Result, "No result returned");
Assert.That(_runner.Result.Test.IsSuite);
Assert.That(_runner.Result.Test, Is.TypeOf<TestAssembly>());
Assert.That(_runner.Result.Test.RunState, Is.EqualTo(RunState.NotRunnable));
Assert.That(_runner.Result.Test.TestCaseCount, Is.EqualTo(0));
Assert.That(_runner.Result.ResultState, Is.EqualTo(ResultState.NotRunnable.WithSite(FailureSite.SetUp)));
Assert.That(_runner.Result.Message,
Does.StartWith(COULD_NOT_LOAD_MSG));
}
[Test, SetUICulture("en-US")]
public void RunAsync_BadFile_ReturnsNonRunnableSuite()
{
_runner.Load(BAD_FILE, EMPTY_SETTINGS);
_runner.RunAsync(TestListener.NULL, TestFilter.Empty);
_runner.WaitForCompletion(Timeout.Infinite);
Assert.NotNull(_runner.Result, "No result returned");
Assert.That(_runner.Result.Test.IsSuite);
Assert.That(_runner.Result.Test, Is.TypeOf<TestAssembly>());
Assert.That(_runner.Result.Test.RunState, Is.EqualTo(RunState.NotRunnable));
Assert.That(_runner.Result.Test.TestCaseCount, Is.EqualTo(0));
Assert.That(_runner.Result.ResultState, Is.EqualTo(ResultState.NotRunnable.WithSite(FailureSite.SetUp)));
Assert.That(_runner.Result.Message,
Does.StartWith("Could not load"));
}
#endregion
#region StopRun
[Test]
public void StopRun_WhenNoTestIsRunning_Succeeds()
{
_runner.StopRun(false);
}
[Test]
public void StopRun_WhenTestIsRunning_StopsTest()
{
var tests = LoadSlowTests();
var count = tests.TestCaseCount;
_runner.RunAsync(TestListener.NULL, TestFilter.Empty);
_runner.StopRun(false);
_runner.WaitForCompletion(Timeout.Infinite);
Assert.True(_runner.IsTestComplete, "Test is not complete");
if (_runner.Result.ResultState != ResultState.Success) // Test may have finished before we stopped it
{
Assert.That(_runner.Result.ResultState, Is.EqualTo(ResultState.Cancelled));
Assert.That(_runner.Result.PassCount, Is.LessThan(count));
}
}
#endregion
#region Cancel Run
[Test]
public void CancelRun_WhenNoTestIsRunning_Succeeds()
{
_runner.StopRun(true);
}
[Test]
public void CancelRun_WhenTestIsRunning_StopsTest()
{
var tests = LoadSlowTests();
var count = tests.TestCaseCount;
_runner.RunAsync(TestListener.NULL, TestFilter.Empty);
_runner.StopRun(true);
// When cancelling, the completion event may not be signalled,
// so we only wait a short time before checking.
_runner.WaitForCompletion(Timeout.Infinite);
Assert.True(_runner.IsTestComplete, "Test is not complete");
if (_runner.Result.ResultState != ResultState.Success)
{
Assert.That(_runner.Result.ResultState, Is.EqualTo(ResultState.Cancelled));
Assert.That(_runner.Result.PassCount, Is.LessThan(count));
}
}
#endregion
#region ITestListener Implementation
void ITestListener.TestStarted(ITest test)
{
if (!test.IsSuite)
_testStartedCount++;
}
void ITestListener.TestFinished(ITestResult result)
{
if (!result.Test.IsSuite)
{
_testFinishedCount++;
switch (result.ResultState.Status)
{
case TestStatus.Passed:
_successCount++;
break;
case TestStatus.Failed:
_failCount++;
break;
case TestStatus.Skipped:
_skipCount++;
break;
case TestStatus.Inconclusive:
_inconclusiveCount++;
break;
}
}
}
/// <summary>
/// Called when a test produces output for immediate display
/// </summary>
/// <param name="output">A TestOutput object containing the text to display</param>
public void TestOutput(TestOutput output)
{
_testOutputCount++;
}
#endregion
#region Helper Methods
private ITest LoadMockAssembly()
{
return LoadMockAssembly(EMPTY_SETTINGS);
}
private ITest LoadMockAssembly(IDictionary<string, object> settings)
{
return _runner.Load(
Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY_FILE),
settings);
}
private ITest LoadSlowTests()
{
return _runner.Load(Path.Combine(TestContext.CurrentContext.TestDirectory, SLOW_TESTS_FILE), EMPTY_SETTINGS);
}
private void CheckParameterOutput(ITestResult result)
{
var childResult = TestFinder.Find(
"DisplayRunParameters", result, true);
Assert.That(childResult.Output, Is.EqualTo(
"Parameter X = 5" + Environment.NewLine +
"Parameter Y = 7" + Environment.NewLine));
}
#endregion
}
}
|
{
"content_hash": "10cddcc20c038479fad282bdea5f7955",
"timestamp": "",
"source": "github",
"line_count": 526,
"max_line_length": 141,
"avg_line_length": 37.89923954372624,
"alnum_prop": 0.6130423877602207,
"repo_name": "NikolayPianikov/nunit",
"id": "6252058933491f7f222f7ca8af538296d937ed97",
"size": "21212",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/NUnitFramework/tests/Api/TestAssemblyRunnerTests.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "48"
},
{
"name": "C#",
"bytes": "4603410"
},
{
"name": "PowerShell",
"bytes": "8019"
},
{
"name": "Shell",
"bytes": "3249"
},
{
"name": "Visual Basic",
"bytes": "1689"
}
],
"symlink_target": ""
}
|
set -e
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
# for now, be conservative about what version of protoc we expect
if ! [[ $(protoc --version) =~ "3.0.0" ]]; then
echo "could not find protoc 3.0.0, is it installed + in PATH?"
exit 255
fi
# directories containing protos to be built
DIRS="./wal/walpb ./etcdserver/etcdserverpb ./snap/snappb ./raft/raftpb ./storage/storagepb ./lease/leasepb ./auth/authpb"
# exact version of protoc-gen-gogo to build
SHA="c57e439bad574c2e0877ff18d514badcfced004d"
# set up self-contained GOPATH for building
export GOPATH=${PWD}/gopath
export GOBIN=${PWD}/bin
export PATH="${GOBIN}:${PATH}"
COREOS_ROOT="${GOPATH}/src/github.com/coreos"
ETCD_ROOT="${COREOS_ROOT}/etcd"
GOGOPROTO_ROOT="${GOPATH}/src/github.com/gogo/protobuf"
GOGOPROTO_PATH="${GOGOPROTO_ROOT}:${GOGOPROTO_ROOT}/protobuf"
rm -f "${ETCD_ROOT}"
mkdir -p "${COREOS_ROOT}"
ln -s "${PWD}" "${ETCD_ROOT}"
# Ensure we have the right version of protoc-gen-gogo by building it every time.
# TODO(jonboulle): vendor this instead of `go get`ting it.
go get github.com/gogo/protobuf/{proto,protoc-gen-gogo,gogoproto}
go get golang.org/x/tools/cmd/goimports
pushd "${GOGOPROTO_ROOT}"
git reset --hard "${SHA}"
make install
popd
for dir in ${DIRS}; do
pushd ${dir}
protoc --gogofast_out=plugins=grpc,import_prefix=github.com/coreos/:. -I=.:"${GOGOPROTO_PATH}":"${COREOS_ROOT}" *.proto
sed -i.bak -E "s/github\.com\/coreos\/(gogoproto|github\.com|golang\.org|google\.golang\.org)/\1/g" *.pb.go
sed -i.bak -E 's/github\.com\/coreos\/(errors|fmt|io)/\1/g' *.pb.go
sed -i.bak -E 's/import _ \"gogoproto\"//g' *.pb.go
sed -i.bak -E 's/import fmt \"fmt\"//g' *.pb.go
rm -f *.bak
goimports -w *.pb.go
popd
done
# install protodoc
# go get -v -u github.com/coreos/protodoc
#
# by default, do not run this option.
# only run when './scripts/genproto.sh -g'
#
if [ "$1" = "-g" ]; then
echo "protodoc is auto-generating grpc API reference documentation..."
go get -v -u github.com/coreos/protodoc
SHA_PROTODOC="4cd8db83c5595ac514169fda607d1ccb5eef669b"
PROTODOC_PATH="${GOPATH}/src/github.com/coreos/protodoc"
pushd "${PROTODOC_PATH}"
git reset --hard "${SHA_PROTODOC}"
go install
echo "protodoc is updated"
popd
protodoc --directories="etcdserver/etcdserverpb=service_message,storage/storagepb=service_message,lease/leasepb=service_message,auth/authpb=service_message" \
--title="etcd API Reference" \
--output="Documentation/dev-guide/api_reference_v3.md" \
--message-only-from-this-file="etcdserver/etcdserverpb/rpc.proto"
echo "protodoc is finished..."
else
echo "skipping grpc API reference document auto-generation..."
fi
|
{
"content_hash": "d184026836fc6414db7d8dc98cba410b",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 159,
"avg_line_length": 33.09756097560975,
"alnum_prop": 0.7056005895357406,
"repo_name": "qinguanri/iconf",
"id": "5f56d90f45b15bdff4c4a5f6911e94d095fb35f4",
"size": "2805",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "deps/etcd/scripts/genproto.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "29"
},
{
"name": "PHP",
"bytes": "1"
},
{
"name": "Shell",
"bytes": "17"
}
],
"symlink_target": ""
}
|
package com.gmail.mararok.BUTJ.Test;
import java.lang.reflect.Method;
import com.gmail.mararok.BUTJ.IGNORE;
import com.gmail.mararok.BUTJ.TEST;
import com.gmail.mararok.BUTJ.TestCase;
import com.gmail.mararok.BUTJ.Results.CaseResultsImpl;
import com.gmail.mararok.BUTJ.Results.Results;
public class TestCaseImpl extends TestElementContainer {
private CaseResultsImpl results;
private TestCase testCase;
public TestCaseImpl(TestCase testCase) {
super(testCase.getName());
results = new CaseResultsImpl(this);
this.testCase = testCase;
}
public void run() {
loadTests();
results.onStart();
for (TestElementImpl test: getList()) {
testCase.beforeEach();
test.run();
testCase.afterEach();
}
results.onEnd();
}
private void loadTests() {
Class<?> caseClass = testCase.getClass();
Method[] methods = caseClass.getMethods();
for (Method method : methods) {
if (isTest(method)) {
add(new TestEnviromentImpl(testCase,method));
results.addTests(1);
}
}
}
private boolean isTest(Method method) {
if (method.getAnnotation(TEST.class) != null && method.getAnnotation(IGNORE.class) == null) {
return true;
}
return false;
}
@Override
public Results getResults() {
return results;
}
}
|
{
"content_hash": "fab36931d330c6ae07b7568d8f7cb877",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 95,
"avg_line_length": 21.896551724137932,
"alnum_prop": 0.7062992125984252,
"repo_name": "Mararok/BUTJ",
"id": "d1594989a773bb39997bd3b664e19e9ef7878d77",
"size": "1354",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/gmail/mararok/BUTJ/Test/TestCaseImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "45040"
}
],
"symlink_target": ""
}
|
require 'one_gadget/gadget'
# https://gitlab.com/david942j/libcdb/blob/master/libc/libc0.1-i686-2.19-11/lib/i386-kfreebsd-gnu/i686/cmov/libc-2.19.so
#
# Intel 80386
#
# GNU C Library (Debian GLIBC 2.19-11) stable release version 2.19, by Roland McGrath et al.
# Copyright (C) 2014 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Compiled by GNU CC version 4.8.3.
# Available extensions:
# crypt add-on version 2.1 by Michael Glad and others
# Native POSIX Threads Library by Ulrich Drepper et al
# GNU Libidn by Simon Josefsson
# BIND-8.2.3-T5B
# libc ABIs: UNIQUE
# For bug reporting instructions, please see:
# <http://www.debian.org/Bugs/>.
build_id = File.basename(__FILE__, '.rb').split('-').last
OneGadget::Gadget.add(build_id, 248583,
constraints: ["ebx is the GOT address of libc", "[esp+0x38] == NULL"],
effect: "execve(\"/bin/sh\", esp+0x38, environ)")
OneGadget::Gadget.add(build_id, 248619,
constraints: ["ebx is the GOT address of libc", "[eax] == NULL || eax == NULL", "[[esp+0x8]] == NULL || [esp+0x8] == NULL"],
effect: "execve(\"/bin/sh\", eax, [esp+0x8])")
OneGadget::Gadget.add(build_id, 248623,
constraints: ["ebx is the GOT address of libc", "[[esp+0x4]] == NULL || [esp+0x4] == NULL", "[[esp+0x8]] == NULL || [esp+0x8] == NULL"],
effect: "execve(\"/bin/sh\", [esp+0x4], [esp+0x8])")
OneGadget::Gadget.add(build_id, 408532,
constraints: ["ebx is the GOT address of libc", "[esp+0x8] == NULL"],
effect: "execl(\"/bin/sh\", \"sh\", [esp+0x8])")
OneGadget::Gadget.add(build_id, 408538,
constraints: ["ebx is the GOT address of libc", "eax == NULL"],
effect: "execl(\"/bin/sh\", eax)")
OneGadget::Gadget.add(build_id, 408542,
constraints: ["ebx is the GOT address of libc", "[esp+0x4] == NULL"],
effect: "execl(\"/bin/sh\", [esp+0x4])")
|
{
"content_hash": "82eae1afa47d0904139ca092f8f349b2",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 158,
"avg_line_length": 54.175,
"alnum_prop": 0.5916012921089063,
"repo_name": "david942j/one_gadget",
"id": "df0112b97f0412c85964fb1674b59016aaced4ff",
"size": "2167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/one_gadget/builds/libc-2.19-5455f3eafe22e7a085c3568bebc324a2ade811ea.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "2177111"
}
],
"symlink_target": ""
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "e91482601a9ef777f67a933b01d1e4fb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "3efda640ea4f80f8cea76d43d333f65af842bae6",
"size": "225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Hieracium/Hieracium cruentiferum/Hieracium umbellatum/ Syn. Hieracium laevigatum cruentiferum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
@font-face {
font-family: 'Effra';
src: url('/ui/fonts/effra/effra-regular-webfont.eot');
src: url('/ui/fonts/effra/effra-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('/ui/fonts/effra/effra-regular-webfont.woff') format('woff'),
url('/ui/fonts/effra/effra-regular-webfont.ttf') format('truetype'),
url('/ui/fonts/effra/effra-regular-webfont.svg#effra-regular.) format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Effra';
src: url('/ui/fonts/effra/effra-medium-webfont.eot');
src: url('/ui/fonts/effra/effra-medium-webfont.eot?#iefix') format('embedded-opentype'),
url('/ui/fonts/effra/effra-medium-webfont.woff') format('woff'),
url('/ui/fonts/effra/effra-medium-webfont.ttf') format('truetype'),
url('/ui/fonts/effra/effra-medium-webfont.svg#effra-medium.) format('svg');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Effra';
src: url('/ui/fonts/effra/effra-light-webfont.eot');
src: url('/ui/fonts/effra/effra-light-webfont.eot?#iefix') format('embedded-opentype'),
url('/ui/fonts/effra/effra-light-webfont.woff') format('woff'),
url('/ui/fonts/effra/effra-light-webfont.ttf') format('truetype'),
url('/ui/fonts/effra/effra-light-webfont.svg#effra-medium.) format('svg');
font-weight: 100;
font-style: normal;
}
|
{
"content_hash": "e66afdca6a50754d256c85b2bab5ba0d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 93,
"avg_line_length": 44.625,
"alnum_prop": 0.6519607843137255,
"repo_name": "chrisopedia/chrisopedia.com",
"id": "7d02d86df235d9e0ec6f535118e7b54719a559a2",
"size": "2069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ui/stylesheets/fonts/effra.css",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "419873"
},
{
"name": "JavaScript",
"bytes": "696572"
},
{
"name": "PHP",
"bytes": "1891613"
},
{
"name": "Perl",
"bytes": "35"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.Loader;
namespace Runic.Agent.Core.Services
{
public class AssemblyService
{
//TODO: find a way to utilise the cache across consumers in akka
private readonly Dictionary<string, Assembly> _assemblyCache;
public AssemblyService()
{
_assemblyCache = new Dictionary<string, Assembly>();
}
private void LoadAssembly(string pluginAssemblyPath)
{
if (_assemblyCache.ContainsKey(pluginAssemblyPath))
return;
if (!File.Exists(pluginAssemblyPath))
{
throw new ArgumentException($"Could not find file {pluginAssemblyPath}");
}
Assembly assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(pluginAssemblyPath);
_assemblyCache[pluginAssemblyPath] = assembly ?? throw new ArgumentException($"Could not load assembly {pluginAssemblyPath}");
}
public virtual Assembly GetLoadAssembly(string pluginAssemblyPath)
{
LoadAssembly(pluginAssemblyPath);
if (_assemblyCache.TryGetValue(pluginAssemblyPath, out Assembly val))
{
return val;
}
throw new ArgumentException($"Unable to locate assembly by key {pluginAssemblyPath}");
}
}
}
|
{
"content_hash": "3d5f89735ffdfcf947abbf2e25a69247",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 138,
"avg_line_length": 33.651162790697676,
"alnum_prop": 0.630960608154803,
"repo_name": "joshuagenders/Runic",
"id": "2951562973f4506b113138f6b580099df8c8519c",
"size": "1449",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Agent/src/Runic.Agent.Core/Services/AssemblyService.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "74357"
}
],
"symlink_target": ""
}
|
function opciones() {
var scroll = Ti.UI.createScrollView({
top:1,
width:"95%",
height:"100%",
scrollType:'vertical'
});
var self = Ti.UI.createWindow({
backgroundImage:"/assets/fondo2.png",
zIndex:1,
fullscreen:false,
orientationModes: [Ti.UI.PORTRAIT],
exitOnClose:true,
navBarHidden:true
});
var monstrito= Ti.UI.createView({
backgroundImage:"/assets/mons_inicio.png",
zIndex:10,
left:-10,
top:140,
width:103,
height:143
});
var logo = Ti.UI.createImageView({
image:'/assets/alphaLOGO.png',
top:65,
right:35,
zIndex:2,
width:250,
height:106
});
//label using localization-ready strings from <app dir>/i18n/en/strings.xml
var label = Ti.UI.createLabel({
color:'#000000',
text:"Aplicacion Alpha",
height:20,
width:200,
bottom:100,
font:{fontFamily:'MYRIADPRO-REGULAR',fontSize:14}
});
var texto1 = Ti.UI.createLabel({
color:'#ffffff',
text:"Registrate para seguir ganando puntos y canjear productos",
height:40,
width:200,
top:175,
right:30,
font:{fontFamily:'MYRIADPRO-REGULAR',fontSize:14},
backgroundColor:'#000000',
textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,
zIndex:4
});
var texto2 = Ti.UI.createLabel({
color:'#000000',
text:"Registrate con tu cuenta de facebook o ingresa tu correo",
height:60,
width:200,
top:205,
right:30,
font:{fontFamily:'MYRIADPRO-REGULAR',fontSize:14},
backgroundColor:'#ffffff',
textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,
zIndex:3
});
var btnFacebook = Ti.UI.createButton({
top: 280,
width:200,
height:37,
backgroundImage:'/assets/btnfacebook.png',
zIndex:7,
});
var btnRegistro = Ti.UI.createButton({
top: 380,
width:200,
height:37,
backgroundColor:'#37ade2',
zIndex:7,
title:'CONTINUAR',
color:'#ffffff',
font:{fontFamily:'Minecrafter_3',fontSize:14},
textAlign:Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER,
textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,
backgroundFocusedColor:'#000',
backgroundDisabledColor:'#ff0000'
});
var logoFooter = Ti.UI.createView({
backgroundImage:"/assets/logofooter.png",
zIndex:10,
top:460,
width:100,
height:30,
});
var logoBottom = Ti.UI.createLabel({
top: 490,
width:70,
height:27,
left:20,
color:'#000000',
zIndex:11
});
btnFacebook.addEventListener('click',function(){
var Formulario = require('/ui/common/formulario');
formulario = new Formulario();
formulario.open();
});
btnRegistro.addEventListener('click',function(){
if(txtCorreo.value=="Ingrese su correo"){
alert("Ingrese su correo");
return false;
}
if(txtCorreo.value==""){
alert("Ingrese su correo");
return false;
}
Titanium.API.correo=txtCorreo.value;
var Formulario = require('/ui/common/formulario');
formulario = new Formulario();
formulario.open();
});
var txtCorreo = Ti.UI.createTextField({
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
color: '#336699',
top: 330,
width: 200, height: 37,
backgroundColor:'#ffffff',
hintText:"Ingrese su correo",
font:{fontFamily:'MYRIADPRO-REGULAR',fontSize:14},
keyboardType:Ti.UI.KEYBOARD_EMAIL
});
self.addEventListener('click',function(e){
txtCorreo.blur();
});
var fb = require('facebook');
fb.appid = 1397156940536791;
fb.permissions = ['publish_stream'];
fb.addEventListener('login', function(e) {
fb.requestWithGraphPath('me', {}, 'GET', function(e) {
if (e.success) {
var getdata = JSON.parse(e.result);
Ti.API.correo = getdata.email;
Ti.API.fbid = getdata.id;
Ti.API.nombres = getdata.first_name;
Ti.API.apellidos = getdata.last_name;
var Formulario = require('/ui/common/formulario');
formulario = new Formulario();
formulario.open();
} else if (e.error) {
alert(e.error);
} else {
alert('Unknown response');
}
});
});
scroll.add(logo);
scroll.add(txtCorreo);
scroll.add(texto1);
scroll.add(monstrito);
scroll.add(texto2);
scroll.add(logoFooter);
scroll.add(fb.createLoginButton({
top:280,
style:fb.BUTTON_STYLE_WIDE
}));
scroll.add(btnRegistro);
scroll.add(logoBottom);
self.add(scroll);
//Add behavior for UI
return self;
}
module.exports = opciones;
|
{
"content_hash": "7ea49d3881d85dc9c7fb911a27cb1e22",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 76,
"avg_line_length": 21.034825870646767,
"alnum_prop": 0.6655629139072847,
"repo_name": "kjayru/alpha_v3",
"id": "3c8ecb0eef54db77fbe83ceaecb7a0c0d92bb998",
"size": "4229",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Resources/ui/common/opciones.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "67860"
}
],
"symlink_target": ""
}
|
var express = require('../');
var request = require('supertest');
describe('middleware', function(){
describe('.next()', function(){
it('should behave like connect', function(done){
var app = express()
, calls = [];
app.use(function(req, res, next){
calls.push('one');
next();
});
app.use(function(req, res, next){
calls.push('two');
next();
});
app.use(function(req, res){
var buf = '';
res.setHeader('Content-Type', 'application/json');
req.setEncoding('utf8');
req.on('data', function(chunk){ buf += chunk });
req.on('end', function(){
res.end(buf);
});
});
request(app)
.get('/')
.set('Content-Type', 'application/json')
.send('{"foo":"bar"}')
.expect('Content-Type', 'application/json')
.expect(200, '{"foo":"bar"}', done)
})
})
})
|
{
"content_hash": "d5d520d876c3b346f38e405324a21cb9",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 58,
"avg_line_length": 24.473684210526315,
"alnum_prop": 0.4989247311827957,
"repo_name": "wesleytodd/express",
"id": "ce59589230b26b2387ad2178d54a347dc676d1d9",
"size": "931",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/middleware.basic.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "366856"
},
{
"name": "Makefile",
"bytes": "201"
},
{
"name": "Shell",
"bytes": "196"
}
],
"symlink_target": ""
}
|
PhoneGap BluetoothPlugin By Daniel Diaz
=======================================
Bluetooth plugin for PhoneGap (Android). Tested on versions 2.6.0 and 3.0.0.
**NOTE** The plugin requires Android API version 15 (Ice Cream Sandwich) to function properly.
This plugin was created as part of an EU funded (Rural Development Programme for
Mainland Finland 2007-2013) [project](http://blogit.jamk.fi/metsaapuilta/en/).
Read this first!
----------------
I'm currently in a situation where I do not have any equipment to test this plugin on,
or develop reliably. Due to this situation, I am unable to maintain this plugin properly.
I will still respond to pull requests and issues if I can help with them.
If you are interested in developing this plugin, fork it and make a pull request that
will mention your fork here in this `README`. If you have your own Bluetooth plugin,
that you would like to be mentioned here, make a pull request and add a link to it in
this `README`. Pull requests to fix and add stuff will always be appreciated!
Installation
------------
Check out PhoneGap CLI [docs](http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface)
before starting out.
To install this plugin on 3.0.0, use the phonegap CLI.
```
phonegap local plugin add https://github.com/tanelih/phonegap-bluetooth-plugin.git
```
Remember to build the project afterwards.
Installation below 3.0.0 version should be done manually. Copy the contents of
`manual/<platform>/src` and `manual/www` to their respective locations on your
project. Remember to add plugin specification to `config.xml` and permissions to
`AndroidManifest.xml`.
In `config.xml`...
```
<plugin name="Bluetooth" value="org.apache.cordova.bluetooth.BluetoothPlugin" />
```
In `AndroidManifest.xml`...
```
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
```
Usage
-----
If you installed the plugin with plugman in 3.0.0 environment, the plugin is
accessible from `window.bluetooth`.
If you installed the plugin manually, you need to add the `bluetooth.js` script
to your app. Then require the plugin after the `deviceready` event.
```
window.bluetooth = cordova.require("cordova/plugin/bluetooth");
```
License
-------
This plugin is available under MIT. See LICENSE for details.
|
{
"content_hash": "64ccfdf7c838454baec2d20d1dd5f849",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 119,
"avg_line_length": 37.07575757575758,
"alnum_prop": 0.7454025337147527,
"repo_name": "fernandolmos/wormbot",
"id": "0307b495b1fae40ebe1ba6a2dc5c9f1f9cf64a6f",
"size": "2447",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "6908"
},
{
"name": "HTML",
"bytes": "4666"
},
{
"name": "Java",
"bytes": "103429"
},
{
"name": "JavaScript",
"bytes": "33343"
}
],
"symlink_target": ""
}
|
/*global sinon, QUnit, test*/
sinon.assert.fail = function (msg) {
QUnit.ok(false, msg);
};
sinon.assert.pass = function (assertion) {
QUnit.ok(true, assertion);
};
sinon.config = {
injectIntoThis: true,
injectInto: null,
properties: ['spy', 'stub', 'mock', 'sandbox', 'clock'],
useFakeTimers: [ 10 ],
useFakeServer: false
};
(function (global) {
var module = QUnit.module;
QUnit.module = function(moduleName, env) {
var sandbox;
module.call(this, moduleName, {
setup: function() {
var config = sinon.getConfig(sinon.config);
config.injectInto = this;
sandbox = sinon.sandbox.create(config);
env && env.setup && env.setup.call(this);
},
teardown: function() {
env && env.teardown && env.teardown.call(this);
sandbox.verifyAndRestore();
LocalCache.reset(true);
}
});
};
// Make sure that we are seeded
QUnit.module('', {});
}(this));
// Expose qunit in the global namespace
// Note that we are not exporting module as that causes many of our libs to blow up
this.QUnit = QUnit;
this.sinon = sinon;
[
// Setup
'test', 'asyncTest', 'expect', /* 'module', */
// Asserts
'ok', 'equal', 'notEqual', 'deepEqual', 'strictEqual', 'notStrictEqual', 'raises',
// Async
'start', 'stop'
].forEach(function(name) {
this[name] = QUnit[name];
}, this);
|
{
"content_hash": "70ab81db5c4244523836684fbe264998",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 84,
"avg_line_length": 22.672131147540984,
"alnum_prop": 0.6109906001446131,
"repo_name": "walmartlabs/lumbar-loader",
"id": "654a01c67988b928397a3d1e4ce570001c73e2c7",
"size": "1383",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/lib/sinon-qunit.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4688"
},
{
"name": "JavaScript",
"bytes": "375357"
},
{
"name": "Shell",
"bytes": "185"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>module NMatrix::FactorizeLUMethods - RDoc Documentation</title>
<script type="text/javascript">
var rdoc_rel_prefix = "../";
</script>
<script src="../js/jquery.js"></script>
<script src="../js/darkfish.js"></script>
<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">
<body id="top" role="document" class="module">
<nav role="navigation">
<div id="project-navigation">
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="../index.html" rel="home">Home</a>
</h2>
<div id="table-of-contents-navigation">
<a href="../table_of_contents.html#pages">Pages</a>
<a href="../table_of_contents.html#classes">Classes</a>
<a href="../table_of_contents.html#methods">Methods</a>
</div>
</div>
<div id="search-section" role="search" class="project-section initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<div id="search-field-wrapper">
<input id="search-field" role="combobox" aria-label="Search"
aria-autocomplete="list" aria-controls="search-results"
type="text" name="search" placeholder="Search" spellcheck="false"
title="Type to search, Up and Down to navigate, Enter to load">
</div>
<ul id="search-results" aria-label="Search Results"
aria-busy="false" aria-expanded="false"
aria-atomic="false" class="initially-hidden"></ul>
</form>
</div>
</div>
<div id="class-metadata">
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
<h3>Methods</h3>
<ul class="link-list" role="directory">
<li ><a href="#method-c-permutation_array_for">::permutation_array_for</a>
<li ><a href="#method-c-permutation_matrix_from">::permutation_matrix_from</a>
</ul>
</div>
</div>
</nav>
<main role="main" aria-labelledby="module-NMatrix::FactorizeLUMethods">
<h1 id="module-NMatrix::FactorizeLUMethods" class="module">
module NMatrix::FactorizeLUMethods
</h1>
<section class="description">
<p>Methods for generating permutation matrix from LU factorization results.</p>
</section>
<section id="5Buntitled-5D" class="documentation-section">
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Class Methods</h3>
</header>
<div id="method-c-permutation_array_for" class="method-detail ">
<div class="method-heading">
<span class="method-name">permutation_array_for</span><span
class="method-args">(pivot_array)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="permutation_array_for-source">
<pre><span class="ruby-comment"># File lib/nmatrix/math.rb, line 51</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">permutation_array_for</span>(<span class="ruby-identifier">pivot_array</span>)
<span class="ruby-identifier">perm_arry</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pivot_array</span>.<span class="ruby-identifier">size</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span> }
<span class="ruby-identifier">perm_arry</span>.<span class="ruby-identifier">each_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
<span class="ruby-comment">#the pivot indices returned by LAPACK getrf are indexed starting</span>
<span class="ruby-comment">#from 1, so we need to subtract 1 here</span>
<span class="ruby-identifier">perm_arry</span>[<span class="ruby-identifier">i</span>], <span class="ruby-identifier">perm_arry</span>[<span class="ruby-identifier">pivot_array</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">-</span><span class="ruby-value">1</span>] = <span class="ruby-identifier">perm_arry</span>[<span class="ruby-identifier">pivot_array</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">-</span><span class="ruby-value">1</span>], <span class="ruby-identifier">perm_arry</span>[<span class="ruby-identifier">i</span>]
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">perm_arry</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-c-permutation_matrix_from" class="method-detail ">
<div class="method-heading">
<span class="method-name">permutation_matrix_from</span><span
class="method-args">(pivot_array)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="permutation_matrix_from-source">
<pre><span class="ruby-comment"># File lib/nmatrix/math.rb, line 42</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">permutation_matrix_from</span>(<span class="ruby-identifier">pivot_array</span>)
<span class="ruby-identifier">perm_arry</span> = <span class="ruby-identifier">permutation_array_for</span>(<span class="ruby-identifier">pivot_array</span>)
<span class="ruby-identifier">n</span> = <span class="ruby-constant">NMatrix</span>.<span class="ruby-identifier">zeros</span>(<span class="ruby-identifier">perm_arry</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">dtype</span><span class="ruby-operator">:</span> <span class="ruby-value">:byte</span>)
<span class="ruby-identifier">perm_arry</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>[<span class="ruby-identifier">e</span>,<span class="ruby-identifier">i</span>] = <span class="ruby-value">1</span> }
<span class="ruby-identifier">n</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</section>
</section>
</main>
<footer id="validator-badges" role="contentinfo">
<p><a href="http://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>
|
{
"content_hash": "020385ddfd5db7cfa0d348733fe37bbe",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 593,
"avg_line_length": 36.65128205128205,
"alnum_prop": 0.6342521337624178,
"repo_name": "SciRuby/sciruby.com",
"id": "627d76c58210351a650a79f5b5d642732ace8742",
"size": "7147",
"binary": false,
"copies": "1",
"ref": "refs/heads/source",
"path": "source/nmatrix/docs/NMatrix/FactorizeLUMethods.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "109508"
},
{
"name": "HTML",
"bytes": "1419905"
},
{
"name": "JavaScript",
"bytes": "157860"
},
{
"name": "Ruby",
"bytes": "139279"
}
],
"symlink_target": ""
}
|
define('conf/pl/blog', function(require,exports,module){
var $ = require('core/chaos/jquery');
var $Blog = require('mods/blog');
module.exports = {
init : function(){
var objs = this.objs = {};
objs.blog = new $Blog();
},
attach : function(){
},
detach : function(){
},
destroy : function(){
}
};
});
|
{
"content_hash": "4ab29a707912b693590b40cb5839d03f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 16.136363636363637,
"alnum_prop": 0.532394366197183,
"repo_name": "JoveX/penman",
"id": "76b0d6f58a732e1cdd2e8763899858f3af6e7af8",
"size": "355",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/js/conf/pl/blog.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "71959"
},
{
"name": "JavaScript",
"bytes": "196468"
},
{
"name": "Ruby",
"bytes": "54"
}
],
"symlink_target": ""
}
|
module Sequel
module Plugins
# SkipCreateRefresh is a simple plugin that make Sequel not
# refresh after saving a new model object. Sequel does the
# refresh to make sure all columns are populated, which is
# necessary so that database defaults work correctly.
#
# This plugin is mostly for performance reasons where you
# want to save the cost of select statement after the insert,
# but it could also help cases where records are not
# immediately available for selection after insertion.
#
# Note that Sequel does not attempt to refresh records when
# updating existing model objects, only when inserting new
# model objects.
#
# Usage:
#
# # Make all model subclass instances skip refreshes when saving
# # (called before loading subclasses)
# Sequel::Model.plugin :skip_create_refresh
#
# # Make the Album class skip refreshes when saving
# Album.plugin :skip_create_refresh
module SkipCreateRefresh
module InstanceMethods
private
# Do nothing instead of refreshing the record inside of save.
def _save_refresh
nil
end
end
end
end
end
|
{
"content_hash": "c436dc25c63a74ff75b8e524785a4b13",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 70,
"avg_line_length": 34.457142857142856,
"alnum_prop": 0.6799336650082919,
"repo_name": "rosberglinhares/IISLogMonitor",
"id": "b69f9013fc77769bb4f9318297cac7ad03879490",
"size": "1237",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "IISLogMonitor.Setup.Files/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/sequel-4.39.0/lib/sequel/plugins/skip_create_refresh.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "7619"
},
{
"name": "JavaScript",
"bytes": "487"
},
{
"name": "PowerShell",
"bytes": "8925"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World!</string>
<string name="app_name">DragNDropListAppTest</string>
</resources>
|
{
"content_hash": "2f42d7c1caf14eb58edf6582370320d7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 57,
"avg_line_length": 24.285714285714285,
"alnum_prop": 0.6823529411764706,
"repo_name": "terlici/DragNDropListAppTest",
"id": "77f1492fc18ef5546637bedb5a69622da99a6e27",
"size": "170",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/values/strings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "27156"
}
],
"symlink_target": ""
}
|
namespace chromecast {
namespace media {
namespace {
// Converts ::media::AudioCodec to chromecast::media::AudioCodec. Any unknown or
// unsupported codec will be converted to chromecast::media::kCodecUnknown.
AudioCodec ToAudioCodec(const ::media::AudioCodec audio_codec) {
switch (audio_codec) {
case ::media::AudioCodec::kAAC:
return kCodecAAC;
case ::media::AudioCodec::kMP3:
return kCodecMP3;
case ::media::AudioCodec::kPCM:
return kCodecPCM;
case ::media::AudioCodec::kPCM_S16BE:
return kCodecPCM_S16BE;
case ::media::AudioCodec::kVorbis:
return kCodecVorbis;
case ::media::AudioCodec::kOpus:
return kCodecOpus;
case ::media::AudioCodec::kFLAC:
return kCodecFLAC;
case ::media::AudioCodec::kEAC3:
return kCodecEAC3;
case ::media::AudioCodec::kAC3:
return kCodecAC3;
case ::media::AudioCodec::kMpegHAudio:
return kCodecMpegHAudio;
case ::media::AudioCodec::kDTS:
return kCodecDTS;
case ::media::AudioCodec::kDTSXP2:
return kCodecDTSXP2;
default:
LOG(ERROR) << "Unsupported audio codec " << audio_codec;
}
return kAudioCodecUnknown;
}
SampleFormat ToSampleFormat(const ::media::SampleFormat sample_format) {
switch (sample_format) {
case ::media::kUnknownSampleFormat:
case ::media::kSampleFormatAc3:
case ::media::kSampleFormatEac3:
case ::media::kSampleFormatDts:
case ::media::kSampleFormatDtsxP2:
case ::media::kSampleFormatMpegHAudio:
case ::media::kSampleFormatIECDts:
return kUnknownSampleFormat;
case ::media::kSampleFormatU8:
return kSampleFormatU8;
case ::media::kSampleFormatS16:
return kSampleFormatS16;
case ::media::kSampleFormatS24:
return kSampleFormatS24;
case ::media::kSampleFormatS32:
return kSampleFormatS32;
case ::media::kSampleFormatF32:
return kSampleFormatF32;
case ::media::kSampleFormatPlanarU8:
return kSampleFormatPlanarU8;
case ::media::kSampleFormatPlanarS16:
return kSampleFormatPlanarS16;
case ::media::kSampleFormatPlanarF32:
return kSampleFormatPlanarF32;
case ::media::kSampleFormatPlanarS32:
return kSampleFormatPlanarS32;
}
NOTREACHED();
return kUnknownSampleFormat;
}
::media::SampleFormat ToMediaSampleFormat(const SampleFormat sample_format) {
switch (sample_format) {
case kUnknownSampleFormat:
return ::media::kUnknownSampleFormat;
case kSampleFormatU8:
return ::media::kSampleFormatU8;
case kSampleFormatS16:
return ::media::kSampleFormatS16;
case kSampleFormatS24:
return ::media::kSampleFormatS24;
case kSampleFormatS32:
return ::media::kSampleFormatS32;
case kSampleFormatF32:
return ::media::kSampleFormatF32;
case kSampleFormatPlanarU8:
return ::media::kSampleFormatPlanarU8;
case kSampleFormatPlanarS16:
return ::media::kSampleFormatPlanarS16;
case kSampleFormatPlanarF32:
return ::media::kSampleFormatPlanarF32;
case kSampleFormatPlanarS32:
return ::media::kSampleFormatPlanarS32;
default:
NOTREACHED();
return ::media::kUnknownSampleFormat;
}
}
::media::AudioCodec ToMediaAudioCodec(
const chromecast::media::AudioCodec codec) {
switch (codec) {
case kAudioCodecUnknown:
return ::media::AudioCodec::kUnknown;
case kCodecAAC:
return ::media::AudioCodec::kAAC;
case kCodecMP3:
return ::media::AudioCodec::kMP3;
case kCodecPCM:
return ::media::AudioCodec::kPCM;
case kCodecPCM_S16BE:
return ::media::AudioCodec::kPCM_S16BE;
case kCodecVorbis:
return ::media::AudioCodec::kVorbis;
case kCodecOpus:
return ::media::AudioCodec::kOpus;
case kCodecFLAC:
return ::media::AudioCodec::kFLAC;
case kCodecEAC3:
return ::media::AudioCodec::kEAC3;
case kCodecAC3:
return ::media::AudioCodec::kAC3;
case kCodecMpegHAudio:
return ::media::AudioCodec::kMpegHAudio;
case kCodecDTS:
return ::media::AudioCodec::kDTS;
case kCodecDTSXP2:
return ::media::AudioCodec::kDTSXP2;
default:
return ::media::AudioCodec::kUnknown;
}
}
EncryptionScheme ToEncryptionScheme(::media::EncryptionScheme scheme) {
switch (scheme) {
case ::media::EncryptionScheme::kUnencrypted:
return EncryptionScheme::kUnencrypted;
case ::media::EncryptionScheme::kCenc:
return EncryptionScheme::kAesCtr;
case ::media::EncryptionScheme::kCbcs:
return EncryptionScheme::kAesCbc;
default:
NOTREACHED();
return EncryptionScheme::kUnencrypted;
}
}
::media::EncryptionScheme ToMediaEncryptionScheme(EncryptionScheme scheme) {
switch (scheme) {
case EncryptionScheme::kUnencrypted:
return ::media::EncryptionScheme::kUnencrypted;
case EncryptionScheme::kAesCtr:
return ::media::EncryptionScheme::kCenc;
case EncryptionScheme::kAesCbc:
return ::media::EncryptionScheme::kCbcs;
default:
NOTREACHED();
return ::media::EncryptionScheme::kUnencrypted;
}
}
} // namespace
// static
ChannelLayout DecoderConfigAdapter::ToChannelLayout(
::media::ChannelLayout channel_layout) {
switch (channel_layout) {
case ::media::ChannelLayout::CHANNEL_LAYOUT_UNSUPPORTED:
return ChannelLayout::UNSUPPORTED;
case ::media::ChannelLayout::CHANNEL_LAYOUT_MONO:
return ChannelLayout::MONO;
case ::media::ChannelLayout::CHANNEL_LAYOUT_STEREO:
return ChannelLayout::STEREO;
case ::media::ChannelLayout::CHANNEL_LAYOUT_5_1:
case ::media::ChannelLayout::CHANNEL_LAYOUT_5_1_BACK:
return ChannelLayout::SURROUND_5_1;
case ::media::ChannelLayout::CHANNEL_LAYOUT_BITSTREAM:
return ChannelLayout::BITSTREAM;
case ::media::ChannelLayout::CHANNEL_LAYOUT_DISCRETE:
return ChannelLayout::DISCRETE;
default:
NOTREACHED();
return ChannelLayout::UNSUPPORTED;
}
}
// static
::media::ChannelLayout DecoderConfigAdapter::ToMediaChannelLayout(
ChannelLayout channel_layout) {
switch (channel_layout) {
case ChannelLayout::UNSUPPORTED:
return ::media::ChannelLayout::CHANNEL_LAYOUT_UNSUPPORTED;
case ChannelLayout::MONO:
return ::media::ChannelLayout::CHANNEL_LAYOUT_MONO;
case ChannelLayout::STEREO:
return ::media::ChannelLayout::CHANNEL_LAYOUT_STEREO;
case ChannelLayout::SURROUND_5_1:
return ::media::ChannelLayout::CHANNEL_LAYOUT_5_1;
case ChannelLayout::BITSTREAM:
return ::media::ChannelLayout::CHANNEL_LAYOUT_BITSTREAM;
case ChannelLayout::DISCRETE:
return ::media::ChannelLayout::CHANNEL_LAYOUT_DISCRETE;
default:
NOTREACHED();
return ::media::ChannelLayout::CHANNEL_LAYOUT_UNSUPPORTED;
}
}
// static
AudioConfig DecoderConfigAdapter::ToCastAudioConfig(
StreamId id,
const ::media::AudioDecoderConfig& config) {
AudioConfig audio_config;
if (!config.IsValidConfig())
return audio_config;
audio_config.id = id;
audio_config.codec = ToAudioCodec(config.codec());
audio_config.sample_format = ToSampleFormat(config.sample_format());
audio_config.bytes_per_channel = config.bytes_per_channel();
audio_config.channel_layout = ToChannelLayout(config.channel_layout());
audio_config.channel_number = config.channels();
audio_config.samples_per_second = config.samples_per_second();
audio_config.extra_data = config.extra_data();
audio_config.encryption_scheme =
ToEncryptionScheme(config.encryption_scheme());
#if BUILDFLAG(IS_ANDROID)
// On Android, Chromium's mp4 parser adds extra data for AAC, but we don't
// need this with CMA.
if (audio_config.codec == kCodecAAC)
audio_config.extra_data.clear();
#endif // BUILDFLAG(IS_ANDROID)
return audio_config;
}
// static
::media::AudioDecoderConfig DecoderConfigAdapter::ToMediaAudioDecoderConfig(
const AudioConfig& config) {
::media::AudioDecoderConfig audio_decoder_config(
ToMediaAudioCodec(config.codec),
ToMediaSampleFormat(config.sample_format),
ToMediaChannelLayout(config.channel_layout), config.samples_per_second,
config.extra_data, ToMediaEncryptionScheme(config.encryption_scheme));
if (config.channel_layout == ChannelLayout::DISCRETE) {
audio_decoder_config.SetChannelsForDiscrete(config.channel_number);
}
return audio_decoder_config;
}
// static
#define STATIC_ASSERT_MATCHING_ENUM(chromium_name, chromecast_name) \
static_assert(static_cast<int>(::media::VideoColorSpace::chromium_name) == \
static_cast<int>(::chromecast::media::chromecast_name), \
"mismatching status enum values: " #chromium_name)
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::BT709, PrimaryID::BT709);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::UNSPECIFIED, PrimaryID::UNSPECIFIED);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::BT470M, PrimaryID::BT470M);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::BT470BG, PrimaryID::BT470BG);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::SMPTE170M, PrimaryID::SMPTE170M);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::SMPTE240M, PrimaryID::SMPTE240M);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::FILM, PrimaryID::FILM);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::BT2020, PrimaryID::BT2020);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::SMPTEST428_1, PrimaryID::SMPTEST428_1);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::SMPTEST431_2, PrimaryID::SMPTEST431_2);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::SMPTEST432_1, PrimaryID::SMPTEST432_1);
STATIC_ASSERT_MATCHING_ENUM(PrimaryID::EBU_3213_E, PrimaryID::EBU_3213_E);
STATIC_ASSERT_MATCHING_ENUM(TransferID::BT709, TransferID::BT709);
STATIC_ASSERT_MATCHING_ENUM(TransferID::UNSPECIFIED, TransferID::UNSPECIFIED);
STATIC_ASSERT_MATCHING_ENUM(TransferID::GAMMA22, TransferID::GAMMA22);
STATIC_ASSERT_MATCHING_ENUM(TransferID::GAMMA28, TransferID::GAMMA28);
STATIC_ASSERT_MATCHING_ENUM(TransferID::SMPTE170M, TransferID::SMPTE170M);
STATIC_ASSERT_MATCHING_ENUM(TransferID::SMPTE240M, TransferID::SMPTE240M);
STATIC_ASSERT_MATCHING_ENUM(TransferID::LINEAR, TransferID::LINEAR);
STATIC_ASSERT_MATCHING_ENUM(TransferID::LOG, TransferID::LOG);
STATIC_ASSERT_MATCHING_ENUM(TransferID::LOG_SQRT, TransferID::LOG_SQRT);
STATIC_ASSERT_MATCHING_ENUM(TransferID::IEC61966_2_4, TransferID::IEC61966_2_4);
STATIC_ASSERT_MATCHING_ENUM(TransferID::BT1361_ECG, TransferID::BT1361_ECG);
STATIC_ASSERT_MATCHING_ENUM(TransferID::IEC61966_2_1, TransferID::IEC61966_2_1);
STATIC_ASSERT_MATCHING_ENUM(TransferID::BT2020_10, TransferID::BT2020_10);
STATIC_ASSERT_MATCHING_ENUM(TransferID::BT2020_12, TransferID::BT2020_12);
STATIC_ASSERT_MATCHING_ENUM(TransferID::SMPTEST2084, TransferID::SMPTEST2084);
STATIC_ASSERT_MATCHING_ENUM(TransferID::SMPTEST428_1, TransferID::SMPTEST428_1);
STATIC_ASSERT_MATCHING_ENUM(TransferID::ARIB_STD_B67, TransferID::ARIB_STD_B67);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::RGB, MatrixID::RGB);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::BT709, MatrixID::BT709);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::UNSPECIFIED, MatrixID::UNSPECIFIED);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::FCC, MatrixID::FCC);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::BT470BG, MatrixID::BT470BG);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::SMPTE170M, MatrixID::SMPTE170M);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::SMPTE240M, MatrixID::SMPTE240M);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::YCOCG, MatrixID::YCOCG);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::BT2020_NCL, MatrixID::BT2020_NCL);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::BT2020_CL, MatrixID::BT2020_CL);
STATIC_ASSERT_MATCHING_ENUM(MatrixID::YDZDX, MatrixID::YDZDX);
#define STATIC_ASSERT_MATCHING_ENUM2(chromium_name, chromecast_name) \
static_assert(static_cast<int>(::gfx::ColorSpace::chromium_name) == \
static_cast<int>(::chromecast::media::chromecast_name), \
"mismatching status enum values: " #chromium_name)
STATIC_ASSERT_MATCHING_ENUM2(RangeID::INVALID, RangeID::INVALID);
STATIC_ASSERT_MATCHING_ENUM2(RangeID::LIMITED, RangeID::LIMITED);
STATIC_ASSERT_MATCHING_ENUM2(RangeID::FULL, RangeID::FULL);
STATIC_ASSERT_MATCHING_ENUM2(RangeID::DERIVED, RangeID::DERIVED);
VideoConfig DecoderConfigAdapter::ToCastVideoConfig(
StreamId id,
const ::media::VideoDecoderConfig& config) {
VideoConfig video_config;
if (!config.IsValidConfig()) {
return video_config;
}
video_config.id = id;
video_config.codec = ToCastVideoCodec(config.codec(), config.profile());
video_config.profile = ToCastVideoProfile(config.profile());
video_config.extra_data = config.extra_data();
video_config.encryption_scheme = ToEncryptionScheme(
config.encryption_scheme());
video_config.primaries =
static_cast<PrimaryID>(config.color_space_info().primaries);
video_config.transfer =
static_cast<TransferID>(config.color_space_info().transfer);
video_config.matrix = static_cast<MatrixID>(config.color_space_info().matrix);
video_config.range = static_cast<RangeID>(config.color_space_info().range);
absl::optional<::gfx::HDRMetadata> hdr_metadata = config.hdr_metadata();
if (hdr_metadata) {
video_config.have_hdr_metadata = true;
video_config.hdr_metadata.max_content_light_level =
hdr_metadata->max_content_light_level;
video_config.hdr_metadata.max_frame_average_light_level =
hdr_metadata->max_frame_average_light_level;
const auto& mm1 = hdr_metadata->color_volume_metadata;
auto& mm2 = video_config.hdr_metadata.color_volume_metadata;
mm2.primary_r_chromaticity_x = mm1.primaries.fRX;
mm2.primary_r_chromaticity_y = mm1.primaries.fRY;
mm2.primary_g_chromaticity_x = mm1.primaries.fGX;
mm2.primary_g_chromaticity_y = mm1.primaries.fGY;
mm2.primary_b_chromaticity_x = mm1.primaries.fBX;
mm2.primary_b_chromaticity_y = mm1.primaries.fBY;
mm2.white_point_chromaticity_x = mm1.primaries.fWX;
mm2.white_point_chromaticity_y = mm1.primaries.fWY;
mm2.luminance_max = mm1.luminance_max;
mm2.luminance_min = mm1.luminance_min;
}
return video_config;
}
} // namespace media
} // namespace chromecast
|
{
"content_hash": "85b0e3a2aff1e87d152f21b0a5338b66",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 80,
"avg_line_length": 38.8756906077348,
"alnum_prop": 0.7284871740211754,
"repo_name": "chromium/chromium",
"id": "3ff80cafd0fbb5b98080fa42b6f1d965efd2ab36",
"size": "14551",
"binary": false,
"copies": "5",
"ref": "refs/heads/main",
"path": "chromecast/media/cma/base/decoder_config_adapter.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
CREATE SCHEMA IF NOT EXISTS atomic;
CREATE TABLE IF NOT EXISTS atomic.com_sendgrid_unsubscribe_2 (
"schema_vendor" VARCHAR(128) ENCODE ZSTD NOT NULL,
"schema_name" VARCHAR(128) ENCODE ZSTD NOT NULL,
"schema_format" VARCHAR(128) ENCODE ZSTD NOT NULL,
"schema_version" VARCHAR(128) ENCODE ZSTD NOT NULL,
"root_id" CHAR(36) ENCODE RAW NOT NULL,
"root_tstamp" TIMESTAMP ENCODE ZSTD NOT NULL,
"ref_root" VARCHAR(255) ENCODE ZSTD NOT NULL,
"ref_tree" VARCHAR(1500) ENCODE ZSTD NOT NULL,
"ref_parent" VARCHAR(255) ENCODE ZSTD NOT NULL,
"asm_group_id" SMALLINT ENCODE ZSTD,
"category" VARCHAR(5000) ENCODE ZSTD,
"email" VARCHAR(255) ENCODE ZSTD,
"marketing_campaign_id" BIGINT ENCODE ZSTD,
"marketing_campaign_name" VARCHAR(4096) ENCODE ZSTD,
"marketing_campaign_split_id" BIGINT ENCODE ZSTD,
"marketing_campaign_version" VARCHAR(4096) ENCODE ZSTD,
"sg_event_id" VARCHAR(4096) ENCODE ZSTD,
"sg_message_id" VARCHAR(4096) ENCODE ZSTD,
"smtp_id" VARCHAR(4096) ENCODE ZSTD,
"timestamp" TIMESTAMP ENCODE ZSTD,
FOREIGN KEY (root_id) REFERENCES atomic.events(event_id)
)
DISTSTYLE KEY
DISTKEY (root_id)
SORTKEY (root_tstamp);
COMMENT ON TABLE atomic.com_sendgrid_unsubscribe_2 IS 'iglu:com.sendgrid/unsubscribe/jsonschema/2-0-0';
|
{
"content_hash": "bbf066b802f41000a2cbc24b4c9ef0ea",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 103,
"avg_line_length": 54.13333333333333,
"alnum_prop": 0.5763546798029556,
"repo_name": "snowplow/iglu-central",
"id": "4b5701352fbfd39d0892c2216fec6fed05470757",
"size": "1729",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sql/com.sendgrid/unsubscribe_2.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "2506"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<!--
Licensed to the Technische Universität Darmstadt under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The Technische Universität Darmstadt
licenses this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
<style>
:root {
--input-padding-x: 1.5rem;
--input-padding-y: 1.5rem;
}
.form-group input[type=text],input[type=password] {
padding: var(--input-padding-y) var(--input-padding-x);
border-radius: 2rem;
}
.btn-login {
font-size: 0.9rem !important;
letter-spacing: 0.05rem !important;
padding: 0.75rem 1rem !important;
border-radius: 2rem !important;
}
</style>
</wicket:head>
</head>
<body>
<wicket:extend>
<script>
$(document).ready(function() {
$("#urlfragment").attr("value", unescape(self.document.location.hash.substring(1)));
});
</script>
<div class="scrolling flex-content flex-h-container flex-centered">
<div class="flex-content flex-v-container flex-centered">
<form wicket:id="loginForm" class="card" style="background: white; padding: 3rem 3rem; min-width: 440px; max-width: 30%;">
<div class="card-body container-sm">
<h5 class="card-title mb-3 text-center">
Welcome!
</h5>
<input type="hidden" id="urlfragment" wicket:id="urlfragment" />
<div class="form-group form-row mb-3">
<input wicket:id="username" type="text" class="form-control" placeholder="User ID"/>
</div>
<div class="form-group form-row mb-3">
<input wicket:id="password" type="password" class="form-control" placeholder="Password"/>
</div>
<div class="form-group form-row justify-content-md-center">
<input wicket:id="signInBtn" type="submit" class="btn btn-login btn-primary w-100" wicket:message="value:signIn"/>
</div>
<div class="form-group form-row mt-3" wicket:enclosure="loginMessage">
<span wicket:id="loginMessage"></span>
</div>
<wicket:enclosure>
<div class="form-group form-row mt-3" wicket:id="usersLabel" style="color:red">
<wicket:message key="tooManyUsers"/>
</div>
</wicket:enclosure>
</div>
</form>
</div>
</div>
</wicket:extend>
</body>
</html>
|
{
"content_hash": "2a77e3af4211248c1889a95e526ecaeb",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 130,
"avg_line_length": 38.6875,
"alnum_prop": 0.6151857835218094,
"repo_name": "webanno/webanno",
"id": "61bf55754b29c94a41bf09e677d0cefb925b8592",
"size": "3097",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webanno-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/login/LoginPage.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "25786"
},
{
"name": "Dockerfile",
"bytes": "907"
},
{
"name": "HTML",
"bytes": "235442"
},
{
"name": "Java",
"bytes": "4907056"
},
{
"name": "JavaScript",
"bytes": "532072"
},
{
"name": "SCSS",
"bytes": "48472"
},
{
"name": "Shell",
"bytes": "3808"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Action Tables | Tables</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="Thu, 19 Nov 1900 08:52:00 GMT">
<link rel="shortcut icon" href="images/icons/favicon.ico">
<link rel="apple-touch-icon" href="images/icons/favicon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/icons/favicon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/icons/favicon-114x114.png">
<!--Loading bootstrap css-->
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700">
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700,300">
<link type="text/css" rel="stylesheet" href="vendors/jquery-ui-1.10.4.custom/css/ui-lightness/jquery-ui-1.10.4.custom.min.css">
<link type="text/css" rel="stylesheet" href="vendors/font-awesome/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="vendors/bootstrap/css/bootstrap.min.css">
<!--LOADING STYLESHEET FOR PAGE-->
<!--Loading style vendors-->
<link type="text/css" rel="stylesheet" href="vendors/animate.css/animate.css">
<link type="text/css" rel="stylesheet" href="vendors/jquery-pace/pace.css">
<link type="text/css" rel="stylesheet" href="vendors/iCheck/skins/all.css">
<link type="text/css" rel="stylesheet" href="vendors/jquery-notific8/jquery.notific8.min.css">
<link type="text/css" rel="stylesheet" href="vendors/bootstrap-daterangepicker/daterangepicker-bs3.css">
<!--Loading style-->
<link type="text/css" rel="stylesheet" href="css/themes/style1/orange-blue.css" class="default-style">
<link type="text/css" rel="stylesheet" href="css/themes/style1/orange-blue.css" id="theme-change" class="style-change color-change">
<link type="text/css" rel="stylesheet" href="css/style-responsive.css">
</head>
<body class=" ">
<div>
<div class="news-ticker bg-orange">
<div class="container">
<ul id="news-ticker-content" class="list-unstyled mbn">
<li><a href='http://madmin.swlabs.co/' , target='_blank'>This is HTML app version of this template. To see Angular app version, please click here</a>
</li>
</ul><a id="news-ticker-close" href="javascript:;"><i class="fa fa-times"></i></a>
</div>
</div>
<!--BEGIN BACK TO TOP--><a id="totop" href="#"><i class="fa fa-angle-up"></i></a>
<!--END BACK TO TOP-->
<!--BEGIN TOPBAR-->
<div id="header-topbar-option-demo" class="page-header-topbar">
<nav id="topbar" role="navigation" style="margin-bottom: 0; z-index: 2;" class="navbar navbar-default navbar-static-top">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target=".sidebar-collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</button><a id="logo" href="index.html" class="navbar-brand"><span class="fa fa-rocket"></span><span class="logo-text">µAdmin</span><span style="display: none" class="logo-text-icon">µ</span></a>
</div>
<div class="topbar-main"><a id="menu-toggle" href="#" class="hidden-xs"><i class="fa fa-bars"></i></a>
<ul class="nav navbar-nav ">
<li class="active"><a href="index.html">Dashboard</a>
</li>
<li><a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle">Layouts
<i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li><a href="layout-left-sidebar.html">Left Sidebar</a>
</li>
<li><a href="layout-right-sidebar.html">Right Sidebar</a>
</li>
<li><a href="layout-left-sidebar-collapsed.html">Left Sidebar Collasped</a>
</li>
<li><a href="layout-right-sidebar-collapsed.html">Right Sidebar Collasped</a>
</li>
<li class="dropdown-submenu"><a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle">More Options</a>
<ul class="dropdown-menu">
<li><a href="#">Second level link</a>
</li>
<li class="dropdown-submenu"><a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle">More Options</a>
<ul class="dropdown-menu">
<li><a href="#">Third level link</a>
</li>
<li><a href="#">Third level link</a>
</li>
<li><a href="#">Third level link</a>
</li>
<li><a href="#">Third level link</a>
</li>
<li><a href="#">Third level link</a>
</li>
</ul>
</li>
<li><a href="#">Second level link</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="mega-menu-dropdown"><a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle">UI Elements
<i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li>
<div class="mega-menu-content">
<div class="row">
<ul class="col-md-4 mega-menu-submenu">
<li>
<h3>Neque porro quisquam</h3>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Lorem ipsum dolor sit amet</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Consectetur adipisicing elit</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Sed ut perspiciatis unde omnis</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>At vero eos et accusamus et iusto</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Nam libero tempore cum soluta</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Et harum quidem rerum facilis est</a>
</li>
</ul>
<ul class="col-md-4 mega-menu-submenu">
<li>
<h3>Neque porro quisquam</h3>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Lorem ipsum dolor sit amet</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Consectetur adipisicing elit</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Sed ut perspiciatis unde omnis</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>At vero eos et accusamus et iusto</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Nam libero tempore cum soluta</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Et harum quidem rerum facilis est</a>
</li>
</ul>
<ul class="col-md-4 mega-menu-submenu">
<li>
<h3>Neque porro quisquam</h3>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Lorem ipsum dolor sit amet</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Consectetur adipisicing elit</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Sed ut perspiciatis unde omnis</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>At vero eos et accusamus et iusto</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Nam libero tempore cum soluta</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Et harum quidem rerum facilis est</a>
</li>
</ul>
</div>
</div>
</li>
</ul>
</li>
<li class="mega-menu-dropdown mega-menu-full"><a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle">Extras
<i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li>
<div class="mega-menu-content">
<div class="row">
<div class="col-md-7">
<ul class="col-md-4 mega-menu-submenu">
<li>
<h3>Neque porro quisquam</h3>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Lorem ipsum dolor sit amet</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Consectetur adipisicing elit</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Sed ut perspiciatis unde omnis</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>At vero eos et accusamus et iusto</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Nam libero tempore cum soluta</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Et harum quidem rerum facilis est</a>
</li>
</ul>
<ul class="col-md-4 mega-menu-submenu">
<li>
<h3>Neque porro quisquam</h3>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Lorem ipsum dolor sit amet</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Consectetur adipisicing elit</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Sed ut perspiciatis unde omnis</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>At vero eos et accusamus et iusto</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Nam libero tempore cum soluta</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Et harum quidem rerum facilis est</a>
</li>
</ul>
<ul class="col-md-4 mega-menu-submenu">
<li>
<h3>Neque porro quisquam</h3>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Lorem ipsum dolor sit amet</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Consectetur adipisicing elit</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Sed ut perspiciatis unde omnis</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>At vero eos et accusamus et iusto</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Nam libero tempore cum soluta</a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i>Et harum quidem rerum facilis est</a>
</li>
</ul>
</div>
<div class="col-md-5 document-demo">
<ul class="col-md-4 mega-menu-submenu">
<li><a href="#"><i class="fa fa-info-circle"></i><span>Introduction</span></a>
</li>
<li><a href="#"><i class="fa fa-download"></i><span>Installation</span></a>
</li>
</ul>
<ul class="col-md-4 mega-menu-submenu">
<li><a href="#"><i class="fa fa-cog"></i><span>T3 Settings</span></a>
</li>
<li><a href="#"><i class="fa fa-desktop"></i><span>Layout System</span></a>
</li>
</ul>
<ul class="col-md-4 mega-menu-submenu">
<li><a href="#"><i class="fa fa-magic"></i><span>Customization</span></a>
</li>
<li><a href="#"><i class="fa fa-question-circle"></i><span>FAQs</span></a>
</li>
</ul>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>
<form id="topbar-search" action="#" method="GET" class="hidden-xs">
<div class="input-group">
<input type="text" placeholder="Search..." class="form-control" /><span class="input-group-btn"><a href="javascript:;" class="btn submit"><i class="fa fa-search"></i></a></span>
</div>
</form>
<ul class="nav navbar navbar-top-links navbar-right mbn">
<li class="dropdown"><a data-hover="dropdown" href="#" class="dropdown-toggle"><i class="fa fa-bell fa-fw"></i><span class="badge badge-green">3</span></a>
<ul class="dropdown-menu dropdown-alerts">
<li>
<p>You have 14 new notifications</p>
</li>
<li>
<div class="dropdown-slimscroll">
<ul>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-blue"><i class="fa fa-comment"></i></span>New Comment<span class="pull-right text-muted small">4 mins ago</span></a>
</li>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-violet"><i class="fa fa-twitter"></i></span>3 New Followers<span class="pull-right text-muted small">12 mins ago</span></a>
</li>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-pink"><i class="fa fa-envelope"></i></span>Message Sent<span class="pull-right text-muted small">15 mins ago</span></a>
</li>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-green"><i class="fa fa-tasks"></i></span>New Task<span class="pull-right text-muted small">18 mins ago</span></a>
</li>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-yellow"><i class="fa fa-upload"></i></span>Server Rebooted<span class="pull-right text-muted small">19 mins ago</span></a>
</li>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-green"><i class="fa fa-tasks"></i></span>New Task<span class="pull-right text-muted small">2 days ago</span></a>
</li>
<li><a href="extra-user-list.html" target="_blank"><span class="label label-pink"><i class="fa fa-envelope"></i></span>Message Sent<span class="pull-right text-muted small">5 days ago</span></a>
</li>
</ul>
</div>
</li>
<li class="last"><a href="extra-user-list.html" class="text-right">See all alerts</a>
</li>
</ul>
</li>
<li class="dropdown"><a data-hover="dropdown" href="#" class="dropdown-toggle"><i class="fa fa-envelope fa-fw"></i><span class="badge badge-orange">7</span></a>
<ul class="dropdown-menu dropdown-messages">
<li>
<p>You have 14 new messages</p>
</li>
<li>
<div class="dropdown-slimscroll">
<ul>
<li><a href="email-view-mail.html" target="_blank"><span class="avatar"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/48.jpg" alt="" class="img-responsive img-circle"/></span><span class="info"><span class="name">Jessica Spencer</span><span class="desc">Lorem ipsum dolor sit amet...</span></span></a>
</li>
<li><a href="email-view-mail.html" target="_blank"><span class="avatar"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/48.jpg" alt="" class="img-responsive img-circle"/></span><span class="info"><span class="name">John Smith<span class="label label-blue pull-right">New</span></span><span class="desc">Lorem ipsum dolor sit amet...</span></span></a>
</li>
<li><a href="email-view-mail.html" target="_blank"><span class="avatar"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/48.jpg" alt="" class="img-responsive img-circle"/></span><span class="info"><span class="name">John Doe<span class="label label-orange pull-right">10 min</span></span><span class="desc">Lorem ipsum dolor sit amet...</span></span></a>
</li>
<li><a href="email-view-mail.html" target="_blank"><span class="avatar"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/48.jpg" alt="" class="img-responsive img-circle"/></span><span class="info"><span class="name">John Smith</span><span class="desc">Lorem ipsum dolor sit amet...</span></span></a>
</li>
<li><a href="email-view-mail.html" target="_blank"><span class="avatar"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/48.jpg" alt="" class="img-responsive img-circle"/></span><span class="info"><span class="name">John Smith</span><span class="desc">Lorem ipsum dolor sit amet...</span></span></a>
</li>
</ul>
</div>
</li>
<li class="last"><a href="email-view-mail.html" target="_blank">Read all messages</a>
</li>
</ul>
</li>
<li class="dropdown"><a data-hover="dropdown" href="#" class="dropdown-toggle"><i class="fa fa-tasks fa-fw"></i><span class="badge badge-yellow">8</span></a>
<ul class="dropdown-menu dropdown-tasks">
<li>
<p>You have 14 pending tasks</p>
</li>
<li>
<div class="dropdown-slimscroll">
<ul>
<li><a href="page-blog-item.html" target="_blank"><span class="task-item">Fix the HTML code<small class="pull-right text-muted">40%</small></span><div class="progress progress-sm"><div role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%;" class="progress-bar progress-bar-orange"><span class="sr-only">40% Complete (success)</span></div></div></a>
</li>
<li>
<a href="page-blog-item.html" target="_blank"> <span class="task-item">Make a wordpress theme<small class="pull-right text-muted">60%</small></span>
<div class="progress progress-sm">
<div role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;" class="progress-bar progress-bar-blue"><span class="sr-only">60% Complete (success)</span>
</div>
</div>
</a>
</li>
<li>
<a href="page-blog-item.html" target="_blank"> <span class="task-item">Convert PSD to HTML<small class="pull-right text-muted">55%</small></span>
<div class="progress progress-sm">
<div role="progressbar" aria-valuenow="55" aria-valuemin="0" aria-valuemax="100" style="width: 55%;" class="progress-bar progress-bar-green"><span class="sr-only">55% Complete (success)</span>
</div>
</div>
</a>
</li>
<li>
<a href="page-blog-item.html" target="_blank"> <span class="task-item">Convert HTML to Wordpress<small class="pull-right text-muted">78%</small></span>
<div class="progress progress-sm">
<div role="progressbar" aria-valuenow="78" aria-valuemin="0" aria-valuemax="100" style="width: 78%;" class="progress-bar progress-bar-yellow"><span class="sr-only">78% Complete (success)</span>
</div>
</div>
</a>
</li>
</ul>
</div>
</li>
<li class="last"><a href="page-blog-item.html" target="_blank">See all tasks</a>
</li>
</ul>
</li>
<li class="dropdown topbar-user">
<a data-hover="dropdown" href="#" class="dropdown-toggle"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/48.jpg" alt="" class="img-responsive img-circle" /> <span class="hidden-xs">John Doe</span> <span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-user pull-right">
<li><a href="extra-profile.html"><i class="fa fa-user"></i>My Profile</a>
</li>
<li><a href="page-calendar.html"><i class="fa fa-calendar"></i>My Calendar</a>
</li>
<li><a href="email-inbox.html"><i class="fa fa-envelope"></i>My Inbox<span class="badge badge-danger">3</span></a>
</li>
<li><a href="#"><i class="fa fa-tasks"></i>My Tasks<span class="badge badge-success">7</span></a>
</li>
<li class="divider"></li>
<li><a href="extra-lock-screen.html"><i class="fa fa-lock"></i>Lock Screen</a>
</li>
<li><a href="extra-signin.html"><i class="fa fa-key"></i>Log Out</a>
</li>
</ul>
</li>
<li id="topbar-chat" class="hidden-xs"><a href="javascript:void(0)" class="btn-chat"><i class="fa fa-comments"></i><span class="badge badge-info">3</span></a>
</li>
<li class="dropdown hidden-xs">
<!--BEGIN THEME SETTING--><a id="theme-setting" href="javascript:;" data-hover="dropdown" data-step="1" data-intro="<b>Header</b>, <b>sidebar</b>, <b>border style</b> and <b>color</b>, all of them can change for you to create the best" data-position="left" class="dropdown-toggle"><i class="fa fa-cogs"></i></a>
<ul class="dropdown-menu dropdown-theme-setting pull-right">
<li>
<h4 class="mtn">Theme Styles</h4>
<select id="list-style" class="form-control">
<option value="style1">Flat Squared style</option>
<option value="style2">Flat Rounded style</option>
<option value="style3">Flat Border style</option>
</select>
</li>
<li>
<h4 class="mtn">Menu Styles</h4>
<select id="list-menu" class="form-control">
<option value="sidebar-default">Menu style 1</option>
<option value="sidebar-colors">Menu style 2</option>
<option value="sidebar-icons">Menu style 3</option>
<option value="sidebar-collapsed">Menu style 4</option>
</select>
</li>
<li>
<h4 class="mtn">Header & Sidebar</h4>
<select id="list-header" class="form-control">
<option value="header-static">Static</option>
<option value="header-fixed">Fixed</option>
</select>
</li>
<li>
<h4 class="mtn">Theme Colors</h4>
<ul id="list-color" class="list-unstyled list-inline">
<li data-color="green-dark" data-hover="tooltip" title="Green - Dark" class="green-dark"></li>
<li data-color="red-dark" data-hover="tooltip" title="Red - Dark" class="red-dark"></li>
<li data-color="pink-dark" data-hover="tooltip" title="Pink - Dark" class="pink-dark"></li>
<li data-color="blue-dark" data-hover="tooltip" title="Blue - Dark" class="blue-dark"></li>
<li data-color="yellow-dark" data-hover="tooltip" title="Yellow - Dark" class="yellow-dark"></li>
<li data-color="green-grey" data-hover="tooltip" title="Green - Grey" class="green-grey"></li>
<li data-color="red-grey" data-hover="tooltip" title="Red - Grey" class="red-grey"></li>
<li data-color="pink-grey" data-hover="tooltip" title="Pink - Grey" class="pink-grey"></li>
<li data-color="blue-grey" data-hover="tooltip" title="Blue - Grey" class="blue-grey"></li>
<li data-color="yellow-grey" data-hover="tooltip" title="Yellow - Grey" class="yellow-grey"></li>
<li data-color="yellow-green" data-hover="tooltip" title="Yellow - Green" class="yellow-green"></li>
<li data-color="orange-grey" data-hover="tooltip" title="Orange - Grey" class="orange-grey"></li>
<li data-color="pink-blue" data-hover="tooltip" title="Pink - Blue" class="pink-blue"></li>
<li data-color="pink-violet" data-hover="tooltip" title="Pink - Violet" class="pink-violet active"></li>
<li data-color="orange-violet" data-hover="tooltip" title="Orange - Violet" class="orange-violet"></li>
<li data-color="pink-green" data-hover="tooltip" title="Pink - Green" class="pink-green"></li>
<li data-color="pink-brown" data-hover="tooltip" title="Pink - Brown" class="pink-brown"></li>
<li data-color="orange-blue" data-hover="tooltip" title="Orange - Blue" class="orange-blue"></li>
<li data-color="yellow-blue" data-hover="tooltip" title="Yellow - Blue" class="yellow-blue"></li>
<li data-color="green-blue" data-hover="tooltip" title="Green - Blue" class="green-blue"></li>
</ul>
</li>
</ul>
<!--END THEME SETTING-->
</li>
</ul>
</div>
</nav>
<!--BEGIN MODAL CONFIG PORTLET-->
<div id="modal-config" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" data-dismiss="modal" aria-hidden="true" class="close">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifend et nisl eget porta. Curabitur elementum sem molestie nisl varius, eget tempus odio molestie. Nunc vehicula sem arcu, eu pulvinar neque cursus ac. Aliquam ultricies lobortis magna et aliquam. Vestibulum egestas eu urna sed ultricies. Nullam pulvinar dolor vitae quam dictum condimentum. Integer a sodales elit, eu pulvinar leo. Nunc nec aliquam nisi, a mollis neque. Ut vel felis quis tellus hendrerit placerat. Vivamus vel nisl non magna feugiat dignissim sed ut nibh. Nulla elementum, est a pretium hendrerit, arcu risus luctus augue, mattis aliquet orci ligula eget massa. Sed ut ultricies felis.</p>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<!--END MODAL CONFIG PORTLET-->
</div>
<!--END TOPBAR-->
<div id="wrapper">
<!--BEGIN SIDEBAR MENU-->
<nav id="sidebar" role="navigation" class="navbar-default navbar-static-side">
<div class="sidebar-collapse menu-scroll">
<ul id="side-menu" class="nav">
<li class="user-panel">
<div class="thumb"><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/128.jpg" alt="" class="img-circle" />
</div>
<div class="info">
<p>John Doe</p>
<ul class="list-inline list-unstyled">
<li><a href="extra-profile.html" data-hover="tooltip" title="Profile"><i class="fa fa-user"></i></a>
</li>
<li><a href="email-inbox.html" data-hover="tooltip" title="Mail"><i class="fa fa-envelope"></i></a>
</li>
<li><a href="#" data-hover="tooltip" title="Setting" data-toggle="modal" data-target="#modal-config"><i class="fa fa-cog"></i></a>
</li>
<li><a href="extra-signin.html" data-hover="tooltip" title="Logout"><i class="fa fa-sign-out"></i></a>
</li>
</ul>
</div>
<div class="clearfix"></div>
</li>
<li><a href="index.html"><i class="fa fa-tachometer fa-fw"><div class="icon-bg bg-orange"></div></i><span class="menu-title">Dashboard</span></a>
</li>
<li><a href="http://madmin.swlabs.co/" target="_blank"><i class="fa fa-bullhorn fa-fw"><div class="icon-bg bg-orange"></div></i><span class="menu-title">Angular JS Version</span><span class="label label-violet">v4.0</span></a>
</li>
<li><a href="#"><i class="fa fa-laptop fa-fw"><div class="icon-bg bg-pink"></div></i><span class="menu-title">Frontend</span><span class="fa arrow"></span><span class="label label-yellow">v3.0</span></a>
<ul class="nav nav-second-level">
<li><a href="frontend-one-page.html"><i class="fa fa-rocket"></i><span class="submenu-title">One Page</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-desktop fa-fw"><div class="icon-bg bg-pink"></div></i><span class="menu-title">Layouts</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="layout-left-sidebar.html"><i class="fa fa-align-left"></i><span class="submenu-title">Left Sidebar</span></a>
</li>
<li><a href="layout-left-sidebar-collapsed.html"><i class="fa fa-angle-double-left"></i><span class="submenu-title">Left Sidebar Collapsed</span></a>
</li>
<li><a href="layout-right-sidebar.html"><i class="fa fa-align-right"></i><span class="submenu-title">Right Sidebar</span></a>
</li>
<li><a href="layout-right-sidebar-collapsed.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Right Sidebar Collapsed</span></a>
</li>
<li><a href="layout-horizontal-menu.html"><i class="fa fa-header"></i><span class="submenu-title">Horizontal Menu</span></a>
</li>
<li><a href="layout-horizontal-menu-sidebar.html"><i class="fa fa-h-square"></i><span class="submenu-title">Horizontal Menu & Sidebar</span></a>
</li>
<li><a href="layout-fixed-topbar.html"><i class="fa fa-magnet"></i><span class="submenu-title">Fixed Topbar</span></a>
</li>
<li><a href="layout-boxed.html"><i class="fa fa-columns"></i><span class="submenu-title">Boxed Layout</span></a>
</li>
<li><a href="layout-hidden-footer.html"><i class="fa fa-eye-slash"></i><span class="submenu-title">Hidden Footer</span></a>
</li>
<li><a href="layout-header-topbar.html"><i class="fa fa-paperclip"></i><span class="submenu-title">Header & Topbar</span></a>
</li>
<li><a href="layout-title-breadcrumb.html"><i class="fa fa-link"></i><span class="submenu-title">Title & Breadcrumb</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-send-o fa-fw"><div class="icon-bg bg-green"></div></i><span class="menu-title">UI Elements</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="ui-generals.html"><i class="fa fa-briefcase"></i><span class="submenu-title">Generals</span></a>
</li>
<li><a href="ui-portlets.html"><i class="fa fa-instagram"></i><span class="submenu-title">Portlets</span></a>
</li>
<li><a href="ui-buttons.html"><i class="fa fa-hand-o-up"></i><span class="submenu-title">Buttons</span></a>
</li>
<li><a href="ui-tabs.html"><i class="fa fa-trello"></i><span class="submenu-title">Tabs</span></a>
</li>
<li><a href="ui-progressbars.html"><i class="fa fa-ellipsis-h"></i><span class="submenu-title">Progress Bars</span></a>
</li>
<li><a href="ui-typography.html"><i class="fa fa-font"></i><span class="submenu-title">Typography</span></a>
</li>
<li><a href="ui-modals.html"><i class="fa fa-list-alt"></i><span class="submenu-title">Modals</span></a>
</li>
<li><a href="ui-sliders.html"><i class="fa fa-arrows-h"></i><span class="submenu-title">Sliders</span></a>
</li>
<li><a href="ui-icons.html"><i class="fa fa-tint"></i><span class="submenu-title">Icons</span></a>
</li>
<li><a href="ui-checkbox-radio.html"><i class="fa fa-dot-circle-o"></i><span class="submenu-title">Checkbox & Radio</span></a>
</li>
<li><a href="ui-panels.html"><i class="fa fa-th-large"></i><span class="submenu-title">Panels</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-rocket fa-fw"><div class="icon-bg bg-green"></div></i><span class="menu-title">UI Advanced</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="ui-preloader.html"><i class="fa fa-spinner"></i><span class="submenu-title">Preloader</span><span class="label label-yellow">v4.1</span></a>
</li>
<li><a href="ui-editors.html"><i class="fa fa-edit"></i><span class="submenu-title">Editors</span></a>
</li>
<li><a href="ui-nestable-list.html"><i class="fa fa-list-ol"></i><span class="submenu-title">Nestable List</span></a>
</li>
<li><a href="ui-dropdown-select.html"><i class="fa fa-level-down"></i><span class="submenu-title">Dropdown Select</span><span class="label label-yellow">v2.1</span></a>
</li>
<li><a href="ui-notific8-notifications.html"><i class="fa fa-exclamation-circle"></i><span class="submenu-title">Notific8 & Message</span><span class="label label-blue">v2.1</span></a>
</li>
<li><a href="ui-toastr-notifications.html"><i class="fa fa-exclamation-triangle"></i><span class="submenu-title">Toastr Notifications</span></a>
</li>
<li><a href="ui-treeview.html"><i class="fa fa-tasks"></i><span class="submenu-title">Tree View</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-edit fa-fw"><div class="icon-bg bg-violet"></div></i><span class="menu-title">Forms</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="form-layouts.html"><i class="fa fa-columns"></i><span class="submenu-title">Form Layouts</span></a>
</li>
<li><a href="form-basic.html"><i class="fa fa-file-text-o"></i><span class="submenu-title">Form Basics</span></a>
</li>
<li><a href="form-components.html"><i class="fa fa-cube"></i><span class="submenu-title">Form Components</span></a>
</li>
<li><a href="form-xeditable.html"><i class="fa fa-edit"></i><span class="submenu-title">Form X-editable</span></a>
</li>
<li><a href="form-wizard.html"><i class="fa fa-magic"></i><span class="submenu-title">Form Wizard</span></a>
</li>
<li><a href="form-validation.html"><i class="fa fa-exclamation"></i><span class="submenu-title">Form Validation</span></a>
</li>
<li><a href="form-multiple-file-upload.html"><i class="fa fa-upload"></i><span class="submenu-title">Multiple File Upload</span></a>
</li>
<li><a href="form-dropzone-file-upload.html"><i class="fa fa-cloud-upload"></i><span class="submenu-title">Dropzone File Upload</span></a>
</li>
</ul>
</li>
<li class="active"><a href="#"><i class="fa fa-th-list fa-fw"><div class="icon-bg bg-blue"></div></i><span class="menu-title">Tables</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level in">
<li><a href="table-basic.html"><i class="fa fa-th-large"></i><span class="submenu-title">Basic Tables</span></a>
</li>
<li><a href="table-responsive.html"><i class="fa fa-tablet"></i><span class="submenu-title">Responsive Tables</span></a>
</li>
<li class="active"><a href="table-action.html"><i class="fa fa-tencent-weibo"></i><span class="submenu-title">Action Tables</span></a>
</li>
<li><a href="table-filter.html"><i class="fa fa-filter"></i><span class="submenu-title">Filter Tables</span></a>
</li>
<li><a href="table-advanced.html"><i class="fa fa-indent"></i><span class="submenu-title">Advanced Tables</span></a>
</li>
<li><a href="table-export.html"><i class="fa fa-paperclip"></i><span class="submenu-title">Table Export</span><span class="label label-yellow">v2.1</span></a>
</li>
<li></li>
<li><a href="table-editable.html"><i class="fa fa-edit"></i><span class="submenu-title">Jeditable</span><span class="label label-blue">v2.0 </span></a>
</li>
<li><a href="table-datatables.html"><i class="fa fa-list-alt"></i><span class="submenu-title">DataTables</span><span class="label label-pink">v2.0</span></a>
</li>
<li><a href="table-sample.html"><i class="fa fa-table"></i><span class="submenu-title">Sample Tables</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-database fa-fw"><div class="icon-bg bg-red"></div></i><span class="menu-title">Data Grids</span><span class="fa arrow"></span><span class="label label-yellow">Hot</span></a>
<ul class="nav nav-second-level">
<li><a href="#"><i class="fa fa-th-large"></i><span class="submenu-title">Layout Examples</span><span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a href="grid-layout-div.html"><i class="fa fa-angle-right"></i><span class="submenu-title">DIVs Layout</span></a>
</li>
<li><a href="grid-layout-table-1.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Table Demo 1</span></a>
</li>
<li><a href="grid-layout-table-2.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Table Demo 2</span></a>
</li>
<li><a href="grid-layout-2-table.html"><i class="fa fa-angle-right"></i><span class="submenu-title">2 Tables on the Page</span></a>
</li>
<li><a href="grid-layout-ul-li.html"><i class="fa fa-angle-right"></i><span class="submenu-title">UL LI</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-tencent-weibo"></i><span class="submenu-title">Actions Examples</span><span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a href="grid-filter-with-ul-li.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Filters With UL/LI</span></a>
</li>
<li><a href="grid-filter-with-select.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Filters With SELECT</span></a>
</li>
<li><a href="grid-double-sort.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Double Sort</span></a>
</li>
<li><a href="grid-deep-linking.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Deep Linking</span></a>
</li>
<li><a href="grid-pagination-only.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Pagination Only</span></a>
</li>
<li><a href="grid-without-item-per-page.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Without "Items per Page"</span></a>
</li>
<li><a href="grid-hidden-sort.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Hidden Sort</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-table"></i><span class="submenu-title">jPList with jQuery UI</span><span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a href="grid-range-slider.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Range Slider</span></a>
</li>
<li><a href="grid-datepicker.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Date Picker Filter</span></a>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-file-o fa-fw"><div class="icon-bg bg-yellow"></div></i><span class="menu-title">Pages</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="page-gallery.html"><i class="fa fa-suitcase"></i><span class="submenu-title">Gallery</span></a>
</li>
<li><a href="page-timeline.html"><i class="fa fa-steam"></i><span class="submenu-title">Timeline</span></a>
</li>
<li><a href="page-blog.html"><i class="fa fa-puzzle-piece"></i><span class="submenu-title">Blog</span></a>
</li>
<li><a href="page-blog-item.html"><i class="fa fa-chain"></i><span class="submenu-title">Blog Item</span></a>
</li>
<li><a href="page-about.html"><i class="fa fa-group"></i><span class="submenu-title">About Us</span></a>
</li>
<li><a href="page-contact.html"><i class="fa fa-send-o"></i><span class="submenu-title">Contact Us</span></a>
</li>
<li><a href="page-calendar.html"><i class="fa fa-calendar"></i><span class="submenu-title">Full Calendar</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-gift fa-fw"><div class="icon-bg bg-grey"></div></i><span class="menu-title">Extras</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="extra-profile.html"><i class="fa fa-user"></i><span class="submenu-title">User Profile</span></a>
</li>
<li><a href="extra-signin.html"><i class="fa fa-sign-in"></i><span class="submenu-title">Sign In</span></a>
</li>
<li><a href="extra-signup.html"><i class="fa fa-sign-out"></i><span class="submenu-title">Sign Up</span></a>
</li>
<li><a href="extra-lock-screen.html"><i class="fa fa-lock"></i><span class="submenu-title">Lock Screen</span></a>
</li>
<li><a href="extra-user-list.html"><i class="fa fa-user"></i><span class="submenu-title">User List</span><span class="label label-yellow">v2.1</span></a>
</li>
<li><a href="extra-invoice.html"><i class="fa fa-print"></i><span class="submenu-title">Invoice</span></a>
</li>
<li><a href="extra-faq.html"><i class="fa fa-graduation-cap"></i><span class="submenu-title">FAQ</span></a>
</li>
<li><a href="extra-pricing-table.html"><i class="fa fa-money"></i><span class="submenu-title">Pricing Tables</span></a>
</li>
<li><a href="extra-blank.html"><i class="fa fa-file-o"></i><span class="submenu-title">Blank</span></a>
</li>
<li><a href="extra-404.html"><i class="fa fa-exclamation-circle"></i><span class="submenu-title">404 Page</span></a>
</li>
<li><a href="extra-500.html"><i class="fa fa-exclamation-circle"></i><span class="submenu-title">500 Page</span></a>
</li>
<li><a href="javascript:void(0)" title="FullScreen" class="btn-fullscreen"><i class="fa fa-arrows"></i><span class="submenu-title">Full Screen</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-sitemap fa-fw"><div class="icon-bg bg-dark"></div></i><span class="menu-title">Multi-Level Dropdown</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="#"><i class="fa fa-angle-right"></i><span class="submenu-title">Second Level Item</span></a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i><span class="submenu-title">Second Level Item</span></a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i><span class="submenu-title">Third Level</span><span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a href="#"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Third Level Item</span></a>
</li>
<li><a href="#"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Third Level Item</span></a>
</li>
<li><a href="#"><i class="fa fa-angle-double-right"></i><span class="submenu-title"> Third Level Item</span></a>
</li>
<li><a href="#"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Third Level Item</span></a>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-envelope-o"><div class="icon-bg bg-primary"></div></i><span class="menu-title">Email</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="email-inbox.html"><i class="fa fa-inbox"></i><span class="submenu-title">Inbox</span></a>
</li>
<li><a href="email-compose-mail.html"><i class="fa fa-pencil"></i><span class="submenu-title">Compose Mail</span></a>
</li>
<li><a href="email-view-mail.html"><i class="fa fa-eye"></i><span class="submenu-title">View Mail</span></a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-bar-chart-o fa-fw"><div class="icon-bg bg-orange"></div></i><span class="menu-title">Charts</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="charts-flotchart.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Flot Charts</span></a>
</li>
<li><a href="charts-chartjs.html"><i class="fa fa-angle-right"></i><span class="submenu-title">Chartjs</span></a>
</li>
<li><a href="#"><i class="fa fa-angle-right"></i><span class="submenu-title">HighCharts</span><span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a href="charts-highchart-line.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Line Charts</span></a>
</li>
<li><a href="charts-highchart-area.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Area Charts</span></a>
</li>
<li><a href="charts-highchart-column-bar.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Column & Bar Charts</span></a>
</li>
<li><a href="charts-highchart-pie.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Pie Charts</span></a>
</li>
<li><a href="charts-highchart-scatter-bubble.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Scatter & Bubble Charts</span></a>
</li>
<li><a href="charts-highchart-dynamic.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Dynamic Charts</span></a>
</li>
<li><a href="charts-highchart-combinations.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">Combinations</span></a>
</li>
<li><a href="charts-highchart-more.html"><i class="fa fa-angle-double-right"></i><span class="submenu-title">More Chart Types</span></a>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="animations.html"><i class="fa fa-slack fa-fw"><div class="icon-bg bg-green"></div></i><span class="menu-title">Animations</span></a>
</li>
<!--li.charts-sum<div id="ajax-loaded-data-sidebar"></div>-->
</ul>
</div>
</nav>
<!--END SIDEBAR MENU-->
<!--BEGIN CHAT FORM-->
<div id="chat-form" class="fixed">
<div class="chat-inner">
<h2 class="chat-header"><a href="javascript:;" class="chat-form-close pull-right"><i class="glyphicon glyphicon-remove"></i></a><i class="fa fa-user"></i>
Chat
<span class="badge badge-info">3</span></h2>
<div id="group-1" class="chat-group"><strong>Favorites</strong><a href="#"><span class="user-status is-online"></span><small>Verna Morton</small><span class="badge badge-info">2</span></a><a href="#"><span class="user-status is-online"></span><small>Delores Blake</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-busy"></span><small>Nathaniel Morris</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-idle"></span><small>Boyd Bridges</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-offline"></span><small>Meredith Houston</small><span class="badge badge-info is-hidden">0</span></a>
</div>
<div id="group-2" class="chat-group"><strong>Office</strong><a href="#"><span class="user-status is-busy"></span><small>Ann Scott</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-offline"></span><small>Sherman Stokes</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-offline"></span><small>Florence Pierce</small><span class="badge badge-info">1</span></a>
</div>
<div id="group-3" class="chat-group"><strong>Friends</strong><a href="#"><span class="user-status is-online"></span><small>Willard Mckenzie</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-busy"></span><small>Jenny Frazier</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-offline"></span><small>Chris Stewart</small><span class="badge badge-info is-hidden">0</span></a><a href="#"><span class="user-status is-offline"></span><small>Olivia Green</small><span class="badge badge-info is-hidden">0</span></a>
</div>
</div>
<div id="chat-box" style="top:400px">
<div class="chat-box-header"><a href="#" class="chat-box-close pull-right"><i class="glyphicon glyphicon-remove"></i></a><span class="user-status is-online"></span><span class="display-name">Willard Mckenzie</span><small>Online</small>
</div>
<div class="chat-content">
<ul class="chat-box-body">
<li>
<p><img src="https://s3.amazonaws.com/uifaces/faces/twitter/kolage/128.jpg" class="avt" /><span class="user">John Doe</span><span class="time">09:33</span>
</p>
<p>Hi Swlabs, we have some comments for you.</p>
</li>
<li class="odd">
<p><img src="https://s3.amazonaws.com/uifaces/faces/twitter/alagoon/48.jpg" class="avt" /><span class="user">Swlabs</span><span class="time">09:33</span>
</p>
<p>Hi, we're listening you...</p>
</li>
</ul>
</div>
<div class="chat-textarea">
<input placeholder="Type your message" class="form-control" />
</div>
</div>
</div>
<!--END CHAT FORM-->
<!--BEGIN PAGE WRAPPER-->
<div id="page-wrapper">
<!--BEGIN TITLE & BREADCRUMB PAGE-->
<div id="title-breadcrumb-option-demo" class="page-title-breadcrumb">
<div class="page-header pull-left">
<div class="page-title">Action Tables</div>
</div>
<ol class="breadcrumb page-breadcrumb">
<li><i class="fa fa-home"></i> <a href="index.html">Home</a> <i class="fa fa-angle-right"></i> </li>
<li><a href="#">Tables</a> <i class="fa fa-angle-right"></i> </li>
<li class="active">Action Tables</li>
</ol>
<div class="btn btn-blue reportrange hide"><i class="fa fa-calendar"></i> <span></span> report <i class="fa fa-angle-down"></i>
<input type="hidden" name="datestart" />
<input type="hidden" name="endstart" />
</div>
<div class="clearfix"></div>
</div>
<!--END TITLE & BREADCRUMB PAGE-->
<!--BEGIN CONTENT-->
<div class="page-content">
<div id="table-action" class="row">
<div class="col-lg-12">
<ul id="tableactiondTab" class="nav nav-tabs">
<li class="active"><a href="#table-table-tab" data-toggle="tab">Action Tables</a>
</li>
<li><a href="#table-row-tab" data-toggle="tab">Action Rows</a>
</li>
<li><a href="#table-panel-tab" data-toggle="tab">Action Panels</a>
</li>
</ul>
<div id="tableactionTabContent" class="tab-content">
<div id="table-table-tab" class="tab-pane fade in active">
<div class="row">
<div class="col-lg-12">
<h4 class="box-heading">Pagination</h4>
<div class="table-container">
<div class="row mbm">
<div class="col-lg-6">
<div class="pagination-panel">Page
<a href="#" class="btn btn-sm btn-default btn-prev"><i class="fa fa-angle-left"></i></a>
<input type="text" maxlenght="5" value="1" class="pagination-panel-input form-control input-mini input-inline input-sm text-center" /> <a href="#" class="btn btn-sm btn-default btn-prev"><i class="fa fa-angle-right"></i></a> of 6 | View
<select class="form-control input-xsmall input-sm input-inline">
<option value="20" selected="selected">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="-1">All</option>
</select> records | Found total 58 records</div>
</div>
<div class="col-lg-6 text-right">
<div class="pagination-panel">
<ul class="pagination pagination-sm man">
<li><a href="#">«</a>
</li>
<li><a href="#">1</a>
</li>
<li><a href="#">2</a>
</li>
<li><a href="#">3</a>
</li>
<li><a href="#">4</a>
</li>
<li><a href="#">5</a>
</li>
<li><a href="#">»</a>
</li>
</ul>
</div>
</div>
</div>
<table class="table table-hover table-striped table-bordered table-advanced tablesorter">
<thead>
<tr>
<th width="3%">
<input type="checkbox" class="checkall" />
</th>
<th width="9%">Record #</th>
<th>Username</th>
<th width="10%">Country</th>
<th width="10%">Gender</th>
<th width="7%">Order</th>
<th width="12%">Date</th>
<th width="10%">Price</th>
<th width="9%">Status</th>
<th width="12%">Actions</th>
</tr>
<tbody>
<tr>
<td>
<input type="checkbox" />
</td>
<td>1</td>
<td>Henry</td>
<td>United States</td>
<td>Male</td>
<td>32</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>2</td>
<td>John</td>
<td>United States</td>
<td>Female</td>
<td>45</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-info">Pending</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>3</td>
<td>Larry</td>
<td>United States</td>
<td>Female</td>
<td>40</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-warning">Suspended</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>4</td>
<td>Lahm</td>
<td>United States</td>
<td>Female</td>
<td>15</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-danger">Blocked</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>5</td>
<td>Henry</td>
<td>United States</td>
<td>Male</td>
<td>32</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
</tbody>
</thead>
</table>
<div class="row">
<div class="col-lg-6">
<div class="pagination-panel">Page
<a href="#" class="btn btn-sm btn-default btn-prev"><i class="fa fa-angle-left"></i></a>
<input type="text" maxlenght="5" value="1" class="pagination-panel-input form-control input-mini input-inline input-sm text-center" /> <a href="#" class="btn btn-sm btn-default btn-prev"><i class="fa fa-angle-right"></i></a> of 6 | View
<select class="form-control input-xsmall input-sm input-inline">
<option value="20" selected="selected">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="-1">All</option>
</select> records | Found total 58 records</div>
</div>
<div class="col-lg-6 text-right">
<div class="pagination-panel">
<ul class="pagination pagination-sm man">
<li><a href="#">«</a>
</li>
<li><a href="#">1</a>
</li>
<li><a href="#">2</a>
</li>
<li><a href="#">3</a>
</li>
<li><a href="#">4</a>
</li>
<li><a href="#">5</a>
</li>
<li><a href="#">»</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<hr class="mtxl mbxl" />
<h4 class="box-heading">Search Filter</h4>
<div class="table-container">
<div class="row mbl">
<div class="col-lg-6">
<div class="input-group input-group-sm mbs"><span class="input-group-btn"><button type="button" data-toggle="dropdown" class="btn btn-danger dropdown-toggle">Filter
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#"><i class="fa fa-tint"></i>
Newest</a>
</li>
<li><a href="#"><i class="fa fa-star"></i>
Rating</a>
</li>
<li><a href="#"><i class="fa fa-money"></i>
Price</a>
</li>
<li><a href="#"><i class="fa fa-user"></i>
Sales</a>
</li>
</ul>
</span>
<input type="text" placeholder="Enter here..." class="form-control" /><span class="input-group-btn"><button type="button" data-toggle="dropdown" class="btn btn-success dropdown-toggle">Search</button></span>
</div>
</div>
<div class="col-lg-6">
<div class="tb-group-actions pull-right"><span>10 records selected:</span>
<select class="table-group-action-input form-control input-inline input-small input-sm mlm">
<option value="">Select...</option>
<option value="Cancel">Cancel</option>
<option value="Cancel">Hold</option>
<option value="Cancel">On Hold</option>
<option value="Close">Close</option>
</select>
<button class="btn btn-sm btn-primary"><i class="fa fa-check"></i> Submit
</button>
</div>
</div>
</div>
<table class="table table-hover table-striped table-bordered table-advanced tablesorter">
<thead>
<tr>
<th width="3%">
<input type="checkbox" class="checkall" />
</th>
<th width="9%">Record #</th>
<th>Username</th>
<th width="10%">Country</th>
<th width="10%">Gender</th>
<th width="7%">Order</th>
<th width="12%">Date</th>
<th width="10%">Price</th>
<th width="9%">Status</th>
<th width="12%">Actions</th>
</tr>
<tbody>
<tr>
<td>
<input type="checkbox" />
</td>
<td>1</td>
<td>Henry</td>
<td>United States</td>
<td>Male</td>
<td>32</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>2</td>
<td>John</td>
<td>United States</td>
<td>Female</td>
<td>45</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-info">Pending</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>3</td>
<td>Larry</td>
<td>United States</td>
<td>Female</td>
<td>40</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-warning">Suspended</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>4</td>
<td>Lahm</td>
<td>United States</td>
<td>Female</td>
<td>15</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-danger">Blocked</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>5</td>
<td>Henry</td>
<td>United States</td>
<td>Male</td>
<td>32</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
</tbody>
</thead>
</table>
</div>
</div>
</div>
</div>
<div id="table-row-tab" class="tab-pane fade">
<div class="row">
<div class="col-lg-12">
<table class="table table-hover table-striped table-bordered table-advanced tablesorter">
<thead>
<tr>
<th width="3%">
<input type="checkbox" class="checkall" />
</th>
<th width="7%">Record #</th>
<th>Username</th>
<th width="10%">Country</th>
<th width="10%">Gender</th>
<th width="7%">Order</th>
<th width="10%">Date</th>
<th width="15%">Skills</th>
<th width="7%">Status</th>
<th width="12%">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" />
</td>
<td>1</td>
<td>Henry</td>
<td>United States</td>
<td>
<select class="form-control">
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td>
<input type="text" value="32" class="spinner input-mini" />
</td>
<td>20-05-2014</td>
<td>
<div data-hover="tooltip" title="75%" class="progress progress-xs mbs">
<div role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%;" class="progress-bar progress-bar-green"><span class="sr-only">75% Complete</span>
</div>
</div>
</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
<button type="button" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> Delete
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>2</td>
<td>John</td>
<td>United States</td>
<td>
<select class="form-control">
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td>
<input type="text" value="45" class="spinner input-mini" />
</td>
<td>20-05-2014</td>
<td>
<div data-hover="tooltip" title="40%" class="progress progress-xs mbs">
<div role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%;" class="progress-bar progress-bar-red six-sec-ease-in-out"><span class="sr-only">40% Complete</span>
</div>
</div>
</td>
<td><span class="label label-sm label-info">Pending</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
<button type="button" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> Delete
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>3</td>
<td>Larry</td>
<td>United States</td>
<td>
<select class="form-control">
<option>Male</option>
<option selected="selected">Female</option>
<option>Other</option>
</select>
</td>
<td>
<input type="text" value="40" class="spinner input-mini" />
</td>
<td>20-05-2014</td>
<td>
<div data-hover="tooltip" title="80%" class="progress progress-xs mbs">
<div role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%;" class="progress-bar progress-bar-yellow"><span class="sr-only">80% Complete</span>
</div>
</div>
</td>
<td><span class="label label-sm label-warning">Suspended</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
<button type="button" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> Delete
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>4</td>
<td>Lahm</td>
<td>United States</td>
<td>
<select class="form-control">
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td>
<input type="text" value="15" class="spinner input-mini" />
</td>
<td>20-05-2014</td>
<td>
<div data-hover="tooltip" title="60%" class="progress progress-xs mbs">
<div role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;" class="progress-bar progress-bar-violet"><span class="sr-only">60% Complete</span>
</div>
</div>
</td>
<td><span class="label label-sm label-danger">Blocked</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
<button type="button" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> Delete
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="table-panel-tab" class="tab-pane fade">
<div class="row">
<div class="col-lg-12">
<div class="portlet portlet-white">
<div class="portlet-header pam mbn">
<div class="caption">Customer Listing</div>
<div class="actions"><a href="#" class="btn btn-info btn-sm"><i class="fa fa-plus"></i>
New Customer</a>
<div class="btn-group"><a href="#" data-toggle="dropdown" class="btn btn-warning btn-sm dropdown-toggle"><i class="fa fa-wrench"></i>
Tools</a>
<ul class="dropdown-menu pull-right">
<li><a href="#">Export to Excel</a>
</li>
<li><a href="#">Export to CSV</a>
</li>
<li><a href="#">Export to XML</a>
</li>
<li class="divider"></li>
<li><a href="#">Print Invoices</a>
</li>
</ul>
</div>
</div>
</div>
<div class="portlet-body pan">
<table class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
<thead>
<tr>
<th width="3%">
<input type="checkbox" class="checkall" />
</th>
<th width="9%">Record #</th>
<th>Username</th>
<th width="10%">Country</th>
<th width="10%">Gender</th>
<th width="7%">Order</th>
<th width="12%">Date</th>
<th width="10%">Price</th>
<th width="9%">Status</th>
<th width="12%">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" />
</td>
<td>1</td>
<td>Henry</td>
<td>United States</td>
<td>Male</td>
<td>32</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>2</td>
<td>John</td>
<td>United States</td>
<td>Female</td>
<td>45</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-info">Pending</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>3</td>
<td>Larry</td>
<td>United States</td>
<td>Female</td>
<td>40</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-warning">Suspended</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>4</td>
<td>Lahm</td>
<td>United States</td>
<td>Female</td>
<td>15</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-danger">Blocked</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>5</td>
<td>Henry</td>
<td>United States</td>
<td>Male</td>
<td>32</td>
<td>20-05-2014</td>
<td>$240.50</td>
<td><span class="label label-sm label-success">Approved</span>
</td>
<td>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--END CONTENT-->
</div>
<!--BEGIN FOOTER-->
<div id="footer">
<div class="copyright">2014 © μAdmin - Responsive Multi-Style Admin Template</div>
</div>
<!--END FOOTER-->
<!--END PAGE WRAPPER-->
</div>
</div>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery-migrate-1.2.1.min.js"></script>
<script src="js/jquery-ui.js"></script>
<!--loading bootstrap js-->
<script src="vendors/bootstrap/js/bootstrap.min.js"></script>
<script src="vendors/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js"></script>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<script src="vendors/metisMenu/jquery.metisMenu.js"></script>
<script src="vendors/slimScroll/jquery.slimscroll.js"></script>
<script src="vendors/jquery-cookie/jquery.cookie.js"></script>
<script src="vendors/iCheck/icheck.min.js"></script>
<script src="vendors/iCheck/custom.min.js"></script>
<script src="vendors/jquery-notific8/jquery.notific8.min.js"></script>
<script src="vendors/jquery-highcharts/highcharts.js"></script>
<script src="js/jquery.menu.js"></script>
<script src="vendors/jquery-pace/pace.min.js"></script>
<script src="vendors/holder/holder.js"></script>
<script src="vendors/responsive-tabs/responsive-tabs.js"></script>
<script src="vendors/jquery-news-ticker/jquery.newsTicker.min.js"></script>
<script src="vendors/moment/moment.js"></script>
<script src="vendors/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<!--CORE JAVASCRIPT-->
<script src="js/main.js"></script>
<!--LOADING SCRIPTS FOR PAGE-->
<script src="js/table-action.js"></script>
<script type="text/javascript">
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-145464-14', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
|
{
"content_hash": "031fb2d1d0802bb00f201c4dd104f5f9",
"timestamp": "",
"source": "github",
"line_count": 1503,
"max_line_length": 754,
"avg_line_length": 83.70924817032602,
"alnum_prop": 0.32224297579779837,
"repo_name": "chenxuewei/WeDo",
"id": "e11541b323218a225864c057d8f71f085a6f4938",
"size": "125818",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "views/public/table-action.html",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1030"
},
{
"name": "CSS",
"bytes": "1032427"
},
{
"name": "HTML",
"bytes": "9586330"
},
{
"name": "JavaScript",
"bytes": "2996520"
},
{
"name": "PHP",
"bytes": "398738"
}
],
"symlink_target": ""
}
|
package com.kodesport.calculator;
import com.vaadin.testbench.ScreenshotOnFailureRule;
import com.vaadin.testbench.TestBenchTestCase;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.LabelElement;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
/**
* This class contains JUnit tests, which are run using Vaadin TestBench 4.
*
* To run this, first get an evaluation license from
* https://vaadin.com/addon/vaadin-testbench and follow the instructions at
* https://vaadin.com/directory/help/installing-cval-license to install it.
*
* Once the license is installed, you can run this class as a JUnit test.
*/
public class CalculatorTest extends TestBenchTestCase {
@Rule
public ScreenshotOnFailureRule screenshotOnFailureRule =
new ScreenshotOnFailureRule(this, true);
@Before
public void setUp() throws Exception {
setDriver(new FirefoxDriver()); // Firefox
// To use Chrome, first install chromedriver.exe from
// http://chromedriver.storage.googleapis.com/index.html
// on your system path (e.g. C:\Windows\System32\)
// setDriver(new ChromeDriver()); // Chrome
// To use Internet Explorer, first install iedriverserver.exe from
// http://selenium-release.storage.googleapis.com/index.html?path=2.43/
// on your system path (e.g. C:\Windows\System32\)
// setDriver(new InternetExplorerDriver()); // IE
// To test headlessly (without a browser), first install phantomjs.exe
// from http://phantomjs.org/download.html on your system path
// (e.g. C:\Windows\System32\)
// setDriver(new PhantomJSDriver()); // PhantomJS headless browser
}
/**
* Opens the URL where the application is deployed.
*/
private void openTestUrl() {
getDriver().get("http://localhost:8080/Calculator");
}
@Test
public void testClickButton() throws Exception {
openTestUrl();
// At first there should be no labels
assertFalse($(LabelElement.class).exists());
// Click the button
ButtonElement clickMeButton = $(ButtonElement.class).
caption("Click Me").first();
clickMeButton.click();
// There should now be one label
assertEquals(1, $(LabelElement.class).all().size());
// ... with the specified text
assertEquals("Thank you for clicking",
$(LabelElement.class).first().getText());
// Click the button again
clickMeButton.click();
// There should now be two labels
List<LabelElement> allLabels = $(LabelElement.class).all();
assertEquals(2, allLabels.size());
// ... and the last label should have the correct text
LabelElement lastLabel = allLabels.get(1);
assertEquals("Thank you for clicking", lastLabel.getText());
}
}
|
{
"content_hash": "a9a47176892e693cc241496d71a12574",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 79,
"avg_line_length": 35.67816091954023,
"alnum_prop": 0.6723582474226805,
"repo_name": "Yomiji/SilkyCalc",
"id": "e331c598984f5606bd848aacdfff737f39af3ffb",
"size": "3104",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/com/kodesport/calculator/CalculatorTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "312878"
},
{
"name": "HTML",
"bytes": "2603"
},
{
"name": "Java",
"bytes": "18409"
}
],
"symlink_target": ""
}
|
package com.google.security.zynamics.zylib.gui.zygraph.wrappers;
import com.google.security.zynamics.zylib.gui.zygraph.functions.IteratorFunctions;
import com.google.security.zynamics.zylib.gui.zygraph.helpers.INodeCallback;
import com.google.security.zynamics.zylib.gui.zygraph.helpers.ISelectableGraph;
import com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.AbstractZyGraph;
import com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.nodes.ZyGraphNode;
import java.util.Collection;
public class SelectableGraph<NodeType extends ZyGraphNode<?>> implements ISelectableGraph<NodeType> {
private final AbstractZyGraph<NodeType, ?> m_graph;
private SelectableGraph(final AbstractZyGraph<NodeType, ?> graph) {
m_graph = graph;
}
public static <NodeType extends ZyGraphNode<?>> SelectableGraph<NodeType> wrap(
final AbstractZyGraph<NodeType, ?> graph) {
return new SelectableGraph<NodeType>(graph);
}
@Override
public void iterateSelected(final INodeCallback<NodeType> callback) {
IteratorFunctions.iterateSelected(m_graph, callback);
}
@Override
public void selectNodes(final Collection<NodeType> nodes, final boolean selected) {
m_graph.selectNodes(nodes, selected);
}
@Override
public void selectNodes(final Collection<NodeType> toSelect, final Collection<NodeType> toDeselect) {
m_graph.selectNodes(toSelect, toDeselect);
}
}
|
{
"content_hash": "f48d1bb7557cdde9fcfef8aa2a5077c1",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 103,
"avg_line_length": 37.91891891891892,
"alnum_prop": 0.7875980042765502,
"repo_name": "google/binnavi",
"id": "5500affe23ed21702c79958ac944ce13332b2f69",
"size": "1992",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/security/zynamics/zylib/gui/zygraph/wrappers/SelectableGraph.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1489"
},
{
"name": "C",
"bytes": "8997"
},
{
"name": "C++",
"bytes": "982064"
},
{
"name": "CMake",
"bytes": "1953"
},
{
"name": "CSS",
"bytes": "12843"
},
{
"name": "GAP",
"bytes": "3637"
},
{
"name": "HTML",
"bytes": "437459"
},
{
"name": "Java",
"bytes": "21714625"
},
{
"name": "Makefile",
"bytes": "3498"
},
{
"name": "PLpgSQL",
"bytes": "180849"
},
{
"name": "Python",
"bytes": "23981"
},
{
"name": "Shell",
"bytes": "713"
}
],
"symlink_target": ""
}
|
import sys
from argparse import ArgumentParser
from collections import Counter
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from lib.graph import read_embeddings_from_file, read_communities_from_file
def deg2rad(x):
# faster to write than to google it
return 2 * np.pi * x / 360.
def main():
parser = ArgumentParser()
parser.add_argument('-f', help='file with graph, edge in each line')
parser.add_argument('-c', help='file with communities, list of vertices in each line')
parser.add_argument('--n-top-comm', help='number of top communities', type=int)
parser.add_argument('-e', help='file with embeddings, triple (vertex, r, phi) in each line')
parser.add_argument('--emb-skip-lines', help='skip first lines in embedding file', type=int, default=0)
parser.add_argument('--deg', action='store_true', help='angle in degrees, not radians')
parser.add_argument('--annotate', action='store_true', help='annotate vertices')
parser.add_argument('--components', action='store_true', help='analyze components')
parser.add_argument('--clustering', help='compute clustering coefficients', action='store_true')
parser.add_argument('--diameter', help='compute diameter', action='store_true')
parser.add_argument('--pg', action='store_true', help='plot graph')
parser.add_argument('--layout', help='graph layout (no, polar, 2d)', default='polar')
parser.add_argument('--no-edges', action='store_true', help='do not plot graph edges')
parser.add_argument('--n-vertices', type=int, help='plot number of vertices closest to the origin')
parser.add_argument('--core', action='store_true', help='plot only core vertices')
parser.add_argument('--core_exponent', type=float, default=0.5)
parser.add_argument('--pd', action='store_true', help='plot degree distribution')
args = parser.parse_args()
if args.f:
graph_f = open(args.f)
else:
graph_f = sys.stdin
filename = args.f.split('/')[-1].split('.')[0]
print "read graph" + " " + filename
graph = nx.Graph()
for i_line, line in enumerate(graph_f):
if line.startswith('#'):
continue
v1, v2 = line.rstrip().split()
graph.add_edge(v1, v2)
communities = None
if args.c:
print "read communities"
communities = read_communities_from_file(args.c, args.n_top_comm)
embeddings = None
if args.e:
print "read embeddings"
embeddings = read_embeddings_from_file(args.e, args.emb_skip_lines)
print "number of vertices: {}".format(graph.number_of_nodes())
print "number of edges: {}".format(graph.number_of_edges())
n = graph.number_of_nodes()
# analyze degree distribution
deg = graph.degree().values()# [d[1] for d in graph.degree()]
n_isolated_vertices = len([d for d in deg if d == 0])
deg_dist = [i for i in Counter(deg).iteritems() if i[0] > 0]
degs, counts = zip(*deg_dist)
freqs = [float(c) / n for c in counts]
# components
if args.components:
print "n isolated vertices: {}".format(n_isolated_vertices)
components = sorted(nx.connected_component_subgraphs(graph), key=len, reverse=True)
print "n components: {}".format(len(components))
print "n nontrivial components: {}".format(len(components) - n_isolated_vertices)
print "largest compoment size: {}".format(len(components[0]))
# clustering
if args.clustering:
print "Global clustering coefficient (transitivity): {0:.5f}".format(nx.transitivity(graph))
print "Local clustering coefficient (average clustering): {0:.5f}".format(nx.average_clustering(graph))
# diameter
if args.diameter:
Gcc=sorted(nx.connected_component_subgraphs(graph), key = len, reverse=True)
G0=Gcc[0]
print "Diameter of giant component: {}".format(nx.diameter(G0))
# plots
plots = [
['graph', args.pg],
['degrees', args.pd],
]
active_plots = [pl for pl in plots if pl[1] is True]
plot2idx = {pl[0]: pl_i+1 for pl_i, pl in enumerate(active_plots)}
n_plots = len(plot2idx)
# plot degree distribution
if args.pd:
plot_idx = plot2idx['degrees']
ax_deg = plt.subplot(1, n_plots, plot_idx)
plt.title('Degree distribution of ' + filename)
ax_deg.loglog(degs, freqs, marker='o', linewidth=0)
# fit in logarithmic scale
# truncate 10% boundary degrees
x = np.log(degs)
y = np.log(freqs)
xy = sorted(zip(x, y), key=lambda z: z[0])
truncate_xy = int(0.1 * len(xy))
xy = xy[truncate_xy:-truncate_xy]
x, y = zip(*xy)
fit = np.polyfit(x, y, 1)
ax_deg.loglog(np.exp(x), np.exp(np.poly1d(fit)(x)), label="{0:.2f}x{1:+.2f}".format(*fit))
ax_deg.grid(True)
ax_deg.legend()
# plot graph
if args.pg:
if args.layout == 'polar':
if embeddings is None:
raise Exception("Embedding is not provided for polar layout")
plot_idx = plot2idx['graph']
vert = embeddings.keys()
if args.n_vertices:
vert.sort(key=lambda x: embeddings[x][0])
vert = vert[:args.n_vertices]
elif args.core:
n = graph.number_of_nodes()
vert = [v for v in vert if graph.degree(v) >= n**args.core_exponent]
print "Number of core vertices: {}".format(len(vert))
pairs = [embeddings[v] for v in vert]
r, phi = zip(*pairs)
if args.deg:
phi = map(deg2rad, phi)
colors = None
if communities is not None:
colors=[]
# find dominating community
for v in vert:
comm_index, comm_size, comm_color = max(communities.get(v, [(0, 1, (0.9,0.9,0.9, 0.25))]), key=lambda x: x[1])
colors.append(comm_color)
ax = plt.subplot(1, n_plots, plot_idx, projection='polar')
# edges
vert = set(vert) # check inclustion in set is faster
if not args.no_edges:
for (v1, v2) in graph.edges():
if v1 not in vert or v2 not in vert:
continue
r1, phi1 = embeddings[v1]
r2, phi2 = embeddings[v2]
if args.deg:
phi1 = deg2rad(phi1)
phi2 = deg2rad(phi2)
ax.plot((phi1, phi2), (r1, r2), color='g')
# vertices
if colors is None:
ax.plot(phi, r, marker='o', linewidth=0)
else:
for phi, r, color in zip (phi, r, colors):
ax.scatter(phi, r, color=color)
if args.annotate:
for v in vert:
r, phi = embeddings[v]
if args.deg:
phi = deg2rad(phi)
ax.annotate(
str(v), xy=(phi, r), xytext=(phi, r),
horizontalalignment='left', verticalalignment='top'
)
elif args.layout == '2d':
raise Exception('2d layout is not implemented')
else:
raise Exception('default layout is not implemented')
if n_plots > 0:
plt.show()
if __name__ == '__main__':
main()
|
{
"content_hash": "1200842050457c2f63ea036f10f524b4",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 130,
"avg_line_length": 38.916666666666664,
"alnum_prop": 0.5722698072805139,
"repo_name": "horoshenkih/rgg",
"id": "db9ff7234ff6254f2f84de86943bc8c348d358ac",
"size": "7495",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "analyze.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "61559"
},
{
"name": "CMake",
"bytes": "488"
},
{
"name": "Python",
"bytes": "54745"
},
{
"name": "Shell",
"bytes": "64"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Bull. Misc. Inform. Kew 1898:227. 1898
#### Original name
null
### Remarks
null
|
{
"content_hash": "ec82199de714eb1e005606648a73e148",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 12.923076923076923,
"alnum_prop": 0.6964285714285714,
"repo_name": "mdoering/backbone",
"id": "44d65491e603c8c2a96088d178f804a8c2fc3f83",
"size": "222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Miscanthus/Miscanthus oligostachyus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#include "CoreMinimal.h"
#include "ManageEventSender.h"
#include "Generate/Manage/ManageRectLightComponent.h"
#include "Runtime/Engine/Classes/Components/RectLightComponent.h"
// Source file C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Engine\Classes\Components\RectLightComponent.h:20
extern "C"
{
DOTNET_EXPORT auto E_PROP_URectLightComponent_BarnDoorAngle_GET(URectLightComponent* Ptr) { return Ptr->BarnDoorAngle; }
DOTNET_EXPORT void E_PROP_URectLightComponent_BarnDoorAngle_SET(URectLightComponent* Ptr, float Value) { Ptr->BarnDoorAngle = Value; }
DOTNET_EXPORT auto E_PROP_URectLightComponent_BarnDoorLength_GET(URectLightComponent* Ptr) { return Ptr->BarnDoorLength; }
DOTNET_EXPORT void E_PROP_URectLightComponent_BarnDoorLength_SET(URectLightComponent* Ptr, float Value) { Ptr->BarnDoorLength = Value; }
DOTNET_EXPORT auto E_PROP_URectLightComponent_SourceHeight_GET(URectLightComponent* Ptr) { return Ptr->SourceHeight; }
DOTNET_EXPORT void E_PROP_URectLightComponent_SourceHeight_SET(URectLightComponent* Ptr, float Value) { Ptr->SourceHeight = Value; }
DOTNET_EXPORT auto E_PROP_URectLightComponent_SourceWidth_GET(URectLightComponent* Ptr) { return Ptr->SourceWidth; }
DOTNET_EXPORT void E_PROP_URectLightComponent_SourceWidth_SET(URectLightComponent* Ptr, float Value) { Ptr->SourceWidth = Value; }
DOTNET_EXPORT INT_PTR E_NewObject_URectLightComponent(UObject* Parent, char* Name)
{
return (INT_PTR)NewObject<URectLightComponent>(Parent, FName(UTF8_TO_TCHAR(Name)));
}
DOTNET_EXPORT auto E_URectLightComponent_SetBarnDoorAngle(URectLightComponent* Self, float NewValue)
{
auto _p0 = NewValue;
Self->SetBarnDoorAngle(_p0);
}
DOTNET_EXPORT auto E_URectLightComponent_SetBarnDoorLength(URectLightComponent* Self, float NewValue)
{
auto _p0 = NewValue;
Self->SetBarnDoorLength(_p0);
}
DOTNET_EXPORT auto E_URectLightComponent_SetSourceHeight(URectLightComponent* Self, float NewValue)
{
auto _p0 = NewValue;
Self->SetSourceHeight(_p0);
}
DOTNET_EXPORT auto E_URectLightComponent_SetSourceWidth(URectLightComponent* Self, float bNewValue)
{
auto _p0 = bNewValue;
Self->SetSourceWidth(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_UpdateLightGUIDs(ULightComponentBase* Self)
{
((UManageRectLightComponent*)Self)->_Supper__UpdateLightGUIDs();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_DetachFromParent(USceneComponent* Self, bool bMaintainWorldPosition, bool bCallModify)
{
auto _p0 = bMaintainWorldPosition;
auto _p1 = bCallModify;
((UManageRectLightComponent*)Self)->_Supper__DetachFromParent(_p0, _p1);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnAttachmentChanged(USceneComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnAttachmentChanged();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnHiddenInGameChanged(USceneComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnHiddenInGameChanged();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnVisibilityChanged(USceneComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnVisibilityChanged();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PropagateLightingScenarioChange(USceneComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PropagateLightingScenarioChange();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_UpdateBounds(USceneComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__UpdateBounds();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_UpdatePhysicsVolume(USceneComponent* Self, bool bTriggerNotifiers)
{
auto _p0 = bTriggerNotifiers;
((UManageRectLightComponent*)Self)->_Supper__UpdatePhysicsVolume(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_Activate(UActorComponent* Self, bool bReset)
{
auto _p0 = bReset;
((UManageRectLightComponent*)Self)->_Supper__Activate(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_BeginPlay(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__BeginPlay();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_CreateRenderState_Concurrent(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__CreateRenderState_Concurrent();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_Deactivate(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__Deactivate();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_DestroyComponent(UActorComponent* Self, bool bPromoteChildren)
{
auto _p0 = bPromoteChildren;
((UManageRectLightComponent*)Self)->_Supper__DestroyComponent(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_DestroyRenderState_Concurrent(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__DestroyRenderState_Concurrent();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_InitializeComponent(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__InitializeComponent();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_InvalidateLightingCacheDetailed(UActorComponent* Self, bool bInvalidateBuildEnqueuedLighting, bool bTranslationOnly)
{
auto _p0 = bInvalidateBuildEnqueuedLighting;
auto _p1 = bTranslationOnly;
((UManageRectLightComponent*)Self)->_Supper__InvalidateLightingCacheDetailed(_p0, _p1);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnActorEnableCollisionChanged(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnActorEnableCollisionChanged();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnComponentCreated(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnComponentCreated();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnComponentDestroyed(UActorComponent* Self, bool bDestroyingHierarchy)
{
auto _p0 = bDestroyingHierarchy;
((UManageRectLightComponent*)Self)->_Supper__OnComponentDestroyed(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnCreatePhysicsState(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnCreatePhysicsState();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnDestroyPhysicsState(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnDestroyPhysicsState();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnRegister(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnRegister();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnRep_IsActive(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnRep_IsActive();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnUnregister(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnUnregister();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_RegisterComponentTickFunctions(UActorComponent* Self, bool bRegister)
{
auto _p0 = bRegister;
((UManageRectLightComponent*)Self)->_Supper__RegisterComponentTickFunctions(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_SendRenderDynamicData_Concurrent(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__SendRenderDynamicData_Concurrent();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_SendRenderTransform_Concurrent(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__SendRenderTransform_Concurrent();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_SetActive(UActorComponent* Self, bool bNewActive, bool bReset)
{
auto _p0 = bNewActive;
auto _p1 = bReset;
((UManageRectLightComponent*)Self)->_Supper__SetActive(_p0, _p1);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_SetAutoActivate(UActorComponent* Self, bool bNewAutoActivate)
{
auto _p0 = bNewAutoActivate;
((UManageRectLightComponent*)Self)->_Supper__SetAutoActivate(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_SetComponentTickEnabled(UActorComponent* Self, bool bEnabled)
{
auto _p0 = bEnabled;
((UManageRectLightComponent*)Self)->_Supper__SetComponentTickEnabled(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_SetComponentTickEnabledAsync(UActorComponent* Self, bool bEnabled)
{
auto _p0 = bEnabled;
((UManageRectLightComponent*)Self)->_Supper__SetComponentTickEnabledAsync(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_ToggleActive(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__ToggleActive();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_UninitializeComponent(UActorComponent* Self)
{
((UManageRectLightComponent*)Self)->_Supper__UninitializeComponent();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_BeginDestroy(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__BeginDestroy();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_FinishDestroy(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__FinishDestroy();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_MarkAsEditorOnlySubobject(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__MarkAsEditorOnlySubobject();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostCDOContruct(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PostCDOContruct();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostEditImport(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PostEditImport();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostInitProperties(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PostInitProperties();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostLoad(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PostLoad();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostNetReceive(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PostNetReceive();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostRepNotifies(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PostRepNotifies();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PostSaveRoot(UObject* Self, bool bCleanupIsRequired)
{
auto _p0 = bCleanupIsRequired;
((UManageRectLightComponent*)Self)->_Supper__PostSaveRoot(_p0);
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PreDestroyFromReplication(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PreDestroyFromReplication();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_PreNetReceive(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__PreNetReceive();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_ShutdownAfterError(UObject* Self)
{
((UManageRectLightComponent*)Self)->_Supper__ShutdownAfterError();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_CreateCluster(UObjectBaseUtility* Self)
{
((UManageRectLightComponent*)Self)->_Supper__CreateCluster();
}
DOTNET_EXPORT auto E__Supper__URectLightComponent_OnClusterMarkedAsPendingKill(UObjectBaseUtility* Self)
{
((UManageRectLightComponent*)Self)->_Supper__OnClusterMarkedAsPendingKill();
}
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
{
"content_hash": "70db613d48baf7680ed12de7d41a2fa0",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 167,
"avg_line_length": 35.903225806451616,
"alnum_prop": 0.7786163522012579,
"repo_name": "mrkriv/UnrealDotNet",
"id": "ac58bddb275ac08890657095796911f718fe26ce",
"size": "11225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Plugins/UnrealDotNet/Source/UnrealDotNetRuntime/Public/Generate/Export/URectLightComponent.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "6957"
},
{
"name": "Batchfile",
"bytes": "83"
},
{
"name": "C",
"bytes": "7625"
},
{
"name": "C#",
"bytes": "7716983"
},
{
"name": "C++",
"bytes": "3675882"
},
{
"name": "Objective-C",
"bytes": "134897"
}
],
"symlink_target": ""
}
|
package org.jkiss.dbeaver.model.impl.jdbc.cache;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.impl.AbstractObjectCache;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.DBSDataType;
import org.jkiss.dbeaver.model.struct.DBSObject;
import java.util.Collection;
public abstract class JDBCLazyDataTypeCache extends AbstractObjectCache<JDBCDataSource, DBSDataType> {
protected final DBSObject owner;
public JDBCLazyDataTypeCache(DBSObject owner)
{
this.owner = owner;
}
protected abstract DBSDataType createDataType(
int valueType,
String name,
String remarks,
boolean unsigned,
boolean searchable,
int precision,
int minScale,
int maxScale);
@NotNull
@Override
public Collection<DBSDataType> getAllObjects(@NotNull DBRProgressMonitor monitor, @Nullable JDBCDataSource jdbcDataSource) throws DBException
{
return getCachedObjects();
}
@Override
public DBSDataType getObject(@NotNull DBRProgressMonitor monitor, @Nullable JDBCDataSource jdbcDataSource, @NotNull String name) throws DBException
{
return getCachedObject(name);
}
public DBSDataType getDataType(String name, int valueType)
{
return null;
}
}
|
{
"content_hash": "7fe694a6d12abee44aae1b9583f93d38",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 151,
"avg_line_length": 29.23076923076923,
"alnum_prop": 0.7098684210526316,
"repo_name": "ruspl-afed/dbeaver",
"id": "bd3c8cc06606d58c928b7f6a82ebeb94c028e6f1",
"size": "2196",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCLazyDataTypeCache.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "690"
},
{
"name": "C++",
"bytes": "65328"
},
{
"name": "CSS",
"bytes": "4214"
},
{
"name": "HTML",
"bytes": "2368"
},
{
"name": "Java",
"bytes": "12750447"
},
{
"name": "Shell",
"bytes": "32"
},
{
"name": "XSLT",
"bytes": "7361"
}
],
"symlink_target": ""
}
|
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/Rx';
import 'rxjs/add/operator/toPromise';
@Injectable()
export class FileService {
constructor(private http: Http) { }
getRelativeContent(relativePath) {
return this.http.get(window.location.origin + window.location.pathname + relativePath).toPromise();
}
getContent(fullPath) {
return this.http.get(fullPath).toPromise();
}
}
|
{
"content_hash": "dc7027376724b78e2f8f1cafa6696d5c",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 103,
"avg_line_length": 23.473684210526315,
"alnum_prop": 0.7130044843049327,
"repo_name": "homoluden/NG2-Markdown-GitHub-IO",
"id": "71e1a5d68c18694a629e5033beb5158baef52408",
"size": "446",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/src/app/file.service.ts",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<ns0:DryadDataFile xmlns:ns0="http://purl.org/dryad/schema/terms/v3.1" xmlns:ns2="http://purl.org/dc/terms/" xmlns:ns3="http://rs.tdwg.org/dwc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.org/dryad/schema/terms/v3.1 http://datadryad.org/profile/v3.1/dryad.xsd">
<ns2:type>file</ns2:type>
<ns2:creator>House, Clarissa M.</ns2:creator>
<ns2:creator>Jensen, Kim</ns2:creator>
<ns2:creator>Rapkin, James</ns2:creator>
<ns2:creator>Lane, Sarah</ns2:creator>
<ns2:creator>Okada, Kensuke</ns2:creator>
<ns2:creator>Hosken, David J.</ns2:creator>
<ns2:creator>Hunt, John</ns2:creator>
<ns2:title>House et al. ConditionData-Survival&Development&MorphologicalData</ns2:title>
<ns2:identifier>http://dx.doi.org/10.5061/dryad.4gg88/1</ns2:identifier>
<ns2:rights>http://creativecommons.org/publicdomain/zero/1.0/</ns2:rights>
<ns2:description>Sheet 1 includes survival (0 = died, 1 = survived), development time and body size. Diet is a number from 1 - 24, Plate number is a number from 1 - 96. The %P and %C is the percentage P and C in that diet. Sheet 2 includes the morphometric data - body size, mean eye area, mandible size & genital size. As before, Diet is a number from 1 - 24, Plate number is a number from 1 - 71. The %P and %C is the percentage P and C in that diet. Please refer to the manuscript for information explaining why some diets aren't represented in the morphological data and the 'plate' effect.</ns2:description>
<ns2:subject>Condition-dependence</ns2:subject>
<ns2:subject>genitalia</ns2:subject>
<ns2:subject>larval diet</ns2:subject>
<ns2:subject>nutritional geometry</ns2:subject>
<ns2:subject>sexual selection</ns2:subject>
<ns2:subject>weapons</ns2:subject>
<ns3:scientificName>Gnatocerus cornutus</ns3:scientificName>
<ns2:dateSubmitted>2015-09-02T18:46:21Z</ns2:dateSubmitted>
<ns2:available>2015-09-02T18:46:21Z</ns2:available>
<ns2:format>77847</ns2:format>
<ns2:provenance>Step: dryadAcceptEditReject - action:dryadAcceptEditRejectAction Entered publication blackout by Edward Krause(ekrause@datadryad.org) on 2015-08-17T18:05:28Z (GMT)</ns2:provenance>
<ns2:provenance>Made available in DSpace on 2015-09-02T18:46:21Z (GMT). No. of bitstreams: 1
House et al. ConditionDataSurvival&Development.xlsx: 77847 bytes, checksum: 167745d48eb6efefb24959bb395b0db5 (MD5)</ns2:provenance>
<ns2:isPartOf>http://dx.doi.org/10.5061/dryad.4gg88</ns2:isPartOf>
</ns0:DryadDataFile>
|
{
"content_hash": "5cefe262dfa58f98d527de6e6d498cab",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 618,
"avg_line_length": 89.5,
"alnum_prop": 0.75658419792498,
"repo_name": "NCEAS/metadig",
"id": "b8eb20f7ca71bfef34fd44ff1c8fd41f7714606d",
"size": "2506",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "results/DRYAD/Dryad_Metadata_Application_Profile_Version_3.1/xml/00800-metadata.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2361"
},
{
"name": "Python",
"bytes": "42696"
},
{
"name": "Shell",
"bytes": "5798"
},
{
"name": "XSLT",
"bytes": "207495"
}
],
"symlink_target": ""
}
|
(function($, Electus){
var socket = io.connect('http://techopinion.jit.su');
socket.on('sentence', function (data) {
statement.setSentence(data.text);
});
var statement = new Electus.Statement({
"agreement" : true
});
statement.on("change:agreement", function(){
socket.emit("agreement", statement.toJSON());
});
$(function(){
new Electus.StatementView({ model : statement, el : $("#viewport") });
});
})(jQuery, Electus);
|
{
"content_hash": "8feec541c10203852f6941f43ac5282a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 25.68421052631579,
"alnum_prop": 0.5922131147540983,
"repo_name": "dvberkel/electus",
"id": "da807ed541d85004db9449bbc7154de125c6b26e",
"size": "488",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/client.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "135040"
}
],
"symlink_target": ""
}
|
<?php
namespace Garden\Container\Tests;
use Garden\Container\Tests\Fixtures\Db;
use Garden\Container\Tests\Fixtures\DbDecorator;
use Garden\Container\Tests\Fixtures\DbInterface;
use Garden\Container\Tests\Fixtures\Foo;
use Garden\Container\Tests\Fixtures\FooAwareInterface;
use Garden\Container\Tests\Fixtures\PdoDb;
use Garden\Container\Tests\Fixtures\Sql;
use Garden\Container\Tests\Fixtures\UnionTypeBasicWithDefaults;
use Garden\Container\Tests\Fixtures\UnionTypeBasicWithoutDefault;
use Garden\Container\Tests\Fixtures\UnionTypeComplex;
use PHPUnit\Framework\TestCase;
abstract class AbstractContainerTest extends TestCase {
const DB = Db::class;
const DB_INTERFACE = DbInterface::class;
const DB_DECORATOR = DbDecorator::class;
const FOO = Foo::class;
const FOO_AWARE = FooAwareInterface::class;
const PDODB = PdoDb::class;
const SQL = Sql::class;
const UNION_BASIC_DEFAULTS = UnionTypeBasicWithDefaults::class;
const UNION_BASIC = UnionTypeBasicWithoutDefault::class;
const UNION_COMPLEX = UnionTypeComplex::class;
/**
* Provide values for tests that are configured for shared and non shared.
*
* @return array Returns a data provider array.
*/
public function provideShared() {
return [
'notShared' => [false],
'shared' => [true],
];
}
}
|
{
"content_hash": "7cba54ef46f23003e99fa67f37b2bec8",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 78,
"avg_line_length": 33.24390243902439,
"alnum_prop": 0.731474688187821,
"repo_name": "vanilla/garden-container",
"id": "4684c230bc8fd6e0acb5f4b258755b38d54a0eda",
"size": "1477",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/AbstractContainerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "94895"
}
],
"symlink_target": ""
}
|
module.exports = angular.module('trafficPortal.private.cdns.profiles', [])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('trafficPortal.private.cdns.profiles', {
url: '/{cdnId}/profiles',
views: {
cdnsContent: {
templateUrl: 'common/modules/table/cdnProfiles/table.cdnProfiles.tpl.html',
controller: 'TableCDNProfilesController',
resolve: {
cdn: function($stateParams, cdnService) {
return cdnService.getCDN($stateParams.cdnId);
},
profiles: function($stateParams, profileService) {
return profileService.getProfiles({ cdn: $stateParams.cdnId });
}
}
}
}
})
;
$urlRouterProvider.otherwise('/');
});
|
{
"content_hash": "e6f038fdf650a24126e97f51c0a2b91f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 81,
"avg_line_length": 29.44,
"alnum_prop": 0.6480978260869565,
"repo_name": "jeffmart/incubator-trafficcontrol",
"id": "0cdf3b61d1f53eb51007b04a627ed79ab96f35b9",
"size": "1543",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "traffic_portal/app/src/modules/private/cdns/profiles/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "22423"
},
{
"name": "CSS",
"bytes": "189748"
},
{
"name": "Go",
"bytes": "1610079"
},
{
"name": "HTML",
"bytes": "746665"
},
{
"name": "Java",
"bytes": "1249282"
},
{
"name": "JavaScript",
"bytes": "1619291"
},
{
"name": "Makefile",
"bytes": "1047"
},
{
"name": "PLSQL",
"bytes": "4308"
},
{
"name": "PLpgSQL",
"bytes": "70798"
},
{
"name": "Perl",
"bytes": "3498542"
},
{
"name": "Perl 6",
"bytes": "25530"
},
{
"name": "Python",
"bytes": "93425"
},
{
"name": "Roff",
"bytes": "4011"
},
{
"name": "Ruby",
"bytes": "4090"
},
{
"name": "SQLPL",
"bytes": "66692"
},
{
"name": "Shell",
"bytes": "170470"
}
],
"symlink_target": ""
}
|
import assert from 'assert';
import app from '../index';
describe('cyborg', () => {
it('should pass a test', () => {
assert.equal(app('bar'), 'foo bar');
});
});
|
{
"content_hash": "46803a729036f5399854c2aa7b9cb757",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 21.375,
"alnum_prop": 0.5497076023391813,
"repo_name": "doowb/boilerplate-module",
"id": "33cc20ae355a890330bd5967136245c6797906fd",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "5189"
}
],
"symlink_target": ""
}
|
require "rails_helper"
describe KeywordsController, type: :controller do
let! (:keyword) { Keyword.create!(label: "keyword", description: "desc") }
let (:user) { FactoryBot.create :admin }
before(:each) do
login_user user
end
describe "GET index" do
before { get :index }
it { expect(assigns(:keywords)).to eq([keyword]) }
it { expect(response).to render_template("index") }
end
describe "GET new" do
before { get :new }
it { expect(response).to render_template("new") }
end
describe "POST create" do
label = "new_keyword"
description = "desc"
context "when succeeds in creating" do
before { post :create, params: { keyword: { label: label, description: description} } }
it { expect(response).to redirect_to keywords_url }
it { expect(Keyword.find_by(label: label).label).to eq(label) }
end
context "when fails to create" do
before {
allow_any_instance_of(Keyword).to receive(:save).and_return(false)
post :create, params: { keyword: { label: label, description: description} }
}
it { expect(response).to redirect_to keywords_url }
it { expect(flash[:notice]).not_to be_nil }
end
end
describe "GET edit" do
before { get :edit, params: { id: keyword.id } }
it { expect(response).to render_template("edit") }
end
describe "POST update" do
label = "changed"
context "when succeeds in saving" do
before { post :update, params: { id: keyword.id, keyword: { label: label } } }
it { expect(response).to redirect_to keywords_url }
it { expect(Keyword.find("keyword/changed").label).to eq(label) }
end
context "when fails to save" do
before {
allow_any_instance_of(Keyword).to receive(:update).and_return(false)
post :update, params: { id: keyword.id, keyword: { label: label } }
}
it { expect(response).to render_template("edit") }
end
end
describe "DELETE destroy" do
context "when succeeds in saving" do
before { delete :destroy, params: { id: keyword.id } }
it { expect(response).to redirect_to keywords_url }
it { expect(Keyword.find_by(id: keyword.id)).to be_nil }
end
context "when fails to save" do
before {
allow_any_instance_of(Keyword).to receive(:destroy).and_return(false)
delete :destroy, params: { id: keyword.id }
}
it { expect(response).to redirect_to keywords_url }
end
end
end
|
{
"content_hash": "3cd8d1b6fd30322e6d4817a459cc4179",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 93,
"avg_line_length": 33.24,
"alnum_prop": 0.6289610910549539,
"repo_name": "kumabook/spread_beaver",
"id": "494b30c9af3bd6609853c04bd214bb549c37527f",
"size": "2524",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/controllers/keywords_controller_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2554"
},
{
"name": "Dockerfile",
"bytes": "854"
},
{
"name": "HTML",
"bytes": "79814"
},
{
"name": "JavaScript",
"bytes": "7137"
},
{
"name": "Ruby",
"bytes": "547534"
}
],
"symlink_target": ""
}
|
package v1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
watch "k8s.io/apimachinery/pkg/watch"
api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
)
// PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface.
// A group's client should implement this interface.
type PersistentVolumeClaimsGetter interface {
PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface
}
// PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources.
type PersistentVolumeClaimInterface interface {
Create(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
Update(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
UpdateStatus(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.PersistentVolumeClaim, error)
List(opts v1.ListOptions) (*v1.PersistentVolumeClaimList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error)
PersistentVolumeClaimExpansion
}
// persistentVolumeClaims implements PersistentVolumeClaimInterface
type persistentVolumeClaims struct {
client restclient.Interface
ns string
}
// newPersistentVolumeClaims returns a PersistentVolumeClaims
func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVolumeClaims {
return &persistentVolumeClaims{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any.
func (c *persistentVolumeClaims) Create(persistentVolumeClaim *v1.PersistentVolumeClaim) (result *v1.PersistentVolumeClaim, err error) {
result = &v1.PersistentVolumeClaim{}
err = c.client.Post().
Namespace(c.ns).
Resource("persistentvolumeclaims").
Body(persistentVolumeClaim).
Do().
Into(result)
return
}
// Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any.
func (c *persistentVolumeClaims) Update(persistentVolumeClaim *v1.PersistentVolumeClaim) (result *v1.PersistentVolumeClaim, err error) {
result = &v1.PersistentVolumeClaim{}
err = c.client.Put().
Namespace(c.ns).
Resource("persistentvolumeclaims").
Name(persistentVolumeClaim.Name).
Body(persistentVolumeClaim).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus().
func (c *persistentVolumeClaims) UpdateStatus(persistentVolumeClaim *v1.PersistentVolumeClaim) (result *v1.PersistentVolumeClaim, err error) {
result = &v1.PersistentVolumeClaim{}
err = c.client.Put().
Namespace(c.ns).
Resource("persistentvolumeclaims").
Name(persistentVolumeClaim.Name).
SubResource("status").
Body(persistentVolumeClaim).
Do().
Into(result)
return
}
// Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs.
func (c *persistentVolumeClaims) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("persistentvolumeclaims").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *persistentVolumeClaims) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("persistentvolumeclaims").
VersionedParams(&listOptions, api.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any.
func (c *persistentVolumeClaims) Get(name string, options meta_v1.GetOptions) (result *v1.PersistentVolumeClaim, err error) {
result = &v1.PersistentVolumeClaim{}
err = c.client.Get().
Namespace(c.ns).
Resource("persistentvolumeclaims").
Name(name).
VersionedParams(&options, api.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors.
func (c *persistentVolumeClaims) List(opts v1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
result = &v1.PersistentVolumeClaimList{}
err = c.client.Get().
Namespace(c.ns).
Resource("persistentvolumeclaims").
VersionedParams(&opts, api.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested persistentVolumeClaims.
func (c *persistentVolumeClaims) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("persistentvolumeclaims").
VersionedParams(&opts, api.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched persistentVolumeClaim.
func (c *persistentVolumeClaims) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) {
result = &v1.PersistentVolumeClaim{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("persistentvolumeclaims").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
|
{
"content_hash": "e53785d0b666a7f319b24ecb21cc593c",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 175,
"avg_line_length": 36.07006369426752,
"alnum_prop": 0.7745011478015186,
"repo_name": "ibm-contribs/kubernetes",
"id": "a482723ff71c8fe9b8f544db614b0822057ddaf6",
"size": "6232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pkg/client/clientset_generated/clientset/typed/core/v1/persistentvolumeclaim.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "978"
},
{
"name": "Go",
"bytes": "42334945"
},
{
"name": "HTML",
"bytes": "2592459"
},
{
"name": "Makefile",
"bytes": "75994"
},
{
"name": "Nginx",
"bytes": "1608"
},
{
"name": "Protocol Buffer",
"bytes": "620698"
},
{
"name": "Python",
"bytes": "1328484"
},
{
"name": "SaltStack",
"bytes": "55371"
},
{
"name": "Shell",
"bytes": "1652033"
}
],
"symlink_target": ""
}
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>generic::raw_protocol::raw_protocol</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../generic__raw_protocol.html" title="generic::raw_protocol">
<link rel="prev" href="protocol.html" title="generic::raw_protocol::protocol">
<link rel="next" href="raw_protocol/overload1.html" title="generic::raw_protocol::raw_protocol (1 of 2 overloads)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="protocol.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../generic__raw_protocol.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="raw_protocol/overload1.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_asio.reference.generic__raw_protocol.raw_protocol"></a><a class="link" href="raw_protocol.html" title="generic::raw_protocol::raw_protocol">generic::raw_protocol::raw_protocol</a>
</h4></div></div></div>
<p>
<a class="indexterm" name="idm45773621744864"></a>
Construct a protocol object for a specific
address family and protocol.
</p>
<pre class="programlisting"><a class="link" href="raw_protocol/overload1.html" title="generic::raw_protocol::raw_protocol (1 of 2 overloads)">raw_protocol</a><span class="special">(</span>
<span class="keyword">int</span> <span class="identifier">address_family</span><span class="special">,</span>
<span class="keyword">int</span> <span class="identifier">socket_protocol</span><span class="special">);</span>
<span class="emphasis"><em>» <a class="link" href="raw_protocol/overload1.html" title="generic::raw_protocol::raw_protocol (1 of 2 overloads)">more...</a></em></span>
</pre>
<p>
Construct a generic protocol object from a specific protocol.
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span>
<span class="keyword">typename</span> <a class="link" href="../Protocol.html" title="Protocol requirements">Protocol</a><span class="special">></span>
<a class="link" href="raw_protocol/overload2.html" title="generic::raw_protocol::raw_protocol (2 of 2 overloads)">raw_protocol</a><span class="special">(</span>
<span class="keyword">const</span> <span class="identifier">Protocol</span> <span class="special">&</span> <span class="identifier">source_protocol</span><span class="special">);</span>
<span class="emphasis"><em>» <a class="link" href="raw_protocol/overload2.html" title="generic::raw_protocol::raw_protocol (2 of 2 overloads)">more...</a></em></span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2015 Christopher M.
Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="protocol.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../generic__raw_protocol.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="raw_protocol/overload1.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|
{
"content_hash": "3c9c9ba776a795b61a6d22a09bccc4ac",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 449,
"avg_line_length": 74.52380952380952,
"alnum_prop": 0.6509052183173589,
"repo_name": "zjutjsj1004/third",
"id": "8bcff1f9c9d01427ea9d3eb1083d0b6d63d88f8c",
"size": "4695",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "boost/doc/html/boost_asio/reference/generic__raw_protocol/raw_protocol.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "224158"
},
{
"name": "Batchfile",
"bytes": "33175"
},
{
"name": "C",
"bytes": "5576593"
},
{
"name": "C#",
"bytes": "41850"
},
{
"name": "C++",
"bytes": "179595990"
},
{
"name": "CMake",
"bytes": "28348"
},
{
"name": "CSS",
"bytes": "331303"
},
{
"name": "Cuda",
"bytes": "26521"
},
{
"name": "FORTRAN",
"bytes": "1856"
},
{
"name": "Groff",
"bytes": "1305458"
},
{
"name": "HTML",
"bytes": "159660377"
},
{
"name": "IDL",
"bytes": "15"
},
{
"name": "JavaScript",
"bytes": "285786"
},
{
"name": "Lex",
"bytes": "1290"
},
{
"name": "Makefile",
"bytes": "1202020"
},
{
"name": "Max",
"bytes": "37424"
},
{
"name": "Objective-C",
"bytes": "3674"
},
{
"name": "Objective-C++",
"bytes": "651"
},
{
"name": "PHP",
"bytes": "60249"
},
{
"name": "Perl",
"bytes": "37297"
},
{
"name": "Perl6",
"bytes": "2130"
},
{
"name": "Python",
"bytes": "1833677"
},
{
"name": "QML",
"bytes": "613"
},
{
"name": "QMake",
"bytes": "17385"
},
{
"name": "Rebol",
"bytes": "372"
},
{
"name": "Shell",
"bytes": "1144162"
},
{
"name": "Tcl",
"bytes": "1205"
},
{
"name": "TeX",
"bytes": "38313"
},
{
"name": "XSLT",
"bytes": "564356"
},
{
"name": "Yacc",
"bytes": "20341"
}
],
"symlink_target": ""
}
|
# Android 安全攻防实战
## 第一章 Android开发工具
### 使用命令行创建 Android 虚拟设备(AVD)
1. 获得可以使用的系统镜像列表
```sh
[path-to-sdk-install]/tools/android list targets
```
2. 创建 AVD
```sh
[path-to-sdk-install]/tools/android create -avd -n [AVD name] -t [system image target id]
// more external storage
[path-to-sdk-install]/tools/android create -avd -n [AVD name] -t [system image target id] -c [size] [K|M]
```
3. 运行创建的 AVD
```sh
[path-to-sdk-install]/tools/emulator -avd [AVD name]
// specify internal storage
[path-to-sdk-install]/tools/emulator -avd [AVD name] -partition-size [size in MBs]
```
扩展阅读:<https://developer.android.com/studio/tools/help/android.html>
### 使用 Android 调试桥(ADB)与 AVD 交互
1. 启动指定的 AVD
```sh
[path-to-sdk-install]/tools/emulator -avd [name]
```
2. 列出所有已经连接上来的 Android 设备
```sh
[path-to-sdk-install[/platform-tools/adb devices
```
3. 运行一个连接到 Android 设备的 shell
```sh
/sdk/platform-tools/adb shell
```
扩展阅读:<https://developer.android.com/studio/command-line/adb.html>
### 从AVD 上复制出/复制入文件
1. 从 AVD 上把文件复制出来
```sh
adb {options} pull [path to copy from] [local path to copy to]
```
2. 把文件复制到 AVD 里去
```sh
adb {options} push [local path to copy from] [path to copy to on AVD]
```
### 通过 ADB 在 AVD 中安装 app
```sh
adb {options} install [path to apk]
```
## 第二章 实践 app 安全
### 检查 app 的证书和签名
1. 从 Android 中取出一个 app
```sh
/sdk/platform-tools/adb pull /system/app/Calendar/Calendar.apk
```
2. 解压 apk
```sh
unzip Calendar.apk
```
3. 在 "META_INF" 的文件夹里
- `MANIFEST.MF`:声明了资源,与 `CERT.SF` 文件相似。
- `CERT.RSA`:公钥证书。
- `CERT.SF`:包含了 app 中所有的资源文件,负责对 app 进行签名。
```sh
[jdk]/bin/keytool -printcert -file META-INF/CERT.RSA
```
4. 查看签名文件的内容,包含了 app 中的各个资源文件的密码学意义上的 hash。
```sh
cat [path-to-unzipped-apk]/META-INF/CERT.SF
```
5. 使用 OpenSSL 查看证书
```sh
openssl pkcs7 -inform DER -in META-INF/CERT.RSA -noout -print_certs -text
```
扩展阅读:
- <https://datatracker.ietf.org/doc/rfc2459/?include_text=1>
- <http://docs.oracle.com/javase/6/docs/technotes/guides/security/cert3.html>
### 对 Android app 签名
先删掉现有的 `META-INF` 文件夹,然后建立签名。
1. 建立一个密钥储存器(keystore),用来存放签名 app 时要用的私钥。并把这个密钥存储器放在一个安全的地方。
```sh
// 生成
keytool -genkey -v -keystore [nameofkeystore] -alias [your_keyalias] -keyalg RSA -keysize 2048 -validity [numberofdays]
// 删除
keytool -delete -alias [your_keyalias] -keystore [nameofkeystore] -storepass [password]
```
```text
/usr/local/java/jdk1.8.0_112/bin/keytool -genkey -v -keystore releasekey.keystore -alias keyalias -keyalg RSA
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
输入密钥库口令:
您的名字与姓氏是什么?
[Unknown]: Li Hua
您的组织单位名称是什么?
[Unknown]: Xi dian
您的组织名称是什么?
[Unknown]: Mo Ha Xie Hui
您所在的城市或区域名称是什么?
[Unknown]: xi'an
您所在的省/市/自治区名称是什么?
[Unknown]: shanxi
该单位的双字母国家/地区代码是什么?
[Unknown]: China
CN=Li Hua, OU=Xi dian, O=Mo Ha Xie Hui, L=xi'an, ST=shanxi, C=China是否正确?
[否]: y
正在为以下对象生成 2,048 位RSA密钥对和自签名证书 (SHA256withRSA) (有效期为 90 天):
CN=Li Hua, OU=Xi dian, O=Mo Ha Xie Hui, L=xi'an, ST=shanxi, C=China
输入 <keyalias> 的密钥口令
(如果和密钥库口令相同, 按回车):
[正在存储releasekey.keystore]
```
2. 用这个密钥存储器对一个 app 进行签名。
```sh
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore [name of your keystore] [your .apk file] [your key alias]
```
`Keytool` 对公钥和私钥的实际处理方式是:把公钥放在 X.509 v3 证书中,该证书是用来声明公钥持有者的,并能验证相关公钥是否属于声明持有者的。
扩展阅读:
- <http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html>
- <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html>
- <https://developer.android.com/studio/publish/app-signing.html>
### 验证 app 的签名
```sh
jarsigner -verify -verbose [path-to-yout-apk]
```
### 探索 AndroidManifest.xml 文件
从 apk 包里提取出 AndroidManifest.xml 文件。
```sh
apktool d -f -s [apk file] -o decoded-data/
```
现在提取出来的文件就在 decoded-data 文件夹中。
扩展阅读:<https://developer.android.com/guide/topics/manifest/manifest-intro.html>
### 通过 ADB 与 activity 管理器交互
1. 获取一个 shell
```sh
adb shell
```
2. 找一个要运行的 activity
```sh
pm list packages
```
3. 运行 activity
```sh
am start [package name]
```
4. 在运行 activity 之前,还可以通过使用 `start` 命令接收的 `intent` 参数,来指定传给 activity 的 intent。
```sh
am start <INTENT> < --user UID | current >
```
我们可以执行下面的或类似的命令:
```sh
am start -n com.android.MyPackage/
com.android.MyPackageLaunchMeActivity
-e MyInput HelloWorld -a android.intent.MyPackageIntentAction
-c android.intent.category.MyPackageIntentCategory
```
也可以使用 activity 管理器来启动服务:
```sh
am startservice <package name>/<component name> <INTENT>
```
还可以使用与下面命令类似的命令:
```sh
am startservice com.android.app/
com.android.app.service.ServiceComponent
```
当然,我们也可以使用 activity 管理器杀掉一个进程:
```sh
kill < --user UID | current > <package>
```
扩展阅读:<https://developer.android.com/studio/command-line/adb.html>
### 通过 ADB 提取 app 里的资源
1. 获取一个 shell 并切换到 `/data/data/` 目录
```sh
adb shell
cd /data/data/
```
注意 `data` 目录的拥有者和组,拥有者实际上就是 app 本身。
2. 查看 app 的资源和元数据
```sh
ls -alR */
ls -alR */files/
ls -al */*/*.mp3
```
3. 找到文件之后,可以把文件复制出来
```sh
adb pull /data/data/[package-name]/[filepath]
```
## 第三章 Android 安全评估工具
### 简介
Santoku:基于 Debian 的 Linux 发行版,用于移动安全评估。
Drozer:漏洞利用和 Android 安全评估框架。Drozer 分为两部分,一个是 console ,运行在本地计算机上,一个是 server,是一个安装在目标 Android 设备上的 app。在使用 console 和 Android 设备交互时,就是把 Java 代码输入到运行在实际设备上的 drozer 代理中。
### 运行一个 drozer 会话
1. 使用 ADB,设置好端口转发
```sh
adb forward tcp:31415 tcp:31415
```
2. 打开设备上 drozer 的 agent,启用代理。
3. 连接 drozer console,进入 console模式
```sh
drozer console connect
```
### 枚举已安装的包
```sh
dz> run app.package.list
dz> run app.package.list -f [application name]
dz> run app.package.info --package [package name]
OR
dz> run app.package.info -a [package name]
dz> run app.package.info -p [permission label]
```
工作原理:<https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/package.py>
```py
def add_arguments(self, parser):
parser.add_argument("-a", "--package", default=None, help="the identifier of the package to inspect")
parser.add_argument("-d", "--defines-permission", default=None, help="filter by the permissions a package defines")
parser.add_argument("-f", "--filter", default=None, help="keyword filter conditions")
parser.add_argument("-g", "--gid", default=None, help="filter packages by GID")
parser.add_argument("-p", "--permission", default=None, help="permission filter conditions")
parser.add_argument("-u", "--uid", default=None, help="filter packages by UID")
parser.add_argument("-i", "--show-intent-filters", action="store_true", default=False , help="show intent filters")
def execute(self, arguments):
if arguments.package == None:
for package in self.packageManager().getPackages(common.PackageManager.GET_PERMISSIONS | common.PackageManager.GET_CONFIGURATIONS | common.PackageManager.GET_GIDS | common.PackageManager.GET_SHARED_LIBRARY_FILES | common.PackageManager.GET_ACTIVITIES):
self.__get_package(arguments, package)
else:
package = self.packageManager().getPackageInfo(arguments.package, common.PackageManager.GET_PERMISSIONS | common.PackageManager.GET_CONFIGURATIONS | common.PackageManager.GET_GIDS | common.PackageManager.GET_SHARED_LIBRARY_FILES | common.PackageManager.GET_ACTIVITIES)
self.__get_package(arguments, package)
def get_completion_suggestions(self, action, text, **kwargs):
if action.dest == "permission":
return android.permissions
def __get_package(self, arguments, package):
application = package.applicationInfo
activities = package.activities
services = package.services
```
只要在 drozer console 中使用 `app.activity.info` 模块,就会调用 `execute()` 方法。
我们看到它调用了包管理器中的 API -- `self.packageManager().getPackages(...)`。这个包返回一个带有各个包的权限、配置、GID,以及共享库的所有包对象的列表(list)。这个脚本对列表中的每个对象调用一次 `self.__get_package()` 函数,把它打印到 drozer console 的屏幕上。
### 枚举 activity
```sh
dz> run app.activity.info
dz> run app.activity.info --filter [activity name]
OR
dz> run app.activity.info -f [activity name]
dz> run app.activity.info --package [package name]
OR
dz> run app.activity.info -a [package name]
```
扩展阅读:<https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/activity.py>
### 枚举 content provider
```sh
dz> run app.provider.info
dz> run app.provider.info --package [package name]
OR
dz> run app.provider.info -a [package name]
dz> run app.provider.info --permission [permission label]
OR
dz> run app.provider.info -p [permission label]
```
工作原理:<https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/provider.py>
```py
def execute(self, arguments):
if arguments.package == None:
for package in self.packageManager().getPackages(common.PackageManager.GET_PROVIDERS | common.PackageManager.GET_URI_PERMISSION_PATTERNS):
self.__get_providers(arguments, package)
else:
package = self.packageManager().getPackageInfo(arguments.package, common.PackageManager.GET_PROVIDERS | common.PackageManager.GET_URI_PERMISSION_PATTERNS)
self.__get_providers(arguments, package)
def __get_providers(self, arguments, package):
providers = self.match_filter(package.providers, 'authority', arguments.filter)
if arguments.permission != None:
r_providers = self.match_filter(providers, 'readPermission', arguments.permission)
w_providers = self.match_filter(providers, 'writePermission', arguments.permission)
providers = set(r_providers + w_providers)
```
这个脚本通过调用 Android 包管理器,并传给它一些标志位提取出一个包的列表。我们看到,一旦包管理器收集到这些关于 `content proviser` 的详细信息后,脚本会调用一个名为 `__get_provider()` 方法,这个方法提取了 `provider` 的读和写的权限。`__get_provider()` 方法的作用基本上就是在定义了 `content provider` 权限的段中寻找一些字符串值,它调用 `math_filters()` 执行一些简单的字符串匹配,如果 `content provider` 所需的权限是读,这个字符串会被标上 `readPermission`;如果 `content provider` 所需权限是写,它会被标上 `writePermission`。之后,它会设置一个 provider 对象,然后把结果输出到 console 上。
扩展阅读:<https://developer.android.com/guide/topics/providers/content-providers.html>
### 枚举 service
```sh
dz> run app.service.info
dz> run app.service.info --package [package name]
dz> run app.service.info --permission [permission label]
OR
dz> run app.service.info -p [permission label]
dz> run app.service.info --filter [filter string]
OR
dz> run app.service.info -f [filter string]
dz> run app.service.info --unexported
OR
dz> run app.service.info -u
```
工作原理:
```py
def execute(self, arguments):
if arguments.package == None:
for package in self.packageManager().getPackages(common.PackageManager.GET_SERVICES | common.PackageManager.GET_PERMISSIONS):
self.__get_services(arguments, package)
else:
package = self.packageManager().getPackageInfo(arguments.package, common.PackageManager.GET_SERVICES | common.PackageManager.GET_PERMISSIONS)
self.__get_services(arguments, package)
```
这个脚本会检查特定的包是否需要传入一个参数,如果不需要参数,或者包名已经定义,这个脚本会提取出一张包的列表,并在循环中,对其中的每个包调用一次 `self.__get_services()` 方法,在提取包列表时,根据对方法 `self.packageManager().getPackageInfo(arguments.package, common, PackageManager.GET_SERVICES | common.PackageManager.GET_PERMISSIONS)` 返回的数据进行字符串匹配的结果,可以对包的某些属性进行过滤。
扩展阅读:
- <https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/service.py>
- <https://developer.android.com/guide/components/services.html>
- <https://developer.android.com/reference/android/app/Service.html>
- <https://developer.android.com/guide/components/bound-services.html>
### 枚举 broadcast receiver
```sh
dz> run app.broadcast.info
dz> run app.broadcast.info --package [package]
OR
dz> run app.broadcast.info -a [package]
dz> run app.broadcast.info --filter [filter]
OR
dz> run app.broadcast.info -f [filter]
dz> run app.broadcast.info --unexported
OR
dz> run app.broadcast.info -u
```
扩展阅读:
- <https://developer.android.com/reference/android/content/BroadcastReceiver.html>
- <https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/broadcast.py>
### 确定 app 的受攻击面(attack surface)
一个 app 的受攻击面就是它导出组件的数量。
```sh
dz> run app.package.attacksurface [package name]
```
工作原理:
<https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/package.py>
```py
from drozer import android
from drozer.modules import common, Module
class AttackSurface(Module, common.Filters, common.PackageManager):
def execute(self, arguments):
if arguments.package != None:
package = self.packageManager().getPackageInfo(arguments.package, common.PackageManager.GET_ACTIVITIES | common.PackageManager.GET_RECEIVERS | common.PackageManager.GET_PROVIDERS | common.PackageManager.GET_SERVICES)
application = package.applicationInfo
activities = self.match_filter(package.activities, 'exported', True)
receivers = self.match_filter(package.receivers, 'exported', True)
providers = self.match_filter(package.providers, 'exported', True)
services = self.match_filter(package.services, 'exported', True)
self.stdout.write("Attack Surface:\n")
self.stdout.write(" %d activities exported\n" % len(activities))
self.stdout.write(" %d broadcast receivers exported\n" % len(receivers))
self.stdout.write(" %d content providers exported\n" % len(providers))
self.stdout.write(" %d services exported\n" % len(services))
if (application.flags & application.FLAG_DEBUGGABLE) != 0:
self.stdout.write(" is debuggable\n")
if package.sharedUserId != None:
self.stdout.write(" Shared UID (%s)\n" % package.sharedUserId)
else:
self.stdout.write("No package specified\n")
```
这个模块会通过包管理器 API 提取关于 `service`、`activity`、`broadcast receiver` 和 `content provider` 的信息,然后根据得到的信息,确定它们是不是被导出。
### 运行 activity
1. 寻找一些 activity
```sh
dz> run app.activity.info --package [package name]
```
2. 发送如何运行的 intent
```sh
dz> run app.activity.start --action [intent action] --category [intent category] --component [package name] [component name]
dz> run app.activity.forintent --action [intent action] -category [intent category]
```
工作原理:
<https://raw.githubusercontent.com/mwrlabs/drozer/develop/src/drozer/modules/app/activity.py>
```py
def execute(self, arguments):
intent = android.Intent.fromParser(arguments)
if len(intent.flags) == 0:
intent.flags.append('ACTIVITY_NEW_TASK')
if intent.isValid():
self.getContext().startActivity(intent.buildIn(self))
else:
self.stderr.write("invalid intent: one of action or component must be set\n")
```
drozer 把通过参数解析器拿到的用户输入的参数放到一个 `intent` 里,检查是否有效后,就发送出去。
扩展阅读:
- <https://developer.android.com/reference/android/content/Intent.html>
- <https://developer.android.com/guide/components/intents-filters.html>
- <https://developer.android.com/guide/components/activities.html>
编写扩展:
- <https://developer.android.com/reference/android/os/Build.html>
- <https://github.com/mwrlabs/drozer/wiki/Writing-a-Module>
## 第四章 利用 app 中的漏洞
### 收集 logcat 泄漏的信息
```sh
adb logcat [options] [filter]
adb logcat > output.txt
adb logcat | grep [pattern]
```
Android 的 Monkey testing 框架用来向 app 发送系统/硬件级事件。
```sh
adb shell monkey -p [package] -v [event count]
```
扩展阅读:
- <https://developer.android.com/studio/command-line/logcat.html>
- <http://blog.parse.com/learn/engineering/discovering-a-major-security-hole-in-facebooks-android-sdk/>
- <https://developer.android.com/studio/command-line/adb.html#logcat>
- <http://www.vogella.com/tutorials/AndroidTesting/article.html>
### 检查网络流量
确认 tcpdump 和 netcat 已经安装在 Android 设备后,可以抓取网络流量
```sh
tcpdump -w - | nc -l -p 31337
```
把 tcpdump 的输出传给本地计算机上的 Wireshark,首先通过 ADB 设置端口转发
```sh
adb forward tcp:12345 tcp:31337
```
最后通过管道把输出转到 Wireshark 里
```sh
./adb forward tcp:12345 tcp:31337 && netcat 127.0.0.1 12345 | wireshark -k -S -i -
```
扩展阅读:
- <https://code.tutsplus.com/tutorials/analyzing-android-network-traffic--mobile-10663>
- <https://wiki.wireshark.org/DisplayFilters>
- <https://wiki.wireshark.org/CaptureFilters>
- <http://www.tcpdump.org/tcpdump_man.html>
- <https://www.wireshark.org/docs/wsug_html_chunked/>
### 攻击 service
1. 针对给定的 app,寻找哪些 service 是导出的
```sh
dz> run app.service.info --permission null
```
2. 找到一堆 service 之后,使用下列命令运行它们
```sh
dz> run app.service.start --action [ACTION] --category [CATEGORY] --data-uri [DATA-URI] --component [package name] [component name] --extra [TYPE KEY VALUE] --mimetype [MIMETYPE]
```
在停止和启动这些 service 时,可以同时运行 `logcat`。
3. 从根本上讲,在 XML 文件中寻找下列部分
```sh
<action
<meta-data
```
4. 为了把 intent 发送给这个 service,可以在 drozer console 中执行命令
```sh
// 以 `com.linkedin.android` 为例子
dz> run app.service.start --component com.linkedin.android com.linkedin.android.authenticator.AuthenitactionService --action android.accounts.AccountAuthenitcator
```
扩展阅读:
<https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4276&cid=6>
### 攻击 broadcast receiver
在阅读漏洞源码时特备注意 broadcast receiver 中的 `intent filter` 的定义。
向 broadcast receiver 发送一个 intent
```sh
dz> run app.broadcast.send --action [ACTION] --category [CATEGORY] --component [PACKAGE COMPONENT] --data-uri [DATA-URI] -extra [TYPE KEY VALUE] -flags [FLAGS*] -mimetype [MIMETYPE]
```
扩展阅读:
- <http://www.cs.wustl.edu/~jain/cse571-11/ftp/trojan/index.html>
- <https://blog.lookout.com/blog/2010/08/10/security-alert-first-android-sms-trojan-found-in-the-wild/>
### 枚举有漏洞的 content provider
1. 枚举不需要权限的 content provider
```sh
dz> run app.provider.info --permission null
```
2. 选中一个 content provider 后,列出所有冠有主机名的 URI
```sh
dz> run app.provider.finduri [package]
```
工作原理:
```py
def findContentUris(self, package):
"""
Search a package for content providers, by looking for content:// paths
in the binary.
"""
self.deleteFile("/".join([self.cacheDir(), "classes.dex"]))
content_uris = []
for path in self.packageManager().getSourcePaths(package):
strings = []
if ".apk" in path:
dex_file = self.extractFromZip("classes.dex", path, self.cacheDir())
if dex_file != None:
strings = self.getStrings(dex_file.getAbsolutePath())
dex_file.delete()
# look for an odex file too, because some system packages do not
# list these in sourceDir
strings += self.getStrings(path.replace(".apk", ".odex"))
elif (".odex" in path):
strings = self.getStrings(path)
content_uris.append((path, filter(lambda s: ("CONTENT://" in s.upper()) and ("CONTENT://" != s.upper()), strings)))
return content_uris
```
`.finduri` 模块列出所有可能的 content URI 的方法:打开 app 的 DEX 文件,直接在未经解析的文件中寻找那些看上去像是有效的 content URI 格式的字符串。
扩展阅读:
- <https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/common/provider.py>
- <https://github.com/mwrlabs/drozer/blob/develop/src/drozer/modules/app/provider.py>
- <https://developer.android.com/guide/topics/security/permissions.html#uri>
- <https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-2318&cid=3>
### 从有漏洞的 content provider 中提取数据
1. 得到有漏洞的 content provider
```sh
run app.provider.info --permission null
run app.provider.finduri [package]
```
2. 提取、下载数据
```sh
dz> run app.provider.query [URI]
dz> run app.provider.download [URI]
```
扩展阅读:
- <http://www.cvedetails.com/cve/CVE-2010-4804/>
- <http://vuln.sg/winzip101-en.html>
### 向 content provider 插入数据
1. 列出数据的结构和各列的名称等信息
```sh
dz> run app.provider.columns [URI]
```
2. 插入数据
```sh
dz> run app.provider.insert [URI] [--boolean [name] [value]] [--integer [name] [value]] [--string [name] [value]]...
```
### 枚举有 SQL 注入漏洞的 content provider
```sh
dz> run app.provider.query [URI] --selection "1=1"
dz> run app.provider.query [URI] --selection "1-1=0"
......
```
扩展阅读:
- <http://www.sqlite.org/lang.html>
- <https://www.owasp.org/index.php/SQL_Injection>
### 利用可调试的 app
1. 检查一个 app 是不是可调试的,可以直接查看在 app 中的 manifest,也可以执行
```sh
dz> run app.package.debuggable
```
2. 运行
```sh
dz> run app.activity.start --component com.example.readmycontacts com.example.readmycontacts.MainActivity
```
3. 可以使用 ADB 连接 java 调试连接协议端口,它是一个在虚拟机实例上打开的专供调试使用的端口,返回可以连接 VM 的接口
```sh
adb jdwp
```
4. 用 ADB 转发端口
```sh
adb forward tcp:[localport] jdwp:[jdwp port on device]
```
5. 从本地计算机使用 Java 调试器连上 VM
```sh
jdb -attach localhost:]PORT]
```
6. 提取类信息
```sh
classes
```
7. 枚举指定类中的所有方法
```sh
> methods [class-path]
```
8. 列出类的域或类属性的名称和值,在 jdb 中执行
```sh
> fields [class name]
```
扩展阅读:
- <http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/jdb.html>
- <http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/index.html>
- <https://developer.android.com/guide/topics/manifest/application-element.html#debug>
- <https://labs.mwrinfosecurity.com/blog/debuggable-apps-in-android-market>
- <http://www.saurik.com/id/17>
- <https://www.packtpub.com/books/content/debugging-java-programs-using-jdb>
- <https://android.googlesource.com/platform/dalvik/+/gingerbread-release/vm/jdwp/JdwpAdb.c>
- <https://android.googlesource.com/platform/dalvik/+/eclair-passion-release/vm/jdwp/JdwpAdb.c>
- <https://android.googlesource.com/platform/dalvik/+/kitkat-release/vm/jdwp/JdwpAdb.cpp>
## 第五章 保护 app
### 包含 app 的组件
两种方法:其一是正确使用 `AndroidManifest.xml` 文件,其二是代码级别上强制进行权限检查。
如果某个组件不需要被其他 app 调用,或者需要明确与其他部分的组件隔离,在该组件的 XML 元素中加入下面属性
```sh
<[component name] android:exported="false">
</[component name]>
```
扩展阅读:
- <https://developer.android.com/guide/topics/manifest/service-element.html>
- <https://developer.android.com/guide/topics/manifest/receiver-element.html>
- <https://developer.android.com/guide/topics/manifest/activity-element.html>
- <https://developer.android.com/guide/topics/manifest/application-element.html>
- <https://developer.android.com/guide/topics/manifest/manifest-intro.html>
- <https://developer.android.com/reference/android/content/Context.html>
- <https://developer.android.com/reference/android/app/Activity.html>
### 通过定制权限保护组件
1. 声明表示 `permission` 标签的字符串,编辑 `res/values/strings.xml` 文件
```sh
<string name="custom_permission_label">Custom Permission</string>
```
2. 添加保护级别为 `normal` 的定制权限,在 `AndroidManifest.xml` 文件中加入下列字符串
```sh
<permission android:name="android.permission.CUSTOM_PERMISSION"
android:protectionLevel="normal"
android:description="My custom permission"
android:label="@string/custom_permission_label">
```
3. 把它添加到 app 某个组件的 `android:permission` 属性中
```sh
<activity ...
android:permission="android.permission.CUSTOM_PERMISSION">
</activity>
```
也可以是 `provider`、`service`、`receiver`。
4. 也可以在其他 app 的 `AndroidManifest.xml` 文件中添加标签
```sh
<uses-permission android:name="android.permission.CUSTOM_PERMISSION"/>
```
定义权限组:
1. 在 `res/values/string.xml` 中添加一个表示权限组标签的字符串
```sh
<string name="my_permissions_group_label">Personal Data Access</string>
```
2. 在 AndroidManifest.xml 中添加代码
```sh
<permission-group
android:name="android.permissions.persomal_data_access_group"
android:label="@string/my_permissions_group_label"
android:description="Permissions that allow access to personaldata" />
```
3. 把定义的权限分配到组中
```sh
<permission ...
android:permissionGroup="android.permission.personal_data_access_group" />
```
扩展阅读:
- <https://developer.android.com/guide/topics/manifest/permission-element.html>
- <https://developer.android.com/guide/topics/manifest/uses-permission-element.html>
- <https://developer.android.com/guide/topics/manifest/permission-group-element.html>
- <https://developer.android.com/reference/android/Manifest.permission.html>
### 保护 content provider 的路径
1. 设置一个用于管理所有与你的认证相关路径的读和写权限的 permission,在 `manifest` 中添加下面的元素,其中的 `[permission name]` 是其他 app 在读或写任何 content provider 路径时必须拥有的权限。
```sh
<provider android:enabled="true"
android:exported="true"
android:authorities="com.android.myAuthority"
android:permission="com.myapp.provider"
android:permission="[permission name]">
</provider>
```
2. 加上读和写的权限。
```sh
<provider
android:writePermission="[write permission name]"
android:readPermission="[read permission name]">
</provider>
```
扩展阅读:
- <https://developer.android.com/guide/topics/manifest/provider-element.html>
- <https://developer.android.com/guide/topics/manifest/path-permission-element.html>
### 防御 SQL 注入攻击
1. 实例化一个 RssItemDAO 对象时,把 insertStatement 对象编译成一个参数化的 SQL insert 语句字符串
```java
public class RssItemDAO {
private SQLiteDatabase db;
private SQLiteStatement insertStatement;
private static String COL_TITLE = "title";
private static String TABLE_NAME = "RSS_ITEMS";
private static String INSERT_SQL = "insert into " + TABLE_NAME + " (content, link, title) values (?,?,?)";
public RssItemDAO(SQLiteDatabase db) {
this.db = db;
insertStatement = db.compileStatement(INSERT_SQL);
}
```
2. 把一个新的 RssItem 对象插入到数据库中时,可以按语句中出现的顺序,绑定各个属性
```java
public long save(RssItem item) {
insertStatement.bindString(1, item.getContent());
insertStatement.bindString(2, item.getLink());
insertStatement.bindString(3, item.getTitle());
return insertStatement.executeInsert();
}
```
3. 展示了如何使用 SQLiteDatabase.query 去获取与指定搜索条件相匹配的 RssItems
```java
public List<RssItem> fetchRssItemsByTitle(String searchTerm) {
Cursor cursor = db.query(TABLE_NAME, null, COL_TITLE + "LIKE ?", new String[] { "%" + searchTerm + "%" }, null, null, null);
// process cursor into list
List<RssItem> rssItems = new ArrayList<RssItemDAO.RssItem>();
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
// maps cursor columns of RssItem properties
RssItem item = cursorToRssItem(cursor);
rssItems.add(item);
cursor.moveToNext();
}
return rssItems;
}
```
扩展阅读:
- <https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html>
- <https://developer.android.com/reference/android/database/sqlite/SQLiteStatement.html>
- <https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet>
- <http://www.sqlite.org/lang_expr.html>
### 验证 app 的签名
确保已经有一个签名私钥,没有的话使用下面的方法创建
```sh
keytool -genkey -v -keystore your_app.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
```
1. 找出你证书的 SHA1 签名
```sh
keytool -list -v -keystore your_app.keystore
// for example
71:92:0A:C9:48:6E:08:7D:CB:CF:5C:7F:6F:EC:95:21:35:85:BC:C5 :
```
2. 把 hash 复制到 app 中,在 Java `.class` 文件中,删除冒号并把它定义为一个静态字符串
```sh
private static String CERTIFICATE_SHA1 = "71920AC9486E087DCBCF5C7F6FEC95213585BCC5";
```
3. 编写在运行时获取 .apk 文件的当前签名的代码
```java
public static boolean validateAppSignature(Context context) {
try {
// get the signature form the package manager
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES);
Signature[] appSignatures = packageInfo.signatures;
//this sample only checks the first certificate
for (Signature signature : appSignatures) {
byte[] signatureBytes = signature.toByteArray();
//calc sha1 in hex
String currentSignature = calcSHA1(signatureBytes);
//compare signatures
return CERTIFICATE_SHA1.equalsIgnoreCase(currentSignature);
}
} catch (Exception e) {
// if error assume failed to validate
}
return false;
}
```
4. 把签名的 hash 存下来,把它转换成十六进制
```java
private static String calcSHA1(byte[] signature) throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance("SHA1");
digest.update(signature);
byte[] signatureHash = digest.digest();
return bytesToHex(signatureHash);
}
public static String bytesToHex(byte[] bytes) {
final char[] hexArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8','9', 'A', 'B', 'C', 'D', 'E', 'F' };
char[] hexChars = new char[bytes.length * 2];
int v;
for (int j = 0; j < bytes.length; j++) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
```
5. 比较
```sh
CERTIFICATE_SHA1.equalsIgnoreCase(currentSignature);
```
扩展阅读:
- <https://developer.android.com/studio/publish/app-signing.html>
- <https://gist.github.com/scottyab/b849701972d57cf9562e>
- <https://developer.android.com/reference/android/content/pm/Signature.html>
- <https://developer.android.com/reference/android/content/pm/PackageManager.html>
- <http://www.saurik.com/id/17>
- <http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html>
### 通过检测安装程序、模拟器、调试标志位反逆向工程
1. 检查安装程序是不是谷歌应用商店
```java
public static boolean checkGooglePlayStore(Context context) {
String installerPackageName = context.getPackageManager().getInstallerPackageName(context.getPackageName());
return installerPackageName != null && installerPackageName.startsWith("com.google.android");
}
```
2. 检查是不是运行在一台模拟器中
```java
public static boolean isEmulator() {
try {
Class systemPropertyClazz = Class.forName("android.os.SystemProperties");
boolean kernelQemu = getProperty(systemPropertyClazz, "ro.kernel.qemu").length() > 0;
boolean hardwareGoldfish = getProperty(systemPropertyClazz, "ro.hardware").equals("goldfish");
boolean modelSdk = getProperty(systemPropertyClazz, "ro.product.model").equals("sdk");
if (kernelQemu || hardwareGoldfish || modelSdk) {
return true;
}
} catch (Exception e) {
// error assumes emulator
}
return false;
}
private static String getProperty(Class clazz, String propertyName) throws Exception {
return (String) clazz.getMethod("get", new Class[] { String. class }).invoke(clazz, new Object[] { propertyName });
}
```
3. 检查可调试标志位是否被打开
```java
public static boolean isDebuggable(Context context){
return (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
}
```
扩展阅读:
- <https://github.com/android/platform_frameworks_base/blob/master/core/java/android/os/SystemProperties.java>
- <https://developer.android.com/reference/android/content/pm/PackageManager.html>
- <https://developer.android.com/reference/android/content/pm/ApplicationInfo.html>
### 使用 ProGuad
1. Android Studio下,需要在 Gradle Build 系统中 `buildType` 的 release 部分加入下面代码
```sh
android {
...
buildTypes {
release {
runProguard true
proguardFile file('../proguard-project.txt)
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
}
```
2. 保证 `proGuard-android.txt` 文件始终在配置中规定的位置。
扩展阅读:
- <https://developer.android.com/studio/build/shrink-code.html>
- <https://sourceforge.net/projects/proguard/>
- <http://proguard.sourceforge.net/index.html#manual/examples.html>
## 第六章 逆向 app
### 把 Java 源码编译成 DEX 文件
1. 打开文本编辑器,创建一个文件
```java
public class Example{
public static void main(String []args){
System.out.printf("Hello World!\n");
}
}
```
2. 编译得到 .class 文件
```sh
javac -source 1.6 -target 1.6 Example.java
```
3. 使用 dx 得到一个 DEX 文件
```sh
/sdk/build-tools/25.0.0/dx --dex --output=Example.dex Example.class
```
### 解析 DEX 文件格式
<https://github.com/android/platform_dalvik/blob/master/libdex/DexFile.h>
DEX 文件的格式:
```c
struct DexFile {
/* directly-mapped "opt" header */
const DexOptHeader* pOptHeader;
/* pointers to directly-mapped structs and arrays in base DEX */
const DexHeader* pHeader;
const DexStringId* pStringIds;
const DexTypeId* pTypeIds;
const DexFieldId* pFieldIds;
const DexMethodId* pMethodIds;
const DexProtoId* pProtoIds;
const DexClassDef* pClassDefs;
const DexLink* pLinkData;
/*
* These are mapped out of the "auxillary" section, and may not be
* included in the file.
*/
const DexClassLookup* pClassLookup;
const void* pRegisterMapPool; // RegisterMapClassPool
/* points to start of DEX file data */
const u1* baseAddr;
/* track memory overhead for auxillary structures */
int overhead;
/* additional app-specific data structures associated with the DEX */
//void* auxData;
};
```
下面我们分别来分析各个区段:
DEX 文件头:
```c
struct DexHeader {
u1 magic[8]; /* includes version number */
u4 checksum; /* adler32 checksum */
u1 signature[kSHA1DigestLen]; /* SHA-1 hash */
u4 fileSize; /* length of entire file */
u4 headerSize; /* offset to start of next section */
u4 endianTag;
u4 linkSize;
u4 linkOff;
u4 mapOff;
u4 stringIdsSize;
u4 stringIdsOff;
u4 typeIdsSize;
u4 typeIdsOff;
u4 protoIdsSize;
u4 protoIdsOff;
u4 fieldIdsSize;
u4 fieldIdsOff;
u4 methodIdsSize;
u4 methodIdsOff;
u4 classDefsSize;
u4 classDefsOff;
u4 dataSize;
u4 dataOff;
};
```
```c
/*
* These match the definitions in the VM specification.
*/
typedef uint8_t u1;
typedef uint16_t u2;
typedef uint32_t u4;
typedef uint64_t u8;
typedef int8_t s1;
typedef int16_t s2;
typedef int32_t s4;
typedef int64_t s8;
```
StringIds 区段:
由一系列相对 DEX 文件的加载基地址的偏移量组成,用于计算定义在 Data 区段中的各个静态字符串的起始位置。
```c
struct DexStringId {
u4 stringDataOff; /* file offset to string_data_item */
};
```
编译器、反编译器、虚拟机如何寻找字符串:
```c
/* return the const char* string data referred to by the given string_id */
DEX_INLINE const char* dexGetStringData(const DexFile* pDexFile,
const DexStringId* pStringId) {
const u1* ptr = pDexFile->baseAddr + pStringId->stringDataOff;
// Skip the uleb128 length.
while (*(ptr++) > 0x7f) /* empty */ ;
return (const char*) ptr;
}
```
TypeIds 区段:存放寻找各个 type 的相应字符串时需要的信息。
```c
struct DexTypeId {
u4 descriptorIdx; /* index into stringIds list for type descriptor */
};
```
ProtoIds 区段:存放一系列用来描述方法的 prototype ID,其中含有关于各个方法的返回类型和参数的信息。
```c
struct DexProtoId {
u4 shortyIdx; /* index into stringIds for shorty descriptor */
u4 returnTypeIdx; /* index into typeIds list for return type */
u4 parametersOff; /* file offset to type_list for parameter types */
};
```
FieldIds 区段:由 StringIds 和 TypeIds 区段中数据的索引号组成,描述类中各个成员。
```c
struct DexFieldId {
u2 classIdx; /* index into typeIds list for defining class */
u2 typeIdx; /* index into typeIds for field type */
u4 nameIdx; /* index into stringIds for field name */
};
```
MethodIds 区段:
```c
struct DexMethodId {
u2 classIdx; /* index into typeIds list for defining class */
u2 protoIdx; /* index into protoIds for method prototype */
u4 nameIdx; /* index into stringIds for method name */
};
```
ClassDefs 区段:
```c
struct DexClassDef {
u4 classIdx; /* index into typeIds for this class */
u4 accessFlags;
u4 superclassIdx; /* index into typeIds for superclass */
u4 interfacesOff; /* file offset to DexTypeList */
u4 sourceFileIdx; /* index into stringIds for source file name */
u4 annotationsOff; /* file offset to annotations_directory_item */
u4 classDataOff; /* file offset to class_data_item */
u4 staticValuesOff; /* file offset to DexEncodedArray */
};
```
下面我们用 dexdump 工具解析 DEX:
```sh
/sdk/build-tools/25.0.0/dexdump Example.dex
```
还可以用 dx 工具,用更接近 DEX 文件格式的方法解析:
```sh
dx --dex --verbose-dump -dump-to=[output-file].txt [input-file].class
```
扩展阅读:
- <http://retrodev.com/android/dexformat.html>
- <https://github.com/JesusFreke/smali>
- <http://www.strazzere.com/papers/DexEducation-PracticingSafeDex.pdf>
- <https://github.com/android/platform_dalvik/tree/master/libdex>
- <http://source.android.com/devices/tech/dalvik/dex-format.html>
### 解释 Dalvik 字节码
使用 baksmali 工具把 DEX 文件反编译成语法格式良好的 smali 文件。
```sh
baksmali [dex filename].dex
```
扩展阅读:
- <http://source.android.com/devices/tech/dalvik/instruction-formats.html>
- <http://source.android.com/devices/tech/dalvik/dalvik-bytecode.html>
### 把 DEX 反编译回 Java
1. 使用 Dex2jar 工具把 DEX 文件转换成 .class 文件
```sh
dex2jar [dex file].dex
```
2. 使用 jd-gui 工具得到源文件
### 反编译 app 的原生库
Android NDK 中 toolchain 里提供的 objdump。
```sh
objdump -D [native library].so
```
扩展阅读:
- <http://www.atmel.com/Images/DDI0029G_7TDMI_R3_trm.pdf>
- <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf>
- <http://www.arm.com/products/processors/instruction-set-architectures/index.php>
- <http://refspecs.linuxbase.org/elf/elf.pdf>
### 使用 GDB server 调试 Android 进程
1. 确保设备上安装了 gdbserver,然后查看正在运行的所有进程
```sh
ps
```
2. 得到一个有效的 PID 后,使用 gdbserver 附加它
```sh
gdbserver :[tcp-port number] --attach [PID]
```
3. 在本地计算机上执行端口转发
```sh
adb forward tcp:[device port-number] tcp:[local port-number]
```
4. 运行 gdb 后(NDK toolchains)
```sh
target remote :[PID]
```
## 第七章 网络安全
- <https://developer.android.com/training/articles/security-ssl.html>
- <http://www.bouncycastle.org/latest_releases.html>
- <https://developer.android.com/reference/javax/net/ssl/HttpsURLConnection.html>
- <https://developer.android.com/reference/javax/net/ssl/SSLSocketFactory.html>
- <https://guardianproject.info/code/onionkit/>
- <https://play.google.com/store/apps/details?id=org.torproject.android>
- <https://code.google.com/archive/p/httpclientandroidlib/>
- <https://github.com/guardianproject/cacert>
- <https://www.owasp.org/index.php/Man-in-the-middle_attack>
- <https://www.madboa.com/geek/openssl/>
- <https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning>
- <https://github.com/moxie0/AndroidPinning>
- <https://www.imperialviolet.org/2011/05/04/pinning.html>
## 第八章 原生代码中漏洞的利用与分析
### 检查文件权限
首先安装 busybox 工具。
列出所有用户都可读的文件:
```sh
./busybox find [path-to-search] -perm 0444 -exec ls -al {} \;
```
所有用户都可写的文件:
```sh
./busybox find [path-to-search] -perm 0222 -exec ls -al {} \;
```
所有用户都可执行的文件:
```sh
./busybox find [path-to-search] -perm 0111 -exec ls -al {} \;
```
如果要找规定的位被设为1,其他的位设不设都没关系的文件,可以在搜索权限的参数前面加上一个 `"-"` 符号作为前缀。
找出 setuid 位被设为1的可执行文件:
```sh
./busybox find [path-to-search] -perm -4111 -exec ls -al {} \;
```
找出所有 setguid 位和可执行位都被设为1的文件:
```sh
./busybox find [path-to-search] -perm -2111 -exec ls -al {} \;
```
找出所有属于 root 用户的文件:
```sh
./busybox find [path-to-search] -user 0 -exec ls -al {} \;
```
找出所有系统用户的文件:
```sh
./busybox find [path-to-search] -user 1000 -exec ls -al {} \;
```
根据组 ID 列出文件:
```sh
./busybox find [path-to-search] -group 0 -exec ls -al {} \;
```
建立各个 app 的 UID 列表:
```sh
ls -al /data/data/
```
我们看到 app 的命名格式为 `u[数字]_a[数字]`,具体意思为 `u[用户配置文件号]_a[ID]`,在 `ID` 上加上10000,就得到系统中实际使用的 `UID`。
找出该 UID 的用户的所有文件:
```sh
./busybox find /data/data/ -user [UID] -exec ls -al {} \;
```
扩展阅读:
- <https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-1894>
- <https://android.googlesource.com/platform/system/core/+/android-4.4.2_r1/include/private/android_filesystem_config.h>
- <http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/fhs.html>
- <http://www.pathname.com/fhs/pub/fhs-2.3.pdf>
### 交叉编译原生可执行程序
使用 Android 原生开发工具包(NDK)。
1. 为代码建一个目录,例如“buffer-overflow”,这个目录下必须建立一个名为 `jni` 的子目录,因为 NDK 的编译脚本会专门寻找这个目录。
2. 在 JNI 目录下创建一个 Android.mk 文件,记录一些编译相关的属性。
```sh
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# give module name
LOCAL_MODULE := buffer-overflow #name of folder
# list your C files to compile
LOCAL_SRC_FILES := buffer-overflow.c #name of source to compile
# this option will build executables instead of building library for Android application.
include $(BUILD_EXECUTABLE)
```
3. 示例代码,保存在 jni 目录中:
```c
#include<stdio.h>
#include<string.h>
void vulnerable(char *src) {
char dest[10];
strcpy(dest, src);
printf("[%s]\n", dest);
return;
}
void call_me_maybe() {
printf("so much win!!\n");
return;
}
int main(int argc, char **argv) {
vulnerable(argv[1]);
return 0;
}
```
4. 调用 NDK build 脚本完成编译
```sh
[path-to-ndk]/ndk-build
```
5. 用 NDK 特定版本的 objdump 解析这个可执行文件的汇编代码
```sh
[path-to-ndk]/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump -D buffer-overflow/obj/local/armeabi/buffer-overflow > buffer-overflow.txt
```
扩展阅读:
- <http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf>
- <http://simplemachines.it/doc/arm_inst.pdf>
- <http://101.96.8.164/web.eecs.umich.edu/~prabal/teaching/eecs373-f10/readings/ARMv7-M_ARM.pdf>
- <https://www.exploit-db.com/docs/16151.pdf>
- <http://101.96.8.165/infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf>
- <https://www.exploit-db.com/docs/16151.pdf>
- <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf>
- <http://infocenter.arm.com/help/topic/com.arm.doc.dui0068b/DUI0068.pdf>
- <https://android.googlesource.com/platform/bionic/>
- <https://android.googlesource.com/platform/bionic/+/jb-mr0-release/libc/bionic/dlmalloc.c>
### 利用竞争条件引发的漏洞
竞争条件问题是当进程运行在使用抢占式进程调度系统的多线程系统中时,由于缺乏强制互斥条件而引发的。抢占式调度允许任务调度器强制中断一个正在运行中的线程或进程。
要利用竞争条件漏洞,必须至少具备一下条件:
1. 能访问存在漏洞的进程所要竞争访问的资源
2. 恶意改变这些资源
3. 使用时间/检查时间(TOU/TOC)的窗口大小
我们先准备一个例子,使用 Jelly Bean 模拟器:
```c
#include<stdio.h>
#include<unistd.h>
#include<errno.h>
#define MAX_COMMANDSIZE 100
int main(int argc, char *argv[], char **envp) {
char opt_buf[MAX_COMMANDSIZE];
char *args[2];
args[0] = opt_buf;
args[1] = NULL;
int opt_int;
const char *command_filename = "/data/race-condition/commands.txt";
FILE *command_file;
printf("option: ");
opt_int = atoi(gets(opt_buf));
printf("[*] option %d selected...\n", opt_int);
if (access(command_filename, R_OK|F_OK) == 0) {
printf("[*] access okay...\n");
command_file = fopen(command_filename, "r");
for (; opt_int>0; opt_int--) {
fscanf(command_file, "%s", opt_buf);
}
printf("[*] executing [%s]...\n", opt_buf);
fclose(command_file);
}
else {
printf("[x] access not granted...\n");
}
int ret = execve(args[0], &args, (char **)NULL);
if (ret != NULL) {
perror("[x] execve");
}
return 0;
}
```
1. 用交叉编译原生可执行程序的方法编译,并部署到 Android 设备上,把它放在系统上一个任何用户都有可读和执行权限的目录下。
2. 在 `/data/` 下新建一个 `race-condition` 文件夹,并把 `command.txt` 文件进去。
3. 在把它复制到设备后,赋予这个可执行文件 `setuid` 权限,使任何用户都对这个文件拥有执行权限。
```sh
chmod 4711 /system/bin/race-condition
```
4. 用 `ADB shell` 登陆,尝试访问一些没有执行、读取或写入权限的属于 root 的文件,显然不行
5. 我们利用 `race-condition` 这个可执行文件,先向 `commands.txt` 文件写入命令
```sh
echo "/system/bin/sh" >> /data/race-condition/commands.txt
```
命令被写入到最后一行,可以用 `cat [filename]` 查看文件并记下刚写入的命令是第几行。
6. 执行 `race-condition`,在要求输入 `option` 时输入刚才的行数,这个有漏洞的二进制可执行文件会去执行 `sh` 命令并给你 `root` 权限。
扩展阅读:
- <https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-1727&cid=8>
- <https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-1731&cid=8>
- <https://packetstormsecurity.com/files/122145/Sprite-Software-Android-Race-Condition.html>
- <http://www.wright.edu/static/cats/maint/maintenance.html>
### 栈溢出漏洞的利用
- <https://www.exploit-db.com/docs/24493.pdf>
- <http://phrack.org/issues/49/14.html#article>
- <http://thinkst.com/stuff/bh10/BlackHat-USA-2010-Meer-History-of-Memory-Corruption-Attacks-wp.pdf>
- <http://cseweb.ucsd.edu/~hovav/dist/noret-ccs.pdf>
- <https://www.informatik.tu-darmstadt.de/fileadmin/user_upload/Group_TRUST/PubsPDF/ROP-without-Returns-on-ARM.pdf>
### 自动 fuzzing 测试 Android 原生代码
- <http://www.linuxjournal.com/article/10844>
- <https://code.google.com/archive/p/ouspg/wikis/Radamsa.wiki>
- <https://code.google.com/archive/p/ouspg/wikis/Blab.wiki>
- <http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html>
- <http://www.cs.tut.fi/tapahtumat/testaus12/kalvot/Wieser_20120606radamsa-coverage.pdf>
## 第九章 加密与在开发时使用设备管理策略
- <https://www.owasp.org/index.php/Using_the_Java_Cryptographic_Extensions>
- <http://rtyley.github.io/spongycastle/#downloads>
- <http://www.bouncycastle.org/java.html>
- <http://cs.ucsb.edu/~yanick/publications/2013_ccs_cryptolint.pdf>
- <https://developer.android.com/reference/java/security/SecureRandom.html>
- <https://developer.android.com/reference/javax/crypto/KeyGenerator.html>
- <http://www.openhandsetalliance.com/oha_members.html>
- <https://developer.android.com/reference/android/content/SharedPreferences.html>
- <http://www.codeproject.com/Articles/549119/Encryption-Wrapper-for-Android-SharedPreferences>
- <https://github.com/scottyab/secure-preferences>
- <https://github.com/commonsguy/cwac-prefs>
- <https://developer.android.com/reference/javax/crypto/SecretKeyFactory.html>
- <https://developer.android.com/reference/javax/crypto/spec/PBEKeySpec.html>
- <http://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html>
- <http://android-developers.blogspot.co.uk/2013/02/using-cryptography-to-store-credentials.html>
- <https://github.com/nelenkov/android-pbe>
- <https://www.zetetic.net/sqlcipher/buy/>
- <https://github.com/sqlcipher/android-database-sqlcipher>
- <https://guardianproject.info/code/iocipher/>
- <https://developer.android.com/reference/java/security/KeyStore.html>
- <https://developer.android.com/samples/BasicAndroidKeyStore/index.html>
- <http://nelenkov.blogspot.co.uk/2013/08/credential-storage-enhancements-android-43.html>
- <http://www.arm.com/products/security-on-arm/trustzone>
- <https://developer.android.com/guide/topics/admin/device-admin.html>
- <https://developer.android.com/guide/topics/admin/device-admin.html#sample>
- <https://developer.android.com/work/device-management-policy.html>
- <https://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_DEVICE_ADMIN>
|
{
"content_hash": "dc11fe80b4c286a0a565e9000f862998",
"timestamp": "",
"source": "github",
"line_count": 1698,
"max_line_length": 397,
"avg_line_length": 26.915194346289752,
"alnum_prop": 0.6961620935626449,
"repo_name": "firmianay/Life-long-Learner",
"id": "1a67b1217adbff6456299c538f315d88acc5ddaf",
"size": "53404",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Attack-and-Defense-of-Android-Security/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5692"
},
{
"name": "Shell",
"bytes": "4075"
}
],
"symlink_target": ""
}
|
<?php
/* AcmeDemoBundle:Demo:index.html.twig */
class __TwigTemplate_1c63c2c24606693c3d6654a76eb31e86a7026f7935af72ece0e47d7362bae8b8 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
// line 1
try {
$this->parent = $this->env->loadTemplate("AcmeDemoBundle::layout.html.twig");
} catch (Twig_Error_Loader $e) {
$e->setTemplateFile($this->getTemplateName());
$e->setTemplateLine(1);
throw $e;
}
$this->blocks = array(
'title' => array($this, 'block_title'),
'content_header' => array($this, 'block_content_header'),
'content' => array($this, 'block_content'),
);
}
protected function doGetParent(array $context)
{
return "AcmeDemoBundle::layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = array())
{
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 3
public function block_title($context, array $blocks = array())
{
echo "Symfony - Demos";
}
// line 5
public function block_content_header($context, array $blocks = array())
{
echo "";
}
// line 7
public function block_content($context, array $blocks = array())
{
// line 8
echo " <h1 class=\"title\">Available demos</h1>
<ul id=\"demo-list\">
<li><a href=\"";
// line 10
echo $this->env->getExtension('routing')->getPath("_demo_hello", array("name" => "World"));
echo "\">Hello World</a></li>
<li><a href=\"";
// line 11
echo $this->env->getExtension('routing')->getPath("_demo_secured_hello", array("name" => "World"));
echo "\">Access the secured area</a> <a href=\"";
echo $this->env->getExtension('routing')->getPath("_demo_login");
echo "\">Go to the login page</a></li>
";
// line 13
echo " </ul>
";
}
public function getTemplateName()
{
return "AcmeDemoBundle:Demo:index.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 67 => 13, 61 => 11, 57 => 10, 53 => 8, 50 => 7, 44 => 5, 38 => 3, 11 => 1,);
}
}
|
{
"content_hash": "62794f5bf59b0419fd6e9dd712701f10",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 107,
"avg_line_length": 28.258823529411764,
"alnum_prop": 0.5428809325562032,
"repo_name": "abou78180/tennisfilter",
"id": "ed0078431c0914a6e596e3ead01d694a36e18903",
"size": "2402",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/cache/dev/twig/1c/63/c2c24606693c3d6654a76eb31e86a7026f7935af72ece0e47d7362bae8b8.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3297"
},
{
"name": "CSS",
"bytes": "35961"
},
{
"name": "JavaScript",
"bytes": "2362"
},
{
"name": "PHP",
"bytes": "125148"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.GameContent.Creative;
using Terraria.ModLoader;
namespace GoldensMisc.Items.Weapons
{
public class TopazStaff : ModItem
{
public override bool IsLoadingEnabled (Mod mod)
{
return ModContent.GetInstance<ServerConfig>().AltStaffs;
}
public override void SetStaticDefaults()
{
Item.staff[Item.type] = true;
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetDefaults()
{
Item.mana = 3;
Item.UseSound = SoundID.Item43;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 15;
Item.useAnimation = 38;
Item.useTime = 38;
Item.width = 40;
Item.height = 40;
Item.shoot = ProjectileID.TopazBolt;
Item.shootSpeed = 6.5f;
Item.knockBack = 3.25f;
Item.value = Item.sellPrice(0, 0, 8);
Item.DamageType = DamageClass.Magic;
Item.noMelee = true;
}
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ItemID.CopperBar, 10)
.AddIngredient(ItemID.Topaz, 8)
.AddTile(TileID.Anvils)
.Register();
}
}
}
|
{
"content_hash": "69df46864bca9fe6224f699085b38560",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 81,
"avg_line_length": 22.627450980392158,
"alnum_prop": 0.7036395147313691,
"repo_name": "goldenapple3/Miscellania",
"id": "73769e3c537c6ac32d12456e148d5edf0677517b",
"size": "1156",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Items/Weapons/TopazStaff.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "218368"
}
],
"symlink_target": ""
}
|
layout: post
title: "Ultimate PowerShell Prompt Customization and Git Setup Guide"
date: 2016-08-20 13:37:00
comments: true
description: A guide for making your PowerShell prompt pop with ConEmu, Quake mode, a customized and colored prompt and a nice Git setup.
modified: 2016-08-22
psversion: 5.1.14393.0
---
Source control and Git keeps getting more and more important for both Developers and Operations guys. Getting up and running with Git on MacOS or Linux is very easy as most things are built in. There are also cool tools like [oh-my-zsh](http://ohmyz.sh/) to customize your prompt.
On Windows, it's a bit of a different story. Let's spend a little time installing ConEmu and Git, then customizing it to take our prompt from something that looks like this:

to this:

By the end of the article you will have a great looking prompt, a nice Git setup using ssh keys and even be able to squash commits on Windows.
> 📢 Want to be notified when I post more like this? [Follow me on Twitter: @MattHodge](https://twitter.com/matthodge) 📢
* TOC
{:toc}
# Install required components
We will be installing the following tools for our ultimate git setup:
* `Chocolatey` - a Windows package manager
* Chocolatey Packages
* `git.install` - Git for Windows
* `ConEmu` - Terminal Emulator for Windows
* PowerShell Modules
* `posh-git` - PowerShell functions for working with Git
Open an Administrative PowerShell prompt and enter the following:
{% highlight powershell %}
# Set your PowerShell execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
# Install Chocolatey
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
# Install Chocolatey packages
choco install git.install -y
choco install conemu -y
# Install PowerShell modules
Install-PackageProvider NuGet -MinimumVersion '2.8.5.201' -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name 'posh-git'
{% endhighlight %}
Close out of your PowerShell window.
# ConEmu
Open up ConEmu. I like to use this instead of the standard PowerShell prompt.
On the first launch of ConEmu, you will be prompted with a fast configuration dialog. Click `OK` and continue. We will customize it manually.
Open up the settings menu and configure the below settings.

## Enable single instance mode
Prevent multiple copies of ConEmu starting. Use the tabs instead!

## Enable Quake mode
This is a cool one, it makes ConEmu slide down from the top of your screen like the Quake terminal used to.

## Set PowerShell as the default shell
Who uses `cmd` anymore? Set the default shell to PowerShell.

## Verify Quake mode hotkey
Get the most out of Quake Mode by setting a hotkey.

## Set a custom color scheme
You can customize ConEmu you a color scheme. Check out the [ConEmu Theme GitHub Repo](https://github.com/joonro/ConEmu-Color-Themes). My terminal example above is using the `Dracula` theme.
# PowerShell Profile
We have a nice terminal theme, but let's do a few finishing touches to make it pop.
## Create and edit the PowerShell Profile
PowerShell can load some settings every time it starts, which is known as the PowerShell Profile or `$PROFILE`.
To create/edit your `$PROFILE` do the following:
{% highlight powershell %}
# Creates profile if doesn't exist then edits it
if (!(Test-Path -Path $PROFILE)){ New-Item -Path $PROFILE -ItemType File } ; ise $PROFILE
{% endhighlight %}
This will launch the PowerShell ISE so you can edit the profile.
## posh-git and Ssh-Agent
The first thing to do inside your PowerShell Profile is to import the `posh-git` module. Next, you should add the `Start-SshAgent` command. `ssh-agent` will manage our keys for us.
Add the following to your `$PROFILE`
{% highlight powershell %}
Import-Module -Name posh-git
Start-SshAgent
{% endhighlight %}
This will give us some functionality when working with Git repos.
## Customize the prompt
Let's make our prompt a little cooler and customize it a little.
I like the prompt that `Joon Ro` created over at [his blog](https://joonro.github.io/blog/posts/powershell-customizations.html). I modified it slightly:
{% gist 0f0be96e0489feeb8a05d94151093517 %}
## Colorize your directory listing
When we do a `ls` or `dir` wouldn't it be nice to be able to colorize folders or certain file types instead of just having a boring list that looks the same?
Check out the [Get-ChildItem-Color](https://github.com/joonro/Get-ChildItem-Color) repository. I added the contents of `Get-ChildItem-Color.ps1` to my `$PROFILE`.
I then overwrote both the `ls` and `dir` aliases by adding the following into my `$PROFILE`:
{% highlight powershell %}
Set-Alias ls Get-ChildItem-Color -option AllScope -Force
Set-Alias dir Get-ChildItem-Color -option AllScope -Force
{% endhighlight %}
# Git
Now we have a nice terminal to work with, let's get Git setup.
Open up ConEmu.
## Add C:\Program Files\Git\usr\bin to Path Variable
First up we need to add the `C:\Program Files\Git\usr\bin` folder to our path variable. This folder contains `ssh-add` and `ssh-agent` which we will be using to manage our SSH keys.
{% highlight powershell %}
# Permanently add C:\Program Files\Git\usr\bin to machine Path variable
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Git\usr\bin", "Machine")
{% endhighlight %}
Restart ConEmu for it to take effect.
## Generate a key
Let's generate our ssh key.
{% highlight powershell %}
# Generate the key and put into the your user profile .ssh directory
ssh-keygen -t rsa -b 4096 -C "your@email.com" -f $env:USERPROFILE\.ssh\id_rsa
{% endhighlight %}
## Add the public key to GitHub
Once we have a generated SSH Key, we need to give GitHub the public key.
{% highlight powershell %}
# Copy the public key. Be sure to copy the .pub for the public key
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | clip
{% endhighlight %}
Open up your GitHub settings and choose `SSH and GPG keys` on the left.

This process is similar for BitBucket.
## Add our key to ssh-agent
When we try and push to our git repository, our machine will need to authenticate us using our SSH Key. A tool called `ssh-agent` keeps track of the keys we have and authenticating against GitHub for us.
With `Start-SshAgent` added to our profile, when you open up a new PowerShell prompt (or tab in ConEmu), `ssh-agent` will notice the `id_rsa.pub` in our `$env:USERPROFILE\.ssh` directory and attempt to load it:

If you don't see this prompt you, `ssh-agent` had probably started before the ssh key existed, try stopping and starting it:
{% highlight powershell %}
Stop-SshAgent
Start-SshAgent
{% endhighlight %}
You can also manually add a key to `ssh-agent`:
{% highlight powershell %}
Add-SshKey $env:USERPROFILE\.ssh\id_rsa
{% endhighlight %}
To view the keys that `ssh-agent` knows about, you can list them:
{% highlight powershell %}
# List ssh keys
ssh-add -l
{% endhighlight %}
If you wanted to remove your keys from `ssh-agent` for some reason:
{% highlight powershell %}
# Remove all ssh keys
ssh-add -D
{% endhighlight %}
## Test authentication to GitHub
To test that your ssh key is working, you can run the following command:
{% highlight powershell %}
# Test ssh connection to GitHub
ssh -T git@github.com
{% endhighlight %}

## Configure global Git settings
Finally, we can configure some global Git settings:
{% highlight powershell %}
git config --global user.email "your@email.com"
git config --global user.name "Your Name"
git config --global push.default simple
git config --global core.ignorecase false
# Configure line endings for windows
git config --global core.autocrlf true
{% endhighlight %}
## Squash commits
Do you commit a little too often? Me too. It's all good and well until we go and make a pull request on someone else's repository and they are a little anal about keeping the Git history clean. Maybe you just feel embarrassed at the amount of commits you do and want to cover your tracks.
To fix this, we can "squash" our commits down so they just appear as one.
Here is what a pull request looks like with several commits:

The easiest way to squash commits on Windows is to use the `gitk` tool.
Back over on our repository:
{% highlight powershell %}
# run the gitk tool
gitk
{% endhighlight %}
These are the commits I want to squash:

I select the commit before I made the big mess, and choose `Reset <branch> to here`.

Choose `Mixed: leave working tree untouched, reset index`

What this has done is reset your branch / repo to before the commits, but has left your changes untouched. We can now re-add the changes.
{% highlight powershell %}
# see the state of the repo
git status
# add your changes back
git add .
# commit your changes
git commit -m "only one commit now!"
# git push with the --force switch
git push --force
{% endhighlight %}
Your commits will be squashed nicely now, and even if you had a pull request open, it will have been updated:

Thanks to Matt Wrock ([@mwrock](https://github.com/mwrock)) for this tip!
# Conclusion
With that, we have a pretty awesome looking PowerShell prompt and can work nicely with git repositories. We can even squash commits on Windows!

Enjoy Quake mode :)
|
{
"content_hash": "73a3626e2896841d9a55a80c955d81a5",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 288,
"avg_line_length": 34.28947368421053,
"alnum_prop": 0.7570030698388335,
"repo_name": "MattHodge/matthodge.github.io",
"id": "70eb9cef403210c692e29111b91ac7ec61e66846",
"size": "10434",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-08-20-ultimate-powershell-prompt-and-git-setup.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "37529"
},
{
"name": "Dockerfile",
"bytes": "67"
},
{
"name": "HTML",
"bytes": "13138"
},
{
"name": "JavaScript",
"bytes": "1260"
},
{
"name": "PowerShell",
"bytes": "961"
},
{
"name": "Ruby",
"bytes": "92"
}
],
"symlink_target": ""
}
|
//
// UIView+draggable.m
// UIView+draggable
//
// Created by Andrea on 13/03/14.
// Copyright (c) 2014 Fancy Pixel. All rights reserved.
//
#import "UIView+draggable.h"
#import <objc/runtime.h>
@interface UIView ()
/**-----------------------------------------------------------------------------
* @name UIView+draggable Properties
* -----------------------------------------------------------------------------
*/
/** The pan gestures that handles the view dragging
* panGesture The tint color of the blurred view. Set to nil to reset.
*/
@property (nonatomic) UIPanGestureRecognizer *panGesture;
/**
A caging area such that the view can not be moved outside
of this frame.
If @c cagingArea is not @c CGRectZero, and @c cagingArea does not contain the
view's frame then this does nothing (ie. if the bounds of the view extend the
bounds of @c cagingArea).
Optional. If not set, defaults to @c CGRectZero, which will result
in no caging behavior.
*/
@property (nonatomic) CGRect cagingArea;
/**
Restricts the area of the view where the drag action starts.
Optional. If not set, defaults to self.view.
*/
@property (nonatomic) CGRect handle;
/**
Restricts the movement along the X axis
*/
@property (nonatomic) BOOL shouldMoveAlongX;
/**
Restricts the movement along the Y axis
*/
@property (nonatomic) BOOL shouldMoveAlongY;
/**
Notifies when dragging started
*/
@property (nonatomic, copy) void (^draggingStartedBlock)();
/**
Notifies when dragging ended
*/
@property (nonatomic, copy) void (^draggingEndedBlock)();
@end
@implementation UIView (draggable)
- (void)setPanGesture:(UIPanGestureRecognizer*)panGesture
{
objc_setAssociatedObject(self, @selector(panGesture), panGesture, OBJC_ASSOCIATION_RETAIN);
}
- (UIPanGestureRecognizer*)panGesture
{
return objc_getAssociatedObject(self, @selector(panGesture));
}
- (void)setCagingArea:(CGRect)cagingArea
{
if (CGRectEqualToRect(cagingArea, CGRectZero) ||
CGRectContainsRect(cagingArea, self.frame)) {
NSValue *cagingAreaValue = [NSValue valueWithCGRect:cagingArea];
objc_setAssociatedObject(self, @selector(cagingArea), cagingAreaValue, OBJC_ASSOCIATION_RETAIN);
}
}
- (CGRect)cagingArea
{
NSValue *cagingAreaValue = objc_getAssociatedObject(self, @selector(cagingArea));
return [cagingAreaValue CGRectValue];
}
- (void)setHandle:(CGRect)handle
{
CGRect relativeFrame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
if (CGRectContainsRect(relativeFrame, handle)) {
NSValue *handleValue = [NSValue valueWithCGRect:handle];
objc_setAssociatedObject(self, @selector(handle), handleValue, OBJC_ASSOCIATION_RETAIN);
}
}
- (CGRect)handle
{
NSValue *handleValue = objc_getAssociatedObject(self, @selector(handle));
return [handleValue CGRectValue];
}
- (void)setShouldMoveAlongY:(BOOL)newShould
{
NSNumber *shouldMoveAlongYBool = [NSNumber numberWithBool:newShould];
objc_setAssociatedObject(self, @selector(shouldMoveAlongY), shouldMoveAlongYBool, OBJC_ASSOCIATION_RETAIN );
}
- (BOOL)shouldMoveAlongY
{
NSNumber *moveAlongY = objc_getAssociatedObject(self, @selector(shouldMoveAlongY));
return (moveAlongY) ? [moveAlongY boolValue] : YES;
}
- (void)setShouldMoveAlongX:(BOOL)newShould
{
NSNumber *shouldMoveAlongXBool = [NSNumber numberWithBool:newShould];
objc_setAssociatedObject(self, @selector(shouldMoveAlongX), shouldMoveAlongXBool, OBJC_ASSOCIATION_RETAIN );
}
- (BOOL)shouldMoveAlongX
{
NSNumber *moveAlongX = objc_getAssociatedObject(self, @selector(shouldMoveAlongX));
return (moveAlongX) ? [moveAlongX boolValue] : YES;
}
- (void)setDraggingStartedBlock:(void (^)())draggingStartedBlock
{
objc_setAssociatedObject(self, @selector(draggingStartedBlock), draggingStartedBlock, OBJC_ASSOCIATION_RETAIN);
}
- (void (^)())draggingStartedBlock
{
return objc_getAssociatedObject(self, @selector(draggingStartedBlock));
}
- (void)setDraggingEndedBlock:(void (^)())draggingEndedBlock
{
objc_setAssociatedObject(self, @selector(draggingEndedBlock), draggingEndedBlock, OBJC_ASSOCIATION_RETAIN);
}
- (void (^)())draggingEndedBlock
{
return objc_getAssociatedObject(self, @selector(draggingEndedBlock));
}
- (void)handlePan:(UIPanGestureRecognizer*)sender
{
// Check to make you drag from dragging area
CGPoint locationInView = [sender locationInView:self];
if (!CGRectContainsPoint(self.handle, locationInView)) {
return;
}
[self adjustAnchorPointForGestureRecognizer:sender];
if (sender.state == UIGestureRecognizerStateBegan && self.draggingStartedBlock) {
self.draggingStartedBlock();
}
if (sender.state == UIGestureRecognizerStateEnded && self.draggingEndedBlock) {
self.draggingEndedBlock();
}
CGPoint translation = [sender translationInView:[self superview]];
CGFloat newXOrigin = CGRectGetMinX(self.frame) + (([self shouldMoveAlongX]) ? translation.x : 0);
CGFloat newYOrigin = CGRectGetMinY(self.frame) + (([self shouldMoveAlongY]) ? translation.y : 0);
CGRect cagingArea = self.cagingArea;
CGFloat cagingAreaOriginX = CGRectGetMinX(cagingArea);
CGFloat cagingAreaOriginY = CGRectGetMinY(cagingArea);
CGFloat cagingAreaRightSide = cagingAreaOriginX + CGRectGetWidth(cagingArea);
CGFloat cagingAreaBottomSide = cagingAreaOriginY + CGRectGetHeight(cagingArea);
if (!CGRectEqualToRect(cagingArea, CGRectZero)) {
// Check to make sure the view is still within the caging area
if (newXOrigin <= cagingAreaOriginX ||
newYOrigin <= cagingAreaOriginY ||
newXOrigin + CGRectGetWidth(self.frame) >= cagingAreaRightSide ||
newYOrigin + CGRectGetHeight(self.frame) >= cagingAreaBottomSide) {
// Don't move
newXOrigin = CGRectGetMinX(self.frame);
newYOrigin = CGRectGetMinY(self.frame);
}
}
[self setFrame:CGRectMake(newXOrigin,
newYOrigin,
CGRectGetWidth(self.frame),
CGRectGetHeight(self.frame))];
[sender setTranslation:(CGPoint){0, 0} inView:[self superview]];
}
- (void)adjustAnchorPointForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
UIView *piece = self;
CGPoint locationInView = [gestureRecognizer locationInView:piece];
CGPoint locationInSuperview = [gestureRecognizer locationInView:piece.superview];
piece.layer.anchorPoint = CGPointMake(locationInView.x / piece.bounds.size.width, locationInView.y / piece.bounds.size.height);
piece.center = locationInSuperview;
}
}
- (void)setDraggable:(BOOL)draggable
{
[self.panGesture setEnabled:draggable];
}
- (void)enableDragging
{
self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
[self.panGesture setMaximumNumberOfTouches:1];
[self.panGesture setMinimumNumberOfTouches:1];
[self.panGesture setCancelsTouchesInView:NO];
[self setHandle:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
[self addGestureRecognizer:self.panGesture];
}
@end
|
{
"content_hash": "42b519b760cfd5ca9a0dd3cfb07e952c",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 135,
"avg_line_length": 31.835497835497836,
"alnum_prop": 0.6990753331520261,
"repo_name": "wwy0918/__Y_Utils__",
"id": "c6cf4297bf0cadc59e68a1f0be6efd14d8c6ba6d",
"size": "7354",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "__Y__/__Y_Utils__/__Y_Category__/__Y_UIKit__/__Y_View__/UIView/UIView+draggable.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "354483"
},
{
"name": "Ruby",
"bytes": "5386"
}
],
"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.4"/>
<title>Repast HPC: repast::Functor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Repast HPC
 <span id="projectnumber">2.0</span>
</div>
<div id="projectbrief">High-Performance Agent-Based Modeling Platform</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>repast</b></li><li class="navelem"><a class="el" href="classrepast_1_1_functor.html">Functor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classrepast_1_1_functor-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">repast::Functor Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classrepast_1_1_functor.html" title="Functor interface. ">Functor</a> interface.
<a href="classrepast_1_1_functor.html#details">More...</a></p>
<p><code>#include <<a class="el" href="_schedule_8h_source.html">Schedule.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for repast::Functor:</div>
<div class="dyncontent">
<div class="center">
<img src="classrepast_1_1_functor.png" usemap="#repast::Functor_map" alt=""/>
<map id="repast::Functor_map" name="repast::Functor_map">
<area href="classrepast_1_1_method_functor.html" title="Adapts a no-arg method call on an object instance to a Functor interface. " alt="repast::MethodFunctor< T >" shape="rect" coords="0,56,170,80"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adadfddb7b4d7da5f105287498ff4d7d8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adadfddb7b4d7da5f105287498ff4d7d8"></a>
virtual void </td><td class="memItemRight" valign="bottom"><b>operator()</b> ()=0</td></tr>
<tr class="separator:adadfddb7b4d7da5f105287498ff4d7d8"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classrepast_1_1_functor.html" title="Functor interface. ">Functor</a> interface. </p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li>repast_hpc/<a class="el" href="_schedule_8h_source.html">Schedule.h</a></li>
<li>repast_hpc/Schedule.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Aug 11 2013 12:21:29 for Repast HPC by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
|
{
"content_hash": "a97df2900a92a5d884e8c90ca790334e",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 960,
"avg_line_length": 53.090225563909776,
"alnum_prop": 0.6727092479818723,
"repo_name": "gnu3ra/SCC15HPCRepast",
"id": "a1400ba6cca3e81e77a6d079c3521ec82492e730",
"size": "7061",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/API/repast_hpc/html/classrepast_1_1_functor.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "166901"
},
{
"name": "Awk",
"bytes": "4270"
},
{
"name": "Batchfile",
"bytes": "59453"
},
{
"name": "C",
"bytes": "89044644"
},
{
"name": "C#",
"bytes": "171870"
},
{
"name": "C++",
"bytes": "149286410"
},
{
"name": "CMake",
"bytes": "1277735"
},
{
"name": "CSS",
"bytes": "275497"
},
{
"name": "Cuda",
"bytes": "26749"
},
{
"name": "DIGITAL Command Language",
"bytes": "396318"
},
{
"name": "FORTRAN",
"bytes": "5955918"
},
{
"name": "Groff",
"bytes": "1536123"
},
{
"name": "HTML",
"bytes": "152716955"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "Java",
"bytes": "1703162"
},
{
"name": "JavaScript",
"bytes": "132031"
},
{
"name": "Lex",
"bytes": "44890"
},
{
"name": "LiveScript",
"bytes": "299224"
},
{
"name": "Logos",
"bytes": "17671"
},
{
"name": "Makefile",
"bytes": "10089555"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "4756"
},
{
"name": "PHP",
"bytes": "74480"
},
{
"name": "Perl",
"bytes": "1444604"
},
{
"name": "Perl6",
"bytes": "9917"
},
{
"name": "PostScript",
"bytes": "4003"
},
{
"name": "Pure Data",
"bytes": "1710"
},
{
"name": "Python",
"bytes": "2280373"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Scilab",
"bytes": "3012"
},
{
"name": "Shell",
"bytes": "11997985"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "696679"
},
{
"name": "Visual Basic",
"bytes": "11578"
},
{
"name": "XSLT",
"bytes": "771726"
},
{
"name": "Yacc",
"bytes": "140274"
}
],
"symlink_target": ""
}
|
package cafile
import (
"istio.io/istio/pkg/security"
)
// CACertFilePath stores the OS CA certificate file path
var CACertFilePath = ""
func init() {
CACertFilePath = security.GetOSRootFilePath()
}
|
{
"content_hash": "61ec3849b011db8da4273bc6e981fc04",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 17,
"alnum_prop": 0.7450980392156863,
"repo_name": "istio/istio",
"id": "ce7eb4db0a19c0db10cdf2ed93e67e04be6244c6",
"size": "790",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "security/pkg/nodeagent/cafile/cafile.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "1273"
},
{
"name": "Go",
"bytes": "12352993"
},
{
"name": "Java",
"bytes": "1080"
},
{
"name": "Makefile",
"bytes": "59962"
},
{
"name": "Python",
"bytes": "11895"
},
{
"name": "Ruby",
"bytes": "317"
},
{
"name": "Shell",
"bytes": "149235"
},
{
"name": "Smarty",
"bytes": "7998"
}
],
"symlink_target": ""
}
|
<?php
namespace Frontend\Modules\Mailmotor\Domain\Subscription\Command;
use MailMotor\Bundle\MailMotorBundle\Helper\Subscriber;
final class UnsubscriptionHandler
{
/**
* @var Subscriber
*/
protected $subscriber;
public function __construct(
Subscriber $subscriber
) {
$this->subscriber = $subscriber;
}
public function handle(Unsubscription $unsubscription): void
{
// Unsubscribing the user, will dispatch an event
$this->subscriber->unsubscribe(
$unsubscription->email
);
}
}
|
{
"content_hash": "fa81ff1f553d8a7dc07920ee8b2c1d47",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 65,
"avg_line_length": 19.96551724137931,
"alnum_prop": 0.6476683937823834,
"repo_name": "DegradationOfMankind/forkcms",
"id": "bef96367067a59851ad3a0159ce6614592615771",
"size": "782",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Frontend/Modules/Mailmotor/Domain/Subscription/Command/UnsubscriptionHandler.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "4871"
},
{
"name": "CSS",
"bytes": "260120"
},
{
"name": "HTML",
"bytes": "1352728"
},
{
"name": "JavaScript",
"bytes": "1108761"
},
{
"name": "PHP",
"bytes": "3062083"
},
{
"name": "Shell",
"bytes": "797"
},
{
"name": "Smarty",
"bytes": "5794"
}
],
"symlink_target": ""
}
|
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|TitleWindow{
chromeColor: #FFCC99;
contentBackgroundColor: #CC6699;
symbolColor: #FF0066;
selectionColor: #00FF00;
rollOverColor: #FF9933;
focusColor: #B80000;
fontFamily: EmbeddedVerdana;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
@font-face {
src: url("../../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Regular.ttf");
fontFamily: EmbeddedArial;
embedAsCFF: true;
}
@font-face {
src: url("../../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Bold.ttf");
fontWeight: bold;
fontFamily: EmbeddedArial;
embedAsCFF: true;
}
@font-face {
src: url("../../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Italic.ttf");
fontStyle: italic;
fontFamily: EmbeddedArial;
embedAsCFF: true;
}
@font-face {
src: url("../../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
fontFamily: EmbeddedVerdana;
embedAsCFF: true;
}
@font-face {
src: url("../../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
fontWeight: bold;
fontFamily: EmbeddedVerdana;
embedAsCFF: true;
}
@font-face {
src: url("../../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
fontStyle: italic;
fontFamily: EmbeddedVerdana;
embedAsCFF: true;
}
@font-face {
src: url("../../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
fontFamily: EmbeddedVerdanaHalo;
embedAsCFF: false;
}
@font-face {
src: url("../../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
fontWeight: bold;
fontFamily: EmbeddedVerdanaHalo;
embedAsCFF: false;
}
@font-face {
src: url("../../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
fontStyle: italic;
fontFamily: EmbeddedVerdanaHalo;
embedAsCFF: false;
}
s|Button{
fontFamily: EmbeddedVerdana;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
s|TextArea{
fontFamily: EmbeddedVerdana;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
s|Label{
fontFamily: EmbeddedVerdana;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
mx|Label{
fontFamily: EmbeddedVerdanaHalo;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
mx|DataGrid{
fontFamily: EmbeddedVerdanaHalo;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
.testWindowStyle1{
chromeColor: #FFCC99;
contentBackgroundColor: #CC6699;
symbolColor: #FF0066;
selectionColor: #00FF00;
rollOverColor: #FF9933;
focusColor: #B80000;
fontFamily: EmbeddedVerdana;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
.testWindowStyle2{
color: #FFCC99;
fontSize:14;
fontStyle:italic;
fontWeight:bold;
fontFamily: EmbeddedVerdana;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
}
global{
fontFamily: EmbeddedVerdana;
fontAntiAliasType: normal;
}
|
{
"content_hash": "33e5e3109253bfaaffdb6b6333af8908",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 81,
"avg_line_length": 23.27906976744186,
"alnum_prop": 0.6510156510156511,
"repo_name": "adufilie/flex-sdk",
"id": "dd4b84d1b61b84ffe6973c8027ea5a7819366f93",
"size": "3810",
"binary": false,
"copies": "10",
"ref": "refs/heads/develop",
"path": "mustella/tests/gumbo/components/TitleWindow/SWFs/assets/MyTitleWindowStyle1.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AGS Script",
"bytes": "478"
},
{
"name": "ASP",
"bytes": "6381"
},
{
"name": "ActionScript",
"bytes": "34995123"
},
{
"name": "Awk",
"bytes": "1958"
},
{
"name": "Batchfile",
"bytes": "40336"
},
{
"name": "C",
"bytes": "4601"
},
{
"name": "C++",
"bytes": "10259"
},
{
"name": "CSS",
"bytes": "508448"
},
{
"name": "Groff",
"bytes": "59633"
},
{
"name": "HTML",
"bytes": "84174"
},
{
"name": "Java",
"bytes": "15072764"
},
{
"name": "JavaScript",
"bytes": "110516"
},
{
"name": "PureBasic",
"bytes": "362"
},
{
"name": "Shell",
"bytes": "306455"
},
{
"name": "Visual Basic",
"bytes": "4498"
},
{
"name": "XSLT",
"bytes": "757371"
}
],
"symlink_target": ""
}
|
var database = null;
module.exports.setConfig = function (options) {
database = options.database || null;
database.setConfig(options);
};
module.exports.getDatabase = function () {
return database;
};
|
{
"content_hash": "640e1c9a34efacdac17496dea6cb3031",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 47,
"avg_line_length": 20.9,
"alnum_prop": 0.7129186602870813,
"repo_name": "adriantoine/bloql",
"id": "110292a361494548db20e7c8fdb24bc5fd92abec",
"size": "210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/server/config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "15285"
},
{
"name": "Shell",
"bytes": "170"
}
],
"symlink_target": ""
}
|
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand
import build
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
'--verbosity', action='store', dest='verbosity', default='1',
type='choice', choices=['0', '1', '2'],
help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'
),
)
help = 'Builds the documentation'
args = ''
requires_model_validation = False
def handle(self, *test_labels, **options):
build.generate_api_docs()
build.build_docs()
|
{
"content_hash": "20c33c912f7f884339ae726dfd3a667f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 81,
"avg_line_length": 24.92,
"alnum_prop": 0.6468699839486356,
"repo_name": "CollabQ/CollabQ",
"id": "4bbdf84e2fc8b2f4eddb3457d8194ce3371550ad",
"size": "1238",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/management/commands/build_docs.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "400472"
},
{
"name": "C++",
"bytes": "20"
},
{
"name": "JavaScript",
"bytes": "327809"
},
{
"name": "Python",
"bytes": "6590397"
},
{
"name": "R",
"bytes": "1277"
},
{
"name": "Shell",
"bytes": "5624"
}
],
"symlink_target": ""
}
|
/*
* LoginPage Messages
*
* This contains all the text for the LoginPage component.
*/
import { defineMessages } from 'react-intl';
export default defineMessages({
header: {
id: 'app.containers.LoginPage.header',
defaultMessage: '登录-健康汇销',
},
username: {
id: 'app.containers.LoginPage.username',
defaultMessage: '账号',
},
usernameErr: {
id: 'app.containers.LoginPage.usernameErr',
defaultMessage: '账号不能为空',
},
password: {
id: 'app.containers.LoginPage.password',
defaultMessage: '密码',
},
passwordErr: {
id: 'app.containers.LoginPage.passwordErr',
defaultMessage: '密码不能为空',
},
login: {
id: 'app.containers.LoginPage.login',
defaultMessage: '登录',
},
});
|
{
"content_hash": "3cb022b959e695d39c7327ca1cd445d1",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 58,
"avg_line_length": 22.060606060606062,
"alnum_prop": 0.6497252747252747,
"repo_name": "Princess310/react-chat-exp",
"id": "40d952a1e12862225bb2a21da12a40608453a5da",
"size": "776",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/containers/LoginPage/messages.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1787"
},
{
"name": "CSS",
"bytes": "91943"
},
{
"name": "HTML",
"bytes": "11334"
},
{
"name": "JavaScript",
"bytes": "3707484"
}
],
"symlink_target": ""
}
|
layout: model
title: Portuguese BERT Embeddings (Large Cased)
author: John Snow Labs
name: bert_portuguese_large_cased
date: 2020-11-04
task: Embeddings
language: pt
edition: Spark NLP 2.6.0
spark_version: 2.4
tags: [open_source, embeddings, pt]
supported: true
annotator: BertEmbeddings
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---
## Description
This is the pre-trained BERT model trained on the Portuguese language. `BERT-Base` and `BERT-Large` Cased variants were trained on the `BrWaC` (Brazilian Web as Corpus), a large Portuguese corpus, for 1,000,000 steps, using whole-word mask.
{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/bert_portuguese_large_cased_pt_2.6.0_2.4_1604487922125.zip){:.button.button-orange.button-orange-trans.arr.button-icon}
## How to use
<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python
...
embeddings = BertEmbeddings.pretrained("bert_portuguese_large_cased", "pt") \
.setInputCols("sentence", "token") \
.setOutputCol("embeddings")
nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, tokenizer, embeddings])
pipeline_model = nlp_pipeline.fit(spark.createDataFrame([[""]]).toDF("text"))
result = pipeline_model.transform(spark.createDataFrame([['Eu amo PNL']], ["text"]))
```
```scala
...
val embeddings = BertEmbeddings.pretrained("bert_portuguese_large_cased", "pt")
.setInputCols("sentence", "token")
.setOutputCol("embeddings")
val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, tokenizer, embeddings))
val data = Seq("Eu amo PNL").toDF("text")
val result = pipeline.fit(data).transform(data)
```
{:.nlu-block}
```python
import nlu
text = ["Eu amo PNL"]
embeddings_df = nlu.load('pt.bert.cased.large').predict(text, output_level='token')
embeddings_df
```
</div>
{:.h2_title}
## Results
```bash
token pt_bert_cased_large_embeddings
Eu [0.6893012523651123, 0.18436528742313385, 0.14...
amo [0.6536692976951599, 0.17582201957702637, -0.5...
PNL [-0.1397203803062439, 0.5698696374893188, -0.3...
```
{:.model-param}
## Model Information
{:.table-model}
|---|---|
|Model Name:|bert_portuguese_large_cased|
|Type:|embeddings|
|Compatibility:|Spark NLP 2.6.0+|
|License:|Open Source|
|Edition:|Official|
|Input Labels:|[sentence, token]|
|Output Labels:|[word_embeddings]|
|Language:|[pt]|
|Dimension:|1024|
|Case sensitive:|true|
{:.h2_title}
## Data Source
The model is imported from https://github.com/neuralmind-ai/portuguese-bert
|
{
"content_hash": "2c076a08b77a45b6133ed15c6b65ca83",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 240,
"avg_line_length": 29.380434782608695,
"alnum_prop": 0.7354790972992971,
"repo_name": "JohnSnowLabs/spark-nlp",
"id": "bd43d20e24d7dfd245be29a82a787dd0add3b062",
"size": "2707",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/_posts/Digaari/2020-11-04-bert_portuguese_large_cased.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "14452"
},
{
"name": "Java",
"bytes": "223289"
},
{
"name": "Makefile",
"bytes": "819"
},
{
"name": "Python",
"bytes": "1694517"
},
{
"name": "Scala",
"bytes": "4116435"
},
{
"name": "Shell",
"bytes": "5286"
}
],
"symlink_target": ""
}
|
## 2.3.1 / 2018-06-19
* [BUGFIX] Avoid infinite loop on duplicate NaN values. #4275
* [BUGFIX] Fix nil pointer deference when using various API endpoints #4282
* [BUGFIX] config: set target group source index during unmarshalling #4245
* [BUGFIX] discovery/file: fix logging #4178
* [BUGFIX] kubernetes_sd: fix namespace filtering #4285
* [BUGFIX] web: restore old path prefix behavior #4273
* [BUGFIX] web: remove security headers added in 2.3.0 #4259
## 2.3.0 / 2018-06-05
* [CHANGE] `marathon_sd`: use `auth_token` and `auth_token_file` for token-based authentication instead of `bearer_token` and `bearer_token_file` respectively.
* [CHANGE] Metric names for HTTP server metrics changed
* [FEATURE] Add query commands to promtool
* [FEATURE] Add security headers to HTTP server responses
* [FEATURE] Pass query hints via remote read API
* [FEATURE] Basic auth passwords can now be configured via file across all configuration
* [ENHANCEMENT] Optimise PromQL and API serialization for memory usage and allocations
* [ENHANCEMENT] Limit number of dropped targets in web UI
* [ENHANCEMENT] Consul and EC2 service discovery allow using server-side filtering for performance improvement
* [ENHANCEMENT] Add advanced filtering configuration to EC2 service discovery
* [ENHANCEMENT] `marathon_sd`: adds support for basic and bearer authentication, plus all other common HTTP client options (TLS config, proxy URL, etc.)
* [ENHANCEMENT] Provide machine type metadata and labels in GCE service discovery
* [ENHANCEMENT] Add pod controller kind and name to Kubernetes service discovery data
* [ENHANCEMENT] Move TSDB to flock-based log file that works with Docker containers
* [BUGFIX] Properly propagate storage errors in PromQL
* [BUGFIX] Fix path prefix for web pages
* [BUGFIX] Fix goroutine leak in Consul service discovery
* [BUGFIX] Fix races in scrape manager
* [BUGFIX] Fix OOM for very large k in PromQL topk() queries
* [BUGFIX] Make remote write more resilient to unavailable receivers
* [BUGFIX] Make remote write shutdown cleanly
* [BUGFIX] Don't leak files on errors in TSDB's tombstone cleanup
* [BUGFIX] Unary minus expressions now removes the metric name from results
* [BUGFIX] Fix bug that lead to wrong amount of samples considered for time range expressions
## 2.2.1 / 2018-03-13
* [BUGFIX] Fix data loss in TSDB on compaction
* [BUGFIX] Correctly stop timer in remote-write path
* [BUGFIX] Fix deadlock triggerd by loading targets page
* [BUGFIX] Fix incorrect buffering of samples on range selection queries
* [BUGFIX] Handle large index files on windows properly
## 2.2.0 / 2018-03-08
* [CHANGE] Rename file SD mtime metric.
* [CHANGE] Send target update on empty pod IP in Kubernetes SD.
* [FEATURE] Add API endpoint for flags.
* [FEATURE] Add API endpoint for dropped targets.
* [FEATURE] Display annotations on alerts page.
* [FEATURE] Add option to skip head data when taking snapshots.
* [ENHANCEMENT] Federation performance improvement.
* [ENHANCEMENT] Read bearer token file on every scrape.
* [ENHANCEMENT] Improve typeahead on `/graph` page.
* [ENHANCEMENT] Change rule file formatting.
* [ENHANCEMENT] Set consul server default to `localhost:8500`.
* [ENHANCEMENT] Add dropped Alertmanagers to API info endpoint.
* [ENHANCEMENT] Add OS type meta label to Azure SD.
* [ENHANCEMENT] Validate required fields in SD configuration.
* [BUGFIX] Prevent stack overflow on deep recursion in TSDB.
* [BUGFIX] Correctly read offsets in index files that are greater than 4GB.
* [BUGFIX] Fix scraping behavior for empty labels.
* [BUGFIX] Drop metric name for bool modifier.
* [BUGFIX] Fix races in discovery.
* [BUGFIX] Fix Kubernetes endpoints SD for empty subsets.
* [BUGFIX] Throttle updates from SD providers, which caused increased CPU usage and allocations.
* [BUGFIX] Fix TSDB block reload issue.
* [BUGFIX] Fix PromQL printing of empty `without()`.
* [BUGFIX] Don't reset FiredAt for inactive alerts.
* [BUGFIX] Fix erroneous file version changes and repair existing data.
## 2.1.0 / 2018-01-19
* [FEATURE] New Service Discovery UI showing labels before and after relabelling.
* [FEATURE] New Admin APIs added to v1 to delete, snapshot and remove tombstones.
* [ENHANCEMENT] The graph UI autcomplete now includes your previous queries.
* [ENHANCEMENT] Federation is now much faster for large numbers of series.
* [ENHANCEMENT] Added new metrics to measure rule timings.
* [ENHANCEMENT] Rule evaluation times added to the rules UI.
* [ENHANCEMENT] Added metrics to measure modified time of file SD files.
* [ENHANCEMENT] Kubernetes SD now includes POD UID in discovery metadata.
* [ENHANCEMENT] The Query APIs now return optional stats on query execution times.
* [ENHANCEMENT] The index now no longer has the 4GiB size limit and is also smaller.
* [BUGFIX] Remote read `read_recent` option is now false by default.
* [BUGFIX] Pass the right configuration to each Alertmanager (AM) when using multiple AM configs.
* [BUGFIX] Fix not-matchers not selecting series with labels unset.
* [BUGFIX] tsdb: Fix occasional panic in head block.
* [BUGFIX] tsdb: Close files before deletion to fix retention issues on Windows and NFS.
* [BUGFIX] tsdb: Cleanup and do not retry failing compactions.
* [BUGFIX] tsdb: Close WAL while shutting down.
## 2.0.0 / 2017-11-08
This release includes a completely rewritten storage, huge performance
improvements, but also many backwards incompatible changes. For more
information, read the announcement blog post and migration guide.
https://prometheus.io/blog/2017/11/08/announcing-prometheus-2-0/
https://prometheus.io/docs/prometheus/2.0/migration/
* [CHANGE] Completely rewritten storage layer, with WAL. This is not backwards compatible with 1.x storage, and many flags have changed/disappeared.
* [CHANGE] New staleness behavior. Series now marked stale after target scrapes no longer return them, and soon after targets disappear from service discovery.
* [CHANGE] Rules files use YAML syntax now. Conversion tool added to promtool.
* [CHANGE] Removed `count_scalar`, `drop_common_labels` functions and `keep_common` modifier from PromQL.
* [CHANGE] Rewritten exposition format parser with much higher performance. The Protobuf exposition format is no longer supported.
* [CHANGE] Example console templates updated for new storage and metrics names. Examples other than node exporter and Prometheus removed.
* [CHANGE] Admin and lifecycle APIs now disabled by default, can be re-enabled via flags
* [CHANGE] Flags switched to using Kingpin, all flags are now --flagname rather than -flagname.
* [FEATURE/CHANGE] Remote read can be configured to not read data which is available locally. This is enabled by default.
* [FEATURE] Rules can be grouped now. Rules within a rule group are executed sequentially.
* [FEATURE] Added experimental GRPC apis
* [FEATURE] Add timestamp() function to PromQL.
* [ENHANCEMENT] Remove remote read from the query path if no remote storage is configured.
* [ENHANCEMENT] Bump Consul HTTP client timeout to not match the Consul SD watch timeout.
* [ENHANCEMENT] Go-conntrack added to provide HTTP connection metrics.
* [BUGFIX] Fix connection leak in Consul SD.
## 1.8.2 / 2017-11-04
* [BUGFIX] EC2 service discovery: Do not crash if tags are empty.
## 1.8.1 / 2017-10-19
* [BUGFIX] Correctly handle external labels on remote read endpoint
## 1.8.0 / 2017-10-06
* [CHANGE] Rule links link to the _Console_ tab rather than the _Graph_ tab to
not trigger expensive range queries by default.
* [FEATURE] Ability to act as a remote read endpoint for other Prometheus
servers.
* [FEATURE] K8s SD: Support discovery of ingresses.
* [FEATURE] Consul SD: Support for node metadata.
* [FEATURE] Openstack SD: Support discovery of hypervisors.
* [FEATURE] Expose current Prometheus config via `/status/config`.
* [FEATURE] Allow to collapse jobs on `/targets` page.
* [FEATURE] Add `/-/healthy` and `/-/ready` endpoints.
* [FEATURE] Add color scheme support to console templates.
* [ENHANCEMENT] Remote storage connections use HTTP keep-alive.
* [ENHANCEMENT] Improved logging about remote storage.
* [ENHANCEMENT] Relaxed URL validation.
* [ENHANCEMENT] Openstack SD: Handle instances without IP.
* [ENHANCEMENT] Make remote storage queue manager configurable.
* [ENHANCEMENT] Validate metrics returned from remote read.
* [ENHANCEMENT] EC2 SD: Set a default region.
* [ENHANCEMENT] Changed help link to `https://prometheus.io/docs`.
* [BUGFIX] Fix floating-point precision issue in `deriv` function.
* [BUGFIX] Fix pprof endpoints when -web.route-prefix or -web.external-url is
used.
* [BUGFIX] Fix handling of `null` target groups in file-based SD.
* [BUGFIX] Set the sample timestamp in date-related PromQL functions.
* [BUGFIX] Apply path prefix to redirect from deprecated graph URL.
* [BUGFIX] Fixed tests on MS Windows.
* [BUGFIX] Check for invalid UTF-8 in label values after relabeling.
## 1.7.2 / 2017-09-26
* [BUGFIX] Correctly remove all targets from DNS service discovery if the
corresponding DNS query succeeds and returns an empty result.
* [BUGFIX] Correctly parse resolution input in expression browser.
* [BUGFIX] Consistently use UTC in the date picker of the expression browser.
* [BUGFIX] Correctly handle multiple ports in Marathon service discovery.
* [BUGFIX] Fix HTML escaping so that HTML templates compile with Go1.9.
* [BUGFIX] Prevent number of remote write shards from going negative.
* [BUGFIX] In the graphs created by the expression browser, render very large
and small numbers in a readable way.
* [BUGFIX] Fix a rarely occurring iterator issue in varbit encoded chunks.
## 1.7.1 / 2017-06-12
* [BUGFIX] Fix double prefix redirect.
## 1.7.0 / 2017-06-06
* [CHANGE] Compress remote storage requests and responses with unframed/raw snappy.
* [CHANGE] Properly ellide secrets in config.
* [FEATURE] Add OpenStack service discovery.
* [FEATURE] Add ability to limit Kubernetes service discovery to certain namespaces.
* [FEATURE] Add metric for discovered number of Alertmanagers.
* [ENHANCEMENT] Print system information (uname) on start up.
* [ENHANCEMENT] Show gaps in graphs on expression browser.
* [ENHANCEMENT] Promtool linter checks counter naming and more reserved labels.
* [BUGFIX] Fix broken Mesos discovery.
* [BUGFIX] Fix redirect when external URL is set.
* [BUGFIX] Fix mutation of active alert elements by notifier.
* [BUGFIX] Fix HTTP error handling for remote write.
* [BUGFIX] Fix builds for Solaris/Illumos.
* [BUGFIX] Fix overflow checking in global config.
* [BUGFIX] Fix log level reporting issue.
* [BUGFIX] Fix ZooKeeper serverset discovery can become out-of-sync.
## 1.6.3 / 2017-05-18
* [BUGFIX] Fix disappearing Alertmanger targets in Alertmanager discovery.
* [BUGFIX] Fix panic with remote_write on ARMv7.
* [BUGFIX] Fix stacked graphs to adapt min/max values.
## 1.6.2 / 2017-05-11
* [BUGFIX] Fix potential memory leak in Kubernetes service discovery
## 1.6.1 / 2017-04-19
* [BUGFIX] Don't panic if storage has no FPs even after initial wait
## 1.6.0 / 2017-04-14
* [CHANGE] Replaced the remote write implementations for various backends by a
generic write interface with example adapter implementation for various
backends. Note that both the previous and the current remote write
implementations are **experimental**.
* [FEATURE] New flag `-storage.local.target-heap-size` to tell Prometheus about
the desired heap size. This deprecates the flags
`-storage.local.memory-chunks` and `-storage.local.max-chunks-to-persist`,
which are kept for backward compatibility.
* [FEATURE] Add `check-metrics` to `promtool` to lint metric names.
* [FEATURE] Add Joyent Triton discovery.
* [FEATURE] `X-Prometheus-Scrape-Timeout-Seconds` header in HTTP scrape
requests.
* [FEATURE] Remote read interface, including example for InfluxDB. **Experimental.**
* [FEATURE] Enable Consul SD to connect via TLS.
* [FEATURE] Marathon SD supports multiple ports.
* [FEATURE] Marathon SD supports bearer token for authentication.
* [FEATURE] Custom timeout for queries.
* [FEATURE] Expose `buildQueryUrl` in `graph.js`.
* [FEATURE] Add `rickshawGraph` property to the graph object in console
templates.
* [FEATURE] New metrics exported by Prometheus itself:
* Summary `prometheus_engine_query_duration_seconds`
* Counter `prometheus_evaluator_iterations_missed_total`
* Counter `prometheus_evaluator_iterations_total`
* Gauge `prometheus_local_storage_open_head_chunks`
* Gauge `prometheus_local_storage_target_heap_size`
* [ENHANCEMENT] Reduce shut-down time by interrupting an ongoing checkpoint
before starting the final checkpoint.
* [ENHANCEMENT] Auto-tweak times between checkpoints to limit time spent in
checkpointing to 50%.
* [ENHANCEMENT] Improved crash recovery deals better with certain index
corruptions.
* [ENHANCEMENT] Graphing deals better with constant time series.
* [ENHANCEMENT] Retry remote writes on recoverable errors.
* [ENHANCEMENT] Evict unused chunk descriptors during crash recovery to limit
memory usage.
* [ENHANCEMENT] Smoother disk usage during series maintenance.
* [ENHANCEMENT] Targets on targets page sorted by instance within a job.
* [ENHANCEMENT] Sort labels in federation.
* [ENHANCEMENT] Set `GOGC=40` by default, which results in much better memory
utilization at the price of slightly higher CPU usage. If `GOGC` is set by
the user, it is still honored as usual.
* [ENHANCEMENT] Close head chunks after being idle for the duration of the
configured staleness delta. This helps to persist and evict head chunk of
stale series more quickly.
* [ENHANCEMENT] Stricter checking of relabel config.
* [ENHANCEMENT] Cache busters for static web content.
* [ENHANCEMENT] Send Prometheus-specific user-agent header during scrapes.
* [ENHANCEMENT] Improved performance of series retention cut-off.
* [ENHANCEMENT] Mitigate impact of non-atomic sample ingestion on
`histogram_quantile` by enforcing buckets to be monotonic.
* [ENHANCEMENT] Released binaries built with Go 1.8.1.
* [BUGFIX] Send `instance=""` with federation if `instance` not set.
* [BUGFIX] Update to new `client_golang` to get rid of unwanted quantile
metrics in summaries.
* [BUGFIX] Introduce several additional guards against data corruption.
* [BUGFIX] Mark storage dirty and increment
`prometheus_local_storage_persist_errors_total` on all relevant errors.
* [BUGFIX] Propagate storage errors as 500 in the HTTP API.
* [BUGFIX] Fix int64 overflow in timestamps in the HTTP API.
* [BUGFIX] Fix deadlock in Zookeeper SD.
* [BUGFIX] Fix fuzzy search problems in the web-UI auto-completion.
## 1.5.3 / 2017-05-11
* [BUGFIX] Fix potential memory leak in Kubernetes service discovery
## 1.5.2 / 2017-02-10
* [BUGFIX] Fix series corruption in a special case of series maintenance where
the minimum series-file-shrink-ratio kicks in.
* [BUGFIX] Fix two panic conditions both related to processing a series
scheduled to be quarantined.
* [ENHANCEMENT] Binaries built with Go1.7.5.
## 1.5.1 / 2017-02-07
* [BUGFIX] Don't lose fully persisted memory series during checkpointing.
* [BUGFIX] Fix intermittently failing relabeling.
* [BUGFIX] Make `-storage.local.series-file-shrink-ratio` work.
* [BUGFIX] Remove race condition from TestLoop.
## 1.5.0 / 2017-01-23
* [CHANGE] Use lexicographic order to sort alerts by name.
* [FEATURE] Add Joyent Triton discovery.
* [FEATURE] Add scrape targets and alertmanager targets API.
* [FEATURE] Add various persistence related metrics.
* [FEATURE] Add various query engine related metrics.
* [FEATURE] Add ability to limit scrape samples, and related metrics.
* [FEATURE] Add labeldrop and labelkeep relabelling actions.
* [FEATURE] Display current working directory on status-page.
* [ENHANCEMENT] Strictly use ServiceAccount for in cluster configuration on Kubernetes.
* [ENHANCEMENT] Various performance and memory-management improvements.
* [BUGFIX] Fix basic auth for alertmanagers configured via flag.
* [BUGFIX] Don't panic on decoding corrupt data.
* [BUGFIX] Ignore dotfiles in data directory.
* [BUGFIX] Abort on intermediate federation errors.
## 1.4.1 / 2016-11-28
* [BUGFIX] Fix Consul service discovery
## 1.4.0 / 2016-11-25
* [FEATURE] Allow configuring Alertmanagers via service discovery
* [FEATURE] Display used Alertmanagers on runtime page in the UI
* [FEATURE] Support profiles in AWS EC2 service discovery configuration
* [ENHANCEMENT] Remove duplicated logging of Kubernetes client errors
* [ENHANCEMENT] Add metrics about Kubernetes service discovery
* [BUGFIX] Update alert annotations on re-evaluation
* [BUGFIX] Fix export of group modifier in PromQL queries
* [BUGFIX] Remove potential deadlocks in several service discovery implementations
* [BUGFIX] Use proper float64 modulo in PromQL `%` binary operations
* [BUGFIX] Fix crash bug in Kubernetes service discovery
## 1.3.1 / 2016-11-04
This bug-fix release pulls in the fixes from the 1.2.3 release.
* [BUGFIX] Correctly handle empty Regex entry in relabel config.
* [BUGFIX] MOD (`%`) operator doesn't panic with small floating point numbers.
* [BUGFIX] Updated miekg/dns vendoring to pick up upstream bug fixes.
* [ENHANCEMENT] Improved DNS error reporting.
## 1.2.3 / 2016-11-04
Note that this release is chronologically after 1.3.0.
* [BUGFIX] Correctly handle end time before start time in range queries.
* [BUGFIX] Error on negative `-storage.staleness-delta`
* [BUGFIX] Correctly handle empty Regex entry in relabel config.
* [BUGFIX] MOD (`%`) operator doesn't panic with small floating point numbers.
* [BUGFIX] Updated miekg/dns vendoring to pick up upstream bug fixes.
* [ENHANCEMENT] Improved DNS error reporting.
## 1.3.0 / 2016-11-01
This is a breaking change to the Kubernetes service discovery.
* [CHANGE] Rework Kubernetes SD.
* [FEATURE] Add support for interpolating `target_label`.
* [FEATURE] Add GCE metadata as Prometheus meta labels.
* [ENHANCEMENT] Add EC2 SD metrics.
* [ENHANCEMENT] Add Azure SD metrics.
* [ENHANCEMENT] Add fuzzy search to `/graph` textarea.
* [ENHANCEMENT] Always show instance labels on target page.
* [BUGFIX] Validate query end time is not before start time.
* [BUGFIX] Error on negative `-storage.staleness-delta`
## 1.2.2 / 2016-10-30
* [BUGFIX] Correctly handle on() in alerts.
* [BUGFIX] UI: Deal properly with aborted requests.
* [BUGFIX] UI: Decode URL query parameters properly.
* [BUGFIX] Storage: Deal better with data corruption (non-monotonic timestamps).
* [BUGFIX] Remote storage: Re-add accidentally removed timeout flag.
* [BUGFIX] Updated a number of vendored packages to pick up upstream bug fixes.
## 1.2.1 / 2016-10-10
* [BUGFIX] Count chunk evictions properly so that the server doesn't
assume it runs out of memory and subsequencly throttles ingestion.
* [BUGFIX] Use Go1.7.1 for prebuilt binaries to fix issues on MacOS Sierra.
## 1.2.0 / 2016-10-07
* [FEATURE] Cleaner encoding of query parameters in `/graph` URLs.
* [FEATURE] PromQL: Add `minute()` function.
* [FEATURE] Add GCE service discovery.
* [FEATURE] Allow any valid UTF-8 string as job name.
* [FEATURE] Allow disabling local storage.
* [FEATURE] EC2 service discovery: Expose `ec2_instance_state`.
* [ENHANCEMENT] Various performance improvements in local storage.
* [BUGFIX] Zookeeper service discovery: Remove deleted nodes.
* [BUGFIX] Zookeeper service discovery: Resync state after Zookeeper failure.
* [BUGFIX] Remove JSON from HTTP Accept header.
* [BUGFIX] Fix flag validation of Alertmanager URL.
* [BUGFIX] Fix race condition on shutdown.
* [BUGFIX] Do not fail Consul discovery on Prometheus startup when Consul
is down.
* [BUGFIX] Handle NaN in `changes()` correctly.
* [CHANGE] **Experimental** remote write path: Remove use of gRPC.
* [CHANGE] **Experimental** remote write path: Configuration via config file
rather than command line flags.
* [FEATURE] **Experimental** remote write path: Add HTTP basic auth and TLS.
* [FEATURE] **Experimental** remote write path: Support for relabelling.
## 1.1.3 / 2016-09-16
* [ENHANCEMENT] Use golang-builder base image for tests in CircleCI.
* [ENHANCEMENT] Added unit tests for federation.
* [BUGFIX] Correctly de-dup metric families in federation output.
## 1.1.2 / 2016-09-08
* [BUGFIX] Allow label names that coincide with keywords.
## 1.1.1 / 2016-09-07
* [BUGFIX] Fix IPv6 escaping in service discovery integrations
* [BUGFIX] Fix default scrape port assignment for IPv6
## 1.1.0 / 2016-09-03
* [FEATURE] Add `quantile` and `quantile_over_time`.
* [FEATURE] Add `stddev_over_time` and `stdvar_over_time`.
* [FEATURE] Add various time and date functions.
* [FEATURE] Added `toUpper` and `toLower` formatting to templates.
* [FEATURE] Allow relabeling of alerts.
* [FEATURE] Allow URLs in targets defined via a JSON file.
* [FEATURE] Add idelta function.
* [FEATURE] 'Remove graph' button on the /graph page.
* [FEATURE] Kubernetes SD: Add node name and host IP to pod discovery.
* [FEATURE] New remote storage write path. EXPERIMENTAL!
* [ENHANCEMENT] Improve time-series index lookups.
* [ENHANCEMENT] Forbid invalid relabel configurations.
* [ENHANCEMENT] Improved various tests.
* [ENHANCEMENT] Add crash recovery metric 'started_dirty'.
* [ENHANCEMENT] Fix (and simplify) populating series iterators.
* [ENHANCEMENT] Add job link on target page.
* [ENHANCEMENT] Message on empty Alerts page.
* [ENHANCEMENT] Various internal code refactorings and clean-ups.
* [ENHANCEMENT] Various improvements in the build system.
* [BUGFIX] Catch errors when unmarshalling delta/doubleDelta encoded chunks.
* [BUGFIX] Fix data race in lexer and lexer test.
* [BUGFIX] Trim stray whitespace from bearer token file.
* [BUGFIX] Avoid divide-by-zero panic on query_range?step=0.
* [BUGFIX] Detect invalid rule files at startup.
* [BUGFIX] Fix counter reset treatment in PromQL.
* [BUGFIX] Fix rule HTML escaping issues.
* [BUGFIX] Remove internal labels from alerts sent to AM.
## 1.0.2 / 2016-08-24
* [BUGFIX] Clean up old targets after config reload.
## 1.0.1 / 2016-07-21
* [BUGFIX] Exit with error on non-flag command-line arguments.
* [BUGFIX] Update example console templates to new HTTP API.
* [BUGFIX] Re-add logging flags.
## 1.0.0 / 2016-07-18
* [CHANGE] Remove deprecated query language keywords
* [CHANGE] Change Kubernetes SD to require specifying Kubernetes role
* [CHANGE] Use service address in Consul SD if available
* [CHANGE] Standardize all Prometheus internal metrics to second units
* [CHANGE] Remove unversioned legacy HTTP API
* [CHANGE] Remove legacy ingestion of JSON metric format
* [CHANGE] Remove deprecated `target_groups` configuration
* [FEATURE] Add binary power operation to PromQL
* [FEATURE] Add `count_values` aggregator
* [FEATURE] Add `-web.route-prefix` flag
* [FEATURE] Allow `on()`, `by()`, `without()` in PromQL with empty label sets
* [ENHANCEMENT] Make `topk/bottomk` query functions aggregators
* [BUGFIX] Fix annotations in alert rule printing
* [BUGFIX] Expand alert templating at evaluation time
* [BUGFIX] Fix edge case handling in crash recovery
* [BUGFIX] Hide testing package flags from help output
## 0.20.0 / 2016-06-15
This release contains multiple breaking changes to the configuration schema.
* [FEATURE] Allow configuring multiple Alertmanagers
* [FEATURE] Add server name to TLS configuration
* [FEATURE] Add labels for all node addresses and discover node port if available in Kubernetes SD
* [ENHANCEMENT] More meaningful configuration errors
* [ENHANCEMENT] Round scraping timestamps to milliseconds in web UI
* [ENHANCEMENT] Make number of storage fingerprint locks configurable
* [BUGFIX] Fix date parsing in console template graphs
* [BUGFIX] Fix static console files in Docker images
* [BUGFIX] Fix console JS XHR requests for IE11
* [BUGFIX] Add missing path prefix in new status page
* [CHANGE] Rename `target_groups` to `static_configs` in config files
* [CHANGE] Rename `names` to `files` in file SD configuration
* [CHANGE] Remove kubelet port config option in Kubernetes SD configuration
## 0.19.3 / 2016-06-14
* [BUGFIX] Handle Marathon apps with zero ports
* [BUGFIX] Fix startup panic in retrieval layer
## 0.19.2 / 2016-05-29
* [BUGFIX] Correctly handle `GROUP_LEFT` and `GROUP_RIGHT` without labels in
string representation of expressions and in rules.
* [BUGFIX] Use `-web.external-url` for new status endpoints.
## 0.19.1 / 2016-05-25
* [BUGFIX] Handle service discovery panic affecting Kubernetes SD
* [BUGFIX] Fix web UI display issue in some browsers
## 0.19.0 / 2016-05-24
This version contains a breaking change to the query language. Please read
the documentation on the grouping behavior of vector matching:
https://prometheus.io/docs/querying/operators/#vector-matching
* [FEATURE] Add experimental Microsoft Azure service discovery
* [FEATURE] Add `ignoring` modifier for binary operations
* [FEATURE] Add pod discovery to Kubernetes service discovery
* [CHANGE] Vector matching takes grouping labels from one-side
* [ENHANCEMENT] Support time range on /api/v1/series endpoint
* [ENHANCEMENT] Partition status page into individual pages
* [BUGFIX] Fix issue of hanging target scrapes
## 0.18.0 / 2016-04-18
* [BUGFIX] Fix operator precedence in PromQL
* [BUGFIX] Never drop still open head chunk
* [BUGFIX] Fix missing 'keep_common' when printing AST node
* [CHANGE/BUGFIX] Target identity considers path and parameters additionally to host and port
* [CHANGE] Rename metric `prometheus_local_storage_invalid_preload_requests_total` to `prometheus_local_storage_non_existent_series_matches_total`
* [CHANGE] Support for old alerting rule syntax dropped
* [FEATURE] Deduplicate targets within the same scrape job
* [FEATURE] Add varbit chunk encoding (higher compression, more CPU usage – disabled by default)
* [FEATURE] Add `holt_winters` query function
* [FEATURE] Add relative complement `unless` operator to PromQL
* [ENHANCEMENT] Quarantine series file if data corruption is encountered (instead of crashing)
* [ENHANCEMENT] Validate Alertmanager URL
* [ENHANCEMENT] Use UTC for build timestamp
* [ENHANCEMENT] Improve index query performance (especially for active time series)
* [ENHANCEMENT] Instrument configuration reload duration
* [ENHANCEMENT] Instrument retrieval layer
* [ENHANCEMENT] Add Go version to `prometheus_build_info` metric
## 0.17.0 / 2016-03-02
This version no longer works with Alertmanager 0.0.4 and earlier!
The alerting rule syntax has changed as well but the old syntax is supported
up until version 0.18.
All regular expressions in PromQL are anchored now, matching the behavior of
regular expressions in config files.
* [CHANGE] Integrate with Alertmanager 0.1.0 and higher
* [CHANGE] Degraded storage mode renamed to rushed mode
* [CHANGE] New alerting rule syntax
* [CHANGE] Add label validation on ingestion
* [CHANGE] Regular expression matchers in PromQL are anchored
* [FEATURE] Add `without` aggregation modifier
* [FEATURE] Send alert resolved notifications to Alertmanager
* [FEATURE] Allow millisecond precision in configuration file
* [FEATURE] Support AirBnB's Smartstack Nerve for service discovery
* [ENHANCEMENT] Storage switches less often between regular and rushed mode.
* [ENHANCEMENT] Storage switches into rushed mode if there are too many memory chunks.
* [ENHANCEMENT] Added more storage instrumentation
* [ENHANCEMENT] Improved instrumentation of notification handler
* [BUGFIX] Do not count head chunks as chunks waiting for persistence
* [BUGFIX] Handle OPTIONS HTTP requests to the API correctly
* [BUGFIX] Parsing of ranges in PromQL fixed
* [BUGFIX] Correctly validate URL flag parameters
* [BUGFIX] Log argument parse errors
* [BUGFIX] Properly handle creation of target with bad TLS config
* [BUGFIX] Fix of checkpoint timing issue
## 0.16.2 / 2016-01-18
* [FEATURE] Multiple authentication options for EC2 discovery added
* [FEATURE] Several meta labels for EC2 discovery added
* [FEATURE] Allow full URLs in static target groups (used e.g. by the `blackbox_exporter`)
* [FEATURE] Add Graphite remote-storage integration
* [FEATURE] Create separate Kubernetes targets for services and their endpoints
* [FEATURE] Add `clamp_{min,max}` functions to PromQL
* [FEATURE] Omitted time parameter in API query defaults to now
* [ENHANCEMENT] Less frequent time series file truncation
* [ENHANCEMENT] Instrument number of manually deleted time series
* [ENHANCEMENT] Ignore lost+found directory during storage version detection
* [CHANGE] Kubernetes `masters` renamed to `api_servers`
* [CHANGE] "Healthy" and "unhealthy" targets are now called "up" and "down" in the web UI
* [CHANGE] Remove undocumented 2nd argument of the `delta` function.
(This is a BREAKING CHANGE for users of the undocumented 2nd argument.)
* [BUGFIX] Return proper HTTP status codes on API errors
* [BUGFIX] Fix Kubernetes authentication configuration
* [BUGFIX] Fix stripped OFFSET from in rule evaluation and display
* [BUGFIX] Do not crash on failing Consul SD initialization
* [BUGFIX] Revert changes to metric auto-completion
* [BUGFIX] Add config overflow validation for TLS configuration
* [BUGFIX] Skip already watched Zookeeper nodes in serverset SD
* [BUGFIX] Don't federate stale samples
* [BUGFIX] Move NaN to end of result for `topk/bottomk/sort/sort_desc/min/max`
* [BUGFIX] Limit extrapolation of `delta/rate/increase`
* [BUGFIX] Fix unhandled error in rule evaluation
Some changes to the Kubernetes service discovery were integration since
it was released as a beta feature.
## 0.16.1 / 2015-10-16
* [FEATURE] Add `irate()` function.
* [ENHANCEMENT] Improved auto-completion in expression browser.
* [CHANGE] Kubernetes SD moves node label to instance label.
* [BUGFIX] Escape regexes in console templates.
## 0.16.0 / 2015-10-09
BREAKING CHANGES:
* Release tarballs now contain the built binaries in a nested directory.
* The `hash_mod` relabeling action now uses MD5 hashes instead of FNV hashes to
achieve a better distribution.
* The DNS-SD meta label `__meta_dns_srv_name` was renamed to `__meta_dns_name`
to reflect support for DNS record types other than `SRV`.
* The default full refresh interval for the file-based service discovery has been
increased from 30 seconds to 5 minutes.
* In relabeling, parts of a source label that weren't matched by
the specified regular expression are no longer included in the replacement
output.
* Queries no longer interpolate between two data points. Instead, the resulting
value will always be the latest value before the evaluation query timestamp.
* Regular expressions supplied via the configuration are now anchored to match
full strings instead of substrings.
* Global labels are not appended upon storing time series anymore. Instead,
they are only appended when communicating with external systems
(Alertmanager, remote storages, federation). They have thus also been renamed
from `global.labels` to `global.external_labels`.
* The names and units of metrics related to remote storage sample appends have
been changed.
* The experimental support for writing to InfluxDB has been updated to work
with InfluxDB 0.9.x. 0.8.x versions of InfluxDB are not supported anymore.
* Escape sequences in double- and single-quoted string literals in rules or query
expressions are now interpreted like escape sequences in Go string literals
(https://golang.org/ref/spec#String_literals).
Future breaking changes / deprecated features:
* The `delta()` function had an undocumented optional second boolean argument
to make it behave like `increase()`. This second argument will be removed in
the future. Migrate any occurrences of `delta(x, 1)` to use `increase(x)`
instead.
* Support for filter operators between two scalar values (like `2 > 1`) will be
removed in the future. These will require a `bool` modifier on the operator,
e.g. `2 > bool 1`.
All changes:
* [CHANGE] Renamed `global.labels` to `global.external_labels`.
* [CHANGE] Vendoring is now done via govendor instead of godep.
* [CHANGE] Change web UI root page to show the graphing interface instead of
the server status page.
* [CHANGE] Append global labels only when communicating with external systems
instead of storing them locally.
* [CHANGE] Change all regexes in the configuration to do full-string matches
instead of substring matches.
* [CHANGE] Remove interpolation of vector values in queries.
* [CHANGE] For alert `SUMMARY`/`DESCRIPTION` template fields, cast the alert
value to `float64` to work with common templating functions.
* [CHANGE] In relabeling, don't include unmatched source label parts in the
replacement.
* [CHANGE] Change default full refresh interval for the file-based service
discovery from 30 seconds to 5 minutes.
* [CHANGE] Rename the DNS-SD meta label `__meta_dns_srv_name` to
`__meta_dns_name` to reflect support for other record types than `SRV`.
* [CHANGE] Release tarballs now contain the binaries in a nested directory.
* [CHANGE] Update InfluxDB write support to work with InfluxDB 0.9.x.
* [FEATURE] Support full "Go-style" escape sequences in strings and add raw
string literals.
* [FEATURE] Add EC2 service discovery support.
* [FEATURE] Allow configuring TLS options in scrape configurations.
* [FEATURE] Add instrumentation around configuration reloads.
* [FEATURE] Add `bool` modifier to comparison operators to enable boolean
(`0`/`1`) output instead of filtering.
* [FEATURE] In Zookeeper serverset discovery, provide `__meta_serverset_shard`
label with the serverset shard number.
* [FEATURE] Provide `__meta_consul_service_id` meta label in Consul service
discovery.
* [FEATURE] Allow scalar expressions in recording rules to enable use cases
such as building constant metrics.
* [FEATURE] Add `label_replace()` and `vector()` query language functions.
* [FEATURE] In Consul service discovery, fill in the `__meta_consul_dc`
datacenter label from the Consul agent when it's not set in the Consul SD
config.
* [FEATURE] Scrape all services upon empty services list in Consul service
discovery.
* [FEATURE] Add `labelmap` relabeling action to map a set of input labels to a
set of output labels using regular expressions.
* [FEATURE] Introduce `__tmp` as a relabeling label prefix that is guaranteed
to not be used by Prometheus internally.
* [FEATURE] Kubernetes-based service discovery.
* [FEATURE] Marathon-based service discovery.
* [FEATURE] Support multiple series names in console graphs JavaScript library.
* [FEATURE] Allow reloading configuration via web handler at `/-/reload`.
* [FEATURE] Updates to promtool to reflect new Prometheus configuration
features.
* [FEATURE] Add `proxy_url` parameter to scrape configurations to enable use of
proxy servers.
* [FEATURE] Add console templates for Prometheus itself.
* [FEATURE] Allow relabeling the protocol scheme of targets.
* [FEATURE] Add `predict_linear()` query language function.
* [FEATURE] Support for authentication using bearer tokens, client certs, and
CA certs.
* [FEATURE] Implement unary expressions for vector types (`-foo`, `+foo`).
* [FEATURE] Add console templates for the SNMP exporter.
* [FEATURE] Make it possible to relabel target scrape query parameters.
* [FEATURE] Add support for `A` and `AAAA` records in DNS service discovery.
* [ENHANCEMENT] Fix several flaky tests.
* [ENHANCEMENT] Switch to common routing package.
* [ENHANCEMENT] Use more resilient metric decoder.
* [ENHANCEMENT] Update vendored dependencies.
* [ENHANCEMENT] Add compression to more HTTP handlers.
* [ENHANCEMENT] Make -web.external-url flag help string more verbose.
* [ENHANCEMENT] Improve metrics around remote storage queues.
* [ENHANCEMENT] Use Go 1.5.1 instead of Go 1.4.2 in builds.
* [ENHANCEMENT] Update the architecture diagram in the `README.md`.
* [ENHANCEMENT] Time out sample appends in retrieval layer if the storage is
backlogging.
* [ENHANCEMENT] Make `hash_mod` relabeling action use MD5 instead of FNV to
enable better hash distribution.
* [ENHANCEMENT] Better tracking of targets between same service discovery
mechanisms in one scrape configuration.
* [ENHANCEMENT] Handle parser and query evaluation runtime panics more
gracefully.
* [ENHANCEMENT] Add IDs to H2 tags on status page to allow anchored linking.
* [BUGFIX] Fix watching multiple paths with Zookeeper serverset discovery.
* [BUGFIX] Fix high CPU usage on configuration reload.
* [BUGFIX] Fix disappearing `__params` on configuration reload.
* [BUGFIX] Make `labelmap` action available through configuration.
* [BUGFIX] Fix direct access of protobuf fields.
* [BUGFIX] Fix panic on Consul request error.
* [BUGFIX] Redirect of graph endpoint for prefixed setups.
* [BUGFIX] Fix series file deletion behavior when purging archived series.
* [BUGFIX] Fix error checking and logging around checkpointing.
* [BUGFIX] Fix map initialization in target manager.
* [BUGFIX] Fix draining of file watcher events in file-based service discovery.
* [BUGFIX] Add `POST` handler for `/debug` endpoints to fix CPU profiling.
* [BUGFIX] Fix several flaky tests.
* [BUGFIX] Fix busylooping in case a scrape configuration has no target
providers defined.
* [BUGFIX] Fix exit behavior of static target provider.
* [BUGFIX] Fix configuration reloading loop upon shutdown.
* [BUGFIX] Add missing check for nil expression in expression parser.
* [BUGFIX] Fix error handling bug in test code.
* [BUGFIX] Fix Consul port meta label.
* [BUGFIX] Fix lexer bug that treated non-Latin Unicode digits as digits.
* [CLEANUP] Remove obsolete federation example from console templates.
* [CLEANUP] Remove duplicated Bootstrap JS inclusion on graph page.
* [CLEANUP] Switch to common log package.
* [CLEANUP] Update build environment scripts and Makefiles to work better with
native Go build mechanisms and new Go 1.5 experimental vendoring support.
* [CLEANUP] Remove logged notice about 0.14.x configuration file format change.
* [CLEANUP] Move scrape-time metric label modification into SampleAppenders.
* [CLEANUP] Switch from `github.com/client_golang/model` to
`github.com/common/model` and related type cleanups.
* [CLEANUP] Switch from `github.com/client_golang/extraction` to
`github.com/common/expfmt` and related type cleanups.
* [CLEANUP] Exit Prometheus when the web server encounters a startup error.
* [CLEANUP] Remove non-functional alert-silencing links on alerting page.
* [CLEANUP] General cleanups to comments and code, derived from `golint`,
`go vet`, or otherwise.
* [CLEANUP] When entering crash recovery, tell users how to cleanly shut down
Prometheus.
* [CLEANUP] Remove internal support for multi-statement queries in query engine.
* [CLEANUP] Update AUTHORS.md.
* [CLEANUP] Don't warn/increment metric upon encountering equal timestamps for
the same series upon append.
* [CLEANUP] Resolve relative paths during configuration loading.
## 0.15.1 / 2015-07-27
* [BUGFIX] Fix vector matching behavior when there is a mix of equality and
non-equality matchers in a vector selector and one matcher matches no series.
* [ENHANCEMENT] Allow overriding `GOARCH` and `GOOS` in Makefile.INCLUDE.
* [ENHANCEMENT] Update vendored dependencies.
## 0.15.0 / 2015-07-21
BREAKING CHANGES:
* Relative paths for rule files are now evaluated relative to the config file.
* External reachability flags (`-web.*`) consolidated.
* The default storage directory has been changed from `/tmp/metrics`
to `data` in the local directory.
* The `rule_checker` tool has been replaced by `promtool` with
different flags and more functionality.
* Empty labels are now removed upon ingestion into the
storage. Matching empty labels is now equivalent to matching unset
labels (`mymetric{label=""}` now matches series that don't have
`label` set at all).
* The special `__meta_consul_tags` label in Consul service discovery
now starts and ends with tag separators to enable easier regex
matching.
* The default scrape interval has been changed back from 1 minute to
10 seconds.
All changes:
* [CHANGE] Change default storage directory to `data` in the current
working directory.
* [CHANGE] Consolidate external reachability flags (`-web.*`)into one.
* [CHANGE] Deprecate `keeping_extra` modifier keyword, rename it to
`keep_common`.
* [CHANGE] Improve label matching performance and treat unset labels
like empty labels in label matchers.
* [CHANGE] Remove `rule_checker` tool and add generic `promtool` CLI
tool which allows checking rules and configuration files.
* [CHANGE] Resolve rule files relative to config file.
* [CHANGE] Restore default ScrapeInterval of 1 minute instead of 10 seconds.
* [CHANGE] Surround `__meta_consul_tags` value with tag separators.
* [CHANGE] Update node disk console for new filesystem labels.
* [FEATURE] Add Consul's `ServiceAddress`, `Address`, and `ServicePort` as
meta labels to enable setting a custom scrape address if needed.
* [FEATURE] Add `hashmod` relabel action to allow for horizontal
sharding of Prometheus servers.
* [FEATURE] Add `honor_labels` scrape configuration option to not
overwrite any labels exposed by the target.
* [FEATURE] Add basic federation support on `/federate`.
* [FEATURE] Add optional `RUNBOOK` field to alert statements.
* [FEATURE] Add pre-relabel target labels to status page.
* [FEATURE] Add version information endpoint under `/version`.
* [FEATURE] Added initial stable API version 1 under `/api/v1`,
including ability to delete series and query more metadata.
* [FEATURE] Allow configuring query parameters when scraping metrics endpoints.
* [FEATURE] Allow deleting time series via the new v1 API.
* [FEATURE] Allow individual ingested metrics to be relabeled.
* [FEATURE] Allow loading rule files from an entire directory.
* [FEATURE] Allow scalar expressions in range queries, improve error messages.
* [FEATURE] Support Zookeeper Serversets as a service discovery mechanism.
* [ENHANCEMENT] Add circleci yaml for Dockerfile test build.
* [ENHANCEMENT] Always show selected graph range, regardless of available data.
* [ENHANCEMENT] Change expression input field to multi-line textarea.
* [ENHANCEMENT] Enforce strict monotonicity of time stamps within a series.
* [ENHANCEMENT] Export build information as metric.
* [ENHANCEMENT] Improve UI of `/alerts` page.
* [ENHANCEMENT] Improve display of target labels on status page.
* [ENHANCEMENT] Improve initialization and routing functionality of web service.
* [ENHANCEMENT] Improve target URL handling and display.
* [ENHANCEMENT] New dockerfile using alpine-glibc base image and make.
* [ENHANCEMENT] Other minor fixes.
* [ENHANCEMENT] Preserve alert state across reloads.
* [ENHANCEMENT] Prettify flag help output even more.
* [ENHANCEMENT] README.md updates.
* [ENHANCEMENT] Raise error on unknown config parameters.
* [ENHANCEMENT] Refine v1 HTTP API output.
* [ENHANCEMENT] Show original configuration file contents on status
page instead of serialized YAML.
* [ENHANCEMENT] Start HUP signal handler earlier to not exit upon HUP
during startup.
* [ENHANCEMENT] Updated vendored dependencies.
* [BUGFIX] Do not panic in `StringToDuration()` on wrong duration unit.
* [BUGFIX] Exit on invalid rule files on startup.
* [BUGFIX] Fix a regression in the `.Path` console template variable.
* [BUGFIX] Fix chunk descriptor loading.
* [BUGFIX] Fix consoles "Prometheus" link to point to /
* [BUGFIX] Fix empty configuration file cases
* [BUGFIX] Fix float to int conversions in chunk encoding, which were
broken for some architectures.
* [BUGFIX] Fix overflow detection for serverset config.
* [BUGFIX] Fix race conditions in retrieval layer.
* [BUGFIX] Fix shutdown deadlock in Consul SD code.
* [BUGFIX] Fix the race condition targets in the Makefile.
* [BUGFIX] Fix value display error in web console.
* [BUGFIX] Hide authentication credentials in config `String()` output.
* [BUGFIX] Increment dirty counter metric in storage only if
`setDirty(true)` is called.
* [BUGFIX] Periodically refresh services in Consul to recover from
missing events.
* [BUGFIX] Prevent overwrite of default global config when loading a
configuration.
* [BUGFIX] Properly lex `\r` as whitespace in expression language.
* [BUGFIX] Validate label names in JSON target groups.
* [BUGFIX] Validate presence of regex field in relabeling configurations.
* [CLEANUP] Clean up initialization of remote storage queues.
* [CLEANUP] Fix `go vet` and `golint` violations.
* [CLEANUP] General cleanup of rules and query language code.
* [CLEANUP] Improve and simplify Dockerfile build steps.
* [CLEANUP] Improve and simplify build infrastructure, use go-bindata
for web assets. Allow building without git.
* [CLEANUP] Move all utility packages into common `util` subdirectory.
* [CLEANUP] Refactor main, flag handling, and web package.
* [CLEANUP] Remove unused methods from `Rule` interface.
* [CLEANUP] Simplify default config handling.
* [CLEANUP] Switch human-readable times on web UI to UTC.
* [CLEANUP] Use `templates.TemplateExpander` for all page templates.
* [CLEANUP] Use new v1 HTTP API for querying and graphing.
## 0.14.0 / 2015-06-01
* [CHANGE] Configuration format changed and switched to YAML.
(See the provided [migration tool](https://github.com/prometheus/migrate/releases).)
* [ENHANCEMENT] Redesign of state-preserving target discovery.
* [ENHANCEMENT] Allow specifying scrape URL scheme and basic HTTP auth for non-static targets.
* [FEATURE] Allow attaching meaningful labels to targets via relabeling.
* [FEATURE] Configuration/rule reloading at runtime.
* [FEATURE] Target discovery via file watches.
* [FEATURE] Target discovery via Consul.
* [ENHANCEMENT] Simplified binary operation evaluation.
* [ENHANCEMENT] More stable component initialization.
* [ENHANCEMENT] Added internal expression testing language.
* [BUGFIX] Fix graph links with path prefix.
* [ENHANCEMENT] Allow building from source without git.
* [ENHANCEMENT] Improve storage iterator performance.
* [ENHANCEMENT] Change logging output format and flags.
* [BUGFIX] Fix memory alignment bug for 32bit systems.
* [ENHANCEMENT] Improve web redirection behavior.
* [ENHANCEMENT] Allow overriding default hostname for Prometheus URLs.
* [BUGFIX] Fix double slash in URL sent to alertmanager.
* [FEATURE] Add resets() query function to count counter resets.
* [FEATURE] Add changes() query function to count the number of times a gauge changed.
* [FEATURE] Add increase() query function to calculate a counter's increase.
* [ENHANCEMENT] Limit retrievable samples to the storage's retention window.
## 0.13.4 / 2015-05-23
* [BUGFIX] Fix a race while checkpointing fingerprint mappings.
## 0.13.3 / 2015-05-11
* [BUGFIX] Handle fingerprint collisions properly.
* [CHANGE] Comments in rules file must start with `#`. (The undocumented `//`
and `/*...*/` comment styles are no longer supported.)
* [ENHANCEMENT] Switch to custom expression language parser and evaluation
engine, which generates better error messages, fixes some parsing edge-cases,
and enables other future enhancements (like the ones below).
* [ENHANCEMENT] Limit maximum number of concurrent queries.
* [ENHANCEMENT] Terminate running queries during shutdown.
## 0.13.2 / 2015-05-05
* [MAINTENANCE] Updated vendored dependencies to their newest versions.
* [MAINTENANCE] Include rule_checker and console templates in release tarball.
* [BUGFIX] Sort NaN as the lowest value.
* [ENHANCEMENT] Add square root, stddev and stdvar functions.
* [BUGFIX] Use scrape_timeout for scrape timeout, not scrape_interval.
* [ENHANCEMENT] Improve chunk and chunkDesc loading, increase performance when
reading from disk.
* [BUGFIX] Show correct error on wrong DNS response.
## 0.13.1 / 2015-04-09
* [BUGFIX] Treat memory series with zero chunks correctly in series maintenance.
* [ENHANCEMENT] Improve readability of usage text even more.
## 0.13.0 / 2015-04-08
* [ENHANCEMENT] Double-delta encoding for chunks, saving typically 40% of
space, both in RAM and on disk.
* [ENHANCEMENT] Redesign of chunk persistence queuing, increasing performance
on spinning disks significantly.
* [ENHANCEMENT] Redesign of sample ingestion, increasing ingestion performance.
* [FEATURE] Added ln, log2, log10 and exp functions to the query language.
* [FEATURE] Experimental write support to InfluxDB.
* [FEATURE] Allow custom timestamps in instant query API.
* [FEATURE] Configurable path prefix for URLs to support proxies.
* [ENHANCEMENT] Increase of rule_checker CLI usability.
* [CHANGE] Show special float values as gaps.
* [ENHANCEMENT] Made usage output more readable.
* [ENHANCEMENT] Increased resilience of the storage against data corruption.
* [ENHANCEMENT] Various improvements around chunk encoding.
* [ENHANCEMENT] Nicer formatting of target health table on /status.
* [CHANGE] Rename UNREACHABLE to UNHEALTHY, ALIVE to HEALTHY.
* [BUGFIX] Strip trailing slash in alertmanager URL.
* [BUGFIX] Avoid +InfYs and similar, just display +Inf.
* [BUGFIX] Fixed HTML-escaping at various places.
* [BUGFIX] Fixed special value handling in division and modulo of the query
language.
* [BUGFIX] Fix embed-static.sh.
* [CLEANUP] Added initial HTTP API tests.
* [CLEANUP] Misc. other code cleanups.
* [MAINTENANCE] Updated vendored dependencies to their newest versions.
## 0.12.0 / 2015-03-04
* [CHANGE] Use client_golang v0.3.1. THIS CHANGES FINGERPRINTING AND INVALIDATES
ALL PERSISTED FINGERPRINTS. You have to wipe your storage to use this or
later versions. There is a version guard in place that will prevent you to
run Prometheus with the stored data of an older Prometheus.
* [BUGFIX] The change above fixes a weakness in the fingerprinting algorithm.
* [ENHANCEMENT] The change above makes fingerprinting faster and less allocation
intensive.
* [FEATURE] OR operator and vector matching options. See docs for details.
* [ENHANCEMENT] Scientific notation and special float values (Inf, NaN) now
supported by the expression language.
* [CHANGE] Dockerfile makes Prometheus use the Docker volume to store data
(rather than /tmp/metrics).
* [CHANGE] Makefile uses Go 1.4.2.
## 0.11.1 / 2015-02-27
* [BUGFIX] Make series maintenance complete again. (Ever since 0.9.0rc4,
or commit 0851945, series would not be archived, chunk descriptors would
not be evicted, and stale head chunks would never be closed. This happened
due to accidental deletion of a line calling a (well tested :) function.
* [BUGFIX] Do not double count head chunks read from checkpoint on startup.
Also fix a related but less severe bug in counting chunk descriptors.
* [BUGFIX] Check last time in head chunk for head chunk timeout, not first.
* [CHANGE] Update vendoring due to vendoring changes in client_golang.
* [CLEANUP] Code cleanups.
* [ENHANCEMENT] Limit the number of 'dirty' series counted during checkpointing.
## 0.11.0 / 2015-02-23
* [FEATURE] Introduce new metric type Histogram with server-side aggregation.
* [FEATURE] Add offset operator.
* [FEATURE] Add floor, ceil and round functions.
* [CHANGE] Change instance identifiers to be host:port.
* [CHANGE] Dependency management and vendoring changed/improved.
* [CHANGE] Flag name changes to create consistency between various Prometheus
binaries.
* [CHANGE] Show unlimited number of metrics in autocomplete.
* [CHANGE] Add query timeout.
* [CHANGE] Remove labels on persist error counter.
* [ENHANCEMENT] Various performance improvements for sample ingestion.
* [ENHANCEMENT] Various Makefile improvements.
* [ENHANCEMENT] Various console template improvements, including
proof-of-concept for federation via console templates.
* [ENHANCEMENT] Fix graph JS glitches and simplify graphing code.
* [ENHANCEMENT] Dramatically decrease resources for file embedding.
* [ENHANCEMENT] Crash recovery saves lost series data in 'orphaned' directory.
* [BUGFIX] Fix aggregation grouping key calculation.
* [BUGFIX] Fix Go download path for various architectures.
* [BUGFIX] Fixed the link of the Travis build status image.
* [BUGFIX] Fix Rickshaw/D3 version mismatch.
* [CLEANUP] Various code cleanups.
## 0.10.0 / 2015-01-26
* [CHANGE] More efficient JSON result format in query API. This requires
up-to-date versions of PromDash and prometheus_cli, too.
* [ENHANCEMENT] Excluded non-minified Bootstrap assets and the Bootstrap maps
from embedding into the binary. Those files are only used for debugging,
and then you can use -web.use-local-assets. By including fewer files, the
RAM usage during compilation is much more manageable.
* [ENHANCEMENT] Help link points to http://prometheus.github.io now.
* [FEATURE] Consoles for haproxy and cloudwatch.
* [BUGFIX] Several fixes to graphs in consoles.
* [CLEANUP] Removed a file size check that did not check anything.
## 0.9.0 / 2015-01-23
* [CHANGE] Reworked command line flags, now more consistent and taking into
account needs of the new storage backend (see below).
* [CHANGE] Metric names are dropped after certain transformations.
* [CHANGE] Changed partitioning of summary metrics exported by Prometheus.
* [CHANGE] Got rid of Gerrit as a review tool.
* [CHANGE] 'Tabular' view now the default (rather than 'Graph') to avoid
running very expensive queries accidentally.
* [CHANGE] On-disk format for stored samples changed. For upgrading, you have
to nuke your old files completely. See "Complete rewrite of the storage
* [CHANGE] Removed 2nd argument from `delta`.
* [FEATURE] Added a `deriv` function.
* [FEATURE] Console templates.
* [FEATURE] Added `absent` function.
* [FEATURE] Allow omitting the metric name in queries.
* [BUGFIX] Removed all known race conditions.
* [BUGFIX] Metric mutations now handled correctly in all cases.
* [ENHANCEMENT] Proper double-start protection.
* [ENHANCEMENT] Complete rewrite of the storage layer. Benefits include:
* Better query performance.
* More samples in less RAM.
* Better memory management.
* Scales up to millions of time series and thousands of samples ingested
per second.
* Purging of obsolete samples much cleaner now, up to completely
"forgetting" obsolete time series.
* Proper instrumentation to diagnose the storage layer with... well...
Prometheus.
* Pure Go implementation, no need for cgo and shared C libraries anymore.
* Better concurrency.
* [ENHANCEMENT] Copy-on-write semantics in the AST layer.
* [ENHANCEMENT] Switched from Go 1.3 to Go 1.4.
* [ENHANCEMENT] Vendored external dependencies with godeps.
* [ENHANCEMENT] Numerous Web UI improvements, moved to Bootstrap3 and
Rickshaw 1.5.1.
* [ENHANCEMENT] Improved Docker integration.
* [ENHANCEMENT] Simplified the Makefile contraption.
* [CLEANUP] Put meta-data files into proper shape (LICENSE, README.md etc.)
* [CLEANUP] Removed all legitimate 'go vet' and 'golint' warnings.
* [CLEANUP] Removed dead code.
## 0.8.0 / 2014-09-04
* [ENHANCEMENT] Stagger scrapes to spread out load.
* [BUGFIX] Correctly quote HTTP Accept header.
## 0.7.0 / 2014-08-06
* [FEATURE] Added new functions: abs(), topk(), bottomk(), drop_common_labels().
* [FEATURE] Let console templates get graph links from expressions.
* [FEATURE] Allow console templates to dynamically include other templates.
* [FEATURE] Template consoles now have access to their URL.
* [BUGFIX] Fixed time() function to return evaluation time, not wallclock time.
* [BUGFIX] Fixed HTTP connection leak when targets returned a non-200 status.
* [BUGFIX] Fixed link to console templates in UI.
* [PERFORMANCE] Removed extra memory copies while scraping targets.
* [ENHANCEMENT] Switched from Go 1.2.1 to Go 1.3.
* [ENHANCEMENT] Made metrics exported by Prometheus itself more consistent.
* [ENHANCEMENT] Removed incremental backoffs for unhealthy targets.
* [ENHANCEMENT] Dockerfile also builds Prometheus support tools now.
## 0.6.0 / 2014-06-30
* [FEATURE] Added console and alert templates support, along with various template functions.
* [PERFORMANCE] Much faster and more memory-efficient flushing to disk.
* [ENHANCEMENT] Query results are now only logged when debugging.
* [ENHANCEMENT] Upgraded to new Prometheus client library for exposing metrics.
* [BUGFIX] Samples are now kept in memory until fully flushed to disk.
* [BUGFIX] Non-200 target scrapes are now treated as an error.
* [BUGFIX] Added installation step for missing dependency to Dockerfile.
* [BUGFIX] Removed broken and unused "User Dashboard" link.
## 0.5.0 / 2014-05-28
* [BUGFIX] Fixed next retrieval time display on status page.
* [BUGFIX] Updated some variable references in tools subdir.
* [FEATURE] Added support for scraping metrics via the new text format.
* [PERFORMANCE] Improved label matcher performance.
* [PERFORMANCE] Removed JSON indentation in query API, leading to smaller response sizes.
* [ENHANCEMENT] Added internal check to verify temporal order of streams.
* [ENHANCEMENT] Some internal refactorings.
## 0.4.0 / 2014-04-17
* [FEATURE] Vectors and scalars may now be reversed in binary operations (`<scalar> <binop> <vector>`).
* [FEATURE] It's possible to shutdown Prometheus via a `/-/quit` web endpoint now.
* [BUGFIX] Fix for a deadlock race condition in the memory storage.
* [BUGFIX] Mac OS X build fixed.
* [BUGFIX] Built from Go 1.2.1, which has internal fixes to race conditions in garbage collection handling.
* [ENHANCEMENT] Internal storage interface refactoring that allows building e.g. the `rule_checker` tool without LevelDB dynamic library dependencies.
* [ENHANCEMENT] Cleanups around shutdown handling.
* [PERFORMANCE] Preparations for better memory reuse during marshalling / unmarshalling.
|
{
"content_hash": "3c770156adc4dce142cef9186300106c",
"timestamp": "",
"source": "github",
"line_count": 1120,
"max_line_length": 159,
"avg_line_length": 51.37678571428572,
"alnum_prop": 0.7679607938549233,
"repo_name": "amorken/prometheus",
"id": "11699d053c9b6d279da352b18c262547fcb0c184",
"size": "57544",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CHANGELOG.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7407"
},
{
"name": "Go",
"bytes": "1183030"
},
{
"name": "HTML",
"bytes": "45088"
},
{
"name": "JavaScript",
"bytes": "58103"
},
{
"name": "Lex",
"bytes": "3008"
},
{
"name": "Makefile",
"bytes": "1454"
},
{
"name": "Shell",
"bytes": "1407"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "a8598232243029d2d357ac2e20b2a1d1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "cf8255c7e030226be3bce80e4ba35da25dbe3c0a",
"size": "173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Magnoliales/Annonaceae/Tridimeris/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
<?php
namespace Magento\Payment\Gateway\Config;
interface ValueHandlerInterface
{
/**
* Retrieve method configured value
*
* @param array $subject
* @param int|null $storeId
*
* @return mixed
*/
public function handle(array $subject, $storeId = null);
}
|
{
"content_hash": "7b44dd579f637660238ebd5dd0d27a2b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 18.6875,
"alnum_prop": 0.6287625418060201,
"repo_name": "tarikgwa/test",
"id": "70e13466bfe30df92d45d4a8c8239819f497b0ea",
"size": "397",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "html/app/code/Magento/Payment/Gateway/Config/ValueHandlerInterface.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "26588"
},
{
"name": "CSS",
"bytes": "4874492"
},
{
"name": "HTML",
"bytes": "8635167"
},
{
"name": "JavaScript",
"bytes": "6810903"
},
{
"name": "PHP",
"bytes": "55645559"
},
{
"name": "Perl",
"bytes": "7938"
},
{
"name": "Shell",
"bytes": "4505"
},
{
"name": "XSLT",
"bytes": "19889"
}
],
"symlink_target": ""
}
|
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View
} from 'react-native';
export default class COMPONENT_NAME extends Component {
render() {
return (
<View style={styles.parent}>
<Text style={styles.title__text}>
New Component
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
parent: {
alignItems: 'center',
justifyContent: 'center',
flex: 1,
},
title__text: {
color: "black",
fontSize: 20
}
});
|
{
"content_hash": "749b9d6ee149e8a3ff09d85da9507079",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 55,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.5363636363636364,
"repo_name": "Jonham/ReactNative-EnjoySuffering",
"id": "fd34bf8a499480ed52d9e0a81e5c1bd155c6c014",
"size": "624",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "RNComponents/template.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3356"
}
],
"symlink_target": ""
}
|
<?php
namespace yii\base;
class Object {}
class ClassNeedsNoProperties extends Object { // <-- all false-positives
static public function setAuthor() {} // <- static
public function setPrice() {} // <- missing argument
public function getBook($default) {} // <- extra argument
static public function getQuantity() {} // <- static
}
/**
*
* @property-write mixed $author
* @property-read void $book
*/
class ClassNeedsProperties1
extends Object
{
public function setAuthor($author) {}
public function getBook() {}
}
/**
*
* @property-write mixed $author2
* @property-write mixed $author1
*/
class ClassNeedsProperties2
extends Object
{
public function setAuthor1($author) {}
static public function getAuthor1() {} // <-- static
public function setAuthor2($author) {}
public function getAuthor2($default) {} // <- extra arguments
}
/**
*
* @property-read void $author2
* @property-read void $author1
*/
class ClassNeedsProperties3
extends Object
{
public function getAuthor1() {}
static public function setAuthor1($author) {} // <-- static
public function getAuthor2() {}
public function setAuthor2() {} // <- no arguments
}
|
{
"content_hash": "c951da6d43c405c06898f860ae94fb01",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 72,
"avg_line_length": 24.75925925925926,
"alnum_prop": 0.605833956619297,
"repo_name": "kalessil/yii2inspections",
"id": "e9addaea5ff9e02b34d774af3dc619a6bad0349a",
"size": "1337",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "testData/fixtures/property-tags-partial.fixed.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1763"
},
{
"name": "Java",
"bytes": "76863"
},
{
"name": "PHP",
"bytes": "5795"
}
],
"symlink_target": ""
}
|
package org.apache.sshd.util.test;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
/**
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
*/
public class EchoShell extends CommandExecutionHelper {
public EchoShell() {
super();
}
@Override
protected boolean handleCommandLine(String command) throws Exception {
OutputStream out = getOutputStream();
out.write((command + "\n").getBytes(StandardCharsets.UTF_8));
out.flush();
return !"exit".equals(command);
}
}
|
{
"content_hash": "b06fb0cec7aa8109c232960ab0d2dcdf",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 23.916666666666668,
"alnum_prop": 0.6724738675958188,
"repo_name": "lgoldstein/mina-sshd",
"id": "9ad8a14afd6b590fac42649355a96ef58c83a26f",
"size": "1375",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sshd-core/src/test/java/org/apache/sshd/util/test/EchoShell.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "15035"
},
{
"name": "HTML",
"bytes": "5769"
},
{
"name": "Java",
"bytes": "6840795"
},
{
"name": "Python",
"bytes": "11690"
},
{
"name": "Shell",
"bytes": "34849"
}
],
"symlink_target": ""
}
|
namespace content {
class CONTENT_EXPORT TestSynchronousCompositor : public SynchronousCompositor {
public:
explicit TestSynchronousCompositor(const viz::FrameSinkId& frame_sink_id);
~TestSynchronousCompositor() override;
void SetClient(SynchronousCompositorClient* client);
scoped_refptr<FrameFuture> DemandDrawHwAsync(
const gfx::Size& viewport_size,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority) override;
void ReturnResources(
uint32_t layer_tree_frame_sink_id,
const std::vector<viz::ReturnedResource>& resources) override;
void DidPresentCompositorFrames(viz::FrameTimingDetailsMap timing_details,
uint32_t frame_token) override {}
bool DemandDrawSw(SkCanvas* canvas) override;
void SetMemoryPolicy(size_t bytes_limit) override {}
void DidBecomeActive() override {}
void DidChangeRootLayerScrollOffset(
const gfx::ScrollOffset& root_offset) override {}
void SynchronouslyZoomBy(float zoom_delta,
const gfx::Point& anchor) override {}
void OnComputeScroll(base::TimeTicks animate_time) override {}
void SetBeginFrameSource(viz::BeginFrameSource* source) override {}
void DidInvalidate() override {}
void SetHardwareFrame(uint32_t layer_tree_frame_sink_id,
std::unique_ptr<viz::CompositorFrame> frame);
struct ReturnedResources {
ReturnedResources();
ReturnedResources(const ReturnedResources& other);
~ReturnedResources();
uint32_t layer_tree_frame_sink_id;
std::vector<viz::ReturnedResource> resources;
};
using FrameAckArray = std::vector<ReturnedResources>;
void SwapReturnedResources(FrameAckArray* array);
private:
SynchronousCompositorClient* client_;
viz::FrameSinkId frame_sink_id_;
std::unique_ptr<Frame> hardware_frame_;
FrameAckArray frame_ack_array_;
DISALLOW_COPY_AND_ASSIGN(TestSynchronousCompositor);
};
} // namespace content
#endif // CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_
|
{
"content_hash": "431971d003fb1b8640daecffc58f7d61",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 37.70909090909091,
"alnum_prop": 0.7333654773384763,
"repo_name": "endlessm/chromium-browser",
"id": "d660ce36f8f6eff58e90c1a6d8b5062ff94d1480",
"size": "2658",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/public/test/test_synchronous_compositor_android.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
const webpack = require('webpack');
const merge = require('webpack-merge');
const path = require('path');
const tslint = require('./tslint');
const PrettierPlugin = require('prettier-webpack-plugin');
const prettierRules = require('./prettier.rules.json');
const baseWebpackConfig = require('./webpack.base');
module.exports = merge(baseWebpackConfig, {
module: {
rules: [
{
test: /\.ts$/,
enforce: 'pre',
loader: 'tslint-loader',
options: tslint
},
]
},
devtool: 'eval-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
historyApiFallback: true,
inline: true,
port: 9000,
stats: 'minimal'
},
plugins: [
new PrettierPlugin(prettierRules),
new webpack.DefinePlugin({
__IN_DEBUG__: JSON.stringify(true)
}),
],
});
|
{
"content_hash": "c9bb86e2479be173a9501ca299c2aa2d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 58,
"avg_line_length": 23.16216216216216,
"alnum_prop": 0.6149358226371062,
"repo_name": "jasonraimondi/command-query",
"id": "28d3e7c757d640e5685051b0070a35e9fb62c608",
"size": "857",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "angular-spa/webpack.dev.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "553"
},
{
"name": "CSS",
"bytes": "38254"
},
{
"name": "HTML",
"bytes": "4742"
},
{
"name": "JavaScript",
"bytes": "9252"
},
{
"name": "Makefile",
"bytes": "1385"
},
{
"name": "Nginx",
"bytes": "707"
},
{
"name": "PHP",
"bytes": "167291"
},
{
"name": "TypeScript",
"bytes": "4624"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 11 02:01:57 EET 2011 -->
<TITLE>
ai.ku.nlp
</TITLE>
<META NAME="date" CONTENT="2011-12-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../ai/ku/nlp/package-summary.html" target="classFrame">ai.ku.nlp</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="POSTagger.html" title="class in ai.ku.nlp" target="classFrame">POSTagger</A>
<BR>
<A HREF="WordNetFinder.html" title="class in ai.ku.nlp" target="classFrame">WordNetFinder</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|
{
"content_hash": "245c8b395ac813408853e11d947adde3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 105,
"avg_line_length": 26.970588235294116,
"alnum_prop": 0.6597600872410033,
"repo_name": "ai-ku/langvis",
"id": "8ce70db5f00611bc88c6576864a1a36d3b4fcafe",
"size": "917",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/ai/ku/nlp/package-frame.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1391"
},
{
"name": "Haskell",
"bytes": "1005"
},
{
"name": "Java",
"bytes": "7426611"
},
{
"name": "Perl",
"bytes": "10563"
},
{
"name": "Python",
"bytes": "1744764"
},
{
"name": "Ruby",
"bytes": "691"
},
{
"name": "Shell",
"bytes": "701"
}
],
"symlink_target": ""
}
|
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="BbKpiEmpl">
<resultMap type="com.netsteadfast.greenstep.po.hbm.BbKpiEmpl" id="baseResultMap">
<id column="OID" property="oid"/>
<result column="KPI_ID" property="kpiId"/>
<result column="EMP_ID" property="empId"/>
<result column="CUSERID" property="cuserid"/>
<result column="CDATE" property="cdate"/>
<result column="UUSERID" property="uuserid"/>
<result column="UDATE" property="udate"/>
</resultMap>
<select id="selectByParams" resultMap="baseResultMap" >
select * from bb_kpi_empl where 1=1
<if test="oid != null">
AND OID = #{oid}
</if>
<if test="kpiId != null">
AND KPI_ID = #{kpiId}
</if>
<if test="empId != null">
AND EMP_ID = #{empId}
</if>
</select>
<select id="selectByValue" resultMap="baseResultMap" >
select * from bb_kpi_empl where 1=1
<if test="oid != null">
AND OID = #{oid}
</if>
<if test="kpiId != null">
AND KPI_ID = #{kpiId}
</if>
<if test="empId != null">
AND EMP_ID = #{empId}
</if>
</select>
</mapper>
|
{
"content_hash": "e06ba0946cfc30dad3007ca072a3303a",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 82,
"avg_line_length": 27.162790697674417,
"alnum_prop": 0.6078767123287672,
"repo_name": "quangnguyen9x/bamboobsc_quangnv",
"id": "1bd46791b943787120bed8dd8b07e654d4f38fe7",
"size": "1168",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gsbsc-persistence/resource/mappers/BbKpiEmpl.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "232"
},
{
"name": "FreeMarker",
"bytes": "186074"
},
{
"name": "Groovy",
"bytes": "35207"
},
{
"name": "Java",
"bytes": "22394663"
},
{
"name": "Shell",
"bytes": "498"
}
],
"symlink_target": ""
}
|
module BradViews::Forms
class Snippets < BradViews::Tools::Snippets
def control_group label_html, state = nil, &block
html_class = 'control-group'
html_class += " #{state}" if state.present?
div_tag :class => html_class do
concat label_html
div_tag!(:class => 'controls', &block)
end
end
def help_block content
content_tag :p, content, :class => 'help-block'
end
def help_inline content
content_tag :span, content, :class => 'help-inline'
end
def input_prepend content, &block
div_tag :class => 'input-prepend' do
span_tag! content, :class => 'add-on'
block.call
end
end
def input_append content, &block
div_tag :class => 'input-append' do
block.call
span_tag! content, :class => 'add-on'
end
end
end
end
|
{
"content_hash": "496df1fa0163e35e9e287f7e9933c944",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 57,
"avg_line_length": 23.97222222222222,
"alnum_prop": 0.5874855156431055,
"repo_name": "cice/brad",
"id": "dac363159904efaf5dae1bb68994f8f954caca4b",
"size": "863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/brad_views/forms/snippets.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6889"
},
{
"name": "Ruby",
"bytes": "60647"
},
{
"name": "Vim script",
"bytes": "26402"
}
],
"symlink_target": ""
}
|
using namespace ContainerBenchmarks;
constexpr std::size_t TestNumInputs = 1024;
template <class _Size>
inline TEST_ALWAYS_INLINE
_Size loadword(const void* __p) {
_Size __r;
std::memcpy(&__r, __p, sizeof(__r));
return __r;
}
inline TEST_ALWAYS_INLINE
std::size_t rotate_by_at_least_1(std::size_t __val, int __shift) {
return (__val >> __shift) | (__val << (64 - __shift));
}
inline TEST_ALWAYS_INLINE
std::size_t hash_len_16(std::size_t __u, std::size_t __v) {
const std::size_t __mul = 0x9ddfea08eb382d69ULL;
std::size_t __a = (__u ^ __v) * __mul;
__a ^= (__a >> 47);
std::size_t __b = (__v ^ __a) * __mul;
__b ^= (__b >> 47);
__b *= __mul;
return __b;
}
template <std::size_t _Len>
inline TEST_ALWAYS_INLINE
std::size_t hash_len_0_to_8(const char* __s) {
static_assert(_Len == 4 || _Len == 8, "");
const uint64_t __a = loadword<uint32_t>(__s);
const uint64_t __b = loadword<uint32_t>(__s + _Len - 4);
return hash_len_16(_Len + (__a << 3), __b);
}
struct UInt32Hash {
UInt32Hash() = default;
inline TEST_ALWAYS_INLINE
std::size_t operator()(uint32_t data) const {
return hash_len_0_to_8<4>(reinterpret_cast<const char*>(&data));
}
};
struct UInt64Hash {
UInt64Hash() = default;
inline TEST_ALWAYS_INLINE
std::size_t operator()(uint64_t data) const {
return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
}
};
struct UInt128Hash {
UInt128Hash() = default;
inline TEST_ALWAYS_INLINE
std::size_t operator()(__uint128_t data) const {
const __uint128_t __mask = static_cast<std::size_t>(-1);
const std::size_t __a = (std::size_t)(data & __mask);
const std::size_t __b = (std::size_t)((data & (__mask << 64)) >> 64);
return hash_len_16(__a, rotate_by_at_least_1(__b + 16, 16)) ^ __b;
}
};
struct UInt32Hash2 {
UInt32Hash2() = default;
inline TEST_ALWAYS_INLINE
std::size_t operator()(uint32_t data) const {
const uint32_t __m = 0x5bd1e995;
const uint32_t __r = 24;
uint32_t __h = 4;
uint32_t __k = data;
__k *= __m;
__k ^= __k >> __r;
__k *= __m;
__h *= __m;
__h ^= __k;
__h ^= __h >> 13;
__h *= __m;
__h ^= __h >> 15;
return __h;
}
};
struct UInt64Hash2 {
UInt64Hash2() = default;
inline TEST_ALWAYS_INLINE
std::size_t operator()(uint64_t data) const {
return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
}
};
//----------------------------------------------------------------------------//
// BM_Hash
// ---------------------------------------------------------------------------//
template <class HashFn, class GenInputs>
void BM_Hash(benchmark::State& st, HashFn fn, GenInputs gen) {
auto in = gen(st.range(0));
const auto end = in.data() + in.size();
std::size_t last_hash = 0;
benchmark::DoNotOptimize(&last_hash);
while (st.KeepRunning()) {
for (auto it = in.data(); it != end; ++it) {
benchmark::DoNotOptimize(last_hash += fn(*it));
}
benchmark::ClobberMemory();
}
}
BENCHMARK_CAPTURE(BM_Hash,
uint32_random_std_hash,
std::hash<uint32_t>{},
getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_Hash,
uint32_random_custom_hash,
UInt32Hash{},
getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_Hash,
uint32_top_std_hash,
std::hash<uint32_t>{},
getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_Hash,
uint32_top_custom_hash,
UInt32Hash{},
getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
//----------------------------------------------------------------------------//
// BM_InsertValue
// ---------------------------------------------------------------------------//
// Sorted Assending //
BENCHMARK_CAPTURE(BM_InsertValue,
unordered_set_uint32,
std::unordered_set<uint32_t>{},
getRandomIntegerInputs<uint32_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_InsertValue,
unordered_set_uint32_sorted,
std::unordered_set<uint32_t>{},
getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
// Top Bytes //
BENCHMARK_CAPTURE(BM_InsertValue,
unordered_set_top_bits_uint32,
std::unordered_set<uint32_t>{},
getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_InsertValueRehash,
unordered_set_top_bits_uint32,
std::unordered_set<uint32_t, UInt32Hash>{},
getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
// String //
BENCHMARK_CAPTURE(BM_InsertValue,
unordered_set_string,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_InsertValueRehash,
unordered_set_string,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
//----------------------------------------------------------------------------//
// BM_Find
// ---------------------------------------------------------------------------//
// Random //
BENCHMARK_CAPTURE(BM_Find,
unordered_set_random_uint64,
std::unordered_set<uint64_t>{},
getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_random_uint64,
std::unordered_set<uint64_t, UInt64Hash>{},
getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
// Sorted //
BENCHMARK_CAPTURE(BM_Find,
unordered_set_sorted_uint64,
std::unordered_set<uint64_t>{},
getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_sorted_uint64,
std::unordered_set<uint64_t, UInt64Hash>{},
getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
// Sorted //
#if 1
BENCHMARK_CAPTURE(BM_Find,
unordered_set_sorted_uint128,
std::unordered_set<__uint128_t, UInt128Hash>{},
getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_sorted_uint128,
std::unordered_set<__uint128_t, UInt128Hash>{},
getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
#endif
// Sorted //
BENCHMARK_CAPTURE(BM_Find,
unordered_set_sorted_uint32,
std::unordered_set<uint32_t>{},
getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_sorted_uint32,
std::unordered_set<uint32_t, UInt32Hash2>{},
getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
// Sorted Ascending //
BENCHMARK_CAPTURE(BM_Find,
unordered_set_sorted_large_uint64,
std::unordered_set<uint64_t>{},
getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_sorted_large_uint64,
std::unordered_set<uint64_t, UInt64Hash>{},
getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
// Top Bits //
BENCHMARK_CAPTURE(BM_Find,
unordered_set_top_bits_uint64,
std::unordered_set<uint64_t>{},
getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_top_bits_uint64,
std::unordered_set<uint64_t, UInt64Hash>{},
getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
// String //
BENCHMARK_CAPTURE(BM_Find,
unordered_set_string,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_FindRehash,
unordered_set_string,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
///////////////////////////////////////////////////////////////////////////////
BENCHMARK_CAPTURE(BM_InsertDuplicate,
unordered_set_int,
std::unordered_set<int>{},
getRandomIntegerInputs<int>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_InsertDuplicate,
unordered_set_string,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
unordered_set_int,
std::unordered_set<int>{},
getRandomIntegerInputs<int>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
unordered_set_string,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_InsertDuplicate,
unordered_set_int_insert_arg,
std::unordered_set<int>{},
getRandomIntegerInputs<int>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_InsertDuplicate,
unordered_set_string_insert_arg,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
unordered_set_int_insert_arg,
std::unordered_set<int>{},
getRandomIntegerInputs<unsigned>)->Arg(TestNumInputs);
BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
unordered_set_string_arg,
std::unordered_set<std::string>{},
getRandomCStringInputs)->Arg(TestNumInputs);
BENCHMARK_MAIN();
|
{
"content_hash": "375f28c5bb1921ede64adb351d6aff2b",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 80,
"avg_line_length": 30.452380952380953,
"alnum_prop": 0.6182285267508097,
"repo_name": "llvm-mirror/libcxx",
"id": "3824386e7e2b009ab31072b470a4ad34a8fc877d",
"size": "9196",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "benchmarks/unordered_set_operations.bench.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2035"
},
{
"name": "C",
"bytes": "19789"
},
{
"name": "C++",
"bytes": "25847968"
},
{
"name": "CMake",
"bytes": "147482"
},
{
"name": "CSS",
"bytes": "1237"
},
{
"name": "HTML",
"bytes": "228687"
},
{
"name": "Objective-C++",
"bytes": "2263"
},
{
"name": "Python",
"bytes": "279305"
},
{
"name": "Shell",
"bytes": "21350"
}
],
"symlink_target": ""
}
|
module Fibonacci
# Calculate the first _count_ Fibonacci numbers, starting with 1,1.
#
# :call-seq:
# Fibonacci.sequence(count) -> array
# Fibonacci.sequence(count) {|val| ... } -> nil
#
# If a block is given, supply successive values to the block and
# return +nil+, otherwise return all values as an array.
def Fibonacci.sequence(count, &block)
result, block = setup_optional_block(block)
generate do |val|
break if count <= 0
count -= 1
block[val]
end
result
end
# Calculate the Fibonacci numbers up to and including _max_.
#
# :call-seq:
# Fibonacci.upto(max) -> array
# Fibonacci.upto(max) {|val| ... } -> nil
#
# If a block is given, supply successive values to the
# block and return +nil+, otherwise return all values as an array.
def Fibonacci.upto(max, &block)
result, block = setup_optional_block(block)
generate do |val|
break if val > max
block[val]
end
result
end
private
# Yield a sequence of Fibonacci numbers to a block.
def Fibonacci.generate
f1, f2 = 1, 1
loop do
yield f1
f1, f2 = f2, f1+f2
end
end
# If a block parameter is given, use it, otherwise accumulate into an
# array. Return the result value and the block to use.
def Fibonacci.setup_optional_block(block)
if block.nil?
[ result = [], lambda {|val| result << val } ]
else
[ nil, block ]
end
end
end
|
{
"content_hash": "cdd92bd5ac93caf5fbfb684a268637fe",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 71,
"avg_line_length": 25.810344827586206,
"alnum_prop": 0.612558450233801,
"repo_name": "sunpy1106/programmingruby",
"id": "34f0304e962354047ba391a0caa4b2804c77c3bc",
"size": "2120",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rdoc/fib_example.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "7970"
},
{
"name": "CSS",
"bytes": "17109"
},
{
"name": "HTML",
"bytes": "8361"
},
{
"name": "JavaScript",
"bytes": "12650"
},
{
"name": "Makefile",
"bytes": "11286"
},
{
"name": "Ruby",
"bytes": "172734"
}
],
"symlink_target": ""
}
|
package echo
import (
"bytes"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"reflect"
"strings"
"errors"
"github.com/danjac/podbaby/cmd/Godeps/_workspace/src/golang.org/x/net/websocket"
"github.com/stretchr/testify/assert"
)
type (
user struct {
ID string `json:"id" xml:"id"`
Name string `json:"name" xml:"name"`
}
)
func TestEcho(t *testing.T) {
e := New()
req, _ := http.NewRequest(GET, "/", nil)
rec := httptest.NewRecorder()
c := NewContext(req, NewResponse(rec, e), e)
// Router
assert.NotNil(t, e.Router())
// Debug
e.SetDebug(true)
assert.True(t, e.debug)
// DefaultHTTPErrorHandler
e.DefaultHTTPErrorHandler(errors.New("error"), c)
assert.Equal(t, http.StatusInternalServerError, rec.Code)
}
func TestEchoIndex(t *testing.T) {
e := New()
e.Index("_fixture/index.html")
c, b := request(GET, "/", e)
assert.Equal(t, http.StatusOK, c)
assert.NotEmpty(t, b)
}
func TestEchoFavicon(t *testing.T) {
e := New()
e.Favicon("_fixture/favicon.ico")
c, b := request(GET, "/favicon.ico", e)
assert.Equal(t, http.StatusOK, c)
assert.NotEmpty(t, b)
}
func TestEchoStatic(t *testing.T) {
e := New()
// OK
e.Static("/images", "_fixture/images")
c, b := request(GET, "/images/walle.png", e)
assert.Equal(t, http.StatusOK, c)
assert.NotEmpty(t, b)
// No file
e.Static("/images", "_fixture/scripts")
c, _ = request(GET, "/images/bolt.png", e)
assert.Equal(t, http.StatusNotFound, c)
// Directory
e.Static("/images", "_fixture/images")
c, _ = request(GET, "/images", e)
assert.Equal(t, http.StatusForbidden, c)
// Directory with index.html
e.Static("/", "_fixture")
c, r := request(GET, "/", e)
assert.Equal(t, http.StatusOK, c)
assert.Equal(t, true, strings.HasPrefix(r, "<!doctype html>"))
// Sub-directory with index.html
c, r = request(GET, "/folder", e)
assert.Equal(t, http.StatusOK, c)
assert.Equal(t, true, strings.HasPrefix(r, "<!doctype html>"))
// assert.Equal(t, "sub directory", r)
}
func TestEchoMiddleware(t *testing.T) {
e := New()
buf := new(bytes.Buffer)
// echo.MiddlewareFunc
e.Use(MiddlewareFunc(func(h HandlerFunc) HandlerFunc {
return func(c *Context) error {
buf.WriteString("a")
return h(c)
}
}))
// func(echo.HandlerFunc) echo.HandlerFunc
e.Use(func(h HandlerFunc) HandlerFunc {
return func(c *Context) error {
buf.WriteString("b")
return h(c)
}
})
// echo.HandlerFunc
e.Use(HandlerFunc(func(c *Context) error {
buf.WriteString("c")
return nil
}))
// func(*echo.Context) error
e.Use(func(c *Context) error {
buf.WriteString("d")
return nil
})
// func(http.Handler) http.Handler
e.Use(func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
buf.WriteString("e")
h.ServeHTTP(w, r)
})
})
// http.Handler
e.Use(http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
buf.WriteString("f")
})))
// http.HandlerFunc
e.Use(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
buf.WriteString("g")
}))
// func(http.ResponseWriter, *http.Request)
e.Use(func(w http.ResponseWriter, r *http.Request) {
buf.WriteString("h")
})
// Unknown
assert.Panics(t, func() {
e.Use(nil)
})
// Route
e.Get("/", func(c *Context) error {
return c.String(http.StatusOK, "Hello!")
})
c, b := request(GET, "/", e)
assert.Equal(t, "abcdefgh", buf.String())
assert.Equal(t, http.StatusOK, c)
assert.Equal(t, "Hello!", b)
// Error
e.Use(func(*Context) error {
return errors.New("error")
})
c, b = request(GET, "/", e)
assert.Equal(t, http.StatusInternalServerError, c)
}
func TestEchoHandler(t *testing.T) {
e := New()
// HandlerFunc
e.Get("/1", HandlerFunc(func(c *Context) error {
return c.String(http.StatusOK, "1")
}))
// func(*echo.Context) error
e.Get("/2", func(c *Context) error {
return c.String(http.StatusOK, "2")
})
// http.Handler/http.HandlerFunc
e.Get("/3", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("3"))
}))
// func(http.ResponseWriter, *http.Request)
e.Get("/4", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("4"))
})
for _, p := range []string{"1", "2", "3", "4"} {
c, b := request(GET, "/"+p, e)
assert.Equal(t, http.StatusOK, c)
assert.Equal(t, p, b)
}
// Unknown
assert.Panics(t, func() {
e.Get("/5", nil)
})
}
func TestEchoConnect(t *testing.T) {
e := New()
testMethod(t, CONNECT, "/", e)
}
func TestEchoDelete(t *testing.T) {
e := New()
testMethod(t, DELETE, "/", e)
}
func TestEchoGet(t *testing.T) {
e := New()
testMethod(t, GET, "/", e)
}
func TestEchoHead(t *testing.T) {
e := New()
testMethod(t, HEAD, "/", e)
}
func TestEchoOptions(t *testing.T) {
e := New()
testMethod(t, OPTIONS, "/", e)
}
func TestEchoPatch(t *testing.T) {
e := New()
testMethod(t, PATCH, "/", e)
}
func TestEchoPost(t *testing.T) {
e := New()
testMethod(t, POST, "/", e)
}
func TestEchoPut(t *testing.T) {
e := New()
testMethod(t, PUT, "/", e)
}
func TestEchoTrace(t *testing.T) {
e := New()
testMethod(t, TRACE, "/", e)
}
func TestEchoAny(t *testing.T) { // JFC
e := New()
e.Any("/", func(c *Context) error {
return c.String(http.StatusOK, "Any")
})
}
func TestEchoMatch(t *testing.T) { // JFC
e := New()
e.Match([]string{GET, POST}, "/", func(c *Context) error {
return c.String(http.StatusOK, "Match")
})
}
func TestEchoWebSocket(t *testing.T) {
e := New()
e.WebSocket("/ws", func(c *Context) error {
c.socket.Write([]byte("test"))
return nil
})
srv := httptest.NewServer(e)
defer srv.Close()
addr := srv.Listener.Addr().String()
origin := "http://localhost"
url := fmt.Sprintf("ws://%s/ws", addr)
ws, err := websocket.Dial(url, "", origin)
if assert.NoError(t, err) {
ws.Write([]byte("test\n"))
defer ws.Close()
buf := new(bytes.Buffer)
buf.ReadFrom(ws)
assert.Equal(t, "test", buf.String())
}
}
func TestEchoURL(t *testing.T) {
e := New()
static := func(*Context) error { return nil }
getUser := func(*Context) error { return nil }
getFile := func(*Context) error { return nil }
e.Get("/static/file", static)
e.Get("/users/:id", getUser)
g := e.Group("/group")
g.Get("/users/:uid/files/:fid", getFile)
assert.Equal(t, "/static/file", e.URL(static))
assert.Equal(t, "/users/:id", e.URL(getUser))
assert.Equal(t, "/users/1", e.URL(getUser, "1"))
assert.Equal(t, "/group/users/1/files/:fid", e.URL(getFile, "1"))
assert.Equal(t, "/group/users/1/files/1", e.URL(getFile, "1", "1"))
}
func TestEchoRoutes(t *testing.T) {
e := New()
h := func(*Context) error { return nil }
routes := []Route{
{GET, "/users/:user/events", h},
{GET, "/users/:user/events/public", h},
{POST, "/repos/:owner/:repo/git/refs", h},
{POST, "/repos/:owner/:repo/git/tags", h},
}
for _, r := range routes {
e.add(r.Method, r.Path, h)
}
for i, r := range e.Routes() {
assert.Equal(t, routes[i].Method, r.Method)
assert.Equal(t, routes[i].Path, r.Path)
}
}
func TestEchoGroup(t *testing.T) {
e := New()
buf := new(bytes.Buffer)
e.Use(func(*Context) error {
buf.WriteString("0")
return nil
})
h := func(*Context) error { return nil }
//--------
// Routes
//--------
e.Get("/users", h)
// Group
g1 := e.Group("/group1")
g1.Use(func(*Context) error {
buf.WriteString("1")
return nil
})
g1.Get("/", h)
// Group with no parent middleware
g2 := e.Group("/group2", func(*Context) error {
buf.WriteString("2")
return nil
})
g2.Get("/", h)
// Nested groups
g3 := e.Group("/group3")
g4 := g3.Group("/group4")
g4.Get("/", func(c *Context) error {
return c.NoContent(http.StatusOK)
})
request(GET, "/users", e)
// println(len(e.middleware))
assert.Equal(t, "0", buf.String())
buf.Reset()
request(GET, "/group1/", e)
// println(len(g1.echo.middleware))
assert.Equal(t, "01", buf.String())
buf.Reset()
request(GET, "/group2/", e)
assert.Equal(t, "2", buf.String())
buf.Reset()
c, _ := request(GET, "/group3/group4/", e)
assert.Equal(t, http.StatusOK, c)
}
func TestEchoNotFound(t *testing.T) {
e := New()
r, _ := http.NewRequest(GET, "/files", nil)
w := httptest.NewRecorder()
e.ServeHTTP(w, r)
assert.Equal(t, http.StatusNotFound, w.Code)
}
func TestEchoMethodNotAllowed(t *testing.T) {
e := New()
e.Get("/", func(c *Context) error {
return c.String(http.StatusOK, "Echo!")
})
r, _ := http.NewRequest(POST, "/", nil)
w := httptest.NewRecorder()
e.ServeHTTP(w, r)
assert.Equal(t, http.StatusMethodNotAllowed, w.Code)
}
func TestEchoHTTPError(t *testing.T) {
m := http.StatusText(http.StatusBadRequest)
he := NewHTTPError(http.StatusBadRequest, m)
assert.Equal(t, http.StatusBadRequest, he.Code())
assert.Equal(t, m, he.Error())
}
func TestEchoServer(t *testing.T) {
e := New()
s := e.Server(":1323")
assert.IsType(t, &http.Server{}, s)
}
func TestEchoHook(t *testing.T) {
e := New()
e.Get("/test", func(c *Context) error {
return c.NoContent(http.StatusNoContent)
})
e.Hook(func(w http.ResponseWriter, r *http.Request) {
path := r.URL.Path
l := len(path) - 1
if path != "/" && path[l] == '/' {
r.URL.Path = path[:l]
}
})
r, _ := http.NewRequest(GET, "/test/", nil)
w := httptest.NewRecorder()
e.ServeHTTP(w, r)
assert.Equal(t, r.URL.Path, "/test")
}
func testMethod(t *testing.T, method, path string, e *Echo) {
m := fmt.Sprintf("%c%s", method[0], strings.ToLower(method[1:]))
p := reflect.ValueOf(path)
h := reflect.ValueOf(func(c *Context) error {
return c.String(http.StatusOK, method)
})
i := interface{}(e)
reflect.ValueOf(i).MethodByName(m).Call([]reflect.Value{p, h})
_, body := request(method, path, e)
if body != method {
t.Errorf("expected body `%s`, got %s.", method, body)
}
}
func request(method, path string, e *Echo) (int, string) {
r, _ := http.NewRequest(method, path, nil)
w := httptest.NewRecorder()
e.ServeHTTP(w, r)
return w.Code, w.Body.String()
}
|
{
"content_hash": "4c79e6cc40869d0b8d811f211504f615",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 83,
"avg_line_length": 22.156599552572708,
"alnum_prop": 0.627221324717286,
"repo_name": "danjac/podbaby",
"id": "135b62329fb661be61889404eab28cd1e0709ec0",
"size": "9904",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmd/Godeps/_workspace/src/github.com/labstack/echo/echo_test.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "435"
},
{
"name": "Go",
"bytes": "96933"
},
{
"name": "JavaScript",
"bytes": "155841"
},
{
"name": "Makefile",
"bytes": "390"
},
{
"name": "PLpgSQL",
"bytes": "17782"
},
{
"name": "TSQL",
"bytes": "938"
}
],
"symlink_target": ""
}
|
<div class="contact-wrapper" id="contact">
<div class="container">
<div class="contact">
<h3 class="section-title">Contact</h3>
<div class="headshot"></div>
<ul class="contact-info">
<li><span class="contact-intro"><i class="fa fa-user"> Name </i></span><span class="name">Dylan Sanders</span></li>
<li><span class="contact-intro"><i class="fa fa-envelope"></i> Email </span><a class="email" href="mailto:dylanjsanders1@gmail.com">dylanjsanders1@gmail.com</a></li>
<li><span class="contact-intro"><i class="fa fa-phone"></i> Phone </span><span class="phone">(206) 724-4453</span></li>
<li><span class="contact-intro"><i class="fa fa-map-marker"></i> Location </span><span class="location">Seattle, WA</span></li>
<li><span class="contact-intro"><i class="fa fa-file-text"></i> Resume </span><a href="https://bit.ly/DylanSandersResume" target="_blank">Download</a></li>
<li class="contact-links">Also find me at <span class="contact-intro"><a href="github.com/dylanjsa90"><i class="fa fa-github"></i></a>
<a href="linkedin.com/dylanjsanders"><i class="fa fa-linkedin"></i></a> <a href="http://codepen.io/dylansa90/" target="_blank"><i class="fa fa-codepen"></i></a></span></li>
</ul>
</div>
</div>
</div>
|
{
"content_hash": "415bda6568ee92c541285d90621356de",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 182,
"avg_line_length": 77.29411764705883,
"alnum_prop": 0.6187214611872146,
"repo_name": "dylanjsa90/Portfolio",
"id": "98d7c60ad876c9b6b6e2f11fcf79ef1838537a98",
"size": "1314",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/contact/contact_info_template.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "12060"
},
{
"name": "HTML",
"bytes": "9757"
},
{
"name": "JavaScript",
"bytes": "18977"
}
],
"symlink_target": ""
}
|
#import <CoreGraphics/CoreGraphics.h>
#import <CoreText/CoreText.h>
#import <Foundation/Foundation.h>
#if USE(APPLE_INTERNAL_SDK)
#import <CoreUI/CUICatalog.h>
#import <CoreUI/CUIStyleEffectConfiguration.h>
#else
@interface CUIStyleEffectConfiguration : NSObject <NSCopying>
@end
@interface CUIStyleEffectConfiguration ()
@property (nonatomic) BOOL useSimplifiedEffect;
@end
@interface CUICatalog : NSObject
@end
@interface CUICatalog ()
- (BOOL)drawGlyphs:(const CGGlyph[])glyphs atPositions:(const CGPoint[])positions inContext:(CGContextRef)context withFont:(CTFontRef)font count:(NSUInteger)count stylePresetName:(NSString *)stylePresetName styleConfiguration:(CUIStyleEffectConfiguration *)styleConfiguration foregroundColor:(CGColorRef)foregroundColor;
@end
#endif
|
{
"content_hash": "ddf73a91dc90d67f7ab54dc3725d1c41",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 320,
"avg_line_length": 27.892857142857142,
"alnum_prop": 0.8130601792573624,
"repo_name": "gubaojian/trylearn",
"id": "c221ebe2b2731573513010509d7fba4c4588ec49",
"size": "2135",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "WebLayoutCore/Source/WebCore/PAL/pal/spi/ios/CoreUISPI.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AspectJ",
"bytes": "623"
},
{
"name": "Assembly",
"bytes": "1942"
},
{
"name": "Batchfile",
"bytes": "6632"
},
{
"name": "C",
"bytes": "6629351"
},
{
"name": "C++",
"bytes": "57418677"
},
{
"name": "CMake",
"bytes": "1269316"
},
{
"name": "CSS",
"bytes": "99559"
},
{
"name": "HTML",
"bytes": "283332"
},
{
"name": "Java",
"bytes": "267448"
},
{
"name": "JavaScript",
"bytes": "282026"
},
{
"name": "Makefile",
"bytes": "164797"
},
{
"name": "Objective-C",
"bytes": "956074"
},
{
"name": "Objective-C++",
"bytes": "3645713"
},
{
"name": "Perl",
"bytes": "192119"
},
{
"name": "Python",
"bytes": "39191"
},
{
"name": "Ragel",
"bytes": "128173"
},
{
"name": "Roff",
"bytes": "26536"
},
{
"name": "Ruby",
"bytes": "32784"
},
{
"name": "Shell",
"bytes": "7177"
},
{
"name": "Vue",
"bytes": "1776"
},
{
"name": "Yacc",
"bytes": "11866"
}
],
"symlink_target": ""
}
|
namespace Farmhand.UI
{
// ReSharper disable StyleCop.SA1300
using System;
using System.Collections.Generic;
using System.Linq;
using Farmhand.UI.Interfaces;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using StardewValley;
using StardewValley.Menus;
/// <summary>
/// The framework menu.
/// </summary>
public class FrameworkMenu : IClickableMenu, IComponentCollection
{
/// <summary>
/// Texture location of the top-left menu background sprite.
/// </summary>
protected static readonly Rectangle Tl = new Rectangle(0, 0, 64, 64);
/// <summary>
/// Texture location of the top-center menu background sprite.
/// </summary>
protected static readonly Rectangle Tc = new Rectangle(128, 0, 64, 64);
/// <summary>
/// Texture location of the top-right menu background sprite.
/// </summary>
protected static readonly Rectangle Tr = new Rectangle(192, 0, 64, 64);
/// <summary>
/// Texture location of the middle-left menu background sprite.
/// </summary>
protected static readonly Rectangle Ml = new Rectangle(0, 128, 64, 64);
/// <summary>
/// Texture location of the middle-right menu background sprite.
/// </summary>
protected static readonly Rectangle Mr = new Rectangle(192, 128, 64, 64);
/// <summary>
/// Texture location of the bottom-right menu background sprite.
/// </summary>
protected static readonly Rectangle Br = new Rectangle(192, 192, 64, 64);
/// <summary>
/// Texture location of the bottom-left menu background sprite.
/// </summary>
protected static readonly Rectangle Bl = new Rectangle(0, 192, 64, 64);
/// <summary>
/// Texture location of the bottom-center menu background sprite.
/// </summary>
protected static readonly Rectangle Bc = new Rectangle(128, 192, 64, 64);
/// <summary>
/// Texture location of the menu background sprite.
/// </summary>
protected static readonly Rectangle Bg = new Rectangle(64, 128, 64, 64);
/// <summary>
/// Zoom level 2 (pixelZoom * 2).
/// </summary>
protected static readonly int Zoom2 = Game1.pixelZoom * 2;
/// <summary>
/// Zoom level 2 (pixelZoom * 2).
/// </summary>
protected static readonly int Zoom3 = Game1.pixelZoom * 3;
/// <summary>
/// Zoom level 4 (pixelZoom * 4).
/// </summary>
protected static readonly int Zoom4 = Game1.pixelZoom * 4;
/// <summary>
/// Zoom level 6 (pixelZoom * 6).
/// </summary>
protected static readonly int Zoom6 = Game1.pixelZoom * 6;
/// <summary>
/// Zoom level 10 (pixelZoom * 10).
/// </summary>
protected static readonly int Zoom10 = Game1.pixelZoom * 10;
/// <summary>
/// Zoom level 20 (pixelZoom * 20).
/// </summary>
protected static readonly int Zoom20 = Game1.pixelZoom * 20;
/// <summary>
/// Initializes a new instance of the <see cref="FrameworkMenu" /> class.
/// </summary>
/// <param name="area">
/// The bounding area of this component.
/// </param>
/// <param name="showCloseButton">
/// Whether the show close button should be displayed.
/// </param>
/// <param name="drawChrome">
/// Whether draw chrome is enabled.
/// </param>
public FrameworkMenu(Rectangle area, bool showCloseButton = true, bool drawChrome = true)
{
this.DrawChrome = drawChrome;
this.Area = new Rectangle(
area.X * Game1.pixelZoom,
area.Y * Game1.pixelZoom,
area.Width * Game1.pixelZoom,
area.Height * Game1.pixelZoom);
this.initialize(this.Area.X, this.Area.Y, this.Area.Width, this.Area.Height, showCloseButton);
}
/// <summary>
/// Initializes a new instance of the <see cref="FrameworkMenu" /> class.
/// </summary>
/// <param name="size">
/// The size of the menu.
/// </param>
/// <param name="showCloseButton">
/// Whether the show close button should be displayed.
/// </param>
/// <param name="drawChrome">
/// Whether draw chrome is enabled.
/// </param>
public FrameworkMenu(Point size, bool showCloseButton = true, bool drawChrome = true)
{
this.DrawChrome = drawChrome;
this.Centered = true;
var pos = Utility.getTopLeftPositionForCenteringOnScreen(size.X * Game1.pixelZoom, size.Y * Game1.pixelZoom);
this.Area = new Rectangle((int)pos.X, (int)pos.Y, size.X * Game1.pixelZoom, size.Y * Game1.pixelZoom);
this.initialize(this.Area.X, this.Area.Y, this.Area.Width, this.Area.Height, showCloseButton);
}
/// <summary>
/// Gets or sets the bounding area of this component.
/// </summary>
public Rectangle Area { get; set; }
/// <summary>
/// Gets or sets a value indicating whether centered.
/// </summary>
protected bool Centered { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to draw chrome.
/// </summary>
protected bool DrawChrome { get; set; }
/// <summary>
/// Gets or sets an ordered collection that determines the draw order.
/// </summary>
protected List<IMenuComponent> DrawOrder { get; set; } = new List<IMenuComponent>();
/// <summary>
/// Gets or sets an ordered collection that determines the event order.
/// </summary>
protected List<IInteractiveMenuComponent> EventOrder { get; set; } = new List<IInteractiveMenuComponent>();
/// <summary>
/// Gets or sets the floating component.
/// </summary>
protected IInteractiveMenuComponent FloatingComponent { get; set; }
/// <summary>
/// Gets or sets the focus element.
/// </summary>
protected IInteractiveMenuComponent FocusElement { get; set; }
/// <summary>
/// Gets or sets a value indicating whether mouse is held on this component.
/// </summary>
protected bool Hold { get; set; }
/// <summary>
/// Gets or sets the hover in element.
/// </summary>
protected IInteractiveMenuComponent HoverInElement { get; set; }
#region IComponentCollection Members
/// <summary>
/// Gets or sets the static components.
/// </summary>
public List<IMenuComponent> StaticComponents { get; set; } = new List<IMenuComponent>();
/// <summary>
/// Gets or sets the interactive components.
/// </summary>
public List<IInteractiveMenuComponent> InteractiveComponents { get; set; } =
new List<IInteractiveMenuComponent>();
/// <summary>
/// Gets the area in which events (such as mouse click/hover events) are captured.
/// </summary>
public virtual Rectangle EventRegion
=>
new Rectangle(
this.Area.X + Zoom10,
this.Area.Y + Zoom10,
this.Area.Width - Zoom20,
this.Area.Height - Zoom20);
/// <summary>
/// Gets the zoomed event region.
/// </summary>
public virtual Rectangle ZoomEventRegion
=>
new Rectangle(
(this.Area.X + Zoom10) / Game1.pixelZoom,
(this.Area.Y + Zoom10) / Game1.pixelZoom,
(this.Area.Width - Zoom20) / Game1.pixelZoom,
(this.Area.Height - Zoom20) / Game1.pixelZoom);
/// <summary>
/// Gets the menu attached to this container.
/// </summary>
/// <returns>
/// The attached menu <see cref="FrameworkMenu" />.
/// </returns>
public virtual FrameworkMenu GetAttachedMenu()
{
return this;
}
/// <summary>
/// Resets the current focus for this container.
/// </summary>
public virtual void ResetFocus()
{
if (this.FocusElement == null)
{
return;
}
this.FocusElement.FocusLost();
if (this.FocusElement is IKeyboardComponent)
{
Game1.keyboardDispatcher.Subscriber.Selected = false;
Game1.keyboardDispatcher.Subscriber = null;
}
this.FocusElement = null;
if (this.FloatingComponent != null)
{
this.FloatingComponent.Detach(this);
this.FloatingComponent = null;
}
}
/// <summary>
/// Gives focus to a specified component.
/// </summary>
/// <param name="component">
/// The component to give focus.
/// </param>
public virtual void GiveFocus(IInteractiveMenuComponent component)
{
if (component == this.FocusElement)
{
return;
}
this.ResetFocus();
this.FocusElement = component;
var focusElement = this.FocusElement as IKeyboardComponent;
if (focusElement != null)
{
Game1.keyboardDispatcher.Subscriber = new KeyboardSubscriberProxy(focusElement);
}
if (!this.InteractiveComponents.Contains(component))
{
this.FloatingComponent = component;
component.Attach(this);
}
component.FocusGained();
}
/// <summary>
/// Adds a component to this collection
/// </summary>
/// <param name="component">
/// The component to add.
/// </param>
public virtual void AddComponent(IMenuComponent component)
{
var interactiveMenuComponent = component as IInteractiveMenuComponent;
if (interactiveMenuComponent != null)
{
this.InteractiveComponents.Add(interactiveMenuComponent);
}
else
{
this.StaticComponents.Add(component);
}
component.Attach(this);
this.UpdateDrawOrder();
}
/// <summary>
/// Removes a component from this collection
/// </summary>
/// <param name="component">
/// The component to remove.
/// </param>
public virtual void RemoveComponent(IMenuComponent component)
{
var removed = false;
this.RemoveComponents(
a =>
{
var b = a == component && !removed;
if (b)
{
removed = true;
a.Detach(this);
}
return b;
});
}
/// <summary>
/// Removes all components of a specific type from this collection.
/// </summary>
/// <typeparam name="T">
/// The type of components to remove.
/// </typeparam>
public virtual void RemoveComponents<T>() where T : IMenuComponent
{
this.RemoveComponents(a => a.GetType() == typeof(T));
}
/// <summary>
/// Removes all components matching a filter from this collection.
/// </summary>
/// <param name="filter">
/// The filter to use.
/// </param>
public virtual void RemoveComponents(Predicate<IMenuComponent> filter)
{
this.InteractiveComponents.RemoveAll(
a =>
{
var b = filter(a);
if (b)
{
a.Detach(this);
}
return b;
});
this.StaticComponents.RemoveAll(
a =>
{
var b = filter(a);
if (b)
{
a.Detach(this);
}
return b;
});
this.UpdateDrawOrder();
}
/// <summary>
/// Removes all components from this collection
/// </summary>
public virtual void ClearComponents()
{
foreach (var component in this.InteractiveComponents)
{
component.Detach(this);
}
foreach (var component in this.StaticComponents)
{
component.Detach(this);
}
this.InteractiveComponents.Clear();
this.StaticComponents.Clear();
this.UpdateDrawOrder();
}
/// <summary>
/// Gets whether this collection can accept the provided component.
/// </summary>
/// <param name="component">
/// The component to check.
/// </param>
/// <returns>
/// Whether this collection accepts the component.
/// </returns>
public virtual bool AcceptsComponent(IMenuComponent component)
{
return true;
}
#endregion
/// <summary>
/// Draws the menu background
/// </summary>
/// <param name="b">
/// The sprite batch to use.
/// </param>
/// <param name="x">
/// The x position of the frame.
/// </param>
/// <param name="y">
/// The y position of the frame.
/// </param>
/// <param name="width">
/// The width of the frame.
/// </param>
/// <param name="height">
/// The height of the frame.
/// </param>
public static void DrawMenuRect(SpriteBatch b, int x, int y, int width, int height)
{
var o = new Rectangle(x + Zoom2, y + Zoom2, width - Zoom4, height - Zoom4);
b.Draw(Game1.menuTexture, new Rectangle(o.X, o.Y, o.Width, o.Height), Bg, Color.White);
o = new Rectangle(x - Zoom3, y - Zoom3, width + Zoom6, height + Zoom6);
b.Draw(Game1.menuTexture, new Rectangle(o.X, o.Y, 64, 64), Tl, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X + o.Width - 64, o.Y, 64, 64), Tr, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X + 64, o.Y, o.Width - 128, 64), Tc, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X, o.Y + o.Height - 64, 64, 64), Bl, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X + o.Width - 64, o.Y + o.Height - 64, 64, 64), Br, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X + 64, o.Y + o.Height - 64, o.Width - 128, 64), Bc, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X, o.Y + 64, 64, o.Height - 128), Ml, Color.White);
b.Draw(Game1.menuTexture, new Rectangle(o.X + o.Width - 64, o.Y + 64, 64, o.Height - 128), Mr, Color.White);
}
/// <summary>
/// Gets the list of components ordered by draw order
/// </summary>
/// <param name="statics">
/// Static components.
/// </param>
/// <param name="interactives">
/// Interactive components.
/// </param>
/// <returns>
/// An KeyValuePair of ordered lists of the components.
/// </returns>
public static KeyValuePair<List<IInteractiveMenuComponent>, List<IMenuComponent>> GetOrderedLists(
List<IMenuComponent> statics,
List<IInteractiveMenuComponent> interactives)
{
var drawOrder = new List<IMenuComponent>(statics);
drawOrder.AddRange(interactives);
drawOrder =
drawOrder.OrderByDescending(x => x.Layer)
.ThenByDescending(x => x.GetPosition().Y)
.ThenByDescending(x => x.GetPosition().X)
.ToList();
var eventOrder =
interactives.OrderBy(x => x.Layer)
.ThenBy(x => x.GetPosition().Y)
.ThenBy(x => x.GetPosition().X)
.ToList();
return new KeyValuePair<List<IInteractiveMenuComponent>, List<IMenuComponent>>(eventOrder, drawOrder);
}
/// <summary>
/// Updates the draw and event order collections.
/// </summary>
protected virtual void UpdateDrawOrder()
{
var sorted = GetOrderedLists(this.StaticComponents, this.InteractiveComponents);
this.DrawOrder = sorted.Value;
this.EventOrder = sorted.Key;
}
/// <summary>
/// Called when game window size changed. (Game override)
/// </summary>
/// <param name="oldBounds">
/// The old bounds.
/// </param>
/// <param name="newBounds">
/// The new bounds.
/// </param>
public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds)
{
if (!this.Centered)
{
return;
}
var pos = Utility.getTopLeftPositionForCenteringOnScreen(this.Area.Width, this.Area.Height);
this.Area = new Rectangle((int)pos.X, (int)pos.Y, this.Area.Width, this.Area.Height);
}
/// <summary>
/// Called when left click is released. (Game override)
/// </summary>
/// <param name="x">
/// The x position.
/// </param>
/// <param name="y">
/// The y position.
/// </param>
public override void releaseLeftClick(int x, int y)
{
if (this.HoverInElement == null)
{
return;
}
var p = new Point(x, y);
var o = new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10);
this.HoverInElement.LeftUp(p, o);
this.Hold = false;
if (this.HoverInElement.InBounds(p, o))
{
return;
}
this.HoverInElement.HoverOut(p, o);
this.HoverInElement = null;
}
/// <summary>
/// Called when left click is held. (Game override)
/// </summary>
/// <param name="x">
/// The x position.
/// </param>
/// <param name="y">
/// The y position.
/// </param>
public override void leftClickHeld(int x, int y)
{
if (this.HoverInElement == null)
{
return;
}
this.Hold = true;
this.HoverInElement.LeftHeld(new Point(x, y), new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10));
}
/// <summary>
/// Called when left click is received. (Game override)
/// </summary>
/// <param name="x">
/// The x position.
/// </param>
/// <param name="y">
/// The y position.
/// </param>
/// <param name="playSound">
/// Whether the default right click sound should be played
/// </param>
public override void receiveLeftClick(int x, int y, bool playSound = true)
{
base.receiveLeftClick(x, y, playSound);
var p = new Point(x, y);
var o = new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10);
if (this.FloatingComponent != null && this.FloatingComponent.InBounds(p, o))
{
this.FloatingComponent.LeftClick(p, o);
return;
}
foreach (var el in this.EventOrder)
{
if (el.InBounds(p, o))
{
this.GiveFocus(el);
el.LeftClick(p, o);
return;
}
}
this.ResetFocus();
}
/// <summary>
/// Exits this menu
/// </summary>
public void ExitMenu()
{
this.exitThisMenu();
}
/// <summary>
/// Called when right click is received. (Game override)
/// </summary>
/// <param name="x">
/// The x position.
/// </param>
/// <param name="y">
/// The y position.
/// </param>
/// <param name="playSound">
/// Whether the default right click sound should be played
/// </param>
public override void receiveRightClick(int x, int y, bool playSound = true)
{
var p = new Point(x, y);
var o = new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10);
if (this.FloatingComponent != null && this.FloatingComponent.InBounds(p, o))
{
this.FloatingComponent.RightClick(p, o);
return;
}
foreach (var el in this.EventOrder)
{
if (el.InBounds(p, o))
{
this.GiveFocus(el);
this.FocusElement = el;
el.RightClick(p, o);
return;
}
}
this.ResetFocus();
}
/// <summary>
/// Called when hovered. (Game override)
/// </summary>
/// <param name="x">
/// The x position.
/// </param>
/// <param name="y">
/// The y position.
/// </param>
public override void performHoverAction(int x, int y)
{
base.performHoverAction(x, y);
if (!this.Area.Contains(x, y) || this.Hold)
{
return;
}
var p = new Point(x, y);
var o = new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10);
if (this.HoverInElement != null && !this.HoverInElement.InBounds(p, o))
{
this.HoverInElement.HoverOut(p, o);
this.HoverInElement = null;
}
if (this.FloatingComponent != null && this.FloatingComponent.InBounds(p, o))
{
this.FloatingComponent.HoverOver(p, o);
return;
}
foreach (var el in this.EventOrder)
{
if (el.InBounds(p, o))
{
if (this.HoverInElement == null)
{
this.HoverInElement = el;
el.HoverIn(p, o);
}
el.HoverOver(p, o);
break;
}
}
}
/// <summary>
/// Called when a scroll event is received. (Game override)
/// </summary>
/// <param name="direction">
/// The direction of the scroll
/// </param>
public override void receiveScrollWheelAction(int direction)
{
base.receiveScrollWheelAction(direction);
var p = Game1.getMousePosition();
var o = new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10);
this.FloatingComponent?.Scroll(direction, p, o);
foreach (var el in this.EventOrder)
{
el.Scroll(direction, p, o);
}
}
/// <summary>
/// Called when a key press event is received. (Game override)
/// </summary>
/// <param name="key">
/// The pressed key
/// </param>
public override void receiveKeyPress(Keys key)
{
if (Game1.keyboardDispatcher.Subscriber == null)
{
base.receiveKeyPress(key);
}
}
/// <summary>
/// Called on game update. (Game override)
/// </summary>
/// <param name="time">
/// The elapsed time since the previous frame
/// </param>
public override void update(GameTime time)
{
base.update(time);
this.FloatingComponent?.Update(time);
foreach (var el in this.DrawOrder)
{
el.Update(time);
}
}
/// <summary>
/// Called on draw. (Game override)
/// </summary>
/// <param name="b">
/// The sprite batch to use for this draw.
/// </param>
public override void draw(SpriteBatch b)
{
if (this.DrawChrome)
{
DrawMenuRect(b, this.Area.X, this.Area.Y, this.Area.Width, this.Area.Height);
}
var o = new Point(this.Area.X + Zoom10, this.Area.Y + Zoom10);
foreach (var el in this.DrawOrder)
{
el.Draw(b, o);
}
this.FloatingComponent?.Draw(b, o);
base.draw(b);
this.drawMouse(b);
}
}
}
|
{
"content_hash": "0bb934f2c55220cfff4151771d506330",
"timestamp": "",
"source": "github",
"line_count": 754,
"max_line_length": 121,
"avg_line_length": 34.177718832891244,
"alnum_prop": 0.4942956926658906,
"repo_name": "TownEater/Stardew-Farmhand",
"id": "ca0a38d9dbf7611cde229ce5443eeff96101791a",
"size": "25772",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Libraries/FarmhandUI/FrameworkMenu.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "39"
},
{
"name": "C#",
"bytes": "1299511"
}
],
"symlink_target": ""
}
|
package tests
import (
"testing"
br "github.com/FabianWe/boolrecognition"
)
// Example 1.28 / 1.29 from BOOLEAN FUNCTIONS Theory, Algorithms, and
// Applications by Yves Crama and Peter L. Hammer (page 58)
var phi br.ClauseSet = []br.Clause{
[]int{0, 1},
[]int{0, 2, 3},
[]int{1, 2},
}
// TODO write the actual tests, but this is really annoying with the concurrent
// stuff, we have to ignore the order etc.
func TestMinMaxPoints(t *testing.T) {
// mtps := lpb.ComputeMTPs(phi, 4)
// mfps := lpb.ComputeMFPs(mtps, true)
// tests here
}
|
{
"content_hash": "3bbea6a494aa12c1a9da103075f5c9e6",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 23.869565217391305,
"alnum_prop": 0.6830601092896175,
"repo_name": "FabianWe/boolrecognition",
"id": "a577099433c89c84a3bdd49541b3977d816b4329",
"size": "1165",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lpb/tests/points_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "119060"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>graphs: 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.13.0 / graphs - 8.8.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
graphs
<small>
8.8.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-04 18:00:14 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-04 18:00:14 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.5 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/graphs"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Graphs"]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
"coq-int-map" {>= "8.8" & < "8.9~"}
]
tags: [ "keyword: graphs" "keyword: graph theory" "keyword: cycle detection" "keyword: paths" "keyword: constraints" "keyword: inequalities" "keyword: reflection" "category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures" "category: Miscellaneous/Extracted Programs/Combinatorics" ]
authors: [ "Jean Goubault" ]
bug-reports: "https://github.com/coq-contribs/graphs/issues"
dev-repo: "git+https://github.com/coq-contribs/graphs.git"
synopsis: "Satisfiability of inequality constraints and detection of cycles with negative weight in graphs"
description:
"*******************************************************************"
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/graphs/archive/v8.8.0.tar.gz"
checksum: "md5=aa176fba6a90b6ffff8f673958baa68d"
}
</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-graphs.8.8.0 coq.8.13.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0).
The following dependencies couldn't be met:
- coq-graphs -> coq < 8.9~ -> ocaml < 4.10
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-graphs.8.8.0</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": "393035cc4ee7604da28339c8670739ee",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 407,
"avg_line_length": 44.339393939393936,
"alnum_prop": 0.544013121924549,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "a7cdfa9cbecc033f1a50374be58cf190361200fe",
"size": "7341",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.12.1-2.0.8/released/8.13.0/graphs/8.8.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
require 'spec_helper'
describe 'java8', :type => :class do
shared_examples_for 'a linux os' do
it { is_expected.to compile }
it { should contain_class('apt') }
it { should contain_package('oracle-java8-installer').with(
'responsefile' => '/tmp/java.preseed'
) }
it { should contain_file('/tmp/java.preseed').with(
'source' => 'puppet:///modules/java8/java.preseed',
'mode' => '0600',
'backup' => 'false'
) }
it { should contain_file('/etc/profile.d/set_java_home.sh')}
end
context 'supported operating systems' do
describe 'ubuntu' do
['precise', 'trusty'].each do |lsbdistcodename|
context "#{lsbdistcodename}" do
let(:facts) {{
:lsbdistid => 'Ubuntu',
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:lsbdistcodename => lsbdistcodename
}}
it_behaves_like 'a linux os' do
end
it { should contain_apt__ppa('ppa:webupd8team/java') }
end
end
end
describe 'debian' do
['squeeze', 'wheezy'].each do |lsbdistcodename|
context "#{lsbdistcodename}" do
let(:facts) {{
:lsbdistid => 'Debian',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:lsbdistcodename => lsbdistcodename,
}}
it_behaves_like 'a linux os' do
end
it { should contain_apt__source('webupd8team-java').with(
'location' => 'http://ppa.launchpad.net/webupd8team/java/ubuntu',
'release' => 'precise',
'repos' => 'main',
'key' => {
'id' => '7B2C3B0889BF5709A105D03AC2518248EEA14886',
'server' => 'keyserver.ubuntu.com',
},
'include' => {
'deb' => 'true',
'src' => 'true',
}
) }
end
end
end
end
end
|
{
"content_hash": "4a7b58e286a9434db3a5a0ec68cf9b78",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 77,
"avg_line_length": 30.873015873015873,
"alnum_prop": 0.5131105398457584,
"repo_name": "jevon71-work/vagrant-working",
"id": "ba0e8981ccab1a99b40a6d00d6682e123a202f01",
"size": "1945",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "etc/puppet/modules/java8/spec/classes/java8_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "33101"
},
{
"name": "Pascal",
"bytes": "13898"
},
{
"name": "Puppet",
"bytes": "159231"
},
{
"name": "Ruby",
"bytes": "1648550"
},
{
"name": "Shell",
"bytes": "8731"
}
],
"symlink_target": ""
}
|
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Ads.GoogleAds.V12.Resources {
/// <summary>Holder for reflection information generated from google/ads/googleads/v12/resources/hotel_performance_view.proto</summary>
public static partial class HotelPerformanceViewReflection {
#region Descriptor
/// <summary>File descriptor for google/ads/googleads/v12/resources/hotel_performance_view.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static HotelPerformanceViewReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cj9nb29nbGUvYWRzL2dvb2dsZWFkcy92MTIvcmVzb3VyY2VzL2hvdGVsX3Bl",
"cmZvcm1hbmNlX3ZpZXcucHJvdG8SImdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYx",
"Mi5yZXNvdXJjZXMaH2dvb2dsZS9hcGkvZmllbGRfYmVoYXZpb3IucHJvdG8a",
"GWdvb2dsZS9hcGkvcmVzb3VyY2UucHJvdG8ixgEKFEhvdGVsUGVyZm9ybWFu",
"Y2VWaWV3EkwKDXJlc291cmNlX25hbWUYASABKAlCNeBBA/pBLwotZ29vZ2xl",
"YWRzLmdvb2dsZWFwaXMuY29tL0hvdGVsUGVyZm9ybWFuY2VWaWV3OmDqQV0K",
"LWdvb2dsZWFkcy5nb29nbGVhcGlzLmNvbS9Ib3RlbFBlcmZvcm1hbmNlVmll",
"dxIsY3VzdG9tZXJzL3tjdXN0b21lcl9pZH0vaG90ZWxQZXJmb3JtYW5jZVZp",
"ZXdCiwIKJmNvbS5nb29nbGUuYWRzLmdvb2dsZWFkcy52MTIucmVzb3VyY2Vz",
"QhlIb3RlbFBlcmZvcm1hbmNlVmlld1Byb3RvUAFaS2dvb2dsZS5nb2xhbmcu",
"b3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvYWRzL2dvb2dsZWFkcy92MTIvcmVz",
"b3VyY2VzO3Jlc291cmNlc6ICA0dBQaoCIkdvb2dsZS5BZHMuR29vZ2xlQWRz",
"LlYxMi5SZXNvdXJjZXPKAiJHb29nbGVcQWRzXEdvb2dsZUFkc1xWMTJcUmVz",
"b3VyY2Vz6gImR29vZ2xlOjpBZHM6Okdvb2dsZUFkczo6VjEyOjpSZXNvdXJj",
"ZXNiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V12.Resources.HotelPerformanceView), global::Google.Ads.GoogleAds.V12.Resources.HotelPerformanceView.Parser, new[]{ "ResourceName" }, null, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// A hotel performance view.
/// </summary>
public sealed partial class HotelPerformanceView : pb::IMessage<HotelPerformanceView>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<HotelPerformanceView> _parser = new pb::MessageParser<HotelPerformanceView>(() => new HotelPerformanceView());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<HotelPerformanceView> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Ads.GoogleAds.V12.Resources.HotelPerformanceViewReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public HotelPerformanceView() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public HotelPerformanceView(HotelPerformanceView other) : this() {
resourceName_ = other.resourceName_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public HotelPerformanceView Clone() {
return new HotelPerformanceView(this);
}
/// <summary>Field number for the "resource_name" field.</summary>
public const int ResourceNameFieldNumber = 1;
private string resourceName_ = "";
/// <summary>
/// Output only. The resource name of the hotel performance view.
/// Hotel performance view resource names have the form:
///
/// `customers/{customer_id}/hotelPerformanceView`
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string ResourceName {
get { return resourceName_; }
set {
resourceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as HotelPerformanceView);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(HotelPerformanceView other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ResourceName != other.ResourceName) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (ResourceName.Length != 0) hash ^= ResourceName.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (ResourceName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(ResourceName);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (ResourceName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(ResourceName);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (ResourceName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ResourceName);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(HotelPerformanceView other) {
if (other == null) {
return;
}
if (other.ResourceName.Length != 0) {
ResourceName = other.ResourceName;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
ResourceName = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
ResourceName = input.ReadString();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code
|
{
"content_hash": "f9be33e3d07404eb41f75ccad4473037",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 235,
"avg_line_length": 39.16194331983806,
"alnum_prop": 0.6953375374754471,
"repo_name": "googleads/google-ads-dotnet",
"id": "51b364f3ea7628672b6ef4050cd034b83c31dcbf",
"size": "9937",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "Google.Ads.GoogleAds/src/V12/HotelPerformanceView.g.cs",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "1468"
},
{
"name": "C#",
"bytes": "97173437"
},
{
"name": "CSS",
"bytes": "705"
},
{
"name": "HTML",
"bytes": "5996"
},
{
"name": "JavaScript",
"bytes": "1543"
},
{
"name": "Shell",
"bytes": "20116"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Notepad</title>
<link rel="shortcut icon" sizes="16x16" href="favicon.ico">
<link rel="stylesheet" href="css/notepad.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400">
<meta property="og:site_name" content="notepad.codetri.net">
<meta property="og:type" content="website">
<meta property="og:title" content="Notepad">
<meta property="og:url" content="https://notepad.codetri.net">
<meta property="og:image" content="https://notepad.codetri.net/img/social-media-card.png">
<meta property="og:description" content="Good ol' Windows Notepad, now available on the Web!">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@cely717">
<meta name="twitter:creator" content="@cely717">
<meta name="twitter:title" content="Notepad">
<meta name="twitter:description" content="Good ol' Windows Notepad, now available on the Web!">
<meta name="twitter:image:src" content="https://notepad.codetri.net/img/social-media-card.png">
</head>
<body class="win10">
<header>
<img width="19" height="16" alt="Logo" src="img/icon.png">
<h1><span id="title-file-name">Untitled</span> - Notepad</h1>
</header>
<nav class="menu">
<ul>
<li id="menu-file">File</li>
<li id="menu-edit">Edit</li>
<li id="menu-format">Format</li>
<li id="menu-view">View</li>
<li id="menu-help">Help</li>
</ul>
<div class="border" id="secondary"></div>
<div class="border" id="primary"></div>
</nav>
<nav class="menu-context file">
<div class="area-check">
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
</div>
<label id="action-new">New</label>
<label class="menu-disabled">Open...</label>
<label id="action-save">Save</label>
<label id="action-save-as">Save As...</label>
<label class="menu-divider menu-disabled">Page Setup...</label>
<label id="action-print">Print...</label>
<label class="menu-disabled menu-divider">Exit</label>
</nav>
<nav class="menu-context edit">
<div class="area-check">
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
<div class="blank"></div>
</div>
<label class="menu-disabled">Undo</label>
<label class="menu-disabled menu-divider">Cut</label>
<label class="menu-disabled">Copy</label>
<label class="menu-disabled">Paste</label>
<label class="menu-disabled">Delete</label>
<label class="menu-disabled menu-divider">Find...</label>
<label class="menu-disabled">Find Next...</label>
<label class="menu-disabled">Replace...</label>
<label class="menu-disabled">Go To...</label>
<label class="menu-divider" id="action-select-all">Select All</label>
<label id="action-time-date">Time/Date</label>
</nav>
<nav class="menu-context format">
<div class="area-check">
<input type="checkbox" id="word-wrap">
<div class="blank"></div>
</div>
<label for="word-wrap">Word Wrap</label>
<label class="menu-disabled">Font...</label>
</nav>
<nav class="menu-context view">
<div class="area-check">
<input type="checkbox" id="status-bar">
</div>
<label for="status-bar" id="action-status-bar">Status Bar</label>
</nav>
<nav class="menu-context help">
<div class="area-check">
<div class="blank"></div>
<div class="blank"></div>
</div>
<label id="action-view-help">View Help</label>
<label class="menu-divider menu-disabled">About Notepad</label>
</nav>
<div id="area-edit">
<textarea class="no-word-wrap" autocomplete="off" spellcheck="false" autofocus></textarea>
</div>
<div id="area-status-bar">
<div></div>
<div class="text">
Ln <span class="line-number"></span>, Col <span class="column-number"></span>
</div>
</div>
<script async src="js/notepad.js"></script>
</body>
</html>
|
{
"content_hash": "b4a9e2dbf761e015b903bb3b8695ae99",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 97,
"avg_line_length": 32.9264705882353,
"alnum_prop": 0.6223760607414024,
"repo_name": "le717/notepad.exe",
"id": "d90cb2a0e0876c52612cbee29ff2c51ffb9d5ddb",
"size": "4478",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3855"
},
{
"name": "HTML",
"bytes": "5393"
},
{
"name": "JavaScript",
"bytes": "9086"
}
],
"symlink_target": ""
}
|
from ..models import SipkdBase, SipkdDBSession
from datetime import datetime
from sqlalchemy import (
Column,
Integer,
BigInteger,
SmallInteger,
Text,
DateTime,
Date,
String,
ForeignKey,
text,
UniqueConstraint,
Numeric,
ForeignKeyConstraint,
PrimaryKeyConstraint
)
from sqlalchemy.orm import (
relationship,backref )
class SipkdSpm(SipkdBase):
__tablename__ = 'antarbyr'
__table_args__ = (PrimaryKeyConstraint('unitkey', 'nospm'),)
unitkey = Column(String(10), nullable=False)
nospm = Column(String(50), nullable=False)
kdstatus = Column(String(3), nullable=False)
keybend = Column(String(10))
idxsko = Column(String(10), nullable=False)
idxttd = Column(String(10))
nospp = Column(String(50))
kdp3 = Column(String(10), ForeignKey('daftphk3.kdp3'))
idxkode = Column(Integer, nullable=False)
noreg = Column(String(5))
ketotor = Column(String(254))
nokontrak = Column(String(1024))
keperluan = Column(String(4096))
penolakan = Column(String(1))
tglvalid = Column(DateTime)
tglspm = Column(DateTime)
tgspp = Column(DateTime)
kddana = Column(String(3))
kdkabkot = Column(String(3))
class SipkdSp2d(SipkdBase):
__tablename__ = 'sp2d'
__table_args__ = (PrimaryKeyConstraint('unitkey', 'nosp2d'),
ForeignKeyConstraint(['unitkey', 'nospm'],
['antarbyr.unitkey', 'antarbyr.nospm']),)
unitkey = Column(String(10), nullable=False)
nosp2d = Column(String(50), nullable=False)
kdstatus = Column(String(3), nullable=False)
nospm = Column(String(50))
keybend = Column(String(10), ForeignKey('bend.keybend'))
idxsko = Column(String(10), nullable=False)
idxttd = Column(String(10))
kdp3 = Column(String(10), ForeignKey('daftphk3.kdp3'))
idxkode = Column(Integer, nullable=False)
noreg = Column(String(5))
ketotor = Column(String(254))
nokontrak = Column(String(2048))
keperluan = Column(String(4096))
penolakan = Column(String(1))
tglvalid = Column(DateTime)
tglsp2d = Column(DateTime)
tglspm = Column(DateTime)
nobbantu = Column(String(10))
class SipkdSp2d4(SipkdBase):
__tablename__ = 'sp2ddetd'
__table_args__ = (PrimaryKeyConstraint('mtgkey','unitkey', 'nosp2d'),
ForeignKeyConstraint(['unitkey', 'nosp2d'],
['sp2d.unitkey', 'sp2d.nosp2d']),)
mtgkey = Column(String(10), nullable=False)
unitkey = Column(String(10), nullable=False)
nosp2d = Column(String(50), nullable=False)
nojetra = Column(String(2), nullable=False)
nilai = Column(Numeric)
class SipkdSp2d5(SipkdBase):
__tablename__ = 'sp2ddetr'
__table_args__ = (PrimaryKeyConstraint('kdkegunit','mtgkey','unitkey', 'nosp2d'),
ForeignKeyConstraint(['unitkey', 'nosp2d'],
['sp2d.unitkey', 'sp2d.nosp2d']),)
kdkegunit = Column(String(10), nullable=False)
mtgkey = Column(String(10), nullable=False)
unitkey = Column(String(10), nullable=False)
nosp2d = Column(String(50), nullable=False)
nojetra = Column(String(2), nullable=False)
kddana = Column(String(3))
nilai = Column(Numeric)
class SipkdSp2d51(SipkdBase):
__tablename__ = 'sp2ddetrtl'
__table_args__ = (PrimaryKeyConstraint('mtgkey','unitkey', 'nosp2d'),
ForeignKeyConstraint(['unitkey', 'nosp2d'],
['sp2d.unitkey', 'sp2d.nosp2d']),)
mtgkey = Column(String(10), nullable=False)
unitkey = Column(String(10), nullable=False)
nosp2d = Column(String(50), nullable=False)
nojetra = Column(String(2), nullable=False)
kddana = Column(String(3))
nilai = Column(Numeric)
class SipkdSp2d6(SipkdBase):
__tablename__ = 'sp2ddetb'
__table_args__ = (PrimaryKeyConstraint('mtgkey','unitkey', 'nosp2d'),
ForeignKeyConstraint(['unitkey', 'nosp2d'],
['sp2d.unitkey', 'sp2d.nosp2d']),)
mtgkey = Column(String(10), nullable=False)
unitkey = Column(String(10), nullable=False)
nosp2d = Column(String(50), nullable=False)
nojetra = Column(String(2), nullable=False)
kddana = Column(String(3))
nilai = Column(Numeric)
class SipkdSp2dPjk(SipkdBase):
__tablename__ = 'sp2dpjk'
__table_args__ = (PrimaryKeyConstraint('pjkkey','unitkey', 'nosp2d'),
ForeignKeyConstraint(['unitkey', 'nosp2d'],
['sp2d.unitkey', 'sp2d.nosp2d']),)
unitkey = Column(String(10), nullable=False)
nosp2d = Column(String(50), nullable=False)
pjkkey = Column(String(10), ForeignKey('jpajak.pjkkey'), nullable=False)
nilai = Column(Numeric)
keterangan = Column(String(512))
class SipkdRek6(SipkdBase):
__tablename__ = 'matangb'
mtgkey = Column(String(10), primary_key=True, nullable=False)
kdper = Column(String(30))
nmper = Column(String(200))
mtglevel = Column(String(2), nullable=False)
kdkhusus = Column(String(1))
type = Column(String(2))
class SipkdRek4(SipkdBase):
__tablename__ = 'matangd'
mtgkey = Column(String(10), primary_key=True, nullable=False)
kdper = Column(String(30))
nmper = Column(String(200))
mtglevel = Column(String(2), nullable=False)
kdkhusus = Column(String(1), nullable=False)
type = Column(String(2))
class SipkdRek5(SipkdBase):
__tablename__ = 'matangr'
mtgkey = Column(String(10), primary_key=True, nullable=False)
kdper = Column(String(30))
nmper = Column(String(200))
mtglevel = Column(String(2), nullable=False)
kdkhusus = Column(String(1))
type = Column(String(2))
class SipkdVendor(SipkdBase):
__tablename__ = 'daftphk3'
kdp3 = Column(String(10), primary_key=True, nullable=False)
nmp3 = Column(String(100))
nminst = Column(String(100))
norcp3 = Column(String(50))
nmbank = Column(String(50))
jnsusaha = Column(String(50))
alamat = Column(String(200))
telepon = Column(String(20))
npwp = Column(String(30))
unitkey = Column(String(10))
class SipkdBend(SipkdBase):
__tablename__ = 'bend'
keybend = Column(String(10), primary_key=True, nullable=False)
jns_bend = Column(String(2), nullable=False)
nip = Column(String(30), ForeignKey('pegawai.nip'), nullable=False)
kdbank = Column(String(2), ForeignKey('daftbank.kdbank'))
unitkey = Column(String(10), nullable=False)
jab_bend = Column(String(100))
rekbend = Column(String(100))
saldobend = Column(Numeric)
npwpbend = Column(String(30))
tglstopbend = Column(DateTime)
saldobendt = Column(Numeric)
class SipkdPegawai(SipkdBase):
__tablename__ = 'pegawai'
nip = Column(String(30), primary_key=True, nullable=False)
kdgol = Column(String(10))
unitkey = Column(String(10))
nama = Column(String(100))
alamat = Column(String(200))
jabatan = Column(String(200))
pddk = Column(String(30))
class SipkdBank(SipkdBase):
__tablename__ = 'daftbank'
kdbank = Column(String(2), primary_key=True, nullable=False)
nmbank = Column(String(50))
akbank = Column(String(20))
alamat = Column(String(200))
telepon = Column(String(20))
cabang = Column(String(50))
class SipkdPjk(SipkdBase):
__tablename__ = 'jpajak'
pjkkey = Column(String(10), primary_key=True, nullable=False)
kdpajak = Column(String(10))
nmpajak = Column(String(50))
rumuspjk = Column(String(100))
|
{
"content_hash": "fa6a2cc4cb1f457d0ed8050b7324c923",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 85,
"avg_line_length": 37.60287081339713,
"alnum_prop": 0.6145820078890444,
"repo_name": "aagusti/sp2d",
"id": "9195769a1842b1e7b9e4f933d71406bf58693f23",
"size": "7859",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sp2d/models/sp2d_sipkd.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "15982"
},
{
"name": "CSS",
"bytes": "107334"
},
{
"name": "HTML",
"bytes": "1317001"
},
{
"name": "JavaScript",
"bytes": "983058"
},
{
"name": "PHP",
"bytes": "1684"
},
{
"name": "Python",
"bytes": "320067"
},
{
"name": "SQLPL",
"bytes": "2828"
},
{
"name": "Shell",
"bytes": "241"
}
],
"symlink_target": ""
}
|
include_recipe 'apache2'
include_recipe 'apache2::mod_rewrite'
# apache2のレシピを読み込んで、デフォルトのVirtualHostを無効にする。
execute "a2dissite default"
# コピーしたVirtualHostのテンプレートを設定する。
web_app node['product_name'] do
server_name node['hostname']
server_aliases [node['fqdn'], node['product_name']]
docroot "/vagrant/app/webroot/"
allow_override "All"
end
|
{
"content_hash": "93d0f27db886700cf6ba60f71063195b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 22.8125,
"alnum_prop": 0.726027397260274,
"repo_name": "muneando/chef-cakephp-cookbook",
"id": "74832c1c7633fb33180bcd6238a3ea7f06821562",
"size": "580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "site-cookbooks/cakephp/recipes/apache.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "10807"
}
],
"symlink_target": ""
}
|
package io.netty.channel.epoll;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelException;
import io.netty.channel.ChannelOption;
import io.netty.channel.MessageSizeEstimator;
import io.netty.channel.RecvByteBufAllocator;
import io.netty.channel.socket.SocketChannelConfig;
import io.netty.util.internal.PlatformDependent;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Map;
import static io.netty.channel.ChannelOption.*;
public final class EpollSocketChannelConfig extends EpollChannelConfig implements SocketChannelConfig {
private static final long MAX_UINT32_T = 0xFFFFFFFFL;
private final EpollSocketChannel channel;
private volatile boolean allowHalfClosure;
/**
* Creates a new instance.
*/
EpollSocketChannelConfig(EpollSocketChannel channel) {
super(channel);
this.channel = channel;
if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
setTcpNoDelay(true);
}
// Make it consistent with NIO.
setMaxMessagesPerRead(16);
}
@Override
public Map<ChannelOption<?>, Object> getOptions() {
return getOptions(
super.getOptions(),
SO_RCVBUF, SO_SNDBUF, TCP_NODELAY, SO_KEEPALIVE, SO_REUSEADDR, SO_LINGER, IP_TOS,
ALLOW_HALF_CLOSURE, EpollChannelOption.TCP_CORK, EpollChannelOption.TCP_NOTSENT_LOWAT,
EpollChannelOption.TCP_KEEPCNT, EpollChannelOption.TCP_KEEPIDLE, EpollChannelOption.TCP_KEEPINTVL,
EpollChannelOption.TCP_MD5SIG, EpollChannelOption.TCP_QUICKACK);
}
@SuppressWarnings("unchecked")
@Override
public <T> T getOption(ChannelOption<T> option) {
if (option == SO_RCVBUF) {
return (T) Integer.valueOf(getReceiveBufferSize());
}
if (option == SO_SNDBUF) {
return (T) Integer.valueOf(getSendBufferSize());
}
if (option == TCP_NODELAY) {
return (T) Boolean.valueOf(isTcpNoDelay());
}
if (option == SO_KEEPALIVE) {
return (T) Boolean.valueOf(isKeepAlive());
}
if (option == SO_REUSEADDR) {
return (T) Boolean.valueOf(isReuseAddress());
}
if (option == SO_LINGER) {
return (T) Integer.valueOf(getSoLinger());
}
if (option == IP_TOS) {
return (T) Integer.valueOf(getTrafficClass());
}
if (option == ALLOW_HALF_CLOSURE) {
return (T) Boolean.valueOf(isAllowHalfClosure());
}
if (option == EpollChannelOption.TCP_CORK) {
return (T) Boolean.valueOf(isTcpCork());
}
if (option == EpollChannelOption.TCP_NOTSENT_LOWAT) {
return (T) Long.valueOf(getTcpNotSentLowAt());
}
if (option == EpollChannelOption.TCP_KEEPIDLE) {
return (T) Integer.valueOf(getTcpKeepIdle());
}
if (option == EpollChannelOption.TCP_KEEPINTVL) {
return (T) Integer.valueOf(getTcpKeepIntvl());
}
if (option == EpollChannelOption.TCP_KEEPCNT) {
return (T) Integer.valueOf(getTcpKeepCnt());
}
if (option == EpollChannelOption.TCP_USER_TIMEOUT) {
return (T) Integer.valueOf(getTcpUserTimeout());
}
if (option == EpollChannelOption.TCP_QUICKACK) {
return (T) Boolean.valueOf(isTcpQuickAck());
}
return super.getOption(option);
}
@Override
public <T> boolean setOption(ChannelOption<T> option, T value) {
validate(option, value);
if (option == SO_RCVBUF) {
setReceiveBufferSize((Integer) value);
} else if (option == SO_SNDBUF) {
setSendBufferSize((Integer) value);
} else if (option == TCP_NODELAY) {
setTcpNoDelay((Boolean) value);
} else if (option == SO_KEEPALIVE) {
setKeepAlive((Boolean) value);
} else if (option == SO_REUSEADDR) {
setReuseAddress((Boolean) value);
} else if (option == SO_LINGER) {
setSoLinger((Integer) value);
} else if (option == IP_TOS) {
setTrafficClass((Integer) value);
} else if (option == ALLOW_HALF_CLOSURE) {
setAllowHalfClosure((Boolean) value);
} else if (option == EpollChannelOption.TCP_CORK) {
setTcpCork((Boolean) value);
} else if (option == EpollChannelOption.TCP_NOTSENT_LOWAT) {
setTcpNotSentLowAt((Long) value);
} else if (option == EpollChannelOption.TCP_KEEPIDLE) {
setTcpKeepIdle((Integer) value);
} else if (option == EpollChannelOption.TCP_KEEPCNT) {
setTcpKeepCnt((Integer) value);
} else if (option == EpollChannelOption.TCP_KEEPINTVL) {
setTcpKeepIntvl((Integer) value);
} else if (option == EpollChannelOption.TCP_USER_TIMEOUT) {
setTcpUserTimeout((Integer) value);
} else if (option == EpollChannelOption.TCP_MD5SIG) {
@SuppressWarnings("unchecked")
final Map<InetAddress, byte[]> m = (Map<InetAddress, byte[]>) value;
setTcpMd5Sig(m);
} else if (option == EpollChannelOption.TCP_QUICKACK) {
setTcpQuickAck((Boolean) value);
} else {
return super.setOption(option, value);
}
return true;
}
@Override
public int getReceiveBufferSize() {
try {
return channel.fd().getReceiveBufferSize();
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public int getSendBufferSize() {
try {
return channel.fd().getSendBufferSize();
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public int getSoLinger() {
try {
return channel.fd().getSoLinger();
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public int getTrafficClass() {
try {
return Native.getTrafficClass(channel.fd().intValue());
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public boolean isKeepAlive() {
try {
return channel.fd().isKeepAlive();
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public boolean isReuseAddress() {
try {
return Native.isReuseAddress(channel.fd().intValue()) == 1;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public boolean isTcpNoDelay() {
try {
return channel.fd().isTcpNoDelay();
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Get the {@code TCP_CORK} option on the socket. See {@code man 7 tcp} for more details.
*/
public boolean isTcpCork() {
try {
return channel.fd().isTcpCork();
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Get the {@code TCP_NOTSENT_LOWAT} option on the socket. See {@code man 7 tcp} for more details.
* @return value is a uint32_t
*/
public long getTcpNotSentLowAt() {
try {
return Native.getTcpNotSentLowAt(channel.fd().intValue()) & MAX_UINT32_T;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Get the {@code TCP_KEEPIDLE} option on the socket. See {@code man 7 tcp} for more details.
*/
public int getTcpKeepIdle() {
try {
return Native.getTcpKeepIdle(channel.fd().intValue());
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Get the {@code TCP_KEEPINTVL} option on the socket. See {@code man 7 tcp} for more details.
*/
public int getTcpKeepIntvl() {
try {
return Native.getTcpKeepIntvl(channel.fd().intValue());
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Get the {@code TCP_KEEPCNT} option on the socket. See {@code man 7 tcp} for more details.
*/
public int getTcpKeepCnt() {
try {
return Native.getTcpKeepCnt(channel.fd().intValue());
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Get the {@code TCP_USER_TIMEOUT} option on the socket. See {@code man 7 tcp} for more details.
*/
public int getTcpUserTimeout() {
try {
return Native.getTcpUserTimeout(channel.fd().intValue());
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setKeepAlive(boolean keepAlive) {
try {
channel.fd().setKeepAlive(keepAlive);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setPerformancePreferences(
int connectionTime, int latency, int bandwidth) {
return this;
}
@Override
public EpollSocketChannelConfig setReceiveBufferSize(int receiveBufferSize) {
try {
channel.fd().setReceiveBufferSize(receiveBufferSize);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setReuseAddress(boolean reuseAddress) {
try {
Native.setReuseAddress(channel.fd().intValue(), reuseAddress ? 1 : 0);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setSendBufferSize(int sendBufferSize) {
try {
channel.fd().setSendBufferSize(sendBufferSize);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setSoLinger(int soLinger) {
try {
channel.fd().setSoLinger(soLinger);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setTcpNoDelay(boolean tcpNoDelay) {
try {
channel.fd().setTcpNoDelay(tcpNoDelay);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_CORK} option on the socket. See {@code man 7 tcp} for more details.
*/
public EpollSocketChannelConfig setTcpCork(boolean tcpCork) {
try {
channel.fd().setTcpCork(tcpCork);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_NOTSENT_LOWAT} option on the socket. See {@code man 7 tcp} for more details.
* @param tcpNotSentLowAt is a uint32_t
*/
public EpollSocketChannelConfig setTcpNotSentLowAt(long tcpNotSentLowAt) {
if (tcpNotSentLowAt < 0 || tcpNotSentLowAt > MAX_UINT32_T) {
throw new IllegalArgumentException("tcpNotSentLowAt must be a uint32_t");
}
try {
Native.setTcpNotSentLowAt(channel.fd().intValue(), (int) tcpNotSentLowAt);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public EpollSocketChannelConfig setTrafficClass(int trafficClass) {
try {
Native.setTrafficClass(channel.fd().intValue(), trafficClass);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_KEEPIDLE} option on the socket. See {@code man 7 tcp} for more details.
*/
public EpollSocketChannelConfig setTcpKeepIdle(int seconds) {
try {
Native.setTcpKeepIdle(channel.fd().intValue(), seconds);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_KEEPINTVL} option on the socket. See {@code man 7 tcp} for more details.
*/
public EpollSocketChannelConfig setTcpKeepIntvl(int seconds) {
try {
Native.setTcpKeepIntvl(channel.fd().intValue(), seconds);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* @deprecated use {@link #setTcpKeepCnt(int)}
*/
@Deprecated
public EpollSocketChannelConfig setTcpKeepCntl(int probes) {
return setTcpKeepCnt(probes);
}
/**
* Set the {@code TCP_KEEPCNT} option on the socket. See {@code man 7 tcp} for more details.
*/
public EpollSocketChannelConfig setTcpKeepCnt(int probes) {
try {
Native.setTcpKeepCnt(channel.fd().intValue(), probes);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_USER_TIMEOUT} option on the socket. See {@code man 7 tcp} for more details.
*/
public EpollSocketChannelConfig setTcpUserTimeout(int milliseconds) {
try {
Native.setTcpUserTimeout(channel.fd().intValue(), milliseconds);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_MD5SIG} option on the socket. See {@code linux/tcp.h} for more details.
* Keys can only be set on, not read to prevent a potential leak, as they are confidential.
* Allowing them being read would mean anyone with access to the channel could get them.
*/
public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) {
try {
channel.setTcpMd5Sig(keys);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Set the {@code TCP_QUICKACK} option on the socket. See <a href="http://linux.die.net/man/7/tcp">TCP_QUICKACK</a>
* for more details.
*/
public EpollSocketChannelConfig setTcpQuickAck(boolean quickAck) {
try {
channel.fd().setTcpQuickAck(quickAck);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
/**
* Returns {@code true} if <a href="http://linux.die.net/man/7/tcp">TCP_QUICKACK</a> is enabled,
* {@code false} otherwise.
*/
public boolean isTcpQuickAck() {
try {
return channel.fd().isTcpQuickAck();
} catch (IOException e) {
throw new ChannelException(e);
}
}
@Override
public boolean isAllowHalfClosure() {
return allowHalfClosure;
}
@Override
public EpollSocketChannelConfig setAllowHalfClosure(boolean allowHalfClosure) {
this.allowHalfClosure = allowHalfClosure;
return this;
}
@Override
public EpollSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis) {
super.setConnectTimeoutMillis(connectTimeoutMillis);
return this;
}
@Override
public EpollSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead) {
super.setMaxMessagesPerRead(maxMessagesPerRead);
return this;
}
@Override
public EpollSocketChannelConfig setWriteSpinCount(int writeSpinCount) {
super.setWriteSpinCount(writeSpinCount);
return this;
}
@Override
public EpollSocketChannelConfig setAllocator(ByteBufAllocator allocator) {
super.setAllocator(allocator);
return this;
}
@Override
public EpollSocketChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) {
super.setRecvByteBufAllocator(allocator);
return this;
}
@Override
public EpollSocketChannelConfig setAutoRead(boolean autoRead) {
super.setAutoRead(autoRead);
return this;
}
@Override
public EpollSocketChannelConfig setAutoClose(boolean autoClose) {
super.setAutoClose(autoClose);
return this;
}
@Override
public EpollSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
return this;
}
@Override
public EpollSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
return this;
}
@Override
public EpollSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
super.setMessageSizeEstimator(estimator);
return this;
}
@Override
public EpollSocketChannelConfig setEpollMode(EpollMode mode) {
super.setEpollMode(mode);
return this;
}
}
|
{
"content_hash": "eb91bb39b125eff0e1f86d9c16ef33e6",
"timestamp": "",
"source": "github",
"line_count": 548,
"max_line_length": 119,
"avg_line_length": 31.516423357664234,
"alnum_prop": 0.6006021654797059,
"repo_name": "imangry/netty-zh",
"id": "b9d90fc57e2e500b8251d2df18d08aff41fa0305",
"size": "17905",
"binary": false,
"copies": "2",
"ref": "refs/heads/4.0",
"path": "transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "99310"
},
{
"name": "C++",
"bytes": "1637"
},
{
"name": "CSS",
"bytes": "49"
},
{
"name": "HTML",
"bytes": "1466"
},
{
"name": "Java",
"bytes": "8721303"
},
{
"name": "Shell",
"bytes": "7879"
}
],
"symlink_target": ""
}
|
package http
import (
"go-common/library/log"
bm "go-common/library/net/http/blademaster"
)
func paramInsert(c *bm.Context) {
v := new(struct {
Name string `form:"name"`
Value int `form:"value"`
Remark string `form:"remark"`
})
if err := c.Bind(v); err != nil {
return
}
err := svr.InsertParameter(c, v.Name, v.Remark, v.Value)
if err != nil {
log.Error("svr.InsertParameter error(%v)", err)
}
c.JSON(nil, err)
}
|
{
"content_hash": "eb0d8043cd55e93c8a26eab5c22918d4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 57,
"avg_line_length": 20.045454545454547,
"alnum_prop": 0.6326530612244898,
"repo_name": "LQJJ/demo",
"id": "4142894119194ba2d58e0e55edbb065a9f2dc67d",
"size": "441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "126-go-common-master/app/admin/main/up-rating/http/parameter.go",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5910716"
},
{
"name": "C++",
"bytes": "113072"
},
{
"name": "CSS",
"bytes": "10791"
},
{
"name": "Dockerfile",
"bytes": "934"
},
{
"name": "Go",
"bytes": "40121403"
},
{
"name": "Groovy",
"bytes": "347"
},
{
"name": "HTML",
"bytes": "359263"
},
{
"name": "JavaScript",
"bytes": "545384"
},
{
"name": "Makefile",
"bytes": "6671"
},
{
"name": "Mathematica",
"bytes": "14565"
},
{
"name": "Objective-C",
"bytes": "14900720"
},
{
"name": "Objective-C++",
"bytes": "20070"
},
{
"name": "PureBasic",
"bytes": "4152"
},
{
"name": "Python",
"bytes": "4490569"
},
{
"name": "Ruby",
"bytes": "44850"
},
{
"name": "Shell",
"bytes": "33251"
},
{
"name": "Swift",
"bytes": "463286"
},
{
"name": "TSQL",
"bytes": "108861"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main"><source path="C:\Users\HurshidHP\StudioProjects\BLEDevice_1.0\BLEdevice\Application\tests\assets"/></dataSet></merger>
|
{
"content_hash": "17a99ce28ba372ea42536a5f48c6aef7",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 161,
"avg_line_length": 100,
"alnum_prop": 0.745,
"repo_name": "yujboss/BLEdevice",
"id": "61bc8343a7eeae5dfde94307084a5d594bd88b4d",
"size": "200",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Application/build/intermediates/incremental/mergeAssets/androidTest/debug/merger.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "113387"
}
],
"symlink_target": ""
}
|
namespace google_breakpad {
// This is passed as the context to the MinidumpWriteDump callback.
typedef struct {
AppMemoryList::const_iterator iter;
AppMemoryList::const_iterator end;
} MinidumpCallbackContext;
// This define is new to Windows 10.
#ifndef DBG_PRINTEXCEPTION_WIDE_C
#define DBG_PRINTEXCEPTION_WIDE_C ((DWORD)0x4001000A)
#endif
vector<ExceptionHandler*>* ExceptionHandler::handler_stack_ = NULL;
LONG ExceptionHandler::handler_stack_index_ = 0;
CRITICAL_SECTION ExceptionHandler::handler_stack_critical_section_;
volatile LONG ExceptionHandler::instance_count_ = 0;
ExceptionHandler::ExceptionHandler(const wstring& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
int handler_types,
MINIDUMP_TYPE dump_type,
const wchar_t* pipe_name,
const CustomClientInfo* custom_info) {
Initialize(dump_path,
filter,
callback,
callback_context,
handler_types,
dump_type,
pipe_name,
NULL, // pipe_handle
NULL, // crash_generation_client
custom_info);
}
ExceptionHandler::ExceptionHandler(const wstring& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
int handler_types,
MINIDUMP_TYPE dump_type,
HANDLE pipe_handle,
const CustomClientInfo* custom_info) {
Initialize(dump_path,
filter,
callback,
callback_context,
handler_types,
dump_type,
NULL, // pipe_name
pipe_handle,
NULL, // crash_generation_client
custom_info);
}
ExceptionHandler::ExceptionHandler(
const wstring& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
int handler_types,
CrashGenerationClient* crash_generation_client) {
// The dump_type, pipe_name and custom_info that are passed in to Initialize()
// are not used. The ones set in crash_generation_client are used instead.
Initialize(dump_path,
filter,
callback,
callback_context,
handler_types,
MiniDumpNormal, // dump_type - not used
NULL, // pipe_name - not used
NULL, // pipe_handle
crash_generation_client,
NULL); // custom_info - not used
}
ExceptionHandler::ExceptionHandler(const wstring &dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
int handler_types) {
Initialize(dump_path,
filter,
callback,
callback_context,
handler_types,
MiniDumpNormal,
NULL, // pipe_name
NULL, // pipe_handle
NULL, // crash_generation_client
NULL); // custom_info
}
void ExceptionHandler::Initialize(
const wstring& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
int handler_types,
MINIDUMP_TYPE dump_type,
const wchar_t* pipe_name,
HANDLE pipe_handle,
CrashGenerationClient* crash_generation_client,
const CustomClientInfo* custom_info) {
LONG instance_count = InterlockedIncrement(&instance_count_);
filter_ = filter;
callback_ = callback;
callback_context_ = callback_context;
dump_path_c_ = NULL;
next_minidump_id_c_ = NULL;
next_minidump_path_c_ = NULL;
dbghelp_module_ = NULL;
minidump_write_dump_ = NULL;
dump_type_ = dump_type;
rpcrt4_module_ = NULL;
uuid_create_ = NULL;
handler_types_ = handler_types;
previous_filter_ = NULL;
#if _MSC_VER >= 1400 // MSVC 2005/8
previous_iph_ = NULL;
#endif // _MSC_VER >= 1400
previous_pch_ = NULL;
handler_thread_ = NULL;
is_shutdown_ = false;
handler_start_semaphore_ = NULL;
handler_finish_semaphore_ = NULL;
requesting_thread_id_ = 0;
exception_info_ = NULL;
assertion_ = NULL;
handler_return_value_ = false;
handle_debug_exceptions_ = false;
consume_invalid_handle_exceptions_ = false;
// Attempt to use out-of-process if user has specified a pipe or a
// crash generation client.
scoped_ptr<CrashGenerationClient> client;
if (crash_generation_client) {
client.reset(crash_generation_client);
} else if (pipe_name) {
client.reset(
new CrashGenerationClient(pipe_name, dump_type_, custom_info));
} else if (pipe_handle) {
client.reset(
new CrashGenerationClient(pipe_handle, dump_type_, custom_info));
}
if (client.get() != NULL) {
// If successful in registering with the monitoring process,
// there is no need to setup in-process crash generation.
if (client->Register()) {
crash_generation_client_.reset(client.release());
}
}
if (!IsOutOfProcess()) {
// Either client did not ask for out-of-process crash generation
// or registration with the server process failed. In either case,
// setup to do in-process crash generation.
// Set synchronization primitives and the handler thread. Each
// ExceptionHandler object gets its own handler thread because that's the
// only way to reliably guarantee sufficient stack space in an exception,
// and it allows an easy way to get a snapshot of the requesting thread's
// context outside of an exception.
InitializeCriticalSection(&handler_critical_section_);
handler_start_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL);
assert(handler_start_semaphore_ != NULL);
handler_finish_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL);
assert(handler_finish_semaphore_ != NULL);
// Don't attempt to create the thread if we could not create the semaphores.
if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) {
DWORD thread_id;
const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
handler_thread_ = CreateThread(NULL, // lpThreadAttributes
kExceptionHandlerThreadInitialStackSize,
ExceptionHandlerThreadMain,
this, // lpParameter
0, // dwCreationFlags
&thread_id);
assert(handler_thread_ != NULL);
}
dbghelp_module_ = LoadLibrary(L"dbghelp.dll");
if (dbghelp_module_) {
minidump_write_dump_ = reinterpret_cast<MiniDumpWriteDump_type>(
GetProcAddress(dbghelp_module_, "MiniDumpWriteDump"));
}
// Load this library dynamically to not affect existing projects. Most
// projects don't link against this directly, it's usually dynamically
// loaded by dependent code.
rpcrt4_module_ = LoadLibrary(L"rpcrt4.dll");
if (rpcrt4_module_) {
uuid_create_ = reinterpret_cast<UuidCreate_type>(
GetProcAddress(rpcrt4_module_, "UuidCreate"));
}
// set_dump_path calls UpdateNextID. This sets up all of the path and id
// strings, and their equivalent c_str pointers.
set_dump_path(dump_path);
}
// Reserve one element for the instruction memory
AppMemory instruction_memory;
instruction_memory.ptr = NULL;
instruction_memory.length = 0;
app_memory_info_.push_back(instruction_memory);
// There is a race condition here. If the first instance has not yet
// initialized the critical section, the second (and later) instances may
// try to use uninitialized critical section object. The feature of multiple
// instances in one module is not used much, so leave it as is for now.
// One way to solve this in the current design (that is, keeping the static
// handler stack) is to use spin locks with volatile bools to synchronize
// the handler stack. This works only if the compiler guarantees to generate
// cache coherent code for volatile.
// TODO(munjal): Fix this in a better way by changing the design if possible.
// Lazy initialization of the handler_stack_critical_section_
if (instance_count == 1) {
InitializeCriticalSection(&handler_stack_critical_section_);
}
if (handler_types != HANDLER_NONE) {
EnterCriticalSection(&handler_stack_critical_section_);
// The first time an ExceptionHandler that installs a handler is
// created, set up the handler stack.
if (!handler_stack_) {
handler_stack_ = new vector<ExceptionHandler*>();
}
handler_stack_->push_back(this);
if (handler_types & HANDLER_EXCEPTION)
previous_filter_ = SetUnhandledExceptionFilter(HandleException);
#if _MSC_VER >= 1400 // MSVC 2005/8
if (handler_types & HANDLER_INVALID_PARAMETER)
previous_iph_ = _set_invalid_parameter_handler(HandleInvalidParameter);
#endif // _MSC_VER >= 1400
if (handler_types & HANDLER_PURECALL)
previous_pch_ = _set_purecall_handler(HandlePureVirtualCall);
LeaveCriticalSection(&handler_stack_critical_section_);
}
}
ExceptionHandler::~ExceptionHandler() {
if (dbghelp_module_) {
FreeLibrary(dbghelp_module_);
}
if (rpcrt4_module_) {
FreeLibrary(rpcrt4_module_);
}
if (handler_types_ != HANDLER_NONE) {
EnterCriticalSection(&handler_stack_critical_section_);
if (handler_types_ & HANDLER_EXCEPTION)
SetUnhandledExceptionFilter(previous_filter_);
#if _MSC_VER >= 1400 // MSVC 2005/8
if (handler_types_ & HANDLER_INVALID_PARAMETER)
_set_invalid_parameter_handler(previous_iph_);
#endif // _MSC_VER >= 1400
if (handler_types_ & HANDLER_PURECALL)
_set_purecall_handler(previous_pch_);
if (handler_stack_->back() == this) {
handler_stack_->pop_back();
} else {
// TODO(mmentovai): use advapi32!ReportEvent to log the warning to the
// system's application event log.
fprintf(stderr, "warning: removing Breakpad handler out of order\n");
vector<ExceptionHandler*>::iterator iterator = handler_stack_->begin();
while (iterator != handler_stack_->end()) {
if (*iterator == this) {
iterator = handler_stack_->erase(iterator);
} else {
++iterator;
}
}
}
if (handler_stack_->empty()) {
// When destroying the last ExceptionHandler that installed a handler,
// clean up the handler stack.
delete handler_stack_;
handler_stack_ = NULL;
}
LeaveCriticalSection(&handler_stack_critical_section_);
}
// Some of the objects were only initialized if out of process
// registration was not done.
if (!IsOutOfProcess()) {
#ifdef BREAKPAD_NO_TERMINATE_THREAD
// Clean up the handler thread and synchronization primitives. The handler
// thread is either waiting on the semaphore to handle a crash or it is
// handling a crash. Coming out of the wait is fast but wait more in the
// eventuality a crash is handled. This compilation option results in a
// deadlock if the exception handler is destroyed while executing code
// inside DllMain.
is_shutdown_ = true;
ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
const int kWaitForHandlerThreadMs = 60000;
WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs);
#else
TerminateThread(handler_thread_, 1);
#endif // BREAKPAD_NO_TERMINATE_THREAD
CloseHandle(handler_thread_);
handler_thread_ = NULL;
DeleteCriticalSection(&handler_critical_section_);
CloseHandle(handler_start_semaphore_);
CloseHandle(handler_finish_semaphore_);
}
// There is a race condition in the code below: if this instance is
// deleting the static critical section and a new instance of the class
// is created, then there is a possibility that the critical section be
// initialized while the same critical section is being deleted. Given the
// usage pattern for the code, this race condition is unlikely to hit, but it
// is a race condition nonetheless.
if (InterlockedDecrement(&instance_count_) == 0) {
DeleteCriticalSection(&handler_stack_critical_section_);
}
}
bool ExceptionHandler::RequestUpload(DWORD crash_id) {
return crash_generation_client_->RequestUpload(crash_id);
}
// static
DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter);
assert(self);
assert(self->handler_start_semaphore_ != NULL);
assert(self->handler_finish_semaphore_ != NULL);
for (;;) {
if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) ==
WAIT_OBJECT_0) {
// Perform the requested action.
if (self->is_shutdown_) {
// The instance of the exception handler is being destroyed.
break;
} else {
self->handler_return_value_ =
self->WriteMinidumpWithException(self->requesting_thread_id_,
self->exception_info_,
self->assertion_);
}
// Allow the requesting thread to proceed.
ReleaseSemaphore(self->handler_finish_semaphore_, 1, NULL);
}
}
// This statement is not reached when the thread is unconditionally
// terminated by the ExceptionHandler destructor.
return 0;
}
// HandleException and HandleInvalidParameter must create an
// AutoExceptionHandler object to maintain static state and to determine which
// ExceptionHandler instance to use. The constructor locates the correct
// instance, and makes it available through get_handler(). The destructor
// restores the state in effect prior to allocating the AutoExceptionHandler.
class AutoExceptionHandler {
public:
AutoExceptionHandler() {
// Increment handler_stack_index_ so that if another Breakpad handler is
// registered using this same HandleException function, and it needs to be
// called while this handler is running (either because this handler
// declines to handle the exception, or an exception occurs during
// handling), HandleException will find the appropriate ExceptionHandler
// object in handler_stack_ to deliver the exception to.
//
// Because handler_stack_ is addressed in reverse (as |size - index|),
// preincrementing handler_stack_index_ avoids needing to subtract 1 from
// the argument to |at|.
//
// The index is maintained instead of popping elements off of the handler
// stack and pushing them at the end of this method. This avoids ruining
// the order of elements in the stack in the event that some other thread
// decides to manipulate the handler stack (such as creating a new
// ExceptionHandler object) while an exception is being handled.
EnterCriticalSection(&ExceptionHandler::handler_stack_critical_section_);
handler_ = ExceptionHandler::handler_stack_->at(
ExceptionHandler::handler_stack_->size() -
++ExceptionHandler::handler_stack_index_);
// In case another exception occurs while this handler is doing its thing,
// it should be delivered to the previous filter.
SetUnhandledExceptionFilter(handler_->previous_filter_);
#if _MSC_VER >= 1400 // MSVC 2005/8
_set_invalid_parameter_handler(handler_->previous_iph_);
#endif // _MSC_VER >= 1400
_set_purecall_handler(handler_->previous_pch_);
}
~AutoExceptionHandler() {
// Put things back the way they were before entering this handler.
SetUnhandledExceptionFilter(ExceptionHandler::HandleException);
#if _MSC_VER >= 1400 // MSVC 2005/8
_set_invalid_parameter_handler(ExceptionHandler::HandleInvalidParameter);
#endif // _MSC_VER >= 1400
_set_purecall_handler(ExceptionHandler::HandlePureVirtualCall);
--ExceptionHandler::handler_stack_index_;
LeaveCriticalSection(&ExceptionHandler::handler_stack_critical_section_);
}
ExceptionHandler* get_handler() const { return handler_; }
private:
ExceptionHandler* handler_;
};
// static
LONG ExceptionHandler::HandleException(EXCEPTION_POINTERS* exinfo) {
AutoExceptionHandler auto_exception_handler;
ExceptionHandler* current_handler = auto_exception_handler.get_handler();
// Ignore EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP exceptions. This
// logic will short-circuit before calling WriteMinidumpOnHandlerThread,
// allowing something else to handle the breakpoint without incurring the
// overhead transitioning to and from the handler thread. This behavior
// can be overridden by calling ExceptionHandler::set_handle_debug_exceptions.
DWORD code = exinfo->ExceptionRecord->ExceptionCode;
LONG action;
bool is_debug_exception = (code == EXCEPTION_BREAKPOINT) ||
(code == EXCEPTION_SINGLE_STEP) ||
(code == DBG_PRINTEXCEPTION_C) ||
(code == DBG_PRINTEXCEPTION_WIDE_C);
if (code == EXCEPTION_INVALID_HANDLE &&
current_handler->consume_invalid_handle_exceptions_) {
return EXCEPTION_CONTINUE_EXECUTION;
}
bool success = false;
if (!is_debug_exception ||
current_handler->get_handle_debug_exceptions()) {
// If out-of-proc crash handler client is available, we have to use that
// to generate dump and we cannot fall back on in-proc dump generation
// because we never prepared for an in-proc dump generation
// In case of out-of-process dump generation, directly call
// WriteMinidumpWithException since there is no separate thread running.
if (current_handler->IsOutOfProcess()) {
success = current_handler->WriteMinidumpWithException(
GetCurrentThreadId(),
exinfo,
NULL);
} else {
success = current_handler->WriteMinidumpOnHandlerThread(exinfo, NULL);
}
}
// The handler fully handled the exception. Returning
// EXCEPTION_EXECUTE_HANDLER indicates this to the system, and usually
// results in the application being terminated.
//
// Note: If the application was launched from within the Cygwin
// environment, returning EXCEPTION_EXECUTE_HANDLER seems to cause the
// application to be restarted.
if (success) {
action = EXCEPTION_EXECUTE_HANDLER;
} else {
// There was an exception, it was a breakpoint or something else ignored
// above, or it was passed to the handler, which decided not to handle it.
// This could be because the filter callback didn't want it, because
// minidump writing failed for some reason, or because the post-minidump
// callback function indicated failure. Give the previous handler a
// chance to do something with the exception. If there is no previous
// handler, return EXCEPTION_CONTINUE_SEARCH, which will allow a debugger
// or native "crashed" dialog to handle the exception.
if (current_handler->previous_filter_) {
action = current_handler->previous_filter_(exinfo);
} else {
action = EXCEPTION_CONTINUE_SEARCH;
}
}
return action;
}
#if _MSC_VER >= 1400 // MSVC 2005/8
// static
void ExceptionHandler::HandleInvalidParameter(const wchar_t* expression,
const wchar_t* function,
const wchar_t* file,
unsigned int line,
uintptr_t reserved) {
// This is an invalid parameter, not an exception. It's safe to play with
// sprintf here.
AutoExceptionHandler auto_exception_handler;
ExceptionHandler* current_handler = auto_exception_handler.get_handler();
MDRawAssertionInfo assertion;
memset(&assertion, 0, sizeof(assertion));
_snwprintf_s(reinterpret_cast<wchar_t*>(assertion.expression),
sizeof(assertion.expression) / sizeof(assertion.expression[0]),
_TRUNCATE, L"%s", expression);
_snwprintf_s(reinterpret_cast<wchar_t*>(assertion.function),
sizeof(assertion.function) / sizeof(assertion.function[0]),
_TRUNCATE, L"%s", function);
_snwprintf_s(reinterpret_cast<wchar_t*>(assertion.file),
sizeof(assertion.file) / sizeof(assertion.file[0]),
_TRUNCATE, L"%s", file);
assertion.line = line;
assertion.type = MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER;
// Make up an exception record for the current thread and CPU context
// to make it possible for the crash processor to classify these
// as do regular crashes, and to make it humane for developers to
// analyze them.
EXCEPTION_RECORD exception_record = {};
CONTEXT exception_context = {};
EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context };
::RtlCaptureContext(&exception_context);
exception_record.ExceptionCode = STATUS_INVALID_PARAMETER;
// We store pointers to the the expression and function strings,
// and the line as exception parameters to make them easy to
// access by the developer on the far side.
exception_record.NumberParameters = 3;
exception_record.ExceptionInformation[0] =
reinterpret_cast<ULONG_PTR>(&assertion.expression);
exception_record.ExceptionInformation[1] =
reinterpret_cast<ULONG_PTR>(&assertion.file);
exception_record.ExceptionInformation[2] = assertion.line;
bool success = false;
// In case of out-of-process dump generation, directly call
// WriteMinidumpWithException since there is no separate thread running.
if (current_handler->IsOutOfProcess()) {
success = current_handler->WriteMinidumpWithException(
GetCurrentThreadId(),
&exception_ptrs,
&assertion);
} else {
success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs,
&assertion);
}
if (!success) {
if (current_handler->previous_iph_) {
// The handler didn't fully handle the exception. Give it to the
// previous invalid parameter handler.
current_handler->previous_iph_(expression,
function,
file,
line,
reserved);
} else {
// If there's no previous handler, pass the exception back in to the
// invalid parameter handler's core. That's the routine that called this
// function, but now, since this function is no longer registered (and in
// fact, no function at all is registered), this will result in the
// default code path being taken: _CRT_DEBUGGER_HOOK and _invoke_watson.
// Use _invalid_parameter where it exists (in _DEBUG builds) as it passes
// more information through. In non-debug builds, it is not available,
// so fall back to using _invalid_parameter_noinfo. See invarg.c in the
// CRT source.
#ifdef _DEBUG
_invalid_parameter(expression, function, file, line, reserved);
#else // _DEBUG
_invalid_parameter_noinfo();
#endif // _DEBUG
}
}
// The handler either took care of the invalid parameter problem itself,
// or passed it on to another handler. "Swallow" it by exiting, paralleling
// the behavior of "swallowing" exceptions.
exit(0);
}
#endif // _MSC_VER >= 1400
// static
void ExceptionHandler::HandlePureVirtualCall() {
// This is an pure virtual function call, not an exception. It's safe to
// play with sprintf here.
AutoExceptionHandler auto_exception_handler;
ExceptionHandler* current_handler = auto_exception_handler.get_handler();
MDRawAssertionInfo assertion;
memset(&assertion, 0, sizeof(assertion));
assertion.type = MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL;
// Make up an exception record for the current thread and CPU context
// to make it possible for the crash processor to classify these
// as do regular crashes, and to make it humane for developers to
// analyze them.
EXCEPTION_RECORD exception_record = {};
CONTEXT exception_context = {};
EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context };
::RtlCaptureContext(&exception_context);
exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION;
// We store pointers to the the expression and function strings,
// and the line as exception parameters to make them easy to
// access by the developer on the far side.
exception_record.NumberParameters = 3;
exception_record.ExceptionInformation[0] =
reinterpret_cast<ULONG_PTR>(&assertion.expression);
exception_record.ExceptionInformation[1] =
reinterpret_cast<ULONG_PTR>(&assertion.file);
exception_record.ExceptionInformation[2] = assertion.line;
bool success = false;
// In case of out-of-process dump generation, directly call
// WriteMinidumpWithException since there is no separate thread running.
if (current_handler->IsOutOfProcess()) {
success = current_handler->WriteMinidumpWithException(
GetCurrentThreadId(),
&exception_ptrs,
&assertion);
} else {
success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs,
&assertion);
}
if (!success) {
if (current_handler->previous_pch_) {
// The handler didn't fully handle the exception. Give it to the
// previous purecall handler.
current_handler->previous_pch_();
} else {
// If there's no previous handler, return and let _purecall handle it.
// This will just put up an assertion dialog.
return;
}
}
// The handler either took care of the invalid parameter problem itself,
// or passed it on to another handler. "Swallow" it by exiting, paralleling
// the behavior of "swallowing" exceptions.
exit(0);
}
bool ExceptionHandler::WriteMinidumpOnHandlerThread(
EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion) {
EnterCriticalSection(&handler_critical_section_);
// There isn't much we can do if the handler thread
// was not successfully created.
if (handler_thread_ == NULL) {
LeaveCriticalSection(&handler_critical_section_);
return false;
}
// The handler thread should only be created when the semaphores are valid.
assert(handler_start_semaphore_ != NULL);
assert(handler_finish_semaphore_ != NULL);
// Set up data to be passed in to the handler thread.
requesting_thread_id_ = GetCurrentThreadId();
exception_info_ = exinfo;
assertion_ = assertion;
// This causes the handler thread to call WriteMinidumpWithException.
ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
// Wait until WriteMinidumpWithException is done and collect its return value.
WaitForSingleObject(handler_finish_semaphore_, INFINITE);
bool status = handler_return_value_;
// Clean up.
requesting_thread_id_ = 0;
exception_info_ = NULL;
assertion_ = NULL;
LeaveCriticalSection(&handler_critical_section_);
return status;
}
bool ExceptionHandler::WriteMinidump() {
// Make up an exception record for the current thread and CPU context
// to make it possible for the crash processor to classify these
// as do regular crashes, and to make it humane for developers to
// analyze them.
EXCEPTION_RECORD exception_record = {};
CONTEXT exception_context = {};
EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context };
::RtlCaptureContext(&exception_context);
exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION;
return WriteMinidumpForException(&exception_ptrs);
}
bool ExceptionHandler::WriteMinidumpForException(EXCEPTION_POINTERS* exinfo) {
// In case of out-of-process dump generation, directly call
// WriteMinidumpWithException since there is no separate thread running.
if (IsOutOfProcess()) {
return WriteMinidumpWithException(GetCurrentThreadId(),
exinfo,
NULL);
}
bool success = WriteMinidumpOnHandlerThread(exinfo, NULL);
UpdateNextID();
return success;
}
// static
bool ExceptionHandler::WriteMinidump(const wstring &dump_path,
MinidumpCallback callback,
void* callback_context,
MINIDUMP_TYPE dump_type) {
ExceptionHandler handler(dump_path, NULL, callback, callback_context,
HANDLER_NONE, dump_type, (HANDLE)NULL, NULL);
return handler.WriteMinidump();
}
// static
bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
DWORD child_blamed_thread,
const wstring& dump_path,
MinidumpCallback callback,
void* callback_context,
MINIDUMP_TYPE dump_type) {
EXCEPTION_RECORD ex;
CONTEXT ctx;
EXCEPTION_POINTERS exinfo = { NULL, NULL };
// As documented on MSDN, on failure SuspendThread returns (DWORD) -1
const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
DWORD last_suspend_count = kFailedToSuspendThread;
HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
THREAD_QUERY_INFORMATION |
THREAD_SUSPEND_RESUME,
FALSE,
child_blamed_thread);
// This thread may have died already, so not opening the handle is a
// non-fatal error.
if (child_thread_handle != NULL) {
last_suspend_count = SuspendThread(child_thread_handle);
if (last_suspend_count != kFailedToSuspendThread) {
ctx.ContextFlags = CONTEXT_ALL;
if (GetThreadContext(child_thread_handle, &ctx)) {
memset(&ex, 0, sizeof(ex));
ex.ExceptionCode = EXCEPTION_BREAKPOINT;
#if defined(_M_IX86)
ex.ExceptionAddress = reinterpret_cast<PVOID>(ctx.Eip);
#elif defined(_M_X64)
ex.ExceptionAddress = reinterpret_cast<PVOID>(ctx.Rip);
#endif
exinfo.ExceptionRecord = &ex;
exinfo.ContextRecord = &ctx;
}
}
}
ExceptionHandler handler(dump_path, NULL, callback, callback_context,
HANDLER_NONE, dump_type, (HANDLE)NULL, NULL);
bool success = handler.WriteMinidumpWithExceptionForProcess(
child_blamed_thread,
exinfo.ExceptionRecord ? &exinfo : NULL,
NULL, child, false);
if (last_suspend_count != kFailedToSuspendThread) {
ResumeThread(child_thread_handle);
}
CloseHandle(child_thread_handle);
if (callback) {
success = callback(handler.dump_path_c_, handler.next_minidump_id_c_,
callback_context, NULL, NULL, success);
}
return success;
}
bool ExceptionHandler::WriteMinidumpWithException(
DWORD requesting_thread_id,
EXCEPTION_POINTERS* exinfo,
MDRawAssertionInfo* assertion) {
// Give user code a chance to approve or prevent writing a minidump. If the
// filter returns false, don't handle the exception at all. If this method
// was called as a result of an exception, returning false will cause
// HandleException to call any previous handler or return
// EXCEPTION_CONTINUE_SEARCH on the exception thread, allowing it to appear
// as though this handler were not present at all.
if (filter_ && !filter_(callback_context_, exinfo, assertion)) {
return false;
}
bool success = false;
if (IsOutOfProcess()) {
success = crash_generation_client_->RequestDump(exinfo, assertion);
} else {
success = WriteMinidumpWithExceptionForProcess(requesting_thread_id,
exinfo,
assertion,
GetCurrentProcess(),
true);
}
if (callback_) {
// TODO(munjal): In case of out-of-process dump generation, both
// dump_path_c_ and next_minidump_id_ will be NULL. For out-of-process
// scenario, the server process ends up creating the dump path and dump
// id so they are not known to the client.
success = callback_(dump_path_c_, next_minidump_id_c_, callback_context_,
exinfo, assertion, success);
}
return success;
}
// static
BOOL CALLBACK ExceptionHandler::MinidumpWriteDumpCallback(
PVOID context,
const PMINIDUMP_CALLBACK_INPUT callback_input,
PMINIDUMP_CALLBACK_OUTPUT callback_output) {
switch (callback_input->CallbackType) {
case MemoryCallback: {
MinidumpCallbackContext* callback_context =
reinterpret_cast<MinidumpCallbackContext*>(context);
if (callback_context->iter == callback_context->end)
return FALSE;
// Include the specified memory region.
callback_output->MemoryBase = callback_context->iter->ptr;
callback_output->MemorySize = callback_context->iter->length;
callback_context->iter++;
return TRUE;
}
// Include all modules.
case IncludeModuleCallback:
case ModuleCallback:
return TRUE;
// Include all threads.
case IncludeThreadCallback:
case ThreadCallback:
return TRUE;
// Stop receiving cancel callbacks.
case CancelCallback:
callback_output->CheckCancel = FALSE;
callback_output->Cancel = FALSE;
return TRUE;
}
// Ignore other callback types.
return FALSE;
}
bool ExceptionHandler::WriteMinidumpWithExceptionForProcess(
DWORD requesting_thread_id,
EXCEPTION_POINTERS* exinfo,
MDRawAssertionInfo* assertion,
HANDLE process,
bool write_requester_stream) {
bool success = false;
if (minidump_write_dump_) {
HANDLE dump_file = CreateFile(next_minidump_path_c_,
GENERIC_WRITE,
0, // no sharing
NULL,
CREATE_NEW, // fail if exists
FILE_ATTRIBUTE_NORMAL,
NULL);
if (dump_file != INVALID_HANDLE_VALUE) {
MINIDUMP_EXCEPTION_INFORMATION except_info;
except_info.ThreadId = requesting_thread_id;
except_info.ExceptionPointers = exinfo;
except_info.ClientPointers = FALSE;
// Leave room in user_stream_array for possible breakpad and
// assertion info streams.
MINIDUMP_USER_STREAM user_stream_array[2];
MINIDUMP_USER_STREAM_INFORMATION user_streams;
user_streams.UserStreamCount = 0;
user_streams.UserStreamArray = user_stream_array;
if (write_requester_stream) {
// Add an MDRawBreakpadInfo stream to the minidump, to provide
// additional information about the exception handler to the Breakpad
// processor. The information will help the processor determine which
// threads are relevant. The Breakpad processor does not require this
// information but can function better with Breakpad-generated dumps
// when it is present. The native debugger is not harmed by the
// presence of this information.
MDRawBreakpadInfo breakpad_info;
breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID |
MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID;
breakpad_info.dump_thread_id = GetCurrentThreadId();
breakpad_info.requesting_thread_id = requesting_thread_id;
int index = user_streams.UserStreamCount;
user_stream_array[index].Type = MD_BREAKPAD_INFO_STREAM;
user_stream_array[index].BufferSize = sizeof(breakpad_info);
user_stream_array[index].Buffer = &breakpad_info;
++user_streams.UserStreamCount;
}
if (assertion) {
int index = user_streams.UserStreamCount;
user_stream_array[index].Type = MD_ASSERTION_INFO_STREAM;
user_stream_array[index].BufferSize = sizeof(MDRawAssertionInfo);
user_stream_array[index].Buffer = assertion;
++user_streams.UserStreamCount;
}
// Older versions of DbgHelp.dll don't correctly put the memory around
// the faulting instruction pointer into the minidump. This
// callback will ensure that it gets included.
if (exinfo) {
// Find a memory region of 256 bytes centered on the
// faulting instruction pointer.
const ULONG64 instruction_pointer =
#if defined(_M_IX86)
exinfo->ContextRecord->Eip;
#elif defined(_M_AMD64)
exinfo->ContextRecord->Rip;
#elif defined(_M_ARM64)
exinfo->ContextRecord->Pc;
#else
#error Unsupported platform
#endif
MEMORY_BASIC_INFORMATION info;
if (VirtualQueryEx(process,
reinterpret_cast<LPCVOID>(instruction_pointer),
&info,
sizeof(MEMORY_BASIC_INFORMATION)) != 0 &&
info.State == MEM_COMMIT) {
// Attempt to get 128 bytes before and after the instruction
// pointer, but settle for whatever's available up to the
// boundaries of the memory region.
const ULONG64 kIPMemorySize = 256;
ULONG64 base =
(std::max)(reinterpret_cast<ULONG64>(info.BaseAddress),
instruction_pointer - (kIPMemorySize / 2));
ULONG64 end_of_range =
(std::min)(instruction_pointer + (kIPMemorySize / 2),
reinterpret_cast<ULONG64>(info.BaseAddress)
+ info.RegionSize);
ULONG size = static_cast<ULONG>(end_of_range - base);
AppMemory& elt = app_memory_info_.front();
elt.ptr = base;
elt.length = size;
}
}
MinidumpCallbackContext context;
context.iter = app_memory_info_.begin();
context.end = app_memory_info_.end();
// Skip the reserved element if there was no instruction memory
if (context.iter->ptr == 0) {
context.iter++;
}
MINIDUMP_CALLBACK_INFORMATION callback;
callback.CallbackRoutine = MinidumpWriteDumpCallback;
callback.CallbackParam = reinterpret_cast<void*>(&context);
// The explicit comparison to TRUE avoids a warning (C4800).
success = (minidump_write_dump_(process,
GetProcessId(process),
dump_file,
dump_type_,
exinfo ? &except_info : NULL,
&user_streams,
&callback) == TRUE);
CloseHandle(dump_file);
}
}
return success;
}
void ExceptionHandler::UpdateNextID() {
assert(uuid_create_);
UUID id = {0};
if (uuid_create_) {
uuid_create_(&id);
}
next_minidump_id_ = GUIDString::GUIDToWString(&id);
next_minidump_id_c_ = next_minidump_id_.c_str();
wchar_t minidump_path[MAX_PATH];
swprintf(minidump_path, MAX_PATH, L"%s\\%s.dmp",
dump_path_c_, next_minidump_id_c_);
// remove when VC++7.1 is no longer supported
minidump_path[MAX_PATH - 1] = L'\0';
next_minidump_path_ = minidump_path;
next_minidump_path_c_ = next_minidump_path_.c_str();
}
void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) {
AppMemoryList::iterator iter =
std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr);
if (iter != app_memory_info_.end()) {
// Don't allow registering the same pointer twice.
return;
}
AppMemory app_memory;
app_memory.ptr = reinterpret_cast<ULONG64>(ptr);
app_memory.length = static_cast<ULONG>(length);
app_memory_info_.push_back(app_memory);
}
void ExceptionHandler::UnregisterAppMemory(void* ptr) {
AppMemoryList::iterator iter =
std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr);
if (iter != app_memory_info_.end()) {
app_memory_info_.erase(iter);
}
}
} // namespace google_breakpad
|
{
"content_hash": "84c564dd74e306d33faced3a2114537f",
"timestamp": "",
"source": "github",
"line_count": 1041,
"max_line_length": 80,
"avg_line_length": 38.918347742555234,
"alnum_prop": 0.6467147159006763,
"repo_name": "endlessm/chromium-browser",
"id": "ad45b2000b56e8a3e5661d5a410c85e5342eb90a",
"size": "42345",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
using Xamarin.Forms;
using System.Collections.Generic;
namespace DNA.XForms.Sample
{
public class MenuPage : ContentPage
{
readonly List<ViewModels.MenuItem> MenuItems = new List<ViewModels.MenuItem>();
public ListView Menu { get; set; }
public MenuPage ()
{
MenuItems.AddRange (ViewModels.MenuItem.All());
BackgroundColor = ColorHelper.MenuBackgroundColor;
var layout = new StackLayout { Spacing = 0, VerticalOptions = LayoutOptions.FillAndExpand };
var headerText = new ContentView {
Padding = new Thickness(10, 36, 0, 5),
Content = new Xamarin.Forms.Label {
TextColor = Color.White,
Text = "DNA.XForms Sample",
Font = Font.SystemFontOfSize (NamedSize.Medium),
}
};
layout.Children.Add(headerText);
Menu = new ListView {
ItemsSource = MenuItems,
VerticalOptions = LayoutOptions.FillAndExpand,
BackgroundColor = Color.Transparent,
RowHeight = 48,
};
var cell = new DataTemplate(typeof(ImageCell));
cell.SetBinding(TextCell.TextProperty, "Title");
cell.SetBinding(ImageCell.ImageSourceProperty, "Icon");
cell.SetValue(VisualElement.BackgroundColorProperty, Color.Transparent);
Menu.ItemTemplate = cell;
layout.Children.Add(Menu);
this.Content = layout;
}
}
}
|
{
"content_hash": "2238f2e5c9cf188ebf2c3ee45c53545f",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 95,
"avg_line_length": 24.09433962264151,
"alnum_prop": 0.706342991386061,
"repo_name": "Digital-Nomad-Apps/DNA.XForms",
"id": "1a022991b17bd7b2c3b2e0e3e329c806ba743650",
"size": "1279",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DNA.XForms.Sample/Pages/MenuPage.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "81460"
},
{
"name": "Smalltalk",
"bytes": "319"
}
],
"symlink_target": ""
}
|
Widget that let you select regions
## Settings
## Wiring
### Input Endpoints
### Output Endpoints
## Usage
## Reference
- [FIWARE Mashup](https://mashup.lab.fiware.org/)
## Copyright and License
MIT
|
{
"content_hash": "8adae3086576224028516e9dac0aeb81",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 10.947368421052632,
"alnum_prop": 0.6875,
"repo_name": "fidash/widget-selectregion",
"id": "b1b0791300a21ff5b4e9c970617ae182def6cf31",
"size": "225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/doc/index.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1942"
},
{
"name": "HTML",
"bytes": "1639"
},
{
"name": "JavaScript",
"bytes": "14675"
}
],
"symlink_target": ""
}
|
module ActiveScaffold::Actions
module List
def self.included(base)
base.before_filter :list_authorized_filter, :only => [:index, :table, :update_table, :row, :list]
end
def index
list
end
def table
do_list
render(:action => 'list', :layout => false)
end
# This is called when changing pages, sorts and search
def update_table
do_list
respond_to_action(:update_table)
end
# get just a single row
def row
render :partial => 'list_record', :locals => {:record => find_if_allowed(params[:id], :read)}
end
def list
do_list
do_new if active_scaffold_config.list.always_show_create
@record ||= active_scaffold_config.model.new if active_scaffold_config.list.always_show_search
respond_to_action(:list)
end
protected
def list_respond_to_html
render :action => 'list'
end
def list_respond_to_js
render :action => 'list', :layout => false
end
def list_respond_to_xml
render :xml => response_object.to_xml, :content_type => Mime::XML, :status => response_status
end
def list_respond_to_json
render :text => response_object.to_json, :content_type => Mime::JSON, :status => response_status
end
def list_respond_to_yaml
render :text => response_object.to_yaml, :content_type => Mime::YAML, :status => response_status
end
def update_table_respond_to_html
return_to_main
end
def update_table_respond_to_js
render(:partial => 'list')
end
# The actual algorithm to prepare for the list view
def do_list
includes_for_list_columns = active_scaffold_config.list.columns.collect{ |c| c.includes }.flatten.uniq.compact
self.active_scaffold_joins.concat includes_for_list_columns
options = { :sorting => active_scaffold_config.list.user.sorting,
:count_includes => active_scaffold_config.list.user.count_includes }
paginate = (params[:format].nil?) ? (accepts? :html, :js) : ['html', 'js'].include?(params[:format])
if paginate
options.merge!({
:per_page => active_scaffold_config.list.user.per_page,
:page => active_scaffold_config.list.user.page
})
end
page = find_page(options);
if page.items.blank?
page = page.pager.first
active_scaffold_config.list.user.page = 1
end
@page, @records = page, page.items
end
# The default security delegates to ActiveRecordPermissions.
# You may override the method to customize.
def list_authorized?
authorized_for?(:action => :read)
end
private
def list_authorized_filter
raise ActiveScaffold::ActionNotAllowed unless list_authorized?
end
def update_table_formats
(default_formats + active_scaffold_config.formats).uniq
end
def list_formats
(default_formats + active_scaffold_config.formats + active_scaffold_config.list.formats).uniq
end
end
end
|
{
"content_hash": "7810880e7ac15f4151add521fa1f377b",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 116,
"avg_line_length": 31.71578947368421,
"alnum_prop": 0.641885164288085,
"repo_name": "mailserv/mailserv",
"id": "faea0be3dbb76602a27c8131f043d9afebb744ed",
"size": "3013",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "account/vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "2501"
},
{
"name": "CSS",
"bytes": "48827"
},
{
"name": "HTML",
"bytes": "76717"
},
{
"name": "JavaScript",
"bytes": "6967"
},
{
"name": "Nginx",
"bytes": "2883"
},
{
"name": "PHP",
"bytes": "62046"
},
{
"name": "Ruby",
"bytes": "196119"
},
{
"name": "Shell",
"bytes": "27239"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<!--
Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel='import' href='/tracing/extras/importer/trace_code_entry.html'>
<script>
'use strict';
tr.exportTo('tr.e.importer', function() {
// This code is a tracification of:
// devtools/front_end/timeline/TimelineJSProfile.js
function TraceCodeMap() {
this.banks_ = new Map();
}
TraceCodeMap.prototype = {
addEntry(addressHex, size, name, scriptId) {
const entry = new tr.e.importer.TraceCodeEntry(
this.getAddress_(addressHex), size, name, scriptId);
this.addEntry_(addressHex, entry);
},
moveEntry(oldAddressHex, newAddressHex, size) {
const entry = this.getBank_(oldAddressHex)
.removeEntry(this.getAddress_(oldAddressHex));
if (!entry) return;
entry.address = this.getAddress_(newAddressHex);
entry.size = size;
this.addEntry_(newAddressHex, entry);
},
lookupEntry(addressHex) {
return this.getBank_(addressHex)
.lookupEntry(this.getAddress_(addressHex));
},
addEntry_(addressHex, entry) {
// FIXME: Handle bank spanning addresses ...
this.getBank_(addressHex).addEntry(entry);
},
getAddress_(addressHex) {
// 13 hex digits === 52 bits, double mantissa fits 53 bits.
const bankSizeHexDigits = 13;
addressHex = addressHex.slice(2); // cut 0x prefix.
return parseInt(addressHex.slice(-bankSizeHexDigits), 16);
},
getBank_(addressHex) {
addressHex = addressHex.slice(2); // cut 0x prefix.
// 13 hex digits === 52 bits, double mantissa fits 53 bits.
const bankSizeHexDigits = 13;
const maxHexDigits = 16;
const bankName = addressHex.slice(-maxHexDigits, -bankSizeHexDigits);
let bank = this.banks_.get(bankName);
if (!bank) {
bank = new TraceCodeBank();
this.banks_.set(bankName, bank);
}
return bank;
}
};
function TraceCodeBank() {
this.entries_ = [];
}
TraceCodeBank.prototype = {
removeEntry(address) {
// findLowIndexInSortedArray returns 1 for empty. Just handle the
// empty list and bail early.
if (this.entries_.length === 0) return undefined;
const index = tr.b.math.findLowIndexInSortedArray(
this.entries_, function(entry) { return entry.address; }, address);
const entry = this.entries_[index];
if (!entry || entry.address !== address) return undefined;
this.entries_.splice(index, 1);
return entry;
},
lookupEntry(address) {
const index = tr.b.math.findHighIndexInSortedArray(
this.entries_, function(e) { return address - e.address; }) - 1;
const entry = this.entries_[index];
return entry &&
address < entry.address + entry.size ? entry : undefined;
},
addEntry(newEntry) {
// findLowIndexInSortedArray returns 1 for empty list. Just push the
// new address as it's the only item.
if (this.entries_.length === 0) {
this.entries_.push(newEntry);
}
const endAddress = newEntry.address + newEntry.size;
const lastIndex = tr.b.math.findLowIndexInSortedArray(
this.entries_, function(entry) { return entry.address; }, endAddress);
let index;
for (index = lastIndex - 1; index >= 0; --index) {
const entry = this.entries_[index];
const entryEndAddress = entry.address + entry.size;
if (entryEndAddress <= newEntry.address) break;
}
++index;
this.entries_.splice(index, lastIndex - index, newEntry);
}
};
return {
TraceCodeMap,
};
});
</script>
|
{
"content_hash": "857cf8a5deefba7540ede8a743b780ed",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 80,
"avg_line_length": 30.282258064516128,
"alnum_prop": 0.6340878828229028,
"repo_name": "catapult-project/catapult-csm",
"id": "47e6e4e7a0fbecdab4964176fba3699ae5b6890f",
"size": "3755",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tracing/tracing/extras/importer/trace_code_map.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "4902"
},
{
"name": "C++",
"bytes": "43728"
},
{
"name": "CSS",
"bytes": "24873"
},
{
"name": "Go",
"bytes": "80325"
},
{
"name": "HTML",
"bytes": "11817766"
},
{
"name": "JavaScript",
"bytes": "518002"
},
{
"name": "Makefile",
"bytes": "1588"
},
{
"name": "Python",
"bytes": "6207634"
},
{
"name": "Shell",
"bytes": "2558"
}
],
"symlink_target": ""
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace KryptonPaletteExamples.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KryptonPaletteExamples.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
|
{
"content_hash": "26297df6ad302c80ecdd5defecfd7b8e",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 188,
"avg_line_length": 44.57142857142857,
"alnum_prop": 0.6164529914529915,
"repo_name": "ComponentFactory/Krypton",
"id": "2e3a692716b1e2f6ff0007b4e6b2bb0bfa438ebc",
"size": "2810",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Krypton Toolkit Examples/KryptonPalette Examples/Properties/Resources.Designer.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "19637203"
}
],
"symlink_target": ""
}
|
/** @module resolve */
/** for typedoc */
import { find, tail, uniqR, unnestR, inArray } from "../common/common";
import { propEq, not } from "../common/hof";
import { trace } from "../common/trace";
import { services } from "../common/coreservices";
import { resolvePolicies } from "./interface";
import { Resolvable } from "./resolvable";
import { PathUtils } from "../path/pathFactory";
import { stringify } from "../common/strings";
import { isUndefined } from '../common';
var whens = resolvePolicies.when;
var ALL_WHENS = [whens.EAGER, whens.LAZY];
var EAGER_WHENS = [whens.EAGER];
export var NATIVE_INJECTOR_TOKEN = "Native Injector";
/**
* Encapsulates Dependency Injection for a path of nodes
*
* UI-Router states are organized as a tree.
* A nested state has a path of ancestors to the root of the tree.
* When a state is being activated, each element in the path is wrapped as a [[PathNode]].
* A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.
*
* The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.
*/
var ResolveContext = /** @class */ (function () {
function ResolveContext(_path) {
this._path = _path;
}
/** Gets all the tokens found in the resolve context, de-duplicated */
ResolveContext.prototype.getTokens = function () {
return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(uniqR, []);
};
/**
* Gets the Resolvable that matches the token
*
* Gets the last Resolvable that matches the token in this context, or undefined.
* Throws an error if it doesn't exist in the ResolveContext
*/
ResolveContext.prototype.getResolvable = function (token) {
var matching = this._path.map(function (node) { return node.resolvables; })
.reduce(unnestR, [])
.filter(function (r) { return r.token === token; });
return tail(matching);
};
/** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */
ResolveContext.prototype.getPolicy = function (resolvable) {
var node = this.findNode(resolvable);
return resolvable.getPolicy(node.state);
};
/**
* Returns a ResolveContext that includes a portion of this one
*
* Given a state, this method creates a new ResolveContext from this one.
* The new context starts at the first node (root) and stops at the node for the `state` parameter.
*
* #### Why
*
* When a transition is created, the nodes in the "To Path" are injected from a ResolveContext.
* A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.
* The "To State" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).
* This method is used to create a narrower context when injecting ancestor nodes.
*
* @example
* `let ABCD = new ResolveContext([A, B, C, D]);`
*
* Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:
* When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.
* However, `B` should only be able to access resolvables from `A`, `B`.
*
* When resolving for the `B` node, first take the full "To Path" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.
* `let AB = ABCD.subcontext(a)`
*/
ResolveContext.prototype.subContext = function (state) {
return new ResolveContext(PathUtils.subPath(this._path, function (node) { return node.state === state; }));
};
/**
* Adds Resolvables to the node that matches the state
*
* This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).
* The resolvable is added to the node matching the `state` parameter.
*
* These new resolvables are not automatically fetched.
* The calling code should either fetch them, fetch something that depends on them,
* or rely on [[resolvePath]] being called when some state is being entered.
*
* Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.
*
* @param newResolvables the new Resolvables
* @param state Used to find the node to put the resolvable on
*/
ResolveContext.prototype.addResolvables = function (newResolvables, state) {
var node = find(this._path, propEq('state', state));
var keys = newResolvables.map(function (r) { return r.token; });
node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables);
};
/**
* Returns a promise for an array of resolved path Element promises
*
* @param when
* @param trans
* @returns {Promise<any>|any}
*/
ResolveContext.prototype.resolvePath = function (when, trans) {
var _this = this;
if (when === void 0) { when = "LAZY"; }
// This option determines which 'when' policy Resolvables we are about to fetch.
var whenOption = inArray(ALL_WHENS, when) ? when : "LAZY";
// If the caller specified EAGER, only the EAGER Resolvables are fetched.
// if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.`
var matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;
// get the subpath to the state argument, if provided
trace.traceResolvePath(this._path, when, trans);
var matchesPolicy = function (acceptedVals, whenOrAsync) {
return function (resolvable) {
return inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]);
};
};
// Trigger all the (matching) Resolvables in the path
// Reduce all the "WAIT" Resolvables into an array
var promises = this._path.reduce(function (acc, node) {
var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));
var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));
var wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async')));
// For the matching Resolvables, start their async fetch process.
var subContext = _this.subContext(node.state);
var getResult = function (r) { return r.get(subContext, trans)
.then(function (value) { return ({ token: r.token, value: value }); }); };
nowait.forEach(getResult);
return acc.concat(wait.map(getResult));
}, []);
// Wait for all the "WAIT" resolvables
return services.$q.all(promises);
};
ResolveContext.prototype.injector = function () {
return this._injector || (this._injector = new UIInjectorImpl(this));
};
ResolveContext.prototype.findNode = function (resolvable) {
return find(this._path, function (node) { return inArray(node.resolvables, resolvable); });
};
/**
* Gets the async dependencies of a Resolvable
*
* Given a Resolvable, returns its dependencies as a Resolvable[]
*/
ResolveContext.prototype.getDependencies = function (resolvable) {
var _this = this;
var node = this.findNode(resolvable);
// Find which other resolvables are "visible" to the `resolvable` argument
// subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path)
var subPath = PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path;
var availableResolvables = subPath
.reduce(function (acc, _node) { return acc.concat(_node.resolvables); }, []) //all of subpath's resolvables
.filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument
var getDependency = function (token) {
var matching = availableResolvables.filter(function (r) { return r.token === token; });
if (matching.length)
return tail(matching);
var fromInjector = _this.injector().getNative(token);
if (isUndefined(fromInjector)) {
throw new Error("Could not find Dependency Injection token: " + stringify(token));
}
return new Resolvable(token, function () { return fromInjector; }, [], fromInjector);
};
return resolvable.deps.map(getDependency);
};
return ResolveContext;
}());
export { ResolveContext };
var UIInjectorImpl = /** @class */ (function () {
function UIInjectorImpl(context) {
this.context = context;
this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector;
}
UIInjectorImpl.prototype.get = function (token) {
var resolvable = this.context.getResolvable(token);
if (resolvable) {
if (this.context.getPolicy(resolvable).async === 'NOWAIT') {
return resolvable.get(this.context);
}
if (!resolvable.resolved) {
throw new Error("Resolvable async .get() not complete:" + stringify(resolvable.token));
}
return resolvable.data;
}
return this.getNative(token);
};
UIInjectorImpl.prototype.getAsync = function (token) {
var resolvable = this.context.getResolvable(token);
if (resolvable)
return resolvable.get(this.context);
return services.$q.when(this.native.get(token));
};
UIInjectorImpl.prototype.getNative = function (token) {
return this.native && this.native.get(token);
};
return UIInjectorImpl;
}());
//# sourceMappingURL=resolveContext.js.map
|
{
"content_hash": "c6466c041b2a0e2ff29ed0abc4a22e41",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 156,
"avg_line_length": 49.58793969849246,
"alnum_prop": 0.6381232265910012,
"repo_name": "lucionei/chamadotecnico",
"id": "a5e0eb49833496c79131c875f556f7c6b134a060",
"size": "9868",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "chamadosTecnicosFinal-app/node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4187"
},
{
"name": "HTML",
"bytes": "18078"
},
{
"name": "Java",
"bytes": "30643"
},
{
"name": "JavaScript",
"bytes": "23666"
}
],
"symlink_target": ""
}
|
class Fixnum
include BusinessTime
def business_hours
BusinessHours.new(self)
end
alias_method :business_hour, :business_hours
def business_days
BusinessDays.new(self)
end
alias_method :business_day, :business_days
end
|
{
"content_hash": "f9b49ab92d05a23d4c96eaca63d77bf3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 46,
"avg_line_length": 19,
"alnum_prop": 0.7246963562753036,
"repo_name": "chip/business_time",
"id": "cfcb5b5bf8e3134837779302bef9a85b115d9227",
"size": "424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/extensions/fixnum.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "37787"
}
],
"symlink_target": ""
}
|
<div class="user-table-container" [@flyIn]="'active'">
<form class="form-vertical" role="form">
<div class="row">
<div class="col-sm-10">
<div class="input-group">
<input class="form-control" type="text" placeholder="权限组名称">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="fa fa-search" aria-hidden="true"></i> 搜索</button>
</span>
</div>
</div>
<div class="col-sm-2">
<div class="input-group pull-right">
<button type="button" (click)="addPermissionGroupDialog()" pButton icon="fa-external-link-square"
label="创建权限组">
</button>
</div>
</div>
</div>
</form>
<div class="row">
<div class="col-sm-12">
<table class="table table-bordered">
<thead>
<tr>
<th>序号</th>
<th>权限组名称</th>
<th>描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let permissionGroup of permissionGroupArray; let i = index">
<td>{{(permissionGroupsCurrentPage-1) * itemsPerPage + i+1}}</td>
<td>{{permissionGroup.name}}</td>
<td>{{permissionGroup.description}}</td>
<td>
<button pButton type="button" label="删除" icon="fa-times" class="ui-button-danger"></button>
<button pButton type="button" label="修改权限"
(click)="permissionGroupPermissionsDialog(permissionGroup.id)"
icon="fa-pencil-square-o"></button>
<button pButton type="button" label="添加权限" icon="fa-plus"
(click)="addPermissionGroupPermissionsDialog(permissionGroup.id)"></button>
</td>
</tr>
</tbody>
</table>
<p-paginator [rows]="itemsPerPage" [totalRecords]="permissionGroupsTotalCount"
(onPageChange)="permissionGroupsPaginate($event)"></p-paginator>
</div>
</div>
</div>
<p-dialog [(visible)]="displayDialog" modal="modal" [responsive]="true" width="600">
<p-header>创建权限组</p-header>
<form [formGroup]="permissionGroupForm" (ngSubmit)="onSubmit()" class="form-horizontal">
<div class="form-group" [ngClass]="{ 'has-error': formErrors.name}">
<label class="col-sm-2 control-label">权限组名称:</label>
<div class="col-sm-10">
<input formControlName="name" type="text" class="form-control" placeholder="请输入权限组名...">
<div *ngIf="formErrors.name" class="text-danger">
<span>{{formErrors.name}}</span>
</div>
</div>
</div>
<div class="form-group" [ngClass]="{'has-error':formErrors.description}">
<label class="col-sm-2 control-label">权限组描述:</label>
<div class="col-sm-10">
<textarea formControlName="description" class="form-control" cols="40" rows="10"
placeholder="请输入权限组的描述"></textarea>
<div *ngIf="formErrors.description" class="text-danger">
<span>{{formErrors.description}}</span>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" pButton icon="fa-check" [disabled]="!permissionGroupForm.valid || hasSubmit"
label="确定"></button>
<button type="button" pButton icon="fa-close" (click)="display=false" label="取消"></button>
</div>
</div>
</form>
</p-dialog>
<p-dialog [(visible)]="showPermissionsDialog" modal="modal" [responsive]="true" width="600">
<p-header>权限组所拥有的权限</p-header>
<div class="row">
<div class="col-sm-12">
<table class="table table-bordered">
<thead>
<tr>
<th>序号</th>
<th>权限名称</th>
<th>方法</th>
<th>路由</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let permission of permissionArray; let i = index">
<td>{{(currentPage - 1) * itemsPerPage + i+1}}</td>
<td>{{permission.name}}</td>
<td>{{permission.method}}</td>
<td>{{permission.route}}</td>
<td>
<button pButton type="button" label="删除" class="ui-button-danger" icon="fa-times"></button>
</td>
</tr>
</tbody>
</table>
<p-paginator [rows]="itemsPerPage" [totalRecords]="permissionsTotalCount"
(onPageChange)="permissionsPaginate($event)"></p-paginator>
</div>
</div>
</p-dialog>
<p-dialog [(visible)]="showAddPermissionsDialog" modal="modal"
[responsive]="true" width="600">
<p-header>添加权限</p-header>
<div class="row">
<div class="col-sm-12">
<p-dataTable [value]="doNotHavePermissionArray" [(selection)]="addPermissionsSelectionArray" [paginator]="true"
[rows]="10" [pageLinks]="5" [headerCheckboxToggleAllPages]="true"
dataKey="id">
<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
<p-column field="name" header="权限名"></p-column>
<p-column field="method" header="方法"></p-column>
<p-column field="route" header="路由"></p-column>
</p-dataTable>
</div>
</div>
<p-footer>
<button type="button" (click)="addPermissionSubmit(pg_id)" pButton icon="fa-check"
[disabled]="addPermissionsSelectionArray.length === 0 || hasSubmit"
label="确定"></button>
<button type="button" pButton icon="fa-close" (click)="showAddPermissionsDialog=false" label="取消"></button>
</p-footer>
</p-dialog>
|
{
"content_hash": "16aac4dc1b6b2b7459737525972ee4fd",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 129,
"avg_line_length": 39.84892086330935,
"alnum_prop": 0.5649034121682615,
"repo_name": "bulabulaka/Studio",
"id": "aa2c6f85b0fdcb53d8e4fcc18a00f361f5063175",
"size": "5755",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/client/app/permission/permission-group/permission-group.component.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22660"
},
{
"name": "HTML",
"bytes": "30279"
},
{
"name": "SQLPL",
"bytes": "7906"
},
{
"name": "TypeScript",
"bytes": "265215"
}
],
"symlink_target": ""
}
|
'use strict';
const common = require('../common');
const bench = common.createBenchmark(main, {
n: [1e5],
});
function main({ n }) {
bench.start();
for (var i = 0; i < n; i++) {
// Access every item in object to process values.
Object.keys(process.env);
}
bench.end(n);
}
|
{
"content_hash": "22b3607bd846791e863890b80c0d4b5a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 17.294117647058822,
"alnum_prop": 0.5884353741496599,
"repo_name": "MTASZTAKI/ApertusVR",
"id": "a332d3cbd61895159460a6de98b873a345f08ee5",
"size": "294",
"binary": false,
"copies": "1",
"ref": "refs/heads/0.9",
"path": "plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/benchmark/process/bench-env.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "7599"
},
{
"name": "C++",
"bytes": "1207412"
},
{
"name": "CMake",
"bytes": "165066"
},
{
"name": "CSS",
"bytes": "1816"
},
{
"name": "GLSL",
"bytes": "223507"
},
{
"name": "HLSL",
"bytes": "141879"
},
{
"name": "HTML",
"bytes": "34827"
},
{
"name": "JavaScript",
"bytes": "140550"
},
{
"name": "Python",
"bytes": "1370"
}
],
"symlink_target": ""
}
|
module WithoutTimestamp
extend ActiveSupport::Concern
def without_timestamps
old = ActiveRecord::Base.record_timestamps
ActiveRecord::Base.record_timestamps = false
begin
yield
ensure
ActiveRecord::Base.record_timestamps = old
end
end
end
|
{
"content_hash": "a00d9ca014bd44850bad7fc2a6067d33",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 48,
"avg_line_length": 19.857142857142858,
"alnum_prop": 0.7194244604316546,
"repo_name": "itedd/itedd",
"id": "e8d31fcec2a2aa0a1606d5420b2a54e35f6ecbc5",
"size": "278",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/concerns/without_timestamp.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "52697"
},
{
"name": "CoffeeScript",
"bytes": "1989"
},
{
"name": "HTML",
"bytes": "30828"
},
{
"name": "JavaScript",
"bytes": "802"
},
{
"name": "Ruby",
"bytes": "91743"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_25) on Mon Apr 06 10:05:38 PDT 2015 -->
<title>com.github.lookout.whoas Class Hierarchy (whoas 0.3.0 API)</title>
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.github.lookout.whoas Class Hierarchy (whoas 0.3.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../com/github/lookout/whoas/package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/github/lookout/whoas/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Hierarchy For Package com.github.lookout.whoas</h1>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.Object
<ul>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/AbstractHookQueue.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">AbstractHookQueue</span></a>
<ul>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/InMemoryQueue.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">InMemoryQueue</span></a></li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/RedisQueue.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">RedisQueue</span></a></li>
</ul>
</li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/AbstractHookRunner.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">AbstractHookRunner</span></a>
<ul>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/SequentialHookRunner.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">SequentialHookRunner</span></a></li>
</ul>
</li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/HookRequest.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">HookRequest</span></a></li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/Publisher.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">Publisher</span></a></li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/WhoasFactory.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">WhoasFactory</span></a></li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/WhoasQueueConfig.html" title="class in com.github.lookout.whoas"><span class="typeNameLink">WhoasQueueConfig</span></a></li>
</ul>
</li>
</ul>
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<ul>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/QueueAction.html" title="interface in com.github.lookout.whoas"><span class="typeNameLink">QueueAction</span></a></li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/RedisQueueAction.html" title="interface in com.github.lookout.whoas"><span class="typeNameLink">RedisQueueAction</span></a><T></li>
<li type="circle">com.github.lookout.whoas.<a href="../../../../com/github/lookout/whoas/WhoasConfiguration.html" title="interface in com.github.lookout.whoas"><span class="typeNameLink">WhoasConfiguration</span></a><T></li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../com/github/lookout/whoas/package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/github/lookout/whoas/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"content_hash": "5b06add8369b0dab3ba85587a99096d4",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 230,
"avg_line_length": 44.12080536912752,
"alnum_prop": 0.6527228475813812,
"repo_name": "lookout/whoas",
"id": "daf395440e1c8ee0f387dbeb6fe835ab55d53399",
"size": "6574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/html5/javadoc/com/github/lookout/whoas/package-tree.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groovy",
"bytes": "12824"
},
{
"name": "Java",
"bytes": "22578"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.