text:
## Coding challenge - Count field name occurrence

### Original problem description

Please write a program in C that reads and analyzes the content of a file. The file in question contains any number of well-formed
HTTP headers (rfc 2616) and their values in canonical form. Your program needs to read this file and determine the number of times
a set of headers (chosen at compile time) occurs in the file.

For example, if your program tracked the 'Connection', 'Accept', and 'Content-Length' headers, and is run against the following file:

<file start>
Content-Length: 10
User-Agent: Test
Content-Length: 14
Accept: comedy
Content-Length: 100
Content-Encoding: gzip
Connection: close
User-Agent: Test
Accept: flash
User-Agent: Test1
Content-Length: 20
User-Agent: Test2
User-Agent: Test3
Accept: gzip
<file end>

it should indicate that Content-length was seen 4 times, Accept 3 times, etc. As a matter of practice, we recommend that
your program try to match all the headers that a browser might be interested in.

The program does not need to do anything with the header value. Also, when thinking about this solution, please optimize for
CPU, meaning that it's okay to take extra memory if you can find a good algorithm to reduce the processing.

### Revised problem description

The above is very vague and overly confusing.

Scan a text file for lines of text matching the following expression: ^[field-name]:.*$
and then count occurences of each field-name within the file.

Field-name is specified by rfc822; and is characters of ascii 33-126 except for colon.

Allow the fields desired to be processed to be specified when the program is run.

### Initial considerations

Generally to solve a problem such as this it makes the most sense to simple use a red-black tree with a simple
string hashing ( numerical hashing ) algorithm in order to store the counts of the field names.

That said, the last line of the original problem description says to "optimize for CPU and use extra memory".
This seems to imply that what is being looked for is a knowledge of a trie, doing a lookup when each character
is used; a 1->[character list] mapping, instead of a 1->2 binary tree structure using a numerical hash value.
I don't think such a structure is optimal as hash number computation of a tree is extremely fast and binary trees
such as self balancing trees ( red black trees being an example ) are optimal for that sort of lookup.

Another possible option would be to use perfect hashing to take in all possible known header field names and then
use those to point directly into a range of memory capable of handling counts for all possible keys. This would be the
most optimal potentially computation wise as the algorithm for numeric hashing can be minimalized based on the key
space ( limited number of field names that are in actual practical use ). Given a need for the speed difference between
this and a classic hashmap method using a general hashing algorithm, I don't think it is worth going down this route.

If the field names present within the file were given from the start, that would make perfect hashing an optimal
solution. They are not.

Conclusion: Most straightforward sane method of doing this is to use a numeric hashing of field names, and store
counts in a self balancing red-black tree. This said, there is a potential optimization possible here. If you consider
the red-black tree containing the counts to have only "valid paths" leading to counts that you "want to store", you
could skip navigation of the tree once you reach a subtree where no keys that you wish to count are possible to
navigate to. If the list of keys being counted is low, this optimization would save a bunch of memory lookups for
field names that are being ignored. To do this would require tweaking the nodes in the red-black tree implementation
to be able to operate on all the nodes in it leading to the successful tracked values. It would be a fun optimization.

Another possible method would be to use standard numeric hashing and bucketing into a semi-large region of memory.
In this fashion one can do a direct lookup of the count using just a single memory lookup to the node, and then
matching of the full field-name to ensure one is at the correct bucket. Depending on the number of different field
names within the file this will be more optimal / take less memory lookups compared to a tree approach.

This would only, though, be optimal if the file is large enough to warrant the time needed to allocate/reserve the
section of memory. The memory needs to be wiped in that region also. Certain memory allocation methods on Linux
can return already zeroed sections of memory in certain conditions, but it should not be relied on. That could be
mitigated by leaving the program running as service and only zeroing out counts for the field names being looked at
on each run.

Since using a direct lookup seems optimal computation wise I will go with that method.

# Conclusion of implementation method

Use a highly performant numeric hash ( with proper mixing ) to generic a bucket lookup ID with which to store counts
of fields.


text:
![Kitura](https://raw.githubusercontent.com/IBM-Swift/Kitura/master/Documentation/KituraLogo.png)

**Sample stub server using Kitura Web Framework**

## Summary

This is a sample [Kitura](https://github.com/IBM-Swift/Kitura/) application.

## Clone, build and run
1. `git clone https://github.com/FutureWorkshops/KituraStubServer.git && cd StubServer`

2. `swift build`

3. `./.build/debug/StubServer`

  You should see message _Listening on port 8091_.

4. Open your browser at [http://localhost:8090](http://localhost:8090)

## Running in Xcode

You can also run this sample application inside Xcode by opening StubServer.xcodeproj
## License

The gem is available under the terms of the [MIT License](http://opensource.org/licenses/MIT).

license: MIT

repository: FutureWorkshops/KituraStubServer

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: FutureWorkshops/KituraStubServer


text:
[![Backlog](https://badge.waffle.io/haronk/binarydigger.png?label=backlog&title=Backlog)](https://waffle.io/haronk/binarydigger)
[![Stories in Ready](https://badge.waffle.io/haronk/binarydigger.svg?label=ready&title=Ready)](http://waffle.io/haronk/binarydigger)
[![In Progress](https://badge.waffle.io/haronk/binarydigger.svg?label=in%20progress&title=In%20Progress)](http://waffle.io/haronk/binarydigger)
[![Done](https://badge.waffle.io/haronk/binarydigger.svg?label=done&title=Done)](http://waffle.io/haronk/binarydigger)

# Binary Digger

## Introduction

The idea of **BinaryDiger** (BD) is to help programmers inspecting unknown data formats and traversing quickly known ones.

BD uses plugin system for digging different data formats.
There are 2 different types of plugins: compiled and script based. Compiled plugin is a dynamic library that provides
specific interface for the main application to access hierarchical data.
Scripter (script based plugin) is also dynamic library which loads external scripts to parse data.

In current state Gui supports only view mode for data file.

## Screenshots

![Compiled plugin](images/BinaryDigger1.png "Compiled plugin")

![Lua scripter](images/BinaryDigger2.png "Lua scripter")

## Features

### Modularity

BD is built around interface implemented by plugins. Gui is a standalone application that loads plugins and uses their functionality to parse binary data into hierarchical structures.
Main requirement for the both parts of system (plugins and Gui) is supporting same interface.
In this case plugins and Gui are independent and could be developed separately.

### Compiled plugins

To add new compiled plugin just add new \*.cpp file into *BinaryDigger/plugins* folder and recompile project.
For examples look into existing plugin files.

#### Syntax

Plugin contains templates and plugin definition.

Template is defined by **TEMPL** and **TEMPL_END** macrosses.

```cpp
TEMPL(name, params...)

    // C++ code and template fields definitions
    ...
TEMPL_END
```

Where **name** is template name (without quotes) and **params** is parameters declaration similar to C-function parameters declaration.

To declare and use template elements several macrosses and methods could be used:

* **VAR** - simple element declaration.

```cpp
    VAR(WORD, size);
```

* **ARR** - array elemnt declaration.

```cpp
    ARR(CHAR, tag, 3);
```

* **VAL** - retrieve value of the POD element of the current template.

```cpp
    VAR(WORD,  entryNameLen);
    ARR(CHAR,  entryName, VAL(entryNameLen));
```

* To access subelement use following approach:

```cpp
TEMPL(T1)
    VAR(DWORD, len);
TEMPL_END

TEMPL(T2)
    VAR(T1, t1);
    DWORD_T = t1->item<DWORD>("len");
TEMPL_END
```

* To get or set file position use **getPosition** and **setPosition** methods:

```cpp
    bd_u64 pos = getPosition(); // retrieve current position
    setPosition(dataOffset);    // set new one
    ARR(UCHAR, data, 10);       // read data at those position
    setPosition(pos);           // return to the current position
```

There are several predefined templates for the POD types: **CHAR**, **UCHAR**, **WORD**, **DWORD**, **QWORD** and **DOUBLE**.

To make template available for using outside it should be registered:

```cpp
TEMPL(T1)
    VAR(DWORD, len);
TEMPL_END

PLUGIN(T1Plugin)
    TEMPL_REGISTER(T1);
PLUGIN_END
```

There should be at least one registered plugin.

### Scripters

Scripter (scripting plugin) doesn't provide any hardcoded templates. It uses script to generate parsed tree.

Gui application supports configurable highlighting in the script editor window.

> In current state Gui supports highlighting file only for Lua. This will be fixed in the future.

#### Syntax highlighting

Syntax highlighting subsytem uses Json format for configuration files. See example in [lua.json](gui/BinaryDigger/syntax/lua.json) file.

Configuration can contain several sections:

1. **regexps** - generic regular expression mappers. Each subelement contains:

2. **keywords** -

3. **comments** -

4. **formats** -

#### Lua scripter

To compile Lua scripter you should update as described
[here](http://stackoverflow.com/questions/23574323/why-cant-i-catch-a-luabinderror-exception-when-my-lua-code-throws-an-error).
Otherwise exceptions from Luabind will not be catched and program terminates.

## Development tools.

- GUI: Qt.
- Plugins: plain C interface. Macroses are used to specify data templates/structures.
- Scripting: Lua. Script has only read access to the hierarchy tree.
- Build system: CMake.

[Installation instructions](INSTALL.md).

## Versions features.

### Version 0.1.0

- HEX view and synchronization with tree navigation (http://qt-apps.org/content/show.php/?content=133189)
- GUI with tree view
- defining templates as C macroses
- support of the minimum template types: char, short, int, int64, array, templ
- minimal Lua scripting support (console only)

### Version 0.1.1

- minimal Lua scripting support (Gui)
- configurable script syntax highlighting

### Version 0.X.0

- large files support (using memory mapped files or other techniques)
- multiple templates support: apply different templates to the hierarchy elements data (blobs)

## TODO

* Full Lua scripting support.
* Array as tree node. DONE
* *"size"* property of the node to specify predefined hardcoded node size. For the POD types generate "size" automatically.
* Postponed nodes loading/generation using "size" property. Additional parameter to specify deepness of tree generation.
* Node properties (size, color, toString, endian, ...).

repository: HaronK/BinaryDigger

repo_name: HaronK/BinaryDigger


text:
[ ![Codeship Status for cloverinteractive/runtime-picker](https://app.codeship.com/projects/96305c50-5e62-0136-f3f4-6e975dd0f2b8/status?branch=master)](https://app.codeship.com/projects/296056)
[![Coverage Status](https://coveralls.io/repos/github/cloverinteractive/runtime-picker/badge.svg?branch=master)](https://coveralls.io/github/cloverinteractive/runtime-picker?branch=master)

Runtime-Picker
==============

A react-bootstrap Popover that let's you set a runtime like i fyou were entering time in a microwave.

---

## Dependencies

These are the things your project needs for runtime-picker to work.

* react
* react-dom
* react-bootstrap

## Installation

```
yarn add runtime-picker
```

You can then import it into your webpack components as follows:

```es6
import RuntimePicker from 'runtime-picker';
```

## Usage

Runtime-Picker generates a hidden text field containing the runtime picked calculated in seconds,
so you can submit this as part as our form, however you can send your custom `onChange` handler and
receive the number of seconds when the component updates.

### Runtime-Picker Props

| Property | Type | Default | Description |
|:---|:---|:---|:---|
| `disabled` | boolean | `false` | Whether the runtime picker should be disabled, this renders a hidden input as well and visible text field with the parsed runtime |
| `maxHours` | number | `9999` | This is the max number of hours you can enter in your runtime |
| `name` | string | `'runtime'` | The name of the hidden text field containing the runtime in seconds |
| `onChange` | Function | `undefined` | Event handler to be called after the component updates |
| `placeholder` | string | `'HHHH:MMM:SS'` | Visible text field placeholder text |
| `placement` | string | `'bottom' \| 'left' \| 'right' \| 'top'` | This is the Popover position relative to the visible text field |
| `skipSeconds` | boolean | `false` | Whether we wish to start from minutes instead of seconds and lose some granularity |
| `title` | string | `'Pick your Runtime'` | This is the Popover's title |
| `value` | number | `0` | This is the startoff value in seconds |

## Caveats

If you're rendering inside a `<Modal />` make sure to set your modal's `enforceFocus` prop to `false`.

repository: cloverinteractive/runtime-picker

gha_language: JavaScript

gha_license_id: MIT

repo_name: cloverinteractive/runtime-picker


text:
#

## The Jupyter notebook theme for ![LaTeX](https://render.githubusercontent.com/render/math?math=\LaTeX) lovers ![heart](https://render.githubusercontent.com/render/math?math=\heartsuit)

The  theme aims at combining the flexibility and interactivity of Jupyter notebooks with the unique elegance and sobriety of a `LaTeX` article.

### `noTeXbook` in a Nutshell

- *Computer Modern* fonts for Markdown typesetting;
- `Fira Code` (_open source_) font for **Code** editor (with ligatures support);
- `Hack` (_open source_) font for **Markdown** editor (slightly better for text writing, _ed._);
- Multiple Colour Syntax highlighting themes;
- Extra `CSS` classes for additional LaTeX-ish formatting use cases (e.g. _footnotes_, _dropcap_);
- **Full** support for Jupyter Notebooks and JupyterLab (version `2.0x`).

### Sneak Peek?

Here is a [**Preview**](https://leriomaggio.github.io/notexbook-jupyter-theme/) of how \[a\] `noTeXbook` looks like!

### Setup `noTeXbook` Theme

The  `noTeXbook` theme is available on [PyPi](https://pypi.org/project/notexbook-theme/) as a Jupyter Notebook
(Python) extension:

```shell
$ pip install notexbook-theme
```

Once installed, just `load` the `notexbook` extension into a Jupyter notebook cell:

```jupyterpython
%load_ext notexbook
```

The theme can be activated via the `%texify` IPython magic 🔮:

```jupyterpython
%texify  # default theme settings will be used
```

#### `%texify` IPython magic

The `%texify` IPython magic embeds the `noTeXbook` theme directly into the current notebook.
This results into the following three unique features:

1.  **on-demand activation**: the theme is enabled **only** for selected notebooks, without having to
	[change](https://jupyter-notebook.readthedocs.io/en/stable/security.html?highlight=custom.css#javascript-and-css-in-markdown-cells)
	the (global) default Jupyter notebook theme.

2.  **portable**: the theme is embedded directly into the notebook (as the output of a single cell).
	Therefore, whenever the notebook will be *shared* and/or *exported* (e.g. in HTML or PDF via `webpdf`),
	the theme will continue to be available, with no extra installation required.
	Similarly, *disabling the theme* becomes as easy as *clearing* the output of the `%texify` cell.

3.  **customisable**: the theme allows for an easy customisation (e.g. enabling multiple **editor themes**)
	via `IPython magic` line arguments.

#### Magic Line Arguments and Theme settings 🪄

The `%texify` IPython magic 🔮 supports the following arguments:

```shell
-cdth <{material,github,github2,crisp}>, --code-theme <{material,github,github2,crisp}>
	Colour Theme for Code Editor

-mdth <{material,typora}>, --md-theme <{material,typora}>
	Colour Theme for Markdown Editor

-cdfs CODE_MONO_FONT_SIZE, --code-fontsize CODE_MONO_FONT_SIZE
	Font size used in Code and Markdown Editor. Default: 16px

-mdfs MD_MONO_FONT_SIZE, --md-fontsize MD_MONO_FONT_SIZE
	Font size of Rendered Markdown monospace. Default: 17px

-nbfs NB_FONT_SIZE, --notebook-font-size NB_FONT_SIZE
	Font size of Rendered Content in Notebook. Default: 17px

-lh NB_LINE_HEIGHT, --linespread NB_LINE_HEIGHT
	Line height of Notebook Content. Default: 1.4

-v, --verbose
	Verbose mode: Display the list of enabled Theme settings.
```

**Examples**:

```jupyterpython
%texify --code-font Monaco --linespread 1.3 -fs 18
```

In these settings: (1) the `Monaco` font will be used for code editor; (2) notebook font size will be set to `18px`,
and the line height will be `1.3`.
**Note**: To actually use the `Monaco` font for code editor, the font must be available and installed on your local machine.
If that is not be the case, the default code mono font (i.e. `Fira Code`) will be used as a fallback.

```jupyterpython
%texify --code-theme github
```

In these settings, the **new** `github` Code Editor theme will be used for code syntax highlighting, substituting the
default _Material Design_ theme. This theme is inspired by the current code theme on GitHub.

To see the **full** list of configuration options :

```jupyterpython
%texify?
```

### There's more...

The `noTeXbook` theme is **also** available as a **full-fledged** _custom_ Jupyter notebook theme (HTML/CSS).
This is useful in case you would prefer to enable the theme as **the** global custom default Jupyter theme.

The `noTeXbook` theme package is available for [download](https://github.com/leriomaggio/notexbook-jupyter-theme/releases),
along with its corresponding [documentation](https://github.com/leriomaggio/notexbook-jupyter-theme/blob/custom-css/README.md).
The documentation also contains details on the original CSS design, and instructions on how to define
your own CSS Editor Colour theme.

**Last but not least**, **Experimental** theme integration for Google Colaboratory Notebooks (via the
    [Stylus](https://en.wikipedia.org/wiki/Stylus_(browser_extension)) browser extension)
is also available. See [here](https://github.com/leriomaggio/notexbook-jupyter-theme/blob/texbook-colab/README.md)
for more information.

### `noTeXbook` shall by *thy* name

When I had to think to a name for this project, I aimed almost immediately at finding a single word that would
convey the idea of integration between `LaTeX` and notebooks I had in mind.
So
seemed quite an obvious choice.
Moreover, this name itself is also a unique [portmanteau](https://www.merriam-webster.com/dictionary/portmanteau)
(`port·man·teau | \ pȯrt-ˈman-(ˌ)tō`) that blends together the words **noTe**X**book**, and
no**TeXbook**, that is the name of [Donald E. Knuth](https://en.wikipedia.org/wiki/Donald_Knuth)'s
[book](http://www.ctex.org/documents/shredder/src/texbook.pdf) on `TeX`.

That was the omen... 🤩.

> One!... Two!... Five!

(_from_:  [The Holy Hand Grenade](https://www.youtube.com/watch?v=xOrgLj9lOwk) - Monty Python and the Holy Grail)

The
project wishes to pay a tribute of gratitude (in the name, and in the content) to two of the technologies I do use
(and love) the most as a researcher and as a data scientist.

### Project Links

- 📦 [PyPi package](https://pypi.org/project/notexbook-theme/)
- 🖌 [Official GitHub Repo](https://github.com/leriomaggio/notexbook-jupyter-theme/)
- 🚀 [Documentation and GitHub Page](https://leriomaggio.github.io/notexbook-jupyter-theme/)

#### Credits

* The [`spinzero`](https://github.com/neilpanchal/spinzero-jupyter-theme) jupyter theme has been inspirational in the design of the early version of this theme;
* The idea of overlay of selected cells has been inspired from [this](https://gist.github.com/formigone/dbabdd4ae38ded54b6f028713ac78c8a) custom theme.
* Inspiration on the choice of Monospace fonts for code and markdown has come from this [article](https://fontsarena.com/blog/best-programming-fonts/)
* Original versions of colour themes for code and markdown editors:
	- [Material Design Light](https://github.com/JonaDuran/Material-Light-Theme/)
	- [GitHub Light](https://github.com/primer/github-syntax-light)
	- [Crisp Rainglow Collection](https://github.com/rainglow/vscode/)

#### References

(Some links I found useful along the way):

- [Computer Modern on the Web](https://www.checkmyworking.com/cm-web-fonts/)
- [`setuptools`: Specify Dependencies](https://python-packaging.readthedocs.io/en/latest/dependencies.html)
- [How to Add Custom `setup.py` commands](https://jichu4n.com/posts/how-to-add-custom-build-steps-and-commands-to-setuppy/)
- [`pyproject.toml`](https://martin-thoma.com/pyproject-toml/)
- [What the heck is `pyproject.toml`](https://snarky.ca/what-the-heck-is-pyproject-toml/)
- [Jupyter Server Extension](https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Distributing%20Jupyter%20Extensions%20as%20Python%20Packages.html) (Particularly useful in earlier version of this project in which fonts where handled as local resources)

#### Acknowledgments

Special thanks to [cdesio](https://github.com/cdesio), [ninadicara](https://github.com/ninadicara), and [alanderex](https://github.com/alanderex) for testing earlier versions of the theme!


text:
# Login App

Originally developed for 180 Studios in Santa Rosa, CA, this Python app was developed to fit a need of a free, simple, open source member management system for our makerspace.

It uses a simple json-based database library, TinyDB, to keep track of members and when they've visited. Currently, members are given barcodes to enable login, but we are looking to add RFID support soon.

The core tenets of this application are:

- Free
- Easy to use
- Full featured

The GUI is written in tkinter for ease of quick development and as a learning exercise. Pull requests for new features and improvements are welcome.

gha_language: Python


text:
## Kendo UI Themes

Kendo UI widgets include a number of predefined themes. In this chapter you'll learn how to make your app look amazing using Kendo UI themes.

### Theme Change

    Exercise: Theme the application.

If the project is running, **stop** the project.

In Visual Studio's Project Explorer, **Right click** on the project and choose **Telerik UI For MVC > Configure Project** from the menu.

From the Project Configuration Wizard, **choose** the Nova theme.

**Open** `Views/Shared/_Layout.cshtml` and move `@Styles.Render("~/Content/css")` just above the closing head tag `</head>`.

**Run** the application to see the theme applied to the Kendo UI widgets.

Next, you'll be finishing the theme by adding styles to non-Kendo UI elements creating a completely custom look.

A style sheet was installed with the boilerplate to give you a jump-start. **Add** it to the application by opening `Views/Shared/_Layout.cshtml` and adding a reference to `~/Content/site-nova.css` just above the closing head tag `</head>`.

Note: This is CSS, so the order in which the style sheets are added is very important.

    <link href="~/Content/site-nova.css" rel="stylesheet" />

**Refresh** the application and notice the look is starting to come together. There's just a few items that could use some fine-tuning. Let's add some additional styles to `site-nova.css` to complete the theme.

**Open** site-nova.css and **find** `/* Side Panel - Employee List */`. **Add** a style that sets the date picker widgets inside the menuPanel to %100 width of the container.

The resulting code should be:

	/* Side Panel - Employee List */
	#menuPanel .k-widget.k-datepicker.k-header {
	    width: 100%;
	}

![Date Picker Width](images/chapter10/datepicker-width.jpg)

**Add** a style to offset the employee list so its content lines up with the left edge of its container.

	#employee-list > ul {
    	margin: 0 -10px;
	}

![Date Picker Width](images/chapter10/list-view-container.jpg)

**Find** `/* Small Devices, Tablets, and Up */`. Here you'll find a media query that will hold some styles that are only applied to scree sizes above `768px`.

	@media only screen and (min-width : 768px) {

	}

Inside the media query **add** a selector for `.app-wrapper` and **set** a left margin of `-15` and **set** the `position` to `relative`. This style will align the app with the left hand edge of the screen.

	/* Small Devices, Tablets, and Up */
	@media only screen and (min-width : 768px) {
	    .app-wrapper {
	        position: relative;
	        margin-left: -15px;
	    }
	}

![App Wrapper margin](images/chapter10/app-wrapper.jpg)

Finally, set the Kendo UI Chart themes.

**Open** `_MontlySalesByEmployee.cshtml` and **set** the `Theme` property to `nova` on the `EmployeeAverageSales` chart.

	@(Html.Kendo().Chart<KendoQsBoilerplate.MonthlySalesByEmployeeViewModel>()
        .Name("EmployeeAverageSales")
        ...
        .AutoBind(false)
       	.Events(e => e.DataBound("onAverageSalesDataBound"))
        .Theme("nova")
	)

**Open** `_QuarterToDateSales.cshtml` and **set** the `Theme` property to `nova` on the `EmployeeQuarterSales` chart.

    @(Html.Kendo().Chart<KendoQsBoilerplate.QuarterToDateSalesViewModel>()
        .Name("EmployeeQuarterSales")
        ...
	    .AutoBind(false)
        .Events(e => e.DataBound("onQuarterSalesDataBound"))
        .Theme("nova")
	)

And... that's it! You've created an interactive dashboard application using Telerik UI for MVC and Kendo UI. In the process you've mastered scaffolding, Kendo UI templates, charts, server and client-side APIs, responsive web design and themes.

Congratulations!


text:
# Ruby HAML-JS

Precompiles the HAML-JS templates into a function.

This can be used as a standalone template or as part of Rails 3.1 assets pipeline.

For example, if you have a file `app/assets/javascripts/templates/comment.jst.hamljs` with the following content:

```haml
.comment
  .author= author
  .text= text
```

Then it will be *compiled* on the server side into a plain JavaScript function.
It doesn't require you to do anything on the client side.
And the result will look like this:

```javascript
(function() {
  this.JST || (this.JST = {});
  this.JST["templates/comment"] = function (locals) { function html_escape(text) {
      return (text + "").
        replace(/&/g, "&").
        replace(/</g, "<").
        replace(/>/g, ">").
        replace(/\"/g, """);
    }
  with(locals || {}) {
    try {
     var _$output="<div class=\"comment\"><div class=\"author\">" +
  html_escape(author) +
  "</div><div class=\"text\">" +
  html_escape(text) +
  "</div></div>";
   return _$output;  } catch (e) {
      return "\n<pre class='error'>" + html_escape(e.stack) + "</pre>\n";
    }
  }
  };
}).call(this);
```

Then you access that template like so:

```javascript
var commentView = JST['templates/comment'];
// ...
// Somewhere in your code later:
var html = commentView({author: 'Dima', text: 'Looks nice'});
```

# Installation

```ruby
# Gemfile
gem 'ruby-haml-js'
```

```bash
# Then install it
bundle
```

# Usage - with Rails 3.1 assets pipeline

1. Put your template unders `app/assets/javascripts` (or other path where Rails can find it).
2. Use the naming `my-template.jst.hamljs`.
3. Serve the template to browser by `require my-template` from `application.js` or link to it as `my-template.js`
4. Use the template from the JavaScript: `JST['my-template']({your: 'local', variables: 'go here'})`

# Configuration

## Custom HTML escape

You can change the escape function from the built-in, autogenerated to your own:

```ruby
# Set it somewhere, before generating the template.
# Good place can be a Rails initializer.
RubyHamlJs::Template.custom_escape = "App.escape_html"
```

This will use the given function and will not generate custom escape code inside each template.
But you need to make sure that the function is defined before using the templates in JavaScript.

## Custom haml.js

If you need a custom version of haml.js library you may specify it using the haml_path

```ruby
RubyHamlJs::Template.haml_path = "path/to/haml.js"
```

# Development

- Source hosted at [GitHub](https://github.com/dnagir/ruby-haml-js)
- Report issues and feature requests to [GitHub Issues](https://github.com/dnagir/ruby-haml-js/issues)

Pull requests are very welcome! But please write the specs.

To start, clone the repo and then:

```shell
bundle install
bundle exec rspec spec/
```

gha_language: Ruby


text:
# Test document

Applications correctness has been tested with automatic unit tests and manually via user interface. Performance tests are performed with solving multiple 15-puzzles and calculating average solving time for each algorithm.

## Test coverage

Overall test coverage is ~ 95-98%:

![Coverage](https://github.com/MiguelSombrero/fifteen-puzzle-solver/blob/master/documentation/pics/overall_coverage.png)

## Unit testing

### fifteenpuzzlesolver, fifteenpuzzlesolver.ui

These packages contains main method and user interface and has left outside of the unit tests.

### fifteenpuzzlesolver.domain

This package contains classes for algorithms and puzzles. Test coverage is ~ 93-97%, although I'm not happy with the tests of AStar and IDAStar classes: I found it hard to test correctness of search() method. There could be also more tests about finding optimal solution.

![Coverage](https://github.com/MiguelSombrero/fifteen-puzzle-solver/blob/master/documentation/pics/domain_coverage.png)

### fifteenpuzzlesolver.service

Package contains only PuzzleService class, which provides methods for generating and solving puzzles. Test coverage is ~ 83-99%. There is basically one branch I'm not testing, which decreases test coverage. I'm using mock classes for mocking PuzzleSolvers, so that I can tests benchmark methods correctly.

![Coverage](https://github.com/MiguelSombrero/fifteen-puzzle-solver/blob/master/documentation/pics/service_coverage.png)

### fifteenpuzzlesolver.utils

Package contains data structures and puzzle generator. Test coverage is 100%. With PuzzleGenerator class I mainly tested that the returned puzzles are 'valid' puzzles.

![Coverage](https://github.com/MiguelSombrero/fifteen-puzzle-solver/blob/master/documentation/pics/utils_coverage.png)

## Manual testing

Manual tests are run mostly to check that user interface works correctly. Also manual testing has been run for single puzzles and for PuzzleGenerator, in order check their correctness.

## Performance testing

Explanation of table column names:

- Hardness = Number of moves used to generate puzzle. Puzzles are created with generatePuzzleByMoves() method, which traverses backwards from solved state by given moves
- n = Number of puzzles solved when calculating averages
- e = Application crashed due to a OutOfMemory error
- "-" = Out of patience error (solving took too long to wait)
- Time = Average time for solving puzzle
- Moves = Average of used moves for solving puzzle
- A* position = A* algorithm with position based heuristics
- A* manhattan = A* algorithm with manhattan heuristics
- A* collision = A* algorithm with manhattan + linear collision heuristics
- IDA* = IDA* algorithm with mentioned heuristic

### Time

Hardness | A* position | A* manhattan | A* collision | IDA* position | IDA* manhattan | IDA* collision
---------|-------------|--------------|--------------|---------------|----------------|---------------
5 (n=50) | 0.000s | 0.000s | 0.000s | 0.000s | 0.000s | 0.000s
10 (n=50) | 0.000s | 0.000s | 0.000s | 0.000s | 0.000s | 0.000s
20 (n=50) | 0.011s | 0.002s | 0.009s | 0.006s | 0.001s | 0.006s
30 (n=50) | e | 0.043s | 0.068s | 3.847s | 0.028s | 0.032s
40 (n=50) | e | 0.305s | 0.360s | - | 0.191s | 0.411s
50 (n=40) | e | 2.474s | 5.010s | - | 1.987s | 1.540s
60 (n=40) | e | 3.522s | 3.877s | - | 2.390s | 1.370s
70 (n=40) | e | e | 4.303s | - | 3.576s | 2.187s
80 (n=40) | e | e | 7.714s | - | 6.768s | 3.595s
90 (n=30) | e | e | 8.283s | - | 10.403s | 3.355s
100 (n=30) | e | e | 14.361s | - | 18.744s | 5.478s
120 (n=30) | e | e | e | - | 30.833s | 6.448s
140 (n=30) | e | e | e | - | 89.947s | 26.715s
160 (n=30) | e | e | 42.664s | - | 33.020s | 16.681s

### Moves

Hardness | A* position | A* manhattan | A* collision | IDA* position | IDA* manhattan | IDA* collision
---------|-------------|--------------|--------------|---------------|----------------|---------------
5 (n=50) | 4  | 4 | 4 | 4 | 4 | 4
10 (n=50) | 8 | 8 | 8 | 8 | 8 | 8
20 (n=50) | 18 | 18 | 19 | 18 | 18 | 19
30 (n=50) | e | 25 | 25 | 24 | 24 | 25
40 (n=50) | e | 29 | 30 | - | 29 | 29
50 (n=40) | e | 33 | 33 | - | 33 | 33
60 (n=40) | e | 35 | 36 | - | 35 | 35
70 (n=40) | e | e | 38 | - | 37 | 37
80 (n=40) | e | e | 38 | - | 38 | 38
90 (n=30) | e | e | 39 | - | 38 | 38
100 (n=30) | e | e | 39 | - | 39 | 38
120 (n=30) | e | e | e | - | 41 | 41
140 (n=30) | e | e | e | - | 43 | 43
160 (n=30) | e | e | 43 | - | 42 | 43

### Analyzis of heuristics

As performance tests clearly shows, position based heuristic is by far the worst. It performs as well as the other heuristics with easy puzzles (under 30 moves), but cripples completely with puzzles harder than that. I guess the number of tiles in wrong position cannot assort different game states well enough - there is simply too much draws.

Manhattan heuristic is clear improvement to position based heuristic. It performs as well as liner collision heuristic - some cases even better - with semi-hard (under 70 moves) puzzles.

It seems - according to the tests - that linear collision heuristics might overestimate the cost of reaching the solved state; in some cases, path found with linear collision heuristic has more moves than other heuristics. This might also explain why manhattan heuristic performs some cases better than linear collision - it needs to traverse shorter path to find goal. I have tested with 100K random puzzles, that heuristics never estimates the cost over 80 moves, but this doesn't prove that found solution is optimal.

### Analyzis of algorithms

A* is almost as fast as IDA* algorithm with easy puzzles. Harder the puzzle, greater the difference between A* and IDA* increases. A* algorithms clear downside is its memory consumption; solving hard puzzles usually leads to OutOfMemory error, because Java's heap space runs out. A* alforithm saves all the game states it is about to visit in priority queue, even though some of the states are clearly ones that it never traverses.

As stated in the implementation document, time-complexity of A* is O(lgV*V) and IDA* is O(V). Difference comes from the extraction of nodes from min-heap, which takes approximately O(lgV) time. A* algorithm seems to be little slower than IDA* algorithm, which verifies in practise the difference between time-complexities. However, logarithm stays very small even with huge V, so difference between effectiviness of A* and IDA* might also be due to something else, memory consumption maybe.

license: ISC

repository: MiguelSombrero/fifteen-puzzle-solver

repo_name: MiguelSombrero/fifteen-puzzle-solver


text:
# Hosting Iconify API

This article explains how to host Iconify on your server, so your website does not rely on Iconify public API servers.

[Iconify API](./index.md) software is available in 2 versions: Node.js and PHP

If you can, use Node.js version.

Node.js implementation is slightly faster. This is because in Node.js server uses one persistent process and all data is already in memory, so everything is ready for each request. PHP needs to load data on every request. PHP version has cache to improve speed, but it is still slower than Node.js.

## Source code

Everything you need is available at [Iconify GitHub repositories](https://github.com/iconify):

- [Node.js version of Iconify API](https://github.com/iconify/api.js)
- [PHP version of Iconify API](https://github.com/iconify/api.php)
- [Default icon data](https://github.com/iconify/collections-json)

## PHP

PHP version of API is easier to install.

See [Iconify API: PHP](./hosting-php/index.md) for installation and configuration instructions.

See [Iconify API: Node.js](./hosting-js/index.md) for installation and configuration instructions.

## Servers network

Iconify public API is hosted on multiple servers that form custom CDN. They are located in different parts of the world and visitors are always redirected to the closest server.

Host does CDN help? By connecting visitors to the closest server, latency is greatly reduced:

- Visitors from US are connected to one of servers located on different sides of the US.
- Visitors from Europe are connected to server in UK or server in Germany.
- For visitors from Asia there are servers in Singapore and Japan.
- For visitors from Oceania there is a server in Australia.

Additional servers may be added in other regions when needed.

How else does it help? Redundancy. Downtime happens. If one server has issues, you can quickly disable it and visitors will be routed to a different server. There are tools to automate it, such as Route 53 health checks.

Would you like to set up your own CDN for Iconify API? See [setting up custom CDN tutorial](./cdn.md).

For added security, Iconify public API also CloudFlare service. However, that does not change anything. Instead of connecting visitor to the closest server, CDN is used to connect CloudFlare edge server to the closest API. Iconify API still greatly benefits from latency reduction offered by a custom CDN.

repository: Natureshadow/documentation

repo_name: Natureshadow/documentation


text:
# creativity

Fun little toy Python that displays a short, random ASCII movie when you try to
install it. Then it uninstalls itself.

Contributions appreciated, support available via Twitter: [@ajaska](https://twitter.com/ajaska)

ASCII movies powered by [asciinema](https://asciinema.org/)

## Usage:

`pip install creativity`

repository: ajaska/creativity

repo_name: ajaska/creativity


text:
# PN5_60582

<PageHeader />

## Description

Add a new environment variable to:

1. configure the number of commands in the jShell command history
2. specify that the command stack is username based

### Previous Release Behavior

The command stack was previously limited to 50 entries.

The  command stack was port number based, meaning that a user coming in on a  different port number will not obtain the same stack entries.

### Current Release Behavior

A new environment variable, JSH\_COMMAND\_STACK, can be used to configure the jShell command history.

The command stack can be set to any number greater or equal to 50.

The command stack can optionally be username based with the literal **USERNAME** (see examples below).

For a command stack that has a maximum command history of 500 entries and is port number based:

```
JSH_COMMAND_STACK=500
```

For a command stack that is username based and has a default stack size of 50 entries:

```
JSH_COMMAND_STACK=USERNAME
```

For a command stack that is both username based and has a maximum stack size of 1000 entries:

```
JSH_COMMAND_STACK=USERNAME,1000
```

The *value* of the environment variable is case insensitive, e.g.

```
JSH_COMMAND_STACK=UserName
```

If the environment variable is unassigned or any part of the value is invalid:

1. the stack will be port number based
2. the maximum stack size will be 50

If stack size is less than 50 then the default (minimum) stack size will be 50 entries.

If the stack is username based and the user is logged in to more than one port then the stack will be shared.

This environment variable must be set prior to entering the jShell.

Back to [5.6.3 Release Notes](./../README.md)

<PageFooter />

repository: patpog/docs

repo_name: patpog/docs


text:
Data Reconciliation Engine (DRE)
=========

DRE is a patient frontend (UI) and Node.js server for reconciling health data.

[![Build Status](https://travis-ci.org/amida-tech/DRE.svg)](https://travis-ci.org/amida-tech/DRE)
[![Dependency Status](https://david-dm.org/amida-tech/DRE.svg)](https://david-dm.org/amida-tech/DRE)

High Level Overview
===================
![DRE High Level Diagram](docs/images/dre_overview_new.png)

The purpose of the Data Reconciliation Engine is to take personal health data in a variety of formats (starting with BlueButton/CCDA) from multiple sources and parse/normalize/de-duplicate/merge it into a single Patient's Master Health Record with patient assistance (although most of hard work will be done automagically).

DRE's components
=================
![DRE Components Diagram](docs/images/dre_four_components.png)

DRE has 4 primary elements

#### 1 - Parsing and Normalization Library.

This parses incoming data into a homogenous, simplified and normalized data model in JSON format.

Parsing library code: [amida-tech/blue-button](https://github.com/amida-tech/blue-button)

#### 2 - Matching Library.

This takes the standardized data elements and flags probable duplicate values. New patient records are compared against the existing Master Health Record and automatically matched. The result produces a list of all entries in the new record, labelled as duplicates (0 % match), new entries (100% match), or partial matches (to be reconciled by patient in a next step).

Matching library code: [amida-tech/blue-button-match](https://github.com/amida-tech/blue-button-match)

#### 3 - Reconciliation Interface.

This provides a RESTful API and UI for review and evaluation of duplicate or partially matched entries, by the patient.

#### 4 - Master Record Interface.

This provides a API for interaction with and access to the aggregated health record.

Documentation for record.js [API](./docs/recordjs.md)

### Screenshots of the Demo
-![Landing Page](./docs/images/1-LandingBars.png)
-![Master Health Record View](./docs/images/2-MyRecord.png)
-![My Files](./docs/images/3-MyFiles.png)

-![Reconciliation Interface](./docs/images/4-Match.png)
-![Billing Section](./docs/images/5-Billing.png)
-![Notes](./docs/images/6-NotesDetails.png)
-![Account History](./docs/images/7-History.png)

##Quick up and running guide

###Prerequisites

- Node.js (v0.10+) and NPM
- Grunt.js
- MongoDB
- Redis
- Ruby/Compass/Bower

#### prepare
```
# you need Node.js and Grunt.js installed
# and MongoDB + Redis runnning

npm install -g bower
gem update --system
gem install compass
npm install -g yo
npm install -g grunt-cli
npm install -g generator-angular

#then
npm install
bower install
```

To run, use `node server`

#### Grunt commands:

`grunt` - To run Server Side tests

`grunt test` - To run and watch Client Side tests. Make sure a Selenium server and Node are running with `webdriver-manager start` and `node server.js`.

`grunt travis-protractor` - To run Client Side tests. Make sure a Selenium server and Node are running with `webdriver-manager start` and `node server.js`.

```grunt build``` - Executes build and puts it into /dist.

```grunt live``` - Build and watch files for development (just linting, compiling styles and watching).

#### Protractor Tests:

```
# you need MongoDB, Redis, Node, and Selenium running
# option selects which suite of tests to run (populate, scenarios, and/or medications)
# screenshots and report are saved to ./protractor-result/

npm install -g protractor
protractor client/test/conf.js --suite option

```

## Contributing

Contributors are welcome. See issues https://github.com/amida-tech/DRE/issues

## Contributors

###### Amida team

- Dmitry Kachaev
- Matt McCall
- Ekavali Mishra
- Jamie Johnson
- Matt Martz
- Jacob Sachs
- Mike Hiner
- Byung Joo Shin (summer '14 intern, UVA)
- Kevin Young (summer '14 intern, UMD)
- Nadia Wallace (winter '15 intern, MIT)

###### PWC team

_We gratefully acknowledge PWC's essential support in the development of the FHIR components of DRE, among other important contributions to codebase of this open source project._

- Afsin Ustundag

## Release Notes

See release notes [here] (./RELEASENOTES.md)

## License

Licensed under [Apache 2.0](./LICENSE)


text:
# django-chemtrails

[![Code Health](https://landscape.io/github/inonit/django-chemtrails/master/landscape.svg?style=flat)](https://landscape.io/github/inonit/django-chemtrails/master)
[![Build Status](https://travis-ci.org/inonit/django-chemtrails.svg?branch=master)](https://travis-ci.org/inonit/django-chemtrails)
[![Coverage Status](https://coveralls.io/repos/github/inonit/django-chemtrails/badge.svg?branch=master)](https://coveralls.io/github/inonit/django-chemtrails?branch=master)
[![Documentation Status](https://readthedocs.org/projects/django-chemtrails/badge/?version=latest)](http://django-chemtrails.readthedocs.io/en/latest/?badge=latest)

Graphing Django

[Documentation available](http://django-chemtrails.rtfd.io/) on Read the Docs!

**BIG FAT WARNING**

This is experimental software in a really, really early pre-alpha phase.
The API is guaranteed to change without any notice. Please don't
use for anything whatsoever!

# What's all the fuzz about?
Who doesn't love graphs, charts and visual data?

This project springs from another project I'm working on which involves
a rather complex permission system. As a solution I'm looking into
using a graph to help determine if a user has permissions to perform
some action on an object, based on the relationship between entities.

## Meta data

Currently there is two kind of node types; `MetaNodes` and `ModelNodes`.
The `MetaNodes` contains no user data, but are meant to visualize the
structure of the database. Each node contains meta data such as
`app_label`, `model_name` and so on as well as relations to other
`MetaNodes`. They may also be connected to the actual `ModelNodes` by
flipping on a setting.

The image below displays all the `MetaNodes` for the `Bookstore` app
used to test and develop this library.

![The Bookstore meta graph](/docs/_static/example-meta-graph.png?raw=true "The Bookstore meta graph")

## Node data

`ModelNodes` on the other hand is more of a copy of a model instance.
It contains data from the the actual object, as well as relations to
other nodes.

The image below displays the `ModelNodes` for the `Bookstore` app.

![The Bookstore graph](/docs/_static/example-node-graph.png?raw=true "The Bookstore graph")

# Give it a spin

As stated earlier, for now this project is **not** suitable for any usage,
except fooling around a bit. If you'd like to try it out follow the steps below.

```
$ git clone https://github.com/inonit/django-chemtrails.git
$ cd django-chemtrails
django-chemtrails:$ docker-compose up -d
django-chemtrails:$ python manage.py migrate
django-chemtrails:$ python manage.py testgraph 2  # any number
Hang tight, this might take a little while...
Successfully created 2 bookstore graphs.
Check them out in the Neo4j web console!
```

Open the Neo4j web console at [http://localhost:7474](http://localhost:7474/browser/)
and enter a Cypher query to fetch everything.

```
MATCH (n) RETURN n
```

To wipe out the entire Neo4j database, enter the following Cypher query.

```
MATCH (n) DETACH DELETE n
```

repository: inonit/django-chemtrails

repo_name: inonit/django-chemtrails


text:
# Android Library (High-Level API) and Demo Application

This section contains the source code for Android demo application. The application uses a
high-level library, [PorcupineManager](/demo/android/porcupinemanager), for wake word detection. The library can be
used on its own to build always-listening Android applications. It manages all aspects of wake word detection
including configuring Porcupine, recording input audio, and sending notifications.

## Prerequisites

Consult the prerequisites section of [Android binding](/binding/android).

## Demo Application Usage

Using [Android Studio](https://developer.android.com/studio/index.html) open [demo/android](/demo/android) as an android
project and then run the application. Note that you need an android phone with developer options enabled connected to
your machine in order to run the application.

If you'd like to run tests navigate to [androidTest](/demo/android/app/src/androidTest/java/ai/picovoice/porcupine/demo) using Android Studio,
right click, and select `Run Tests in ai.picovoice.porcupine.demo` from drop down menu.

## Library Installation and Usage

You can add [PorcupineManager](/demo/android/porcupinemanager) as a dependency to
your Android app by consulting the documentation on
[Android Developers](https://developer.android.com/studio/projects/android-library.html#AddDependency) website.

[PorcupineManager](/demo/android/porcupinemanager) requires `RECORD_AUDIO` user permission. Be sure it is granted to your App.
Furthermore, Porcupine performs data-intensive operations such as recording/processing audio which should not be run on the
UI thread. Make sure you are following the [best practices for data-intensive operations](https://developer.android.com/training/multiple-threads/index.html).

The library can be initialized using

```java
    final String modelFilePath = ... // It is available at lib/common/porcupine_params.pv
    final String keywordFilePath = ...
    final float sensitivity = 0.5f;

    PorcupineManager manager = new PorcupineManager(
            modelFilePath,
            keywordFilePath,
            sensitivity,
            new KeywordCallback() {
                @Override
                public void run() {
                    // detection event logic/callback
                }
            });
```

When initialized, input audio can be monitored using ```manager.start() ```. When done be sure to stop the manager using
```manager.stop()```. `modelFilePath` should point to [model parameter file](/lib/common/porcupine_params.pv) which contains
neural network parameters. This file is shipped separately to reduce the size of library while supporting all ABIs. Furthermore,
`keywordFilePath` should point to an Android keyword file available at [resources/keyword_files](/resources/keyword_files). If you
like to use a different wake word please contact us at<EMAIL_ADDRESS>For more information about keyword files refer to
[tools/optimizer](/tools/optimizer). Finally, `sensitivity` is the parameter that enables developers to trade miss rate for false alarm. It is a floating number within
[0, 1]. A higher sensitivity reduces miss rate at cost of increased false alarm rate. For more information about this parameter
refer to [include/pv_porcupine.h](/include/pv_porcupine.h).

If you'd like to run the tests navigate to [androidTest](/demo/android/porcupinemanager/src/androidTest/java/ai/picovoice/porcupinemanager) using Android Studio,
right click, and select `Run Tests in ai.picovoice.porcupinemanager` from drop down menu.


text:
# Examples for Nuvoton N76E003 SDCC BSP

* [bsp-pwm](./bsp-pwm/readme.md): testing PWM capabilities of N76E003
* [bsp-pwm-asymmetric](./bsp-pwm-asymmetric/readme.md): two PWM signals generated by PWM interrupt handler
* [bsp-template](./bsp-template/readme.md): template project for the BSP
* [bsp-test](./bsp-test/readme.md): testing environment for bsp/lib
* [hpdl-1414](./hpdl-1414/readme.md) HPDL-1414 Alphanumeric display controlled using MCP23017 I2C 16-Bit I/O Expander
* [xy-lpwm-fw](./xy-lpwm-fw/readme.md): alternative firmware for XY-LPWM and clones
* [xy-lpwm-lcd]((./xy-lpwm-lcd/readme.md)): XY-LPWM LCD screen controlled by commands over serial port

branch_name: refs/heads/main


text:
centos-6.5-lamp-plus
====================

A simple modification of the https://vagrantcloud.com/smallhadroncollider/centos-6.5-lamp vagrant box

A PHP 5.3/MySQL developer environment with virtual hosts for separate parallel projects.

one time provisioning
---------------------
* additional port forwarding, host: 80 to guest: 80
* php53u-mbstring
* nano
* phpMyAdmin
* password for mysql (required by phpMyAdmin)
* virtual hosts
* php session.save_path changed
* php error reporting changed

provisioning done on every startup
----------------------------------
* add new virtual host from a local file
* restart httpd

tools
-----
* phpMyAdmin is available via [localhost/phpMyAdmin](http://localhost/phpMyAdmin)

additional vhosts HOW-TO
------------------------
1. create a new project dir under the public directory, i.e. *public/myproj*
2. edit the *provision/httpd.conf.add.new.vhost* file by copying the contents of httpd.conf.append and replacing the lines
  1. *DocumentRoot /vagrant/public* to *DocumentRoot /vagrant/public/myproj*
  2. *ServerName localhost* to *ServerName myproj.localhost*
3. edit your **host's** *hosts file* and add the new *myproj.localhost* domain targeted to <IP_ADDRESS>
4. run *vagrant reload*
5. have fun :)

requirements
------------
the original box requires the virtualizastion turned on in BIOS


text:
Use [Dropbox](http://www.dropbox.com) as the storage backend for your [Redmine](http://www.redmine.org) installation.

## Installation

To install the plugin, execute the following commands from the root of your Redmine directory:
```
cd plugins
git clone git://github.com/alexbevi/redmine_dropbox_attachments.git
bundle install
```

More information on installing Redmine plugins can be found in [Redmine Wiki](http://www.redmine.org/wiki/redmine/Plugins).

After the plugin is installed you will need to restart Redmine for the plugin to be available.

### Compatiblity

This plugin has been tested against [Redmine](http://www.redmine.org) 2.0+.   Dropbox API v2 support is supported as of f680dcd.

Though it "should" be capable of working with older (1.x) versions, no guarantees will be made ;)

### Uninstallation

To remove the plugin, from the root of your installation directory do the following:
```
rm -rf plugins/redmine_dropbox_attachments
bundle install
```

## Configuration

![Screenshot](screenshot.png)

The plugin must be configured from `Administration > Plugins > Dropbox Attachment Storage > Configure`

### Authorization

Before Redmine can store files on a shared Dropbox folder, it must be authorized. You'll need to create an app at [the Dropbox Developer portal](https://www.dropbox.com/developers), and then enter the app's key and secret in the plugin's settings page within Redmine. Make sure that you have also added `https://your app's base url/dropbox/authorize` as an OAuth2 Redirect URI in the Dropbox developer portal so that Dropbox knows it's ok to send a token back to your app. Finally, get an OAuth token by clicking _Authorize Redmine with Dropbox_ on the same plugin settings page, then selecting _Allow_ from Dropbox's authorization page.

### Specifying a Base Directory

By default, the plugin will write to your Dropbox's `Apps > redmine_files` directory.

If you specify a *Base Directory* value, that subdirectory will be creted under Apps/redmine_files and used to store attachements for the plugin.

### Storing Attachments in a Project Hierarchy

If this option is checked, files will be stored in a folder structure in the format of:
```
/base
  /project
    /module
      file
      file
      file
```

This makes it easier to locate an attachment directly on Dropbox as there is a bit more context to the stored content.

### Storing Attachments for Multiple Redmine Installations

Since you can only register a single instance of this plugin with Dropbox, if you want to store attachments for multiple installations of Redmine, the steps are:

1) Authorize the plugin _ONCE_ with Dropbox

2) Copy the _Dropbox Token_ and _Dropbox Secret_ values from the authorized installation

3) Paste the token/secret values to each additional installation

Note that if you have multiple installations, it's a good idea to specify different base directories. If you happen to use the same project-identifiers across installations, the plugin will not be able to differentiate which installation a file should belong to.

## Acknowledgement

This plugin is heavily based on the [Redmine S3](https://github.com/tigrish/redmine_s3) plugin. Thanks to all the contributors there who've made this such an easy plugin to build ;)

I also used the [Redmine DropBox](https://github.com/zuinqstudio/redmine_drop_box) plugin to find some quick answers to interacting with dropbox.

### Thanks

Big thanks to [Alexander Nickel](https://github.com/mralexandernickel) for the initial implementation of the project folder hierarchy.

## Notes

Ruby 1.9+ is required in order for this plugin to work properly. Using Ruby 1.8.7 will result in

    NoMethodError (undefined method `<=>' for :root:Symbol)

when trying to delete an object (File, Issue, Document ... etc) that has an attachment.

### Issues Upgrading from v2.0.0

That version ignored the value of *Base Directory* and instead used a string value of "false".
Just copy the files from "false" to the desired directory.

### Issues Upgrading from 2.2.1

As of September 27, 2017, Dropbox no longer supports the v1 API that this plugin used in version 2.2.1 and prior; Dropbox's v2 API is now supported, but the authentication flow is slightly different and you will need to reauthenticate your app on the plugin settings page for everything to work.

## About

Copyright (c) 2012-2013 Alex Bevilacqua

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.

#### Shameless Plug(s)

If you like this plugin, feel free to [endorse](http://coderwall.com/alexbevi) me ;)

repository: sibdigital/redsd

repo_name: sibdigital/redsd


text:
# Display Extensions

Display extensions allow site administrators to change how the contribution tracker looks and functions on the client side. You can think of them like plugins for a template engine. They can alter things like the site name/logo, footer, and other pieces as functionality is added.

## Format

An extension must:

* Be located in the `extensions` directory (this one).
* Have an extension of `.ext.ts`, `.ext.tsx`, `.ext.js`, or `.ext.jsx`.
* Import/require the `register` function from `../ext`.
* Call `register` with two parameters:
    * `extensionPoint` _(string)_ - The name of the extension point (hook) where your extension will run.
    * `ext` _(function)_ - The function that will be called when this extension is triggered. Parameters and return values may vary for each extension point; see below.

### Example

See `DemoFooter.ext.tsx` in this directory. This extension adds a link to this project's GitHub page in the footer.

## Extension Points

The following are the current extension points shipped with oss-contribution-tracker. If you think there should be another, feel free to submit an issue or pull request.

### `footer`

Add a page footer with links to your site/company's support resources.

A [React functional component].

* Input:
    * `props` - React props. Empty.
* Return: a rendered React component.

### `navbar-logo`

Replace the "contribution Builder" text with your own text or logo.

A [React functional component].

* Input:
    * `props` - React props:
        * `children` - the default header text
* Return: a rendered React component.

### `navbar-links`

Add additional links to the navbar.

A [React functional component].

* Input:
    * `props` - React props:
        * `user` - an object describing the current user. See `App.tsx` for structure.
* Return: a rendered React component.

### `navbar-admin-links`

Add additional admin links to the navbar.

A [React functional component].

* Input:
    * `props` - React props:
        * `user` - an object describing the current user. See `App.tsx` for structure.
* Return: a rendered React-Router Link.

### `navbar-contribution`

Allows for replacing the contribution system.

A [React functional component].

* Input:
    * `props` - React props:
        * `children` - The default contribution process.
        * `user` - an object describing the current user. See `App.tsx` for structure.
* Return: a rendered React component.

### `navbar-end`

Add additional items to the end of the navbar.

A [React functional component].

* Input:
    * `props` - React props:
        * `user` - an object describing the current user. See `App.tsx` for structure.
* Return: a rendered React component.

### `page-end`

Add content to the end of the page.

A [React functional component].

* Input:
    * `props` - React props. Empty.
* Return: a rendered React component.

### `page-start`

Add content to the beginning of the page.

A [React functional component].

* Input:
    * `props` - React props. Empty.
* Return: a rendered React component.

### `ldap-info`

Area for displaying additional ldap information.

A [React functional component].

* Input:
    * `props` - React props:
        * `alias` - Alias of the user accessing the page. This is used for accessing the users LDAP info.
* Return: a rendered React component.

### `landing-content`

Replace the default landing content.

A [React functional component].

* Input:
    * `props` - React props:
        * `children` - Default landing metrics.
* Return: a rendered React component.

### `admin-sidebar`

Add options to the admin sidebar.

A [React functional component].

* Input:
    * `props` - React props. Empty.
* Return: a rendered React component.

### `admin-content`

Area for displaying additional admin components

A [React functional component].

* Input:
    * `props` - React props. Empty.
* Return: a rendered React component.

### `routes-additional`

Add additional routes for react-router-dom.

A [React functional component].

* Input:
    * `props` - React props. Empty.
* Return: a react-router-dom route.

[React functional component]: https://reactjs.org/docs/components-and-props.html#functional-and-class-components

repository: amzn/oss-contribution-tracker

gha_language: TypeScript

repo_name: amzn/oss-contribution-tracker


text:
# A Simplified Version of Google's "Quick, Draw"
[Soft Computing](http://www.ftn.uns.ac.rs/599836027/soft-computing) project, [Software Engineering and Information Technologies, Undegraduate Academic Studies, Faculty of Technical Sciences, University of Novi Sad](http://www.ftn.uns.ac.rs/n2094179280/software-engineering-and-information-technologies), 2019/2020

Technologies used: Keras 2.3.1, Python 3.6.1, Tensorflow 2.0.0

# Overview

The goal is to predict what the user has drawn on the canvas. A subset of the „Quick, Draw!“ dataset was used, which included the following six classes: Airplane, Alarm clock, Ant, Axe, Bicycle, The Mona Lisa.

# Demo

# How to run

- clone the project via `git clone https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw.git`

- download data (see [Fetching the data](#fetching-the-data))

- in terminal, enter `set WRAPT_INSTALL_EXTENSIONS=false` (this is required due to a `pip install tensorflow` problem)

- in terminal, enter `pip3 install -r requirements.txt` to install the dependencies

- download VGG weights and place them in `models/transfer_learning`:
    - `VGG19_10k.h5`: https://drive.google.com/file/d/1uvpi0ugDtwueWnGk4m13jp3KK8HAbVCj/view?usp=sharing
    - `VGG19_100k.h5`: https://drive.google.com/file/d/1GvKnDsntD73XjyYa4XBsiJnG-SPohoQC/view?usp=sharing

- run `web.py`

# Fetching the data

Create a folder called `data` in project root, download and place the following files into that folder:

Airplane: https://storage.cloud.google.com/quickdraw_dataset/full/numpy_bitmap/airplane.npy

Alarm clock: https://storage.cloud.google.com/quickdraw_dataset/full/numpy_bitmap/alarm%20clock.npy

Ant: https://storage.cloud.google.com/quickdraw_dataset/full/numpy_bitmap/ant.npy

Axe: https://storage.cloud.google.com/quickdraw_dataset/full/numpy_bitmap/axe.npy

Bicycle: https://storage.cloud.google.com/quickdraw_dataset/full/numpy_bitmap/bicycle.npy

The Mona Lisa: https://storage.cloud.google.com/quickdraw_dataset/full/numpy_bitmap/The%20Mona%20Lisa.npy

# Models

## Vanilla CNN

13 layers, excluding the input layer ([view architecture visualization](https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw/blob/master/models/vanilla_cnn/vanilla_cnn_model%20architecture.svg)). Dropout was used to avoid overfitting. The kernel's dimensions are 3x3, which is an often-used kernel size.

This model was trained on both 10,000 images per label and 100,000 images per label. The latter case brought no noticeable improvement.

[Callbacks](https://keras.io/callbacks/) used:

- [ImageDataGenerator](https://github.com/keras-team/keras/blob/master/keras/preprocessing/image.py#L238) was used for augmenting the images, which helps avoid overfitting.

- [EarlyStopping](https://github.com/keras-team/keras/blob/master/keras/callbacks/callbacks.py#L733) was especially useful for the 100k-images-per-label-model, as it greatly reduced the number of epochs that the model would execute before stopping. It was set up in such a way that if the validation loss was noticed to have stopped decreasing after five epochs, the training would terminate.

- [ModelCheckpoint](https://github.com/keras-team/keras/blob/master/keras/callbacks/callbacks.py#L633) was used with the `save_best_only` flag set to `True`, so as to only save the latest best model (i.e. the best model out of all the epochs) according to the validation loss.

- [ReduceLROnPlateau](https://github.com/keras-team/keras/blob/master/keras/callbacks/callbacks.py#L946) was used because models often benefit from reducing the learning rate by a factor of 2-10 once learning stagnates [2]. Yet again, the monitored value was the validation loss.

[Constraints](https://keras.io/constraints/) used:

- [MaxNorm](https://github.com/keras-team/keras/blob/master/keras/constraints.py#L22) is a type of weight constraint. From [Dropout: A Simple Way to Prevent Neural Networks from
Overfitting](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf): *"One particular form of regularization was found to be especially useful for dropout—constraining the norm of the incoming weight vector at each hidden unit to be upper bounded by a fixed constant c."*

Plots:

- [10k per label train/val accuracy](https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw/blob/master/models/vanilla_cnn/vanilla_cnn_10k_train_val_acc.png)

- [10k per label train/val loss](https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw/blob/master/models/vanilla_cnn/vanilla_cnn_10k_train_val_loss.png)

- [100k per label train/val accuracy](https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw/blob/master/models/vanilla_cnn/vanilla_cnn_100k_train_val_acc.png)

- [100k per label train/val loss](https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw/blob/master/models/vanilla_cnn/vanilla_cnn_100k_train_val_loss.png)

## SVM

The default value of 1 was used for *C*, the penalty error term. 'rbf' was the value used for the *kernel* parameter, also by default. The default value of 'scale' was used for *gamma*, the RBF kernel coefficient.2

Training was very slow; [from docs](https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html): *"The fit time scales at least quadratically with the number of samples and may be impractical beyond tens of thousands of samples."* This model doesn't work well on this problem.

A "grid search" on *C* and *gamma* was performed using cross-validation [1].

Perhaps the performance of this model could be improved by using the histogram of oriented gradients (HOG).

2*C* tells the SVM optimization how much to avoid misclassifying each training example by (large *C* - small hyperplane, and vice versa), and *gamma* defines how far the influence of a single training example (i.e. point) reaches (large *gamma* - the decision boundary will only depend on the points close to it - that is, each point's influence radius will be small, and vice versa).

## [VGG19](https://github.com/keras-team/keras-applications/blob/master/keras_applications/vgg19.py)

Consists of 24 layers, excluding the input layer ([view architecture visualization](https://github.com/UrosOgrizovic/SimpleGoogleQuickdraw/blob/master/models/transfer_learning/VGG19%20architecture.svg)). However, instead of using VGG19's fully connected layers, I used my own, because my problem doesn't have 1000 classes.

This model uses 3x3 convolution filters. Its predecessor, VGG16, achieved state-of-the-art results in the ImageNet Challenge 2014 by adding more weight layers compared to previous models that had done well in that competition.

## Accuracy per model

    set
    CNN 10k
    CNN 100k
    SVM 2k
    SVM 10k
    VGG 10k
    VGG 100k

      train
      ~99%
      ~97%
      ~89%*
      ~84%*
      ~94%
      ~94%

      validation
      ~99%
      ~97%
      ~94%
      ~94%

      test
      ~96%
      ~98%
      ~89%*
      ~84%*
      ~94%
      ~94%

\* 10-fold cross validation was done for the SVM models, so there are only train and test accuracies

# References
[1] - [Hsu, Chih-Wei, Chih-Chung Chang, and Chih-Jen Lin. "A practical guide to support vector classification." (2003): 1396-1400.](https://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf)

[2] - [Ravaut, Mathieu, and Satya Gorti. "Gradient descent revisited via an adaptive online learning rate." arXiv preprint arXiv:1801.09136 (2018).](https://arxiv.org/pdf/1801.09136.pdf)

repository: UrosOgrizovic/SimpleGoogleQuickdraw

repo_name: UrosOgrizovic/SimpleGoogleQuickdraw


text:
---
layout: project
title: Mini Lazarillo
description: A student digital edition of the Lazarillo de Tormes.
link: "https://minilazarillo.github.io/project.html"
author: Alex Gil
img: minilaz.png
people:
- Susanna Allés Torrent
- Alex Gil
---

In the context of the course "Minimal Editions: From the Manuscript to the Web," taught in the [Department of Latin American and Iberian Cultures](http://laic.columbia.edu/), Susanna Allés and Alex Gil undertook a pedagogical experiment in which they introduced students to the basic and general principles of textual criticism and the essential technologies needed for students to publish their own digital scholarly editions.

The resulting edition is a good example of the sort of digital humanities work we can expect to accomplish in the language instruction and literature classroom.

repository: cul/dlst-dh

gha_language: HTML

repo_name: cul/dlst-dh


text:
# UC Davis - Cardiac Tissue Models

The multi-scale cardiac electrophysiology services from the laboratory of [Prof. Colleen Clancy](https://health.ucdavis.edu/publish/providerbio/pharmacology/faculty/21746#.XTcp2ugzabg) provide a computational workflow for the integration and implementation of a reusable and reproducible cardiac multi-scale electrophysiology model. The workflow integrates multistep single-cell, 1D and 2D model simulations in a single automated process. The model formulation for ventricular cells from rabbit Soltis-Saucerman (1), and human Grandi-Bers (2) are implemented in the workflow.  Both models contain beta-adrenergic signaling pathways, and the firing rate model (unpublished Lewis model).

### Usage
To explore the service and the model, please proceed as follows:

1. To use either the human or rabbit model templates, double click on the template which will prompt you to instantiate and name your own study. After this, the study flowchart should be displayed for you.

    ![rabbitCC](https://user-images.githubusercontent.com/32800795/61494767-5adc3100-a9b7-11e9-80ba-a1bc54dd9a05.JPG)

2. For a sample data set, select the initial conditions files for either rabbit or human models  into the File Picker by double clicking the File Picker and navigating through the directory tree as shown:

    ![CC_inputfiles](https://user-images.githubusercontent.com/32800795/61584726-1d111100-ab4d-11e9-9a91-93c1da82b05c.JPG ':size=500%')

3. Next, click “Retrieve” at the bottom of the worbench and then “Run.” You will then be able to view results of the simulation in any of the viewer services.

    Please note that running the entire study including 2D will take some time: about 10 minutes for the 2D part and about 1 minute for the remaining parts.

4. The simulation gives either 0D (ex. Time series of membrane potential),

    ![rabbitCC_0D](https://user-images.githubusercontent.com/32800795/61584782-de2f8b00-ab4d-11e9-9493-7f7b0fe395a4.JPG ':size=600%')

    1D (ex. Surface plot of an action potential traveling over space)

    ![rabbitCC_1D](https://user-images.githubusercontent.com/32800795/61584781-de2f8b00-ab4d-11e9-884b-36e88c31ccd8.JPG)

    or 2D (ex. Video of membrane potential traveling through cardiac tissue).

5. Note that you can interact with each of these plots through use of our plot tools shown in the top right corner of the plot area such as zooming, panning and viewing data point values by hovering the cursor over the plots.

    ![ccplot_tools](https://user-images.githubusercontent.com/32800795/61584783-de2f8b00-ab4d-11e9-9aba-e520a7cef5f8.JPG)

#### Reference:

*(1)	Soltis AR, Saucerman JJ. Synergy between CaMKII substrates and beta-adrenergic signaling in regula- tion of cardiac myocyte Ca(2+) handling. Biophysical journal. 2010; 99(7):2038–47. Epub 2010/10/07.*

*(2)	Grandi E, Pasqualini FS, Bers DM. A novel computational model of the human ventricular action poten- tial and Ca transient. J Mol Cell Cardiol. 2010; 48(1):112–21. Epub 2009/10/20.*

repository: odeimaiz/osparc-manual

repo_name: odeimaiz/osparc-manual


text:
Chrome Remote Tab Closer
------------------------

With remote schooling being inevitable in our school district in the fall of
2020 I needed a way to *quickly, immediately, and remotely* block and unblock
websites in Chrome. Sites such as Youtube are necessary for schoolwork some of the time
but are also a huge distraction.

This is accomplished by opening Chrome with remote debugging enabled and
using pychrome to periodically close any open tab with an offending URL.

This is done in two parts:
- A service that reads one or more configuration files and enforces the bans.
- A simple web server for updating the configurations remotely. (TODO)


text:
# GitHub Streak Scraper

[![npm package](https://img.shields.io/npm/v/github-streak-scraper.svg)](https://www.npmjs.com/package/github-streak-scraper)
[![Dependency Status](https://david-dm.org/theDavidBarton/github-streak.svg)](https://david-dm.org/theDavidBarton/github-streak/)

Parses the Contribution graph to count the current streak of a GitHub user.

## Usage

Wrap `githubStreakScraper('GitHub-user-name')` in an async function/promise.

```js
const getStreakData = async => {
  const githubStreak = await githubStreakScraper('theDavidBarton');
  console.log(githubStreak);
}
```

```js
{
  user: 'theDavidBarton',
  currentlyOnStreak: true,
  currentStreakCount: 18,
  currentStreakStartDate: '2019-12-30'
}
```

## License

MIT License

Copyright (c) 2020 David Barton

repository: theDavidBarton/github-streak

repo_name: theDavidBarton/github-streak


text:
# ICT (C# programming)
## Introduction to C#
C# is a modern, object-oriented, and type-safe programming language. C# enables developers to build many types of secure and robust applications that run in the .NET ecosystem. C# provides language constructs to directly support these concepts, making C# a natural language in which to create and use software components. Since its origin, C# has added features to support new workloads and emerging software design practices.
C# is used for:
* Mobile applications
* Desktop applications
* Web applications
* Web services
* Web sites
* Games
* VR
* Database applications
* And much, much more!
## About this repository
This repository contains all the code for the course **"ICT"** in the spring semester 2021 year in KBTU. This repository includes both the code from the lectures and the codes of practical tasks. Also problems from [**Informatics**](Problems/) and [**Final Exam**](FinalExam/).
## License
This repository is released under the [MIT license](LICENSE.md). In short, this means you are free to use this software in any personal, open-source or commercial projects. Attribution is optional but appreciated.


text:
# Proof of Concept
# Migrating Notes RichText to Markdown

This repository holds the content of my blog post series for converting Notes RichText to Markdown. You can read about that on the following links.

[Part I](https://blog.winkelmeyer.com/2016/01/proof-of-concept-migrating-notes-richtext-to-markdown-part-i/)

[Part II](https://blog.winkelmeyer.com/2016/01/proof-of-concept-migrating-notes-richtext-to-markdown-part-ii/)

[Part III](https://blog.winkelmeyer.com/2016/01/proof-of-concept-migrating-notes-richtext-to-markdown-part-iii/)

# Pre-Conditions

You'll need Java 8 to run the code.

# Test contents

Besides the source code you'll find a sample database in ```src/test/resources``` which can be used to test drive the code. The sample database contains a few documents and need no special setup.

You may use any own database. In that case you have to make sure that you change the fields that are read from the view.

# Eclipse setup
The project uses [Gradle](https://gradle.org/).

To setup the project for Eclipse run the following command from your command line.

```gradle cleanEclipe eclipse```

That will create the needed Eclipse project files and also download the dependencies. You can afterwards import the project into Eclipse.

If you don't have Gradle installed - the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) is attached to the project. Replace ```gradle``` with ```gradlew```in the commands to run it standalone.

This step is not mandatory.

# Application properties

For running the code you've to change the some properties, like the server host name, view etc. Those are configured in the file ```src/main/resources/application.properties```.

## server
Enter the hostname or IP address of the IBM Domino server (without a prepended _http_ or _https_) in here. The PoC code uses _http_ fixed. You can change that if you want. ;-)

## database
Enter the full path (relative to the Domino data directory) to your test database in here.

## view
Enter the view name that'll be used for getting the document data in here.

## fieldBody
Set the field name that contains the to be converted RichText in here.

## username
The PoC code assumes that the connection needs authentication. So set a valid HTTP username in here.

## password.
Well, its clear what should be in here, right?

## pathSave
Enter the target folder on your file system in here. The generated Markdown files will be stored in here.

# Running the code

After you've changed the ```application.properties``` file you've two options to run the code. A runnable class is located for that in ```src/main/java/com.winkelmeyer.richtext2markdown.tests.SimpleTest```.

## Using Eclipse

Just as usual you can run the class as a Java application.

## Using Gradle/command line

Here you've two options. You can either run it directly via your command line or create a runnable/distributable JAR file. Make sure that your _java.home_ property is set correctly within your operating system.

### Run class directly
Enter ```gradle run``` on the command line. That will execute the class directly.

### Create runnable JAR file
Enter ```gradle installDist``` on the command line. This will create a full distributable package located in ```build/install/com.winkelmeyer.richtext2markdown```. Within the ```bin``` folder you'll find two executables (Windows/Unix).

Read more about this [in the Gradle documentation](https://docs.gradle.org/current/userguide/application_plugin.html) and in my [ICON UK presentation](http://www.slideshare.net/muenzpraeger/iconuk-2015-gradle-up).

# Result data
You can inspect the result data within the generated Markdown files. Play with different RichText elements to see and learn about the output (and with that about the stuff you may have to think about).

There are lots of different Markdown viewers and editors for all operating systems available. Pick one that you'll like. ;-)


text:
# BSG SystemVerilog to Verilog (SV2V)

BSG SV2V takes a hardware design written in SystemVerilog and converts it into
a single HDL file that is Verilog-2005 compliant. The Verilog-2005 standard is
compatible with a much wider variety of CAD tools, thus this converter can help
bridge the gap between code bases employing advanced synthesizable
SystemVerilog features and older or less sophisticated tools.

The tool uses Synopsys Design Compiler (DC) to perform elaboration of the
design, and then post-processes to map DC's gtech/generic/datapath
representation back to standard Verilog. Thus a DC license is required by the
party running the tool, but is not required to use the converted file.

This approach maximizes compatibility with code that was written and targets
DC. Of course it would also be neat if somebody wrote a totally open source SV
to V!

Here is a [Youtube Demo](https://youtu.be/H3p5hwI8WR0).

## Setup

For this converter, you will need Synopsys Design Compiler installed (verified
on version M-2016.12-SP5-5) and access to a valid license file. If you have
access to *bsg_cadenv* and it is setup for the machine you are working on, then
you can simply clone *bsg_sv2v* and *bsg_cadenv* into the same directory and
the CAD tools should be setup automatically to run on our machines. For all
other users, you should open the Makefile in the root of the repository and set
the following two variables:

```
export LM_LICENSE_FILE ?= <YOUR LICENSE FILE HERE>
```

```
export DC_SHELL ?= <YOUR DC_SHELL BINARY HERE>
```

The BSG SV2V converter also depends on
[Icarus Verilog](http://iverilog.icarus.com/),
[Pyverilog](https://pypi.org/project/pyverilog/), and
[pypy](https://pypy.org/). To download and build these tools, simply run:

```
$ make tools
```

## Usage

### Design Filelist

To use the BSG SV2V converter flow, first you must first create a filelist. The
filelist is the main way of linking together all of the bits to elaborate the
design. The format of the filelist is fairly basic and is based on Synopsys VCS
filelists.  Each line in the filelist can be 1 of 5 things:

- A comments starting with the `#` character
- A macro definition in the format `+define+NAME=VALUE`
- A top-level parameter definition in the format `-pvalue+NAME=VALUE`
- An include search directory in the format `+incdir+DIRECTORY`
- An HDL file path (no format, just the file path)

You may also use environment variables inside the filelist by using the `$`
character followed by the name of the environment variable.

Below is a mock filelist as an example:

```bash
### My Design Filelist
# Macros
+define+SYNTHESIS
+define+DEBUG=0
# Parameters
-pvalue+data_width=32
# Search paths
+incdir+$INCLUDE_DIR/vh/
+incdir+$INCLUDE_DIR/pkgs/
# Files
$SRC_DIR/top.v
$SRC_DIR/sub_design/file1.v
$SRC_DIR/sub_design/file2.v
$SRC_DIR/sub_design/file3.v
```

### Running the Flow

Now that you have setup the tools and created a design filelist, you are ready
to run the flow! The main target is:

```
$ make convert_sv2v DESIGN_NAME=<top-module> DESIGN_FILELIST=<path-to-filelist> DESIGN_DIRECTORIES_MK=<optional-makefile-fragment>
```

If you'd prefer, you can modify the Makefile and set `DESIGN_NAME`,
`DESIGN_FILELIST`, and `DESIGN_DIRECTORIES_MK` rather than specifying them as
part of the makefile target. `DESIGN_NAME` should be set to the name of the
toplevel module in the design and `DESIGN_FILELIST` should be the filelist for
the design discussed in the previous section. `DESIGN_DIRECTORIES_MK` is
optional and can point to a makefile fragment that can setup environment
variables for use inside the design filelist.

This command will first launch Synopsys Design Compiler and elaborate the
design. It will then call a python script that will take the elaborated design
and turn it back into synthesizable RTL that is Verilog-05 compatible. All
output files can be found in the `results` directory. The main converted file
will be in:

```
./results/${DESIGN_NAME}.sv2v.v
```

### Example

A very simple example has been include in the `examples` directory. To test out
the example, run:

```
$ make convert_sv2v DESIGN_NAME=gcd DESIGN_FILELIST=examples/gcd/gcd.flist
```

To see the converted file, run:

```
$ cat ./results/gcd.sv2v.v
```

### Log Level

The `bsg_elab_to_rtl.py` script logs various information throughout the process
of converting the DC elaborated netlist to RTL. By default, the logger level is
set to `info` however you can change the log level. Available options are `debug`,
`info`,`warning`,`error`, and `critical`. Inside of the Makefile, you can set the
`LOGLVL` variable to the logging level desired.

### Optimization Passes

As part of the BSG SV2V flow, after all components have been swapped with their RTL
equivalents, additional passes of the netlist are performed to try and cleanup and
optimize the netlist. By default, every optimization pass is enabled, however every
optimization pass can be disabled using flags passed to the `bsg_elab_to_rtl.py`
script. In the Makefile, you can add these flags to the `SV2V_OPTIONS` variable to
disable these optimizations.

| Optimization Name    | Disable Flag           | Description                                                                                |
|:--------------------:|:----------------------:|:-------------------------------------------------------------------------------------------------------------------|
| Wire/Reg Declaration | no_wire_reg_decl_opt   | Takes individual wire and reg declarations and combines them into comma separated multi-variable declarations.     |
| Always@ Reduction    | no_always_at_redux_opt | Squashes always@ blocks based on sensitivity lists and conditional statements.                                     |
| Concat Reduction     | no_concat_redux_opt    | Squashes bits in large concats that share the same base bus name.                                                  |

### Adding Wrapper Module

BSG SV2V supports adding a wrapper module for the toplevel by using the
optional `-wrapper <name>` flag (where `<name>` is the wrapper module name).
This can be useful when using BSG SV2V in other infrastructure where you would
like to control the toplevel module name. To determine which module is the
toplevel that should be wrapper, the user must define the `DESIGN_NAME`
environment variable. You can also add the `-wrapper` flag to the
`SV2V_OPTIONS` variable inside the Makefile.

### Converting Timing Constraints

BSG SV2V can also take an optional tcl or sdc file that will then be applied to
the design and written back out as an SDC file that has been fully expanded to
the given design (for example: if the folloing timing constraint is applied:
`set_output_delay 10 -clock clk [all_outputs]` the the resulting output SDC
file will expand that constraint such that every output port for the design has
a `set_output_delay` command. To specify a constraint file to convert, set the
`DESIGN_CONSTRAINTS_FILE` variable inside the Makefile or set the variable at
runtime using the following syntax:

```
$ make convert_sv2v DESIGN_CONSTRAINTS_FILE=<file path>
```

### Elaborating a Different Top-level Module

When dealing with hierarchical designs, it can some be useful to elaborate the
design higher up the logical hierarchy than the point that you are acutally
interested in (ie. the design being converted). This is primarily useful to
push parameters from higher up the hierarchy. To specify a different point to
elaborate, set the `DESIGN_ELAB_NAME` variable inside the Makefile or set the
variable at runtime using the following syntax:

```
$ make convert_sv2v DESIGN_ELAB_NAME=<hier name>
```

Note: the point that you elaborate from must instantiate an instance of the
`DESIGN_NAME` module. Said another way, it must be higher up the local
hierarchy. Also, every instances of `DESIGN_NAME` must have the same
parameterization as there is no way to disambiguous which parameterization you
are interested in converting.


text:
---
layout: page
title: Teaching
permalink: teaching/sample-work/
subtitle: Analysis of Indetreminate Structures (15CV52)
---

#### Course objectives: This course will enable students to:

1. Identify, formulate and solve engineering problems of RC elements subjected to different kinds of loading.
2. Follow a procedural knowledge in designing various structural RC elements.
3. Impart the culture of following the codes for strength, serviceability and durability as an ethics.
4. Provide knowledge in analysis and design of RC elements for the success in competitive examinations.

#### Academic Materials for this course are;

* [Syllabus](https://drive.google.com/open?id=0B7DoZbz5_0lfY1FDSzNwblo5Mk0)
* [Course Plan](https://drive.google.com/open?id=0B7DoZbz5_0lfSF9HRzJrNW9wMEU)
* [Lesson Delivery Progress Report](https://drive.google.com/open?id=0B7DoZbz5_0lfckFQRTJ4eDdNZnM)
* [Class Time Table](https://drive.google.com/open?id=0B7DoZbz5_0lfRk9WODRmZTIyREk)
* [Previous Year Question papers-Set1](https://drive.google.com/open?id=0B7DoZbz5_0lfN2hVT2hPbGZxYTA)
* [Previous Year Question papers-Set2](https://drive.google.com/open?id=0B7DoZbz5_0lfV21LWFpqVnhTTUU)
* [I IA Question paper and Scheme](https://drive.google.com/open?id=0B7DoZbz5_0lfaWZRbmxobV9fVW8)
* [Assignment-1](https://drive.google.com/open?id=0B7DoZbz5_0lfSWd1TEFLNVhFUFU)
* [Click here to check your IA marks for AIS](https://drive.google.com/open?id=0B7DoZbz5_0lfb21MNUpjbl95N1U)
* [Updated Fixed End Moments Standard Table](https://drive.google.com/open?id=0B7DoZbz5_0lfelBkLXJQMGdBWU0)
* Lecture Notes

1. #### Module I: Slope Deflection Method-Lecture Notes.

    [Introdcution on Indeterminate Structures-PPT](https://drive.google.com/open?id=0B7DoZbz5_0lfSTQzZ3UyUEJ1MzQ)

    1.1 [Introduction.](https://drive.google.com/open?id=0B7DoZbz5_0lfRzNyUlhFUUduUTA)

    1.2 [Numerical Problems on Continuous Beams.](https://drive.google.com/open?id=0B7DoZbz5_0lfUE9hbjluNTZ0c3c)

    1.3 [Numerical Problems on frames without sway.](https://drive.google.com/open?id=0B7DoZbz5_0lfb1F0emhnLTJRWHM)

    1.4 [Numerical problems on frames with sway.](https://drive.google.com/open?id=0B7DoZbz5_0lfOVBCQWFoczdELWs)

2. #### Module II: Moment Distribution Method-Lecture Notes.

     2.1 [Introduction-PPT.](https://drive.google.com/open?id=0B7DoZbz5_0lfcVRMMGZPVXY2dXc)

     2.2 [Moment Distribution method-Introduction](https://drive.google.com/open?id=0B7DoZbz5_0lfNHRfc1p0aGJPVms)

     2.3 [Numerical Problems-1](https://drive.google.com/open?id=0B7DoZbz5_0lfTkM4NV9CQ20yQUE)

     2.4 [Numerical Problems-2](https://drive.google.com/open?id=0B7DoZbz5_0lfbUJuM3BwRmhKeUk)

3. #### Module III: Kani's Method-Lecture Notes.

     2.1 [Introduction and Numerical Problems on Beams](https://drive.google.com/open?id=0B7DoZbz5_0lfM3dpTm1QZUt3TWs)

     2.2 [Numerical Problems on Non-Sway Frames](https://drive.google.com/open?id=0B7DoZbz5_0lfX0RaaTNucm9Mcmc)

     2.3 [Numerical Problems on Sway Frames](https://drive.google.com/open?id=0B7DoZbz5_0lfdVIxSkdUZnZVUm8)


text:
# RFID Replicator

Scripts to deal with RFID tags (Working out of the box on [Kali](https://www.kali.org/downloads/) distribution) :

- **rfid-replicator.sh** : replicate identically an original RFID tag into a clone tag (including its UID)

repository: kevinlacire/rfid-scripts

repo_name: kevinlacire/rfid-scripts


text:
Git cheat sheet
===============

## Git basics
```bash
git init <directory>
# Create empty Git repo in specified directory.
# Run with no arguments to initialize the current directory as a git repository.

git clone <repo>
# Clone repo located at <repo> onto local machine.
# Original repo can be located on the local filesystem or on a remote machine via HTTP or SSH.

git add <directory>
# Stage all changes in <directory> for the next commit.
# Replace <directory> with a <file> to change a specific file.

git commit -m "<message>"
# Commit the staged snapshot, but instead of launching a text editor, use <message> as the commit message.

git status
# List which files are staged, unstaged, and untracked.
```

## Git config
```bash
git config user.name <name>
# Define the author name to be used for all commits in current repo.
# Use --global flag to set config options for current user.

git config user.email <email>
# Define the author's email to be used for all commits in current repo.
# Use --global flag to set config options for current user.

git config --global alias. <alias-name> <git-command>
# Create shortcut for a Git command.
# E.g. alias.glog log --graph --oneline will set git glog equivalent to git log --graph --oneline.

git config --system core.editor <editor>
# Set text editor used by commands for all users on the machine.
# <editor> arg should be the command that launches the desired editor (e.g., vi).

git config --global --edit
# Open the global configuration file in a text editor for manual editing.
```

## Git log
```bash
git log
# Display the entire commit history using the default format. For customization see additional options.

git log -<limit>
# Limit number of commits by <limit>. E.g. git log -5 will limit to 5 commits.

git log --oneline
# Condense each commit to a single line.

git log -p
# Display the full diff of each commit.

git log --stat
# Include which files were altered and the relative number of lines that were added or deleted
# from each of them.

git log --author=”<pattern>”
# Search for commits by a particular author.

git log --grep=”<pattern>”
# Search for commits with a commit message that matches <pattern>.

git log <since>..<until>
# Show commits that occur between <since> and <until>.
# Args can be a commit ID, branch name, HEAD, or any other kind of revision reference.

git log -- <file>
# Only display commits that have the specified file.

git log --graph --decorate
# --graph flag draws a text based graph of commits on left side of commit msgs.
# --decorate adds names of branches or tags of commits shown.

git reflog
# Show a log of changes to the local repository’s HEAD.
# Add --relative-date flag to show date info or --all to show all refs.
```

## Git diff
```bash
git diff
# Show unstaged changes between your index and working directory.

git diff HEAD
# Show difference between working directory and last commit.

git diff --cached
# Show difference between staged changes and last commit.
```

## Git reset
```bash
git reset
# Reset staging area to match most recent commit, but leave the working directory unchanged.

git reset <file>
# Remove <file> from the staging area, but leave the working directory unchanged.
# This unstages a file without overwriting any changes.

git reset --hard
# Reset staging area and working directory to match most recent commit and overwrites all changes
# in the working directory.

git reset <commit>
# Move the current branch tip backward to <commit>, reset the staging area to match,
# but leave the working directory alone.
```

## Git rebase
```bash
git rebase <base>
# Rebase the current branch onto <base>.
# <base> can be a commit ID, a branch name, a tag, or a relative reference to HEAD.

git rebase -i <base>
# Interactively rebase current branch onto <base>.
# Launches editor to enter commands for how each commit will be transferred to the new base.
```

## Undoing changes
```bash
git revert <commit>
# Create new commit that undoes all of the changes made in <commit>,
# then apply it to the current branch.

git clean -n
# Show which files would be removed from working directory.

# Use with nothing staged to edit the last commit’s message.
```

## Branching
```bash
git branch
# List all of the branches in your repo.
# Add a <branch> argument to create a new branch with the name <branch>.

git checkout -b <branch>
# Create and check out a new branch named <branch>. Drop the -b flag to checkout an existing branch.

git merge <branch>
# Merge <branch> into the current branch.
```

## Remote Repositories
```bash
git remote add <name> <url>
# Create a new connection to a remote repo.
# After adding a remote, you can use <name> as a shortcut for <url> in other commands.

git fetch <remote> <branch>
# Fetch a specific <branch>, from the repo. Leave off <branch> to fetch all remote refs.

git pull <remote>
# Fetch the specified remote’s copy of current branch and immediately merge it into the local copy.

git pull --rebase <remote>
# Fetch the remote’s copy of current branch and rebases it into the local copy.
# Uses git rebase instead of merge to integrate the branches.

git push <remote> <branch>
# Push the branch to <remote>, along with necessary commits and objects.
# Creates named branch in the remote repo if it doesn’t exist.

git push <remote> --force
# !!! Forces the git push even if it results in a non-fast-forward merge.
# Do not use the --force flag unless you’re absolutely sure you know what you’re doing.

git push <remote> --all
# Push all of your local branches to the specified remote.

git push <remote> --tags
# Tags aren’t automatically pushed when you push a branch or use the --all flag.
# The --tags flag sends all of your local tags to the remote repo.
```

repository: ingvarc/practical-cheat-sheets

repo_name: ingvarc/practical-cheat-sheets