[ Go Back ]
The ResourceManager REST API's allow the user to get information about the cluster - status on the cluster, metrics on the cluster, scheduler information, information about nodes in the cluster, and information about applications on the cluster.
The cluster information resource provides overall information about the cluster.
Both of the following URI's give you the cluster information.
* http://<rm http address:port>/ws/v1/cluster * http://<rm http address:port>/ws/v1/cluster/info
| Item | Data Type | Description |
|---|---|---|
| id | long | The cluster id |
| startedOn | long | The time the cluster started (in ms since epoch) |
| state | string | The ResourceManager state - valid values are: NOTINITED, INITED, STARTED, STOPPED |
| haState | string | The ResourceManager HA state - valid values are: INITIALIZING, ACTIVE, STANDBY, STOPPED |
| resourceManagerVersion | string | Version of the ResourceManager |
| resourceManagerBuildVersion | string | ResourceManager build string with build version, user, and checksum |
| resourceManagerVersionBuiltOn | string | Timestamp when ResourceManager was built (in ms since epoch) |
| hadoopVersion | string | Version of hadoop common |
| hadoopBuildVersion | string | Hadoop common build string with build version, user, and checksum |
| hadoopVersionBuiltOn | string | Timestamp when hadoop common was built(in ms since epoch) |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/info
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "clusterInfo": { "id":1324053971963, "startedOn":1324053971963, "state":"STARTED", "resourceManagerVersion":"0.23.1-SNAPSHOT", "resourceManagerBuildVersion":"0.23.1-SNAPSHOT from 1214049 by user1 source checksum 050cd664439d931c8743a6428fd6a693", "resourceManagerVersionBuiltOn":"Tue Dec 13 22:12:48 CST 2011", "hadoopVersion":"0.23.1-SNAPSHOT", "hadoopBuildVersion":"0.23.1-SNAPSHOT from 1214049 by user1 source checksum 11458df3bb77342dca5f917198fad328", "hadoopVersionBuiltOn":"Tue Dec 13 22:12:26 CST 2011" } }
XML response
HTTP Request:
Accept: application/xml GET http://<rm http address:port>/ws/v1/cluster/info
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 712 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <clusterInfo> <id>1324053971963</id> <startedOn>1324053971963</startedOn> <state>STARTED</state> <resourceManagerVersion>0.23.1-SNAPSHOT</resourceManagerVersion> <resourceManagerBuildVersion>0.23.1-SNAPSHOT from 1214049 by user1 source checksum 050cd664439d931c8743a6428fd6a693</resourceManagerBuildVersion> <resourceManagerVersionBuiltOn>Tue Dec 13 22:12:48 CST 2011</resourceManagerVersionBuiltOn> <hadoopVersion>0.23.1-SNAPSHOT</hadoopVersion> <hadoopBuildVersion>0.23.1-SNAPSHOT from 1214049 by user1 source checksum 11458df3bb77342dca5f917198fad328</hadoopBuildVersion> <hadoopVersionBuiltOn>Tue Dec 13 22:12:48 CST 2011</hadoopVersionBuiltOn> </clusterInfo>
The cluster metrics resource provides some overall metrics about the cluster. More detailed metrics should be retrieved from the jmx interface.
| Item | Data Type | Description |
|---|---|---|
| appsSubmitted | int | The number of applications submitted |
| appsCompleted | int | The number of applications completed |
| appsPending | int | The number of applications pending |
| appsRunning | int | The number of applications running |
| appsFailed | int | The number of applications failed |
| appsKilled | int | The number of applications killed |
| reservedMB | long | The amount of memory reserved in MB |
| availableMB | long | The amount of memory available in MB |
| allocatedMB | long | The amount of memory allocated in MB |
| totalMB | long | The amount of total memory in MB |
| containersAllocated | int | The number of containers allocated |
| containersReserved | int | The number of containers reserved |
| containersPending | int | The number of containers pending |
| totalNodes | int | The total number of nodes |
| activeNodes | int | The number of active nodes |
| lostNodes | int | The number of lost nodes |
| unhealthyNodes | int | The number of unhealthy nodes |
| decommissionedNodes | int | The number of nodes decommissioned |
| rebootedNodes | int | The number of nodes rebooted |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/metrics
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "clusterMetrics":{ "appsSubmitted":0, "appsCompleted":0, "appsPending":0, "appsRunning":0, "appsFailed":0, "appsKilled":0, "reservedMB":0, "availableMB":17408, "allocatedMB":0, "containersAllocated":0, "containersReserved":0, "containersPending":0, "totalMB":17408, "totalNodes":1, "lostNodes":0, "unhealthyNodes":0, "decommissionedNodes":0, "rebootedNodes":0, "activeNodes":1 } }
XML response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/metrics Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 432 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <clusterMetrics> <appsSubmitted>0</appsSubmitted> <appsCompleted>0</appsCompleted> <appsPending>0</appsPending> <appsRunning>0</appsRunning> <appsFailed>0</appsFailed> <appsKilled>0</appsKilled> <reservedMB>0</reservedMB> <availableMB>17408</availableMB> <allocatedMB>0</allocatedMB> <containersAllocated>0</containersAllocated> <containersReserved>0</containersReserved> <containersPending>0</containersPending> <totalMB>17408</totalMB> <totalNodes>1</totalNodes> <lostNodes>0</lostNodes> <unhealthyNodes>0</unhealthyNodes> <decommissionedNodes>0</decommissionedNodes> <rebootedNodes>0</rebootedNodes> <activeNodes>1</activeNodes> </clusterMetrics>
A scheduler resource contains information about the current scheduler configured in a cluster. It currently supports both the Fifo and Capacity Scheduler. You will get different information depending on which scheduler is configured so be sure to look at the type information.
The capacity scheduler supports hierarchical queues. This one request will print information about all the queues and any subqueues they have. Queues that can actually have jobs submitted to them are referred to as leaf queues. These queues have additional data associated with them.
| Item | Data Type | Description |
|---|---|---|
| type | string | Scheduler type - capacityScheduler |
| capacity | float | Configured queue capacity in percentage relative to its parent queue |
| usedCapacity | float | Used queue capacity in percentage |
| maxCapacity | float | Configured maximum queue capacity in percentage relative to its parent queue |
| queueName | string | Name of the queue |
| queues | array of queues(JSON)/zero or more queue objects(XML) | A collection of queue resources |
| Item | Data Type | Description |
|---|---|---|
| capacity | float | Configured queue capacity in percentage relative to its parent queue |
| usedCapacity | float | Used queue capacity in percentage |
| maxCapacity | float | Configured maximum queue capacity in percentage relative to its parent queue |
| absoluteCapacity | float | Absolute capacity percentage this queue can use of entire cluster |
| absoluteMaxCapacity | float | Absolute maximum capacity percentage this queue can use of the entire cluster |
| absoluteUsedCapacity | float | Absolute used capacity percentage this queue is using of the entire cluster |
| numApplications | int | The number of applications currently in the queue |
| usedResources | string | A string describing the current resources used by the queue |
| queueName | string | The name of the queue |
| state | string of QueueState | The state of the queue |
| queues | array of queues(JSON)/zero or more queue objects(XML) | A collection of sub-queue information |
| resourcesUsed | A single resource object | The total amount of resources used by this queue |
| Item | Data Type | Description |
|---|---|---|
| type | String | type of the queue - capacitySchedulerLeafQueueInfo |
| numActiveApplications | int | The number of active applications in this queue |
| numPendingApplications | int | The number of pending applications in this queue |
| numContainers | int | The number of containers being used |
| maxApplications | int | The maximum number of applications this queue can have |
| maxApplicationsPerUser | int | The maximum number of applications per user this queue can have |
| maxActiveApplications | int | The maximum number of active applications this queue can have |
| maxActiveApplicationsPerUser | int | The maximum number of active applications per user this queue can have |
| userLimit | int | The minimum user limit percent set in the configuration |
| userLimitFactor | float | The user limit factor set in the configuration |
| users | array of users(JSON)/zero or more user objects(XML) | A collection of user objects containing resources used |
| Item | Data Type | Description |
|---|---|---|
| username | String | The username of the user using the resources |
| resourcesUsed | A single resource object | The amount of resources used by the user in this queue |
| numActiveApplications | int | The number of active applications for this user in this queue |
| numPendingApplications | int | The number of pending applications for this user in this queue |
| Item | Data Type | Description |
|---|---|---|
| memory | int | The amount of memory used (in MB) |
| vCores | int | The number of virtual cores |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/scheduler
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "scheduler": { "schedulerInfo": { "capacity": 100.0, "maxCapacity": 100.0, "queueName": "root", "queues": { "queue": [ { "absoluteCapacity": 10.5, "absoluteMaxCapacity": 50.0, "absoluteUsedCapacity": 0.0, "capacity": 10.5, "maxCapacity": 50.0, "numApplications": 0, "queueName": "a", "queues": { "queue": [ { "absoluteCapacity": 3.15, "absoluteMaxCapacity": 25.0, "absoluteUsedCapacity": 0.0, "capacity": 30.000002, "maxCapacity": 50.0, "numApplications": 0, "queueName": "a1", "queues": { "queue": [ { "absoluteCapacity": 2.6775, "absoluteMaxCapacity": 25.0, "absoluteUsedCapacity": 0.0, "capacity": 85.0, "maxActiveApplications": 1, "maxActiveApplicationsPerUser": 1, "maxApplications": 267, "maxApplicationsPerUser": 267, "maxCapacity": 100.0, "numActiveApplications": 0, "numApplications": 0, "numContainers": 0, "numPendingApplications": 0, "queueName": "a1a", "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "type": "capacitySchedulerLeafQueueInfo", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>", "userLimit": 100, "userLimitFactor": 1.0, "users": null }, { "absoluteCapacity": 0.47250003, "absoluteMaxCapacity": 25.0, "absoluteUsedCapacity": 0.0, "capacity": 15.000001, "maxActiveApplications": 1, "maxActiveApplicationsPerUser": 1, "maxApplications": 47, "maxApplicationsPerUser": 47, "maxCapacity": 100.0, "numActiveApplications": 0, "numApplications": 0, "numContainers": 0, "numPendingApplications": 0, "queueName": "a1b", "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "type": "capacitySchedulerLeafQueueInfo", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>", "userLimit": 100, "userLimitFactor": 1.0, "users": null } ] }, "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>" }, { "absoluteCapacity": 7.35, "absoluteMaxCapacity": 50.0, "absoluteUsedCapacity": 0.0, "capacity": 70.0, "maxActiveApplications": 1, "maxActiveApplicationsPerUser": 100, "maxApplications": 735, "maxApplicationsPerUser": 73500, "maxCapacity": 100.0, "numActiveApplications": 0, "numApplications": 0, "numContainers": 0, "numPendingApplications": 0, "queueName": "a2", "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "type": "capacitySchedulerLeafQueueInfo", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>", "userLimit": 100, "userLimitFactor": 100.0, "users": null } ] }, "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>" }, { "absoluteCapacity": 89.5, "absoluteMaxCapacity": 100.0, "absoluteUsedCapacity": 0.0, "capacity": 89.5, "maxCapacity": 100.0, "numApplications": 2, "queueName": "b", "queues": { "queue": [ { "absoluteCapacity": 53.7, "absoluteMaxCapacity": 100.0, "absoluteUsedCapacity": 0.0, "capacity": 60.000004, "maxActiveApplications": 1, "maxActiveApplicationsPerUser": 100, "maxApplications": 5370, "maxApplicationsPerUser": 537000, "maxCapacity": 100.0, "numActiveApplications": 1, "numApplications": 2, "numContainers": 0, "numPendingApplications": 1, "queueName": "b1", "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "type": "capacitySchedulerLeafQueueInfo", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>", "userLimit": 100, "userLimitFactor": 100.0, "users": { "user": [ { "numActiveApplications": 0, "numPendingApplications": 1, "resourcesUsed": { "memory": 0, "vCores": 0 }, "username": "user2" }, { "numActiveApplications": 1, "numPendingApplications": 0, "resourcesUsed": { "memory": 0, "vCores": 0 }, "username": "user1" } ] } }, { "absoluteCapacity": 35.3525, "absoluteMaxCapacity": 100.0, "absoluteUsedCapacity": 0.0, "capacity": 39.5, "maxActiveApplications": 1, "maxActiveApplicationsPerUser": 100, "maxApplications": 3535, "maxApplicationsPerUser": 353500, "maxCapacity": 100.0, "numActiveApplications": 0, "numApplications": 0, "numContainers": 0, "numPendingApplications": 0, "queueName": "b2", "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "type": "capacitySchedulerLeafQueueInfo", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>", "userLimit": 100, "userLimitFactor": 100.0, "users": null }, { "absoluteCapacity": 0.4475, "absoluteMaxCapacity": 100.0, "absoluteUsedCapacity": 0.0, "capacity": 0.5, "maxActiveApplications": 1, "maxActiveApplicationsPerUser": 100, "maxApplications": 44, "maxApplicationsPerUser": 4400, "maxCapacity": 100.0, "numActiveApplications": 0, "numApplications": 0, "numContainers": 0, "numPendingApplications": 0, "queueName": "b3", "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "type": "capacitySchedulerLeafQueueInfo", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>", "userLimit": 100, "userLimitFactor": 100.0, "users": null } ] }, "resourcesUsed": { "memory": 0, "vCores": 0 }, "state": "RUNNING", "usedCapacity": 0.0, "usedResources": "<memory:0, vCores:0>" } ] }, "type": "capacityScheduler", "usedCapacity": 0.0 } } }
XML response
HTTP Request:
Accept: application/xml GET http://<rm http address:port>/ws/v1/cluster/scheduler
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 5778 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <scheduler> <schedulerInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="capacityScheduler"> <capacity>100.0</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <queueName>root</queueName> <queues> <queue> <capacity>10.5</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>50.0</maxCapacity> <absoluteCapacity>10.5</absoluteCapacity> <absoluteMaxCapacity>50.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>a</queueName> <state>RUNNING</state> <queues> <queue> <capacity>30.000002</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>50.0</maxCapacity> <absoluteCapacity>3.15</absoluteCapacity> <absoluteMaxCapacity>25.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>a1</queueName> <state>RUNNING</state> <queues> <queue xsi:type="capacitySchedulerLeafQueueInfo"> <capacity>85.0</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>2.6775</absoluteCapacity> <absoluteMaxCapacity>25.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>a1a</queueName> <state>RUNNING</state> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numActiveApplications>0</numActiveApplications> <numPendingApplications>0</numPendingApplications> <numContainers>0</numContainers> <maxApplications>267</maxApplications> <maxApplicationsPerUser>267</maxApplicationsPerUser> <maxActiveApplications>1</maxActiveApplications> <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser> <userLimit>100</userLimit> <users/> <userLimitFactor>1.0</userLimitFactor> </queue> <queue xsi:type="capacitySchedulerLeafQueueInfo"> <capacity>15.000001</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>0.47250003</absoluteCapacity> <absoluteMaxCapacity>25.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>a1b</queueName> <state>RUNNING</state> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numActiveApplications>0</numActiveApplications> <numPendingApplications>0</numPendingApplications> <numContainers>0</numContainers> <maxApplications>47</maxApplications> <maxApplicationsPerUser>47</maxApplicationsPerUser> <maxActiveApplications>1</maxActiveApplications> <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser> <userLimit>100</userLimit> <users/> <userLimitFactor>1.0</userLimitFactor> </queue> </queues> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> </queue> <queue xsi:type="capacitySchedulerLeafQueueInfo"> <capacity>70.0</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>7.35</absoluteCapacity> <absoluteMaxCapacity>50.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>a2</queueName> <state>RUNNING</state> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numActiveApplications>0</numActiveApplications> <numPendingApplications>0</numPendingApplications> <numContainers>0</numContainers> <maxApplications>735</maxApplications> <maxApplicationsPerUser>73500</maxApplicationsPerUser> <maxActiveApplications>1</maxActiveApplications> <maxActiveApplicationsPerUser>100</maxActiveApplicationsPerUser> <userLimit>100</userLimit> <users/> <userLimitFactor>100.0</userLimitFactor> </queue> </queues> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> </queue> <queue> <capacity>89.5</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>89.5</absoluteCapacity> <absoluteMaxCapacity>100.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>2</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>b</queueName> <state>RUNNING</state> <queues> <queue xsi:type="capacitySchedulerLeafQueueInfo"> <capacity>60.000004</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>53.7</absoluteCapacity> <absoluteMaxCapacity>100.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>2</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>b1</queueName> <state>RUNNING</state> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numActiveApplications>1</numActiveApplications> <numPendingApplications>1</numPendingApplications> <numContainers>0</numContainers> <maxApplications>5370</maxApplications> <maxApplicationsPerUser>537000</maxApplicationsPerUser> <maxActiveApplications>1</maxActiveApplications> <maxActiveApplicationsPerUser>100</maxActiveApplicationsPerUser> <userLimit>100</userLimit> <users> <user> <username>user2</username> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numPendingApplications>1</numPendingApplications> <numActiveApplications>0</numActiveApplications> </user> <user> <username>user1</username> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numPendingApplications>0</numPendingApplications> <numActiveApplications>1</numActiveApplications> </user> </users> <userLimitFactor>100.0</userLimitFactor> </queue> <queue xsi:type="capacitySchedulerLeafQueueInfo"> <capacity>39.5</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>35.3525</absoluteCapacity> <absoluteMaxCapacity>100.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>b2</queueName> <state>RUNNING</state> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numActiveApplications>0</numActiveApplications> <numPendingApplications>0</numPendingApplications> <numContainers>0</numContainers> <maxApplications>3535</maxApplications> <maxApplicationsPerUser>353500</maxApplicationsPerUser> <maxActiveApplications>1</maxActiveApplications> <maxActiveApplicationsPerUser>100</maxActiveApplicationsPerUser> <userLimit>100</userLimit> <users/> <userLimitFactor>100.0</userLimitFactor> </queue> <queue xsi:type="capacitySchedulerLeafQueueInfo"> <capacity>0.5</capacity> <usedCapacity>0.0</usedCapacity> <maxCapacity>100.0</maxCapacity> <absoluteCapacity>0.4475</absoluteCapacity> <absoluteMaxCapacity>100.0</absoluteMaxCapacity> <absoluteUsedCapacity>0.0</absoluteUsedCapacity> <numApplications>0</numApplications> <usedResources><memory:0, vCores:0></usedResources> <queueName>b3</queueName> <state>RUNNING</state> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> <numActiveApplications>0</numActiveApplications> <numPendingApplications>0</numPendingApplications> <numContainers>0</numContainers> <maxApplications>44</maxApplications> <maxApplicationsPerUser>4400</maxApplicationsPerUser> <maxActiveApplications>1</maxActiveApplications> <maxActiveApplicationsPerUser>100</maxActiveApplicationsPerUser> <userLimit>100</userLimit> <users/> <userLimitFactor>100.0</userLimitFactor> </queue> </queues> <resourcesUsed> <memory>0</memory> <vCores>0</vCores> </resourcesUsed> </queue> </queues> </schedulerInfo> </scheduler>
| Item | Data Type | Description |
|---|---|---|
| type | string | Scheduler type - fifoScheduler |
| capacity | float | Queue capacity in percentage |
| usedCapacity | float | Used queue capacity in percentage |
| qstate | string | State of the queue - valid values are: STOPPED, RUNNING |
| minQueueMemoryCapacity | int | Minimum queue memory capacity |
| maxQueueMemoryCapacity | int | Maximum queue memory capacity |
| numNodes | int | The total number of nodes |
| usedNodeCapacity | int | The used node capacity |
| availNodeCapacity | int | The available node capacity |
| totalNodeCapacity | int | The total node capacity |
| numContainers | int | The number of containers |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/scheduler
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "scheduler": { "schedulerInfo": { "type":"fifoScheduler", "capacity":1, "usedCapacity":"NaN", "qstate":"RUNNING", "minQueueMemoryCapacity":1024, "maxQueueMemoryCapacity":10240, "numNodes":0, "usedNodeCapacity":0, "availNodeCapacity":0, "totalNodeCapacity":0, "numContainers":0 } } }
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/scheduler Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 432 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <scheduler> <schedulerInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="fifoScheduler"> <capacity>1.0</capacity> <usedCapacity>NaN</usedCapacity> <qstate>RUNNING</qstate> <minQueueMemoryCapacity>1024</minQueueMemoryCapacity> <maxQueueMemoryCapacity>10240</maxQueueMemoryCapacity> <numNodes>0</numNodes> <usedNodeCapacity>0</usedNodeCapacity> <availNodeCapacity>0</availNodeCapacity> <totalNodeCapacity>0</totalNodeCapacity> <numContainers>0</numContainers> </schedulerInfo> </scheduler>
With the Applications API, you can obtain a collection of resources, each of which represents an application.
Multiple parameters can be specified. The started and finished times have a begin and end parameter to allow you to specify ranges. For example, one could request all applications that started between 1:00am and 2:00pm on 12/19/2011 with startedTimeBegin=1324256400&startedTimeEnd=1324303200. If the Begin parameter is not specified, it defaults to 0, and if the End parameter is not specified, it defaults to infinity.
* state [deprecated] - state of the application * states - applications matching the given application states, specified as a comma-separated list. * finalStatus - the final status of the application - reported by the application itself * user - user name * queue - queue name * limit - total number of app objects to be returned * startedTimeBegin - applications with start time beginning with this time, specified in ms since epoch * startedTimeEnd - applications with start time ending with this time, specified in ms since epoch * finishedTimeBegin - applications with finish time beginning with this time, specified in ms since epoch * finishedTimeEnd - applications with finish time ending with this time, specified in ms since epoch * applicationTypes - applications matching the given application types, specified as a comma-separated list. * applicationTags - applications matching any of the given application tags, specified as a comma-separated list.
When you make a request for the list of applications, the information will be returned as a collection of app objects. See also Application API for syntax of the app object.
| Item | Data Type | Description |
|---|---|---|
| app | array of app objects(JSON)/zero or more application objects(XML) | The collection of application objects |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "apps": { "app": [ { "finishedTime" :<PHONE_NUMBER>530, "amContainerLogs" : "http://host.domain.com:8042/node/containerlogs/container_1326815542473_0001_01_000001", "trackingUI" : "History", "state" : "FINISHED", "user" : "user1", "id" : "application_1326815542473_0001", "clusterId" :<PHONE_NUMBER>473, "finalStatus" : "SUCCEEDED", "amHostHttpAddress" : "host.domain.com:8042", "progress" : 100, "name" : "word count", "startedTime" :<PHONE_NUMBER>334, "elapsedTime" : 25196, "diagnostics" : "", "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326815542473_0001/jobhistory/job/job_1326815542473_1_1", "queue" : "default", "allocatedMB" : 0, "allocatedVCores" : 0, "runningContainers" : 0 }, { "finishedTime" :<PHONE_NUMBER>546, "amContainerLogs" : "http://host.domain.com:8042/node/containerlogs/container_1326815542473_0002_01_000001", "trackingUI" : "History", "state" : "FINISHED", "user" : "user1", "id" : "application_1326815542473_0002", "clusterId" :<PHONE_NUMBER>473, "finalStatus" : "SUCCEEDED", "amHostHttpAddress" : "host.domain.com:8042", "progress" : 100, "name" : "Sleep job", "startedTime" :<PHONE_NUMBER>380, "elapsedTime" : 148166, "diagnostics" : "", "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326815542473_0002/jobhistory/job/job_1326815542473_2_2", "queue" : "default", "allocatedMB" : 0, "allocatedVCores" : 0, "runningContainers" : 1 } ] } }
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 2459 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <apps> <app> <id>application_1326815542473_0001</id> <user>user1</user> <name>word count</name> <applicationType>MAPREDUCE</applicationType> <queue>default</queue> <state>FINISHED</state> <finalStatus>SUCCEEDED</finalStatus> <progress>100.0</progress> <trackingUI>History</trackingUI> <trackingUrl>http://host.domain.com:8088/proxy/application_1326815542473_0001/jobhistory/job /job_1326815542473_1_1</trackingUrl> <diagnostics/> <clusterId>1326815542473</clusterId> <startedTime>1326815573334</startedTime> <finishedTime>1326815598530</finishedTime> <elapsedTime>25196</elapsedTime> <amContainerLogs>http://host.domain.com:8042/node/containerlogs/container_1326815542473_0001 _01_000001</amContainerLogs> <amHostHttpAddress>host.domain.com:8042</amHostHttpAddress> <allocatedMB>0</allocatedMB> <allocatedVCores>0</allocatedVCores> <runningContainers>0</runningContainers> </app> <app> <id>application_1326815542473_0002</id> <user>user1</user> <name>Sleep job</name> <applicationType>YARN</applicationType> <queue>default</queue> <state>FINISHED</state> <finalStatus>SUCCEEDED</finalStatus> <progress>100.0</progress> <trackingUI>History</trackingUI> <trackingUrl>http://host.domain.com:8088/proxy/application_1326815542473_0002/jobhistory/job/job_1326815542473_2_2</trackingUrl> <diagnostics/> <clusterId>1326815542473</clusterId> <startedTime>1326815641380</startedTime> <finishedTime>1326815789546</finishedTime> <elapsedTime>148166</elapsedTime> <amContainerLogs>http://host.domain.com:8042/node/containerlogs/container_1326815542473_0002_01_000001</amContainerLogs> <amHostHttpAddress>host.domain.com:8042</amHostHttpAddress> <allocatedMB>0</allocatedMB> <allocatedVCores>0</allocatedVCores> <runningContainers>0</runningContainers> </app> </apps>
With the Application Statistics API, you can obtain a collection of triples, each of which contains the application type, the application state and the number of applications of this type and this state in ResourceManager context. Note that with the performance concern, we currently only support at most one applicationType per query. We may support multiple applicationTypes per query as well as more statistics in the future.
Two paramters can be specified. The parameters are case insensitive.
* states - states of the applications, specified as a comma-separated list. If states is not provided, the API will enumerate all application states and return the counts of them. * applicationTypes - types of the applications, specified as a comma-separated list. If applicationTypes is not provided, the API will count the applications of any application type. In this case, the response shows * to indicate any application type. Note that we only support at most one applicationType temporarily. Otherwise, users will expect an BadRequestException.
When you make a request for the list of statistics items, the information will be returned as a collection of statItem objects
| Item | Data Type | Description |
|---|---|---|
| statItem | array of statItem objects(JSON)/zero or more statItem objects(XML) | The collection of statItem objects |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/appstatistics?states=accepted,running,finished&applicationTypes=mapreduce
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "appStatInfo": { "statItem": [ { "state" : "accepted", "type" : "mapreduce", "count" : 4 }, { "state" : "running", "type" : "mapreduce", "count" : 1 }, { "state" : "finished", "type" : "mapreduce", "count" : 7 } ] } }
XML response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/appstatistics?states=accepted,running,finished&applicationTypes=mapreduce Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 2459 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <appStatInfo> <statItem> <state>accepted</state> <type>mapreduce</type> <count>4</count> </statItem> <statItem> <state>running</state> <type>mapreduce</type> <count>1</count> </statItem> <statItem> <state>finished</state> <type>mapreduce</type> <count>7</count> </statItem> </appStatInfo>
An application resource contains information about a particular application that was submitted to a cluster.
Use the following URI to obtain an app object, from a application identified by the appid value.
* http://<rm http address:port>/ws/v1/cluster/apps/{appid}
Note that depending on security settings a user might not be able to see all the fields.
| Item | Data Type | Description |
|---|---|---|
| id | string | The application id |
| user | string | The user who started the application |
| name | string | The application name |
| Application Type | string | The application type |
| queue | string | The queue the application was submitted to |
| state | string | The application state according to the ResourceManager - valid values are members of the YarnApplicationState enum: NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED |
| finalStatus | string | The final status of the application if finished - reported by the application itself - valid values are: UNDEFINED, SUCCEEDED, FAILED, KILLED |
| progress | float | The progress of the application as a percent |
| trackingUI | string | Where the tracking url is currently pointing - History (for history server) or ApplicationMaster |
| trackingUrl | string | The web URL that can be used to track the application |
| diagnostics | string | Detailed diagnostics information |
| clusterId | long | The cluster id |
| startedTime | long | The time in which application started (in ms since epoch) |
| finishedTime | long | The time in which the application finished (in ms since epoch) |
| elapsedTime | long | The elapsed time since the application started (in ms) |
| amContainerLogs | string | The URL of the application master container logs |
| amHostHttpAddress | string | The nodes http address of the application master |
| allocatedMB | int | The sum of memory in MB allocated to the application's running containers |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "app" : { "finishedTime" :<PHONE_NUMBER>300, "amContainerLogs" : "http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001", "trackingUI" : "History", "state" : "FINISHED", "user" : "user1", "id" : "application_1326821518301_0005", "clusterId" :<PHONE_NUMBER>301, "finalStatus" : "SUCCEEDED", "amHostHttpAddress" : "host.domain.com:8042", "progress" : 100, "name" : "Sleep job", "applicationType" : "Yarn", "startedTime" :<PHONE_NUMBER>552, "elapsedTime" : 446748, "diagnostics" : "", "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326821518301_0005/jobhistory/job/job_1326821518301_5_5", "queue" : "a1" } }
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005 Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 847 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <app> <id>application_1326821518301_0005</id> <user>user1</user> <name>Sleep job</name> <queue>a1</queue> <state>FINISHED</state> <finalStatus>SUCCEEDED</finalStatus> <progress>100.0</progress> <trackingUI>History</trackingUI> <trackingUrl>http://host.domain.com:8088/proxy/application_1326821518301_0005/jobhistory/job/job_1326821518301_5_5</trackingUrl> <diagnostics/> <clusterId>1326821518301</clusterId> <startedTime>1326824544552</startedTime> <finishedTime>1326824991300</finishedTime> <elapsedTime>446748</elapsedTime> <amContainerLogs>http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001</amContainerLogs> <amHostHttpAddress>host.domain.com:8042</amHostHttpAddress> </app>
With the application attempts API, you can obtain a collection of resources that represent an application attempt.
When you make a request for the list of app attempts, the information will be returned as an array of app attempt objects.
appAttempts:
| Item | Data Type | Description |
|---|---|---|
| appAttempt | array of app attempt objects(JSON)/zero or more app attempt objects(XML) | The collection of app attempt objects |
| Item | Data Type | Description |
|---|---|---|
| id | string | The app attempt id |
| nodeId | string | The node id of the node the attempt ran on |
| nodeHttpAddress | string | The node http address of the node the attempt ran on |
| logsLink | string | The http link to the app attempt logs |
| containerId | string | The id of the container for the app attempt |
| startTime | long | The start time of the attempt (in ms since epoch) |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005/appattempts
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "appAttempts" : { "appAttempt" : [ { "nodeId" : "host.domain.com:8041", "nodeHttpAddress" : "host.domain.com:8042", "startTime" :<PHONE_NUMBER>693, "id" : 1, "logsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001/user1", "containerId" : "container_1326821518301_0005_01_000001" } ] } }
XML response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005/appattempts Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 575 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <appAttempts> <appttempt> <nodeHttpAddress>host.domain.com:8042</nodeHttpAddress> <nodeId>host.domain.com:8041</nodeId> <id>1</id> <startTime>1326381444693</startTime> <containerId>container_1326821518301_0005_01_000001</containerId> <logsLink>http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001/user1</logsLink> </appAttempt> </appAttempts>
With the Nodes API, you can obtain a collection of resources, each of which represents a node.
When you make a request for the list of nodes, the information will be returned as a collection of node objects. See also Node API for syntax of the node object.
| Item | Data Type | Description |
|---|---|---|
| node | array of node objects(JSON)/zero or more node objects(XML) | A collection of node objects |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/nodes
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "nodes": { "node": [ { "rack":"\/default-rack", "state":"NEW", "id":"h2:1235", "nodeHostName":"h2", "nodeHTTPAddress":"h2:2", "healthStatus":"Healthy", "lastHealthUpdate":1324056895432, "healthReport":"Healthy", "numContainers":0, "usedMemoryMB":0 "availMemoryMB":8192 }, { "rack":"\/default-rack", "state":"NEW", "id":"h1:1234", "nodeHostName":"h1", "nodeHTTPAddress":"h1:2", "healthStatus":"Healthy", "lastHealthUpdate":1324056895092, "healthReport":"Healthy", "numContainers":0, "usedMemoryMB":0, "availMemoryMB":8192 } ] } }
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/nodes Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 1104 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <nodes> <node> <rack>/default-rack</rack> <state>RUNNING</state> <id>h2:1234</id> <nodeHostName>h2</nodeHostName> <nodeHTTPAddress>h2:2</nodeHTTPAddress> <healthStatus>Healthy</healthStatus> <lastHealthUpdate>1324333268447</lastHealthUpdate> <healthReport>Healthy</healthReport> <numContainers>0</numContainers> <usedMemoryMB>0</usedMemoryMB> <availMemoryMB>5120</availMemoryMB> </node> <node> <rack>/default-rack</rack> <state>RUNNING</state> <id>h1:1234</id> <nodeHostName>h1</nodeHostName> <nodeHTTPAddress>h1:2</nodeHTTPAddress> <healthStatus>Healthy</healthStatus> <lastHealthUpdate>1324333268447</lastHealthUpdate> <healthReport>Healthy</healthReport> <numContainers>0</numContainers> <usedMemoryMB>0</usedMemoryMB> <availMemoryMB>5120</availMemoryMB> </node> </nodes>
A node resource contains information about a node in the cluster.
Use the following URI to obtain a Node Object, from a node identified by the nodeid value.
* http://<rm http address:port>/ws/v1/cluster/nodes/{nodeid}
| Item | Data Type | Description |
|---|---|---|
| rack | string | The rack location of this node |
| state | string | State of the node - valid values are: NEW, RUNNING, UNHEALTHY, DECOMMISSIONED, LOST, REBOOTED |
| id | string | The node id |
| nodeHostName | string | The host name of the node |
| nodeHTTPAddress | string | The nodes HTTP address |
| healthStatus | string | The health status of the node - Healthy or Unhealthy |
| healthReport | string | A detailed health report |
| lastHealthUpdate | long | The last time the node reported its health (in ms since epoch) |
| usedMemoryMB | long | The total about of memory currently used on the node (in MB) |
| availMemoryMB | long | The total amount of memory currently available on the node (in MB) |
| numContainers | int | The total number of containers currently running on the node |
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/nodes/h2:1235
Response Header:
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26)
Response Body:
{ "node": { "rack":"\/default-rack", "state":"NEW", "id":"h2:1235", "nodeHostName":"h2", "nodeHTTPAddress":"h2:2", "healthStatus":"Healthy", "lastHealthUpdate":1324056895432, "healthReport":"Healthy", "numContainers":0, "usedMemoryMB":0, "availMemoryMB":5120 } }
JSON response
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/node/h2:1235 Accept: application/xml
Response Header:
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 552 Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <node> <rack>/default-rack</rack> <state>NEW</state> <id>h2:1235</id> <nodeHostName>h2</nodeHostName> <nodeHTTPAddress>h2:2</nodeHTTPAddress> <healthStatus>Healthy</healthStatus> <lastHealthUpdate>1324333268447</lastHealthUpdate> <healthReport>Healthy</healthReport> <numContainers>0</numContainers> <usedMemoryMB>0</usedMemoryMB> <availMemoryMB>5120</availMemoryMB> </node>


HTML Lists are used to specify lists of information. All lists may contain one or more list elements. There are three different types of HTML lists:
HTML Ordered List or Numbered List displays elements in numbered format. The HTML ol tag is used for ordered list. There can be different types of numbered list:
To represent different ordered lists, there are 5 types of attributes in this tag.
| Type | Description |
|---|---|
| Type "1" | This is the default type. In this type, the list items are numbered with numbers. |
| Type "I" | In this type, the list items are numbered with upper case roman numbers. |
| Type "i" | In this type, the list items are numbered with lower case roman numbers. |
| Type "A" | In this type, the list items are numbered with upper case letters. |
| Type "a" | In this type, the list items are numbered with lower case letters. |
Here is an example to display list in roman number uppercase.
Output:
Here is an example to display list in roman number lowercase.
Output:
Here is an example to display list in alphabet uppercase.
Output:
Here is an example to display list in alphabet lowercase.
Output:
HTML Unordered List or Bulleted List displays elements in bulleted format. The HTML ul tag is used for the unordered list. There can be 4 types of bulleted list:
To represent different ordered lists, there are 4 types of attributes in this tag
| Type | Description |
|---|---|
| Type "disc" | This is the default style. In this style, the list items are marked with bullets. |
| Type "circle" | In this style, the list items are marked with circles. |
| Type "square" | In this style, the list items are marked with squares. |
| Type "none" | In this style, the list items are not marked . |
Output:
Output:
Output:
HTML Description list is also a list style which is supported by HTML and XHTML. It is also known as definition list where entries are listed like a dictionary or encyclopedia.
Output


var currZoom: Float
The current zoom value; computed by .computeZoom.
See Also
android.widget.Scroller.getCurrX


A p5.js template for animation
While doing a lot of animation with p5.js over the last few months, I’ve slowly developed a template that I now use to start all my projects. It’s designed for my own use but perhaps it could also be useful (in part or as a whole) for other people. So I’m sharing it on GitHub and documenting it below. There’s always ample room for improvement, so if you have any ideas don’t hesite to get in touch.
The main feature of this template is a convenient system to export frames to create videos and gifs. This is accomplished with a small Node.js server, named server.js, that communicates with the p5.js sketch via Socket.io. To export frames, the sketch gets a reference to the web canvas and sends it to server.js, which saves it to disk. The best part is that the exportation can all happen behind the scene, in the command line, using the Node module Puppeteer. Then, when all the frames are exported, they can be turned into videos and gifs using ffmpeg.
Below are all the files included in the template. I will now go through how all the pieces fit together.
frame-export.js
frames
headless.js
index.html
libraries
server.js
sketch.js
style.css
Starting with frame-export.js
After importing p5.js and Socket.io in the file index.html, the template imports frame-export.js. This file has two purposes. Firstly, it establishes whether or not we need to start exporting frames, and secondly, it contains the global function frameExport(), which sends the canvas to server.js. Here is frame-export.js in its entirety:
let GET = {};
let query = window.location.search.substring(1).split("&");
for (let i = 0; i < query.length; i++) {
if (query[i] === "") // check for trailing & with no param
continue;
var param = query[i].split("=");
GET[param[0]] = param[1];
}
let exporting = (GET["exporting"] && GET["exporting"] == "true") ? true : false;
function frameExport() {
var formattedFrameCount = "" + frameCount;
while (formattedFrameCount.length < 5) {
formattedFrameCount = "0" + formattedFrameCount;
}
var dataUrl = canvasDOM.toDataURL();
var data = {
dataUrl: dataUrl,
name: fileName + "-" + formattedFrameCount
}
socket.emit('image', data);
}
The exporting boolean will establish whether or not the user intends to export the frames from the sketch. We use Url query strings to set this variable. If the user loads the address http://localhost:8080/, exporting will default to false. To load the sketch with the intent of exporting frames, the user needs to load another address: http://localhost:8080/?exporting=true.
The goal here is to prevent accidental exportation of frames, which can happen quite often if you keep changing and reloading the same p5.js sketch while only sometimes wanting to export frames. Accidental exportations can create large amounts of unwanted files on your hard drive, and can even erase older files with identical names.
Another good side effect of this approach is being able to load a sketch only to see it in the browser, and to load it later to export its frames, all without changing any code in the JavaScript files.
The real magic: exporting frames from the terminal
The best part of this template is the ability to export frames from the terminal using Puppeteer. Puppeteer is a Node.js application which creates a “headless browser”, which is a browser that you can control from the command line.
The code below is what you will find inside headless.js. It’s not a JavaScript file that needs to be linked in index.html, it’s a tiny Node.js application. The only thing that it does is load the address http://localhost:8080/?exporting=true inside Puppeteer’s headless browser, which means that it’ll load your p5.js sketch and trigger the exportation of frames.
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch();
// await console.log("Puppeteer launched");
const page = await browser.newPage();
await page.setViewport({
width: 2560 / 2,
height: 1600 / 2,
deviceScaleFactor: 2
});
// await console.log(page.viewport());
await page.goto('http://localhost:8080/?exporting=true');
// await page.screenshot({ path: 'example.png' });
// await browser.close();
})();
The beauty of exporting frames from the terminal is that you do not need to look at your p5.js sketch as it is exporting (browsers deactivate the p5.js sketch when the page is not displayed). This means that you can start looking at the frames as they appear on your hard drive, and for long sequences, you can do whatever else you want with your computer. No need to wait.
Do note that headless.js contains hard-coded numbers for the width and height of the screen (in the page.setViewport call). This is the size of my screen, so just change these numbers to fit yours.
Global variables in sketch.js
let looping = true;
let socket, cnvs, ctx, canvasDOM;
let fileName = "./frames/sketch";
let maxFrames = 20;
We first declare a looping variable, used to pause and restart the animation by pushing the spacebar. Then, socket, cnvs, ctx, and canvasDOM are all going to be used to
The setup() function
function setup() {
socket = io.connect('http://localhost:8080');
cnvs = createCanvas(windowWidth, windowWidth / 16 * 9);
ctx = cnvs.drawingContext;
canvasDOM = document.getElementById('defaultCanvas0');
if (exporting) {
frameRate(2);
} else {
frameRate(30);
}
And then, the sketch’s frameRate is set according to the exporting variable. This is done because, when exporting simple frames that do not require a lot of computation, I find that exporting too many frames per second ends up clogging the system. I’m still testing this out, but for now, exporting 2 frames per second seems like a good compromise. It’s generally slower but more consistent—it will not slow down over time.
On the other hand, if exporting is false, I set the frameRate to 30. This is just a personal preference—I studied in traditional paper animation and I’m used to thinking in terms of 24 or 30 frames per second (typical frame rates for film and ntsc video, respectively). From what I’ve been able to observe, it doesn’t seem like the web canvas is actually able to dependably refresh at the rate of 24 frames per second. It seems to only refresh correctly at fractions of 60 (so 10, 20, and 30).
The draw() loop
function draw() {
for (let i = 0; i < 500; i++) {
let x = random(width);
let y = random(height);
ellipse(x, y, 5);
}
if (exporting && frameCount <= maxFrames) {
frameExport();
}
}
Some convenient hot keys
function keyPressed() {
if (keyCode === 32) {
if (looping) {
noLoop();
looping = false;
} else {
loop();
looping = true;
}
}
if (key == 'p' || key == 'P') {
frameExport();
}
if (key == 'r' || key == 'R') {
window.location.reload();
}
if (key == 'm' || key == 'M') {
redraw();
}
}


openssl req -new -sha256 -key filename.key -out filename.csr- Generate a self-signed certificate and a corresponding key-pair, storing both in a file:
openssl req -new -x509 -newkey rsa:4096 -keyout filename.key -out filename.cert -subj "/C=XX/CN=foobar" -days 365


Payments Home
Name
Phone Number
Your Qr Code
New Split
Payment
Recent Transactions
Payments
Splits
Settings


We optimize methodologies!
- whiteboard visionary vortals
- harness clicks-and-mortar bandwidth
- recontextualize extensible experiences
- evolve B2C vortals
- enhance out-of-the-box synergies
- morph rich schemas
- envisioneer world-class eyeballs
- brand back-end infomediaries
- revolutionize innovative e-tailers
- streamline cross-platform markets


Login with NEO-wallet address
This software is a community demo version of the product, it is intended for the introduction of its main functions. In order to eliminate the risk of accidental hardware damage, this version does not contain computing core module. To install the full developer version of the program, please visit our GitHub and follow the installation instructions.


IBM
`Prev `__
I
`Next `__
--------------
**IBM**: /I·B·M/
Once upon a time, the computer company most hackers loved to hate;
today, the one they are most puzzled to find themselves liking.
From hackerdom's beginnings in the mid-1960s to the early 1990s, IBM was
regarded with active loathing. Common expansions of the corporate name
included: Inferior But Marketable; It's Better Manually; Insidious Black
Magic; It's Been Malfunctioning; Incontinent Bowel Movement; and a
near-`*infinite* `__ number of even less complimentary
expansions (see also `*fear and
loathing* <../F/fear-and-loathing.html>`__). What galled hackers about
most IBM machines above the PC level wasn't so much that they were
underpowered and overpriced (though that counted against them), but that
the designs were incredibly archaic, `*crufty* <../C/crufty.html>`__,
and `*elephantine* <../E/elephantine.html>`__ ... and you couldn't *fix*
them — source code was locked up tight, and programming tools were
expensive, hard to find, and bletcherous to use once you had found them.
We didn't know how good we had it back then. In the 1980s IBM had its
own troubles with Microsoft and lost its strategic way, receding from
the hacker community's view. Then, in the 1990s, Microsoft became more
noxious and omnipresent than IBM had ever been.
In the late 1990s IBM re-invented itself as a services company, began to
release open-source software through its AlphaWorks group, and began
shipping `*Linux* <../L/Linux.html>`__ systems and building ties to the
Linux community. To the astonishment of all parties, IBM emerged as a
staunch friend of the hacker community and `*open
source* <../O/open-source.html>`__ development, with ironic consequences
noted in the `*FUD* <../F/FUD.html>`__ entry.
This lexicon includes a number of entries attributed to ‘IBM’; these
derive from some rampantly unofficial jargon lists circulated within
IBM's formerly beleaguered hacker underground.
--------------
+--------------------------+----------------------------+---------------------------------+
| `Prev `__ | `Up <../I.html>`__ | `Next `__ |
+--------------------------+----------------------------+---------------------------------+
| IANAL | `Home <../index.html>`__ | ICBM address |
+--------------------------+----------------------------+---------------------------------+


Rancho's Onsite Tacos
Rancho's Onsite Tacos
Home
(current)
About
Menu
Contact
Moblie availability
We come to you!
Sunday
8:00 AM to 4:00 PM
Monday
9:00 AM to 8:00 PM
Tuesday
9:00 AM to 8:00 PM
Wednesday
9:00 AM to 8:00 PM
Thursday
9:00 AM to 8:00 PM
Friday
9:00 AM to 8:00 PM
Saturday
8:00 AM to 11:00 PM
Email<EMAIL_ADDRESS>Contact Us Today!
(213)296-8061
Contact
Write information below
First Name
Last Name
Email
Your Feedback
Submit


{% extends 'blog/base.html' %} {% block content %}
Blogging has always been about expressing yourself and sharing what you know on the Internet. So, this is the place for you where you can write you blog and post it for the world to see it.


Steem Developer Portal
JS: Witness Listing And Voting
Create a list of available witnesses as well as vote for and remove your vote for a witness.
Full, runnable src of Witness Listing And Voting can be downloaded as part of the JS tutorials repository.
This tutorial will take you through the process of preparing and submitting a vote
using the broadcast
operation. A demo account is provided to use on the testnet
but all variables can be easily changed and applied to the production server
.
There is also an alternative method to vote for a witness using a hot signing
link that can be generated via Steemconnect. You create a link using the witness
name and the approve
fields which denotes whether you want to vote for or remove the vote. This link then allows you to vote simply by signing in with your account details. This is a very simple way to send a vote request to any other user with the correct details already provided by the link.
Intro
We are using the account witness vote
function to create the vote which we then commit to the steem blockchain with a broadcast
operation from dsteem
. We also look at the vote status for a specific user using the getAccounts
function. The parameters required for the witness voting operation are:
- limit - Used in creating the witness list. Denotes the maximum number of witnesses to display
- voter - This is the account making the vote
- privatekey - The private active key of the voter account
- witness - The name of the witness being voted for
- approve - This is a boolean value determining whether the voting opration is to vote for, or to remove a vote
Steps
- Configure connection Configuration of
dsteem
to communicate with a Steem blockchain - Create witness list Displaying a list of active witnesses
- Input variables Collecting the required inputs via an HTML UI
- Voting status Confirming the current vote status for the selected witness
- Broadcast Creating an object and broadcasting the vote to the blockchain
1. Configure connection
As usual, we have a public/app.js
file which holds the Javascript segment of the tutorial. In the first few lines we define the configured library and packages:
import { Client, PrivateKey } from 'dsteem';
import { Testnet as NetConfig } from '../../configuration'; //A Steem Testnet. Replace 'Testnet' with 'Mainnet' to connect to the main Steem blockchain.
let opts = { ...NetConfig.net };
//connect to a steem node, testnet in this case
const client = new Client(NetConfig.url, opts);
Above, we have dsteem
pointing to the test network with the proper chainId, addressPrefix, and endpoint by importing from the configuration.js
file. Because this tutorial is interactive, we will not publish test content to the main network. Instead, we’re using the testnet and a predefined account which is imported once the application loads, to demonstrate witness voting.
window.onload = async () => {
const account = NetConfig.accounts[0];
document.getElementById('username').value = account.address;
document.getElementById('activeKey').value = account.privActive;
};
2. Create witness list
We create a list of the current active witnesses available. This gives a list from which to select a witness to vote for. The list retrieved from the blockchain has a maximum length of 100 witnesses. We query the blockchain with the getState
function and then use a for loop
to display the list. This function is initiated once the user inputs a value for the limit
variable and clicks on the “Fetch current Witnesses” button.
window.createList = async () => {
//get list limit
const limit = document.getElementById('limit').value;
const witnessdata = await client.database.getState('witnesses');
var witnesses = [];
for (const witness in witnessdata.witnesses) {
console.log('witness', witness);
witnesses.push(
`<li><a href="#" onclick="document.getElementById('witness').value = '${witness}';">${witness}</a></li>`
);
}
console.log('witnesses', witnesses);
document.getElementById('witnessList').innerHTML = witnesses.join('');
document.getElementById('witnessListContainer').style.display = 'flex';
};
3. Input variables
The required parameters for the vote operation is recorded via an HTML UI that can be found in the public/index.html
file. The values are pre-populated in this case with a testnet demo
account.
The parameter values are allocated as seen below, once the user clicks on the “Submit Vote” button.
window.submitVote = async () => {
//get all values from the UI
//get account name of voter
const voter = document.getElementById('username').value;
//get private active key
const privateKey = dsteem.PrivateKey.fromString(
document.getElementById('activeKey').value
);
//get witness name
const witness = document.getElementById('witness').value;
4. Voting status
The approve
parameter within the vote function determines whether the user is voting for the witness or removing its vote. In order to get the correct value for this parameter we first need to identify whether the user has already voted for the specified witness or not. One of the fields from the account information (blockchain query) holds an array of all the witnesses currently voted for by the user. The check returns true
if the user has already voted for the selected witness. The result of this query is displayed and the user is given a choice whether to proceed with the vote/unvote process or stop the process activating a new function for each of those choices.
//check if witness is already voted for
_data = new Array
_data = await client.database.getAccounts([voter]);
const witnessvotes = _data[0]["witness_votes"];
const approve = witnessvotes.includes(witness);
if (approve) {
checkresult = "Witness has already been voted for, would you like to remove vote?"
votecheck = "Vote removed"
} else {
checkresult = "Witness has not yet been voted for, would you like to vote?"
votecheck = "Vote added"
}
document.getElementById('voteCheckContainer').style.display = 'flex';
document.getElementById('voteCheck').className = 'form-control-plaintext alert alert-success';
document.getElementById('voteCheck').innerHTML = checkresult;
document.getElementById("submitYesBtn").style.visibility = "visible";
document.getElementById("submitNoBtn").style.visibility = "visible";
5. Broadcast
When the user decides to continue with the voting process the actual vote function is triggered and we create a vote object
with the input variables before we can broadcast to the blockchain.
window.submitYes = async () => {
//create vote object
const vote = [
'account_witness_vote',
{ account: voter, witness: witness, approve: !approve },
];
The array cotains the function for the witness vote along with an object containing the needed parameters. We have to use the opposite of the approve
variable that we created in the previous step. That variable is true
if the user has already voted, and a value of true
for the approve
parameter means that the user is voting for the specified witness which will then return an error.
After the object has been created we can broadcast
the operation to the steem blockchain along with the private active key of the user. The result of the vote is displayed on the UI to confirm whether you voted for or removed a vote for the witness as well as error details should there be one.
//broadcast the vote
client.broadcast.sendOperations([vote], privateKey).then(
function(result) {
console.log(
'included in block: ' + result.block_num,
'expired: ' + result.expired
);
document.getElementById('voteCheckContainer').style.display = 'flex';
document.getElementById('voteCheck').className =
'form-control-plaintext alert alert-success';
document.getElementById('voteCheck').innerHTML = votecheck;
},
function(error) {
console.error(error);
document.getElementById('voteCheckContainer').style.display = 'flex';
document.getElementById('voteCheck').className =
'form-control-plaintext alert alert-danger';
document.getElementById('voteCheck').innerHTML = error.jse_shortmsg;
}
);
document.getElementById('submitYesBtn').style.visibility = 'hidden';
document.getElementById('submitNoBtn').style.visibility = 'hidden';
Should the user choose to stop the process the following function is executed.
window.submitNo = async () => {
document.getElementById('voteCheckContainer').style.display = 'flex';
document.getElementById('voteCheck').className =
'form-control-plaintext alert alert-success';
document.getElementById('voteCheck').innerHTML =
'Vote process has ben cancelled';
document.getElementById('submitYesBtn').style.visibility = 'hidden';
document.getElementById('submitNoBtn').style.visibility = 'hidden';
};
The option buttons (continue with voting process or stop) are disabled at the end of the process in order to remove confusion on what to do next or what the option buttons will do.
To run this tutorial
- clone this repo
cd tutorials/22_witness_listing_and_voting
npm i
npm run dev-server
ornpm run start
- After a few moments, the server should be running at http://localhost:3000/


Main
City Overview
Trash Bins
Pick-Up Trucks
Some Table
Contact Soppurt
5 Notifications
Search
Account
Dropdown
Log out


Class ReadSession (2.4.0)
ReadSession(mapping=None, *, ignore_unknown_fields=False, **kwargs)
Information about the ReadSession.
This message has oneof
_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes
| Name | Description |
| name |
str
Output only. Unique identifier for the session, in the form ``projects/{project_id}/locations/{location}/sessions/{session_id}``. |
| expire_time |
google.protobuf.timestamp_pb2.Timestamp
Output only. Time at which the session becomes invalid. After this time, subsequent requests to read this Session will return errors. The expire_time is automatically assigned and currently cannot be specified or updated. |
| data_format |
google.cloud.bigquery_storage_v1.types.DataFormat
Immutable. Data format of the output data. |
| avro_schema |
google.cloud.bigquery_storage_v1.types.AvroSchema
Output only. Avro schema. This field is a member of `oneof`_ ``schema``. |
| arrow_schema |
google.cloud.bigquery_storage_v1.types.ArrowSchema
Output only. Arrow schema. This field is a member of `oneof`_ ``schema``. |
| table |
str
Immutable. Table that this ReadSession is reading from, in the form ``projects/{project_id}/datasets/{dataset_id}/tables/{table_id}`` |
| table_modifiers |
google.cloud.bigquery_storage_v1.types.ReadSession.TableModifiers
Optional. Any modifiers which are applied when reading from the specified table. |
| read_options |
google.cloud.bigquery_storage_v1.types.ReadSession.TableReadOptions
Optional. Read options for this session (e.g. column selection, filters). |
| streams |
Sequence[google.cloud.bigquery_storage_v1.types.ReadStream]
Output only. A list of streams created with the session. At least one stream is created with the session. In the future, larger request_stream_count values *may* result in this list being unpopulated, in that case, the user will need to use a List method to get the streams instead, which is not yet available. |
| estimated_total_bytes_scanned |
int
Output only. An estimate on the number of bytes this session will scan when all streams are completely consumed. This estimate is based on metadata from the table which might be incomplete or stale. |
Inheritance
builtins.object > proto.message.Message > ReadSessionClasses
TableModifiers
TableModifiers(mapping=None, *, ignore_unknown_fields=False, **kwargs)
Additional attributes when reading a table.
TableReadOptions
TableReadOptions(mapping=None, *, ignore_unknown_fields=False, **kwargs)
Options dictating how we read a table.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields


--- layout: jsdoc title: "Class: SWCli" jsdocNav: - Modules: - workbox-background-sync - workbox-broadcast-cache-update - workbox-build - workbox-cache-expiration - workbox-cacheable-response - workbox-google-analytics - workbox-precaching - workbox-routing - workbox-runtime-caching - workbox-sw ---
This class is a wrapper to make test easier. This is used by ./bin/index.js to pass in the args when the CLI is used.
Generates a file manifest with revisioning details that can be used in your service worker for precaching assets.
| Returns |
Promise
Resolves when the node process exits. |
|---|
This method will generate a working service worker with a file manifest.
| Returns |
Promise
The promise returned here will be used to exit the node process cleanly or not. |
|---|
Prints the help text to the terminal.
| Returns |
string
The log output |
|---|
If a command is given in the command line args, this method will handle the appropriate action.
| Parameters |
|
|||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
Promise
A promise for the provided task. |


How RecyclerView works internally?
Let's take a deep dive into how the things work under the hood in RecyclerView.
Blog by theDroidLady
Introduction
Being an Android developer, our life revolves around recyclerViews only. Take a look on your contacts list, photos app, Facebook feed, music app showing a list of tracks, online clothing app showing you a list of products and almost every other app we have in our device is using recyclerView to show a huge set of data to users.
So Now my question is,
Have you ever got curious about the internals, how it actually works, how the data flows and displayed to the user?
Why do we need to know all these factors?
Just think about it: RecyclerView is needed almost in every modern Android app, so the way developers work with it affects the experience of millions and millions of users. We can surely find many good tutorials on how to show data list to users using recyclerView. But, Is that “black box” approach enough to handle a complex scenario where we have millions of Android devices with different rendering and performance issues?
I definitely don’t want my users to have a bad experience for my Home screen(or any other) which currently shows a list of recommended products for them. So, I wanted to know the exact process and flow to make sure I am utilizing the things in the correct approach.
Also, A famous quote about learning is :
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
Wait, Before we move to RecyclerView internals, one should be clear about why it came to existence when we already had ListView.
With ListView, We had some downsides :
-
Lag in Scrolling: ListView has a habit of creating as many views (rows) as there are data items in the dataset. This creation of views and using findViewById() method is a costly affair.
-
No Default Animations Support: ListView comes with no built-support for animations and we devs know how much time it takes to implement a perfect animation.
-
One Scrolling Orientation(Vertical): No Horizontal lists allowed. Only vertical scrolling is supported in ListView.
There are many more reasons other than the above listed which made Android devs realize that something NEW is needed which is highly optimized and comes with great capabilities.
RecyclerView: What it is?
As per Android documentation:
RecyclerView is a UI component which allows us to create a scrolling list. It is basically a new ViewGroup used to render any adapter-based view in horizontal/vertical /grid or staggered grid manner using the Viewholder pattern.
Hold on, many new terms introduced right. Don’t get confused. Let’s understand these:
We have 4 major components of RecyclerView:
-
RecyclerView.Adapter: Provides a binding from your app’s data set (which is specific to your app) to item views that are displayed within the RecyclerView. The adapter knows how to associate each item-view position in the RecyclerView to a specific location in the data source.
-
RecyclerView.LayoutManager: Positions items within the RecyclerView. You can use one of several predefined layout managers or you can implement your own custom layout manager. It can be linearly or in a grid.
-
RecyclerView.ItemAnimator: RecyclerView comes with default animations which we can override and change according to our needs. By default, RecyclerView uses DefaultItemAnimator.
-
RecyclerView.ViewHolder: It is mandatory to use with recyclerView and helps us to draw the UI for individual items that we want to draw on the screen.
Let’s understand all these through an example,
Assume, You and I are standing in front of a Burger stall and there is a huge line and at once only 4 members can be entertained. The person making it provides each of the 4 members with one plate and on preparing burgers, he put it on their plate. Another thing what he does is, he kept some plates extra and gave few to the members in line waiting to have a burger in advance and 2 to the members who already finished eating and maybe can ask for the repetition. And then the ones who already had burgers but were holding plates pass the plates to the selling guy so that he can clean them up and give them to the new 2 members in line.
So here, the selling guy is the recyclerView, the plates are the Views, the burger is Data, at once 4 members getting entertained(visible) is termed as Viewport in RecyclerView world and the idea behind using lesser number of plates is our ViewHolder as we can see the person is cleaning them and reusing them as per required. This is the main advantage of using ViewHolder as we are clearing reducing the CPU intensive task of more View Creations.
I hope we are clear with the terminology. Let’s get to the internals now.
RecyclerView: How it works?
Now, let’s understand the process:
So, There is data(item) kept in the data-set(list of items). The adapter binds data to the View and then gives it to the Layout Manager which happens to control the views.
RecyclerView does not allocate an item view for every item in your data source. Instead, it allocates only the number of item views that fit on the screen(Viewport) and it reuses those item layouts as the user scrolls. When the view first scrolls out of sight, it goes through the recycling process as shown in the above diagram:
- When a view scrolls out of sight and is no longer displayed, it becomes a scrap view.
Let’s understand the Scrap view. The Recycler has a Scrap Heap Caching System for these views:
It is a lightweight collection where views can be returned to the Layout Manager directly without passing the view back to Adapter again. This is because the data is still attached to the ViewHolder. So no need to pass it back to the Adapter for binding the data.
Views placed here, are temporarily detached but will be reused within the same layout pass.
The View just above and below the View port are the Detached Views. These views which are detached are expected to be re-attached before code returns.
- When a new item is to be displayed, a view is taken from the recycle pool for reuse. Because this view must be re-bound by the adapter before being displayed, it is called a <>bdirty view</b>.
Same like the Scrap heap, we have another caching system for these type of views which is Recycle Pool:
It is a collection which consists of views that are assumed to have incorrect data (data from a different position or index) also called the dirty view, is always passed to the adapter back so that data can be attached or bound again to the ViewHolder and then returned to the Layout Manager.
Recycler instance is provided to the Layout Manager at some points so that it can obtain new views or recycle old views.
-
The dirty view is recycled: the adapter locates the data for the next item to be displayed and copies this data to the views for this item. References for these views are retrieved from the recycler view’s view holder.
-
The recycled view is added to the list of items in the RecyclerView that is about to go on-screen.
-
The recycled view goes on-screen as the user scrolls the RecyclerView to the next item in the list. Meanwhile, another view scrolls out of sight and is recycled according to the above steps.
Each time the adapter inflates an item-layout, it also creates a corresponding ViewHolder. The ViewHolder uses FindViewById to get references to the views inside the inflated item-layout file. These references are used to load new data into the views every time the layout is recycled to show new data.
RecyclerView: Methods
When you implement an adapter, you must override the following RecyclerView.Adapter methods:
The layout manager calls these methods while it is positioning items within the RecyclerView.
If LayoutManager fails to find a suitable View in all of those places, it creates one by calling adapter’s onCreateViewHolder() method. It then binds the View via onBindViewHolder() if necessary, and finally returns it.
RecyclerView: Notifying changes
-
NotifyDataSetChanged – Signals that the data set has changed (forces a full update).
-
NotifyItemChanged – Signals that the item at the specified position has changed.
-
NotifyItemRemoved – Signals that the item in the specified position has been removed.
Like this we have notifyItemRangeInserted, notifyItemRangeRemoved , notifyItemRangeChanged. Read about these, check your scenario and use them wisely. If you know exactly how your data set has changed, you can call the appropriate methods listed above to refresh RecyclerView in the most efficient manner.
RecyclerView: Some Performance Tips
-
recyclerView.setHasFixedSize(true): If it is possible to set the width and height of the items at the XML file and they don’t change based on adapter’s content, add this line to your RecyclerView Initializing method. By this method, you told RecyclerView to don’t calculate items size every time they added and removed from RecyclerView.
-
recyclerView.setItemViewCacheSize(size): Set the number of offscreen views to retain before adding them to the potentially shared recycled view pool. So when you scroll the RecyclerView such that there’s a view that is just barely completely off-screen, the RecyclerView will keep it around so that you can scroll it back into view without having to re-execute onBindViewHolder().
-
Check how and when to use adapter.setHasStableIds(true)(This can help for the purposes of animation and visual object persistence).
References :
This is all from my side!! I hope you learned something from this article.
Enjoy reading!! Don’t forget to subscribe for more. :-)


Neal Davis
is the Training Coordinator for Computational Science and Engineering
at the University of Illinois at Urbana-Champaign,
where he conducts training across a range of traditional engineering software programs and packages.
His professional interests include engineering pedagogy,
the foundations of computing,
and the history of science.
Instructor Trainer


Reports abstract methods which override concrete methods. Methods overridden from
java.lang.Object
are not reported by this inspection.
Powered by InspectionGadgets


Class CodeInstruction
An abstract wrapper around OpCode and their operands. Used by transpilers
Inherited Members
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
public class CodeInstruction
Constructors
| Improve this Doc View SourceCodeInstruction(CodeInstruction)
Create a full copy (including labels and exception blocks) of a CodeInstruction
Declaration
public CodeInstruction(CodeInstruction instruction)
Parameters
| Type | Name | Description |
|---|---|---|
| CodeInstruction | instruction | The CodeInstruction to copy |
CodeInstruction(OpCode, Object)
Creates a new CodeInstruction with a given opcode and optional operand
Declaration
public CodeInstruction(OpCode opcode, object operand = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Emit.OpCode | opcode | The opcode |
| System.Object | operand | The operand |
Fields
| Improve this Doc View Sourceblocks
All exception block boundaries defined on this instruction
Declaration
public List<ExceptionBlock> blocks
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ExceptionBlock> |
labels
All labels defined on this instruction
Declaration
public List<Label> labels
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Reflection.Emit.Label> |
opcode
The opcode
Declaration
public OpCode opcode
Field Value
| Type | Description |
|---|---|
| System.Reflection.Emit.OpCode |
operand
The operand
Declaration
public object operand
Field Value
| Type | Description |
|---|---|
| System.Object |
Methods
| Improve this Doc View SourceCall(Expression<Action>)
Creates a CodeInstruction calling a method (CALL)
Declaration
public static CodeInstruction Call(Expression<Action> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Action> | expression | The lambda expression using the method |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
Call(LambdaExpression)
Creates a CodeInstruction calling a method (CALL)
Declaration
public static CodeInstruction Call(LambdaExpression expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.LambdaExpression | expression | The lambda expression using the method |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
Call(String, Type[], Type[])
Creates a CodeInstruction calling a method (CALL)
Declaration
public static CodeInstruction Call(string typeColonMethodname, Type[] parameters = null, Type[] generics = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | typeColonMethodname | The target method in the form |
| System.Type[] | parameters | Optional parameters to target a specific overload of the method |
| System.Type[] | generics | Optional list of types that define the generic version of the method |
Returns
| Type | Description |
|---|---|
| CodeInstruction | A code instruction that calls the method matching the arguments |
Call(Type, String, Type[], Type[])
Creates a CodeInstruction calling a method (CALL)
Declaration
public static CodeInstruction Call(Type type, string name, Type[] parameters = null, Type[] generics = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The class/type where the method is declared |
| System.String | name | The name of the method (case sensitive) |
| System.Type[] | parameters | Optional parameters to target a specific overload of the method |
| System.Type[] | generics | Optional list of types that define the generic version of the method |
Returns
| Type | Description |
|---|---|
| CodeInstruction | A code instruction that calls the method matching the arguments |
Call<T>(Expression<Action<T>>)
Creates a CodeInstruction calling a method (CALL)
Declaration
public static CodeInstruction Call<T>(Expression<Action<T>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Action<T>> | expression | The lambda expression using the method |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
Type Parameters
| Name | Description |
|---|---|
| T |
Call<T, TResult>(Expression<Func<T, TResult>>)
Creates a CodeInstruction calling a method (CALL)
Declaration
public static CodeInstruction Call<T, TResult>(Expression<Func<T, TResult>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T, TResult>> | expression | The lambda expression using the method |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
Type Parameters
| Name | Description |
|---|---|
| T | |
| TResult |
CallClosure<T>(T)
Returns an instruction to call the specified closure
Declaration
public static CodeInstruction CallClosure<T>(T closure)
where T : Delegate
Parameters
| Type | Name | Description |
|---|---|---|
| T | closure | The closure that defines the method to call |
Returns
| Type | Description |
|---|---|
| CodeInstruction | A CodeInstruction that calls the closure as a method |
Type Parameters
| Name | Description |
|---|---|
| T | The delegate type to emit |
Clone()
Clones a CodeInstruction and resets its labels and exception blocks
Declaration
public CodeInstruction Clone()
Returns
| Type | Description |
|---|---|
| CodeInstruction | A lightweight copy of this code instruction |
Clone(Object)
Clones a CodeInstruction, resets labels and exception blocks and sets its operand
Declaration
public CodeInstruction Clone(object operand)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | operand | The operand |
Returns
| Type | Description |
|---|---|
| CodeInstruction | A copy of this CodeInstruction with a new operand |
Clone(OpCode)
Clones a CodeInstruction, resets labels and exception blocks and sets its opcode
Declaration
public CodeInstruction Clone(OpCode opcode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Emit.OpCode | opcode | The opcode |
Returns
| Type | Description |
|---|---|
| CodeInstruction | A copy of this CodeInstruction with a new opcode |
LoadArgument(Int32, Boolean)
Creates a CodeInstruction loading an argument with the given index, using the shorter forms when possible
Declaration
public static CodeInstruction LoadArgument(int index, bool useAddress = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index of the argument |
| System.Boolean | useAddress | Use address of argument |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
See Also
| Improve this Doc View SourceLoadField(Type, String, Boolean)
Creates a CodeInstruction loading a field (LD[S]FLD[A])
Declaration
public static CodeInstruction LoadField(Type type, string name, bool useAddress = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The class/type where the field is defined |
| System.String | name | The name of the field (case sensitive) |
| System.Boolean | useAddress | Use address of field |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
LoadLocal(Int32, Boolean)
Creates a CodeInstruction loading a local with the given index, using the shorter forms when possible
Declaration
public static CodeInstruction LoadLocal(int index, bool useAddress = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index where the local is stored |
| System.Boolean | useAddress | Use address of local |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
See Also
| Improve this Doc View SourceStoreArgument(Int32)
Creates a CodeInstruction storing to an argument with the given index, using the shorter forms when possible
Declaration
public static CodeInstruction StoreArgument(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index of the argument |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
See Also
| Improve this Doc View SourceStoreField(Type, String)
Creates a CodeInstruction storing to a field (ST[S]FLD)
Declaration
public static CodeInstruction StoreField(Type type, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The class/type where the field is defined |
| System.String | name | The name of the field (case sensitive) |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
StoreLocal(Int32)
Creates a CodeInstruction storing to a local with the given index, using the shorter forms when possible
Declaration
public static CodeInstruction StoreLocal(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index where the local is stored |
Returns
| Type | Description |
|---|---|
| CodeInstruction |
See Also
| Improve this Doc View SourceToString()
Returns a string representation of the code instruction
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the code instruction |


Home
Workshop 1
Workshop 2
Workshop 3
Workshop 4
Workshop 5
Workshop 6
Tutorials
Hardware
Launch Box
Visualization System
Remote operation
Sensing
Flight Model
Payload Collaboration
Contact us
Write for us


|
|
|
| |||||
|
| |
-Fred Jansen, How to Land on a Comet“We finally selected the final landing site and the commands were prepared for Rosetta to launch Philae.
The way this works is that Rosetta has to be at the right point in space and aiming towards the comet, because the lander is passive. The lander is then pushed out and moves towards the comet.
...Now, the landing duration of the whole trajectory was seven hours. Now do a simple calculation: if the velocity of Rosetta is off by one centimeter per second, seven hours is 25,000 seconds. That means 252 meters wrong on the comet. So we had to know the velocity of Rosetta much better than one centimeter per second, and its location in space better than 100 meters at 500 million kilometers from Earth. That's no mean feat.”
Engineers very frequently find themselves in situations where there is one variable they want to measure or control, but they can't do so directly. Instead they must use other related variables that they can measure or control, and use a model of how these variables are related to each other. In the example of landing on a comet above, engineers wanted to control the landing position of the Philae lander. But what they had control over was the initial velocity of the Philae lander, and only to a certain level of precision.
With variables engineers want to control, they don't say that they would like the variable to be some specific value, they say that they need the variable to be within a specific range. This range may be really really tiny or relatively large, but the goal is that nothing should go wrong if the variable is within this safe range. In the example of the comet, engineers had used pictures taken by Rosetta to find a circular area on the comet with a 250 meter radius that seemed relatively safe to land in.
Engineers also don't have perfect control over the variables they do have control over. They can (roughly speaking) ensure that the variable falls into a certain range, and by using more precise instruments, they can make that range smaller until it is as small as necessary.
With variables engineers want to measure, it's not a matter of getting every single decimal digit. The true value will certainly have infinitely many decimal digits, and where would we write them all? The goal is to find a small range that the engineers know that the true value falls into. Typically this is reported as some number of decimal digits. Saying that pi begins with 3.14... is the same as saying that pi is somewhere between 3.14 and 3.15.
We can summarize the effectiveness of engineering as follows:
In order to achieve an approximate task, we only need approximate knowledge of the system and approximate control over the input parameters.
If we have a particular target interval of y-values in mind, how small are we going to have to make the interval of x-values to always land on the target?Thinking about these particular subquestions may provide some insight:
Is it always possible to "cheat" (narrow down the range of x-values so that the y-value always winds up in the desired range)?Try out the following for various functions:


Welcome to dcode!
This is a paragprah tag and this is a new line
This is item #1
This is item #2
This is item #3


This Template is responsible for creating a table of domain objects.
If you modify this template, do not forget to change the overwrite settings
in /Configuration/ExtensionBuilder/settings.yaml:
Resources:
Private:
Templates:
Archive.html: keep
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
Archive
{episodes.edate}
{episodes.catname}
{episodes.name}
{episodes.sdescription}
{episodes.edate}
{episodes.catname} :: {total.cycle}
{episodes.name}
{episodes.sdescription}


Look Up!
Your browser should be asking you to enable your webcam and microphone.
This site will not work until you provide access
.
Your browser does not appear to support WebRTC.
Try either the
latest Firefox nightly build
, or
Google Chrome Beta
to join the fun.


Families
|
|
{{family.household}} {{family.phone}} {{family.email}} |
Companions
|
|
{{companion.household}} {{companion.phone}} {{companion.email}} |
Teachers
|
|
{{teacher.household}} {{teacher.phone}} {{teacher.email}} |
Visits
|
|
{{visit.date | date : 'MMM yyyy'}} {{visit.type | capitalize }} {{visit.note | truncate:true:50}} |


A Pythagorean triplet is a set of three natural numbers, a b c, for which,
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.Find the product abc.


Hello and welcome to my website! My name is Adam Hanna and I plan to post new content to this site from time to time. I don't don't expect to stick to any one subject or another but rather plan to keep this as a general collection of my ramblings. I tend to be intereted in software development, technology and politics, so I would expect most of my post to be in one of those three categories.
If you wish to contact me, the easiest way is via [Twitter](https://twitter.com/adam_m_hanna).
My RSA fingerprint: 3D33 EE0E 8620 44EC F7FA 3CA0 2687 062E 2A4E 0E15
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJc7EQQAAoJEKOADrzu9nNIQrsP/2ROy08iUzu//z7rp+cXIgWG NuL6jtpklTkbkYPJYkrAktWRLOd32bNltch3whv8ISiDHB4Vm0ofifTfFLbh+8B3 B2qLsvskDmlj/zN+wgmzybVQj0/NI1iatTeV5BP2F1cWP+kQy/JlIDfPCK95rRVH PGHi0txn0JUJKrXUFRMePQiscRkWrE4nKC6pGxiS1ymIVP76Cn+v0+8qkr/Nhv8P 3INv/K3IcIr1Uvxso9Z1mlUNp1soY9jctcU2Ze2ElCkaX3buVhLhoVe3+Bgns6gl hzsF2lkoOnw0gLBTUqykPv+NpHTDbKTHZ/zbqc1fDnAsiQdBZbPPiADo+g54ByqT LK1QBKqDh8KTBLCorcKJBJ4W8uWZRsXE5q9Xzf5bOvLTc+LgA+SwS0AcEXM+g1QU mg84AUtabYvLZmhtm/6zJkAfJPYpIxTpixRgeJKd6QIgMBHFnd7lUfE0nF+RJPnJ a7fKhPejTYE+N/xosDZ+a5FPFnOxyeLFChpEiNLOOZeosVcLTm40jWevDP80pTJj r9HYoE583Ss2AlEDKfthWl95g6O4gnYGuEjM2hSMWHsrZmQ0BY4UJwtFp6IBXW07 RcmpEiqw1oBrIxD5WiTJaR+x223U4Q4wMqEOEImyrdz+eFYczne73Fo3aEXvkvdK wFvRoZqo81V56gK5I9t6 =gaIJ -----END PGP SIGNATURE-----


[ ok ] Checking for list of available modules...
[ ** ] Building new config
[ ** ] First let's start with some global settings...
[ ?? ] What port would you like ZNC to listen on? (1025 to 65535): 6666
[ ?? ] Would you like ZNC to listen using SSL? (yes/no) [no]: yes
[ ** ] Unable to locate pem file: [/home/graham/.znc/znc.pem]
[ ?? ] Would you like to create a new pem file now? (yes/no) [yes]: yes
[ ok ] Writing Pem file [/home/graham/.znc/znc.pem]...
[ ?? ] Would you like ZNC to listen using ipv6? (yes/no) [yes]: no
[ ?? ] Listen Host (Blank for all ips):
[ ok ] Verifying the listener...
[ ** ] -- Global Modules --
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] | Name | Description |
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] | partyline | Internal channels and queries for users connected to znc |
[ ** ] | webadmin | Web based administration module |
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] And 12 other (uncommon) modules. You can enable those later.
[ ?? ] Load global module <partyline>? (yes/no) [no]:
[ ?? ] Load global module <webadmin>? (yes/no) [no]:
[ ** ] Now we need to set up a user...
[ ?? ] Username (AlphaNumeric): grahamgilbert
[ ?? ] Would you like this user to be an admin? (yes/no) [yes]: yes
[ ?? ] Nick [grahamgilbert]:
[ ?? ] Alt Nick [grahamgilbert_]:
[ ?? ] Ident [grahamgilbert]:
[ ?? ] Real Name [Got ZNC?]: Graham Gilbert
[ ?? ] Bind Host (optional):
[ ?? ] Number of lines to buffer per channel [50]: 1000
[ ?? ] Would you like to clear channel buffers after replay? (yes/no) [yes]: yes
[ ?? ] Default channel modes [+stn]:
[ ** ] -- User Modules --
[ ** ] +--------------+------------------------------------------------------------------------------------------+
[ ** ] | Name | Description |
[ ** ] +--------------+------------------------------------------------------------------------------------------+
[ ** ] | chansaver | Keep config up-to-date when user joins/parts |
[ ** ] | controlpanel | Dynamic configuration through IRC. Allows editing only yourself if you're not ZNC admin. |
[ ** ] | perform | Keeps a list of commands to be executed when ZNC connects to IRC. |
[ ** ] +--------------+------------------------------------------------------------------------------------------+
[ ** ] And 22 other (uncommon) modules. You can enable those later.
[ ?? ] Load module <chansaver>? (yes/no) [no]: yes
[ ?? ] Load module <controlpanel>? (yes/no) [no]:
[ ?? ] Load module <perform>? (yes/no) [no]:
[ ?? ] Would you like to set up a network? (yes/no) [no]: yes
[ ?? ] Network (e.g. `freenode' or `efnet'): freenode
[ ** ] -- Network Modules --
[ ** ] +-------------+-------------------------------------------------------------------------------------------------+
[ ** ] | Name | Description |
[ ** ] +-------------+-------------------------------------------------------------------------------------------------+
[ ** ] | chansaver | Keep config up-to-date when user joins/parts |
[ ** ] | keepnick | Keep trying for your primary nick |
[ ** ] | kickrejoin | Autorejoin on kick |
[ ** ] | nickserv | Auths you with NickServ |
[ ** ] | perform | Keeps a list of commands to be executed when ZNC connects to IRC. |
[ ** ] | simple_away | This module will automatically set you away on IRC while you are disconnected from the bouncer. |
[ ** ] +-------------+-------------------------------------------------------------------------------------------------+
[ ** ] And 17 other (uncommon) modules. You can enable those later.
[ ?? ] Load module <chansaver>? (yes/no) [no]: yes
[ ?? ] Load module <keepnick>? (yes/no) [no]: no
[ ?? ] Load module <kickrejoin>? (yes/no) [no]: no
[ ?? ] Load module <nickserv>? (yes/no) [no]: no
[ ?? ] Load module <perform>? (yes/no) [no]: no
[ ?? ] Load module <simple_away>? (yes/no) [no]: yes
[ ** ] Only add servers from the same IRC network.
[ ** ] If a server from the list can't be reached, another server will be used.
[ ?? ] IRC server (host only): irc.freenode.net
[ ?? ] [irc.freenode.net] Port (1 to 65535) [6667]:
[ ?? ] [irc.freenode.net] Password (probably empty):
[ ?? ] Does this server use SSL? (yes/no) [no]:
[ ?? ] Would you like to add another server for this IRC network? (yes/no) [no]:
[ ?? ] Would you like to add a channel for ZNC to automatically join? (yes/no) [yes]: yes
[ ?? ] Channel name: ##osx-server
[ ?? ] Would you like to add another channel? (yes/no) [no]: no
[ ?? ] Would you like to set up another network? (yes/no) [no]: no
[ ?? ] Would you like to set up another user? (yes/no) [no]: no
[ ok ] Writing config [/home/vagrant/.znc/configs/znc.conf]...
[ ** ] To connect to this ZNC you need to connect to it as your IRC server
[ ** ] using the port that you supplied. You have to supply your login info
[ ** ] as the IRC server password like this: user/network:pass.
[ ** ] Try something like this in your IRC client...
[ ** ] /server <znc_server_ip> +6666 grahamgilbert:<pass>
[ ** ] And this in your browser...
[ ** ] https://<znc_server_ip>:6666/
[ ?? ] Launch ZNC now? (yes/no) [yes]: no