| ETAPA 4 (MOTOS): | General |
| Pos. | Piloto | Marca | Penalización | Diferencia |
| 1 | Pablo QUINTANILLA | Husqvarna 450 Rally Factory | 15:27:22.0 | |
| 2 | Toby PRICE | KTM 450 Rally Factory | +2:45.0 | |
| 3 | Sam SUNDERLAND | KTM 450 Rally Factory | +2:47.0 | |
| 4 | Mohammed AL BALOOSHI | KTM 450 Rally Replica | +26:01.0 | |
| 5 | Pierre Alexandre RENET | Husqvarna 450 Rally Factory | +29:30.0 | |
| 6 | Jakub PIATEK | KTM 450 Rally Replica | +42:19.0 | |
| 7 | Laia SANZ | KTM 450 Rally Factory | +43:33.0 | |
| 8 | Jose Ignacio CORNEJO | KTM 450 Rally Replica | +50:32.0 | |
| 9 | David MCBRIDE | KTM 450 Rally Replica | +59:34.0 | |
| 10 | Txomin ARANA COBEAGA | Husqvarna FR 450 Rally | +1:29:22.0 | |
| 11 | David THOMAS | Husqvarna FR 450 Rally | -3:53.0 | +2:03:02.0 |
| 12 | Khalid AL FALASI | Honda CRF 450 | +2:19:25.0 | |
| 13 | Rafal SONIK | Honda TRX 700 | +2:46:42.0 | |
| 14 | Camelia LIPAROTI | Yamaha Raptor 700 | 5:30.0 | +4:13:44.0 |
| 15 | Pawel STASIACZEK | KTM 450 Rally Replica | 5:00.0 | +4:46:24.0 |
| 16 | Ibrahim ALRUBAIAN | KTM 450 Rally Replica | +4:57:58.0 | |
| 17 | Scott BRITNELL | Husqvarna FE450 | +5:02:50.0 | |
| 18 | David MABBS | KTM 450 Rally Replica | +5:08:52.0 | |
| 19 | Ben YOUNG | KTM 450 Rally Replica | +5:42:06.0 | |
| 20 | Paul MIDDLETON | KTM 450 Rally Replica | +5:58:05.0 | |
| 21 | Rosa ROMERO FONT | KTM 450 Rally Replica | +6:01:17.0 | |
| 22 | Jubany HERMS FERRAN | KTM 450 Rally Replica | +6:05:01.0 | |
| 23 | Joikef SVEINBJORNSSON | Husqvarna FR 450 Rally | 30:00.0 | +6:30:26.0 |
| 24 | Arjan BOS | Husqvarna FR 450 Rally | +7:08:10.0 | |
| 25 | Thomas PREUSS | KTM 450 Rally Replica | 1:00.0 | +8:23:07.0 |
| 26 | Stephan PREUSS | KTM 450 Rally Replica | +8:26:03.0 | |
| 27 | Kees KOOLEN | Honda TRX 680 | 7:10:00.0 | +13:35:37.0 |
| 28 | Jacob SMITH | Honda CRF 450 R | 6:30:36.0 | +14:19:01.0 |
| 29 | Helder RODRIGUES | Yamaha WR 450 | 13:30:00.0 | +18:42:44.0 |
| 30 | Mark DAVIDSON | KTM SXF 450 | 25:06:36.0 | +38:35:03.0 |
| 31 | Ignacio CASALE | Yamaha Raptor 700 | 32:05:00.0 | +38:41:03.0 |
| 32 | Ibrahim BUGLA | Honda CRF 490 | 52:45:00.0 | +66:32:27.0 |
| 33 | Jan ZATKO | Honda CRF 450 | 64:25:00.0 | +81:05:21.0 |
| 34 | Deniz ALGUN | KTM EXC500 | 78:25:00.0 | +98:00:20.0 |
| 35 | Tony SCHATTAT | KTM 450 Rally Replica | 91:25:00.0 | +111:00:05.0 |


--- title: Route Rules Alpha 1 overview: Configuration affecting traffic routing location: https://istio.io/docs/reference/config/istio.routing.v1alpha1.html layout: protoc-gen-docs ---
Configuration affecting traffic routing. Here are a few terms useful to define in the context of routing rules.
Service is a unit of an application with a unique name that other services use to refer to the functionality being called. Service instances are pods/VMs/containers that implement the service.
Service versions - In a continuous deployment scenario, for a given service, there can be multiple sets of instances running potentially different variants of the application binary. These variants are not necessarily different API versions. They could be iterative changes to the same service, deployed in different environments (prod, staging, dev, etc.). Common scenarios where this occurs include A/B testing, canary rollouts, etc. The choice of a particular version can be decided based on various criterion (headers, url, etc.) and/or by weights assigned to each version. Each service has a default version consisting of all its instances.
Source - downstream client (browser or another service) calling the Envoy proxy/sidecar (typically to reach another service).
Destination - The remote upstream service to which the Envoy proxy/sidecar is talking to, on behalf of the source service. There can be one or more service versions for a given service (see the discussion on versions above). Envoy would choose the version based on various routing rules.
Access model - Applications address only the destination service without knowledge of individual service versions. The actual choice of the version is determined by Envoy, enabling the application code to decouple itself from the evolution of dependent services.
Load balancing algorithms supported by Envoy.
| Name | Description |
|---|---|
ROUND_ROBIN |
Simple round robin policy. |
LEAST_CONN |
The least request load balancer uses an O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. |
RANDOM |
The random load balancer selects a random healthy host. The random load balancer generally performs better than round robin if no health checking policy is configured. |
Circuit breaker configuration for Envoy. The circuit breaker implementation is fine-grained in that it tracks the success/failure rates of individual hosts in the load balancing pool. Hosts that continually return errors for API calls are ejected from the pool for a pre-defined period of time. See Envoy’s circuit breaker and outlier detection for more details.
| Field | Type | Description |
|---|---|---|
simpleCb |
CircuitBreaker.SimpleCircuitBreakerPolicy (oneof) |
|
custom |
google.protobuf.Any (oneof) |
(– For proxies that support custom circuit breaker policies. –) |
A simple circuit breaker can be set based on a number of criteria such as connection and request limits. For example, the following destination policy sets a limit of 100 connections to “reviews” service version “v1” backends.
metadata:
name: reviews-cb-policy
namespace: default
spec:
destination:
name: reviews
labels:
version: v1
circuitBreaker:
simpleCb:
maxConnections: 100
The following destination policy sets a limit of 100 connections and 1000 concurrent requests, with no more than 10 req/connection to “reviews” service version “v1” backends. In addition, it configures hosts to be scanned every 5 mins, such that any host that fails 7 consecutive times with 5XX error code will be ejected for 15 minutes.
metadata:
name: reviews-cb-policy
namespace: default
spec:
destination:
name: reviews
labels:
version: v1
circuitBreaker:
simpleCb:
maxConnections: 100
httpMaxRequests: 1000
httpMaxRequestsPerConnection: 10
httpConsecutiveErrors: 7
sleepWindow: 15m
httpDetectionInterval: 5m
| Field | Type | Description |
|---|---|---|
maxConnections |
int32 |
Maximum number of connections to a backend. |
httpMaxPendingRequests |
int32 |
Maximum number of pending requests to a backend. Default 1024 |
httpMaxRequests |
int32 |
Maximum number of requests to a backend. Default 1024 |
sleepWindow |
google.protobuf.Duration |
Minimum time the circuit will be open. format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is 30s. |
httpConsecutiveErrors |
int32 |
Number of 5XX errors before circuit is opened. Defaults to 5. |
httpDetectionInterval |
google.protobuf.Duration |
Time interval between ejection sweep analysis. format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s. |
httpMaxRequestsPerConnection |
int32 |
Maximum number of requests per connection to a backend. Setting this parameter to 1 disables keep alive. |
httpMaxEjectionPercent |
int32 |
Maximum % of hosts in the load balancing pool for the destination service that can be ejected by the circuit breaker. Defaults to 10%. |
httpMaxRetries |
int32 |
Maximum number of retries that can be outstanding to all hosts in a cluster at a given time. Defaults to 3. |
Describes the Cross-Origin Resource Sharing (CORS) policy, for a given service. Refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for further details about cross origin resource sharing. For example, the following rule restricts cross origin requests to those originating from example.com domain using HTTP POST/GET, and sets the Access-Control-Allow-Credentials header to false. In addition, it only exposes X-Foo-bar header and sets an expiry period of 1 day.
metadata:
name: my-rule
namespace: default
spec:
destination:
name: ratings
route:
- labels:
version: v1
corsPolicy:
allowOrigin:
- example.com
allowMethods:
- POST
- GET
allowCredentials: false
allowHeaders:
- X-Foo-Bar
maxAge: "1d"
| Field | Type | Description |
|---|---|---|
allowOrigin |
string[] |
The list of origins that are allowed to perform CORS requests. The content will be serialized into the Access-Control-Allow-Origin header. Wildcard * will allow all origins. |
allowMethods |
string[] |
List of HTTP methods allowed to access the resource. The content will be serialized into the Access-Control-Allow-Methods header. |
allowHeaders |
string[] |
List of HTTP headers that can be used when requesting the resource. Serialized to Access-Control-Allow-Methods header. |
exposeHeaders |
string[] |
A white list of HTTP headers that the browsers are allowed to access. Serialized into Access-Control-Expose-Headers header. |
maxAge |
google.protobuf.Duration |
Specifies how long the the results of a preflight request can be cached. Translates to the Access-Control-Max-Age header. |
allowCredentials |
google.protobuf.BoolValue |
Indicates whether the caller is allowed to send the actual request (not the preflight) using credentials. Translates to Access-Control-Allow-Credentials header. |
DestinationPolicy defines client/caller-side policies that determine how to handle traffic bound to a particular destination service. The policy specifies configuration for load balancing and circuit breakers. For example, a simple load balancing policy for the ratings service would look as follows:
metadata:
name: ratings-lb-policy
namespace: default # optional (default is "default")
spec:
destination:
name: ratings
loadBalancing:
name: ROUND_ROBIN
The FQDN of the destination service is composed from the destination name and meta namespace fields, along with a platform-specific domain suffix (e.g. on Kubernetes, “reviews” + “default” + “svc.cluster.local” -> “reviews.default.svc.cluster.local”).
A destination policy can be restricted to a particular version of a service or applied to all versions. It can also be restricted to calls from a particular source. For example, the following load balancing policy applies to version v1 of the ratings service running in the prod environment but only when called from version v2 of the reviews service:
metadata:
name: ratings-lb-policy
namespace: default
spec:
source:
name: reviews
labels:
version: v2
destination:
name: ratings
labels:
env: prod
version: v1
loadBalancing:
name: ROUND_ROBIN
Note: Destination policies will be applied only if the corresponding tagged instances are explicitly routed to. In other words, for every destination policy defined, at least one route rule must refer to the service version indicated in the destination policy.
| Field | Type | Description |
|---|---|---|
destination |
IstioService |
Optional: Destination uniquely identifies the destination service associated with this policy. |
source |
IstioService |
Optional: Source uniquely identifies the source service associated with this policy. |
loadBalancing |
LoadBalancing |
Load balancing policy. |
circuitBreaker |
CircuitBreaker |
Circuit breaker policy. |
custom |
google.protobuf.Any |
(– Other custom policy implementations –) |
Each routing rule is associated with one or more service versions (see glossary in beginning of document). Weights associated with the version determine the proportion of traffic it receives. For example, the following rule will route 25% of traffic for the “reviews” service to instances with the “v2” tag and the remaining traffic (i.e., 75%) to “v1”.
metadata:
name: my-rule
namespace: default
spec:
destination:
name: reviews
route:
- labels:
version: v2
weight: 25
- labels:
version: v1
weight: 75
| Field | Type | Description |
|---|---|---|
destination |
IstioService |
Sometimes required. Optional destination uniquely identifies the destination service. If not specified, the value is inherited from the parent route rule. |
labels |
map<string, string> |
Sometimes required. Service version identifier for the destination service. (– N.B. The map is used instead of pstruct due to lack of serialization support in golang protobuf library (see https://github.com/golang/protobuf/pull/208) –) |
weight |
int32 |
REQUIRED. The proportion of traffic to be forwarded to the service version. (0-100). Sum of weights across destinations SHOULD BE == 100. If there is only destination in a rule, the weight value is assumed to be 100. When using multiple weights, either destination or labels must be specified. |
Egress rules describe the properties of a service outside Istio. When transparent proxying is used, egress rules signify a white listed set of domains that microserves in the mesh are allowed to access. A subset of routing rules and all destination policies can be applied on the service targeted by an egress rule. The destination of an egress rule is allowed to contain wildcards (e.g., *.foo.com). Currently, only HTTP-based services can be expressed through the egress rule. If TLS origination from the sidecar is desired, the protocol associated with the service port must be marked as HTTPS, and the service is expected to be accessed over HTTP (e.g., http://gmail.com:443). The sidecar will automatically upgrade the connection to TLS when initiating a connection with the external service.
For example, the following egress rule describes the set of services hosted under the *.foo.com domain
kind: EgressRule
metadata:
name: foo-egress-rule
spec:
destination:
service: *.foo.com
ports:
- port: 80
protocol: http
- port: 443
protocol: https
| Field | Type | Description |
|---|---|---|
destination |
IstioService |
REQUIRED: Hostname or a wildcard domain name associated with the external service. ONLY the “service” field of destination will be taken into consideration. Name, namespace, domain and labels are ignored. Routing rules and destination policies that refer to these external services must have identical specification for the destination as the corresponding egress rule. Wildcard domain specifications must conform to format allowed by Envoy’s Virtual Host specification, such as “.foo.com” or “-bar.foo.com”. The character ‘’ in a domain specification indicates a non-empty string. Hence, a wildcard domain of form “-bar.foo.com” will match “baz-bar.foo.com” but not “-bar.foo.com”. |
ports |
EgressRule.Port[] |
REQUIRED: list of ports on which the external service is available. |
useEgressProxy |
bool |
Forward all the external traffic through a dedicated egress proxy. It is used in some scenarios where there is a requirement that all the external traffic goes through special dedicated nodes/pods. These dedicated egress nodes could then be more closely monitored for security vulnerabilities. The default is false, i.e. the sidecar forwards external traffic directly to the external service. |
Port describes the properties of a specific TCP port of an external service.
| Field | Type | Description |
|---|---|---|
port |
int32 |
A valid non-negative integer port number. |
protocol |
string |
The protocol to communicate with the external services. MUST BE one of HTTP|HTTPS|GRPC|HTTP2. |
HTTPFaultInjection can be used to specify one or more faults to inject while forwarding http requests to the destination specified in the route rule. Fault specification is part of a route rule. Faults include aborting the Http request from downstream service, and/or delaying proxying of requests. A fault rule MUST HAVE delay or abort or both.
Note: Delay and abort faults are independent of one another, even if both are specified simultaneously.
| Field | Type | Description |
|---|---|---|
delay |
HTTPFaultInjection.Delay |
Delay requests before forwarding, emulating various failures such as network issues, overloaded upstream service, etc. |
abort |
HTTPFaultInjection.Abort |
Abort Http request attempts and return error codes back to downstream service, giving the impression that the upstream service is faulty. |
Abort specification is used to prematurely abort a request with a pre-specified error code. The following example will return an HTTP 400 error code for 10% of the requests to the “ratings” service “v1”.
metadata:
name: my-rule
spec:
destination:
name: reviews
route:
- labels:
version: v1
httpFault:
abort:
percent: 10
httpStatus: 400
The httpStatus field is used to indicate the HTTP status code to return to the caller. The optional percent field, a value between 0 and 100, is used to only abort a certain percentage of requests. If not specified, all requests are aborted.
| Field | Type | Description |
|---|---|---|
percent |
float |
percentage of requests to be aborted with the error code provided (0-100). |
grpcStatus |
string (oneof) |
|
http2Error |
string (oneof) |
|
httpStatus |
int32 (oneof) |
REQUIRED. HTTP status code to use to abort the Http request. |
overrideHeaderName |
string |
(– Specify abort code as part of Http request. TODO: The semantics and syntax of the headers is undefined. –) |
Delay specification is used to inject latency into the request forwarding path. The following example will introduce a 5 second delay in 10% of the requests to the “v1” version of the “reviews” service.
metadata:
name: my-rule
spec:
destination:
name: reviews
route:
- labels:
version: v1
httpFault:
delay:
percent: 10
fixedDelay: 5s
The fixedDelay field is used to indicate the amount of delay in seconds. An optional percent field, a value between 0 and 100, can be used to only delay a certain percentage of requests. If left unspecified, all request will be delayed.
| Field | Type | Description |
|---|---|---|
percent |
float |
percentage of requests on which the delay will be injected (0-100) |
fixedDelay |
google.protobuf.Duration (oneof) |
REQUIRED. Add a fixed delay before forwarding the request. Format: 1h/1m/1s/1ms. MUST be >=1ms. |
exponentialDelay |
google.protobuf.Duration (oneof) |
(– Add a delay (based on an exponential function) before forwarding the request. mean delay needed to derive the exponential delay values –) |
overrideHeaderName |
string |
(– Specify delay duration as part of Http request. TODO: The semantics and syntax of the headers is undefined. –) |
HTTPRedirect can be used to send a 302 redirect response to the caller, where the Authority/Host and the URI in the response can be swapped with the specified values. For example, the following route rule redirects requests for /v1/getProductRatings API on the ratings service to /v1/bookRatings provided by the bookratings service.
metadata:
name: my-rule
namespace: default
spec:
destination:
name: ratings
match:
request:
headers:
uri: /v1/getProductRatings
redirect:
uri: /v1/bookRatings
authority: bookratings.default.svc.cluster.local
| Field | Type | Description |
|---|---|---|
uri |
string |
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix. |
authority |
string |
On a redirect, overwrite the Authority/Host portion of the URL with this value |
Describes the retry policy to use when a HTTP request fails. For example, the following rule sets the maximum number of retries to 3 when calling ratings:v1 service, with a 2s timeout per retry attempt.
metadata:
name: my-rule
namespace: default
spec:
destination:
name: ratings
route:
- labels:
version: v1
httpReqRetries:
simpleRetry:
attempts: 3
perTryTimeout: 2s
| Field | Type | Description |
|---|---|---|
simpleRetry |
HTTPRetry.SimpleRetryPolicy (oneof) |
|
custom |
google.protobuf.Any (oneof) |
(– For proxies that support custom retry policies –) |
| Field | Type | Description |
|---|---|---|
attempts |
int32 |
REQUIRED. Number of retries for a given request. The interval between retries will be determined automatically (25ms+). Actual number of retries attempted depends on the httpReqTimeout. |
perTryTimeout |
google.protobuf.Duration |
Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE >=1ms. |
overrideHeaderName |
string |
(– Downstream Service could specify retry attempts via Http header to Envoy, if Envoy supports such a feature. –) |
HTTPRewrite can be used to rewrite specific parts of a HTTP request before forwarding the request to the destination. Rewrite primitive can be used only with the DestinationWeights. The following example demonstrates how to rewrite the URL prefix for api call (/ratings) to ratings service before making the actual API call.
metadata:
name: my-rule
namespace: default
spec:
destination:
name: ratings
match:
request:
headers:
uri:
prefix: /ratings
rewrite:
uri: /v1/bookRatings
route:
- labels:
version: v1
| Field | Type | Description |
|---|---|---|
uri |
string |
rewrite the Path (or the prefix) portion of the URI with this value. If the original URI was matched based on prefix, the value provided in this field will replace the corresponding matched prefix. |
authority |
string |
rewrite the Authority/Host header with this value. |
Describes HTTP request timeout. For example, the following rule sets a 10 second timeout for calls to the ratings:v1 service
metadata:
name: my-rule
namespace: default
spec:
destination:
name: ratings
route:
- labels:
version: v1
httpReqTimeout:
simpleTimeout:
timeout: 10s
| Field | Type | Description |
|---|---|---|
simpleTimeout |
HTTPTimeout.SimpleTimeoutPolicy (oneof) |
|
custom |
google.protobuf.Any (oneof) |
(– For proxies that support custom timeout policies –) |
| Field | Type | Description |
|---|---|---|
timeout |
google.protobuf.Duration |
REQUIRED. Timeout for a HTTP request. Includes retries as well. Default 15s. format: 1h/1m/1s/1ms. MUST BE >=1ms. It is possible to control timeout per request by supplying the timeout value via x-envoy-upstream-rq-timeout-ms HTTP header. |
overrideHeaderName |
string |
(– Downstream service could specify timeout via Http header to Envoy, if Envoy supports such a feature. –) |
Ingress rules are routing rules applied to the ingress proxy pool. The ingress proxes serve as the receiving edge proxy for the entire mesh, but can also be addressed from inside the mesh. Each ingress rule defines a destination service and port. Rules that do not resolve to a service or a port in the mesh should be ignored.
The routing rules for the destination service are applied at the ingress proxy. That means the routing rule match conditions are composed and its actions are enforced. The traffic splitting for the destination service is also effective.
WARNING: This API is experimental and under active development
| Field | Type | Description |
|---|---|---|
port |
int32 |
REQUIRED: Port on which the ingress proxy listens and applies the rule. |
tlsSecret |
string |
Optional TLS secret path to apply server-side TLS context on the port. It is up to the underlying secret store to interpret the path to the secret. |
precedence |
int32 |
RECOMMENDED. Precedence is used to disambiguate the order of application of rules. A higher number takes priority. If not specified, the value is assumed to be 0. The order of application for rules with the same precedence is unspecified. |
match |
MatchCondition |
Match conditions to be satisfied for the ingress rule to be activated. |
destination |
IstioService |
REQUIRED: Destination uniquely identifies the destination service. Note: The ingress rule destination specification represents all version of the service and therefore the IstioService’s labels field MUST be empty. |
destinationPort |
int32 (oneof) |
Identifies the destination service port by value |
destinationPortName |
string (oneof) |
Identifies the destination service port by name |
IstioService identifies a service and optionally service version. The FQDN of the service is composed from the name, namespace, and implementation-specific domain suffix (e.g. on Kubernetes, “reviews” + “default” + “svc.cluster.local” -> “reviews.default.svc.cluster.local”).
| Field | Type | Description |
|---|---|---|
name |
string |
The short name of the service such as “foo”. |
namespace |
string |
Optional namespace of the service. Defaults to value of metadata namespace field. |
domain |
string |
Domain suffix used to construct the service FQDN in implementations that support such specification. |
service |
string |
The service FQDN. |
labels |
map<string, string> |
Optional one or more labels that uniquely identify the service version. Note: When used for a RouteRule destination, labels MUST be empty. |
(– Faults can be injected into the connections from downstream by the Envoy, for testing the failure recovery capabilities of downstream services. Faults include aborting the connection from downstream service, delaying proxying of connection to the destination service, and throttling the bandwidth of the connection (either end). Bandwidth throttling for failure testing should not be confused with the rate limiting policy enforcement provided by the Mixer component. L4 fault injection is not supported at the moment. –)
| Field | Type | Description |
|---|---|---|
throttle |
L4FaultInjection.Throttle |
Unlike Http services, we have very little context for raw Tcp|Udp connections. We could throttle bandwidth of the connections (slow down the connection) and/or abruptly reset (terminate) the Tcp connection after it has been established. We first throttle (if set) and then terminate the connection. |
terminate |
L4FaultInjection.Terminate |
Abruptly reset (terminate) the Tcp connection after it has been established, emulating remote server crash or link failure.
| Field | Type | Description |
|---|---|---|
percent |
float |
percentage of established Tcp connections to be terminated/reset |
terminateAfterPeriod |
google.protobuf.Duration |
TODO: see if it makes sense to create a generic Duration type to express time interval related configs. |
Bandwidth throttling for Tcp and Udp connections
| Field | Type | Description |
|---|---|---|
percent |
float |
percentage of connections to throttle. |
downstreamLimitBps |
int64 |
bandwidth limit in “bits” per second between downstream and Envoy |
upstreamLimitBps |
int64 |
bandwidth limits in “bits” per second between Envoy and upstream |
throttleAfterPeriod |
google.protobuf.Duration (oneof) |
Wait a while after the connection is established, before starting bandwidth throttling. This would allow us to inject fault after the application protocol (e.g., MySQL) has had time to establish sessions/whatever handshake necessary. |
throttleAfterBytes |
double (oneof) |
Alternatively, we could wait for a certain number of bytes to be transferred to upstream before throttling the bandwidth. |
throttleForPeriod |
google.protobuf.Duration |
Stop throttling after the given duration. If not set, the connection will be throttled for its lifetime. |
(– L4 connection match attributes. Note that L4 connection matching support is incomplete. –)
| Field | Type | Description |
|---|---|---|
sourceSubnet |
string[] |
IPv4 or IPv6 ip address with optional subnet. E.g., a.b.c.d/xx form or just a.b.c.d |
destinationSubnet |
string[] |
IPv4 or IPv6 ip address of destination with optional subnet. E.g., a.b.c.d/xx form or just a.b.c.d. This is only valid when the destination service has several IPs and the application explicitly specifies a particular IP. |
Load balancing policy to use when forwarding traffic. These policies directly correlate to load balancer types supported by Envoy. Example,
metadata:
name: reviews-lb-policy
namespace: default
spec:
destination:
name: reviews
loadBalancing:
name: RANDOM
| Field | Type | Description |
|---|---|---|
name |
LoadBalancing.SimpleLBPolicy (oneof) |
Load balancing policy name (as defined in SimpleLBPolicy below) |
custom |
google.protobuf.Any (oneof) |
(– Custom LB policy implementations –) |
Match condition specifies a set of criterion to be met in order for the route rule to be applied to the connection or HTTP request. The condition provides distinct set of conditions for each protocol with the intention that conditions apply only to the service ports that match the protocol. For example, the following route rule restricts the rule to match only requests originating from “reviews:v2”, accessing ratings service where the URL path starts with /ratings/v2/ and the request contains a “cookie” with value “user=jason”,
metadata:
name: my-rule
namespace: default
spec:
destination:
name: ratings
match:
source:
name: reviews
labels:
version: v2
request:
headers:
cookie:
regex: "^(.*?;)?(user=jason)(;.*)?"
uri:
prefix: "/ratings/v2/"
MatchCondition CANNOT be empty. At least one source or request header must be specified.
| Field | Type | Description |
|---|---|---|
source |
IstioService |
Identifies the service initiating a connection or a request. |
tcp |
L4MatchAttributes |
(– Set of layer 4 match conditions based on the IP ranges –) |
udp |
L4MatchAttributes |
(– Set of layer 4 match conditions based on the IP ranges –) |
request |
MatchRequest |
Attributes of an HTTP request to match. |
MatchRequest specifies the attributes of an HTTP request to be used for matching a request.
| Field | Type | Description |
|---|---|---|
headers |
map<string, StringMatch> |
Set of HTTP match conditions based on HTTP/1.1, HTTP/2, GRPC request metadata, such as uri, scheme, authority. The header keys must be lowercase and use hyphen as the separator, e.g. x-request-id. Header values are case-sensitive and formatted as follows: exact: “value” or just “value” for exact string match prefix: “value” for prefix-based match regex: “value” for ECMAscript style regex-based match Note 1: The keys uri, scheme, method, and authority correspond to URI, protocol scheme (e.g., HTTP, HTTPS), HTTP method (e.g., GET, POST), and the HTTP Host header respectively. Note 2: uri can be used to perform URL matches. For all HTTP headers including uri, exact, prefix and ECMA style regular expression matches are supported. |
Route rule provides a custom routing policy based on the source and destination service versions and connection/request metadata. The rule must provide a set of conditions for each protocol (TCP, UDP, HTTP) that the destination service exposes on its ports.
The rule applies only to the ports on the destination service for which it provides protocol-specific match condition, e.g. if the rule does not specify TCP condition, the rule does not apply to TCP traffic towards the destination service.
For example, a simple rule to send 100% of incoming traffic for a “reviews” service to version “v1” can be specified as follows:
metadata:
name: my-rule
namespace: default # optional (default is "default")
spec:
destination:
name: reviews
namespace: my-namespace # optional (default is metadata namespace field)
route:
- labels:
version: v1
weight: 100
| Field | Type | Description |
|---|---|---|
destination |
IstioService |
REQUIRED: Destination uniquely identifies the destination associated with this routing rule. This field is applicable for hostname-based resolution for HTTP traffic as well as IP-based resolution for TCP/UDP traffic. Note: The route rule destination specification represents all version of the service and therefore the IstioService’s labels field MUST be empty. |
precedence |
int32 |
RECOMMENDED. Precedence is used to disambiguate the order of application of rules for the same destination service. A higher number takes priority. If not specified, the value is assumed to be 0. The order of application for rules with the same precedence is unspecified. |
match |
MatchCondition |
Match condtions to be satisfied for the route rule to be activated. If match is omitted, the route rule applies only to HTTP traffic. |
route |
DestinationWeight[] |
REQUIRED (route|redirect). A routing rule can either redirect traffic or forward traffic. The forwarding target can be one of several versions of a service (see glossary in beginning of document). Weights associated with the service version determine the proportion of traffic it receives. |
redirect |
HTTPRedirect |
REQUIRED (route|redirect). A routing rule can either redirect traffic or forward traffic. The redirect primitive can be used to send a HTTP 302 redirect to a different URI or Authority. |
rewrite |
HTTPRewrite |
Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with Redirect primitive. Rewrite will be performed before forwarding. |
websocketUpgrade |
bool |
Indicates that a HTTP/1.1 client connection to this particular route should be allowed (and expected) to upgrade to a WebSocket connection. The default is false. Envoy expects the first request to this route to contain the WebSocket upgrade headers. Otherwise, the request will be rejected. |
httpReqTimeout |
HTTPTimeout |
Timeout policy for HTTP requests. |
httpReqRetries |
HTTPRetry |
Retry policy for HTTP requests. |
httpFault |
HTTPFaultInjection |
Fault injection policy to apply on HTTP traffic |
l4Fault |
L4FaultInjection |
(– L4 fault injection policy applies to Tcp/Udp (not HTTP) traffic –) |
mirror |
IstioService |
Mirror HTTP traffic to a another destination in addition to forwarding the requests to the intended destination. Mirrored traffic is on best effort basis where Envoy will not wait for the mirrored cluster to respond before returning the response from the original destination. Statistics will be generated for the mirrored destination. |
corsPolicy |
CorsPolicy |
Cross-Origin Resource Sharing policy (CORS). Refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for further details about cross origin resource sharing. |
appendHeaders |
map<string, string> |
Additional HTTP headers to add before forwarding a request to the destnation service. |
Describes how to match a given string in HTTP headers. Match is case-sensitive.
| Field | Type | Description |
|---|---|---|
exact |
string (oneof) |
exact string match |
prefix |
string (oneof) |
prefix-based match |
regex |
string (oneof) |
ECMAscript style regex-based match |


{%extends 'base.html'%} {%load static %} {%block body%} From {{old.auther}} {{old.title}} {{old.time_upload}} by {{old.auther}} {{old.overview}} {{old.body_text|safe}} Edit This Ticket! {%csrf_token%} Title Of Ticket Overview Slug of Ticket Ticket! {{old.body_text}} Submit {%endblock%}
{{old.time_upload}} by {{old.auther}}
{{old.overview}}
{{old.body_text|safe}}


| Term | Definition |
|---|---|
| Cybersecurity | Protection of information systems, programs, and data from unauthorized access, modification, and destruction |
| Hacker | Someone who uses a computer to get unauthorized access to an information system, program, or data |
| Vulnerability | A weakness in the system's security defenses that hackers can take advantage of |
| Exposure | An weakness in a computer system that could become a vulnerability |
| Common Vulnerabilities and Exposures (CVE) Database | Existent vulnerabilities organized by products, vendor, severity, patches, etc listed at nvd.nist.gov |
| Exploit | Software used by hackers that takes advantage of a vulnerability to acquire unauthorized access to a system |
| Exploit-DB Database of Exploits | Collection of exploits, made public to help security researchers, found at exploit-db.com |
| Keylogging | An attack method that hackers use to collect (log) the keys that are pressed on a keyboard so they can get information |
| Patching | Updating your computer to an improved version of software that fixes bugs and vulnerabilities |
| Social Engineering | Manipulating people psychologically to convince them to do specific actions or give away confidential information. |
| Phishing | A social engineering attack where hackers pretend to be a trustworthy party to acquire your personal information such as your credit card details, passwords, etc |
| SMS Phishing (Smishing) | A form of phishing using text messages |
| Voice Phishing (Vishing) | A form of phishing using phone calls or voice messages |
| Whaling | Targeting people of authority using social engineering |
| Watering Hole attack | When a website of interest of a certain group is infected with malware to exploit the group |
| Denial of service (DoS) attack | An attack that makes a user's system or network unavailable by sending a lot of traffic to the system (flooding) or sending data that makes the system crash |
| Botnet | A group of internet-connected systems controlled by malware |
| Distributed Denial of service (DDoS) attack | When a hacker uses a botnet to execute a DoS attack |
| Shoulder Surfing | When someone is able to see a user's keyboard or screen; This allows them to gain information from the user |
| Malware | A broad term for any malicious software such as viruses, ransomware, worm, etc. used by hackers |
| Computer Virus | A type of malware that attaches itself to a program and runs when the program is launched |
| Computer Worm | Malware that replicates itself to spread from computer to computer |
| Ransomware | A form of malware where the attacker locks the user out of their computer and demands a ransom from the user |
| Trojan | Malware that is disguised as a helpful program that, once opened, can give the attacker access to your computer |
| Client-server network | The server is a powerful computer that provides services to less powerful computers knows as clients |
| FTP (File Transfer Protocol) | A network protocol used to transfer files between a client and server computer |
| HTTP (Hypertext Transfer Protocol) | Used to define how messages are formatted and transmitted over the World Wide Web |


the actual processing logic of the execution context
child execution contexts
this is where you could store some temp data to be shared between different lifecycle hook if needed.
a unique id computed based on the rule and root object of the rule if suppressDuplicateTask mode is true, two paths in the rule that result in the same rule evaluation against the same object should have same contextId
parent execution context
the execution response
the object passed to a rule as the root object
the associated rule
Generated using TypeDoc
the context for current rule execution


Auditor General’s work being undermined by state institutions – CSOs worried
Civil Society Organizations (CSOs) in Ghana have expressed worry over what they say is an attempt to undermine the work of the Auditor-General, Daniel Domelevo, by some state agencies.
A release by CSOs said even though Mr Dormelevo was vigorously pursuing his constitutionally-mandated functions and acting without fear or favour in auditing and surcharging a number of state institutions he has courted the anger of some ruling party supporters.
The CSOs said they believed the purported procurement procedural challenge for which the Mr Dormelevo was currently being harassed could have been cured but various state agencies decided to teach the Auditor General a lesson.
The CSOs have, therefore, given reasons for which they believe the Auditor-General is being undermined.
Reasons for which CSOs believe the Auditor-General’s work is being undermined include:
An on-going feud between the Audit Service Board and the Auditor General.
The non-approval of the concurrent application for ratification by PPA despite establishing that there was value for money and found no malfeasance or dissipation of public money by the Auditor-General.
EOCO’s decision to still investigate the matter in the first place, after the PPA has established value for money, and had not found any malfeasance or dissipation of public money.
The Alliance for Accountable Governance (AFAG), an NPP-affiliated pressure group calling for the Attorney General to take action on the PPA report, as well as calling for the removal of the Auditor General.


RSTARTD(1) RSTARTD(1) NAME rstartd - a sample implementation of a Remote Start rsh helper SYNOPSIS rstartd rstartd.real [-c configfilename] DESCRIPTION Rstartd is an implementation of a Remote Start "helper" as defined in "A Flexible Remote Execution Protocol Based on rsh". This document describes the peculiarities of rstartd and how it is con‐ figured. OPTIONS -c configfilename This option specifies the "global" configuration file that rstartd is to read. Normally, rstartd is a shell script that invokes rstartd.real with the -c switch, allowing local configu‐ ration of the location of the configuration file. If rstartd.real is started without the -c option, it reads /usr/lib/X11/rstart/config. INSTALLATION It is critical to successful interoperation of the Remote Start protocol that rstartd be installed in a directory which is in the "default" search path, so that default rsh requests and the ilk will be able to find it. CONFIGURATION AND OPERATION Rstartd is by design highly configurable. One would like things like configuration file locations to be fixed, so that users and administra‐ tors can find them without searching, but reality is that no two vendors will agree on where things should go, and nobody thinks the original location is "right". Thus, rstartd allows one to relocate all of its files and directories. Rstartd has a hierarchy of configuration files which are executed in order when a request is made. They are: global config per-user ("local") config global per-context config per-user ("local") per-context config config from request As you might guess from the presence of "config from request", all of the config files are in the format of an rstart request. Rstartd defines a few additional keywords with the INTERNAL- prefix for specifying its con‐ figuration. Rstartd starts by reading and executing the global config file. This file will normally specify the locations of the other configuration files and any systemwide defaults. Rstartd will then read the user's local config file, default name $HOME/.rstart. Rstartd will then start interpreting the request. Presumably one of the first lines in the request will be a CONTEXT line. The context name is converted to lower case. Rstartd will read the global config file for that context, default name /usr/lib/X11/rstart/contexts/<name>, if any. It will then read the user's config file for that context, default name $HOME/.rstart.contexts/<name>, if any. (If neither of these exists, rstartd aborts with a Failure message.) Rstartd will finish interpreting the request, and execute the program specified. This allows the system administrator and the user a large degree of con‐ trol over the operation of rstartd. The administrator has final say, because the global config file doesn't need to specify a per-user config file. If it does, however, the user can override anything from the global file, and can even completely replace the global context config files. The config files have a somewhat more flexible format than requests do; they are allowed to contain blank lines and lines beginning with "#" are comments and ignored. (#s in the middle of lines are data, not comment markers.) Any commands run are provided a few useful pieces of information in envi‐ ronment variables. The exact names are configurable, but the supplied defaults are: $RSTART_CONTEXT the name of the context $RSTART_GLOBAL_CONTEXTS the global contexts directory $RSTART_LOCAL_CONTEXTS the local contexts directory $RSTART_GLOBAL_COMMANDS the global generic commands directory $RSTART_LOCAL_COMMANDS the local generic commands directory $RSTART_{GLOBAL,LOCAL}_CONTEXTS should contain one special file, @List, which contains a list of the contexts in that directory in the format specified for ListContexts. The supplied version of ListContexts will cat both the global and local copies of @List. Generic commands are searched for in several places: (defaults) per-user per-context directory ($HOME/.rstart.commands/<context>) global per-context directory (/usr/lib/X11/rstart/commands/<context>) per-user all-contexts directory ($HOME/.rstart.commands) global all-contexts directory (/usr/lib/X11/rstart/commands) (Yes, this means you can't have an all-contexts generic command with the same name as a context. It didn't seem like a big deal.) Each of these directories should have a file called @List that gives the names and descriptions of the commands in that directory in the format specified for ListGenericCommands. CONFIGURATION KEYWORDS There are several "special" rstart keywords defined for rstartd configu‐ ration. Unless otherwise specified, there are no defaults; related fea‐ tures are disabled in this case. INTERNAL-REGISTRIES name ... Gives a space-separated list of "MISC" registries that this sys‐ tem understands. (Registries other than this are accepted but generate a Warning.) INTERNAL-LOCAL-DEFAULT relative_filename Gives the name ($HOME relative) of the per-user config file. INTERNAL-GLOBAL-CONTEXTS absolute_directory_name Gives the name of the system-wide contexts directory. INTERNAL-LOCAL-CONTEXTS relative_directory_name Gives the name ($HOME relative) of the per-user contexts direc‐ tory. INTERNAL-GLOBAL-COMMANDS absolute_directory_name Gives the name of the system-wide generic commands directory. INTERNAL-LOCAL-COMMANDS relative_directory_name Gives the name ($HOME relative) of the per-user generic commands directory. INTERNAL-VARIABLE-PREFIX prefix Gives the prefix for the configuration environment variables rstartd passes to its kids. INTERNAL-AUTH-PROGRAM authscheme program argv[0] argv[1] ... Specifies the program to run to set up authentication for the specified authentication scheme. "program argv[0] ..." gives the program to run and its arguments, in the same form as the EXEC keyword. INTERNAL-AUTH-INPUT authscheme Specifies the data to be given to the authorization program as its standard input. Each argument is passed as a single line. $n, where n is a number, is replaced by the n'th argument to the "AUTH authscheme arg1 arg2 ..." line. INTERNAL-PRINT arbitrary text Prints its arguments as a Debug message. Mostly for rstartd debugging, but could be used to debug config files. NOTES When using the C shell, or any other shell which runs a script every time the shell is started, the script may get run several times. In the worst case, the script may get run three times: By rsh, to run rstartd By rstartd, to run the specified command By the command, eg xterm rstartd currently limits lines, both from config files and requests, to BUFSIZ bytes. DETACH is implemented by redirecting file descriptors 0,1, and 2 to /dev/null and forking before executing the program. CMD is implemented by invoking $SHELL (default /bin/sh) with "-c" and the specified command as arguments. POSIX-UMASK is implemented in the obvious way. The authorization programs are run in the same context as the target pro‐ gram - same environment variables, path, etc. Long term this might be a problem. In the X context, GENERIC-CMD Terminal runs xterm. In the OpenWindows context, GENERIC-CMD Terminal runs cmdtool. In the X context, GENERIC-CMD LoadMonitor runs xload. In the OpenWindows context, GENERIC-CMD LoadMonitor runs perfmeter. GENERIC-CMD ListContexts lists the contents of @List in both the system- wide and per-user contexts directories. It is available in all contexts. GENERIC-CMD ListGenericCommands lists the contents of @List in the sys‐ tem-wide and per-user commands directories, including the per-context subdirectories for the current context. It is available in all contexts. CONTEXT None is not implemented. CONTEXT Default is really dull. For installation ease, the "contexts" directory in the distribution con‐ tains a file "@Aliases" which lists a context name and aliases for that context. This file is used to make symlinks in the contexts and commands directories. All MISC values are passed unmodified as environment variables.  Other than by explicitly running programs I don't think it can write or delete any files, but there's no guarantee of that.  @List files need not be complete; contexts or commands which are dull or which need not or should not be advertised need not be listed. In par‐ ticular, per-user @List files should not list things which are in the system-wide @List files. In the future, perhaps ListContexts and List‐ GenericCommands will automatically suppress lines from the system-wide files when there are per-user replacements for those lines. Error handling is OK to weak. In particular, no attempt is made to prop‐ erly report errors on the exec itself. (Perversely, exec errors could be reliably reported when detaching, but not when passing the stdin/out socket to the app.) If compiled with -DODT1_DISPLAY_HACK, rstartd will work around a bug in SCO ODT version 1. (1.1?) (The bug is that the X clients are all com‐ piled with a bad library that doesn't know how to look host names up using DNS. The fix is to look up a host name in $DISPLAY and substitute an IP address.) This is a trivial example of an incompatibility that rstart can hide. SEE ALSO rstart(1), rsh(1), A Flexible Remote Execution Protocol Based on rsh AUTHOR Jordan Brown, Quarterdeck Office Systems X Version 11 rstart 1.0.4 RSTARTD(1)


Rules
WASD - movement
Space - set pause
Esc - continue
On your way there will be obstacles - fire holes and demons.
They should be avoided!
If you're on a boar, you move faster.
If you're on a griffin, you're not afraid of fire, because you are flying


Lebanese eatery Comptoir Libanais launches its Christmas feasting menu
Make it a Middle Eastern Christmas!
by Nancy BrownLebanese eatery Comptoir Libanais has launched its Christmas feasting menu – and it had us at the word feasting!
Diners can add a Middle Eastern flavour to their festive celebrations with three courses designed to reflect the "hospitality and warmth shown in homes across the Middle East".
For £24.95, you can expect to enjoy four mezze-style starters.
Graze on fried aubergines with tahini, stuffed vegan vine leaves, harissa-spiced chicken hummus and pastry parcels filled with minced lamb.
Read more: Tesco launches its deliciously festive chocolate orange range
The mains sound delicious, too.
Opt for roasted sea bass, honey and harissa grilled chicken, lamb kofta or a veggie feta and aubergine shakshuka – a spicy slow-cooked concoction with tomatoes, peppers, onion and garlic.
Be sure to save room for dessert – arguably the tastiest course of all. Although how you're going to pick just one from this little lot is beyond us.
Read more: Morrisons is offering a free mince pie and hot drink for OAPs this Christmas
The Christmas date pudding offers a Lebanese twist on the festive favourite. It's full of sticky dates and covered in white chocolate.
Or enjoy the chocolate cheesecake, which is served with a zesty orange compote.
There's also a traditional Lebanese rose water milk pudding and an orange and almond cake.
Fans of the eatery have said of the food: "Beautifully presented – like heaven on a plate."
The Christmas feast is available till Christmas Eve. Check the website for your nearest restaurant.
Head to our Facebook page @EntertainmentDailyFix and let us know if you'll be trying the menu.


modify
add Drug
discharge
admission
add checks
Medical Record
Disease Name
Patient:
status:
InPatient
Location:
outPatient
Age:
20
Allergic history:
seafood and milk
Doctors :
Disease Detail
Recommend
Drug List
Physical Examination
2天前
天猫
×
Close
Modify Medical Record
Update the detail
Disease Name
Disease Detail
Recommend
×
Close
Add Drug
add drug for your patient
Choose Drug
Num
×
Close
Admission
Choose Ward
×
Close
Checks
Check Name
CT
X-ray
URAN
Blood test
Extra Message
×
Close
Send Message


--- title: Israel shot 118 date: 2004-04-28T00:00:00.000Z filepathOriginal: photos/IMG0121.jpg filepathThumbnail: photos/IMG0121.thumbnail.jpg filepathPreview: photos/IMG0121.preview.jpg ---
The valley of olive groves, as seen from Shorashim, opening out onto the coastal plain


Round
Current Player: 1
Current Accumulated Score:
Total Score Player 1:
Total Score Player 2:
Final Score Player 1:
Final Score Player 2:


{% extends "base.html" %} {% block title %}Err: 500{% endblock %} {% block content %}
Internal server error. We hope to have this resolved shortly.


Each slide has a code examples, some even have multiple.
You can view the example by pressing the down key
You can download the code samples right here
These slides were made with reveal.js
When creating new objects you can pass in a series of parameters to initialize fields and properties in your object
Example 1.1
public class User
{
public string Username;
public string Password;
public int Age;
}
public class Example1_1
{
public static void Example()
{
var usr = new User() {Username = "Valdemar", Password = "god123", Age = 24};
}
}
Value types cannot, as the name suggests, be null (only reference types can be null, such is the nature of reference types). The same goes for structs.
This can often be a nuisance, especially if you're processing a dataset from a database which allows null values in the columns.
Value types can be wrapped inside the Nullable
Example 1.2
public static void Example()
{
// DateTime data1 = null; -- Compiler Error!
int? data2 = null; // Works
if (!data2.HasValue)
Console.WriteLine("data2 has no value!"); // Statement will be executed
// Another way to declare a nullable object
Nullable<DateTime> date = DateTime.Now;
// The proper way to access the value
Console.WriteLine(date.Value.ToShortDateString());
// You can also use a cast
Console.WriteLine(((DateTime)date).ToShortDateString());
// This causes an Exception at runtime!
Console.WriteLine("Value of data2: " + ((int)data2));
}
The ?? operator is a special version of the ternary operator. It can be used to provide a default value if the first value is null
Example 1.3
public static void Example()
{
int? A = 5;
int? B = null;
int C = A ?? 42; // C becomes 5
int D = B ?? 42; // D becomes 42
int E = (B != null) ? (int)B : 42; // not as pretty!
}
It it my experience that delegates are not well understood by many programmers.
You can do some great things with delegates. They can help you construct more elegant and reusable code by injecting functions into your code at runtime.
Example 1.4
namespace DarkSideOfCSharp
{
public delegate void LogDelegate(string logString);
public class BusinessClass
{
// We provide a delegate property that can be assigned to at runtime
public LogDelegate Log { get; set; }
public void DoWork()
{
// ...Do some work inside this method...
// Call the Log delegate
Log("Some information");
// ...Continue working...
}
}
public class Example1_4
{
public static void Example()
{
var business = new BusinessClass();
business.Log = ConsoleLogger;
business.DoWork(); // This will print text in the console
business.Log = FileLogger;
business.DoWork(); // This will write text to file
}
public static void ConsoleLogger(string text)
{
Console.WriteLine(text);
}
public static void FileLogger(string text)
{
System.IO.File.WriteAllText(@"c:\logfile.txt", text);
}
}
}
Too few people are using Linq. Linq is awesome,
Use it more often!
The language extensions in C# allow you to use Linq queries as a first class language construct. Awesome!
Example 1.5
public class Person
{
public string Name;
public int Age;
public string Occupation;
}
public class Example1_5
{
public static void Example()
{
// Create a simple dataset
var list = new List<Person>();
list.Add(new Person() { Name = "John", Age = 24, Occupation = "Programmer" });
list.Add(new Person() { Name = "Michelle", Age = 55, Occupation = "Manager" });
list.Add(new Person() { Name = "Alex", Age = 31, Occupation = "Programmer" });
list.Add(new Person() { Name = "Jack", Age = 96, Occupation = "Retired" });
list.Add(new Person() { Name = "Audrey", Age = 13, Occupation = "Student" });
list.Add(new Person() { Name = "Lucas", Age = 17, Occupation = "Student" });
// search the set using Linq syntax
var students = from p in list where p.Occupation == "Student" select p.Name;
var programmers = from p in list where p.Occupation == "Programmer" select p.Name;
var kids = from p in list where p.Age < 18 select p.Name;
}
}
Lambdas are anonymous functions (explained later). They are mostly used in conjunction with Linq methods.
Linq methods are defined as extension methods for types like IEnumerable
Example 1.6
public class Person
{
public string Name;
public int Age;
public string Occupation;
}
public class Example1_6
{
public static void Example()
{
var list = new List<Person>();
list.Add(new Person() { Name = "John", Age = 24, Occupation = "Programmer" });
list.Add(new Person() { Name = "Michelle", Age = 55, Occupation = "Manager" });
list.Add(new Person() { Name = "Alex", Age = 31, Occupation = "Programmer" });
list.Add(new Person() { Name = "Jack", Age = 96, Occupation = "Retired" });
list.Add(new Person() { Name = "Audrey", Age = 13, Occupation = "Student" });
list.Add(new Person() { Name = "Lucas", Age = 17, Occupation = "Student" });
// search the set using lambda syntax
var students = list.Where(x => x.Occupation == "Student").Select(x => x.Name);
var programmers = list.Where(x => x.Occupation == "Programmer").Select(x => x.Name);
var kids = list.Where(x => x.Age < 18).Select(x => x.Name);
}
}
Linq defines a bunch of cool functions for IEnumerable. Learn to use them, they will make your life so much easier!
Example 1.7
public static void Example()
{
var array = new int[] { 23, 12, 5, 0, 16, 83, 56, 42 };
bool containsZero = array.Any(x => x == 0); // True
var text = new List<string>() {"Albert", "John", "Mike", "Jessica", "Lucas" };
var firstJ = text.First(x => x.StartsWith("J")); // John
var alphabetical = text.OrderBy(x => x).ToList(); // order list alphabetically
}
You can do really complex things with just one line of code.
Example 1.8
public class Person
{
public string Name;
public int Age;
public string Occupation;
}
public class Example1_8
{
public static void Example()
{
// Create a simple dataset
var list = new List<Person>();
list.Add(new Person() {Name="John", Age = 24, Occupation="Programmer"});
list.Add(new Person() {Name="Michelle", Age = 55, Occupation="Manager"});
list.Add(new Person() {Name="Alex", Age = 31, Occupation="Programmer"});
list.Add(new Person() {Name="Jack", Age = 96, Occupation="Retired"});
list.Add(new Person() {Name="Audrey", Age = 13, Occupation="Student"});
list.Add(new Person() {Name="Lucas", Age = 17, Occupation="Student"});
// Find all people over 30, take their names
// and concatename them into a string, seperated by commas
string names = list.Where(x => x.Age > 30).Select(x => x.Name)
.Aggregate((x, y) => x + ", " + y);
Console.WriteLine(names); // Prints "Michelle, Alex, Jack"
}
}
You can use preprocessor directives to affect how which parts of your code get compiled, provide warnings to Visual Studio and lots more
Example 1.9
public static void Example()
{
#if DEBUG
// #warning shows up in Visual Studio's Error List
#warning DEBUG is defined. Test code has been enabled
// You can use this for assertions, tracing and logging and it will
// automatically be removed when building in release configuration
Console.WriteLine("This statement only runs in Debug Configuration");
#endif
}
Classes and methods that are deprecated and should not be used can be marked with the [Obsolete] attribute.
It will signal Visual Studio that calling the method is not recommended and that an alternative method should be used instead.
Example 1.10
public class Example1_10_1
{
public static void Example()
{
OldMethod();
}
[Obsolete]
public static void OldMethod()
{
}
}
In C# 3.0 a short-hand syntax for properties was introduced. Use this syntax when possible
Example 1.11
public class Example1_11
{
int _val;
public int OldStyleValue
{
get { return _val; }
set { _val = value; }
}
// NewStyle has the backing field automatically implemented by the compiler
public int NewStyle { get; set; }
// You can even define different access modifiers for get and set
public static int DifferentAccessor { get; private set; }
public static void Example()
{
DifferentAccessor = 42; // only assignable inside this class
}
}
You can define your own properties and apply them to your classes and methods. Attributes only provide metadata. You can read attributes via reflection at runtime
Example 1.12
namespace DarkSideOfCSharp
{
// This is a custom Attribute. We can use it to find
// special fields in our class. We use the attribute to
// filter out which fields to log and which to skip over
public class LogAttribute : Attribute
{
public string Field;
public LogAttribute(string logField)
{
Field = logField;
}
}
public class Entity
{
public int Value; // Don't log this field
[Log("Text Message")]
public string Text;
[Log("@")]
public DateTime Time;
}
public class Example1_12
{
public static void Example()
{
var e = new Entity();
e.Text = "Some text";
e.Time = DateTime.Now;
e.Value = 56;
// Writes "Text Message: Some text @: 20.9.2012 01:12:01" to the console
LogToConsole(e);
}
public static void LogToConsole(object obj)
{
// We use reflection to get information about the class of the object
// what fields the class contains, and what attributes those fields have
var fields = obj.GetType().GetFields();
foreach (var field in fields)
{
var attr = field.GetCustomAttributes(typeof(LogAttribute), true);
if (attr.Length > 0)
Console.Write(((LogAttribute)attr[0]).Field
+ ": " + field.GetValue(obj) + " ");
}
Console.Write("\n");
}
}
}
A complete life-saver when you're writing unit tests!
Declaring this attribute in your assembly allows another assembly to access classes and methods that are internal.
Without InternalsVisibleTo:
Example 1.13
// In Assembly DarkSideOfCSharp:
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleTo("DarkSideOfCSharp.Tests")]
namespace DarkSideOfCSharp
{
public class Example1_13
{
internal static void HiddenFunction()
{
Console.WriteLine("This function can normally only be
accessed from inside this assembly");
}
}
}
// In Assembly DarkSideOfCSharp.Tests:
namespace DarkSideOfCSharp.Tests
{
class Program
{
static void Main(string[] args)
{
// This works because of the InternalsVisibleToAttribute!
Example1_13.HiddenFunction();
}
}
}
Static constructors can be very powerful if used correctly.
Use them to initialize static fields and properties that must contain the correct data the first time they are read.
Great for things like setting up configuration settings or constant values.
Example 1.14
public class Config
{
public static string DatabaseName {get; private set; }
public static string Hostname { get; private set; }
public static int TimeoutMillisec { get; private set; }
// this is a static constructor. It will run before any field,
// property or method in this class is accessed.
static Config()
{
DatabaseName = "Localhost:1234";
Hostname = "mycomputer.domain.com";
TimeoutMillisec = 1200;
}
}
public class Example1_14
{
public static void Example()
{
// Notice that I don't have to do anything before I read the values.
// The runtime initializes the class for me.
string db = Config.DatabaseName; // db = "Localhost:1234"
string host = Config.Hostname; // host = "mycomputer.domain.com"
int timeout = Config.TimeoutMillisec; // timeout = 1200
}
}
You can create static methods that act like members of a class defined somewhere else. This is not much more than syntactic sugar, but it can make your code more readable.
Example 2.1
// Extension methods must be declared inside static classes
public static class MyExtensions
{
// Note the "this" keyword before the first parameter. This is how you
// make an method behave like an extension method
public static int Index<T>(this List<T> list, Func<T, bool> expression)
{
for (int i = 0; i < list.Count; i++)
{
if (expression(list[i]))
return i;
}
return -1;
}
}
public class Example2_1
{
public static void Example()
{
var list = new List<string>()
{"John", "Mike", "Jessica", "Christina", "Michelle"};
int indexOfM = list.Index(x => x.StartsWith("M")); // returns 1
}
}
You can define complex types (even generic types), similar to typedef in C/C++, with the using keyword
Example 2.2
namespace DarkSideOfCSharp
{
// Define a "Pair" type as a Tuple of an int and a string
using Pair = Tuple<int, string>;
// Define PairList as a List of Pairs
using PairList = List<Tuple<int, string>>;
public class Example2_2
{
public static void Example()
{
PairList list = new PairList();
list.Add(new Pair(23, "Hello World"));
list.Add(new Pair(56, "More Text"));
// Prints
// System.Collections.Generic.List`1[System.Tuple`2[System.Int32,System.String]]
Console.WriteLine(list.GetType().ToString());
}
}
}
You can define methods for you classes that enables you to directly cast your objects to other types.
Implicit conversions can make code much easier to write, but very hard to understand. Make sure you only provide implicit conversion when its function it obvious and clear.
Example 2.3
public class Human
{
public string Name;
public int Age;
// This is not a very bright idea...
public static implicit operator int(Human h) { return h.Age; }
public static implicit operator string(Human h) { return h.Age.ToString(); }
//WTF mate!!?
}
public class Example2_3
{
public static void Example()
{
var human = new Human() { Name = "Valdemar", Age = 24 };
int intValue = human; // intValue = 24
string stringValue = human; // stringValue = "24" !
// You thought casting Human to string would give you the Name?
// See how easy it is to abuse and confuse you code with bad
// implicit conversions!! Use with caution!
}
}
I have shown numerous examples of lambda expressions so far. But what are they, really? We use them all the time with Linq, but how do they work?
Lambdas are actually just functions, they get compiled and ran like any other code.
When we write code like this:
bool containsFive = list.Any(x => x == 5);
The lambda expression gets compiled into a function and a delegate to that function is passed into the Any() method.
We can assign lambdas to delegates just like other method or function.
Example 2.4.1
public delegate bool MyDele1(int val);
public class Example2_4_1
{
public static void Example()
{
// create a lambda function that returns true if value is a multiple of 5
MyDele1 dele = x => (x % 5 == 0);
Console.WriteLine("7 is a multiple of 5: " + dele(7)); // "False"
Console.WriteLine("10 is a multiple of 5: " + dele(10)); // "True"
}
}
Lambdas are a form of anonymous functions; functions which are defined inside the scope of another method or function. We can also use the more "traditional" syntax to declare anonymous functions
Example 2.4.2
public delegate bool MyDele2(int val);
public class Example2_4_2
{
public static void Example()
{
// create an anonymous function without using lambda syntax
// Does the same thing as Example 2.4.1
MyDele2 dele = delegate(int x)
{
if (x % 5 == 0)
return true;
else
return false;
};
Console.WriteLine("7 is a multiple of 5: " + dele(7)); // "False"
Console.WriteLine("10 is a multiple of 5: " + dele(10)); // "True"
}
}
We can use Func<T, TResult> and Action<T> to avoid having to define our own delegates. These types were introduced in .NET 3.5.
Example 2.4.3
public static void Example()
{
// instead of having to define out own delegate with the correct signature
// we can use the type Func<T,TResult>, which was introduced in .NET 3.5
Func<int, bool> dele = x => (x % 5 == 0);
Console.WriteLine("7 is a multiple of 5: " + dele(7)); // "False"
Console.WriteLine("10 is a multiple of 5: " + dele(10)); // "True"
// Func<> takes 0...4 inputs and returns an output
// if your function returns void then we can use Action<> instead
Action<string> printIt = x => Console.WriteLine(x);
printIt("Hello World"); // prints "Hello World" to the console
}
We can even go bat-shit insane and define anonymous functions which return other anonymous functions! Welcome to functional programming.
Example 2.4.4
// Define a delegate type that returns a value that is a function
public delegate Func<int, bool> FactoryDele(int x);
public class Example2_4_4
{
public static void Example()
{
// Define a function which returns another function
FactoryDele functionFactory = x => ( val => val % x == 0 );
Func<int, bool> divisibleBy5 = functionFactory(5);
Func<int, bool> divisibleBy3 = functionFactory(3);
Console.WriteLine("7 is a divisible of 5: " + divisibleBy5(7)); // "False"
Console.WriteLine("10 is a divisible of 5: " + divisibleBy5(10)); // "True"
Console.WriteLine("7 is a divisible of 3: " + divisibleBy3(7)); // "False"
Console.WriteLine("9 is a divisible of 3: " + divisibleBy3(9)); // "True"
}
}
You may be more familiar with anonymous methods than you would think. If you've ever written Javascript, not to mention if you use JQuery, you have almost definitely used anonymous functions:
Example 2.4.6
Javascript + JQuery:
$("#button").click(function() {
alert("You clicked the button");
});
C# + WinForms:
var button1 = new Button();
button1.Text = "Click 1";
button1.Click += delegate(object sender, EventArgs e) {
MessageBox.Show("You clicked the button");
};
When people start applying functional programming patterns to your code, they often encounter a curious side effect of defining functions within functions.
Consider the next example.
What do you think it will print?
Example 2.5
public static void Example()
{
Action[] actions = null;
Action make = delegate ()
{
// this anonymous function forms a closure
// From here we can access variables declared outside this function
actions = new Action[5];
// but we can also declare variables that exist inside this closure
int i = 1;
// This probably doesn't do what you think...
for (; i <= 5; i++)
actions[i - 1] = () => Console.WriteLine("i is " + i);
};
make();
// Call all the methods
for (int i = 0; i < 5; i++)
actions[i]();
}
The answer is:
i is 6
i is 6
i is 6
i is 6
i is 6
How did that happen?
i exists inside the scope of the make() function. Since that is where the anonymous functions are created, they also reside inside that scope.
The function acts as a closure around the value i and the created functions.
When the loop condition inside make() fails, i has been incremented to 6. When we execute the functions, i still has the value of 6!
We can utilize anonymous functions and lambdas to make our code pretty and easy to read.
Example 2.6
public class Log
{
public static void Time(Action action)
{
var start = DateTime.Now;
action();
var millis = (DateTime.Now - start).TotalMilliseconds;
Console.WriteLine("Action took " + millis + " milliseconds");
}
}
public class Example2_6
{
public static void Example()
{
// how long does it take to sum all numbers between 0 and 100000000??
Log.Time(() =>
{
ulong x = 0;
for (int i = 0; i < 100000000; i++ )
x = x + (ulong)i;
});
// Prints "Action took 314,0179 milliseconds"
}
}
Just like we can have anonymous functions, we can also create anonymous types.
They come in handy in many places.
Microsoft ASP.NET MVC makes extensive use of them to return objects which are serialized to JSON
Example 2.7
public static void Example()
{
// create an object of an anonymous type
var anon = new { Name = "Valdemar", Age = 24 };
// anonymous objects are statically typed.
// You even get intellisense in Visual Studio
Console.WriteLine("Name: " + anon.Name);
//... but they're read-only!
//anon.Name = "John"; // Compiler error!
}
Example 2.7.2 (MVC example, not included in project)
public class HomeController : Controller
{
public ActionResult JsonTest()
{
// send the data as http response text to the browser
// HTTP response: "{ Name = Valdemar, Age = 24 }"
return Json(new { Name = "Valdemar", Age = 24 });
}
}
Example 2.7.3 - Create a list of anonymous types
// Don't actually do this, mmmkay?
public static List<T> CreateAnonList(T prototype)
{
return new List<T>();
}
public static void Example()
{
var anon1 = new { Name = "Valdemar", Age = 24 };
var anon2 = new { Name = "John", Age = 56 };
// Use the anonymous type as a "prototype"
// we can infer its type and create a list of that type!
var anonList = CreateAnonList(anon1);
anonList.Add(anon1);
anonList.Add(anon2);
}
I bet you didn't know C# had a goto statement?!
Thankfully you can only use goto inside the scope of a single function.
Example 3.1
public static void Example()
{
int[][][] Map = MakeData();
int x = 0;
int y = 0;
int z = 0;
for(x=0; x < 10; x++)
for (y = 0; y < 10; y++)
for (z = 0; z < 10; z++)
if(Map[x][y][z] == 25)
goto End;
End:
Console.WriteLine("Found 25 at " + x + "," + y + "," + z);
}
C# makes it very easy to call extern, native code DLLs.
The DLLImport attribute is defined in System.Runtime.InteropServices.
By using DLLImport you can also write your own Dlls in C or C++ and call them from C#.
www.pinvoke.net lists import statements for just about every WinAPI function call.
Works with Mono on Linux too! (.so files)
Example 3.2.2 Console window in WinForms applications
public class Example3_2_2
{
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool FreeConsole();
[DllImport("kernel32.dll")]
static extern bool AllocConsole();
public static void Example()
{
var form = new Form();
var button1 = new Button();
button1.Text = "Show console";
button1.Top = 10;
var button2 = new Button();
button2.Text = "Hide Console";
button2.Top = 50;
var button3 = new Button();
button3.Text = "Print time";
button3.Top = 100;
// Alternative way to accomplish the same thing using lambda syntax
button1.Click += (sender, e) => AllocConsole();
button2.Click += (sender, e) => FreeConsole();
button3.Click += (sender, e) =>
Console.WriteLine("Debug message @ " + DateTime.Now.ToLongTimeString());
form.Controls.Add(button1);
form.Controls.Add(button2);
form.Controls.Add(button3);
form.ShowDialog();
}
}
You can use any unicode character you want
for variable names.
(as long as it doesn't have special meaning in C# syntax).
...although I wouldn't recommend doing it.
Example 3.3
public static void Example()
{
decimal Verðbólguspá = 12.5M; // totally legal!
}
C# has pointers. Yup, bet you didn't know that...
You can declare and work with pointers
inside an unsafe{} context.
...and you need to explicitly tell the compiler
to allow unsafe code
Example 3.4 - Unsafe code (do not try this at home!)
public static void Example()
{
int val = 0;
unsafe
{
// allocate memory on the heap
int* arrPtr = (int*)Marshal.AllocHGlobal(100 * 4);
int i = 0;
while (i < 100)
{
*(arrPtr + 4 * i) = i * 2;
i++;
}
i = 0;
while (i < 100)
{
val = *(arrPtr + 4 * i);
Console.WriteLine(val.ToString()); // Prints 0 2 4 6 ... 198
i++;
}
}
}
Communicating with legacy code
Using native libraries with no alternative for .NET
Building plugins and modules that can interop with native hosts
Native code is faster, and I'm a speed junkie!
C# supports a special type of routines called generators.
Generators return a sequence of items, but one at a time.
They are useful for many things, an example being when you're working with large amounts of data and don't wish to load it all into memory.
Example 3.5
public class Example3_5
{
public static IEnumerable<Tuple<string, byte[]>> GetFiles(string directory)
{
var files = Directory.GetFiles(directory);
foreach (var file in files)
{
var fi = new FileInfo(file);
if (fi.Length > 1024 * 1024 * 20) // skip files larger than 20 meg
continue;
var content = File.ReadAllBytes(file);
yield return new Tuple<string, byte[]>(file, content);
}
}
public static void Example()
{
string path =
@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE";
// let's count all the zero bytes in every file in the directory
foreach (var file in GetFiles(path))
{
int count = file.Item2.Count(x => x == 0);
Console.WriteLine(file.Item1 + " contains " + count + " zero bytes");
}
}
}


 Visit "Film Freak Central" for the latest film and DVD reviews, plus essays, contests, and the proverbial much, much more! - http://filmfreakcentral.net/ - Bring a friend.)
starring Garry Shandling, Annette Bening, John Goodman, Ben Kingsley screenplay by Garry Shandling, Michael Leeson, Ed Solomon, Peter Tolan directed by Mike Nichols
To paint a picture of how immature Mike Nichols' What Planet Are You From? can get, its McGuffin is a vibrating penis. The film stoops, often, to a level of humour rarely used outside the schoolyard-or an episode of `Married With Children'. Yet there's an infectious sunshine in its comedy; Garry Shandling's first big screen starring vehicle revels in impropriety without lapsing into bad taste. My problems with What Planet Are You From? generally lie outside its sense of humour.
A Star Wars-style credit crawl recounts the development of a faraway planet populated entirely by brilliant, emotionless men. Their leader (Ben Kingsley) has chosen galactic domination as their next course of action, starting with Earth. One lucky citizen will be outfitted with an electric schlong and transported via some bizarre molecular charge to America, natch, where he will be expected to impregnate an earthling woman. `Harold Anderson' (Shandling) proves himself up to the challenge in a series of ignorantly designed tests on the art of courtship. Harold's ‘spaceship' crashes into a plane bound for Phoenix; he begins work immediately upon exiting the tiny lavatory, flirting unsuccessfully with a harried flight attendant (Judy Greer) and a passenger (Shandling's receptionist from `The Larry Sanders Show', Janeane Garofalo) who has been frightened by the faux turbulence. (`I like your shoes,' he tells her as she cries out for comfort.) On ground, Harold immediately lands an upper-level job at a non-descript financial institution, where he seeks out dating advice from philandering co-worker Perry (Greg Kinnear).
Following a few aborted flings, Harold meets recovering alcoholic Susan (a game Annette Bening), with whom he shares a desire to have a baby. They marry in Vegas and have a 21-hour honeymoon of non-stop sex. Like many a horn dog before him, Harold misunderstands his duties as a provider of emotional support thereafter, and would rather watch TV than discuss feelings with his wife.
The film's witty hook is that Susan can't tell the difference between a man and an alien-moreover, that a member of a notoriously unsympathetic alien race is anthropologically indistinguishable from sleazy Perry or Roland Jones (John Goodman), a neglectful airline insurance investigator. (Jones allows his marriage to disintegrate in his quest to expose Harold's secret identity.) As a result, Harold and Susan's interstellar divide is, amusingly, a non-issue. Still, it's not news that the sexes are eternally, and maybe extraterrestrially, engaged in silent battle, and whenever What Planet Are You From? gets its mind out of the gutter long enough to be about long term relationships, it is no more revelatory than a night at `Yuk Yuk's.
As the man responsible for The Graduate, Who's Afraid of Virginia Woolf, and Carnal Knowledge, director Nichols specializes in stories that explore the male-female dynamic, which probably made him seem the ideal choice to mount a quasi-adaptation of John Gray's soupy reference book Men Are From Mars, Women Are From Venus. Yet What Planet Are You From?'s guiding hand could be mistaken for that of John Landis or Amy Heckerling, especially given the preponderance of skin and the shabbier edges of the material (neither filmmaker is famed for his/her scrutiny): the corners of the blasé plot don't always meet and Bo Welch's outerspace sets are derivative of Men in Black's gleaming headquarters, which he also designed.
Lacking any unique political perspective, What Planet Are You From? is a high-profile T&A comedy, albeit an enjoyable one. The tone of the film is pleasantly relaxed and awfully sweet-we're barely alerted to the climax before it happens and get to spend a lot of quality time with Bening as she charms in spades. Shandling is droll, as always (as a devoted fan of `...Larry Sanders...', I admit a certain bias to the scrunch-faced actor), and, as Harold begins tearing down his emotional girders and taking responsibility for his actions, he displays an oft-muted warmth in full-force. (Shandling also makes off with the best line in the movie, say I, though to reveal it is to spoil many surprises.)
Others in the ensemble are not so successful, notably Kinnear, who fritters away the clout earned from an Oscar nomination in a role that has Sam McMurray (who played the wife-swapping boss of Nicolas Cage's character in Raising Arizona) written all over it.  If Nichols didn't have the reputation of a Woody Allen or a Robert Altman, and if the project didn't necessitate hiring big names to elevate its cachet beyond that of another coming-of-human tale, casting choices may have been a little less all-star perfunctory, and subsequently improved the picture.
-March, 2000
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Runescape Classic has 18 skills, spanning the full gamut of combat, magic, survival and creation. To complete all the challenges the world of Runescape has to offer, one must master all of them.
For a brief guide and useful calculator for each skill, check out any skill name outlined in blue.
| Attack | Defense | Strength |
|---|---|---|
| Hits | Ranged | Prayer |
| Magic | Cooking | Woodcut |
| Fletching | Fishing | Firemaking |
| Crafting | Smithing | Mining |
| Herblaw | Agility | Thieving |


EINSTEIN
What is the square root of the number in the box?
START GAME
MUTE
* Answers are always positive integers.
Enter your answer:
Submit Answer
Next Question


Dear [[contact-name]],
We're glad you took the time to send us a message.
Just so you know, this is an automated email sent from our website.
We'll be in touch with you soon to respond to your enquiry.
Regards, Company Name Here


toArray
public static <K,V,T> T[] toArray(java.util.Map<K,V> map,
T[] a)
Generates an array of entries from a map. Entries are defined in the API as
a class which consists of a key
and value
with a name
typically in the form of Key_ValueMapEntry
, represented here as
T
. The generated array can be used in objects where Key_ValueMapEntry[]
is taken as a value. The input map must have same type
K
as the key
within Key_ValueMapEntry
. The same
applies for V
and value
within Key_ValueMapEntry
.
- Type Parameters:
K
- the type of the entry keyV
- the type of the entry valueT
- the map entry type- Parameters:
map
- a map of type K
and V
representing the entry
arraya
- the array into which the entries of this map are to be stored, if
it is big enough; otherwise, a new array of the same runtime type is
allocated for this purpose
- Returns:
- an array of all map entries contained within the map parameter


| Full Statistics for June 2004 |
|---|
| Monthly Summary | |||
|---|---|---|---|
|
Total hits (any request) Total files sent (Code 200) Total files saved by cache (Code 304) Other response codes (see below) |
100.00% 81.14% 8.90% 9.96% |
7677 6229 683 765 | |
|
Total pageviews Remaining responses |
24.78% 75.22% |
1902 5775 | |
| Total KB requested Total KB transferred (Code 200) Total KB saved by cache (Code 304) |
|
100.00% 91.24% 8.76% |
76821 70094 6727 |
| Total unique URLs Total unique sites Total user sessions Total unique agents Total unique referrer URLs | 130 450 645 173 150 | ||
| Maximum | Average | ||
|
Hits per day Files sent per day Files cached per day Pageviews per day Sessions per day KB sent per day |
506 394 232 223 62 8889 |
255 207 22 63 21 2337 | |
| Logfile statistics | |||
| Total logfile entries read Total logfile entries processed Corrupt logfile entries Empty Request Method |
7692 7677 14 1 | ||
| Other Response Codes | |||
| Partial Content (Code 206) Moved Permanently (Code 301) Forbidden (Code 403) Not Found (Code 404) |
4 3 3 754 | ||
| Request Methods other than GET/POST | |||
| HEAD | 1 | ||
|


Patents
-
Ludmila Cherkasova, Abhishek Verma,
Estimating performance parameter of a job having map and reduce tasks after a failure, Filed June 2011.
-
Ludmila Cherkasova, Abhishek Verma,
Varying a characteristic of job profile relating to map and reduce tasks according to data size, Filed May 2011.
-
Abhishek Verma, Ludmila Cherkasova,
Scheduling map and reduce tasks for jobs for execution according to performance goals, Filed April 2011.
-
Ludmila Cherkasova, Abhishek Verma,
Determining an allocation of resources for a job, Filed Feb 2011.
-
Abhishek Verma, Ludmila Cherkasova,
Estimating a performance characteristic of a job using a performance model, Filed Feb 2011.


WITNESS LIST Oversight of Electric Utility Restructuring Committee September 7, 2001 - 9:00A Accenture Role at ERCOT ON: Mueller, Keith (Accenture), Reston, VA East Texas (Non-ERCOT) Systems ON: Brown, Nick (Southwest Power Pool, Inc.), Little Rock, AR Gallaher, Frank (Entergy Corp.), New Orleans, LA Solomon, Stuart (American Electric Power), Columbus, OH Electric Utility Restructuring ON: Corona, Constance (Public Utility Commission), Austin, TX Durso, Susan (Public Utility Commission), Austin, TX Klein, Becky Commissioner (Public Utility Commission), Austin, TX Mueller, Paula (Public Utility Commission), Austin, TX Perlman, Brett Commissioner (Public Utility Commission), Austin, TX Renfro, Mike (Public Utility Commission), Austin, TX Electric Utility Restructuring Over ON: Yzaguirre, Max Chairman (Public Utility Commission), Austin, TX ERCOT ON: Priestley, Vanus (AES New Energy, Inc.), Austin, TX ERCOT Systems Progress ON: Bojorquez, William (Electric Reliability Council of Texas), Austin, TX Jones, Sam (Electric Reliability Council of Texas), Austin, TX Noel, Thomas (Electric Reliability Council of Texas), Austin, TX


Ardavan is a third year UC San Diego student studying Product Design and Structural Engineering. He holds an Associates degree in Mathematics from Diablo Valley College. Ardavan also has extensive experience in MATLAB and Java programming. In terms of current research, Ardavan is working on wave energy projects in UCSD's Mechanical and Aerospace Engineering Department.


The input files for NDPP are a set of XML files. XML, which stands for eXtensible Markup Language, is a simple format that allows data to be exchanged efficiently between different programs and interfaces.
To provide the input parameters for NDPP, there are two input files required: ndpp.xml, and a cross_sections file. The ndpp.xml file provides NDPP with the options the user wishes to use when processing a set of nuclides. This file must be named ndpp.xml. The set of nuclides to be pre-processed is provided in the cross_sections file, which can be named however the user wishes, but typically is named cross_sections.xml. This file is very similar to the cross_sections.xml file used by OpenMC, and the OpenMC cross_sections.xml file can be read directly by NDPP as a good starting point. If an explicit cross_sections.xml file is not provided (and the path and filename provided in ndpp.xml), then the default cross_sections file referenced by the CROSS_SECTIONS environment variable will be used. For most cases this means that the user’s entire cross-section library (in the default cross_sections.xml file) will be processed, unless a reduced set is provided with a local cross_sections file.
All calculational parameters and desired output options are specified in the ndpp.xml file. In the following discussion, if a default value is listed for a parameter, then that is the value which NDPP will use if the parameter is not provided in the input file.
The <scatt_type> element has no attributes and has an accepted value of “tabular” or “legendre”. If set to “tabular”, the incoming energy-to-group scattering distributions will be output in a tabular format with the number of bins defined by the <scatt_order> element. If this element is set to “legendre”, the Legendre moments of the angular distribution will be output with the scattering order defined in the <scatt_order> element.
Default: legendre
NOTE: The tabular format has not yet been implemented in NDPP
The <scatt_order> element has no attributes and contains a single integer. As discussed in the <scatt_type> section, the <scatt_order> element provides either the number of tabular bins or the scattering order to NDPP, depending on the value of <scatt_type>.
Default: 5
The <nuscatter> element has no attributes and has an accepted value of “true” or “false”. If set to “true”, then the library produced by NDPP will contain a dataset representing the total production of neutrons due to scatter (that is, ). This data will be included in addition to the standard scattering data (). If “false”, then the scattering production of neutrons will not be included.
Default: True
The <mu_bins> element has no attributes and contains a single integer. This value represents the number of angular points used when converting the ACE- format angular distributions to an intermediate tabular representation. This intermediate representation is the data which is numerically integrated by NDPP, and therefore increasing the number of points increases the accuracy of the results, however, it comes at a cost of an increase in NDPP memory usage and computational cost. This parameter does not affect NDPP processing of thermal scattering tables. This parameter has no impact on the runtime memory or computational costs of the target Monte Carlo code.
Default: 2001
The <freegas_cutoff> element has no attributes and accepts a double-precision number. This number represents the maximum incoming energy (divided by each library’s value of kT) at which the free gas treatment is disabled. For example, if a value of 800.0 is entered for a library with a kT value of 2.53E-8 MeV, then the free gas treatment will be disabled at 800.0 * 2.53E-8 MeV, or 2.024E-5 MeV. If the free gas treatment is desired over the entire energy range for all nuclides/temperatures to be evaluated, a value of -1 can be provided for this element. To disable the free gas treatment, a value of 0.0 can be entered. This cutoff value applies to all nuclides in the cross_sections.xml file, but can be overridden on a per-nuclide basis in the cross_sections.xml file. This parameter does not affect NDPP processing of thermal scattering tables.
Default: 400.0
The <cross_sections> element has no attributes and simply indicates the path to an XML cross section listing file (usually named cross_sections.xml).
Default: The CROSS_SECTIONS environment variable will be used to find the path to the XML cross section listing.
The <energy_bins> element provides the energy group structure to NDPP. <energy_bins> simply contains a list (in increasing order) of bounding energies for a number of groups. The list must be in increasing order to avoid errors during the execution of NDPP. For example, if this element is specified as <energy_bins> 0.0 1.0 20.0 </energy_bins>, then two energy groups will be created, one with energies between 0 and 1 MeV and the other with energies between 1 and 20 MeV.
The <integrate_chi> element has no attributes and has an accepted value of “true” or “false”. If set to “true”, all fissionable nuclides will have their fission neutron spectrum () integrated over the provided energy group structure and written to the output files. If “false”, then the integration will not be performed.
Default: True
The <thinning_tol> element has no attributes and accepts a single floating-point number representing the percent tolerance for thinning the incoming energy grid of the pre-processed data. The thinning algorithm applied essentially discards incoming energy grid points which provide the same result to within the error of the provided thinning tolerance when the neighboring points are interpolated across. The larger the provided value is the smaller the memory footprint of the resultant data library, but with decreased accuracy.
Default: 0.0
The <print_tol> element has no attributes and accepts a single floating-point number. This element is used to set the minimum value of group-to-group transfers that will be printed. Increasing this value decreases the output file size but can reduce accuracy of the resultant preprocessed data library.
Default: 1.0E-8 (1.0E-6%)
The <output_format> element determines what format the preprocessed data libraries should use. This element accepts a string. Valid options are “ascii”, “binary”, “hdf5”, and “human”. If “ascii” is specified, an output library will be written for each entry in the cross_sections.xml file which contains the requested data in ASCII text. If “binary” is specified, the same will be written, but in a machine-readable binary format. These first two are similar to the Type 1 and Type 2 ACE formats, respectively. If “hdf5” is specified, a single binary HDF5 file will be created which contains the data for all the cross_sections.xml file entries. If “human” is specified, then a more verbose form of the “ascii” format will be written which is useful for manual inspection of results.
Default: ascii
The <threads> element has no attributes and contains a single integer. This value is the number of OpenMP threads to use. This element has no effect when NDPP is not compiled with OpenMP support.
Default: Use all available threads (or one, if NDPP was not compiled with OpenMP support).
The cross_sections.xml file uses a very similar format to that used in OpenMC with deviations noted here. For a full discussion of the format and generation strategies see the OpenMC manual discussion.
The <freegas_cutoff> attribute is a member of the <ace_table> element and accepts a single floating-point number. The value provided will override the value of freegas_cutoff specified in the ndpp.xml file for the library it is an attribute of. If none is provided, the value provided in the ndpp.xml input will be applied. The syntax for this attribute is the same as is used for the freegas_cutoff element discussed above. This attribute has no affect on thermal scattering tables.
As an example (which could be commonly utilized), the following shows how to set the H-1 free gas treatment to be applied over the entire energy range:
<ace_table alias="H-1.70c" freegas_cutoff="-1.0" awr="0.999167" location="1" name="1001.70c" path="endf70a" temperature="2.5301e-08" zaid="1001"/>


{% extends 'base_templates/origin_template.html' %} {% block title %}Financials{% endblock %} {% block pagetitle %}Financials{% endblock %} {% block financecolor %}grey lighten-2{% endblock %} {% block body %}
Look Up the monetary status of each student
| ID | Name | Class | Expected Fee | Fee Paid | Balance | Guardian |
|---|---|---|---|---|---|---|
| 1 | Jannet Doe | 2A | 60,000 FCFA | 25,000 FCFA | 35,000 FCFA | Ma Paulina |
| 2 | Sophie lieben | 4C | 70,000 FCFA | 15,000 FCFA | 55,000 FCFA | Mr Jack |
| 3 | Carter Rudolf | LSA | 90,000 FCFA | 45,000 FCFA | 45,000 FCFA | Carteer Mall |


A way to visualize products across all brands and screens.
One of the most difficult things at Deluxe Distribution has always been how to streamline the catalog process. The company takes so much pride in their art department as well as their staff photographer's work. and one way they would show it off was through its printed catalogs. They even served up a catalog camp every season. The printed catalog was discontinued, but a new medium has taken over. We had to seamlessly work with print designers in order to work their ideas for online translation for desktop and mobile.
The transition is a variable, with many elements that could distract the workflow. Branding plays a key part in showcase, but also begins to add a layer of overbearing graphic assets , specifically on mobile. Also trying to convince esigners that are not used to minimal design aesthetics has proved to be a difficult task.
The main objective is to translate our brands through the products without screaming. Let the product spean for itslef and add cohesiveness to the overall design. A second objective which has proved successfull has been ysabuility and repurposing. What was once a time consuming process has been cut down to a fraction of the time spent on production and development
Catalog Wireframe
The guid below aims at helping designers prioritize the products and spend less time on branding elements. This should streamline their creative process, prevent time consuming art direction, and get these catalogs out the door faster than has been the case. It aims at clearly defined goals for legibility for both mobile and desktop.