text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0](https://github.com/unity-game-framework/ugf-data/releases/tag/3.0.0) - 2023-01-04

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/11?closed=1)

### Changed

- Update project ([#28](https://github.com/unity-game-framework/ugf-data/issues/28))
    - Update dependencies: `com.ugf.module.controllers` to `4.0.0` and `com.ugf.module.serialize` to `5.0.0` versions.

## [3.0.0-preview.3](https://github.com/unity-game-framework/ugf-data/releases/tag/3.0.0-preview.3) - 2022-12-13

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/10?closed=1)

### Fixed

- Fix data loader controller ([#26](https://github.com/unity-game-framework/ugf-data/issues/26))
    - Add `DataLoaderProviderControllerAsset` inspector replacement support for collection.
    - Fix `DataLoaderController` class to access to the specified loader.

## [3.0.0-preview.2](https://github.com/unity-game-framework/ugf-data/releases/tag/3.0.0-preview.2) - 2022-12-12

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/9?closed=1)

### Added

- Add data loader file controller extension option ([#23](https://github.com/unity-game-framework/ugf-data/issues/23))
    - Add `DataLoaderFileController.OnGetPath` method to be protected and overridable used to change path building behavior.
    - Change `DataLoaderFileController` class to support extension name append for specified data path.
- Add data loader memory controller ([#22](https://github.com/unity-game-framework/ugf-data/issues/22))
    - Update dependencies: `com.ugf.module.controllers` to `4.0.0-preview.6` version.
    - Update package _Unity_ version to `2022.2`.
    - Add `DataLoaderMemory` class as loader implementation with data storage in memory.
    - Add `DataLoaderSerializeController` class as loader controller with serialization.
    - Add `DataLoaderController<TDescription, TLoader>` abstract class to implement controller with specific type of the loader.
    - Change `DataLoaderController` class to be the default loader controller implementation with direct loader usage.

## [3.0.0-preview.1](https://github.com/unity-game-framework/ugf-data/releases/tag/3.0.0-preview.1) - 2022-08-07

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/8?closed=1)

### Added

- Add DataLoaderPrefs save immediately option ([#20](https://github.com/unity-game-framework/ugf-data/issues/20))
    - Update dependencies: `com.ugf.module.controllers` to `4.0.0-preview.3` and `com.ugf.runtimetools` to `2.14.0` versions.
    - Add `DataLoaderPrefs.SaveOnWrite` property used to determine whether to save preferences after each write.

## [3.0.0-preview](https://github.com/unity-game-framework/ugf-data/releases/tag/3.0.0-preview) - 2022-07-14

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/7?closed=1)

### Changed

- Change string ids to global id ([#18](https://github.com/unity-game-framework/ugf-data/issues/18))
    - Update dependencies: `com.ugf.module.controllers` to `4.0.0-preview`, `com.ugf.module.serialize` to `5.0.0-preview` and `com.ugf.runtimetools` to `2.9.2` versions.
    - Update package _Unity_ version to `2022.1`.
    - Change usage of ids as `GlobalId` structure instead of `string`.

## [2.0.0-preview.4](https://github.com/unity-game-framework/ugf-data/releases/tag/2.0.0-preview.4) - 2022-06-30

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/6?closed=1)

### Fixed

- Fix data loader prefs can't write ([#16](https://github.com/unity-game-framework/ugf-data/issues/16))
    - Add `DataLoaderInstanceController.GetOrCreate<T>()` extension method used to get or create and set the specified type of data.
    - Fix `DataLoaderPrefs` class can't write data when no specified key was set.

## [2.0.0-preview.3](https://github.com/unity-game-framework/ugf-data/releases/tag/2.0.0-preview.3) - 2022-06-30

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/5?closed=1)

### Fixed

- Fix DataLoaderController using bytes serializer ([#14](https://github.com/unity-game-framework/ugf-data/issues/14))
    - Fix `DataLoaderController` class to use general serializer, instead of serializer with data as byte array only.

## [2.0.0-preview.2](https://github.com/unity-game-framework/ugf-data/releases/tag/2.0.0-preview.2) - 2022-06-29

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/4?closed=1)

### Fixed

- Fix DataLoaderController accessing dependencies (#12 )
  - Fix `DataLoaderController` class to properly define dependencies to loader and serializer.

## [2.0.0-preview.1](https://github.com/unity-game-framework/ugf-data/releases/tag/2.0.0-preview.1) - 2022-06-28

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/3?closed=1)

### Added

- Add DataLoaderInstanceController ([#8](https://github.com/unity-game-framework/ugf-data/issues/8))
    - Add `DataLoaderInstanceController` class as controller which works with loading of single instance of the data.
- Add data loader prefs ([#6](https://github.com/unity-game-framework/ugf-data/issues/6))
    - Add `DataLoaderPrefs` class as implementation of `IDataLoader` interface which works with _Unity_ `PlayerPrefs`.

### Changed

- Add check for exist data ([#7](https://github.com/unity-game-framework/ugf-data/issues/7))
    - Update dependencies: `com.ugf.module.controllers` to `2.1.1`, `com.ugf.module.serialize` to `4.0.0` and `com.ugf.runtimetools` to `2.8.0`.
    - Change `IDataLoader` interface and implementations to work using _Try_ pattern methods.
    - Change `IDataLoaderController` interface and implementations to work using _Try_ pattern methods.

## [2.0.0-preview](https://github.com/unity-game-framework/ugf-data/releases/tag/2.0.0-preview) - 2021-11-26

### Release Notes

- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/2?closed=1)

### Changed

- Add data loading controllers ([#5](https://github.com/unity-game-framework/ugf-data/pull/5))
    - Update package Unity version to `2021.2`.
    - Update dependencies: add `com.ugf.module.controllers` of `2.0.0` and `com.ugf.module.serialize` of `4.0.0-preview.1` version.
    - Update package publish registry.
    - Add `DataLoader` and related classes to implement abstract loaders for specific data storage or type.
    - Add `DataLoaderController` and related classes to implement abstract loader controllers that converts raw data to specific objects.
    - Remove all old data structure classes.

## [1.0.0-preview](https://github.com/unity-game-framework/ugf-data/releases/tag/1.0.0-preview) - 2019-06-30

- [Commits](https://github.com/unity-game-framework/ugf-data/compare/ddfe50a...1.0.0-preview)
- [Milestone](https://github.com/unity-game-framework/ugf-data/milestone/1?closed=1)

### Added
- This is a initial release.

repository: unity-game-framework/ugf-data

gha_language: C#

repo_name: unity-game-framework/ugf-data


text:
# Work Day Scheduler

## Description
This is a calendar application that allows a user to save planned events for each hour of the work day. This application has been developed using HTML, CSS, JavaScript, jQuery and MomentJS JavaScript library. This app will run in the browser and features dynamically updated HTML and CSS powered by jQuery.

User can use this daily work day planner to create a daily schedule. The user is presented with hourly time blocks for standard business hours. Each time block is color-coded to indicate whether it is in the past (grey), present (red), or future (green). User can click into each time block, enter an event and click save button to store the event text in local storage. The stored events persist upon page refresh.

This source code is available to everyone under the standard MIT license.

Technologies Used: HTML5, CSS3, JavaScript, jQuery, MomentJS.

## Installation

To install this code, download the zip file and extract the files to a designated directory on your web server or computer without changing the directory/folder structure, or use GitHub's guidelines to clone the repository.

## Screenshot of the application:
![](images/scheduler.png)

## Link to deployed website:
https://nagck.github.io/dayplanner

## Usage

The application can be accessed via any standard browser on any device supported by the browser.

## Credits

- The website has been primarily developed using HTML5, CSS3, JavaScript, jQuery, MomentJS.

- Sincere thanks to my course instructors Ed (Edward Apostol), Adam (Adam El-Masri), Anas (Anas Qazi) and Herman (German Arcila) for teaching and helping me in acquring HTML/CSS/JavaScript/jQuery skills. And of course thanks to my fellow students for sharing valuable tips and tricks on Slack study groups.

- Here are some websites that I referred to develop the application code:
    * https://www.w3schools.com/js/default.asp
    * https://developer.mozilla.org/en-US/docs/Web/JavaScript
    * https://getbootstrap.com/
    * https://www.w3schools.com/css/default.asp
    * https://css-tricks.com/
    * https://momentjs.com/
    * https://jquery.com/

## License
Licensed under the [MIT](https://choosealicense.com/licenses/mit/) license.

## Feedback
Feedback is always appreciated. If you are interested in fixing any issues and contributing directly to the code base, please provide at  https://github.com/nagck/dayplanner/pulls

---

license: MIT

repository: nagck/dayplanner

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: nagck/dayplanner


text:
Using a Java web framework of your choice (e.g. Spring boot, Grails, Struts, Google Web Toolkit etc):

Write an application that manages post it notes:

A user should be able to:
    - Create a note
    - Update a note
    - Delete a note
    - View a list of notes

Want to see:
    - A simple UI with a clean design. (Good CSS, and HTML)
    - Good test coverage (unit and integration – you can use any framework you wish).
    - Use of Spring
    - Use of JPA/Hibernate/JDBC (Or an alternative persistence layer if you want)
    - Logging
    - Javadoc
    - Good understanding of OO and MVC principles
    - Integrated build technology e.g. Maven

repository: psriramula/MyNotes

branch_name: refs/heads/master

repo_name: psriramula/MyNotes


text:
---
layout: post
title: Tweetz Desktop 1.0
---

Tweetz has been "finished" for quite some time now so I decided to call
it 1.0. Not sure why I didn't do this sooner. I use the darn thing every
day and have so day one. It's not the best or most full-featured twitter
client but it's quite possibly the least annoying.

While I don't do much on this project other than maintenance, I do on
occasion add small enhancements when they seem appropriate and I'm in
the mood.

So what's changed in this release?

-   Remove height restriction on images. This does mean that some tweets
    will take up more vertical space.

-   Add a donation link to the settings panel

I know, pretty lame for a 1.0 release but I've found over the years that
users hate surprises.

I noticed that twitter has updated their API to allow 140-second videos.
At some point soon I'll add this capability.

Twitter has also announced a relaxing of the 140 character limit. It's
not clear to me what the rules are yet or whether there will be API
support.

Availble at:
<https://github.com/mike-ward/tweetz-desktop/releases/latest>

gha_language: HTML


text:
# Bootswatch Sprockets

The gem provides the [Bootswatch][] themes to the sprockets assets packaging.
It is meant to be used in conjunction with [Bootstrap for Sass][]. This gem
does not depend on the rails framework. It can be used with any other framework
that uses sprockets, e.g. [Middleman][].

  [Middleman]: https://github.com/middleman/middleman
  [Bootswatch]: https://github.com/thomaspark/bootswatch
  [Bootstrap for Sass]: https://github.com/twbs/bootstrap-sass

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'bootswatch-sprockets', "~> 0.1"
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install bootswatch_sprockets

## Usage

This is an example how to use the [Slate](http://bootswatch.com/slate/)
template:

```sass
@import bootswatch/slate/variables

@import bootstrap-sprockets
@import bootstrap

@import bootswatch/slate/bootswatch
```

## Internals

This gem does nothing more than packaging all the [Bootswatch][] scss
files into `/assets/stylsheets/...`.

## Building

[Bootswatch][] is included as a git submodule!

repository: DrTom/bootswatch-sprockets

repo_name: DrTom/bootswatch-sprockets


text:
---
title: "Data Transmission with Delphi (Part 1: Pointers and Structures)"
excerpt_separator: "<!--more-->"
categories:
  - Data Transmission
tags:
  - Delphi
  - Communication
  - Cross-Language
  - DLL
  - Records
  - Structs
sidebar:
  nav: data_transmission
---

In this blog post I will start to describe the data structures and the use of pointers in communicating cross-platform via DLLs.

<!--more-->
The purpose of this blog series is to understand how to transfer raw data at high speed with direct access using pointers to structures that can be supported by most programming platforms.

When we transmit data between an application and a DLL, we operate in the same memory space. This means that we can read memory directly via pointers. This allows high speed transmission of data by directly reading memory as common structures shared between the application and DLLs.

## Pointer Primer ##

Many tutorials on pointers exist already and this is not a replacement for those, just a basic primer and refresher on high level concepts.

Think of memory as a grid of boxes where each box has a sequential identifier (or address). If we have a memory position in this grid as well as knowledge about the number of boxes to read beyond that position, and their interpretation, then two systems with this common understanding can create an efficient system of directly sharing information.

In the model described above a pointer is simply the address of a box as described above. I like to think of pointers as "native unsigned integers". Thinking about pointers this way helps keep our sanity when passing pointers by value or by reference. The value held by the pointer behaves in the same way as a numeric value passed by value or by reference.

Let us look at a sample of a pointer type defined in System.SysUtils.pas

{% highlight pascal %}
PThreadInfo = ^TThreadInfo;
TThreadInfo = record
  Next: PThreadInfo;
  ThreadID: TThreadID;
  Active: Integer;
  RecursionCount: Cardinal;
end;
{% endhighlight %}

`PThreadInfo` is a pointer type to `TThreadInfo`. The type `PThreadInfo` has exacly the same size as `Pointer`, which is the same size as `NativeUInt` (32-bit or 64-bit based on the platform). So, if the `PThreadInfo` essentially just holds a numeric value just like any other pointer, then why declare it in this way? Well, as I mentioned earlier, if we know how much memory we need to read and how to interpret its values then we know what the data represents. When we de-reference a typed pointer variable like `LMyThreadPtr: PThreadInfo`, by calling in this form: `LMyThreadPtr^`, then we interpret the memory at the position value held by `LMyThreadPtr` as memory with a stucture defined by `TThreadInfo`.

Besides an understanding of the data at the memory location of the pointer, the strongly typed pointer also has benefits in an area called "pointer math". In short, this means that if we increment our pointer it will not always increment by 1, but by the size of the associated type. Pointer math also allows for indexing memory positions based on a pointer type. I will explain in more detail in a future post.

Now we have both parts to make our communication between application and DLL possible: a memory address and an interpretation of that memory. Let us look at an example of what our communication might look like

## Abstract Structured Types in Window Messaging ##

Windows messaging deals with lots of varying information and types in a generic way. Let us look at one scenario of windows messaging how this works with abstract treatment of pointers.

The windows message [WM_DEVICECHANGE](https://docs.microsoft.com/en-us/windows/desktop/DevIO/wm-devicechange) can inform us of device changes on our system. Once we receive this method and the `wmparam` has a value of [DBT_DEVICEARRIVAL](https://docs.microsoft.com/en-us/windows/desktop/DevIO/dbt-devicearrival) we know that a device arrived. Then we can read the `lparam` for information for device. In the windows message strucutre `lparam` is simply a `NativeInt` (i.e. a numeric value), and for this windows message we can treat it as a pointer to [DEV_BROADCAST_HDR](https://docs.microsoft.com/en-us/windows/desktop/api/Dbt/ns-dbt-_dev_broadcast_hdr)

The structure and its strongly typed pointer looks like this in Delphi:

{% highlight pascal %}
PDEV_BROADCAST_HDR = ^DEV_BROADCAST_HDR;
DEV_BROADCAST_HDR = record
  dbch_size: DWORD;
  dbch_devicetype: DWORD;
  dbch_reserved: DWORD;
end;
{% endhighlight %}

The information we can glean form this is limited to essentially just the device type, so how can we get more detail? If you read the documentation for [DEV_BROADCAST_HDR](https://docs.microsoft.com/en-us/windows/desktop/api/Dbt/ns-dbt-_dev_broadcast_hdr). You will see that for each of the values of the device type it tells you that the structure is not really `DEV_BROADCAST_HDR`, but some other structure like [DEV_BROADCAST_DEVICEINTERFACE](https://docs.microsoft.com/en-us/windows/desktop/api/dbt/ns-dbt-_dev_broadcast_deviceinterface_a) or [DEV_BROADCAST_VOLUME](https://docs.microsoft.com/en-us/windows/desktop/api/dbt/ns-dbt-_dev_broadcast_volume). You may be confused at this point, but let us look at those two types as translated to Delphi code:

{% highlight pascal %}
PDEV_BROADCAST_DEVICEINTERFACE = ^DEV_BROADCAST_DEVICEINTERFACE;
DEV_BROADCAST_DEVICEINTERFACE = record
  dbcc_size: DWORD;
  dbcc_devicetype: DWORD; // = DBT_DEVTYP_DEVICEINTERFACE
  dbcc_reserved: DWORD;
  dbcc_classguid: TGUID;
  dbcc_name: Char;
end;

PDEV_BROADCAST_VOLUME = ^DEV_BROADCAST_VOLUME;
DEV_BROADCAST_VOLUME = record
  dbcv_size: DWORD;
  dbcv_devicetype: DWORD; // = DBT_DEVTYP_VOLUME
  dbcv_reserved: DWORD;
  dbcv_unitmask: DWORD;
  dbcv_flags: Word;
end;
{% endhighlight %}

Look at the two records above and compare them to `DEV_BROADCAST_HDR`. You will notice that the first part of their data is the same. `DEV_BROADCAST_HDR` is an abstract structure. Once we cast our pointer from the header type `PDEV_BROADCAST_HDR` to the specific type (say `PDEV_BROADCAST_DEVICEINTERFACE`) we can now read more information. All of this works of course if both parties have a clear and unambiguous understanding of the size of data that needs to be read.

Without going into detail. Here is an example of how we would use this

{% highlight pascal %}
procedure TFoo.WMDeviceChange(var AMessage: TMessage);
var
  LUsbDeviceName: string;
  LPDeviceBroadcastHeader: PDEV_BROADCAST_HDR;
  LPBroadcastDeviceIntf: PDEV_BROADCAST_DEVICEINTERFACE;
  LPBroadcastVolume: PDEV_BROADCAST_VOLUME;
begin
  if (AMessage.wParam = DBT_DEVICEARRIVAL) then
  begin
    LPDeviceBroadcastHeader := PDEV_BROADCAST_HDR(AMessage.LParam);

    case LPDeviceBroadcastHeader^.dbch_devicetype of
      DBT_DEVTYP_DEVICEINTERFACE:
        begin
          LPBroadcastDeviceIntf := PDEV_BROADCAST_DEVICEINTERFACE(LPDeviceBroadcastHeader);
          LUsbDeviceName := PChar(@LPBroadcastDeviceIntf^.dbcc_name);
      ...
        end;

      DBT_DEVTYP_VOLUME:
        begin
          LPBroadcastVolume := PDEV_BROADCAST_VOLUME(LPDeviceBroadcastHeader);
          // use LPBroadcastVolume.dbcv_unitmask to find volume information
          ...
        end;
    end;
  end;
end;
{% endhighlight %}

## Shared Structures (Naive Attempt) ##

As long as our application and DLL have a common understanding of the structure they need to pass the call could be a simple one

{% highlight pascal %}
procedure foo(AData: Pointer); stdcall;
{% endhighlight %}

The DLL receiving the information can cast to the correct pointer type and read the memory at that address, but this would not be very extensible and reduce readability of the source code. Look at the windows message handler routine we defined earlier. In that case we use the less abstract `PDEV_BROADCAST_HDR` type and cast to the appropriate `PDEV_BROADCAST_*` pointer type based on `dbch_devicetype`. We can do the same in our shared structure (record) definitions.

Let use start by creating our header or "base" record type. As seen above we need a type so we can cast to correct pointer type. An enumeration would work fine

{% highlight pascal %}
type
  TxRectTypeEnum = (TxRectType_Undefined, TxRectType_Line, TxRectType_Arc);

  PTxRec = ^TxRec;
  TxRec = Record
    RecType: TxRectTypeEnum;
  End;
{% endhighlight %}

Next we can define our Line and Arc records, but we have to keep in mind that the first data needs to match that of TxRec.

{% highlight pascal %}
type

  PTxRecArc = ^TxRecArc;
  TxRecArc = Record
    // common to TxRec
      RecType: TxRectTypeEnum; // = TxRectType_Arc

    // TxRecArc data start
    CenterX: Double;
    CenterY: Double;
    StartAng: Double;
    EndAng: Double;
    Radius: Double;

    CCW: boolean
  End;

  PTxRecLine = ^TxRecLine;
  TxRecLine = Record
    // common to TxRec
      RecType: TxRectTypeEnum; // = TxRectType_Line

    // TxRecLine data start
    P1X: Double;
    P1Y: Double;

    P2X: Double;
    P2Y: Double;
  End;

{% endhighlight %}

The type alone will work for single records transmitted by our API. We will need the size if we read a complex stream of data (for instance from a file). It would be prudent to also add the size to our base type. If we ever encounter a stream that has a record that we don't understand we can skip that section of memory.

## Shared Structures (Slightly Improved) ##

{% highlight pascal %}
type
  PTxRec = ^TxRec;
  TxRec = Record
    Size: DWord;
    RecType: TxRectTypeEnum;
  End;

  PTxRecArc = ^TxRecArc;
  TxRecArc = Record
    // common to TxRec
    Size: DWord;
    RecType: TxRectTypeEnum; // = TxRectType_Arc

    // TxRecArc data start
    CenterX: Double;
    CenterY: Double;
    StartAng: Double;
    EndAng: Double;
    Radius: Double;

    CCW: boolean
  End;

  PTxRecLine = ^TxRecLine;
  TxRecLine = Record
    // common to TxRec
    Size: DWord;
    RecType: TxRectTypeEnum; // = TxRectType_Line

    // TxRecLine data start
    P1X: Double;
    P1Y: Double;

    P2X: Double;
    P2Y: Double;
  End;

{% endhighlight %}

Records don't always occupy the memory size equivalent to the size of their component values, so adding the size allow receivers to read the correct amount of data when reading streams. There is another issue to consider: data members and records themselves have the data aligned to certain size boundaries. Since all systems reading the memory need a clear understanding of the data, we need to understand how this data can be represented in an unambiguous way. The `Size` value can be read by both parties as a first line of defense to know that records are represented in a similar way, but for complete safety we need to ensure that our data alignment matches.

## Record Alignment and Padding ##

Records are usually [padded and aligned](https://en.wikipedia.org/wiki/Data_structure_alignment), this means they have their data members and the record as a whole are padded to certain size multiples. This speeds up memory access and indexing of data. We could declare our records as `Packed` to prevent alignment or we could use explicit compiler defines (`$A` or `$ALIGN`) to set the alignment. As long as all parties involved in the transfer of the data have the same understanding of the data structure the data can be read correctly.

Records are by aligned by the smaller of:
* The record alignment setting. By default, 8-byte (Quad Word)
* The size of the largest element

Record fields are aligned by the smaller of:
* The alignment of fields of its own size
* The alignment of the record (see above)

By placing larger members before smaller ones, we could create a more compact structure because we would eliminate data member alignment requirements. This is true because data types are usually multiples of smaller types (1,2,4,8 bytes). 8 Byte alignment is the same standard used by the Windows SDK and the reason why we could do a verbatim translation of the C++ struct to a Delphi record.

If we now look at our header record the `RecType: TxRectTypeEnum` gains no space benefit defined as a type with a size of 1 byte. By default, enumerated types are byte, but since our `Size` is `DWord` the record will be aligned by at least 4 bytes. This means that the size of the record will be 8 instead of 5. In our Line and Arc records it means that a pad of 3 bytes will be added before `CenterX` and before `P1X` in `TxRecArc` and `TxRecLine` respectively. Similarly, since our record will be aligned to a boundary of 8 bytes (since it contains `Double`), a pad of 7 bytes is added to the end.

In memory our Record really looks like this (I added comments where padding is done)

{% highlight pascal %}
TxRecArc = Record
  Size: DWord;       // 4 bytes. Offset 0
  RecType: TxRectTypeEnum; // = TxRectType_Arc //1 byte //Offset 4

  //Pad1 : Array[0..2] of Byte;  // implicit pad added to align CenterX to align to a multiple of 8 bytes
  CenterX: Double; // offset 8
  CenterY: Double;
  StartAng: Double;
  EndAng: Double;
  Radius: Double;

  CCW: boolean; // 1 byte. offset 48
  //Pad2 : Array[0..6] of Byte;  // implicit pad added to align record with the next record
End;
{% endhighlight %}

Since enumerated types are typically 32-bit in other programming languages we might as well set our `TxRectTypeEnum` to be 4 bytes using (the `$Z` compiler directive). Doing so this `Pad1` will disappear and we will be more compatible with C++. Also, since we have padding after CCW we could use `WordBool` or `LongBool` datatypes without growing our record footprint

{% highlight pascal %}
{$Z4}
  TxRectTypeEnum = (TxRectType_Undefined, TxRectType_Line, TxRectType_Arc);
{$Z1}
{% endhighlight %}

If we use "standard" alignment rules (8 Byte) we remain compatible with Windows SDK standards. Most applications can easily be configured to use our records and we won't have surprises about alignment of fields or records.

I highly recommend staying within the 8-Byte (Quad Word) record alignment scheme. It is well known and widely used. If parties use this alignment the fields will be aligned as expected.

## Section Conclusion ##
Pointers are numeric values. Strongly typed pointers allow us to understand the structure and values at the address held by a pointer. Casting a pointer allows for a different or extended interpretation of the data at a memory address. As long as two parties have common interpretation of the structure of memory data can be easily read or written by either.

In the next section I will expand on pointer math and the transmission of arrays of data.

gha_language: SCSS

gha_license_id: MIT


text:
GeoRuby
=======

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nofxx/georuby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This is intended as a holder for geometric data.
The data model roughly follows the OGC "Simple Features for SQL" specification,
so it should play nice with data returned from PostGIS or any Spatial Extensions (MongoDB, MySQL...).
It also supports various output and input formats (GeoRSS, KML, Shapefile).
GeoRuby is written in pure Ruby.

OGC:"http://www.opengis.org/docs/99-049.pdf"

If you are looking for Proj/Geos (geometric operators or reprojections) rubygem checkout: (C extension)
rgeo:"https://github.com/dazuma/rgeo"

[![Gem Version](https://badge.fury.io/rb/georuby.png)](http://badge.fury.io/rb/georuby)
[![Code Climate](https://codeclimate.com/github/nofxx/georuby.png)](https://codeclimate.com/github/nofxx/georuby)
[![Build Status](https://travis-ci.org/nofxx/georuby.png?branch=master)](https://travis-ci.org/nofxx/georuby)
[![Coverage Status](https://coveralls.io/repos/nofxx/georuby/badge.png)](https://coveralls.io/r/nofxx/georuby)
[![Dependency Status](https://gemnasium.com/nofxx/georuby.svg)](https://gemnasium.com/nofxx/georuby)

Available data types
--------------------

The following geometric data types are provided :
- Point
- Line String
- Linear Ring
- Polygon
- Multi Point
- Multi Line String
- Multi Polygon
- Geometry Collection

They can be in 2D, 3DZ, 3DM, and 4D.

On top of this an Envelope class is available, to contain the bounding box of a geometry.

Installation
------------

To install the latest version, just type:

    gem install georuby

Or include on your projects`s Gemfile:

    gem 'georuby'

Optional, require if you need the functionality:

    require 'georuby'
    require 'geo_ruby/ewk'        # EWKT/EWKB
    require 'geo_ruby/shp'        # Shapefile
    require 'geo_ruby/gpx'        # GPX data
    require 'geo_ruby/kml'        # KML data
    require 'geo_ruby/georss'     # GeoRSS
    require 'geo_ruby/geojson'    # GeoJSON

TODO: https://github.com/AnalyticalGraphicsInc/czml-writer

Use
===

Simple Examples
----------------

Creating a 3D Point:

    Point.from_x_y_z(10.0, 20.0, 5.0)

Creating a LineString:

    LineString.from_coordinates([[1,1],[2,2]],4326))

Creating a Polygon:

    Polygon.from_coordinates([[1,1],[2,2]],4326))
    LineString.from_linear_rings(rings)

Input and output
----------------

These geometries can be input and output in WKB/EWKB/WKT/EWKT format as well as
the related HexWKB and HexEWKB formats. HexEWKB and WKB are the default form under
which geometric data is returned respectively from PostGIS and MySql.

GeoRSS Simple, GeoRSS W3CGeo, GeoRSS GML can also be input and output.
Note that they will not output valid RSS, but just the part strictly concerning
the geometry as outlined in http://www.georss.org/1/ . Since the model does
not allow multiple geometries, for geometry collections, only the first geometry
will be output. Similarly, for polygons, the GeoRSS output will only contain the outer ring.
As for W3CGeo output, only points can be output, so the first point of the geometry is chosen.
By default the Simple format is output. Envelope can also be output in these formats:
The box geometric type is chosen (except for W3CGeo, where the center of the envelope is chose).
These formats can also be input and a GeoRuby geometry will be created.
Note that it will not read a valid RSS file, only a geometry string.

On top of that, there is now support for KML output and input.
As for GeoRSS, a valid KML file will not be output, but only the geometric data.
Options <tt>:id</tt>, <tt>:extrude</tt>, <tt>:tesselate</tt> and <tt>:altitude_mode</tt> can be given.
Note that if the <tt>:altitude_mode</tt> option is not passed or set to <tt>clampToGround</tt>,
the altitude data will not be output even if present. Envelopes output a LatLonAltBox instead of a geometry.
For the output, the following geometric types are supported : Point, LineString, Polygon.

SHP reading and writing
---

Georuby has support for reading ESRI shapefiles (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf).
A tool called <tt>shp2sql.rb</tt> is also provided: it shows how to use the SHP reading functionality together
with the spatial adapter plugin for Rails to import spatial features into MySQL and PostGIS.

Here is an example of Shapefile reading, that goes through all the geometries
in a file and disaply the values of the attributes :

      require 'geo_ruby/shp'

      ShpFile.open(shpfile) do |shp|
        shp.each do |shape|
          geom = shape.geometry #a GeoRuby SimpleFeature
          att_data = shape.data #a Hash
          shp.fields.each do |field|
            puts att_data[field.name]
          end
        end
      end

Support for ESRI shapefile creation and modification has been added as well.
New shapefiles can be created given a geometry type and specifications for the DBF fields.
Data can be added and removed from an existing shapefile.
An update operation is also provided for convenience: it just performs a 'delete' and an 'add',
which means the index of the modified record will change. Note that once a shapefile has been created,
GeoRuby does not allow the modification of the schema (it will probably be done in a subsequent version).

Here is an example of how to create a new Shapefile with 2 fields :

      shpfile = ShpFile.create('hello.shp', ShpType::POINT, [DBF::Field.new("Hoyoyo", "C", 10), DBF::Field.new("Boyoul","N",10,0)])

The file is then open for reading and writing.

Here is an example of how to write to a shapefile (created or not with GeoRuby) :

      shpfile = ShpFile.open('places.shp')
      shpfile.transaction do |tr|
        tr.add(ShpRecord.new(Point.from_x_y(123.4, 123.4), 'Hoyoyo' => "AEZ",'Bouyoul' => 45))
        tr.update(4, ShpRecord.new(Point.from_x_y(-16.67, 16.41), 'Hoyoyo' => "EatMe",'Bouyoul' => 42))
        tr.delete(1)
      end
      shpfile.close

Note the transaction is just there so the operations on the files can be buffered.
Nothing happens on the original files until the block has finished executing.
Calling <tt>tr.rollback</tt> at anytime during the execution will prevent the modifications.

Also currently, error reporting is minimal and it has not been tested that
thoroughly so caveat emptor and backup before performing any destructive operation.

Shapefile names and extensions (dbf, shp, gpx) must be lowercased!

GPX Reading
-----------

You can read and convert GPX Files to LineString/Polygon:

     gpxfile = GpxFile.open('tour.gpx')
     gpxfile.as_line_string
     => GeoRuby::SimpleFeatures::LineString..

GeoJSON Support
---------------

Basic GeoJSON support has been implemented per v1.0 of the {spec}[http://geojson.org/geojson-spec.html].

USAGE:

 input - `GeoRuby::SimpleFeatures::Geometry.from_geojson(geojson_string)`
 output - call `#as_geojson` or `#to_json` on any SimpleFeature Geometry instance

TODO:

 * Refactor to support extremely large GeoJSON input streams / files. Currently
   the entire GeoJSON representation must be loaded into memory as a String
 * Improve srid/crs support on input and add support on output
 * Implement bounding-box spport per spec on input/output?
 * Improved / more tests

GeoJSON support implemented by {Marcus Mateus}[http://github.com/marcusmateus] and released courtesy {SimpliTex}[http://simplitex.com].

### Extra Features

- Writing of ESRI shapefiles
- Reading of ESRI shapefiles
- Tool to import spatial features in MySQL and PostGIS from a SHP file

### Acknowledgement

The SHP reading part uses the DBF library (http://rubyforge.org/projects/dbf/) by Keith Morrison (http://infused.org).
Thanks also to Pramukta Kumar and Pete Schwamb for their contributions.

## Support (Original GeoRuby gem)

Any questions, enhancement proposals, bug notifications or corrections
can be sent to<EMAIL_ADDRESS>

### Coming in the next versions

- Schema modification of existing shapefiles
- More error reporting when writing shapefiles
- More tests on writing shapefiles ; tests on real-world shapefiles
- Better shp2sql import tool
- Documentation

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/nofxx/georuby/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

repository: leoroos/georuby

repo_name: leoroos/georuby


text:
# Dota2

[![Go Reference](https://pkg.go.dev/badge/github.com/paralin/go-dota2.svg)](https://pkg.go.dev/github.com/paralin/go-dota2)
[![Go Report Card Widget]][Go Report Card]
[![DOI](https://zenodo.org/badge/103461337.svg)](https://zenodo.org/badge/latestdoi/103461337)

[Go Report Card Widget]: https://goreportcard.com/badge/github.com/paralin/go-dota2
[Go Report Card]: https://goreportcard.com/report/github.com/paralin/go-dota2

## Introduction

**go-dota2** is a DOTA 2 client plugin for go-steam.

Games implemented:

 - [dota2](https://github.com/paralin/go-dota2)
 - [underlords](https://github.com/paralin/go-underlords)

Also see: the old [C#/SteamKit Implementation](https://github.com/paralin/Dota2).

This project makes use of a dynamic API generator (apigen) designed to
automatically interpret Valve's various naming conventions into a intermediate
API scheme representation, which is then converted into Go code.

## Implementation Progress

Complete.

 - [x] GC session state management
 - [x] Player profile fetching / call tracking
 - [x] SOCache tracking / state management
 - [x] Basic chat interaction
 - [x] Lobby tracking / state management
    - [x] Read lobby state correctly
    - [x] Implement normal lobby operations
 - [x] Party tracking / state management
    - [x] Read party and invite state correctly
    - [x] Implement normal party operations
 - [x] Code generation for API
 - [x] Code generation for events

## SOCache Mechanism

The caching mechanism makes it easy to watch for changes to common objects, like `Lobby, LobbyInvite, Party, PartyInvite`.

This mechanism is used everywhere, these objects are not exposed in their own events.

```go
import (
	gcmm "github.com/paralin/go-dota2/protocol"
	"github.com/paralin/go-dota2/cso"
)

eventCh, eventCancel, err := dota.GetCache().SubscribeType(cso.Lobby)
if err != nil {
    return err
}

defer eventCancel()

lobbyEvent := <-eventCh
lobby := lobbyEvent.Object.(*gcmm.CSODOTALobby)
```

Events for the object type are emitted on the eventCh. Be sure to call `eventCancel` once you are done with the channel to prevent resource leaks.

The cache object also adds interfaces to get and list the current objects in the cache.

## Implementation Generation

The base API implementation is generated by the [apigen](./apigen) code. Using heuristics, request IDs are matched to response IDs, and events and action-only requests are identified. Some manual tweaking is done in the overrides file.

This means that ALL of the Dota API will be available in this codebase, although only some of it is documented.

## go-steam Dependency

This library depends on [go-steam](https://github.com/paralin/go-steam).

gha_language: Go


text:
## 2.3.0
* Overwrite existing tables in the metastore
* Add functions module and provide switch_case column generation and multijoin
* Add implicit test target import and extended assertEqual variation
* Support writing to redis:// and rediss:// URLs
* Add LRU cache that persists DataFrames under the hood
* Add ability to check whether a complex type defines specific fields

# 2.2.1
* `spark.sql.shuffle.partitions` in `SparklyTest` should be set to string,
because `int` value breaks integration testing in Spark 2.0.2.

# 2.2.0
* Add instant iterative development mode. `sparkly-testing --help` for more details.
* Use in-memory db for Hive Metastore in `SparklyTest` (faster tests).
* `spark.sql.shuffle.partitions = 4` for `SparklyTest` (faster tests).
* `spark.sql.warehouse.dir = <random tmp dir>` for `SparklyTest` (no side effects)

## 2.1.1
* Fix: remove backtick quoting from catalog utils to ease work with different databases.

## 2.1.0
* Add ability to specify custom maven repositories.

## 2.0.4
* Make it possible to override default value of spark.sql.catalogImplementation

## 2.0.3
* Add KafkaWatcher to facilitate testing of writing to Kafka
* Fix a few minor pyflakes warnings and typos

## 2.0.2
* Fix: #40 write_ext.kafka ignores errors.

## 2.0.1
* Migrate to Spark 2, Spark 1.6.x isn't supported by sparkly 2.x.
* Rename `SparklyContext` to `SparklySession` and derive it from `SparkSession`.
* Use built-in csv reader.
* Replace `hms` with `catalog_ext`.
* `parse_schema` is now consistent with `DataType.simpleString` method.

## 1.1.1
* Fix: kafka import error.

## 1.1.0
* Kafka reader and writer.
* Kafka fixtures.

## 1.0.0
* Initial open-source release.
* Features:
 - Declarative definition of application dependencies (spark packages, jars, UDFs)
 - Readers and writers for ElasticSearch, Cassandra, MySQL
 - DSL for interaction with Apache Hive Metastore

repository: cglewis/sparkly

gha_language: Python

repo_name: cglewis/sparkly


text:
# Django Rest Password Reset

This python package provides a simple password reset strategy for django rest framework, where users can request password
reset tokens via their registered e-mail address.

Credits - https://github.com/anexia-it/django-rest-passwordreset

The main idea behind this package is to not make any assumptions about how the token is delivered to the end-user (e-mail, text-message, etc...) and to major issues in the origin package.
Also, this package provides a signal that can be reacted on (e.g., by sending an e-mail or a text message).

This package basically provides two REST endpoints:

- Request a token
- Verify (confirm) a token (and change the password)

## Quickstart

1. Install the package from pypi using pip:

```bash
pip install django-rest-resetpassword
```

2. Add `django_rest_resetpassword` to your `INSTALLED_APPS` (after `rest_framework`) within your Django settings file:

```python
INSTALLED_APPS = (
    ...
    'django.contrib.auth',
    ...
    'rest_framework',
    ...
    'django_rest_resetpassword',
    ...
)
```

3. This package stores tokens in a separate database table (see [django_rest_resetpassword/models.py](django_rest_resetpassword/models.py)). Therefore, you have to run django migrations:

```bash
python manage.py migrate
```

4. This package provides two endpoints, which can be included by including `django_rest_resetpassword.urls` in your `urls.py` as follows:

```python
from django.conf.urls import url, include

urlpatterns = [
    ...
    url(r'^accounts/password-reset/',
        include('django_rest_resetpassword.urls', namespace='password_reset')),
    ...
]
```

**Note**: You can adapt the url to your needs.

### Endpoints

The following endpoints are provided:

- `POST ${API_URL}/password-reset/` - request a reset password token by using the `email` parameter
- `POST ${API_URL}//password-reset/validate_token/` - will return a 200 if a given `token` is valid
- `POST ${API_URL}password-reset/confirm/` - using a valid `token`, the users password is set to the provided `password`

where `${API_URL}/` is the url specified in your _urls.py_ (e.g., `api/password_reset/`)

### Signals

- `reset_password_token_created(sender, instance, reset_password_token)` Fired when a reset password token is generated
- `pre_password_reset(user)` - fired just before a password is being reset
- `post_password_reset(user)` - fired after a password has been reset

### Example for sending an e-mail

1. Create two new django templates: `email/user_reset_password.html` and `email/user_reset_password.txt`. Those templates will contain the e-mail message sent to the user, aswell as the password reset link (or token).
   Within the templates, you can access the following context variables: `current_user`, `username`, `email`, `reset_password_url`. Feel free to adapt this to your needs.

2. Add the following code, which contains a Django Signal Receiver (`@receiver(...)`), to your application. Take care where to put this code, as it needs to be executed by the python interpreter (see the section _The `reset_password_token_created` signal is not fired_ below, aswell as [this part of the django documentation](https://docs.djangoproject.com/en/1.11/topics/signals/#connecting-receiver-functions) and [How to Create Django Signals Tutorial](https://simpleisbetterthancomplex.com/tutorial/2016/07/28/how-to-create-django-signals.html) for more information).

```python
from django.core.mail import EmailMultiAlternatives
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.urls import reverse

from django_rest_resetpassword.signals import reset_password_token_created

@receiver(reset_password_token_created)
def password_reset_token_created(sender, instance, reset_password_token, *args, **kwargs):
    """
    Handles password reset tokens
    When a token is created, an e-mail needs to be sent to the user
    :param sender: View Class that sent the signal
    :param instance: View Instance that sent the signal
    :param reset_password_token: Token Model Object
    :param args:
    :param kwargs:
    :return:
    """
    # send an e-mail to the user
    context = {
        'current_user': reset_password_token.user,
        'username': reset_password_token.user.username,
        'email': reset_password_token.user.email,
        'reset_password_url': "{}?token={}".format(reverse('password_reset:reset-password-request'), reset_password_token.key)
    }

    # render email text
    email_html_message = render_to_string('email/user_reset_password.html', context)
    email_plaintext_message = render_to_string('email/user_reset_password.txt', context)

    msg = EmailMultiAlternatives(
        # title:
        "Password Reset for {title}".format(title="Some website title"),
        # message:
        email_plaintext_message,
        # from:
<EMAIL_ADDRESS>        # to:
        [reset_password_token.user.email]
    )
    msg.attach_alternative(email_html_message, "text/html")
    msg.send()

```

3. You should now be able to use the endpoints to request a password reset token via your e-mail address.
   If you want to test this locally, I recommend using some kind of fake mailserver (such as maildump).

# Configuration / Settings

The following settings can be set in Djangos `settings.py` file:

- `DJANGO_REST_MULTITOKENAUTH_RESET_TOKEN_EXPIRY_TIME` - time in hours about how long the token is active (Default: 24)

  **Please note**: expired tokens are automatically cleared based on this setting in every call of `ResetPasswordRequestToken.post`.

- `DJANGO_REST_RESETPASSWORD_NO_INFORMATION_LEAKAGE` - will cause a 200 to be returned on `POST ${API_URL}/reset_password/`
  even if the user doesn't exist in the databse (Default: False)

- `DJANGO_REST_MULTITOKENAUTH_REQUIRE_USABLE_PASSWORD` - allows password reset for a user that does not
  [have a usable password](https://docs.djangoproject.com/en/2.2/ref/contrib/auth/#django.contrib.auth.models.User.has_usable_password) (Default: True)

## Custom Email Lookup

By default, `email` lookup is used to find the user instance. You can change that or add more matching fields by adding

```python
DJANGO_REST_LOOKUP_FIELDS = ['custom_email_field', 'other_lookup_field']
```

into Django settings.py file.

## Custom Remote IP Address and User Agent Header Lookup

If your setup demands that the IP adress of the user is in another header (e.g., 'X-Forwarded-For'), you can configure that (using Django Request Headers):

```python
DJANGO_REST_RESETPASSWORD_IP_ADDRESS_HEADER = 'HTTP_X_FORWARDED_FOR'
```

The same is true for the user agent:

```python
HTTP_USER_AGENT_HEADER = 'HTTP_USER_AGENT'
```

## Custom Token Generator

By default, a random string token of length 10 to 50 is generated using the `RandomStringTokenGenerator` class.
This library offers a possibility to configure the params of `RandomStringTokenGenerator` as well as switch to
another token generator, e.g. `RandomNumberTokenGenerator`. You can also generate your own token generator class.

You can change that by adding

```python
DJANGO_REST_RESETPASSWORD_TOKEN_CONFIG = {
    "CLASS": ...,
    "OPTIONS": {...}
}
```

into Django settings.py file.

### RandomStringTokenGenerator

This is the default configuration.

```python
DJANGO_REST_RESETPASSWORD_TOKEN_CONFIG = {
    "CLASS": "django_rest_resetpassword.tokens.RandomStringTokenGenerator"
}
```

You can configure the length as follows:

```python
DJANGO_REST_RESETPASSWORD_TOKEN_CONFIG = {
    "CLASS": "django_rest_resetpassword.tokens.RandomStringTokenGenerator",
    "OPTIONS": {
        "min_length": 20,
        "max_length": 30
    }
}
```

It uses `os.urandom()` to generate a good random string.

### RandomNumberTokenGenerator

```python
DJANGO_REST_RESETPASSWORD_TOKEN_CONFIG = {
    "CLASS": "django_rest_resetpassword.tokens.RandomNumberTokenGenerator"
}
```

You can configure the minimum and maximum number as follows:

```python
DJANGO_REST_RESETPASSWORD_TOKEN_CONFIG = {
    "CLASS": "django_rest_resetpassword.tokens.RandomNumberTokenGenerator",
    "OPTIONS": {
        "min_number": 1500,
        "max_number": 9999
    }
}
```

It uses `random.SystemRandom().randint()` to generate a good random number.

### Write your own Token Generator

Please see [token_configuration/django_rest_resetpassword/tokens.py](token_configuration/django_rest_resetpassword/tokens.py) for example implementation of number and string token generator.

The basic idea is to create a new class that inherits from BaseTokenGenerator, takes arbitrary arguments (`args` and `kwargs`)
in the `__init__` function as well as implementing a `generate_token` function.

```python
from django_rest_resetpassword.tokens import BaseTokenGenerator

class RandomStringTokenGenerator(BaseTokenGenerator):
    """
    Generates a random string with min and max length using os.urandom and binascii.hexlify
    """

    def __init__(self, min_length=10, max_length=50, *args, **kwargs):
        self.min_length = min_length
        self.max_length = max_length

    def generate_token(self, *args, **kwargs):
        """ generates a pseudo random code using os.urandom and binascii.hexlify """
        # determine the length based on min_length and max_length
        length = random.randint(self.min_length, self.max_length)

        # generate the token using os.urandom and hexlify
        return binascii.hexlify(
            os.urandom(self.max_length)
        ).decode()[0:length]
```

## Documentation / Browsable API

This package supports the [DRF auto-generated documentation](https://www.django-rest-framework.org/topics/documenting-your-api/) (via `coreapi`) as well as the [DRF browsable API](https://www.django-rest-framework.org/topics/browsable-api/).

![drf_browsable_email_validation](docs/browsable_api_email_validation.png 'Browsable API E-Mail Validation')

![drf_browsable_password_validation](docs/browsable_api_password_validation.png 'Browsable API E-Mail Validation')

![coreapi_docs](docs/coreapi_docs.png 'Core API Docs')

## Known Issues / FAQ

### Django 2.1 Migrations - Multiple Primary keys for table ...

Django 2.1 introduced a breaking change for migrations (see [Django Issue #29790](https://code.djangoproject.com/ticket/29790)). We therefore had to rewrite the migration [0002_pk_migration.py](django_rest_resetpassword/migrations/0002_pk_migration.py) such that it covers Django versions before (`<`) 2.1 and later (`>=`) 2.1.

Some information is written down in Issue #8.

### The `reset_password_token_created` signal is not fired

You need to make sure that the code with `@receiver(reset_password_token_created)` is executed by the python interpreter. To ensure this, you have two options:

1. Put the code at a place that is automatically loaded by Django (e.g., models.py, views.py), or

2. Import the file that contains the signal within your app.py `ready` function:

   _some_app/signals.py_

```python
from django.core.mail import EmailMultiAlternatives
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.urls import reverse

from django_rest_resetpassword.signals import reset_password_token_created

@receiver(reset_password_token_created)
def password_reset_token_created(sender, instance, reset_password_token, *args, **kwargs):
    # ...
```

_some_app/app.py_

```python
from django.apps import AppConfig

class SomeAppConfig(AppConfig):
    name = 'your_django_project.some_app'
    verbose_name = 'Some App'

    def ready(self):
        import your_django_project.some_app.signals  # noqa
```

_some_app/**init**.py_

```python
default_app_config = 'your_django_project.some_app.SomeAppConfig'
```

### MongoDB not working

Apparently, the following piece of code in the Django Model prevents MongodB from working:

```python
 id = models.AutoField(
     primary_key=True
 )
```

See issue #49 for details.

## Contributions

This library tries to follow the unix philosophy of "do one thing and do it well" (which is providing a basic password reset endpoint for Django Rest Framework). Contributions are welcome in the form of pull requests and issues! If you create a pull request, please make sure that you are not introducing breaking changes.

## Tests

See folder [tests/](tests/). Basically, all endpoints are covered with multiple
unit tests.

Use this code snippet to run tests:

```bash
pip install -r requirements_test.txt
python setup.py install
cd tests
python manage.py test
```

## Release on PyPi

To release this package on pypi, the following steps are used:

```bash
rm -rf dist/ build/
python setup.py sdist
twine upload dist/*
```


text:
Let's start a Grunt project from the scratch

Update npm, if needed
```
npm update -g npm
```

Init project by creating the 'package.json' file that will store its metadata with this wizard
```
npm init
```

Install grunt command-line interface globally (-g)
```
npm install -g grunt-cli
```

Create a 'Gruntfile.js' either by hand or with any of the available templates of 'grunt-init'
```
npm install -g grunt-init
```

Install the 'grunt' dependency on the project
```
npm install grunt --save-dev
```

Install Grunt plugins modules we specified into the Gruntfile
```
npm install
  grunt-contrib-jshint
  grunt-contrib-watch
  --save-dev
```

And now!
```
grunt
```
or
```
grunt watch
```

repository: gesposito/auto-mate

repo_name: gesposito/auto-mate


text:
# Docker version of [rustwasm/wasm_game_of_life](https://github.com/rustwasm/wasm_game_of_life)

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

This repository contains instructions to build a dockerize version
of the Rust and WebAssembly tutorial implementing the Game of Life.

A simple `make` command will build the `wasm_game_of_life/www` directory to serve.

`make run` will serve `http://localhost:8080`. It requires `npm` to be installed.

`make docker_run` will serve `http://localhost:8080` from `docker`.


text:
# Building pkcs11test for Windows

This document describes process of building both 32-bit and 64-bit versions of pkcs11test on 64-bit Windows machine.

## Required software

- [Visual Studio](https://visualstudio.microsoft.com/vs/community/) (Community)
- [C/C++ dependency manager from Microsoft](https://vcpkg.io/)
- [CMake](https://cmake.org/)

## Prepare working directories

    set P11TEST_HOME=C:\Projects\pkcs11test
    set VCPKG_HOME=C:\Projects\vcpkg

## Build GTest

    cd %VCPKG_HOME%
    bootstrap-vcpkg.bat
    vcpkg install gtest:x86-windows
    vcpkg install gtest:x64-windows
    vcpkg integrate install

## Build pkcs11test
    git clone https://github.com/google/pkcs11test.git %P11TEST_HOME%
## x86
    mkdir %P11TEST_HOME%\tmp
    cd %P11TEST_HOME%\tmp
    cmake .. -A Win32 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%/scripts/buildsystems/vcpkg.cmake
    cmake --build . --config RelWithDebInfo
    cmake -DCMAKE_INSTALL_PREFIX=%P11TEST_HOME%\out32 -DCMAKE_INSTALL_CONFIG_NAME=RelWithDebInfo -P cmake_install.cmake

## x64
    mkdir %P11TEST_HOME%\tmp
    cd %P11TEST_HOME%\tmp
    cmake .. -A x64 -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%/scripts/buildsystems/vcpkg.cmake
    cmake --build . --config RelWithDebInfo
    cmake -DCMAKE_INSTALL_PREFIX=%P11TEST_HOME%\out64 -DCMAKE_INSTALL_CONFIG_NAME=RelWithDebInfo -P cmake_install.cmake

branch_name: refs/heads/dev


text:
# Overview
This is a logger wrapper that keeps in memory a ring buffer of log lines
isolated to the `Thread.current`.
The main use of this is to have access to log history for when exception
happen.

## Example Use

```ruby
module Main
  class Application < Rails::Application

    ThreadLogger.config.max_entries = 100

    # hijack a logger that's already configured
    config.logger = ThreadLogger.hijack(config.logger)

  end

  class ApplicationController < ActionController::Base

    before_filter do
      logger.history.clear
    end

    rescue_from Exception do |exception|
      send_error exception
      raise exception
    end

    def send_error(exception)
      logger.error(exception)

      # convert history to text
      Mailman.support(exception, log: logger.history.to_text).deliver

      # convert history to HTML
      Mailman.support(exception, html: logger.history.to_html).deliver
    end
  end
end
```

look in /examples directory for more examples

# Features

## As a Developer
[x] use public_send instead of __send__
[x] general log capture with thread friendly ring buffer
[ ] clear history based on matchers
[ ] limit RingBuffer based on memory consumption
[x] default max entries so we don't run out of memory for anyone that forgets
[x] convert log to HTML

# Use with standard Ruby Logger

```
# Set how many entries to keep
ThreadLogger.config.max_entries = 5

# Hijack the standard logger instance
logger = ThreadLogger.hijack(Logger.new($stdout))

# Do some logging
('a'..'z').each{|l| logger.info l}
=>
I, [2015-10-29T14:56:59.242216 #35557]  INFO -- : a
I, [2015-10-29T14:56:59.242265 #35557]  INFO -- : b
...
I, [2015-10-29T14:56:59.242608 #35557]  INFO -- : z

# Get the history
logger.history.to_a
=>
["I, [2015-10-29T14:57:51.297326 #36535]  INFO -- : v\n",
 "I, [2015-10-29T14:57:51.297338 #36535]  INFO -- : w\n",
 "I, [2015-10-29T14:57:51.297349 #36535]  INFO -- : x\n",
 "I, [2015-10-29T14:57:51.297361 #36535]  INFO -- : y\n",
 "I, [2015-10-29T14:57:51.297373 #36535]  INFO -- : z\n"]
```

# Use with Log4r
```
# Set how many entries to keep
ThreadLogger.config.max_entries = 5

require 'log4r'

logger = Log4r::Logger.new 'mylog'
outputter = Log4r::Outputter.stdout
logger.outputters = outputter

logger = ThreadLogger.hijack(logger, outputter: outputter)

# do some logging
('a'..'z').each{|l| logger.info l}
 INFO mylog: a
 INFO mylog: b
 INFO mylog: c
 ...
 INFO mylog: z

# get the history
logger.history.to_a
=> [" INFO mylog: v\n",
 " INFO mylog: w\n",
 " INFO mylog: x\n",
 " INFO mylog: y\n",
 " INFO mylog: z\n"]
```


text:
# abandoned project

# Phoenix

super light JS web app support library

# How to install?

1. Download phoenix. If You have git, you can use following command `git clone https://github.com/Clechay/phoenix.git` in target dir.

2. Put in your app following files and add them in this order to your app's main html file:

```
[bowser lib (included in demo app)]
[other libs you use, ex. jquery (included in demo app, needed for events module)]
phoenix/core.js
phoenix/module/variables.js
[file which You will use to overwrite phoenix modules default vars, ex app/variables-app.js]
[additional modules which You want to use, ex. phoenix/modules/events.js (this one need jquery to work)]
[your app js files, ex app/app.js]
```

Example app is in `demo` dir.

Done! Now You can use phoenix in your project :3

# How to use existing modules?

### Events

Use `phoenix.eventRegister(id)` to register new event.

Use `phoenix.eventRegister(id,func)` to register new event and add first function func to it.

Use `phoenix.eventActionRegister(id,func)` to add new action to event.

Use `phoenix.eventReport(id,parms)` to execute all functions from event one by one from global variable 'phoenix_globalTemp'

# How to create module?

`{module-id}` means your module id, ex 'my_module'

`{module-dependencies}` means your module dependencies list as an array of strings, ex ['jquery','variables','events']

for dependencies check, order of list is meaningless.

```js
// check if phoenix is compatibile with browser
if (phoenix.core.checkComp()) {

	// check if all needed libs are avaible
	if (phoenix.core.checkDeps({module-dependencies})) {

		// log on console that module loading was started
		phoenix.core.log("start_module_loading","{module-id}")

		// create place for your data
		phoenix.data.{module-id}= new Object();

		// create alias to your data var to make life even easier
		var data=phoenix.data.{module-id};

		// create place for your module functions
		phoenix.{module-id}= new Object();

		// create alias to your module functions place to make life even easier
		var module=phoenix.{module-id};

		// your code

		// use module.{your-function-name}=function (args) { your function code } to add function to module
		// use module.{your-function-name}(args) to access your module function
		//
		// use phoenix.{anther-module-name}.(args) to access function from another module
		//
		// use data to acces your module data
		//
		// use phoenix.core to acces core of phoenix

		// add module id to modules list so other libs can check if it's avaible when they need it
		phoenix.core.addModule("{module-id}");

		// log on console that module was loaded successfuly :3
		phoenix.core.log("finish_module_loading","events")
	}
	else{
		// log on console that module can not be loaded because of missing libs
		phoenix.core.log("could_not_load_module",{id:"{module-id}",reason:"deps"})
	};
}
else{
	// log on console that module can not be loaded because of browser incompatibility with phoenix itself
	phoenix.core.log("could_not_load_module",{id:"{module-id}",reason:"comp"})
};
```

Done! You made phoenix module :3

repository: Clechay/phoenix

gha_language: JavaScript

repo_name: Clechay/phoenix


text:
Alfred Firefox Tab switcher
===========================

![demo gif](./demo.gif)

An [Alfred](https://www.alfredapp.com/) workflow to quickly switch between
firefox tabs.

# Installation

## Requirements

- [nodeJS](https://nodejs.org/en/) (tested with version 13.7)
- [Node Package Manager (npm)](https://www.npmjs.com/) (usually installed alongside
    nodeJS)
- [Alfred](https://www.alfredapp.com/) + Powerpack License

## 1. Install the workflow

You need to install the workflow first as it will also install the native
messaging host component of the extension (required before the extension is
started).

```
npm install -g alfred-firefoxtabswitch
```

The workflow will register automatically with Alfred, and the
[Native Manifest](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_manifests)
will be written automatically upon install at `/Library/Application Support/Mozilla/NativeMessagingHosts/alfredtabswitch.json`

## 2. Install the Firefox extension

Go to https://addons.mozilla.org/en-US/firefox/addon/alfred-tab-switch/ and
install it from there.

# Usage

Invoke the workflow with `fw` (you can customize that in Alfred), all opened
tabs (across all windows) will be shown.

If more than one argument is supplied to the workflow, all arguments must be
present in either the title or the URL.

Then simply hit ENTER on the tab you want to focus.

# Architecture

```
                                                    ┌───────────┐
                                                    │  Alfred   │
                                                    └───────────┘
                                                          ▲
                        ╭──────────────╮                  │
                        │ ◎ ○ ○ ░░░░░░░│                  │
                        ├──────────────┤            ┌─────┴─────┐
                        │              │            │UDP socket │
                        │              │            └─────┬─────┘
                        │              │                  │
                        │       ┌──────┴─────┐            ▼
                        └───────┤ Extension  ├───────────────────────────┐
                                └──────────┬─┘  Native Messaging Host    │
                                           └─────────────────────────────┘
```

The firefox extension will automatically spawn the native messaging host at
startup.

The host will open an UDP socket on port `52547` and listen for incoming
connections.

Alfred interacts with Firefox via the UDP socket, querying for the list of tabs,
and commanding to switch to a given tab. These inteactions are handled by the
`./host/client.js` file (spawned by alfred).

Each time the user issues a command, Alfred will spawn an instance of
`host/client.js`, which will talk to the UDP socket and kill itself when the
result is returned.

If the native messaging host fails to reply within 1 second, the client will
kill itself.

## Why so complex?

[Other workflows](https://github.com/stuartcryan/rapid-browser-tabs-for-alfred)
use Apple Script to switch tabs for Safari, Chrome etc.

But Firefox does not expose its tabs to the system, so the only way is to use an
extension with an native messaging component that allows alfred to communicate
with firefox.

# Debugging

TODO

license: Unlicense

repository: jknight/alfred-firefoxtabswitch

gha_license_id: Unlicense

repo_name: jknight/alfred-firefoxtabswitch


text:
[![Gem Version](https://badge.fury.io/rb/evil-seed.svg)](https://rubygems.org/gems/evil-seed)
[![Build Status](https://travis-ci.org/evilmartians/evil-seed.svg?branch=master)](https://travis-ci.org/evilmartians/evil-seed)
[![Cult of Martians](http://cultofmartians.com/assets/badges/badge.svg)](http://cultofmartians.com/tasks/evil-seed.html)

# EvilSeed

EvilSeed is a tool for creating partial anonymized dump of your database based on your app models.

## Motivation

Using production-like data in your staging environment could be very useful, especially for debugging intricate production bugs.

The easiest way to achieve this is to use production database backups. But that's not an option for rather large applications for two reasons:

- production dump can be extremely large, and it just can't be dumped and restored in a reasonable time

- you should care about sensitive data (anonymization).

EvilSeed aims to solve these problems.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'evil-seed', require: false
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install evil-seed

## Usage

### Configuration

```ruby
require 'evil_seed'

EvilSeed.configure do |config|
  # First, you should specify +root models+ and their +constraints+ to limit the number of dumped records:
  # This is like Forum.where(featured: true).all
  config.root('Forum', featured: true) do |root|
    # It's possible to remove some associations from dumping with pattern of association path to exclude
    #
    # Association path is a dot-delimited string of association chain starting from model itself:
    # example: "forum.users.questions"
    root.exclude(/\btracking_pixels\b/, 'forum.popular_questions')

    # It's possible to limit the number of included into dump has_many and has_one records for every association
    # Note that belongs_to records for all not excluded associations are always dumped to keep referential integrity.
    root.limit_associations_size(100)

    # Or for certain association only
    root.limit_associations_size(10, 'forum.questions')
  end

  # Everything you can pass to +where+ method will work as constraints:
  config.root('User', 'created_at > ?', Time.current.beginning_of_day - 1.day)

  # For some system-wide models you may omit constraints to dump all records
  config.root("Role") do |root|
    # Exclude everything
    root.exclude(/.*/)
  end

  # Transformations allows you to change dumped data e. g. to hide sensitive information
  config.customize("User") do |u|
    # Reset password for all users to the same for ease of debugging on developer's machine
    u["encrypted_password"] = encrypt("qwerty")
    # Reset or mutate other attributes at your convenience
    u["metadata"].merge!("foo" => "bar")
    u["created_at"] = Time.current
    # Please note that there you have only hash of record attributes, not the record itself!
  end

  # Anonymization is a handy DSL for transformations allowing you to transform model attributes in declarative fashion
  # Please note that model setters will NOT be called: results of the blocks will be assigned to
  config.anonymize("User") do
    name  { Faker::Name.name }
    email { Faker::Internet.email }
    login { |login| "#{login}-test" }
  end

  # You can ignore columns for any model. This is specially useful when working
  # with encrypted columns.
  #
  # This will remove the columns even if the model is not a root node and is
  # dumped via an association.
  config.ignore_columns("Profile", :name)
end
```

### Creating dump

Just call the `#dump` method and pass a path where you want your SQL dump file to appear!

```ruby
require 'evil_seed'
EvilSeed.dump('path/to/new_dump.sql')
```

### Caveats, tips, and tricks

 1. Specify `root`s for dictionaries and system-wide models like `Role` at the top without constraints and with all associations excluded.

 2. Use `exclude` aggressively. You will be amazed, how much your app's models graph is connected. This, in conjunction with the fact that this gem traverses associations in deep-first fashion, sometimes leads to unwanted results: some records will get into dump even if you don't want them.

 3. Look at the resulted dump: there are some useful debug comments.

## Database compatibility

This gem has been tested against:

 - PostgreSQL: any version that works with ActiveRecord should work
 - MySQL: any version that works with ActiveRecord should work
 - SQLite: 3.7.11 or newer is required (with support for inserting multiple rows at a time)

## FIXME (help wanted)

 1. `has_and_belongs_to_many` associations are traversed in a bit nonintuitive way for end user:

    Association path for `User.has_and_belongs_to_many :roles` is `user.users_roles.role`, but should be `user.roles`

 2. Test coverage is poor

 3. Some internal refactoring is required

## Standalone usage

If you want to use it as a standalone application, you can place exerything in a single file like this:

```ruby
#!/usr/bin/env ruby

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'activerecord'
  gem 'evil-seed'
  gem 'mysql2'
end

# Describe your database layout with ActiveRecord models.
# See http://guides.rubyonrails.org/active_record_basics.html

class Category < ActiveRecord::Base
  has_many :translations, class_name: "Category::Translation"
end

class Category::Translation < ActiveRecord::Base
  belongs_to :category, inverse_of: :translations
end

# Configure evil-seed itself
EvilSeed.configure do |config|
  config.root("Category", "id < ?", 1000)
end

# Connect to your database.
# See http://guides.rubyonrails.org/configuring.html#configuring-a-database)
ActiveRecord::Base.establish_connection(ENV.fetch("DATABASE_URL"))

# Create dump in dump.sql file in the same directory as this script
EvilSeed.dump(File.join(__dir__, "dump.sql").to_s)
```

And launch it like so:

```sh
DATABASE_URL=mysql2://user:pass@host/db ruby path/to/your/script.rb
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/palkan/evil-seed.

## License

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

repository: evilmartians/evil-seed

gha_language: Ruby

repo_name: evilmartians/evil-seed


text:
# Canada's sale taxes API

Here's an API to get canadian sales tax informations. Simple as that.

If you see any discrepancies in actual data, missing future rates or want to contribute historical rates, please open an issue on the Github repository with the data and we'll include it in the API.

## Documentation

### Rate limit

API usage is curently rate limited at 60 tries per minutes. The rate limit is subject to change upon API popularity.

### Contributing

You know the drill: report bugs in issue, suggest features in issue and if you can, submit pull requests!

### Meaning of accronyms

- GST: Global sales tax;
- PST: Provincial sales tax;
- HST: Harmonized sales tax;

### Usage

#### Parameters

The only parameter curently supported is `:prov` which is a [two letter canadian province postal abbreviation](https://en.wikipedia.org/wiki/Canadian_postal_abbreviations_for_provinces_and_territories#List_of_postal_abbreviations)

#### URL to poll

URL to poll the API is `http://api.canadasalestaxapi.ca`.

#### Get current GST

`/v1/federal/gst`

##### Example of successfull response

```
{
	"rate":0.05,
	"last_modified":"2016-10-01"
}
```
#### Get current HST for a province

`/v1/federal/hst/:prov`

##### Example of successfull response

```
{
	"rate":0.15,
	"last_modified":"2016-10-01"
}
```

##### Example of unsuccessful response
Will return 404 when there is no HST applicable to the province.

```
{
	"error":{
		"code":1000,
		"message":"There is no applicable HST in the :prov region"
	}
}
```

#### Get current HST for all provinces

`/v1/federal/hst/all`

##### Example of successfull response
If a :prov is not present in the response, it means that there is no HST applicable to :prov.

```
{
	"nb":{"rate":0.15,"last_modified":"2016-10-01"},
	"nl":{"rate":0.15,"last_modified":"2016-10-01"},
	"ns":{"rate":0.15,"last_modified":"2016-10-01"},
	"on":{"rate":0.13,"last_modified":"2016-10-01"},
	"pe":{"rate":0.15,"last_modified":"2016-10-01"},
}
```

#### Get current PST for a province

`/v1/provincial/pst/:prov`

##### Example of successfull response
Will return a rate of `null` if there is no applicable HST for a province.

```
{
	"rate":0.10,
	"last_modified":"2016-10-01"
}
```

##### Example of unsuccessful response
Will return 404 when there is no PST applicable to the province.

```
{
	"error":{
		"code":1000,
		"message":"There is no applicable PST in the :prov region"
	}
}
```

#### Get current PST for all provinces

`/v1/provincial/pst/all`

##### Example of successfull response
If a :prov is not present in the response, it means that there is no HST applicable to :prov.

```
{
	"bc":{"rate":0.07,"last_modified":"2016-10-01"},
	"mb":{"rate":0.08,"last_modified":"2016-10-01"},
	"nb":{"rate":0.1,"last_modified":"2016-10-01"},
	"nl":{"rate":0.1,"last_modified":"2016-10-01"},
	"ns":{"rate":0.1,"last_modified":"2016-10-01"},
	"on":{"rate":0.08,"last_modified":"2016-10-01"},
	"pe":{"rate":0.09,"last_modified":"2016-10-01"},
	"qc":{"rate":0.9975,"last_modified":"2016-10-01"},
	"sk":{"rate":0.05,"last_modified":"2016-10-01"},
}
```

#### Get the total applicable tax for a province

`/v1/total/:prov`

##### Example of successfull response

```
{
	"rate":0.14975,
	"type":"GST+PST",
	"last_modified":"2016-10-01"
}
```

#### Get the total applicable tax for all province

`/v1/total/all`

##### Example of successfull response

```
{
	"ab":{"rate":0.05,"type":"GST","last_modified":"2016-10-01"},
	"bc":{"rate":0.12,"type":"GST+PST","last_modified":"2016-10-01"},
	"mb":{"rate":0.13,"type":"GST+PST","last_modified":"2016-10-01"},
	"nb":{"rate":0.15,"type":"HST","last_modified":"2016-10-01"},
	"nl":{"rate":0.15,"type":"HST","last_modified":"2016-10-01"},
	"nt":{"rate":0.05,"type":"GST","last_modified":"2016-10-01"},
	"ns":{"rate":0.15,"type":"HST","last_modified":"2016-10-01"},
	"nu":{"rate":0.05,"type":null,"last_modified":"2016-10-01"},
	"on":{"rate":0.13,"type":"HST","last_modified":"2016-10-01"},
	"pe":{"rate":0.14,"type":"HST","last_modified":"2016-10-01"},
	"qc":{"rate":0.14975,"type":"GST+PST","last_modified":"2016-10-01"},
	"sk":{"rate":0.1,"type":"GST+PST","last_modified":"2016-10-01"},
	"yt":{"rate":0.05,"type":"GST","last_modified":"2016-10-01"}
}
```

## License

The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

repository: jpmurray/canada-sale-tax-api

gha_language: PHP

repo_name: jpmurray/canada-sale-tax-api


text:
![immovable rod](/images/immovable-rod.jpg)

###### top

##### Tomb of Annihilation

# Random Camping Bonus Payouts
Roll a d%, add the Final Camp Goodness Score, and compare with this table:

|d% + FCGS|Description|
|-------|-----------|
|1 - 3|After unknowingly spending the night on hallowed ground, the party has attracted the undesirable attention of a powerful spirit, demon, or fey.|
|4 - 6|Three random party members each receive a single permanent injury such as those described on the _Lingering Injuries_ table in chapter 3 of the DMG, or one of the critical hit tables in _Dungeon Crawl Classics_.
|7 - 9|By virtue of their clever and thrifty use of gear and supplies, the party has earned 1d20 platinum coins.|
|10 - 12|Party members have disadvantage on all saving throws, ability checks, and initiative rolls for the next 24 hours.|
|13 - 15|Every party member loses one random piece of equipment from their inventory.|
|16 - 18|Roll a 1d12 and randomly choose food or water. Each party member loses that many pounds of food or gallons of water from their inventory.|
|19 - 21|All party members gain one level of _exhaustion_.|
|22 - 24|After unknowingly camping in the beast's territory, the party has attracted the attention of a monster who begins following them.|
|25 - 27|Roll a 1d6 and randomly choose food or water. Every party member gains pounds of food or gallons of water equal to the roll.|
|28 - 30|All characters have disadvantage on all Wisdom (Survival) rolls for the following day.|
|31 - 33|All characters without _Inspiration_ gain it.|
|34 - 36|Roll a 1d6. Every character gets temporary hit points equal to the roll, which stack with any existing temporary hit points the character has.|
|37 - 39|Any character with levels of _exhaustion_ left over after their long rest may remove a level of _exhaustion_.|
|40 - 42|The party finds a cache of 1d12 _Potions of Healing_.|
|43 - 45|The party finds a cache of maps. The party may reveal 2d12 unmapped hex tiles on the Chultan map.|
|46 - 48|One random party member loses one random piece of equipment from their inventory.|
|49 - 51|Every character in the party gains a permanent +1 proficiency bonus to their _Camping_ skill proficiency, even if they aren't currently _proficient_ in it.|
|52 - 54|One random party member gains a level of _exhaustion_.|
|55 - 57|By virtue of their clever and thrifty use of gear and supplies (and perhaps a lucky discovery), the party has earned 5d20 platinum coins.|
|58 - 60|Roll 3d6 and randomly choose food or water. Each party member gains that many days' worth of pounds of food or gallons of water.|
|61 - 63|Roll 2d6. Every character gets temporary hit points equal to the roll, which stack with any existing temporary hit points the character has.|
|64 - 66|The party finds an unlabelled map that shows a trail leading to an X.|
|67 - 69|An attractive peasant stumbles out of the wilderness being chased by monsters.|
|96 - 72|A hideously ugly peasant stumbles out of the wilderness being chased by monsters.|
|73 - 75|All characters without _Inspiration_ gain it.|
|76 - 78|The party loses 5d20 platinum coins' worth of coins, gems, and trading goods.|
|79 - 81|Exactly two characters chosen by unanimous agreement of the party may each add a permanent +1 to their proficiency bonus in a single skill or tool proficiency.|
|82 - 84|All spellcasters in the party have double the normal number of spell slots available until 24 hours have passed.|
|85 - 87|The party has attracted the mercurial or ambiguous attention of a powerful spirit, demon, or fey.|
|88 - 90|Roll a d20. Each party members loses one or more pieces of equipment of their choice, with a minimum total weight in pounds equal to the roll.|
|91 - 93|All characters suffer disadvantage on all _Camping_ ability checks rolled in the next 24 hours.|
|94 - 96|Roll 4d6. Every character gets temporary hit points equal to the roll, which stack with any existing temporary hit points the character has.|
|97 - 99|The party discovers 1d6 spell scrolls of their choice, of any spells from the class lists and levels that the party's spellcasters are able to cast.|
|100 - 102|Party members gain advantage on all saving throws and ability checks rolled during the next 24 hours.|
|103 - 105|Roll again twice on this table.|
|107 - 108|Every party member must choose a skill proficiency they are _proficient_ in and take a permanent -1 penalty to their proficiency bonus with that skill. They do not stop being _proficient_.|
|109 - 111|All characters have a +3 bonus to their AC for the next 24 hours.|
|112 - 114|Roll 3d20 and randomly choose food or water. Each party member loses that many pounds of food or gallons of water from their inventory.|
|115 - 117|One random party member receives a permanent injury such as those described on the _Lingering Injuries_ table in chapter 3 of the DMG, or one of the critical hit tables in _Dungeon Crawl Classics_.|
|118 - 120|Each character in the party may add a permanent +1 to their proficiency bonus in a single skill or tool proficiency of their choice.|
|121 - 123|Roll 8d6. Every character gets temporary hit points equal to the roll, which stack with any existing temporary hit points the character has.|
|124 - 126|The party loses 20d20 platinum coins' worth of coins, gems, and trading goods.|
|127 - 129|Each character may become proficient in a single new saving throw of their choice.|
|130|The party has attracted the friendly attention of a powerful spirit, demon, or fey.|

![immovable rod](/images/immovable-rod.jpg)

[Back to top](#top)

[Rules for travelling in the jungle](travelling.md#top)

[Tomb of Annihilation homepage](README.md#top)

![the end](/images/toa-end.jpg)

repository: Paganpilot/DnD

repo_name: Paganpilot/DnD


text:
# ConditionalDelegate
[![Build Status](https://secure.travis-ci.org/rdvdijk/conditional_delegate.png)](http://travis-ci.org/rdvdijk/conditional_delegate)

**ConditionalDelegate** allows delegates to be conditional.

## Installation

Add this line to your application's Gemfile:

    gem 'conditional_delegate'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install conditional_delegate

## Usage

Here is a short example with a parent and child class. Calls
to the child object are delegated to its parent if the
condition for that delegation is met.

Simple parent class with four accessors:

```ruby
class Parent
  attr_accessor :foo, :bar, :baz, :qux
end
```

Child class with the same accessors as the parent, and some
conditional delegates defined:

```ruby
class Child
  extend ConditionalDelegate

  attr_accessor :parent, :foo, :bar, :baz, :qux

  conditional_delegate :foo, to: :parent, if: :empty?
  conditional_delegate :bar, to: :parent, if: lambda { |value| value == "something" }

  conditional_delegate :baz, :qux, to: :parent, if: :empty?
end
```

The field `foo` is delegated to the parent if the value of `foo` of the child is `empty?`.

The field `bar` is delegated to the parent if the given lambda returns true for the child's `foo` value.

Both the fields `baz` and `qux` are delegated to the parent if the child's field values are `empty?`.

```ruby
parent = Parent.new
parent.foo = "parent foo"
parent.bar = "parent bar"
parent.baz = "parent baz"
parent.qux = "parent qux"

child = Child.new
child.foo = ""
child.bar = "something"
child.baz = ""
child.qux = "child qux"

child.parent = parent

child.foo # => "parent foo"
child.bar # => "parent bar"
child.baz # => "parent baz"
child.qux # => "child qux"
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
LevelDB
=======

Fork of http://code.google.com/p/leveldb

Original docs:

* [README] (README)
* [LICENSE] (LICENSE)
* [AUTHORS] (AUTHORS)
* [NEWS] (NEWS)
* [TODO] (TODO)
* [API] (doc/index.html)

Changes
-------

This fork differs from the official version of leveldb as follows:

* Installation is supported by the makefile.

Installation
------------

First, build the library with:

    make

Then, LevelDB can be installed using

    sudo make install

The install target in the Makefile is as described in issue #138 on the google tracker: http://code.google.com/p/leveldb/issues/detail?id=138.

You can set the following env vars before running `make` if you prefer different installation locations:

  * PREFIX (default is /usr/local)

  * LIBDIR (default is $PREFIX/lib)

  * INCLUDEDIR (default is $PREFIX/include)

repository: vjoel/leveldb

repo_name: vjoel/leveldb


text:
# MojoELF

MojoELF is an ELF binary loader that runs in your application instead of
as part of the C runtime. The most useful feature of this is that, unlike
the standard `dlopen()`, it can load an ELF file from a place other than
the filesystem. Notably, it can load one from a buffer in memory.

## To use this nonsense:

- Add mojoelf.c to your build.
- Compile with these #defines, or change the top of mojoelf.c:
  ```c
  #define MOJOELF_SUPPORT_DLERROR 0  // remove MOJOELF_dlerror() + lots of strings.
  #define MOJOELF_SUPPORT_DLOPEN_FILE 0 // remove MOJOELF_dlopen_file()
  #define MOJOELF_REDUCE_LIBC_DEPENDENCIES 0  // use less libc calls. Scary!
  #define NDEBUG 1  // Turns off assert, which removes libc dependencies.
  ```
- Your calling code should `#include mojoelf.h` ...
- Put your ELF library in memory, and call `MOJOELF_dlopen_mem()` with the
  address of the memory buffer, the size of the buffer, and (optionally),
  callbacks that handle symbol resolution (they can be NULL). Details on
  the resolver callbacks are at the end of this document.
- If `MOJOELF_dlopen_mem()` returns non-NULL, the library is ready to use. If
  it returns NULL, there was a problem (`MOJOELF_dlerror()` will give you a
  human-readable error message). On success, you can free your buffer; we
  don't need it after `MOJOELF_dlopen_mem()` returns.
- `MOJOELF_dlopen_file()` does the same thing, but takes a filename instead of
  a memory buffer. Internally, it just loads the file into a malloc()'d
  buffer and calls `MOJOELF_dlopen_mem()`.
- To request entry points into the library, use MOJOELF_dlsym():
  ```c
  int (*my_function)(int argument) = MOJOELF_dlsym(lib, "AwesomeFunc");
  if (my_function == NULL) {
      printf("couldn't find AwesomeFunc!\n");
  } else {
      printf("AwesomeFunc() returns %d\n", my_function(123));
  }
  ```
- When you are done with a library, call `MOJOELF_dlclose()` to free any
  resources. All pointers returned by `MOJOELF_dlsym()` for this library are
  invalid after this call.
- Other fun stuff: `MOJOELF_getentry()` gets you the entry point for the
  ELF file (which isn't useful on shared libraries, but is how you eventually
  get to main() in an executable).

## Callbacks:

You supply a handful of callbacks when calling `MOJOELF_dlopen_*()`. Any given
callback is allowed to be NULL, as is the pointer to the MOJOELF_callbacks if
you don't care about these at all. The function pointers get copied, so you
can free the MOJOELF_Callbacks struct as soon as `MOJOELF_dlopen_*()` returns.

```c
typedef struct MOJOELF_Callbacks
{
    MOJOELF_LoaderCallback loader;
    MOJOELF_SymbolCallback resolver;
    MOJOELF_UnloaderCallback unloader;
} MOJOELF_Callbacks;
```

Note that `MOJOELF_dlopen_*()` does not make any attempt to resolve dependencies
on its own, so if you want to implement something like Linux's dynamic loader,
you'll need to parse `LD_LIBRARY_PATH`, or whatever, on your own using these
callbacks. By default, without callbacks, any dependency (including libc.so)
or unresolved symbol will cause `MOJOELF_dlopen_*()` to fail.

The "loader" callback doesn't necessarily load anything. All it does it tell
MojoELF that it's claiming a specific dependency. For example, if you want to
load an ELF that depends on libFoo.so.3, but you plan to override this
library without it actually existing, you can write a callback like this...

```c
void *my_loader(const char *soname, const char *rpath, const char *runpath)
{
    return (void *) (strcmp(soname, "libFoo.so.3") == 0);
}
```

...and MojoELF will not try to load libFoo itself, and assumes you will
provide any needed symbols from it via your resolver callback.

Note that your loader can be way more complex...it could actually _load_
something, for example, but in many cases, this is all that's needed.

The loader callback is provided with any `RPATH` or `RUNPATH` entries in the
currently-loading ELF. Please refer to Linux's `dlopen()` manpage for details
on these strings.

The value returned from the loader callback is opaque data. It will be passed
to your resolver callback, and is expected to be free'd in the unloader
callback, if you like.

The resolver callback looks like this:

```c
extern int my_function(int argument);

void *my_resolver(void *handle, const char *sym)
{
    if (strcmp(sym, "my_function") == 0)
        return my_function;
    // this also works for data, not just functions.
    return NULL;  /* can't help you. */
}
```

The callback is called once for each non-NULL value that your loader
previously returned, in the other they were returned, until one succeeds. If
none succeeds, the callback fires one more time with the handle set to NULL.
If this still doesn't return a non-NULL value, MojoELF will fail to load the
ELF file, due to missing dependencies.

The unloader callback is like this:

```c
void my_unloader(void *handle)
{
    // if (handle) is something you allocated in your loader callback,
    //  you can free it here.
}
```

## If you have problems:

Ask Ryan<EMAIL_ADDRESS>

license: Zlib

repository: icculus/mojoelf

repo_name: icculus/mojoelf


text:
# picker

::: danger
`<picker>` is only supported on Android and iOS, and is not supported on web.
:::

A series of stream api. It provides function: pick data, pick date, pick time

# API

## pick

#### pick(options, callback[options])

* **@options**
  * **`index`**, number, default selected row
  * **`items`**, array, picker's data
  * **`textColor`**, color, text color in the picker item
  * **`selectionColor`**, color, the background color of the selected item in the picker
  * **`confirmTitle`**, string, confirm button text
  * **`cancelTitle`**, string, cancel button text
  * **`confirmTitleColor`**, color, confirm button text color
  * **`cancelTitleColor`**, color, cancel button text color
  * **`title`**, string, title of dialog
  * **`titleColor`**, color, text color of the dialog title
  * **`titleBackgroundColor`**, color, background color of the dialog title

* **@callback**, the callback function after executing this action. `ret {Object}` is `callback` 's parameter:
  * **`result`**, string, result is one of success,cancel,error
  * **`data`**, number, the selected index,it exists when result is success.

## pickDate

#### pickDate(options, callback[options])

* **@options**
  * **`value`**, string, required, date picker selected value by default，date's form is yyyy-MM-dd
  * **`max`**, string, optional, date’s max value
  * **`min`**, string, optional, date's min value
* **@callback**, the callback function after executing this action.ret {Object} is callback 's parameter:
  * **`result`**, string, result is one of success/cancel/error.
  * **`data`**, string, the selected value, the form of data is yyyy-MM-dd, it exists when result is success.

## pickTime

#### pickTime(options, callback[options])

* **@options**
  * **`value`**, string, required，the form of value is HH:mm
* **@callback**, the callback function after executing this action.ret {Object} is callback 's parameter:
  * **`result`**, string, result is one of success/cancel/error
  * **`data`**, string, the selected value, the form of data is HH:mm, it exists when result is success.

[Demo](http://dotwe.org/vue/060faedd0952f518d2d5322a5fb5ea2f)

repository: apache/incubator-weex-site

repo_name: apache/incubator-weex-site


text:
# Todo List Web App

[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org) [![Build Status](https://api.travis-ci.org/kbouzidi/todolist.svg?branch=master)](https://travis-ci.org/kbouzidi/todolist/branches)  [![Build Status](https://codeship.com/projects/061c9970-ae2b-0133-3079-7e50fc25e7b7/status?branch=master)](https://codeship.com/projects/132245)
[![Coverage Status](https://coveralls.io/repos/github/kbouzidi/todolist/badge.svg?branch=master)](https://coveralls.io/github/kbouzidi/todolist?branch=master)

## Overall directory structure
```
todolist/
  |- src/
  |- .gitignore
  |- .travis.yml
  |- pom.xml
  |- LICENSE
  |- README.md
  |- run.sh
```

## Description
TO-DO list to track project progress.

A web App for easily organising project, tasks. Check out the live demo.

Todo comes with a broad range of features including nested adding new Task, new User, new project, with clean API and modern views.
It's best viewed in a modern browser but fallbacks will be available soon.

## Live Demo
 - [Todo List Live Demo](https://spark-todo.herokuapp.com)

## API description

 - [Todo List API](http://docs.todolist21.apiary.io)

## Environment setup
Download and setup the following applications:

- [JAVA JDK8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- [Spark](http://sparkjava.com)
- [Maven](https://maven.apache.org/)
- [Postgres](http://www.postgresql.org/)
- [Angular Material](https://material.angularjs.org/latest/)
- [Heroku](https://www.heroku.com)

For Windows users please install `Cygwin`

- [Cygwin](https://www.cygwin.com/)

## Application server
 - `Jetty v9.3.0.M2`

## Version control
 - `Github`

## Server installation
Go to the server folder and execute the following commands

### Database
- `psql -c "CREATE USER sylvain WITH PASSWORD 'sylvain';"`
- `psql -c 'create database tests;' -U postgres`
- `psql -c 'grant all privileges on database tests to sylvain;' -U postgres`

## Maven
- `mvn clean install`

## Run Batch
 - `mvn jetty:run`

### Contributing

TODO welcomes any and all contributions! Please read the [CONTRIBUTING guide](https://github.com/kbouzidi/todolist/blob/master/CONTRIBUTING.md) for details on developing and submitting your contributions.

repository: kbouzidi/todolist

repo_name: kbouzidi/todolist


text:
# mat-ripple

`mat-ripple` defines an area in which a ripple animates, usually in response to user action. It is used as an attribute directive, for example `<div mat-ripple [matRippleColor]="rippleColor">...</div>`.

By default, a ripple is activated when the host element of the `mat-ripple` directive receives mouse or touch events. On a mousedown or touch start, the ripple background fades in. When the click event completes, a circular foreground ripple fades in and expands from the event location to cover the host element bounds.

Ripples can also be triggered programmatically by getting a reference to the MatRipple directive and calling its `start` and `end` methods.

### Global options

Developers are able to specify options for all ripples inside of their application.

The speed of the ripples can be adjusted and the ripples can be disabled globally as well.

Global ripple options can be specified by setting the `MAT_RIPPLE_GLOBAL_OPTIONS` provider.

```ts
const globalRippleConfig: RippleGlobalOptions = {
  disabled: true,
  baseSpeedFactor: 1.5 // Ripples will animate 50% faster than before.
}

@NgModule({
  providers: [
    {provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: globalRippleConfig}
  ]
})
```

Here are all available global options listed:

| Name            | Type    | Description                               |
| --------------- | ------- | ----------------------------------------- |
| disabled        | boolean | Whether ripples should show or not.       |
| baseSpeedFactor | number  | Factor to adjust ripple speed.            |

### API Summary

Properties:

| Name | Type | Description |
| --- | --- | --- |
| `matRippleTrigger` | Element | The DOM element that triggers the ripple when clicked. Defaults to the parent of the `mat-ripple`.
| `matRippleColor` | string | Custom color for foreground ripples
| `matRippleCentered` | boolean | If true, the ripple animation originates from the center of the `mat-ripple` bounds rather than from the location of the click event.
| `matRippleRadius` | number | Optional fixed radius of foreground ripples when fully expanded. Mainly used in conjunction with `unbounded` attribute. If not set, ripples will expand from their origin to the most distant corner of the component's bounding rectangle.
| `matRippleUnbounded` | boolean | If true, foreground ripples will be visible outside the component's bounds.
| `matRippleDisabled` | boolean | If true, click events on the trigger element will not activate ripples. The `start` and `end` methods can still be called to programmatically create ripples.


text:
# node-mysql-crud-example
### Example of DB CRUD web using NodeJS, MySql, Knex and Bookshelf

This app has been built based on [this tutorial](https://dev.to/achowba/build-a-simple-app-using-node-js-and-mysql-19me), originally on the *master* branch. On the _bookshelf_ branch the code related to database has been adapted to that ORM.

After cloning the repo, you can start the app by:

```shell
$ npm install
$ node app.js
```

Open on a browser `http://localhost:4000/players/` to start ussing the app.

Opening `http://localhost:4000/assets/img/diego.jpeg` you can access directly to the players' images.

branch_name: refs/heads/bookshelf