text:
![FarCry Solr Pro](http://jeffcoughlin.github.io/farcrysolrpro/assets/images/logo-farcrySolrPro-admin.png "FarCry Solr Pro")

# FarCry Solr Pro Plugin

The FarCry Solr Pro plugin lets you use the power of Lucene (through Solr) to index and search your site.  It goes above and beyond ColdFusion's native implementation of Solr.

FarCry Solr Pro was designed with FarCry's framework in mind.  It matches each record with its unique record ID and grants you the power to make your searches more relevant with things like field boosting, search term elevation, and more.

![FarCry Solr Pro Webtop](http://jeffcoughlin.github.io/farcrysolrpro/assets/images/searchExample.png "FarCry Solr Pro Webtop")

## Details and Installation

For more details and installation information, see the [documentation pages](http://jeffcoughlin.github.io/farcrysolrpro "FarCry Solr Pro").

## Authors

Jeff Coughlin [http://jeffcoughlin.com](http://jeffcoughlin.com), Sean Coyne [http://www.n42designs.com](http://www.n42designs.com)

## Features
* **Boosting**
    * **by field:** You can give certain fields more weight than others.
    * **by document:** You can give certain documents more weight than others (ie. Main landing pages). No re-index required.
* **Elevation**
    * To raise certain items to the top of the result list based on a certain query
        * *Example:* Every time someone searches for the search term "Round Widgets" you can tell Solr to return the following [n] documents of choice in order (n = the specific documents you've chosen). These documents will appear in order at the top of the results, then be followed with the remaining results from a standard Solr search.
    * You can also choose to "exclude" specific documents from results based on specific search strings.
    * This setting is instant. No re-index is required.
* **Spellcheck**
    * Relevant suggestions
    * Phonetic search
        * Even if you spell the word completely wrong Solr will know and do a search with the correct spelling.
        * *Example:* Search for the word "phlowur" and solr will know to search for the real word "flower". It's smarter than using a dictionary. Instead, it uses the existing content *already* in your index to work from.
            * Note: This example will only work, of course, if you actually have the word "flower" indexed in your content somewhere.
* **Performance enhancements**
    * Many times faster than the previous FarCry Solr plugin which uses ColdFusion's cfsearch/cfindex tags under the hood. The FarCry Solr Pro plugin talks directly to Solr and takes advantage of many overlooked features by ColdFusion.
    * Complete data field indexing
        * Because we are now able to store custom fields, we don't have to do complicated content lookups on each item in the search results. All the data you now see in the search results (title, teaser, last updated date, content type, etc) can all stored in Solr (provided you use the plugin correctly). This feature alone makes searches much faster.
* **Index on-save**
    * No more having to wait for nightly indexes to see your content in search results. The second you save a published document it is instantly available to site searches.
* **Rule content indexing**
    * Now, static content in rules can be related directly to the parent page.
        * *Example:* If you have a rule called "textarea" where you decided to have more content to appear in the right pane, you can now index that data and have it related to the page it lives on. So when someone searches for a string that matches that rule in the right pane, it will return the parent page in the search results.
    * Note: Currently we are only indexing text/string fields in the rules (not arrays, etc).
* **Search result highlighting**
    * Now search result summary/teasers have the ability to highlight search terms in your search results exactly where they were found.
    * Plus, if the term(s) were found in multiple spots, we show them together in the same search result summary/teaser separated by ellipses.
* **File Indexing**
    * File format parsing is automatically handled by the plugin using a content analysis toolkit called Tika.  Not only will it the parse text of documents, but it will also get metadata from documents like author and company.
    * The parser doesn't just handle PDFs and Word docs.  Below is a list of many of the formats that Tika supports for metadata extraction:
        * HyperText Markup Language (HTML)
        * XML and derived formats
        * Microsoft Office document formats
        * OpenDocument Format
        * Portable Document Format (PDF)
        * Electronic Publication Format (Epub)
        * Rich Text Format (RTF)
        * Compression and packaging formats (zip, gzip, tar, etc)
        * Text formats
        * Audio formats (MP3, etc)
        * Image formats (simple metadata from images)
        * Video formats (FLV parser)
        * Java class files and archives
        * The mbox format (extracting email messages from mailbox formats)
    * For more details on what formats Tika supports, see Tika's Supported Document Formats page.
* **Document size**
    * Optionally return the document size with each result.
        * You can choose which fields total up the size (options are text-based fields, files, and images).
            * For content pages, it is suggested to select only those fields relevant to the landing/target page itself (ie. A title and body field are likely relevant to the landing page where a teaser field is not).
            * Any file or image fields selected will get the file size of each referenced item.  Although there are plenty of uses for this option, it is likely most useful in cases where the record itself that you're indexing refers to a file (like a PDF).
* **Custom search forms**
    * Having a general site search is great, but what about another search form on the site that searches something like products? Because we can index and store as many fields as we like now, we can also search by those fields just like you would any other database. So, if you have a product search page and you wanted your visitors to search by 15 different filter options, you can now create a custom search form and use Solr to search all of those fields. The end result: A fast user experience even on some of the most complicated search requests.
* **Filters**
    * **Synonyms:** Matches strings of tokens and replaces them with other strings of tokens.
        * *Example1:* matching similar terms for ipod, i-pod, i pod => ipod
        * *Example2:* heart attack => myocardial infarction
            * So, if someone searches for the term "heart attack", the results will also include any documents with the text "myocardial infarction".
    * **Stop Words:** These are words that Solr will ignore when searching. Some default English examples are "and, or, the" because they are words that are commonly used and can affect search result scoring.
    * **Protected Words:** A list of words that should be protected and passed through unchanged. This protects the words from being "stemmed" (reducing two unrelated words to the same base word).
        * *Example:* Solr is smart enough to know that when someone searches for the word "nursing" to also search for the word "nurse".  This is called stemming.  However, perhaps you don't want it to stem the word "nursing".  You can use this setting to protect the word "nursing" from ever being stemmed by the search engine so that if the word "nursing" would only be found if someone searched for it specifically.
    * **Spellings (dictionary):** By default, this never needs to be changed.  We've implemented Solr's automatic spell checker, which uses the data already in the index to spell check against.  However, if you wanted to override this, you could use the settings in Solr to create a custom dictionary.
* **Reports & Stats**
    * **Search log:** Shows what people are searching for, how many results they received, and the suggestion they were given (if relevant).
    * **Searches without results:** Shows what people were searching for when they received no results.  This is helpful to see if people are searching for things on your site that do exist, but for some reason they're not finding what they want (maybe they are searching for terms that don't exist on your site, but refer to the same content).  Using things like "synonyms" can help here, as well as adding the actual terms to your content itself.

## Minimum Requirements

* ColdFusion 10
* FarCry 7.4
* Solr 3.5
    * Solr 3.5 is optionally included in this plugin.
    * To date, we have only tested this on Solr 3.5

repository: seancoyne/farcrysolrpro

repo_name: seancoyne/farcrysolrpro


text:
---
layout: post
title: "Screensharing with WebRTC"
description: ""
article:
  written_on: 2012-12-24
  updated_on: 2012-12-24
authors:
  - dutton
tags:
  - chrome APIs
  - getusermedia
  - Chrome extensions
  - screenshare
  - webrtc
permalink: /2012/12/Screensharing-with-WebRTC
---

As we reported last week, there's been a lot happening lately with our old friend WebRTC.

Well... here's another first: WebRTC screensharing.

Here's a screencast: youtube.com/watch?v=tD0QtBUZsF4

...and here's the code: github.com/samdutton/rtcshare

In essence, we've built an experimental Chrome extension that uses RTCPeerConnection and chrome.tabCapture to share a live 'video' of a browser tab. If you want to try it out, you'll need Chrome Canary, and you'll need to enable Experimental Extension APIs on the about:flags page.

Our prototype relies heavily on the mighty apprtc.appspot.com demo and, to be frank, it's a bit of a hack! But... it's a proof of concept, and it works.

Here's how we did it:

When the user clicks the extension icon (the 'record button' next to the address bar), the extension's background script background.js, appends an iframe to itself, the src of which is rtcshare.appspot.com. In background.js it's only used to get values such as token and room_key. We told you this was a hack :^}! This is a chopped and channeled version of apprtc.appspot.com. As with the apprtc example, rtcshare.appspot.com is also used for the remote client.

{% highlight javascript %}
chrome.browserAction.onClicked.addListener(function(tab) {
	var currentMode = localStorage["capturing"];
	var newMode = currentMode === "on" ? "off" : "on";

	if (newMode === "on"){ // start capture
		appendIframe();
	} else { // stop capture
		chrome.tabs.getSelected(null, function(tab){
			localStream.stop();
			onRemoteHangup();
		});
		// set icon, localStorage, etc.
	}
}
{% endhighlight %}

When the iframe has loaded, background.js gets values from it (generated by the rtcshare.appspot.com app) and calls chrome.tabCapture.capture() to start capturing a live stream of the current tab.

{% highlight javascript %}
function appendIframe(){
	iframe = document.createElement("iframe");
	iframe.src="https://rtcshare.appspot.com";
	document.body.appendChild(iframe);
	iframe.onload = function(){
		iframe.contentWindow.postMessage("sendConfig", "*");
	};
}

// serialised config object messaged by iframe when it loads

window.addEventListener("message", function(event) {
	if (event.origin !== "https://rtcshare.appspot.com"){
		return;
	}
 	var config = JSON.parse(event.data);
	room_link = config.room_link; // the remote peer URL
	token = config.token; // for messaging via Channel API
	// more parameter set from config
);

function startCapture(){
	chrome.tabs.getSelected(null, function(tab) {
		var selectedTabId = tab.id;
		chrome.tabCapture.capture({audio:true, video:true}, handleCapture); // bingo!
	});
}
{% endhighlight %}

Once the live stream is available (in other words, a live 'video' of the current tab), background.js kicks off the peer connection process, and signalling is done via rtcshare.appspot.com using XHR and Google's Channel API. All in all, it works like the apprtc demo, except that the video stream communicated to the remote peer is from chrome.tabCapture and not getUserMedia().

{% highlight javascript %}
function handleCapture(stream){
	localStream = stream; // used by RTCPeerConnection addStream();
	initialize(); // start signalling and peer connection process
}
{% endhighlight %}

For demo purposes, this prototype extension opens a new tab with the URL provided by rtcshare.appspot.com, which has a 'room number' query string added. Of course, this URL could be opened on another computer, in another place, and THAT might be the start of something useful!

{% highlight javascript %}
chrome.tabs.create({url: room_link});
{% endhighlight %}

We envisage a lot of interesting use cases for screensharing and, even at this early stage of development, we're impressed at how responsive and stable plugin-free tab capture and sharing can be.

As ever, we welcome your comments: about this extension and about the WebRTC APIs in general. If you want to learn more about WebRTC, check out the HTML5 Rocks article or our Quick Start Guide.

Happy hacking -- and best wishes for 2013 from everyone at HTML5R and WebRTC!

branch_name: refs/heads/development

extension: md

gha_language: CSS

license_type: permissive


text:
---
layout: post
title: How I am handling the great lockdown
subtitle: Or, how to learn cool stuff, eat healthy, and have fun during troubled times.
tags: [musings]
---

The Covid-19 pandemic has put the enitre world in a state of lockdown. We are
no longer able to do a lot of things that we used to take for granted. Simple
pleasures such as, catching a movie, having dinner with loved ones in your
favorite restaurant, riding the metro, and even going for a stroll around the
block is no longer possible.

If the latest [IMF projections](https://www.imf.org/en/Publications/WEO/Issues/2020/04/14/weo-april-2020)
are any indication, a real recovery would take years. If the economic experts
are to be believed, we come to the harsh conclusion that we are in it for the
long haul. Once we get over the initial shock, there is more doom, and gloom
on the way with companies set to reduce workforce, and freeze hiring.
Unemployed folks are going to find it extra difficult to find a new job, and
the ones that are already working will have hold on to their dear jobs. In
hard times such as this, it is all the more important to look at the bright
side and plan ahead. Our new found extra time could be put to good use.
Keeping these in mind, I have taken up additional projects for betterment
during this period, which I shall list below.

# Learning how to learn

This course has been in my to-do list for a long time. It's a bit ironic
considering the fact that understanding and beating procrastination is one
of the central tenets of this course. There is no better time to learn the
skills that are taught in this course. I have learned a lot about how the brain
works, best practices to learn, and retain what you have learned. The course
is aimed not just for students, but anyone who wishes to learn, and enrich
their lives from what they have learned. I am only two weeks into this four
week course, but I already feel that everyone should be aware of the
techniques taught in this course to improve their study habits, and study
outcome. So, I do recommend it, and I shall write a detailed blog post once I
complete the course. You can study [Learning how to learn](https://www.coursera.org/learn/learning-how-to-learn) for free ($49 if you
want a verified certificate) at Coursera.

# Become a better cook

I am not new to cooking. My first attempt at cooking was a decade ago in 2009,
when I moved to Sweden for my master's degree. The high cost of living meant
that I had to quickly graduate from making instant noodles, and sandwiches to
 a decent cook in relatively short time.  Things changed after my marriage
 to Ranju (who is awesome cook), who took over the kitchen duties from me. I
 happy being the assistant chef, helping out occasionally but I rarely cooked
 on my own.

Things are different now though. I am cooking again, starting with simple stir
fries and noodle soups. I slowly progressed to making simple curries, and
Indian dishes. I started to make use of the oven that came with the cooking
range. Cooking with a different heat source is challenging, and the resulting
food sure is delicious. I also happen to be reading "Salt, Fat, Acid, Heat" by
Samin Nosrat. So, I view this period as a good opportunity to practice many
things I've learned from this book. Oh, by the way, this book is a great place
to start if you want to improve your cooking, and do not know where to start.

# Sugar free April

Ranju and I decided to skip added sugar for the whole month of April. We avoid
foods with high, or added sugar, except for the 2-3 cheat meals we have during
week. This means no more milkshakes, ice cream, and even the 1 teaspoon sugar
that we add to the tea we take. In addition to this, we avoid high glycemic
fruits such as grapes. It is okay to consume fruits on the lower end (<55 on
the index) of the [Glycemic Index](https://www.health.harvard.edu/diseases-and-conditions/glycemic-index-and-glycemic-load-for-100-foods).
So, apple, oranges, and plum, etc. are good. We are also avoiding starchy
foods like potatoes, and rice on most days, having substituted it with
wheat-based chapattis, and rotis.

I have noticed that my energy levels are much more consistent now, probably
due to far fewer spikes in insulin levels. This has helped me put in couple of
good hours during the usual afternoon slump between 13:00 and 16:00 hours.
I've already lost 0.7 kgs just two weeks into this experiment. It has been so
successful, I have decided to continue this after April.

# Phone-a-friend.

Before the lockdown, we were all too busy to stay in touch with near and dear
ones. This is especially true for me, as I rarely make calls except on special
occasions. These days, I am making a concentrated effort to call up old
friends now that I have plenty of time. To kick things started, I had a long
(2+ hours) of Zoom meeting with a group of my oldest friends, who are now
living in different parts of the world, spread across 5 continents. This was
such a great experience, as all of us had never gathered at the same time
since 2005.

I am now calling a friend or a family member every two days to catch up. I
feel that this helps me deal with the social isolation that comes with the
great lockdown. We may be at faraway places, but it need not feel that way.
Thanks to technology, we are now better connected than ever. So, let's make
good use of it.

# Wholesome entertainment

You can only achieve so much productivity in a day. It's important to let your
hair down and relax as well. Since I won't be getting my movie fix in the
theaters in the foreseeable future, I am putting my HD TV to good use. Instead
of mindlessly consuming YouTube videos, I decided to watch some good movies
instead.

I had watched the Oscar winning Korean movie Parasite in February, and it
opened my eyes, and ears to world cinema. I had seen some Swedish, and German
movies during my stay in Sweden, but I realized that I had not seen any new
foreign films in the years that followed. A quick google search revealed
[Empire magazine's 100 greatest films from world cinema](https://www.empireonline.com/movies/features/100-greatest-world-cinema-films/), which goes like this:

> From Brazil to Japan to France and Senegal, from Neo-Realism to Dogme to
J-horror, we've compiled a list of the very best films not in the English
language (note: features, not documentaries). So rustle up some sushi,
strike up a gauloise and make sure you've locked your bicycle as we count
down the top 100 world cinema movies...

As humans we come from different places, belong to many cultures, and speak
many languages, but human emotions, pain, and suffering are universal. After
watching half a dozen movies from this list, it was enlightening to realize
that. It was time well spent.

license: MIT

branch_name: refs/heads/master


text:
---
layout: default
---

# 1994-06-20 - Re: OJ`S CELL PHONE

## Header Data

From<EMAIL_ADDRESS>(Matthew Gream)

To<EMAIL_ADDRESS>(Bob MorrisG)

Message Hash: 80d0a7acec6e35a980d42ed229aeac8a0afdfa1477d32346d9744c4db59c91cf

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-06-20 01:48:05 UTC

Raw Date: Sun, 19 Jun 94 18:48:05 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Matthew Gream)
Date: Sun, 19 Jun 94 18:48:05 PDT
To<EMAIL_ADDRESS>(Bob MorrisG)
Subject: Re: OJ`S CELL PHONE
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

"Bob MorrisG" wrote:
> Technicians in the tracking station can, if necessary, track a
> particular call back to the cell site from which it originates.  But the
> monitoring can not be done unless the phone is in use. [ Is that true? ]

I wonder about this.

A friend had a Motorola handset he was using with our (Telecom) AMPS
service. When in stand-by mode, it polls the closest cell to determine
link quality and whether any slots are available for use.

When we were on holiday a few months ago, we stayed in a little seaside
town (ie. a small cell) and I can remember eating and noticing the
phone switch to `no service' for a few minutes, presumably as the cell
was fully loaded. While travelling through a National Park the
following day, in the middle of nowhere effectively, the same thing
happened as we went out of network range for a couple of hours.

The question is whether this polling includes the handset identifying
itself to the cell.

Matthew.

--
Matthew Gream<EMAIL_ADDRESS>-- Consent Technologies, (02) 821-2043
Disclaimer: I'm only a student at UTS

{% endraw %}
```

## Thread

+ Return to [June 1994](/archive/1994/06)

+ Return to<EMAIL_ADDRESS>(Bob MorrisG)](/authors/bmorris_at_netcom_com_bob_morrisg_)"
+ Return to "[Chris Knight <cknight@crl.com>](/authors/chris_knight_cknight_at_crl_com_)"
+ Return to<EMAIL_ADDRESS>(Mike McNally)](/authors/m5_at_vail_tivoli_com_mike_mcnally_)"
+ Return to<EMAIL_ADDRESS>(Matthew Gream)](/authors/mgream_at_acacia_itd_uts_edu_au_matthew_gream_)"
+ Return to "["Perry E. Metzger" <perry@imsi.com>](/authors/perry_e_metzger_perry_at_imsi_com_)"
+ Return to "[Phil Karn <karn@qualcomm.com>](/authors/phil_karn_karn_at_qualcomm_com_)"
+ Return to<EMAIL_ADDRESS>(Paul J. Ste. Marie)](/authors/pstemari_at_bismark_cbis_com_paul_j_ste_marie_)"
+ Return to "[Richard Johnson <Richard.Johnson@Colorado.EDU>](/authors/richard_johnson_richard_johnson_at_colorado_edu_)"
+ Return to "[Rick Busdiecker <rfb@lehman.com>](/authors/rick_busdiecker_rfb_at_lehman_com_)"

+ 1994-06-19 (Sun, 19 Jun 94 09:11:22 PDT) - [OJ`S CELL PHONE](/archive/1994/06/fe5de79c7b5ec07bd476dc3983d6e8838b19fa3efa1178fa21aacd97e8b25186) -<EMAIL_ADDRESS>(Bob MorrisG)_
  + 1994-06-19 (Sun, 19 Jun 94 09:48:56 PDT) - [OJ`S CELL PHONE](/archive/1994/06/cf0b79be6e8237a9b80260680870f87c8ef40b0723b8acc6dd4fd1ac6a4f5fd0) -<EMAIL_ADDRESS>(Mike McNally)_
    + 1994-06-19 (Sun, 19 Jun 94 13:10:15 PDT) - [Re: OJ`S CELL PHONE](/archive/1994/06/7f1f7d763c950a8e2084a56702eb915bee29481dd5842e96df67343ce91288f1) - _Chris Knight<EMAIL_ADDRESS>    + 1994-06-20 (Mon, 20 Jun 94 06:19:38 PDT) - [Re: OJ`S CELL PHONE](/archive/1994/06/6c71768c8c1407816d46a6d539a531deb1c5d74bb34c5a07c8245ff86541e0b0) - _"Perry E. Metzger"<EMAIL_ADDRESS>    + 1994-06-22 (Wed, 22 Jun 94 01:58:18 PDT) - [Re: OJ`S CELL PHONE](/archive/1994/06/c939f96a448e6cfcb1b6cc36d31e7844cdda37a269733f898b516ef345024f1c) - _Phil Karn<EMAIL_ADDRESS>      + 1994-06-22 (Wed, 22 Jun 94 04:48:20 PDT) - [Re: OJ`S CELL PHONE](/archive/1994/06/be51c55e1af7e35905f8de6ecf9a2f2c0e97c19d44cfa272125a29c778beea3a) - _Rick Busdiecker<EMAIL_ADDRESS>  + 1994-06-20 (Sun, 19 Jun 94 18:48:05 PDT) - Re: OJ`S CELL PHONE -<EMAIL_ADDRESS>(Matthew Gream)_
    + 1994-06-20 (Sun, 19 Jun 94 19:02:28 PDT) - [Re: OJ`S CELL PHONE](/archive/1994/06/805bdc68558cdd067a89fab43b3e8f47e180f83fffe06ea52df3917405d7f6f3) - _Richard Johnson<EMAIL_ADDRESS>    + 1994-06-20 (Mon, 20 Jun 94 07:16:02 PDT) - [OJ`S CELL PHONE](/archive/1994/06/b465c32440af0290d4d5145c8cd8b6b5444f3a5e0258a6c90c1e6ac8a6c23674) -<EMAIL_ADDRESS>(Paul J. Ste. Marie)_
  + 1994-06-22 (Wed, 22 Jun 94 01:52:49 PDT) - [Re: OJ`S CELL PHONE](/archive/1994/06/461c51f91c618f1f3827e5dc0aec0dad46cd4282c96c8b104a5ef9273c14a7f3) - _Phil Karn<EMAIL_ADDRESS>

gha_license_id: MIT


text:
# Blanket.js

A seamless JavaScript code coverage library.

[Project home page](http://migrii.github.com/blanket/)

[![Build Status](https://travis-ci.org/Migrii/blanket.png)](https://travis-ci.org/Migrii/blanket)

* [Philosophy](#philosophy)
* [Mechanism](#mechanism)
* [Install](#install)
* [Configure](#configure)
* [Use](#use)
* [Custom Reporters](#custom-reporters)
* [Continuous Integration](#continuous-integration)
* [Roll Your Own](#roll-your-own)
* [Development](#development)
* [FAQ](#faq)
* [Contributors](#contributors)
* [Revision History](#revision-history)

## Philosophy

Blanket.js is a code coverage tool for javascript that aims to be:

1. Easy to install
2. Easy to use
3. Easy to understand

Blanket.js can be run seamlessly or can be customized for your needs.

## Mechanism

JavaScript code coverage compliments your existing JavaScript tests by adding code coverage statistics (which lines of your source code are covered by your tests).

Blanket works in a 3 step process:

1. Loading your source files using a modified [RequireJS](http://requirejs.org/)/[Require](http://nodejs.org/api/globals.html#globals_require) script
2. Parsing the code using [Esprima](http://esprima.org) and [node-falafel](https://github.com/substack/node-falafel), and instrumenting the file by adding code tracking lines.
3. Connecting to hooks in the test runner to output the coverage details after the tests have completed.

## Install

Download the appropriate version of blanket.js for your test runner:
**QUnit**: [blanket.js for QUnit](https://raw.github.com/Migrii/blanket/live/dist/qunit/blanket.js)

**Mocha**: `npm install blanket` (NOTE: The Blanket NPM package requires Node 0.8.*)

Or [build it yourself](#roll-your-own).

## Configure

Reference the script in your test runner.

**QUnit**: `<script src="blanket.js"></script>`
The add the data attribute `data-cover` to any script file you want covered.
(Ex: `<script src="mylibrary.js data-cover></script>` )

You can also use a global filter with the data-cover-only attribute:

`<script src="blanket.js" data-cover-only="/src/"></script>` or
`<script src="blanket.js" data-cover-only="['pattern1','pattern2']"></script>` or
`<script src="blanket.js" data-cover-only="//regex//"></script>`

**Mocha**: `require("blanket")(<pattern-for-source-files>);` The argument passed is a string (or regex) that refers to the folder where the source scripts are stored.
*Note: This require statement must be placed before the require statement of any scripts that you want covered.*

In the browser, you can also avoid using the data-cover attributes by using a string/regex to denote which files to load:
`<script> blanket.loadOnly = "/src/"; </script>`
This is useful in certain situations, and neccessary when your test runner uses requirejs to load your source files.

## Use

**QUnit**: Run the tests (with the 'Enable Coverage' box checked) and you'll see the coverage statistics appended below the test results.

**Mocha**: Use the built-in reporters to output coverage details, i.e. `mocha -R html-cov > coverage.html`

## Custom Reporters

**QUnit**: Custom reporters can be created to match your prefered test runner style.  See [simple_json_reporter.js](https://github.com/Migrii/blanket/blob/live/src/reporters/simple_json_reporter.js) as an example.  More documentation soon.

Reference your reporter with the data-cover-reporter attribute:
`<script src="blanket.js" data-cover-reporter="myReporter.js"></script>`

**Mocha**: You can use any existing mocha reporters, or create your own.  See [json-cov](https://github.com/visionmedia/mocha/blob/master/lib/reporters/json-cov.js) as an example.

## Continuous Integration

You can use the [travis-cov](https://github.com/alex-seville/travis-cov) reporter, to integrate Blanket.js with an instance of Travis CI:

1. `npm install travis-cov`
2. Add to your package.json,

```
"scripts": {
         "test": "mocha -R travis-cov"
       },
       "travis-cov-threshold": <number>
```

If your CI tests aren't run with mocha, but are instead run with qunit & phantomjs, you can use the following configuration:

```
"scripts": {
         "test": "phantomjs ./node_modules/travis-cov/phantom_runner.js path-to-your-testrunner <threshold-number>"
       }
```

When you commit your code to Travis the coverage results will be compared against the threshold and will fail if any files fall below the threshold.

## Roll your own

1. `git clone git@github.com:Migrii/blanket.git`
2. `npm install`
3. `grunt buildit`
4. Your newly rolled file can be found at `/dist/qunit/blanket.js`

A minified and unminfied copy of the source will be created.
We plan on adding a variety of different command line options to allow you to create a version of blanket customized for your needs.
Let us know what you'd like to see!

## Development

**All development takes place on the MASTER branch.**

If you're looking for a place to contribute, the ['low priority' issues](https://github.com/Migrii/blanket/issues?labels=low+priority&page=1&state=open) are probably a good introduction to the project.

## FAQ

See the [FAQ in the Blanket Wiki](https://github.com/Migrii/blanket/wiki/FAQ).

Feel free to add questions to the Issue tracker, or send them to [@alex_seville](http://www.twitter.com/alex_seville).

## Contributors

Thanks to the following people:

* [alex-seville](https://github.com/alex-seville)
* [dervalp](https://github.com/dervalp)
* [morkai](https://github.com/morkai)
* [msaglietto](https://github.com/msaglietto)
* [flrent](https://github.com/flrent)

And thanks also to: [RequireJS](http://requirejs.org/), [Esprima](http://esprima.org/), [node-falafel](https://github.com/substack/node-falafel), [Mocha](http://visionmedia.github.com/mocha/), [Qunit](http://qunitjs.com/).

## Disclaimer

This product is currently in beta release and is NOT stable or production ready.  It is subject to changes.  We appreciate any feedback or assistance.

## Revision History

Dec-8-12 - 0.9.9
Moved Makefile into grunt and reorganized files.  Fixed instrumenting of comments in node.

Dec-3-12 - 0.9.8
Fixes to instrumentation, fix for escaped characters in node.  Added adapters and Jasmine example.

Nov-26-12 - 0.9.7
Custom reporters. Better organization of tests.

Nov-24-12 - 0.9.6
Better line counts, more tests, normalizing slashes for windows, require loader uses module._compile to properly pass the exports, added Makefile for CI, various other fixes.

Nov-19-12 - 0.9.4
Major refactoring, QUnit tests run with phantomjs, both node and browser tests are covered by blanket on travis-ci.  Compatibility with existing requirejs instance.

Nov-8-12 - 0.9.2
Bug fixes to instrumentation and node require loader.

Nov-4-12 - 0.9.1
Works seamlessly with mocha (in node) and uses built in mocha reporters for coverage.

Oct-29-12 - 0.9.0
Initial release of blanket.js.  Works with qunit, but coverage output is not complete.

## License
Copyright (c) 2012 Alex-Seville
Licensed under the MIT license.

repository: randylien/blanket

repo_name: randylien/blanket


text:
---
author: Jens-Christian Fischer
categories: ["musings"]
comments: true
date: 2010-01-29 16:01:41+00:00
layout: post
link: https://invisible.ch/2010/01/29/links-for-2010-01-29/
slug: links-for-2010-01-29
tags: ["blog"]
title: links for 2010-01-29
type: post
wordpress_id: 787
---

  *

[Vanity — Welcome to Vanity](https://vanity.labnotes.org/)

A/B Testing framework for Rails

(tags: [rails](https://delicious.com/jaycee/rails) [ruby](https://delicious.com/jaycee/ruby) [conversion](https://delicious.com/jaycee/conversion) [abtesting](https://delicious.com/jaycee/abtesting) [testing](https://delicious.com/jaycee/testing))

  *

[Notes: Merging two unrelated repositories](https://www.simplicidade.org/notes/archives/2009/04/merging_two_unr.html)

(tags: [git](https://delicious.com/jaycee/git) [howto](https://delicious.com/jaycee/howto) [merge](https://delicious.com/jaycee/merge) [repository](https://delicious.com/jaycee/repository))


text:
# Steps to run vault on Openshift.

Below steps to generate the `Vault` image from the build scripts.

```
#Login to the openshift with the Kube-admin instead of system admin.
oc login -u kubeadmin -p $(cat ~/openstack-upi/auth/kubeadmin-password)

# Create a new project
oc new-project vault-test

# Get the default route host
HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
echo $HOST

#Login to podman as kubeadmin
podman login -u kubeadm -p $(oc whoami -t) --tls-verify=false $HOST

# Download the Dockerfile and entrypoint script from the ppc64le/buildscripts to generate the Docker Image and push it to the Cluster as IS.
mkdir vault-docker && cd vault-docker
wget https://raw.githubusercontent.com/ppc64le/build-scripts/master/v/vault/Dockerfiles/1.5.3-ubi8/Dockerfile
wget https://raw.githubusercontent.com/ppc64le/build-scripts/master/v/vault/Dockerfiles/1.5.3-ubi8/docker-entrypoint.sh

#Build the Docker image
podman build -t $HOST/local-images/vault:1.5.3 .

#Push the image as local image so that any project/namespace get the access.
podman push $HOST/local-images/vault:1.5.3 --tls-verify=false

oc get is -A | grep vault
oc describe is vault -n local-images

IMAGE_NAME=$(oc describe is vault -n local-images | grep "Image Repository" | cut -d: -f2 | tr -d '\t')

# Update the policy/role to have access to image pull from local image to `vault-test` namespace.
oc policy add-role-to-group system:image-puller system:serviceaccounts --namespace=vault-test || true
```

Following are the steps to run `Vault` on Openshift

```
# A sample application, to check our docker image.
git clone https://github.com/raffaelespazzoli/credscontroller
cd credscontroller/

vi openshift/vault.yaml

#########################################################
# --- Steps to use the locally generated image ---
#########################################################
#Replace image: vault:0.11.1 with image: image-registry.openshift-image-registry.svc:5000/local-images/vault:1.5.3
# Add SKIP_CHOWN variable as true.

#########################################################
# --- Steps to use the ibmcom/vault-ppc64le image ---
#########################################################
#Replace image: vault:0.11.1 with image: ibmcom/vault-ppc64le:1.5.3-ubi8
# Add SKIP_CHOWN variable as true.

oc adm policy add-scc-to-user anyuid -z default

#Set the config for Vault.
oc create configmap vault-config --from-file=vault-config=./openshift/vault-config.json

# Start Vault app/deployment.
oc create -f ./openshift/vault.yaml

#Create a route for vault
oc create route passthrough vault --port=8200 --service=vault

#Unisntallation step for the vault app/deployment.
oc delete all --selector app=vault
```

gha_language: Shell


text:
---
layout: post
title: "OsSFR6"
description: ""
category: genes
tags: [abiotic stress]
---

* **Information**
    + Symbol: OsSFR6
    + MSU: [LOC_Os10g35560](http://rice.plantbiology.msu.edu/cgi-bin/ORF_infopage.cgi?orf=LOC_Os10g35560)
    + RAPdb: [Os10g0498700](http://rapdb.dna.affrc.go.jp/viewer/gbrowse_details/irgsp1?name=Os10g0498700)

* **Publication**
    + [OsSFR6 is a functional rice orthologue of SENSITIVE TO FREEZING-6 and can act as a regulator of COR gene expression, osmotic stress and freezing tolerance in Arabidopsis](http://www.ncbi.nlm.nih.gov/pubmed?term=OsSFR6 is a functional rice orthologue of SENSITIVE TO FREEZING-6 and can act as a regulator of COR gene expression, osmotic stress and freezing tolerance in Arabidopsis%5BTitle%5D), 2011, New Phytol.

* **Genbank accession number**

* **Key message**
    + OsSFR6 is an orthologue of AtSFR6, and thus a target for future manipulation to improve tolerance to osmotic and other abiotic stresses

* **Connection**

[//]: # * **Key figures**


text:
# Modified version for bio-medical image labeling

# label_ellipse
A tool to label ellipse object

# Usage
### start to label
```
python label.py
```
You will know what to do next.

### check labels
```
python check.py
```
Again, you will know what to do next.

-----------------
When calculating, Change int to float to make the label more accurate.


text:
## P1
* Refile input - allow types other than images
* Search
* Filters
  * Specify in YAML:
    filter_by:
      job_type:
* Simple 'options' list (ie. User#user_type)

```yaml
name: Article
sort:
  column: position
fields:
  title:
    type: text
    label: 'Main Title'
  copy: wysiwyg
  links: association
  category:
    type: collection
    collection: Article::VALID_CATEGORIES
filters:
  featured:
    scope: featured
  by_issue:
    association: issue
```

# class QuizDecorator
#   def title
#     { label:"Quiz Title", type:"Text", }
#   end

## Filters
* Address :has_many and other relationships

* Add default inputs for SimpleForm (take cues from Webflow?):
  * :color?
* Add 'type' to code editor (html, json, ruby)

* "Permanent" object concept - don't allow deletion?
  * Simply have the object respond to a permanent? method

* 'Preview' button ?
* accepts_nested_attributes_for
  * How can we allow assignment of already existing content?
  * Allow removal without destruction

* Turbolinks testing and conversion

## UI
* Add help text to YAML config
* Default sort items list by created date?
* Allow multiple columns in index view:
  * :to_label_columns (?) [:name, :category_name, :created_at]

## WYSIWYG - Images & Files
* Create similar proxy functionality for Files (a FileManager plugin)
* Keep this generalized so that if needed we could swap out the S3 backend?

## Generators
* Generate the YAML for a model (go through the admin_fields step and then write to a file)
* Generate directories for extensibility

## Extensibility
* Custom controller actions
* Custom views
* Customizing views through configs
* SimpleForm fields

## Documentation
* Polymorphic belongs_to: validating "inclusion: :in" for the 'type' column filters the list of classes to pick from.
* Configuring AWS will enable blanket uploads to S3 bucket from WYSIWYG editor
* S3 setup & IAM configuration
* collection input type && validates_inclusion_in

repository: cohesivecc/admin

gha_language: JavaScript

repo_name: cohesivecc/admin


text:
# EloRatingSystem

This is an Elo rating system built using Swift. It has win estimation and rating calculations for an unlimited amount of players. The rating calculator can handle games for 1 vs 1, 2 vs 2, 3 vs 100 or etc. It will provide you with the chance of winning as a percentage for player A versus player B.

# Install with Swift Package Manager

1. Open your Package.swift file and add this to your package dependancies:

`.package(url: "https://github.com/BryanNorden/elo-rating-swift.git", from: "1.2.0"`

2. In Package.swift find main target and add `"EloRatingSystem"`

3. Add this to any file where you would like to use the rating system:
`import EloRatingSystem`
4. Build / Run, then enjoy

### Notes
- To update the package manually open terminal and run  `swift package update`

- If you have issues you can run this in termial to reset your packages
`rm -rf .build/ *.xcodeproj/ Package.resolved`

# Calculate the chance of winning
`EloRating().chanceOfWinning(forPlayer: 100.0, vs: 1.0)` ->  chance of winning as a percentage in decimal form

### Chance of winning Example
We have two players. Bob with a rating of 800 and Jake with a rating of 1500.

To find out the likely hood that Bob will beat Jake you would use this
`let chanceOfBobBeatingJake = chanceOfWinning(forPlayer 800, vs ratingB: 1500)`
Then chanceOfBobBeatingJake = 0.17472092062234879 or 17.5% chance Bob will beat Jake

The chance of Jake beating Bob would be
`let chanceOfJakeBeatingBob = chanceOfWinning(forPlayer 1500, vs ratingB: 800)`
So chanceOfJakeBeatingBob = 0.98252791166305542 or 98.25% chance Jake will beat Bob

# Calculate Ratings after Game has been played
`EloRating().calculateWinLossRatings(_ players: [EloPlayer])`
This will take an array of EloPlayers and will return back an array of EloPlayers with their updated rating. You will need to create an EloPlayer for each of the players that played. The EloPlayer is just for that game. You can use your own player models.

**Important:** EloPlayer has an optional property id and uuid to help you identify your user. The function will work if you do not assign the EloPlayer your user's id or uuid, but it will be harder to identify your user when the rating calculations are returned

The players will be sorted into a winning team vs losing team based on the game result you assign the player (This is how it can handle any amounts of players). Then it will calculate the rating for everyone based on the ratings each player had before the start of the game. So you would then update your player model with their new rating, which would be `EloPlayer.ratingAfter`

#### Example of how to use calculateWinLossRatings method
```
let players = [
EloPlayer(gameResult: .won, ratingBefore: 900, ratingAfter: 0, ratingChange: 0, id: 112),
EloPlayer(gameResult: .won, ratingBefore: 600, ratingAfter: 0, ratingChange: 0, id: 200),
EloPlayer(gameResult: .lost, ratingBefore: 1500, ratingAfter: 0, ratingChange: 0, id: 6),
EloPlayer(gameResult: .lost, ratingBefore: 1100, ratingAfter: 0, ratingChange: 0, id: 22),
EloPlayer(gameResult: .lost, ratingBefore: 1100, ratingAfter: 0, ratingChange: 0, id: 56)
\]

let calculatedPlayers = EloRating().calculateWinLossRatings(players)
```

This would return these players
```
calculatedPlayers = [
EloPlayer(gameResult: .won, ratingBefore: 900, ratingAfter: 943.9107, ratingChange: 43.9107, id: 112),
EloPlayer(gameResult: .won, ratingBefore: 600, ratingAfter: 647.1034, ratingChange: 47.1034, id: 200),
EloPlayer(gameResult: .lost, ratingBefore: 1500, ratingAfter: 1468.2899, ratingChange: -31.7100, id: 6),
EloPlayer(gameResult: .lost, ratingBefore: 1100, ratingAfter: 1070.3479, ratingChange: -29.6520, id: 22),
EloPlayer(gameResult: .lost, ratingBefore: 1100, ratingAfter: 1070.3479, ratingChange: -29.6520, id: 56)
]
```

repository: kevinenax/elo-rating-swift

repo_name: kevinenax/elo-rating-swift


text:
# Smallwork

An anti-framework, developed as a minimal [Sass](http://sass-lang.com/ "Sass") starting point.

## Dependencies

- [Ruby](http://www.ruby-lang.com/)
    - [Sass](http://sass-lang.com/)

## Acknowledgements

- [Nicolas Gallagher](http://nicolasgallagher.com/) for `normalize.css` and the `%clearfix` object.
- [Nicole Sullivan](http://www.stubbornella.org/content/) for the `.media` object.
- [Harry Roberts](http://csswizardry.com/) for the `.island` and `.islet` objects.

## License

**The MIT License (MIT)**

*Copyright (c) 2013 Ellen Gummesson*

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

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

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: gummesson/smallwork

repo_name: gummesson/smallwork


text:
# wxWidgets_Inifile
A wxWidgets (formerly wxWindows) C++ class that allows for the writing and reading of initialisation and information strings to an .ini file.

For additional information, please contact :

Sigma Numerix Ltd.,
Email<EMAIL_ADDRESS>WWW : http://www.numerix-dsp.com

(C) Copyright 2004 Numerix Ltd.


text:
{{{
  "title": "Update 9: Light at the end of the tunnel...",
  "tags": ["piwars", "RaspberryPi","piwars-2018"],
  "category": "Robotics",
  "date": "April-16-2018",
  "author": "Sumit Kumar Maitra"
}}}

... is often the headlights of an oncoming train 🤣🤣🤣.

## Restoring confidence and getting my mojo black

In my last post I outlined I had goofed up the code for straight line speed challenge. Yesterday things came to a head and I decided I had enough. I scrapped the entire code for the straight line bit and started fresh. I was desperate to have a small win as a pick-me-up from the sad state of affairs.

After re-writing my control loop, it took about 30-45 minutes for me to get the bot to start going straight-ish again. In a couple of hours or so I had it completing the full length, albeit with a significant bit of meandering. This was at 50% speed. After some more tuning (and this time noting down every bit of change I was making to the code in my commit notes) I was able to race the bot at 70% speed taking smidge less than 9 seconds. I paused there, took a deep breath and checked in the code.

Too early to celebrate yet! I wanted to keep all software tuning for this week and wanted to focus on the construction of the robot over the weekend so I parked the code and went back to Tinkercad.

Thanks to everyone in the community who egged me along 👍

## Golf grabber

Saturday night I designed a golf ball grabbing attachment that looked way over complicated with two motors, one to open/close the clamp and other to raise lower the whole thing. I posted a picture of the design on Twitter.

If you thought my PiNoon holder was over engineered, I present to you my golf ball grabber… still at a concept stage so may no make it by Sunday #PiWars 😳 pic.twitter.com/KWjFwSgkGk
— Pi of things (@piofthings) 15 April 2018

Keith (@PiTutorials) responded and pointed out it was a bit of overkill to use two motors to do essentially the same thing, grab and release the ball.

So the servos open/close and move up/down?  Do you really need both, they effectively do the same thing, release the ball.
— Keith's Pi Tutorials (@PiTutorials) 15 April 2018

That got me thinking, I could really do this with one motor and not worry about opening/closing the clamp. So after my mini win with the straight line speed I went back to re-designing the grabber and came up with this.

![Golf grabber](/posts/images/pi-wars/pi-o-steer-golf-grabber-design-2.jpg)

This was a much simpler design requiring only one motor making the robot less 'front-heavy'.

## To shoot or not to duck shoot...

I spent quite a bit of time trying to build a spring based projectile launcher for the duck shoot challenge. However, I could only get so far as this

![Proposed Duck shooty thingy](/posts/images/pi-wars/pi-o-steer-duck-shooty-thingy-incomplete.jpg)

The idea was to have a launcher on spring, pulled all the way back via one motor. A clamp at the bottom that keeps the ball in launch position, and another motor that release the clamp to launch the ball.

Unfortunately, it is easier to imagine it than come up with all the gubbins required to accurately hold the thing in place.

I felt I didn't have enough time to do this.

Once I decided I wasn't going to build the launcher the next option was to roll the ball.

I read up the rules and found out the ball size and told myself, well, we'll see what we can do about that, if nothing we'll have our butch bot nudge the balls towards target.

### The golf grabber v2 bonus
After the golf grabber design was done I sat there looking at it at 2 am in the morning, and it suddenly struck me - _If I modify this to hold a bigger ball I could use a smiliar mechanism to propel the ball! Only risk was it might lob the ball instead of rolling it._ I got on discourse and asked Mike the question. Today morning he came back with the confirmation this was allowed. Wooo hoo! That's six out of seven challenges within grasping distance.

## 3D Printing away to glory
I mentioned I had 60+ hours of 3D Printing to do. Turns out it might be significantly more than that. After 34 hours I have this motely lot of parts

![34 hours of 3D Printing later](/posts/images/pi-wars/pi-o-steer-3d-printing-34hrs.jpg)

Doesn't seem like a lot, that's because I have a cheap printer that prints rather slowly. If you have access to a better printer it shouldn't take you this long. I'll just have to power through the rest of the build at this pace. Looks like another 30 hrs or so to go.

How things have turned around in a couple of days. All I have to do it maintain this focus (not one of my strengths) and we'll be in a decent place for Sunday. Fingers crossed.

repository: piofthings/web

gha_language: G-code

repo_name: piofthings/web


text:
# Vertical bar charts {#concept_bnq_fd2_vdb .concept}

This topic describes the overview, examples, and deletion of a vertical bar chart.

Make sure that you have read [Dashboard overview](reseller.en-US/User Guide/Create dashboards/Dashboard overview.md#) and [Dashboard basic operations](reseller.en-US/User Guide/Create dashboards/Dashboard basic operations/Basic dashboard operations.md#) before reading this topic. For creating a dataset, see [Create a dataset](reseller.en-US/User Guide/Data modeling/Dataset management/Create a dataset.md#).

## Overview {#section_a4v_1jl_xgb .section}

A vertical bar chart shows comparisons among discrete categories. You can use a vertical bar chart to visualize data changes over a period of time or comparisons among discrete categories. For example, you can show the comparison of the traffic flow of vehicles over different periods of time at a crossing.

Similar to a [line chart](reseller.en-US/User Guide/Create dashboards/Create charts/Line charts.md#), a vertical bar chart is based on the category axis and value axis.

## Samples {#section_ywl_djl_xgb .section}

![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/9126/15640460081689_en-US.png)

## Notes {#section_oj5_fjl_xgb .section}

You can set at least one dimension for the category axis such as province and product\_type. In addition, you can set at least one measure for the value axis such as order\_amt and profit\_amt. The Color Legend \(Dimensions\) section can take only one dimension.

**Note:** You can enable the color legend only when the value axis involves one measure.

## Examples {#section_vfq_hjl_xgb .section}

Scenario: compares the shipping cost for different products of provinces of East China. The following example uses the company\_sales\_record dataset.

1.  Log on to the Quick BI console.
2.  Click **Datasets** to go to the Datasets page.
3.  Click the **Create Dashboard** icon on the right side of the company\_sales\_record dataset.

    **Note:** If you use **Quick BI Enterprise Standard**, you need to choose **Standard** or **Full Screen** as the dashboard display mode. The following example uses the **Standard** display mode.

4.  Click the **Vertical Bar Chart** icon and an empty chart appears on the dashboard.
5.  On the Dimensions list, locate the **area** field and add it to the Filters section.

    East China is filtered by using the area filter as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/9126/15640460081685_en-US.png)

6.  Click the **Filter** icon and select **Filter by Value** in the dialog box that appears as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/9126/156404600911401_en-US.png)

7.  Select East China and click **OK**.
8.  Drag **province** and **product\_type** to the Category Axis \(Dimensions\) area in turn.

    **Note:** Make sure that you have converted the dimension type from String to Geo for the province dimension. For more information, see [Change the dimension type](reseller.en-US/User Guide/Data modeling/Dataset management/Change field types.md#).

9.  On the Measures list, drag **shipping\_cost** to the Value Axis \(Measures\) area.
10. Drag **product\_type** to the Colors \(Dimensions\) area.

    **Note:** You can enable the color legend only when the value axis involves one measure.

11. Click **Update** to update the chart.
12. On the Style tab page, you can configure the basic information, chart type, axes, functionality, and series settings.
13. Click **Save** to save the dashboard.

## Configure the style {#section_zdf_sjl_xgb .section}

**Note:** For more information about Style, see [Configure a chart](reseller.en-US/User Guide/Create dashboards/Dashboard basic operations/Configure a chart.md#).

## Delete a chart {#section_okw_sjl_xgb .section}

Click the **More Actions** icon in the upper-right corner of a chart and select **Delete** from the drop-down list to delete the chart.

url: https://raw.githubusercontent.com/xiao15934831580/bi/a266cc43c3e9f5eb88bab9c630cf28e52a364687/intl.en-US/User Guide/Create dashboards/Create charts/Vertical bar charts.md

filename: Vertical bar charts.md


text:
# DEPLOY

Although these CloudFormation templates are meant to serve more as a reference, you can indeed deploy them directly.

The templates prefixed with **"existing-stack"** are generally more indicative of how we expect customers to deploy Ribbon SBCs (insertion into an existing environment).

>  **NOTE**
>  The user is expected to be familiar with AWS prior to attempting to deploy the Ribbon SBC on AWS.
>  See [Ribbon SBC on AWS - Instantiate Pre-Requisites](https://github.com/RibbonCommunications/sbc_aws_cloudformation/blob/master/supported/pre_requisites/README.md#ribbon-sbc-on-aws---instantiate-pre-requisites) for more details about SBC pre-requisites such as AWS VPC, networking objects and security group.


text:
The `for in` construct can be used to iterate an `Iterator`, a lazy value
generator (more details later). One of the easiest ways to create an iterator
is to use the range notation. `a..b` will yield values from `a` (inclusive) to
`b` (exclusive) in steps of one.

Let's write FizzBuzz using `for` instead of `while`.

{for.play}

repository: XadillaX/zh-rust-by-example

repo_name: XadillaX/zh-rust-by-example


text:
---
title: Getting Started
page_title: Getting Started
description: Getting Started
slug: radtimepicker-timepicker-populating
tags: getting,started
published: True
position: 2
---

# Getting Started

RadTimePicker is a control that displays a time representation from which the user can select a single time.

>In order to use __RadTimePicker__ control in your projects you have to add references to the following assemblies:
>	1. __Telerik.Windows.Controls__
>	1. __Telerik.Windows.Controls.Input__

>	You can find more info {% if site.site_name == 'Silverlight' %}[here]({%slug installation-installing-controls-dependencies%}){% endif %}{% if site.site_name == 'WPF' %}[here]({%slug installation-installing-controls-dependencies-wpf%}){% endif %}.

__HeaderText:__

__HeaderContent__ property can be used to customize the TimePickers header. You can use for header almost all types of controls.

__Selection:__

The __SelectedTime__ property holds the selected time.

#### __C#__

{{region cs-radtimepicker-timepicker-populating_0}}
	timePicker.SelectedTime = new TimeSpan(3,0,0);
{{endregion}}

__Populating:__

You can limit the times that can be selected by setting the __StartTime__ and __EndTime__ properties. The __TimeInterval__ property allows user to specify the interval between time slots available for selection. RadTimePicker also allows binding to various data source types through __ClockItemSource__ property.

#### __XAML__

{{region xaml-radtimepicker-timepicker-populating_1}}
	<telerik:RadTimePicker x:Name="timePicker" TimeInterval="0:30:0" StartTime="0:0:0" EndTime="7:0:0" />
{{endregion}}

The following example demonstrate how to bind RadTimePicker to observable collection from TimeSpan objects.

#### __C#__

{{region cs-radtimepicker-timepicker-populating_2}}
	public DataBinding()
	{
	    this.radTimePicker.ClockItemsSource = this.LoadDataObjects();
	}
	public ObservableCollection<TimeSpan> LoadDataObjects()
	{
	    ObservableCollection<TimeSpan> times = new ObservableCollection<TimeSpan>()
	    {
	       new TimeSpan(9,0,0),
	       new TimeSpan(10,0,0),
	       new TimeSpan(10,5,0),
	       new TimeSpan(10,22,0),
	    };
	    return times;
	}
{{endregion}}

For more information on the handling the selection events, see the Binding section.

__Clock:__

If you need a clock that takes less space, use the RadClock control which in its essence is a panel with header and times and have almost all of the properties of TimePicker.

![](images/Clock.jpg)

__Styling and Appearance:__

The TimePicker control has __IconButtonStyle__ property that can be used to style the toggle button of the control and also support different layouts for the Clock using __ClockPanel__ property. For more information see the Styling and Appearance section.

repository: gangaedy/xaml-docs

repo_name: gangaedy/xaml-docs


text:
# Create video thumbnails

Everyone knows how to create thumbnails for images. But can we do it for
videos? Surely this will take massive amounts of code, no?

Not with Reshuffle!

## Ingredients:

* __2__ [S3](https://aws.amazon.com/s3/) buckets

* __1__ [Amazon Elastic Trasncoder](https://aws.amazon.com/elastictranscoder/) pipeline

* __1__ [mediainfo](https://mediaarea.net/en/MediaInfo) utility, [precompiled for lambda](https://mediaarea.net/download/binary/mediainfo/20.08/MediaInfo_CLI_20.08_Lambda.zip)

* __1__ Reshuffle

## Preparation:

1. Create two S3 buckets: source and target. Open source for public read

1. Create an Elastic Transcoder pipeline to read from your source bucket and output into your target bucket

1. Set up the following environment variables:

    AWS_ACCESS_KEY_ID

    AWS_SECRET_ACCESS_KEY

    AWS_DEFAULT_REGION

    S3_SOURCE_BUCKET

    S3_TARGET_BUCKET

    ELASTIC_TRANSCODER_PIPELINE

## Workflow:

1. Run [create-video-thumbnails-et.js](./create-video-thumbnails-et.js) on Reshuffle

1. Drop video file into your source S3 bucket

1. Reshuffle picks it up and uses Lambda to run the MediaInfo command line utility to get information on the video

1. Reshuffle looks at video frame size infomation. If the frame is large,
Reshuffle starts transcoding job and tracks job until thumbnail is ready. If
it's small, Reshuffle simply copies the file into target bucket.

## Bonus:

We also provide an API endpoint for listing all the generated thumbnail video files.

repository: reshufflehq/reshuffle-aws-connectors

gha_language: TypeScript

repo_name: reshufflehq/reshuffle-aws-connectors


text:
---
layout: default
---

# 1994-05-15 - CJR, FOIA and non-US citizens

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: ea8199062a06c59b79321f2d71cf6b2efa68ca5734facfac060043b417f803ad

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-05-15 13:52:20 UTC

Raw Date: Sun, 15 May 94 06:52:20 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Sun, 15 May 94 06:52:20 PDT
To<EMAIL_ADDRESS>Subject: CJR, FOIA and non-US citizens
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

I asked various things about non-US citizens and ITAR violations earlier,
but haven't seen my post on the list. Anyway, those questions have been
answered, more or less, by the discussions on the topic.

A related question: can a non-US citizen file a commodoties jurisdiction
or FOIA request? Directly, through a US attorney, etc?

-------------------------------------------------------------------------------
Rishab Aiyer Ghosh<EMAIL_ADDRESS>Voicemail +91 11 3760335; Vox/Fax/Data 6853410
H-34C Saket New Delhi 110017 INDIA

The National Short-Sleeved Shirt Association says:
                                             Support your right to bare arms!
-------------------------------------------------------------------------------

{% endraw %}
```

## Thread

+ Return to [May 1994](/archive/1994/05)

+ Return to "[rishab@dxm.ernet.in](/authors/rishab_at_dxm_ernet_in)"

+ 1994-05-15 (Sun, 15 May 94 06:52:20 PDT) - CJR, FOIA and non-US citizens -<EMAIL_ADDRESS>


text:
# Description
GDScript is the primary scripting language used by the [Godot Game Engine](https://godotengine.org/).

This plugin adds filetype set, syntax highlighting, snippets and ctags for the most recent version (3.2 at the time of writing).

# Installation
Using [vim-plug](https://github.com/junegunn/vim-plug):

    Plug 'clktmr/vim-gdscript3'

Or any other plugin manager of your choice.

# Screenshot
![Screenshot](screenshot.png)

*Colorscheme: [base16-eighties](https://github.com/chriskempson/base16-vim)*

# Completion, Go To Definition and Error Linting
I highly recommend using [coc.nvim](https://github.com/neoclide/coc.nvim) with the LSP and the following configuration:
```json
  "languageserver": {
      "godot": {
        "host": "<IP_ADDRESS>",
        "filetypes": ["gd", "gdscript3"],
        "port": 6008
      }
    }
```
Ps. This will only works after [this PR](https://github.com/godotengine/godot/pull/35864) gets merged and released on Godot.

# License
MIT

gha_language: Python


text:
## HINTS FOR
# Task 1: Track and share your own work

## Task
Create a local repository, link it to a remote repository on GitHub, and practice changing the repo and sharing your changes on GitHub.

## Add to your drawing
As you go through these steps, add to your drawing the commands that move changes between different parts of the git project. In this version of the file, these steps are **bolded**.

## Steps
1. Make a directory somewhere on your machine (make its name unique so there isn't another with the same name on GitHub\
`mkdir <your_creative_dir_name>`

2. Change into the directory\
`cd <your_creative_dir_name>`

3. Initialize a git repository\
`git init`

4.  **Stage the change**\
`git add <filename>`

1.  Make a PUBLIC repository on GitHub with the same name (if it's private, you won't be able to do the collaboration task; you can delete it afterwards).
   - Go to `www.github.com/<your-github-username>` and log in
   - Click "Repositories"
   - Click "New"
   - Enter the name of your repo
   - Choose to make your repo Public
   - Don't check any boxes
   - Click "Create repository"

9. Once you create your repo on GitHub, it will bring you to a page with a heading *"... or push an existing repository from the command line"*. Use this code to tell git the shortname and address of your remote repository, rename your principal branch to 'main', and **push your local repo contents to the remote repo**.\
`git remote add <remote shortname> <remote address>`\
`git branch -M main`\
`git push -u <remote> <branch>`\
*Note that you only need the `-u` the first time*

10. If you have time before the next task, repeat these steps a few times:
      - Change your file
      - **Stage the change**
      - **Commit the change**
      - **Push the change to GitHub**

branch_name: refs/heads/main


text:
# survey-batch
Import survey data to DB and generate report and sent report via email
Flow
=========================================
![alt tag](https://raw.githubusercontent.com/le-tri-mulodo/survey-batch/master/Survey.jpg)
Set up, build & run
=========================================
**survey-batch** use `Spring Batch` & `Maven` to minimize spend coding time.

## Setup
Open `config.properties` and config.
  + Config values for the datasource:
    + `ds.driver`: JDBC driver for datasource
    + `ds.url.survey`: URL of survey data schema
    + `ds.url.job_repo`: URL of job repository schema
    + `ds.username` & `ds.password`: User name & password to access datasource
  + Config values for the data folder:
    + `zip_folder`: Folder contain all ZIP files send by fieldworkers
    + `csv_folder`: The temp folder contain CSV files decompressed and use data in them to import into DB
    + `backup_folder`: Contain ZIP files backuped by date
  + Config values for mail:
    + `email.host`: Host of mail service
    + `email.port`: Port of mail service
    + `email.username` & `email.password`: User name & password to access mail service

## Initialize DB
  + Create schemas for store survey data and job repository
  + Execute `survey_create.sql` script to create tables need to run program

## Build
To build, execute from the top level directory:

  `$ mvn clean install`
## Run

  `$ java -Djava.awt.headless=true -jar target/survey.jar`

## Benchmark result

Best result when IMPORT use JDBC:

| Chunk size | Record | Duration 1st | 2nd | 3rd |
| ---------- | ------ |	------------ | ------------- | ------------ |
| 100000 | 1000000 |	32,664 ms |	34,613 ms	| 36,625 ms |

Best result when COPY use JDBC:

| Chunk size | Pagesize | Record | Duration 1st | 2nd | 3rd |
| ---------- | -------- | ------ | ------------ | ------------- | ------------ |
| 50000 | 100000 |	1000000 |	33,150 ms	| 34,711 ms | 36,080 36 ms |

Note: please view [benchmark](benchmark.md) for more detail.

repository: le-tri-mulodo/survey-batch

gha_language: Java

repo_name: le-tri-mulodo/survey-batch


text:
## Managing Models

Models are created through the declaration of a database schema. Specifically for MongoDB, this can be done easily through the `mongoose` package. The `mongoose.Schema()` method will create a table schema through the object which you pass to, defaulting to _strict_ mode. Here's an example:

```js
const mongoose = require("mongoose") // Import the mongoose package
mongoose.Promise = global.Promise // Tell mongoose to use the global Promise object on it's DB interactions
const storeSchema = new mongoose.Schema({
  name: {
    type: String, // Only accept Strings
    trim: true, // Get rid of preceding/terminating whitespace
    required: "Please enter a store name!", // Must be given
  },
  description: {
    type: String,
    trim: true,
  },
  tags: [String], // Only accept an array of strings
})

// Export the storeSchema applied to a table entitled 'Store'
module.exports = mongoose.model("Store", storeSchema)
```

Models can also perform helpful operations on the data which is passed to it, depending on the action which is take. For example, the following snippet takes effect before the `.save()` method is called on the `storeSchema`. If the `name` of the store has been modified, then create the slug, and move on.

```js
// The save method creates an entry in the storeSchema table
storeSchema.pre("save", function(next) {
  // Skip it and stop this function
  if (!this.isModified("name")) return next()
  // Create the slug
  this.slug = slug(this.name)
  next()
})
```

There is a little bit to remember about creating models, you have to import them into your app at least once. In this specific app, it is done in `start.js` with following line:

```js
require("./models/User")
```

Then, wherever the models are used, they can be imported similarly to any other node package with the following:

```js
const User = mongoose.model("User")
```

---

## Async/Await

Since JavaScript is an asynchronous scripting language, making requests to external resources is a problem, especially if multiple need to be made before any sort of user response. Modern JavaScript is way past _[Callback Hell](http://callbackhell.com/)_, since the introduction of the `global.Promise` object. Now, in order to make a bunch of calls, you can simply chain them:

```js
doSomething()
  .then(function(result) {
    return doSomethingElse(result)
  })
  .then(function(newResult) {
    return doThirdThing(newResult)
  })
  .then(function(finalResult) {
    console.log("Got the final result: " + finalResult)
  })
  .catch(failureCallback)
```

<small>Example credits to [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavasScript/Guide/Using_promises)</small>

But even this can get pretty confusing pretty fast. Another way to handle this is with `async` and `await` notation. To use this notation, preface the asynchronous function with the keyword `async` to denote the fact that a promise will be taking place inside. Then, simply put the keyword `await` in front of the call, in order to tell js not to continue until this response is completed.

```js
// The finished message ill only log after the new store has been saved
exports.createStore = async (req, res) => {
  const store = new Store(req.body)
  await store.save() //This line saves the new store to the database
  console.log("Finished!")
}
```

There is a trade off however; the error handling, which is critical when depending on external resources. Since physically impossible to write code without errors in it, the `async/await` calls need to be `try`'d in order to `catch` any errors in reading/writing to the database or API. This is because there is no callback function which naturally catches the error. However, there is a way of conveniently catching errors using a helper function.

```js
// This function is middleware which accepts a function
exports.catchErrors = fn => {
  // It then returns the output to a 'parent' function
  return function(req, res, next) {
    // The parent function outputs our input function followed by .catch() in order to catch the error, and skip to the next middleware.
    // This error is caught in the next middleware
    return fn(req, res, next).catch(next)
  }
}
```

---

## Simple Control Flow

The MVC design pattern is really helpful for developing a clean modular codebase. The general architecture is as follows:

1. Create the route for the process initiation. This would cover the exact URL (ex. `stores/create`, as well as the action, `get` or `post`)

```js
const express = require("express")
const router = express.Router()

router.get("/add", placeholderController)
```

2. Create (and handle errors) for operations through the appropriate controller (ex. group all the actions related to store management under `storeController.js`)

```js
const storeController = require("../controllers/storeController")
router.get("/add", catchErrors(storeController.addStore))
```

```js
// Within storeController.js
exports.addStore = async (req, res) => {
  // some functionality...
  res.render("placeholderTemplate")
  // or res.redirect() to another route which renders
}
```

3. Create/Use the appropriate template to render the request (ex)

```js
// Within storeController.js
exports.addStore = async (req, res) => {
  // some functionality...
  res.render("editStore") //views/editStore.pug
  // or res.redirect() to another route which renders
}
```

```pug
<!-- Within editStore.pug -->
extends layout

block content
  .inner
    h2= title
    form(action=`/add/${store._id || ''}` method="POST" class="card")
    label(for="name") Name
    input(type="text" name="name" value=store.name)
    label(for="description") Description
    textarea(name="description")= store.description
    //- ...
```

1. Use mixins, along with redirects and other route controllers to create the complex stuff!

```pug
//- Since the store creation, and store editing both use the same form, it can be used as a mixin instead of being duplicated
<!-- Within editStore.pug -->
extends layout

include mixins/_storeForm

block content
  .inner
    h2= title
    +storeForm(store)
```

```pug
<!-- Within _storeForm.pug -->
mixin storeForm(store = {})
  //- enctype="multipart/form-data"
  form(action=`/add/${store._id || ''}` method="POST" class="card")
    label(for="name") Name
    input(type="text" name="name" value=store.name)
    label(for="description") Description
    textarea(name="description")= store.description
    //- ...
```

url: https://raw.githubusercontent.com/leeandher/leander.xyz/ba3b0b92abe034a1313ce6408b6fc73bb2e42099/src/pages/notes/Learn Node/2 - Storage and Control Flow.md

branch_name: refs/heads/live

filename: 2 - Storage and Control Flow.md


text:
# Operator Registry Tooling

When compiled, the `operator-registry` project results in a collection of tools that in aggregate define a way of packaging and delivering operator manifests to Kubernetes clusters. Historically, this is done with multiple tools. For example, you can use `initializer` to generate an immutable database and then use `registry-serve` to serve the database via an API. We have added the `opm` tool that aggregates these functions together and allows a user to interact with container images and tooling directly to generate and update registry databases in a mutable way.

The following document describes the tooling that `opm` provides along with descriptions of how to use them including each command's purpose, their inputs and outputs, and some examples.

## opm

`opm` (Operator Package Manager) is a tool that is used to generate and interact with operator-registry catalogs, both the underlying databases (generally referred to as the `registry`) and their images (the `index`). This is divided into two main commands: `registry` which is used to initialize, update and serve an API of the underlying database of manifests and references and `index` which is used to interact with an OCI container runtime to generate the registry database and package it in a container image.

### registry

`opm registry` generates and updates registry database objects.

#### add

First, let's look at adding a version of an operator bundle to a registry database.

For example:

`opm registry add -b "quay.io/operator-framework/operator-bundle-prometheus:0.14.0" -d "test-registry.db"`

Dissecting this command, we called `opm registry add` to pull a container image that includes the manifests for the 0.14.0 version of the `prometheus` operator. We then unpacked those manifests from the container image and attempted to insert them into the registry database `test-registry.db`. Since that database file didn't currently exist on disk, the database was initialized first and then prometheus 0.14.0 was added to the empty database.

Now imagine that the 0.15.0 version of the `prometheus operator` was just released. We can add that operator to our existing database by calling add again and pointing to the new container image:

`opm registry add -b "quay.io/operator-framework/operator-bundle-prometheus:0.15.0" -d "test-registry.db"`

Great! The existing `test-registry.db` file is updated. Now we have a registry that contains two versions of the operator and defines an update graph that, when added to a cluster, will signal to the Operator Lifecycle Manager that if you have already installed version `0.14.0` that `0.15.0` can be used to upgrade your installation.

**Aside:** if using a custom CA for your bundle image registry, be sure to configure the container tool with the appropriate certificate
([docker](https://docs.docker.com/engine/security/certificates/), [podman](http://docs.podman.io/en/latest/markdown/podman-image-sign.1.html#cert-dir-path)).
If using the `none` container tool, download the root certificate to a file and pass the file path like so:

```sh
opm registry add -b "custom-ca-registry.com/operator-bundle-prometheus:0.15.0" -d "test-registry.db" --container-tool=none --ca-file="/path/to/cert.pem"
```

#### rm

`opm` also currently supports removing entire packages from a registry.

For example:

`opm registry rm -o "prometheus" -d "test-registry.db"`

Calling this on our existing test registry removes all versions of the prometheus operator entirely from the database.

#### prune

`opm` supports specifying which packages should be kept in an operator database.

For example:

`opm registry prune -p "prometheus" -d "test-registry.db"`

Would remove all but the `prometheus` package from the operator database.

#### serve

`opm` also includes a command to connect to an existing database and serve a `gRPC` API that handles requests for data about the registry:

`opm registry serve -d "test-registry.db" -p 50051`

### index

`opm index` is, for the most part, a wrapper for `opm registry` that abstracts the underlying database interaction to instead make it easier to speak about the container images that are actually shipped to clusters directly. In particular, this makes it easy to say "given my operator index image, I want to add a new version of my operator and get an updated container image that I can automatically ship to clusters".

#### add

Index add works much the same way as registry add. For example:

`opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.14.0 --tag quay.io/operator-framework/monitoring-index:1.0.0`

Similar to `opm registry add`, this command will pull the specified container bundle and insert it into a registry. The real difference is that the result is more than just a database file. By default, this command will also attempt to build a container image and depending on the value of the `--tag` flag, will tag the output image as `quay.io/operator-framework/monitoring-index:1.0.0`. The resulting image has the database and the opm binary in it and, when run, calls the `registry serve` command on the database that was generated.

Just like registry add command, the updates are cumulative. In this case, rather than pointing at a database file, we can use the `--from-index` flag to specify a previous index to build off of a previous registry:

`opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.15.0 --from-index quay.io/operator-framework/monitoring:1.0.0 --tag quay.io/operator-framework/monitoring:1.0.1`

This results in a fresh image that includes the updated prometheus operator in the prometheus package's update graph.

At a high level, this command operates by wrapping `registry add` around some additional interaction with pulling and building container images. To that end, the last thing it does is actually shell out to a container CLI tool to build the resulting container (by default, `podman build`). It does this by generating a dockerfile and then passing that file to the shell command.

For example:

```dockerfile
FROM quay.io/operator-framework/upstream-registry-builder AS builder

FROM scratch
LABEL operators.operatorframework.io.index.database.v1=./index.db
COPY database ./
COPY --from=builder /bin/opm /opm
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
EXPOSE 50051
ENTRYPOINT ["/opm"]
CMD ["registry", "serve", "--database", "index.db"]
```

In the above example, it's important to note that we use a builder image to get the latest upstream released version of opm in order to call `opm registry serve` to host the gRPC API. If a developer or CI system would prefer to point to a different version of `opm` to serve their operator (perhaps one in a private release or a fork) then they just need to deliver their own version in a container and then use the `--binary-image` command.

For example:

`opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.14.0 --tag quay.io/operator-framework/monitoring-index:1.0.0 --binary-image quay.io/$user/my-opm-source`

This will update the above dockerfile and replace the builder image with the image specified in the `--binary-image` flag.

We are aware of the fact that, in many cases, users will want to make other changes to this dockerfile (adding additional labels, adding other binaries for metrics, using a different port, etc.). For these more complex use cases, we have added the `--generate` and `--out-dockerfile` flags. Adding `--generate` will skip the container build command entirely and instead write a Dockerfile to the local filesystem. By default, this file is called `index.Dockerfile` and is put in the directory you run `opm` from. If you want to rename this generated dockerfile and write it somewhere else, just specify the `--out-dockerfile` flag:

`opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.14.0 --generate --out-dockerfile "my.Dockerfile"`

Running this command will still generate the updated registry database, but it will store it locally and additionally write `my.Dockerfile` which can be modified as needed.

#### Update Graph Generation

In an effort to make channel head selection understandable and deterministic when bulk-adding bundles to an index using `--mode=replaces` (the default), the following heuristic has been adopted: the bundles with the highest version within a package are considered the heads of the channels they belong to.

#### Under the Hood

`opm` effectively decomposes bundle addition into the following steps for each package:

- Add bundles to the underlying data store
- Choose the channel heads and default channel
- Rebuild the update graph starting at the new heads

Channel head -- the "latest" operator in a channel -- selection is now informed by [semver](https://semver.org/). The heurstic is that the bundle with the highest version in each channel becomes the new head. The default channel is then taken from the maximum versioned bundle which defines a default channel.

Starting from these heads, opm then rebuilds the entire update graph using the edges defined by the `replaces` and `skips` CSV fields.

If a given CSV is missing a version field, the command ignores all CSVs (sourced from the command's arguments) belonging to that package and exits with a non-zero status code.

CSVs without a version (and with duplicate versions) that are *already part of the index* are allowed so long as there is at least one CSV with a version field in the package that is recognizable as having the maximum version.

When `--overwrite-latest` is set, all existing bundles in a package are processed as new "input", and are thus constrained by the rules for new bundles with no exception for previously-existing unversioned/duplicatively-versioned CSVs, and any offending package in input will be excluded from the resulting index.

#### What does this mean for a package author?

- the head of every channel will __always__ be the bundle in that channel with the highest version field defined
- a version field __must__ be defined on a bundle expected to be channel head, unless it's the only bundle in the channel

#### Common Pitfalls

- [Pre-release](https://semver.org/#spec-item-9) versions __should not__ be used as patches to channel heads; e.g. 1.0.0-p replaces 1.0.0
    - pre-release versions come _before_ their release version and consequently won't be chosen as the new channel head by opm (see https://semver.org/#spec-item-11 for more on ordering)
</ul>

#### rm

Like `opm registry rm`, this command will remove all versions an entire operator package from the index and results in a container image that does not include that package. It supports virtually all of the same options and flags as `opm index add` with the exception of replacing `--bundles` with `--operators`.

For example:

`opm index rm --operators prometheus --tag quay.io/operator-framework/monitoring-index:1.0.2 --binary-image quay.io/$user/my-opm-source`

This will result in the tagged container image `quay.io/operator-framework/monitoring-index:1.0.2` with a registry that no longer contains the `prometheus` operator at all.

#### prune

`opm index prune` allows the user to specify which operator packages should be maintained in an index.

For example:

`opm index prune -p "prometheus" --from-index quay.io/operator-framework/example-index:1.0.0 --tag quay.io/operator-framework/example-index:1.0.1`

This would remove all but the `prometheus` package from the index.

#### export

`opm index export` will export a package from an index image into a directory. The format of this directory will match the appregistry manifest format: containing all versions of the package in the index along with a `package.yaml` file. This command takes an `--index` flag that points to an index image, a `--package` flag that states a package name, an optional `--download-folder` as the export location (default is `./downloaded`), and just as the other index commands it takes a `--container-tool` flag.

For example:

`opm index export --index="quay.io/operator-framework/monitoring:1.0.0" --package="prometheus" -c="podman"`

This will result in the following `downloaded` folder directory structure:

```bash
downloaded
├── 0.14.0
│   ├── alertmanager.crd.yaml
│   ├── prometheus.crd.yaml
│   ├── prometheusoperator.0.14.0.clusterserviceversion.yaml
│   ├── prometheusrule.crd.yaml
│   └── servicemonitor.crd.yaml
├── 0.15.0
│   ├── alertmanager.crd.yaml
│   ├── prometheus.crd.yaml
│   ├── prometheusoperator.0.15.0.clusterserviceversion.yaml
│   ├── prometheusrule.crd.yaml
│   └── servicemonitor.crd.yaml
├── 0.22.2
│   ├── alertmanager.crd.yaml
│   ├── prometheus.crd.yaml
│   ├── prometheusoperator.0.22.2.clusterserviceversion.yaml
│   ├── prometheusrule.crd.yaml
│   └── servicemonitor.crd.yaml
└── package.yaml
```

which can be pushed to appregistry.

**Note**: the appregistry format is being deprecated in favor of the new index image and image bundle format.

### External Container Tooling

Of note, many of these commands require some form of shelling to common container tooling. By default, the container tool that `opm` shells to is [podman](https://podman.io/). However, we also support overriding this via the `--container-tool`.

For example:

`opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.14.0 --tag quay.io/operator-framework/monitoring-index:1.0.0 --container-tool docker`

These commands require shelling to an external tool:

- `opm index add`
- `opm index rm`
- `opm index export`

### Self-Contained Container Tooling

There are a few commands that use self-contained container tooling. These commands do not require shelling to an external tool:

- `opm registry add`

#### Configuration

By default, the self-contained tooling uses the standard [Docker config](https://docs.docker.com/engine/reference/commandline/cli/#configuration-files) in the `~/.docker` directory. This can be changed by setting the `DOCKER_CONFIG` environment variable.

#### Authentication

Authentication options [can be added](https://docs.docker.com/engine/reference/commandline/login/#credentials-store) to the standard Docker config. The self-contained tooling should also be able to use the system credential store out-of-the-box.

repository: operator-framework/operator-registry

gha_language: Go

repo_name: operator-framework/operator-registry


text:
# DABBLE API ANGULAR EXERCISE
## by Patrick Fiorentino and James Nielson
#### Date: April 22, 2015

 An exercise in Angular JS creating an application that utilizes the Dribbble API to display thumbnails and pages of designs populated by independent designers. Following a Treehouse lesson while in class at Epicodus.

    ##Technologies Used
    - Dribble API
    - Anguler JS
    - HTML
    - CSS
    - Computers

    ##Use and Editing
    To use the app:
     - clone repository
     - start php/python/apache server in source directory
     - run http://localhost:8000

    #### Copyright © 2015, Patrick Fiorentino James Nielson
    #### License: [MIT](https://github.com/twbs/bootstrap/blob/master/LICENSE")

    #### No guarantees, no promises.  Don't use it for 'evil'.


text:
---
layout: writeup
ctf: ISITDTU Quals 2018
chal: Love Cryptography
flag: ISITDTU{break_LCG_unknown_all}
points: 424
category: crypto
---

>We are given a [love\_cryptography.py](love_cryptography.py) and a [enc](enc)

This looks like a simple cipher where the character is multiplied and then added by a constant modulo n

>ciphertext[i]=(m*ord(message[i])+c)%n

This looks quite easy to exploit, each character will be mapped to the same sequence.

Furthermore part of the ciphertext is given to us

>assert "ISITDTU" in mes

So firstly I tried to find instances of "I?IT?T", however my script accidentally double printed and I was left thinking that this wasn't the right way to solve

```python
for i in range(2,len(enc)):
    if(enc[i] not in seen):
        seen.append(enc[i])
    if(enc[i]==enc[i-2]):
        print(str(seen.index(enc[i]))+"True")
    print(seen.index(enc[i]))
#try to spot the fatal error
```

I saw

```
19
20
19True
19
21
22
21True
```

in the output, which seemed like my code found "I?IIT?T", however I forgot to write an ```else:```, causing it to double print, spent an hour trying to figure out why it didn't work until my teammate(Tuan Linh) gave me the position of "I?IT?T"

Now knowing where ISITDTU is, we can finally start the calculating m,n,c

## Exploit

First, notice that S,T,U are constitutive ASCII letters, that means that ```ord(S)+1=ord(T)``` and ```ord(T)+1=ord(U)```

Now if we look at how the ciphertext is generated, we found an easy way to calculate m%n, which can be treated as m under integers mod n

```
m1=enc[pos of T]-enc[pos of S]
m2=enc[pos of U]-enc[pos of T]
```

When we run this to find m1 and m2, we see that m1 is positive but m2 is negative. This means that enc[pos of T]+m>n, thus enc[pos of U]=enc[pos of T]+m-n

Thus we got m and n already, c can also be obtained easily

m*ord(S)+c=enc\[pos of S\](mod n)

and c is easily obtained

Thus we have a simple code to calculate m,n and c

```python
m1=enc[T]-enc[S]
m2=enc[U]-enc[T]
n=abs(m1-m2)#empirically observed that m2 is negative and m1 is positive
m=m1%n#just in case i mess up
c=(enc[S]-m*ord("S"))%n
```

Since we know ```ciphertext[i]=(m*message[i]+c)%n```, we can calculate message[i] by ```message[i]=(k*(ciphertext[i]-c))%n``` where k is a number that satisfies ```k*m mod n=1```, which can be easily computed with the Euclidean algorithm

[exploit.py](exploit.py)

path: /_writeups/2018/ISITDTU Quals 2018/Love CryptoGraphy/2018-07-28-Love CryptoGraphy.md

filename: 2018-07-28-Love CryptoGraphy.md


text:
---
layout: default
---

# 1996-09-06 - Re: [DREK] Neo-Nazis etc.

## Header Data

From<EMAIL_ADDRESS>(Dave Harman OBC)

To: _N/A_

Message Hash: 6dee4e4fd42785509d2e16c062059891ab6e0822462256555acf86c4b2af0b7e

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-09-06 23:07:33 UTC

Raw Date: Sat, 7 Sep 1996 07:07:33 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Dave Harman OBC)
Date: Sat, 7 Sep 1996 07:07:33 +0800
Subject: Re: [DREK] Neo-Nazis etc.
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

! : Try to keep in mind that "Nazis" aren't skinheads and other
! : troublemakers exactly, which is to say, those are the first people
! : Hitler got rid of when he came to power.
! :
! : Real Nazis are/were bureaucrats; cold, calculating, bureaucratic. Do we
! : know anyone like that?
! :
!
! Reminded me of the following:
!
! 	"You think swastikas are cool.
! 	 	They're coaches, businessmen, and cops.
! 	In a real Fourth Reich, you'd be the first to go."

  Thank you.

{% endraw %}
```

## Thread

+ Return to [September 1996](/archive/1996/09)

+ Return to "[Dale Thorn <dthorn@gte.net>](/authors/dale_thorn_dthorn_at_gte_net_)"
+ Return to<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)](/authors/dlv_at_bwalk_dm_com_dr_dimitri_vulis_kotm_)"
+ Return to "[Mark Rogaski <wendigo@pobox.com>](/authors/mark_rogaski_wendigo_at_pobox_com_)"
+ Return to<EMAIL_ADDRESS>(Dave Harman OBC)](/authors/qut_at_netcom_com_dave_harman_obc_)"

+ 1996-09-06 (Sat, 7 Sep 1996 02:18:32 +0800) - [Neo-Nazis etc.](/archive/1996/09/7f31d4055c561d28d311e67bddfbcdc6db752973ac070f0b93e243748bf43f6a) - _Dale Thorn<EMAIL_ADDRESS>  + 1996-09-06 (Sat, 7 Sep 1996 05:18:22 +0800) - [Re: [NOISE] Neo-Nazis etc.](/archive/1996/09/72aebfe38d0dcdc6ef5b838db94eb38b19dbef2ff265e8b7f9b532e2e26cf269) - _Mark Rogaski<EMAIL_ADDRESS>    + 1996-09-06 (Sat, 7 Sep 1996 07:07:33 +0800) - Re: [DREK] Neo-Nazis etc. -<EMAIL_ADDRESS>(Dave Harman OBC)_
  + 1996-09-07 (Sat, 7 Sep 1996 15:41:03 +0800) - [Re: Neo-Nazis etc.](/archive/1996/09/b38d9b46b0f9139daf452215b8494e131888a7ebd308bfe91780fc54c465a680) -<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)_