text:
# Caption And Subtitle Converter for PHP

Convert and edit subtitles and captions.

## Supported formats

| Format                                                                                | Extension |
|-------------------------------------------------------------------------------------------------------|-----------|
| [SubRip](https://en.wikipedia.org/wiki/SubRip#SubRip_text_file_format)                                | .srt      |
| [WebVTT](https://en.wikipedia.org/wiki/WebVTT)                                                        | .vtt      |
| [Youtube Subtitles](https://webdev-il.blogspot.lt/2010/01/sbv-file-format-for-youtube-subtitles.html) | .sbv      |

## Installation

```
composer require saeven/subtitles
```

## Fork Notes

This package was forked from `mantas-done/subtitles` (thank you) to become more opinionated, to implement strict types and new interfaces, and to implement proper PSR-4 loading.
What's more, this version of that package removes all ability to manipulate files directly or to attempt to infer the existence of converters by scanning the filesystem
with file_exists and so forth. It also resorts to pattern matching in cases where the original implementation would split strings. Lastly, it adds Carbon to perform
time conversions.

## Usage

Convert .srt content to .vtt:

```php
// add namespace
use \Circlical\Subtitles\Subtitles;

(new Subtitles())->load($srtContent, 'srt')->content('vtt');
```

Manually create VTT

```php
$subtitles = new Subtitles();
$subtitles->add(0, 5, 'This text is shown in the beggining of video for 5 seconds');
file_put_contents( './foo', $subtitles->content('subtitles.vtt'));
```

Load subtitles from string

```php
$string = "
1
00:02:17,440 --> 00:02:20,375
Senator, we're making our final approach
";

$subtitles = Subtitles::load($string, 'srt');
```

Get file content without saving to file

```php
echo $subtitles->content('vtt');
```

Add subtitles

```php
$subtitles->add(0, 5, 'some text'); // from 0, till 5 seconds

// Add multiline text
$subtitles->add(0, 5, [
    'first line',
    'second line',
]);
````

Remove subtitles

```php
$subtitles->remove(0, 5); // from 0, till 5 seconds
```

Add 1 second to all subtitles

```php
$subtitles->shiftTime(1);
```

Subtract 0.5 second

```php
$subtitles->shiftTime(-0.5);
```

Add 5 second to subtitles starting from 1 minute till 2 mintes

```php
$subtitles->shiftTime(5, 60, 120);
```

Example: shift time gradually by 2 seconds over 1 hour video. At the beginning of the video don't change time, in the middle shift time by 1 second. By the end of video, shift time by 2 seconds.

```php
$subtitles->shiftTimeGradually(2, 0, 3600);
```

### "Internal Format"

"Internal Format" is just a PHP array. It is used internally in library to be able to convert between different formats.

```
Array
(
    [0] => Array
        (
            [start] => 137.44
            [end] => 140.375
            [lines] => Array
                (
                    [0] => Senator, we're making
                    [1] => our final approach into Coruscant.
                )
        )
    [1] => Array
        (
            [start] => 140.476
            [end] => 142.501
            [lines] => Array
                (
                    [0] => Very good, Lieutenant.
                )
        )
)
```

```
[start] - when to start showing text (float - seconds)
[end] - when to stop showing text (float -seconds)
[lines] - one or more text lines (array)
```

## Running Tests

```
./vendor/bin/phpunit
```

## Contribution

Not all original converters from the fork have been corrected. Feel free to convert one from the 'todo' folder and open a PR!

## Report Bugs

If some file is not working with the library, please create and issue and attach the file.

repository: Saeven/subtitles

gha_language: PHP

repo_name: Saeven/subtitles


text:
# Overview

The<EMAIL_ADDRESS>module handles the the [Wavefront OBJ format](https://en.wikipedia.org/wiki/Wavefront_.obj_file), a simple ASCII format that defines 3D geometries as vertices, normals and faces.

## Installation

```bash
npm install @loaders.gl/obj
npm install @loaders.gl/core
```

## Attribution

OBJLoader is a port of [three.js](https://github.com/mrdoob/three.js)'s OBJLoader under MIT License.

branch_name: refs/heads/master

extension: md

gha_license_id: NOASSERTION

license_type: permissive


text:
---
title: default Function
keywords: query language reference
tags: [reference page]
sidebar: doc_sidebar
permalink: ts_default.html
summary: Reference to the default() function
---
## Summary
```
default([<timeWindow>,] [<delayTime>,] <defaultValue>, <tsExpression> [.orElse<defaultIfNoData>])
```

Fills in gaps in the time series described by `tsExpression`, by inserting data points with the value `defaultValue`.
* Specify `timeWindow` to fill in data for just a limited period of time after each existing point.
* Specify `delayTime` to allow a gap before the inserted data.

{% include important.html content="If you don't specify a `timeWindow`, we apply the default value for every second and fill gaps up to 28 days. Performance of queries and dashboards can deteriorate." %}

{% include important.html content="Despite its apparent simplicity, the `default()` function is one of the most misunderstood functions in Wavefront Query Language (WQL). See the **Caveats** section below for recommendations." %}

## Parameters

Parameter	Description

[timeWindow](query_language_reference.html#common-parameters)
Maximum amount of time to fill with inserted data points. If you omit this parameter, gaps with duration of up to the metrics obsolescence period are completely filled.

You can specify a time measurement based on the clock or calendar (1s, 1m, 1h, 1d, 1w), the window length (1vw) of the chart, or the bucket size (1bw) of the chart. Default is minutes if the unit is not specified.

delayTime
Amount of time that must pass without a reported value before inserting data points. If you omit this parameter, data points are inserted at the beginning of each gap.

The delayTime affects the timeWindow. For example, if you provide a default value of 5 min but start after a 1 min delay, only the last 4 min of that time window are populated with the default value.

defaultValue
Value that you want to use in places where there are gaps in the data. You can specify a constant or a function that returns time series.

 [tsExpression](query_language_reference.html#query-expressions)
Expression in which you want to replace gaps in data with a default value.

.orElse
An optional operator that allows you to specify a default value even if the time series did not report any data in the specified time window. You can enter a constant value, for example orElse(5). You can also enter a timeseries for chained .orElse statements, for example .orElse(ts('my.metric')).

## Description

The `default()` function allows you to specify the value that you would like to assign to gaps of missing data on a chart. This is the only missing data function that allows you to specify the value you’d like to assign to gaps of missing data. The `default()` function only fills the gaps after a data point, not after a given timestamp.

### Basic Usage

For the simplest case, you can use `default()` to set the default value of a query to 0 if the specified metric does not exist:

`default(0, ts(my.metric))`

{% include note.html content="In certain situations we don't recommend using `default()`. See the list of **Caveats** below. In that case, use the following query instead." %}

`ts(my.metric).orElse(0)`

### Using default() With .orElse

While the `default()` function allows you to specify a value for missing points on a chart, the function shows NO DATA if the time series reported no data at all in the specified time window. In that situation, you can use `default()` with the `.orElse` operator to specify a value to return if no data are found.

{% include note.html content="A typical use case for `orElse` is together with `default()` but you can use `.orElse` with other functions." %}

## Examples

### Examples for Basic Usage of default()

The first screenshot shows two time series. The lines are dashed when there are no data:

![ts_default before](images/ts_default_before.png)

If we wrap `default()` and specify 0 as the default, missing data are replaced with 0 in the display.

![ts_default image](images/ts_default.png)

### Examples for default() with .orElse

* If the time series exists in the time window, `default()` fills in the values and `.orElse` is not needed (does nothing).
  ```
  default(100, ts('my.metric').orElse(25))
  ```
* If the time series does **not** exist in the time window, i.e. is not reporting in the past four weeks, NO DATA is shown by default. However, `.orElse` specifies a value of 25, which is shown for the time series.
  ```
  default(100, ts('metric_not_there').orElse(25))
  ```

## Caveats

Use `default()` with care:

* Sometimes using `default()` is just what you need - but sometimes it does not behave the way you might expect.
* In many cases `default()` does not add value when used with alerts.
* `default()` can affect performance - and in some cases prevent alerts from firing.

Here are some things to watch out for -- and suggestions how you can rewrite the query without using `default()` in many cases:

### Time Series Churn with default()

Use of `default()` leads to slower queries if there's time series churn, that is, old time series stop reporting and new time series start reporting all the time. This can happen easily if sources are dynamically provisioned, for example, in case of an EC2 instance.

For example, consider the following query:

`align(1m, default(0, ts("filehandles.used"))) / align(1m, default(0, ts("filehandles.total"))) * 100 > 60. `

Assume your environment has about 350 active time series at any moment, but within the last 2 weeks (the [metrics obsolescence period](metrics_managing.html#obsolete-metrics) if the default configuration is not changed), ~7200 unique time series were active.

In this case, `default()` is not needed at all - `filehandles.used` and `filehandles.total` always report together. The following query is more than 20x faster:

`ts("filehandles.used") / ts("filehandles.total") * 100 > 60`

### Alerts Don't Fire with default()

When a metric arrives with a delay of more than 1 minute, the use of `default()` can prevent an associated alert from firing because the value for the last minute evaluates to `false`.

Instead of accounting for sparse metrics -- `success.count` is reporting all the time, but `failure.count` is reporting a value only when there's a problem -- approach the query from a different angle.

Instead of:

`ts(success.count) * 100 / (default(0, ts(failure.count)) + ts(success.count)) < 95`

Use

`ts(failure.count) * 100 / (ts(failure.count) + ts(success.count)) > 5`

### Unexpected Behavior with highpass() and default()

Using `highpass()` after `default()` with a higher highpass value than default reverts the effects of `default()`.

Instead of

`highpass(..., default(0, ts(...)))`

Use

`highpass(..., ts(...))`

### Using msum() Makes default() Redundant

Using `msum()` after `default(0, )` is redundant because `msum()` always returns a value for all active series where `default(0, )` backfills a value.

Instead of

  `msum(..., default(0, ts(...)))`

Use

  `msum(..., ts(...))`

### Using rawsum() Makes default() Redundant

Using `rawsum()` after `default(0, )` is usually redundant. If you are sure that default() is necessary:

Instead of

`rawsum(default(0, ts(...)))`

Use

`default(0, rawsum(ts(...)))`

### Time Windows and default()

To [improve performance](query_language_performance.html#specify-a-time-window-with-missing-data-functions), limit the time window.

* Use the timeWindow parameter to limit to the current time window.
* Use the delayTime parameter introduce a delay time.

{% include tip.html content="The delayTime affects the timeWindow. For example, if you provide a default value of 5 min but start after a 1 min delay, only the last 4 min of that time window are populated with the default value." %}

### Histogram and default()

You cannot apply `default()` to a histogram. Even if you convert the histogram to a tsExpression, an error results if you then apply `default()`.

## See Also

[Using Moving and Tumbling Windows to Highlight trends](query_language_windows_trends.html)

Other missing data functions include:
* [interpolate](ts_interpolate.html)
* [next](ts_next.html)
* [last](ts_last.html)
* [orElse Operator](ts_orelse.html)

repository: wavefrontHQ/docs

gha_language: CSS

repo_name: wavefrontHQ/docs


text:
Installs ArgoCD.

install.yaml is sourced from the URL:

* https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Which installs the latest.  As of now this is v1.6.1

repository: robparrott/eks-bootstrap

repo_name: robparrott/eks-bootstrap


text:
<head>
    <meta property='og:image' content='{{site.url}}/{{page.image}}'/>
    <meta property='og:type' content='website' />
</head>

# MNNIT-Computer-Club

This repository contains the codes, support links and other relevant materials for every class under Computer Club, MNNIT Allahabad,Prayagraj.

This repository is only open for PRs by CC-MNNIT-admins/members (hereafter called CC-Admins). Please DO NOT make a PR otherwise.

## Table of Contents

- [MNNIT-Computer-Club](#mnnit-computer-club)
  - [Table of Contents](#table-of-contents)
  - [About](#about)
  - [Resources](#resources)
  - [Contact](#contact)
  - [Announcements](#announcements)
  - [Contribute](#contribute)
  - [Contributors](#contributors)

## About

We are an educational club at Motilal Nehru National Institute Of Technology, Allahabad ,Prayagraj an Institute of National Importance. MNNIT Computer Club as we call it is a official student organisation under Student Activity Centre (SAC) of our college.

We host several events in the domain of Computer Science And Engineering for which we also conduct classes on regular basis. Students from various courses actively participate in these events and classes throughout the year.

## Resources

- Android
	- [DroidRush Common Resources](Android)
	- [Android Class - 1](Android/2018_08_19_Android-Class-1)
	- [Android Class - 2](Android/2018_08_21_Android-Class-2)
  - [Android Class - 3](Android/2018_08_28_Android-Class-3)
- CodeWarriors
	- [Code Warriors Common Resources](CodeWarriors)
	- [Code Warriors Class - 1](CodeWarriors/2018_08_15_CodeWarriors-1)
- Competitive Coding
	- [Number Theory Class - 1](Competitive_Coding/2018_08_11_Number-Theory-1)
	- [Number Theory Class - 2](Competitive_Coding/2018_08_13_Number-Theory-2)
	- [Binary Search & C++ STL](Competitive_Coding/2018_08_18_BinarySearch+STL)
	- [DP-1](Competitive_Coding/2018_10_07_DP-1)
	- [DP-2](Competitive_Coding/2018_10_26_DP-2)
- First Year
	- [Webster Class - 1](https://github.com/CC-MNNIT/2018-19-Classes/tree/master/FirstYear/2018_08_28_Web-First-Year-Class-1)
	- [Inception Class - 1](FirstYear/2018_08_31_First-Year-Inception-Class-1)
	- [Inception Class - 2](FirstYear/2018_09_02_First-Year-Inception-Class-2)
	- [SoftaBlitz Class - 1](FirstYear/2018_09_1_First-Year-SoftaBlitz-Class-1)
	- [Introduction To Programming Class -2](FirstYear/2018_10_09_Introduction-To-Programming-Class-2)
- Git And Github
	- [Git Class - 1](Git_Github/2018_03_07_Git-Class-1)
	- [Git Class - 2](Git_Github/2018_03_12_Git-Class-2)
- Java
	- [SoftaBlitz Common Resources](Java/Softablitz)
	- [Java Class - 1](Java/2018_08_12_Java-Class-1)
	- [Java Class - 2](Java/2018_08_14_Java-Class-2)
	- [Java Class - 3](Java/2018_08_16_Java-Class-3)
	- [Java Class - 4](Java/2018_08_29_Java-Class-4)
	- [Java Class - 5](Java/2018_08_31_Java-Class-5)
	- [Java Class - 6](Java/2018_09_02_Java-Class-6)
- Linux And Networking
	- [Linux Class - 1](Linux_Networking/2018_08_24_TuxWars-1)
- [Machine Learning](MachineLearning)
	- [Machine Learning - 1](MachineLearning/2018_08_20_Logical-Rhythm-1)
	- [Machine Learning - 2](MachineLearning/2018_08_22_Logical-Rhythm-2)
	- [Machine Learning - 3](MachineLearning/2018_08_27_Logical-Rhythm-3)
- Placements
	- [Guide to Placements](Placements)
- Python
	- [Python Class - 2](Python/2018_03_27_Python-Class-2)
- Web
	- [Webster Basic Requirements and Downloads](WebDev)
	- [Webster Class - 1](WebDev/2018_08_18_Web-Class-1)
	- [Webster Class - 2](WebDev/2018_08_19_Web-Class-2)
	- [Webster Class - 3](WebDev/2018_08_22_Web-Class-3)
	- [Webster Class - 4](WebDev/2018_09_01_Web-Class-4)
	- [Webster Class - 5, Final Class](WebDev/2018_09_02_Web-Class-5)
	- [Django-Resources](WebDev/Django-Resources)
	- [Submissions](WebDev/submissions)

- trends in software development tools
	- [stackoverflow surveys](trends)

## Announcements

* [Avishkar 2018](https://avishkar.mnnit.ac.in/) is on its way. Do participate.

## Contribute

Follow the [contribution guide](https://github.com/CC-MNNIT/2018-19-Classes/blob/master/.github/CONTRIBUTING.md). Add the class folder link in README.md

## Contributors

* [Abhey Rana](https://github.com/Abhey)
* [Mohit Khare](https://github.com/mkfeuhrer)
* [Deepak Bharti](https://github.com/dbads)
* [Souvik Paul](https://github.com/FLYSKY12)
* [Dipunj Gupta](https://github.com/packetChor)

## Contact

We love to hear out suggestions. Reach out to us at<EMAIL_ADDRESS>

license: MIT


text:
# Quarks2Cosmos Deep Inverse Problems Data Challenge
Material for the CMU Quarks2Cosmos Conference Data Challenges

## Challenge Outline

This Data Challenge is designed to help you learn a number of concepts and tools and is structured around 2 concrete problems:
- a ["guided challenge"](notebooks/PartI-DifferentiableForwardModel.ipynb) on solving inverse problems (inpainting, deconvolution, deblending) on HSC galaxy images
- an ["open challenge"](notebooks/MappingDarkMatterDataChallenge.ipynb) on solving a Dark Matter Mass-Mapping problem from real HSC weak gravitational lensing data.

Participants may choose to primarily follow the guided challenge where answers will be povided at the end of each day,
and/or dive a little bit deeper into the open challenge where no answer exist :-) and where they can apply some of the
methodology they have learned in the guided challenge.

The schedule of the challenge is designed to be modular, so that you can follow one day and/or miss another day and
still be able to make the most of a given day, solutions will be provided for the guided challenge at the end of each day.

### Day I: Differentiable Forward Models

- [Notebook](notebooks/PartI-DifferentiableForwardModel.ipynb)

Learning objectives:
- How to write a probabilistic forward model for galaxy images with Jax + TensorFlow Probability
- How to optimize parameters of a Jax model

Challenge Goals:
- Write a forward model of ground-based galaxy images

### Day II: Learning a prior with Generative Models

Learning objectives:
- Write an Auto-Encoder in Jax+Haiku
- Build a Normalizing Flow in Jax+Haiku+TensorFlow Probability
- Bonus: Learn a prior by Denoising Score Matching

Challenge Goals:
- Build a generative model of galaxy morphology from Space-Based images

### Day III: Bringing it all together

Learning objectives:
- Solve inverse problem by MAP
- Learn how to sample from the posterior using Variational Inference
- Bonus: Learn to sample with SDE

Challenge Goals:
- Recover high-resolution posterior images for HSC galaxies
- Propose an inpainting model for masked regions in HSC galaxies
- Bonus: Demonstrate single band deblending!

### Day IV: Extra hacking time

Day IV is dedicated to extra hacking time and producing some nice plots for the presentation on Day V.
Participants can use this time to work on the Mass-Mapping open challenge, continue to explore the galaxy image problem, and/or ask more questions!

## How to get setup at PSC on Bridges 2

We will primarily work on the OnDemand interface, to set up your python environment do the following from a command line on a GPU node. **Warning**: This assumes you have a fresh account at PSC, if not the case, ask challenge organizers to check it won't ruin your setup.
```bash
$ module load AI cuda
$ pip install --upgrade pip
$ pip install --upgrade "jax[cuda111]" -f https://storage.googleapis.com/jax-releases/jax_releases.html
$ pip install --upgrade tensorflow
```
Then clone this repo and install the package and dependencies:
```bash
$ git clone https://github.com/EiffL/Quarks2CosmosDataChallenge.git
$ cd Quarks2CosmosDataChallenge
$ pip install --user -e .
```
Finally, add links to the data already available at PSC. From your `Quarks2CosmosDataChallenge` folder:
```bash
$ ln -s /ocean/projects/cis210053p/shared/deep_inverse data
$ ln -s /ocean/projects/cis210053p/shared/deep_inverse/tensorflow_datasets ~/
```

To make your newly installed environment accessible from OnDemand jupyter use this  final touch:
```
$ mkdir -p ~/.local/share/jupyter/kernels/
$ cp -r /ocean/projects/cis210053p/shared/common/python3-AI ~/.local/share/jupyter/kernels/
```
You should now have access to the `Python3  - AI` kernel in jupyter.

branch_name: refs/heads/main


text:
---
layout: post
title: Words with style
date: 2008-06-14
tags: ["cloud","design","tags","tech","wordle"]
---

[![](/blog/content/2008/06/wordle-300x172.png "wordle")](/blog/content/2008/06/wordle.png)

From Roo's [del.icio.us stream](http://del.icio.us/rooreynolds), I came across [Wordle](http://wordle.net/) by IBM Research's Jonathan Feinberg.

It is "a toy for generating 'word clouds' from text that you provide". The results it produces are absolutely stunning. Tag clouds are quite a common thing these days - it would take a couple clicks to add one in the sidebar of this blog. But they are often quite dull. Wordle shows this doesn't have to be the case.

The site lets you specify a list of words to generate the cloud from, or it will do it from your del.icio.us tags. You can see my tags in the cloud above.

At the moment it is a java applet - but it would be great to see it run as a web service so these clouds can be integrated more readily.


text:
# Change log

## Next release

* Report withdrawal charge API added

## 1.68.0

Released 18 July 2018

### Bonus corrections added

The 'request a bonus payment' endpoint has been enhanced with new (optional) supersede fields. You can use these to supersede a bonus claim you have previously submitted. This results in either an additional bonus or a bonus recovery.

The GET endpoint has also been updated to return the supersede fields.

New error responses have been added to support errors which may occur because of superseding a bonus request.

### Additional validation added to Request a bonus payment

* **BONUS\_CLAIM\_TIMESCALES\_EXCEEDED**
Bonus claims can only be made or altered for dates up to 6 years and 14 days in the past.
* **HELP\_TO\_BUY\_NOT\_APPLICABLE**
Help to buy figures can only be submitted for claims dated up to April 2018.

### Endpoint titles and descriptions updated

We have renamed some of the API endpoints and changed their descriptions in the API specification on the Developer Hub. This is a documentation change only, so urls, parameters, etc remain the same.

**For example:**

"Retrieve payment details" has been renamed to "Get a list of all bonus payments in a date range."

The description of that endpoint has been changed from "This allows a LISA provider to retrieve payments made by HMRC in a specific date range" to "Get a list of all completed and due bonus payments from HMRC in a specific date range."

### Test data IDs updated

The IDs used in the test data scenario requests and responses have been updated. This is to provide a end-to-end success path across the API endpoints.

### Test data code formatted

The JSON examples in the test data scenarios are now properly indented. This makes them easier to read, particularly when copying the examples.

### Response documentation added for POST endpoints

The response fields are now documented for both POST and GET endpoints.

### Modify date of first subscription updated

The message returned when an account has been made void has been changed.

The old message was:

*"Successfully updated the firstSubscriptionDate for the LISA account and changed the account status to void because the investor has another account with a more recent firstSubscriptionDate"*

The new message is:

*"Successfully updated the firstSubscriptionDate for the LISA account and changed the account status to void because the investor has another account with an earlier firstSubscriptionDate"*

repository: wakmo/lisa-api

repo_name: wakmo/lisa-api


text:
### `Arithmetic`: Elm library for integer arithmetic and number theory

#### (View the docs [here](http://package.elm-lang.org/packages/lynn/elm-arithmetic/latest/Arithmetic).)

Implements some useful functions involving:
* Parity and modular arithmetic
* Base conversion
* Squares and cubes
* Divisors, GCD, LCM
* The Chinese Remainder Theorem
* Prime sieves and prime checking (Miller–Rabin)

Released under the BSD3 license.

repository: lynn/elm-arithmetic

gha_language: Elm

gha_license_id: MIT

repo_name: lynn/elm-arithmetic


text:
HFast
-------------
HTTPS-Server serving PHP (FPM) with convention over config.

> Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Why?
- Few to no configuration
 So bye bye to those hours wasting on setting
 up PHP-FCGI, ratelimiting etc...
- HTTP/2 and IPv4+IPv6 by default
- TLS by default, zero config! (LetsEncrypt)
- Ratelimit by default on PHP-backend
- Proper caching/security headers everywhere
- base64 auth protected /admin to put sensitive stuff behind
- Native support for pre-optimized content. Let Brotli/Zopfli pre-compress assets
 to `.br`/`.gz` and HFast will serve them
- Accesslog as JSON for easy parsing
- Dynamic queues (`/queue/<chan>`) to easily queue data to the site without
 worrying about losing data on bugs in your code (faster code building!)

How?
- You need to place files in the pre-defined project structure
- Think about URL-versioning CSS/img/JS-files if you want to replace them (support file.vXXX.css|js by default where the vXXX is stripped off)
- Content Security Policy (CSP) by default, no CSS/JS in the body of HTML
- Proper deadlines, so 5sec to finish a script, if your script it slower fix it!

Systemd?
Supported, see contrib dir for an example config to use.
```
vi /etc/systemd/system/hfast.service
vi /etc/systemd/system/hfast.socket
chmod 644 /etc/systemd/system/hfast.service
systemctl daemon-reload
systemctl enable hfast
systemctl enable hfast.socket
systemctl start hfast.socket
systemctl start hfast
```

Example overrides.toml
```
type Overrides struct {
	Proxy           string // Just forward to given http(s)://addr:port
	ExcludedDomains []string // CSP-domains added to header (allowing external CSS/JS)
	Lang            []string // Auto redirect to supported pub/[lang]
	Admin           map[string]string // Admin user+pass for backend
	DevMode         bool // Protect whole site with Authlist(IP) or Admin user+pass
	Authlist        map[string]bool // Whitelist with IP=>true, Blacklist with IP=>false (works only with DevMode or /admin)
	SiteType        string // "" = default (all rules on), "weak" = Site without CSP, "indexphp" = Site with index.php as central file
}
```

/var/log/hfast.access.log
```
type Msg struct {
	Method string
	Host string
	URL string
	Status int
	Remote string
	Ratelimit string
	Duration int64
	UA string
	Proto string
	Len uint64
	Date string
	Time string
	Referer string
}
```
FYI. Example that reads the logs findable in `contrib/logparser`.

Future plan(s)
- Write small co-worker to offer distributed (DNS)
 hosting where the site is kept online when nodes fall off.

Thanks to:
* https://github.com/coreos/go-systemd/tree/master/examples/activation/httpserver

repository: mpdroog/hfast

gha_language: Go

repo_name: mpdroog/hfast


text:
# liteshort-android
liteshort-android is a simple Android client for [liteshort](https://github.com/132ikl/liteshort).

# Main interface

You can shorten a URL through the main interface. By default, pressing the shorten button takes a URL from the clipboard and shortens it. You can also provide a long url and a short url, similar to the functionality of liteshort's web interface.

# Tile

You can also shorten a URL by using the Quick Settings tile. Simply click the button in your click settings tray and the URL on the clipboard will be shortened and replaced.

gha_language: Java


text:
# NODE ACL - Access Control Lists for Node

This module provides a minimalistic ACL implementation inspired by Zend_ACL.

When you develop a web site or application you will soon notice that sessions are not enough to protect all the
available resources. Avoiding that malicious users access other users content proves a much more
complicated task than anticipated. ACL can solve this problem in a flexible and elegant way.

Create roles and assign roles to users. Sometimes it may even be useful to create one role per user,
to get the finest granularity possible, while in other situations you will give the *asterisk* permission
for admin kind of functionality.

A Redis, MongoDB and In-Memory based backends are provided built-in in the module. There are other third party backends such as [*knex*](https://github.com/christophertrudel/node_acl_knex) based, [*firebase*](https://github.com/tonila/node_acl_firebase) and [*elasticsearch*](https://github.com/adnanesaghir/acl-elasticsearch-backend). There is also an alternative memory backend that supports [*regexps*](https://github.com/futurechan/node_acl-mem-regexp).

Follow [manast](http://twitter.com/manast) for news and updates regarding this library.

## Status

[![BuildStatus](https://secure.travis-ci.org/OptimalBits/node_acl.png?branch=master)](http://travis-ci.org/OptimalBits/node_acl)
[![Dependency Status](https://david-dm.org/OptimalBits/node_acl.svg)](https://david-dm.org/OptimalBits/node_acl)
[![devDependency Status](https://david-dm.org/OptimalBits/node_acl/dev-status.svg)](https://david-dm.org/OptimalBits/node_acl#info=devDependencies)

## Features

- Users
- Roles
- Hierarchies
- Resources
- Express middleware for protecting resources.
- Robust implementation with good unit test coverage.

## Installation

Using npm:

```javascript
npm install acl
```

## Documentation

* [addUserRoles](#addUserRoles)
* [removeUserRoles](#removeUserRoles)
* [userRoles](#userRoles)
* [roleUsers](#roleUsers)
* [hasRole](#hasRole)
* [addRoleParents](#addRoleParents)
* [removeRoleParents](#removeRoleParents)
* [removeRole](#removeRole)
* [removeResource](#removeResource)
* [allow](#allow)
* [removeAllow](#removeAllow)
* [allowedPermissions](#allowedPermissions)
* [isAllowed](#isAllowed)
* [areAnyRolesAllowed](#areAnyRolesAllowed)
* [whatResources](#whatResources)
* [middleware](#middleware)
* [backend](#backend)

## Examples

Create your acl module by requiring it and instantiating it with a valid backend instance:

```javascript
var acl = require('acl');

// Using redis backend
acl = new acl(new acl.redisBackend(redisClient, prefix));

// Or Using the memory backend
acl = new acl(new acl.memoryBackend());

// Or Using the mongodb backend
acl = new acl(new acl.mongodbBackend(dbInstance, prefix));
```

All the following functions return a promise or optionally take a callback with
an err parameter as last parameter. We omit them in the examples for simplicity.

Create roles implicitly by giving them permissions:

```javascript
// guest is allowed to view blogs
acl.allow('guest', 'blogs', 'view')

// allow function accepts arrays as any parameter
acl.allow('member', 'blogs', ['edit', 'view', 'delete'])
```

Users are likewise created implicitly by assigning them roles:

```javascript
acl.addUserRoles('joed', 'guest')
```

Hierarchies of roles can be created by assigning parents to roles:

```javascript
acl.addRoleParents('baz', ['foo', 'bar'])
```

Note that the order in which you call all the functions is irrelevant (you can add parents first and assign permissions to roles later)

```javascript
acl.allow('foo', ['blogs', 'forums', 'news'], ['view', 'delete'])
```

Use the wildcard to give all permissions:

```javascript
acl.allow('admin', ['blogs', 'forums'], '*')
```

Sometimes is necessary to set permissions on many different roles and resources. This would
lead to unnecessary nested callbacks for handling errors. Instead use the following:

```javascript
acl.allow([
    {
        roles:['guest', 'member'],
        allows:[
            {resources:'blogs', permissions:'get'},
            {resources:['forums', 'news'], permissions:['get', 'put', 'delete']}
        ]
    },
    {
        roles:['gold', 'silver'],
        allows:[
            {resources:'cash', permissions:['sell', 'exchange']},
            {resources:['account', 'deposit'], permissions:['put', 'delete']}
        ]
    }
])
```

You can check if a user has permissions to access a given resource with *isAllowed*:

```javascript
acl.isAllowed('joed', 'blogs', 'view', function(err, res){
    if(res){
        console.log("User joed is allowed to view blogs")
    }
})
```

Of course arrays are also accepted in this function:

```javascript
acl.isAllowed('jsmith', 'blogs', ['edit', 'view', 'delete'])
```

Note that all permissions must be fulfilled in order to get *true*.

Sometimes is necessary to know what permissions a given user has over certain resources:

```javascript
acl.allowedPermissions('james', ['blogs', 'forums'], function(err, permissions){
    console.log(permissions)
})
```

It will return an array of resource:[permissions] like this:

```javascript
[{'blogs' : ['get', 'delete']},
 {'forums':['get', 'put']}]
```

Finally, we provide a middleware for Express for easy protection of resources.

```javascript
acl.middleware()
```

We can protect a resource like this:

```javascript
app.put('/blogs/:id', acl.middleware(), function(req, res, next){…}
```

The middleware will protect the resource named by *req.url*, pick the user from *req.session.userId* and check the permission for *req.method*, so the above would be equivalent to something like this:

```javascript
acl.isAllowed(req.session.userId, '/blogs/12345', 'put')
```

The middleware accepts 3 optional arguments, that are useful in some situations. For example, sometimes we
cannot consider the whole url as the resource:

```javascript
app.put('/blogs/:id/comments/:commentId', acl.middleware(3), function(req, res, next){…}
```

In this case the resource will be just the three first components of the url (without the ending slash).

It is also possible to add a custom userId or check for other permissions than the method:

```javascript
app.put('/blogs/:id/comments/:commentId', acl.middleware(3, 'joed', 'post'), function(req, res, next){…}
```

## Methods

### addUserRoles( userId, roles, function(err) )

Adds roles to a given user id.

__Arguments__

```javascript
    userId   {String|Number} User id.
    roles    {String|Array} Role(s) to add to the user id.
    callback {Function} Callback called when finished.
```

---------------------------------------

### removeUserRoles( userId, roles, function(err) )

Remove roles from a given user.

__Arguments__

```javascript
    userId   {String|Number} User id.
    roles    {String|Array} Role(s) to remove to the user id.
    callback {Function} Callback called when finished.
```

---------------------------------------

### userRoles( userId, function(err, roles) )

Return all the roles from a given user.

__Arguments__

```javascript
    userId   {String|Number} User id.
    callback {Function} Callback called when finished.
```

---------------------------------------

### roleUsers( rolename, function(err, users) )

Return all users who has a given role.

__Arguments__

```javascript
    rolename   {String|Number} User id.
    callback {Function} Callback called when finished.
```

---------------------------------------

### hasRole( userId, rolename, function(err, hasRole) )

Return boolean whether user has the role

__Arguments__

```javascript
    userId   {String|Number} User id.
    rolename {String|Number} role name.
    callback {Function} Callback called when finished.
```

---------------------------------------

### addRoleParents( role, parents, function(err) )

Adds a parent or parent list to role.

__Arguments__

```javascript
    role     {String} Child role.
    parents  {String|Array} Parent role(s) to be added.
    callback {Function} Callback called when finished.
```

---------------------------------------

### removeRoleParents( role, parents, function(err) )

Removes a parent or parent list from role.

If `parents` is not specified, removes all parents.

__Arguments__

```javascript
    role     {String} Child role.
    parents  {String|Array} Parent role(s) to be removed [optional].
    callback {Function} Callback called when finished [optional].
```

---------------------------------------

### removeRole( role, function(err) )

Removes a role from the system.

__Arguments__

```javascript
    role     {String} Role to be removed
    callback {Function} Callback called when finished.
```

---------------------------------------

### removeResource( resource, function(err) )

Removes a resource from the system

__Arguments__

```javascript
    resource {String} Resource to be removed
    callback {Function} Callback called when finished.
```

---------------------------------------

### allow( roles, resources, permissions, function(err) )

Adds the given permissions to the given roles over the given resources.

__Arguments__

```javascript
    roles       {String|Array} role(s) to add permissions to.
    resources   {String|Array} resource(s) to add permisisons to.
    permissions {String|Array} permission(s) to add to the roles over the resources.
    callback    {Function} Callback called when finished.
```

### allow( permissionsArray, function(err) )

__Arguments__

```javascript
    permissionsArray {Array} Array with objects expressing what permissions to give.
       [{roles:{String|Array}, allows:[{resources:{String|Array}, permissions:{String|Array}]]

    callback         {Function} Callback called when finished.
```

---------------------------------------

###  removeAllow( role, resources, permissions, function(err) )

Remove permissions from the given roles owned by the given role.

Note: we loose atomicity when removing empty role_resources.

__Arguments__

```javascript
    role        {String}
    resources   {String|Array}
    permissions {String|Array}
    callback    {Function}
```

---------------------------------------

### allowedPermissions( userId, resources, function(err, obj) )

Returns all the allowable permissions a given user have to
access the given resources.

It returns an array of objects where every object maps a
resource name to a list of permissions for that resource.

__Arguments__

```javascript
    userId    {String|Number} User id.
    resources {String|Array} resource(s) to ask permissions for.
    callback  {Function} Callback called when finished.
```

---------------------------------------

### isAllowed( userId, resource, permissions, function(err, allowed) )

Checks if the given user is allowed to access the resource for the given
permissions (note: it must fulfill all the permissions).

__Arguments__

```javascript
    userId      {String|Number} User id.
    resource    {String} resource to ask permissions for.
    permissions {String|Array} asked permissions.
    callback    {Function} Callback called with the result.
```

---------------------------------------

### areAnyRolesAllowed( roles, resource, permissions, function(err, allowed) )

Returns true if any of the given roles have the right permissions.

__Arguments__

```javascript
    roles       {String|Array} Role(s) to check the permissions for.
    resource    {String} resource to ask permissions for.
    permissions {String|Array} asked permissions.
    callback    {Function} Callback called with the result.
```

---------------------------------------

### whatResources(role, function(err, {resourceName: [permissions]})

Returns what resources a given role has permissions over.

__Arguments__

```javascript
    role        {String|Array} Roles
    callback    {Function} Callback called with the result.
```

whatResources(role, permissions, function(err, resources) )

Returns what resources a role has the given permissions over.

__Arguments__

```javascript
    role        {String|Array} Roles
    permissions {String|Array} Permissions
    callback    {Function} Callback called with the result.
```

---------------------------------------

### middleware( [numPathComponents, userId, permissions] )

Middleware for express.

To create a custom getter for userId, pass a function(req, res) which returns the userId when called (must not be async).

__Arguments__

```javascript
    numPathComponents {Number} number of components in the url to be considered part of the resource name.
    userId            {String|Number|Function} the user id for the acl system (defaults to req.session.userId)
    permissions       {String|Array} the permission(s) to check for (defaults to req.method.toLowerCase())
```

---------------------------------------

### backend( db, [prefix] )

Creates a backend instance. All backends except Memory require driver or database instance. `useSingle` is only applicable to the MongoDB backend.

__Arguments__

```javascript
    db        {Object} Database instance
    prefix    {String} Optional collection prefix
    useSingle     {Boolean} Create one collection for all resources (defaults to false)
```

```javascript
var mongodb = require('mongodb');
mongodb.connect("mongodb://<IP_ADDRESS>:27017/acltest", function(error, db) {
  var mongoBackend = new acl.mongodbBackend(db, 'acl_');
});
```

Creates a new MongoDB backend using database instance `db`.

```javascript
var client = require('redis').createClient(6379, '<IP_ADDRESS>', {no_ready_check: true});
var redisBackend = new acl.redisBackend(client);
```

Creates a new Redis backend using Redis client `client`.

## Tests

Run tests with `npm` (requires mocha):
```javascript
 npm test
```

## Future work

- Support for denials (deny a role a given permission)

## License

(The MIT License)

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

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

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: Hellogark/TuaregWeb

gha_language: JavaScript

repo_name: Hellogark/TuaregWeb


text:
# Exercise 1

### Basics of compilation

The goal of this exercise is to help you get your programming environment
set up, and to give you some practice with the error messages.

1.  In this directory, use the text editor of your choice to create a new file
named `cards.c`.  I recommend Atom, but some people like Sublime Text.

2.  Type in the code example on page 37 of *Head First C*.  Typing in
code is boring, but it will give you a chance to make some errors and
debug them, so I think it is worth it.  If you disagree, feel free to
collaborate.

3. Compile and run the program.

4. Add it to the repo and check it in.

5. In its current form, the program is one giant function.  Refactor
it, splitting it into at least three functions with well designed
interfaces.  See if the refactoring creates opportunities to improve
the quality of the code.  Write comments that document each function.

6. I suggest you follow the code style demonstrated in the book,
so you should lay out your code like what you see there.  Use line
breaks to make sure your code fits into 80 columns.

In general, every program you write should include:

* A top-level comment that describes what's in the file and includes
   your name and any relevant copyright and license information.

* A comment before each function explaining what it does.  The content
   and format should be similar to this:

```
    /* Prompts the user for input and puts the reply in the given buffer.

       User input is truncated to the first two characters.

       prompt: string prompt to display
       card_name: buffer where result is stored
    */
    void get_card_name(char *prompt, char *card_name)
```

7. While working on this exercise, you probably made errors and saw
some of the C compiler's error messages.  Take some time to make more
errors so you see as many error messages as possible.

Some tips that might help you debug C programs:

*  If a program contains a syntax error, it throws off the compiler,
   often causing it to generate a long cascade of additional error
   messages, even if there are no additional errors.  In general, only
   the first error message is reliable.

*  The C compiler can tell you the location in the program where it
   realized that something was wrong, but that is not always where the
   error is.

*  Error messages contain useful information, so don't ignore them.  At
   the same time, you should not take them too seriously.  Finding
   errors requires a combination of reading errors messages and
   looking carefully at the code.

When you are working with a new programming language, you should get
in the habit if compiling and testing often.

8. Once your program is working and compiles without generating any
error messages or warnings, compile your program again using these
flags

```
    gcc -ansi -pedantic -Wall cards.c
```

Look up what these flags do.  Did you get additional warnings?  See if
you can get your program to compile cleanly with these flags.

9.  Check your modified program into the repo.

### Optimization

1.  In this directory, you should find a file named `hello.c`.  Compile and
run it, then add the following line at the beginning of `main`:

```
    int x = 5;
```

Compile and look at the assembly language output (see [this section of
*Think OS*](http://greenteapress.com/thinkos/html/thinkos002.html#toc8).
Can you find the code that corresponds to this line?

2. What happens if you turn on optimization using the flag `-O2`?

3. Modify the `printf` statement to print `x`, then compile it with and
without optimization.  What effect does it have when you print `x`?

4. Add

```
    int y = x + 1;
```

And then print the value of `y` (but not `x`).  Compile with and without
optimization.  What happens to `x` and `y`?

What conclusions can you draw about how optimization works?

5. Add comments to the code to explain these experiments and the results,
then check in the final version.

repository: sdaitzman/ExercisesInC

repo_name: sdaitzman/ExercisesInC


text:
# JavaScript

## Summary

<runkit global enabled='false'></runkit>

Learn the basics of JavaScript, a high-level, dynamic, untyped and interpreted programming language,
and one of the three core technologies of the web.

**You will need**

- [Google Chrome][chrome] (recommended, any browser with developer tools will do)

- [Setup](#setup)
- [What is JavaScript?](#what-is-javascript)
  - [JavaScript is still evolving](#javascript-is-still-evolving)
  - [JavaScript ES6+ support](#javascript-es6-support)
- [JavaScript types](#javascript-types)
  - [JavaScript has 6 primitive data types](#javascript-has-6-primitive-data-types)
  - [JavaScript has **dynamic** objects](#javascript-has-dynamic-objects)
  - [Array are **objects**](#array-are-objects)
  - [JavaScript is **untyped**](#javascript-is-untyped)
  - [Comparing values with `==` or `===`](#comparing-values-with--or-)
  - [Falsy values](#falsy-values)
- [JavaScript supports first-class functions](#javascript-supports-first-class-functions)
  - [Storing functions in variables or data structures](#storing-functions-in-variables-or-data-structures)
  - [Returning functions from a function](#returning-functions-from-a-function)
  - [Passing functions as arguments](#passing-functions-as-arguments)
    - [Function as argument exercise](#function-as-argument-exercise)
  - [Transforming data with functions](#transforming-data-with-functions)
  - [Arrow functions _(ES6+)_](#arrow-functions-_es6_)
    - [Arrow function arguments](#arrow-function-arguments)
    - [Body of arrow functions](#body-of-arrow-functions)
- [Constructors](#constructors)
  - [The `this` keyword](#the-this-keyword)
- [Variables](#variables)
  - [Defining variables](#defining-variables)
  - [Dynamic or constant variables](#dynamic-or-constant-variables)
  - [The function scope](#the-function-scope)
  - [The block scope](#the-block-scope)
  - [The (evil) global scope](#the-evil-global-scope)
    - [When it's okay to use the global scope](#when-its-okay-to-use-the-global-scope)
    - [Oops, global scope](#oops-global-scope)
- [String syntax](#string-syntax)
- [Manipulating arrays](#manipulating-arrays)
  - [Examples](#examples)
  - [The `for...of` loop](#the-forof-loop)
- [Destructuring assignment](#destructuring-assignment)
  - [Array destructuring](#array-destructuring)
    - [Array destructuring features & tricks](#array-destructuring-features--tricks)
  - [Object destructuring](#object-destructuring)
    - [Object destructuring features & tricks](#object-destructuring-features--tricks)
- [JSON](#json)
  - [JSON who?](#json-who)
  - [Example](#example)
  - [Using JSON](#using-json)
- [Resources](#resources)

## Setup

To follow along the exemples in this subject, create a new folder, e.g. `js`, on you `dfa-course` project.

Create two file in this new folder: `index.html` and `script.js`.

Then add the following in the `index.html` file:

```html
<head>
  <script src="script.js"></script>
</head>
```
Start `live-server` and display your browser's console (since we won't need the webpage).

> Feel free to remove all code from `script.js` each time you want to try one of this subject's examples.

## What is JavaScript?

> JavaScript is a high-level, **dynamic**, **untyped**, and interpreted programming language.
> Alongside HTML and CSS, JavaScript is one of the three core technologies of World Wide Web.

> JavaScript is **prototype**-based with **first-class functions**, making it a multi-paradigm language, supporting **object-oriented**, **imperative**, and **functional** programming styles.

### JavaScript is still evolving

It has been standardized in the [ECMAScript][es] language specification.

- [**ECMAScript 2015** (also known as ECMAScript 6 or ES6)][es6] added an enormous amount of new (drastic) features : iterators and for/of loops, Python-style [generators][js-generators] and generator expressions, [arrow functions][js-arrow-functions], binary data, typed arrays, collections (maps, sets and weak maps), [promises][js-promise], number and math enhancements, reflection, and [proxies][js-proxy].
  > Since this huge release, it has been decided to make smaller and more frequent releases
- [**ECMAScript 2017** (ES8)][es8] added [async/await functions][js-async] and [shared memory and atomics][js-shared-memory].
- [**ECMAScript 2018** (ES9)][es9] added [asynchronous iteration][js-async-iteration] and more.
- And so on...

### JavaScript ES6+ support

Many features of ES6 are **supported by [the majority of modern browsers][caniuse-es6]**.

This means that you could use them directly in JavaScript code running in the **browser**.

If your user base might not have **up-to-date browsers** or ones that do not support those features, you should stick to **ES5** or use a JavaScript compiler like [Babel][babel] or a module bundler like [Webpack][webpack]
to turn your ES6+ code into compatible ES5 code before releasing it.

In server-side code running with the latest **Node.js** versions,
all **ES6+** features are supported except for [imports][js-imports].

> JavaScript examples in this course will use ES6 features when applicable

## JavaScript types

### JavaScript has 6 primitive data types

```js
let aString = "HEIG-VD";
let aNumber = 3.12;
let aBoolean = true;
let nullValue = null;
let undefinedValue;
let aSymbol = Symbol("foo");

console.log(typeof aString); // "string"
console.log(typeof aNumber); // "number"
console.log(typeof aBoolean); // "boolean"
console.log(typeof nullValue); // "object"
console.log(typeof undefinedValue); // "undefined"
console.log(typeof aSymbol); // "symbol"

// There is no integer type
console.log(Number.isInteger(aNumber)); // false
console.log(typeof 4); // "number"
console.log(Number.isInteger(4)); // true

// Symbols are unique identifiers
console.log(Symbol("foo") == aSymbol); // false
```

The types are:

- String
- Number
- Boolean
- Null
- Undefined
- Symbol (**ES6**)

> Note that `null` is a type, but `typeof null === object`.
> This is a [remnant][js-typeof-null] from the first version of JavaScript.

### JavaScript has **dynamic** objects

```js
// Let's create an object
let person = {
  firstName: "John",
  lastName: "Doe",
};

// We can dynamically add properties
person.gender = "male";

let property = "zip";
person[property] = 1446;

// And delete them
delete person.firstName;

// And list them
for (const key in person) {
  console.log(key + ": " + person[key]);
}
```

```txt
lastName: John
gender: male
zip: 1446
```

Objects have **no class**, they are **dynamic bags** of properties.

Every object has a **different list of properties**.

### Array are **objects**

They are list-like objects with numeric keys.

```js
// Let's create an array
let fruits = ["apple", "pear"];

console.log(typeof fruits); // "object"

// Iterate over it
for (let i = 0; i < fruits.length; i++) {
  console.log("fruit " + i + " is " + fruits[i]);
}

// fruit 0 is apple
// fruit 1 is banana
```

We'll learn more about arrays later.

### JavaScript is **untyped**

Values have a type, but **variables don't**.
When you declare a variable, you don't specify a type.

```js
let aVariable = "aString";
console.log(typeof aVariable); // "string"

aVariable = 3.12;
console.log(typeof aVariable); // "number"

aVariable = true;
console.log(typeof aVariable); // "boolean"

aVariable = [1, 2, 3];
console.log(typeof aVariable); // "object"

aVariable = {
  aProperty: "aValue",
};
console.log(typeof aVariable); // "object"
```

The type can **change** over time.

### Comparing values with `==` or `===`

The `==` operator **loosely** compares values for equality:

```js
console.log(1 == true); // true
console.log(2.3 == "2.3"); // true
console.log(false == []); // true
```

The `===` operator **strictly** compares for equality:

```js
console.log(1 === true); // false
console.log(2.3 === "2.3"); // false
console.log(false === []); // false
console.log(42 === 42); // true
```

### Falsy values

The following values all **evaluate to false**: `false`, `0`, `""`, `null`, `undefined`, `NaN`.

```js
if (0) {
  console.log("Zero is truthy");
} else {
  console.log("Zero is falsy"); // "Zero is falsy"
}
```

This can cause weird bugs sometimes:

```js
let countdown = "";
if (countdown == 0) {
  console.log("We are done"); // "We are done"
} else {
  console.log("We are not done");
}
```

Therefore, it's recommended to always use the triple-equal `===` operator for equality comparisons.

## JavaScript supports first-class functions

> "A programming language is said to have [first-class functions][first-class-functions] if it treats functions as first-class citizens.

> Specifically, this means the language supports **passing functions as arguments** to other functions, **returning them** as the values from other functions, and **assigning them to variables** or **storing them in data structures**."

### Storing functions in variables or data structures

A JavaScript function isn't a special construct linked to a class like in Java.
It can be stored in variables like any other value.

```js
// Store a function in a variable
let hello = function (name) {
  console.log("Hello " + name + "!");
};

// The hello variable now holds a function
console.log(typeof hello); // "function"

// You can call it
hello("World"); // "Hello World!"

// Store a function as an object's property
let anObject = {
  aProperty: function () {
    return 42;
  },
};

// That property now holds a function as its value
console.log(typeof anObject.aProperty); // "function"

let value = anObject.aProperty();
console.log(value); // 42
```

### Returning functions from a function

```js
// Let's define a function that returns a function
function makeSquareFunction() {
  return function (n) {
    return n * n;
  };
}

// By calling it, we get a function
let square = makeSquareFunction();
console.log(typeof square); // "function"

let result = square(5);
console.log(result); // 25
```

Note that functions can be **anonymous** (i.e. they have no name),
like the function returned from `makeSquareFunction`:

```js
return function (n) {
  return n * n;
};
```

### Passing functions as arguments

A function can take another function as an argument.

```js
function hello(name) {
  console.log("Hello " + name + "!");
}

function callIt(func) {
  func("World");
}

callIt(hello); // "Hello World!"
```

#### Function as argument exercise

Copy the following code in your `script.js` file and try to **implement it**:

```js
// Let's define a couple of arithmetic function
function add(a, b) {
  return a + b;
}
function multiply(a, b) {
  return a * b;
}

// Give me some arguments and implement me!
function compute(/* TODO */) {
  // TODO
}

// Call compute with "add"
let value = compute(2, 4, add);
console.log(value);

// Call compute with "multiply"
value = compute(2, 4, multiply);
console.log(value);
```

**Current result**

```
undefined
undefined
```

**Expected result**

```
6
8
```

### Transforming data with functions

These properties of functions enable powerful [**functional programming**][func-prog] patterns:

```js
// Define an array of people objects
let people = [
  { firstName: "John", lastName: "Doe" },
  { firstName: "John", lastName: "Smith" },
  { firstName: "Deborah", lastName: "Smith" },
];

// Define a function that takes a person and returns their last name
function getName(person) {
  return person.lastName;
}

// The "map" function of arrays returns an array of the same size,
// but with each element "mapped" or "transformed" using the provided
// function
let lastNames = people.map(getName);

// We transformed an array of people into an array of last names
console.log(lastNames); // [ "Doe", "Smith", "Smith" ]
```

### Arrow functions _(ES6+)_

<runkit disabled></runkit>

While seaching for examples on the web, you will stumble upon a strange syntax:

```js
let divideFunc = (nb1, nb2) => nb1 / nb2;
```

You are facing the **ES6** syntax for functions called **arrow functions**.
The example above is (mostly) equivalent to writing:

```js
let divideFunc = function (nb1, nb2) {
  return nb1 / nb2;
};
```

#### Arrow function arguments

<runkit except='0,1'></runkit>

Let's see how an arrow function is written:

```js
`(nb1, nb2)` => nb1 / nb2
```

The part left of the `=>` represents the **function's arguments**.

If your function has **only one** argument, you can **omit** the parentheses:

```js
let squareroot = `number` => Math.sqrt(number);
```

But if your function has **no arguments**, you **MUST** add **empty parentheses**:

```js
// No argument
let callback = `()` => console.log("Timeout finished");
setTimeout(callback, 1000);
```

> As a rule of thumb, you should always use brackets.

#### Body of arrow functions

<runkit except='0'></runkit>

```js
(nb1, nb2) => `nb1 / nb2`;
```

The part right of the `=>` is **the body** of the function; note the absence of brackets (`{}`).

The `return` keyword is **implicit** with one-line bodies that have no brackets:

```js
// This arrow function will return the square root of the number
const squareroot = (number) => `Math.sqrt(number)`;
console.log(squareroot(4)); // 2
```

If the body has **more than one line**, you **MUST add brackets** `{}` around it (_and use the `return` keyword if necessary_):

```js
const square = (number) =>
  `{``let result = number * number;``return result;``}`;

console.log(square(5)); // 25
```

## Constructors

Though JavaScript doesn't really have classes _per se_, any function can behave like a **constructor** and create an object.

For a function to act as a constructor, you don't have to declare it differently than any other function.
All you have to do is call the function with `new` like in most object-oriented languages:

```js
function Starship() {}

let discovery = new Starship();
console.log(discovery); // {}
console.log(discovery instanceof Starship); // true
```

The `discovery` variable stores a new (and empty) object, of type `Starship`.

> Note that there's **nothing special** about this function: calling it with `new` is what makes it a constructor.
>
> It's simply a **convention** to put the first letter in uppercase.

### The `this` keyword

You can access the `this` keyword inside a function body. In this case, `this` refers to **the object that will be created** when calling this function as a **constructor** (with `new`).

You can modify this object, for example to attach it properties with values received as parameters:

```js
function Starship(name, designation) {
* this.name = name;
* this.designation = designation;
}

let discovery = new Starship("Discovery", "NCC-1031");
console.log(discovery);
// Starship {name: "Discovery", designation: "NCC-1031"}
```

> It's possible to implement class-like structures with **constructor functions** and **prototypes**.
>
> JavaScript **ES6** adds a new sytax for **classes** that looks very much like what you could find in Java, although the underlying mechanisms are still based on **prototypes**.
> But that's outside the scope of this tutorial.

## Variables

### Defining variables

<runkit disabled></runkit>

There are three ways to define a variable in JavaScript:

```js
// ES5
var aString = "foo";

// ES6
let aNumber = 42;
const aBoolean = true;
```

Note that `var` is valid whatever the ES version you're using, but `let` and `const` are only available in **ES6** and later versions.

### Dynamic or constant variables

Variables declared with `var` or `let` are dynamic.
Their value can **change** over time.

```js
var aString = "foo";
let aNumber = 24;

console.log(aString); // "foo"
console.log(aNumber); // 24

aString = "bar";
aNumber = 25;

console.log(aString); // "bar"
console.log(aNumber); // 25
```

Variables declared with `const` cannot change.
They are **constants**:

```js
const theMeaningOfLife = 42;

theMeaningOfLife = 43; // TypeError: Assignment to constant variable.
```

### The function scope

Variables declared with `var` in a function are visible **everywhere in that function**.
Note that they are **NOT block-scoped** like in most languages.

```js
function logThings(things) {
  var numberOfThings = things.length;

  for (var i = 0; i < numberOfThings; i++) {
    var thing = things[i];
    console.log(thing);
  }

  console.log("Number of things: " + numberOfThings);
  console.log("Last thing: " + thing);
  console.log("Iterator: " + i);
}

logThings(["apple", "banana", "pear"]);

// "apple"
// "banana"
// "pear"
// "Number of things: 3"
// "Last thing: pear"
// "Iterator: 3"
```

### The block scope

The `let` and `const` keywords introduced in **ES6** create **block-scoped** variables,
only visible in the block, statement or expression on which they are used.

```js
function logThings(things) {
  const numberOfThings = things.length;

  for (let i = 0; i < numberOfThings; i++) {
    let thing = things[i];
    console.log(thing);
  }

  console.log("Number of things: " + numberOfThings);
  console.log("Last thing: " + thing);
}

logThings(["apple", "banana", "pear"]);

// "apple"
// "banana"
// "pear"
// "Number of things: 3"
// ReferenceError: thing is not defined
```

**It is recommended to use them in ES6-compatible environments**.

### The (evil) global scope

Variables declared with `var` outside of any function are **global variables**, accessible anywhere.

```js
// A global variable
var name = "World";

function hello() {
  // We can use "name" even though it's not an argument
  // of the function, because it's global
  console.log("Hello " + name + "!");

  // It's a bad idea to use them because anyone can
  // change their value and mess up your program
  name = "Bob";
}

hello(); // "Hello World!"
hello(); // "Hello Bob!"
```

You should **almost never use them**.

#### When it's okay to use the global scope

In an **HTML page**, all loaded scripts share the same global scope.

In that context, ES5 libraries expose global variables so that your code can use them.
For example, jQuery provides the **`$`** global variable for easy access.

In a **Node.js script**, the global scope is limited to the file you're in, so it's okay to use it.

If you're not writing either one of those, just **don't use global variables**.

#### Oops, global scope

If you forget the `var`, `let` or `const` keyword, JavaScript will not complain.
It will simply consider the variable global.

```js
// Let's declare a global variable
var i = 42;

// And a function that logs each thing in the passed array
function logThings(things) {
  // Oops, we forgot the "var" or "let"
* for (i = 0; i < things.length; i++) {
    console.log(things[i]);
  }
}

var fruits = [ 'apple', 'banana', 'pear' ];
logThings(fruits);

// Oops, we've modified something outside of the function
console.log(i); // 3
```

Just **don't do it**.

## String syntax

<runkit disabled></runkit>

In JavaScript, you have 3 ways of declaring strings:

```js
// With single quotes: '
let string = 'I\'m your "Wurst" nightmare: ' + worstNightmare;
```

> You have to **escape all other single quotes**, and use `+` to concatenate.

```js
// With double quotes: "
let string = 'I\'m your "Wurst" nightmare: ' + worstNightmare;
```

> You have to **escape all other double quotes**, and use `+` to concatenate.

**ES6** also adds the new **template literals**:

```js
// With backticks (template literals): `
let string = \`I'm your "Wurst" nightmare: ${worstNightmare}`;
```

You have to escape all other backticks, but you can use single and double quotes without escaping.

Expressions included as `${expression}` will be evaluated then concatenated.

## Manipulating arrays

Arrays in JavaScript are objects and provide you with a [boatload of methods][array-functions] to manipulate items:

| Function     | Effect                                                                                |
| :----------- | :------------------------------------------------------------------------------------------------------------------------ |
| `.forEach()` | Calls a function for every element in the array                                                                           |
| `.concat()`  | Concatenates two arrays into one, and returns this new array                                                              |
| `.find()`    | Finds the **first** element that passes a provided test function                                                          |
| `.pop()`     | Removes the **last** element, and returns it (`.shift()` does the same but for the **first** element)                     |
| `.push()`    | Adds new elements to **the end** of an array (`.unshift()` does the same but adds them to the **beginning** of the array) |
| `.slice()`   | Returns **a portion** of the array                                                                                |
| `.reverse()` | Reverses the order of the elements in an array (**this modifies the original array**)                                     |

### Examples

`.forEach()`

```js
let crew = ["Jonathan", "T'Pol", "Trip", "Malcolm", "Sato", "Travis"];
crew.forEach(function (element, index) {
  console.log("Hello, my name is " + element + ", and I'm n°" + index);
});
```

`.find()`

```js
let ages = [3, 10, 19, 25];
let adult = ages.find(function (age) {
  return age >= 18;
});
console.log(adult); // 19
```

`.slice()`

```js
let starships = ["NX-01", "NCC-1701", "NCC-1701 D", "NCC-1764", "NCC-74656"];
// Start at position 0, included, and end before position 3, excluded.
let enterprises = starships.slice(0, 3);
console.log(enterprises); // ["NX-01", "NCC-1701", "NCC-1701 D"]
```

### The `for...of` loop

**ES6**'s `for...of` loop is a new, simpler way of **iterating over all elements** of an array:

```js
let fruits = ["apple", "pear"];

// Classic "for" loop
for (let i = 0; i < fruits.length; i++) {
  let fruit = fruits[i];
  console.log("fruit: " + fruit);
}

// Equivalent "for...of" loop
for (let fruit of fruits) {
  console.log("fruit: " + fruit);
}
```

The `for...of` loop is actually not limited to arrays:
it can iterate over any [iterable object][js-iterable] such as Map, Set, etc.

## Destructuring assignment

The destructuring assignment syntax makes it possible to **unpack values from arrays**, or **properties from objects**, into **distinct variables**.

### Array destructuring

Basic variable assignment.

```js
let foo = [ 'one', 'two', 'three' ];

*let [ one, two, three ] = foo;
console.log(one); // "one"
console.log(two); // "two"
console.log(three); // "three"
```

Equivalent without destructuring.

```js
let foo = [ 'one', 'two', 'three' ];

*let one = foo[0];
*let two = foo[1];
*let three = foo[2];
console.log(one); // "one"
console.log(two); // "two"
console.log(three); // "three"
```

You can also use destructuring separately from the variables' declaration:

```js
let foo = [ 'one', 'two', 'three' ];
let one, two, three;

*[ one, two, three ] = foo;
console.log(one); // "one"
console.log(two); // "two"
console.log(three); // "three"
```

#### Array destructuring features & tricks

Here's a few things you can do with array destructuring:

```js
// Default values
let a, b;
*[ a=5, b=7 ] = [ 1 ];
console.log(a); // 1
console.log(b); // 7

// Swapping variables
let c = 1;
let d = 3;
*[c, d] = [d, c];
console.log(c); // 3
console.log(d); // 1

// Ignoring values
*let [ e, f ] = [ 'foo', 'bar', 'baz' ];
console.log(e); // "foo"
console.log(f); // "bar"

// Assigning the rest to a variable
*let [ g, ...h ] = [ 1, 2, 3 ];
console.log(g); // 1
console.log(h); // [2, 3]
```

### Object destructuring

Basic variable assignment.

```js
let o = { p: 42, q: true };

*let { p, q } = o;
console.log(p); // 42
console.log(q); // true
```

Equivalent without destructuring.

```js
let o = { p: 42, q: true };

*let p = o.p;
*let q = o.q;
console.log(p); // 42
console.log(q); // true
```

You can also use destructuring separately from the variables' declaration
(but you have to put it within parentheses):

```js
let o = { p: 42, q: true };
let p, q;

*({ p, q } = o);
console.log(p); // 42
console.log(q); // true
```

#### Object destructuring features & tricks

Here's a few things you can do with object destructuring:

```js
// Assigning to new variable names
let o = { p: 42, q: true };

*let { p: foo, q: bar } = o;
console.log(foo); // 42
console.log(bar); // true

// Default values
*let { a = 10, b = 5 } = { a: 3 };
console.log(a); // 3
console.log(b); // 5

// Unpacking fields from function parameters
*function userId({id}) {
  return id;
}

let user = { id: 42, name: 'Bob' };
console.log('userId: ' + userId(user)); // "userId: 42"
```

## JSON

### JSON who?

[JSON][json] stands for **J**ava**S**cript **O**bject **N**otation.
It is a syntax that is used to **represent JavaScript objects** with **text**.

JSON can only describe the following types:

| Types   | Notation                                           |
| :------ | :------------------------------------------------- |
| String  | `"text"`                                           |
| Number  | `2`                                                |
| Boolean | `true`, `false`                                    |
| Null    | `null`                                             |
| Array   | `[ "value1", "value2" ]`                           |
| Object  | `{ "property1": "value1", "property2": "value2" }` |

Object properties and strings **MUST be double-quoted**.

Note that you **cannot** put a JavaScript function in a JSON object.

### Example

Here is an example of a **JavaScript object**, and its **description in JSON**:

```js
let starship = {
  designation: "NX-01",
  crew: 83,
  captain: {
    firstname: "Jonathan",
    lastname: "Archer",
    activeService: true
  },
  species: [
    "human",
    "dog",
    "denobulan",
    "vulcan"
  ],
* "warp.factor": 5,
* "cloak": null
};
```

This is a JavaScript object.
You _can_ put double quotes around property names, but you don't **have to**
unless it's an **invalid identifier** (e.g. cannot use `.` in a variable name).

```json
{
  "designation": "NX-01",
  "crew": 83,
  "captain": {
    "firstname": "Jonathan",
    "lastname": "Archer",
    "activeService": true
  },
  "species": ["human", "dog", "denobulan", "vulcan"],
  "warp.factor": 5,
  "cloak": null
}
```

This is JSON. The double quotes around property names are **required**.

### Using JSON

**Manually** declaring a JavaScript object in JSON (or the opposite) can be quite tedious, especially with deep, complex objects.

Fortunately, JavaScript provides the **global `JSON` object** which can do it for you.
To transform a **JavaScript object to JSON text**, use `JSON.stringify()`:

```js
let crew = {name: "T'Pol", species: "Vulcan", station: "Science Officer"};
*let crewJson = JSON.stringify(crew);
console.log(crewJson);
// "{"name":"T'Pol","species":"Vulcan","station":"Science Officer"}"
```

To do the opposite, that is create a JavaScript object from JSON text, use `JSON.parse()`:

```js
let crewJson = '{"name": "Travis", "species": "Human", "station": "Helm"}';
*let crew = JSON.parse(crewJson);
console.log(crew);
// Object {name: "Travis", species: "Human", station: "Helm"}
```

## Resources

- A re-introduction to JavaScript
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
- Inheritance and the prototype chain
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain
- Introduction to Object-Oriented JavaScript
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript
- JavaScript objects in detail
  http://javascriptissexy.com/javascript-objects-in-detail
- Complete list of native Array methods
  https://www.w3schools.com/jsref/jsref_obj_array.asp

[caniuse-es6]: https://caniuse.com/#search=es6
[array-functions]: https://www.w3schools.com/jsref/jsref_obj_array.asp
[babel]: http://babeljs.io
[chrome]: https://www.google.com/chrome/
[es]: https://en.wikipedia.org/wiki/ECMAScript
[es6]: http://es6-features.org/
[es8]: http://2ality.com/2016/02/ecmascript-2017.html
[es9]: http://2ality.com/2017/02/ecmascript-2018.html
[es2019]: http://2ality.com/2018/02/ecmascript-2019.html
[es2020]: https://2ality.com/2019/12/ecmascript-2020.html
[ex-function-as-argument]: http://codepen.io/AlphaHydrae/pen/dNBpPv?editors=0010
[first-class-functions]: https://en.wikipedia.org/wiki/First-class_function
[func-prog]: https://en.wikipedia.org/wiki/Functional_programming
[js-arrow-functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
[js-async]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
[js-async-iteration]: http://2ality.com/2016/10/asynchronous-iteration.html
[js-destructuring-assignment]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
[js-generators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
[js-imports]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
[js-iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
[js-loops]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration
[js-promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[js-proxy]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
[js-shared-memory]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
[js-typeof-null]: http://www.2ality.com/2013/10/typeof-null.html
[js-symbol]: https://developer.mozilla.org/en-US/docs/Glossary/Symbol
[json]: http://www.json.org/
[foreach-doc]: https://www.w3schools.com/jsref/jsref_forEach.asp
[concat-doc]: https://www.w3schools.com/jsref/jsref_concat_array.asp
[find-doc]: https://www.w3schools.com/jsref/jsref_find.asp
[pop-doc]: https://www.w3schools.com/jsref/jsref_pop.asp
[push-doc]: https://www.w3schools.com/jsref/jsref_push.asp
[slice-doc]: https://www.w3schools.com/jsref/jsref_slice_array.asp
[reverse-doc]: https://www.w3schools.com/jsref/jsref_reverse.asp
[webpack]: https://webpack.js.org/

repository: MediaComem/comem-masrad-dfa

repo_name: MediaComem/comem-masrad-dfa


text:
# emacs-fast-loader

A fast emacs init loader like init-loader.el.

## Requirements

`fast-loader` depends on the following shell commands.

* cd
* cat
* sed

## Installation

Install `fast-loader.el` to load-path directory.

## Usage

For example, the following represents init files tree.

```
~/.emacs.d
      |--- inits
      |      |---- 00-init.el
      |      |---- 01-packages.el
      |      |---- 02-theme.el
      |     ...
      |--- init.el
     ...
```

The following code enables `fast-loader` and loads `inits/*.el`.

```
(require 'fast-loader)
(fast-loader-load "~/.emacs.d/inits")
```

`fast-loader` concatenates `inits/*.el` and save it as `~/.emacs.d/fast-loader-cache/inits.el`.

The concatenated file is updated automatically if you modify `inits/*.el`.

### Auto byte compile

```
 (custom-set-variables '(fast-loader-byte-compile t))
```

## Performance

Measuring condition:

* one init file consists of one function and 10 lines
* measure load time using `emacs-init-time`

### Disable byte compile

|   loader    | num of init files | time(sec) |
|:-----------:|:-----------------:|:---------:|
| fast-loader | 10                | 1.0       |
| fast-loader | 100               | 1.0       |
| fast-loader | 1000              | 1.1       |
| init-loader | 10                | 1.0       |
| init-loader | 100               | 1.1       |
| init-loader | 1000              | 2.7       |

### Enable byte compile

|   loader    | num of init files | time with compile(sec) | time(sec) |
|:-----------:|:-----------------:|:----------------------:|:---------:|
| fast-loader | 10                | 1.5                    | 1.0       |
| fast-loader | 100               | 3.0                    | 1.0       |
| fast-loader | 1000              | 28.4                   | 1.1       |
| init-loader | 10                | 2.0                    | 1.0       |
| init-loader | 100               | 5.5                    | 1.1       |
| init-loader | 1000              | 48.7                   | 2.7       |

## Contribution

1. Fork it ( http://github.com/nabeix/emacs-fast-loader )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request

## License

MIT

repository: nabeix/emacs-fast-loader

repo_name: nabeix/emacs-fast-loader


text:
---
layout: post
title: Pre Historic India
description: Notes on Ancient Indian History Harappan culture Indus Valley
summary: collection of short notes on Indus valley civilization Harappa and Ancient Indian History
tags: AncientHistory
---

# the Prehistoric Period
 -  Paleolithic
 -  Mesolithic
 -  Neolithic and
 -  Metal age.

## paleolithic or old stone age
- Hunting and gathering prevalent
- stone tools hand sized and flacked off large pables
- Period before 10000 BC

## mesolithic or middle stone age
- 10000 BC  - 6000 BC
- Langhanj (Gujarat),Adamgarh (MP)

- Hunter Gatheres
- Microliths , Painted and engraved rock shelters , Microliths
-  Animal bones - dog , deer, boar, ostrich

## Neolithic Age
- 6000BC - 4000 BC
kashmir Valley, Chirand (Bihar), Belan Valley (Uttar Pradesh)
- Maski, Brahmgiri, Hallur, Kodekal (Karnataka)
- Paiyampalli (Tamilnadu)
- Utnur (Andhra Pradesh)
- Agriculture, Domestication of animals, polishing stone tools, pottery
- emergence of village
- burials of the dead
- used clothes of cotton and wool

## chalcolithic period
- copper and bronze came to use
- smelting metal ore and crafting metal artifact's
- microlithic tools continued
- ==Harappan culture = chalcolithic period[[Pre Historic India#chalcolithic period]]==
- copper objects , beads, terracotta, pottery -Paiyampalli (Tamilnadu)
- chalcolithic followed by iron age.
-


text:
# Home assistant add-on: calibre

[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)

![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fcalibre%2Fconfig.json)
![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fcalibre%2Fconfig.json)
![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fcalibre%2Fconfig.json)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
[![GitHub Super-Linter](https://github.com/alexbelgium/hassio-addons/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![Builder](https://github.com/alexbelgium/hassio-addons/workflows/Builder/badge.svg)](https://github.com/alexbelgium/hassio-addons/actions/workflows/builder.yaml)

[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white

_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_

[![Stargazers repo roster for @alexbelgium/hassio-addons](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.github/stars2.svg)](https://github.com/alexbelgium/hassio-addons/stargazers)

![downloads evolution](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/calibre/stats.png)

## About

---

[Calibre](https://calibre-ebook.com/) is a powerful and easy to use e-book manager. Users say it’s outstanding and a must-have. It’ll allow you to do nearly everything and it takes things a step beyond normal e-book software. It’s also completely free and open source and great for both casual users and computer experts.

This addon is based on the docker image https://github.com/linuxserver/docker-calibre

## Installation

---

The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.

1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
   [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Set the add-on options to your preferences
1. Start the add-on.
1. Check the logs of the add-on to see if everything went well.
1. Open the webUI and adapt the software options

## Configuration

---

Webui can be found at <http://your-ip:PORT>.
Configurations can be done through the app webUI, except for the following options.
Please read the upstream container documentation for further info : https://github.com/linuxserver/docker-calibre/blob/35b5e3ae06ba95f666687150ca5fd632b8db9e87/README.md#application-setup

In particular, the webserver and wireless connection needs to be manually enabled from the desktop app to be able to access it, using ports 8081 and 9090 respectively.

```yaml
PGID: user
GPID: user
TZ: timezone
PASSWORD: Optionally set a password for the gui
CLI_ARGS: Optionally pass cli start arguments to calibre
localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. ex. sda1, sdb1, MYNAS...
networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas
cifsusername: "username" # optional, smb username, same for all smb shares
cifspassword: "password" # optional, smb password
```

## Support

Create an issue on github

## Illustration

---

![illustration](https://calibre.com/img/slider/artistdetails.png)

[repository]: https://github.com/alexbelgium/hassio-addons

repository: baldarn/hassio-addons

gha_language: Dockerfile

repo_name: baldarn/hassio-addons


text:
## `::function_name`

Function attribute `#[named]` that generates a `function_name!` macro
in the scope of the function's body.

The generated `function_name!()` is a macro that expands to
the name of the annotated function, as a string literal.

[![Repository](https://img.shields.io/badge/repository-GitHub-brightgreen.svg)](
https://github.com/danielhenrymantilla/rust-function_name)
[![Latest version](https://img.shields.io/crates/v/function_name.svg)](
https://crates.io/crates/function_name)
[![Documentation](https://docs.rs/function_name/badge.svg)](
https://docs.rs/function_name)
[![MSRV](https://img.shields.io/badge/MSRV-1.45.0-white)](
https://gist.github.com/danielhenrymantilla/8e5b721b3929084562f8f65668920c33)
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](
https://github.com/rust-secure-code/safety-dance/)
[![no_std compatible](https://img.shields.io/badge/no__std-compatible-success.svg)](
https://github.com/rust-secure-code/safety-dance/)
[![License](https://img.shields.io/crates/l/function_name.svg)](
https://github.com/danielhenrymantilla/rust-function_name/blob/master/LICENSE-ZLIB)
[![CI](https://github.com/danielhenrymantilla/rust-function_name/workflows/CI/badge.svg)](
https://github.com/danielhenrymantilla/rust-function_name/actions)

### Examples

```rust
use ::function_name::named;

#[named]
fn my_super_duper_function ()
{
    assert_eq!(
        function_name!(),
        "my_super_duper_function",
    );
}
```

Since the generated `function_name!` expands to a string literal,
it can be used with other macros such as [`concat!`](
https://doc.rust-lang.org/std/macro.concat.html):

```rust
#[macro_use] extern crate function_name;

macro_rules! function_path {() => (concat!(
    module_path!(), "::", function_name!()
))}

pub mod foo {
    pub mod bar {
        #[named]
        pub fn baz ()
        {
            assert_eq!(
                function_path!(),
                [
                    env!("CARGO_PKG_NAME"),
                    "foo", "bar",
                    "baz",
                ].join("::"),
            );
        }
    }
}
```

[Repository]: https://github.com/danielhenrymantilla/rust-function_name
[Documentation]: https://docs.rs/function_name
[crates.io]: https://crates.io/crates/function_name

license: MIT,Zlib

detected_licenses: MIT Zlib

gha_language: Rust


text:
# Canteen

[![Build Status](https://gitlab.com/jeffdn/rust-canteen/badges/master/pipeline.svg)](https://gitlab.com/jeffdn/rust-canteen/pipelines) [![Latest Version](https://img.shields.io/crates/v/canteen.svg)](https://crates.io/crates/canteen)

## Description

Canteen is the first project that I'm implementing in Rust. It's a clone of
[Flask](http://flask.pocoo.org), my very favorite Python web framework. There is code for
an example implementation in the [canteen-impl](https://gitlab.com/jeffdn/canteen-impl)
repository.

## Usage

It's by no means complete, but I'm working on it, and it's now available on
[crates.io](https://crates.io/)! To install and check it out, add the following to
your Cargo.toml:

```toml
[dependencies]
canteen = "0.5"
```

The principle behind Canteen is simple -- handler functions are defined as simple
Rust functions that take a `Request` and return a `Response`. Handlers are then attached
to one or more routes and HTTP methods/verbs. Routes are specified using a simple
syntax that lets you define variables within them; variables that can then be
extracted to perform various operations. Currently, the following variable types can
be used:

- `<str:name>` will match anything inside a path segment, returns a `String`
- `<int:name>` will return a signed integer (`i32`) from a path segment
  - ex: `cnt.add_route("/api/foo/<int:foo_id>", &[Method::Get], my_handler)` will match
  `"/api/foo/123"` but not `"/api/foo/123.34"` or `"/api/foo/bar"`
- `<uint:name>` will return an unsigned integer (`u32`)
- `<float:name>` does the same thing as the `int` parameter definition, but matches numbers
with decimal points and returns an `f32`
- `<path:name>` will greedily take all path data contained, returns a `String`
  - ex: `cnt.add_route("/static/<path:name>", &[Method::Get], utils::static_file)` will
  serve anything in the `/static/` directory as a file

After the handlers are attached to routes, the next step is to simply start the
server. Any time a request is received, it is dispatched with the associated handler
to a threadpool worker. The worker notifies the parent process when it's finished,
and then the response is transmitted back to the client. Pretty straightforward stuff!

## Example

```rust
extern crate canteen;

use canteen::*;
use canteen::utils;

fn hello_handler(req: &Request) -> Response {
    let mut res = Response::new();

    res.set_status(200);
    res.set_content_type("text/plain");
    res.append("Hello, world!");

    res
}

fn double_handler(req: &Request) -> Response {
    let to_dbl: i32 = req.get("to_dbl");

    /* simpler response generation syntax */
    utils::make_response(format!("{}", to_dbl * 2), "text/plain", 200)
}

fn main() {
    let cnt = Canteen::new();

    // bind to the listening address
    cnt.bind(("<IP_ADDRESS>", 8080));

    // set the default route handler to show a 404 message
    cnt.set_default(utils::err_404);

    // respond to requests to / with "Hello, world!"
    cnt.add_route("/", &[Method::Get], hello_handler);

    // pull a variable from the path and do something with it
    cnt.add_route("/double/<int:to_dbl>", &[Method::Get], double_handler);

    // serve raw files from the /static/ directory
    cnt.add_route("/static/<path:path>", &[Method::Get], utils::static_file);

    cnt.run();
}
```

repository: jeffdn/rust-canteen

repo_name: jeffdn/rust-canteen


text:
# MoDetect

This application will take audio input base-band from any digital RF transmission and automatically detect the transmission mode. Content of the signal is not demodulated or interpreted, only the signal mode, such as CW, PSK31, RTTY, JT-65, etc. will be detected. This will be accomplished by decomposing the audio signal into its FFT signature over time. Then a basic Markov-chain analysis will compare the transition matrix' signature with the typical one for each mode until a match is found. Once frequency deltas & durations are generated (at random for now), a right-stochastic transition matrix shows a normalised count of occurrences of states going from the row-value to the column-value in the sample. A colour-based graph visualises this same information using coloured dots whose value ranges can be calibrated in real time using a slider.

## Status
The source code is currently implemented using the Qt platform.  I'm currently still working on the Digital Signal Processing portion and it will be uploaded in late April 2018. Meanwhile, the user interface and signal-generation simulator compile and work well as a demo of the concept.

## Next Steps
Generating actual data from digital signal processing (DSP) by performing a fast Fourier transform (FFT) analysis to retrieve frequency information over a real-time audio sample. Then, I will incorporate the actual mechanism that will store transition matrices for each signal type and allow a comparison for signal ID.

## Environment
I've compiled this using Qt Creator 4.5.1 (Based on Qt 5.10.1) and compiling using MSVC 2015, 64-bits on x86. Even though I haven't yet put much effort on portability at this early stage of the implementation, your comments on any portability issues you encounter are most welcome.

## Language Features, Classes, Techniques

- C++
- Qt Widgets
- Qt Signal/Slot communications
- Qt Widget promotion
- Unconventional User Interface
- Use of STL containers such as std::vector<>, std::map<>
- Use of Placement New memory allocation (rarely used) to allocate a contiguous block of memory for the matrix.
- Real-time programming and example of using the std::chrono STL templates.
- Digital Signal Processing (DSP)

# Installation
 Simply compile all the code in Qt Creator using all files in the same directory.

# License
All the source code in this Repository is original and its licensing is modeled after the MIT License (https://opensource.org/licenses/MIT)

Copyright 2018 Roger M. Delisle

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

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

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

repository: RogerDelisle/MoDetect

repo_name: RogerDelisle/MoDetect


text:
---
title: "How to set up Gmail with a desktop mail clients"
date: 2011-02-24T15:06:36+05:45
last_modified_at: 2016-07-09T17:31:09+05:45
---

We can set-up Gmail in different desktop email clients like Microsoft Outlook, Apple Mail, or Mozilla Thunderbird. In fact, any email address which lets you enable POP/IMAP can be set up in such mail clients. I recommend using IMAP if possible because it's the best way to make sure you can see all your mail at any time on all of your devices.

To use Gmail in mail clients, first of all, you will need to enable POP/IMAP in Gmail. To do so, go to settings and click on the Forwarding and POP/IMAP tab and select enable POP or IMAP for all mail. Enable POP for mail that arrives from now on or select IMAP if you want to import your old mails and also want to sync all mails on all of your devices as well.

Next, open Outlook, go to Tools and click on email accounts, select the 'Add New Account' and click next. Then select POP/IMAP in the type of server. Then you will need to enter the specifications for Gmail. Enter your own username and password and fill out the following details in the respective fields:

####  Incoming Mail POP (Post Office Protocol) Server

POP creates local copies of emails and deletes the originals from the server, the emails are tied to that specific machine, and cannot be accessed via any webmail or any separate client on other computers.

Server: `pop.gmail.com`
Port: 995
Requires SSL: Yes

#### Incoming Mail IMAP (Internet Message Access Protocol) Server

Compared to POP, IMAP allows users to log into many different email clients or webmail interfaces and view the same emails, because the emails are kept on remote email servers until the user deletes them. In a world where we now check our email on web interfaces, email clients, and on mobile phones, IMAP has become extremely popular.

Server: `imap.gmail.com`
Port: 993
Requires SSL: Yes

#### Outgoing Mail SMTP (Simple Mail Transfer Protocol) Server

SMTP is an Internet standard for electronic mail (email) transmission. SMTP by default uses TCP port 25. The protocol for mail submission is the same, but uses port 587. SMTP connections secured by SSL, known as SMTPS, default to port 465 (nonstandard, but sometimes used for legacy reasons).

Server: `smtp.gmail.com`
Port: 465 or 587
Requires SSL: Yes
Requires authentication: Yes

#### Your login info

Full Name or Display Name: [your name]
Email address: Your full email address<EMAIL_ADDRESS>
Password: Your account's password
Requires authentication: Yes

#### Other resources

* [Use Gmail with Outlook, Apple Mail, or other mail clients](https://support.google.com/mail/topic/3398031?hl=en) --- Gmail Help


text:
# Astroid Clone on Godot 3.1

Want to get started with Godot Engine but don't know where to start? In that case, this code base might help you.
This repository is primarily used for my YouTube tutorial series on Godot 3.1 (stable). With this code base, you'll learn how to:

* Create your own games with Godot Engine and gain confidence.
* Master GDScript, Godot's custom scripting language that strikes the balence between performance and convinience.
* Prototype games rapidly for game jams.
* Organize your game assets for better accessability and productivity.


text:
---
date: 2020-03-03
title: Team descriptions
topics: [teams]
author: hadihariri
subtitle: Let others know what your team does!
thumbnail: ./thumbnail.png
cardThumbnail: ./card.png
shortVideo:
  poster: ./preview.png
  url: https://youtu.be/bAXgKWoQLno
leadin: |
    **What is your team doing?**

    By providing a description on your team page, this information will be available to anyone that visits it.

    List key focus areas, and let others know what your team does!

    [More about team descriptions...](https://www.jetbrains.com/help/space/edit-the-team-description.html)
---


text:
# Contributing

This repository uses a pre-commit configuration with isort and black. There are tools
in the Tools directory that you can move to the root of this project and make style
adjustments to your code before contributing.

You may also add your github username into the Misc/contrib.diff file.

repository: OceanScript-Devs/OceanScript

gha_language: Python

repo_name: OceanScript-Devs/OceanScript