text:
---
layout:     post
title:      "Java Records: Data carrier classes"
subtitle:   "More concise and readable Java code"
date:       2021-03-14 12:00:00
author:     "Vipin Sharma"
header-img: "img/posts/blog-post-bg2.jpeg"
comments: true
tags: [java, JDK16]
---

## Records

Professional Java developers need immutable data carrier-classes for communication with databases, web Services. We need to write a lot of boilerplate code to create a simple data carrier-class, we typically implement constructor, accessors, equals(), hashCode(), and toString().  ***This process is repetitive and error-prone. Developers also complain “Java is too verbose”.***

Record classes provide a way to model data in java. An example of data is one row from a database table. This feature simplifies coding, makes java code more concise and readable. It is going to increase productivity for professional java developers. Java14 introduced Records as a preview feature, Java15 brings in some updates as a second preview and Java16 makes it a final feature, no changes in Record after this.

### Common implementation use cases
**1. Multiple return values:** Often we encounter cases when we want to return multiple values from a method, for this we will have to create a class having values that we need to return. The record provides an easy way rather than writing boilerplate code.

**2. Data transfer objects (DTO):** Developers working with databases often write DTO which is typically used for storage only, we can again reduce boilerplate code using java Record classes.

### Java code before and after Record

Following is one example showing Point class without using record.

```
class Point
{
 public final int x;
 public final int y;
 public Point(int x, int y) { this.x = x; this.y = y; }
 public int getX() {...}
 public int getY() {...}
 public String toString() {...}
 public boolean equals(Object o) {...}
 public int hashCode() {...)
}
```

**Record equivalent for Point class is following one line, WOW !**
```java
record Point(int x, int y){}
```
In this example record class name is Point, and it has 2 components x,y that describes state. The record class can have a body as well, later in this post we have such examples.

We can use javap command to see the compiled class:

```shell
javac com/jfeatures/jdk16/records/Point.java
javap -p com/jfeatures/jdk16/records/Point.class

Compiled from "Point.java"
final class com.jfeatures.jdk16.records.Point extends java.lang.Record {
  private final int x;
  private final int y;
  com.jfeatures.jdk16.records.Point(int, int);
  public final java.lang.String toString();
  public final int hashCode();
  public final boolean equals(java.lang.Object);
  public int x();
  public int y();
}
```

In the above output of the javap command we can see the record classes have:

1. A private final field for each component in record declaration(state description). (In the above example private final int x, private final int y)
2. A public read accessor method for each component of the Record, with the same name and type as the parameter. (public int x(), public int y())
3. A public constructor, having the same arguments as the components of the record, is also called a canonical constructor. This constructor initializes each field from the corresponding argument. (com.jfeatures.jdk16.records.Point(int, int))
4. Implementations of equals and hashCode that say two record classes are equal if they are of the same type and contain the same state.
5. An implementation of toString that includes the string representation of all the record components, with their names.

### Record classes in detail

Record classes behave like normal classes except restrictions, following are few properties of the Record classes:
1. Can be declared as top-level or nested, can be generic.
2. Can implement interfaces.
3. Are instantiated via the new keyword.
4. Record class body may declare static methods, static fields, static initializers, constructors, instance methods, and nested types.
5. The record class and the individual components in a state description, can be annotated.
6. We can define a nested record class. Nested record is implicitly static, because an immediately enclosing instance can add a state to the record.
7. Instances of record classes can be serialized and deserialized. Serialization is done using Record components and deserialization is done using the canonical constructor. Serialization and deserialization can not be customized via regular means (writeObject, readObject, readObjectNoData, writeExternal, or readExternal methods).

#### Restrictions on record
Following code shows compilation error in extends, because Record classes are implicitly final.
```java
record Base(int a) { }
record Child(int a, int b) extends Base { }
```
Similarly, we have a few more restrictions to follow for record classes.

Restrictions on Record classes can be divided into 3 categories:
1. Restrictions that ensure the record class components alone defines the representation
    1. record classes cannot extend any other class
    2. record classes cannot declare instance fields, only record components carry the state of the record object.

2. Restrictions that emphasize the API of a record is defined solely by its record components, and cannot be enhanced
   later by another class or record.
    1. record classes are implicitly final.
    2. record classes cannot be abstract.
    3. record classes cannot declare native methods.

3. Restriction to make sure record is immutable by default.
    1. The components of a record are implicitly final.

#### Constructors

Record classes have 3 types of constructors:
1.  **Canonical constructor**:
    It contains all components of the record. This is declared implicitly, can be declared explicitly as well. Starting From Java15, if the canonical constructor is implicitly declared then its access modifier is the same as the record class. If the canonical constructor is explicitly declared then its access modifier must provide at least as much access as the record class.
```java
record Employee(String name, int id) {
       Employee(String name, int id) {
           this.name = name;
           this.id = id;
       }
}
```
2.  **Compact canonical constructor**:  It doesn't have any parameter, it is always called when defined. The compact form helps developers focus on validating and normalizing parameters. Here parameters are declared implicitly, and the private fields corresponding to record components are automatically assigned (this.x = x) at the end of the constructor.
```java
record Employee(String name, int id) {
        Employee {
            //validation
            if(name.length()==0) throw new RuntimeException("Nota a valid name");
        }
}
```
For a Record class, only one out of canonical constructor or compact canonical constructor can be defined. Defining both results into compilation failure.

3.  **Custom constructor**: We can create custom constructors as well having only a few parameters from the Record header. Since this is not a canonical constructor, its first statement must invoke another constructor of the record class.
```java
record Employee(String name, int id) {
       public Employee(String name) {
           this(name, 0);
       }
}
```
Starting from Java 15 assigning any of the instance fields (record components) in the constructor body became a compile-time error. Only the canonical constructor is allowed to do this.

#### Update on @Override annotation

Java 15 extends the meaning of the @Override annotation to include an explicitly declared accessor method for a record. Now following is valid java code.

```java
package com.jfeatures.jdk16.records;

public record Employee(String name, int id) {

    @Override
    public int id() {
        return id;
    }

    @Override
    public String name() {
        return name;
    }
}
```

#### Local record, enum, and interfaces are now allowed in Java

Java15 introduced the ability to declare local record classes, local enum classes, and local interfaces. Nested record classes and local record classes are implicitly static. It avoids adding an immediate enclosing instance to the state of the record class.

```java
public class LocalComponents {
    public static void main(String[] args) {
        System.out.println("Start Test");
        new LocalComponents().instanceMethod();
    }

    void instanceMethod() {
        record LocalRecord(int x, int y) {
            LocalRecord {
                System.out.println("Inside Local Record compact canonical constructors");
            }
        }
        enum LocalEnum {
            VALUE1,
            VALUE2;
        }

        interface LocalInterface extends Cloneable {
        }
    }
}
```

For versions before Java15, above code will not compile. Following is a compilation error for local enum in above example.

    com/jfeatures/jdk16/records/LocalComponents.java:16: error: enum types must not be local
    enum LocalEnum {
    ^
    1 error

#### Inner class can declare static members

Before Java 16, an inner class can not declare a static member. Java 16 allows the inner class to declare a member of the type record class. This will allow an inner class to declare a member that is a record class.

```java
package com.jfeatures.jdk16.records;

public class RecordInInnerClass {
    public static void main(String[] args) {
        System.out.println("Starting test");
    }

    class Inner{
        record TestRecord(int id, String name){
        }
    }
}
```

This code shows below compilation error with Java 15, it works fine with Java16 or later.

    javac --enable-preview -source 15 com/jfeatures/jdk16/records/RecordInInnerClass.java
    com/jfeatures/jdk16/records/RecordInInnerClass.java:9: error: static declarations not allowed in inner classes
    record TestRecord(int id, String name){
    ^
    Note: com/jfeatures/jdk16/records/RecordInInnerClass.java uses preview language features.
    Note: Recompile with -Xlint:preview for details.
    1 error

### Why record, why not just tuples?
A central aspect of Java's philosophy is that "names" matter.  A `Person` with properties `firstName` and `lastName` is clearer and safer than a tuple of `String` and `String`.

### Conclusion

Records help you remove repetitive and error prone code, reduce bugs in your code, reduces verbosity in code, and increases developer productivity. Using language features like this is going to make you a great developer everyone wants to hire.

If you want to get amazing Java jobs, I wrote an ebook [5 steps to Best Java Jobs](https://jfeatures.com/). You can download this step-by-step guide for free!

[](https://jfeatures.com/)

### Resources

1.  https://openjdk.java.net/jeps/395
2.  https://cr.openjdk.java.net/~briangoetz/amber/datum.html


text:
# general notes

Docker - tips

show all images
```bash
docker images
```
``show all running containers``

x

running a container with “terminal integration” (-ti) ,see the ubuntu version, and exit
```bash
docker run -ti ubuntu:latest bash
root@e6eff42b9102:/# cat /etc/lsb-release
root@e6eff42b9102:/# exit or ctrl d
```

``Stopped containers``:

First, let’s see all the stopped containers:

```bash
docker ps -a //for all
docker ps -l //for the last stoped container
```

How to create an image from a container?
Docker commit takes containers and creates a new image from them:
1. run a container
2. create file inside the container
3. exit
4. get the last container exits
5. docker commit ``<source docker> <new images name>``
6. check image exists
7. run a cointainer with the new image craeted
8. see the new file inside the new container
 ```bash
docker images
docker run -ti ubuntu:latest bash
root@e6eff42b9102:/# cat /etc/lsb-release
root@e6eff42b9102:/# exit or ctrl d
docker ps -a #for all
docker ps -l #for the last stoped container
docker run -ti ubuntu bash
touch My-sample-state-file
exit
docker ps -l
# CONTAINER
# ID   IMAGE     COMMAND   CREATED
# TS     NAMES
# 9dd0d5d7240c   ubuntu    "bash"
# seconds ago
# STATUS
# 35 seconds ago
# POR
#           optimistic_albattani
docker commit optimistic_albattani my-custome-ubuntu
docker images
docker run -ti my-custome-ubuntu bash
ls
# My-sample-state-file  bin  boot  dev
# etc  home  lib  lib32  lib64  libx32
# media  mnt  opt  proc  root  run
# sbin  srv  sys  tmp  usr  var
exit
Exited (0) 2
```

``pull and push images``
```bash
docker pull debian:sid
docker tag debian:sid erezye/my-debian:v11
docker push debian:sid erezye/my-debian:v11
```

Remove unused data https://docs.docker.com/engine/reference/commandline/system_prune/

```bash
docker system prune [OPTIONS]
```

## Registry
there is a docker build in as part of the docker, registry is a network service

what should we do to create local registry

``` bash
docker run -d -p 5000:5000 --restart=always --name registry registry:2
# -d deattached
# -p port forword
# restart=always if this containers dies just restart it
# call is registry from registry version 2 image
```
push to local regitry
``` bash
# tag the image first, MUST with the local:5000 for local registry pushing
docker tag ubuntu:16.04 localhost:5000/cx/myubuntu:19.99
#push the image to the local registry
docker push localhost:5000/cx/myubuntu:19.99
```

how to save images to archive (tar.gz) great for backups and sending images

``` bash
# save 3 images (google-is-big:latest alpine  ubuntu) into one file my-images.tar.gz
docker save -o my-images.tar.gz google-is-big:latest  ubuntu:16.04

docker rmi google-is-big:latest ubuntu:16.04

docker load -i my-images.tar.gz
```

repository: erezye/docker-learn

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: erezye/docker-learn


text:
Four-Cylinder Engine Ignition Control - AUTOSAR Version

This example is an extension of [four-cylinder engine Ignition control demo](https://www.mathworks.com/matlabcentral/fileexchange/69271-four-cylinder-engine-ignition-control-simulation) focusing on translation of Ignition Control reference model to an AUTOSAR version using [AUTOSAR Blockset](https://www.mathworks.com/products/autosar.html?s_tid=FX_PR_info) thus allowing it to generate AUTOSAR compliant code that can be integrated into AUTOSAR Run Time Environment. This example is meant for demo and education purpose only and not intended to run certain application.

Running this demo would require the following:

- [MATLAB](https://www.mathworks.com/products/matlab.html?s_tid=FX_PR_info)
- [Simulink](https://www.mathworks.com/products/simulink.html?s_tid=FX_PR_info)
- [AUTOSAR Blockset](https://www.mathworks.com/products/autosar.html?s_tid=FX_PR_info)
- [Embedded Coder](https://www.mathworks.com/products/embedded-coder.html)
- [Simulink Coder](https://www.mathworks.com/products/simulink-coder.html)
- [MATLAB Coder](https://www.mathworks.com/products/matlab-coder.html)
- [Stateflow](https://www.mathworks.com/products/stateflow.html?s_tid=FX_PR_info)


text:
---
uid: Discord.Commands.OverrideTypeReaderAttribute
remarks: *content
---

This attribute is used to override a command parameter's type reading
behaviour. This may be useful when you have multiple custom
@Discord.Commands.TypeReader and would like to specify one.

---
uid: Discord.Commands.OverrideTypeReaderAttribute
examples: [*content]
---

The following example will override the @Discord.Commands.TypeReader
of @Discord.IUser to `MyUserTypeReader`.

```cs
public async Task PrintUserAsync(
    [OverrideTypeReader(typeof(MyUserTypeReader))] IUser user)
{
    //...
}
```

license: MIT

branch_name: refs/heads/dev

gha_language: C#

gha_license_id: MIT


text:
# [Convert a Number to a String!](https://www.codewars.com/kata/5265326f5fda8eb1160004c8)
We need a function that can transform a number into a string.

What ways of achieving this do you know?

```if:c
In C, return a dynamically allocated string that will be freed by the test suite.
```

#### Examples:

```
123 --> "123"
999 --> "999"
```

url: https://raw.githubusercontent.com/anthonyjatoba/codewars/76b0d66dd1ba76a4d136b658920cdf85fd5c4b06/8 kyu/Convert a Number to a String!/README.md

repository: anthonyjatoba/codewars

branch_name: refs/heads/master

repo_name: anthonyjatoba/codewars


text:
---
layout: post
author: Manav Sehgal
title:  "Open Cloud Based Workflow For Designing Your Website"
image: /img/blog/open-workflow.png
tags: github jekyll
category: workflow
---

Design your next website with the freedom of switching from any device, to any place, to any operating system. All you need is a web browser.

I have Windows enviornment at work, Mac at my home office, and use Android phone and iPad when mobile. I author articles, ebooks, and create code.

My requirement is to seamlessly move from one device to next, from one place to next, without losing any time getting to next authoring or coding activity.

I have discovered a loosely coupled workflow tying four useful tools together, which lets me enjoy this any device/OS/place freedom.

- **Cloud9.** This is where I do my coding and writing. Cloud9 offers a cloud based Integrated Development Environment.
- **GitHub.** What ties it all together. Saving my work on GitHub means, even when I need to setup a new development or authoring environment, I always have my latest code or content handy.
- **Jekyll.** Static website content management for GitHub. I use this to enable a simple, yet powerful content workflow.
- **Trello.** Very useful when extending my activities to a community of collaborators or peers at work. Used for planning, collaborating, brain-storming, and communicating.

### Cloud9 As Your Dev, Authoring Box

You can actually skip this step altogether.
If you desire a simpler workflow and don't plan to test Jekyll builds before publishing to GitHub,
you can simply fork/clone OpenTheme as your own GitHub project and edit, create posts directly within GitHub.

If you plan to do your custom build of Semantic UI, or modify the OpenTheme to your requirements,
then you may want to consider Cloud9 over setting up a dev box on your local machine.

Cloud9 comes with three big advantages over a local dev box setup.

**Pre-configured dev environment.** Basic Cloud9 box has several Jekyll dependencies already pre-installed.
Including Ruby. All you need to do is check versions and update the required gems in case you want to be on the latest.

**Cloud-to-cloud is faster.** Cloning, committing from-to GitHub is from Cloud9 servers to GitHub servers.
Latency is minimal, even if you are running on a GPS connection.

**Mobility.** Combination of the first two benefits means I can switch connection speeds, networks, machines, OS,
screen sizes and yet start from the last line I wrote or coded within no time.

gha_language: HTML


text:
### Created by Brian Kulei.
[live demo](https://brian6382.github.io/web_application/).
#### project description
It is a web app aplication that help us know the day we were born,
it also give us a name accouding to the day we were born.eg if you were born on Friday, and you are a male
ua name will be Kofi.
![Screenshot from 2021-06-13 12-30-04](https://user-images.githubusercontent.com/82508349/121802047-37719d80-cc43-11eb-87c9-764d7f787a66.png)
## setup & installation
- copy the url on arrow down.
- Clone on your computer.
- Go live or start your server.
## contact & license information.
You can forke the project.
## dependencies
-Monitor The day of the week we were born.
## Technologies Used
- HTML.
- CSS.
- BOOTSTRAP.
 JAVASCRIPT.
## contact
-072555466<EMAIL_ADDRESS>
# license information.
Read our [lincences](./Lincense).
Copyright (c) 2021 **MTI LINCENSE**


text:
# Steam for Go

This library allows you to interact with Steam as if it was an actual Steam client.
It's a port of [SteamKit2](https://github.com/SteamRE/SteamKit) to Go.

## Installation

    go get github.com/Philipp15b/go-steam

## Usage

You can view the documentation with the `godoc` tool or
[online on godoc.org](http://godoc.org/github.com/Philipp15b/go-steam).

When updating, always check the [`CHANGELOG.md`](CHANGELOG.md) first.

## Updating go-steam for a new SteamKit version

To update go-steam for a new version of SteamKit, do the following:

	go get code.google.com/p/goprotobuf/protoc-gen-go
    git submodule init && git submodule update
    cd generator
    go run generator.go clean proto steamlang

Replace `steamlang` with `steamlang:nodebug` if you want to exclude the `String() string` methods
for the generated SteamLanguage enums.

Make sure that `protoc-gen-go`/`$GOPATH/bin` is in your `$PATH`.
On Windows you also have to have [.NET Framework](https://www.microsoft.com/net/downloads) installed,
on other operating systems [mono](http://www.go-mono.com/mono-downloads/download.html)
is used (must be in `$PATH` too).

Apply the protocol changes where necessary.

## License

Steam for Go is licensed under the New BSD License. More information can be found in LICENSE.txt.

repository: macb/go-steam

repo_name: macb/go-steam


text:
UPGRADE 3.x
===========

UPGRADE FROM 3.9 to 3.10
========================

### Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQuery

Deprecated `getSingleScalarResult()` method.

UPGRADE FROM 3.8 to 3.9
=======================

### Sonata\DoctrineMongoDBAdminBundle\Filter\CallbackFilter

Deprecated not returning a boolean from the `callback` option.
Deprecated `active_callback` option, you MUST return a boolean in the `callback` option to specify if the filter should
be active or not.

Not adding `Sonata\AdminBundle\Filter\Model\FilterData` as type declaration of argument 4 of the callable passed to
`Sonata\DoctrineMongoDBAdminBundle\Filter\CallbackFilter` is deprecated. In version 4.0 this argument will be an
instance of `Sonata\AdminBundle\Filter\Model\FilterData`.

UPGRADE FROM 3.7 to 3.8
=======================

### Sonata\DoctrineMongoDBAdminBundle\Admin\FieldDescription

Deprecated this class in favor of `Sonata\DoctrineMongoDBAdminBundle\FieldDescription\FieldDescription`.

### Sonata\DoctrineMongoDBAdminBundle\Guesser\FilterTypeGuesser

Deprecated this class in favor of `Sonata\DoctrineMongoDBAdminBundle\FieldDescription\FilterTypeGuesser`.

### Sonata\DoctrineMongoDBAdminBundle\Guesser\TypeGuesser

Deprecated this class in favor of `Sonata\DoctrineMongoDBAdminBundle\FieldDescription\TypeGuesser`.

### Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager

Deprecated `modelReverseTransform()` method, use `reverseTransform()` instead.

### Sonata\DoctrineMongoDBAdminBundle\Builder\ListBuilder

Deprecated `buildActionFieldDescription()` method without replacement.

### Sonata\DoctrineMongoDBAdminBundle\Guesser\TypeGuesser

Deprecated `guessType()` method, you should use `guess()` method instead.

### Sonata\DoctrineMongoDBAdminBundle\Guesser\FilterTypeGuesser

Deprecated `guessType()` method, you should use `guess()` method instead.

### Sonata\DoctrineMongoDBAdminBundle\Guesser\AbstractTypeGuesser

This class has been deprecated without replacement.

### Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager

Deprecated `getParentMetadataForProperty()` method.
Deprecated `getNewFieldDescriptionInstance()` method, you SHOULD use `FieldDescriptionFactory::create()` instead.
Deprecated passing an instance of `Sonata\AdminBundle\Datagrid\ProxyQueryInterface`
which is not an instance of `Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQueryInterface` as
argument 2 to the `Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::addIdentifiersToQuery()` method.
Deprecated passing an instance of `Sonata\AdminBundle\Datagrid\ProxyQueryInterface`
which is not an instance of `Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQueryInterface` as
argument 2 to the `Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::batchDelete()` method.
Deprecated `getModelInstance()` method.

### Sonata\DoctrineMongoDBAdminBundle\Filter\Filter

Deprecated passing an instance of `Sonata\AdminBundle\Datagrid\ProxyQueryInterface`
which is not an instance of `Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQueryInterface` as
argument 1 to the `Sonata\DoctrineMongoDBAdminBundle\Filter\Filter::filter()` method.

UPGRADE FROM 3.6 to 3.7
=======================

### Sonata\DoctrineMongoDBAdminBundle\Datagrid\Pager

Deprecated `computeNbResult()` method.
Deprecated `getNbResults()` method, you SHOULD use `countResults()` instead.
Deprecated `setNbResults()` method.
Deprecated `getResults()` method.

UPGRADE FROM 3.5 to 3.6
=======================

### Sonata\DoctrineMongoDBAdminBundle\Guesser\TypeGuesser

`TypeGuesser::guessType()` returns `null` instead of `false` when there is no metadata found for the property
respecting `TypeGuesserInterface::guessType()`.

### Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager

Deprecated passing `null` as argument 2 for `find()`.
Deprecated passing `null` or an object which is in state new or removed as argument 1 for `getNormalizedIdentifier()`.
Deprecated passing `null` as argument 1 for `getUrlSafeIdentifier()`.
Deprecated `getModelIdentifier()`.
Deprecated `getDefaultSortValues()`.
Deprecated `getDefaultPerPageOptions()`.
Deprecated `modelTransform()`.
Deprecated `getDataSourceIterator()`. You SHOULD use
`Sonata\DoctrineMongoDBAdminBundle\Exporter\DataSource::createIterator` instead.

UPGRADE FROM 3.3 to 3.4
=======================

### Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager

- Deprecated `ModelManager::getModelCollectionInstance()`.
- Deprecated `ModelManager::collectionClear()`.
- Deprecated `ModelManager::collectionHasElement()`.
- Deprecated `ModelManager::collectionAddElement()`.
- Deprecated `ModelManager::collectionRemoveElement()`.
- Deprecated `ModelManager::getPaginationParameters()`.
- Deprecated `ModelManager::getSortParameters()`.

### Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQuery

Deprecated passing arguments to `execute()` method.

### Sonata\DoctrineMongoDBAdminBundle\DatagridBuilder

Changed constructor's first parameter typehint from `Symfony\Component\Form\FormFactory` to
`Symfony\Component\Form\FormFactoryInterface`.

### Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager

Deprecated `camelize()` method.

Deprecated not passing an instance of `PropertyAccessInterface` as second argument in the constructor.

### Sonata\DoctrineMongoDBAdminBundle\Admin\FieldDescription

Deprecated `getTargetEntity()`, use `getTargetModel()` instead.

UPGRADE FROM 3.0 to 3.1
=======================

### Tests

All files under the ``Tests`` directory are now correctly handled as internal test classes.
You can't extend them anymore, because they are only loaded when running internal tests.
More information can be found in the [composer docs](https://getcomposer.org/doc/04-schema.md#autoload-dev).


text:
## Implementation of Ceph [Quick Start examples](http://docs.ceph.com/docs/master/start/) in Vagrant

This allows you to run a [Ceph][] cluster in [VirtualBox][] virtual machines, in a minimal, reproducible environment, thanks to [Vagrant][].

```bash
vagrant plugin install vagrant-vbguest
vagrant up  # Inside the folder with Vagrantfile
# Wait...
```

```bash
vagrant ssh        # admin node
vagrant ssh node1  # mon+mds+rgw node
vagrant ssh node2  # osd node
vagrant ssh node3  # osd node
```

Things to try (inside the admin node):

```bash
ceph status

ceph osd pool create data 48
rados put --pool=data test-object <(echo test-data)
ceph osd map data test-object
```

With this setup you can access the cluster from the host machine. The folder with *Vagrantfile* is synchronized to contain the Ceph's keys. You can do all the same things as from the admin node, or even use this as a client.

```bash
ceph -k ceph.client.admin.keyring status

key='-k ceph.client.admin.keyring'
rados $key --pool=data get test-object -
```

The next fun thing to do is [making a block device](http://docs.ceph.com/docs/master/start/quick-rbd/#configure-a-block-device) on your host machine, to store arbitrary file systems... inside a cluster of VMs.
Just don't forget to pass the `-k` argument!

[ceph]: //ceph.com
[vagrant]: //vagrantup.com
[virtualbox]: //virtualbox.org

repository: oprypin/vagrant-ceph-quickstart

repo_name: oprypin/vagrant-ceph-quickstart


text:
# Intermediate Python for Data Science
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/uc-python/intermediate-python-datasci/master)

### Course Description

Welcome to Intermediate Python for Data Science! This short course provides a more detailed information on how programming with Python can make working with data easier and a deeper dive into the Python data science ecosystem. You will learn the to program more efficient data science applications using Python using control flow and custom functions, gain comfortability with Python from the shell, and be exposed to a few of the leading data science packages of Python like scikit-learn for predictive modeling.

### Objectives

The following are the primary learning objectives of students:

1. Learn to use control flow and custom functions to work with data more efficiently.

2. Build awareness and basic skills in working with Python from the shell and its environments.

3. Exposure to Python's data science ecosystem and modeling via scikit-learn.

### Agenda

**Day 1**

| Topic                                                                          |     Time      |
| :----------------------------------------------------------------------------- | :-----------: |
| Breakfast / Social Time                                                        |  8:00 - 9:00  |
| Introductions                                                                  |  9:00 - 9:15  |
| Setting the Stage                                                              |  9:15 - 9:45  |
| Conditions                                                                     |  9:45 - 10:30 |
| Break                                                                          | 10:30 - 10:45 |
| Iterations                                                                     | 10:45 - 12:00 |
| Lunch                                                                          | 12:00 - 1:00  |
| Functions                                                                      |  1:00 - 2:00  |
| Applying Functions to pandas Data Frames                                       |  2:00 - 2:30  |
| Break                                                                          |  2:30 - 2:45  |
| Case Study, pt. 1                                                              |  2:45 - 4:00  |
| Q\&A                                                                           |  4:00 - 4:30  |

**Day 2**

| Topic                                                                          |     Time      |
| :----------------------------------------------------------------------------- | :-----------: |
| Breakfast / Social Time                                                        |  8:00 - 9:00  |
| Case Study Review, pt. 1                                                       |  9:00 - 9:30  |
| Python from the Shell                                                          |  9:30 - 10:30 |
| Break                                                                          | 10:30 - 10:45 |
| Kernels and Environments                                                       | 10:45 - 11:30 |
| Python Data Science Ecosystem                                                  | 11:30 - 12:00 |
| Lunch                                                                          | 12:00 - 1:00  |
| Modeling with scikit-learn                                                     |  1:00 - 2:00  |
| Case Study, pt. 2                                                              |  2:00 - 3:15  |
| Case Study Review, pt. 2 and Q\&A                                              |  3:15 - 4:00  |

### Course Preparation

In an effort to simplify the setup for this class, we are using Binder for all in-class materials (slides, worksheets, etc.). In result, there is no pre-requisite installation required for the in-class material.

With that being said, we recommend installing the appropriate technologies and downloading the course materials. This will be more stable in the event of network issues, and *it will also be required to apply your learnings outside of class*.

Follow these steps to download the technologies and materials:

#### 1. Python, Jupyter and package installation.

These easiest way to install Python, Jupyter, and the necessary packages is through Anaconda. To download and install Anaconda:

1. Visit the [Anaconda download page](https://www.anaconda.com/distribution/)
2. Select your appropriate operating system
3. Click the "Download" button for Python 3.7 - this will begin to download the Anaconda installer
4. Open the installer when the download completes, and then follow the prompts. If you are prompted about installing PyCharm, elect **not** to do so.
5. Once installed, open the Anaconda Navigator and launch a Jupyter Notebook to ensure it works.
6. Follow [the package installation instructions](https://docs.anaconda.com/anaconda/navigator/tutorials/manage-packages/#installing-a-package) to ensure `pandas`, `numpy`, `scikit-learn`, and `seaborn` packages are installed.

#### 2. Download class materials

There are two ways to download the class materials:

1. Clone it - If you're familiar with how to do so, you can clone this repository.
2. Download the files as a zip - use [this link](https://github.com/uc-python/intermediate-python-datasci/archive/master.zip)

If you have any specific questions prior to the class you can reach out to us directly via GitHub or email:

  * Ethan Swan: [GitHub](https://www.github.com/eswan18) &<EMAIL_ADDRESS>  * Mark Roepke: [GitHub](https://www.github.com/markroepke) &<EMAIL_ADDRESS>


text:
# gradle-android-utils [![Build Status](https://secure.travis-ci.org/gfx/gradle-android-utils.png)](http://travis-ci.org/gfx/gradle-android-utils)

This is a set of utilities for Android build system.

NOTE: **This project is still alpha-qality; API will be change without notice**

# METHODS

### `void iconToGrayScale(File inputFile, File outputFile)`

Converts the input icon file into grayscaled one.

### `void copyFile(File inputFile, File outputFile, boolean toOverwrite = false)`

Create `outputFile` from `inputFile` if it does not exist.

You can force overwrite with specifies the `true` to the 3rd argument.

### `void initSdkDir(Map<String, String> extra = null)`

Creates `local.properties` if it does not exist, which includes
`sdk.dir`, `ndk.dir` and `extra` properties.

### `void writeResources(File file, Map<String, String> dict)`

Creates a resource XML file, which contains `dict`.

### `Version parseVersion(String versionName)`, `Version readVersion(File versionFile)`

Prases or reads a version object, which has `toVersionCode()` and `toVersionName()` methods.

## `void setBuildConfigField(buildType, Map<String, Object> buildConfigMap)`

Set `buildConfigField` from `Map`. Requirements to 'com.android.tools.build:gradle:0.8.0' or later.

``` groovy
// For example

android.variantFilter{ variant ->
    def buildConfigMap = [
        'APP_NAME': 'MyApp' + variant.buildType.name.capitalize(),
        'EXTENSION_MIN_SDK_INT': 14,
        'API_SERVER_PRODUCTION': false,
    ]

    setBuildConfigField(variant.buildType, buildConfigMap)
    // or
    //setBuildConfigField(variant.flavors.get(0), buildConfigMap)
}

/**
 * //Build result
 *
 * public final class BuildConfig {
 *   ...
 *   // Fields from build type: debug
 *   public static final String APP_NAME = "MyAppDebug";
 *   public static final Integer EXTENSION_MIN_SDK_INT = 14;
 *   public static final Boolean API_SERVER_PRODUCTION = false;
 * }
 */
```

# SEE ALSO

* https://github.com/gfx/Android-HankeiN which uses this project

# LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms of the MIT license.

repository: morristech/gradle-android-utils

repo_name: morristech/gradle-android-utils


text:
# vertx-jooq
A [jOOQ](http://www.jooq.org/)-CodeGenerator to create [vertx](http://vertx.io/)-ified DAOs and POJOs!
Perform all CRUD-operations asynchronously and convert your POJOs from/into a `io.vertx.core.json.JsonObject` using the API and
driver of your choice.

## new in version 3.0
A lot has changed - not only under the hood.
- Starting from this version on, `vertx-jooq` both includes the JDBC
and the async variant (formerly known as [`vertx-jooq-async`](https://github.com/jklingsporn/vertx-jooq-async/)). This
 avoids duplicate code and thus provides better stability.
- Say good bye callback-API: everybody who has written code that is more complex than a simple `HelloWorld` application
 hates callback-APIs. That is why I decided to let the classic-module now return Vertx `Futures` instead of accepting a
 `Handler` to deal with the result.
- `vertx-jooq-future` becomes `vertx-jooq-completablefuture`: that was more or less a consequence of the decision to let the
classic API return `Futures` now.
- Consistent naming: I decided to prefix any DAO-method that is based on a `SELECT` with `find`, followed by `One` if
it returns one value, or `Many` if it is capable to return many values, followed by a condition to define how the value is
obtained, eg `byId`. If you are upgrading from a previous version, you will have to run some search and replace sessions in your favorite IDE.
- DAOs are no longer capable of executing arbitrary SQL. There were two main drivers for this decision: 1. joining the JDBC
 and the async API did not allow it. 2. DAOs are bound to a POJO and should only operate on the POJO's type. With the option to execute any
  SQL one could easily join on POJOs of other types and thus break boundaries. You can still execute type-safe SQL asynchronously
  using one of the `QueryExecutors` though.
- Never again call blocking DAO-methods by accident: in previous vertx-jooq versions every `VertxDAO` extended from jOOQ's `DAOImpl` class.
This made it easy to just wrap the blocking variant of a CRUD-operation in a `Vertx.executeBlocking` block to get the async variant
  of it. The downside however was that the blocking CRUD-operations were still visible in the DAO-API and it was up to the user
  to call the correct (async) method. The blocking variants have been removed from the API - all calls are now asynchronous.
- All insert (except `insertReturningPrimary`), update and delete-methods now contain information about the number of affected rows.
The result is a cleaner, thinner API.
- Guice finally available for all async APIs.

## different needs, different apis
![What do you want](https://media.giphy.com/media/E87jjnSCANThe/giphy.gif)

Before you start generating code using vertx-jooq, you have to answer these questions:
- What API do you want to use? There are three options:
  - a `io.vertx.core.Future`-based API. This is `vertx-jooq-classic`.
  - a [rxjava2](https://github.com/ReactiveX/RxJava) based API. This is `vertx-jooq-rx`.
  - an API that returns a [vertx-ified implementation](https://github.com/cescoffier/vertx-completable-future)
  of `java.util.concurrent.CompletableFuture` for all async DAO operations. This is `vertx-jooq-completablefuture`.
- How do you want to communicate with the database? There are two options:
  - Using good old JDBC, check for the modules with `-jdbc` suffix.
  - Using this [asynchronous](https://github.com/mauricio/postgresql-async) database driver, check for `-async` modules.
- Do you use [Guice](https://github.com/google/guice) for dependency injection?

When you made your choice, you can start to configure the code-generator. This can be either done programmatically or
 using a maven- / gradle-plugin (recommended way). Please check the documentation in the module of the API of your choice how to set it up:

- [`vertx-jooq-classic-async`](vertx-jooq-classic-async)
- [`vertx-jooq-classic-jdbc`](vertx-jooq-classic-jdbc)
- [`vertx-jooq-rx-async`](vertx-jooq-rx-async)
- [`vertx-jooq-rx-jdbc`](vertx-jooq-rx-jdbc)
- [`vertx-jooq-completablefuture-async`](vertx-jooq-completablefuture-async)
- [`vertx-jooq-completablefuture-jdbc`](vertx-jooq-completablefuture-jdbc)

## example
Once the generator is set up, it will create DAOs like in the code snippet below (classic-API, JDBC, no dependency injection):
```
//Setup your jOOQ configuration
Configuration configuration = ...

//setup Vertx
Vertx vertx = Vertx.vertx();

//instantiate a DAO (which is generated for you)
SomethingDao dao = new SomethingDao(configuration,vertx);

//fetch something with ID 123...
dao.findOneById(123)
    .setHandler(res->{
    		if(res.succeeded()){
        		vertx.eventBus().send("sendSomething", res.result().toJson())
    		}else{
    				System.err.println("Something failed badly: "+res.cause().getMessage());
    		}
    });

//maybe consume it in another verticle
vertx.eventBus().<JsonObject>consumer("sendSomething", jsonEvent->{
    JsonObject message = jsonEvent.body();
    //Convert it back into a POJO...
    Something something = new Something(message);
    //... change some values
    something.setSomeregularnumber(456);
    //... and update it into the DB
    Future<Integer> updatedFuture = dao.update(something);
});

//or do you prefer writing your own type-safe SQL?
JDBCClassicGenericQueryExecutor queryExecutor = new JDBCClassicGenericQueryExecutor(configuration,vertx);
Future<Integer> updatedCustom = queryExecutor.execute(dslContext ->
				dslContext
				.update(Tables.SOMETHING)
				.set(Tables.SOMETHING.SOMEREGULARNUMBER,456)
				.where(Tables.SOMETHING.SOMEID.eq(something.getSomeid()))
				.execute()
);

//check for completion
updatedCustom.setHandler(res->{
		if(res.succeeded()){
				System.out.println("Rows updated: "+res.result());
		}else{
				System.err.println("Something failed badly: "+res.cause().getMessage());
		}
});
```

# known issues
- The generator will omit datatypes that it does not know, e.g. `java.sql.Timestamp`. To fix this, you can easily subclass the generator, handle these types and generate the code using your generator.
 See the `handleCustomTypeFromJson` and `handleCustomTypeToJson` methods in the `AbstractVertxGenerator` or checkout the [`CustomVertxGenerator`](vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate/custom)
 from the tests.


text:
# rumqttd

[![crates.io page](https://img.shields.io/crates/v/rumqttd.svg)](https://crates.io/crates/rumqttd)
[![docs.rs page](https://docs.rs/rumqttd/badge.svg)](https://docs.rs/rumqttd)

Rumqttd is a high performance MQTT broker written in Rust. It's light weight and embeddable, meaning
you can use it as a library in your code and extend functionality

## Getting started

You can directly run the broker by running the binary with a config file with:

```
cargo run --release -- -c rumqttd.toml

```

Example config file is provided on the root of the repo.

#### Building the docker image

In order to run rumqttd within a docker container, build the image by running `build_rumqttd_docker.sh` from the project's root directory. The shell script will use docker to build rumqttd and package it along in an [alpine](https://hub.docker.com/_/alpine) image. You can then run `rumqttd` using default config with:

```bash
./build_rumqttd_docker.sh
docker run -p 1883:1883 -p 1884:1884 -it rumqttd
```

Or you can run `rumqttd` with the custom config file by mounting the file and passing it as argument:

```bash
./build_rumqttd_docker.sh
docker run -p 1883:1883 -p 1884:1884 -v /absolute/path/to/rumqttd.toml:/rumqttd.toml -it rumqttd -c /rumqttd.toml
```

# How to use with TLS

To connect an MQTT client to rumqttd over TLS, create relevant certificates for the broker and client using [provision](https://github.com/bytebeamio/provision) as follows:
```bash
provision ca // generates ca.cert.pem and ca.key.pem
provision server --ca ca.cert.pem --cakey ca.key.pem --domain localhost // generates localhost.cert.pem and localhost.key.pem
provision client --ca ca.cert.pem --cakey ca.key.pem --device 1 --tenant a // generates 1.cert.pem and 1.key.pem
```

Update config files for rumqttd and rumqttc with the generated certificates:
```toml
[v4.2.tls]
    certpath = "path/to/localhost.cert.pem"
    keypath = "path/to/localhost.key.pem"
    capath = "path/to/ca.cert.pem"
```

You may also use [certgen](https://github.com/minio/certgen), [tls-gen](https://github.com/rabbitmq/tls-gen) or [openssl](https://www.baeldung.com/openssl-self-signed-cert) to generate self-signed certificates, though we recommend using provision.

**NOTE:** Mount the folders containing the generated tls certificates and the proper config file(with absolute paths to the certificate) to enable tls connections with rumqttd running inside docker.

## Dynamically update log filter

Log levels and filters can by dynamically updated without restarting broker.
To update the filter, we can send a POST request to `/logs` endpoint, which is exposed by our console, with new filter as plaintext in body.
For example, to get logs of rumqttd ( running locally and expose console at port 3030 ) with log level "debug", we can do:
```sh
curl -H "Content-Type: text/plain" -d "rumqttd=debug" <IP_ADDRESS>:3030/logs
```

The general syntax for filter is:
```
target[span{field=value}]=level
```
So filter for logs of client with id "pub-001" which has occurred any any span will be `[{client_id=pub-001}]`. Know more about it [here](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/struct.EnvFilter.html#directives)

repository: bytebeamio/rumqtt

gha_language: Rust

repo_name: bytebeamio/rumqtt


text:
---
title: Strangers
devised: true
season: Fringe
season_sort: 90
period: Autumn
venue: New Theatre Studio A and B
venue_sort: New Theatre Studio A
date_start: 2015-11-29
date_end: 2015-11-30

cast:
- role: Mindreader
  name: Melina Paneris
- role: Entertainer
  name: Josh Mallalieu
- role: Waitress
  name: Natalia Gonzalez Morales
- role: Gambler
  name: Chloe Wilson
- role: Interest
  name: Amy Naylor
- role: Obsession
  name: Gary Berezin
- role: Presenter
  name: Laura Thornton

crew:
- role: Director
  name: Joe Strickland
- role: Producer
  name: James Collyer
- role: Show Designer
  name: Joe Strickland
- role: Lighting Designer
  name: Joseph Heil
- role: Technical Director
  name: Emily Sterling
- role: Technical Director
  name: Sam Layton
- role: Poster Designer
  name: Beth Mullen

assets:
  - type: poster
    image: q3kdpxT
  - type: programme
    title: Strangers Programme Notes
    filename: strangers-programme-notes.pdf

links:
  - type: Review
    href: http://www.impactnottingham.com/2015/12/strangers-nottingham-new-theatre/
    snapshot: F0yYK
    publisher: Impact Nottingham
    author: Larissa Rowan
    title: "Strangers @ Nottingham New Theatre"
    date: 2015-12-01
    rating: 8/10
    quote: "I was shocked to discover that this was the first performance for many of the cast members, as they delivered a solid and powerful production, along with the production crew. "
---

Strangers is a unique style of performance, blending magic and theatre to create a new artistic medium. In the way a musical tells a story with the help of music and lyrics this tells a story with the help of tricks and illusions. When seven strangers each encounter a magical set of pan pipes they think all their dreams have come true. However, the mind reader, children’s entertainer, restaurant server, gambler, couple on a first date, and television presenter find out that fame, fortune and freedom come at a cost. One that each character will come to deeply regret.

repository: newtheatre/history-project

repo_name: newtheatre/history-project


text:
# Challenge Summary - repeatedWord

+ Find the first repeated word in a book.

## Challenge Description

+ Write a function that accepts a lengthy string parameter.
+ Without utilizing any of the built-in library methods available to your language, return the first word to occur more than once in that provided string.

## Approach & Efficiency

+ Big O: O(n log n)

## Solution

+ ![repeatedWord](CC-31.png)

+ Example

+ Input: "Once upon a time, there was a brave princess who..."
+ Output: "a"

+ Input: "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way – in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only..."
+ Output: "it"

+ Input: "It was a queer, sultry summer, the summer they electrocuted the Rosenbergs, and I didn’t know what I was doing in New York..."
+ Output: "summer"

gha_language: JavaScript


text:
# Time and Process

~8.5 hours in total.

2 hours reading related literature for background knowledge.

2 hours exploring some tools, namely
[Oyente](https://github.com/enzymefinance/oyente),
[Slither](https://github.com/crytic/slither), and
[Vandal](https://github.com/usyd-blockchain/vandal).

1 hour identifying a suitable issue for this project.

2 hours writing code and performing experiments.

1.5 hours writing this document.

## Choice for the Tool

First of all, given the limited amount of time, it is a good idea to start from
an existing
framework to detect some issues. Either parsing and analyzing the Solidity source code
or analyzing the EVM bytecode will require good infrastructures.

[Vandal](https://github.com/usyd-blockchain/vandal) is used as the staring pointing
for this project for the following reasons.

1. It accepts EVM bytecode as input. This enables the tool to cover a larger set
of EVM based smart contracts (as supposed to taking Solidity code as input).

2. It provides right levels of abstractions. Vandal first decompiles the EVM bytecode
into three-address code (TAC). Then, Vandal extracts higher-level information
(data flows, control flows, etc.) and express this information in Datalog rules.
One could write and analysis using both three-address code primitives and higher-level
Datalog rules.

## Choice for the Issue

For this project, the Transaction order dependence (TOD) issue is chosen based on the
following criteria.

1. The issue has not been solved using the Vandal framework. So, issues including
Reentrancy, Unchecked Call, and Out-of-Gas are not chosen.
2. The issue involves some domain knowledge in EVM smart contracts. The TOD issue
involves state variables, which are something special.

# Problem

Detecting Transaction Order Dependence

Transaction order dependence (TOD) is a know issue where different execution orders of
transactions lead to different results.
Here is a typical scenario for this issue. We have two transactions T1 and T2 invoking
contract C. T1 set a reward amount, and T2 send the reward to a user. One might observe
such two transactions and manipulate the order of these two transactions being included
in the block, so the user being rewarded may receive different amounts of rewards.

This issue is documented here https://swcregistry.io/docs/SWC-114 with contract samples.
This is a minimal example demonstrate the TOD issue. If there is one transaction invoking
the setReward() function which updates the reward state variable and anther transaction
claiming the reward by invoking the claimReward() function, different orders of these two
transactions will transfer different rewards to the receiver.

```solidity
/*
 * @source: https://github.com/ConsenSys/evm-analyzer-benchmark-suite
 * @author: Suhabe Bugrara
 */

pragma solidity ^0.4.16;

contract EthTxOrderDependenceMinimal {
    address public owner;
    bool public claimed;
    uint public reward;

    function EthTxOrderDependenceMinimal() public {
        owner = msg.sender;
    }

    function setReward() public payable {
        require (!claimed);

        require(msg.sender == owner);
        // owner.transfer(reward);
        reward = msg.value;
    }

    function claimReward(uint256 submission) {
        require (!claimed);
        require(submission < 10);

        msg.sender.transfer(reward);
        claimed = true;
    }
}
```

This is a contract without the issue.

```solidity
/*
 * @source: https://github.com/ConsenSys/evm-analyzer-benchmark-suite
 * @author: Suhabe Bugrara
 */

pragma solidity ^0.4.16;

contract EthTxOrderDependenceMinimal {
    address public owner;
    bool public claimed;
    uint public reward = 5; // changed here

    function EthTxOrderDependenceMinimal() public {
        owner = msg.sender;
    }

    function setReward() public payable {
        require (!claimed);

        require(msg.sender == owner);
        // owner.transfer(reward);
        // reward = msg.value; // changed here
    }

    function claimReward(uint256 submission) {
        require (!claimed);
        require(submission < 10);

        msg.sender.transfer(reward);
        claimed = true;
    }
}
```

# Detecting TOD Issues

When TOD happens, there is one transaction T1 updates a state variable V.
To this end, we define the following Datalog rule.

```datalog
// write the value of Variable var to storage location val in Statement stmt
.decl SSTORE(stmt: Statement, val: Value, var: Variable)

SSTORE(stmt, val, var) :-
  op(stmt,"SSTORE"),
  use(index, stmt, 1), // write to the storage location indexed by the value of Variable index
  use(var, stmt, 2), // write the value of Variable var to the storage location
  value(index, val). // Variable index has value val
```

There is another transaction T2
makes a call whose argument $value is dependent on the state variable V.
Since the argument $value is dependent on V, this transaction reads from V.
we define the following Datalog rule.

```datalog
// read the value of storage location val to Variable var in Statement stmt
.decl SLOAD(stmt: Statement, val: Value, var: Variable)

SLOAD(stmt, val, var) :-
  op(stmt,"SLOAD"),
  use(index, stmt, 1), // read from the storage location indexed by the value of Variable index
  def(var, stmt), // the read result is in Variable var
  value(index, val). // // Variable index has value val
```

Finally, putting these together, T1 sets the value of x1, and the value
of x2 is dependent on x1, and T1 writes to storage location val with the value
of x2. Then, T2 makes a storage load and loads the result into y1.
Note that SSTORE and SLOAD share the same $val argument. This means the
associated read and write operations access the same storage location (and the
same state variable).
The value of y2 is dependent on y1,
and the value of y2 is used as the argument $value in CALL.

```datalog
todCall(stmt) :-
  setBySource(x1),
  depends(x2, x1),
  SSTORE(_, val, x2),
  SLOAD(_, val, y1),
  depends(y2, y1),
  op_CALL(stmt, _, _, y2, _, _, _, _).
```

# Implementations and Experiments

## Implementation

The analysis is in ./datalog/tod.dl, and it depends on some other files in the
./datalog/lib folder.

## Install the Tool

The requirements for this tool could be generally installed using the following command:

```bash
pip install -r requirements.txt
```

Here are more
[detailed instructions](https://github.com/usyd-blockchain/vandal/wiki/Getting-Started-with-Vandal#writing-analyses)
from the original repo.

## Benchmarks

A contract with TOD issue: ./myExamples/tod/tod.sol

A contract without TOD issue: ./myExamples/tod/todNot.sol

## Running the experiments

From the root of the project,

```bash
cd myExamples/tod
solc --bin-runtime tod.sol | tail -n 1 > tod.hex
../../bin/analyze.sh tod.hex ../../datalog/tod.dl
```
The result is in the todCall.csv file. Similarly, for the contract without TOD issue,
```
solc --bin-runtime todNot.sol | tail -n 1 > todNot.hex
../../bin/analyze.sh todNot.hex ../../datalog/tod.dl
```

repository: rpanwork/vandal

repo_name: rpanwork/vandal


text:
# Introduction
We use our hands to play most musical instruments. Why not make a hand-instrument? A combination of sensors mounted on a glove is used to generate sounds on a personal computer. The glove has 5 flex sensors (one along each finger), 5 pressure sensors (one on each finger tip), and an inertial measurement unit (MPU-6050) consisting of a 3-axis gyroscope and a 3-axis accelerometer. The sensors send analog data via a micro-controller (e.g. Arduino) to the serial port on a computer. The data then gets processed in real-time to create music. For a start, Python and Arduino are used to make it accessible to everyone and encourage developers to contribute. The basic functionality also requires a Digital Audio Workstation (DAW) like GarageBand, Logic or Ableton.

#Setup

## Packages
This package uses Python 3.5. The following packages are required
- [mido](https://pypi.python.org/pypi/mido/1.1.3) is used to send midi messages to a virtual instrument. Install with `pip install mido`.
- [rtmidi](https://pypi.python.org/pypi/python-rtmidi/0.3.1a) is used as a backend for mido. Install with `pip install python-rtmidi`.
- [PyQt5](http://pyqt.sourceforge.net/Docs/PyQt5/) is used for an optional GUI. Install with `pip install pyqt5` and by following instructions [here](http://pyqt.sourceforge.net/Docs/PyQt5/installation.html).

## Virtual instrument
MIDI messages are sent from the python code to a DAW (e.g. GarageBand) on the computer. For this you need to setup a virtual midi port. For mac, use the following [instructions](http://feelyoursound.com/setup-midi-os-x/). Then, replace the `IACDriver` variable `__init__.py` with your virtual midi port name. Once this is done, the DAW will discover the app as a midi instrument.

# Usage
For compiling a non-GUI version, run `python Main.py`. In `Main.py`:
- For `PressureNotes = 1`, the glove triggers a set of notes with the pressure sensors specified by `n1`, with threshold pressure `pressThresh`
- For `FlexNotes = 1`, the glove triggers a set of notes with the flex sensors specified by `n2`, with threshold flex `pressThresh`
- For `FlexPitchChords = 1` uses the IMU pitch data to trigger a chord when below a certain angle, and the flex sensors to specify the chord. The mapping is specified in the `trig2chord` function in `notemidi.py`.
- For a table of all possible notes, see the csv file `data/tables/note2midi.csv`.
- Pressure and Flex sensors can be used in combination as they run in two seperate threads but this is not recommended. For now, only have one of the above set to 1.

- Simulation: if you don't have a glove, it is most convenient to use the simulation functionality. For `sim = 1` and a specified simulation file `simfile`, the program will read sensor data recorded from the glove in the `data/sim/` folder. Otherwise, if you are using the glove, set it to 0.
- Recording: if you have the glove and want to record a file for future simulation, run `python sensor_read.py`. Your sensor data will be recorded in the `filename` you specify in the script.

## GUI
For a more intuitive usage of the glove, there is a GUI application using PyQt5 (not yet complete). This can be used by running `python gluvUI.py`.

## Potential Applications
- String instrument (e.g. violin) with pressure sensors for notes and accelerometer for vibrato
- pressure sensors with accelerometer data triggering percussion instruments by shaking the hand (audio using PyAudio)
- Accelerometer conductor baton for controlling playback speed in realtime (requires addition of playback capabilities)
- General language (gesture sequences) for triggering specific musical events
- Incorporating VMO for improvising with the gluvn!

repository: adigandhi/Gluvn

repo_name: adigandhi/Gluvn


text:
## Social Media ##

### Installation ###

* `git clone https://github.com/johnyblaze/SocialMedia.git projectname`
* `cd projectname`
* `composer install`
* `php artisan key:generate`
* Create a database and inform *.env*
* `php artisan migrate --seed` to create and populate tables
* Inform *config/mail.php* for email sends
* `php artisan vendor:publish` to publish filemanager

### Features ###

* Home page
* Custom Error Page 404
* Authentication (registration, login, logout, password reset, mail confirmation, throttle)
* Users roles : administrator (all access), redactor (create and edit post, upload and use medias in personnal directory), and user (create comment in blog)
* Blog with comments
* Search in posts
* Tags on posts
* Contact us page
* Admin dashboard with new messages, users, posts and comments
* Users admin (roles filter, show, edit, delete, create)
* Messages admin
* Posts admin (list with dynamic order, show, edit, delete, create)
* Medias gestion

### Tricks ###

To test application the database is seeding with users :

* Administrator : email =<EMAIL_ADDRESS>password = admin

repository: johnyblaze/SocialMedia

repo_name: johnyblaze/SocialMedia


text:
Elastos.ELA version 0.3.7 is now available from:

  <https://download.elastos.io/elastos-ela/elastos-ela-v0.3.7/>

This is a new minor version release, fix transaction count check error when sync block, fix rollback failed error, compatible with release_v0.3.6 version.

Please report bugs using the issue tracker at GitHub:

  <https://github.com/elastos/Elastos.ELA/issues>

How to Upgrade
==============

If you are running version release_v0.3.5 and before, you should shut it down and wait until
 it has completely closed, then just copy over `ela` (on Linux).

However, as usual, config, keystore and chaindata files are compatible.

Compatibility
==============

Elastos.ELA is supported and extensively tested on operating systems
using the Linux kernel. It is not recommended to use Elastos.ELA on
unsupported systems.

Elastos.ELA should also work on most other Unix-like systems but is not
as frequently tested on them.

As previously-supported CPU platforms, this release's pre-compiled
distribution provides binaries for the x86_64 platform.

Notable changes
===============

Fixed new nodes that could not be synchronized from scratch

0.3.7 change log
=================

Detailed release notes follow

- #1170 `c853031` fix transaction count check error when sync block
- #1177 `19045cd` fix rollback failed error

detected_licenses: MIT BSD-3-Clause ISC

gha_language: Go

gha_license_id: NOASSERTION


text:
# Finite integration of polynomials

A finite integration method, from "[Boundary integration over linear polyhedra](https://www.sciencedirect.com/science/article/pii/001044859090007Y)", is developed here, to compute various-order monomial integrals over polyhedral solids and surfaces in 3D space. The integration method can be used for the exact evaluation of domain integrals of trivariate polynomial forms.

## Integration Algorithms

Here we implement a finite solution
to both surface and volume integration of polynomials, by using a
triangulation of the domain boundary.   The evaluation of
surface and volume integrals is achieved by transformation into line
integrals over the boundary of every 2-simplex of a domain
triangulation.  A different approach to finite integration, using a
decomposition into volume elements induced by a boundary triangulation
is given in "[A symbolic method for calculating the integral properties of arbitrary nonconvex polyhedra](https://ieeexplore.ieee.org/document/6429334/)" where a closed formula for volume
integration over polyhedral volumes, by decomposing the solid into a set
of solid tetrahedra, but such a method cannot be used for surface
integrations.

Surface integrals are computed as a summation of integrals over a
triangulation of the surface.  Any triangle is mapped into the unit
triangle in the 2-space of parameters, where integrals
of monomials become particularly
simple.  Then formulae for integrals over polyhedral volumes are
given.  They are easily derived by transforming volume integrals in
surface integrals using the Divergence Theorem.
It is possible to show that such integrals are
computable in polynomial time, and that inertia moments are computable
in $O(E)$ time, $E$ being the number of edges of the solid model of
the integration domain.

An important feature of the integration formulae presented here is
that they can also be used with a partial model of a polyhedron,
consisting of the collection of its boundary's 2-cell cycles (loops).
Loops are oriented
counter-clockwise if external, clockwise if internal to another loop.
Such a  model, without explicit storage of face adjacencies, is
very frequently adopted in Computer Graphics.
In this case it is sufficient to consider any $(n+1)$-sided face (also
unconnected or multiply connected)  as topological sum of $n-1$
oriented triangles $t_i$, with vertices $\langle v_0, v_i,
v_{i+1}\rangle$, where $1\le i\le n-1$ .  In applying formulae
(\ref{19}) or (\ref{27}) to such a set of triangles, any edge that
does not belong to the original polygon will be computed twice, in the
two opposite directions.  These contributions to the whole integral
will mutually cancel each other, as they correspond to pairs of
line integrals evaluated along opposite paths

## Examples

### 2D integration

First some examples are given of the basic integration functions on 2D plane. The `II` integral, with parameters `alpha,beta,gamma = 0,0,0` returns the area of the domain `P`. It is important to notice that all domains (both 2D and 3D) are embedded in 3-space.

# Example  unit 3D triangle
```julia
julia> V = [0.0 1.0 0.0; 0.0 0.0 1.0; 0.0 0.0 0.0]
3×3 Array{Float64,2}:
 0.0  1.0  0.0
 0.0  0.0  1.0
 0.0  0.0  0.0

julia> FV = [[1,2,3]]
1-element Array{Array{Int64,1},1}:
 [1, 2, 3]

julia> P = V,FV
([0.0 1.0 0.0; 0.0 0.0 1.0; 0.0 0.0 0.0], Array{Int64,1}[[1, 2, 3]])

julia> Lar.II(P, 0,0,0)
0.5
```
Then, more interesting examples are given. First, the surface of the affinely transformed (rotated and translated) unit square:

```julia
julia> V,FV = Lar.simplexGrid([1,1])
([0.0 1.0 0.0 1.0; 0.0 0.0 1.0 1.0], Array{Int64,1}[[1, 2, 3], [2, 3, 4]])

julia> P = [V;[0 0 0 0]], FV
([0.0 1.0 0.0 1.0; 0.0 0.0 1.0 1.0; 0.0 0.0 0.0 0.0],
Array{Int64,1}[[1, 2, 3], [2, 3, 4]])

julia> Lar.surface(P)
1.0

julia> p = Lar.Struct([Lar.t(0.5,0.5,0), Lar.r(0,0,pi/4), P]);

julia> q = Lar.struct2lar(p);

julia> Lar.surface(q)
1.0000000532124802
```
Then, the surface and the barycenter  of the simplicial grid `3 x 4` of unit 2-cells on the ``z=0`` plane is computed. Notice that the  `centroid` function cannot be used, since `P` is two-dimensional (flat) and embedded in 3-space. So, we use directly the centroid definition as first surface moments divided by area. Remember that the grid domain is ``3 x 4``.

```julia
julia> V,FV = Lar.simplexGrid([3,4]);

julia> P = [V; zeros(size(V,2))'], FV;

julia> Lar.surface(P)
12.0

julia> Lar.II(P,1,0,0)/Lar.II(P,0,0,0)
1.5

julia> Lar.II(P,0,1,0)/Lar.II(P,0,0,0)
2.0

julia> Lar.II(P,0,0,1)/Lar.II(P,0,0,0)
0.0
```

### 3D integration

The simplest example of volume integration is `volume` integral on the unit 3D tetrahedron `P`.

```julia
julia> V = [0.0 1.0 0.0 0.0; 0.0 0.0 1.0 0.0; 0.0 0.0 0.0 1.0]
3×4 Array{Float64,2}:
 0.0  1.0  0.0  0.0
 0.0  0.0  1.0  0.0
 0.0  0.0  0.0  1.0

julia> FV = [[1, 2, 4], [1, 3, 2], [4, 3, 1], [2, 3, 4]]
4-element Array{Array{Int64,1},1}:
 [1, 2, 4]
 [1, 3, 2]
 [4, 3, 1]
 [2, 3, 4]

julia> P = V,FV
([0.0 1.0 0.0 0.0; 0.0 0.0 1.0 0.0; 0.0 0.0 0.0 1.0],
Array{Int64,1}[[1, 2, 4], [1, 3, 2], [4, 3, 1], [2, 3, 4]])

julia> Lar.volume(P)
0.16666666666666674
```

For more general polyhedrons, we must extract the boundary sourface, get a triangulation
and apply the 3D integration functions on the LAR of such models.

## Main Interface

```@docs
Lar.surface
```

```@docs
Lar.volume
```

```@docs
Lar.centroid
```

gha_language: Julia


text:
# ThingWorx Windows Services extension

This is a simple ThingWorx extension wrapping `sc` command-line utility from Windows SDK (see details
[in Windows Dev Center](https://docs.microsoft.com/en-us/windows/win32/services/controlling-a-service-using-sc)).
Currently it supports only querying Windows services, allowing you to
get the list and state of all configured services on the Windows box where ThingWorx is running. Usage is trivial:

```javascript
try {
    var windowsServices = Resources["WindowsServicesFunctions"].QueryServices();
} catch (ex) {
    // Unsupported platform (Linux, Docker, no SDK, etc.)
}
```

This returns an INFOTABLE of `WindowsService` shape like this:

| name            | description                  | type              | state   |
| --------------- | ---------------------------- | ----------------- | ------- |
| AdobeARMservice | Adobe Acrobat Update Service | WIN32_OWN_PROCESS | RUNNING |
| Appinfo         | Application Information      | WIN32             | RUNNING |
| AppMgmt         | Application Management       | WIN32             | RUNNING |

## Installing

1. Download [extension's ZIP file](https://raw.githubusercontent.com/vilia-fr/twxscext/master/build/distributions/windows-services-ext.zip)
2. Make sure that your ThingWorx is configured to allow installing server-side extensions (ThingWorx 8.4+)
3. Open ThingWorx Composer > Import/Export > Extensions > Import
4. Select the ZIP file, upload and refresh the browser page as suggested
5. You can use the extension, no need to restart the server

## Upgrading

To upgrade the extension, you'll need to repeat the same steps as for installing. Don't forget to restart the server afterwards.

## Removing

To remove the extension from your ThingWorx installation you'll need to:

1. Check your code to make sure that you don't use it anywhere (a handy way to do it would be exporting all your entities "to source control",
i.e. as a bunch of XML files and do a `grep` over those files, looking for `WindowsServicesFunctions`.
2. Uninstall it via Composer > Import/Export > Extensions > Manage
3. Restart the server

## Compatibility

Tested against the following versions of ThingWorx:

1. ThingWorx 7.4.0-b159
2. ThingWorx 8.4.3-b2219

Both on Windows 10 Version 1803 (OS Build 17134.885).

## Docker support

On Windows Docker containers run inside Hyper-V or VirtualBox VMs with MobyLinux, which means that technically speaking ThingWorx is running on Linux and
is not aware of the Windows hypervisor. Which in turn means it doesn't know anything about Windows' `sc` command, so this extension won't work.

## Dependencies

This extension depends only on the `sc` utility, available as part of [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk).
Make sure the SDK is installed before you use this extension. If you try using it without SDK or on Linux, you will get a runtime exception, so make sure you
catch it in the calling code.

There are no external Java dependencies.

## Security considerations

This extension executes a command-line utility on the Windows `PATH`. An evildoer with write access to any of the directories on the PATH can compromise its
results or execute malicious code under Tomcat user. This simplistic design has major implications on your server security, so please make sure you understand
it before using this extension.

Most importantly, do not install untrusted software on the server host, and make sure your Tomcat user has as few access rights as possible. But even then
there is a risk that this extension may compromise the system, so **DON'T USE IT IN PRODUCTION**, or better modify it to make it safer (e.g. use absolute
path to `sc`, or use another mechanism altogether).

## Building

1. Copy JAR files from ThingWorx Extension SDK into /twx-lib directory;
2. Execute `ant -f build-extension.xml`

## Disclaimer

Vilia does not support this extension, nor liable for any side effects of installing it on your ThingWorx system.
Use it on your own risk. **DO NOT USE IT IN PRODUCTION ENVIRONMNENT!**

repository: vilia-fr/twx-sc-ext

repo_name: vilia-fr/twx-sc-ext


text:
# Data Analysis for Genomics

## NEWS:

January 12, 2015 : we are reogranizing the labs here and the book:

http://genomicsclass.github.io/book/

The content will be split into 8 courses. The first course starts
January 19, 2015:

https://www.edx.org/course/statistics-r-life-sciences-harvardx-ph525-1x

*Note*: if you want to contribute through pull request, please first clone a new version of the repo. If you have a version of the repo from 2014, it might contain some large data objects, which accidentally snuck in, and we want to avoid reincluding these.

## Courses:

- 1: Statistics and R for the Life Sciences
- 2: Introduction to Linear Models and Matrix Algebra
- 3: Advanced Statistics for the Life Sciences
- 4: Introduction to Bioconductor
- 5: Case study: RNA-seq data analysis
- 6: Case study: Variant Discovery and Genotyping
- 7: Case study: ChIP-seq data analysis
- 8: Case study: DNA methylation data analysis

repository: miroslavas/labs

repo_name: miroslavas/labs


text:
# novemberalpha
An app that tells you how to pronounce a word using the NATO phonetic alphabet.

# Development
```bash
$ npm install
$ grunt
$ node dist/app.js
```

# Demo
See it [live](http://vikasgorur.in/novemberalpha/).

![screencast](https://github.com/vikasgorur/novemberalpha/raw/master/screencast.gif)

repository: vikasgorur/novemberalpha

repo_name: vikasgorur/novemberalpha


text:
# Burger App

![<ALT>](https://img.shields.io/badge/Burger-App-blue)

## Description

An application that lets display conceptual burgers which you can in turn devour.

## Table of Contents

- Installation
- Usage
- License
- Contributors
- Tests
- Questions

## Installation

https://burger-app-ak.herokuapp.com/ - current build is not deployed, best way to use it is on local host through the repository here: https://github.com/icecicle04/burger

## Usage

Input the new burger item you would like to devour. Click add burger. Once the burger is added to the list, you can then devour the burger and it will move to the devoured column.

## Licenses

MIT License

## Contributors

Ali Khan

## Tests

Tested on Local Host

## Questions

email<EMAIL_ADDRESS>
## Images

![<ALT>](public/assets/images/homepage.png)


text:
# Creating Your Project with the CLI Boilerplate

- Link out to installing the CLI tool.
- Run the `create-project` command using the Apostrophe boilerplate, with `open-museum` as the project name.
- Include updating `secret` in apostrophe-express
- install and run for the first time.


text:
# Lobster Challenge

![Charles and his lobster](lobster.jpg "Charles and his lobster")

Charles has a lobster, but the poor creature does not yet have a name.
Let's use a simple Plutus Smart Contract on Cardano to help Charles find a name for his lobster!

We start with a [list of names](names.md) and a "secret random" number, which we will only reveal in the end.
Then we need the Community's help! We need 500 Community members who are willing to help name the lobster by
creating transactions which will add their own "random" number (from 1 to 100) to the current total.

In the end, we will reveal our own "secret random" number, add it to the total provided by the Community,
and use the result (after taking the remainder after division by the number of available names) as an index
into the list of names to pick the lobster name.

## Native Tokens

We use three distinct native tokens to help us name the lobster:

| Policy                                     | Policy Id                                                  | Token Name       | Purpose                             |
| ------------------------------------------ | ---------------------------------------------------------- | ---------------- | ----------------------------------- |
| [script](scripts/nft-mint-policy.plutus)   | `cc7888851f0f5aa64c136e0c8fb251e9702f3f6c9efcf3a60a54f419` | `LobsterNFT`     | Identifies the relevant UTxO.       |
| [script](scripts/other-mint-policy.plutus) | `fda1b6b487bee2e7f64ecf24d24b1224342484c0195ee1b7b943db50` | `LobsterCounter` | Stores the current "random" number. |
| [script](scripts/other-mint-policy.plutus) | `fda1b6b487bee2e7f64ecf24d24b1224342484c0195ee1b7b943db50` | `LobsterVotes`   | Counts the number of votes.         |

The first one, `LobsterNFT`, is an NFT and used to identified the "correct" UTxO "sitting" at the contract address.
(Recall that _anybody_ can send _anything_ _anywhere_ at _anytime_, so we can't prevent people from creating other UTxO's at the script address.
The UTxO we care about is the one holding the NFT.)

The second one, `LobsterCounter`, stores the current "random" number. It starts at zero when the contract is deployed,
and each "vote" can add a number of tokens between 1 and 100.
Once 500 people have "voted", we add our own secret number, which we picked before deploying the contract and which is a parameter to the contract and hence encoded in the script address. Finally we take the rest of dividing the sum by the number of names in the list of possible names.
This will be the final amount of `LobsterCounter` tokens "sitting" at the script address, and it will indicate the index of the chosen lobster name.

The third token, `LobsterVotes`, is used to count the number of "votes".
Each time a user interacts with the contract and increases the amount of `LobsterCounter` tokens by a "random" number,
The amount of `LobsterVotes` tokens at the script UTxO will go up by one.
Once 500 people have "voted", voting stops, and we will set the final result with a last transaction,
which will bring the amount of `LobsterVotes` tokens to its ultimate value of 501.

## Script

The validator for the naming contract is paramterized by six parameters:

| Parameter  | Value                              | Explanation                     ]
| ---------  | ---------------------------------- | ------------------------------- |
| Seed       | TO BE REVEALED                     | Our own "random" number.        |
| NFT        | `LobsterNFT`token (see above)      | Token identifying the UTxO.     |
| Counter    | `LobsterCounter` token (see above) | Token tracking "random" number. |
| Votes      | `LobsterVotes` token (see above)   | Token counting votes.           |
| Name Count | 1219                               | Number of available names.      |
| Vote Count | 500                                | Number of votes.                |

We will reveal the "seed", our own "random" contribution, in the end,
when we finalize the contract.

Using these parameter values, we get a [script](scripts/lobster.plutus) with script address `addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff`.

## Example

Let's look at an example and assume our own "secret random" number is 42.

Voting might progress as follows:

| `LobsterCounter` | `Lobster Votes` | Comment |
| ----------------:| ---------------:| ------- |
|                0 |               0 | In the beginning, there have been no votes, and the counter starts at zero.                                     |
|               13 |               1 | The first Community member votes and adds 13 to the counter.                                                    |
|              113 |               2 | The second Community member adds 100.                                                                           |
|              114 |               3 | The third Community member adds 1.                                                                              |
|              ... |             ... | More Community members add their own numbers.                                                                   |
|            24782 |             500 | The last vote has been cast, which brought the counter to 24782.                                                |
|              444 |             501 | We add our own secret, 42, and get 24824. Dividing this by 1219, the number of names, gives a remainder of 444. |

In this example, the lobster will get the name with index 444, which happens to be __Stewart__.

## Voting

We will kick off the process by minting the `LobsterNFT` NFT and creating a UTxO at the script address,
which contains the NFT, but neither `LobsterCounter` nor `LobsterVotes` tokens yet,
because the counter starts at zero, and there have been no votes.

To vote, you have to create a transaction that spends the UTxO at the script address holding the NFT
and creates a new UTxO at the same address, which holds the same NFT,
one more `LobsterVotes` tokens than before and
a number between 1 and 100 more `LobsterCounter` tokens than before.

This means that this transaction will have to mint `LobsterVotes` and `LobsterCounter` tokens,
but that's fine: The minting policy of those tokens allows arbitrary minting.

The Plutus script defining the script address will make sure that all constraints are satisfied:

 - The NFT has to be present in both the spent UTxO and the newly created one.
 - The amount of `LobsterVotes` tokens must be smaller than 500 in the beginning, and it must increase by one.
 - The amount of `LobsterCounter` tokens must go up by a number between 1 and 100.

You can use this [Bash script](scripts/lobster-contribute.sh) to create, sign and submit a suitable transaction.
This assumes that you have a node running, the command line interface `cardano-cli` available and that your node socket is called `node.socket`.
The script expects seven arguments:

 - A UTxO with some funds to provide collateral and pay for transaction fees.
 - The current script UTxO.
 - The filename of a file containing your address - this is where the change will go.
 - The filename of the file containing your signing key.
 - The current amount of `LobsterCounter` tokens.
 - The new amount of `LobsterCounter` tokens (which must be 1-100 higher than the current amount).
 - The current amount of `LobsterVotes` tokens (which should be less than 500).

I also recorded an [Explainer Video](https://youtu.be/6xEAnMaov3E).

## Finalization

Once 500 votes have been cast, we will submit a final transaction to get the ultimate result and record it as the final amount of `LobsterCounter` tokens.
As stated above, we will add our own secret random number to the total and take the remainder after division by the number of names in our list.
We can't "cheat" at this step, because the Plutus contract has been paramterized by our number, and the contract will enforce that we calculate the final value correctly.

## Code

You can look at the Plutus code [here](src/Cardano/PlutusLobster/LobsterScript.hs),
where you will find the minting policies for the used native tokens and the validator enforcing the contract logic.

You can build the code with `cabal build`.

## Result

The 500 votes are in! The final counter after 500 votes was 22933. Adding our own "random" number, which was<PHONE_NUMBER>57012117487873, gives<PHONE_NUMBER>57012117510806.
Taking the remainder after division by 1219, the number of potential names, gives __522__.
Looking into the [list of names](names.md), we see that this index points to the name __Logan__.

Charles' lobster finally has his name!


text:
# Screen Capture Tutorial

Many users have requested the ability to record FlipFlip sessions as a video file, to be saved or shared. This
tutorial will get you started with recording your Scenes.

Since many excellent free 3rd party tools exist for this purpose, we decided not to try and re-invent them within
FlipFlip. We recommend using [**Loom**](https://www.loom.com/) and
[**Virtual Audio Cable**](https://www.vb-audio.com/Cable/) to capture your sessions, but feel free to use whatever
utilities suit your needs. Both **Loom** and **VirtualAudioCable** are totally free. **Loom** is a nice cross-platform
screen recording option, and **Virtual Audio Cable** allows us to record FlipFlip (and other) audio.

?> **Virtual Audio Cable** is only compatible with Windows. However, alternative solutions exist for MacOS and Linux.

### Loom

First, we'll setup [**Loom**](https://www.loom.com/). Before you can start using **Loom**, you'll need to
[create an account](https://www.loom.com/signup).  However, your profile will be visible on videos you share, so keep that
in mind when creating it. After you've made an account, you can download and install the
[desktop app](https://www.loom.com/desktop).

The first time you launch **Loom**, you'll need to sign in (with the account you just created):

Then you'll see the main **Loom** screen:

Unless you want to also record your webcam, we recommend "Screen Only" and disabling the camera input. Next, we'll need
to send our audio output to a recording channel. This is where **Virtual Audio Cable** comes in.

### Virtual Audio Cable

Now that **Loom** is setup and ready, let's download and setup [**Virtual Audio Cable**](https://www.vb-audio.com/Cable/).
Click the download button to download the `.zip` package. Then, unzip this package (doesn't matter where). From the
extracted files, right click on `VBCable_Setup_x64` and click "Run as Administrator". (If you are on a 32-bit system,
use `VBCable_Setup`). Then, just click the big "Install Driver" button. Windows may prompt you again, just click
"Install".

That should be it! Click the audio/sound icon in your taskbar then the playback device dropdown. Select the new output
option "CABLE Input (VB-Audio Virtual Cable)":

This will output all of your system audio to a channel **Loom** can record on.

?> **NOTE**: Be aware that changing your default audio output to "CABLE Input" will result in _all_ of your system
audio being output through that channel. Meaning any other sounds on your computer will also be recorded by **Loom**.
To prevent this, disable other programs while you're recording, or ensure they are outputting to a different audio
channel.

### Recording a Scene

Now that we have all the parts setup, let's go back to **Loom** for a minute. Click the Mic dropdown and select the new
"CABLE Output (VB-Audio Virtual Cable)" option. Now, **Loom** will be able to record the sound coming from FlipFlip!

We're ready to record now. Before we start, get your FlipFlip Scene ready to play. Open up FlipFlip and navigate to the
Scene you wish to record. Depending on your preference, you may want to start recording before your Scene starts, or
you may want to wait for your Scene to play for a bit before beginning the recording. For this tutorial, we'll start
recording before playing the Scene.

So, in **Loom**, click "Start Recording" (the default hotkey to Start/Stop is `Ctrl+Shift+L`). If you have a
multi-monitor setup, you'll also need to select the monitor to record (whichever FlipFlip is on). You'll see a 3 second
countdown before recording begins. Once it has, in FlipFlip, click the "Play" button to begin your Scene (be sure to
expand to fullscreen if you don't want to record the toolbar).

When your Scene has finished, you can stop recording by clicking the **Loom** icon in the taskbar (or by using the
`Ctrl+Shift+L` hotkey). A webpage should then open and your recording will immediately begin uploading to your Loom
profile (but not publicly visible).

You can share the video directly from there, or download it for further editing/clipping. That's all there is to it!

repository: ififfy/flipflip

gha_language: TypeScript

repo_name: ififfy/flipflip


text:
# Docker Minecraft
[![Build Status](https://jenkins.dray.be/buildStatus/icon?job=docker_minecraft)](https://jenkins.dray.be/job/docker_minecraft)

This is a docker image for Minecraft running on an Alpine linux container

## Usage
The file /minecraft/conf.override overrides any configuration used, including specifying a different minecraft jar.
See conf.defaults for a list of configuration options you can override

### Docker compose
The easiest way to use this is with docker compose. Just place your minecraft folder inside the data folder and run `docker-compose up`

### Manually running the image
You just need to map the directory with the minecraft server jar to /minecraft.
`docker run --rm -v /foo/minecraft:/minecraft -p 25565:25565 justin8/minecraft


text:
# Google Summer of Code 2017, libGPML
This summer I participated in the Google Summer of Code. Within the NRNB organization, I worked on the WikiPathways/PathVisio project. It was a great experience. I am very grateful to my mentor, Martina Kutmon for helping me along the way.

## Overview

This project aimed at creating a library using PathVisio core module to create a library to just read and write GPML files (used by PathVisio to store pathways) which can be used by PathVisio, the WikiPathways app for Cytoscape and many other applications.

In other words a general GPML library which contains the data model, the functionality to read and write GPML files and relevant exporters to other often used file formats so it can be easily integrated in other applications.

## Cleaning the library

This mostly involved getting rid of unused code. The following commits were the most significant in this phase.

* https://github.com/PathVisio/libGPML/commit/6623bf0a90d372f01d19560c08bb1a5eafd73178
* https://github.com/PathVisio/libGPML/commit/76744cfb391a660be8de1345e46beb6a192204d2
* https://github.com/PathVisio/libGPML/commit/3b354c8d45502f85a24878cbcb77bf1125756aa6
* https://github.com/PathVisio/libGPML/commit/9deed5caea1502e80edd7e8121156674382f6d60

## GPML 2017 Schema

The development of the new schema required a lot of discussion with the community involving major design decisions. This was accomplished in parallel among other goals.

* https://github.com/PathVisio/libGPML/commit/c43bbe8116dff60cd2f82c5aabaf5dc17b77651c
* https://github.com/PathVisio/libGPML/commit/bcb19d6471b9628142e49fdd65ad46b43eb2b0fd
* https://github.com/PathVisio/libGPML/commit/af49d662eafdf9221675d7fd6afe4ef8c1263aaf
* https://github.com/PathVisio/libGPML/commit/301c98a759a224881d2df407a2c9576a315f9f93
* https://github.com/PathVisio/libGPML/commit/c6f7047d24a5ce8b2e27761a10987f14660d9b09
* https://github.com/PathVisio/libGPML/commit/fabbf7fccde8fdc6077b23c9bdacd772b898e02a
* https://github.com/PathVisio/libGPML/commit/9a30e0fc6d0aee5c109ea082d3ce651aacd96b67
* https://github.com/PathVisio/libGPML/commit/78ccebde4a3b5fd2d11c5212e18e91a1a7eb69c4
* https://github.com/PathVisio/libGPML/commit/7096efa6ba9d04b3e5750f3523acbb0844ab9954
* https://github.com/PathVisio/libGPML/commit/4b550cd4e5306f25db067313cba096178a7e2769

## PathwayAsNetwork module

This class was created to reinterpret the Pathway in a more network like model, easing the use of graph algorithms to perform better analysis.

* https://github.com/PathVisio/libGPML/commit/8bfc9a436730d842626ebb57c81502b219294d5b
* https://github.com/PathVisio/libGPML/commit/f6ac1c9b6d5deadf1226ee19b0499aa07e42f054
* https://github.com/PathVisio/libGPML/commit/1b7d814376fd042e9cc7f43d27c40b331f531a76
* https://github.com/PathVisio/libGPML/commit/a367246aab661bf10efd7429ceac9561f1b9039a

## Export to other BioPAX, SIF

Using the PathVisio BioPAX plugin, an exporter for BioPAX was introduced, it was modified to create a BiopaxExporterStrict, a strict exporter which allows loosing data in order to avoid errors. An Exporter to SIF format was also added.
Both exporters take the help of PathwayAsNetwork module to export.

* https://github.com/PathVisio/libGPML/commit/78503ade11f63c834b753409f4c8cb0a46fde15c
* https://github.com/PathVisio/libGPML/commit/94ffe0aca6afdc8beed21b728fd3a4fa7fa2627b
* https://github.com/PathVisio/libGPML/commit/a8b241bb481b498c78e4535663bf7cacae2d0a27
* https://github.com/PathVisio/libGPML/commit/55c76f95d4f0b5c0c2ae86e9a10d088c9f1d1e36


text:
Team Contract
===========

As a member of team DrumpfTower, you must agree to the following:

####Communication
- Check Slack often enough to stay in the loop.
####Coding Practices
- Frequently Commit code, descriptive commits.
 - Commit by topic areas, relevant commit messages.
     - I.e. DO NOT DO: “git add . -> git commit -m “fixed everything” -> git push”.
- Github branch hierarchy:
```
Master
└───authoring
    ├───authoring_frontend
    │   │   authoring_frontend_featurename1_netID
    │   │   authoring_frontend_featurename1_netID
    │   │   ...
    │
    └───authoring_backend
    │   │   authoring_backend_featurename1_netID
    │   │   authoring_backend_featurename1_netID
    │   │   ...

└───engine
    ├───engine_frontend
    │   │   engine_frontend_featurename1_netID
    │   │   engine_frontend_featurename1_netID
    │   │   ...
    │
    └───engine_backend
    │   │   engine_backend_featurename1_netID
    │   │   engine_backend_featurename1_netID
    │   │   ...
```
- Github conventions
   - Begin work on new feature- create new branch with new feature ‘git checkout -b engine/authoring_frontend/backend_featurename_netID’.
   - Work on branch.
- Only merge to higher branches if it is functioning.
- Command+Shift+F between master and next level down.
- Constantly work on Integration.
- Feature based branches.
- Always label the files you authored at top.
- camelCase naming for variables.
####Commitment To Work
- Be on time to meetings.
- Complete work in a timely manner so as not to delay team members.
- Be willing to help any other team member.
- Constantly keep teammates up to date on what you’re working on.
- Constantly query teammates on what they’re working on.

repository: fraankwang/VoogaSalad

repo_name: fraankwang/VoogaSalad


text:
# Sonover Address Module
Sonover Address is a [Concord module](https://artkonekt.github.io/concord/#/modules) that allows you to store addresses for an entity.
Being a Concord module it is intended to be used by Laravel Applications.

## Installation
1. `composer require sonover/address`
2. If concord hasn't been installed yet, [install it](https://artkonekt.github.io/concord/#/installation)
3. Edit `config/concord.php` and add the address module:

```php
return [
    'modules' => [
        Sonover\Address\Providers\ModuleServiceProvider::class
    ]
];
```

After this, address should be listed among the concrd modules:

```
php artisan concord:modules -a

+----+-----------------------+--------+---------+------------------+-----------------+
| #  | Name                  | Kind   | Version | Id               | Namespace       |
+----+-----------------------+--------+---------+------------------+-----------------+
| 1. | Sonover Address Module | Module | 0.2.0   | sonover.address | Sonover\Address |
+----+-----------------------+--------+---------+------------------+-----------------+
```

## Usuage
```php
class Contact extends Model {
    use Addressable;
}
```

### Add an Address

```php
$contact->addAddress([
    'address' => 'Example',
    'city' => 'Example City',
    'province' => 'St. George',
    'country' => 'GD',
    'postalcode' => 'GD-142'
], 'shipping');
```

### Get all shipping addresses
```
$contact->shippingAddress
```

The following types are supported out of the box: `billing`, `business`, `contract`, `mailing`, `pickup`, `residential` and `shipping`

If you want to extend this list for your application refer to [Extending Enums](https://artkonekt.github.io/concord/#/enums?id=extending-enums) in Concord's documentation.

You can grab any address by the type `$contact->{type}Address`

### Remove Address
```php
$contact->removeAddress($address)
```

repository: sonover/address

gha_language: PHP

repo_name: sonover/address


text:
karaf-docker
============

First attempt to run [apache-karaf](http://karaf.apache.org) inside [docker](http://docker.io) container.
Is is based on [fabric8-docker](https://github.com/fabric8io/fabric8-docker), but the idea is to provide generic karaf container support.

Build
-----

Simply run build.sh script.

Run
---

Run via provided karaf.sh script.

repository: sleeperor/karaf-docker

repo_name: sleeperor/karaf-docker


text:
---
layout: page_without_header
title: Conflict-Directed Diverse Planning for Logic-Geometric Programming
permalink: /ConflictPlanningLGP/
---

Joaquim Ortiz de Haro, Erez Karpas, Marc Toussaint and Michael Katz.

International Conference on Automated Planning and Scheduling (ICAPS) 2022

**Back to personal webpage**: here

**Paper:** here

**Brief:**

We propose a systematic interface between state-of-the-art symbolic planners and nonlinear constrained optimization methods to solve Logic-Geometric Programs. The key idea of our approach is to efficiently identify geometric conflicts in the form of minimal infeasible action prefixes, and incorporate this information back into the symbolic planner through a multi-prefix forbidding compilation.

**Abstract:**

Robots operating in the real world must combine task planning for reasoning about what to do with motion planning for reasoning about how to do it -- this is known as task and motion planning. One promising approach for task and motion planning is Logic Geometric Programming (LGP) which integrates a logical layer and a geometric layer in an optimization formulation. The logical layer describes feasible high-level actions at an abstract symbolic level, while the geometric layer uses continuous optimization methods to reason about motion trajectories with geometric constraints.
In this paper we propose a new approach for solving task and motion planning problems in the LGP formulation, that leverages state-of-the-art diverse planning at the logical layer to explore the space of feasible logical plans, and minimizes the number of optimization problems to be solved on the continuous geometric layer.
To this end, geometric infeasibility is fed back into planning by identifying prefix conflicts and incorporating this back into the planner through a novel multi-prefix forbidding compilation. We further leverage diverse planning with a new novelty criteria for selecting candidate plans based on the prefix novelty, and a metareasoning approach which attempts to extract only useful conflicts by leveraging the information that is gathered in the course of solving the given problem.

**Supplementary video:**  here

**Slides:** here

**Poster:** here

**Funding**

This research was supported by the German-Israeli Foundation for Scientific Research (GIF) grant I-1491-407.6/2019, the German Research Foundation (DFG) under Germany’s Excellence Strategy EXC 2002/1–390523135 "Science of Intelligence", and the International Max-Planck Research School for Intelligent Systems (IMPRS-IS).