text:
[Link to project](https://github.com/crepac4/nodash)

# nodash
An 'extension' of lodash for node

[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
![GitHub last commit](https://img.shields.io/github/last-commit/crepac4/nodash)
![Node.js CI](https://github.com/crepac4/nodash/workflows/Node.js%20CI/badge.svg)
![nycrc config on GitHub](https://img.shields.io/nycrc/crepac4/nodash?config=.nycrc.json)

## Description

An extension of lodash with functions and utilities that I use for nodejs.

## To be implemented
1) Functions for distinguishing between async Function Generator, Function Generators, async Functions, Functions, Classes, Literal objects. (Done)
2) syntactic sugar for synchronous get of a json file (Done)
3) Other functionality that I miss from python (in progress)

## What does 'nodash' mean?
lodash - nodash - node dash.


text:
+++
date = "2016-03-13T13:12:12Z"
title = "Pandas drop function"
tags = ['pandas', 'data-verbs']

+++

[drop](http://pandas.pydata.org/pandas-docs/version/0.17.1/generated/pandas.DataFrame.drop.html)
lets you drop particular rows or columns of the dataframe.

<!--more-->

The thing I find this most useful for is removing messy intermediary columns that you don't need any more.
If you do this, you need to specify that the `axis=1` to drop the columns.

```python
(
    clean
    .drop('land_border_length', axis = 1)
)
```

license: MIT

repository: dataewan/dataewan-hugo-blog

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: dataewan/dataewan-hugo-blog


text:
# Phytophthora iranica Ershad, 1971 SPECIES

#### Status
ACCEPTED

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

#### Published in
Mitt. biol. BundAust. Land. -u. Forstw. 140: 63 (1971)

#### Original name
Phytophthora iranica Ershad, 1971

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
layout: post
title: OpenCL on Samsung Chromebook 3
---

Here's quick description how to get going OpenCL on Samsung Chromebook 3.
-----

### Steps:

1. Install [crouton](https://github.com/dnschneid/crouton)

2. Install Mali drivers and SDK
    * Mali [driver](http://malideveloper.arm.com/develop-for-mali/drivers/mali-t6xx-gpu-user-space-drivers/http://malideveloper.arm.com/develop-for-mali/drivers/mali-t6xx-gpu-user-space-drivers/) - choose T604 X11 version
    * Mali [SDK](http://malideveloper.arm.com/develop-for-mali/sdk/mali-opencl-sdk/)
    * I've installed the driver libraries into /usr/lib to avoid config-fu
    * Run sudo ldconfig
    * Modify library links to avoid symbol [lookup errors](http://krblogs.com/post/65347946766/mali-drivers-on-chromebook)

            ln -s /usr/lib/libmali.so /usr/lib/libOpenCL.so.1
            ln -s /usr/lib/libOpenCL.so.1 /usr/lib/libOpenCL.so

3. Check permissions to the mali GPU device. I've added myself to the video group

        ls -l /dev/mali0

4. Compile SDK examples to test if all is good.  [DrinkCat](http://drinkcat.blogspot.com/2013/11/opencl-on-samsung-chromebook-arm-under.html)
 has very good tutorial on this

5. Enjoy 1 node of [supercomputer](http://www.xbitlabs.com/news/other/display/20121119221057_Barcelona_Supercomputing_Center_Selects_Samsung_Exynos_Processor_for_Supercomputer.html) power

Credits:
[DrinkCat](http://drinkcat.blogspot.com/2013/11/opencl-on-samsung-chromebook-arm-under.html)
[Krishnaraj Bhat](http://krblogs.com/post/65347946766/mali-drivers-on-chromebook)


text:
# layout-elements

    npm install layout-elements

## Requirements

This package relies on and makes use of [CSS Variables (Custom Properties)](https://caniuse.com/#feat=css-variables) in runtime.

## Rationale

Stack: abstraction on top of Flexbox for linear collections. No need to figure
out `justify-content`/`align-items` values, etc.

Scene: a useful layer to force aspect ratio of an element.

## Usage

```javascript
import React from 'react';
import { Stack } from 'layout-elements';

function MyDataList({ items }) {
  return (
    <Stack direction="vertical" spacing={1} alignment="stretch">
      {items.map(item => (
        <MyItem data={item} />
      ))}
    </Stack>
  );
}
```

```javascript
import React from 'react';
import { Scene } from 'layout-elements';

function MyDataVis() {
  return (
    <Scene aspectRatio={16 / 9} preserve>
      <svg>...</svg>
    </Scene>
  );
}
```

Make sure related stylesheet is bundled as well:

```css
@import url('layout-elements/style.css');
```

## Typings

The library includes Flow and TypeScripts type definitions. Mostly aiming at
correct props usage.

repository: alexeyraspopov/layout-elements

repo_name: alexeyraspopov/layout-elements


text:
# PastryShop

[![Build Status](https://travis-ci.com/kevalpatel2106/PastryShop.svg?branch=master)](https://travis-ci.com/kevalpatel2106/PastryShop) [![codecov](https://codecov.io/gh/kevalpatel2106/PastryShop/branch/master/graph/badge.svg)](https://codecov.io/gh/kevalpatel2106/PastryShop) [![API](https://img.shields.io/badge/API-21%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=21)

#### Demo application for delicious pastries shop.

## Features:
- Beautiful animations.
- Offline first approach. All the network responses are cached into the database (powered by [Room](https://developer.android.com/topic/libraries/architecture/room)).
- Uses android architecture components.
- Follows MVVM architecture pattern.
- Uses dagger heavily to provide clear separation between different architecture layers. Helps to write testable code.
- Mocking database, shared preferences and web server to write accurate tests.
- Single activity application.

## How to run tests?
- Make sure you connect physical device or run an emulator before running the UI tests.
- To run tests, run following command:
```bash
./gradlew cAT
```

## Acknowledgement:
- This application implements the design and animations from the beautiful post on [uplabs](https://www.uplabs.com/posts/restaurant-app-for-android). (There are some changes in resources such as fonts, images and texts from the original mock up.)
- Code coverage currently displays percentage of code tested by the unit tests. (UI tests are not being performed on CI server.)

## Screenshots:

|Portrait (Pixel 2)|Landscape (Nexus 9)|
|:---:|:---:|
|![portrait.gif](/.github/portrait.gif)|![landscape.gif](/.github/landscape.gif)|

## What to try this out?
- You can download the debuggable apk from [here](https://github.com/kevalpatel2106/PastryShop/releases) and play with it.

## Want to contribute?
Every small or large contribution to this project is appreciated. Make sure you read the [contribution guide](/.github/CONTRIBUTING.md) before generating the pull request.

## Questions?🤔
Hit me on twitter [![Twitter](https://img.shields.io/badge/Twitter-@kevalpatel2106-blue.svg?style=flat)](https://twitter.com/kevalpatel2106)

## License
Copyright 2018 Keval Patel

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.


text:
---
layout: post
title:      "School Registration Application"
date:       2019-05-22 23:59:05 +0000
permalink:  school_registration_application
---

I was not ready for this project. This list of requirements seemed daunting and I wasn't sure I remembered half of what they were asking us to do. The scope method? No one remembers how to write a scope method. Also the relationships requirements for our models about made my eyes cross.

But here I am now on the other side of this, and I can't believe I finished. I solidified my knowledge of routing to views, how models interact with each other based on their relationships, and learned a few new tricks. For example, instead of Bootstrap to style my project, I learned about Materialize, Google's version of Bootstrap. Its ok. Not extremely well documented but I am hoping will show diversity. Also there's is a handy helper method called .ordinalize that will take your integer and and the "st", "th", or "rd" for you. SO helpful. I did remember how to use a scope method after all. And the coolest part was implementing OmniAuth for Facebook login. That feels like real developer stuff.

I definitely felt the pressure when I started this project but with careful planning and making sure I was 100% on board with what I wanted from my models, the application came along pretty smoothly and I feel excited to turn it in. I love coding more with everything I learn.

extension: markdown


text:
* Rewrite parser; formatter is now ~60% faster
* Add IndentPackageBlocks formatting preference
* Allow newline before self type declaration
* FIX: avoid abutting `@` and an operator, otherwise it merges into a single identifer
* FIX: formatting for newline between `private[foo]` and trait/class/def etc
* Update parser to match changes from Scala trac #3672 (types on implicit parameters in function expressions)
* FIX: avoid hash and operator merging (e.g. `b[c# ::[d]]`)
* Tweaks to else clause formatting

repository: auvik/scalariform

gha_language: Scala

gha_license_id: MIT

repo_name: auvik/scalariform


text:
Koddi
========

Sample app for koddi.com, It uses Silex

Getting Started
===============

#### Clone koddi-sample-app

```bash
$ git clone https://github.com/bhargavjoshi/koddi-sample-app.git
$ cd koddi-sample-app
```

Open `config/propel/buildtime-conf.xml` and fillout with proper database username, password and database name.

Repeat the same with `config/propel/runtime-conf.xml`

#### Use composer to install dependencies

```bash
$ composer install
```

#### Generate config file

```bash
$ vendor/bin/propel config:convert-xml --output-dir="config/propel" --input-dir="config/propel"
```

#### Generating Required propel classes

```bash
$ ./propel build
```

#### Migrating the Database

```bash
$ ./propel migrate
```

repository: bhargavjoshi/koddi-sample-app

gha_language: PHP

repo_name: bhargavjoshi/koddi-sample-app


text:
<!---
   Copyright 2017-2023 Ericsson AB.
   For a full list of individual contributors, please see the commit history.

   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.
--->

# Confidence Level Joining Example

This example illustrates
how [EiffelConfidenceLevelModifiedEvent](../eiffel-vocabulary/EiffelConfidenceLevelModifiedEvent.md) can be used to
capture and summarize a larger body of lower level results, such as test suite verdicts, effectively _joining_ multiple
flows in the continuous integration and delivery system.

A JSON array of all events used in this example can be
found [here](../examples/flows/confidence-level-joining/events.json).

## Introduction

A common use case in continuous integration and delivery systems is to join many separate (and disparate) tests into a
larger entity, providing a stamp of approval to the item under test. In Eiffel, such stamps are provided
by [EiffelConfidenceLevelModifiedEvent](../eiffel-vocabulary/EiffelConfidenceLevelModifiedEvent.md). This not only
serves the purpose of raising the level of abstraction, thereby facilitating analysis and release decisions, but also
provides a pragmatic extension point of the production pipeline: an external listener (e.g. a product looking to
integrate the item under test) is not interested in tracking individual test case results, particularly as they may well
change over time or even from execution to execution, but simply wants to know "Is this artifact good enough for me to
pick up?".

## Event Graph

![alt text](./confidence-level-joining.svg "Event Graph of Confidence Level Joining Example")

## Event-by-Event Explanation

### ArtC1

The [EiffelArtifactCreatedEvent](../eiffel-vocabulary/EiffelArtifactCreatedEvent.md) is central in this example. It
declares that a new artifact has been created, and (largely via links) documents how and from what it was built. At the
time of this event we still know very little about the artifact: it has unique coordinates (its purl identity), but
where to fetch it or whether it is any good remains to be seen.

### CDef1

An [EiffelCompositionDefinedEvent](../eiffel-vocabulary/EiffelCompositionDefinedEvent.md) detailing a composition of
items (such as source code revisions and other artifacts), from which the artifact declared by __ArtC1__ was built. The
elements of the composition, the reason for defining the composition et cetera are excluded in this example.

### EDef1

An [EiffelEnvironmentDefinedEvent](../eiffel-vocabulary/EiffelEnvironmentDefinedEvent.md) describing the environment in
which the artifact declared by __ArtC1__ was built.

### ArtP1

The [EiffelArtifactPublishedEvent](../eiffel-vocabulary/EiffelArtifactPublishedEvent.md) declaring that the created
artifact now has been published, and consequently may be fetched. Since __ArtC1__ itself declares the purl identity, the
artifact _may_ be fetched using only that information (assuming a binary repository supporting this, such as
Artifactory), but it is still recommended practice to explicitly declare when and where the artifact can be retrieved,
in order to avoid outages or timing issues.

### ActT1, ActT2, ActS1, ActS2, ActF1, ActF2

A set
of [EiffelActivityTriggeredEvent](../eiffel-vocabulary/EiffelActivityTriggeredEvent.md), [EiffelActivityStartedEvent](../eiffel-vocabulary/EiffelActivityStartedEvent.md), [EiffelActivityFinishedEvent](../eiffel-vocabulary/EiffelActivityFinishedEvent.md)
reporting on the lifecycle of two independent activity executions being caused by the publication of the artifact. Note
that the EiffelActivityStartedEvents and EiffelActivityFinishedEvents are "dead ends" in the graph: in this example,
nothing occurs as a direct cause of the activity starting or finishing (although such a setup is, of course, entirely
possible) and the work being done within the activity refers directly to the EiffelActivityTriggeredEvent as its
context. This shows how, in one sense, this type of lifecycle events is superfluous: for the core functionality of this
example it is perfectly possible to cut them out and let the EiffelTestCaseStartedEvents refer directly to __ArtP1__ as
their cause. Activity events do provide important contextual information, however, as they allow monitoring of e.g.
system performance, bottlenecks, queue times and execution durations. They also serve the purpose of clustering work; in
this example, __ActT1__ and __ActT2__ may represent activities executed at wildly different times, at different
locations and by different organizations.

### TCT1, TCT2, TCT3, TCT4

[EiffelTestCaseTriggeredEvents](../eiffel-vocabulary/EiffelTestCaseTriggeredEvent.md) declaring that, as part of their
respective activities, test cases have been triggered for execution. In this example only a very small number of test
cases are executed - in reality, these events tend to be very numerous. Note that the cause of the execution can be
traced to __ArtC1__ via __CONTEXT__ and __CAUSE__ links. This is not enough to unambiguously identify the item under
test, however: it is entirely conceivable that the immediate cause for executing the test is completely independent from
the item under test. Consequently the __IUT__  link is used to reference __ArtC1__ directly.

### TCS1, TCS2, TCS3, TCS4

[EiffelTestCaseStartedEvents](../eiffel-vocabulary/EiffelTestCaseStartedEvent.md) declaring that the previously
triggered test case executions have commenced.

### TCF1, TCF2, TCF3, TCF4

[EiffelTestCaseFinishedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md) reporting the verdict of their
respective test case executions.

### CLM1

The [EiffelConfidenceLevelModifiedEvent](../eiffel-vocabulary/EiffelConfidenceLevelModifiedEvent.md) that summarizes all
of the test case executions under a single headline. Note that the algorithm for determining this confidence level may
be simple or relatively complex, but an important point of the event is that this algorithm is evaluated close to those
tests, affording separation of concerns for users (human or automated) who simply want to know whether the relevant
tests worked, whichever those tests happened to be at that point in time. This way the nitty gritty details are
abstracted away. It doesn't end there, however: while not included in this example, __CLM1__ may in turn be but a
building block of subsequent, even higher level EiffelConfidenceLevelModifiedEvents.

repository: eiffel-community/eiffel

gha_language: Python

repo_name: eiffel-community/eiffel


text:
### OpenEJB

The OpenEJB plugin in [hawtio](http://hawt.io "hawtio") gives a raw view of the underlying OpenEJB JMX metric data.

This plugin works similar to the [JMX](#/help/jmx) plugin, where you can find more details about navigating the JMX tree,
and reading the attributes and invoking operations.

repository: emituofokoog/Openfire

repo_name: emituofokoog/Openfire


text:
# Changelog
All major and minor version changes will be documented in this file. Details of
patch-level version changes can be found in [commit messages](../../commits/master).

## 2021 - 2021/01/24
- Update docs
- Update requirements
- Drop py < 3.7

## 2020.2 - 2020/06/06
- Perform a 'visual attack' on potential stego files using `visual`

## 2020.1 - 2020/06/03
- Hide binary in sound and image files (switched from text to binary for this)
- Can now hide whole images inside other images!
- Use map and OTP LSB encodings for sound
- Image mode is preserved
- Removed CLI
- Can hide data in Microsoft Office files
- Can hide data in OpenOffice/ LibreOffice files
- Optionally encrypt data and use a mapping for homoglyphs
- Hide using zero width chars
- Detect some forms of steganography with varying success

## 2020 - 2020/05/22
- First release

repository: FHArchive/StegStash

repo_name: FHArchive/StegStash


text:
# Event Driven Architecture

## Review, Research, and Discussion

1. What’s the difference between a FIFO and a standard queue?

- FIFO - first come first server basis
- Standard - Output matters more than order

2. How can the server be assured a message was properly received?

- the client can assure the server by emitting an event which notifies the server

3. What classic design pattern is best represented by event driven programming?

- Represented by Observer Pattern; is a software design pattern with objects
- subject maintains a list of dependencies (observers) which are notified automatically of any state changes

4. How do you test an event driven system?

- test the functionality of the handlers

## Terminology

- FIFO Queue:
  - messaging apps when the order of operations and events are critical
  - useful for organising and manupliation of data
  - analagous to serving people in a first come first serve bases

- Pub/Sub:
  - publisher app creates and sends messages to a topic
  - sub apps create a subscription to a topic to receive messages from it
  - async massaging services

## Preview

1. Which 3 things had you heard about previously and now have better clarity on?

- Pub, sub and Sending of messages

2. Which 3 things are you hoping to learn more about in the upcoming lecture/demo?

- I want to dig deeper on how disconnection/what happens when a system turns off and turns back on and how to handle it
- I want to dig depper into Pub and Sub concepts
- Understand implementation of queues and optimal usages

3. What are you most excited about trying to implement or see how it works?

- Building better apps and optimal code

## References

- https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
- https://cloud.google.com/pubsub/docs/overview
- https://medium.com/dan-on-coding/testing-event-driven-systems-63c6b0c57517
- https://en.wikipedia.org/wiki/Observer_pattern

repository: jennerdulce/reading-notes

branch_name: refs/heads/main

repo_name: jennerdulce/reading-notes


text:
# Authentication in RapidCMS (server side)

RapidCMS does not provide any authentication out-of-the-box, but integrates seamlessly with any
authentication. To get you started, this page provides details about integrating AD authentication in RapidCMS.

## 1. NuGet package

Install the [Microsoft.AspNetCore.Authentication.AzureAD.UI](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.AzureAD.UI) package
to get started.

## 2. Active Directory App Registration

Add an App Registration to your Active Directory, and add `https://localhost:[your-port]/signin-oidc` as
reply url for the Web App. Copy the Application Id GUID, and paste it in the following JSON which needs to
be added to `appsettings.json`.

```
"AzureAd": {
    "Instance": "https://login.microsoftonline.com/common",
    "ClientId": "{app registration GUID}",
    "CallbackPath": "/signin-oidc"
},
```

Use `https://login.microsoftonline.com/[tenant-id]` to prevent guest accounts from another Active Directory to
be redirected to the wrong Active Directory instance.

## 3. Add code to `Startup.cs`

To the `ConfigureServices` method in `Startup`, add the following code:

```c#
// ***********************************************
// For more info on:
// Microsoft.AspNetCore.Authentication.AzureAD.UI
// see:
// https://bit.ly/2Fv6Zxp
// This creates a 'virtual' controller
// called 'Account' in an Area called 'AzureAd' that allows the
// 'AzureAd/Account/SignIn' and 'AzureAd/Account/SignOut'
// links to work
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
    .AddAzureAD(options => Configuration.Bind("AzureAd", options));

// This configures the 'middleware' pipeline
// This is where code to determine what happens
// when a person logs in is configured and processed
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
{
    options.TokenValidationParameters = new TokenValidationParameters
    {
        // Instead of using the default validation
        // (validating against a single issuer value, as we do in
        // line of business apps), we inject our own multitenant validation logic
        ValidateIssuer = false,
        // If the app is meant to be accessed by entire organizations,
        // add your issuer validation logic here.
        //IssuerValidator = (issuer, securityToken, validationParameters) => {
        //    if (myIssuerValidationLogic(issuer)) return issuer;
        //}
    };
    options.Events = new OpenIdConnectEvents
    {
        OnTicketReceived = context =>
        {
            // If your authentication logic is based on users
            // then add your logic here
            return Task.CompletedTask;
        },
        OnAuthenticationFailed = context =>
        {
            context.Response.Redirect("/Error");
            context.HandleResponse(); // Suppress the exception
            return Task.CompletedTask;
        },
        OnSignedOutCallbackRedirect = context =>
        {
            // This is called when a user logs out
            // redirect them back to the main page
            context.Response.Redirect("/");
            context.HandleResponse();
            return Task.CompletedTask;
        },
        // If your application needs to do authenticate single users,
        // add your user validation below.
        //OnTokenValidated = context =>
        //{
        //    return myUserValidationLogic(context.Ticket.Principal);
        //}
    };
});
```

Verify that the following instructions are present in `Configure` in `Startup.cs`:

```c#
app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();

app.UseEndpoints(endpoints =>
{
    endpoints.MapBlazorHub();
    endpoints.MapFallbackToPage("/_Host");
    endpoints.MapDefaultControllerRoute();
});
```

These methods allow the virtual controllers provided by `AzureAD.UI` to do their job, and authentication is enforced.

## 4. Add `LoginScreen` component

Add a new Razor component to your project, and call it `LoginScreen`. Paste the following code in that component:

```c#
<h4>Hi!</h4>

<p>Please sign in to access the CMS.</p>

<hr />

<a class="btn btn-primary" href="/AzureAD/Account/SignIn?redirectUri=/" target="_top">Login via Active Directory</a>
```

## 5. Add 'LoginStatus' component

Add a new Razor component to your project, and call it `LoginStatus`. Paste the following code in that component:

```c#
<AuthorizeView>
    <div>
        <div class="btn btn-primary"><i class="icon ion-md-contact"></i> Hi, @context.User.Identity.Name!</div>
        <a class="btn btn-primary" href="/AzureAD/Account/SignOut?post_logout_redirect_uri=/" target="_top">Logout</a>
    </div>
</AuthorizeView>
```

## 6. Implement a Authorization Handler

Since you are in control of who is allowed to do what, you have to implement an AuthorizationHandler. To get you started, this
is a very permissive handler that allows everyone to do anything:

```c#
public class VeryPermissiveAuthorizationHandler : AuthorizationHandler<OperationAuthorizationRequirement, IEntity>
{
    protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, IEntity resource)
    {
        context.Succeed(requirement);

        return Task.CompletedTask;
    }
}
```

The `requirement` parameter will always be one of the onces defined in `RapidCMS.Core.Authorization.Operation`, and
are your familiar CRUD operations, like `Create`, `Read`, `Update`, `Delete` and for relations `Add` and `Remove` also
exist. When creating you own handlers you can narrow the scope of each handler by not using `IEntity` but each of your
own entities. Or create a handler for a specific entity, and have the general `IEntity`-handler catch the rest.

## 7. Tell ASP.NET and RapidCMS to use those components

Open `Startup.cs`,  look up the `services.AddRapidCMSServer` method, and add the following instructions:

```c#
// in ConfigureServices
services.AddTransient<IAuthorizationHandler, VeryPermissiveAuthorizationHandler>();

// in AddRapidCMSServer

config.SetCustomLoginScreen(typeof(LoginScreen));
config.SetCustomLoginStatus(typeof(LoginStatus));
```

These instructions tell RapidCMS to use those components as login screen and login status.

Remove `config.AllowAnonymousUser()` to prevent anonymous users to use the CMS.

## 8. Hit Run

This is everything you should do to get authentication working in RapidCMS. The two custom components are
used to draw the login screen and the login status in the tob bar. You can fully customize the look and feel of
those components.

The callbacks like `OnTicketReceived` and `OnTokenValidated` can be used to further check which user has signed
in and allow you to onboard any new user.

## More information

[See this page for more information about Blazor and Authentication](https://devblogs.microsoft.com/aspnet/configuring-a-server-side-blazor-app-with-azure-app-configuration/).

repository: yourstockforecast/RapidCMS

repo_name: yourstockforecast/RapidCMS


text:
# int2az
## Utility for translating numbers into Azerbaijani.
### 1. How to use
```python
from int2az import Int2Az
Int2Az.convert(123)
```
**Output:**
```python
 'bir yüz iyirmi üç'
```
### 2. Restrictions
Input number must be in Integer format and below **1000000000** *(Its possible to raise this number, contact me if you have such problem or fork this repo and make necessery changes ;) )*

### 3. PS
Azerbaijani is not my home language. Moreover, I do not know Azerbaijani at all. So, if you will find any mistakes in translations - please contact me and i will try to fix this.


text:
# Operations Base Principles

Here are the principles that we apply when deciding how to run Operational workloads. They come from the management team at Stafrænt Ísland.

1. Secure access to data and services
2. Minimize downtime
3. Allow for Developers to move fast
4. Be prepared for running a subset of critical services on-premise
5. Minimize operational overhead
6. Minimize expenses

## Security

We utilize all our expertise when provisioning infrastructure to apply state-of-the-art security in the cloud. We do our part to fulfill our responsibility in the [Shared Responsibility Model](https://aws.amazon.com/compliance/shared-responsibility-model/).

## Minimize downtime

We strive to apply changes to our Production environment that we are certain of the impact. That requires us to have pre-Production environment that is very close to the Production one where we exercise all changes before they are applied to Production. We also monitor our Production environment according to the Service-Level Agreements(SLA) for the individual services running there.

## Allow for Developers to move fast

We need to allow the Organization be able to deliver new services to the users and iterate on those quickly and safely. The same goes for fixes and improvements. That's why our Org has invested heavily in infrastructure as well as engineering practices and processes that allow the teams to create new applications with minimal operational overhead. This is achieved by standardizing and pre-packaging all infrastructure concerns in libraries and automation while keeping up with security standards.

## Be prepared for running a subset of critical services on-premise

As part of Iceland's government infrastructure, we need to be prepared to run a subset of our services in a local data center. To achieve that, we need to use technologies that are known to work on-premises. Fortunately, the majority of the core tech today is open-source or is based on open standards, which makes this requirement quite achievable. Non-critical services can utilize all the advantages of the cloud.

## Minimize operational overhead

We are using fully managed services in the cloud as much as possible since the TCO is much lower then managing them ourselves. We try to focus our operational effort on the unique services our Organization develops.

## Minimize expenses

We utilize our cloud expertise to minimize the cost of running in the cloud.


text:
# Tinker MVC

[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.txt)
[![Contributors](https://img.shields.io/badge/contributors-1-blue.svg?style=flat-square)](https://github.com/jasonsnider/tinker-mvc/graphs/contributors)
[![Build Status](https://travis-ci.org/jasonsnider/tinker-mvc.svg?branch=master)](https://travis-ci.org/jasonsnider/tinker-mvc)
[![Code Climate](https://codeclimate.com/github/jasonsnider/tinker-mvc/badges/gpa.svg)](https://codeclimate.com/github/jasonsnider/tinker-mvc)

An experimental framework to help me better understand various design concepts.

## Goals

* Fast, Lightweight, Minimalist
* PSR Compliance
* DI/IoC
* MVC
* Pluggable
* Themable
* Pretty URLs
* Test Driven Design

## Set Up

Configure apache so that it will point to the webroot directory.

### Dispatching and Routing.

For example the URL http://example.com/something/main/view/5606/user:1/

1. Plugin: Something
1. Controller: Main
1. Action: view
1. 5506 would be the same as $_GET['5506'] = true
1. user:1 would would be the same as $_GET['user'] = 1

## Versioning

I follow [The Semantic Versioning guidelines](http://semver.org/) but like
everything else, it is all in how you interpret the thing.

 I only increment version numbers when I'm ready to push to
master so my last commit to dev prior to merging into master branch will always
have a commit message of 'Version x.x.x'.

* Major: breaking changes.
* Minor: new features; no breaking changes.
* Patch: bug fixes, formatting, comments, documentation, etc; no breaking changes.

At version 0.x.x all changes should be considered breaking.

My intent is to try to determine how risky an upgrade would be. Patch and minor
versions should be considered low risk upgrades while major version should be
considered high risk (so pay closer attention). If you change something that
is not considered __public__ then all bets are off.

repository: jasonsnider/tinker-mvc

repo_name: jasonsnider/tinker-mvc


text:
### Singleton Pattern
* ensure one and only one object of the class gets created
* Provide access point for object as global scope
* Control concurrent access to the resources that are shared

> How to Implement?
> - Make the constructor private
> - Create static method that does initialization
> - Object gets created on the first call. Class returns the same object aftwerwards.

##### Classic Singleton
```python
class Singleton(object):
    # __new__ is Python's method to instantiate object.
    # Overriding __new__ method to control object creation.
    def __new__(cls):
        # checks whether object already exists. hasattr method checks cls object has the instance property. == class already has an object
        if not hasattr(cls, 'instance'):
            cls.instance = super(Singleton, cls).__new__(cls)
        return cls.instance

s = Singleton()
print("Object created", s)

s1 = Singleton()
print("Object created", s1)
```
##### Lazy instantiation in Singleton
* Prevent exidental creation of object that is not needed
* Make sure object gets created when it's actually needed
* work with reduced resources and create them only when needed.

```python
class Singleton:
    __instance = None
    def __init__(self):
        if not Singleton.__instance:
            print("__init__ method called..")
        else:
            print("Instance already created:", self.getInstance())
    @classmethod
    def getInstance(cls):
        if not cls.__instance:
            cls.__instance = Singleton()
        return cls.__instance

s = Singleton()
print("Object created", Singleton.getInstance())
s1 = Singleton() # instance alreay created
```

repository: JiwonYeom/TIL

path: /Design Pattern/singleton.md

repo_name: JiwonYeom/TIL


text:
---
title: "Comparing the Analysis and Results of a Modified Social Accounting Matrix Framework with Conventional Methods of Reporting Indirect Non-Medical Costs"
author: Quentin Leclerc
date: '2020-11-25'
publication: "PharmacoEconomics"
publication_types: ["2"]
slug: samindirectcosts
categories: ["Health economics"]
tags: []
subtitle: ''
summary: ''
authors: ["Baudouin Standaert", "Christophe Saubouin", "**Quentin J. Leclerc**", "Mark P. Connolly"]
lastmod: '2021-11-02T09:15:12+02:00'
featured: no
image:
  caption: ''
  focal_point: ''
  preview_only: no
projects: []
abstract: "
**Background:** Assessing the societal perspective in economic evaluations of new interventions requires estimates of indirect non-medical costs caused by the disease. Different methods exist for measuring the labor input function as a surrogate for these costs. They rarely specify the effect of health on labor and who gains and who loses money. Social accounting matrix (SAM) is an established framework that evaluates public policies with multiple perspectives that could help.

\n**Objectives:** We evaluated the use of a modified SAM to assess money flows between different economic agents resulting in economic transactions following policy changes of medical interventions.

\n**Methods:** We compared conventional methods of measuring indirect non-medical costs related to rotavirus vaccination in the Netherlands with a modified SAM framework. To compare the outcome of each method, we calculated returns on investment (ROI) as the net amount of money per euro invested in the vaccine. One-way and probabilistic sensitivity analyses were carried out for each method, focusing on critical variables with the largest impact on indirect cost estimates.

\n**Results:** The ROI was higher for the modified SAM (1.33) than for the conventional methods assessing income calculations (range − 0.178 to 1.22). Probabilistic sensitivity analyses showed wide distributions in the ROI estimates, with variation in the variable impact on the indirect cost results per method selected.

\n**Conclusions:** In contrast to conventional methods, the SAM approach provides detailed and comprehensive assessments of the impact of new interventions on the indirect non-medical costs and the financial interactions between agents, disclosing useful information for different stakeholders."

doi: "10.1007/s40273-020-00978-4"
---

repository: qleclerc/qleclerc

repo_name: qleclerc/qleclerc


text:
# Investigate a Dataset
This is a project which is a part of Udacity's Data Analyst Nanodegree program.

## Project Overview
The presented project is to analyze a dataset and then communicate the findings about it. The project consist of going through the entire data analysis process, starting by posing a question and finishing by sharing the findings.

## Project Data

> **Data Set**: No-show appointments dataset collects information from 100k medical appointments in Brazil [kaggle](https://www.kaggle.com) which could be found [here](https://www.kaggle.com/joniarroba/noshowappointments/downloads/noshowappointments.zip) and is focused on the question of whether or not patients show up for their appointment

* ‘ScheduledDay’ tells us on what day the patient set up their appointment.
* ‘Neighborhood’ indicates the location of the hospital.
* ‘Scholarship’ indicates whether or not the patient is enrolled in Brasilian welfare program.
* ‘No-show’ says ‘No’ if the patient showed up to their appointment, and ‘Yes’ if they did not show up.


text:
# ATG-Toolkit
IntelliJ Plugin for simplifying development of Oracle eCommerce modules (former ATG)

Main ATG-related capabilities provided by the plugin for the different file types:
* [Properties](https://github.com/chivaler/ATG-Toolkit/wiki/Properties-Files-Capabilities)
* [Java](https://github.com/chivaler/ATG-Toolkit/wiki/Java-Classes-Capabilities)
* [JSP](https://github.com/chivaler/ATG-Toolkit/wiki/JSP-File-Capabilities)
* [XML](https://github.com/chivaler/ATG-Toolkit/wiki/XML-Files-Capabilities)

More details about plugin could be found on [WIKI](https://github.com/chivaler/ATG-Toolkit/wiki).

# Develop
Pull the repository contents
Import project as gradle
Reopen the project
Use the task *runIde* to Run/Debug Idea with the plugin

repository: chivaler/ATG-Toolkit

branch_name: refs/heads/develop

gha_language: Java

repo_name: chivaler/ATG-Toolkit


text:
This repo is where the code to Magenta Studio is maintained. For information, support and installation instructions of the tools themselves go to [this website](https://magenta.tensorflow.org/studio/).

This is not a Google product.

## Overview and Organization

Magenta Studio is a set of plugins contained in a [Max for Live](https://www.ableton.com/en/live/max-for-live/) Device. They are contained in a single web application that runs in the Max environment via Chromium Embedded Framework (CEF). All of the front-end code is contained in the `client/` folder, which contains the five plugins, and common UI and communication components which can be found in the `client/components/` folder. These objects are built using [lit](https://lit.dev/).

The communication between the web application and Live is handed through Max. This contains a local express server that runs on port 3333 (or 3334, 3335, etc if you have multiple instances open) in [Node for Max](https://cycling74.com/articles/node-for-max-intro-%E2%80%93-let%E2%80%99s-get-started). The Max patch and related JavaScript files can be found in the folder called `magenta4live.amxd/`.

## Installation

Tested with Node LTS v18.12.1.

If you have node.js and npm installed on your computer, all of the dependencies can be installed by running

```
npm install
```

## Development

To run the front-end web application in development mode, in which webpack will rebuild the app when changes are made, you can run

```
npm run watch
```

You will need to open the Max project to start the express server to test your changes. You can either view the app in the [`jweb`] object in Max, or load it in the browser at [http://localhost:3333](http://localhost:3333) (again, 3334, 3335, etc. if there are multiple instances running). Hot reloading is not enabled, so you will need to refresh to see changes.

## Building

All of the modules are included in a Max for Live device. To build the device, run

```
npm run build
```

All of the build files will be placed into the folder `magenta4live.amxd/code/public`.

Open the Max project, then select File > Export Max for Live Device..., and then select a location to save the device. Once the dialog closes, the device has been built!

Lastly, you'll need to change the icon of the `magenta4live` device. You can do this (on Mac) by:
1. Open the Magenta icon (`client/magenta_logo`) in Preview.
2. Select Edit > Copy
3. Right click on `magenta4live.amxd`, then select Get Info.
4. Select the tiny icon in the upper left of the window, and select Edit > Paste or enter Command + V.
5. Done!

## Versioning
You can update the version of the device by changing the version in the root `package.json`. When you build the device, this number will be visible when you click "About" in the interface.

## License

Copyright 2023 Google Inc.

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.

repository: magenta/magenta-studio

gha_language: JavaScript

repo_name: magenta/magenta-studio


text:
# ColorContrast
Small library to find valid color combinations for a given contrast threshold. The contrast calculation algorithm is based on the WCAG 2.0.

------

## Install

Using composer:
```bash
composer require davidgorges/color-contrast
```

## Usage
````php
    use ColorContrast\ColorContrast;

    /* ... */

    $contrast = new ColorContrast();
    $contrast->addColors(0xff0000, 0x002200, 0x0022ff, 0xffffff);
    $combinations = $contrast->getCombinations(ColorContrast::MIN_CONTRAST_AAA);
    foreach ($combinations as $combination) {
        printf("#%s on the Background color #%s has a contrast value of %f \n", $combination->getForeground(), $combination->getBackground(), $combination->getContrast());
    }
````

this would output:
````
    #FFFFFF on the Background color #002200 has a contrast value of 17.949476
    #FFFFFF on the Background color #0022FF has a contrast value of 8.033817
    #002200 on the Background color #FFFFFF has a contrast value of 17.949476
    #0022FF on the Background color #FFFFFF has a contrast value of 8.033817
````

### Dark or Light Complimentary Color

````php
    $contrast = new ColorContrast();

    // imagine having a red background and you need to know if its better
    // to display a white or black text on top if it
    $complimentary = $contrast->complimentaryTheme('#d80000'); // returns ColorContrast::DARK to indicate you should use a dark color on this background

    if($complimentary == ColorContrast::LIGHT) {
        // Use a light font
    } else {
        // use a dark font
    }
````
## Thanks

* [Calculating Color Contrast with PHP](http://www.splitbrain.org/blog/2008-09/18-calculating_color_contrast_with_php) by Andreas Gohr
* [jxnblk/colorable](https://github.com/jxnblk/colorable) JavaScript Library that inspired ColorContrast

## License
The MIT License (MIT)

Copyright (c) 2015 David Gorges

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.

 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.

[1]:https://getcomposer.org/doc/04-schema.md#minimum-stability

repository: davidgorges/color-contrast-php

repo_name: davidgorges/color-contrast-php


text:
# Musical Ear Test App

The Musical Ear Test App is an app created to be able to use the Musical Ear Test on the internet. Right now, the application is available in two languages:

- Turkish
- Dutch

Perhaps more languages could be added in the future. Pull requests are welcome.

## Run the application

### Requirements

To run this application, you need to have Git and Node.js installed.

### Clone repository and install dependencies

```shell
git clone https://github.com/drikusroor/MusicalEarTestApp.git
cd MusicalEarTestApp
npm install gulp -g
npm install bower -g
bower install
```

### Run application

To run the application, simply execute:

```shell
gulp
```

repository: drikusroor/MusicalEarTestApp

gha_language: CSS

repo_name: drikusroor/MusicalEarTestApp


text:
#Put a container under some pressure
This is a simple app to put disk load on something (CloudFoundry in my case).

```
export WRITERS=50
java -jar target/diskwriter-0.0.1-SNAPSHOT.jar
````

`WRITERS` causes the app to spawn a that many threads. Each thread writes a 1B file over and over again.

You need to hit the app url to get the threads started writing.

repository: krujos/diskwriter

repo_name: krujos/diskwriter


text:
# Exercise 3: Implementing application that supports B2B

This exercise will demonstrate to the user how to configure and implement an application that supports B2B.
**Note**:
This exercise demonstrates signing into a web application using three different accounts. These three accounts will come from two organizations, one of them being the organization where the Azure AD application is registered. Therefore, in order to complete the exercise, you'll need access to two user accounts in different Azure AD directories.

## Task 1: Create a single-tenant Azure AD application

In this task, you'll create an Azure AD application that allows users from the current organization to sign in.

### Register a single-tenant Azure AD application

1. From the Azure portal [https://azure.portal.com](https://azure.portal.com/), navigate to **Azure Active Directory**.

1. Select **Manage > App registrations** in the left-hand navigation.

1. On the **App registrations** page, select **New registration**.

1. On the **Register an application** page, set the values as follows:

    - **Name**: Hello ASPNET Core Identity 03

    - **Supported account types**: Accounts in this organizational directory only (Single tenant)

    ![Register an application page for accounts in this organizational directory only.](../../Linked_Image_Files/l01_exercise_3_task_1_image_1.png)

1. Select **Register** to create the application.

1. On the **Hello ASPNET Core Identity 03** page, copy the values **Application (client) ID** and **Directory (tenant) ID**; you'll need these values later in this exercise.

1. On the **Hello ASPNET Core Identity 03** page, select the **Add a Redirect URI** link under the **Redirect URIs**.

1. Locate the section **Redirect URIs** and add the following two URLs:

    - **https://localhost:3007**

    - **https://localhost:3007/signin-oidc**

1. Add the following **Logout URL**: **https://localhost:3007/signout-oidc**

1. Locate the section **Implicit grant** and select both **Access tokens** and **ID tokens**. This tells Azure AD to return these tokens the authenticated user if requested.

1. Select **Save** when finished setting these values.

## Task 2: Create a single organization ASP.NET core web application

In this application, you'll create an ASP.NET Core web application that allows users from the current organization to sign in and display their information.

1. Open your command prompt, navigate to a directory where you want to save your work, create a new folder, and change directory into that folder. For example:

    ```powershell
    Cd c:/LabFiles
    md SingleOrgGuests
    cd SingleOrgGuests
    ```

1. Execute the following command to create a new ASP.NET Core MVC web application:

    ```powershell
    dotnet new mvc --auth SingleOrg
    ```

1. Open the folder in Visual Studio code by executing from the project directory: **code .**

### Configure the web application with the Azure AD application you created

1. Locate and open the **./appsettings.json** file in the ASP.NET Core project.

1. Set the **AzureAd.Domain** property to the domain of your Azure AD tenant where you created the Azure AD application (*for example: contoso.onmicrosoft.com*).

1. Set the **AzureAd.TenantId** property to the **Directory (tenant) ID** you copied when creating the Azure AD application in the previous step.

1. Set the **AzureAd.ClientId** property to the **Application (client) ID** you copied when creating the Azure AD application in the previous step.

### Update the web application's launch configuration

1. Locate and open the **./Properties/launchSettings.json** file in the ASP.NET Core project.

1. Set the **iisSettings.iisExpress.applicationUrl** property to **https://localhost:3007**.

1. Set the **iisSettings.iisExpress.sslPort** property to **3007**.

### Update the user experience

1. Finally, update the user experience of the web application to display all the claims in the OpenID Connect ID token.

1. Locate and open the **./Views/Home/Index.cshtml** file.

1. Add the following code to the end of the file:

    ```powershell
    @if (User.Identity.IsAuthenticated)
    {
    <div>
        <table cellpadding="2" cellspacing="2">
            <tr>
                <th>Claim</th>
                <th>Value</th>
            </tr>
            @foreach (var claim in User.Claims)
            {
                <tr>
<EMAIL_ADDRESS><EMAIL_ADDRESS>                </tr>
            }
        </table>
    </div>
    }
    ```

1. Save the above all changes.

## Task 3: Build and test the app

1. Execute the following command in a command prompt to compile and run the application:

    ```powershell
    dotnet build
    dotnet run
    ```

1. Open a browser and navigate to the url **https://localhost:5001**. The web application will redirect you to the Azure AD sign in page.

1. Sign in using a Work and School account from your Azure AD directory. Azure AD will redirect you back to the web application. Notice some of the details from the claims included in the ID token.

    ![User logged into web application with page displaying user's information.](../../Linked_Image_Files/l01_exercise_3_task_3_image_1.png)

1. Take special note of the **tenantid** and **upn** claim. These claims indicate the ID of the Azure AD directory and ID of the user that signed in. Make a note of these values to compare them to other options in a minute.

1. Now try logging in as a user from a different organization. Select the **Sign out** link in the top left. Wait for Azure AD and the web application signs out the current user. When the web application reloads, repeat the sign in process, except this time try signing in as a user from a different organization or use a Microsoft Account.

1. Notice Azure AD will reject the user's sign in, explaining that the user's account doesn't exist in the current tenant.

![Rejected user sign in dialog displaying error message.](../../Linked_Image_Files/l01_exercise_3_task_3_image_2.png)

Before this user can access this application, they need to be added as a guest into the Azure AD directory where the application was registered. Proceed with the next task to invite a guest user to your organization.

## Task 4: Invite a guest user from another organization

In this task, you will configure your Active Directory tenant to allow external users and then will invite a guest user from another Active Directory organization.

1. From the Azure portal, navigate to **Azure Active Directory**.

1. In the left-hand navigation, select **User**.

1. Examine the external user settings for available to administrators by selecting **User Settings** and then **Manage external collaboration settings**.

    ![Azure Active Directory admin center displaying user settings page with link to configure external users access.](../../Linked_Image_Files/l01_exercise_3_task_4_image_1.png)

1. Notice that administrators can configure the Azure AD directory so guest users have limited rights compared to other users, and who can invite guest users.

    ![Azure Active Directory admin center displaying external collaboration settings page.](../../Linked_Image_Files/l01_exercise_3_task_4_image_2.png)

1. Now let's invite a guest user. Select **All users** in the left-hand navigation, and then select **New guest user**:

1. On the **New user** page, select Invite user and then add the guest user's information:

    - **Name:** Test User

    - **Email address:** Type the email address of the new user you created in Exercise 1 Task 3. *For example<EMAIL_ADDRESS>
    ![New user page with settings for inviting new user from external organization.](../../Linked_Image_Files/l01_exercise_3_task_4_image_3.png)

1. Select **Invite** to automatically send the invitation to the guest user.

1. Now let's try to sign in with the user. In the browser, navigate to **https://localhost:5001**.

1. This time, after successfully logging in, the user's Azure AD directory will prompt the user to grant the application's Azure AD directory permissions to sign in as the user and obtain basic information about the user.

    ![Azure Active Directory admin center displaying external collaboration settings page.](../../Linked_Image_Files/l01_exercise_3_task_4_image_4.png)

1. Take note of what is happening at this point. The original Azure AD directory is not signing in the user, rather the user has been redirected to sign in with their Azure AD directory. Once they sign in, their Azure AD directory will provide a token to our directory that is used to verify the user is authenticated and authorized the application to obtain their basic profile information. It then created a new access token that can be used by our ASP.NET Core web application.

1. After selecting **Accept**, the user is taken to our ASP.NET application. Notice the difference in some of the claims.

    - The **identityprovider** claim is the ID of the Azure AD directory that authenticated the user. This claim is the user's Azure AD directory

    - The **tenantid** claim is the ID of the Azure AD directory our application is registered in. Notice this value is not the same as the **identityprovider** claim, indicating the user's identity is in one directory while they have been added as a guest user to another Azure AD directory.

    ![External guest user signed into web application with page displaying logged in user info.](../../Linked_Image_Files/l01_exercise_3_task_4_image_5.png)

1. Stop the web server by going back to the running project in Visual Studio Code. From the Terminal, press **CTRL+C** in the command prompt.

## Review

In this exercise, you created an ASP.NET Core web application and Azure AD application that allows guest users from partner Azure AD directories to sign in and access the application. You then invited a guest user to the directory and signed into the application with this user.

### [Go to exercise 04 instructions -->](../Exercise_04/05-Exercise-4-Configuring-permissions-to-consume-an-API.md)

### [<-- Back to exercise 02 instructions](../Exercise_02/03-Exercise-2-Implementing-authentication.md)

### [<-- Back to readme](../../../)


text:
## Zlib issues

Remove default cabal environment (to fix ghcide 'cannot satisfy ghc...' error):

```
rm ~/.ghc/x86_64-linux-8.6.5/environments/default
```

Create symlinks to header files (search with `nix-locate`):

```
sudo ln -s /nix/store/j3anl3dw9f22g711g0y1bdn3hphgd4np-zlib-1.2.11-dev/include/zlib.h ~/.nix-profile/include/zlib.h

sudo ln -s /nix/store/j3anl3dw9f22g711g0y1bdn3hphgd4np-zlib-1.2.11-dev/include/zconf.h ~/.nix-profile/include/zconf.h
```

Export include and lib directories:

```
export CPATH=~/.nix-profile/include
export LIBRARY_PATH=~/.nix-profile/lib
```

### Related issues

- https://github.com/haskell/cabal/issues/6228
- https://github.com/NixOS/nixpkgs/issues/44144

repository: gvolpe/nix-config

gha_language: Nix

repo_name: gvolpe/nix-config


text:
# nanoflux-react-demo
A Demo showing how to use [nanoflux](https://github.com/ohager/nanoflux) and [nanoflux-react](https://github.com/ohager/nanoflux-react) with modern React App (15.4+ based on create-react-app)

[ONLINE DEMO](https://ohager.github.io/nanoflux-react-demo/)

repository: ohager/nanoflux-react-demo

repo_name: ohager/nanoflux-react-demo


text:
# Minimal TouchBar

## Preview

![](./tmshchk.png)

## Features

- Brightness Down & Up
- Previous & Next Track
- Play/Stop
- Mute
- Volume Up & Down
- Clock

## Thanks

- [MTMR](https://github.com/Toxblh/MTMR)

- [MTMR-presets](https://github.com/Toxblh/MTMR-presets)

license: Unlicense

repository: Toxblh/MTMR-presets

gha_language: Shell

gha_license_id: Unlicense

repo_name: Toxblh/MTMR-presets


text:
CAKE Affiliate API for Node.js
==============================

[CAKE](http://getcake.com) is _SaaS platform providing marketing intelligence for perforfmance marketers_ (LinkedIn). These guys have many
different APIs thus they provide big marketing platform. This module covers [Affiliate APIs](https://support.getcake.com/hc/en-us/sections/200129250-AFFILIATE-API-Documentation) group.

## Requirements

* CoffeeScript installed globally (for `cake build`)

## Installation

    npm install cake-affiliate-api --save

## Example

```js
'use strict'

var CakeAffiliateAPI = require('cake-affiliate-api')
  , options
  , client

options = {
  "apiKey":      "MY_API_KEY",
  "affiliateId": "100500",
  "baseUrl":     "https://cake.coolnetwork.com",
  "rawResponse": true
}

client = new CakeAffiliateAPI(options)

client.offerFeed({offerStatusId: 3}, handleResult)

function handleResult(err, data) {
  if (err) {
    // handle error...
  }
  else {
    handleData(data)
  }
}
```

## API

Keep in mind that every API option which is passed in `camelcase` is `underscore`d before making HTTP call. So it's OK to name options like `mediaTypeCategoryId` (converted to `media_type_category_id`).

### [addLinkCreative](https://support.getcake.com/hc/en-us/articles/200652944-cupCAKE-Commerce-Intelligence-Setup-and-Configuration-Affiliate-Publisher-)(campaignId, data, callback)

`data` options:

* **creativeName** (required)
* **offerLink** (required)
* `description` defaults to `null`

### [applyForOffer](https://support.getcake.com/hc/en-us/articles/200706440--Offers-ApplyForOffer-V3-Affiliate)(offerContractId, data, callback)

`data` options:

* **mediaTypeId** (required)
* `notes` defaults to `null`
* **agreedToTerms** defaults to `false`
* **agreedFromIpAddress** (required)

### [creativeFeed](https://support.getcake.com/hc/en-us/articles/200652944-cupCAKE-Commerce-Intelligence-Setup-and-Configuration-Affiliate-Publisher-)(exportFeedId, updatesSince, callback)

### [getCampaign](https://support.getcake.com/hc/en-us/articles/200705940--Offers-GetCampaign-V2-Affiliate)(campaignId, callback)

### [getCreativeCode](https://support.getcake.com/hc/en-us/articles/200705950--Offers-GetCreativeCode-V2-Affiliate)(campaignId, creativeId, callback)

### [getCreativeTypes](https://support.getcake.com/hc/en-us/articles/200706350--Offers-GetCreativeTypes-V2-Affiliate)(callback)

### [getFeaturedOffer](https://support.getcake.com/hc/en-us/articles/200706360--Offers-GetFeaturedOffer-V2-Affiliate)(callback)

### [getMediaTypeCategories](https://support.getcake.com/hc/en-us/articles/200706370--Offers-GetMediaTypeCategories-V2-Affiliate)(callback)

### [getOfferStatuses](https://support.getcake.com/hc/en-us/articles/200706380--Offers-GetOfferStatuses-V2-Affiliate)(callback)

### [getPixelTokens](https://support.getcake.com/hc/en-us/articles/200705960--Offers-GetPixelTokens-V2-Affiliate)(callback)

### [getSubAffiliates](https://support.getcake.com/hc/en-us/articles/200706390--Offers-GetSubAffiliates-V2-Affiliate)(query, callback)

`query` options:

* `startAtRow` defaults to `1`
* `rowLimit` defaults to `0`

### [getSupressionList](https://support.getcake.com/hc/en-us/articles/200705970--Offers-GetSuppressionList-V2-Affiliate)(offerId, callback)

### [getTags](https://support.getcake.com/hc/en-us/articles/200706400--Offers-GetTags-V2-Affiliate)(callback)

### [getVerticalCategories](https://support.getcake.com/hc/en-us/articles/200705980--Offers-GetVerticalCategories-V2-Affiliate)(callback)

### [getVerticals](https://support.getcake.com/hc/en-us/articles/200705990--Offers-GetVerticals-V2-Affiliate)(callback)

### [offerFeed](https://support.getcake.com/hc/en-us/articles/200704910--Offers-OfferFeed-V4-Affiliate)(query, callback)

`query` options:

* `campaignName` defaults `''`
* `mediaTypeCategoryId` defaults to `0`
* `verticalCategoryId` defaults to `0`
* `verticalId` defaults to `0`
* `offerStatusId` defaults to `0`
* `tagId` defaults to `0`
* `startAtRow` defaults to `1`
* `rowLimit` defaults to `0`

### [sendCreativePack](https://support.getcake.com/hc/en-us/articles/200706460--Offers-SendCreativePack-V2-Affiliate)(campaignId, creativeId, contactId, callback)

### [setPixel](https://support.getcake.com/hc/en-us/articles/200706040--Offers-SetPixel-V2-Affiliate)(campaignId, pixelHtml, callback)

### [setPostbackURL](https://support.getcake.com/hc/en-us/articles/200706030--Offers-SetPostbackURL-V2-Affiliate)(campaignId, postbackURL, callback)

### [setTestLink](https://support.getcake.com/hc/en-us/articles/200706020--Offers-SetTestLink-V2-Affiliate)(campaignId, testLink, callback)

## Options

* **apiKey** defaults to `null`

    * API key. Read [Affiliate API Documentation Notes](https://support.getcake.com/hc/en-us/articles/202456680-Affiliate-API-Documentation-Notes) to know where to get it.

* **affiliateId** defaults to `null`

    * Affiliate Id. Read documentation above.

* **baseUrl** defaults to `null`

    * API endpoint of CAKE-based network.

* _rawResponse_ defaults `false`

    * If `true` xml2js is not called for XML response and it's returned as string.

* _parser_ defaults to `null`

    * Should be a function like `parse(xmlString, callback)` where `callback` accepts `(err, response)`

* _xml2jsOptions_ defaults to `{explicitArray: false}`

    * Options passed to `xml2js.parseString()`. If specified will overwrite defaults. **Also if specified, client won't try to process response smartly (i.e. if response outputs collection it will return raw `xml2js` output instead of array).**

## FAQ

**Why module is writted on CoffeeScript but compiled to JavaScript after `npm install`?**

I really like CoffeeScript for fast module development but dislike when people do something like this:

    require('coffee-script');
    require('./module.coffee');

Why should we do this if in the end all is compiled to JavaScript? :wink:

## TODO

* Implement ALL APIs

repository: jkthxt/node-cake-affiliate-api

repo_name: jkthxt/node-cake-affiliate-api


text:
---
layout: post
title: "Roman Numerals Kata (video)"
category: blog
tag:
- kata
---

One of my tasks for this week is to perform and record the Roman Numerals Kata in under 10min. I stopped recording as soon as I reached the algorithm since beyond that point I was simply typing in the rest of the cases.

The kata can be shown below and I have also put below the link to the Github repository if you want to see the full code with the commit history showing each step:

<iframe width="640" height="480" src="//www.youtube.com/embed/Y7SlbNllO6k" frameborder="0" allowfullscreen></iframe>

[Github repo](https://github.com/Maikon/Roman_Numerals)

repository: Maikon/indigo

branch_name: refs/heads/gh-pages

repo_name: Maikon/indigo


text:
---
title: "home"
bg: '#95a5a6'
color: black
style: center
---

<img class="coala-logo" src="{{ site.logo }}">

# coala

## Linting and Fixing Code for All Languages

### [Browse Supported Languages](https://coala.io/languages)

[Supported Languages](https://coala.io/languages)
—
[Issue Tracker](http://bugs.coala-analyzer.org/)
—
[Code](https://github.com/coala-analyzer/coala)
—
[Docs](https://docs.coala.io/)
—
[FAQ](https://github.com/coala-analyzer/coala/wiki/FAQ)
—
[Blog](http://blog.coala.io/)
—
[Donate](http://donate.coala-analyzer.org)

<script type="text/javascript" src="https://asciinema.org/a/42968.js" id="asciicast-42968" async data-loop="1" data-autoplay="1"></script>

repository: coala/website-old

repo_name: coala/website-old


text:
# TG-Budget-Tracker
## By Travis Gray

For this assignment, I was tasked with creating a file that provides offline functionality for a website. If a user is operating this website and loses internet connection for whatever reason, the website will still function and send the pending data to the database once an internet connection is restored.

## Instructions for Use

![Screenshot1](./public/imgs/Screenshot1.png)

This is the main page that will display when coming to the website. Since the website doesn't have unique ID's stored, all information from everything that's been entered into the database will be visible to everyone visiting the site. I have the window open on the right to demonstrate the characteristics of the website and how they contribute to functionality of the site.

![Screenshot2](./public/imgs/Screenshot2.png)

I've added and subtracted a couple of transactions to show how they appear on the app.

![Screenshot3](./public/imgs/Screenshot3.png)

I've switched over to the network tab and disabled internet access for the site to do some testing. I've added two more transactions and they show up in red since they can't access the internet. There is also a console error down below showing that the internet has been disconnected. The site is still functional even though there's no internet connection.

![Screenshot4](./public/imgs/Screenshot4.png)

I've switched the tab over from the Network tab to the Application tab to show how data is stored on the site. The IndexedDB stores database information while the site is offline, which is stored on the local machine. Values are added to the "pending" collection while the site is offline and will upload to the database once the internet connection has been restored.

![Screenshot5](./public/imgs/Screenshot5.png)

I've turned the internet connection back on in the Network tab, and you can now see that a new connection has gone through called "bulk". This means that all of the information waiting in the "pending" collection is sent through to the database to be stored.

![Screenshot6](./public/imgs/Screenshot6.png)

This screen is displaying the "pending" collection and how it has been cleared out now that the information has been sent over to the main online database.

![Screenshot7](./public/imgs/Screenshot7.png)

And for the final touch, I've added another transaction and cleared out the console to show that the internet connection has been restored and that the transactions have been successfully saved within the online database. There were no hiccups with the site even when the connection was offline.

## Links

* [Github](https://github.com/Teknix420/TG-Budget-Tracker)
* [Heroku](https://tg-budget-tracker.herokuapp.com/)

## Licensing

* MIT License


text:
# sched

[![GoDoc](https://godoc.org/github.com/changkun/sched?status.svg)](https://godoc.org/github.com/changkun/sched) [![Build Status](https://travis-ci.org/changkun/sched.svg?branch=master)](https://travis-ci.org/changkun/sched) [![Go Report Card](https://goreportcard.com/badge/github.com/changkun/sched)](https://goreportcard.com/report/github.com/changkun/sched) [![codecov](https://codecov.io/gh/changkun/sched/branch/master/graph/badge.svg)](https://codecov.io/gh/changkun/sched) [![](https://img.shields.io/github/release/changkun/sched/all.svg)](https://github.com/changkun/sched/releases)

`sched` is a high performance task scheduling library with future support.

## Usage

```go
// Init sched, with tasks should recovered when reboot
futures, err := sched.Init(
    "redis://<IP_ADDRESS>:6379/1"，
    &ArbitraryTask1{},
    &ArbitraryTask2{},
)
if err != nil {
    panic(err)
}
// Retrieve task's future
for i := range futures {
    fmt.Printf("%v", futures[i].Get())
}

// Setup tasks, use future.Get() to retrieve the future of task
future, err := sched.Submit(&ArbitraryTask{...})
if err != nil {
    panic(err)
}
fmt.Printf("%v", future.Get())

// Launch a task, use future.Get() to retrieve the future of task
future, err := sched.Trigger(&ArbitraryTask{...})
if err != nil {
    panic(err)
}
fmt.Printf("%v", future.Get())

// Pause sched
sched.Pause()

// Resume sched
sched.Resume()

// Wait sched schedule all tasks
sched.Wait()

// Stop sched gracefully
sched.Stop()
```

## Task Design

Learn more regarding task design, see [test examples](./tests).

## License

[MIT](./LICENSE) © [Changkun Ou](https://changkun.de)

repository: changkun/sched

gha_language: Go

repo_name: changkun/sched


text:
# Script Examples

The command catalog provided by the Redfish Utility enables a wide variety of options to manipulate and work with the server. Multiple commands chained together have the potential to provide higher-level functionality and meet any needs that arise depending on the task at hand.

## Selecting and getting properties from a type.

```
:: selectget.bat [URI] [USERNAME] [PASSWORD]
@echo off

set argC=0
for %%x in (%*) do Set /A argC+=1
if %argC% LSS 3 goto :failCondition
goto :main

:failCondition
@echo Usage:
@echo selectget.bat [URI] [USERNAME] [PASSWORD]
goto :EOF

:main
@echo *****************************************
@echo ************* Logging in... *************
@echo *****************************************
redfish.exe login %1 -u %2 -p %3
@echo *****************************************
@echo *** selecting ComputerSystem type... ****
@echo *****************************************
redfish.exe select ComputerSystem.
@echo *****************************************
@echo ********** getting AssetTag... **********
@echo *****************************************
redfish.exe get AssetTag
pause
```

This is a batch file that logs into a remote server, selects the `ComputerSystem` type, and gets the `AssetTag` value.

## Saving and loading a file using file-based editing mode

```
:: saveload.bat [SELECTOR] [FILENAME]
:: Specify a type with the SELECTOR tag, and
:: save to a file called FILENAME
@echo off
set argC=0
for %%x in (%*) do Set /A argC+=1
if %argC% LSS 2 goto :failCondition
goto :main

:failCondition
@echo Usage:
@echo saveload.bat [SELECTOR] [FILENAME]
@echo specify a type with the SELECTOR tag, and
@echo save to a file called FILENAME
goto :EOF

:main
redfish.exe login
redfish.exe save --selector=%1 --json -f %2
@echo Edit the file, then:
pause
redfish.exe load -f %2
```

This is a file-based edit mode helper for the Redfish Utility

1. Run to download selected type to a file called `redfish.json`

2. Edit the `redfish.json` file to make changes.

3. Press any key running batch program to continue with program, uploading the newly edited program to the server.

repository: thebeswick/python-redfish-utility

repo_name: thebeswick/python-redfish-utility


text:
# firefox-addon-venezuela-no-more

A funny Firefox addon to get away from Venezuela when you read the Spanish press.

**SETUP:**  [Install in your firefox web browser here.](https://addons.mozilla.org/es/firefox/addon/venezuela-no-more/  "Setup")

*(There is a Chrome version too here: [bameda/chrome-ext-venezuela-no-more](https://github.com/bameda/chrome-ext-venezuela-no-more))*

![Example in eldiario.es](screenshot.png "Example in eldiario.es")

### For developers

Install jpm

```
npm install jpm --global
```

Them, in `src`:

- `jpm run -b /usr/bin/firefox` - Teat
- `jpm xpi` - Make package

repository: bameda/firefox-addon-venezuela-no-more

repo_name: bameda/firefox-addon-venezuela-no-more


text:
# TeamsUserCallingSettings

## Parameters

| Parameter | Attribute | DataType | Description | Allowed Values |
| --- | --- | --- | --- | --- |
| **Identity** | Key | String | The Identity of the user to set call forwarding, simultaneous ringing and call group settings for. Can be specified using the ObjectId or the SIP address. | |
| **GroupNotificationOverride** | Write | String | The group notification override that will be set on the specified user. The supported values are Ring, Mute and Banner. | `Ring`, `Mute`, `Banner` |
| **CallGroupOrder** | Write | String | The order in which to call members of the Call Group. The supported values are Simultaneous and InOrder. | |
| **CallGroupTargets** | Write | StringArray[] | The members of the Call Group. You need to always specify the full set of members as the parameter value. What you set here will overwrite the current call group membership. | |
| **IsUnansweredEnabled** | Write | Boolean | This parameter controls whether forwarding for unasnwered calls is enabled or not. | |
| **UnansweredDelay** | Write | String | The time the call will ring the user before it is forwarded to the unanswered target. The supported format is hh:mm:ss and the delay range needs to be between 10 and 60 seconds in 10 seconds increments, i.e. 00:00:10, 00:00:20, 00:00:30, 00:00:40, 00:00:50 and 00:01:00. The default value is 20 seconds. | |
| **UnansweredTarget** | Write | String | The unanswered target. Supported type of values are ObjectId, SIP address and phone number. For phone numbers we support the following types of formats: E.164 (+12065551234 or +1206555000;ext=1234) or non-E.164 like 1234. | |
| **UnansweredTargetType** | Write | String | The unanswered target type. Supported values are Voicemail, SingleTarget, MyDelegates and Group. | `Group`, `MyDelegates`, `SingleTarget`, `Voicemail` |
| **IsForwardingEnabled** | Write | Boolean | This parameter controls whether forwarding is enabled or not. | |
| **ForwardingType** | Write | String | The type of forwarding to set. Supported values are Immediate and Simultaneous | `Immediate`, `Simultaneous` |
| **ForwardingTargetType** | Write | String | The forwarding target type. Supported values are Voicemail, SingleTarget, MyDelegates and Group. Voicemail is only supported for Immediate forwarding. | `Group`, `MyDelegates`, `SingleTarget`, `Voicemail` |
| **ForwardingTarget** | Write | String | The forwarding target. Supported types of values are ObjectId's, SIP addresses and phone numbers. For phone numbers we support the following types of formats: E.164 (+12065551234 or +1206555000;ext=1234) or non-E.164 like 1234. | |
| **Ensure** | Write | String | Present ensures the policy exists, absent ensures it is removed. | `Present`, `Absent` |
| **Credential** | Required | PSCredential | Credentials of the Teams Global Admin. | |

## Description

This resource configures a Teams User's Calling Settings.

More information: https://learn.microsoft.com/en-us/microsoftteams/user-call-settings

## Permissions

### Microsoft Graph

To authenticate with the Microsoft Graph API, this resource required the following permissions:

#### Delegated permissions

- **Read**

    - None

- **Update**

    - None

#### Application permissions

- **Read**

    - None

- **Update**

    - None

## Examples

### Example 1

This example adds a new Teams Channels Policy.

```powershell
Configuration Example
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $credsCredential
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        TeamsUserCallingSettings 'AssignCallingSettings'
        {
            CallGroupOrder       = "Simultaneous";
            Credential           = $credsCredential;
            Ensure               = "Present";
            Identity             =<EMAIL_ADDRESS>            UnansweredDelay      = "00:00:20";
        }
    }
}
```

branch_name: refs/heads/Dev

gha_language: PowerShell


text:
# Bits to Die

Converts entropy measured in bits to "die" (number of dice rolls).

## What this does / Use case

You want to get a feel for how hard it is to "guess" a non-diceware password with dice. You know the password is roughly X bits of entropy. This Rust script takes that X bits and converts in to a different (and completely made up) measure of entropy that I'm calling "die". It represents the number of 6-sided die it would theoretically (I think) take to reproduce that password exactly. In other words it estimates the length of the password encoded in base 6.

## Example

`@[5k[ybL8%\/E~A` has about 87.98 bits of entropy, according to KeePassXC's random password generator (which I believe uses [zxcvbn](https://github.com/dropbox/zxcvbn) for measuring entropy). Entering `87.98` bits into this program will inform you that that's equivalent to about 34.04 "die" of entropy.

Using a dictionary of 7776 words, `probiotic-troubling-breath-salaried-plank-docile` has an entropy of 77.55 bits. This script reports that that is equivalent to 30 die, which is in fact the number of rolls you'd need to generate a 6-word passphrase using the diceware method.

## Lingering Questions

I'm not sure why `f_f64.powf(bits) as f64` in the `bits_to_die` function doesn't cause some sort off overflow in Rust when the entered number of bits is greater than 64. If anybody knows, please leave as issue or pull request!

## Disclaimers

I'm reading [_An Introduction to Information Theory: Symbols, Signals and Noise_ by John R. Pierce](https://www.amazon.com/Introduction-Information-Theory-Symbols-Mathematics/dp/0486240614) and thought this would be a good exercise to further my understanding of entropy, passwords, and Rust. I don't know if this is scientifically accurate or useful, so, you know, don't rely on it beyond a curiosity.


text:
# Arduino Yún + Twitter Streaming API blink example
![image](http://i.imgur.com/gwWNge2l.jpg)

This is a simple example on how to run some code on the Arduino side of the Arduino Yún on specific events fired through the Twitter Streaming API

i.e. when a tweet containing a specific #hashtag is twitted, Arduino blinks an LED

I love this experiment because it's near real time and it gives a lot of possibilities, and it's very easy to set up

## Requirements

* An Arduino Yún (obviously) with an external SD card (required for hosting the Python libraries you'll need)
* A [twitter app](https://apps.twitter.com/) you own
* The [Tweepy library](https://github.com/tweepy/tweepy) for Python

## Instructions

> "I love instructions, they give me confidence."
> -- <cite>me</cite>

1. In case you haven't done it yet, [upgrade](http://arduino.cc/en/Tutorial/YunSysupgrade) your Arduino Yún to the latest version and [expand](http://arduino.cc/en/Tutorial/ExpandingYunDiskSpace) it's disk space using the SD card
2. Log to your Arduino using ssh
3. Install a bunch of useful stuff

		$ opkg update
		$ opkg install git
		$ opkg install python-expat
		$ opkg install python-openssl
		$ opkg install python-bzip2
#### easy_install
		$ opkg install distribute
#### pip
		$ easy_install pip
####[tweepy](https://github.com/tweepy/tweepy)
		$ pip install tweepy
or install it manually cloning it from github

		$ git clone https://github.com/tweepy/tweepy.git
		$ cd tweepy
		$ python setup.py install

4. If you don't have one, create your [twitter app](https://apps.twitter.com/)
and get your consumer key and consumer secret. Then, generate an access token and get your access token and access token secret

5. Create a working folder for all the scripts (i.e. /root/python)

		$ mkdir /root/python
		$ cd /root/python
and, while in the python folder, clone the Twitter Blink example

		$ git clone git@github.com:amicojeko/TwitterBlink.git
don't forget to make the kill_processes.sh script executable!

		$ chmod +x kill_processes.sh

6. Then use vi or nano (I personally installed vim) to put your twitter app configuration data into the streaming.py script, and to configure the string to be searched inside the Twitter Stream Maelstrom

		$ nano streaming.py

	now everything should be ready.

7. Open the Arduino IDE and load the TwitterBlink.ino script that is in the Arduino folder (you can download it from GitHub )

8. Configure the script folder (in case you created a folder different from root/python/ in the previuos steps)

	You can customize the script for your needings, in it's initial configuration it will blink the LED attached to pin 13 (and the built in LED as well) so it's perfect for testing

9. Upload the script to Arduino, it should start working as soon as it's uploaded

10. Have fun!!

cheers!

Jeko

repository: amicojeko/TwitterBlink

repo_name: amicojeko/TwitterBlink


text:
<!-- Updated by Vladislav Bragoi -->
# Turtlebot3 Tools

This folders contains useful scripts to bring up turtlebot3 waffle.

## UPDATE
Panorama works only if raspicam package is installed. Click [here](http://emanual.robotis.com/docs/en/platform/turtlebot3/applications/#turtlebot-panorama-demo-using-raspberry-pi-camera-module) to see how to configure and/or install it.
[Needs to be tested on turtlebot3]

### New files:
* 08hostpc_navigation_map.sh
* 09hostpc_rviz_navigation_map.sh
* 10hostpc_save_map.sh
* 11turtlebot_bringup_picamera.sh
* 12hostpc_panorama.sh
* 13hostpc_start_panorama_demo.sh
* 14hostpc_view_image.sh

## Requirements
* A wireless network
* A turtlebot configured as described [here](http://emanual.robotis.com/docs/en/platform/turtlebot3/pc_software_setup/)
* Ubuntu on intel joule must connect automatically to a wireless network and get always the always the same ip address (dhcp or static)
    1. Boot the joule with a monitor connected
    2. Use network manager and connect to the wireless network (setting a static ip optionally)
    3. Reboot with monitor and check if the board connects automatically (optional)
    4. Turn off and disconnect monitor

## Dynamic IP
If using dynamic IP address (like us in our network) there is a simple way to get joule's ip address without a monitor:
1. with joule turned on connect the host pc to the board with a micro-usb cable
2. use a serial terminal like picocom (or putty on windows) to open the serial port and communicate to the joule with the command picocom /dev/ttyUSB0 -b115200
3. log in to the joule from the serial, writing username and password
4. use ifconfig command to get joule ip
5. disconnect the micro usb cable from the joule

## Usage
1. Connect host pc to the same wireless network of the turtlebot
2. Edit 00config.sh with the correct ip addresses and ubuntu joule username
3. Turn on turtlebot3 and wait ~45secs for ubuntu to start
4. Run 01hostpc_bringup.sh in a terminal of the host pc
5. In another terminal run 02turtlebot_bringup.sh (typing joule password twice)

Now turtlebot is ready and working (lidar sensor, if connected should start rotating).

## Teleoperation
Many teleoperation methods are available:
* keyboard teleoperation is available by running 03hostpc_keyboard_teleop.sh
* joypad teleoperation is available by running 03hostpc_joysyick_teleop.sh with the joypad connected
* android phone teleoperation with app [TeleOP](https://play.google.com/store/apps/details?id=com.github.rosjava.android_apps.teleop.indigo)
* other methods as described [here](http://emanual.robotis.com/docs/en/platform/turtlebot3/teleoperation/)

## SLAM
With the system running, it is possible to run SLAM node to create map.
Execute script 05hostpc_slam.sh
When script is closed, map is saved in current directory.
To see the built map real-time, launch 06hostpc_show_slam.sh with slam running.

## Shutdown system
To poweroff turtlebot, close the scripts with CTRL+C in inverse order.
Before shutting down it is important to poweroff the joule operating system.
Execute script 99turtlebot_poweroff.sh and wait ~30secs before removing power!


text:
---
layout: post
title: An Introduction to Julia and Distributions
date: 17/01/26
---

Julia is a new language on the block aimed at being a suitable mid point between the adaptability of Python and the speed of Matlab. Its a nice fall-back when my R code is just that bit too slow to really churn through some numbers.

On of the main benefits of using R is the ease at which the 'standard' distributions are available. Want exponentially distributed random variables? Just call rexp()! Want the pdf of the gamma distribution? dgamma() is there to help you. With Julia this type of functionality is in the [Distribution module](https://github.com/JuliaStats/Distributions.jl), so takes just a little bit more of work to get the same functionality.

In this post I will outline how the basics of the distributions package and how you can replicate some of the functionality of R.

Firstly, we need to install the Distributions package. This is done by calling `Pkg.add("Distributions")`. Now that is installed we need to load it into the namespace. Open a new Julia instance and load the package with `using Distributions`. The necessary functions are now loaded.

Our first exercise will be to sample $$N$$ exponentially distributed variables and check that the density of the samples tends to the pdf of the exponential distribution as $$N$$ becomes larger.
The first step in this code is to define our distribution. As the exponential distribution only requires one parameter, $$m$$, this is as simple as calling `Exponential(m)` in our code. Now we use a number of different functions on the distribution.

We can sample from this distribution using `rand(dist, N)` where $$N$$ is the number of samples to draw. We can then overlay the pdf of the distribution by using `pdf(dist, x)`.

Combing these commands allows us to draw a graph (using the Julia package [Gadfly](http://gadflyjl.org/stable/)) like this:

![Exponential Plot](/assets/expPlot.svg){:. center-image}

Here we can see the small sample size does not resemble the pdf but the large sample size does. So we are correctly drawing from the exponential distribution as expected.

There are also other functions available. A great example is calculating the mean of a log-normal distribution. This distribution is defined with two parameters; $$m$$ and $$s^2$$. However, the mean of the distribution is not equal to $$m$$. Instead it is $$ \exp(m+\frac{s^2}{2})$$. The Distributions package in Julia knows this. So by simply calling `mean` on the `LogNormal()` object you can return the theoretical mean of the distribution and not have to worry about the parametrisation specifics of the distribution.

    dist = LogNormal(1,4)
    mean(dist) == exp(1 + 4^2/2)

Overall, Julia and the Distributions package offer similar functionality to R. You can easily replicate some of the functions in R with very effort in Julia. This can be a useful tool if R is not quite cutting it on the speed front.

gha_language: HTML


text:
JavaScript O.O. Code Review 2
==========

By Ben Casalino, 18-September-2015

A pizza ordering web app that allows a user choose pizza quantity, toppings and size. Then calculates the orders and returns the total cot.

Setup
----------
* Clone repository:
```console
$ git clone https://github.com/bencasalino/js-cr2.git
```
* Open 'index.html' in a browser to begin.
* Enjoy!

Technologies Used
----------
JavaScript, jQuery, HTML, Bootstrap, CSS

License
----------
MIT License, Copyright (c) 2015 Ben Casalino


text:
# Topic

> 大師也曾是初學者─TLC名主持人的人生故事 (Women You Should Know Video Profile: Samantha Brown)

> When I got the job, I mean, I was petrified, because I really had absolutely no idea what I was doing, and I remember the first day of the shoot not knowing what I was doing, and everything is improvised. There is no script. It's just you go with it.

> 當我得到那份工作時，我嚇壞了，因為我真的不知道我在做什麼。我還記得開拍的第一天，我什麼都不知道，一切都要即興演出，沒有腳本，只能「做就對了」。

[![Image](https://cdn.voicetube.com/assets/thumbnails/YNE4_1O4n1M.jpg)](https://www.youtube.com/embed/YNE4_1O4n1M?rel=0&showinfo=0&cc_load_policy=0&controls=1&autoplay=1&iv_load_policy=3&playsinline=1&wmode=transparent&start=146&end=163&enablejsapi=1&origin=https://tw.voicetube.com&widgetid=1)

Host: michelle

Today issue: Every expert was once a beginner. -Helen Hayes

Start by doing what's necessary; then do what's possible; and suddenly you are doing the impossible. -Francis of Assisi

[Host record](https://cdn.voicetube.com/tmp/everyday_records/Michellesu/2535.mp3)

## learning points
1. _
	* petrified ['pɛtrɪfaɪd] (adj.) 嚇呆的，驚呆的
		- it means extremely frightened so frightened that you're unable to speak or move.
		- Maybe you familiar with this word petrified. The word petrified appears repetitively in the book "The Chamber of Secrets". This is the part where Hermione had indirect eye contact with that snake monster. She got petrified meaning she was turned into a stone.
		- spell  => Petrificus Totalus
		- He is petrified of everything he is a real worrier. => warrior 注意發音
			+ 他對所有他真正擔心的事情都感到害怕。
		- The kid is petrified of the injection needles.
			+ 孩子嚇呆了注射針。
	* petrify ['pɛtrɪfaɪ] (v.) 把…嚇呆，使驚呆
		-  I never like clowns they petrify me when I was a kid.
			+ 我小時候從不喜歡小丑，他們會把我嚇唬我。

2. _
	* improvise ['ɪmprəvaɪz] (v.) 臨時做；即興做
		- to do something with whatever you can make you solve without having any plans in advance.
		- My mind went blank I didn't know what to do so I had to improvise.
			+ 我的腦子一片空白，我不知道該怎麼辦，所以我不得不即興發揮。
		- I got petrified as I was waiting for my turn to deliver an improvised speech in front of the room of people.
			+ 當我在輪到在人們面前發表即興演講時，我嚇呆了。
	* spontaneous [spɑn'tenɪəs] (adj.) 自發的；非籌劃安排的
		- I think for those people who are experts and doing improv stuff they must be very creative and spontaneous.
			+ 我認為對於那些專家和做改進事物的人來說，他們必須非常有創造力和自發性。

3. _
	* script [skrɪpt] (n.) 劇本；講稿
		- the script is the written text word for a film a play or a speech.
		- I can't go spontaneously recording as Pronunciation Challenge now so I always need to write a script for it.
		- There is no script in life.
	* transcript ['træn͵skrɪpt] (n.) 文字記錄；抄本
		- transcript means the exact written copy of something.
		- I sometimes copy the transcript from videos like Ted Talk on voice tube to practice English things like that.


text:
# Title

Longest Alternating Subsequence

# Difficulty

Intermediate

# Tags

subsequence

# Description

In the longest alternating subsequence problem, one wants to find a subsequence of a given sequence in which the elements are in alternating order, and in which the sequence is as long as possible.

Remember, a subsequence of a given sequence is a sequence formed from the given sequence by deleting some of the elements without disturbing the relative positions of the remaining elements. For instance, the sequence of positive even integers (2, 4, 6, ...) is a subsequence of the positive integers (1, 2, 3, ...). The positions of some elements change when other elements are deleted. However, the relative positions are preserved.

We denote the function *as* as *as_n* where *n* is the number of elements in the sequence. The value of the function is the length of the longest alternating subsequence. Some examples:

* as_5(1,2,3,4,5) = 2 because any sequence of 2 distinct digits are (by definition) alternating. (for example 1,2 or 1,4 or 3,5)
* as_5(1,5,3,2,4) = 4 because 1,5,3,4 and 1,5,2,4 and 1,3,2,4 are all alternating, and there is no alternating subsequence with more elements
* as_5(5,3,4,1,2) = 5 because 5,3,4,1,2 is itself alternating

# Input Description

You'll be given a sequence of integers, one sequence per line. Example:

	10  22  9  33  49  50  31  60

# Output Descripton

Your program should emit the length of the longest alternating subsequence. From the above example:

	10  22  9  33  49  50  31  60 -> 6

(This is because a subsequence like `10  22  9  33  31  60` is a six member alternating subsequence.)

# Challeng Input

	1 5 4
	1 4 5
	13 18 3 8 16 12 6 7 11 1 2 19 4 15 17 5 0 9 14 10
	9 5 7 1 6 4 0 2 8 3

# Challenge Output

	1 5 4 -> 3
	1 4 5 -> 2
	13 18 3 8 16 12 6 7 11 1 2 19 4 15 17 5 0 9 14 10 -> 16
	9 5 7 1 6 4 0 2 8 3 -> 9

# FSharp Solution

	let longestSubsequence(s:seq<int>) : int =
		let getSigns(s:seq<int>) : seq<int> =
			Seq.windowed 2 s |>
			Seq.map (fun [|x;y|] -> Operators.compare x y)

		let targetSequence (n:int) : seq<int> =
			let rec loop (n:int) (acc:int list): int list =
				if n = 0 then acc
				else
					match (Seq.last acc) with
					| -1 -> loop (n-1) (acc@[1])
					|  1 -> loop (n-1) (acc@[-1])
			loop (n-1) [1] |> Seq.ofList

		// http://www.clear-lines.com/blog/post/Longest-Common-Subsequence-in-F-Sharp.aspx
		let rec LCS list1 list2 =
		  if List.length list1 = 0 || List.length list2 = 0 then
		    List.Empty
		  else
		    let tail1 = List.tail list1
		    let tail2 = List.tail list2
		    if List.head list1 = List.head list2 then
		      List.head list1 :: LCS tail1 tail2
		    else
		      let candidate1 = LCS list1 tail2
		      let candidate2 = LCS tail1 list2
		      if List.length candidate1 > List.length candidate2 then
		        candidate1
		      else
		        candidate2
		1 + (LCS ( getSigns s |> List.ofSeq) ( targetSequence (Seq.length s - 1) |> List.ofSeq) |> List.length)

repository: paralax/ColossalOpera

repo_name: paralax/ColossalOpera


text:
Robotlegs
=========

Robotlegs-Sharp is a application framework for C# ported from [Robotlegs for AS3](https://github.com/robotlegs/robotlegs-framework).
It offers:

* Dependency injection
* Module Management
* Command Management
* View Management
* Plug-and-play extensions

You can also check out it's features in more detail [here](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/Features.md)

Download & Install
------------------

We have provided the files as .dll binarys for ease of including into your projects. Please note you also need the dependency of swiftsuspenders.

* [Robotlegs Binaries Download](https://robotlegs-sharp.github.io/)

If you are wanting to browse though the interals, or want the source to recompile. Please download the sources here:

* [Robotlegs Source](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/src/)
* [SwiftSuspenders Source](https://github.com/robotlegs-sharp/swiftsuspenders-sharp/tree/master/src/)

Getting Started
---------------

* [A Brief Overview](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/ABriefOverview.md)
* [Features](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/Features.md)
* [Platforms](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/Platforms.md)
* [Writing An Extension](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/WritingAnExtension.md)
* [Common Problems](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/CommonProblems.md)
* [The internals (how it all works)](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/docs/TheInternals.md)

License
-------

The following source/framework has been applied with the [MIT license](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/blob/master/LICENSE)

Acknowledgements
----------------

Thanks to the original [Robotlegs Contributors](https://github.com/robotlegs/robotlegs-framework/graphs/contributors) who developed the first and second revision of the framework. Your original source has been beautifully done with painfully complex patterns.

Thanks to all who have [contributed to this repository](https://github.com/robotlegs-sharp/robotlegs-sharp-framework/graphs/contributors). Without you this port would be vaporware.

And thanks to whomever is reading this text, if you are benefiting from this framework it's made the year writing this port worthwhile.

Code Status
-----------

[![Build Status](https://api.travis-ci.org/robotlegs-sharp/robotlegs-sharp-framework.svg?branch=master)](https://travis-ci.org/robotlegs-sharp/robotlegs-sharp-framework)

gha_language: C#


text:
Title: Problem Set 1 Answers
Author: Arjun Shankar
1. User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
***I didn't know if I was allowed to do research to find the answers so I indicated which ones I did research for***
Mozilla/5.0(researched) : Says that the browser is compatible with the Mozilla. Only used for historical reasons.
(X11; Ubuntu; Linux i686; rv:26.0) : Information about the machine that is commincating with the server
	Ubuntu: The machine is running Ubuntu
	Linux i686: The machine is running 32-bit Linux
	X11(researched): Indicates the windowing system for bitmap displays.
	rv:26.0(researched): Indicates the version of Gecko
Gecko/20100101 (researched): Indicates that the browser uses the gecko engine and specifies the build date of the browser
Firefox/26.0: Indicates the web browser and its version

2. If there are multiple threads trying to access and change the same global variable, then we may run into problems where the global variable does not have the value that it should.