text:
---
title: "Azure Service Bus Message Pump"
layout: default
---

# Azure Service Bus Message Pump

Azure Service Bus Message Pump will perform all the plumbing that is required for processing queues & topics:

- Manage message pump lifecycle
- Deserialize messages into concrete types
- Interpret message to provide correlation & context information
- Provide exception handling
- Provide telemetry

As a user, the only thing you have to do is **focus on processing messages, not how to get them**.
You can do this by creating a message handler which implements from `IAzureServiceBusMessageHandler<TMessage>` (or `IMessageHandler<TMessage, MessageContext>`).

Here is an example of a message handler that expects messages of type `Order`:

```csharp
using Arcus.Messaging.Abstractions;
using Arcus.Messaging.Pumps.ServiceBus;
using Microsoft.Extensions.Logging;

public class OrdersMessageHandler : IAzureServiceBusMessageHandler<Order>
{
    private readonly ILogger _logger;

    public OrdersMessageHandler(ILogger<OrdersMessageHandler> logger)
    {
        _logger = logger;
    }

    public async Task ProcessMessageAsync(
        Order orderMessage,
        AzureServiceBusMessageContext messageContext,
        MessageCorrelationInfo correlationInfo,
        CancellationToken cancellationToken)
    {
        _logger.LogInformation("Processing order {OrderId} for {OrderAmount} units of {OrderArticle} bought by {CustomerFirstName} {CustomerLastName}", orderMessage.Id, orderMessage.Amount, orderMessage.ArticleNumber, orderMessage.Customer.FirstName, orderMessage.Customer.LastName);

        // Custom logic

        _logger.LogInformation("Order {OrderId} processed", orderMessage.Id);
    }
}
```

or with using the more general `IMessageHandler<>`, that will use the more general `MessageContext` instead of the one specific for Azure Service Bus.

```csharp
using Arcus.Messaging.Abstractions;
using Arcus.Messaging.Pumps.Abstractions.MessageHandling;
using Microsoft.Extensions.Logging;

public class OrdersMessageHandler : IMessageHandler<Order>
{
    private readonly ILogger _logger;

    public OrdersMessageHandler(ILogger<OrdersMessageHandler> logger)
    {
        _logger = logger;
    }

    public async Task ProcessMessageAsync(
        Order orderMessage,
        MessageContext messageContext,
        MessageCorrelationInfo correlationInfo,
        CancellationToken cancellationToken)
    {
        _logger.LogInformation("Processing order {OrderId} for {OrderAmount} units of {OrderArticle} bought by {CustomerFirstName} {CustomerLastName}", orderMessage.Id, orderMessage.Amount, orderMessage.ArticleNumber, orderMessage.Customer.FirstName, orderMessage.Customer.LastName);

        // Custom logic

        _logger.LogInformation("Order {OrderId} processed", orderMessage.Id);
    }
}
```

Other topics:
- [Azure Service Bus Message Pump](#azure-service-bus-message-pump)
  - [Configuration](#configuration)
    - [Customized Configuration](#customized-configuration)
  - [Fallback message handling](#fallback-message-handling)
  - [Influence handling of Service Bus message in message handler](#influence-handling-of-service-bus-message-in-message-handler)
    - [During (regular) message handling](#during-regular-message-handling)
    - [During fallback message handling](#during-fallback-message-handling)
  - [Alternative Service Bus message routing](#alternative-service-bus-message-routing)
  - [Correlation](#correlation)
  - [Automatic Azure Key Vault credentials rotation](#automatic-azure-key-vault-credentials-rotation)
  - [How does this work?](#how-does-this-work)
    - [Installation](#installation)
    - [Usage](#usage)
  - [Want to get started easy? Use our templates!](#want-to-get-started-easy-use-our-templates)

> ⚠ The new Azure SDK doesn't yet support Azure Service Bus plugins. See this [migration guide](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/servicebus/Azure.Messaging.ServiceBus/MigrationGuide.md#known-gaps-from-previous-library) for more info on this topic.

## Configuration

Once the message handler is created, you can very easily configure it:

```csharp
using Microsoft.Extensions.DependencyInjection;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Add Service Bus Queue message pump and use OrdersMessageHandler to process the messages
        // - ISecretProvider will be used to lookup the connection string scoped to the queue for secret ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING
        services.AddServiceBusQueueMessagePump("ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING")
                .WithServiceBusMessageHandler<OrdersMessageHandler, Order>();

        // Add Service Bus Topic message pump and use OrdersMessageHandler to process the messages on the 'My-Subscription-Name' subscription
        // - Topic subscriptions over 50 characters will be truncated
        // - ISecretProvider will be used to lookup the connection string scoped to the queue for secret ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING
        services.AddServiceBusTopicMessagePump("My-Subscription-Name", "ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING")
                .WithServiceBusMessageHandler<OrdersMessageHandler, Order>();

        // Note, that only a single call to the `.WithServiceBusMessageHandler` has to be made when the handler should be used across message pumps.
    }
}
```

In this example, we are using the Azure Service Bus message pump to process a queue and a topic and use the connection string stored in the `ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING` connection string.

We support **connection strings that are scoped on the Service Bus namespace and entity** allowing you to choose the required security model for your applications. If you are using namespace-scoped connection strings you'll have to pass your queue/topic name as well.

### Customized Configuration

Next to that, we provide a **variety of overloads** to allow you to:

- Specify the name of the queue/topic
- Only provide a prefix for the topic subscription, so each topic message pump is handling messages on separate subscriptions
- Configure how the message pump should work *(ie. max concurrent calls & auto delete)*
- Read the connection string from the configuration *(although we highly recommend using the [Arcus secret store](https://security.arcus-azure.net/features/secret-store) instead)*

```csharp
using Microsoft.Extensions.DependencyInjection;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Specify the name of the Service Bus Queue:
        services.AddServiceBusQueueMessagePump(
            "My-Service-Bus-Queue-Name",
            "ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING");

        // Specify the name of the Service Bus Topic, and provide a name for the Topic subscription:
        services.AddServiceBusMessageTopicMessagePump<OrdersMessageHandler>(
            "My-Service-Bus-Topic-Name",
            "My-Service-Bus-Topic-Subscription-Name",
            "ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING");

        // Specify a topic subscription prefix instead of a name to separate topic message pumps.
        services.AddServiceBusTopicMessagePumpWithPrefix(
            "My-Service-Bus-Topic-Name"
            "My-Service-Bus-Subscription-Prefix",
            "ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING");

        // Uses managed identity to authenticate with the Service Bus Topic:
        services.AddServiceBusTopicMessagePumpUsingManagedIdentity(
            topicName: properties.EntityPath,
            subscriptionName: "Receive-All",
            fullyQualifiedNamespace: "<your-namespace>.servicebus.windows.net"
            // The optional client id to authenticate for a user assigned managed identity. More information on user assigned managed identities cam be found here:
            // https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview#how-a-user-assigned-managed-identity-works-with-an-azure-vm
            clientId: "<your-client-id>");

        services.AddServiceBusTopicMessagePump(
            "ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING",
            options =>
            {
                // Indicate whether or not messages should be automatically marked as completed
                // if no exceptions occurred and processing has finished (default: true).
                options.AutoComplete = true;

                // Indicate whether or not the message pump should emit security events (default: false).
                options.EmitSecurityEvents = true;

                // The amount of concurrent calls to process messages
                // (default: null, leading to the defaults of the Azure Service Bus SDK message handler options).
                options.MaxConcurrentCalls = 5;

                // The unique identifier for this background job to distinguish
                // this job instance in a multi-instance deployment (default: guid).
                options.JobId = Guid.NewGuid().ToString();

                // The name of the Azure Service Bus message property that has the transaction ID.
                // (default: Transaction-Id).
                options.Correlation.TransactionIdPropertyName = "X-Transaction-ID";

                // Indicate whether or not the default built-in JSON deserialization should ignore additional members
                // when deserializing the incoming message (default: AdditionalMemberHandling.Error).
                options.Deserialization.AdditionalMembers = AdditionalMemberHandling.Ignore;

                // Indicate whether or not a new Azure Service Bus Topic subscription should be created/deleted
                // when the message pump starts/stops (default: CreateOnStart & DeleteOnStop).
                options.TopicSubscription = TopicSubscription.CreateOnStart | TopicSubscription.DeleteOnStop;
            });

        services.AddServiceBusQueueMessagePump(
            "ARCUS_SERVICEBUS_ORDERS_CONNECTIONSTRING",
            options =>
            {
                // Indicate whether or not messages should be automatically marked as completed
                // if no exceptions occurred and processing has finished (default: true).
                options.AutoComplete = true;

                // Indicate whether or not the message pump should emit security events (default: false).
                options.EmitSecurityEvents = true;

                // The amount of concurrent calls to process messages
                // (default: null, leading to the defaults of the Azure Service Bus SDK message handler options).
                options.MaxConcurrentCalls = 5;

                // The unique identifier for this background job to distinguish
                // this job instance in a multi-instance deployment (default: guid).
                options.JobId = Guid.NewGuid().ToString();

                // The name of the Azure Service Bus message property that has the transaction ID.
                // (default: Transaction-Id).
                options.Correlation.TransactionIdPropertyName = "X-Transaction-ID";

                // Indicate whether or not the default built-in JSON deserialization should ignore additional members
                // when deserializing the incoming message (default: AdditionalMemberHandling.Error).
                options.Deserialization.AdditionalMembers = AdditionalMembersHandling.Ignore;
            });

        // Uses managed identity to authenticate with the Service Bus Topic:
        services.AddServiceBusQueueMessagePumpUsingManagedIdentity(
            queueName: "orders",
            serviceBusNamespace: "<your-namespace>"
            // The optional client id to authenticate for a user assigned managed identity. More information on user assigned managed identities cam be found here:
            // https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview#how-a-user-assigned-managed-identity-works-with-an-azure-vm
            clientId: "<your-client-id>");

        // Multiple message handlers can be added to the services, based on the message type (ex. 'Order', 'Customer'...),
        // the correct message handler will be selected.
        services.AddServiceBusQueueMessagePump(...)
                .WithServiceBusMessageHandler<OrdersMessageHandler, Order>()
                .WithMessageHandler<CustomerMessageHandler, Customer>();
    }
}
```

## Fallback message handling

When receiving a message on the message pump and none of the registered `IAzureServiceBusMessageHandler`'s can correctly process the message, the message pump normally throws and logs an exception.
It could also happen in a scenario that's to be expected that some received messages will not be processed correctly (or you don't want them to).

In such a scenario, you can choose to register a `IAzureServiceBusFallbackMessageHandler` in the dependency container.
This extra message handler will then process the remaining messages that can't be processed by the normal message handlers.

Following example shows how such a message handler can be implemented:

```csharp
using Arcus.Messaging.Pumps.ServiceBus;
using Arcus.Messaging.Pumps.ServiceBus.MessageHandling;
using Microsoft.Azure.ServiceBus;
using Microsoft.Extensions.Logging;

public class WarnsUserFallbackMessageHandler : IAzureServiceBusFallbackMessageHandler
{
    private readonly ILogger _logger;

    public WarnsUserFallbackMessageHandler(ILogger<WarnsUserFallbackMessageHandler> logger)
    {
        _logger = logger;
    }

    public async Task ProcessMessageAsync(Message message, AzureServiceBusMessageContext context, ...)
    {
        _logger.LogWarning("These type of messages are expected not to be processed");
    }
}
```

> Note that you have access to the Azure Service Bus message and the specific message context. These can be used to eventually call `.Abandon()` on the message.

And to register such an implementation:

```csharp
using Microsoft.Extensions.DependencyInjection;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddServiceBusQueueMessagePump(...)
                .WithServiceBusFallbackMessageHandler<WarnsUserFallbackMessageHandler>();
    }
}
```

## Influence handling of Service Bus message in message handler

When an Azure Service Bus message is received (either via regular message handlers or fallback message handlers), we allow specific Azure Service Bus operations during the message handling.
Currently we support [**Dead letter**](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues) and [**Abandon**](https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.messagereceiver.abandon?view=azure-dotnet).

### During (regular) message handling

To have access to the Azure Service Bus operations, you have to implement the `abstract` `AzureServiceBusMessageHandler<T>` class.
Behind the screens it implements the `IMessageHandler<>` interface, so you can register this the same way as your other regular message handlers.

This base class provides several protected methods to call the Azure Service Bus operations:
- `.CompleteMessageAsync`
- `.DeadLetterMessageAsync`
- `.AbandonMessageAsync`

Example:

```csharp
using Arcus.Messaging.Pumps.ServiceBus;
using Arcus.Messaging.Pumps.ServiceBus.MessageHandling;
using Microsoft.Extensions.Logging;

public class AbandonsUnknownOrderMessageHandler : AzureServiceBusMessageHandler<Order>
{
    public AbandonsUnknownOrderMessageHandler(ILogger<AbandonsUnknownOrderMessageHandler> logger)
        : base(logger)
    {
    }

    public override async Task ProcessMessageAsync(Order order, AzureServiceBusMessageContext context, ...)
    {
        if (order.Id < 1)
        {
            await AbandonMessageAsync();
        }
        else
        {
            Logger.LogInformation("Received valid order");
        }
    }
}
```

The registration happens the same as any other regular message handler:

```csharp
using Microsoft.Extensions.DependencyInjection;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddServiceBusQueueMessagePump(...)
                .WithServiceBusMessageHandler<AbandonUnknownOrderMessageHandler, Order>();
    }
}
```

### During fallback message handling

To have access to the Azure Service Bus operations, you have to implement the abstract `AzureServiceBusFallbackMessageHandler` class.
Behind the scenes it implements the `IServiceBusFallbackMessageHandler`, so you can register this the same way as any other fallback message handler.

This base class provides several protected methods to call the Azure Service Bus operations:
- `.CompleteAsync`
- `.DeadLetterAsync`
- `.AbandonAsync`

Example:

```csharp
using Arcus.Messaging.Pumps.ServiceBus;
using Arcus.Messaging.Pumps.ServiceBus.MessageHandling;
using Azure.Messaging.ServiceBus;
using Microsoft.Extensions.Logging;

public class DeadLetterFallbackMessageHandler : AzureServiceBusFallbackMessageHandler
{
    public DeadLetterFallbackMessageHandler(ILogger<DeadLetterFallbackMessageHandler> logger)
        : base(logger)
    {
    }

    public override async Task ProcessMessageAsync(ServiceBusReceivedMessage message, AzureServiceBusMessageContext context, ...)
    {
        Logger.LogInformation("Message is not handled by any message handler, will dead letter");
        await DeadLetterMessageAsync(message);
    }
}
```

The registration happens the same way as any other fallback message handler:

```csharp
using Microsoft.Extensions.DependencyInjection;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddServiceBusQueueMessagePump(...)
                .WithServiceBusFallbackMessageHandler<DeadLetterFallbackMessageHandler>();
    }
}
```

## Alternative Service Bus message routing

By default, when registering the Azure Service Bus message pump a built-in message router is registered to handle the routing throughout the previously registered message handlers.

This router is registered with the `IAzureServiceBusMessageRouter` interface (which implements the more general `IMessageRouter` for non-specific Service Bus messages).

When you want for some reason alter the message routing or provide additional functionality, you can register your own router which the Azure Service Bus message pump will use instead.

The following example shows you how a custom router is used for additional tracking. Note that the `AzureServiceBusMessageRouter` implements the `IAzureServiceBusMessageRouter` so we can override the necessary implementations.

```csharp
public class TrackedAzureServiceBusMessageRouter : AzureServiceBusMessageRouter
{
    public TrackedAzureServiceBusMessageRouter(IServiceProvider serviceProvider, ILogger<AzureServiceBusMessageRouter> logger)
        : base(serviceProvider, logger)
    {
    }

    public override Task ProcessMessageAsync(
        ServiceBusReceivedMessage message,
        AzureServiceBusMessageContext messageContext,
        MessageCorrelationInfo correlationInfo,
        CancellationToken cancellationToken)
    {
        Logger.LogTrace("Start routing incoming message...");
        base.ProcessMessageAsync(message, messageContext, correlationInfo, cancellationToken);
        Logger.LogTrace("Done routing incoming message!");
    }
}
```

This custom message router can be registered with the following extension:

```csharp
public void ConfigureServices(IServiceCollection services)
{
    services.AddServiceBusMessageRouting(serviceProvider =>
    {
        var logger = serviceProvider.GetService<ILogger<TrackedAzureServiceBusMessageRouter>>();
        return new TrackedAzureServiceBusMessageRouter(serviceProvider, logger);
    });

    services.AddServiceBusQueueMessagePump(...);
}
```

> Note that your own router should be registered **before** you register the Azure Message Pump otherwise it cannot be overriden.

## Correlation

To retrieve the correlation information of Azure Service Bus messages, we provide an extension that wraps all correlation information.

```csharp
using Arcus.Messaging.Abstractions;
using Azure.Messaging.ServiceBus;

ServiceBusReceivedMessage message = ...
MessageCorrelationInfo correlationInfo = message.GetCorrelationInfo();

// Unique identifier that indicates an attempt to process a given message.
string cycleId = correlationInfo.CycleId;

// Unique identifier that relates different requests together.
string transactionId = correlationInfo.TransactionId;

// Unique idenfier that distinguishes the request.
string operationId = correlationInfo.OperationId;
```

## Automatic Azure Key Vault credentials rotation

The additional library `Arcus.Messaging.Pumps.ServiceBus.KeyRotation` provides an extension on the message pump to restart the pump automatically when the credentials of the pump stored in Azure Key Vault are changed.
This feature allows more reliable restarting instead of relying on authentication exceptions that may be throwed during the lifetime of the message pump.

## How does this work?

A background job is polling for `SecretNewVersionCreated` events on an Azure Service Bus Topic for the secret that stores the connection string.

That way, when the background job receives a new Key Vault event, it will get the latest connection string, restart the message pump and authenticate with the latest credentials.

### Installation

This features requires to install our NuGet package:

```shell
PM > Install-Package Arcus.Messaging.Pumps.ServiceBus.KeyRotation
```

### Usage

When the package is installed, you'll be able to use the extension in your application:

```csharp
public void ConfigureServices(IServiceCollection services)
{
    // You should have a unique Job ID to identity the message pump so the automatic process knows which pump to restart.
    string jobId = Guid.NewGuid().ToString();

    string secretName = hostContext.Configuration["ARCUS_KEYVAULT_CONNECTIONSTRINGSECRETNAME"];
    services.AddServiceBusQueueMessagePump(secretName, options => options.JobId = jobId)

            // This extension will be available to you once you installed the package.
            .WithAutoRestartServiceBusMessagePumpOnRotatedCredentials(
                jobId: jobId,
                subscriptionNamePrefix: "TestSub",

                // The secret key where the Azure Service Bus Topic connection string is located that the background job will use to receive the Azure Key vault events.
                serviceBusTopicConnectionStringSecretKey: "ARCUS_KEYVAULT_SECRETNEWVERSIONCREATED_CONNECTIONSTRING",

                // The secret key where the Azure Service Bus connection string is located that your target message pump uses.
                // This secret key name will be used to check if the received Azure Key Vault event is from this secret or not.
                messagePumpConnectionStringKey: secretName,

                // The maximum amount of thrown unauthorized exceptions that your message pump should allow before it should restart either way.
                // This amount can be used to either wait for an Azure Key Vault event or rely on the thrown unauthorized exceptions.
                maximumUnauthorizedExceptionsBeforeRestart: 5)

            .WithServiceBusMessageHandler<OrdersAzureServiceBusMessageHandler, Order>();
}
```

## Want to get started easy? Use our templates!

We provide templates to get started easily:

- Azure Service Bus Queue Worker Template ([docs](https://templates.arcus-azure.net/features/servicebus-queue-worker-template))
- Azure Service Bus Topic Worker Template ([docs](https://templates.arcus-azure.net/features/servicebus-topic-worker-template))

[← back](/)

gha_language: C#


text:
---
layout: post
title: Wallis in autumn
---

September 28 - 29, I was supposed to fly in Zermatt. However, the wind forecast was not favorable, so the plans were postponed. I did not like the change of plans, as it gave me one free weekend and collision of plans next weekend, especially when the forecast did not look that bad. But when I experienced the wind from tropical storm hitting Europe, I was glad not to fly.

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/1.jpg)
*Les Haudères*

I started quite late, leaving Zurich at 8:30 resulted in getting to Les Haudères after 12:30. Anyway, I had big dreams, hiking the whole way to Zinal in one day, and sleeping above Zinal

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/2.jpg)
*[Map](https://en.mapy.cz/s/jehulotasa) of my naive plan.*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/3.jpg)
*The dry meadows have an interesting color..*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/4.jpg)
*..in contrast to glaciers.*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/5.jpg)
*The view from Col du Torernt. These peaks are Dents du Midi..*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/6.jpg)
*..and the furthest at the horizon is Mont Blanc, places that I saw two years ago when I was living in Geneva.*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/7.jpg)
*The views to the other side were no less interesting.*

Somehow, my pace was horrible, so I had no chance to make it. I ended after 10 km with 1500 m of altitude gain, by Lac des Autannes. It was a shallow, thus warm lake in 2650 masl, so I swam a bit before the sunset, that was way too early also due to the west slope. But given the winds, the lake was perfectly sheltered, and I could bivouac just under the starts. I was not feeling right, so I spend half of the night watching the stars, not being able to fall asleep.

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/8.jpg)
*I hurried down to swim before the sun sets.*

Sunrise was a reason why I was willing to get up at 7. Watching four 4k peaks - Weisshorn, Zinalhorn, Det Blanche and Ober Gabelhorn changing from pink, over golded to bright white was worthy.

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/9.jpg)
*Sunrise over Grand Cornier and Dent Blanche. I had to wait for the sun much longer.*

Most of my views on Sunday were around Lac de Moiry, who could not be fascinated by the turquoise blue water in the middle of the dry red-ish meadows. Crossing the dam was interesting not only because of the views but also due to info panels. The fascinating fact I learned was about ancient Europe to Africa border, which was just about the lake length, so I was standing in Europy, and the glaciers were Africa.

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/10.jpg)
*Lac de Moiry, now I stand in the ocean.*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/11.jpg)
*Sad history of the glacier.*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/16.jpg)

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/17.jpg)

Hiking on Sunday was much more relaxed, 650 m up was no problem.

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/18.jpg)
![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/19.jpg)
*New views*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/20.jpg)
*Blueberries were mainly sour but still nice to have some. Yet the color was fascinating.*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/21.jpg)
*The Weisshorn [4506] is considered by many mountaineers to be the most beautiful mountain in the Alps and Switzerland for its pyramidal shape and pure white slopes [from the other side]. -- wiki*

![](https://raw.githubusercontent.com/Bender250/bender250.github.io/master/images/eth/export/aw/22.jpg)
*Zinalhorn*

On the way home, I watched altocumulus lenticularis, clouds that signalize strong winds in the atmosphere.  They were everywhere. Probably it was a right decision not to go flying :D.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Relections

**What Git concepts were you struggling with prior to the GPS session?**
Git is still relatively foreign to me and while I get the concepts in a high-level sense, the actual implementation of it has been something I have struggled with for the past week.

**What concepts were clarified during the GPS?**
We spent some time discussing the fetch/merge versus pull which helped to clarify the confusion I had around that.

**What questions did you ask your pair and the guide?**
We asked a lot of questions about the difference between Git and GitHub. I think we were both having some trouble making the distinction between them.

**What still confuses you about Git?**
I feel like I should spend some time understanding branches further. I am unsure about when/where to create one.

**How was your first experience of pairing in a GPS?**
It was very helpful having a guide there to ask questions or clarify any confusion we have had about the task or the code.


text:
*This repository is a mirror of the [component](http://component.io) module [stagas/mouseleave](http://github.com/stagas/mouseleave). It has been modified to work with NPM+Browserify. You can install it using the command `npm install npmcomponent/stagas-mouseleave`. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to [npmcomponent](https://github.com/airportyh/npmcomponent).*

# mouseenter

mouseenter shim utility

## Licence

MIT

repository: npmcomponent/stagas-mouseleave

repo_name: npmcomponent/stagas-mouseleave


text:
## Setup
* Install Node.js
* git clone this repository

Run in the project root to install dependencies:

	$ npm install

### Running

MongoDB

	$ mongod 	//Run from bin directory

MongoDB Client

	$ mongo 	//Run from bin directory

Express

	$ npm start

You should be able to run and view http://localhost:3000/#/home

repository: eshrinivasan/mongodb-node-boilerplate

repo_name: eshrinivasan/mongodb-node-boilerplate


text:
⊕ [Scrapy Tutorial — Scrapy 1.7.4 documentation](https://docs.scrapy.org/en/latest/intro/tutorial.html)

## start
```sh
scrapy startproject tutorial
```

+ tutorial/spiders/quotes_spider.py
    Subclass scrapy.Spider and define the initial requests to make.
    This is the code for our first Spider. Save it in a file named quotes_spider.py under the tutorial/spiders directory in your project:

```python
import scrapy

class QuotesSpider(scrapy.Spider):
    name = "quotes"

    def start_requests(self):
        urls = [
            'http://quotes.toscrape.com/page/1/',
            'http://quotes.toscrape.com/page/2/',
        ]
        for url in urls:
            yield scrapy.Request(url=url, callback=self.parse)

    def parse(self, response):
        page = response.url.split("/")[-2]
        filename = 'quotes-%s.html' % page
        with open(filename, 'wb') as f:
            f.write(response.body)
        self.log('Saved file %s' % filename)
```

+ execute
    go to the project’s top level directory and run:

```sh
scrapy crawl quotes
scrapy crawl quotes_json -o quotes.json
# You can also use other formats, like JSON Lines:
scrapy crawl quotes_json -o quotes.jl
```

repository: samlet/stack

repo_name: samlet/stack


text:
# servers

A collection of simiple servers for testing.

### Setup

You'll need to install node.js if you don't have it already

#### OSX
```bash
brew install node
```

#### Windows
https://nodejs.org/en/#home-downloadhead

### Running the servers

The first step is to install depencencies:

```bash
npm install
```

Then you can run the regular HTTP server (CORS enabled):

```bash
npm run http
```

Or the websocket server:

```bash
npm run ws
```

_____________________________

### HTTPS/WSS/External access

You can use ngrok to connect via HTTPS, WSS or externally without changing any configuration.
https://dashboard.ngrok.com/get-started

Once it's installed, you can then expose the HTTP server:

```bash
ngrok http 8000
```

Or the Websocket server:

```bash
ngrok http 8080
```

_Just use wss://NGROK_URL  instead of https://NGROK_URL for wss connections_

repository: chefsecure/servers

gha_language: JavaScript

gha_license_id: MIT

repo_name: chefsecure/servers


text:
Presentations
=============

My presentations promote how to create a software in the right way.

## [Data Workshop](http://dataworkshop.eu/)
- [data workshop #1 | titanic](https://github.com/slon1024/presentations/blob/master/dataworkshop/DataWorkshop1_Titanic.pdf)
- [data workshop #2 | xgboost](https://github.com/slon1024/presentations/blob/master/dataworkshop/DataWorkshop2_xgboost.pdf)
- [data workshop #3 | model evaluation](https://github.com/slon1024/presentations/blob/master/dataworkshop/DataWorkshop3_model_evaluation.pdf)
- [data workshop #4 | bike sharing demand](https://github.com/slon1024/presentations/blob/master/dataworkshop/DataWorkshop4_bike_sharing_demand.pdf)
- [data workshop #5 | visualization ](https://github.com/slon1024/presentations/blob/master/dataworkshop/DataWorkshop5_visualisation.pdf)

## Good Coding Practice in Real Life
#### SOLID
- [Single Responsibility Principle](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/SOLID/c%23/Single_responsibility_principle.pdf)
- [Open Closed Principle](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/SOLID/c%23/Open_closed_principle.pdf)
- [Liskov Substitution Principle](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/SOLID/c%23/Liskov_substitution_principle.pdf)
- [Interface Segregation Principle](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/SOLID/c%23/Interface_segregation_principle.pdf)
- [Dependency Inversion Principle](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/SOLID/c%23/Dependency_inversion_principle.pdf)

#### Design by Contract
- [part 1](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/DesignByContract/DesignByContract-part1.pdf)
- [part 2](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/DesignByContract/DesignByContract-part2.pdf)
- [part 3](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/DesignByContract/DesignByContract-part3.pdf)

#### Others
- [Cohesion and Coupling](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/Cohesion_and_coupling.pdf)
- [Introduction to Git](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/Intro_to_git.pdf)
- [Introduction to JavaScript Unit Testing](https://github.com/slon1024/presentations/blob/master/Good_coding_practice_in_real_life/Introduction_to_JavaScript_unit_testing.pdf)

## Functional Programming
- [The Philosophy and History of Functional Programming](https://github.com/slon1024/presentations/blob/master/Functional_programming/The_philosophy_and_history_of_functional_programming.pdf)
- [The Philosophy and History of Haskell](https://github.com/slon1024/presentations/blob/master/Functional_programming/The_philosophy_and_history_of_Haskell.pdf)
- [The First Steps in Haskell](https://github.com/slon1024/presentations/blob/master/Functional_programming/The_first_steps_in_Haskell.pdf)
- [Working with Lists in Haskell](https://github.com/slon1024/presentations/blob/master/Functional_programming/Working_with_lists_in_Haskell.pdf)
- [Lazy Evaluation and Currying in Haskell](https://github.com/slon1024/presentations/blob/master/Functional_programming/Lazy_%20evaluation_and_currying_in_Haskell.pdf)
- [Introduction to Monads](https://github.com/slon1024/presentations/blob/master/Functional_programming/Intro_to_monads.pdf)
- [Brainfuck Interpreter in Haskell](https://github.com/slon1024/presentations/blob/master/Functional_programming/Brainfuck_interpreter_in_Haskell.pdf)

## Continuous Integration
- [Introduction to Continuous Integration](https://github.com/slon1024/presentations/blob/master/Continuous_integration/intro_to_ci.pdf)
- [Introduction to Continuous Delivery](https://github.com/slon1024/presentations/blob/master/Continuous_integration/intro_to_cd.pdf)
- [Continuous Integration in Real Life](https://github.com/slon1024/presentations/blob/master/Continuous_integration/Continuous_integration_in_real_life.pdf)

## Language
- [Introduction to Programming in Go](https://github.com/slon1024/presentations/blob/master/Language/Intro_to_programming_in_Go.pdf)
- [BrainFuck - How Does This Work](https://github.com/slon1024/presentations/blob/master/Language/BrainFuck_-_how_does_this_work.pdf)

## Workshop
- [Unit Testing in Real Life](https://github.com/slon1024/presentations/blob/master/Workshop/Unit_testing_in_real_life.pdf)


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.0.0-canary.5729943ba.0](https://github.com/material-components/material-components-web/compare/v4.0.0...v5.0.0-canary.5729943ba.0) (2019-11-20)

### Features

* **button:** Setup elevation overlay ([#5256](https://github.com/material-components/material-components-web/issues/5256)) ([3cbee6d](https://github.com/material-components/material-components-web/commit/3cbee6d))
* **elevation:** Add elevation overlay mixins ([#5249](https://github.com/material-components/material-components-web/issues/5249)) ([b4cfdc4](https://github.com/material-components/material-components-web/commit/b4cfdc4))

### BREAKING CHANGES

* **elevation:** Functions moved into the _functions.scss file

repository: DavidCutiopala/SEPLOM

repo_name: DavidCutiopala/SEPLOM


text:
GNU Octave scripts for the arc-length method.
This implementation is based on a novel a extrapolated predictor.

The main script is **main_arclength.m**. The input files are prepared and tested.
Uncomment the corresponding line in the main file to run the script for a particular problem.

Some load-displacement curves computed with this code.

* Lee frame
![](LeeFrame-path-dl0p5.jpg)

* 215-degree circular arch
![](arch-215deg-path.jpg)

* Semi-circular arch with asymmetric loading
![](arch-semicircle-unsymmetric-path.jpg)

repository: TruongQuocChien/ArcLengthMethod

repo_name: TruongQuocChien/ArcLengthMethod


text:
# ofxWarning

utility for writing strict code on oF.

## how to use

create/update Project with this addon.

## notice

if you use ~0.10.0, you need to use latest ProjectGenerator.

* [PG for macOS](https://drive.google.com/open?id=1qal2sZ81Up1g-GyfgCYzgDgHerBUyPsD) (built on 10.13.6)
* [PG for win](https://drive.google.com/open?id=1kYOG9rTXhpGq26wKjK7xlOS2TyDXjGT3) (built on win10)

(maybe PG will be update on 0.10.1)

### how to build PG

* install node.js

* if you use release of oF ~0.10.0
  * clone master branch of oF from github.

* clone PG from [github](https://github.com/openframeworks/projectGenerator) to app on master branch (or v0.10.0 release) of oF.

* build `projectGenerator/commandLine`
* copy `projectGenerator/commandLine/bin/projectGenerator` to `projectGenerator/frontend/app`
* run `npm install`
* run `npm run build:osx` or `npm run build:linux32`,  `npm run build:linux64`,  `npm run build:VS`
* (copy `projectGenerator/frontend/ dist/projectGenerator-XXX-XXX/projectGenerator.XXX` to perojectGenerator directory of version what you wanna use.)


text:
# Networking for Systems Administrators

## Chapter 8: The Domain Name System

### Domains and Zones
- A zone within a zone is a child zone
- subdomains are zones
- test.com is a child zone of .com, home.test.com is a child zone of test.com
- .com is a child zone of the root zone
- root zone is managed by NTIA... for now

### The DNS Heirarchy
- DNS lookup progression
    1. Client contacts its recursive nameserver and requests IP address
    2. recursive nameserver consults its list of root nameservers and contacts one to request the information
    3. root server can provide address of nameservers responsible for the child zone (e.g. .com)
    4. our client's nameserver contacts the new nameserver requesting the information.
    5. New server returns the next child zone (e.g. test.com)
    6. repeat until we get the proper records or the nameserver we query has no further information
    7. ...or the information is cached already on one of these nameservers and it returns the proper records

### DNS Record Types
- PTR record provides a hostname. Reverse DNS _mostly_ uses PTR records. Service Discovery and ZeroConf also use PTR records
- SOA (Start of Authority) record gives timing and responsibility information for zone you're searching and provides information such as how long to cache entries in this zone and who to contact for problems with the domain.
- CNAME (Canonical Name) DNS alias which redirects you from one name to another

### Running DNS Queries

- On unix use `host` not `nslookup`

### DNS Response Codes
- NOERROR
    - Everything worked correctly in the DNS protocol. Does not mean information is correct, just that you were able to retrieve information (e.g. "I don't have that information!!" would be NOERROR)
- NXDOMAIN
    - DNS protocol worked but there are no records of the name you're looking for
- SERVFAIL
    - Something went wrong and you can't get an answer
- There are more but they're rare

### Name Resolution Order
- Order of methods to check for the given record of a zone is set in `/etc/nsswitch.conf` or `/etc/hosts.conf`

repository: OompahLoompah/Readings-Notes

repo_name: OompahLoompah/Readings-Notes


text:
CHANGELOG
=========

3.3.0
-----

 * Improved the console handler output formatting by adding var-dumper support

3.0.0
-----

 * deprecated interface `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed
 * deprecated methods `Logger::crit()`, `Logger::emerg()`, `Logger::err()` and `Logger::warn()` have been removed

2.4.0
-----

 * added ConsoleHandler and ConsoleFormatter which can be used to show log messages
   in the console output depending on the verbosity settings

2.1.0
-----

 * added ChromePhpHandler

repository: MoetazBrayek/Pidev-web

gha_language: HTML

repo_name: MoetazBrayek/Pidev-web


text:
# CPSC 1150 - Program Design

[View this course on Langara](https://langara.ca/programs-and-courses/courses/CPSC/1150.html)

## Course Description

Provides a general understanding of computing environment and stored information; teaches algorithm development and fundamentals of programming using a suitable high-level language (e.g., Java); introduces abstraction concepts; and focuses on program design and implementation using the procedural programming paradigm.

## Prerequisites

**Prerequisite(s):** One of the following: MDT 85; a minimum "B" grade in Precalculus 12; one of MATH 1171, 1173/1183, 1174; a minimum "C" grade in one of CPSC 1040 or 1045; or a minimum "B" grade in CPSC 1050.

## Resources

- Do you have a resource for this class? [Create a pull request](https://github.com/langaracs/course-resources/compare)!

repository: adplang/course-resources

repo_name: adplang/course-resources


text:
---
name: New Relic
description: New Relic???s digital intelligence platform lets developers, ops, and
  tech teams measure and monitor the performance of their applications and infrastructure.
image: http://kinlane-productions2.s3.amazonaws.com/screen-capture-api/22963-new-relic.jpg
tags:
- monitoring
- performance
created: "2021-01-03"
modified: "2021-01-03"
url: https://raw.githubusercontent.com/api-evangelist/new-relic/master/apis.json
specificationVersion: "0.14"
apis:
- name: New Relic
  description: ~
  image: http://kinlane-productions2.s3.amazonaws.com/screen-capture-api/22963-new-relic.jpg
  humanURL: https://newrelic.com/
  baseURL: https://newrelic.com/
  tags: []
  properties:
  - type: x-openapi
    url: https://raw.githubusercontent.com/api-evangelist/new-relic/master/new-relic-openapi.json
  - type: x-openapi
    url: http://kinlane-productions.s3.amazonaws.com/api-evangelist-site/company/openapis/new-relic.json
  - type: x-postman-collecction
    url: https://raw.githubusercontent.com/api-evangelist/new-relic/master/new-relic-postman-collection.json
include: []
x-common:
- type: About
  url: https://newrelic.com/about
- type: About
  url: https://newrelic.com/about/leadership
- type: About
  url: https://newrelic.com/about/culture
- type: Blog
  url: https://blog.newrelic.com/
- type: Blog RSS
  url: https://blog.newrelic.com/feed/
- type: Case Studies
  url: https://newrelic.com/case-studies/ryanair
- type: Case Studies
  url: https://newrelic.com/case-studies/hearst
- type: Case Studies
  url: https://newrelic.com/case-studies/REI
- type: Case Studies
  url: https://newrelic.com/case-studies/condenast
- type: Contact
  url: https://newrelic.com/about/contact-us
- type: Crunchbase
  url: https://crunchbase.com/organization/new-relic
- type: Customers
  url: https://newrelic.com/customers
- type: Developer
  url: http://developer.newrelic.com
- type: Developer
  url: https://developer.newrelic.com/learn
- type: Developer
  url: https://api.newrelic.com/graphiql
- type: Developer
  url: https://developer.newrelic.com/
- type: Developers
  url: https://rpm.newrelic.com/api/explore/
- type: Documentation
  url: https://docs.newrelic.com/docs/telemetry-sdk
- type: Documentation
  url: https://docs.newrelic.com/
- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Email
  url<EMAIL_ADDRESS>- type: Events
  url: https://newrelic.com/community/events
- type: Facebook
  url: http://www.facebook.com/NewRelic
- type: Github
  url: https://github.com/newrelic
- type: Instagram
  url: https://www.instagram.com/newrelic/
- type: Integrations
  url: https://newrelic.com/integrations
- type: Linkedin
  url: https://www.linkedin.com/company/new-relic-inc-
- type: News
  url: https://newrelic.com/about/newsroom
- type: Open Source
  url: https://developer.newrelic.com/open-source/nerdpacks
- type: Partner
  url: https://newrelic.com/partner/aws-monitoring
- type: Partner
  url: https://newrelic.com/partner/pivotal
- type: Partner
  url: https://newrelic.com/partner/azure
- type: Partner
  url: https://newrelic.com/partner/gcp
- type: Partner
  url: https://newrelic.com/solutions/partners
- type: Platform
  url: https://newrelic.com/platform
- type: Platform
  url: https://newrelic.com/platform/programmability
- type: Platform
  url: https://newrelic.com/platform/kubernetes
- type: Pricing
  url: https://newrelic.com/application-monitoring/pricing
- type: Security
  url: https://newrelic.com/security
- type: Signup
  url: https://newrelic.com/signup?partner=Developer+Edition
- type: Signup
  url: https://newrelic.com/signup
- type: Support
  url: https://support.newrelic.com/
- type: Terms Of Service
  url: https://developer.newrelic.com/terms
- type: Terms Of Service
  url: https://newrelic.com/termsandconditions/terms
- type: Terms Of Service
  url: https://newrelic.com/termsandconditions/dmca
- type: Terms Of Service
  url: https://newrelic.com/termsandconditions/privacy
- type: Terms Of Service
  url: https://newrelic.com/termsandconditions/cookie-policy
- type: Terms Of Service
  url: https://newrelic.com/termsandconditions/uk-slavery-act
- type: Twitter
  url: https://twitter.com/NewRelic
- type: Twitter
  url: http://www.twitter.com/NewRelic
- type: Website
  url: https://newrelic.com/
- type: Youtube
  url: https://www.youtube.com/user/NewRelicInc/featured
- type: x-screenshot
  url: http://kinlane-productions2.s3.amazonaws.com/new-relic.jpg
- type: x-workspace
  url: https://www.postman.com/api-evangelist/workspace/new-relic/overview
...

repository: api-network/api-workspaces

branch_name: refs/heads/main

repo_name: api-network/api-workspaces


text:
# Fuzzywuzzy

### What it is good for?

Match strings with typos.

### Installed with Python or Anaconda

no

### How to install it?

    :::text
    pip install fuzzywuzzy


text:
# Running a Projection

Once you have decided how you want to build your projection, the next step is to run it. Typically, you run it in a distributed fashion in order to spread the load over the different nodes in an Akka Cluster. However, it's also possible to run it as a single instance (when not clustered) or as single instance in a Cluster Singleton.

## Dependencies

To distribute the projection over the cluster we recommend the use of [ShardedDaemonProcess](https://doc.akka.io/docs/akka/current/typed/cluster-sharded-daemon-process.html). Add the following dependency in your project if not yet using Akka Cluster Sharding:

@@dependency [sbt,Maven,Gradle] {
  group=com.typesafe.akka
  artifact=akka-cluster-sharding-typed_$scala.binary.version$
  version=$akka.version$
}

Akka Projections require Akka $akka.version$ or later, see @ref:[Akka version](overview.md#akka-version).

For more information on using Akka Cluster consult Akka's reference documentation on [Akka Cluster](https://doc.akka.io/docs/akka/current/typed/index-cluster.html) and [Akka Cluster Sharding](https://doc.akka.io/docs/akka/current/typed/cluster-sharding.html).

## Running with Sharded Daemon Process

The Sharded Daemon Process can be used to distribute `n` instances of a given Projection across the cluster. Therefore, it's important that each Projection instance consumes a subset of the stream of envelopes.

How the subset is created depends on the kind of source we consume. If it's an Alpakka Kafka source, this is done by Kafka consumer groups. When consuming from Akka Persistence Journal, the events must be sliced by tagging them as demonstrated in the example below.

### Tagging Events in EventSourcedBehavior

Before we can consume the events, the `EventSourcedBehavior` must tag the events with a slice number.

Scala
:  @@snip [ShoppingCart.scala](/examples/src/test/scala/docs/eventsourced/ShoppingCart.scala) { #imports #slicingTags #tagging }

Java
:  @@snip [ShoppingCart.java](/examples/src/test/java/jdocs/eventsourced/ShoppingCart.java) { #slicingTags #tagging }

In the above example, we created a @scala[`Vector[String]`]@java[`List<String>`] of tags from *carts-0* to *carts-4*. Each entity instance will tag its events using one of those tags. The tag is selected based on the module of the entity id's hash code (stable identifier) and the total number of tags. As a matter of fact, this will create a journal sliced with different tags (ie: from *carts-0* to *carts-4*).

We will use those tags to query the journal and create as many Projections instances, and distribute them in the cluster.

### Event Sourced Provider per tag

We can use the @ref:[EventSourcedProvider](eventsourced.md) to consume the `ShoppingCart` events.

Scala
:  @@snip [CassandraProjectionDocExample.scala](/examples/src/test/scala/docs/cassandra/CassandraProjectionDocExample.scala) { #source-provider-imports #running-source-provider }

Java
:  @@snip [CassandraProjectionDocExample.java](/examples/src/test/java/jdocs/cassandra/CassandraProjectionDocExample.java) { #source-provider-imports #running-source-provider }

Note that we define a method that builds a new `SourceProvider` for each passed `tag`.

### Building the Projection instances

Next we create a method to return Projection instances. Again, we pass a tag that is used to initialize the `SourceProvider` and as the key in `ProjectionId`.

Scala
:  @@snip [CassandraProjectionDocExample.scala](/examples/src/test/scala/docs/cassandra/CassandraProjectionDocExample.scala) { #projection-imports #running-projection }

Java
:  @@snip [CassandraProjectionDocExample.java](/examples/src/test/java/jdocs/cassandra/CassandraProjectionDocExample.java) { #projection-imports #running-projection }

### Initializing the Sharded Daemon

Once we have the tags, the `SourceProvider` and the `Projection` of our choice, we can glue all the pieces together using the Sharded Daemon Process and let it be distributed across the cluster.

Scala
:  @@snip [CassandraProjectionDocExample.scala](/examples/src/test/scala/docs/cassandra/CassandraProjectionDocExample.scala) { #daemon-imports #running-with-daemon-process }

Java
:  @@snip [CassandraProjectionDocExample.java](/examples/src/test/java/jdocs/cassandra/CassandraProjectionDocExample.java) { #daemon-imports #running-with-daemon-process }

For this example, we configure as many `ShardedDaemonProcess` as tags and we define the behavior factory to return `ProjectionBehavior` wrapping each time a different `Projection` instance. Finally, the `ShardedDaemon` is configured to use the `ProjectionBehavior.Stop` as its control stop message.

### Projection Behavior

The `ProjectionBehavior` is an Actor `Behavior` that knows how to manage the Projection lifecyle. The Projection starts to consume the events as soon as the actor is spawned and will restart the source in case of failures (see @ref:[Projection Settings](projection-settings.md)).

### Running with local Actor

TODO: Explain how to directly use `ProjectionBehavior` and when it would make sense or not.

### Running in Cluster Singleton

TODO: Explain how run `ProjectionBehavior` as a cluster singleton and when it would make sense or not.

repository: jtjeferreira/akka-projection

repo_name: jtjeferreira/akka-projection


text:
---
layout: post
current: post
cover: uploads/0001.jpg
navigation: true
title: 'Vienna (Wien) VS Prague (Praha): Which one to visit?'
date: 2018-10-30 10:00:00
tags:
  - Europe
  - Austria
class: post-template
subclass: post tag-getting-started
author: parry
---

Praha and Wien are both wonderful and exciting cities with ancient history and culture. However, if you’ve got a European vacation planned in the future and are trying to decide which one of these amazing cities to visit, it can be intimidating for sure.

#### Difference in these two cities:

Both have their charms as well as pros & cons with regards to getting around and depending upon how much time you have.

Every city has its own feel with its culture & atmosphere. Vienna & Praha are not much differ with each other rather Vienna feels more modern, stately and polished while Prague feels slightly undeveloped and more old-fashioned.

One thing is for certain: people in both cities are exceptionally friendly. Many speak English and will be willing to help you if you need any information or directions.

#### Keep a note:

If you plan to spend time in either of city, you can easily explore other places in a day trip. There is easily connection available from Vienna to visit the scenic Melk and Wachau valleys. From Prague, the closest day trip is to the gorgeous Cesky Krumlov, which is part of the South Bohemian Region. Here, you’ll find many old castles and charming houses.

It’s always a tough choice to choose best out of best. I think it depends how much time you have and what is your interest into to explore in the city. If you are traveling in quick trip then Prague might be your better option.

Prague city isn’t as spread out as Vienna and is easier to travel around in. On the other side, if you have time and perhaps wish to spend more money on upscale entertainment, Vienna will be best option.

#### Things to do in both cities:

##### Sightseeing–

In my view, Vienna is amazing to live & visit as you can reach any corner of the city with public transport in few minutes even if the city is spread out however Prague is also beautiful as a city. It has a better location on the river, very dramatic views, loads of sights to see.<br>

![Vienna Sightseen-Schönbrunn](/uploads/20180707_160013.jpg)

![](/uploads/Praha sightseen-01.jpeg)

While both cities are rich in sightseeing adventures, Prague is considered by many travel experts to be more scenic. In Vienna, people can stroll along the Danube River. Vienna city is rich in history with modern architect touch, city is a home to such great sites such as The Hofburg, Schönbrunn Palace and Gardens, and St. Stephen’s Cathedral.

Prague is definitely beautiful as a city. You can stroll along the same Danube River for breath-taking views, sit in one of the many cafés with the view of landscape, and breath in the amazing architecture – both old and modern.

![Praha](/uploads/Praha%20sightseen%202%20-01.jpeg)

##### ![Vienna](/uploads/Vienna sightseen2.jpg)

##### Shopping–

Definitely Vienna - the main shopping area is a lot bigger than Prague's. I am sure you most likely didn’t travel all the way to Europe just to do shopping. However, if you get a chance to explore rich history, beautiful city with option of shopping then choose Vienna.

##### Food–

When it comes to great dining, both cities are equally enticing. Austrians are known for their love of sweets and pastries, which is reflected in the many bakeries, cafés, and restaurants scattered around Vienna. Some restaurants in either city offer local cuisine, though you’re more likely to be eating a combination of Western European. On the other hand, Prague (being that it is in Central Europe) will be far less pricey than Vienna.

![Praha](/uploads/Food%20Praha.JPG)

##### ![Vienna](/uploads/Vienna food.jpg)

##### Culture–

What do you hope to see on your trip? Palaces? Medieval Cathedrals? The Opera? How about museums? If you do happen to visit both cities, you’ll find that culture equally as enriching. However, Vienna has more world-class museums and showcase the rich history of the area. Both cities are fantastic for this, though I think that Prague has the edge because the culture is a lot cheaper and more accessible. It is a lot easier to get affordable tickets for the theatre, the opera, concerts, etc. than in Vienna.

![Praha](/uploads/Praha Culture-01.jpeg)

![Vienna](/uploads/Vienna Culture.jpg)

##### Museums–

Definitely Vienna. There are so many amazing museums in the city that you could visit a different museum every day for a month and still not see everything. And world-class museums. But how much of your time do you real want to spend in museums? If not much, then choose the right option as per your interest. Prague is like an outdoor museum as other historical city- you can see anything when you are walking around Prague.

**End of the day…**

If you ask the same question in the Vienna city forum, most of the people will say Vienna and same applicable in Prague people will always say Praha.

![](/uploads/End of the day .jpg)

As a person who loves both places, I'd pick Vienna & Prague both as traveling from Vienna to Prague can be done in couple of hours and very comfortable. It’s always a great idea to cover the places which you like the most.

Which is your favourite city & why? Write me in comments.


text:
## Description

This repo contains the redacted source code( no data, deployment settings and so on) of the website as described in this [paper](https://www.biorxiv.org/content/early/2018/06/04/337675).

A working [live demo](https://args-osp.herokuapp.com) is hosted on heroku.

## Explanation

The app is composed of a react-redux frontend styled with semantic-ui-react and rails 5 api with mysql database.

## Current Version
1.0


text:
# Thlaspi limosellifolium (Reut. ex Burnat) Reut. ex Rouy & Foucaud SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
null

### Remarks
null

repository: mdoering/backbone

path: /life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Noccaea/Noccaea limosellifolia/ Syn. Thlaspi limosellifolium/README.md

repo_name: mdoering/backbone


text:
# bearer-auth-api
REST API server using gin-gonic to check "Authorization: Bearer" header.

[![TravisCI Status](https://travis-ci.org/nmatsui/bearer-auth-api.svg?branch=master)](https://travis-ci.org/nmatsui/bearer-auth-api)
[![DockerHub Status](https://dockerbuildbadges.quelltext.eu/status.svg?organization=nmatsui&repository=bearer-auth-api)](https://hub.docker.com/r/nmatsui/bearer-auth-api/builds/)

## Description
This REST API Server receives any path and any methods, and checks Bearer Token ("Authorization: Bearer *TOKEN*" Request Header).

1. If no Bearer Token, respond `401 Unauhtorized` always.
1. If Token does not be found in `AUTH_TOKENS` JSON which is given from the environment variable, respond `401 Unauthorized`.
1. If Token is found, but path does not be allowed, respond `403 Forbidden`
1. If Token is found and path is allowed, respond `200 OK`

This REST API is assumed to use with [Ambassador](https://www.getambassador.io/) on [Kubernetes](https://www.getambassador.io/).

## `AUTH_TOKENS` JSON template

```text
{
  "<token1>": ["<allowed path regex>", "<allowed path regex>"...],
  "<token2>": [...],
  ...
}
```

example)

```json
{
  "Znda7iglaqdoltsp7kDl60TvkkszcEGU": ["^/path1/.*$", "^/path2/path2-2/.*$"],
  "fANtLRTszYAayjtmLFllSHBrt2zRyoqV": ["^/path2/.*$"]
}
```

## Run as Docker container

1. Pull container [nmatsui/bearer-auth-api](https://hub.docker.com/r/nmatsui/bearer-auth-api/) from DockerHub

    ```bash
    $ docker pull nmatsui/bearer-auth-api
    ```
1.

repository: keithzrc/bearer-auth-api

repo_name: keithzrc/bearer-auth-api


text:
# WebPos

This is a Point-of-Sale software meant to work from the web i.e. from a web browser and accessed from a server

## Getting Started

The system works straight from the browser as long as the browser uses Javascript. The recommended browser is Google Chrome. See deployment for notes on how to deploy the project on a live system.

### Installing

Git clone the project into your system and then run index.html from a browser.

```
Enter a barcode into the barcode input field and press the return key on your keyboard to add the item to the table
```

```
Sample barcodes to use: 1234, 1245, 5678 & 7890
```

## Running the tests

To test the system use the above barcodes.

```
You can also press the add button to add an item to the table once you enter its barcode.
```

```
Press the search button to search for an item once you enter it's barcode
```

```
Press the remove button to remove the last item from the table.
```

## Built With

* [Javascript](https://www.w3schools.com/js/) - No web framework used
* [Bootstrap 4](https://getbootstrap.com/) - CSS framework
* [HTML5](https://www.w3schools.com/html/html5_intro.asp) - No pre-processor used.

## Contributing

Please rcontribute in any way you can and I will get to your pull requests as soon as I am able to.

## Versioning

This will probably always remain at version 0.0.1

## Authors

* **Wando Hillary** - *Initial work* - [Wandonium](https://github.com/Wandonium/)

## License

(The MIT License)

Copyright (c) 2019 Wando Hillary<EMAIL_ADDRESS>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: Wandonium/WebPos

repo_name: Wandonium/WebPos


text:
---
layout: guide
title: Blocks
parent: Beginners Guide
nav_order: 4
badge: 4
badge_color: guide
badge_justification: left
---

<details id="toc" open markdown="block">
  <summary>
    Table of contents
  </summary>
  {: .text-delta }
1. TOC
{:toc}
</details>

# Custom Blocks
Bedrock Minecraft allows us to add custom blocks into our world, with various vanilla-like properties. In the newest beta , custom blocks can have multiple stages (like plants), directional facing, among other features. This tutorial will cover how to create some simple blocks, for the stable version of Minecraft Bedrock.

[You can find the full bedrock.dev block documentation here.](https://bedrock.dev/r/Blocks)

# Block Behavior File
Block behaviors are structured similarly to entities: They contain description, as well as a list of components that describes the blocks behavior.

{% include filepath.html path="BP/blocks/blockname.json"%}
```jsonc
{
    "format_version": "1.12.0",
    "minecraft:block": {
        "description": {
            "identifier": "tut:blocky",
            "is_experimental": false,
            "register_to_creative_menu": true
        },
        "components": {
            "minecraft:loot": "loot_tables/blocks/blocky.json",
            "minecraft:destroy_time": 3,
            "minecraft:explosion_resistance": 3,
            "minecraft:friction": 0.6,
            "minecraft:flammable": {
                "flame_odds": 0,
                "burn_odds": 0
            },
            "minecraft:map_color": "#FFFFFF",
            "minecraft:block_light_absorption": 0,
            "minecraft:block_light_emission": 0.250
        }
    }
}
```

- "`identifier`" under "`description`" is already familiar to us;
- "`components`":
- "`minecraft:loot`" defines a loot table path which will define what the block will drop. We'll look into loot tables in the next chapter.
- "`minecraft:destroy_time`" defines how long the player will need to punch the block until it breaks. Currently it isn't possible to set different destroy times for different tools;
- "`minecraft:explosion_resistance`": the higher the value, the lower the chance that the block will be destroyed by an explosion;
- "`minecraft:friction`" defines how much friction the block has. For example, Soul and has a high value for friction and thus it slows players down. Ice has a lower friction value, and thus it has the effect of being slippery. The friction of classic blocks such as wood or stone is `0.6`.
- "`minecraft:flammable":"flame_odds`": how likely the block is to catch fire; "`burn_odds`": how likely the block is to be destroyed by fire;
- "`minecraft:map_color`" has the hex code of  color that will be displayed on a minecraft Map to symbolize this block. `#FFFFFF` means white. You can get hex codes for other colors [here](https://www.google.com/search?q=hex+color+picker&rlz=1C1CHBF_enDE886DE886&oq=hex+color+picker&aqs=chrome..69i57j0l7.2293j0j8&sourceid=chrome&ie=UTF-8).
- "`minecraft:block_light_emission`" defines the light level the block will output.

Let's create some more blocks in `BP/blocks`. I created these for four for the tutorials' sake:
- Filename: `blocky.json`; Identifier: `tut:blocky`;
- Filename: `sapp_log.json`; Identifier: `tut:sapp_log`;
- Filename: `compass_block.json`; Identifier: `tut:compass_block`;
- Filename: `flashing.json`; Identifier: `tut:flashing`;
You can play around with changing the component values for each of these. Now let's move over to the resource definition.

# Block Resource File
The resource definition for blocks differs from entities/items, because all the definitions appear in a single file.

{% include filepath.html path="RP/blocks.json"%}
```jsonc
{
    "format_version": [
        1,
        1,
        0
    ],
    "tut:blocky": {
        "textures": "blocky",
        "sound": "stone"
    },
    "tut:sapp_log": {
        "textures": {
            "up": "sapp_log_top",
            "down": "sapp_log_top",
            "side": "sapp_log_side"
        },
        "sound": "wood"
    },
    "tut:compass_block": {
        "textures": {
            "up": "compass_block_up",
            "down": "compass_block_down",
            "north": "compass_block_north",
            "south": "compass_block_south",
            "west": "compass_block_west",
            "east": "compass_block_east"
        },
        "sound": "wool"
    },
    "tut:flashing": {
        "textures": "flashing",
        "sound": "glass"
    }
}
```

As you can see, every block's identifier is applied with textures and step sounds. All of these blocks have a different type of textures, let's look through them.

- "`tut:blocky`" has "`textures`" set to the texture shortname "`**blocky**`". We'll define it in a file similiar to `RP/textures/item_texture.json`, `RP/textures/terrain_texture.json` later.
- "`tut:sapp_log`"'s "textures" are broken up in 3 parts: "`up`"(for the upper face of the block), "`down`"(for the bottom face of the block), and "`side`"(for the remaining four faces). Each one of these has a seperate texture shortname applied.
- "`tut:compass_block`"'s "`textures`" are broken up in even more sub-textures. Instead of "`side`"s, we have a different texture shortname set for the "`north`" side, the "`south`" side, the "`west`" side and the "`east`" side.
- And, lastly, "`tut_flashing`" simply has "`flashing`" defined in the same way as "`tut_blocky`".

## Block terrain texture definition

These "gorgeous" textures are the ones I'm going to use for my example blocks. The first three are located in the `RP/textures/blocks/` folder and the last 6 are located in the `/RP/textures/blocks/compass_block` subfolder - they show North, South, etc.

*Left to right: `blocky.png`, `sapp_log_side.png`, `side_block_top.png`, `sb_up.png`, `sb_down.png`, `sb_north.png`, `sb_south.png`, `sb_west.png`, `sb_east.png`*

![](/assets/images/guide/tut_blocky_texture.png){: .pixelated}

![](/assets/images/guide/tut_log_side_texture.png){: .pixelated}
![](/assets/images/guide/tut_log_top_texture.png){: .pixelated}

![](/assets/images/guide/tut_sb_up.png){: .pixelated}
![](/assets/images/guide/tut_sb_down.png){: .pixelated}

![](/assets/images/guide/tut_sb_north.png){: .pixelated}
![](/assets/images/guide/tut_sb_south.png){: .pixelated}
![](/assets/images/guide/tut_sb_west.png){: .pixelated}
![](/assets/images/guide/tut_sb_east.png){: .pixelated}

All textures need to be defines a **shortname**, (and we'll do it the same way as we defined item texture shortnames in `RP/textures/item_texture.json`), but this time in `RP/textures/terrain_texture.json`

{% include filepath.html path="RP/textures/terrain_texture.json"%}
```jsonc
{
  "resource_pack_name": "tut",
  "texture_name": "atlas.terrain",
  "padding": 8,
  "num_mip_levels": 4,
  "texture_data": {
    "blocky": {
      "textures": "textures/blocks/blocky"
    },
    "sapp_log_top": {
      "textures": "textures/blocks/sapp_log_top"
    },
    "sapp_log_side": {
      "textures": "textures/blocks/sapp_log_side"
    },
    "compass_block_north": {
      "textures": "textures/blocks/compass_block/sb_north"
    },
    "compass_block_east": {
      "textures": "textures/blocks/compass_block/sb_east"
    },
    "compass_block_west": {
      "textures": "textures/blocks/compass_block/sb_west"
    },
    "compass_block_south": {
      "textures": "textures/blocks/compass_block/sb_south"
    },
    "compass_block_up": {
      "textures": "textures/blocks/compass_block/sb_up"
    },
    "compass_block_down": {
      "textures": "textures/blocks/compass_block/sb_down"
    }
  }
}
```

The only difference from `item_textures.json` is that "`atlas.items`" is now changed to "`atlas.terrain`".

"`padding`" and "`num_mip_leavels`" mean the quality of how the texture is displayed, especially noticeable on higher resolution textures.. If it's too low, the performance will be better, but the textures will appear glitchy from further distances.

Next, all our texture shortnames have been defined. These shortnames were already used in r`RP/blocks.json`, as you might remember. If you load the game now, you'll be able to see the 3 new custom blocks you just added, with all the texture functionality :)

![](/assets/images/guide/custom_blocks_inventory.png)

But, we still have to define the `tut:flashing`'s texture(third from the left), which is currently undefined. That's why it appears as purple-and-black tiled texture right now.

## Block flipbook texture definition
As you might have already guessed, flipbook texture shortnames are defined in a different place then `RP/textures/terrain_texture.json`. Let's create another file, `RP/textures/flipbook_textures.json`.

{% include filepath.html path="RP/textures/flipbook_textures.json"%}
```jsonc
[
  {
    "flipbook_texture": "textures/blocks/flashing_flipbook",
    "atlas_tile": "flashing",
    "ticks_per_frame": 13
  }
]
```

- "`flipbbok_texture`" is the path to your texture file, which is named "`flashing_flipbook`" in this scenario.
- "`atlas_tile`" is basically the shortname definition. As you know, we already applied "`flashing`" texture shortname to the `tut:flashing` block in RPblocks.json`.
- "`ticks_per_frame`" defines how quickly the different textures will fade into the block, in other words the speed of the animation.

A **flipbook texture** file is created like this:
- The image width is 16;
- Image height is `16*3`, as we have three different block textures/**frames** to fade. If you wanted a flipbook with 12 different textures, the height would be `16*12`.
**Done!** All of our blocks work perfectly.

<video width="320" height="240" controls>
  <source src="/assets/images/guide/custom_blocks_done.mp4" type="video/mp4">
</video>

# Setting block names
And, finally, let's define our block's names in `/RP/texts/en_US.lang` like we did with items, somewhatlike this:
```
tile.tut:blocky.name=Blocky Block
tile.tut:sapp_log.name=Sapphire Wood
tile.tut:compass_block.name=A compass in block-form
tile.tut:flashing.name=Block of Flashing Matter
```

[You can learn more about .lang here](https://wiki.bedrock.dev/concepts/lang.html)

___

## Your progress so far
**What you've done:**
- [x] Learned about custom block behavior components;
- [x] Created a custom block with simple textures;
- [x] Created a custom block with side- and face-relying textures;
- [x] Created a custom block with flipbook textures;

**What are you to do next:**
- [x] Create custom Loot Tables for your blocks and entities;
- [ ] Create custom crafting recipes;
- [ ] Create custom Spawn Rules for entities;

repository: SmokeyStack/bedrock-wiki

branch_name: refs/heads/gh-pages

repo_name: SmokeyStack/bedrock-wiki


text:
# Reactive and impressive presentation system made with meteor

[![meteor presentation](http://img.youtube.com/vi/YEpXfa-LOW8/0.jpg)](http://www.youtube.com/watch?v=YEpXfa-LOW8)

## Installation

1. Install Meteor https://www.meteor.com/install
1. Clone the repository in your workspace
1. run meteor
1. Create an user and create your presentation.

## Dependencies

- djedi:modules https://github.com/djedi23/meteor-modules
- djedi:jmpress https://github.com/djedi23/meteor-jmpress
- djedi:pres-jmpress https://github.com/djedi23/meteor-pres-jmpress
- djedi:pres-collections https://github.com/djedi23/meteor-pres-collections
- djedi:pres-interactions https://github.com/djedi23/meteor-pres-interactions
- djedi:pres-edition https://github.com/djedi23/meteor-pres-edition


text:
The Open ICR Image Pre-processor
================================
An Python script used to pre-process images of individual handwritten characters to increase OCR/ICR accuracy
Part of the Open ICR Project - http://opensource.newmediaist.com/open-source-icr.html

The purpose of this image pre-processor is to "sanitize and standardize" the input image as much as possible to prepare it for the recognition engine. The image preprocessor has the following dependencies:

Python & the following Python Plugins:

OpenCV

NumPy

sciPy

zhangsuen

            The following is a short summary of the different modifications the image pre-processor makes to the image:

Remove borders around the character (i.e. from imperfect character extraction)

Median filtering is applied to remove salt and pepper type noise

Character image is cropped down to borders of written character

Character image is scaled to a standard set of dimensions

Character image is thinned using Zhang Suen algo

White space padding added around the image to prepare for next stage

Erosion is added to the character image to join small gaps

Usage

          python preprocessor.py -o original.png-d ~path_for_output\filename.png

Code licensed under Apache License v2.0


text:
# August 2019

### Problems Solved:
- 8/4/19: Given three 32-bit integers x, y, and b,
return x if b is 1 and y if b is 0,
using only mathematical or bit operations.
You can assume b can only be 1 or 0.

- 8/5/19: Given a string of parentheses,
write a function to compute the minimum number
of parentheses to be removed to make the
string valid (i.e. each open parenthesis is
eventually closed).

- 8/6/19: Given a list of rules, check if the sum of the rules validate.

- 8/7/19: Implement division of two positive integers without using the division, multiplication,
or modulus operators. Return the quotient
as an integer, ignoring the remainder.

- 8/8/19: Determine whether a tree is a valid binary search tree.

- 8/9/19: Given an integer n and a list of integers l,
write a function that randomly generates a
number from 0 to n-1 that isn't in l (uniform).

- 8/10/19: What does the below code snippet print out?
How can we fix the anonymous functions to behave as we'd expect?

functions = []
for i in range(10):
    functions.append(lambda : i)

for f in functions:
    print(f())

- 8/11/19: We're given a hashmap associating each
courseId key with a list of courseIds values,
which represents that the prerequisites of
courseId are courseIds. Return a sorted
ordering of courses such that we can finish
all courses.
Return null if there is no such ordering.

- 8/12/19: Given a tree, find the largest tree/subtree that is a BST.
Given a tree, return the size of the largest tree/subtree that is a BST.

- 8/13/19: Given a binary tree of integers,
find the maximum path sum between two nodes.
The path must go through at least one node,
and does not need to go through the root.

- 8/14/19: Given a number represented by a list of digits,
find the next greater permutation of a number,
in terms of lexicographic ordering. If there
is not greater permutation possible, return
the permutation with the lowest value/ordering.

- 8/15/19: Given a number in the form of a list of digits,
return all possible permutations.

- 8/16/19: Write a map implementation with a get function
that lets you retrieve the value of a key at a particular time.

- 8/17/19: Given a 2D board of characters and a word,
find if the word exists in the grid.

- 8/18/19: Given an unsorted array of integers,
find the length of the longest consecutive
elements sequence.

- 8/19/19: You are given a sequence of points and
the order in which you need to cover the
points. Give the minimum number of steps
in which you can achieve it.

- 8/20/19: Given an even number (greater than 2),
return two prime numbers whose sum will
be equal to the given number.

- 8/21/19: Given a list of integers and a number K,
return which contiguous elements of the
list sum to K.

- 8/22/19: Given a string and a set of characters,
return the shortest substring containing
all the characters in the set.

- 8/23/19: Determine whether a doubly linked
list is a palindrome. What if it’s singly linked?

- 8/24/19: Given a function f, and N return a
debounced f of N milliseconds.

- 8/25/19: Given an integer list where each number
represents the number of hops you can make,
determine whether you can reach to the last
index starting at index 0.

- 8/26/19: Print the nodes in a binary tree level-wise.

- 8/27/19: Given two strings A and B, return whether
or not A can be shifted some number of
times to get B.

- 8/28/19: Given an unsigned 8-bit integer, swap its
even and odd bits. The 1st and 2nd bit
should be swapped, the 3rd and 4th bit
should be swapped, and so on.

- 8/29/19: Given a binary tree, return all paths
from the root to leaves.

repository: zstoebs/Daily-Coding-Problem

path: /August 2019/README.md

repo_name: zstoebs/Daily-Coding-Problem


text:
Translator: Morton Bast

Reviewer: Thu-Huong Ha
I'm going to start
on a slightly somber note.
Two thousand and seven, five years ago,
my wife gets diagnosed with breast cancer.
Stage IIB.
Now, looking back, the most
harrowing part of that experience
was not just the hospital visits --
these were very painful
for my wife, understandably so.
It was not even the initial shock
of knowing that she had breast cancer
at just 39 years old,
absolutely no history
of cancer in her family.
The most horrifying and agonizing part
of the whole experience
was we were making decisions
after decisions after decisions
that were being thrust upon us.
Should it be a mastectomy?
Should it be a lumpectomy?
Should it be a more
aggressive form of treatment,
given that it was stage IIB?
With all the side effects?
Or should it be a less
aggressive form of treatment?
And these were being thrust
upon us by the doctors.
Now you could ask this question,
why were the doctors doing this?
A simplistic answer would be,
the doctors are doing this
because they want to protect
themselves legally.
I think that is too simplistic.
These are well-meaning doctors,
some of them have gone on
to become very good friends.
They probably were simply
following the wisdom
that has come down through the ages,
this adage that when
you're making decisions,
especially decisions of importance,
it's best to be in charge,
it's best to be in control,
it's best to be in the driver's seat.
And we were certainly
in the driver's seat,
making all these decisions.
And let me tell you --
if some of you have been there,
it was a most agonizing
and harrowing experience.
Which got me thinking.
I said, is there any validity
to this whole adage
that when you're making decisions,
it's best to take the driver's seat,
be in charge, be in control?
Or are there contexts
where we're far better off
taking the passenger's seat
and have someone else drive?
For example, a trusted financial advisor,
could be a trusted doctor, etc.
And since I study human decision making,
I said, I'm going to run some studies
to find some answers.
And I'm going to share one
of these studies with you today.
So, imagine that all of you
are participants in the study.
I want to tell you that
what you're going to do in the study is,
you're going to drink a cup of tea.
If you're wondering why, I'll tell you why
in a few seconds from now.
You are going to solve
a series of puzzles,
and I'm going to show you examples
of these puzzles momentarily.
And the more puzzles you solve,
the greater the chances
that you'll win some prizes.
Now, why do you have to consume the tea?

Why? Because it makes a lot of sense:
In order to solve these puzzles
effectively, if you think about it,
your mind needs to be in two states
simultaneously, right?
It needs to be alert,
for which caffeine is very good.
Simultaneously, it needs to be calm --
not agitated, calm --
for which chamomile is very good.
Now comes the between-subjects design,
the AB design, the AB testing.
So what I'm going to do is randomly
assign you to one of two groups.
So imagine that there is
an imaginary line out here,
so everyone here will be group A,
everyone out here will be group B.
Now, for you folks, what I'm going to do
is I'm going to show you these two teas,
and I'll go ahead and ask you
to choose your tea.
So you can choose whichever tea you want.

You can decide, what is your mental state:
OK, I choose the caffeinated tea,
I choose the chamomile tea.
So you're going to be in charge,
you're going to be in control,
you're going to be in the driver's seat.
You folks, I'm going to show you
these two teas,
but you don't have a choice.
I'm going to give you
one of these two teas,
and keep in mind, I'm going
to pick one of these two teas
at random for you.
And you know that.
So if you think about it,
this is an extreme-case scenario,
because in the real world,
whenever you are taking passenger's seat,
very often the driver is going
to be someone you trust,
an expert, etc.
So this is an extreme-case scenario.
Now, you're all going to consume the tea.
So imagine that you're taking the tea now,
we'll wait for you to finish the tea.
We'll give another five minutes
for the ingredient to have its effects.
Now you're going to have
30 minutes to solve 15 puzzles.
Here's an example of the puzzle
you're going to solve.
Anyone in the audience
want to take a stab?

Audience member: Pulpit!

Baba Shiv: Whoa! OK.
That's cool.
Yeah, so what we'd do if we had
you who gave the answer
as a participant,
we would have calibrated
the difficulty level
of the puzzles to your expertise.
Because we want
these puzzles to be difficult.
These are tricky puzzles,
because your first instinct
is to say "tulip."
And then you have to unstick yourself.
Right?
So these have been calibrated
to your level of expertise,
because we want this to be difficult,
and I'll tell you why, momentarily.
Now, here's another example.
Anyone? This is much more difficult.

Audience member: Embark.

BS: Yeah. Wow! OK.
So, yeah, so this is, again, difficult.
You'll say "kamber," then you'll go,
"maker," and all that,
and then you can unstick yourself.
So you have 30 minutes now
to solve these 15 puzzles.
Now, the question we're asking
here is, in terms of the outcome --
and it comes in the number
of puzzles solved --
will you in the driver's seat
end up solving more puzzles
because you are in control,
you could decide which tea
you would choose,
or would you be better off,
in terms of the number of puzzles solved?

We also observe another thing,
and that is, you folks not only
are solving fewer puzzles,
you're also putting less juice
into the task -- less effort,
you're less persistent, and so on.
How do we know that?
Well, we have two objective measures.
One is, what is the time,
on average, you're taking
in attempting to solve these puzzles?
You will spend less time compared to you.
Second, you have
30 minutes to solve these;
are you taking the entire 30 minutes
or are you giving up
before the 30 minutes elapse?
You will be more likely to give up
before the 30 minutes elapse,
compared to you.
So you're putting in less juice,

and therefore, the outcome:
fewer puzzles solved.

That brings us now to:
why does this happen?
And under what situations -- when --
would we see this pattern of results
where the passenger is going to show
better, more favorable outcomes,
compared to the driver?

It's an acronym that stands for the nature
of the feedback you're getting
after you made the decision.
So if you think about it,
in this particular puzzle task --
it could happen in investing
in the stock market,
very volatile out there,
it could be the medical situation --
the feedback here is immediate.
You know the feedback,
whether you're solving the puzzles or not.
Right? Second, it is negative.
Remember, the deck
was stacked against you,
in terms of the difficulty
level of these puzzles.
And this can happen in the medical domain.
For example, very early on
in the treatment,
things are negative, the feedback,
before things become positive.
Right? It can happen in the stock market.
Volatile stock market, getting negative
feedback, it is also immediate.
And the feedback in all these cases
is concrete, it's unambiguous;
you know if you've solved
the puzzles or not.
Now, the added one,
apart from this immediacy,
negative, this concreteness --
now you have a sense of agency.
You were responsible for your decision.
So what do you do?
You focus on the foregone option.
You say, you know what?
I should have chosen the other tea.

(Laughter)

That casts your decision in doubt,
reduces the confidence
you have in the decision,
the confidence you have
in the performance,
the performance in terms
of solving the puzzles.
And therefore less juice into the task,
fewer puzzles solved
and less favorable outcomes
compared to you folks.
And this can happen in the medical
domain, if you think about it, right?
A patient in the driver's
seat, for example.
Less juice, which means
keeping herself or himself
less physically fit, physically active
to hasten the recovery process,
which is what is often advocated.
You probably wouldn't do that.
And therefore, there are times
when you're facing the INCA,
when the feedback is going
to be immediate, negative, concrete
and you have the sense of agency,
where you're far better off
taking the passenger's seat
and have someone else drive.
Now, I started off on a somber note.
I want to finish up on a more upbeat note.
It has now been five years,
slightly more than five years,
and the good news, thank God,
is that the cancer is still in remission.
So it all ends well.
But one thing I didn't mention
was that very early on into her treatment,
my wife and I decided
that we would take the passenger's seat.
And that made so much of a difference
in terms of the peace of mind
that came with that;
we could focus on her recovery.
We let the doctors make all the decisions
and take the driver's seat.
Thank you.

(Applause)

repository: prewittdavon/TEDVis

gha_language: Python

repo_name: prewittdavon/TEDVis


text:
Android Pulley Menu
==========

Pulley menu is an alternate to traditional Menu which allows user to select any option for an activity intuitively. The menu is revealed by dragging the screen downwards and in that gesture user can also select any of the options.

This Libraray has been implemented in the following android applications :-

[Pulley Menu Demo][2]

Please drop a mail at<EMAIL_ADDRESS>if you are using it in your application so that it can be listed here.

ScreenShots
=====

![Alt text](https://lh4.ggpht.com/kn6a9FJ0ywIQfhOEfa-pCDgT55O-RzPaq2Ht6AEBgTvK6K0avsAZf7Tnteopt7xrnhg=h310-rw )
....
![Alt text](https://lh5.ggpht.com/jX2cyhj39Pk2Qr0PM8sY6LkLvOA-w6wDiyVfIgjc7Jrt-332PO63GYa7tRIXYflUKg=h310-rw ).....
![Alt text](https://lh6.ggpht.com/ekTeiHHF77VIqCKU7QCOgMnzsEubGd0PZ4ZqSIIQIdpoVOwhljintGkoXalL4GbS1hpF=h310-rw )

Usage
=====

This library is very simple to use. It requires no extension of custom classes,
it's simply added to an activity by calling the method

PulleyMenu(Context,ParentView,Menuview,Normal Background Color,Highlighted Color)`
methods.

For examples on how to use this library, check out the sample app.

Sample Call
-------
```java
	final ListView menuview = new ListView(this);
		menuview.setPadding(0, 30 , 0, 0);

		ArrayList<String> list = new ArrayList<String>();
		list.add("Start");
		list.add("Stop");
		list.add("Reset");

		anshul.pulleymenu.CustomListViewAdapter adapter = new anshul.pulleymenu.CustomListViewAdapter(this,
				android.R.layout.simple_list_item_1, list);
		menuview.setAdapter(adapter);
		menuview.setOnItemClickListener(this);
		int color1 = Color.WHITE;
		int color2 = Color.argb(255, 50, 255, 255);
		pulleymenu = new anshul.pulleymenu.PulleyMenu(this,R.layout.activity_topmenu,menuview,color1,color2);
```
-------

Including in your project
=========================

Include it in your project as an android library project.
Please take care of the following points:-

1. The target build should be kept at Android 4.0 though it will work with previous versions too

Credits
=======

 * Cyril Mottier for his [articles][1] on this pattern
 * Simon VT for his library [Android menu Drawer][3]

License
=======

    Copyright 2013 Anshul Bansal

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

[1]: http://android.cyrilmottier.com/?p=658
[2]: https://play.google.com/store/apps/details?id=net.anshul.pulleymenu.samples
[3]: https://github.com/SimonVT/android-menudrawer


text:
# Simple_DVD_Bouncing_Logo
"DVD Bouncing Logo" made in C just for fun

## Animation
![alt text](https://raw.githubusercontent.com/d3suu/Simple_DVD_Bouncing_Logo/master/bounce-animation.gif)

## Compiling and running
```shell
~# git clone https://github.com/d3suu/Simple_DVD_Bouncing_Logo.git
~# cd Simple_DVD_Bouncing_Logo
~# gcc logo.c -o logo
~# ./logo
```

## Modification
On these lines:
```C
#define Y_SIZE 20 // You can change these values as you want!
#define X_SIZE 50
#define SPEED 150
```
`Y_SIZE` and `X_SIZE` stands for borders dimensions, while `SPEED` changes the speed of generating next frameBuffer becouse of terminal refresh speed. For `SPEED` values higher than 50 should be okay. Also higher values = slower refresh rate.

On these lines:
```C
const char logoChar = '@';
const char borderChar = '#';
```
You can change how borders and logo looks like.


text:
### What is all this about?

I'm currently reading through [The C Programming Language, 2nd Edition](https://en.wikipedia.org/wiki/The_C_Programming_Language) or K&R as it's sometimes known.

No idea how far through it I'll get but here's the project files anyway.

### How do I run the files?

Since C is a compiled language, you'll need a compiler. I'm not sure about Windows but for macOS, you've got Clang built in and for Linux, you'll probably want to use [GCC](https://gcc.gnu.org/).

I have no idea what compilers are recommended for what systems though. I barely even know what I'm doing in the first place!

### How do I compile the files then?

For macOS, you can run `cc` or `clang` which both run the Clang compiler.

It takes in a file as a parameter. To compile hello.c, you would run `cc hello.c` which would currently spit out an `a.out` file.

I say currently because I'm guessing you can change the output name but I wouldn't know how just yet.

To run it, you can type `./a.out` into your terminal and the program should run.

I assume for Linux, it's the same but swap `cc` for `gcc`? Google is your friend anyway.

If you don't have gcc installed, I believe it's part of `build-essential` which you can probably get from your distro package manager.

repository: marcus-crane/junkcode

repo_name: marcus-crane/junkcode


text:
# Segment Upload Guide for Youtube Admins

## Upload the new video

In youtube, upload the same video and title it as follows

```txt
Contributor Workshop : <Segment Name> with <Presenter Name> | <Month> <Year>
```

For example

```txt
Contributor Workshop : Why Contribute? with @alisondy | May 2021
```

## Adding the thumbnail image

```markdown
TODO : Instructions on how to generate a thumbnail image, similar to https://gist.github.com/alisondy/e4ff3b483a32330ade0c880b4a4a10b1
```

Set the thumbnail to the image generated in the previous step

## Setting the description

Use the following template for setting the video description

```txt
This is the video guide for the Contributor Workshop segment <Segment Name>

Link to this segments page:
https://kubernetes.dev/docs/workshop/<page-name>

Link to the workshop:
https://kubernetes.dev/docs/workshop/
```

## Update the previous video for the segment if it exists

If you're updating an already existing video, follow the next steps to update the following on the previous video

- title
- thumbnail
- description
- comments section

## Update the title

Update the title on the previous video to match the following format

```txt
Contributor Workshop : <Segment Name> | <Month> <Year> | 🚨🚨 DEPRECATED 🚨🚨
```

For example

```txt
Contributor Workshop : Why Contribute? with @alisondy | May 2021 | 🚨🚨 DEPRECATED 🚨🚨
```

## Update the thumbnail image

Update the Thumbnail image on the previous video to

insert-deprecation-thumbnail-here.jpeg

```txt

THIS VIDEO IS DEPRECATED!
See the comments & description for details on where to find the new video guide!

```

## Update the Description

On the previous video, add the following to the start of the description

```txt
🚨🚨 DEPRECATED , Please see <link to new video> 🚨🚨
```

## Update the Comments

On the previous video, add the following as a comment as Kubernetes YT & pin to the top of the comments

```txt
🚨🚨 DEPRECATED , Please see <link to new video> 🚨🚨
```

Close the comment section of the deprecated video

## Update the Playlist

Update the youtube playlist with the segment recording. Remove the previous version of the video from the playlist if it exists.

repository: kubernetes/community

gha_language: Jupyter Notebook

repo_name: kubernetes/community