text:
## Overview

Flexible User Interfaces is a key part of proper Android app development. We need to ensure that our apps work across a wide variety of devices, versions, orientations and locales. Thankfully, Android has several powerful constructs that make responsive, flexible user interfaces fairly easy.

This is typically used for creating robust applications that work across different conditions. This guide will cover how to define alternative resources, how to have different interfaces for tablets vs phones, how to manage localization and much more.

## Usage

The core features that make responsive, robust and flexible layouts possible are:

 * [[RelativeLayout|Constructing-View-Layouts#relativelayout]] - While `LinearLayout` has uses, the most responsive layout is the Relative which allows you to specify your layout in terms of the spatial relationships. For more flexibility, the [[PercentRelativeLayout|Constructing-View-Layouts#percentrelativelayout]] can be used for elastic percentage based dimensions in conjunction with `RelativeLayout`.
 * [[Alternative Resources|Understanding-App-Resources#responsive-design]] - The ability to have multiple resource files (XML, images, etc) that will be automatically selected based on specified qualifiers (screen size, time of day, locale, etc). Using [size qualifiers](http://developer.android.com/training/multiscreen/screensizes.html#TaskUseSizeQuali) is the best way to create flexible applications.
 * [[Fragments|Creating-and-Using-Fragments]] - Reusable modular components that Activities can be composed from. This allows us to have alternate activity layouts all using the same fragments.
 * [[Drawables and Nine-Patch|Drawables#stretchable-nine-patch-image]] - Drawable XML shapes are inherently responsive but if we need to use images for buttons, we need to make sure that the images are setup to scale properly using the 9-patch system.
 * [Handling Configuration Changes](http://guides.codepath.com/android/Handling-Configuration-Changes) - Properly persisting view state across configuration changes such as screen rotation.

### Supporting Different Screens and Densities

A few quick tips to review when supporting different screen sizes:

 * [Use "wrap_content" and "match_parent"](http://developer.android.com/training/multiscreen/screensizes.html#TaskUseWrapMatchPar)
 * [Use RelativeLayout](http://developer.android.com/training/multiscreen/screensizes.html#TaskUseRelativeLayout)
 * [Use Size Qualifiers](http://developer.android.com/training/multiscreen/screensizes.html#TaskUseSizeQuali)
 * [Use Layout Aliases](http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters)

and tips for support different densities:

 * [Use density independent pixels](http://developer.android.com/training/multiscreen/screendensities.html#TaskUseDP)
 * [Provide density targeted bitmaps](http://developer.android.com/training/multiscreen/screendensities.html#TaskProvideAltBmp)

### Creating a Master-Detail Flexible Interface

Let's take an end-to-end look at creating a master-detail interface using fragments. Specifically creating an application with a list of items and then the ability to see the details for those items. On a phone, we will see a list as one activity and then select an item and have the **details open in a separate activity**. On a tablet, since we have considerably more space, we will have the list and the details on a single Activity.

![Master Detail Pattern](http://developer.android.com/images/training/basics/fragments-screen-mock.png)

**Note:** The full application source can be downloaded in our [android-master-detail-demo](https://github.com/codepath/android-master-detail-demo) repository.

#### Creating the Application

First, let's create a **new Android application** with a minimum of API level 11. In the wizard, select `Blank Activity` and then name the Activity` and hit "Finish".

![Create Project](https://i.imgur.com/ZX7aLMS.png)
![Create Project 2](https://i.imgur.com/wsj17qG.png)

#### Defining the Item Model

Next, let's define a simple `Item` model that we will be displaying in our application. The `Item` will simply contain a `title` and a `body`. The list will display the titles and the detail view will show the title and body. The Item might look like:

```java
public class Item {
  private String title;
  private String body;

  public Item(String title, String body) {
    this.title = title;
    this.body = body;
  }

  public String getTitle() {
    return title;
  }

  public String getBody() {
    return body;
  }

  @Override
  public String toString() {
    return getTitle();
  }

  public static ArrayList<Item> getItems() {
    ArrayList<Item> items = new ArrayList<Item>();
    items.add(new Item("Item 1", "This is the first item"));
    items.add(new Item("Item 2", "This is the second item"));
    items.add(new Item("Item 3", "This is the third item"));
    return items;
  }
}
```

This item defines the fields and a simple constructor. We've also added a simple `toString` representation and created some simple fake item data to use for this example. Our application will be powered by this simple item model and data fixtures.

#### Creating the Fragments

Next, let's setup our fragments for use in this application. First, there will be a `ItemsListFragment` which displays the list of item titles to be viewed. Let's create the associated view first in `res/layout/fragment_items_list.xml`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ListView
        android:id="@+id/lvItems"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </ListView>

</RelativeLayout>
```

and then let's create the associated fragment and attach the view:

```java
public class ItemsListFragment extends Fragment {
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    // Inflate view
    View view = inflater.inflate(R.layout.fragment_items_list,
        container, false);
    // Return view
    return view;
  }
}
```

Second, let's create the `ItemDetailFragment` which displays the title and body for a particular item as a "detail" view. Let's create the associated view first in `res/layout/fragment_item_detail.xml`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/tvTitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Item Title"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView
        android:id="@+id/tvBody"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tvTitle"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="19dp"
        android:text="Item Body" />

</RelativeLayout>
```

and then let's create the associated fragment and attach the view for detail:

```java
public class ItemDetailFragment extends Fragment {
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    // Inflate view
    View view = inflater.inflate(R.layout.fragment_item_detail,
        container, false);
    // Return view
    return view;
  }
}
```

Great! Now we have our two fragments defined (list and detail) with basic views and fragment classes.

#### Layout the Activity

Next, let's lay the fragments onto the Activity. For now, let's assume a phone in which the first activity just has the list of items and then an item is selected and a detail view is displayed. First, let's layout our simple list of items activity by embedding the `ItemsListFragment` into our `res/layout/activity_items_list.xml`:

```xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".ItemsListActivity" >

    <fragment
        android:id="@+id/fragmentItemsList"
        android:name="com.codepath.example.masterdetaildemo.ItemsListFragment"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        tools:layout="@layout/fragment_items_list" />

</RelativeLayout>
```

and then let's change the `ItemsListActivity` to extend from `AppCompatActivity` to enable support fragments:

```
public class ItemsListActivity extends AppCompatActivity {
  // ...
}
```

Now if we were to run the app, we would see an empty ListView in the `ItemsListActivity`. Next, let's populate the items into the list.

#### Populate the Item List Fragment

Let's use an adapter to populate our `ListView` with items based on our fake item data we setup earlier. To do that, we need to add the following to `ItemsListFragment`:

```java
public class ItemsListFragment extends Fragment {
  private ArrayAdapter<Item> adapterItems;
  private ListView lvItems;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Create arraylist from item fixtures
    ArrayList<Item> items = Item.getItems();
    // Create adapter based on items
    adapterItems = new ArrayAdapter<Item>(getActivity(),
        android.R.layout.simple_list_item_activated_1, items);
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    // Inflate view
    View view = inflater.inflate(R.layout.fragment_items_list,
        container, false);
    // Attach adapter to listview
    lvItems = (ListView) view.findViewById(R.id.lvItems);
    lvItems.setAdapter(adapterItems);
    // Return view
    return view;
  }
}
```

Here we have fetched our items, created an adapter based on those items and then attached those items into the ListView. Now we will see the following list when we run:

![State 1](https://i.imgur.com/LWAMwQx.png)

Now we have the list of items populated properly into our fragment and displayed in our activity.

#### Adding Detail View

Next, let's add the ability to select an item and have the details show up. So we want to be able to bring up the detail view when an item is pressed. On the phone size screen, this will bring up a separate activity. So let's create a new blank activity called `ItemDetailActivity` that will display our `ItemDetailFragment`.

![State 2](https://i.imgur.com/mKCCTzh.png)

Inside our `ItemDetailActivity`, we just need to embed a `FrameLayout` that will be dynamically replaced with the `ItemDetailFragment`. In our `res/layout/activity_item_detail.xml`, let's add the frame container:

```xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/flDetailContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".ItemDetailActivity" >

</FrameLayout>
```

and then we need a way to dynamically load the correct item fragment. To do this, we need this `ItemDetailActivity` to be launched with a particular item being passed in that we can then use to populate the appropriate details. Let's assume that when `ItemDetailActivity` it will have an "item" key passed into the Bundle which is a serialized version of the item that should be displayed. In the constructor then, we might add:

```java
public class ItemDetailActivity extends AppCompatActivity {
  ItemDetailFragment fragmentItemDetail;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_item_detail);
    // Fetch the item to display from bundle
    Item item = (Item) getIntent().getSerializableExtra("item");
    if (savedInstanceState == null) {
      // Insert detail fragment based on the item passed
      fragmentItemDetail = new ItemDetailFragment();
      FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
      ft.replace(R.id.flDetailContainer, fragmentItemDetail);
      ft.commit();
    }
  }

}
```

This code grabs the item passed into this activity and then inserts a `ItemDetailFragment` within the `FrameLayout` we setup earlier. At this point, we need to make the `Item` serializable so we can add that to the bundle later:

```java
public class Item implements Serializable {
  private static final long serialVersionUID = -1213949467658913456L;
  // ...
}
```

We also need a way to pass this item into the `ItemDetailFragment` itself so the details can be populated. With fragments, we are never to mess with the Fragment constructor directly. Instead we use a different way of passing arguments similar to an intent bundle. So, next we need to create a way to construct an `ItemDetailFragment` which is passed the appropriate item. To do that, we use the `newInstance` pattern on the fragment:

```java
public class ItemDetailFragment extends Fragment {
  // ...

  // ItemDetailFragment.newInstance(item)
  public static ItemDetailFragment newInstance(Item item) {
    ItemDetailFragment fragmentDemo = new ItemDetailFragment();
    Bundle args = new Bundle();
    args.putSerializable("item", item);
    fragmentDemo.setArguments(args);
    return fragmentDemo;
  }
}
```

This defines an easy to use static method with constructs the fragment and uses the `setArguments` method on the fragment to store the item for use later. We also want to use this item data to populate the TextView title and body within our fragment view. We can do that in `onCreateView`:

```java
public class ItemDetailFragment extends Fragment {
  private Item item;

	@Override
	public void onCreate(Bundle savedInstanceState) {
	  super.onCreate(savedInstanceState);
	  item = (Item) getArguments().getSerializable("item");
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
	    Bundle savedInstanceState) {
	  View view = inflater.inflate(R.layout.fragment_item_detail,
	      container, false);
	  TextView tvTitle = (TextView) view.findViewById(R.id.tvTitle);
	  TextView tvBody = (TextView) view.findViewById(R.id.tvBody);
	  tvTitle.setText(item.getTitle());
	  tvBody.setText(item.getBody());
	  return view;
	}

	// ...
}
```

Now with this, in `onCreate` we extract the `Item` that was passed in with `setArguments` during creation and then in `onCreateView` we display the title and body of the item within the text views. So now when we create a detail fragment with `newInstance`, the item passed in will populate the details of the view. Finally, let's use `newInstance` in our `ItemDetailActivity`:

```java
public class ItemDetailActivity extends AppCompatActivity {
  ItemDetailFragment fragmentItemDetail;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_item_detail);
    // Fetch the item to display from bundle
    Item item = (Item) getIntent().getSerializableExtra("item");
    if (savedInstanceState == null) {
      // Insert detail fragment based on the item passed
      fragmentItemDetail = ItemDetailFragment.newInstance(item); // <-------
      FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
      ft.replace(R.id.flDetailContainer, fragmentItemDetail);
      ft.commit();
    }
  }

}
```

So with all that in place, the `ItemDetailActivity` can be opened (with an item passed into the bundle), the item will be used to create an `ItemDetailFragment` and then we dynamically insert the detail fragment into the frame layout container within the activity in order to display the details.

#### Handling Item Selection in ListView

Next, we need to actually hook up the ListView of items such that when an item is selected, the details view actually appears. Since fragments should use an interface to communicate, we are going to create the interface within our `ItemsListFragment` and trigger events within their that can later be handled by an Activity. In particular, we want to be able to manage an event for when an item is selected:

```java
public class ItemsListFragment extends Fragment {
  // ...

  private OnListItemSelectedListener listener;

  public interface OnListItemSelectedListener {
    public void onItemSelected(Item item);
  }

  @Override
  public void onAttach(Activity activity) {
    super.onAttach(activity);
    if (activity instanceof OnListItemSelectedListener) {
      listener = (OnListItemSelectedListener) activity;
    } else {
      throw new ClassCastException(
          activity.toString()
              + " must implement ItemsListFragment.OnListItemSelectedListener");
    }
  }

  // ...
}
```

With this, we now have an `OnItemSelectedListener` interface which the Activity could use to describe the behavior when a particular item is selected. Let's now setup a handler such that when a list item is clicked, this listener is fired:

```java
public class ItemsListFragment extends Fragment {
  // ...

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    // Inflate view
    View view = inflater.inflate(R.layout.fragment_items_list, container,
        false);
    // Bind adapter to ListView
    lvItems = (ListView) view.findViewById(R.id.lvItems);
    lvItems.setAdapter(adapterItems);
    lvItems.setOnItemClickListener(new OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView<?> adapterView, View item,
          int position, long rowId) {
        // Retrieve item based on position
        Item item = adapterItems.getItem(position);
        // Fire selected listener event with item
        listener.onItemSelected(item); // <--------------
      }
    });
    return view;
  }
}
```

and then let's setup the handler within our activity so we can handle the `onItemSelected` event properly:

```java
public class ItemsListActivity extends AppCompatActivity implements
    OnListItemSelectedListener {

  // ...

  // Handles the event when the fragment list item is selected
  @Override
  public void onItemSelected(Item item) {
    // For phone, launch detail activity using intent
    Intent i = new Intent(this, ItemDetailActivity.class);
    // Embed the serialized item
    i.putExtra("item", item);
    // Start the activity
    startActivity(i);
  }

}
```

With that, if we run the application, we can now see that selecting an item in the item list will correctly bring up our detail activity.

#### Creating a Two-Pane View

If we only cared about a phone, then this tutorial might end at this point. However, let's suppose we want this application to work on a tablet such as the "Nexus 7". You may want to **switch to a tablet emulator device** at this point to test the next sections.

On a tablet, the current listview activity looks odd. We really want a way to have the list and the detail panes within a single activity but only for the tablet.

![Master Detail Pattern](http://developer.android.com/images/training/basics/fragments-screen-mock.png)

So, let's take a look at how to setup the two-pane view only for larger tablet devices and keep phones using the current behavior. Within Android, there is a concept of [Alternative Resources](http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources). That is, we can have resource files that are automatically selected based on certain "qualifiers". There are many, but one easy qualifier is "screen size". We can declare that if the screen size is "large", that a different XML layout will be used for the same activity. To do that, let's right-click to create a new "Android XML Layout File".

The net result is we want to **create an alternate layout XML for our activity** at `res/layout-large/activity_items_list.xml`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:showDividers="middle"
    android:baselineAligned="false"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <fragment
        android:id="@+id/fragmentItemsList"
        android:name="com.codepath.example.masterdetaildemo.ItemsListFragment"
        android:layout_height="wrap_content"
        android:layout_width="0dp"
        android:layout_weight="1"
        tools:layout="@layout/fragment_items_list" />

    <View android:background="#000000"
        android:layout_width="1dp"
        android:layout_height="wrap_content"
        />

    <FrameLayout
        android:id="@+id/flDetailContainer"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="3" />

</LinearLayout>
```

This layout is only used **when the screen size is large** such as a tablet. In this version of the activity layout, there is a static fragment for the `ItemsListFragment` **and** the dynamic frame layout for the `ItemDetailFragment` within the same screen. Notice, that we have used a `LinearLayout` with `android:layout_weight` to ensure that the detail view is about 3x wider then the item list. We have also added a `View` which is being used as a divider between the list and detail fragments.

![Tablet](https://i.imgur.com/l3Aj9WR.png)

#### Supporting Item Selection for Two-Pane View

Now we have a two-pane view on a tablet and single pane for the phones. However, we need to intelligently determine what to do when we select an item from the list. On the phone, we want to launch an intent but on the tablet we want to **dynamically insert the detail fragment** onto the existing Activity. Let's take a look at how we can change the behavior of our Activity depending on if we are in a one pane or two pane layout:

```java
public class ItemsListActivity extends AppCompatActivity implements OnItemSelectedListener {
  // Flag determines if this is a one or two pane layout
  private boolean isTwoPane = false;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_items_list);
    // Call this to determine which layout we are in (tablet or phone)
    determinePaneLayout();
  }

  private void determinePaneLayout() {
    FrameLayout fragmentItemDetail = (FrameLayout) findViewById(R.id.flDetailContainer);
    // If there is a second pane for details
    if (fragmentItemDetail != null) {
      isTwoPane = true;
    }
  }

  // ...
}
```

Now, if there is a second pane, the `isTwoPane` flag will be set to true. If we are on a phone with a single pane, the other XML file will be used and the `isTwoPane` will be false. Now we can use this to determine what to do in `onItemSelected`:

```java
public class ItemsListActivity extends AppCompatActivity implements OnItemSelectedListener {
    @Override
    public void onItemSelected(Item item) {
      if (isTwoPane) { // single activity with list and detail
        // Replace framelayout with new detail fragment
        ItemDetailFragment fragmentItem = ItemDetailFragment.newInstance(item);
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.replace(R.id.flDetailContainer, fragmentItem);
        ft.commit();
      } else { // go to separate activity
        // launch detail activity using intent
        Intent i = new Intent(this, ItemDetailActivity.class);
        i.putExtra("item", item);
        startActivity(i);
      }
    }
}
```

Great! Now in a tablet view, the details show up within the detail area within the same activity and on the phone, the intent launches and we are able to see the details in a separate view.

![Tablet 2](https://i.imgur.com/aJhD3WO.png)

#### Setting Up Activated List Item

At this point, we have used fragments and alternative resources to create a flexible master-detail UI. One final feature might be for the list item to appear "selected" after I am viewing it within the detail pane. If I want the item I selected to appear "activated" in the list, I need to make one more tweak. Let's add a method to our `ItemsListFragment`:

```java
public class ItemsListFragment extends Fragment {
  // ...

  /**
   * Turns on activate-on-click mode. When this mode is on, list items will be
   * given the 'activated' state when touched.
   */
  public void setActivateOnItemClick(boolean activateOnItemClick) {
    // When setting CHOICE_MODE_SINGLE, ListView will automatically
    // give items the 'activated' state when touched.
    lvItems.setChoiceMode(
        activateOnItemClick ? ListView.CHOICE_MODE_SINGLE
            : ListView.CHOICE_MODE_NONE);
  }
}
```

and then use this method in our activity but **only for the two-pane** case:

```java
public class ItemsListActivity extends AppCompatActivity implements
  OnListItemSelectedListener {

  // ...
  private void determinePaneLayout() {
    FrameLayout fragmentItemDetail = (FrameLayout) findViewById(R.id.flDetailContainer);
    if (fragmentItemDetail != null) {
      isTwoPane = true;
      ItemsListFragment fragmentItemsList =
          (ItemsListFragment) getSupportFragmentManager().findFragmentById(R.id.fragmentItemsList);
      fragmentItemsList.setActivateOnItemClick(true);
    }
  }
}
```

Here we are calling the `setActivateOnItemClick` method only if we are in a two-pane layout which activates the `CHOICE_MODE_SINGLE` option on our ListView and allows us to have "activated items". Now, when we run the app on tablets, the last item selected will appear "activated" in the list view.

![Tablet 3](https://i.imgur.com/qXjBcuL.png)

#### Master-Detail Conclusion

We have now successfully built an end-to-end master-detail application that has a list of items and a detail view. On the phone, the list and detail are on separate activities but on the larger tablet, we used an alternate resource file so that we could have a two-pane interface. This has demonstrated the power and flexibility of fragments, alternative resources and relative layouts when used in conjunction within an app. You could imagine this exact same pattern being applied to a Twitter app or a Yelp app.

The full application source can be downloaded in our [android-master-detail-demo](https://github.com/codepath/android-master-detail-demo) repository. Check out the [Adaptive UI](http://developer.android.com/training/multiscreen/adaptui.html) official docs and the [Building a Flexible UI](http://developer.android.com/training/basics/fragments/fragment-ui.html) doc for more details.

## References

 * <http://developer.android.com/training/basics/fragments/fragment-ui.html>
 * <http://developer.android.com/training/multiscreen/screensizes.html>
 * <http://developer.android.com/training/multiscreen/screendensities.html>
 * <http://developer.android.com/training/multiscreen/adaptui.html>
 * <http://developer.android.com/guide/components/fragments.html#Example>
 * <http://www.easyinfogeek.com/2013/07/full-example-of-using-fragment-in.html>
 * <http://www.vogella.com/articles/AndroidFragments/article.html#fragments_tutorial_orientation>

repository: teocci/AndroidGuidenotes

repo_name: teocci/AndroidGuidenotes


text:
---
title: "Sustainable Agriculture, Sustainable Lives"
cover: "farmers.png"
date: "2018-08-27"
category: "non-profit"
tags:
    - Women's Empowerment
    - Kenya
    - Sustainability
---

Kagure, a 9 year old Luo girl in Western Province, Kenya, already feels the weight of a paternalistic society on her shoulders. She wakes early to help her mother feed her siblings, the chickens, and the family cow. During the past decade, children in Kagure’s position have gained access to free elementary education, so after her demanding morning ritual, as her mother heads for the rainforest to scavenge for firewood, Kagure sets off on the dirt path to her local school.  It provides a basic education in math and english, though her labor is also employed here to work her school’s 1 acre farm.  It is hard work, but knowledge of subsistence agriculture aids her in improving the yields of beans, kale, corn, yams, and lentils that her family relies on to sustain themselves.

However, the prized cow her family owns produces only 1/2 quart of milk per day in a culture where it is a luxury in high demand.  If her school provided lessons in Improved dairy management, she could activate that resource to fund a path to a higher education.

In 2006, President Barack Obama visited his grandmother in a village a stone’s throw from Kagure’s home.  Shortly after, he was elected into office.  Kagure was not yet born to witness it.

She deserves the chance to see the change he promised and demonstrated to the world.

At the average Kenyan wage, a $25 pair of shoes takes a week to earn. Donate your old smartphone and Sawa will give the proceeds of its sale in Kenya to Kargure’s elementary school to fund its improved dairy farming and conservation agriculture program.

You can help her leverage her resources to change her life.

license: MIT

repository: Talamantez/gatsby-material-starter

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: Talamantez/gatsby-material-starter


text:
---
layout: post
title: SharePoint Framework - What It Is
categories: [SharePoint, O365, SPFx]
tags: [SharePoint Framework, sharepoint]
fullview: true
comments: true
---

After diving in deep to SPFx I wanted to share some findings about some misconceptions about what SPFx is and isn't that I had and couldn't find elsewhere.

Feel free to correct where I'm wrong and supply any more info. This is all subject to change, but these are current findings with the current bits.

Chris O'Brien's blog is a great help on this, and referenced throughout <http://www.sharepointnutsandbolts.com/>

**Skipping the marketing for a second, what exactly is the SharePoint Framework (SPFx) from a technical standpoint?**

**TLDR;** SPFx provides cross-platform tooling that generates a SharePoint add-in (.spapp) that defines a ClientSideWebPart (new to SP v16) and configures it with information about where the JS files that make up your client-side web part are located.

**Long version**: SPFx provides a yeoman template that contains a provides of things once initialized.

1) Pulls in a number of npm packages that contain the 'framework' and provides ts->js transpilation and webpack packaging

2) Defines a number of gulp tasks that generates the files that go into a .spapp (AppManifest.xml, etc) and zips them up. Other tasks provide local serving of a client-side webpart.

3) Basic project structure based on inputs. See  <http://www.sharepointnutsandbolts.com/2016/07/web-part-manifest-bundle-json-framework.html> for a rundown of the structure.

Webpack is utilized for module loading and bundling.

The entry point to a client web part is provided by a render() method.

**In idiomatic javascript terms, how does the content of my web part get surfaced?**

When a SPFx ClientSideWebPart is rendered, it loads the files provided in the web part json configuration and calls the "render()" function that is exported on the 'entry' class. This serves as the entry point to providing JS-based behavior.

The value of 'this' in the scope of the 'render' method contains a number of properties that can be used.

One of these properties is 'domElement' which is exactly as it sounds -- the dom element that represents the body of the web part. Setting this.domElement.innerHTML property provides the html contents of the web part.

But what about frameworks like angular that 'render' the html for me?'

Remember that everything is running in JS. So, to get angular to work with the SPFx, after including the angular javascript files, one would initialize the angular app within the render method (or in any loaded JS) and provide this.domElement.innerHTML property with the desired html with Angular markup.

For instance:
![screenshot](/assets/media/2016-08-19-sharepoint-framework-what-it-is-01.png "Screenshot")

**Can I use the ClientSideWebPart outside of the tooling that MS provides, for instance, can I create an old-school web part definition that I upload to the web part catalog without using the add-in model?**

There might be benefits to using the add-in model (reuse, discovery) but, yeah, absolutely, in fact the tooling does this for you, but then bundles it up in the .spapp
![screenshot](/assets/media/2016-08-19-sharepoint-framework-what-it-is-02.png "Screenshot")

The namespace to include in your .webpart file is:

Microsoft.SharePoint.WebPartPages.ClientSideWebPart, Microsoft.SharePoint, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=71e9bce111e9429c

The ClientSideWebPartId must be specified, and it's currently unclear to me if it's possible to set those values outside an add-in.

**Can I use the webpart generated by the SPFx on an existing Web Part Page?**

Yes. Currently generated by SPFx is just a plain 'ol web part in the add-in model, just pre-loaded with JS goodness.

**Should I place an emphasis on learning SPFx or client-side frameworks?**

SPFx is a shim to any client side framework, so beyond the initial set up of a project, and defining/obtaining web part properties, the real emphasis is in building your add-in with whatever client-side framework you choose.

**Which client-side frameworks should I learn with SPFx?**

While the SPFx does utilize react, redux and flux, any client-side framework can be utilized with SPFx.

This includes "naked javascript" to jQuery to bigger stacks like Angular and React.

The SPFx does emphasize using TypeScript.

**Does SPFx invalidate any current approaches with the add-in model, webparts or .aspx files?**

No. As seen above, actually SPFx utilizes the add-in model to define the webparts you create and leverages the existing webpart framework in .aspx pages that's been around since SP2010.

The official line from Bill Baer is that *"The SharePoint Framework does not make obsolete nor deprecate the existing Add-In Model for SharePoint."*

**I'm more of a idiomatic javascript guy, can I use the SPFx without Typescript? What about  coffeescript, flowtype?**

Sure, there may or may not be advantages to strong typing, but if you're more comfortable using pure javascript or prefer another language that transpiles to JS you can -- but keep in mind you're going off the SPFx reservation.

Look at the js that SPFx generates for more info, but the key points are to extend the BaseClientSideWebPart prototype, providing a render() function and a propertyPaneSettings property.

It's possible to release your own Yeoman template that simply uses ES6 or any transpiled language.

**What benefits does the SPFx have over add-in parts, creating custom .aspx pages and other approaches that utilize client side techniques that we've utilized with SPO.**

Good question... as you can see by now, SPFx actually leverages the existing add-in model and web parts. It does provide cross-platform tooling that gives you a standard project structure and abstracts away the configuration of a number of toolsets that are becoming standard when developing HTML/JS code (Webpack, Typescript/typings, etc...)

It would benefit oneself to learning these underlying technologies because at some point, one is probably going to need to touch them. (Or at least move code from SPFx Preview to RTM whenever that happens)

If this is MS's way of forcing SP devs to get off the laurels and learn HTML+JS technologies then great.

What about the new "SharePoint Pages" experience?

Not sure -- the current preview bits don't indicate how the "New SharePoint Page Experience" fits in, nor what the migration path.

Looking at the @sharepoint\sp-client-preview module, it does make reference to a ClientSideWebPartManager, and a differentiation between "Classic" and "Client" pages.

There's also workbench.aspx which imports a ASP.Net class called "ClientSidePage" -- perhaps this represents the current state-in-time of the new pages experience being developed.

**What about sharePoint WebHooks?**

Doesn't look like SharePoint specific webhooks have been made available yet, WebHooks as part of the MicroSoft graph are available (Outlook and OneDrive)

**Wrap-up:**

One shouldn't feel ashamed for not looking at SPFx especially if one is currently is or has utilized any client-side frameworks. The bulk of the needed knowledge lies in actually building your app, so it's probably a pragmatic approach to let the dust settle on the SPFx before making too much of a time investment.

Also keep in mind that the above will probably change, as the Github docs repo states:

_"Note: SharePoint Framework web parts during preview are not supported for production use.
The SharePoint Framework is currently available for use in Classic Pages within Office 365 Developer Tenancies. We’ll be expanding coverage to more Office 365 Tenancies over the coming months."_


text:
# 10. Manage Tools

- [Overview](#overview)
- ["Details" view pane](#details-view-pane)
    - [Registry](#registry)
    - [Tool group](#tool-group)
        - [Search](#search-field)
        - [Show attributes/Hide attributes](#show-attributeshide-attributes)
        - ["Gear" icon](#gear-icon)
        - [Personal Docker repository (Tool group)](#personal-docker-repository-tool-group)
        - [List of Tools](#list-of-tools)
        - [Tool information page](#tool-information-page)
            - [Description tab](#description-tab)
            - [Versions tab](#versions-tab)
        - [Settings tab](#settings-tab)

> For more information about Docker container lifecycle and instance lifecycle see at [Appendix A. Instance and Docker container lifecycles](../Appendix_A/Appendix_A._Instance_and_Docker_container_lifecycles.md).
>
> You also can view tools details via the **CLI**. See [14.8. View tools definitions](../14_CLI/14.8._View_tools_definitions_via_CLI.md).

## Overview

The **Tools** tab represents a list of available docker registries and docker images that contain tools. Using Docker images allows you to configure the same processing environment on each node regardless of the node type.
Every **Tool** object in the Cloud Pipeline is a representation of Docker image.

## "Details" view pane

At the top of the page, you'll see the basic objects of the "Tools" space.

![CP_ManageTools](attachments/ManageTools_01.png)

### Registry

Click on the registry name to see a drop-down list of available **Docker registries** and choose one.

### Tool group

Press under the arrow to see a list of available **Tool groups** or to search **Tool group** by the name. Only the lower-case alphanumeric string is allowed for a **Tool group** name.
**_Note_**: when you navigate to the Docker registry, the Tool group shown by default will be chosen based on the following conditions:

1. If a user is included into some group (e.g. "cancer") and a Tool group with the same name exists, it will be shown by default. See more about user groups [here](../13_Permissions/13._Permissions.md).
2. If the first condition isn't met, "**library**" group will be shown by default.
3. If "**library**" group doesn't exist, "**default**" group will be shown by default.
4. If the "**default**" group doesn't exist either, "**personal**" group will be shown.
5. If none of the above groups doesn't exist/user doesn't have access to them, the first Tool group from the list will be shown by default.

#### Search field

This field helps to find a **Tool** by name in particular **Tool group** in a registry.

#### Show attributes/Hide attributes

**Show attributes/Hide attributes** opens the **Attributes** pane, where you can see and edit a list of **key=value** attributes of the tool group. See [17. CP objects tagging by additional attributes](../17_Tagging_by_attributes/17._CP_objects_tagging_by_additional_attributes.md).

#### "Gear" icon

The following options are available:

| Option | Description |
|---|---|
| **Registry** | This button allows to create a new registry or Edit/Delete current. |
| **Group** | Allows creating new Tool group or Edit/Delete current. |
| **+ Enable Tool** | Enables a Tool in a registry. |
| **How to configure** | Configures the Docker client to push/pull images to/from a registry. **_Note_**: Docker client needs to be installed. For installation instructions refer to <https://docs.docker.com/install/>. |

![CP_ManageTools](attachments/ManageTools_02.png)

#### Personal Docker repository (Tool group)

All tools within such repository are named as **<user\_name>/<tool\_name>**.
**_Note_**: If a user loads a registry and there is no **"personal"** group in it, it shall be checked whether he has **WRITE** access to the registry.

- If **No** - do not display **"personal"** section **(1)** in the registry.
- If **Yes** - a user will see the message "Personal tool group was not found in registry" **(2)**. On top of that, you'll see a suggestion to explore **library** Tool group.
    ![CP_ManageTools](attachments/ManageTools_03.png)
    See how to create personal Tool group [here](10.2._Add_Edit_a_Tool_group.md#add-a-personal-tool-group).

#### List of Tools

Tools list will be shown after you select group and registry.
![CP_ManageTools](attachments/ManageTools_04.png)

#### Tool information page

Click on a Tool's name to open **Tool information** page. In the top right corner you can find the following buttons:

| Control | Description |
|---|---|
| **"Displays" icon** | This icon includes:

**Show attributes/Hide attributes**
This button is used to show attributes of a Tool.
**_Note_**: If selected Tool has any defined attribute, attributes pane is shown by default. For more details see [17. CP objects tagging by additional attributes](../17_Tagging_by_attributes/17._CP_objects_tagging_by_additional_attributes.md).

**"Show issues/Hide issues"** shows/hides the issues of the current Tool to discuss. To learn more see [here](../16_Issues/16._Issues.md).

 |
| **"Gear" icon** | Manage Tool permissions or delete a Tool. |
| **Run** | Run an instance with this Tool. |

Tool information page is divided into 3 tabs.

##### Description tab

This tab shows Tool description.
![CP_ManageTools](attachments/ManageTools_05.png)

For registries with **Pipeline authentication** option, you'll also see the **Docker pull command** on this tab if you have **READ** access to a Tool.

##### Versions tab

Choose this tab to see a list of Tool versions.
![CP_ManageTools](attachments/ManageTools_06.png)

> About internal Tool version menu see [10.7. Tool version menu](10.7._Tool_version_menu.md).

Each version has the following icons and controls:
![CP_ManageTools](attachments/ManageTools_07.png)

| Control/Label | Description |  |
|---|---|---|
| **Name** | Name of version | ![CP_ManageTools](attachments/ManageTools_08.png) |
| **Scanning status** |

If the security scanning is forced, you'll see the status "**in progress**" of security scanning.

If the security scanning is failed, you'll see the status "**failed**".

 | ![CP_ManageTools](attachments/ManageTools_09.png) |
| **Last successful scan:** | The label shows if a version is successfully scanned at any time. The label contains date and time of the last successful attempt. | ![CP_ManageTools](attachments/ManageTools_10.png) |
| **Last scan date** | The label shows if a version scanning is failed. The label contains date and time of the last scanning attempt. | ![CP_ManageTools](attachments/ManageTools_11.png) |
| **Colored bars** | Hover over the colored bars to see scan status - a number of vulnerabilities grouped by severity (e.g. Critical, High, Medium, ...). | ![CP_ManageTools](attachments/ManageTools_12.png) |
| **Digest** | The label shows unique identifier of docker image. |  |
| **Corresponding aliases** | The label shows aliases of docker image (e.g. if some digest has more than one alias). | ![CP_ManageTools](attachments/ManageTools_13.png) |
| **Image size** | The label shows the size of docker image.
**_Note_**: this value is provided for the "gzipped" docker image. When pulled to the local workstation or the cloud instance - the size of the image will be greater. | |
| **Modified date** | The label shows modified date of docker image. |  |
| **SCAN** | Control forces the security scanning process. Available only for users with **ROLE_ADMIN** role. | ![CP_ManageTools](attachments/ManageTools_14.png) |
| **Run** | Allow to run the particular Tool version with default settings or customize it. | ![CP_ManageTools](attachments/ManageTools_15.png) |
| **Delete** | Delete the particular Tool version. | ![CP_ManageTools](attachments/ManageTools_16.png) |

In addition, the **Version** tab contains **View unscanned version** control. The control is visible if unscanned versions exist.
![CP_ManageTools](attachments/ManageTools_17.png)

More about **Security scan** feature you could learn [here](10.6._Tool_security_check.md).

##### Settings tab

Navigate to this tab to see Tool attributes and execution defaults:
![CP_ManageTools](attachments/ManageTools_18.png)

1. **Tool endpoints** - specify an endpoint for the service launched in a Tool.
2. **Tool attributes** - tool labels to briefly describe the Tool.
3. **Execution defaults** - execution environment settings with which tool will be run by default:
    - **Instance type** - an instance type in terms of Cloud Provider with specifying amounts of CPU, RAM and GPU.
    - **Price type** - `spot` or `on-demand` type of instance.
    - **Disk** - instance disk size in Gb.
    - **Limit mounts** - available storages for Tool execution.
    - **Configure cluster** - by clicking on this button cluster can be configured (for more details see [here](../06_Manage_Pipeline/6._Manage_Pipeline.md#configuration)).
    - **Cloud Region** - the field where the admin/tool owner could select a specific **Cloud Provider**/**Region** to enforce users to run that tool in it. By default, has **`Not configured`** value. This means, that a tool will be launched in a _Default region_ (configured in the global settings) or a user can set any allowed **Cloud Region**/**Provider** manually.
    - **Cmd template** - default command for Tool execution.
4. **System parameters** - system parameters that can be used during Tool execution.
5. **Custom parameters** - specific parameters that can be used during Tool execution.

Navigate back to the **Tools group** page from the Tool description with the arrow button on the top-left corner.
![CP_ManageTools](attachments/ManageTools_19.png)

repository: epam/cloud-pipeline

branch_name: refs/heads/develop

gha_language: Java

repo_name: epam/cloud-pipeline


text:
---
title: Beat Saber IPA
---

# ![Beat Saber IPA Reloaded](images/banner_dark.svg) [![Build status](https://ci.appveyor.com/api/projects/status/1ruhnnfeudrrd097?svg=true)](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb)

Beat Saber IPA - The mod injector tailored for Beat Saber

## How To Install

1. [Download a release](https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/releases)
2. Extract the contents into the game folder
3. Run **IPA.exe**
4. Start the game as usual

A console window should open before the game starts if the installation was successful.

To disable this console window, pass `--no-console` to the game.

## How To Uninstall

1. Drag & drop the game exe onto **IPA.exe** while holding <kbd>Alt</kbd>
    - Or run `ipa -rn` in a command window

## Arguments

`IPA.exe file-to-patch [arguments]`

- `--launch`: Launch the game after patching
- `--revert`: Revert changes made by IPA (= unpatch the game)
- `--nowait`: Never keep the console open
- See `-h` or `--help` for more options.

Unconsumed arguments will be passed on to the game in case of `--launch`.

## How To Develop

1. Create a new **Class Library** C# project (.NET 4.6)
2. Download a release and add **IPA.Loader.dll** to your references
3. Implement `IBeatSaberPlugin` or `IEnhancedBeatSaberPlugin`
4. Build the project and copy the DLL into the Plugins folder of the game.

See [Developing](https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/wiki/Developing) for more information.

## How To Keep The Game Patched

BSIPA will automatically repatch the game when it updates, as long as `winhttp.dll` is present in the install directory.

## Notes for running under Wine

For some reason, by default, Wine does not load DLLs in quite the same way that Windows does, causing issues with the injection.
To make the injection work with Wine, `winhttp` has to have a DLL override set to `native,builtin`. This can be set either through
Protontricks, or with the following `.reg` file.

```reg
REGEDIT4
[HKEY_CURRENT_USER\Software\Wine\DllOverrides]
"winhttp"="native,builtin"
```

For Steam there's a per-game Wine prefix under `compatdata`. In this case `SteamLibrary/steamapps/compatdata/620980/pfx/user.reg`.
Changes to this file will likely be ovewritten when the game updates or if local files are validated through Steam.

## Developing BSIPA itself

### Prerequisites

- Microsoft Visual Studio 2019 or later (2017 may work, no guarantees)
- Tools for C/C++ (MSVC) v141
- .NET 4.6.1 SDK and .NET 4.7.2 SDK

### Building

1. Clone with `git clone https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git --recursive`
2. Create a file, `bsinstalldir.txt` in the solution root. Do NOT create this in Visual Studio; VS adds a BOM at the begginning of the file that the tools used cannot read.
   It should contain the path to your Beat Saber installation, using forward slashes with a trailing slash. e.g.
   ```
   C:/Program Files (x86)/Steam/steamapps/common/Beat Saber/
   ```
3. Open `BSIPA.sln` in Visual Studio.
4. Choose the configuration `x64-Net4`
5. Rebuild all.

   When you make a change somewhere in BSIPA itself, right click on `BSIPA-Meta` and click `Build` or `Rebuild`. This sets up the output in `path/to/solution/BSIPA-Meta/bin/<Configuration>` to be what
   should be copied to the game directory.

   When making a change to the Mod List, you only need to build the mod list. Install by copying everything in `path/to/solution/BSIPA-ModList/bin/<Configuration>` to your game
   directory.

When building a Debug build, all referenced assemblies from Beat Saber will be copied from the install directory provided in `bsinstalldir.txt` into `Refs/`. Any new references
should reference the copy in there. When building for Release, it just uses the files already in `Refs/`

gha_language: C#


text:
Hot to use custom template?

First need to setup DocFx.
DocFX is an API documentation generator for .NET, which currently supports C#, VB and F#.
It generates API reference documentation from triple-slash comments in your source code.
DocFX builds a static HTML website from your source code and Markdown files,
which can be easily hosted on any web server (for example, github.io).
For more info can look: https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html

Our custom template generate static XML files, instead of HTML.

1. _docfx_temp - it is temp folder, for building template,
	can change that in docfx.json file:
	...
	"build": {
		"content": [
			{
				"src": "_docfx_temp/backend",
	...

2. _docfx_site - it is folder with static HTML(default template) or XML(our custom template),
	can change that in docfx.json file:
	...
	"dest": "_docfx_site",
	...

or both if we use default and custom template in json config file:
	...
	"template": [
		"default",
		"docfx_custom_template"
	],
	...

3. docfx.json - docFx config file, can change anything in config, for more info see:
   https://dotnet.github.io/docfx/tutorial/docfx.exe_user_manual.html

How to build custom template:

clean content in folders:
	rm -rf _docfx_temp
	rm -rf _docfx_site
	rm -rf obj

build default content for docfx folder:
	mono /usr/local/bin/docfx.exe build

build with custom template on Linux:
	mono /usr/local/bin/docfx.exe [-path to docfx json file-]/docfx.json build -t default,docfx_custom_template

build with custom template on Windows(use win cmd):
	cd C:\docfx\
	docfx C:\[-path to docfx json file-]\docfx.json build

serve default static html files, if using default template:
	mono /usr/local/bin/docfx.exe serve _docfx_site
where _docfx_site - folder from 2.

repository: opensquiggly/docfx-template

branch_name: refs/heads/main

repo_name: opensquiggly/docfx-template


text:
# Airport Database Management System

### _Entity Relationship Diagram_

![ER-Diagram](documentation/Airport_Management_System_ER.png)

Built using [Diagram Editor](https://www.diagrameditor.com/).

### Extended Entity Relationship (EER) Diagram

-   An EER Diagram would consist properties like Specialisation & Generalisation.
    -   Suppose, an employee in this system can be **_specialised_** into entities like:
        -   Administration
        -   Security
        -   Engineers
        -   Traffic Monitor
    -   And, different types of flights, like Airbus, Boeing can be **_generalised_** into one single entity _Flight_.

### _Steps to map (E)ER into a Relational Schema_

![Mapping-Algorithm](documentation/ER-to-relations-mapping-algortihm.jpg)

These steps are briefly described in [this PDF](<documentation/(E)ER-mapping-to-RelationalSchema.pdf>).

### _Relational Schema_

-   Mapping the above ER Diagram to a Relational Schema

![relational-schema](documentation/Relational_Schema.png)

Built using [draw.io](draw.io).


text:
# there
Run programs not here, but `there(1)`.

Managing `kubernetes` clusters can be a hassle. Between `kubectl(1)`,
`gcloud(1)`, loading configuration files, `terraform(1)`, `docker(1)`,
`helm(1)` it can be quite a chore to get a cluster running.
\
`there(1)` offers a coherent interface to interact with computers that are not
here, but `there(1)` on the `kubernetes` cluster. Hurray for cohesive
interfaces.

## Getting Started
```sh
$ there config   # configure your local helm instance
$ there init     # create a new helm repo
```

## Usage
```txt
there(1) - Manage remote computers

Commands
  config   Configure your local tool
  init     Create a new repository locally
  build    Build a new container and upload it to your registry
  status   Display the status of your remote computers
  deploy   Deploy a container from your registry to your computers

Flags
  -h, --help      Print this message
  -v, --version   Print version information

Examples
  $ there init
  $ there build service-gateway
  $ there status
  $ there deploy
```

## Directory layout
After running `$ there init` a local `there(1)` repository is created
containing the following files:
```txt
helm/         # helm charts
kubernetes/   # kubernetes manifests
terraform/    # terraform files
secrets/      # kubernetes secrets
README.md
```

## FAQ
### Why are you building this in Rust?
`rust` is fun, and I've got to learn it at some point soooo...

### Why are there shell scripts all over the place?
Well, I had a bunch of `shell` scripts already, so figured I might as well go
ahead and wrap them in `rust` until something more usable rolls out.

### Is this production ready?
No, and it might never be. Though I'll totally be using it for my own
infrastructure the moment I can get it to run. Swoosh.

## See Also
- https://github.com/yoshuawuyts/infra
- https://github.com/yoshuawuyts/knowledge/tree/master/bin/kubectl.md
- https://github.com/yoshuawuyts/knowledge/blob/master/bin/gcloud.md
- https://github.com/yoshuawuyts/knowledge/blob/master/bin/docker.md
- [pressly/sup](https://github.com/pressly/sup)
- [stamf/shocker](https://github.com/stamf/shocker)

## License
[MIT](https://tldrlegal.com/license/mit-license)

repository: yoshuawuyts/there

repo_name: yoshuawuyts/there


text:
Breakout Server
===

Breakout Server is a simple GUI application to create link between a serial
stream and a websocket stream. See the [Using Breakout Server](http://breakoutjs.com/guides/using-breakout-server/) guide for a detailed overview.

Source
---

The source is located in the [BreakoutServer repository](https://github.com/soundanalogous/BreakoutServer).

Quick Start
---

1. Make sure your Arduino (or compatible) is attached and the *BreakoutFirmata* sketch is uploaded (you'll find BreakoutFirmata in Breakout/firmware/).
2. Unzip and open the server folder for your platform and launch the application. Mountain Lion users may need to [temporarily disable Gatekeeper](https://answers.uchicago.edu/page.php?id=25481) to launch the app for the first time. Note: Linux users may need to run ```sudo apt-get install librxtx-java``` or manually install the librxtxSerial.so driver before launching the BreakoutServer.jar application.
3. Select the serial port for your board from the drop-down if it is not the current port displayed.
4. If your firewall is enabled, make sure port 8887 is open (or enter a new port that is open).
5. Click the Connect button. You should see the message "Server running on: [your server name]: 8887/" followed by "Connected to IOBoard on: [serial port name]".
6. Open [http://localhost:8887/examples/index.html](http://localhost:8887/examples/index.html) in your favorite browser and try the Getting Started examples. Note that if you changed the network port in step 4, you will need to update the 2nd parameter of the IOBoard constructor to the new port number.

*If the examples page does not open, click Disconnect then click on the Settings
tab and click on "Choose New Webserver Root" and navigate to and select the
Breakout folder.* and try to connect again.

repository: soundanalogous/Breakout

gha_language: JavaScript

repo_name: soundanalogous/Breakout


text:
---
title: "\n\t\t\t\tWe Buy Things We Don't Need With Money We Don't Have To Impress
  People We Don't Like\t\t"
date: 2012-08-21 20:16:00 Z
categories:
- jim
author<EMAIL_ADDRESS>comments: true
excerpt: "\n\t\t\t\t\t\t"
layout: post
link: https://jim.am/we-buy-things-we-dont-need-with-money-we-dont-have-to-impress-people-we-dont-like/
wordpress_id: 5227
---

Pretty freaky title, eh? This is  just a test of my odd little skillset with this article. The phrase above is what gets searched for on Google the most so far out of all the other stuff  I have written to date on this site.

This, my friends is called the long tail in the land of internet marketing  -  I’ll never rank for the word **husband** on Google. (I think I should rank for **number 1 husband**, but then hey, I am biased. ) But I will rank for this title once I hit the submit button.  I’m already getting searches for it, yet this topic has never appeared here before.

Imagine what would happen if I actually wrote about the above? So with that in mind:

<blockquote>If there's one thing  I have learned since being married is that you don't need a lot of stuff or to impress a whole lot of people. Ever wonder how you see those old guys with socks and sandals on the beach, or just checking the mail or doing yardwork in the front yard and you think - who dresses these guys? You see, they don't care or don't need to impress anybody. They are happy not spending money on stuff they don't need to impress strangers.
>
>

>
> This is one thing to say all this, but in practice - it's harder in real life. We want to  live in the  cool place, drive the cool car and wear the cool clothes. We want to fit in. Well, most of us - some of us are happy being the odd ball - just ask me how I know. Back to my point : I'd love to buy a new[ Hyundai Veloster](https://www.hyundaiusa.com/vehicles/2013/veloster/?), and one of the reasons is pure vanity  - it looks cool. Besides, I'm middle aged, and I'm due for something sporty. But, here's the thing: Despite that the air conditioning is gone, and BW seems to think that due to this fact we need to [buy a new car](http://jim.am/she-wants-to-buy-a-mazda-cx-5/) (we don't)  our  little car gets around town just fine.
>
>

>
> Eventually we'll have to buy a new car, but when we do we'll buy the car we want to fit our needs, one we can afford and one where we could care less what the neighbours think. Why? Because here's what happens when you buy a new car: You get one, maybe two nice comments about your new set of wheels when you park it in your driveway, but after that the only one left to impress is you. And the thing with new is that new becomes the new old, and within weeks you've got cheerios behind the seat cushions on the new car. You've become acclimatized to the new. The new, is  no longer the new new, but the new old. You're bored with the old new. But, you're making payments on it -  for another 72 months. Ouch
>
>

>
> But what if you stopped spending money you don't have on stuff you don't need to impress others?    I write articles just like this. I try to answer a question if  I can, because everybody’s always searching for something and me too - you’re never too  old to learn new things. Here’s a few questions I have in my head from just today:

  1.

How to keep your wife from losing her marbles?

  1.

How to replace a concrete front porch

  1.

How to get the dog to stop barking at the UPS guy

  1.

How to convince your wife you need a new lens for your camera

  1.

How to tell your wife she doesn’t need to buy more shoes

and on and on and on..

What happens, is that after a bit of time, all the articles I have written start to make me money. On one site I’ve written 440 articles and have made over ten thousand dollars this year to date. In my underwear - at five in the morning (apologies for the mental image). The math works out to about 36 dollars a year for every article I add to my site on average. Some, make me no money but others make me lots to make up for the ones that don’t. This works the same as the movies or the music industry - the hits pay for the duds, and then some - but until you make them, there’s no guarantee what will be what.

The solution? Write more.

## The $1000 challenge

What I love about what I do is that once you have data, you can make more money.  I know I will get some visitors here based on the title of this article alone.  I also know that if I’m making ten grand with 400 articles, I can make 30 grand with 1200, or thereabouts.  So, that’s what I intend to do - make 30k a year in brand new income. This won’t take me too long. I’m a third of the way done. I can’t say it will take me 90 days, or even 3 years, but eventually if you throw enough mud at the wall some will stick.

Why am I doing this? For one reason, and one reason only: **BW doesn’t believe I can, and she’s the only person I need to impress**. I can talk about  how I’m going to make more money, but until she actually sees the cash-ola she’s not going to believe me.   And right now I’m producing more of the latter and less of the former.  I intend to  change that, and a grand a month seems like a manageable goal to start with.

A grand a month works out to 33.00 a day or so, and assuming I make $3/month for each article, I need to write about 350 or so more and what better way to make myself accountable to this half baked idea than to write it down here? Assuming each one takes me an hour, there’s no reason why I should not be able write 5 a day x 5 days = 25 articles a week. Somedays I may write more, some less, and I could even cheat and outsource the work to India, but for this first thousand bucks I won’t - I’ll do the work myself. So 100 articles a month = 3.5 months = $1000 a month in new income by Christmas 2012  - that’s the goal. If I push myself I want to have 1000 articles written by year’s end published

The beauty of this is the more you write, the more questions you can answer. I never knew that somebody was searching for this, but I do now. Here’s a few other searches I rank for on Google with this site: (the numbers are how many times this site has come up in Goog;e’s search results). _God, I wish I knew the answer to the second question. _

[![Screen Shot 2012-08-21 at 7.58.53 PM](http://jim.am/images /2012/08/Screen-Shot-2012-08-21-at-7.58.53-PM.png)](http://jim.am/images /2012/08/Screen-Shot-2012-08-21-at-7.58.53-PM.png)

Pretty funky list eh?  If I wrote how to buy cheap weed,  how to feed the dog, how much is a  mazda CX-5, where can I see a dog  drinking beer. - one article on each, I’d get not only more visitors for those terms but those articles would produce even more terms and add to this list.  The idea list is pretty much nonstop. I have a spreadsheet with over 25,000 keywords to write about - that should keep me pretty busy. ?

That’s it. I need to make a $1000 a month by the holidays in new income. All because of a pretty smile. (and to prove to her that I can do this)

Also, when people ask us what we both do - We can both say ‘we’re writers’. Aren’t you impressed? ?

repository: ramseeker/sidey

extension: markdown

repo_name: ramseeker/sidey


text:
---
title: "updating"
bg: purple
color: white
fa-icon: cloud-upload
---

## Updating

So you've got a copy running and there's some new update? Let's update!

1. Checkout your github-pages branch
  - `git checkout gh-pages` for a standalone or existing page
  - `git checkout master` for a *username.github.io* page
2. run `git remote | grep -q "singlepage" || git remote add -t publish singlepage https://github.com/t413/SinglePaged.git` to be sure you have access to this repository (you can run this command at any time).
2. `git fetch singlepage` to fetch-in-place new changes.
3. Update to the new base (using merge)
    1. `git merge singlepage/publish`
4. You can alternatively update using rebase. This *rewrites history* (**bad**), but it is cleaner.
    1. `git rebase singlepage/publish`

branch_name: refs/heads/gh-pages

gha_language: CSS


text:
# Xeniaap
## One booking engine for everything

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)

## Tech

Xeniaap uses a number of open source projects to work properly:
- JavaScript ES7
- ReactJS
- Redux-toolkit
- Bable
- Eslint
- Material-UI

## Features

- List out all the rockets in a single page
- Search rockets by it's name
- Filter rockets by status, date and upcoming fields
- Click on cards more icon to see the details

## Live running app

```sh
https://xeniapp-dev.herokuapp.com/
```

## Clone repository

```sh
git clone https://github.com/kksarma/xeniapp.git
```

## Installation

Install the dependencies and devDependencies and start the server.

```sh
cd xeniapp
yarn
yarn start
```

For production environments...

```sh
yarn --production
NODE_ENV=production yarn start
```

Linting the codebase...

```sh
yarn lint
yarn lint:fix
```

## License

MIT

repository: kksarma/xeniapp

repo_name: kksarma/xeniapp


text:
# slap-bot

## Resources

### Slack Bots

### Circuit Playground Express

- Circuit Playground Express Firmata / Examples: <https://github.com/adafruit/CircuitPlaygroundFirmata/>

### Tones

- Zelda Chest Tone for Arduino: <https://github.com/witnessmenow/attiny85-zelda-chest> (originally from <https://gist.github.com/ianklatzco/9127560>)
- Zelda Song Player for Arduino: <https://github.com/mitomon/MitosArduinoScripts/tree/master/zeldaSongPlayer>


text:
# Simple Isomorphic Counter

This is a an overly complicated but simple application to show yet another option to build Isomorphic/Universal JavaScript applications.

##Build & Run

´npm run build && npm run styles && npm start´

repository: MarcCloud/isomorphic-counter

repo_name: MarcCloud/isomorphic-counter


text:
# Phalaris tuberosa var. hirtiglumis VARIETY

#### Status
SYNONYM

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

#### Published in
J. A. Battandier & L. C. Trabut, Fl. Algérie 1(2):140. 1895

#### Original name
null

### Remarks
null

repository: mdoering/backbone

path: /life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Phalaris/Phalaris aquatica/ Syn. Phalaris tuberosa hirtiglumis/README.md

repo_name: mdoering/backbone


text:
## Notes

Watch the live video of this conversation on [Rokfin](https://rokfin.com/stream/6184/Episode-98--Mike-Maharrey-and-the-City-of-Gold).

Mike's Twitter: [https://twitter.com/mmaharrey10th](https://twitter.com/mmaharrey10th)

Grab a copy of the Constitution's Owner's Manual: [https://amzn.to/3gdVcUR](https://amzn.to/3gdVcUR)

Mike's Website: [https://www.michaelmaharrey.com/](https://www.michaelmaharrey.com/)

Listen to GodArchy: [https://www.godarchy.org/](https://www.godarchy.org/)

See the work they are doing at the Tenth Amendment Center: [https://tenthamendmentcenter.com/](https://tenthamendmentcenter.com/)

Have you checked out out Opsec Drip yet? No? Do it now here: [youtube.com/channel/UCY6-KklshhvF4GOrkHPQRmQ](https://www.youtube.com/channel/UCY6-KklshhvF4GOrkHPQRmQ)

Buy yourself some Lorenzotti Italian coffee at [lorenzotti.coffee](https://www.lorenzotti.coffee/) and don't forget to grab a tin and try it out for 10% off with our special promo code THEMADONES.

Buy one of our spiffy shirts, pop sockets, or throw pillows over at [wearethemadones.com/store](https://wearethemadones.com/store)

If I forgot to link something here that I said I would, shoot me a tweet and I'll send it to you.
Find us on:

[Rokfin](https://rokfin.com/TheMadOnes), [Patreon](https://patreon.com/TheMadOnes), [Facebook](https://www.facebook.com/WeAreTheMad/), [Cam's Twitter](https://twitter.com/CamHarless), [Jessica's Twitter](https://twitter.com/soupcanarchist), and our [website](http://wearethemad.com).

Find all of our original shows at [The MLGA Network](https://mlganetwork.com).

gha_language: SCSS


text:
[![Build Status](https://travis-ci.org/Harrisandwich/dndint-server.svg?branch=master)](https://travis-ci.org/Harrisandwich/dndint-server)

To interact with the server, you'll need the [client app](https://github.com/Harrisandwich/dndint-client)

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

```sh
# Clone the repo
git clone https://github.com/Harrisandwich/dndint-server.git
cd dndint-server

# Install dependencies
npm install

# Start development live-reload server
npm run dev

# Start production server:
npm start
```

License
-------

MIT

repository: Harrisandwich/dndint-server

repo_name: Harrisandwich/dndint-server


text:
Items in PointShop are very configurable and provide numerous ways of creating something unique. Below are listed the properties and functions available in items. Some are required, whilst others are optional.

Properties

Functions

Hooks

###Creating New Items

Creating new items is as simple as making a new lua file inside one of the category folders inside the `pointshop/items` folder. The new file should then be populated with Item [Properties](/items/properties) and [Functions](/items/functions).

 Filenames for items must be lowercase and contain no spaces or non-alphanumeric characters. Items with filenames containing uppercase characters or spaces will not work properly.

###Clientside Models

PointShop has a built in system for showing models attached to players and does this by default if both an `ITEM.Model` and an `ITEM.Attachment` or `ITEM.Bone` are specified.

repository: Gengars/pointshop-documentation

repo_name: Gengars/pointshop-documentation


text:
Deployed through Heroku, this full-stack note-taking application allows users to create, save, and delete notes on the web.

 # Installation
open [this page](https://note-taker-demo1.herokuapp.com/notes)to access the application, The application can also be installed to your local machine by cloning the repo and running the command "node server.js" in your terminal and create your own notes.

Usage

![screencapture-note-taker-demo1-herokuapp-notes-2021-05-16-23_05_46](https://user-images.githubusercontent.com/79482141/118427615-a4713200-b69b-11eb-87bc-9659fa59c914.png)

![screencapture-note-taker-demo1-herokuapp-2021-05-16-23_04_07](https://user-images.githubusercontent.com/79482141/118427577-94595280-b69b-11eb-8f45-a0b4350200ee.png)

# Credits
 [uniqid from npm Libraries](https://www.npmjs.com/package/uniquid)
 [Express.js](https://expressjs.com/)
 [Heroku](https://devcenter.heroku.com/)
 [W3schools](https://www.w3schools.com/)

## License
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


text:
# jupyterlab_xkcd

Show a random xkcd.com comic in a JupyterLab panel

![Screenshot of the extension in JupyterLab](screenshot.png)

## Why?

This project is reference material for the *Let's Make an xkcd JupyterLab Extension*
tutorial currently proposed in [jupyterlab/jupyterlab#2921](https://github.com/jupyterlab/jupyterlab/pull/2921/).

## Prerequisites

* JupyterLab

## Installation

```bash
jupyter labextension install @jupyterlab/xkcd-extension
```

## Development

For a development install (requires npm version 4 or later), do the following in the repository directory:

```bash
npm install
jupyter labextension link .
```

To rebuild the package and the JupyterLab app:

```bash
npm run build
jupyter lab build
```


text:
---
layout: post
title:      "JS Hoisting and Scope"
date:       2019-06-04 01:06:32 -0400
permalink:  js_hoisting_and_scope
---

Hoisting can be accomplished with both a variable and a function.  There are a couple of nuances with variable hoisting that can be tricky.

**Function hoisting:**

Function hoisting will hoist the function name and the definition to the top of the scope.

For example:

```
hoistedFunction();

function hoistedFunction() {
console.log("I'm getting hoisted");
}
```

The console is able to log the message from the function since the function definition is also hoisted to the top, allowing the function to not only be referenced but actually invoked.

BUT function hoisting is only possible with function *definitions* and not function *expressions*.

For example:

```
imHoisted();

notHoisted();

function imHoisted() {
console.log("Hoisting")
}

var notHoisted = () => console.log("Not hoisting");
```

This console should log the first functions message while returning `TypeError: undefined is not a function`, due to the fact that the declaration gets hoisted but not the actual function definition.

**Variable hoisting:**

Variable hoisting is only possible with the `var` variable keyword.

Only the variable declaration will get hoisted to the top of the current scope, not the variable initialization.

For example:

```
console.log(x)
var x = "not initialized"
```

This example will return `undefined` rather than `Uncaught ReferenceError: x is not defined`, due to the fact that the `var x` variable declaration was able to be hoisted, however the `= "not initialized"` initialization was not.

The following example will show a variable being hoisted.

```
x = "I'll be initialized after the declaration";
console.log(x);
var x;
```

The console is able to log the value of `x` due to the fact that the initialization takes place after the variable declaration is hoised to the top.  This variable hoisting can lead to potential issues when declaring a variable in the global scope and then redeclaring within a local block scope, which leads to the next section on Scope.

**Scope:**

Variables can be declared and assigned within the global scope and the local block scope.

Variables declared globally are accessible throughout the whole script, in and out of functions.

For example:

```
const globalVariable = "I'm global";

globalVariable;

function messageLog() {
console.log(globalVariable);
}
```

The `globalVariable` line is able to return the value of the variable and the function is also able to log the value of the variable from within the function.

Next, I'll show an example of variables declared within functions and their accessibility:

```
function globalVariable() {
var imGlobal = "Accessible";
}

function nonGlobal() {
let notGlobal = "Not accessible";
}

window.imGlobal;

window.notGlobal;
```

The call to `window.imGlobal` will return the value of the variable that was declared within the function due to `var` having a global scope, while the call to `window.notGlobal` will return `undefined` since the variable declaration is only accessible from within that block scope.

Similarly, while working within a function there will be different capabilities of the variables.

For example:

```
let x = "first value"

function scopingTest() {
let x = "second value"
console.log(x);
}
console.log(x)

var y = "first y value"

function scopeTest() {
var y = "Second y value"
console.log(y);
}
console.log(y);
```

The first console log will display the value for `x` as it was assigned within the block of the function, whereas the second console.log will display the `x` value as it was assigned outside of the function scope.  It is the same variable being declared with `let` however, since the `let` declarations within the function only have block scope, it treats `x` as a completely new variable, so it does not affect the `x` that was assigned outside of the function.

Now, the second set of console logs will both return the same value for y `Second y value`, due to the scope of the `var` variable declaration.

There is also a difference between function declarations.

`var` and `let` can be declared without being initialized

```
var x;
let y;
```

However, `const` requires an initialization upon declaration.

Another restriction of `const` is that once it is declared it cannot be re-declared, unlike `var` and `let`.

But, one difference with `var` and `let` re-declarations is that `var` can be re-declared regardless of scope, while `let` can only be re-declared froma  different scope.


text:
---
date: 2014-10-14
speaker: "Mr. Divakaran D."
title: "Compactness theorem for the spaces of distance measure spaces and Riemann surface laminations."
time: "11.00 a.m. - 12.00 noon"
venue: "Lecture Hall I, Department of Mathematics"
series: Thesis
series-prefix: PhD
series-suffix: defence
---
Gromov’s compactness theorem for metric spaces, a compactness theorem for the
space of compact metric spaces equipped with the Gromov-Hausdorff distance, is
a landmark theorem with many applications. We give a generalisation of this
result - more precisely, we prove a compactness theorem for the space of
distance measure spaces equipped with the generalised
Gromov-Hausdorff-Levi-Prokhorov distance. A distance measure space is a triple
`$(X, d, μ)$`, where $(X, d)$ forms a distance space (a generalisation of a metric
space where, we allow the distance between two points to be infinity) and μ is
a finite Borel measure.

Using this result, we prove that the Deligne-Mumford compactifiaction is the
completion of the moduli space of Riemann surfaces under generalised
Gromov-Hausdorff-Levi-Prokhorov distance. The Deligne-Mumford compactification,
a compactification of the moduli space of Riemann surfaces with explicit
description of the limit points, and the closely related Gromov's compactness
theorem for pseudo-holomorphic curves in symplectic manifolds (in particular
curves in an algebraic variety) are important results for many areas of
mathematics.

While Gromov's compactness theorem for pseudo-holomorphic curves is an
important tool in symplectic topology, its applicability is limited due to the
non-existence of a general method to construct pseudo-holomorphic curves.
Considering a more general class of domains (in place of Riemann surfaces) is
likely to be useful. Riemann surface laminations are a natural generalisation
of Riemann surfaces. Theorems such as the uniformisation theorem for surface
laminations due to Alberto Candel (which is a partial generalisation of the
uniformisation theorem for surfaces), generalisations of the Gauss-Bonnet
theorem proved for some special cases, and the topological classification of
“almost all" leaves using harmonic measures reinforces the usefulness of this
line on enquiry. Also, the success of essential laminations,as generalised
incompressible surfaces, in the study of 3-manifolds suggests that a similar
approach may be useful in symplectic topology. With this motivation we prove a
compactness theorem analogous to the Deligne-Mumford compactification for the
space of Riemann surface laminations.

repository: siddhartha-gadgil/DeptWeb

gha_language: HTML

repo_name: siddhartha-gadgil/DeptWeb


text:
# Connect IoT devices to the Open Platform

This document walks through :

1. Provisioning a device to Open Platform
1. Visualizing data from devices

## Requirements

- A PC with web browser
- Optional : A device to connect to Open Platform solution
    - If you do not have any of following devices, you may use Raspberry Pi Web Simulator
    - Raspberry Pi
    - Seeed WIO Terminal
    - A PC with Linux

## Provisioning a device to Open Platform

In order to consume (e.g. visualize) data from a device, the device must be provisioned.  Provisioning device means :

1. Creating device identity in IoT Hub
1. Prepare a device
1. Authenticating the device
1. Establishing a connection

### 1 : Creating a device identity in IoT Hub

A device must be known to the solution.  Creating a device identity means registering a device entity in IoT Hub.
In this instruction, we will use Raspberry Pi Azure IoT Online Simulator.

1. Browse to Open Platform Web Dashboard with your browser
1. Click **Device Management** in the Navigation Menu
1. Click **Device Management** tab
1. Click **Add a device**
1. Give a name for the new device
    e.g. PiSimulator1
1. Click **+Create**

Once a new device is successfuly created, it should be added to the dropdown device list

![IOTHUB 05](media/IOTHUB-05.png)

### 2. Preparing a device

Each device firmware/device app has their own way of programming authentication information.  For this demo, we will use [Raspberry Pi Azure IoT Online Simulator](https://azure-samples.github.io/raspberry-pi-web-simulator/).

1. Browse to **Raspberry Pi Azure IoT Online Simulator** with your browser

    Click **Raspberry Pi Simulator** in the Navigation Menu

1. Select the new device you created above, if not selected
1. Click **Advanced (for Device Developers)**

    You should see fields are filled.

1. Click green button next to **Primary Connection String**

    This will copy the connection string in clipboard.

![IOTHUB 06](media/IOTHUB-06.png)

### 3. Connecting a device

1. Switch to **Raspberry Pi Azure IoT Online Simulator**

    Replace `[Your IoT hub device connection string]` with the connection string

    > [!IMPORTANT]
    > Ensure the connection string is inside single quotes `` ` `` `` ` ``
    >
    > Correct
    > const connectionString = `` ` ``HostName=P15-IoTHub-jq.......`` ` ``;
    >
    > Incorrect
    > const connectionString = HostName=P15-IoTHub-jqs.......;

    Example :

    ![IOTHUB 07](media/IOTHUB-07.png)

1. Click `Run` button to connect and start sending simulated telemetry to Open Platform.

    In the bottom right pane, you should see log saying the simulator is connected and sending telemetry.

    ![IOTHUB 08](media/IOTHUB-08.png)

1. Switch to Open Platform portal

    Confirm telemetry and events are pushed to the portal.

    > [!NOTE]
    > Make sure you click **Stop** in Raspberry Pi Simulator or close browser when you are finished.

    ![IOTHUB 09](media/IOTHUB-09.png)

## Next Step

- Developers : Learn more technical details of the Open Platform Open Platform Developer Guide : [Architecture Overview](../Developer-Guide/Architecture-Overview.md)

[Project 15 from Microsoft - Open Platform](../README.md)


text:
# Tree Column Type #

Provided by ``DataGrid\Extension\Gedmo\GedmoDoctrineExtension``

## Available Options ##

* ``em`` - string
* ``label`` - string, by default ``[$field->getName()]``
* ``field_mapping`` - **required**, array, by default ``[$field->getName()]``
* ``value_glue`` - string
* ``display_order`` - integer
* ``editable`` - **required**, boolean, by default ``false``
* ``empty_value`` - string|array, by default ``""`` (empty string)
* ``form_options`` - array, by default ``[]``
* ``form_type`` - array, by default ``[]``

## Options Description ##

**em** Name of entity manager, if null column takes default one.

**label** By default label value its taken from name under what column was registered in grid.

**field_mapping** Fields that should be used when data is retrieved from the source. By default there is only one
field and its taken from the name under what column was registered in grid.
Option is useful when you need to implode few fields from object in one column.

**value_glue** Useful only when you need to implode data from few source object fields into one column.

**value_format** Useful when you need to format value before passing it to view. Value formatted with php ``sprintf`` function. There should be at least same count of ``mapping_fields`` option
values as placeholders count in format string. This option can be used with ``value_glue`` option.
``format`` option also accept ``\Closure`` function that should return valid formatted string.

**display_order** Optional integer value specifying order of column in grid. Columns in grid are sorted according
  to ascending value of this option. Columns without this option will stay in their natural order (between columns with
  positive and negative values of this option)

**editable** If enabled SymfonyForm object is automatically created and passed into view as attribute and you can easily use it to display quick edit.

**form_options** Array of options for forms, where key is name of field (one of field_mapping) and value is
options passed to form.

**form_type** Array of types for forms, where key is name of field (one of field_mapping) and value is form type.

## Example Usage ##

``` php
<?php

$dataGrid->addColumn('item', 'gedmo_tree', [
    'label' => 'Item',
    'editable' => true,
]);

```

Difference between ``tree`` and ``text`` column is that cellView of ``tree`` column type has few additional
attributes.
List of attributes and example of usage below:

**Attributes**
* **id** - element id
* **parent** - (optional) parent id
* **root** - (optional) root id of element
* **left** - element left position
* **right** - element right position
* **level** - element nesting level
* **children** - element children count

**Usage** (in Twig)

```
{# datagrid_column_type_{column_type}_cell #}
{% block datagrid_column_type_gedmo_tree_cell %}
    <td>
        <div>
            {% spaceless %}
            <div
                {% if cell.getAttribute('parent') is not null %} data-parent="{{ cell.getAttribute('parent') }}"{% endif %}
                {% if cell.getAttribute('root') is not null %} data-root="{{ cell.getAttribute('root') }}"{% endif %}
                {% if cell.getAttribute('level') is not null %} data-level="{{ cell.getAttribute('level') }}" class="tree-level-{{ cell.getAttribute('level') }}"{% endif %}
                data-children="{{ cell.getAttribute('children') }}"
            >
            {% endspaceless %}
            {{ cell.value|raw }}
            </div>
            {{ datagrid_column_cell_form_widget(cell) }}
        </div>
    </td>
{% endblock %}
```

repository: open-source-contributions/datagrid

repo_name: open-source-contributions/datagrid


text:
### [CVE-2019-5068](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5068)
![](https://img.shields.io/static/v1?label=Product&message=Mesa%203D%20X11%20Graphics%20library&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-277%3A%20Insecure%20Inherited%20Permissions&color=brighgreen)

### Description

An exploitable shared memory permissions vulnerability exists in the functionality of X11 Mesa 3D Graphics Library 19.1.2. An attacker can access the shared memory without any specific permissions to trigger this vulnerability.

### POC

#### Reference
- https://talosintelligence.com/vulnerability_reports/TALOS-2019-0857

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
Where it is clear the below content has not read, the issue is likely to be closed with "please read the template". Please don't take offense at this. It is simply a time management decision. When someone raises an issue, without reading the template, then often too much time is spent going back and forth to obtain information that is outlined below.

#### Guidance

If you are uncertain if the PR will be accepted, outline the proposal in an issue to confirm it is viable.

Even if the feature is a good idea and viable, it may not be accepted since the ongoing effort in maintaining the feature may outweigh the benefit it delivers.

#### Description

A description of what the PR achieves.

#### The solution

Outline the implementation. Also include any alternative solutions considered.

#### Todos

 * [ ] Related issues
 * [ ] Tests
 * [ ] Documentation

repository: ValdisThomann/EfResultsFilter

repo_name: ValdisThomann/EfResultsFilter


text:
a_string.capsize
puts a_string

sleep 3

puts a_string.capsize

sleep 1

another_string.capsize!
puts another_string
```

## WHY?!

Once, I forgot the word for 'capitalize' and said 'capsize' instead, but it's ok now because it's a method... Alias.

I will go down with this ship.

repository: olethalai/CAPSIZE

repo_name: olethalai/CAPSIZE


text:
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.3.1](https://github.com/maidsafe/secured_linked_list/compare/v0.3.0...v0.3.1) (2021-07-29)

### Features

* add self_verify API which checks every key in the chain is proven (signed) by its parent key ([9f14e7b](https://github.com/maidsafe/secured_linked_list/commit/9f14e7bccf8bbd24c3190dc019671a3fa0c6bf38))

## [0.3.0](https://github.com/maidsafe/secured_linked_list/compare/v0.2.0...v0.3.0) (2021-06-30)

### ⚠ BREAKING CHANGES

* **blsttc:** this enables blsttc to run on older cpu architectures

### Features

* **blsttc:** update blsttc ([f8d167c](https://github.com/maidsafe/secured_linked_list/commit/f8d167c7bd7568ec627beb6110173311f93fb028))

## [0.2.0](https://github.com/maidsafe/secured_linked_list/compare/v0.1.3...v0.2.0) (2021-06-29)

### ⚠ BREAKING CHANGES

* updates to use blsstc

### Features

* introducing blsstc ([731cbe4](https://github.com/maidsafe/secured_linked_list/commit/731cbe4a7ffea73fc07bbea0b8786732c7c50ccb))

### [0.1.3](https://github.com/maidsafe/secured_linked_list/compare/v0.1.2...v0.1.3) (2021-06-28)

### Bug Fixes

* use blsttc instead of threshold_crypto ([38e2307](https://github.com/maidsafe/secured_linked_list/commit/38e23074359c1eb7514d91d86eaa7ad8a6dd819f))

### [0.1.2](https://github.com/maidsafe/secured_linked_list/compare/v0.1.1...v0.1.2) (2021-06-15)

### [0.1.1](https://github.com/maidsafe/secured_linked_list/compare/v0.1.0...v0.1.1) (2021-05-26)

## [0.1.0](https://github.com/maidsafe/secured_linked_list/compare/v0.1.0...v0.1.0) (2021-05-25)

* Initial commit.


text:
---
layout: post
title:  Project moved to GitHub
date:   2018-05-18 09:55:00 +0100
categories: generic
---

As SourceForge seems to die slowly and has proven very unreliable early this
year, I've decided to move the entire project to GitHub.

The source code, the issue tracker, the wiki, and the homepage are now hosted
on GitHub. Only downloads for older releases remain on SourceForge.

And yes, this is a clear sign that I picked up the game again and decided to
continue working on it. I plan on releasing an update which will focus on bug
fixes and balancing in the near future (lesson learned in the past: precise
dates and release announcements should not appear in the same sentence).

After that release I'll continue working on unfinished features, e.g. the
*summon daemon* spell.


text:
## Wilsons
Implementation of Wilson's maze algorithm from the book
"Mazes for Programmers".  Performs a random walk through the grid.  It
watches for loops that occur during the walk and removes them from the
path that may be generated.  Note that the path is not carved from the
grid initially.  It will keep forming a possible path until it hits a
previously visited cell.   When the loop terminates the path that was
built represents a unique path from the random start to the previously
visited node (with no loops).  This path is carved into the grid.
After a path is carved a new random start location is selected from
locations that have not been visited and the process continues until
there are no more unvisited cells.

#### Examples:

```javascript
import {AlgorithmType, Maze} from 'trailz';

const maze = new Maze(10, 10, AlgorithmType.Wilsons);
console.log(maze.string);
```

repository: jmquigley/trailz

gha_language: TypeScript

repo_name: jmquigley/trailz