text:
Attending: timmywil, dmethvin, markelog, gibson042

Location: https://gitter.im/jquery/meeting

## mgol gone 1 more week

## 3.2 Progress
* Issues with needs review
  - https://github.com/jquery/jquery/issues?q=is%3Aopen+is%3Aissue+label%3A%22Needs+review%22
* https://github.com/jquery/jquery/issues/3438
  - Makes sense to me. Don’t process if processData is false.
  - Assigned to Dave for 3.2
* https://github.com/jquery/jquery/issues/3434
  - What’s the fix?
  - Markelog to look into it

## PRs
* https://github.com/jquery/jquery/pulls?q=is%3Aopen+is%3Apr+milestone%3A3.2.0
* https://github.com/jquery/jquery/pull/3489 ensure iframes get jQuery
  - Merged
* https://github.com/jquery/jquery/pull/3463 > tbody
  - Merged
* https://github.com/jquery/jquery/pull/3470 Callbacks.add - locking
  - Merged, but requires followup
* https://github.com/jquery/jquery/pull/3496 Followup: snowballing effects fixes
  - LGTM
* https://github.com/jquery/jquery/pull/3487 offset + position
  - Do we care about html + getBoundingClientRect? Not really.
* https://github.com/jquery/jquery/pull/3462 contents(template)
  - Markelog to follow up
* https://github.com/jquery/jquery/pull/3483 isWindow and toString.call
  - Does this work everywhere? Do we approve?

## The API site
* Especially important: issues in the 3.0.0 milestone: https://github.com/jquery/api.jquery.com/milestone/2

## Migrate
* https://github.com/jquery/jquery-migrate/milestone/9 3.2.0


text:
# SnakeGame
This is the classical game Snake using Pygame
surface.py provides the class that will build up the game screen and making drawings on the screen
snake.py provides the class that will create the snake for the user
apple.py provides the class that will create the apple/snack to eat to grow the snake
main.py allows the options for two player. Set player to 2 for two player

Player 1 keys:
left: left arrow,
right: right arrow,
up: up arrow,
down: down arrow

Player 2 keys:
left: a key
right: d key
up: w key
down: s key

# GUI element
The program has a homescreen which will allow users to choose between single player or double player.
If the game ends, players will be sent back to the home screen.

license: MIT

repository: BozeBro/Snake-Game-and-two-player

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: BozeBro/Snake-Game-and-two-player


text:
[![Build Status](https://travis-ci.org/asottile/future-breakpoint.svg?branch=master)](https://travis-ci.org/asottile/future-breakpoint)
[![Build status](https://ci.appveyor.com/api/projects/status/4b6qu7v13vxc3tue/branch/master?svg=true)](https://ci.appveyor.com/project/asottile/future-breakpoint/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/asottile/future-breakpoint/badge.svg?branch=master)](https://coveralls.io/github/asottile/future-breakpoint?branch=master)

future-breakpoint
=================

A backport of `breakpoint` to python<3.7.

## install

`pip install future-breakpoint`

## supported versions

python2.7+, python3+, (noop on python3.7+)

## usage

Once installed, you should be able to use `breakpoint()` in the same way as in
python3.7+.

```python
def rand():
    breakpoint()  # no need for `import pdb; pdb.set_trace()`
    return 4
```

See [PEP 553](https://www.python.org/dev/peps/pep-0553/) for full usage!

## how though?

- a C extension which implements the PEP
- a `.pth` file executed on startup (see setup.py) patches `sys` / `builtins`

## you may also like

- [future-fstrings](https://github.com/asottile/future-fstrings)

repository: jaysonsantos/future-breakpoint

gha_language: Python

gha_license_id: MIT

repo_name: jaysonsantos/future-breakpoint


text:
# Census-Data: Predicting Salary Range

## Motivation
The goal of this supervised machine learning algorithm is to decide which socioeconomic factors will reliably predict whether an individual makes less than or more than $50,000 yearly. The dataset being used is found on UCI’s machine learning repository and was collected in 1994.

For context, $50,000 in 1994 is the rough equivalent of $87,000 in 2020. Calculations made on this
website.

# Table of contents
1. [What to Expect](#expect)
2. [Code Style](#codestyle)
3. [Package Manager](#package)
4. [IDE](#ide)
5. [Dataset Download](#dataset)
6. [Feature Engineering](#feature)
7. [Preprocessing Visualization](#preprocessing)
    - [Correlations](#corr)
    - [Education and Age Distribution](#eduage)
    - [Hours/week Distribution](#hrs)
8. [Algorithms and Results](#algorithms)
9. [Troubleshooting](#troubleshooting)
10. [License](#license)

## What to Expect
In addition to the dataframes saved and uploaded as csv files, I have compiled each phase of building the algorithm, from preprocessing to model evaluation, across the following files:

File 1: Data introduction + cleanup + feature engineering

File 2: Data exploration

File 3: Images from data exploration

File 4: Training labeled data on K Nearest Classifier

File 5: Training labeled data on Decision Forest Classifier

File 6: Training labeled data on Logistic Regression Classifier

## Code Style
Python version 3.7.4.

## Package manager
Anaconda with the following download tutorial.

## IDE
Jupyter Notebook, which is downloaded when Anaconda is downloaded.

## Dataset Download
UCI Machine Learning Repository.  Raw data is also uploaded as csv file above. Cleaned up versions are found as completeDF.csv, and normalized, scalar version of data is found in featDF.csv.

## Feature Engineering

Age

Workclass

Education

Education Number (numerical ranking of education)

Marital Status

Occupation

Relationship

Race

Sex

Capital Gain

Capital Loss

Country of Origin

Salary Label

## Preprocessing Visualization

### Correlations
From the initial correlation heatmap below, we understand that "educationnum" has the highest correlation with the salary label amongst the given features. We should be mindful that the absolute value of this correlation (.33) isn't so convincing that we'll find a strong correlation. For now, we should rely on "educationnum" as the guiding feature for our initial visualization.

From here, we took a closer look at how correlation varies within a description. For example, if two individuals overlap in major factors (i.e. education, workclass, and hours per week are the same), could there still be a discrepancy if one person is a spouse, while the other lives alone. I broke it down by race, marital status, workclass, and relationship below.

![](images_folder/heatmap.png)

![](images_folder/maritalstatus_corr.png)
![](images_folder/occupation_corr.png)
![](images_folder/race_corr.png)
![](images_folder/workclass_corr.png)
![](images_folder/relationship_corr.png)

### Education and Age Distribution

With these next two bar graphs, we can better understand the relative distribution of education level contributing to the overall database.

![](images_folder/agecount_eachgroup.png)

The general curve for age count in the <50K group resembles the total count, whereas we see the mean of the >50K shift towards the right. We also notice a larger volume of people in the >50K than in the <50K group.

![](images_folder/educationcount_eachgroup.png)

### Hours/Week Distributions

The next logical step was to combine how both age and hours per week worked can predict the salary label. It's interesting to see how a person can work an upwards of 60+ hours per week and not make it to the >50k yearly salary. In the other group, it looks like the hours are clustered between 35 and 65 hours per week. This could indicate that we eventually need a closer look into the occuption sector for each group.

![](images_folder/scatter_salaryagecapgain.png)
![](images_folder/scatter_salaryageeducation.png)
![](images_folder/scatter_salaryagehours.png)

## Algorithms and Results

K Nearest Classifier

 We found that 36 was the best K for our dataset to use for the K Nearest Neighbors Algorithm.

 Train score = 84.07%

 Test score = 83.51%

## Troubleshooting

For the future:

 I would like to use the same training algorithm and run it across varying cities using the 2020 census. I'd be curious to see how feature weights could vary across major cities, and eventually see whether there's variance between the 1994 and 2020 census. I'd also want to change the question of how much a household makes, to intead explore how the US Census affects local funding (i.e. any differences in school funding from block-to-block.)

## License
MIT


text:
# Distributed Consensus: an introduction

This repo contains materials for a presentation I created to introduce
a generally technical audience to the topic of fail-stop
(non-Byzantine) distributed consensus algorithms.

The slides can be accessed directly from [here](https://storage.googleapis.com/consensus-intro-talk/slides.pdf).

There are three interactive visualizations/animations included:

 - [State Machine Log Replication](https://storage.googleapis.com/consensus-intro-talk/state-machines.html)
 - [Happy Path Update Workflow](https://storage.googleapis.com/consensus-intro-talk/cluster.html)
 - [Leader Recovery Workflow](https://storage.googleapis.com/consensus-intro-talk/recovery-simple.html)

repository: tonyastolfi/consensus-intro-talk

repo_name: tonyastolfi/consensus-intro-talk


text:
{{{
  "title": "Supported Browsers for the Control Portal",
  "date": "11-26-2013",
  "author": "Richard Seroter",
  "attachments": [],
  "contentIsHTML": false
}}}

The Lumen Cloud Control Portal is designed to work consistently across all major modern web browsers.

Minimum version browser support:

* [Microsoft Internet Explorer](http://windows.microsoft.com/en-US/internet-explorer/download-ie) (versions 9+) on Windows
* [Google Chrome](https://www.google.com/intl/en/chrome/browser/) (latest version) on Windows and Mac
* [Firefox](http://www.mozilla.org/en-US/firefox/) (latest version) on Windows and Mac
* [Safari](http://www.apple.com/safari/) (latest version) on Mac

If you observe any unexpected behavior or user interface issues in the supported browsers, please send a ticket to the NOC for further investigation.

repository: AnthonyHakim/PublicKB

gha_license_id: NOASSERTION

repo_name: AnthonyHakim/PublicKB


text:
---
layout: post
title:  "Presentation on Angular Animation"
date:   2017-05-27
categories: blog
seo__desc: presentation given by Jason Hodges on Angular Animation.
seo__key: Angular 4, animation, presentation, Angular
---

Click [here]((http://jasonhodges.me/angular-animation){:target="_blank"}) for a presentation I put together and gave at work for a lunch & learn.
Use the left / right arrow keys on your keyboard to navigate the slides. Works best in Google Chrome.

repository: jasonhodges/ngx-blog

gha_language: JavaScript

repo_name: jasonhodges/ngx-blog


text:
# Sabertoooth

This is a repo for studying purposes only.

## General Information

Contains a base project using OpenGL, GLEW and GLFW to build projects upon.

SOIL and GLM, as well as a class for Shader compiling, are already included.

## Instructions

1. Open Visual Studio
2. Click on "Open Project/Solution"
3. Go to the folder where you downloaded this project
4. Select "Sabertooth.sln"

### Windows SDK error

1. Under "Solution Explorer", right-click the solution and select "Retarget Solution"
2. Select your Windows SDK

repository: brunocamboim/opengl-tileset-tilemap

repo_name: brunocamboim/opengl-tileset-tilemap


text:
In this project the future price of the stock is calculated by analyzing the current data.

## Technique 1

Linear Regression - Simple Linear Regression is used to predict the stock price

## Technique 2

Neural Networks - ANN is used to predict the stock price

gha_language: Jupyter Notebook


text:
<!--
This file is part of BenchExec, a framework for reliable benchmarking:
https://github.com/sosy-lab/benchexec

SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>

SPDX-License-Identifier: Apache-2.0
-->

# BenchExec
## A Framework for Reliable Benchmarking and Resource Measurement

[![Build Status](https://gitlab.com/sosy-lab/software/benchexec/badges/main/pipeline.svg)](https://gitlab.com/sosy-lab/software/benchexec/pipelines)
[![Apache 2.0 License](https://img.shields.io/badge/license-Apache--2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![PyPI version](https://img.shields.io/pypi/v/BenchExec.svg)](https://pypi.python.org/pypi/BenchExec)
[![DOI](https://zenodo.org/badge/30758422.svg)](https://zenodo.org/badge/latestdoi/30758422)

**News and Updates**:
- Linux kernel 5.11 finally [makes it possible](https://github.com/sosy-lab/benchexec/blob/main/doc/INSTALL.md#kernel-requirements) to use all BenchExec features on distributions other than Ubuntu!
- We now provide an [Ubuntu PPA](https://launchpad.net/~sosy-lab/+archive/ubuntu/benchmarking) that makes installing and upgrading BenchExec easier ([docs](https://github.com/sosy-lab/benchexec/blob/main/doc/INSTALL.md#debianubuntu)).
- An extended version of our paper on BenchExec and its background was published as open access in the journal STTT,
  you can read [Reliable Benchmarking: Requirements and Solutions](https://doi.org/10.1007/s10009-017-0469-y) online.
  We also provide a set of [overview slides](https://www.sosy-lab.org/research/prs/Latest_ReliableBenchmarking.pdf).

BenchExec provides three major features:

- execution of arbitrary commands with precise and reliable measurement
  and limitation of resource usage (e.g., CPU time and memory),
  and isolation against other running processes
- an easy way to define benchmarks with specific tool configurations
  and resource limits,
  and automatically executing them on large sets of input files
- generation of interactive tables and plots for the results

Unlike other benchmarking frameworks,
BenchExec is able to reliably measure and limit resource usage
of the benchmarked tool even if the latter spawns subprocesses.
In order to achieve this,
it uses the [cgroups feature](https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt)
of the Linux kernel to correctly handle groups of processes.
For proper isolation of the benchmarks, it uses (if available)
Linux [user namespaces](http://man7.org/linux/man-pages/man7/namespaces.7.html)
and an [overlay filesystem](https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt)
to create a [container](https://github.com/sosy-lab/benchexec/blob/main/doc/container.md)
that restricts interference of the executed tool with the benchmarking host.
BenchExec is intended for benchmarking non-interactive tools on Linux systems.
It measures CPU time, wall time, and memory usage of a tool,
and allows to specify limits for these resources.
It also allows to limit the CPU cores and (on NUMA systems) memory regions,
and the container mode allows to restrict filesystem and network access.
In addition to measuring resource usage,
BenchExec can verify that the result of the tool was as expected,
and extract further statistical data from the output.
Results from multiple runs can be combined into CSV and interactive HTML tables,
of which the latter provide scatter and quantile plots
(have a look at our [demo table](https://sosy-lab.github.io/benchexec/example-table/svcomp-simple-cbmc-cpachecker.table.html)).

BenchExec works only on Linux and needs a one-time setup of cgroups by the machine's administrator.
The actual benchmarking can be done by any user and does not need root access.

BenchExec was originally developed for use with the software verification framework
[CPAchecker](https://cpachecker.sosy-lab.org)
and is now developed as an independent project
at the [Software Systems Lab](https://www.sosy-lab.org)
of the [Ludwig-Maximilians-Universität München (LMU Munich)](https://www.uni-muenchen.de).

### Links

- [Documentation](https://github.com/sosy-lab/benchexec/tree/main/doc/INDEX.md)
- [Demo](https://sosy-lab.github.io/benchexec/example-table/svcomp-simple-cbmc-cpachecker.table.html) of a result table
- [Downloads](https://github.com/sosy-lab/benchexec/releases)
- [Changelog](https://github.com/sosy-lab/benchexec/tree/main/CHANGELOG.md)
- [BenchExec GitHub Repository](https://github.com/sosy-lab/benchexec),
  use this for [reporting issues and asking questions](https://github.com/sosy-lab/benchexec/issues)
- [BenchExec at PyPI](https://pypi.python.org/pypi/BenchExec)
- [BenchExec at Zenodo](https://doi.org/10.5281/zenodo.1163552): Each release gets a DOI such that you can reference it from your publications and artifacts.

### Literature

- [Reliable Benchmarking: Requirements and Solutions](https://doi.org/10.1007/s10009-017-0469-y), by D. Beyer, S. Löwe, and P. Wendler.  International Journal on Software Tools for Technology Transfer (STTT), 21(1):1-29, 2019. [doi:10.1007/s10009-017-0469-y](https://doi.org/10.1007/s10009-017-0469-y). Journal paper about BenchExec (open access, also with a [supplementary webpage](https://www.sosy-lab.org/research/benchmarking/) and [overview slides](https://www.sosy-lab.org/research/prs/Latest_ReliableBenchmarking.pdf))
- [CPU Energy Meter: A Tool for Energy-Aware Algorithms Engineering](https://doi.org/10.1007/978-3-030-45237-7_8), by D. Beyer and P. Wendler. In Proc. TACAS 2020, part 2, LNCS 12079, pages 126-133, 2020. Springer. [doi:10.1007/978-3-030-45237-7_8](https://doi.org/10.1007/978-3-030-45237-7_8)
- [Benchmarking and Resource Measurement](https://doi.org/10.1007/978-3-319-23404-5_12), by D. Beyer, S. Löwe, and P. Wendler. In Proc. SPIN 2015, LNCS 9232, pages 160-178, 2015. Springer. [doi:10.1007/978-3-319-23404-5_12](https://doi.org/10.1007/978-3-319-23404-5_12)

### License and Copyright

BenchExec is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0),
copyright [Dirk Beyer](https://www.sosy-lab.org/people/beyer/).
Exceptions are some tool-info modules
and third-party code that is bundled in the HTML tables,
which are available under several other free licenses
(cf. [folder `LICENSES`](https://github.com/sosy-lab/benchexec/tree/main/LICENSES)).

### Authors
Maintainer: [Philipp Wendler](https://www.philippwendler.de)

Contributors:
- [Aditya Arora](https://github.com/alohamora)
- [Dirk Beyer](https://www.sosy-lab.org/people/beyer/)
- [Laura Bschor](https://github.com/laurabschor)
- [Thomas Bunk](https://github.com/TBunk)
- [Montgomery Carter](https://github.com/MontyCarter)
- [Andreas Donig](https://github.com/adonig)
- [Karlheinz Friedberger](https://www.sosy-lab.org/people/friedberger)
- Peter Häring
- [Florian Heck](https://github.com/fheck)
- [Hugo](https://github.com/hugovk)
- [George Karpenkov](http://metaworld.me/)
- [Mike Kazantsev](http://fraggod.net/)
- [Michael Lachner](https://github.com/lachnerm)
- [Thomas Lemberger](https://www.sosy-lab.org/people/lemberger/)
- [Sebastian Ott](https://github.com/ottseb)
- Stefan Löwe
- [Stephan Lukasczyk](https://github.com/stephanlukasczyk)
- [Alexander von Rhein](http://www.infosun.fim.uni-passau.de/se/people-rhein.php)
- [Alexander Schremmer](https://www.xing.com/profile/Alexander_Schremmer)
- [Dennis Simon](https://github.com/DennisSimon)
- [Andreas Stahlbauer](http://stahlbauer.net/)
- [Thomas Stieglmaier](https://stieglmaier.me/)
- [Martin Yankov](https://github.com/marto97)
- [Ilja Zakharov](https://github.com/IljaZakharov)
- and [lots of more people who integrated tools into BenchExec](https://github.com/sosy-lab/benchexec/graphs/contributors)

### Users of BenchExec

BenchExec was successfully used for benchmarking in all instances
of the international competitions on [Software Verification](https://sv-comp.sosy-lab.org)
and [Software Testing](https://test-comp.sosy-lab.org)
with a wide variety of benchmarked tools and hundreds of thousands benchmark runs.
It is integrated into the cluster-based logic-solving service
[StarExec](https://www.starexec.org/starexec/public/about.jsp) ([GitHub](https://github.com/StarExec/StarExec)).

The developers of the following tools use BenchExec:

- [CPAchecker](https://cpachecker.sosy-lab.org), also for regression testing
- [Dartagnan](https://github.com/hernanponcedeleon/Dat3M)
- [SMACK](https://github.com/smackers/smack)
- [SMTInterpol](https://github.com/ultimate-pa/smtinterpol)
- [TriCera](https://github.com/uuverifiers/tricera)
- [Ultimate](https://github.com/ultimate-pa/ultimate)

If you would like to be listed here, [contact us](https://github.com/sosy-lab/benchexec/issues/new).

repository: sosy-lab/benchexec

branch_name: refs/heads/main

repo_name: sosy-lab/benchexec


text:
# syfodeploy-rs

`syfodeploy`, but in Rust!

## Installation

Currently, `syfodeploy-rs` is not on crates.io. You may install `syfodeploy-rs` by running `cargo install --path .` from within this repository.

If you have installed Rust via `rustup`, you may also want to have `~/.cargo/.bin` in your path.
```
export PATH="$HOME/.cargo/bin:$PATH"
```

To uninstall, you can run `cargo uninstall syfodeploy`

## Usage

* You can simply invoke `syfodeploy` to trigger a build with the current git repository as well as the current branch
* You may also trigger a build by running `syfodeploy your_project your_branch`, such as `syfodeploy sykefravaer master`

repository: navikt/syfodeploy-rs

repo_name: navikt/syfodeploy-rs


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

### Description

Unspecified vulnerability in Medtronic Paradigm wireless insulin pump 512, 522, 712, and 722 allows remote attackers to modify the delivery of an insulin bolus dose and cause a denial of service (adverse human health effects) via unspecified vectors involving wireless communications and knowledge of the device's serial number, as demonstrated by Jerome Radcliffe at the Black Hat USA conference in August 2011.  NOTE: the vendor has disputed the severity of this issue, saying "we believe the risk of deliberate, malicious, or unauthorized manipulation of medical devices is extremely low... we strongly believe it would be extremely difficult for a third-party to wirelessly tamper with your insulin pump... you would be able to detect tones on the insulin pump that weren't intentionally programmed and could intervene accordingly."

### POC

#### Reference
- http://www.darkreading.com/security/vulnerabilities/231300312/getting-root-on-the-human-body.html
- http://www.hanselman.com/blog/HackersCanKillDiabeticsWithInsulinPumpsFromAHalfMileAwayUmNoFactsVsJournalisticFearMongering.aspx
- http://www.scmagazineus.com/black-hat-insulin-pumps-can-be-hacked/article/209106/

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Multisig-Simplicity

## Description

MuSig implementation with [Simplicity](https://medium.com/chain-accelerator/i-tested-elements-simplicity-22c3189a725c).

The library is divided into several modules:
* The module `MuSig` contains the Simplicity script that check if a signature is valid for two given public keys.
* The module `Utils.SchnorrMuSig` contains all the expressions for manipulating keys and signature.
* The module `Utils.KeyGen` can be used to generate keypairs (not secure! only for testing)
* The module `Utils.Ty` defines all the types.
* The module `Utils.Secp256k1` implements usefull functions applying on secp256k's elements.
* The module `Utils.Scalar` provides utils for Scalar computations.
* The module `Test.DoubleSig` provides a bunch of data for testing purpose.

## Installation

1. Install the Simplicity library, on your device or inside a Nix environement: https://github.com/ElementsProject/simplicity.git (see the `Install` part for further details).
2. Then, move inside the cloned repo `multisig-simplicity` and launch `cabal update && cabal build`.
3. Finally, you can use `cabal repl` to test the library's functions.

license: Unlicense

repository: louisinger/multisig-simplicity

repo_name: louisinger/multisig-simplicity


text:
# InferredCrumpets

## 0.7.0

- [PLAT-1175] Update to Ruby 3.2

## 0.6.0

- [PLAT-183] Ruby 3.1, coveralls via github actions

## 0.5.0

- [TT-8631] Update to build with github actions / ruby 3.0 / rails 6.1

## 0.4.2

- [TT-6224] ActiveRecord::Base subjects can now take a custom crumb name

## 0.4.1

- [TT-5835] Fix crumb title for active record relation

## 0.4.0

- [TT-5807] Use crumb title for the subject name

## 0.3.0

- [TT-5087] Add parent to be displayed on index routes
- [TT-5088] Add ability to link to all actions

## 0.2.6

- [TT-4479] Added grandparent support

## 0.2.5

- [RU-145] Check for the Rails 5 ActionController::UrlGenerationError

## 0.2.4

- [TT-3102] Move url checking out into seperate class
- [TT-3102] Fix regression where subject routes where not build properly

## 0.2.3

- [TT-3117] Fix: NoMethodError when subject is not linkable

## 0.2.2

- [TT-3102] Fix: Show subject crumb even when action is not linkable

## 0.2.1

- [TT-2850] Fix: Don't link to actions that have no url

## 0.2.0

- Fix: shallow routes no longer cause a routing error
- Change: collection crumb not shown if a parent is set and the collection is shallow routed

## 0.1.2

- Fix: non-index collection actions now work

## 0.1.1

- Update: works with Crumpet 0.3.0

## 0.1.0

- Initial release

gha_language: Ruby


text:
# Talks
Resources used in my [talks](https://vladiliescu.net/talks).

* [Boy meets Girl](./Boy%20meets%20Girl)
* [Service versus Studio](./Service%20versus%20Studio)
* [Training Better Models Using Automated Machine Learning](./Training%20Better%20Models%20Using%20Automated%20Machine%20Learning)

repository: vladiliescu/talks

repo_name: vladiliescu/talks


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

### Description

Musical World v1 was discovered to contain an arbitrary file upload vulnerability via uploaded_songs.php. This vulnerability allows attackers to execute arbitrary code via a crafted PHP file.

### POC

#### Reference
- http://packetstormsecurity.com/files/166653/Musical-World-1-Shell-Upload.html
- https://github.com/D4rkP0w4r/Musical-World-Unrestricted-File-Upload-RCE-POC

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/D4rkP0w4r/D4rkP0w4r


text:
---
title: Hello World!
date: 2019-10-16T02:13:00.000Z
image: ''
tags:
  - Cecil
  - SSG
draft: false
---
![](/images/hello_world.jpeg)

For my first post, I have decided to do something that every programer learns in their introductory programming course. That's right; this is going to be a post on writing a 'Hello World!' program in python. However, writing such a program in python barely takes 10 seconds depending on your typing speed, instead let's write an evolutionary algorithm that will spell out "Hello World!" for us. Before we jump into coding; let's have a brief introduction to the genetic algorithm.

## What are Genetic Algorithms?

Genetic algorithms are tools that are used to find good sometimes even optimal solutions to problems that have billions of solutions. They were proposed by John Holland, his students and David E. Goldberg. Genetic algorithms encode a potential solution to a chromosome like data structure and apply recombination operations to preserve critical information. The basic principle on which genetic algorithm works reflects the process of natural selection.

![](/images/ga_1.jpg)

The process of natural selection starts with the selection of fittest individuals from a population. They produce offspring which inherit the characteristics of the parents and will be added to the next generation. If parents have better fitness, their offspring will be better than parents and have a better chance at surviving. This process keeps on iterating and at the end, a generation with the fittest individuals will be found.

![](/images/flow.jpg)

Genetic algorithms vary in their structure based on their purpose, but all of them share a few common components. The algorithm begins with initializing a population of individuals using default random values. Then, it runs each member of that population through a fitness function. Then the fittest member of the population is selected to reproduce, then the evaluations and reproduction process are repeated until the termination condition is realized. At termination, the algorithm presents a best member of the population.

#### Genes

Genetic algorithm needs a gene set to build upto the target variable. In this particular case, the genset will be the alphabets from a-z in both cases. Space, period, and exclamation (!) symbol are also included.

```python
import random  # To generate random samples
import datetime # To display the time taken to arrive at the solution

geneSet = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!."
target = "Hello World!"
```

#### Generate Parents

Although, the section is titled "Generate Parents" we are essentially initializing a population.

```python
# Function to generate random strings from the gene set.
# It takes in length as a parameter and returns the list of strings.

def generate_parent(length):
    genes = []               # Empty list to add the generated parents

# Run the loop until length of the genes list is less than the specified
# length parameter

    while len(genes) < length:

# Select the minimum of (length - len(genes)) and len(geneSet)
# and assign it to sampleSize

        sampleSize = min(length - len(genes), len(geneSet))

# random.sample returns a list of strings from geneSet equal to
# length of sample size. Add the elements to the empty list.

        genes.extend(random.sample(geneSet, sampleSize))
    return ''.join(genes)
```

#### Fitness Function

The fitness function provides feedback to guide the algorithm towards a solution. In this case, the fitness value is the total number of letters in the same position as that of the target variable.

```python
# Function that adds 1 incase the letters in guess and target match in
# position and case.

def get_fitness(guess):
    return sum(1 for expected, actual in zip(target, guess) if expected == actual)
```

#### Mutation

In certain new offspring formed, some of their genes can be subjected to a mutation with a low random probability. This implies that some of the bits in the bit string can be flipped. Mutation occurs to maintain diversity within the population and prevent premature convergence.

The following implementation converts the parent string to an array with `list(parent)`, then replaces 1 letter in the array with a randomly selected one from `geneSet` and finally recombines the result into a string with `''.join(childGenes)`

```python
def mutate(parent):
    index = random.randrange(0, len(parent))
    childGenes = list(parent)
    newGene, alternate = random.sample(geneSet, 2)
    childGenes[index] = alternate if newGene == childGenes[index] else newGene
    return ''.join(childGenes)
```

This implementation uses an alternate replacement if the randomly selected `newGene` is the same as the one it is supposed to replace, which can prevent a significant number of wasted guesses.

#### Monitoring Progress

It's important to monitor progress so that the algorithm can be stopped if it gets stuck. Having a visual representation of the gene sequence, which may not be the literal gene sequence, is often critical to identifying what works and what does not so that the algorithm can be improved.

```python
def display(guess):
    timeDiff = datetime.datetime.now() - startTime
    fitness = get_fitness(guess)
    print("{0}\t{1}\t{2}".format(guess, fitness, str(timeDiff)))
```

#### Main Body

The main program begins by initializing `bestParent` to a random sequence of letters and calling the display function. The heart of the genetic algorithm is a loop that:

* generates a random string of letters
* requests the fitness for that guess, then
* compares fitness to that of the best guess, and
* keeps the guess with better fitness

This cycle repeats until a stop condition occurs, in this case when all the letters in the guess match those in the target.

```python
# To reproduce the same result, we call the random.seed function.
random.seed(1)
startTime = datetime.datetime.now() # Record the start time
bestParent = generate_parent(len(target))
bestFitness = get_fitness(bestParent)
display(bestParent)

while True:
    child = mutate(bestParent)
    childFitness = get_fitness(child)
    if bestFitness >= childFitness:
        continue
    display(child)
    if childFitness >= len(bestParent):
        break
    bestFitness = childFitness
    bestParent = child
```

#### Result:

```output
PwYXVxqghGja	0	0:00:00.001003
HwYXVxqghGja	1	0:00:00.001003
HwYXVxqghlja	2	0:00:00.007858
HwYXVxqghlj!	3	0:00:00.011940
HwYXV qghlj!	4	0:00:00.024247
HwYXo qghlj!	5	0:00:00.035484
HwYXo qghld!	6	0:00:00.037479
HwYXo qgrld!	7	0:00:00.040592
HwYXo Wgrld!	8	0:00:00.045106
HwlXo Wgrld!	9	0:00:00.057195
HwlXo World!	10	0:00:00.075456
Hwllo World!	11	0:00:00.079659
Hello World!	12	0:00:00.145945
```


text:
# Tiny X-Wing Tech Demo

![](Screenshots/Shooting.gif)

This is the source code for the [quick X-Wing style game](https://why485.itch.io/tiny-x-wing) I made one weekend to test a few specific things. This is **NOT** meant to be an example of how to do anything well. It was a quick prototype thrown together to test a handful of very specific things, and I thought it'd be interesting to upload the source as it has examples of a few things I've never uploade before such as basic AI.

The code is messier than it needs to be because at the last second I thought it'd be cool to add capital ships and nothing about the game was designed to support capital ships so I had to make a lot of really hacky changes to support the Lancer frigates.

**I have no plans to maintain or update any of this code. It was written for academic purposes.**

This project was built in **Unity 2019.4.0f1**.

# The JSON Loading Stuff

![](Screenshots/JSON.png)

The primary goal of this project was to test loading gameplay related data from the disk rather than having it be stored inside Unity prefabs or Scriptable Objects.

The `ShipLibrary` class (found in [ShipLoader.cs](Assets/Scripts/Ship/ShipSpawner.cs)) loads all the ship parameters from JSON files stored in StreamingAssets. Whenever a ship is spawned using the `ShipSpawner` class, the ship is given the appropriate data to load in for properties such as speed and weapons, from the parsed data that `ShipLibrary` collected.

The main benefit of this approach is that it allows the end user to modify the data without needing the source project to edit prefabs or Scriptable Objects themselves. From a developer perspective, this is not necessarily great since it's harder to verify and edit data using things like Editor scripts.

## Lessons Learned, and Applied, for [Tiny Combat](https://why485.itch.io/tiny-combat-arena)

![](Screenshots/Bombs.png)

In my own experience [implementing this approach in Tiny Combat Arena](https://twitter.com/Why485/status/1286524235494633472), I've been finding that structing your code this way has a bunch of interesting side effects. My biggest concern initially was that everything is now [Stringly Typed](http://wiki.c2.com/?StringlyTyped), but the reality is that once the data is in the system, all the strings are going to be correct because it's all coming from the same place.

This also allows a degree of separation between the logic and way the data is stored in a way that's not typical of how Unity works. In the most typical Unity use case, this kind of data is usually baked into a prefab. In the Tiny Combat example, there would be a Mk82 (bomb) prefab with its correct stats, then a Mk84 prefab (bigger bomb) with its own stats, and so on.

With this more JSON data-driven approach though, this changed. Instead, I've been using a single "archetype" prefab which contains all the necessary components to function as a bomb in gameplay, but needs to initialized with data coming from a JSON. The order of spawning a bomb (simplifying a bit for understanding) then becomes:

1. Data for all loadable stores brought in from disk
2. A bomb is needed, so the game spawned a `_Bomb` prefab
3. The newly spawned `_Bomb` is told to use the data for a `Mk82`
4. The bomb asks the `StoresLoader` (equivalent to this project's `ShipLoader`) for the data of a `Mk82` bomb
5. With that requested data, it spawned an appropriate model, and initializes its MonoBehaviours with data of a Mk82

An example of what a bomb's definition might look like in JSON:

```json
{
  "Store": {
    "DisplayName": "Mk82",
    "Description": "500lb unguided explosive bomb",
    "StoreType": "Bomb",
    "ModelPath": "Weapons/Bombs/Mk80Series/Mk82",
    "Mass": 227.0,
    "Length": 2.25,
    "Diameter": 0.275
  },
  "Warhead": {
    "Fuze": "Impact",
    "BlastRadius": 50.0,
    "Damage": 100.0
  }
}
```

# Spaceship AI

![](Screenshots/Strafe.gif)

I've never actually uploaded any AI code for my projects. The thing with AI is that it tends to be so tailor made for every use case that it's hard to generalize in a way that I think might be useful. The best I think I can do is explain the general concepts I adhere to when writing AI, and give a code example of what it might look like.

Note: I don't think the AI code in this project is particularly good or easy to follow, especially because I hacked on so much to it in order to make the capital ships work.

All AI related code can be found in [Pilot.cs](Assets/Scripts/Ship/Pilot.cs).

### Turn Towards

The single most important function needed for AI to work is the ability for them to fly towards something. I almost always have a `TurnTowards` function which takes in a target position then applies input (pitch, yaw, roll) such that an AI pilot will point their ship at what they need to. This point could be anything from another spaceship to a predicted aiming point. It gets used for literally everything.

### Spread out Calculations!

AI calculations tend to be very expensive. *Especially* targeting code, since AI often have a lot of considerations to make when deciding what to target, or what they even can target. A trick I often use is to separate out "think" and "act" logic, then make it so that the expensive "think" functions are called in offset intervals rather than all AI running the same calculations on the same frame.

### Act vs Think
"Act" logic is the kind of logic that must run every frame. This is the moment to moment stuff such as manipulating the virtual joystick and throttle to fly a spaceship or plane. This should be as simple and straightforward as possible because it needs to happen all the time.

"Think" logic is decision making logic. Am I done doing what I was doing? What should I do next? What should I target now? This is the kind of logic that can be very expensive and should be done relatively infrequently (every 1-5 seconds vs every frame).

To space out the "think" logic, I typically use a simple timer so that it happens once a second or so. This prevents it from being run every frame, and also lets you design around the idea that an AI considers things only in certain time intervals. On top of that, I also offset this by a random number so that all AI don't "think" all at the same time. If they all do some expensive calculation all at once, the player will notice that frame took significantly longer than most frames.

![](Screenshots/Chase.gif)

### Modulating the Control Authority

This is a very space/flight sim trick, but making an AI perfectly turn towards a target is easy. That's not very fun though, as it means all fights turn into endless loops. To make fighting more fun and easy, a trick I use basically every time is to randomly change how hard the AI is allowed to turn. Sometimes they can turn with only 40% strength. Other times, 70%! It's all random, and it gives the player (and other AI) openings to fire on, or escape from targets. Adding randomness, particularly to timing, can also make the AI seem more unpredictable and smarter than they really are.

 Remember, all AI is just an illusion. Very simple (even random!) behaviors can result in emergent behavior that players mistake for intelligence.

# Custom Shaders

![](Screenshots/TIEShader.png)

This project uses the Universal Render Pipeline, along with ShaderGraph to create the shaders. They are similar in principle to [how the shaders in Tiny Combat](Screenshots/T62.png) work.

Ever since learning more about custom shaders, I've admittedly become a bit of a snob when it comes to low poly retro style graphics. Fancy modern physically based shading is very different from the dead simple Lambertian style shading commonly used in older games, so I think if you're trying to go for a nostalgic style you should really consider creating custom shaders to match the look.

## Global Variables in Shader Graph

Since I want to calculate my own lighting, and Shader Graph doesn't support custom lighting models the way the Built-Renderer used to, I need to pass in my own light direction to be used for lighting calculations. This means I can only have one light source (the sun) but for my purposes that's fine. I don't remember where I read how to do this, because it's not obvious at all, but it's essential and powerful.

On the game's light, you'll see a script called `ShaderLighting`. All this does is pass the direction of the light into a shader-accessible global variable called `LightDirection`.

```cs
Shader.SetGlobalVector("LightDirection", -LightSource.transform.forward);
```

To use the data in this variable from Shader Graph, you need to add a property that **matches the name exactly**, and **uncheck Exposed**. My understanding is that this is used for internal variables to the shader, and when it matches a global shader variable, it will take on its value.

![](Screenshots/LightDirection.png)

From there you can use the property in the graph like any other. Note though that in the preview window, it'll use only whatever the default value is. You won't see the shader running with the "true" values until it's running in the scene and these global variables are being set.

Another interesting thing to note is that once you set a global variable, it retains that value for as long as the Editor is open, even between play sessions.

# Cut Code/Content

In order to open source this, I had to strip some content/features for licensing reasons. When possible, the code is left in, so that if you have these assets you could drop them in and uncomment the code.

## Odin Inspector

[Odin Inspector](https://odininspector.com/) was used to make certain things more convenient for testing. This wasn't central to the working of this project, but it made testing the JSON loading/unloading easier. All the Odin related code is still in the project and can be found by searching for the `Sirenix` namespace.

This asset has only gotten better with time. Even if you don't get too into the power user custom inspector stuff, it makes a lot of the Unity Editor UI better in a way that Unity should look into making native. I recommend it.

## Shapes

![](Screenshots/DistantLasers.gif)

I've long been annoyed at the difficulty that Unity has with drawing clean and pixel perfect lines. [Freya Holmer](https://twitter.com/FreyaHolmer) has developed the [plugin of my dreams, Shapes](https://acegikmo.com/shapes/). It was just released and having used it only in demo environments I was curious to trial it in a simple standalone and practical project before taking the plunge and attempting to integrate it into Tiny Combat.

In this project, I used it for debug visuals, the stars in the skybox, and as an aid in drawing the lasers so that lasers always appeared as continuous pixel lines even when far from the camera. It's a joy to work with and I highly recommend it!

As with Odin, the code remains in place and can be found by searching for the `Shapes` namespace. It's just been commented out. The stars have been replaced with quads. The laser line drawing has been replaced with [code which scales the lasers](Assets/Scripts/Weapons/LaserScaling.cs) based on distance to mimic the effect. It's not pixel perfect the way Shapes is, but it's a good enough approximation for this project.

## All the Audio

All sound effects have been removed due to licensing. All the `AudioSource` components, as well as a few audio related scripts, are still intact, so a sufficiently motivated individual should be able to add back in all the sound effects.

license: Zlib

repository: kurtdekker/TinyXWingClean

repo_name: kurtdekker/TinyXWingClean


text:
# Do While Loops
**STATUS**: Implemented

Do while loops are equivalent to while loops, execept that the test for the condition is done _after_ running the code (i.e., it is a post-test loop).

    do
        [[ _code_ ]]
    end while _condition_

repository: hematidrosis/orange-docs

repo_name: hematidrosis/orange-docs


text:
# mithermometer - Library for Xiaomi Aqara temperature and humidity sensor

[![PyPI](https://img.shields.io/pypi/v/mithermometer.svg)](https://pypi.python.org/pypi/mithermometer)
[![PyPI](https://img.shields.io/pypi/status/mithermometer.svg)](https://pypi.python.org/pypi/mithermometer)
[![PyPI](https://img.shields.io/pypi/format/mithermometer.svg)](https://pypi.python.org/pypi/mithermometer)
[![GitHub license](https://img.shields.io/github/license/hobbypunk90/mithermometer.svg)](https://github.com/hobbypunk90/mithermometer/blob/master/LICENSE)

This library lets you read sensor data from a Xiaomi Aqara temperature and humidity  sensor.

* Latest release download: https://pypi.python.org/pypi/mithermometer

the mithermometer library is based on the [miflora library](https://github.com/open-homeautomation/miflora). Thanks for this great lib.

## Functionality
It supports reading the different measurements from the sensor
- temperature
- humidity

To use this library you will need a Bluetooth Low Energy dongle attached to your computer. You will also need a
 Xiaomi Aqara thermometer.

## Backends
As there is unfortunately no universally working Bluetooth Low Energy library for Python, the project currently
offers support for two Bluetooth implementations:

* bluepy library
* bluez tools (via a wrapper around gatttool)
* pygatt library

### bluepy
To use the [bluepy](https://github.com/IanHarvey/bluepy) library you have to install it on your machine, in most cases this can be done via:
```pip3 install bluepy```

Example to use the bluepy backend:
```python
from mithermometer.mithermometer_poller import MiThermometerPoller
from btlewrap.bluepy import BluepyBackend

poller = MiThermometerPoller('some mac address', BluepyBackend)
```
This is the backend library to be used.

### bluez/gatttool wrapper
To use the bluez wrapper, you need to install the bluez tools on your machine. No additional python
libraries are required. Some distrubutions moved the gatttool binary to a separate package. Make sure you have this
binaray available on your machine.

Example to use the bluez/gatttool wrapper:
```python
from mithermometer.mithermometer_poller import MiThermometerPoller
from btlewrap.gatttool import GatttoolBackend

poller = MiThermometerPoller('some mac address', GatttoolBackend)
```

This backend should only be used, if your platform is not supported by bluepy.
Note: gatttool is depracated in many Linux distributions.

### pygatt
If you have a Blue Giga based device that is supported by [pygatt](https://github.com/peplin/pygatt), you have to
install the bluepy library on your machine. In most cases this can be done via:
```pip3 install pygatt```

Example to use the pygatt backend:
```python
from mithermometer.mithermometer_poller import MiThermometerPoller
from btlewrap.pygatt import PygattBackend

poller = MiThermometerPoller('some mac address', PygattBackend)
```
# Dependencies
mithermometer depends on the [btlewrap](https://github.com/ChristianKuehnel/btlewrap) library. If you install mithermometer via PIP btlewrap will automatically be installed. If not, you will have to install btlewrap manually:

```pip3 install btlewrap```

## Conttributing
please have a look at [CONTRIBUTING.md](CONTRIBUTING.md)

## Projects Depending on `mithermometer`

The following shows a selected list of projects using this library:

* https://github.com/zewelor/bt-mqtt-gateway - A BT to MQTT gateway which support MiThermometer sensors + other devices

repository: cybe/mithermometer

repo_name: cybe/mithermometer


text:
Sir Vivor
====================

A chat bot for the Survivor Room on [Pokémon Showdown][1]. This bot has a number of commands, some helpful and some less so, as well as the capability to moderate, and play games.

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

Sir Vivor requires [node.js][2] to run.
This bot has not been tested on every `node.js` version possible, but has the same version requirements as [Pokémon Showdown][3]: either v0.6.3 through v0.8.22, or v0.10.2 and up.
Install `node.js` if you don't have it yet, try the last stable version.

Next up is cloning this bot. This can be done in two ways: cloning it via `git` or downloading as ZIP.
Downloading it as ZIP is the easy and lazy way, but is a lot less handy to update than cloning this repository.

To install dependencies, run:

    npm install

Copy `config-example.js` to `config.js` and edit the needed variables.
To change the commands that the bot responds to, edit `commands.js`.
To create a new game, add a file to the `games` directory

Now, to start the bot, use:

    node main.js

Some information will be shown, and will automatically join the room(s) you specified if no error occurs.

  [2]: http://nodejs.org/
  [3]: https://github.com/Zarel/Pokemon-Showdown

If any of your commands rely on information normally sent to the Pokémon Showdown Client (e.g. functions that execute based on PM that aren't directly related to normal commands), you will need to make changes to the message method in parser.js under the appropriate case.

Development
-----------

Everyone is more than welcome to contribute to the bot.
However, please refrain from adding more example commands.

Credits:
 - Morfent/TalkTakesTime/Quinella/Rival Nick (Original Bot)
 - Swirlyder (Bot Owner and Repo Owner)
 - CheeseMuffin (Major Development, Bot Owner and Maintainer)
 - Hawkie (First customization for survivor, Major Development)
 - inactive (Development, Maintainer)
 - Felucia (Development)
 - Tushavi (Development)
 - Shadecession (Development)

License
-------

Sir Vivor is distributed under the terms of the [MIT License][5].

  [5]: https://github.com/Swirlyder/I-m-a-sirvivor/blob/master/workspace%20sir%20vivor/README.md

repository: Swirlyder/I-m-a-sirvivor

repo_name: Swirlyder/I-m-a-sirvivor


text:
This is an example script demonstrating usage of the parametric tSNE method.
First, training data is generated for 14 clusters in 14 dimensions. We use 2000 training points and 2000 testing points.
The clusters are well-separated for simplicity. The model is saved in h5 format using Keras.
The results for a 2-D tSNE are visualized below, as well as 2-component PCA for comparison.
The training data is plotted as contours, the test data as individual points.

![tSNE](example_viz_tSNE.png "tSNE")

![PCA](example_viz_PCA.png "PCA")

## Requirements
matplotlib
seaborn
scikit-learn (PCA only)


text:
# Play URL Path Base Internationalization (I18n)
**!! THIS IS UNDER DEVELOPMENT !!**

This is a request handler for play framework Scala. It handles the request path for all play default router to use internationalized path as [the language tag](https://www.w3.org/International/articles/language-tags/), and resets `Accept-Language`.
```
http://example.com
http://example.com/en-US
```

**If you find any weird behavior or bugs please report or issue me :) I always welcome your pull requests!**

## Installation

#### Dependency
Add those resolver and dependency to `build.sbt`:

**Currently it only supports Play Framework 2.5.x**
```scala
// Adding resolver
resolvers += "EJISAN" at "https://ejisan.github.io/repo/"
// Adding dependency
libraryDependencies += "com.ejisan" %% "play-i18n-url" % "1.0.0-SNAPSHOT"
```

## Uses
1. Add the request handler (`conf/application.conf`)

```
play.http {
  requestHandler = "ejisan.play.i18n.UrlI18nRequestHandler"
}
```

2. Add the application languages (`conf/application.conf`)

The format of the languages must fallow Language Tag Syntax which is defined in [RFC5646](http://www.rfc-editor.org/rfc/rfc5646.txt).
```
play.i18n {
  # The application languages
  langs = [ "en-US", "es-US", "ja-JP", "en-JP" ]
  ...
```

3. Your application is ready!

`UrlI18nRequestHandler` will automatically add language tag at the head of the requested path and set to `Accept-Language`. If the language tag in the requested path is case insensitive, `UrlI18nRequestHandler` replaces it as right case and redirects it.
```
# http://example.com/en-US or http://example.com/ja-JP etc
GET     /                     controllers.Controller.index
# http://example.com/en-US/page1 or http://example.com/ja-JP/page1 etc
GET     /page1                controllers.Controller.page1
```

### Sird router with Non-Internationalized Routing
Check about [sird router](https://www.playframework.com/documentation/2.5.x/ScalaSirdRouter)
```scala
import javax.inject.Inject
import play.api.http.{ HttpErrorHandler, HttpConfiguration }
import play.api.i18n.DefaultLangs
import play.api.mvc._
import play.api.routing._
import play.api.routing.sird._
import ejisan.play.i18n.{ UrlI18nRequestHandler, ScalaSirdRouterSupport }

class MyUrlI18nRequestHandler @Inject()(
  langs: DefaultLangs,
  defaultRouter: Router,
  errorHandler: HttpErrorHandler,
  httpConfiguration: HttpConfiguration)
  extends UrlI18nRequestHandler(langs, defaultRouter, errorHandler, httpConfiguration)
  with ScalaSirdRouterSupport {
  // Using a sird router
  def router: Router = Router.from {
    case GET(p"/") => Action {
      Results.Ok("Hello Play!")
    }
  }
}
```


text:
---
title: "Android emulator: change your SIM card number"
date: 2019-07-31 00:00:00 +01:00
tags: [android, tools, emulator]
image: "featured.png"
---

One of the biggest advantages of using the Android Emulator is that we can do almost everything as if we were on a physical device. Additionally, here we have a large set of configurations that allow us to replicate a large variety of configurations, namely: architectures, Android versions, hardware profiles, etc.

## But what if we need to mock a SIM card?

If you create an AVD (Android Virtual Device) and go to the native settings application and look for your SIM information, you should see something identical to this:

Device information

If you look closely to the SIM number it seems to be a default number with *+1* as the country code and a mix of random numbers. However, if we look closely the last four digits seem oddly familiarly.

If you enter on your console adb devices and assuming that you’ve got only one created you’ll see:

```shell
$adb devices
  List of devices attached
  emulator-5554 device
```

So, this last 4 four digits basically correspond to the port in which the emulator is connected… and the first ones… let's say that they are the default number used by Android:

```java
static const char kDefaultPhonePrefix[] = “1555521”;
```

### Device properties

In order to see all of your device (emulator) properties you can enter the following command:

```shell
adb shell getprop
```

And to filter the ones only related to the SIM card we just need to:

```shell
adb shell getprop | grep "gsm"
```

which returns:

```shell
[gsm.current.phone-type]: [1]
[gsm.defaultpdpcontext.active]: [true]
[gsm.network.type]: [LTE]
[gsm.operator.alpha]: [Android]
[gsm.operator.iso-country]: [us]
[gsm.operator.isroaming]: [false]
[gsm.operator.numeric]: [310260]
[gsm.sim.operator.alpha]: []
[gsm.sim.operator.iso-country]: [us]
[gsm.sim.operator.numeric]: [310260]
[gsm.sim.state]: [LOADED]
[gsm.version.baseband]: [<IP_ADDRESS>]
[gsm.version.ril-impl]: [android reference-ril 1.0]
```

It seems that there are some older emulators where you can define each one of these properties individually via setprop command:

```shell
adb shell setprop gsm.sim.operator.iso-country pt
```

Unfortunately, this seems to not work on the latest version of the emulator; so if it doesn’t we need to follow a second approach.

### Change your SIM number

After a lot of try and error (a special thanks to here that grabbed his pickax and joined me on this quest), we’ve managed to discover an easy way to update the SIM number on the emulator.

1. First, you need to check if you’ve got the ANDROID_HOME path defined:
    ```shell
echo $ANDROID_HOME
    ```
    It should print your Android SDK path:

    ```shell
/Users/$(whoami)/Library/Android/sdk
    ```

    In case you don’t have your ANDROID_HOME defined you’ll need to set it. First, you need to find where your Android SDK folder is located. You can easily check this by opening Android Studio and after selecting your project right click on “Open Module Settings” and then on the left bar select on “SDK Location”.

    After copying it, open a new console and type:

    ```shell
export ANDROID_HOME=<your_sdk_path>
    ```

    And then add it to the environment variables PATH:

    ```shell
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    ```

    and save it (so you don’t need to enter these commands every time you open a new console):
    ```shell
    source ~/.bash_profile
    ```

2. Next, we will set the EMULATOR variable as well as we did for the ANDROID_HOME :
    ```shell
export EMULATOR=$ANDROID_HOME/emulator
    ```
    and then export the LD_LIBARY_PATH

    ```shell
export LD_LIBRARY_PATH=$EMULATOR/lib64:$EMULATOR/lib64/qt/lib
    ```

3. Now you just need to set the phone_number option with the phone number that you want to use on the emulator:
    ```shell
$EMULATOR//qemu/darwin-x86_64/qemu-system-x86_64 -avd <your_avd_name> -phone-number<PHONE_NUMBER>01
    ```
    In order to get <your_avd_name> you’ll need to see all the AVD’s available:
    ```shell
emulator -list-avds
    ```
In my case, it will output Pixel_2_API_Q, so my command will be:
    ```shell
$EMULATOR//qemu/darwin-x86_64/qemu-system-x86_64 -avd Pixel_2_API_Q -phone-number<PHONE_NUMBER>01
    ```
No need to add the “+” or “00” for the country code, Android will do that automatically for you.

Device properties (new phone number)

Do you have a better approach? Something didn’t quite work with you? Feel free to send me a [message](https://twitter.com/cafonsomota) 🙂.


text:
XML for CocoonJS
================

Version 0.8.6 (beta)

Combining a substantial re-write of [xmldoc](https://github.com/nfarina/xmldoc) and the [sax.js](https://github.com/isaacs/sax-js) Node.js modules, this serves to re-create the DOMParser object in user agents (like CocoonJS) that do not have native XML parsing. It also adds support for most DOM Core Level 1 XML operations.

Currently, this parses text strings into a document-like tree object with the root element of the XML as a "XmlDocument" object and all of its elements, and their own children, as "XmlElement" or similar objects. All common functions like getElementsByTagName, firstChild, and childNodes work as they would normally. However, in addition to the noted differences from the [specification](http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html) below, attributes do not hold Text nodes and are objects per node with properties as key-value pairs instead. (Attribute mutators like get/set work as they normally would, but edit the object instead of Text nodes.)

##DOM Core Level 1 differences:
* All nodes, including XmlDocument, XmlElement, Attr, Text, Comment, CDATA, ProcessingInstruction, DOMImplementation, and DocumentFragment,
are JavaScript OBJECTS, not their corresponding object names in the specification. Those functions which would normally return NodeLists are mapped to arrays instead. (Obviously, the arrays are not "live" either then.)
* DOMException doesn't exist, but its error codes do in the different functionality where they would have been thrown normally.
* DOMImplementation exists, but hasFeature() always returns "true" and createDocument() returns an empty XmlDocument object.
* It doesn't understand docTypes at all. Thus, DOCUMENT_TYPE_NODE is not a possible nodeType value. Nor does document.createDocumentType() exist.
* EntityReference doesn't exist, nor does document.createEntryReference() as a result. ENTITY_REFERENCE_NODE and ENTITY_NODE aren't valid nodeTypes.
* Notation doesn't exist; NOTATION_NODE is not a valid nodeType.
* Readonly access is only enforced on "nodeName" and "nodeValue" properties of nodes.
* HIERARCHY_REQUEST_ERR will never occur.
* Will never throw "NO_MODIFICATION_ALLOWED_ERR," as all nodes can be edited at any time.
* appendChild(node) does not currently work with DocumentFragment nodes. Will not load DocumentFragment's children into the tree correctly.
* insertBefore(), removeChild(), replaceChild(), and cloneNode() are not currently implemented.
* Text nodes do not have the splitText() function (as this depends on insertBefore())

##TODO
* Implement check for DocumentFragment nodes in appendChild, add its children to tree
* Implement insertBefore(), removeChild(), replaceChild(), and cloneNode()
* Add splitText() to Text nodes
* Support DOM Core Level 2
* Support namespace-related operations

## Basic Example

```javascript
 window['DOMParser'] = domParser; //Assuming not isCocoonJS
 var xmlhttp = new XMLHttpRequest();
     xmlhttp.open("GET", "example.xml", true);
     xmlhttp.onreadystatechange = handler;
     xmlhttp.send();

     function handler()
     {
       if (xmlhttp.readyState === 4) {
         if (xmlhttp.status === 200) {
           var tmp = new DOMParser();
           var xml = tmp.parseFromString(xmlhttp.responseText, "text/xml");
         }
       }
     }
```

repository: bassarisse/xml-for-cocoonjs

repo_name: bassarisse/xml-for-cocoonjs


text:
iterami/Music-Local.htm
-----------------------

To use this music player:

* `git clone` this repository.
* Locally open `index.htm` in a modern web browser.
* Add tracks to your playlist with the `Add Tracks` button.
  * Enter the path, relative from `index.htm`, to the music file saved on your computer.
* Use any of the various `Play` buttons to play your tracks.

---

Requires:
* [iterami/common](https://github.com/iterami/common)

repository: honzi/files

repo_name: honzi/files


text:
# Vulnado - Intentionally Vulnerable Java Application

This application and exercises will take you through some of the OWASP top 10 Vulnerabilities and how to prevent them.

## Up and running

1. Install Docker for [MacOS](https://hub.docker.com/editions/community/docker-ce-desktop-mac) or [Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows). You'll need to create a Docker account if you don't already have one.
2. `git clone git://github.com/ScaleSec/vulnado`
3. `cd vulnado`
4. `docker-compose up`
5. Open a browser and navigate to the client to make sure it's working: [http://localhost:1337](http://localhost:1337)
6. Then back in your terminal verify you have connection to your API server: `nc -vz localhost 8081`

## Architecture

The docker network created by `docker-compose` maps pretty well to a multi-tier architecture where a web server is publicly available and there are other network resources like a database and internal site that are not publicly available.

![](exercises/assets/arch.png)

## Exercises

* [SQL Injection](exercises/01-sql-injection.md)
* [XSS - Cross Site Scripting](exercises/02-xss.md)
* [SSRF - Server Side Request Forgery](exercises/03-ssrf.md)
* [RCE - Remote Code Execution & Reverse Shell](exercises/04-rce-reverse-shell.md)

## Remote Debugging - jdb
In case you would like to try some remote debugging with jdb, you may
1. `docker-compose up --build -d`
2. `docker cp vulnado_vulnado_1:/vulnado-0.0.1-SNAPSHOT.jar .`
3. Use JD-GUI [https://github.com/java-decompiler/jd-gui] to decompile the jar
4. Change the file structure, so that the remote debugging can be successfully done
5. `jdb -sourcepath ./ -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5005`
6. Set breakpoints using jdb `stop in com.scalesec.vulnado.LoginController:20`


text:
# Python-News-Scraper
A program that scrapes for announcements from [moneycontrol.com](www.moneycontrol.com) so that traders can take informed decision.
Here is how to get started,

    import moneycontrol as mc

    # First parameter is the ticker symbol
    stock = mc.MoneyControl("ONGC")

The "stock" object has 3 main methods at present that can be used to extract announcements from Money Control.

### fetch_a(page_no=1)
This method is used to fetch announcements from the given page number. By default, page_no is 1. It returns a list of dictionary with all the values in it.

	# Fetching the announcements on page number 3 ofthe website
    stock.fetch_a(3)

	# Here is the output after running this method.
	[
	   {
	      'content':'Oil & Natural Gas Corporation Limited has informed the Exchange regarding Change in Director(s) of the company.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=10266461',
	      'date':'4th-Jan-2018 14:11',
	      'title':' Oil & Natural Gas Corporation Limited ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oil-natural-gas-corporation-limited-10266461.html'
	   },
	   {
	      'content':'Pursuant to Regulation 30 of Securities and Exchange Board of India (Listing Obligations and Disclosure Requirements) Regulations, 2015, we hereby inform that Shri T K Sengupta, Director (Offshore), has ceased to be Director of the Company upon his attaining superannuation on 31.12.2017.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=10266101',
	      'date':'4th-Jan-2018 13:21',
	      'title':'Oil and Natural Gas Corporation - Change in Directorate ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oilnatural-gas-corporation-changedirectorate-10266101.html'
	   },
	   {
	      'content':'The Exchange had sought clarification from the Company with respect to news item captioned "Venezuela\'\'s PDVSA misses debt payments, used Russian bank to pay ONGC". The response from the Company is enclosed.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9926541',
	      'date':'15th-Nov-2017 16:56',
	      'title':' Oil & Natural Gas Corporation Limited ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oil-natural-gas-corporation-limited-9926541.html'
	   },
	   {
	      'content':'Reply to Clarification on media report.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9925541',
	      'date':'15th-Nov-2017 16:24',
	      'title':'Oil and Natural Gas Corporation - Updates ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oilnatural-gas-corporation-updates-9925541.html'
	   },
	   {
	      'content':'The Exchange has sought clarification from Oil & Natural Gas Corporation Ltd with respect to news article appearing on moneycontrol.com on November 13, 2017 titled "Venezuela likely to go bankrupt in a day?."The reply is awaited.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9860941',
	      'date':'13th-Nov-2017 14:23',
	      'title':'Oil and Natural Gas Corporation - Clarification sought from Oil & Natural Gas Corporation Ltd ',
	      'pdf_link':None
	   },
	   {
	      'content':'Oil & Natural Gas Corporation Limited has informed the Exchange regarding Change in Director(s) of the company.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9719361',
	      'date':'2nd-Nov-2017 12:20',
	      'title':' Oil & Natural Gas Corporation Limited ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oil-natural-gas-corporation-limited-9719361.html'
	   },
	   {
	      'content':'Shri A K Srinivasan, Director Finance, has ceased to be Director of the Company upon his attaining superannuation on 31.10.2017',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9717921',
	      'date':'2nd-Nov-2017 11:15',
	      'title':'Oil and Natural Gas Corporation - Change in Directorate ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oilnatural-gas-corporation-changedirectorate-9717921.html'
	   },
	   {
	      'content':"Un-audited Financial Results for the second Quarter and Half Year ended 30th September, 2017- Auditors''Limited Review Report",
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9660001',
	      'date':'28th-Oct-2017 16:58',
	      'title':'Oil and Natural Gas Corporation - Updates ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oilnatural-gas-corporation-updates-9660001.html'
	   },
	   {
	      'content':"ONGC declares results for Q2 FY''18; records impressive production performance",
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9659761',
	      'date':'28th-Oct-2017 16:37',
	      'title':'Oil and Natural Gas Corporation - Press Release / Media Release ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oilnatural-gas-corporation-press-release-media-release-9659761.html'
	   },
	   {
	      'content':'Pursuant to Regulation 30 of Securities and Exchange Board of India (Listing Obligations and Disclosure Requirements) Regulations, 2015, it is hereby inform that Govt. of India has nominated Dr. Sambit Patra, as an Independent Director on the Board of the Company.The Board of Directors of the Company have also approved induction of Dr. Sambit Patra, as an Additional Director with effect from 28th October, 2017.',
	      'link':'http://www.moneycontrol.com/stocks/stock_market/corp_notices.php?autono=9658841',
	      'date':'28th-Oct-2017 15:56',
	      'title':'Oil and Natural Gas Corporation - Change in Directorate ',
	      'pdf_link':'http://www.moneycontrol.com/stocks/reports/oilnatural-gas-corporation-changedirectorate-9658841.html'
	   }
	]

Each announcement is described using 5 keys, namely:

 - **content** - The small description of the announcement present on the website.
 - **link** - The exact link of the announcement page from where the data is scraped.
 - **date** - The date and time of the announcement
 - **title** - The title of the announcement
 - **pdf_link** - The PDF link of the announcement if present, otherwise, None

repository: imrptsngh/News-Scraper

repo_name: imrptsngh/News-Scraper


text:
# Free Code Camp Algorithms and Data Structure Projects
Here are my 5 solutions to Algorithms and Data Structure Projects found in the Free Code Camp JavaScript lessons. Each one scored 100% in all categories.

The link to the syllabus is here [https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/#javascript-algorithms-and-data-structures-projects](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/#javascript-algorithms-and-data-structures-projects)

*'This is it — time to put your new JavaScript skills to work. These projects are similar to the algorithm scripting challenges you've done before – just much more difficult.*

*Complete these 5 JavaScript projects to earn the JavaScript Algorithms and Data Structures certification.'*

repository: qigongcoder/Javascript-FreeCodeCamp

path: /3 Certificate Challenges/readme.MD

repo_name: qigongcoder/Javascript-FreeCodeCamp


text:
chromium-codereview
===================

A chrome extension that changes the frontend to Rietveld for Chromium making it awesome.

Getting started
-------------
1. Install [bower](http://bower.io/)
2. Run bower install in the root of the project.
3. Open about:flags and enable "Experimental web platform features".
4. Open chrome:://extensions and load the unpacked extension.

Note: Chrome 36+ is required.

The application works by redirecting navigations to codereview.chromium.org to /static/app/
which the server will respond to with a 404. It then replaces the 404 page with the app.
This is done since most rietveld pages take a long time to load, but the 404 page is fast.

repository: dtapuska/chromium-codereview

repo_name: dtapuska/chromium-codereview


text:
# Mirror RPM Repos

Setting up offline mirrors for RPM repositories

- [Mirror RPM Repos](#mirror-rpm-repos)
  - [Summary](#summary)
  - [Identifying package repositories to mirror](#identifying-package-repositories-to-mirror)
  - [Downloading package repositories on a machine with Internet access](#downloading-package-repositories-on-a-machine-with-internet-access)
  - [Transferring repositories to offline network](#transferring-repositories-to-offline-network)
  - [Create mirrors on offline network](#create-mirrors-on-offline-network)

## Introduction

Most of the software necessary to run GPU-enabled applications on RHEL or CentOS servers is available via RPM repositories.
In order to deploy this software in an offline environment, the most straightforward path is to mirror the repositories in your offline network.

## Identifying package repositories to mirror

In order to mirror package repositories to use offline, you must first identify which repositories contain the software you need.

DeepOps assumes that a full mirror of your Linux distribution repositories will be available for package installs.
If you do not already have mirrors of the distribution repositories available, please follow the
[instructions provided by Red Hat for creating these mirrors](https://access.redhat.com/solutions/23016).

The following additional RPM repositories are commonly used for GPU-enabled systems deployed by DeepOps:

- [Fedora Extra Packages for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL)
- NVIDIA CUDA repository: [repo file for EL7](https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo), [repo file for EL8](https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel8.repo)
- NVIDIA container repositories: [repo file for EL7](https://raw.githubusercontent.com/NVIDIA/nvidia-docker/gh-pages/centos7/nvidia-docker.repo), [repo file for EL8](https://raw.githubusercontent.com/NVIDIA/nvidia-docker/gh-pages/centos8/nvidia-docker.repo)
- Docker CE repository: [repo file](https://download.docker.com/linux/centos/docker-ce.repo)

These repo files provide the following repository IDs, which will be needed by `reposync` below:

- epel
- cuda-rhel7-x86_64 or cuda-rhel8-x86_64
- libnvidia-container
- nvidia-container-runtime
- nvidia-docker
- docker-ce-stable

To discover a complete list of repositories needed for your particular workload,
we recommend configuring a server with Internet access with the necessary software and validating your list against the contents of `/etc/yum.repos.d`.

## Downloading package repositories on a machine with Internet access

On a RHEL or CentOS machine with Internet access, install the `yum-utils` and `createrepo` packages:

```bash
sudo yum install yum-utils createrepo
```

Then install the EPEL repository:

```bash
sudo yum install  https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
```

Then, for each of the other repo files, install the file into the `/etc/yum.repos.d` directory.
For example, if using the list of repositories from the previous section:

```bash
cd /etc/yum.repos.d
sudo wget https://download.docker.com/linux/centos/docker-ce.repo
sudo wget https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
sudo wget https://raw.githubusercontent.com/NVIDIA/nvidia-docker/gh-pages/centos7/nvidia-docker.repo
```

For each of the repositories you wish to mirror, run the `reposync` command to download the contents of the repository.
This command will use the repository ID from the repo file to identify the repository to be downloaded.

In this example, we're downloading our packages to the local path `/var/repos`, but you may substitute a different path where you want to download packages:

```bash
sudo reposync -l --repoid=docker-ce-stable --downloadcomps --download-metadata --download_path=/var/repos
```

Repeat this for each repository ID you wish to mirror.

At this point, you should have one subdirectory for each of the repositories you chose to mirror, e.g.:

```bash
ls /var/repos/
docker-ce-stable  nvidia-docker
```

For each of these directories, run the `createrepo` command to generate repository metadata:

```bash
sudo createrepo /var/repos/docker-ce-stable
```

## Transferring repositories to offline network

After downloading the repository contents, you will need to transfer the downloaded files to your offline network.

There are many ways to do this, depending on your local setup!
You should use the mechanism that gives you the best performance and ease-of-use in your environment.

One common way to accomplish this transfer is to bundle the downloaded files into an ISO file, which can then be moved to the offline environment or "burned" to a DVD or external USB drive.

```bash
sudo yum install genisoimage
sudo genisoimage -o /tmp/packages.iso /var/repos
```

## Create mirrors on offline network

One the repository contents have been transferred to the offline network, they need to be made available as repositories for package installs.
Your offline enviroment may already have a package server, and there are many free and commercial solutions to do this!

If you don't already have a package server, the following process shows a minimal approach using an Apache httpd server.

First, in the offline network, pick a machine to use as your package server.
We will assume the use of the Apache httpd server and that the web root is `/var/www/html`:

```bash
sudo yum install httpd
sudo systemctl start httpd
sudo mkdir /var/www/html/repos
```

Then extract and copy your downloaded package files to `/var/www/html/repos`.

At this point, the downloaded package repositories should be available on your offline network via the package server.
You can then create repo files on the offline network to allow other hosts to use the package repositories.
For example, a new repo file for the docker-ce-stable repository might look like this:

```bash
[docker-ce-stable]
name=Docker CE
baseurl=http://<my-package-server>/repos/docker-ce-stable
enabled=1
```

You can then add these repo files to `/etc/yum.repos.d` on any machine where you want to install these packages.

repository: NVIDIA/deepops

gha_language: Shell

repo_name: NVIDIA/deepops


text:
---
layout: post
title:  "Java Exception handling Do's and Don't"
categories: [ Home, blog ]
image: assets/images/exception_handling.png
featured: true
---
I have worked with many Java projects and have seen several ways of handling exception in the applications. Each one had shown unique approach and had many good things to follow and bad things to avoid. Let's see what are all the good and bad practices..

### Classifying exception classes based out of architectural layer, example BusinessException, ServiceException and etc.
I see only one reason on this classification that we can know that exception is raised from which layer. But what's the use of knowing that issue from what layer, all we care about is what is the issue and what is the root cause of issue. It does not matter from which layer this exception is originated from. So I see this is the bad practice.
### So what type of custom exception is good? Runtime exception or Checked exception?
We have to decide based on type of the application or purpose of the application. For example if we are designing a API kind of application which is going to be used by external parties the we must choose Checked exception, So that we can force to handle certain exception who ever calls certain methods on API. This way consumer can classify this APIs error from their application error. For example JMSException on producing or consuming JMS queue.
But if we are designing application like Micro Service which is consumer by JSON or XML messages. This case we know that we are throwing custom exception from all over application, so we can handle it Controller class. So we have choose Runtime type of custom exception. This way we don't need to have throws clause on methods signatures all over the application.
### Having only one custom exception like ApplicationException is good?
I don't think that's a good approach. Having one custom exception means they throw only one exception every where in the application with different error code and messages.
For Example,
````
throw new ApplicationException(101, "Validation Error"); throw new ApplicationException(102, "Business Error");
````
Advantages of this way is we can avoid so many exception class but we have to write so many if conditions in the place where we control the behavior of the application based on error. We may or may not report certain errors based on errors. This case we have write if conditions for every error code like below
````
if(errorCode = = 101 && errorCode == 102 ) { // }
````
### So having so many exception class is good approach?
Having so many custom exception class is equals to having one custom exception class. Because we have to write plenty of boiler plate code to control the application behavior based on error type like we do on one exception class.
so many custom exception class meant, having custom exception class for each error. For example, MaxLenthException, MinLengthException and etc.
So this approach has two disadvantages 1. We have to write plenty of exception classes 2. we have to write plenty of boiler plate code to control the behavior of the application.
### So what is the good number of custom exception classes we can have?
Having neither one nor plenty of classes are good. we should have reasonable number of custom exception classes. For example, we should have one exception class for all business rule errors, one exception class for all validation errors like below
BusinessRuleException, ValidationException and etc.,
In this way, we can control behavior of the all BusinessRuleErrors in one boiler plate code.
Same Code Snippet
````
try {
}catch(Exception exp) {
if(exp instanceof BusinessRuleException) {
// Our behavior goes here..
}
````
### What would be the best constructor parameters on custom exception class
In many custom exception classes I have ever seen use to take error code and error message parameters. For Instance,
BusinessRuleException exp = new BusinessRuleException(Constants.ErrorCode,Constants.ErrorMessage);
Let's what are all the draw back on this,
1.If we have error code and error message separately then there is chance people can use error code and error message interchangeably. So we should have error code and error message in one variable. Like below
BusinessRuleException exp = new BusinessRuleException(Constants.ErrorCodeMessage);
Think if constructor accepts String type of error code and messages like below
````
BusinessRuleException(String errorCodeMessage) {
}
````
In this approach we have one draw back that since constructor take String type there is no guarantee that developers will always refer string type from actual Constant class. If they avoid Constant class then error code and messages are scattered across the application. So we will loose complete control of the application's reporting behavior. Application's future maintenance become worst.
### What would be the better constructor parameters data type?
We should declare error codes and messages as Enum constants and constructor should accept only particular Enum constant type. So that it ensures developers to declare any new error code on Enum only. For Instance,
````
public enum ResponseCodeMsgEnum {
NO_RULE(new ResponseInfo(1, "Rule does not meet.")),
}
public class ResponseInfo {
private int responseCode;
private String responseMessage;
}
Constructor look like,
public BusinessRuleException(final ResponseCodeMsgEnum errorEnum, final Throwable throwable) {
}
````
### What are all places we have to throw exception in our application?
There are only two scenario we have throw exception on our application.
1.where ever we would like to throw application's custom error message on meeting certain conditions. For Instance,
````
if( ssn.legnth() > 9 ) {
throw new BusinessRuleException(ErrorCodeMEssagesEnum.INVALID_SSN)
}
2. Where ever external API's forced handle check exceptions. For Instanc, JMSException
try {
///
}catch(JMSException exp){
throw new MessageException(exp); //Custom exception
}
````
I don't think any reason we should throw exception or handle exception any where in the application.
We have to have only only place to handle all the exceptions including custom and system exceptions. That class is beginning of our application class, it's mostly our Controller class.
For Instance,
````
public class MyController {
@RequestMapping(value = "/myTest", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
@ResponseBody
public Test myTest(@RequestBody final TestReq testReq) {
try {
//Service call
}
catch(Exception exp) {
//All exception handling behavior would go here
}
}
}
````
### Do you think custom exception classes hierarchy is required?
Yes, All our application's custom exception should be inherited from base custom exception class. This was we can completely customize the behavior of application errors versus system errors. For instance
````
try {
}catch(Exception exp){
if(exp instanceof AppException) { //AppException is base exception

//Custom behavior goes here
} else { //All remaining system exceptions fall under here..
}
````
I hope by following these Do's and Dont's would make application's maintenance easier for ever.


text:
# RStudio & GitHub

This is a very simple tutorial that allows you to configure RStudio and obtain
code from GitHub - it is not a comprehensive Git tutorial. For a more detailed
Git tutorial, please see Hadley's [Git and GitHub](http://r-pkgs.had.co.nz/git.html).

## 1. Install

- Git from [git-scm.com](https://git-scm.com/downloads)
- R from [CRAN](https://cran.r-project.org/)
- RStudio IDE desktop from [RStudio](https://www.rstudio.com/products/rstudio/download)
  + it is OK to install other packages required by RStudio

### Checks

- RStudio IDE > Options > General should display the R version used
- RStudio IDE > Options > Git/SVN should identify the **Git executable**
- On **OS X Sierra** you might see a dialog box asking to install Xcode. Let it install it,
but be sure to change the path to the `git` executable for both RStudio and Terminal.
  + For RStudio: point the git executable to `/usr/local/git/bin/git`
  + For Terminal: please follow the instructions at the [bottom of this page](https://modulesunraveled.com/installing-git/installing-git-if-you-do-not-have-xcode-or-command-line-developer-tools-installed)

#### Optional tools

- if on Windows, [RTools](https://cran.r-project.org/bin/windows/Rtools/)
- if on Windows or OSX and making extensive use of git, [SourceTree](https://www.sourcetreeapp.com/)

## 2. Configure Remote Repository

### GitHub

- Create your own GitHub account
  + optionally, enable [two-factor authentication (2FA)](https://help.github.com/articles/configuring-two-factor-authentication-via-a-totp-mobile-app/) and test it by logging in

## 3. Setup Keys

**Note:** If you are already familiar with RSA Keys and have generated your key,
you may skip these steps

### RStudio IDE > Options > Git/SVN  > Create RSA Key

![Options dialog](01-options.png)

Do not generate a new key if RStudio finds one!

![Create RSA Key](02-create-key.png)

![Review RSA Key](03-review-key.png)

Note the location (folder) of the files and the name of the files (id_rsa).
There are two keys / files: the public one (`id_rsa.pub`) is OK to share.
The private key (`id_rsa`) should always be kept private.

On OS X, you might have to run the following commands to configure the `~/.ssh/` dir:

```
chmod 700 ~/.ssh
chmod 400 ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa.pub
```

Test connection to GitHub with: `ssh -T<EMAIL_ADDRESS>

## 4. Add Public Key to GitHub

### RStudio IDE > Options > Git/SVN > View Public Key

![RStudio finds the key](04-rstudio-key.png)

![Public key](05-public-key.png)

Copy the Public Key to the Clipboard

### Go to: GitHub > Settings > SSH and GPG keys

![GitHub Keys](06-github-keys.png)

### Add SSH Key to GitHub

![GitHub Add SSH Key](07-github-add.png)

## 5. Clone RStudio Project

### RStudio IDE > File > New Project ... > Version Control > Git

![RStudio New Project](11-rstudio-project.png)

Select Git, it should look like this:

![Configure Project](12-configure-project.png)

### Go to: GitHub > project repository > get link

Select "Clone with SSH" then copy to Clipboard the<EMAIL_ADDRESS>link.

![GitHub Link](13-github-link.png)

### Copy and Paste the link into RStudio dialog box

The Project directory name should be populated automatically.
You should select the parent folder.

![Configure Project](14-configure-project.png)

### Press [Create Project]

If the RSA keys are not configured correctly, you will see an error message.
`Permission denied (publickey)`

If successful, RStudio will open the new project and in the **Files** panel
you will see the project files. This is your *local repository*.

You will also see a **Git** panel
(empty at the beginning) where you can pull, commit and push code changes.

## 6. Update your local files

If you want to keep your *local repository* up to date, you need to **Pull**
code from the *remote repository (GitHub)*.

### RStudio IDE > Git panel > press **Pull**

![RStudio Git Pull](15-git-pull.png)

Please notice that on the top-right side the Git panel display the "branch",
in this case `master`.

**Note:** If you just want to view new code using Pull should be sufficient.
If you make any changes you should discard them before using Pull.

**For making changes, merging and pushing please see a more advanced
Git tutorial.**

repository: numeract/learning-R

repo_name: numeract/learning-R


text:
---
layout: post
title: Automated Acceptance Tests with Behat
date: 2013-11-19
---

[Behat][1] is a powerful behavour-driven-development testing framework for PHP. Combined with Mink, and you can quickly start writing acceptance tests for your application, plug-in a headless browser like Phantom and you can automate it, without the hastle of selenium.

Let's walk through setting up automated acceptance testing for a simple application, testing authentication, content creation and even payment processing, cleaning up test data once its done.

[Michael Peacock][2] is the CTO at [Ground Six][3], author and occasional speaker.

Please register for your ticket at [Eventbrite][4].

[1]: http://behat.org/
[2]: https://twitter.com/michaelpeacock
[3]: http://groundsix.com/
[4]: http://www.eventbrite.com/e/phpne-november-automated-acceptance-tests-with-behat-tickets-9297221239?aff=eorg


text:
---
layout: article
title: 分布式机器学习综述
header:
  theme: dark
  background: '#333'
article_header:
  type: cover
  image:
    src: /head.jpg
---

#
More recent work focuses on bridging the gap between fast heuristics and the slow2, but somewhat more principled, spectral approach. Defferrard et al. (NIPS 2016) approximate smooth filters in the spectral domain using Chebyshev polynomials with free parameters that are learned in a neural network-like model. They achieve convincing results on regular domains (like MNIST), closely approaching those of a simple 2D CNN model.


text:
# KeystoneJS Roadmap

***This is a living document outlining major future features***

## 0.4.0

* [Elemental UI](https://github.com/keystonejs/keystone/issues/1335)
* Password recovery https://github.com/keystonejs/keystone/issues/70
* Mongoose 4.0.0

## 1.0.0

* [Make the Admin UI an SPA](https://github.com/keystonejs/keystone/issues/903)
* Allow Admin UI Customisation
* Restructure App Initialisation (more flexible / pluggable)

## Backlog

* Add squire as option for wysiwyg editor https://github.com/keystonejs/keystone/issues/1112
* Permissions (aka Super Users) feature https://github.com/keystonejs/keystone/issues/803

repository: twreporter/keystone

repo_name: twreporter/keystone


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

### Description

Buffer overflow in Chrome <IP_ADDRESS> and earlier allows remote attackers to cause a denial of service (crash) via a packet with a large length value, which leads to a null dereference or out-of-bounds read.

### POC

#### Reference
- http://aluigi.altervista.org/adv/chrome-boom-adv.txt
- http://marc.info/?l=bugtraq&m=107964719614657&w=2

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


text:
# InsightsServer.BasicMovie

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | Unique identifier representing a specific movie script. | [optional]
**names** | [**Names**](Names.md) |  | [optional]
**picture** | [**Picture**](Picture.md) |  | [optional]
**unifiedScore** | **Number** | combined score of imdbScore and imdbRatingAmount | [optional]

repository: Thylossus/tud-movie-character-insights

repo_name: Thylossus/tud-movie-character-insights


text:
# STVCameraHEAD
In this project we control the movement of two step motors using the Arduino Uno R3. It is possible
to do it with the joystick or via webpage. The project is design in such a way that none of the user's
inputs or power blackouts can destabilize the system or tangle the wires.

# Getting Software
In order to use the STVCameraHEAD we just need to download:
- [the Arduino IDE](https://www.arduino.cc/en/Main/Software)
- [the code](https://github.com/hobitolog/STVCameraHEAD)
- any preferable text editor of your choice

# Where to start?

## IP configuration

In case of connecting out system to the new network we need to check the ip of the current router. We can do it in two ways:
- manually (it should be somewhere on the router's case, usually on the bottom)
- by the software (this depends on the operating system):
1. *WINDOWS* - open cmd -> call ipconfig -> read the network gateway and the mask
2. *LINUX* - open terminal -> call ifconfig -> read our ip and the mask

Example output
```
wlan0: flags=xxxx<UP,BROADCAST,RUNNING,MULTICAST>  mtu yyyy
        inet <IP_ADDRESS>  netmask <IP_ADDRESS>  broadcast <IP_ADDRESS>
```

Following these information it's rather easy to deduce available address span. Write down some possible combinations and save it for further work.

Suppose we have obtained our ip address <IP_ADDRESS> and the mask <IP_ADDRESS>, then we can choose from 256 hosts, but beware of already connected devices. It's safe then to select the one from the middle, for example:
<IP_ADDRESS>.

Now go to the Header.h file and press Ctrl-F and type "IPAddress". It should take you straight to the the line in the code where ip address is set.

```c++
/* Replace octets to match your network */
IPAddress ip(192, 168, 0, 177);

```

From no on it should all work as expected.
Open Arduino IDE,  connect the ethernet cable to the Arduino board, power up the hardware components and run the program.

## IP configuration (extra bonus)

If method above didn't workout it means that the network is probably densly populated. In this case it can be hard to have luck and hit the mark at once.

Try then downloading [nmap software](https://nmap.org/) and scan the network for available free addresses.

## Arduino code

Arduino code is divided into two separate file in the name of readability - Header.h and STVCH.ino.

## Web page code

After testing different combinations for Arduino it appears to be best to have a single file both with html, css an javascript inside it.
User does not have to make any changes in the code unless he desperately wants to. Keep in mind to put the index.htm file onto your sd card and insert it into the Arduino Ethernet Shield. Otherwise it will be pretty hard to do anything.

## Summary

After steps above you should be able to fire up and use the camera head.

# How to use?

## Overview

Configure the camera head as stated above.
Connect your laptop to the network, open web-browser and type the address of the camera head you obtained during  configuration process

![Connect to camera head](images/connect.png)

Then the following webpage should appear:

![Webpage](images/webpage.png)

It's divided into 3 main sections - Speed Control, Angle Control and Joystick Control.

Speed Control and Angle Control are sliders with value feedback, and Joystick Control is a panel to click/touch and hold the cursor in order to move the camera head.

### Speed Control

Default values are set to zero and you can change them at your will. The changes will affect the speed of steppers both in online control or by physical joystick.

### Angle Control

Set angle you want and it will make the camera head move in the desired direction (point-to-point movement).

### Joystick Control

Touch/click to move the camera head in the desired direction.

# Built With
- [Accelstepper.h](https://www.arduinolibraries.info/libraries/accel-stepper)
- [Multistepper.h](http://www.airspayce.com/mikem/arduino/AccelStepper/classMultiStepper.html)
- [Ethernet.h](https://www.arduinolibraries.info/libraries/ethernet)
- [SPI.h](https://www.arduino.cc/en/Reference/SPI)
- [SD.h](https://www.arduino.cc/en/Reference/SD)

# License
This project is licensed under the MIT License. The licence should be downloaded with the github code, if not you can find it [here.](https://github.com/hobitolog/STVCameraHEAD/blob/master/LICENSE)

# Authors
- Adam Banaszczyk
- Krzysztof Stężała

repository: hobitolog/STVCameraHEAD

repo_name: hobitolog/STVCameraHEAD