text:
# OpenJS Foundation Standards WG meeting 2019-07-02

## Links

* **Recording**:
* **GitHub Issue**: https://github.com/openjs-foundation/standards/issues/7

## Present

- Myles Borins (@MylesBorins)
- Jory Burson (@jorydotcom)
- Richard Gibson (@gibson042)
- Eemeli Aro (@eemeli)
- Sendil Kumar (@sendilkumarn)
- Brian Kardell (@bkardell)
- Christian Bromann (@bromann)

## To discuss

* [JB] FYI - Update on Status @ W3C & Ecma International

EA: I would like to participate in 402 as a delegate
JB: Let’s figure that out!
MB: We need to bear in mind that we do not want to undermine the bus. Model of these orgs. Need to make sure people understand they are representing organizations and not themselves as individuals.
RG: I think this is good summary - I work for an org that could join Ecma but in practice is not going to.
EA: This is my situation as well. I would rather us not be in a position to have to define the terms (independent vs. not).
MB: I think we need to be thoughtful and careful about how many reps we send and make sure they are going with the ‘OpenJSF’ hat on. Should we send people with very specific goals in mind?
EA: I think it makes little sense to figure out what the rules are at this point and deal with this case by case.
JB/RG: short description of how these decisions were made in the JS Foundation
JB: {}
BK: I think in general it would be good to have more cross-project discussion about what needs to exist or what needs to advance. That speaks more to our value of representing the JS Ecosystem.
MB: The board charters the CPC, the CPC can charter other groups. We can put together a charter for this group. We tried to put as little as possible into the charter and as much as possible into the governance. We could go through this exercise as a group to get chartered by the CPC.
EA: I don’t think there’s any need to make changes in the CPC charter. {reads relevant section from charter}
MB: Then this group can get chartered by the CPC to handle that.
BK: I think this is all useful, it;s also a little meta. I wonder in very practical ways  is there something very simple we can do that we’re not doing?
MB: Great question. We could do a TC39 or TPAC premeeting, etc.
BK: Yes, this is a great example, +1 to that idea.

* [JB] What is our Scope - what are things we could be doing
Asking for feedback on specific proposals
Outreach things that Dan et al are doing around TC39
See stage-0 proposals
https://github.com/openjs-foundation/cross-project-council/blob/HEAD/proposals/incubating/SHARED_INTERFACES/README.md
https://github.com/openjs-foundation/cross-project-council/blob/HEAD/proposals/incubating/STANDARDS_OUTREACH/README.md
Pre-meetings for TPAC, TC39 meetings
BUDDY SYSTEM!
Play a connector role around standards and working groups
Meetups with TAG, etc
Disseminate information about what these groups are doing/talking about/working on
EA: I was not aware that the JSF was participating. It was not easy to get that info. I hope we can do more to inform people about what we’re doing.
CB: It should be easy for someone from the outside to understand and get involved/participate.
BK: One of the things W3C does now is that they have a buddy system to help you navigate

* [JB] Travel Budget Clarification

BK: No thoughts beyond I have no idea - rely on other people :)

* [JB] TPAC in September

Who’s attending? Christian, Myles, Brian, Jory -
AI: Open an issue in the Standards repo to discuss the agenda and figure out if anyone needs proxies/etc
AI: Schedule a pre-meeting for those interested?

## To decide

* How often are we gonna meet (weekly or bi-weekly or other)? Decide the time and day for the recurring meeting?

BK: weekly seems excessive
SK: once every two weeks?
MB: this webinar is set as a recurring bi-weekly
DONE
MB: Will update the meeting tool to generate all this for us

## Questions

* [SK] Getting started with Standards:
  - What is the general plan here? What do we expect to have in MVP?

JB: We could add learning resources to the repo
EA: How do we want to present ourselves to the SDOs and to the JSDev audience at large? Are we really pitching ourselves as part of the projects or as part of the larger organization (OpenJSF)
BK: Excellent question - historically we were rooted in the projects
CB: Maybe this is something we want to define as a Working group
EA: it also extends to the OpenJSF as a whole

* [SK] Specification Writing & Workshop:
  - Are there any resources already available?
  - Are we gonna have this during the collab summit?

repository: openjs-foundation/standards

repo_name: openjs-foundation/standards


text:
## grapql4j

`GraphQL, a query language and execution engine originally created at Facebook in 2012 for describing the
capabilities and requirements of data models for client‐server applications.
`

_We noticed that their where not many implementations in java which support this query language so we decided to do something about it._

## Goal

  - The goal of this project is to generate a datamodel from any graphql schema together with generating a query language model.

## Usage for parsing the schema

    usage: java eu.ludimus.graphql.generator.ParserMain <schema path> <packagename> <output path>

    e.g: java eu.ludimus.graphql.generator.ParseMain ${basedir}/src/test/resources/tweet.graphql eu.ludimus.tweet ${basedir}/target/generated-sources

## How the result can be used
    After running the parserMain, you end up with a <packagename>.model and a <packagename>.query package.
    The model can be used for marshalling the result from the graphql server.
    The query can be used to create the actual data for the post query.

e.g: with this schema

        type Tweet {
            ID: ID!
            # The tweet text. No more than 140 characters!
            body: String
            # When the tweet was published
            date: Date
            # Who published the tweet
            Author: User
            # Views, retweets, likes, etc
            Stats: Stat
        }

        type User {
            ID: ID!
            username: String
            first_name: String
            last_name: String
            full_name: String
            name: String @deprecated
            avatar_URL: URL
        }

        type Stat {
            views: Int
            likes: Int
            retweets: Int
            responses: Int
        }

        type Notification {
            ID: ID
            date: Date
            type: String
        }

        type Meta {
            count: Int
        }

        scalar URL
        scalar Date

        type Query {
            Tweet(ID: ID!): Tweet
            Tweets(limit: Int, skip: Int, sort_field: String, sort_order: String): [Tweet]
            TweetsMeta: Meta
            User(ID: ID!): User
            Notifications(limit: Int): [Notification]
            NotificationsMeta: Meta
        }

        type Mutation {
            createTweet (
                body: String
            ): Tweet
            deleteTweet(ID: ID!): Tweet
            markTweetRead(ID: ID!): Boolean
        }

it generates a Query class in the query package which can be used like:

    Query.Tweets(3, 2, "methodName", "asc")
                .withResponse(Tweet.graphql().includeAuthor(
                        User.graphql().includeAvatar_URL().includeFirst_name().includeFull_name())
                        .includeBody()
                        .includeDate()
                        .includeID()
                        .includeStats(Stat.graphql().includeLikes().includeResponses().includeRetweets().includeViews()))
                .toQuery();

which gives the following query:

    Tweets(limit: 3,skip: 2,sort_field: "methodName",sort_order: "asc"){ID body date Author {first_name full_name avatar_URL }Stats {views likes retweets responses }}

branch_name: refs/heads/master

extension: md

gha_language: Java

license_type: permissive


text:
## bioloid_description

ROS package (mesh files and URDF) for Bioloid premium kit type A robot.
This package can be used with the real robot or Gazebo (physics simulator).

## ROS Dependecies
Install message-to-tf to convert odometry to tf:
```
$ sudo apt install ros-kinetic-message-to-tf
```

## Usage
```
$ roslaunch bioloid_description rviz.launch
```

![system](assets/images/bioloid_rviz.png)

Adapted from https://github.com/MathieuR/bioloid_typea_description


text:
# candidate-twitter-analysis

# Congressional Candidate Twitter Scraping and NLP Analysis

This Python program was originally written to gather Twitter data from candidates running for office in each of 8 congressional districts in Minnesota to use as part of a statistical model for predicting voter turnout in the 2018 Midterm Election. While it was originally written for Minnesota (which has 8 congressional districts), it could easily be changed to accommodate different numbers of districts.

This works with Python 2.x versions currently (tested on 2.7).

# Important Notes:
- Code is annotated with many comments. Please read them.
- The program requires input files (there are examples provided)
- API keys will need to be filled in with your own

# How to Run (after required installations):

In a Terminal:
	$ python2.7 twitter.py

# To use the program, you will need to have several things installed:

1. TwitterAPI:
	- First, in order to use this package or any of the APIs, you must have a developer account with Twitter. You can request a developer account from their website. and
	- Next, you will need to create a project in order to get API keys. They will also ask for justification when creating a developer account/project.
	- Install a package called TwitterAPI by geduldig (https://github.com/geduldig/TwitterAPI). This will allow you to send requests to the API of your choice and receive data. They give instructions on how to install it.
	- ** Important ** You will need to specify your consumer_key, consumer_secret, access_token_key, and access_token_secret in order to utilize the APIs

2. TextBlob:
	- This is a Natural Language Processing package and is used for gathering important information from the body of the Tweet.
	- You can find installation instructions and documentation here:
		https://textblob.readthedocs.io/en/dev/install.html#with-conda

	Note:
		- You may need to install other dependencies such as Anaconda for the installation process
		- An older version of Python is required -- I am using a version of Python 2.7

# Input: There are example files available of the necessary inputs

	1. Candidates.csv :
		 - This CSV has three columns: This will be used to create Candidate objects
		 		1. FirstLastP (Candidate Name and party affiliation
		 		2. (Congressional) District
		 		3. Year

	2. CandidateTwitters.csv : Will be used to create a dictionary of names and Twitter handles
		- This CSV has two columns:
				1. Name
				2. Twitter Handle

Last Updated: 11/29/2018

license: MIT

repository: thiede-b/candidate-twitter-analysis

repo_name: thiede-b/candidate-twitter-analysis


text:
#Marketing website

Planning docs here: https://drive.google.com/a/optimizely.com/folderview?id=0B4VR-FZkzkAVSGpibGp1SjBwUmM&usp=sharing

##Getting started (for developers)

1. Install node.js (and npm)

You can install both with an easily from the [Node](http://nodejs.org/) website.

2. Clone this repo

3. Install dependencies

Navigation to the repo directory in the command line and execute the following command:

`npm i`

All done!

##Starting the local server

1. In the root of the repo, execute this command:

`grunt server`

repository: pifantastic/marketing-website

repo_name: pifantastic/marketing-website


text:
---
layout: post
title: Phase 3 - Build
---

This phase is where you start building the service and releasing it for customers to use in a ‘production environment’. At the end of the phase you will have a working service, though still have important things left to do.

It is important to continuously release parts of the service and get feedback. If you don't do that, you'll be creating an ever-larger risk that the service won't achieve its aims.

This phase is unlikely to be useful if you are using off-the-shelf software.

Team and skills

During this phase, the team will experience the benefits of having built the team in the earlier phases. A highly engaged Product Owner will ensure that the right user stories are prioritised and the business’ expectations are met, and developers with a common understanding of user need will deliver better work.

However, the roles of the service designer and user researcher remain important to test and iterate the usability of the service. A content editor can ensure that the language of the service is also clear and that it is written in a way that makes it easy to find from search engines.

A project sponsor

A Product Owner

A project manager

A developer (potentially a front-end and back-end developer)

A service designer

A user researcher

A subject matter expert

At times, you will also need to involve:

Information governance

Content design

Councillors and senior officers

Suppliers of existing solutions

Applications Support Officer

Engineers to install solutions, establish connectivity or configure servers

Governance

During this phase, you should be releasing iterations of software into a product environment at least fortnightly. This may take the form of a ‘friendly user’ trial or the soft-launch of a ‘beta’ version.

Where the iteration may have an impact on other tools, a change management request should be submitted to ICT’s Change Advisory Board, which ensures that change is well-managed and documented on behalf of the whole council.

If the solution architecture changes materially during the course of this phase, it should also be submitted to CAB.

At the end of the phase, you will need to request a service standard assessment prior to the service being launched or presented as fully operational.

Tools

The key tool in the building phase will be the user stories. Each user story needs to contain acceptance criteria detailing how it should work technically and what it needs to achieve for customers. In essence, the build phase is a process of working through each user story until it is ‘done’ and then moving onto the next story.

The tools which can help with this include:

Kanban boards (either physically or digital boards like Trello or JIRA)

Story estimation

Sprint Planning

Calculating a ‘velocity’ rate - the speed at which the team is able to deliver a story point

Team healthcheck

To successfully complete the phase, you may also find useful:

An updated business case

An Acceptance into Service document

An Equalities Impact Assessment

A Privacy Impact Assessment

A digital take-up plan

An assisted digital plan

Timing

This phase of work can take a few weeks or several months. The length of the phase is less important than the regular release of working software.

For inspiration

How to write great user stories

Outcomes

A fully operational service that meets some of users’ needs including changes to the underlying business process

A clearly defined list of user stories that would meet all users’ needs

A set of KPIs for the digital service and understanding of how these map against the KPIs for non digital elements of the service

Evidence the service can lead to the desired customer and business outcomes

End of phase checklist

We have:

A service that works for users first time, unaided and evidence to show that it meets their needs

A team that can support the service, have a shared understanding of how it works and understands the remaining user stories and how to achieve them

Tested the service end-to-end in an environment similar to the live environment, on all common browsers and devices

Promoted the service

Started measuring the performance of the service

Support for those who cannot use a digital service without assistance

A plan for what to do if the service is unavailable

A completed Service Standard assessment, published on HackIT.org.uk

An updated, completed Privacy Impact assessment

Tested the service with the Cabinet member responsible (or the senior officer to which they delegated this)

Team and skills

Governance

Tools

Timing

Outcomes

End of phase

repository: LBHackney-IT/HAL

path: /_posts/2017-06-02-Phase 3 - Build.md

gha_language: CSS

gha_license_id: MIT

repo_name: LBHackney-IT/HAL


text:
# Code-Quiz

## Description

This project utilizes DOM manipulation, client-side storage, and javascript fundamentals with arrays and sorting. The project is a JavaScript multiple-choice quiz that generates a score that can be saved to local storage with the highest score listed first.

The code incorporates event delegation on dynamically created HTML elements and navigating the JavaScript quiz object with questions and answers. The quiz is managed by a JavaScript interval function that displays a countdown timer and will inform the user when the quiz is done.

## Table of Contents

* [Installation](#installation)
* [Usage](#usage)
* [Credits](#credits)
* [License](#license)

## Installation

Here is the link to the webpage:

https://jgarcia60.github.io/code-quiz

To install the project files, you can clone the "code-quiz" repository which contains the necessary JavaScript, html, and CSS files at https://github.com/jgarcia60/code-quiz by clicking the green drop down "Code" and cloning the repo with an SSH key.

## Usage

You may use this code as your own quiz simulator, or as a tool to develop a template for dynamically creating and appending HTML elements, using local storage, and implementing event delegation and event-handling for dynamic event listeners.

This is what it looks like:
![screenshot](./code-quiz.png)

## Credits

All HTML, CSS, and JS files, edits, additions, and revisions were done by Jonathan Garcia (https://github.com/jgarcia60/code-quiz).

## License

MIT License

Copyright (c) [2020] [Jonathan Garcia]

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

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

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

---


text:
---
layout: page
title: "Heljyks"
date: 2005-09-13T23:06:41+00:00
comments: true
sharing: true
footer: true
group: Macropedia
categories: ["imperium edition", "chang singh authored", "social sciences"]
---

Hegemonic Economic Trade Group

Heljyks

Helsmunt Institute

Despite the relative peace and security of the High Imperium, it was not without its troubles, many of which came from,  [Periphery](/macropedia/periphery), that vast region of space largely beyond Imperium control.  The Heljyks were the [Periphery](/macropedia/periphery)'s most well-known and notorious inhabitants.  Their origins are uncertain, though they seem to have had some relationship with the [Anthorph](/macropedia/anthorph)s and were themselves genetically altered to survive in the vacuum of space.  They divided themselves into many clans, and other than the common bond of language, culture and genetics, were never fully united.

Early contact between the Imperium and the Heljyks during the [Tawmerik Dynasty](/macropedia/tawmerik-dynasty) was not necessarily unfriendly, and briefly there was even a Heljyk ambassador in the Imperial Court.  Later, however, relations darkened.  The Imperium was now seeking to expand deep into the [Periphery](/macropedia/periphery).  The Heljyks, fearful that the Imperium might stumble upon their clan bases, attacked first, sparking a series of wars known as the [Wars of Expansion](/macropedia/wars-of-expansion), in which the Heljyk clans were decimated and the Imperium greatly enlarged at the expense of many smaller systems that had for centuries enjoyed anonymity.  The Imperium was initially fearful that the [Anthorph](/macropedia/anthorph)s might rise up, but they did not, despite any particular relationship to the Heljyks (and [Anthorph](/macropedia/anthorph)s would never speak of it), they fought on the side of the Imperium.

The remnants of the Heljyks changed tactics.  It was impossible to defeat the vast resources of the Imperium, so they became pirates and geurilla warriors instead.  Their ships, much faster in normal space than Imperium ships due to the genetic modifications of the Heljyks to withstand fatal G-forces, could wipe out a planet's satellite network faster than defense forces could counterattack.  They plagued shipping lanes, took hostages particularly from the noble families, making fortunes off the ransoms.

Steadily their numbers dwindled, however, though the reasons are still uncertain.  The Heljyks disappeared entirely towards the end of the High Imperium, and many thought for good.  During the later years of the [Imperial Interregnum](/macropedia/imperial-interregnum), however, some rumor came to more civilized parts of Heljyk ships being seen in Imperium space.  It is said that certain Imperium families driven out during the early [Imperial Interregnum](/macropedia/imperial-interregnum) had taken refuge with the Heljyks, and it shouldn't seem surprising that these people would have aided anyone who despised the Imperium.  This particular scholar wonders as well if the Heljyks may have had some designs against the [Anthorph](/macropedia/anthorph)s as well.

## References
1. [Anthorph](/macropedia/anthorph)s
1. [Imperial Interregnum](/macropedia/imperial-interregnum)
1. [Periphery](/macropedia/periphery)
1. [Wars of Expansion](/macropedia/wars-of-expansion)

## Related Articles

1. [Tawmerik Dynasty](/macropedia/tawmerik-dynasty)
2. [Imperium Edition Index](/macropedia/imperium-edition-index)
3. [Imperial Interregnum](/macropedia/imperial-interregnum)
4. [Periphery](/macropedia/periphery)
5. [Anthorph](/macropedia/anthorph)
6. [Wars Of Expansion](/macropedia/wars-of-expansion)

gha_language: HTML


text:
# Coding conventions of dashup

## 1 Git

- Commit only relevant files
- Commit message has to contain branch name, e.g. "master: [...]"
- If you are committing an issue, the commit message should be something like: "issue #123". This allows us to navigate withing GitHub.
- Do not commit on master branch (except for documentation changes or similar)
- Reviews:
    - When a feature is implemented, open a pull request and add all other contributors as reviewers
    - Take reviews serious!
    - Do not merge your issue or feature branch if there is no pull request

## 2 Maven

- Add only dependencies if they are necessary
- The same applies to plugins

## 3 Coding

### 3.1 General

- Run formatter before committing
- Do not commit errors
- Do not commit warnings
- No codacy issues

### 3.2 Naming

- Use camel case (no underscores, etc.) in Java
- Use descriptive names for classes, methods, variables etc.
- Do not use abbreviations

## 4 Consequences

Each violation of the conventions leads to 1 beer. At the end of the project, all contributors meet and drink that beer until they are "sternhagelvoll".

repository: raphaelmue/dashup

repo_name: raphaelmue/dashup


text:
# Discord-PaperAPI
Provides a discord bot representation of the Paper API.

The Paper API module comes from: https://github.com/CoreyShupe/PaperAPI.rs

## Setup

To start the bot you'll need a file `etc/config.json` in your project directory formatted as such:
```json
{
  "token": "some_discord_bot_token"
}
```

The in the same directory run the binary as such `./discord_paper` and it will start the bot. Viola.

repository: CoreyShupe/Discord-PaperAPI

repo_name: CoreyShupe/Discord-PaperAPI


text:
# URL handlers - Assembly 2016 presentation

## Using

Can be viewed [on the web](http://hack.urlhandlers.info/assembly/).

Can also be used locally by running a web server.

```console
npm install
npm start
```

And connecting the browser to <http://localhost:8080/assembly/>.

## Publishing on the Github Pages

```console
git subtree push --prefix web origin gh-pages
```

## Setting

* Target <http://www.assembly.org/summer16/program/arttech-seminar/sessions/>
* Presentation language is English
* Crazy demo videos & screenshots
* Wake-up calls & disruptions
* Grande entry and grande finale
* Make sure that screen is mirrored so no need to look away from the crowd
* Always handle transitions between speakers explicitly
  * "Aimo, please"
  * "Atte, go ahead"
  * "Aimo, show me"
  * "Atte, shoot"
* Mac vs. Windows fairness (split screen or altering between them)
* Draft presentation <http://www.ee.oulu.fi/~exec/remarktest.html>
* Technical implementation
  * Static pages in GitHub Pages
    * HTML/JS/.../M4V-files
    * Can be cloned and presented locally
    * or given as online link that can be shared
* TODO:
  * presentation requirements to organizers
  * how to handle transitions from presentation to videos and backwards
    * two screens? (how to prevent next video from starting)
    * embedded videos

## 00:00 1. Motivation - video://

* Title
* video://
  * You open a browser and visit a web page
  * xmas video in fast pace (15 secs?, 10+ x, faster towards end?)
    * From Jani / talk about the target length and the split
    * The beginning sequence should show *extremely* clearly that it is
    just about opening a regular web page
    * Increasingly chaotic music/noise that abruptly cuts to silence,
    in style of <https://youtu.be/ZV-UEca2W9U?t=1m16s> (from 1:16 to 1:33)
      * [option 1 - Tybercore - Heavy Cinematic Hybrid Trailer](https://youtu.be/cKcDwlIPIro?t=57s)
      * [option 2 - Tybercore - Nocturnal Creature](https://youtu.be/a9SBfblEA6w?t=52s)
      * [option 3 - Tybercore - Hybrid Hollywood Trailer](https://youtu.be/sf820zgOhsI)
    * Cut to black in sync with the sound
    * Video candidates:
      * [Xmas video](https://youtu.be/Z9IG9ZD3PNI)
* why://
  * **What** did just happen?
  * You might not want all this happen on your machine
* who://
  * _Aimo_ speaks and _Atte_ introduces demo videos.
  * We are from University of Finland
  * We will walk you through this in slow motion
* video://replay
  * ~~Start from the end frame (black?) and "rewind" the video from end to
    start in superspeed (with the sound also rewinded backwards without
    the pitch going up)~~
  * ~~cut xmas video to sensible length with annotations?~~
  * Have screen shots with annotations
    1. you visit a web page
    1. plenty of applications open
    1. all sort of content opens
    1. printers and cameras get involved
    1. you hope to do your best to cancel everything safely
  * not too much detail in verbal explanation
  * TODO:
    * normal web browsing video? to explain common case (must be short)!!!!
      * maybe not, maybe just change the subtitle "... by exactly what?" to
        "surfing the web is safe!"
    * ~~initial video instead of writing URL maybe just surf~~ (not)
    * *screenshots* with annotations 1. - 5. from above

## 00:05 2. How did we end up here - gopher://, <http://>, magnet://, xxx://

* <http://>
  * For the masses
* <gopher://>
  * When I was young gopher
* <magnet://>
  * For the future
* <xxx://>
  * We found plenty
  * handler cloud?
* TODO:
  * title from URL (handlers) to URL schemes?
  * rearrange to start with <http://>
  * lead to the load with xxx:// - we found plenty of more
  * explain handler cloud
    * grow the cloud in ~5 slides

## 00:10 3. Challenge - <http://challenge.urlhandlers.info>

* This is **Serious** research
* Crowd sourced challenge
* Three teams (yellow, red and blue)
* Example screenshot of a steam or in-game chat
* Need help in research to find out what are the surprise "browsers" out there
* TODO:
  * From Serious Research -> "Pokemon" challenge (three colors)
  * After that explain what people have to do
  * In-game screenshots for Eve Online, SC2, CS GO, ...
    * One here, more later in challenge peek
  * We need you to ... no user agent forging!
  * Team with most user agents, most source addresses windows
  * Scoreboard display

## 00:15 4. Are URL handlers secure? - word://

* Video about opening word on remote content by surfing the web
  * [Open Word v0.5 video](https://youtu.be/5B7QV8iBOYU)
  * Word opens with remote content
* So what?
* Video, orginal at <https://www.youtube.com/watch?v=GyZMJr7RfBE>
  1. remote word content opened due to "careless" surfing
  1. Macros are accepted
  1. Files get encrypted
  1. Ransomware note pops up
* Video
  * [Locky in Action v0.6-cut video](https://youtu.be/PKDQhUWEQFM)
* What happen
  * *screenshots* with annotations 1. - 4. from above
* Recap with handler cloud
* TODO:
  * you visit a web page with a word link video, add sound
  * add sound to the "so what" video
  * recap with cloud with word:// circles
  * credit the original video by Omicron AG - Swiss made IT Security

## 00:20 5. Pop up marketing strikes back - twitter://

* [Popup marketing strikes back video](https://youtu.be/_TkR05uaDWI)
  * iframe carrousel launcher
  * twitter "advertisement" profiles and tweets
* fb:// ???
  * twitter is not the only one,there is e.g. Facebook ???
* TODO:
  * cut twitter ad video and add sound?
  * annoted screenshot based explanation in N steps?

## 00:25 6. Hack the Windows vs. Hack the Mac - freakshow://

* Challenge status (just a quick peek)
* Did you know you have candy crush soda saga in your windows?
* What URL handlers i do have in my gaming pc?
* Where I can insert URLs?
* Some browsers do block or ask! (not all of them tho)
  * But there are more than the browsers!
* TODO:
  * 1..n handler:// + screenshot
    * WIN: candycrush ?
    * MAC: bitcoin:3JDs4hAZeKE7vER2YvmH4yTMDEfoA1trnC?amount=666&label=Honest%20Marko&message=You%20Won
  * 1..n embedded browser
  * everything + split screenshot

## 00:30 8. Grand Final - dontpanic://

* challenge results so far
  * live until end of assembly
* [URL Handled video](https://youtu.be/I2K4bPCw9SE)

## 00:35 9. Q&A

* Meet and greet with mad and harmless scientists
* University of Oulu (OUSPG)
  * Juhani "Aimo" Eronen (Secret government agent)
* Kasper "Atte" Kyllönen (Summer trainee in crime "just a regular high schooler")

### Credits

* Mikko Kenttälä
* Joachim Viide
* Jani Kenttälä
* Marko Laakso
* [Original source material Locky in Action from Omicron AG - Swiss made IT Security](https://youtu.be/GyZMJr7RfBE)

repository: ouspg/urlhandlers

gha_language: JavaScript

repo_name: ouspg/urlhandlers


text:
---
layout: page
title: Crispy
subtitle: Multiplet Simulations Made Easy
use-site-title: false
bigimg: /img/path.jpg
---

>Crispy is a graphical user interface written in [Python](https://www.python.org/) that facilitates the simulation of core-level spectra. The interface provides a set of tools to generate input files, submit calculations, and analyze the results obtained with programs such as [Quanty](http://quanty.org). It has a modular design and can be run on macOS, Linux, and Windows platforms.

Installation
============

Windows
-------
The easiest way to install crispy is to use the installer provided on the [releases](https://github.com/mretegan/crispy/releases) page. Because the installer is only created when a release is published, it might lack newly implemented features. If you want to use the latest development version, follow the instructions below.

From Source
-----------
First you have to make sure you have a working Python distribution. While crispy works with both Python 2 and Python 3, you should try to install Python 3.5 or greater, as in previous versions some of the dependencies like PyQt5 cannot be easily installed. On macOS and Windows you can install Python using the [official](https://www.python.org/downloads) installers. In particular for Windows you should install the 64-bit version of Python, and make sure that during the installation you select to add Python to system's PATH. On Linux, Python and dependencies (see below) can be installed using the system's package manager (``apt-get``, ``dnf``, ``pacman``, etc.).

Crispy depends on the following Python packages:

- **[PyQt5](https://riverbankcomputing.com/software/pyqt/intro)**
- **[numpy](http://numpy.org)**
- **[matplotlib](http://matplotlib.org)**
- **[silx](http://www.silx.org)**

The dependencies can be installed using `pip` (only for Python 3.5 or greater):

    pip install -r requirements.txt [--user]

The `--user` options is usually only required for Linux or macOS operating systems.

It is possible, although unlikely, that the development version of crispy requires features that are not yet available with the pip installable version of silx. In this case you have to also install silx from source. This is not always a very simple task, especially on Windows, but there is extensive [documentation](http://www.silx.org/doc/silx) on how to do it.

Once Python and all dependencies are installed, you can proceed to installing crispy. You can download the source code from GitHub either as an [archive](https://github.com/mretegan/crispy/archive/master.zip) or using `git`:

    git clone https://github.com/mretegan/crispy.git

To build and install the package, run:

    cd crispy
    pip install . [--user]

**Note**: External programs required to run the spectroscopy calculations have to be installed and the PATH environment variable must be set for crispy to be able to use them.

Usage
=====
If you have used the installers, crispy should be easy to find and launch. For the installation from source you can start crispy from the command line using:

    crispy

This is a file created during the installation and should be available from the command line if the PATH environment variable was set correctly during the initial Python installation.

You can also start crispy without installing it by going to the source directory and executing (only for Python 3.5 or greater):

    python -m crispy

License
=======
The source code of crispy is licensed under the MIT license.


text:
LITabControl
============

An auto-layout based multi-tab control designed to look and behave like the tab control in Apple's Numbers spreadsheet.

Features
--------

LITabControl distinguishes itself from other opensource tab systems with its support for Numbers-style behaviors. It supports arbitrary drop-down menus associated with each tab, an animated scrolling tab area, and animated tab reordering.

Classes
-------

The LITabControl project includes 2 classes:

1. **LITabControl** - an NSControl subclass used to display tabs.

2. **LITabCell** - an NSButtonCell subclass used to draw the tab area and to draw both text and images in Numbers-style.

Using LITabControl
------------------

To learn how to use LITabControl, run the LITabControl project in Xcode. LIAppDelegate implements the LITabControlDataSource protocol to display a series of tabs across the top of its associated window.To Add the control to your own project, copy or link assets and classes located in the Classes folder to your project.

To respond to tab clicks - set LITabControl's target and action properties, or listen for LITabControlSelectionDidChangeNotification notifications.

To add new tabs, set LITabControl's addTarget and addAction properties. Your method used to add a tab should behave like this:

```
- (IBAction)addTab:(id)sender {
  // .. add some model object representing your tab
  [sender reloadData];
}
```

RECENT CHANGES
--------------

* 12/28/13
  * Tab title editing, double click to edit.
  * Fixed vertical text offset in dragged tabs.
* 12/29/13
  * Fixed flicker during tab reordering, and bug in reordering first and last tabs.
* 12/30/13
  * Replaced static tab menus with dynamic menus, as per original intention
* 02/09/14
  * Numerous changes to facilitate subclassing
  * Reordered tab views to render front-to-back left to right rather than right to left (eg. tabScroller.subviews.lastObject is leftmost while tabScroller.subviews.firstObject is rightmost). This change in ordering allows subclasses to partially occlude tabs in a visually sensible way.

LICENSE & NOTES
---------------

LITabControl is licensed under the MIT license and hosted on GitHub at https://github.com/monyschuk/LITabControl/ Fork the project and feel free to send pull requests with your changes!

repository: mindersw/LITabControl

repo_name: mindersw/LITabControl


text:
LazyFile How To Guides
======================

How to lazily extract a file from a remote wheel
------------------------------------------------

The original motivation for this library was to extract the
metadata file from a wheel, without downloading the whole
wheel file (which could potentially be very large).

Wheel files are structured as zip files, and can be read using
the standard library `zipfile` module. The `ZipFile` constructor
takes a file-like object which must return bytes, and be seekable.
A LazyFile is ideal for this.

First, we need to implement methods to get the length of the file,
and to get a block of bytes from the file.

```python3
from urllib.request import Request, urlopen

# Get the file size with a HEAD request
def content_len(url):
    req = Request(url, method="HEAD")
    with urlopen(req) as f:
        return int(f.headers["Content-Length"])

# Get a block of bytes from the URL.
def get_url_range(url, lo, hi):
    # Adjust the range, as hi is "past the end"
    req = Request(url, headers={"Range": f"bytes={lo}-{hi-1}"})
    with urlopen(req) as f:
        data = f.read()
        if len(data) != hi-lo:
            raise ValueError(f"Failed to read {hi-lo} bytes")

    return data
```

With these helpers, we can open a URL lazily

```python3
from lazyfile import LazyFile
from functools import partial

def open_url(url):
    url_getter = partial(get_url_range, url)
    file_size = content_len(url)
    return LazyFile(file_size, url_getter)
```

And that's all we need to process the file as a zipfile and
extract the metadata

```python3
def extract_metadata(url)
    f = open_url(url)
    z = ZipFile(f)
    for name in z.namelist():
        if name.endswith(".dist-info/METADATA"):
            metadata = z.read(name)
            return metadata
```

repository: pfmoore/lazyfile

branch_name: refs/heads/main

repo_name: pfmoore/lazyfile


text:
---
layout: default
---

# 1994-09-02 - Re: Government and Repression

## Header Data

From: John Young<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: afb3bf4f8fef69d9b84f95c20ed4b50a8743a833c5588b7e067c7cb5a51e26cc

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-09-02 00:27:46 UTC

Raw Date: Thu, 1 Sep 94 17:27:46 PDT

## Raw message

```
{% raw  %}From: John Young<EMAIL_ADDRESS>Date: Thu, 1 Sep 94 17:27:46 PDT
To<EMAIL_ADDRESS>Subject: Re: Government and Repression
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Responding to msg by<EMAIL_ADDRESS>("Ian
Farquhar") on Fri, 2 Sep  8:32 AM

>Of course, you've got to question whether capital
>punishment is _ever_  justified, and I would argue that
>it isn't.  This is way, way off the topic  of
>cypherpunks, and I don't intend to get into that
>discussion on this  forum.  I am very glad to live in a
>country which has signed international  conventions
>which prohibit it indulging in brutal and callous
>judicial  murder of a person, despite the occasional
>state government loony who  pines for the good old
>days.

An enlightened view like this is never off topic where nuclear
weapons and molten spray in tank hulls are chatted up with
relish.  State-mandated homicide gotta have its dehumanized
professionals to do the dirty work.

And your suggestion of giving kids the vote at an earlier age
adds sane countervalence to the

     parent /
     teacher /
     caseworker /
     cop /
     prison guard /
     executioner

escape from responsibility algorithm.

John

{% endraw %}
```

## Thread

+ Return to [September 1994](/archive/1994/09)

+ Return to "[John Young <jya@pipeline.com>](/authors/john_young_jya_at_pipeline_com_)"

+ 1994-09-02 (Thu, 1 Sep 94 17:27:46 PDT) - Re: Government and Repression - _John Young<EMAIL_ADDRESS>


text:
---
title: "Past Year Review of positives & negatives"
created_at: 2018-12-27T21:38:14.000Z
published_at: 2018-12-28T15:20:46.000Z
---
Inspired by @flowen's [post](https://200wordsaday.com/words/a-year-review-in-30m-using-tim-ferris-s-pyr-12425c20dafccf590) about the Past Year Review (PYR) method by Tim Ferris, here's my attempt at it.

Some background on how to do PYR, extracted from [here](https://medium.com/@egomesneto/the-unconventional-way-tim-ferriss-approaches-new-years-resolutions-b780ee7a7a4f):

> It looks like the following and only takes 30–60 minutes:

>
> Grab a notepad and create two columns: POSITIVE and NEGATIVE.

>
> Go through your calendar from the last year, looking at every week.

>
> For each week, jot down on the pad any people and activities that triggered peak positive or negative emotions for that month.

>
> Once you’ve gone through the past year, look at your notepad list and ask “What 20% of each column produced the most reliable or powerful peaks?”

>
> Based on the answers, take your “positive” leaders and schedule more of them in 2018. Get them on the calendar now!  That’s step one.

>
> Step two is to take your “negative” leaders, put “NOT-TO-DO LIST” at the top, and put them somewhere you can see them each morning for the first few weeks of 2018. These are the people and things you know make you miserable, so don’t put them on your calendar out of obligation, guilt, FOMO, or other nonsense.

>
> That’s it! Let me know how it goes if you try it.

So here goes, in order of intensity, with the "top 20% leaders" marked:

### ✅  Positive

? Spending 1 month on personal solo retreat in Ubud, Bali

? Travelling with wife

? Taking parents and in-laws to Sapporo, Japan

? Taking treatment and surgery for a chronic medical condition, caring for the body and healing from it

? Learning about birth scripts and birth traumas (credits to wife for introducing it)

? Doing #1mvp1month, making/sharing 8 products, and learning from it

? Having something to look forward to and be inspired by, e.g. year-end Ubud trip, Kyoto trip and culture

Discovering a new city that I can come to love, in Yogyakarta, Indonesia

Eating my way through Penang, Malaysia

Witnessing the indie maker movement explode and learning from so many great makers

Connecting with people globally due to the products I made

Giving my first remote talk, and a first to a Japanese audience at Service Design Kansai

Learning something new - drone videography, pottery

Getting waterproof knit sneakers

### ❌ Negative

? Suffering chronic pain from my chronic medical condition

Hated all the renovation and construction work around my house (I didn't mark this because there's nothing much I can do about it, even though it's a leader)

? Being afraid to walk away from or saying no to toxic BS people, situations, work, content

? Veering off my usual design sprint model to offer customized consultancy packages - bad idea

? Taking on clients even when something was 'off'

Being afraid to say no to collaboration opportunities even when it's clear there's no alignment

Poor stress coping with junk food, coffee, fried food, sweets, ice cream

General overall feeling of ill-being

So to sum up, my positive leaders were travel, time with wife and parents, learning, making and inspiration. My negative leaders were poor health, toxicity, doing work that's misaligned and lacking control.

I realised this exercise is similar to my post about [my conditions for joy and happiness](https://200wordsaday.com/words/conditions-for-joy-and-happiness-4405c0c9f8fcd138), only that it also included a list of negatives, a not-to-do list, _my conditions for pain and suffering_. Very useful indeed to not just focus on what worked but also avoiding what didn't!

? Day 22 of the #200wad challenge.


text:
# Talos

Talos is an alternative authentication, authorization and accounting application. It provides a few improvements over original django.contrib.auth and django-guardian, but is not drop-in replacement though. Migrating to talos or starting a new application should be considered with care.

## Overview

Talos is still work-in-progress and is not generally recommended for production.

Talos provides data required for multipoint master-master application level replication (see AbstractReplicatableModel), but does not include any actual algorithms.

Talos tries to be culture-agnostic, thus Principal field has brief and full names, not first and last ones. It is recommended to create separate UserProfile model customized for actual project needs. For instance some projects may need to store not only given and family names, but also patronymics, matronymics or mononyms. Unlike django.contrib.auth Talos does not enforce any cultural favors.

Some of improvements include:
  * Per model and per object permissions.
  * Integration with django.contrib.admin.
  * Arbitrary privileges.
  * Registration by email address.
  * Various credential type support. Username+password, network address, OTP, client certificates to name a few. Various back-ends to validate these credentials. Separation into principals, identities and credentials.
  * Evidence requirements for role membership.
  * Management commands to manipulate principals, identities,and credentials.
  * List and force log off active sessions.
  * Role hierarchy with permission inheritance.

Authentication scenarios considered in Talos design:
  * User logs in providing username and password
    * Basic credentials are validated against internal database
    * Basic credentials are validated against external LDAP database
    * Basic credentials are validated against external Microsoft Active Directory database
  * User logs in providing username and password, but only from specific IP subnet
    * IPv4 and IPv6 are supported
  * User logs in providing username and password and one-time password
    * One-time password may be proprietary hardware token, Google Authenticator or Microsoft Authenticator
  * User logs in providing username and password and one-time password, but only from specific IP subnet
    * One-time password may be proprietary hardware token, Google Authenticator or Microsoft Authenticator
    * IPv4 and IPv6 are supported
  * Application logs in providing username and password
    * Basic credentials are validated against internal database
    * Basic credentials are validated against external LDAP database
    * Basic credentials are validated against external Microsoft Active Directory database
    * HTTP Authorization header is supported
  * Application logs in from specific IP subnet
    * No other credentials provided
    * IPv4 and IPv6 are supported
  * Application logs in providing access token
    * HTTP Authorization header is supported
  * Application logs in providing access token, but only from specific IP subnet
    * HTTP Authorization header is supported
    * IPv4 and IPv6 are supported

Privilege elevation (sudo, UAC, etc. alike) scenarios considered in Talos design:
  * User elevates privileges providing username and confirming password previously used for authentication
  * User elevates privileges providing username and confirming password previously used for authentication, but only from specific IP subnet
     * IPv4 and IPv6 are supported
  * User elevates privileges providing username and one-time password
    * One-time password may be proprietary hardware token, Google Authenticator or Microsoft Authenticator
  * User elevates privileges providing username, one-time password and confirming password previously used for authentication
    * One-time password may be proprietary hardware token, Google Authenticator or Microsoft Authenticator
  * User elevates privileges providing username, one-time password and confirming password previously used for authentication, but only from specific IP subnet
     * IPv4 and IPv6 are supported
    * One-time password may be proprietary hardware token, Google Authenticator or Microsoft Authenticator

## Quick start

### settings.py
  1. Add "talos" to your INSTALLED_APPS setting.

    INSTALLED_APPS = [
        ...
        'talos',
    ]

  2. Set user model to talos.Principal

    AUTH_USER_MODEL = 'talos.Principal'

  3. Replace AUTHENTICATION_BACKENDS with talos ones. These are used for django.contrib.admin or other applications dependent directly on django.contrib.auth

    AUTHENTICATION_BACKENDS = (
        'talos.compatibility.auth.AuthBackend',
    )

  4. Fix UserAttributeSimilarityValidator options to validate against talos.Principal fields

    AUTH_PASSWORD_VALIDATORS = [
        {
            'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
            'OPTIONS':
            {
                'user_attributes': ('brief_name', 'full_name', 'email', 'phone'),
            }
        },
        ...
    ]

  5. Disable django.contrib.auth migrations

    MIGRATION_MODULES = {
        'auth': None
    }

  6. Replace session middleware

    MIDDLEWARE = [
        'django.middleware.security.SecurityMiddleware',
        'talos.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',
        ...
    ]

### urls.py

  1. Add talos URLs to project urlpatterns

    urlpatterns = [
        path('admin/', admin.site.urls),
        path('auth/', include(auth_url_patterns)),
        ...
    ]

### models.py

  1. Specify model permissions in Meta class. Use single name, tuple of names, '__all__' as shortcut for ('select', 'create', 'update', 'delete', ), . Recommeded names are 'select', 'create', 'update', 'delete'. It is highly recommended to always include 'select' if any other permission is specified too. Default is '__all__'

    class Meta:
      model_permissions = '__all__'

  2. Specify object permissions in Meta class. Use single name, tuple of names, '__all__' as shortcut for ('select', 'create', 'update', 'delete', ), . Recommeded names are 'select', 'create', 'update', 'delete'. It is highly recommended to always include 'select' if any other permission is specified too. Default is None

    class Meta:
      object_permissions = '__all__'

  3. Specify related securables in Meta class. Use tuple of ForeignKey field names. To read an object one should have 'select' model or object permission on related object. Default is None

    class Meta:
      related_securables = ('fk_field_name', )

  4. Use for_principal method of model managers to select objects. First argument is talos.Principal instance, for example request.principal. Second argument is permission, 'select' if not specified.

### bash

  1. Create new principal

    ./manage.py create_principal --output-status --new-brief-name "Admin" --new-full-name "Administrator" --new-email<EMAIL_ADDRESS>--new-active

  2. Create new username for existing principal

    ./manage.py create_basic_identity --output-status --principal-email<EMAIL_ADDRESS>--new-username "administrator"

  3. Create new password for existing principal

    ./manage.py create_basic_credential --output-status --principal-email<EMAIL_ADDRESS>--new-password "p@$$w0rd"

  4. Add existing principal to existing role

    ./manage.py create_role_membership --output-status --principal-email<EMAIL_ADDRESS>--role-code "administrators"

## Architecture

  1. Evidence - any type of proof provided during authentication. Evidence can be of a few different kinds. It can be:
      * Knowledge factor - something a principal knows, for instance password.
      * Ownership factor - something a principal has, for instance OTP token or phone.
      * Inherence factor - something a principal is, for instance fingerprint or retina.
      * Location factor - somewhere a principal is, for instance IP address.
      * Trust factor - someone who knows a principal, for instance SSL certificate authority.
  2. Privilege - right to perform not model related actions. For example, login to admin panel.
  3. Model permission - right to mode of access on any instance of specific model. For example select, create, update or delete. Has priority above object permission.
  4. Object permission - right to mode of access on specific instance of specific model. For example select, create, update or delete.  Has priority below model permission.
  5. Role directory - collection of roles with the same required evidence.
      * Role directory may be internal, i.e. entire information is saved in local database, or external, i.e. information is saved externally and is accessed on demand. for example, LDAP directory may be used as external role directory.
      * Role directory may have options assigned. List of options defined depends on role directory type.
      * Role directory may have required evidences assigned. Principal will be considered member of role from directory, only if all required evidenced were provided during authentication.
  6. Role - Job function which defines an authority level.
     * Role may have model permission granted.
     * Role may have privileges granted.
     * Role may have a parent model, in which case role inherits model permissions and privileges granted to parent model. Role may revoke some of inherited model permissions and privileges. Revoking model permission or privilege which has not been granted is not an error.
  7. Pricipal - entity that can be authenticated. For instance person or service.
      * For compatibility reasons Principal implements some credential and identity related functions. This is limited, should not be used directly, is provided only for applications dependent on django.contrib.auth and supports only compatibility required subset of functionality.
      * Anonymous is a materialized principal. Thus permissions can be granted to anonymous.
  8. Identity directory - collection of identities of principals. For example, usernames.
      * In real world a principal may have multiple identities. For instance 'user', 'user@domain', 'domain\user'. All identities are condired of equal priority, there is no "primary" identity.
      * Identity directory may have link to credential directory, to limit identity usage scope.
  9. Identity - something that uniquely identified principal.
  10. Credential directory - collection of principal credentials.
  11. Credential - set of evidences a principal provides during authentication.
  12. Session - virtual connection between principal and server. Session provides security context for operations, either anonymous or authenticated. Session is restarted by authentication operation, either login or logout, which affects all subsequent operations.

repository: triflesoft/django-application-talos

repo_name: triflesoft/django-application-talos


text:
---
layout: default
---

# 1996-01-25 - Re: Crippled Notes export encryption

## Header Data

From: Rich Salz<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 17289daf11a4954a11d3ef68ee449b2b93439b7d8dde490bbfbb23191dfbe1d7

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-01-25 16:34:45 UTC

Raw Date: Fri, 26 Jan 1996 00:34:45 +0800

## Raw message

```
{% raw  %}From: Rich Salz<EMAIL_ADDRESS>Date: Fri, 26 Jan 1996 00:34:45 +0800
To<EMAIL_ADDRESS>Subject: Re: Crippled Notes export encryption
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

> Seriously, this just illustrates the idiocy of banning "hooks" in software.

Yes.  That's why an API that supported generic data transforms and
that included compression and for non-export encryption would be a useful
thing.  I have a start toward such an API definition that I will email to
anyone who might wanna finish it off.  I started doing it around the time
that Raph talked about his per-user crypto server.

> How does one define a "hook"?  Just providing source code could be defined
> as providing a hook, since a good programmer could then modify it to do
> crypto.  Also, how about the various kits and tools used to integrate pgp
> with pine, eudora, etc -- are these not "hooks"?

They define a hook.  They define it on a case-by-case basis.  "They" is
the Office of Defence Trade Controls, in conjunction with their consulting
experts primarily people in the department of Export Control at the NSA.
Luckily the ITAR talks about willful violations.
	/r$

{% endraw %}
```

## Thread

+ Return to [January 1996](/archive/1996/01)

+ Return to "[Rich Salz <rsalz@osf.org>](/authors/rich_salz_rsalz_at_osf_org_)"

+ 1996-01-25 (Fri, 26 Jan 1996 00:34:45 +0800) - Re: Crippled Notes export encryption - _Rich Salz<EMAIL_ADDRESS>


text:
---
layout: post
title: Naming Things is Hard: Finding the Right Level of Abstraction
excerpt: It is said and experience has confirmed - in programming, naming things is hard. So hard it's common for programmers with years and years (and years) of experience to regularly name things poorly. Here's some of the processes I use to name variables and types, focusing on finding the right level of abstraction.
tags: [Naming Patterns]
---

It is said and experience has confirmed - in programming,
[naming things is hard](https://martinfowler.com/bliki/TwoHardThings.html). So hard in fact that it's
common for programmers with years and years (and years) of experience to regularly name things poorly.

There's a number of nuances to giving something an appropriate name, but the one I'm going to talk about
here is _finding the right level of abstraction_. Here's some simple examples:

```csharp
var customerList = new List<Customer>();
var sqlServerConnection = GetDatabaseConnection();
```

In each of these cases, the variable name includes information about its type. Now, in a real program
the lines of code following these declarations will use the variables in one way or another - `customerList`
will have customers added to it, `sqlServerConnection` will be used to execute SQL queries, etc. In this
way we can think of each of these variables as providing a _service_ to the code which uses them - that
code will have a certain set of interactions with them and require a certain interface to do so; it's in
that interface - in the service provided by each variable to the code that consumes it - that the
appropriate level of abstraction is found.

To be more specific: the code that uses `customerList` probably just needs to be able to put a bunch of
`Customer` objects in a group - odds are the fact that the object fulfilling that need is a `List` is
irrelevant, therefore 'List' doesn't need to be in the name. Further, if we change `customerList` to be
a `Collection<Customer>`, the variable name is now not only exposing details about the underlying
implementation - it's lying about them. We could change it to `customerCollection` as part of the same
refactoring, or... we could just name the variable `customers`.

`sqlServerConnection` is similarly specific about the implementation the variable represents. Does it
matter to the code which consumes `sqlServerConnection` that it's using an SQL Server database as opposed
to a (_e.g._) MySQL database? The method which creates the database connection is the provider-agnostic
`GetDatabaseConnection`, so probably not. If not - and we've established in my made-up scenario that it
isn't - we can just name the variable `connection`.

To try and summarise this in a single, pithy statement: a name with the _right level of abstraction_
describes the role played in the code _without unnecessary detail_.

## A More Subtle, More Real-World Example

Let's say we've got an existing application which provides car insurance quotes, and we're going to be
extending it to include quotes for life insurance by integrating a
[WCF](https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx) service from the
globally-renowned Rainbow Unicorn Corporation. We can already imagine some of the objects involved in
this scenario:

- Something to represent an insurance quote
- Something to represent a provider of insurance quotes
- Something to represent a _service_ which provides insurance quotes
- Something to represent a customer on whom a quote is based
- Something containing the information Rainbow Unicorn need to provide a quote
- Something detailing Rainbow Unicorn's response to a quotation request

Let's name some of these objects.

At the heart of this setup is something which contains all the information common to insurance quotes we
obtain, irrespective of who provided them; I suggest we call this object `Quote`. Hang on though - our
application only deals with insurance quotes, so shouldn't it be '`InsuranceQuote`'? I'd say no, because
_as_ the application only deals with insurance quotes, the
[context](/naming-things-is-hard-namespace-interface-class-method-context) of its code is _already_ specific
to insurance - we don't need to [repeatedly](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) specify
that with our object naming.

Let's name the object which represents Rainbow Unicorn themselves. They are a provider specifically of life
insurance, so how about... `LifeInsuranceProvider`? Let's break that name down into its parts and justify
each of them; `Provider` - yep, happy with that, they provide things. `InsuranceProvider` - happy with that
too, but... doesn't that contradict the approach we took when we named `Quote`? Well, yes and no. The context
of the application is insurance - which makes it unnecessary to plaster the word 'insurance' everywhere -
but removing that word in this instance leaves us with `Provider`, which is a common term in programming;
for that reason I'd vote for using 'insurance' here to differentiate the object from one which provides
(_e.g._) validation / data storage / logging. Finally, do we need the word 'life'? That depends. Will the
object describe anything specific to life insurance providers? If so ok, we might want the 'life' prefix,
if not, no - `InsuranceProvider` will cover all the bases.

Onto the object we use to call Rainbow Unicorn's service - what shall we name that? Let's consider what we
know about it, and build the name from those details:

- It's a service - let's call it _Service_

- It provides quotes - let's call it _QuotationService_

- It's specific to life insurance - let's call it _LifeInsuranceQuotationService_

- It's provided by Rainbow Unicorn, and will therefore contain details specific to Rainbow Unicorn's needs -
  let's call it _RainbowUnicornLifeInsuranceQuotationService_

- It operates over WCF - that's an implementation detail, so let's not include that.

So `RainbowUnicornLifeInsuranceQuotationService` - quite a long name, isn't it? But I'd say the sum of
the parts provides just enough detail to encapsulate the service it provides, _and no more_.

Back to our application. To avoid unnecessary details of our new life insurance service bleeding into parts
of the application which don't need to know about them, we'll create an interface for
`RainbowUnicornLifeInsuranceQuotationService` to implement. What should we name it?

- It's a service which provides quotes - let's call it `IQuotationService`

- Our application already obtains car insurance quotes, so we'll need to differentiate our new service from
  any existing car insurance-specific interface - let's call it `ILifeInsuranceQuotationService`

- It's implemented by Rainbow Unicorn - that's an implementation detail, so let's not include that.

Giving us an `ILifeInsuranceQuotationService`, implemented by the `RainbowUnicornLifeInsuranceQuotationService`.
Both of these names contain enough and only the details which describe the role they play in the application.

## Summing Up

Naming things is tricky, but I think it's something which has rules which can be applied to obtain
objectively better or poorer results. I've gone through some of the processes I use to name variables
and types here - hopefully it's been useful :)


text:
---
title: "SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions"
description: ""
layout: "datatype"
tags:
    - "datatype"
    - "sldn"
    - "Virtual"
classes:
    - "SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions"
---

# SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions

 Datatype

## Description

                <input placeholder="Datatype Filter" onkeyup="titleSearch(inputId='prop-input', divId='properties', elementClass='prop-row')"
                    type="text" id="prop-input" value="" size="30" maxlength="128" class="form-text">

## Local

-----
[bootMode]: #bootmode
#### [bootMode]
The mode used to boot the [SoftLayer_Virtual_Guest]({{<ref "reference/datatypes/SoftLayer_Virtual_Guest">}}).  Supported values are 'PV' and 'HVM'.
Type: **string**

-----
[flavorKeyName]: #flavorkeyname
#### [flavorKeyName]
When set the startCpus and maxMemory are defined by the flavor. If the flavor includes local storage blockDevice 0 is also defined by the flavor. When startCpus, maxMemory, or blockDevice 0 are also provided on the template object they are validated against the flavor provided.
Type: **string**

-----
[immediateApprovalOnlyFlag]: #immediateapprovalonlyflag
#### [immediateApprovalOnlyFlag]
When explicitly set to true, createObject(s) will fail unless the order is started automatically. This can be used by automated systems to fail an order that might otherwise require manual approval. For multi-guest orders via [SoftLayer_Virtual_Guest::createObjects]({{<ref "reference/services/SoftLayer_Virtual_Guest/createObjects">}}), this value must be the exact same for every item.
Type: **boolean**

-----
[postInstallScriptUri]: #postinstallscripturi
#### [postInstallScriptUri]
URI of the script to be downloaded and executed after installation is complete. This can be different for each virtual guest when multiple are sent to [SoftLayer_Virtual_Guest::createObjects]({{<ref "reference/services/SoftLayer_Virtual_Guest/createObjects">}}).
Type: **string**

gha_license_id: NOASSERTION


text:
# Managing files in Python

## What are files, directories and paths?

These are simple thing that many computer users already know, but I'll go
through them just to make sure you know them also.

### Files

- Each file has a **name**, like `hello.py`, `mytext.txt` or
    `coolimage.png`. Usually the name ends with an **extension** that
    describes the content, like `py` for Python, `txt` for text or `png`
    for "portable network graphic".
- With just names identifying the files, it wouldn't be possible to have
    two files with the same name. That's why files also have a
    **location**. We'll talk more about this in a moment.
- Files have **content** that consists of
    [8-bit bytes](https://www.youtube.com/watch?v=Dnd28lQHquU).

### Directories/folders

Directories are a way to group files. They also have a name and a location
like files, but instead of containing data directly like files do they
contain other files and directories.

### Paths

Directories and files have a path, like `C:\Users\me\hello.py`. That just
means that there's a folder called `C:`, and inside it there's a folder
called `Users`, and inside it there's a folder called `me` and inside it
there's a `hello.py`. Like this:

```
C:
└── Users
    └── me
        └── hello.py
```

`C:\Users\me\hello.py` is an **absolute path**. But there are also
**relative paths**. For example, if we are in `C:\Users`, `me\hello.py`
is same as `C:\Users\me\hello.py`. The place we are in is sometimes
called **current directory**, **working directory** or
**current working directory**.

So far we've talked about Windows paths, but not all computers run
Windows. For example, an equivalent to `C:\Users\me\hello.py` is
`/home/me/hello.py` on my Ubuntu, and if I'm in `/home`, `me/hello.py`
is same as `/home/me/hello.py`.

```
/
└── home
    └── me
        └── hello.py
```

## Writing to a file

Let's create a file and write a hello world to it.

```python
>>> with open('hello.txt', 'w') as f:
...     print("Hello World!", file=f)
...
>>>
```

Doesn't seem like it did anything. But actually it created a `hello.txt`
somewhere on our system. On Windows it's probably in `C:\Users\YourName`,
and on most other systems it should be in `/home/yourname`. You can open
it with notepad or any other plain text editor your system comes with by
opening the folder that contains the file and then double-clicking the
file.

So how does that code work?

First of all, we open a path with `open`, and it gives us a Python file
object that is assigned to the variable `f`.

```python
>>> f
<_io.TextIOWrapper name='hello.txt' mode='w' encoding='UTF-8'>
>>>
```

File objects are not the same thing as paths and filenames, so if we try
to use `'hello.txt'` like we used `f` it doesn't work.

The first argument we passed to `open` was the path we wanted to write.
Our path was more like a filename than a path, so the file ended up in
the current working directory.

The second argument was `w`. It's short for write, and that just means
that we'll create a new file. There's some other modes we can use also:

| Mode  | Short for | Meaning                                                               |
|-------|-----------|-----------------------------------------------------------------------|
| `r`   | read      | Read from an existing file.                                           |
| `w`   | write     | Write to a file. **If the file exists, its old content is removed.**  |
| `a`   | append    | Write to the end of a file, and keep the old content.                 |

But what is that `with ourfile as f` crap? That's just a fancy way to make
sure that the file gets closed, no matter what happens. As we can see,
the file was indeed closed.

```python
>>> f.closed
True
>>>
```

When we had opened the file we could just print to it. The print is just
like any other print, but we also need to specify that we want to print
to the file we opened using `file=f`.

## Reading from files

After opening a file with the `r` mode we can for loop over it, just
like it was a list. So let's go ahead and read everything in the file
we created to a list of lines.

```python
>>> lines = []
>>> with open('hello.txt', 'r') as f:
...     for line in f:
...         lines.append(line)
...
>>> lines
['Hello World!\n']
>>>
```

Trying to open a non-existent file with `w` or `a` creates the file for
us, but doing that with `r` gives us an error instead. We'll learn more
about errors [later](exceptions.md).

```python
>>> with open('this-doesnt-exist.txt', 'r') as f:
...     print("It's working!")
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'this-doesnt-exist.txt'
>>>
```

So now we have the hello world in the `lines` variable, but it's
`['Hello World!\n']` instead of `['Hello World!']`. So what the heck is
that `\n` doing there?

`\n` means newline. Note that it needs to be a backslash, so `/n`
doesn't have any special meaning like `\n` has. When we wrote the file
with print it actually added a `\n` to the end of it. It's recommended
to end the content of files with a newline character, but it's not
necessary.

Let's see how that works if we have more than one line in the file.

```python
>>> with open('hello.txt', 'w') as f:
...     print("Hello one!", file=f)
...     print("Hello two!", file=f)
...     print("Hello three!", file=f)
...
>>> lines = []
>>> with open('hello.txt', 'r') as f:
...     for line in f:
...         lines.append(line)
...
>>> lines
['Hello one!\n', 'Hello two!\n', 'Hello three!\n']
>>>
```

There we go, each of our lines now ends with a `\n`. When we for
loop over the file it's divided into lines based on where the `\n`
characters are, not based on how we printed to it.

But how to get rid of that `\n`? [The rstrip string
method](https://docs.python.org/3/library/stdtypes.html#str.rstrip) is
great for this:

```python
>>> stripped = []
>>> for line in lines:
...     stripped.append(line.rstrip('\n'))
...
>>> stripped
['Hello one!', 'Hello two!', 'Hello three!']
>>>
```

It's also possible to read lines one by one. Files have [a readline
method](https://docs.python.org/3/library/io.html#io.TextIOBase.readline)
that reads the next line, and returns `''` if we're at the end of the file.

```python
>>> with open('hello.txt', 'r') as f:
...     first_line = f.readline()
...     second_line = f.readline()
...
>>> first_line
'Hello one!\n'
>>> second_line
'Hello two!\n'
```

There's only one confusing thing about reading files. If we try
to read the same file object twice we'll find out that it only gets read
once:

```python
>>> first = []
>>> second = []
>>> with open('hello.txt', 'r') as f:
...     for line in f:
...         first.append(line)
...     for line in f:
...         second.append(line)
...
>>> first
['Hello one!\n', 'Hello two!\n', 'Hello three!\n']
>>> second
[]
>>>
```

File objects remember their position. When we tried to read the
file again it was already at the end, and there was nothing left
to read. But if we open the file again, we get a new file object that
is in the beginning and everything works.

```python
>>> first = []
>>> second = []
>>> with open('hello.txt', 'r') as f:
...     for line in f:
...         first.append(line)
...
>>> with open('hello.txt', 'r') as f:
...     for line in f:
...         second.append(line)
...
>>> first
['Hello one!\n', 'Hello two!\n', 'Hello three!\n']
>>> second
['Hello one!\n', 'Hello two!\n', 'Hello three!\n']
>>>
```

Usually it's best to just read the file once, and use the
content we have read from it multiple times.

If we need all of the content as a string, we can use [the read
method](https://docs.python.org/3/library/io.html#io.TextIOBase.read).

```python
>>> with open('hello.txt', 'r') as f:
...     full_content = f.read()
...
>>> full_content
'Hello one!\nHello two!\nHello three!\n'
>>>
```

We can also open full paths, like `open('C:\\Users\\me\\myfile.txt', 'r')`.
The reason why we need to use `\\` when we really mean `\` is that
backslash has a special meaning. There are special characters like
`\n`, and `\\` means an actual backslash.

[comment]: # (GitHub's syntax highlighting screws up with backslashes.)

```
>>> print('C:\some\name')
C:\some
ame
>>> print('C:\\some\\name')
C:\some\name
>>>
```

Another way to create paths is to tell Python to escape them by
adding an `r` to the beginning of the string. In this case the `r`
is short for "raw", not "read".

```python
>>> r'C:\some\name'
'C:\\some\\name'
>>>
```

If our program is not meant to be ran on Windows and the paths
don't contain backslashes we don't need to double anything or use
`r` in front of paths.

```python
>>> print('/some/name')
/some/name
>>>
```

Doing things like `open('C:\\Users\\me\\myfile.txt', 'r')` is not
recommended because the code needs to be modified if someone wants to
run the program on a different computer that doesn't have a
`C:\Users\me` folder. Just use `open('myfile.txt', 'r')`.

## Examples

This program prints the contents of files:

```python
while True:
    filename = input("Filename or path, or nothing at all to exit: ")
    if filename == '':
        break

    with open(filename, 'r') as f:
        # We could read the whole file at once, but this is
        # faster if the file is very large.
        for line in f:
            print(line.rstrip('\n'))
```

This program stores the user's username and password in a file.
Plain text files are definitely not a good way to store usernames
and passwords, but this is just an example.

```python
# Ask repeatedly until the user answers 'y' or 'n'.
while True:
    answer = input("Have you been here before? (y/n) ")
    if answer == 'Y' or answer == 'y':
        been_here_before = True
        break
    elif answer == 'N' or answer == 'n':
        been_here_before = False
        break
    else:
        print("Enter 'y' or 'n'.")

if been_here_before:
    # Read username and password from a file.
    with open('userinfo.txt', 'r') as f:
        username = f.readline().rstrip('\n')
        password = f.readline().rstrip('\n')

    if input("Username: ") != username:
        print("Wrong username!")
    elif input("Password: ") != password:
        print("Wrong password!")
    else:
        print("Correct username and password, welcome!")

else:
    # Write username and password to a file.
    username = input("Username: ")
    password = input("Password: ")
    with open('userinfo.txt', 'w') as f:
        print(username, file=f)
        print(password, file=f)

    print("Done! Now run this program again and select 'y'.")
```

***

[Previous](what-is-true.md) | [Next](docstrings.md) |
[List of contents](../README.md#basics)

license: Zlib,Unlicense

repository: leriomaggio/python-tutorial

detected_licenses: Zlib Unlicense

gha_language: Python

repo_name: leriomaggio/python-tutorial


text:
---
layout: page
permalink: /about/
cover: about.jpg
---

About Us

Groundworks is a company that helps inspire, resource, and advance great Ideas. We support people in their process of personal growth, and create workspace for transformative initiatives to accelerate. We provide mentoring and coaching for individuals and
companies globally.

Ken Janke

Ken Janke is the founder of Groundworks. He works to position people, organizations, and businesses for their effective future, believing transformation is possible through collective ideas and collaborative action. He collaborates with mission-minded organizations and networks globally to create change in our world.

Our Work

At Groundworks, we have a history of supporting entrepreneurs by providing them with access to quality workspace, coaching and mentoring, a shared knowledge network, peer-to-peer training, and a collaborative ecology. Our collaborative workspaces, known as the Grove, have the potential to launch initiatives that will benefit communities and cities and will drive economic development.

At Groundworks, we have developed Story Lab to help individuals author the story they want to live as missional people. We work to help people discover how to create a vocation that is less about what they do, and more about who they are. Story Lab is a facilitated weekend event to help inspire mission as a lifestyle. We believe that a vocation should be about creating a life - not just about earning a living. Living with great intentionality creates vision. This workshop helps its participants begin to live their story and author their personal mission.