text:
# SwiftExamples
Swift Examples for Advanced iOS Development Course.
=======
# Swift Pedometer
This is a simple example on how to use the CMPedometer class to access a CMPedometerData object to retrieve its "numberOfSteps" property. This property allows us to display the stepsTaken since midnight of the current day.

In this project, we only display the "numberOfSteps" property in our View, but have easy access to the "distance", "floorsAscended", and "floorsDescended" information and could also display that data in our View.

Built by George Andrews <http://www.iteachcoding.com/>

**License Statement:**

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

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

For more information, please refer to <http://unlicense.org/>

license: Unlicense

repository: ChaseLukeA/SwiftExamples

repo_name: ChaseLukeA/SwiftExamples


text:
---
date: 2016-07-29
published: true
title: Live Reload with Jeykll and Hawkins
layout: post
tags: [jekyll,hawkins,ruby,blogging]
---
While struggling to write a different post, I procrastinated by deciding that, to boost my productivity, I *needed* the preview of the post to live-reload. It was actually really easy to set up (and it's very cool to use). <!--more-->

___
**Update - 07/17/2019**: Admittedly, this is a bit late to the party, but I should note that the approach used here is no longer needed. With the [release of Jekyll 3.7](https://jekyllrb.com/news/2018/01/02/jekyll-3-7-0-released/) in January of 2018, LiveReload support was built into the core development server. You can use it via the command: `bundle exec jekyll serve --livereload`

___

## The Problem

I use [LightPaper](http://lightpaper.42squares.in/) to blog. It's the best Markdown editor I've found (and I've tried a lot of them[^1]). While its built-in preview functionality is very good, there are still times that LightPaper's internal Markdown renderer differs from the way kramdown parses/converts the file.[^2] I find these occasional discrepancies frustrating, and they're one of the reasons I prefer to just run `bundle exec jekyll serve` and use the preview supplied by Jekyll's local server when blogging. The downside of this approach is the need to refresh the page in order to see changes, so in order to avoid writing, I decided to track down a solution.

## The Solution: Hawkins

My initial search for "jekyll realtime refresh" lead to a bunch of dated posts about using Grunt, Gulp, Browsersyc, `guard-livereload`, a Chrome plugin, and/or some ruby scripts to make it happen; all of which seemed like a lot more work that I wanted to do.[^3] A revised Google search, that included the year, did the trick: "jekyll refresh on save 2016". Halfway down the results page, I saw a post on [talk.jekyllrb.com](https://talk.jekyllrb.com/) from this year: [A tool for automatic browser refreshes](https://talk.jekyllrb.com/t/a-tool-for-automatic-browser-refreshes/2150).

The tool, which is exactly what I was looking for, is [Hawkins](https://github.com/awood/hawkins), by [@awood](https://github.com/awood). What is Hawkins, exactly? To parrot the README:

> Hawkins is a Jekyll 3.1+ plugin that incorporates LiveReload into the Jekyll "serve" process.

And, as explained by @awood in the initial forum post:

> Hawkins is heavily inspired by guard-livereload and rack-livereload but it's entirely self-contained and integrated with Jekyll so it's easier to setup and use.

## Setting Up Hawkins

I followed the "How To Use" guide from the README and added the following to the Gemfile in the root of my project:

```ruby
group :jekyll_plugins do
  gem 'hawkins'
end
```
Then, from the root of the project, I ran `bundle install`, which downloaded and installed the plugin and all necessary dependencies. That's it; it's ready to use. The syntax for serving the preview with Hawkins is very similar to the standard Jekyll command:

```shell-session
$ bundle exec jekyll liveserve
```
You'll know it's working, because the console output will include the new line "LiveReload Server: <IP_ADDRESS>:35729" (which is not where the site is served from, it's just for serving *livereload.js*.) You can then access the site at the usual: <http://<IP_ADDRESS>:4000>. When you do, the console will acknowledge it with the output: "LiveReload: Browser connected". When you save your Markdown post, the preview will refresh automatically:

![blogging with LightPaper, Jekyll, and LiveReload by Hawkins](/public/assets/images/hawkins-jekyll-lightpaper-preview.png)

Happy blogging!

<hr />
[^1]: Mou, MacDown, Byword, iA Writer, plugins for Sublime Text 3, to name a few. None of them bad; they're just not at quite the same level.
[^2]: Here are two basic example: 1) They handle escaping special characters differently, which can result in some very funky looking output. 2) LightPaper's syntax highlighting is not as robust.
[^3]: Update - 08/01/2016: In the comments, [@bdavidxyz](https://github.com/bdavidxyz) mentioned his project [Impatient Jekyll](http://bdavidxyz.github.io/impatient-jekyll/), which provides live-reload and more. If you'd like a more full featured dev environment for Jekyll, without that much more work, you should check it out.

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: CSS

gha_license_id: NOASSERTION

license_type: permissive


text:
# haproxy-keepalived
> If you want to use this image, you had better learned some of Docker、HAProxy、Keepalived, perhaps some Bash shell knowledge.

## Introduction
Glad you can see this repo. If you are looking for an image that combine HAProxy and Keepalived, this repo can help you archieve this goal.

`HAProxy` is used to setup a Load Balancer for TCP/HTTP applications. And `Keepalived` provides the characteristic of High-Availability for our `HAProxy` service.

Below link is the `haproxy-keepalived` image in docker-hub:
- [pelin/haproxy-keepalived](https://hub.docker.com/r/pelin/haproxy-keepalived/)

## Useage
This image has two-mode: `BIND`、`ENV`, default is `BIND`. Below will introduce the difference between the two modes, and how they are used.

### BIND
`BIND` mode can bind host's file with docker container's volume, such as HAProxy's and Keepalived's conf.
We can use docker-compose to up the `haproxy-keepalived`.

docker-compose.yml
```yml
version: '3'
services:

  haproxy-keepalived:
    image: "pelin/haproxy-keepalived"
    privileged: true
    network_mode: host
    restart: always
    volumes:
      - /data/keepalived.conf:/etc/keepalived/keepalived.conf
      - /data/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
    environment:
      MODE: "BIND"
```
Then we can use `http://${host_ip}:1080/stats` to lookup `HAProxy` service's status.
(Port `1080` can see /haproxy/template.cfg)

### ENV
`ENV` mode can use docker environment variables to generate HAProxy's and Keepalived's conf.
We can use docker-compose to up the `haproxy-keepalived`.

docker-compose.yml
```yml
version: '3'
services:

  haproxy-keepalived:
    image: "pelin/haproxy-keepalived"
    privileged: true
    network_mode: host
    restart: always
    environment:
      MODE: "ENV"
      KEEPALIVED_STATE: "MASTER"
      KEEPALIVED_INTERFACE: "ens18"
      KEEPALIVED_PRIORITY: "105"
      KEEPALIVED_V_ROUTER_ID: "40"
      KEEPALIVED_VIP: "<IP_ADDRESS>"
      haproxy_item1: |-
        listen app-1
            bind *:4000
            mode http
            maxconn 300
            balance roundrobin
            server server1 <IP_ADDRESS>:4001 maxconn 300 check
            server server2 <IP_ADDRESS>:4002 maxconn 300 check
      haproxy_item2: |-
        listen app-2
            bind *:5000
            mode http
            maxconn 300
            balance roundrobin
            server server1 <IP_ADDRESS>:5001 maxconn 300 check
            server server2 <IP_ADDRESS>:5002 maxconn 300 check
```
From above, we add some envs rather than use docker volumes. Below is the meaning of above environment variables:
- `KEEPALIVED_STATE`: Start-up default state
- `KEEPALIVED_INTERFACE`: Keepalived Binding interface
- `KEEPALIVED_PRIORITY`: Keepalived node priority
- `KEEPALIVED_V_ROUTER_ID`: String identifying router
- `KEEPALIVED_VIP`: Virtual ip
- `haproxy_item1`: haproxy's item, can haproxy_item2、haproxy_item3、haproxy_item4, for custom your own haproxy-conf

## Extend
In this image, it extends a feature. If you want to use HAProxy only rather than `haproxy & keepalived`, you can set `HAPROXY_ONLY=true` in docker env.

## Discuss
If you have some problem about useage or some suggestion, welcome to create an ISSUE: https://github.com/penglongli/haproxy-keepalived/issues

## LICENSE
Based on [MIT LICENSE](https://github.com/penglongli/haproxy-keepalived/blob/master/LICENSE)

You can fork it or reference it for custom your own `haproxy-keepalived` image.

repository: sophea/haproxy-keepalived

gha_license_id: MIT

repo_name: sophea/haproxy-keepalived


text:
---
title: Aegisub 2.1.5 released
contributors:
  - Unknown
date: 2008-11-23T02:44:00.004000Z
lastmod: 2008-11-23T02:50:33.989000Z
weight: 50
tags:
  - old-post
  - release
  - aegisub
aliases:
  - /blog/2008/11/aegisub-215-released.html
---

Due to a fairly serious bug introduced in 2.1.4, here's 2.1.5. Everyone is advised to update to it.

- Fixed a bug in audio display that caused it not to update properly (introduced on 2.1.4)
- Fixed a bug that caused Aegisub to crash if you attempted to load any ASS subtitles with malformed embedded fonts
- Tweaked the layout of the visual typesetting bar

The win32 binary is available [here](http://www.malakith.net/amz/aegisub/aegisub-r2481-setup.exe).

BTW, a good way to keep up with Aegisub updates it to subscribe to the [Atom feed](http://www.aegisub.net/feeds/posts/default) - I recommend [Google Reader](http://reader.google.com).

repository: Aegisub/aegisite

gha_language: HTML

repo_name: Aegisub/aegisite


text:
---
layout: default
---

# 1997-08-27 - Re: PGP5i supports RSA keys?

## Header Data

From: Bill Stewart<EMAIL_ADDRESS>To: Anonymous<EMAIL_ADDRESS>Message Hash: f8f18f16a3baeb1b26e173b87bf01121f6a16e57400df8d15b0dac457e9276ad

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-08-27 23:27:17 UTC

Raw Date: Thu, 28 Aug 1997 07:27:17 +0800

## Raw message

```
{% raw  %}From: Bill Stewart<EMAIL_ADDRESS>Date: Thu, 28 Aug 1997 07:27:17 +0800
To: Anonymous<EMAIL_ADDRESS>Subject: Re: PGP5i supports RSA keys?
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 08:13 PM 8/24/97 -0400, Anonymous wrote:
>Sorry, but computer hardware performance is increasing exponentially,
>but the difficulty of factoring is subexponential in the length of the
>number.

Ok, it's subexponential, but not _very_ subexponential.
For example, doubling the work to crack a 1024 bit key means adding
about 10 bits, if I remember right; it's something like
2**N / log N or 2**(N/3) or some other relationship that's
close enough to exponential in that adding a small number of bits
doubles the workload, for values of "small" that mean it doesn't take
you a substantially different amount of work to double the amount of
work a cracker needs to do, or multiply it by 1024, or by 1048576.
You can still kick the NSA's butt at the cost of going to next year's
model for your palmtop, or adding a few megahertz into your Pentium,
rather than needing to siphon off spare CPU cycles from Ft. Meade to
make your cellphone encryption fast enough.

#			Thanks;  Bill
# Bill Stewart, +1-415-442-2215<EMAIL_ADDRESS># You can get PGP outside the US at ftp.ox.ac.uk/pub/crypto/pgp
#   (If this is a mailing list or news, please Cc: me on replies.  Thanks.)

{% endraw %}
```

## Thread

+ Return to [August 1997](/archive/1997/08)

+ Return to "[? the Platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>](/authors/_the_platypus_aka_david_formosa_dformosa_at_st_nepean_uws_edu_au_)"
+ Return to "[? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>](/authors/_the_platypus_aka_david_formosa_dformosa_at_st_nepean_uws_edu_au_)"
+ Return to "[Anonymous <anon@anon.efga.org>](/authors/anonymous_anon_at_anon_efga_org_)"
+ Return to "[Bill Stewart <stewarts@ix.netcom.com>](/authors/bill_stewart_stewarts_at_ix_netcom_com_)"
+ Return to "["David Downey" <digital_matrix@hotmail.com>](/authors/david_downey_digital_matrix_at_hotmail_com_)"
+ Return to "[Irwan Hadi <phoenix@cutey.com>](/authors/irwan_hadi_phoenix_at_cutey_com_)"
+ Return to "[Mike <Michael.Johnson@mejl.com>](/authors/mike_michael_johnson_at_mejl_com_)"
+ Return to "["William H. Geiger III" <whgiii@amaranth.com>](/authors/william_h_geiger_iii_whgiii_at_amaranth_com_)"

+ 1997-08-17 (Sun, 17 Aug 1997 20:49:29 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/a7fcbea80f0575ee22ff5dbce57345740f55a79674eb314feffcb64d60455f88) - _"David Downey"<EMAIL_ADDRESS>  + 1997-08-19 (Tue, 19 Aug 1997 12:51:14 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/a7f2c1f582f3ad0518105dc368a3c4598255c21cefcd141a91bb2b0d23c7374f) - _? the platypus {aka David Formosa}<EMAIL_ADDRESS>    + 1997-08-19 (Tue, 19 Aug 1997 22:43:19 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/71eb0a8964c999a0da6d7c894401446dc910625a5cc12a41db3dd61737cb4904) - _"William H. Geiger III"<EMAIL_ADDRESS>  + 1997-08-19 (Tue, 19 Aug 1997 14:26:04 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/1d9d43c2ffb1aa65cddbfe262def5ebaf2ea64d2ae65a35342c9a7b1ce0f1e2c) - _Mike<EMAIL_ADDRESS>    + 1997-08-21 (Thu, 21 Aug 1997 21:11:57 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/4d2298a8bf6115d6a44c92c8d4f5ea6683696c8e757bfdd9625e9c5396291be3) - _? the Platypus {aka David Formosa}<EMAIL_ADDRESS>    + 1997-08-21 (Fri, 22 Aug 1997 01:33:51 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/984f4588632b56f23a81b87247357e6dc03b3bce894f37bd4ce6b8a63f1e33fd) - _"William H. Geiger III"<EMAIL_ADDRESS>  + 1997-08-20 (Thu, 21 Aug 1997 00:10:19 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/72aa858c54d851b03a93b10760a5712da9356a20baab41ee3062548e2c4b0bf3) - _Irwan Hadi<EMAIL_ADDRESS>  + 1997-08-22 (Fri, 22 Aug 1997 15:21:49 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/3ad3633839ac735841ebdde86e27460a76c641c0f6aaf67dfbbc91a40fd0a5d7) - _Bill Stewart<EMAIL_ADDRESS>  + 1997-08-25 (Mon, 25 Aug 1997 08:29:55 +0800) - [Re: PGP5i supports RSA keys?](/archive/1997/08/394594e70b1dc31c682b64ab26fa676e9e3e6bed2f8d9ccedcedb7c36aa3dfc2) - _Anonymous<EMAIL_ADDRESS>  + 1997-08-27 (Thu, 28 Aug 1997 07:27:17 +0800) - Re: PGP5i supports RSA keys? - _Bill Stewart<EMAIL_ADDRESS>


text:
### [CVE-2010-4251](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-4251)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3D%20n%2Fa%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

The socket implementation in net/core/sock.c in the Linux kernel before 2.6.34 does not properly manage a backlog of received packets, which allows remote attackers to cause a denial of service (memory consumption) by sending a large amount of network traffic, as demonstrated by netperf UDP tests.

### POC

#### Reference
- http://kerneltrap.org/mailarchive/linux-netdev/2010/3/3/6271093/thread
- http://www.vmware.com/security/advisories/VMSA-2011-0012.html

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

repository: trickest/cve

branch_name: refs/heads/main

repo_name: trickest/cve


text:
# RasPy-Slideshow
##Random looping slideshow using Python, designed for Raspberry Pi implementation

This project was intially created for a loved one with Alzheimer's. The basic idea is to have a continually looping slideshow (similar to a digital picture frame) on a screen powered by Raspberry Pi. The slideshow
contains slides of various types, some static while others are drawn dynamically (i.e. date and weather) and others are dependent on the time of year.

If you are familiar with the disease, then you probably know that context is often a hard thing to come by. Faces don't always match up with names, "November" may not have any link to Thanksgiving, and so on. My goal here
was to provide context any day of the year through images, whether through the current weather (show a picture of rain instead of just saying "Rain"), upcoming holidays, seasons and linking faces to names.

That being said, you could easily use this for your own RasPi purposes. I couldn't find anything else that was easy to "drag and drop" pictures into the different folders and just let it run. You could completely disregard any *slide type* that I used and come up with your own.

To see more about this project and how I built the display side please visit [Dynamic Alzheimer's Clock] (http://jpbrown.info/projects/view/dynamic-alzheimers-clock/) on my personal site.

**Requirements**
* tkinter
* httplib2
* PIL

##To Use
###Images
First, you need to decide how you want your image tree to be structured. I have provided my basic skeleton which contains a wide variety. You can add/remove as you like so long as you update **slideshow.py** in the relevant places.
* self.group_static (line 19) contains all of your slides that are eligible year-round, grouped by category
  * Each category contains a *name* and *method* ("image" or "draw", more on that later)
  * That category can include a number of slides which at a minimum have a *name* (not important) and *path* which points to the folder where your images are stored
  * Slides can provide a callback method if the *category method* is "draw", you must implement this method yourself elsewhere. See the 1st slide (Time of Day) for reference
* self.group_seasonal (line 51) contains all of your slides that you want to restrict by month
  * These function as other slides above, but with a *months* attribute that notes what number month the slide is eligible in

###Weather
If you want to use the weather capability you will need to update the zip code (and units if necessary) on line 86 as well as your own AppID (it's free)
```
self.weather_api_path = 'http://api.openweathermap.org/data/2.5/weather?zip=77034,us&units=imperial&APPID=bf21b5e020e1fcdbe8'
```
You could also implement more weather types and cloud types as you see fit. I kept it basic for now.

##Functionality
* F11 toggles fullscreen mode
* Escape key escapes fullscreen
* Transition time is set at 5 seconds, change this on line 192 `self.tk.after(5000, self.slideshow)` and remember to use miliseconds

##Other Notes
* Originally designed for a 1280x800 screen. This mostly matters for the static black image I use for Time of Day
* There are many quirks to getting PIL and tkinter to work on RasPi, especially with older distros. Leave a comment and I'll try to help

**Roadmap**
* Remote access/downloading of new slides
* Annual reminders (birthday, anniversary etc)
* Scheduled reminders i.e. "Haircut at 2PM"

repository: Giologic/RasPy-Slideshow

gha_language: Python

repo_name: Giologic/RasPy-Slideshow


text:
# Anagrams

Anagrams is a Maven based Java project who include сommand line tool for rebuild singly words in a sentence into anagrams.

## Example

All non letters symbols are stays in the same places

Input:   a1bcd efg!h

Output: d1cba hgf!e

## Additional information

- 9 Junit5 tests are included
- Built using the principles of OOP

## Usage

- Open comand line in project root directory

- Build project

```
mvn package
```
- Run

```
java -jar target\anagrams-1.0.jar

```

## Contributing
Pull requests are welcome.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: dmytro-shk/anagrams

repo_name: dmytro-shk/anagrams


text:
# better_forms 0.0.2-beta2
- Upgraded 'provider' version to 5.0.0
- Enhacement of the example provided

# better_forms 0.0.2-beta1
- Added the possibility to use aymmetric field groups

# better_forms 0.0.1-beta10+1
- Added an example to the README

# better_forms 0.0.1-beta10
- Checkboxes are registered automatically as part of the form
- Dropdowns are registered automatically as part of the form

# better_forms 0.0.1-beta9
- Added the ability of registering fields inside BFFormGroup automatically

# better_forms 0.0.1-beta8
- Now, text in checkboxes can be touchable or not

# better_forms 0.0.1-beta7
- Added the posibility to add a Widget as text for a Checkbox

# better_forms 0.0.1-beta6
- Deleted SingleChildScrollView causing problems

# better_forms 0.0.1-beta5
- Fixed some errors related to BFCheckbox

# better_forms 0.0.1-beta4
- Added compatibility with intl 0.17.0-nullsafety.2

# better_forms 0.0.1-beta3+1
- README has been updated with a little bit of info about usage

# better_forms 0.0.1-beta3
- Users can now use custo date format

# better_forms 0.0.1-beta2
- More customization options for the Form button
- User created form fields are now automatically registered

# better_forms 0.0.1-beta1
- First version

gha_language: Dart


text:
# Test: Syntactically valid OpenAPI definition in YAML

> see https://aka.ms/autorest

``` yaml
input-file: tiny.yaml
csharp:
  output-folder: Client
```

repository: Azure/autorest

gha_language: TypeScript

repo_name: Azure/autorest


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

Africa Wikimedia Developer (AWMD) statisitics tool is meant for gathering monthly statistics of African technical contributors into Wikimedia projects such as; MediaWiki, MediaWiki extensions, etc. For more information see: https://www.mediawiki.org/wiki/Awmd-stats

## Ranking method
The tool uses a method to rank different contributors based on their patches and the state of the patch.
Assume "m" is the number of patches merged and "n" is the number of patches under review, the formula is:
```
points = (2 x m) + n
```

# Requirements

* [Python 3.x+](https://www.python.org/downloads/)
* [PIP (Python Dependency Manager)](https://pip.pypa.io/en/stable/installing/)

## Clone project
```bash
git clone ssh://<USERNAME>@gerrit.wikimedia.org:29418/labs/tools/awmd-stats
```

## Setup and documentation

Install application dependencies and regenerate documentation using the `setup.sh` script:
```bash
./setup.sh
```
The above script attempts to check system requirements and tell informs user on next steps.

## Quickstart the tool
```bash
export FLASK_APP=flasky.py
flask run
```

## Read the code documentations
To view documentation of the codes which makes use of the docstrings, use this endpoint
#### On localhost
```bash
localhost:5000/docs/index
```

#### On Toolforge server
```bash
https://tools.wmflabs.org/awmd-stats/docs/index
```

## Testing the tool
```bash
pip install pytest
```

Then run the command below (make sure you're in the project's root for example):
```bash
py.test -v tests/
```

`NOTE`: If you find any failing test, report on Phabricator here: https://phabricator.wikimedia.org/project/board/2858/.

## Coding conventions
The contributors to this tool are strongly encouraged to use the following coding guidelines:

* [MediaWiki's coding conventions for JavaScript](https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript)
* [MediaWiki's manual for Pywikibot/Gerrit developers](https://www.mediawiki.org/wiki/Manual:Pywikibot/Development/Guidelines#Making_a_patch)

# Track your contributions

* You want your contributions to be tracked by this tool? Nicely add your information in the `contributors.json` in the `JSON` format and the tool will automatically run a cron to fetch your contributions.

# Contributors

* [Samuel Guébo](https://github.com/samuelguebo) - Project Lead
* [Derick Alangi](https://github.com/xSavitar) - Contributor

## License
This project is open source and available under the [MIT License](LICENSE).

repository: wikimedia/labs-tools-awmd-stats

repo_name: wikimedia/labs-tools-awmd-stats


text:
---
layout: default
---

# 1993-11-13 - Re: Fractal cryptography

## Header Data

From: Matthew J Ghio<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 34a9e3c9832f0e14e19d0a52b81718fb884f1a55153691ad00e3c6b2f840bf6f

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1993-11-13 00:19:42 UTC

Raw Date: Fri, 12 Nov 93 16:19:42 PST

## Raw message

```
{% raw  %}From: Matthew J Ghio<EMAIL_ADDRESS>Date: Fri, 12 Nov 93 16:19:42 PST
To<EMAIL_ADDRESS>Subject: Re: Fractal cryptography
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

<EMAIL_ADDRESS>(Hal Finney) wrote:

> There have been some discussions on sci.crypt within the past few months
> on nonlinear/chaotic algorithms and their use in cryptography.  Fractal
> cryptography sounds like it might be related.  The problem is that unless
> an algorithm was SPECIFICALLY DESIGNED to prevent an intelligent
> adversary from defeating it, the chances of it being an effective
> cryptosystem are limited.  Just because nonlinear systems produce
> complex-looking results does not mean that these results are unpredictable
> given enough data.

Yeah, but how much data?  Just because something can be solved given
enough data doesn't help me break it if I need 10^37643254 bytes of data
to do it.

> Now, maybe this particular fractal cryptosystem idea will actually work
> well.  I don't know; I haven't seen it.  But the point is that these
> complex types of systems have not provided a good foundation for crypto-
> graphy in the past.

Well, here's a little test.  The following numbers were generated using
a chaotic function:

568139551155097445567935056793172821494566808655678121156334445567812121480659

Do you see a pattern?  What function did I use to generate it?  :)

(Actually, assuming you knew what function I used, you could probably
solve for the key if you had enuf raw output from the PRNG, so it's
probably not completely impossible to solve the above, but that wouldn't
necessarily help you decrypt a file which had been encoded with such a
pad, unless you knew a lot about the format of the file.)

{% endraw %}
```

## Thread

+ Return to [November 1993](/archive/1993/11)

+ Return to<EMAIL_ADDRESS>(Hal Finney)](/authors/hfinney_at_shell_portal_com_hal_finney_)"
+ Return to "[Matthew J Ghio <mg5n+@andrew.cmu.edu>](/authors/matthew_j_ghio_mg5n_at_andrew_cmu_edu_)"
+ Return to<EMAIL_ADDRESS>(CVL staff member Nate Sammons)](/authors/nate_at_vis_colostate_edu_cvl_staff_member_nate_sammons_)"
+ Return to "["Perry E. Metzger" <pmetzger@lehman.com>](/authors/perry_e_metzger_pmetzger_at_lehman_com_)"

+ 1993-11-12 (Thu, 11 Nov 93 23:49:23 PST) - [Fractal cryptography](/archive/1993/11/f2e83fd916da3092cf51f91ad2b70c777d0b6b8ea1c1ce5561eba84b62e73143) -<EMAIL_ADDRESS>(Hal Finney)_
  + 1993-11-13 (Fri, 12 Nov 93 16:19:42 PST) - Re: Fractal cryptography - _Matthew J Ghio<EMAIL_ADDRESS>    + 1993-11-13 (Fri, 12 Nov 93 16:33:45 PST) - [Re: Fractal cryptography](/archive/1993/11/1df7b76b867fd006aa37b16da014f0534db7cb798026a24a899ddca94f6358f6) - _"Perry E. Metzger"<EMAIL_ADDRESS>      + 1993-11-13 (Fri, 12 Nov 93 18:39:42 PST) - [Re: Fractal cryptography](/archive/1993/11/f3bbae4fead8f9ea677afb5cd78cba4731fcb79cc0ae19d1c5a11cbda327538a) - _Matthew J Ghio<EMAIL_ADDRESS>  + 1993-11-18 (Thu, 18 Nov 93 10:31:31 PST) - [Re: Fractal cryptography](/archive/1993/11/1fbac7a3161ca5adf69acac7483dc537e6c32093bc75c4e2c31bbf2fdd36a12b) -<EMAIL_ADDRESS>(CVL staff member Nate Sammons)_


text:
## cd to...

This repo is a fork of `cdto` by Jay Tuley:
https://github.com/jbtule/cdto

I just replaced its toolbar icon as follows for a better look:

<img src="https://raw.github.com/yuanzhoucq/cdto/master/graphics/compare.png" height="278px" width="398px" />

Download [release.zip](https://github.com/yuanzhoucq/cdto/releases/download/2_6_0_n/2_6_0_n.zip)

repository: yuanzhoucq/cdto

repo_name: yuanzhoucq/cdto


text:
Werkzeug
========

Client side components base on Google Closure. Lot of UI component are base on Closure components, or use Closure
components internally.

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

UI components
-------------

* [wzk.ui.Button](wzk/ui/Button.coffee)
  provides basic button functionality with default wzk.ui.ButtonRenderer.

* [wzk.ui.ClearableInput](wzk/ui/ClearableInput.coffee)
  a HTML input field with a clear icon (remove its value)

* [wzk.ui.CloseIcon](wzk/ui/CloseIcon.coffee)
  a component that is rendered as a close/remove icon

* [wzk.ui.Flash](wzk/ui/Flash.coffee)
  renders application messages with fadeout and a closing icon

* [wzk.ui.Input](wzk/ui/Input.coffee)
  a HTML input field a default [wzk.ui.InputRenderer](wzk.ui.InputRenderer)

* [wzk.ui.Link](wzk/ui/Link.coffee)
  a HTML anchor with a default [wzk.ui.LinkRenderer](wzk.ui.LinkRenderer)

* [wzk.ui.TagContainer](wzk/ui/TagContainer.coffee)
  a container of [wzk.ui.Tag](wzk/ui/Tag.coffee) component. Provides adding/removing ability with a remove icon etc.

* [wzk.ui.ac.SelectAutoComplete](wzk/ui/ac/SelectAutoComplete.coffee)
  decorates HTML Select element and builds auto complete from it. Could be decorated with an image. It should be used
  with select-one.

* [wzk.ui.ac.ExtSelectbox](wzk/ui/ac/ExtSelectBox.coffee)
  decorates HTML Select element and builds auto complete from it. Could be decorated with an image. It should be used
  with select-many.

* [wzk.ui.dialog.Dialog](wzk/ui/dialog/Dialog.coffee)
  extended goog.ui.Dialog component that is rendered as Bootstrap dialog.

* [wzk.ui.dialog.Confirm](wzk/ui/dialog/Confirm.coffee)
  a confirm dialog with prepared buttons, rendered as Bootstrap dialog.

* [wzk.ui.form.AjaxForm](wzk/ui/form/AjaxForm.coffee)
  decorates a HTML form and send it via a XHR request.

* [wzk.ui.form.buttons](wzk/ui/form/buttons.coffee) contains functions for preventing multiform submission.

* [wzk.ui.form.Checbox](wzk/ui/form/Checkbox.coffee)
  a HTML checkbox element.

* [wzk.ui.form.MirrorInput](wzk/ui/form/MirrorInput.coffee)
  a component that watches a given HTML input and copies its value to itself by key-up.

* [wzk.ui.form.RemoveButton](wzk/ui/form/RemoteButton.coffee)
  a HTML button that sends data via a XHR request. It takes values from given inputs and adds them as a requests
  parameters.

* [wzk.ui.form.RestForm](wzk/ui/form/RestForm.coffee)
  decorates a HTML form and send it via a XHR request but as a REST request (json data).

* [wzk.ui.form.Select](wzk/ui/form/Select.coffee)
  a HTML select element.

* [wzk.ui.form.Textarea](wzk/ui/form/Textarea.coffee)
  a HTML textarea element.

* [wzk.ui.grid.Grid](wzk/ui/grid/Grid.coffee)
  a HTML table elements that provides paging, filtering, sorting and it uses REST API for as a connection with a server

* [wzk.ui.inlineform.DynamicForm](wzk/ui/inlineform/DynamicForm.coffee)
  decorates Django's inline forms and adds dynamic ability to add or delete an item

* [wzk.ui.tab.Tabs](wzk/ui/tab/Tabs.coffee)
  decorates HTML elements and adds tabs behaviour

Independent components
----------------------

Werkzeug provides an architecture for independent components. Basic idea is calling one function from HTML template
and register components via CSS3 selector. Werkzeug provides [wzk.app.App](wzk/app/App.coffee) class. Every component
is registered via __on__ method.

```coffeescript
app = wzk.app.buildApp()
app.on '.my-class', (element, dom, xhrFactory) ->
  # do stuff
```

Where:

* __element__ is a current HTML element matched by __selector__
* __dom__ is a [wzk.dom.Dom](wzk/dom/Dom.coffee) instance
* __xhrFactory__ is a [wzk.net.XhrFactory](wzk/net/XhrFactory.coffee) instance

Every registered component is loaded asynchronously and independently to others. If the component fails (throws
an exception etc.) occured errors are handled automatically and it does not block other components.

[wzk.net.XhrFactory](wzk/net/XhrFactory.coffee) by default shows a loading message via
[wzk.net.FlashMiddleware](wzk/net/Middleware.coffee) when a XHR is in progress.

The application structure follows:

* start.coffee
* app/base.coffee
* index.html

A whole example could be (start.coffee):

```coffeescript
goog.require 'app'

app.start = (win, msgs) ->

  flash = wzk.ui.buildFlash win.document # decorates or builds Flash component
  app._app.registerStandardComponents flash # registers standard UI components from Werkzeug
  app._app.run win, flash, msgs # runs the application

# ensure the symbol will be visible after compiler renaming
goog.exportSymbol 'app.start', app.start
```

And app/base.coffee file:

```coffeescript
goog.provide 'app'

goog.require 'wzk.app'

app._app = wzk.app.buildApp()
```

index.html

```html
<html>
<head><title>Werkzeug</title></head>
<body>
<script type="text/javascript">
app.start(window, {error: 'Internal error occurred, sorry.', loading: 'Loading...'});
</body>
</html>
```

[wzk.app.App.registerStandardComponents](wzk/app/App.coffee) registers follow components:
* flash messages
* UI grids
* remote button for AJAX buttons
* AJAX forms
* autocomplete components
* dynamic inline forms
* rich tooltips
* Bootstrap navbar-toggle buttons
* snippet loaders
* related object lookup buttons
* more details [wzk.app.App](wzk/app/App.coffee)

Demos
-----

See demos in `wzk-demo/index.html.

Run demos via `grunt --gruntfile wzk-demo/Gruntfile.coffee` and `wzk-demo/index.html` in a browser.

repository: druids/werkzeug

gha_language: CoffeeScript

repo_name: druids/werkzeug


text:
# performing a transplant with patch

![Painting: The first successful kidney transplantation, Brigham Hospital, Harvard University, 1954.](img/first-successful-kidney-transplantation-brigham-1954-babb-1996.jpg)

if you are not able to save the branches as in the
[Multi-Branch Git-Commit-Ectomy Method](branches.md),
you can still save the changes that a particular
set of commits made to a particular file or set of
files using the `patch` utility together with `git`.

## creating patches with git

git has the ability to create patches two ways.

The first way is using `git format-patch`, which
creates one patch per commit. This method preserves
meta-information about the commit and is useful for
transerring changes one commit at a time.

The second way is using `git diff --patch`, which
simply outputs the difference between the two commits,
without any meta-information.

We cover the latter method, since it is more general
and can apply to ranges of commits.

### branch to branch

Suppose you have some changes to the code that live in
a separate branch, and you wish to save those changes
for later (after the git-commit-ectomy is finished).

For example:

```
                   B   master
A  o---o---o---o---o
    \
     \
      o---o---o---o
                  C   feature_branch
```

To create a patch from the feature branch, it is best to
run `git diff` to get the diff between the two branches,
B and C, rather than the diff between the feature branch
and the original commit, A and C.

To produce the patch:

```
git diff --patch feature_branch master > make_feature_branch.patch
```

Note that this will _not_ output diff information for binary files.

To apply the patch, use the `git am` command
(note, of all the git subcommand,s this subcommand
has the _absolute worst name imaginable_):

```
git am < make_feature_branch.patch
```

Alternatively, it is recommended that you keep the patch in
cold storage, and only apply it to the master branch when the
git commit ectomy is finished.


text:
# CHANGELOG

## [v2.3.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v2.3.0) (2017-02-20)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v2.2.1...v2.3.0)

**Implemented enhancements:**

- Split Rakefile tasks into separate tasks [\#95](https://github.com/4-20ma/cookbook-postfix_rpm/pull/95) ([4-20ma](https://github.com/4-20ma))

**Fixed bugs:**

- Fix rainbow lightgray color [\#97](https://github.com/4-20ma/cookbook-postfix_rpm/pull/97) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Update PUBLISH document [\#96](https://github.com/4-20ma/cookbook-postfix_rpm/pull/96) ([4-20ma](https://github.com/4-20ma))
- Update CONTRIBUTING w/labels, uniform formatting [\#94](https://github.com/4-20ma/cookbook-postfix_rpm/pull/94) ([4-20ma](https://github.com/4-20ma))

## [v2.2.1](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v2.2.1) (2017-02-20)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v2.2.0...v2.2.1)

**Merged pull requests:**

- Commit CHANGELOG in rake task publish:tag [\#93](https://github.com/4-20ma/cookbook-postfix_rpm/pull/93) ([4-20ma](https://github.com/4-20ma))

## [v2.2.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v2.2.0) (2017-02-20)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v2.1.1...v2.2.0)

**Implemented enhancements:**

- Add CODE\_OF\_CONDUCT [\#90](https://github.com/4-20ma/cookbook-postfix_rpm/pull/90) ([4-20ma](https://github.com/4-20ma))
- Use github\_changelog\_generator gem [\#88](https://github.com/4-20ma/cookbook-postfix_rpm/pull/88) ([4-20ma](https://github.com/4-20ma))
- Use version gem v1.0.0 [\#87](https://github.com/4-20ma/cookbook-postfix_rpm/pull/87) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Update PUBLISH with config details [\#92](https://github.com/4-20ma/cookbook-postfix_rpm/pull/92) ([4-20ma](https://github.com/4-20ma))
- Unify README markdown formatting [\#91](https://github.com/4-20ma/cookbook-postfix_rpm/pull/91) ([4-20ma](https://github.com/4-20ma))
- Add LICENSE [\#89](https://github.com/4-20ma/cookbook-postfix_rpm/pull/89) ([4-20ma](https://github.com/4-20ma))

## [v2.1.1](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v2.1.1) (2017-02-16)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v2.1.0...v2.1.1)

## [v2.1.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v2.1.0) (2017-02-16)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v2.0.0...v2.1.0)

**Implemented enhancements:**

- Update to postfix-3.1.4 [\#86](https://github.com/4-20ma/cookbook-postfix_rpm/pull/86) ([4-20ma](https://github.com/4-20ma))

## [v2.0.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v2.0.0) (2017-02-15)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v1.2.0...v2.0.0)

**Implemented enhancements:**

- Update to postfix-3.0.8 [\#85](https://github.com/4-20ma/cookbook-postfix_rpm/pull/85) ([4-20ma](https://github.com/4-20ma))

## [v1.2.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v1.2.0) (2017-02-14)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v1.1.0...v1.2.0)

**Implemented enhancements:**

- Update to postfix-2.11.9 [\#84](https://github.com/4-20ma/cookbook-postfix_rpm/pull/84) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Update yum-epel cookbook to v2.1.1 [\#83](https://github.com/4-20ma/cookbook-postfix_rpm/pull/83) ([4-20ma](https://github.com/4-20ma))
- Update TODO [\#82](https://github.com/4-20ma/cookbook-postfix_rpm/pull/82) ([4-20ma](https://github.com/4-20ma))
- Update kitchen-vagrant to v1.0.2 [\#81](https://github.com/4-20ma/cookbook-postfix_rpm/pull/81) ([4-20ma](https://github.com/4-20ma))

## [v1.1.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v1.1.0) (2017-02-14)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v1.0.3...v1.1.0)

**Fixed bugs:**

- Add missing gcc package [\#79](https://github.com/4-20ma/cookbook-postfix_rpm/pull/79) ([4-20ma](https://github.com/4-20ma))
- Revert kitchen-vagrant to v0.21.1 [\#78](https://github.com/4-20ma/cookbook-postfix_rpm/pull/78) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Update postfix source url [\#80](https://github.com/4-20ma/cookbook-postfix_rpm/pull/80) ([4-20ma](https://github.com/4-20ma))
- Update kitchen-vagrant gem to v1.0.1 [\#77](https://github.com/4-20ma/cookbook-postfix_rpm/pull/77) ([4-20ma](https://github.com/4-20ma))
- Update foodcritic gem to v9.0.0 [\#76](https://github.com/4-20ma/cookbook-postfix_rpm/pull/76) ([4-20ma](https://github.com/4-20ma))
- Update rubocop gem to v0.47.1 [\#75](https://github.com/4-20ma/cookbook-postfix_rpm/pull/75) ([4-20ma](https://github.com/4-20ma))
- Replace emeril with stove [\#74](https://github.com/4-20ma/cookbook-postfix_rpm/pull/74) ([4-20ma](https://github.com/4-20ma))
- Add Gemfile.lock to repo [\#73](https://github.com/4-20ma/cookbook-postfix_rpm/pull/73) ([4-20ma](https://github.com/4-20ma))
- Update project to ruby-2.3.1 [\#72](https://github.com/4-20ma/cookbook-postfix_rpm/pull/72) ([4-20ma](https://github.com/4-20ma))
- Update README link layout [\#71](https://github.com/4-20ma/cookbook-postfix_rpm/pull/71) ([4-20ma](https://github.com/4-20ma))
- Update ruby to v2.2.0 [\#69](https://github.com/4-20ma/cookbook-postfix_rpm/pull/69) ([4-20ma](https://github.com/4-20ma))

## [v1.0.3](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v1.0.3) (2014-12-26)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v1.0.2...v1.0.3)

**Fixed bugs:**

- Fix rake knife task for travis-ci [\#65](https://github.com/4-20ma/cookbook-postfix_rpm/pull/65) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Add RELEASE document [\#67](https://github.com/4-20ma/cookbook-postfix_rpm/pull/67) ([4-20ma](https://github.com/4-20ma))
- Update chefspec to v4.2.0 [\#63](https://github.com/4-20ma/cookbook-postfix_rpm/pull/63) ([4-20ma](https://github.com/4-20ma))
- Adjust style of README links [\#61](https://github.com/4-20ma/cookbook-postfix_rpm/pull/61) ([4-20ma](https://github.com/4-20ma))
- Add cookbook version badge to README [\#59](https://github.com/4-20ma/cookbook-postfix_rpm/pull/59) ([4-20ma](https://github.com/4-20ma))
- Update ruby to v2.1.5 [\#57](https://github.com/4-20ma/cookbook-postfix_rpm/pull/57) ([4-20ma](https://github.com/4-20ma))
- Update rubocop v0.28.0 [\#56](https://github.com/4-20ma/cookbook-postfix_rpm/pull/56) ([4-20ma](https://github.com/4-20ma))
- Update chefspec to v4.1.1 [\#55](https://github.com/4-20ma/cookbook-postfix_rpm/pull/55) ([4-20ma](https://github.com/4-20ma))
- Update berkshelf to v3.2.2 [\#54](https://github.com/4-20ma/cookbook-postfix_rpm/pull/54) ([4-20ma](https://github.com/4-20ma))
- Update README to use shields.io badges [\#49](https://github.com/4-20ma/cookbook-postfix_rpm/pull/49) ([4-20ma](https://github.com/4-20ma))
- Update travis-ci to containers, caching [\#47](https://github.com/4-20ma/cookbook-postfix_rpm/pull/47) ([4-20ma](https://github.com/4-20ma))

## [v1.0.2](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v1.0.2) (2014-08-31)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v1.0.1...v1.0.2)

**Fixed bugs:**

- Fix cookbook name in .kitchen.yml [\#45](https://github.com/4-20ma/cookbook-postfix_rpm/pull/45) ([4-20ma](https://github.com/4-20ma))

## [v1.0.1](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v1.0.1) (2014-08-31)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v1.0.0...v1.0.1)

**Implemented enhancements:**

- Add rake changelog task [\#43](https://github.com/4-20ma/cookbook-postfix_rpm/pull/43) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Remove debian/ubuntu support [\#41](https://github.com/4-20ma/cookbook-postfix_rpm/pull/41) ([4-20ma](https://github.com/4-20ma))

## [v1.0.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v1.0.0) (2014-08-31)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v0.3.0...v1.0.0)

**Merged pull requests:**

- Rename cookbook [\#39](https://github.com/4-20ma/cookbook-postfix_rpm/pull/39) ([4-20ma](https://github.com/4-20ma))
- Update emeril gem to v0.8.0 [\#37](https://github.com/4-20ma/cookbook-postfix_rpm/pull/37) ([4-20ma](https://github.com/4-20ma))
- Update to ruby-2.1.2 [\#35](https://github.com/4-20ma/cookbook-postfix_rpm/pull/35) ([4-20ma](https://github.com/4-20ma))
- Update chefspec gem to v4.0.2 [\#33](https://github.com/4-20ma/cookbook-postfix_rpm/pull/33) ([4-20ma](https://github.com/4-20ma))
- Update rubocop gem to v0.24.1 [\#31](https://github.com/4-20ma/cookbook-postfix_rpm/pull/31) ([4-20ma](https://github.com/4-20ma))

## [v0.3.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v0.3.0) (2014-06-21)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v0.2.0...v0.3.0)

**Implemented enhancements:**

- Update postfix to v2.11.1 [\#29](https://github.com/4-20ma/cookbook-postfix_rpm/pull/29) ([4-20ma](https://github.com/4-20ma))

**Merged pull requests:**

- Refactor to facilitate version updates [\#27](https://github.com/4-20ma/cookbook-postfix_rpm/pull/27) ([4-20ma](https://github.com/4-20ma))
- Update rubocop gem to v0.23.0 [\#25](https://github.com/4-20ma/cookbook-postfix_rpm/pull/25) ([4-20ma](https://github.com/4-20ma))
- Update chefspec gem to v4.0.0 [\#23](https://github.com/4-20ma/cookbook-postfix_rpm/pull/23) ([4-20ma](https://github.com/4-20ma))
- Update foodcritic gem to v4.0.0 [\#21](https://github.com/4-20ma/cookbook-postfix_rpm/pull/21) ([4-20ma](https://github.com/4-20ma))

## [v0.2.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v0.2.0) (2014-05-08)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v0.1.1...v0.2.0)

**Merged pull requests:**

- Use bundled kitchen in README [\#19](https://github.com/4-20ma/cookbook-postfix_rpm/pull/19) ([4-20ma](https://github.com/4-20ma))
- Update README products version [\#18](https://github.com/4-20ma/cookbook-postfix_rpm/pull/18) ([4-20ma](https://github.com/4-20ma))
- Refactor integration specs version, rel [\#15](https://github.com/4-20ma/cookbook-postfix_rpm/pull/15) ([4-20ma](https://github.com/4-20ma))
- Adjust release version to 0 [\#13](https://github.com/4-20ma/cookbook-postfix_rpm/pull/13) ([4-20ma](https://github.com/4-20ma))
- Remove -b command switch from init.d script [\#11](https://github.com/4-20ma/cookbook-postfix_rpm/pull/11) ([4-20ma](https://github.com/4-20ma))

## [v0.1.1](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v0.1.1) (2014-05-07)
[Full Changelog](https://github.com/4-20ma/cookbook-postfix_rpm/compare/v0.1.0...v0.1.1)

**Merged pull requests:**

- Convert README recipe list to table [\#8](https://github.com/4-20ma/cookbook-postfix_rpm/pull/8) ([4-20ma](https://github.com/4-20ma))

## [v0.1.0](https://github.com/4-20ma/cookbook-postfix_rpm/tree/v0.1.0) (2014-05-07)
**Implemented enhancements:**

- Add integration specs [\#4](https://github.com/4-20ma/cookbook-postfix_rpm/pull/4) ([jhx](https://github.com/jhx))

**Merged pull requests:**

- Add file tree to README [\#6](https://github.com/4-20ma/cookbook-postfix_rpm/pull/6) ([jhx](https://github.com/jhx))
- Add Berksfile to rubocop checks [\#2](https://github.com/4-20ma/cookbook-postfix_rpm/pull/2) ([jhx](https://github.com/jhx))

\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

gha_language: Ruby


text:
## ~/api/activitystream/<asset-number>

This endpoint provides read-only access to the activity streams for assets and entities within VersionOne, however it is not guaranteed to contain every change to an asset. To get a full accounting of all changes, you must use the asset history.


text:
# Durietzia subexornata (Yoshim.) Yoshim. SPECIES

#### Status
SYNONYM

#### According to
Index Fungorum

#### Published in
Recollecting Edvard August Vainio (São Paulo) 91 (1998)

#### Original name
Lobaria subexornata Yoshim.

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Lecanoromycetes/Peltigerales/Lobariaceae/Lobaria/Lobaria subexornata/ Syn. Durietzia subexornata/README.md

repo_name: mdoering/backbone


text:
---
layout: post
title:  "[Linux] 查看进程占用的物理内存"
date:   2019-08-27
comments: true
categories: Linux
tags: [proc, vmrss]
description:
published: true
---

```
$ cat /proc/[pid]/status| grep Vm
VmPeak:   704480 kB
VmSize:   647140 kB
VmLck:         0 kB
VmPin:         0 kB
VmHWM:     13192 kB
VmRSS:     13192 kB
VmData:   235720 kB
VmStk:       140 kB
VmExe:     10556 kB
VmLib:      2056 kB
VmPTE:       208 kB
VmSwap:        0 kB
```

```
man proc | vim -
/\/proc\/\[pid\]\/status

* VmPeak: Peak virtual memory size.
* VmSize: Virtual memory size.
* VmLck: Locked memory size (see mlock(3)).
* VmPin: Pinned memory size (since Linux 3.2).  These are pages that can't be moved because something needs to directly access physical memory.
* VmHWM: Peak resident set size ("high water mark").
* VmRSS: Resident set size.
* VmData, VmStk, VmExe: Size of data, stack, and text segments.
* VmLib: Shared library code size.
* VmPTE: Page table entries size (since Linux 2.6.10).
* VmPMD: Size of second-level page tables (since Linux 4.0).
* VmSwap: Swapped-out virtual memory size by anonymous private pages; shmem swap usage is not included (since Linux 2.6.34).
```

VmRss 就是实际占用的物理内存大小。

### Resident set size

[Resident set size](https://en.wikipedia.org/wiki/Resident_set_size)

In computing, **resident set size (RSS)** is the portion of memory occupied by a [process](https://en.wikipedia.org/wiki/Process_(computing)) that is held in [main memory](https://en.wikipedia.org/wiki/Computer_data_storage#Primary_storage) (RAM). The rest of the occupied memory exists in the [swap space](https://en.wikipedia.org/wiki/Paging) or [file system](https://en.wikipedia.org/wiki/File_system), either because some parts of the occupied memory were paged out, or because some parts of the executable were never loaded.


text:
:whale:

##  POSS DEMO: Environment LAMP + Overlay Network Docker

### PREREQUISITES
   - docker >= 1.9
   - docker-compose >= 1.5.0
   - swarm >= 1.0

### 1 : You must create a Docker Cluster like described in :
   - https://github.com/herveleclerc/poss-demo-libnetwork

### 2 : Adjust Environment variables in
  - compose/00-setenv.sh
  - compose/*.env if needed

### 3 : docker-compose.yml
  - docker-compose-link.yml : Wordpress will run on a single host with link between container
  - docker-compose-net.yml : Wordpress on a multi host based on overlay network
  - docker-compose-net-vol.yml : Wordpress on  multi host based on overlay network and volume driver

repository: funkytaco/poss-demo-lamp-netw

repo_name: funkytaco/poss-demo-lamp-netw


text:
# scrapyhot

A web spider for hot contents using scrapy framework

# What does it do?
The spider crawl hot keywords from weibo, baidu and sogou, and store them in mysql db

# How to run it?
1. First initialize mysql table using [hots.sql](./hots.sql)
2. Set up DB information in [HotPipelineLocal](./pipelines.py)
3. run the python script [autorunhot.py](./autorunhot.py)

repository: realzzz/scrapyhot

repo_name: realzzz/scrapyhot


text:
# OSWinSubprocess [![Build status](https://ci.appveyor.com/api/projects/status/25lrvnst0ik4b0td?svg=true)](https://ci.appveyor.com/project/demarey/oswinsubprocess)

OSSubprocess is a project that allows the user to spawn Windows System processes from within Pharo language. The main usage of forking external OS processes is to execute OS commands (.e.g dir, copy, etc) as well as arbitrary commands (.e.g C:\Users\me\myscript.bat or pharo.exe) from Pharo. This library uses the [Windows API](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessw) to create process from both 32-bit and 64-bit Pharo images. It also supports Unicode characters.

OSWinSubprocess name is really closed to the name of the [OSSubprocess projet](https://github.com/pharo-contributions/OSSubprocess) that allows to spawn external Unix or OS X processes. OSWinSubprocess and OSSubprocess are complementary and share a part of the API. A mid-term goal would be to unify these projects under the same umbrella.

Important note: As of now, this library does not yet support standard streams (stdin, stdout and stderr). It could be done by setting the appropriate information in the [STARTUPINFO structutre](https://docs.microsoft.com/fr-fr/windows/desktop/api/processthreadsapi/ns-processthreadsapi-_startupinfoa).

## Installation
**Currently, OSWinSubprocess has only be tested on Pharo 7.0**.
From within Pharo, execute the following to install OSWinSubprocess:

```Smalltalk
Metacello new
 	baseline: 'OSWinSubprocess';
 	repository: 'github://pharo-contributions/OSWinSubprocess:master/repository';
	load.
```
## Getting Started
OSWinSubprocess is quite easy to use but depending on the user needs, there are different parts of the API that could be used. We start with a basic example and later we show more complicated scenarios.

```Smalltalk
OSWSWinProcess new
		shellCommand: 'echo'
		arguments: #('ok');
		runAndWait.
```

A subprocess consist of at least a command/binary/program to be executed (in this example `echo`) plus some optional array of arguments.

## Configuration
Running a process is as simple as:
```Smalltalk
OSWSWinProcess new
		command: 'C:\Windows\notepad.exe';
		runAndWait.
```
Notice that this call is blocking. You Pharo image is not responding until you close Notepad.exe.
To overcome this issue, you can just run the process and keep a reference to it to konw if it is still running or just **terminate** it.
```Smalltalk
process := OSWSWinProcess new
		command: 'C:\Windows\notepad.exe';
		run.
...
process terminate.
```
You can call a program and give it **arguments**.
```Smalltalk
OSWSWinProcess new
		command: 'C:\Windows\notepad.exe';
		arguments: #('notepad.exe' 'foo.txt');
		runAndWait.
```
Notepad will ask you to create a new file because it cannot find a file foo.txt. Note that we give the program as a first argument because it is expected by notepad.

Now, create a small file `foo.txt` in `C:\` (with the UI or with a command line with administrator privileges: `echo foo > C:\foo.txt`).
You can now open the file with Notepad:
```Smalltalk
OSWSWinProcess new
		command: 'C:\Windows\notepad.exe';
		arguments: #('notepad.exe' 'C:\foo.txt');
		runAndWait.
```
Another way to achieve the same operation would be to set the **working directory** for the command being called:

You can also configure the directory that will be used as working directory:
```Smalltalk
OSWSWinProcess new
		command: 'C:\Windows\notepad.exe';
		workingDirectory: 'C:\';
		arguments: #('notepad.exe' 'foo.txt');
		runAndWait.
```

OsWinSubprocess offers some facilities to run a command line within a shell:
* `shellCommand:` runs a Windows cmd.exe shell with the provided command, i.e. a string with the command name and arguments.
* `shellCommand:arguments:` runs a Windows cmd.exe shell with the provided command and a collection of arguments.
Warning: Paths with spaces need to be surrounded by double quotes.

## API
OSWSWinProcess instances gives you an high-level API to run and possibly wait for the process termination. It also allows you to get back some information on the process.
* `runAndWait` Runs the process AND waits until the child has exited. Warning: this method freezes the image until the forked process exits.
* `runAndWaitTimeOut: nbMilliSeconds`Runs the process AND waits until the child has exited.
* `runUnwatch` Used to run a process and forget about it
* `run` Runs the process and watch it
* `terminate` Terminates (kill) the process. Will set a non-success exit code (3).
* `isRunning` Answers true if the process is still running, else false.
* `isComplete` Answers true if the process is not running and exitCode is set, else false.
* `isSuccess` Answers true if the process is not running and exitCode is 0 and no error happened, else false.
* `hasTimedOut` Answers true if the process did not terminate before the given timeout, else false.
* `exitCode` Returns the process exit code if set, else nil
* `lastError` Gives you the last error code value. See [Windows API documentation](https://docs.microsoft.com/en-us/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror) for more information

## Known limitations
* no management of standard streams (stdin, stdout and stderr)
* one process watcher per process instance (could have only one process watcher for all processes)

## Authors
* **Keldon Alleyne** - *Initial binding to the Windows API through FFI* - [Keldon Alleyne](https://github.com/avasopht)
* **Christophe Demarey** - *Initial work* - [Christophe Demarey](https://github.com/demarey)

See also the list of [contributors](https://github.com/pharo-contributions/OSWinSubprocess/contributors) who participated in this project.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgments
* OSWinSubprocess took inspiration from the [ProcessWrapper](http://smalltalkhub.com/mc/hernan/ProcessWrapper/main/) project ([source code](http://leves.web.elte.hu/ProcessWrapper)).

repository: pharo-contributions/OSWinSubprocess

gha_language: Smalltalk

repo_name: pharo-contributions/OSWinSubprocess


text:
# BerePi
###### Jeonghoon Kang (jeonghoon.kang at gmail)
Wireless Sensor Network (WSN) using RaspberryPi

You can add wireless sensors to your cyber space simply trying to add BerePi module sensor, to your RaspberryPi.
BerePi project opens software which using BerePi hardware modules.
Please keep track the project.

Simple LED video 01 ( YouTube : https://youtu.be/ygJ3qMiGQvw )

additional nice works :
  1. http://www.raspberrypi-spy.co.uk/
  1. http://www.raspberrypi-spy.co.uk/berryclip-6-led-add-on-board/berryclip-6-led-add-on-board-instructions/

RaspberryPi
  - Raspi init setting :
    - please use, wget http://<IP_ADDRESS>:8070/wordpress/pub/init.sh
    - download and run
  - Raspi2 PinOut:
    - http://www.element14.com/community/docs/DOC-73950/l/raspberry-pi-2-model-b-gpio-40-pin-block-pinout

repository: ipmstyle/BerePi

repo_name: ipmstyle/BerePi


text:
# CredHub Release

CredHub release provides a BOSH Release for [CredHub](https://github.com/cloudfoundry-incubator/credhub).

* [CredHub Tracker](https://www.pivotaltracker.com/n/projects/1977341)

See additional repos for more info:

* [credhub](https://github.com/cloudfoundry-incubator/credhub) :     CredHub server code
* [credhub-cli](https://github.com/cloudfoundry-incubator/credhub-cli) :     command line interface for credhub
* [credhub-acceptance-tests](https://github.com/cloudfoundry-incubator/credhub-acceptance-tests) : integration tests written in Go.

## Deployment documentation

* [Sample Deployment Manifests] (sample-manifests/)
* [Integration with BOSH Director] (docs/bosh-install-with-credhub.md)
* [Configuring a Luna HSM] (docs/configure-luna-hsm.md)
* [Backup and Restore Recommendations] (docs/backup-restore-recommendations.md)
* [Deployment Troubleshooting Guide] (docs/deployment-troubleshooting-guide.md)

## Updating this repo's submodule before a BOSH release

To manually update a local repo, use

```sh
    ./scripts/update
```

 to ensure that the latest code has been pulled into the submodule.

## Run unit tests to exercise the template logic used for application properties

```sh
     ./spec/run_tests.sh
```

repository: drnic/credhub-release

repo_name: drnic/credhub-release


text:
---
layout: post
title: iptables - Configuration (part 2)
date: 2012-04-12
tags:
    - iptables
    - server
---
So now down to the nitty gritty of actually getting rules written for iptables.

To add a rule the commands can range from very simple, to long and complex. The simplest type I use is something like this:

iptables -A INPUT -d <IP_ADDRESS> -p tcp --dport 80 -j ACCEPT

A quick break down of this:

*   iptables -- the program called to run the command
*   -A -- Append the rule, here to the chain INPUT
*   -d -- Destination address the packet is trying to get to
*   -p -- Protocol, here tcp but could be udp.
*   -dport -- Destination port, where is being accessed, here is port 80 for http
*   -j -- Jump, this says what to do if everything in the rule is matched, so if everything is okay, the packet is accepted.

The first tip I learnt was to write these commands into a bash script, as having to re-type them (even with bash_history) would be a laborious task when clearing and reloading rules during the configuration phase.

So I write commands like this for all the ports I want open, and then finish the bash off with:

iptables -A INPUT -d <IP_ADDRESS> -j DROP
iptables -A INPUT -j DROP
iptables -A FORWARD -j DROP

This tells iptables to drop, firstly anything sent to me, then anything trying to pass through my ip. You may wonder why I'm dropping everything, surely that invalidates all the previous rules? Well no, it doesn't as when a rule is matched it immediately jumps to its destination ignoring all else, which is why these must come at the end of the rules.

You may also be wondering, why DROP? I've heard about REJECT. The difference between them is subtle, as both drop the packets. However, reject sends back a response to say 'no access'. So to minimise traffic, it seems best from my point of view to drop anything else.

There are advantages and disadvantages to doing it both ways, but so called stealth isn't really a reason for or against either. A port scan will return closed on reject, and open on accept, but something like filtered on dropped packets, so there isn't much stealthy advantage.

Now, there is a lot more that can be done, the rules I've mentioned so far are truly the most basic, but more on that in the next part. I also mentioned Chains, those will come up again sometime in the future. I also still haven't covered how to actually make this into a working firewall.

More advanced configuration in part 3.

license: ISC


text:
# AutoClicker

AutoCliker is a small application, allowing you to recorde a clicking process and execute it multiples time.

Warning !  For now this application was meant to be use occasionally and many very usefull featurs are missing. Read the Roadmap for more informations.

## Installation

No instalattion needed, you juste have to launch the .exe.

## Roadmap
Ther next modification should be to :
Save process to reuse them later without re-recording them.
Making it possible to remove an action from the list.

## Project status

This project is not my priority for now, I know a lot of features ask to be implemented, feel free to suggest what would be usefull or make pull request, I will likely update it from time to time, as my need changes.
If this project is use by a lot of peaople, i'll reconsidere taking more time for it.

## Contributing

Feel free to contact me or make any pull request.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: StephenAloche/AutoClicker

repo_name: StephenAloche/AutoClicker


text:
### Logging Customizing into JSON

The following logging sample is 'pretty formatted'(multi-line separated && aligned).
```
$ tail -1 /root/nginx/logs/access_json.log

{
    'remote_addr':      '<IP_ADDRESS>',
    'time_local':       '21/Mar/2020:10:46:22 +0000',
    'request':          'GET / HTTP/1.1',
    'status':           '200',
    'body_bytes_sent':  '10',
    'http_user_agent':  'curl/7.54.0',
    'headersIn': {
        'Host':         'localhost:8095',
        'User-Agent':   'curl/7.54.0',
        'Accept':       '*/*'
    },
    'headersOut': {
        'Server':       'nginx/1.17.9',
        'Date':         'Sat, 21 Mar 2020 10:46:22 GMT'
    }
}
```

We can integrate with ELK with `r.subrequest` to `POST` the json formated log entry to Elasticsearch.

Of course, this is only one possible way for logging collecting, while another way is parsing from access.log with filebeat or so.

The following code convert `"` to `'`, because in /root/nginx/logs/acess_json.log, `"` would be urlencoded to `\x22`.

```
    while(logStr.indexOf('"') != -1) {
        logStr = logStr.replace('"', "'");
    }
```


text:
---
title: Changes to Kickstarts for Fedora Atomic 26
author: jberkus
date: 2017-07-17 14:00:00 UTC
published: true
comments: true
tags: atomic, fedora, fedora 26
---

As you know, I'm all about [installing Atomic on bare metal using kickstarts](blog/2016/10/install-with-kickstart/).  And one of the things which has changed with Fedora Atomic 26 is some of the tags and locations you need for your kickstarts.  You'll find that your old kickstarts no longer work.

READMORE

First, your `ostreesetup` line needs to change. Here's my new one:

```
ostreesetup --osname="fedora-atomic" --remote="fedora-atomic-26" --url="file:///ostree/repo" --ref="fedora/26/x86_64/atomic-host" --nogpg
```

Three things changed here.  First, the `remote` is now "fedora-atomic-26" instead of just "fedora-atomic" (`osname` can really be whatever you want). This is a temporary measure until we [merge all of the repos for continuous upgrade](https://fedoramagazine.org/upcoming-fedora-atomic-lifecycle-changes/).  Second, the `url` to install from local media has changed to the simpler "file:///ostree/repo".  Third, the upstream `ref` is now "fedora/26/x86_64/atomic-host", which both removes the reference to a specific container runtime from the edition and makes the urls consistent with other Fedora Editions.

We can also stop disabling cloud-init for Anaconda (bare metal) installs:

```
services --enabled="systemd-timesyncd"
```

Previously, we'd have added `--disabled="cloud-init,cloud-config,cloud-final,cloud-init-local"` in that line, but Anaconda now automatically disables cloud-init since it won't be used for a local install, so we don't have to.

In `%post` where I add in the final configuration for ostree, I also had to change the `url` and `remote`:

```
ostree remote add --if-not-exists --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-primary fedora-atomic-26 https://kojipkgs.fedoraproject.org/atomic/26
```

There's also some other nice improvements there. First, gpg-signing of upgrades and rebases works consistently, so we're adding in gpg checking.  Second, `--if-not-exists` is a nice ostree feature which lets us add remotes idempotently, to better work with Ansible and other config management software.  It's not actually useful here since we're deleting the prior remote, but it's a good idea to get into using it in general (and naming your remotes uniquely).

Below is a completed example kickstart, with all of the changes, which installs Fedora Atomic with OverlayFS to One Big Volume of 60GB and static networking.  Note that in Fedora Atomic 27, One Big Volume will be the default.

```
install
reboot
lang en_US.UTF-8
keyboard us
timezone --utc America/Los_Angeles
selinux --enforcing
zerombr
clearpart --all --initlabel
bootloader --location=mbr --boot-drive=sda
reqpart --add-boot
#part /boot --size=300 --fstype="ext4" --ondisk=sda
part pv.01 --grow --ondisk=sda
volgroup atomicos pv.01
logvol / --size=57000 --fstype="xfs" --name=root --vgname=atomicos
logvol swap --fstype swap --name=lv_swap --vgname=atomicos --size=2048
services --enabled="systemd-timesyncd"
ostreesetup --osname="fedora-atomic" --remote="fedora-atomic-26" --url="file:///ostree/repo" --ref="fedora/26/x86_64/atomic-host" --nogpg

network --device=link --bootproto=static --ip=<IP_ADDRESS> --netmask=<IP_ADDRESS> --hostname=node1.projectatomic.rocks --gateway=<IP_ADDRESS> --nameserver=<IP_ADDRESS>

user --name=atomic --groups=wheel --password=atomic

%post --erroronfail
rm -f /etc/ostree/remotes.d/fedora-atomic.conf
ostree remote add --if-not-exists --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-primary fedora-atomic-26 https://kojipkgs.fedoraproject.org/atomic/26
echo -e "\nSTORAGE_DRIVER='overlay2'\nCONTAINER_ROOT_LV_MOUNT_PATH=''\n" >> /etc/sysconfig/docker-storage-setup
%end
```

repository: mijos/atomic-site

repo_name: mijos/atomic-site


text:
# Training Data for DOREMUS recommender

Scripts for retrieving and managing the training data.

## Datasets

|folder|source |description|
|------|-------|-----------|
|`web-radio`|Radio France| Editorial playlist of RF web radios|
|`spotify`|Spotify|Editorial playlist in Spotify about classical music|

repository: DOREMUS-ANR/recommender

repo_name: DOREMUS-ANR/recommender


text:
CHANGELOG
=========

6.4
---

 * Deprecate Doctrine annotations support in favor of native attributes
 * Deprecate passing an annotation reader to the constructor of `AnnotationLoader`
 * Allow the `Groups` attribute/annotation on classes
 * JsonDecode: Add `json_decode_detailed_errors` option

6.3
---

 * Add `AbstractNormalizer::REQUIRE_ALL_PROPERTIES` context flag to require all properties to be listed in the input instead of falling back to null for nullable ones
 * Add `XmlEncoder::SAVE_OPTIONS` context option
 * Add `BackedEnumNormalizer::ALLOW_INVALID_VALUES` context option
 * Add `UnsupportedFormatException` which is thrown when there is no decoder for a given format
 * Add method `getSupportedTypes(?string $format)` to `NormalizerInterface` and `DenormalizerInterface`
 * Make `ProblemNormalizer` give details about `ValidationFailedException` and `PartialDenormalizationException`
 * Deprecate `CacheableSupportsMethodInterface` in favor of the new `getSupportedTypes(?string $format)` methods
 * The following Normalizer classes will become final in 7.0:
   * `ConstraintViolationListNormalizer`
   * `CustomNormalizer`
   * `DataUriNormalizer`
   * `DateIntervalNormalizer`
   * `DateTimeNormalizer`
   * `DateTimeZoneNormalizer`
   * `GetSetMethodNormalizer`
   * `JsonSerializableNormalizer`
   * `ObjectNormalizer`
   * `PropertyNormalizer`

6.2
---

 * Add support for constructor promoted properties to `Context` attribute
 * Add context option `PropertyNormalizer::NORMALIZE_VISIBILITY` with bitmask flags `PropertyNormalizer::NORMALIZE_PUBLIC`, `PropertyNormalizer::NORMALIZE_PROTECTED`, `PropertyNormalizer::NORMALIZE_PRIVATE`
 * Add method `withNormalizeVisibility` to `PropertyNormalizerContextBuilder`
 * Deprecate calling `AttributeMetadata::setSerializedName()`, `ClassMetadata::setClassDiscriminatorMapping()` without arguments
 * Change the signature of `AttributeMetadataInterface::setSerializedName()` to `setSerializedName(?string)`
 * Change the signature of `ClassMetadataInterface::setClassDiscriminatorMapping()` to `setClassDiscriminatorMapping(?ClassDiscriminatorMapping)`
 * Add option YamlEncoder::YAML_INDENTATION to YamlEncoder constructor options to configure additional indentation for each level of nesting. This allows configuring indentation in the service configuration.
 * Add `SerializedPath` annotation to flatten nested attributes

6.1
---

 * Add `TraceableSerializer`, `TraceableNormalizer`, `TraceableEncoder` and `SerializerDataCollector` to integrate with the web profiler
 * Add the ability to create contexts using context builders
 * Set `Context` annotation as not final
 * Deprecate `ContextAwareNormalizerInterface`, use `NormalizerInterface` instead
 * Deprecate `ContextAwareDenormalizerInterface`, use `DenormalizerInterface` instead
 * Deprecate supporting denormalization for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
 * Deprecate denormalizing to an abstract class in `UidNormalizer`
 * Add support for `can*()` methods to `ObjectNormalizer`

6.0
---

 * Remove `ArrayDenormalizer::setSerializer()`, call `setDenormalizer()` instead
 * Remove the ability to create instances of the annotation classes by passing an array of parameters, use named arguments instead

5.4
---

 * Add support of PHP backed enumerations
 * Add support for serializing empty array as object
 * Return empty collections as `ArrayObject` from `Serializer::normalize()` when `PRESERVE_EMPTY_OBJECTS` is set
 * Add support for collecting type errors during denormalization
 * Add missing arguments in `MissingConstructorArgumentsException`

5.3
---

 * Add the ability to provide (de)normalization context using metadata (e.g. `@Symfony\Component\Serializer\Annotation\Context`)
 * Deprecate `ArrayDenormalizer::setSerializer()`, call `setDenormalizer()` instead
 * Add normalization formats to `UidNormalizer`
 * Add `CsvEncoder::END_OF_LINE` context option
 * Deprecate creating instances of the annotation classes by passing an array of parameters, use named arguments instead

5.2.0
-----

 * added `CompiledClassMetadataFactory` and `ClassMetadataFactoryCompiler` for faster metadata loading.
 * added `UidNormalizer`
 * added `FormErrorNormalizer`
 * added `MimeMessageNormalizer`
 * serializer mapping can be configured using php attributes

5.1.0
-----

 * added support for scalar values denormalization
 * added support for `\stdClass` to `ObjectNormalizer`
 * added the ability to ignore properties using metadata (e.g. `@Symfony\Component\Serializer\Annotation\Ignore`)
 * added an option to serialize constraint violations payloads (e.g. severity)

5.0.0
-----

 * throw an exception when creating a `Serializer` with normalizers which neither implement `NormalizerInterface` nor `DenormalizerInterface`
 * throw an exception when creating a `Serializer` with encoders which neither implement `EncoderInterface` nor `DecoderInterface`
 * changed the default value of the `CsvEncoder` "as_collection" option to `true`
 * removed `AbstractNormalizer::$circularReferenceLimit`, `AbstractNormalizer::$circularReferenceHandler`,
   `AbstractNormalizer::$callbacks`, `AbstractNormalizer::$ignoredAttributes`,
   `AbstractNormalizer::$camelizedAttributes`, `AbstractNormalizer::setCircularReferenceLimit()`,
   `AbstractNormalizer::setCircularReferenceHandler()`, `AbstractNormalizer::setCallbacks()` and
   `AbstractNormalizer::setIgnoredAttributes()`, use the default context instead.
 * removed `AbstractObjectNormalizer::$maxDepthHandler` and `AbstractObjectNormalizer::setMaxDepthHandler()`,
   use the default context instead.
 * removed `XmlEncoder::setRootNodeName()` & `XmlEncoder::getRootNodeName()`, use the default context instead.
 * removed individual encoders/normalizers options as constructor arguments.
 * removed support for instantiating a `DataUriNormalizer` with a default MIME type guesser when the `symfony/mime` component isn't installed.
 * removed the `XmlEncoder::TYPE_CASE_ATTRIBUTES` constant. Use `XmlEncoder::TYPE_CAST_ATTRIBUTES` instead.

4.4.0
-----

 * deprecated the `XmlEncoder::TYPE_CASE_ATTRIBUTES` constant, use `XmlEncoder::TYPE_CAST_ATTRIBUTES` instead
 * added option to output a UTF-8 BOM in CSV encoder via `CsvEncoder::OUTPUT_UTF8_BOM_KEY` context option
 * added `ProblemNormalizer` to normalize errors according to the API Problem spec (RFC 7807)

4.3.0
-----

 * added the list of constraint violations' parameters in `ConstraintViolationListNormalizer`
 * added support for serializing `DateTimeZone` objects
 * added a `deep_object_to_populate` context option to recursive denormalize on `object_to_populate` object.

4.2.0
-----

 * using the default context is the new recommended way to configure normalizers and encoders
 * added a `skip_null_values` context option to not serialize properties with a `null` values
 * `AbstractNormalizer::handleCircularReference` is now final and receives
   two optional extra arguments: the format and the context
 * added support for XML comment encoding (encoding `['#comment' => ' foo ']` results `<!-- foo -->`)
 * added optional `int[] $encoderIgnoredNodeTypes` argument to `XmlEncoder::__construct`
   to configure node types to be ignored during encoding
 * added `AdvancedNameConverterInterface` to access the class,
   the format and the context in a name converter
 * the `AbstractNormalizer::handleCircularReference()` method will have two new `$format`
   and `$context` arguments in version 5.0, not defining them is deprecated
 * deprecated creating a `Serializer` with normalizers which do not implement
   either `NormalizerInterface` or `DenormalizerInterface`
 * deprecated creating a `Serializer` with normalizers which do not implement
   either `NormalizerInterface` or `DenormalizerInterface`
 * deprecated creating a `Serializer` with encoders which do not implement
   either `EncoderInterface` or `DecoderInterface`
 * added the optional `$objectClassResolver` argument in `AbstractObjectNormalizer`
   and `ObjectNormalizer` constructor
 * added `MetadataAwareNameConverter` to configure the serialized name of properties through metadata
 * `YamlEncoder` now handles the `.yml` extension too
 * `AbstractNormalizer::$circularReferenceLimit`, `AbstractNormalizer::$circularReferenceHandler`,
   `AbstractNormalizer::$callbacks`, `AbstractNormalizer::$ignoredAttributes`,
   `AbstractNormalizer::$camelizedAttributes`, `AbstractNormalizer::setCircularReferenceLimit()`,
   `AbstractNormalizer::setCircularReferenceHandler()`, `AbstractNormalizer::setCallbacks()` and
   `AbstractNormalizer::setIgnoredAttributes()` are deprecated, use the default context instead.
 * `AbstractObjectNormalizer::$maxDepthHandler` and `AbstractObjectNormalizer::setMaxDepthHandler()`
   are deprecated, use the default context instead.
 * passing configuration options directly to the constructor of `CsvEncoder`, `JsonDecode` and
   `XmlEncoder` is deprecated since Symfony 4.2, use the default context instead.

4.1.0
-----

 * added `CacheableSupportsMethodInterface` for normalizers and denormalizers that use
   only the type and the format in their `supports*()` methods
 * added `MissingConstructorArgumentsException` new exception for deserialization failure
   of objects that needs data insertion in constructor
 * added an optional `default_constructor_arguments` option of context to specify a default data in
   case the object is not initializable by its constructor because of data missing
 * added optional `bool $escapeFormulas = false` argument to `CsvEncoder::__construct`
 * added `AbstractObjectNormalizer::setMaxDepthHandler` to set a handler to call when the configured
   maximum depth is reached
 * added optional `int[] $ignoredNodeTypes` argument to `XmlEncoder::__construct`. XML decoding now
   ignores comment node types by default.
 * added `ConstraintViolationListNormalizer`

4.0.0
-----

 * removed the `SerializerAwareEncoder` and `SerializerAwareNormalizer` classes,
   use the `SerializerAwareTrait` instead
 * removed the `Serializer::$normalizerCache` and `Serializer::$denormalizerCache`
   properties
 * added an optional `string $format = null` argument to `AbstractNormalizer::instantiateObject`
 * added an optional `array $context = []` to `Serializer::supportsNormalization`, `Serializer::supportsDenormalization`,
   `Serializer::supportsEncoding` and `Serializer::supportsDecoding`

3.4.0
-----

 * added `AbstractObjectNormalizer::DISABLE_TYPE_ENFORCEMENT` context option
   to disable throwing an `UnexpectedValueException` on a type mismatch
 * added support for serializing `DateInterval` objects
 * added getter for extra attributes in `ExtraAttributesException`
 * improved `CsvEncoder` to handle variable nested structures
 * CSV headers can be passed to the `CsvEncoder` via the `csv_headers` serialization context variable
 * added `$context` when checking for encoding, decoding and normalizing in `Serializer`

3.3.0
-----

 * added `SerializerPass`

3.1.0
-----

 * added support for serializing objects that implement `JsonSerializable`
 * added the `DenormalizerAwareTrait` and `NormalizerAwareTrait` traits to
   support normalizer/denormalizer awareness
 * added the `DenormalizerAwareInterface` and `NormalizerAwareInterface`
   interfaces to support normalizer/denormalizer awareness
 * added a PSR-6 compatible adapter for caching metadata
 * added a `MaxDepth` option to limit the depth of the object graph when
   serializing objects
 * added support for serializing `SplFileInfo` objects
 * added support for serializing objects that implement `DateTimeInterface`
 * added `AbstractObjectNormalizer` as a base class for normalizers that deal
   with objects
 * added support to relation deserialization

2.7.0
-----

 * added support for serialization and deserialization groups including
   annotations, XML and YAML mapping.
 * added `AbstractNormalizer` to factorise code and ease normalizers development
 * added circular references handling for `PropertyNormalizer`
 * added support for a context key called `object_to_populate` in `AbstractNormalizer`
   to reuse existing objects in the deserialization process
 * added `NameConverterInterface` and `CamelCaseToSnakeCaseNameConverter`
 * [DEPRECATION] `GetSetMethodNormalizer::setCamelizedAttributes()` and
   `PropertyNormalizer::setCamelizedAttributes()` are replaced by
   `CamelCaseToSnakeCaseNameConverter`
 * [DEPRECATION] the `Exception` interface has been renamed to `ExceptionInterface`
 * added `ObjectNormalizer` leveraging the `PropertyAccess` component to normalize
   objects containing both properties and getters / setters / issers / hassers methods.
 * added `xml_type_cast_attributes` context option for allowing users to opt-out of typecasting
   xml attributes.

2.6.0
-----

 * added a new serializer: `PropertyNormalizer`. Like `GetSetMethodNormalizer`,
   this normalizer will map an object's properties to an array.
 * added circular references handling for `GetSetMethodNormalizer`

2.5.0
-----

 * added support for `is.*` getters in `GetSetMethodNormalizer`

2.4.0
-----

 * added `$context` support for XMLEncoder.
 * [DEPRECATION] JsonEncode and JsonDecode where modified to throw
   an exception if error found. No need for `get*Error()` functions

2.3.0
-----

 * added `GetSetMethodNormalizer::setCamelizedAttributes` to allow calling
   camel cased methods for underscored properties

2.2.0
-----

 * [BC BREAK] All Serializer, Normalizer and Encoder interfaces have been
   modified to include an optional `$context` array parameter.
 * The XML Root name can now be configured with the `xml_root_name`
   parameter in the context option to the `XmlEncoder`.
 * Options to `json_encode` and `json_decode` can be passed through
   the context options of `JsonEncode` and `JsonDecode` encoder/decoders.

2.1.0
-----

 * added DecoderInterface::supportsDecoding(),
   EncoderInterface::supportsEncoding()
 * removed NormalizableInterface::denormalize(),
   NormalizerInterface::denormalize(),
   NormalizerInterface::supportsDenormalization()
 * removed normalize() denormalize() encode() decode() supportsSerialization()
   supportsDeserialization() supportsEncoding() supportsDecoding()
   getEncoder() from SerializerInterface
 * Serializer now implements NormalizerInterface, DenormalizerInterface,
   EncoderInterface, DecoderInterface in addition to SerializerInterface
 * added DenormalizableInterface and DenormalizerInterface
 * [BC BREAK] changed `GetSetMethodNormalizer`'s key names from all lowercased
   to camelCased (e.g. `mypropertyvalue` to `myPropertyValue`)
 * [BC BREAK] convert the `item` XML tag to an array

    ``` xml
    <?xml version="1.0"?>
    <response>
        <item><title><![CDATA[title1]]></title></item><item><title><![CDATA[title2]]></title></item>
    </response>
    ```

    Before:

        Array()

    After:

        Array(
            [item] => Array(
                [0] => Array(
                    [title] => title1
                )
                [1] => Array(
                    [title] => title2
                )
            )
        )

repository: symfony/symfony

gha_language: PHP

repo_name: symfony/symfony


text:
#Readme

Goblet was created by Matthew Weber to be a easy-to-use template for creating a case studies.
It is licensed under the MIT license.

<https://github.com/conjurehq>

repository: allkindsoffood/starbucks

repo_name: allkindsoffood/starbucks


text:
# Code-401-Xamarin

## My Fitst Xamarin App
Lab 41: Intro to Xamarin

*Author: Kyungrae Kim*

----

## Description
This lab is to explore the world of mobile development by building out your own basic xamarin web app.

To get Xamarin proof-of-concept working, I followed the Microsoft's Xamarin exercise which builds an app that will let the user type text into an input field, and will translate that text to numeric digits. It uses the letters that show up on a telephone keypad as the basis for translation.

For example, the letters "cab" translates to "222" because the digit "2" has all three letters "abc".

---

### Getting Started
Clone this repository to your local machine.

```
$ git clone https://github.com/jeremymaya/Code-401-Xamarin.git
```

### To run the program from Visual Studio:
Select ```File``` -> ```Open``` -> ```Code-401-XamarinLab``

Next navigate to the location you cloned the Repository.

Double click on the ```XamarinLab``` directory.

Then select and open ```XamarinLab.sln```

---

### Visuals
#### Home
![home](https://github.com/jeremymaya/Code-401-Xamarin/blob/master/assets/home.png)
#### Translated
![translated](https://github.com/jeremymaya/Code-401-Xamarin/blob/master/assets/translated.png)
#### Call
![call](https://github.com/jeremymaya/Code-401-Xamarin/blob/master/assets/call.png)
#### Call Confirmation
![call-confirm](https://github.com/jeremymaya/Code-401-Xamarin/blob/master/assets/call-confirm.png)

---

### Credits
[Microsoft - Create a phone number translator app](https://docs.microsoft.com/en-us/learn/modules/create-a-mobile-app-with-xamarin-forms/5-exercise-create-phone-number-translator-app)

---

### Change Log
1.0: *Lab 41 Completed* - 10 Dec 2019 11:30 AM
1.0: *Lab 41 Started* - 10 Dec 2019 9:30 AM

gha_language: C#


text:
---
layout: post
title: Tweaking axis-labels of barplots (ggplot2::geom_bar)
---
I'd come across a question on [StackOverflow](http://stackoverflow.com/questions/43694458/barplot-grouping-x-axis-labels-without-manipulating-accompanying-bars/43701167#43701167), which requested to improve the following barplot by grouping 5 states together as an x-axis label e.g. `"Alaska - California", "Colorado - Florida", ... (and so on)`.

![Files in working directory](/images/20170501/envt-1.png)

The barplot depicts the percentage of nationawide homicide occurences against States. Data source: [Homicide Reports, 1980-2014](https://www.kaggle.com/murderaccountability/homicide-reports)

Even though the request of grouping states sounded quite easy, to come out with a generic solution applicable to any barplot was quite challenging.

The solution I come out with includes plotting based on a new grouping variable to group five states with abbreviate labels, e.g.\``"Alaska - California"`.

(i) Housekeeping stuff:

``` r
# packages:
lapply(c("plyr", "dplyr", "tidyr", "ggplot2"), require, character.only = T)

# input data
file <- "https://raw.githubusercontent.com/minerva79/woodpecker/master/data/homicide_by_state.txt"
df <- read.table(file, sep="\t", header=T)
```

(ii) Determine the first and last element for each grouping of 5 states:

``` r
hd <- seq(1, nrow(df), by=5) %>% ceiling # first element
hd <- hd[-length(hd)] # remove last number, which represented nrow(freq)

td <- c((hd-1)[-1], nrow(df)) # last element
```

(iii) Create two functions to create the custom label for each group based on first and last element of each group (e.g. Alabm - Clfrn); and to find length of each group

``` r
abbrevFn <- function(head, tail, state, ...) paste(abbreviate(state[c(head,tail)], ...), collapse = " - ")
intervalFn <- function(head, tail) diff(c(head, tail)) + 1
```

(iv) Create new grouping by replicating custom labels for each group:

``` r
labels <- mapply(function(x,y) abbrevFn(x,y, state=df$State, min=15), hd, td)
labels.n <- mapply(function(x, y) intervalFn(x, y), hd, td)
df$group <- mapply(function(x,y) rep(x,y), labels, labels.n) %>% unlist

head(df)
```

    ##        State  Freq        prop                group
    ## 1    Alabama 11376 0.017818042 Alabama - California
    ## 2     Alaska  1617 0.002532681 Alabama - California
    ## 3    Arizona 12871 0.020159636 Alabama - California
    ## 4   Arkansas  6947 0.010880972 Alabama - California
    ## 5 California 99783 0.156288472 Alabama - California
    ## 6   Colorado  6593 0.010326507   Colorado - Florida

(v) Plot barplot based on the customised group, and dodge position by state:

``` r
xint <- c((1:length(hd) - .5), (1:length(hd) + .5)) %>% unique # set xintercept values for demarcate the groups

ggplot(df, aes(group, prop, fill=State)) +
    geom_bar(stat="identity", position="dodge", width=1) +
    scale_fill_manual(values=rep("gray80", nrow(df)))
```

![Files in working directory](/images/20170501/rplot-1.png)

The labels in this case make the axis looks tremendously messy and the legend is taking out too much space. One quick fix is to change the label length, with the min.length argument in `abbrevFn`, and plot without legend

``` r
labels <- mapply(function(x,y) abbrevFn(x,y, state=df$State, min=3), hd, td)
labels.n <- mapply(function(x, y) intervalFn(x, y), hd, td)
df$group <- mapply(function(x,y) rep(x,y), labels, labels.n) %>% unlist

(p <- ggplot(df, aes(group, prop, fill=State)) +
       geom_bar(stat="identity", position="dodge", width=1) +
       scale_fill_manual(values=rep("gray80", nrow(df))) +
       guides(fill=FALSE))
```

![Files in working directory](/images/20170501/rplot2-1.png)

Let's tidy this plot with appropriate labels, showing percentage instead of proportion and some guidelines for each group

``` r
p + ylab("Accounting % of Nation-wide Homicides") +
  xlab("States") +
  scale_y_continuous(labels=scales::percent) +
  guides(fill=FALSE) +
  theme_bw() +
  geom_vline(xintercept=xint, linetype="dotted")
```

![Files in working directory](/images/20170501/rplot3-1.png)

### Another example:

So let's apply similar coding on another data-set `trees`. The following is a dual-axis plot of `Tree ID` against `Girth` and `Height`:

``` r
dat <- trees %>% mutate(id = rownames(.))
ggplot(dat, aes(x=as.numeric(id), y=Girth)) +
  geom_bar(stat="identity") +
  geom_line(aes(y=Height/6), colour="red") +
  scale_y_continuous(sec.axis = sec_axis(~.*6, name = "Height"))
```

![Files in working directory](/images/20170501/treeplot-1.png)

Instead of dividing up the groups manually into vectors of first and last element, the grouping can be done in a list using `split` function as such:

``` r
grouping <- dat$id %>% split(., ceiling(seq_along(.)/8))

labels <- lapply(grouping, function(ii) mapply(function(x,y) paste(x, y, sep=" - "), ii[1], ii[length(ii)]))
labels.n <- lapply(grouping, length)

dat$gp <- mapply(function(x,y) rep(x,y), labels, labels.n) %>% unlist
dat$gp <- factor(dat$gp, levels=unlist(labels))
```

Plotting out the barplot element is similar to the previous example:

``` r
p <- ggplot() +
  geom_bar(data=dat, aes(x=gp, y=Girth, fill=id), stat="identity", position="dodge", width=1) +
  scale_fill_manual(values=rep("gray80", nrow(dat))) +
  xlab("Tree ID") +
  guides(fill=FALSE)

xint <- seq(.5, 4.5, 1)
(p <- p + geom_vline(xintercept=xint, linetype="dotted"))
```

![Files in working directory](/images/20170501/tree-1.png)

Plotting the line as a second axis in this case require a bit of manual tweaking:

``` r
dat$nx <- (seq(.5, 4.5, by=.125) + .125/2) %>% .[c(-1, -length(.))]

p +  geom_line(data=dat, aes(x=nx, y=Height/6), colour="red") +
  geom_point(data=dat, aes(x=nx, y=Height/6), colour="red") +
  scale_y_continuous(sec.axis = sec_axis(~.*6, name = "Height")) +
  theme_bw()
```

![Files in working directory](/images/20170501/lines-1.png)


text:
# c-bootstrap

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c18ee2ef41274532a7baa1969fe843b7)](https://app.codacy.com/app/rdtscp/c-bootstrap?utm_source=github.com&utm_medium=referral&utm_content=rdtscp/c-bootstrap&utm_campaign=Badge_Grade_Dashboard)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Frdtscp%2Fc-bootstrap%2Fbadge&style=flat)](https://actions-badge.atrox.dev/rdtscp/c-bootstrap/goto)
[![codecov](https://codecov.io/gh/rdtscp/c-bootstrap/branch/master/graph/badge.svg)](https://codecov.io/gh/rdtscp/c-bootstrap)
![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)

-   Bootstrapping a simple C/C++ based compiler written in C++.
-   The compiler will intially be used to build simple C programs, and then extend the grammar enough so that it is able to compile itself.

## Requirements

-   cmake
-   For Binary CodeGen:
    -   nasm
    -   macOS with Intel x64 CPU

## Usage

### Building

Building/Running/Testing in a unix environment:

# Build Code

    git clone https://github.com/rdtscp/c-bootstrap.git
    cd ./c-bootstrap/
    mkdir build ; cd build
    cmake -DCMAKE_BUILD_TYPE=Debug ../
    make -j && ctest --output-on-failure

### Dot Graph Output

Building/Running/Testing in a unix environment:

    # Run Examples below
    ./acc ../test/tests/Test_Parser/BinOp/test.cpp test.dot --graph
    ./acc ../test/tests/Test_Parser/BinOp/test.cpp test_opt.dot --graph --opt

Then paste the contents of test.dot and test_opt.dot into a dot-graph generator (I recommend <http://www.webgraphviz.com/>).
You can then see a graphical representation of the input program.

### Binary Generation

Building/Running/Testing on macOS:

    # Run Examples below
    ./acc ../test/tests/main.cpp test.out
    ./test.out

* * *

## Pre-Processor Grammar

    #define
    #else
    #endif
    #ifdef
    #ifndef
    #include

## Mini-C/C++ Grammar

Progressively changing to adopt new features of the language(s).

    program      -> (include)* (decl)* EOF

    decl         -> classdecl ";"
                 -> vardecl ";"
                 -> arrvardecl ";"
                 -> fundecl ";"
                 -> fundef
                 -> typedecl ";"
                 -> enumdecl ";"

    classdecl    -> "class" IDENT "{" (decl | accessmod )* "}" ";"

    accessmod    -> "public:" | "private:" | "protected:"

    vardecl      -> type IDENT

    arrvardecl   -> vardecl "[" INT_LITERAL "]"

    fundecl      -> type (IDENT | opoverloads) "(" params ")"

    opoverloads  -> "operator="
                  | "operator=="
                  | "operator!="

    fundef       -> type IDENT "(" params ")" block

    typedecl     -> "typedef" type IDENT

    enumdecl     -> "enum" "{" statelist "}"

    statelist    -> (IDENT ["=" INT_LITERAL] ",")* IDENT ["=" INT_LITERAL]

    type         -> ("int" | "char" | "void", "unsigned int", "bool" | classtype ) (ASTERIX)*

    classtype    -> IDENT

    params       -> [ type IDENT ("," type IDENT)* ]

    stmt         -> vardecl ";"
                  | block
                  | "do" stmt "while" "(" exp ")" ";"
                  | "while" "(" exp ")" stmt
                  | "if" "(" exp ")" stmt ["else" stmt]
                  | "return" [exp] ";"
                  | "delete" IDENT ";"
                  | "delete[]" IDENT ";"
                  | "throw" STRING_LITERAL ";"
                  | expr "=" expr ";"
                  | expr ";"

    block        -> "{" stmt* "}"

    expr         -> boolExpr ( "?" boolExpr ":" boolExpr )*
                  | boolExpr "+=" boolExpr

    boolExpr     -> equalExpr
                  | equalExpr "||" equalExpr ( ( "||" || "&&" ) equalExpr )*
                  | equalExpr "&&" equalExpr ( ( "||" || "&&" ) equalExpr )*

    equalExpr    -> compExpr
                  | compExpr "!=" compExpr
                  | compExpr "==" compExpr

    compExpr     -> addExpr
                  | addExpr "<" addExpr
                  | addExpr ">" addExpr
                  | addExpr "<=" addExpr
                  | addExpr ">=" addExpr

    addExpr      -> mulExpr
                  | mulExpr "+" mulExpr ( ( "+" || "-" ) mulExpr )*
                  | mulExpr "-" mulExpr ( ( "+" || "-" ) mulExpr )*

    mulExpr      -> unaryExpr
                  | unaryExpr "*" unaryExpr ( ( "*" || "/" || "%" ) unaryExpr )*
                  | unaryExpr "/" unaryExpr ( ( "_" || "/" || "%" ) unaryExpr )*
                  | unaryExpr "%" unaryExpr ( ( "_" || "/" || "%" ) unaryExpr )*

    unaryExpr    -> "sizeof" "(" type ")"
                  | "*" objExpr
                  | "(" type ")"
                  | "-" objExpr
                  | "++" objExpr
                  | "new" type [ "(" litExpr ("," litExpr)* ")" ] ";"
                  | "&" objExpr
                  | "!" objExpr
                  | objExpr "[" expr "]
                  | objExpr

    objExpr      -> funCall (objExprOp)*
                  | IDENT (objExprOp)*
                  | "this" (objExprOp)*
                  | litExpr

    objExprOp    -> "." funCall
                  | "->" funCall
                  | "." objExpr
                  | "->" objExpr
                  | "[" objExpr "]"

    funCall      -> IDENT "(" litExpr ("," litExpr)\* ")"
                  | IDENT "(" litExpr ")"
                  | IDENT "(" ")"

    litExpr      -> INT_LITERAL
                  | CHAR_LITERAL
                  | STRING_LITERAL
                  | "true"
                  | "false"
                  | "(" expr ")"
                  | expr

* * *

### macOS Notes

    # Building Assembly:
    acc main.cpp
    # Building Objects
    nasm -f macho64 x86.s
    # Link Objects
    ld -no_pie -macosx_version_min 10.15 -lSystem -o x86 x86.o

repository: rdtscp/c-bootstrap

repo_name: rdtscp/c-bootstrap