text:
---
id: 123
title: Virtual Environments
date: 2012-06-17T15:27:35+00:00
author: Simon Moreau
layout: post
guid: http://bim42.wordpress.com/?p=123
permalink: /2012/06/virtual-environments/
categories:
  - General BIM
  - Visualization
image: /assets/2012/06/unity-logo.jpg
tags:
  - Pretty Pictures
  - Unity3D
  - Visualization
---
Virtual environments are a trending topic among our clients these days. Owners don't want only pretty pictures of their future building anymore, but also videos, and lately, whole 3D environments.

They want to be able to walk through their future building and see everything just like the expected end user. This kind of easily accessible 3D model has endless applications: You can validate architectural and interior design choices, check the accessibility and the ergonomic of the building, present a show apartment on a web-based application accessible by anyone, and many more...

For the one who were fond of videos games in their youth, it’s pretty much like creating a level of an average first person shooter game. You create the geometry (in our case, an already existing aggregated design model), you add some textures to make it pretty and you run the whole thing in an engine for interactive 3D content, a professional name for a game engine.

I have tried two of these engines, with different results.

![studio_logo3]({{ "/assets/2012/06/studio_logo3.jpg" | absolute_url }})

3dVia Studio is the solution developped by Dassault System. It's really powerful, with a lot of features and possibilities, and can run _really_ large models. But on the other hand, its price reserves it for visualization professionals, and finding some support and examples on the web can be dreadful.

![unity-logo]({{ "/assets/2012/06/unity-logo.jpg" | absolute_url }})

The other solution is a broadly used game engine named Unity 3D. Its basic version is free, and you can pay for a professional version and specific features, like publication on portable devices (IOS and Android), or work in a collaborative environment.

After some trials with 3DVia Studio, we finally put all our effort to Unity. I will try to post one of my models, so in the meantime, you can have an really good example [here](http://www.tetravol.com/tetravol/clients/villamare/ "Villa Mare").


text:
# Introduction

The key to this exercise is to keep track of a list of numbers and their status of possibly being prime.

## General guidance

- Carefully consider which data structure to use
- Try to only allocate memory once for the data structure you use to keep track of the sieve

## Approach: `BitArray`

```csharp
public static IEnumerable<int> Primes(int max)
{
    if (max < 0)
        throw new ArgumentOutOfRangeException(nameof(max));

    var primes = new BitArray(max + 1, true);

    for (var i = 2; i <= max; i++)
    {
        if (!primes[i])
            continue;

        for (var j = i * 2; j <= max; j += i)
            primes[j] = false;

        yield return i;
    }
}
```

This approach uses a [`BitArray`][bit-array] to (efficiently) keep track of and skip the prime multiples.
For more information, check the [`BitArray` approach][approach-bit-array].

## Approach: `HashSet`

```csharp
public static IEnumerable<int> Primes(int max)
{
    if (max < 0)
        throw new ArgumentOutOfRangeException(nameof(max));

    var primeMultiples = new HashSet<int>();

    for (var i = 2; i <= max; i++)
    {
        if (primeMultiples.Contains(i))
            continue;

        for (var j = i * 2; j <= max; j += i)
            primeMultiples.Add(j);

        yield return i;
    }
}
```

This approach uses a [`HashSet<T>`][hash-set] to keep track of and skip the prime multiples.
For more information, check the [`HashSet<T>` approach][approach-hash-set].

## Which approach to use?

While the difference between the two approaches is minor, the `BitArray` approach has two things going for it:

1. It is a more natural way to encode the problem, as the sieve itself is described as using one list and crossing items off that list.
2. Its performance is better than that of the `HashSet<T>` for the majority of cases. For more details, check out the [Performance article][article-performance].

[approach-bit-array]: https://exercism.org/tracks/csharp/exercises/sieve/approaches/bit-array
[approach-hash-set]: https://exercism.org/tracks/csharp/exercises/sieve/approaches/hash-set
[article-performance]: https://exercism.org/tracks/csharp/exercises/sieve/articles/performance
[bit-array]: https://learn.microsoft.com/en-us/dotnet/api/system.collections.bitarray
[hash-set]: https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1

license: MIT

repository: exercism/csharp

branch_name: refs/heads/main

extension: md

gha_language: C#

gha_license_id: MIT

license_type: permissive

repo_name: exercism/csharp


text:
# bluespiderMod

This Mod will copy the content of a blueprint into the Spidertron logistics slot. The mod is currently in alpha phase. In case of issues or proposals for improvements/extra features, post them in the discussions.

How it works:
1. Place a blueprint in the Spidertron trunk. Currently only the first blueprint is picked-up ( still have to figure out if I can cycle throught the blueprints placed in the Trunk). The blueprints entities will be added to quantities already requested in the slots.
2. Issue following naming conventions:
   - The copy/addtion of the blueprint is only triggered if the blueprint's label starts with \_P\_
   - Include \_E\_ in the label in case you first want to clear the logistics slots
   - Include \_nx_\_ x is a multiplier to request x multiple of entities from the blueprint.
3. Apply the blueprint by moving the Spidertron using its remote control.
4. after treamtment the first underscore is removed to prevent further treatment.

repository: depoorterp/bluespiderMod

branch_name: refs/heads/master

repo_name: depoorterp/bluespiderMod


text:
# SIL.ReleaseTasks package

**SIL.ReleaseTasks** provides several release related tasks that can work with a
`CHANGELOG.md` file.

Tasks in the `SIL.ReleaseTasks` nuget package:

## CreateChangelogEntry task

Given a Changelog file, this task will add an entry to the debian changelog (`debian/changelog`).
The changelog can be a markdown file and can follow the
[Keep a Changelog](https://keepachangelog.com) conventions.

### Properties

- `ChangelogFile`: The name (and path) of the markdown-style changelog file (required)

- `VersionNumber`: The version number to put in the debian changelog (required)

- `PackageName`: The name of the product/package (required)

- `DebianChangelog`: The path and name of the debian changelog file (required)

- `Distribution`: The name of the distribution to put in the debian changelog entry. Defaults to
  `UNRELEASED`

- `Urgency`: The value to put in the urgency field in the debian changelog. Defaults to `low`

- `MaintainerInfo`: Name and e-mail of the maintainer. Defaults to
  `Anonymous<EMAIL_ADDRESS>
### Example

```xml
<UsingTask TaskName="CreateChangelogEntry" AssemblyFile="SIL.ReleaseTasks.dll" />

<Target Name="Test">
  <CreateChangelogEntry ChangelogFile="$(RootDir)/CHANGELOG.md" VersionNumber="3.0.1"
    PackageName="myfavoriteapp" DebianChangelog="$(RootDir)/debian/changelog"
    Distribution="stable" Urgency="high" MaintainerInfo="John Doe <john_doe@example.com>" />
</Target>
```

This uses the markdown file `CHANGELOG.md` and VersionNumber to generate a changelog entry
in the DebianChangeLog file giving the author credit to John Doe.

## CreateReleaseNotesHtml task

Given a markdown-style changelog file, this class will generate a release notes HTML file. The
changelog can be a markdown file and can follow the [Keep a Changelog](https://keepachangelog.com)
conventions.

If the HTML file already exists, the task will look for a section with `class="releasenotes"`
and replace it with the current release notes.

### Properties

- `ChangelogFile`: The name (and path) of the markdown-style changelog file (required)

- `HtmlFile`: The name (and path) of the output HTML file (required)

### Example

```xml
<UsingTask TaskName="CreateReleaseNotesHtml" AssemblyFile="SIL.ReleaseTasks.dll" />

<Target Name="Test">
  <CreateReleaseNotesHtml ChangelogFile="$(RootDir)/CHANGELOG.md"
    HtmlFile="$(OutputDir)/ReleaseNotes.html" />
</Target>
```

This generates a `ReleaseNotes.html` file by creating a new file or by replacing the
`<div class='releasenotes'>` in an existing .htm with a generated one.

## StampChangelogFileWithVersion task

Replaces the first line in a markdown-style Changelog/Release file with the version and date. The
changelog can be a markdown file and can follow the [Keep a Changelog](https://keepachangelog.com)
conventions.

This assumes that a temporary line is currently at the top: e.g.
`## DEV_VERSION_NUMBER: DEV_RELEASE_DATE`

### Properties

- `ChangelogFile`: The name (and path) of the markdown-style changelog file (required)

- `VersionNumber`: The version number to put in the changelog file (required)

- `DateTimeFormat`: The format string used to output the date. Default: `yyyy-MM-dd`

### Example

```xml
<UsingTask TaskName="StampChangelogFileWithVersion" AssemblyFile="SIL.ReleaseTasks.dll" />

<Target Name="Test">
  <StampChangelogFileWithVersion ChangelogFile="$(RootDir)/CHANGELOG.md"
    VersionNumber="1.0.3" DateTimeFormat="dd/MMM/yyyy" />
</Target>
```

This stamps the `CHANGELOG.md` file with the version numbers (replacing the first line with
`'## VERSION_NUMBER DATE'`).

## SetReleaseNotesProperty task

Sets a property to the changes mentioned in the topmost release in a `CHANGELOG.md` file.
This is a markdown file that follows the [Keep a Changelog](https://keepachangelog.com)
conventions.

### Properties

- `ChangelogFile`: The name (and path) of the markdown-style changelog file. Defaults to
  `../CHANGELOG.md`.

- `VersionRegex`: Regular expression to extract the version number from the subheadings in the
  changelog file. Default: `#+ \[([^]]+)\]`

- `AppendToReleaseNotesProperty`: Text that gets added to the end of the property

- `Value` (output parameter): The name of the property that will be set

- `FilterEntries`: Filters out entries that do not belong to a specific nuget package, when enabled.

### Example

```xml
<UsingTask TaskName="SetReleaseNotesProperty" AssemblyFile="SIL.ReleaseTasks.dll" />

<Target Name="Test">
  <PropertyGroup>
    <TextToAdd><![CDATA[
See full changelog at https://github.com/sillsdev/SIL.BuildTasks/blob/master/CHANGELOG.md]]>
    </TextToAdd>
    <FilterEntries>true</FilterEntries>
  </PropertyGroup>
  <SetReleaseNotesProperty ChangelogFile="$(RootDir)/CHANGELOG.md"
    AppendToReleaseNotesProperty="$(TextToAdd)">
    <Output TaskParameter="Value" PropertyName="ReleaseNotes" />
  </SetReleaseNotesProperty>
</Target>
```

### Automatically create release notes

By adding the `SIL.ReleaseTasks` nuget package to a project, the `PackageReleaseNotes`
property will be automatically set when creating a nuget package of the .csproj project.
This works with the new .csproj format that comes with VS 2017 and that defines the
nuget package in the .csproj file.

If you don't want to automatically set the `PackageReleaseNotes` property, you can set the
`IgnoreSetReleaseNotesProp` property to `true`.

By default the changelog file is expected in `../CHANGELOG.md`. The name and path can be
changed by setting the `ChangelogFile` property.

[Keep a Changelog](https://keepachangelog.com) doesn't make any recommendations in what form
versions should be put in the changelog. The default for the `SetReleaseNotesProperty` task
follows the example given on the [Keep a Changelog](https://keepachangelog.com) website, which
puts the version number in square brackets, e.g. `## [1.0.0] - 2017-06-20`. However, it's
possible to set the `VersionRegex` property to allow parsing different formats.

__NOTE:__ Due to [msbuild bug #3468](https://github.com/Microsoft/msbuild/issues/3468) the escape
character is @ instead of \\ (backslash)! To insert @ in the regular expression, double it: @@.


text:
---
layout: post
permalink: getting-started-dynamic-type
title: 'Getting Started With Accessibility: Dynamic Type'
tags: [swift, accessibility]
---

Dynamic Type lets you support different font sizes in your app, so that users
can use a font size that works best for them — from smaller than the system
default, to a whole bunch larger.

... and there's some smarts built into the system to support those cases where
you're limited on space and can't really show a larger font.

---

- [Getting Started With Accessibility: VoiceOver](/getting-started-voiceover)
- [Improving Accessibility: VoiceOver](/improving-voiceover)
- [Verifying VoiceOver: Accessibility Inspector](/verifying-voiceover)
- [Improving Accessibility: Voice Control](/improving-voice-control)
- Getting Started With Accessibility: Dynamic Type (this post)

## Introduction

The [typography documentation](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/typography/#dynamic-type-sizes)
in Apple's Human Interface Guidelines gives you a good idea of
the thought process behind typography as a whole, and Dynamic Type specifically,
with another page giving more [accessibility-specific information on how to deal with text](https://developer.apple.com/design/human-interface-guidelines/accessibility/overview/text-size-and-weight/).

The good news about Dynamic Type is that it _almost_ comes out of the box. The
bad news is the _almost_.

To make sure Dynamic Type is supported by your elements, verify that the
[`adjustsFontForContentSizeCategory`](https://developer.apple.com/documentation/uikit/uicontentsizecategoryadjusting/1771731-adjustsfontforcontentsizecategor)
property for your element is set to `true`:

```swift
let label = UILabel()
label.font = .preferredFont(forTextStyle: .body)
label.numberOfLines = 0
label.adjustsFontForContentSizeCategory = true
```

Make note of a few things:

- We use the `preferredFont(forTextStyle:)` API that provides a system font.
If you're using custom fonts, you'll have to make sure you are properly
supporting Dynamic Type using [`UIFontMetrics`](https://developer.apple.com/documentation/uikit/uifontmetrics).
- We set the label's `numberOfLines` property to zero. While this is not a
strict requirement, you can image that with a larger font, more number of lines
may be used to properly layout your text.
- Elements automatically adjust their content size when the preferred content
size changes.

## Testing and Making Improvements

With this setup for your elements, you'll be able to take a look at your app as
a whole with a different Dynamic Text size; either by changing the system-wide
text size (`Settings > Accessibility > Display & Text Size > Larger Text Size`),
or on a per-app basis (with iOS 15): `Settings > Accessibility > Per-App
Settings > Add App > Larger Text`.

You'll probably note certain places in your app where, because of either the
use of a much smaller (or much larger) font, certain layouts either break or
become a little awkward.

While it's challenging to keep all layouts optimal regardless of the user's
text size, one useful API is [`isAccessibilityCategory`](https://developer.apple.com/documentation/uikit/uicontentsizecategory/2897444-isaccessibilitycategory),
which allows you to query if an accessibility text size is being used. With
that information, you may consider switching your layout from something
horizontal to something vertical, giving you more space to gracefully handle
the larger text size.

<video width="750" controls alt="Switching between a horizontal to a vertical layout">
  <source src="/assets/blog-assets/layout.mp4" type="video/mp4">
</video>

### Large Content Viewer

Unfortunately, certain elements are built in such a way that they are not
expected to increase beyond a certain size. Examples are tab bar items,
segmented controls and things like overlays.

To solve this, Apple introduced the [Large Content Viewer](https://developer.apple.com/videos/play/wwdc2019/261/),
in, I think, iOS 11. In iOS 13, an API was introduced, too, enabling us to adopt
the large content viewer for custom controls. The Large Content Viewer is shown
based on the Dynamic Type settings: when using an accessibility text size,
elements that can't grow in size are expected to show it; the previously
mentioned tab bar items and segmented control work out of the box.

Note that at the time of writing this, Large Content Viewer is unfortunately not
supported in SwiftUI; you'll have to implement it for custom controls using
UIKit.

## Conclusion

Supporting Dynamic Type may seem to require only few changes, yet in reality
most apps won't come with a great experience for it just like that.

Luckily, there are APIs that let us customize our layouts based on text size,
allowing us to improve that experience for smaller and larger text sizes.

Let me know your thoughts on this post, and if you have any questions,
I'd love to help!

---

- [Getting Started With Accessibility: VoiceOver](/getting-started-voiceover)
- [Improving Accessibility: VoiceOver](/improving-voiceover)
- [Verifying VoiceOver: Accessibility Inspector](/verifying-voiceover)
- [Improving Accessibility: Voice Control](/improving-voice-control)
- Getting Started With Accessibility: Dynamic Type (this post)

gha_language: SCSS


text:
# App Service Sample

This is a sample configuration based on the tutorial at [Build a .NET Core and SQL Database web app in Azure Web Apps for Containers](https://docs.microsoft.com/azure/app-service/containers/tutorial-dotnetcore-sqldb-app).

## License

The code is licensed under the MIT [LICENSE](LICENSE.md).

## Contributing

This is an internal project and has an informal contribution setup.  Submit a pull request and we'll go from there.

## What's here

There are application source code files here for a .NET Core ToDo application.  There's also a Visio diagram of the solution.

## Deployment

### Prerequisites

The deployment includes code deployment to Azure from the local machine, which means you must have the [Git for Windows](https://git-scm.com/downloads) client installed.  You also need to have the [Azure CLI (2.0)](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) installed.

Note that for the sake of minimizing installation requirements, the Windows Command Prompt is used, which means that you can't deploy through the Cloud Shell at this time.

### Sign in and subscription selection

To log in with the CLI, use:

```batch
az login
```

To select a subscription by name or ID with the CLI, use:

```batch
az account set --subscription "Microsoft Azure Internal Consumption"
```

### How to deploy

The intended target is Ubuntu Linux VMs.  The folder has batch files for deploying using the Windows Command Prompt with custom parameters in `parameters.cmd`.  Make sure you change the parameters to match your expectations for the deployment.  **The deployment will fail if you won't change the `parameters.cmd` file to indicate you have customized the values.**

It's suggested to include your name, initials, or the like in the names that must be unique to help ensure that uniqueness.  Review the comments in the `parameters.cmd` file to understand what parameters must be unique.

Once the parameters are configured, run `deploy.cmd` to actually create the deployment.  As the deployment progresses, it will show you what stage it is at, as well as a timestamp after each completed step.  Many steps return output from the `az` CLI that show successful completion.  If any deployment command returns a failure status, the script will stop.  Deployments are generally incremental, so you should be able to resolve the issue and start where you left off; if necessary, you can always delete the resource group and start over.  The major exception is the two web apps, which are redployed from scratch each time to avoid Git issues.

### Deployment steps and typical timing

| Step | Timing |
| ---- | ---- |
| Creating resource group | seconds |
| Creating managed SQL Server instance | 2-4 min |
| Creating SQL firewall rule | seconds |
| Creating SQL database | under 1 min |
| Creating connection string | instant |
| Configuring GIT user for deployment | under 1 min |
| Creating app service plan | 1 min |
| Creating front end web app | 1 min |
| Creating back end web app | 1 min |
| Configuring front end connection string | under 1 min |
| Configuring back end connection string | under 1 min |
| Configuring front end app as "Production" | seconds |
| Configuring back end app as "Production" | seconds |
| Resetting local GIT configuration | under 1 min |
| Restoring local libraries and database configuration | seconds |
| Adding front end to local GIT configuration | instant |
| Adding back end to local GIT configuration | instant |
| Deploying code to front end | 4-6 min |
| Deploying code to back end | 4-6 min |
| Configuring front end web app logging | seconds |
| Configuring back end web app logging | seconds |
| Checking for existing Azure AD application for front end | under 1 min |
| Creating Azure AD application for front end | |
| Configuring Azure AD authentication for front end | |

### How to remove

Everything is deployed in a single resource group, so delete the resource group and you're almost done.  You also need to delete the application from Azure AD:

```bat
az ad app delete --id %FEAPPID%
```

This command assumes the script has run and populated the `FEAPPID` variable accordingly.  You can also just delete the app through the
Azure Portal.

## Known issues and future work

* The back end is not protected with Azure AD.  There is an issue with requiring admin consent which is not possible in some cases.  This makes the front-end authentication somewhat window dressing.

* The app does not use the authentication info.  It should show user information somewhere to prove the login is working.

* Instrumentation should be added to show those capabilities in Azure.


text:
Welcome to WalT integrated help.

# Admin documentation

For installation and upgrade procedures (server, network switches, nodes, VPN) and a general view of WalT network structure, checkout [`walt help show admin`](admin.md).

# User documentation

## Getting started

In order to get familiar with main WalT concepts, see [`walt help show tutorial`](tutorial.md).

## General concepts

### Node-related terminology

To understand why a given user owns a given node or not, and for related aspects of terminology, see [`walt help show node-terminology`](node-terminology.md).

### Working with nodes and images

WalT provides:
* direct access to nodes (using `walt node shell`, `walt node cp` for instance)
* access to the underlying operating system image (using `walt image shell`, `walt image cp`, etc.)

For details, see:
* [`walt help show shells`](shells.md)
* [`walt help show node-cp`](node-cp.md)
* [`walt help show image-cp`](image-cp.md)

### Log management

WalT provides a logging system to manage your experiment logs.
See [`walt help show logging`](logging.md) for more info.

## Advanced users

For specific needs, it is possible to build your own WalT image from scratch.
See [`walt help show image-from-scratch`](image-from-scratch.md) for more info.

And if you want to connect a new kind of node which WalT does not currently
supports, check-out [`walt help show new-node-support`](new-node-support.md).

## How it works

See [`walt help show node-bootup`](node-bootup.md) for detailed understanding
of walt core.

repository: ManonBillet/walt-python-packages

repo_name: ManonBillet/walt-python-packages


text:
Used for easily deploying files with sftp in ci environment. See example `.gitlab-ci.yml` file below.

Copies files using the following command, which means it will exclude hidden files or folders, delete files that are present on server and not in repo, and update the rest of the files if they have changed.

`mirror -X .* -X .*/ --reverse --verbose --delete $FROM_DIR $TO_DIR;`

```
image: idealpink/lftp-copy:1.1.0

# define variables SSH_KEY and SSH_KEY_PUB in gitlab ci
variables:
  SSH_PORT: 1234
  SSH_HOST: <IP_ADDRESS>
  SSH_USER: username

stages:
  - move-files
  - restart-service

move-files:
  stage: move-files
  only:
    - master
  script:
    - init_ssh
    - copy_files ./folder/in/repo/ location/on/server/

restart-service:
  image: docker:20.10.0
  stage: restart-service
  only:
    - master
  script:
    - <command to reload service / restart docker container etc>
```

repository: ankarhem/lftp-copy

repo_name: ankarhem/lftp-copy


text:
# Discover role python space exploration

# Description
Course by microsoft with the same name

# Write basic Python in Notebooks in Visual Studio Code

### Introduction
In this module, you'll learn about some basic concepts of the Python programming language, using NASA as context to apply them. Actual engineers working at NASA use these ideas everyday when working on projects.

### Learning objectives
In the units following, you'll learn many introductory computer science topics and apply them to real examples. Along the way, you'll learn:

- How and when to use comments
- How to use math in Python
- How to create variables
- How to use pre-made functions
- How to output data

#### Prerequisites
- Visual Studio Code installed
- Python installed
- Python extension installed

# Code control statements in Python

### Introduction

In this module, you'll learn about some intermediate concepts of the Python programming langauge and use NASA context to apply them.

### Learning objectives

In the units following, you'll learn many intermediate computer science topics nad apply them to real examples. Along the way, you'll learn:

- How to write conditionals and when to use them
- How to write while and for loops and when to use them
- How to make your own functions
- How to call your own functions
- How to use parameteres and global variables

### Prerequisites

- Visual Studio Code installed
- Python installed
- Python extension installed
- Basic knowledge of Python

# Count the number of Moon rocks by type using Python

### Introduction

You're a geologist working at NASA. You're responsible foranalyzing the different types of rocks foudn by the Artemis Rover and producing a report. The rover will send a text document of the different types of rocks, which you'll need to parse through. Your friend tells you ho the Python programming language can make the task much easier than doing it by hand, and more automated.

In this module, yu'll build a simple notebook with Python to complete the task. Along the way, you'll apply a variety of introuctory computer science topics. YOu'll use Visual Studio Code with the Python extension, to run the code and use pre-built functions that will help you complete this exercise.

### Learning objectives

In the unties following, you'll learn many computer science topics and use them to create an end-to-end solution. Along the way, you'll learn:

- How to write variables in the context of a program
- How to use prebuil functions to read data from a text file
- How to create a function and call it in the context of a program
- How to write conditionals and loops in the context of a program

### Prerequisites

- Visual studio Code installed
- Python extension installed in Visual Studio Code
- Python and Jupyter Notebooks installed
- Knowledge about introductory Python topics


text:
# WEEK 11: OS and concurrency

[![Week ZERO Video](https://img.youtube.com/vi/mJR2eD7vfKQ/0.jpg)](https://www.youtube.com/watch?v=mJR2eD7vfKQ)

Today, even “budget” laptops and mobile phone have multiple cores. Understanding concepts like Threads, Locks, Synchronization, etc. are beneficial whether you are building a mobile app or a web-scale service.

Just like System Design interview questions — Multi-Threading and Concurrency Interview questions are useful in gauging your level. A junior engineer will struggle with these questions (and are expected to learn more on the job). A relatively senior engineer is supposed to do better in such questions as they would be responsible for writing a lot of code that takes advantage of multiple cores/threads.

[Java Multithreading and Concurrency for Senior Engineering Interviews](https://www.educative.io/collection/5307417243942912/5707702298738688) is a good resource to check out for more guidance.

## Learning Objectives

1. Be able to define Concurrency, Threading, Parallelism
2. Be able to explain thread safety
3. Consider the "paralells" between threads on a CPU and large scale distributed systems (ha ha)

## Lesson plan

1. <https://youtu.be/3RvkfuXUv1c?t=323> why use a multi-processor system?
1. <https://www.youtube.com/watch?v=0KAGazeMZ2o> Simple multithreading
1. <https://www.youtube.com/watch?v=iKtvNJQoCNw> Lecture 1, unit 1: Introduction to Concurrency (12 minutes)
1. <https://www.youtube.com/watch?v=7ENFeb-J75k> Multithreading Code - Computerphile (15 min - advanced)
1. <https://www.youtube.com/watch?v=Tn0u-IIBmtc> Multitasking, Multithreading, Multiprocessing (10 min)
1. <https://www.youtube.com/watch?v=pWTtPnwialI> what is thread safety? (16 minutes)
1. <https://www.journaldev.com/1162/java-multithreading-concurrency-interview-questions-answers> threading interview questions
1. <https://dzone.com/articles/top-15-java-multithreading-concurrency-interview-q> more threading interview question samples
1. <https://www.youtube.com/watch?v=ajjOEltiZm4> distributed systerms explained
1. <https://www.youtube.com/watch?v=w9GP7MNbaRc> Distributed Systems Architecture InfoQ (41 minutes)
1. <https://www.youtube.com/watch?v=9kKQ8uLK8mk> Laws of programming with Concurrency (50 minutes - way too smart! :) )

## Resources

1. <https://www.youtube.com/channel/UCCb9_Kn8F_Opb3UCGm-lILQ> Microsoft Research youtube channel
2. <https://en.wikipedia.org/wiki/Flynn%27s_taxonomy> Flynn's taxonomy

repository: Greg-Pina/tech-interview-prep-course

repo_name: Greg-Pina/tech-interview-prep-course


text:
how to invoke this tool

## Building
1. Follow this article to generate new keys and upload to github: https://help.github.com/en/enterprise/2.16/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent
2. Run:
```
export DOCKER_BUILDKIT=1
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/id_rsa
ssh-add -l

docker build -t <repo>/python3.8-focal:latest -f ./Dockerfile  --ssh default .
```

## Running
`docker run -v (pwd):/repo  -it <repo>/python3-8-focal /bin/fish`

repository: micurley/docker-tools

repo_name: micurley/docker-tools


text:
# iFoto Function App

Azure Function App for iFoto demo service

## FotosQueueTrigger

Image resize, caption, adding search index, logging function app

## FotosHttpTrigger

Updating search index, deleting index (TO BE IMPLEMENTED)

# Setup & Run

1. Config enviroment variables

2. `func run .\FototosHttTrigger`

## Reference

* [Running Azure Functions Locally with the CLI and VS Code](https://blogs.msdn.microsoft.com/appserviceteam/2016/12/01/running-azure-functions-locally-with-the-cli/)

repository: iljoong/azure-sample-ifoto

repo_name: iljoong/azure-sample-ifoto


text:
# PHP-debug Manual for vs code.

### Windows
1. Install Xampp and copy PHP.info page.

2. Go to https://xdebug.org/wizard and paste the PHPinfo (of your local computer) content in the textarea.

3. Press the button analyze.

4. Download php_xdebug-2.7.2-7.3-vc15-x86_64.dll and copy it into xampp/php/ext

5. Add the following content to php.ini file
    ```js
    [XDebug]
    xdebug.mode = debug
    xdebug.start_with_request = yes
    xdebug.client_port = 9000
    zend_extension = "C:\xampp\php\ext\php_xdebug-2.7.2-7.3-vc15-x86_64 .dll"
    ```

6. Restart Apache service.

7. Add the following content to settings.json in vs code.

    ```js
    "php.validate.executablePath": "c:\\xampp\\php\\php.exe"
    ```

8. Install PHP debug extension. (Go to extensions tab in vs-code)

9. Add launch.json in vs code.

### Ubuntu (linux)
Add xdebug configuration in both /opt/lampp/etc/php.ini and /etc/php/{version}/cli/php.ini

## Additional Points
Add this to ignore vendor files in launch.json
```js
"ignore": [
    "**/vendor/**/*.php"
]
```


text:
# TLS Termination

HTTPProxy follows a similar pattern to Ingress for configuring TLS credentials.

You can secure a HTTPProxy by specifying a Secret that contains TLS private key and certificate information.
If multiple HTTPProxies utilize the same Secret, the certificate must include the necessary Subject Authority Name (SAN) for each fqdn.

Contour (via Envoy) requires that clients send the Server Name Indication (SNI) TLS extension so that requests can be routed to the correct virtual host.
Virtual hosts are strongly bound to SNI names.
This means that the Host header in HTTP requests must match the SNI name that was sent at the start of the TLS session.

Contour also follows a "secure first" approach.
When TLS is enabled for a virtual host, any request to the insecure port is redirected to the secure interface with a 301 redirect.
Specific routes can be configured to override this behavior and handle insecure requests by enabling the `spec.routes.permitInsecure` parameter on a Route.

The TLS secret must contain keys named tls.crt and tls.key that contain the certificate and private key to use for TLS, e.g.:

```yaml
# ingress-tls.secret.yaml
apiVersion: v1
data:
  tls.crt: base64 encoded cert
  tls.key: base64 encoded key
kind: Secret
metadata:
  name: testsecret
  namespace: default
type: kubernetes.io/tls
```

The HTTPProxy can be configured to use this secret using `tls.secretName` property:

```yaml
# httpproxy-tls.yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: tls-example
  namespace: default
spec:
  virtualhost:
    fqdn: foo2.bar.com
    tls:
      secretName: testsecret
  routes:
    - services:
        - name: s1
          port: 80
```

If the `tls.secretName` property contains a slash, eg. `somenamespace/somesecret` then, subject to TLS Certificate Delegation, the TLS certificate will be read from `somesecret` in `somenamespace`.
See TLS Certificate Delegation below for more information.

The TLS **Minimum Protocol Version** a virtual host should negotiate can be specified by setting the `spec.virtualhost.tls.minimumProtocolVersion`:

- 1.3
- 1.2  (Default)

## Fallback Certificate

Contour provides virtual host based routing, so that any TLS request is routed to the appropriate service based on both the server name requested by the TLS client and the HOST header in the HTTP request.

Since the HOST Header is encrypted during TLS handshake, it can’t be used for virtual host based routing unless the client sends HTTPS requests specifying hostname using the TLS server name, or the request is first decrypted using a default TLS certificate.

Some legacy TLS clients do not send the server name, so Envoy does not know how to select the right certificate. A fallback certificate is needed for these clients.

_**Note:**
The minimum TLS protocol version for any fallback request is defined by the `minimum TLS protocol version` set in the Contour configuration file.
Enabling the fallback certificate is not compatible with TLS client authentication._

### Fallback Certificate Configuration

First define the `namespace/name` in the [Contour configuration file][1] of a Kubernetes secret which will be used as the fallback certificate.
Any HTTPProxy which enables fallback certificate delegation must have the fallback certificate delegated to the namespace in which the HTTPProxy object resides.

To do that, configure `TLSCertificateDelegation` to delegate the fallback certificate to specific or all namespaces (e.g. `*`) which should be allowed to enable the fallback certificate.
Finally, for each root HTTPProxy, set the `Spec.TLS.enableFallbackCertificate` parameter to allow that HTTPProxy to opt-in to the fallback certificate routing.

```yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: fallback-tls-example
  namespace: defaultub
spec:
  virtualhost:
    fqdn: fallback.bar.com
    tls:
      secretName: testsecret
      enableFallbackCertificate: true
  routes:
    - services:
        - name: s1
          port: 80
---
apiVersion: projectcontour.io/v1
kind: TLSCertificateDelegation
metadata:
  name: fallback-delegation
  namespace: www-admin
spec:
  delegations:
    - secretName: fallback-secret-name
      targetNamespaces:
      - "*"
```

## Permitting Insecure Requests

A HTTPProxy can be configured to permit insecure requests to specific Routes.
In this example, any request to `foo2.bar.com/blog` will not receive a 301 redirect to HTTPS, but the `/` route will:

```yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: tls-example-insecure
  namespace: default
spec:
  virtualhost:
    fqdn: foo2.bar.com
    tls:
      secretName: testsecret
  routes:
    - services:
        - name: s1
          port: 80
    - conditions:
      - prefix: /blog
      permitInsecure: true
      services:
        - name: s2
          port: 80
```

## Client Certificate Validation

It is possible to protect the backend service from unauthorized external clients by requiring the client to present a valid TLS certificate.
Envoy will validate the client certificate by verifying that it is not expired and that a chain of trust can be established to the configured trusted root CA certificate.
Only those requests with a valid client certificate will be accepted and forwarded to the backend service.

```yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: with-client-auth
spec:
  virtualhost:
    fqdn: www.example.com
    tls:
      secretName: secret
      clientValidation:
        caSecret: client-root-ca
  routes:
    - services:
        - name: s1
          port: 80
```

The preceding example enables validation by setting the optional `clientValidation` attribute.
Its mandatory attribute `caSecret` contains a name of an existing Kubernetes Secret that must be of type "Opaque" and have a data key named `ca.crt`.
The data value of the key `ca.crt` must be a PEM-encoded certificate bundle and it must contain all the trusted CA certificates that are to be used for validating the client certificate.

## TLS Session Proxying

HTTPProxy supports proxying of TLS encapsulated TCP sessions.

_Note_: The TCP session must be encrypted with TLS.
This is necessary so that Envoy can use SNI to route the incoming request to the correct service.

If `spec.virtualhost.tls.secretName` is present then that secret will be used to decrypt the TCP traffic at the edge.

```yaml
# httpproxy-tls-termination.yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: example
  namespace: default
spec:
  virtualhost:
    fqdn: tcp.example.com
    tls:
      secretName: secret
  tcpproxy:
    services:
    - name: tcpservice
      port: 8080
    - name: otherservice
      port: 9999
      weight: 20
```

The `spec.tcpproxy` key indicates that this _root_ HTTPProxy will forward the de-encrypted TCP traffic to the backend service.

### TLS Session Passthrough

If you wish to handle the TLS handshake at the backend service set `spec.virtualhost.tls.passthrough: true` indicates that once SNI demuxing is performed, the encrypted connection will be forwarded to the backend service.
The backend service is expected to have a key which matches the SNI header received at the edge, and be capable of completing the TLS handshake. This is called SSL/TLS Passthrough.

```yaml
# httpproxy-tls-passthrough.yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: example
  namespace: default
spec:
  virtualhost:
    fqdn: tcp.example.com
    tls:
      passthrough: true
  tcpproxy:
    services:
    - name: tcpservice
      port: 8080
    - name: otherservice
      port: 9999
      weight: 20
```

[1]: ../configuration#fallback-certificate

repository: projectcontour/contour

gha_language: Go

repo_name: projectcontour/contour


text:
---
layout: default
---

# 1994-03-19 - Administrivia: Questions about the List

## Header Data

From<EMAIL_ADDRESS>(Timothy C. May)

To<EMAIL_ADDRESS>Message Hash: b39f38202c040683228eec013881bd0aa38527244e934a420eb1685e0c6fedb8

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-03-19 07:31:53 UTC

Raw Date: Fri, 18 Mar 94 23:31:53 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Timothy C. May)
Date: Fri, 18 Mar 94 23:31:53 PST
To<EMAIL_ADDRESS>Subject: Administrivia: Questions about the List
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Cypherdenizens,

Sorry to bother the List, but two things have come up that I need some
feedback on. Two items:

1. Is the list sending out messages in a defective (slow) way, or is
my service (Netcom) bouncing a lot of mail, thus causing these delays
as toad attempts resends?

2. I'm getting a lot of error messages from Julf's site, saying my
messages cannot be delivered to "an2757938" and the like. This used to
be a problem, but was fixed by Eric Hughes a year or so ago. It
appears to be back again. Are others seeing this, too?

First, I seem to be having delays in Cypherpunks mail of about
1-2 days on about 5-10% of all messages. This shows up as me not
seeing messages others are already responding to (because 90-95% of
all messages are getting to me in the usual prompt way). I especially
notice this, of course, with my own messages. (I can't test whether
other mail is being delayed, because I'm no longer on Extropians and
so Cypherpunks accounts for 95% of all my mail.)

For example, the item on video surveillance cameras, forwarded from
alt.conspiracy, did not not reach me until a day after others had
already posted public responses. And just today I got a 5-day old
message (Steve Bellovin's "Re: Clipper Cracks Appear"). The message I
posted today about "Shout it to the world: Clipper is Compromised!"
has still not appeared at my site, although some others have already
responded to me about it (ironically, Steve Bellovin did).

My question is this: Is this just _me_ (and possibly Netcom), or are
others seeing these delays? My suspicion has been that Netcom is
bouncing mail, because of recent overloading and NFS problems, reports
from other about their mail being delayed (usually this implies a
bounce and resend), and from the lack of other messages here
complaining about delayed messages.

Could Hugh Daniel, if he is reading this, or Eric Hughes, or anyone
else who has access to the list at toad.com give me some hint as to
whether I should beat on Netcom some more?

Could other Netcommers here, of which there may be as many as 50, tell
me what experiences they've had?

The second item is also an administrivia issue: I'm getting dozens of
error messages from<EMAIL_ADDRESS>or somesuch (I can't
look right now at the precise address) telling me my mail cannot be
delivered, will not be delivered, is being returned, etc. It looks
like the old blocks Eric had installed to prevent Julf's system from
doing this are no longer working. (There may be more accurate
explanations....)

Anyone else seeing this? Anything we can do? Does the new automated
subscription software (majordomo?) have anything to do with this?

If people send me comments, I'll summarize--unless someone really
knows the Big Picture and wants to just summarize it all here.

Thanks,

--Tim May

--
..........................................................................
Timothy C. May         | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>     | anonymous networks, digital pseudonyms, zero
408-688-5409           | knowledge, reputations, information markets,
W.A.S.T.E.: Aptos, CA  | black markets, collapse of governments.
Higher Power: 2^859433 | Public Key: PGP and MailSafe available.
"National borders are just speed bumps on the information superhighway."

{% endraw %}
```

## Thread

+ Return to [March 1994](/archive/1994/03)

+ Return to<EMAIL_ADDRESS>(Eric Hughes)](/authors/hughes_at_ah_com_eric_hughes_)"
+ Return to "[Matthew J Ghio <mg5n+@andrew.cmu.edu>](/authors/matthew_j_ghio_mg5n_at_andrew_cmu_edu_)"
+ Return to "["Robert A. Hayden" <hayden@krypton.mankato.msus.edu>](/authors/robert_a_hayden_hayden_at_krypton_mankato_msus_edu_)"
+ Return to "[Sameer <sameer@soda.berkeley.edu>](/authors/sameer_sameer_at_soda_berkeley_edu_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_netcom_com_timothy_c_may_)"

+ 1994-03-19 (Fri, 18 Mar 94 23:31:53 PST) - Administrivia: Questions about the List -<EMAIL_ADDRESS>(Timothy C. May)_
  + 1994-03-19 (Sat, 19 Mar 94 02:00:16 PST) - [Re: Administrivia: Questions about the List](/archive/1994/03/a5db0b71104c2ea1f838103bd2c59c58c5663f99a4d87abf2f4bde3bcbde7913) - _Sameer<EMAIL_ADDRESS>    + 1994-03-21 (Sun, 20 Mar 94 21:44:14 PST) - [Re: Administrivia: Questions about the List](/archive/1994/03/2942b200b633e636dd48da347e273a8498b170b3cb947602ba39b8281917888e) - _"Robert A. Hayden"<EMAIL_ADDRESS>  + 1994-03-19 (Sat, 19 Mar 94 10:23:50 PST) - [Re: Administrivia: Questions about the List](/archive/1994/03/b5afded0938b4e8dc88fce833ef4bc157c2e2e8c21253b3ee07390ce95633364) - _Matthew J Ghio<EMAIL_ADDRESS>  + 1994-03-22 (Mon, 21 Mar 94 18:17:01 PST) - [Administrivia: Questions about the List](/archive/1994/03/65c84fcf54e267f1b43d7c2dc1301d6e7f91bb72e43e5a4f5bdb8a70888daff2) -<EMAIL_ADDRESS>(Eric Hughes)_


text:
---
layout: post
title: Obfuscation using nuget
image: img/obfuscation-using-nuget/obfuscation-banner.png
author: Dushyant
date: 2020-06-04T19:00:00.000Z
tags: ["NuGet", "All"]
draft: false
---
# Obfuscation
We are in the golden age of open source software and yet at least I (surely many others too) work at places where safeguarding intellectual property (IP) in software is of paramount importance. One of the main techniques used to safeguard IP is by [obfuscating the code](https://en.wikipedia.org/wiki/Obfuscation_(software)) we ship. We can achieve this by a simple nuget as well. Let's dig into the details in this post.

# Nuget
This post mainly aims at .net framework project, msbuild and nuget.

## .Net framework
You may think why are we still talking about .net framework when [.NET Core is the Future of .NET](https://devblogs.microsoft.com/dotnet/net-core-is-the-future-of-net/) & [.NET 5 is round the corner](https://devblogs.microsoft.com/dotnet/introducing-net-5/). We are getting cool features with the latest developments in the dotnet world, but again from experience, we know that migration and adoption of the newer technologies will take some time, I mean years. Until then we will have a codebase of only .net framework or a mix of .net framework and dotnet core/standard etc.

[![sdk-style-templates](./img/obfuscation-using-nuget/sdk-style-templates.png)](https://marketplace.visualstudio.com/items?itemName=rubberduckdev.SDKStyleTemplatesNet)

Having said so, the sdk style csproj is very useful, feel free to check [my earlier blog post](https://www.rubberduckdev.com/sdkstyle-framework-csproj/) regarding that. But as of now, we do not have an sdk style csproj template shipped in Visual Studio for .net framework projects. I use the [simple visual studio extension](https://marketplace.visualstudio.com/items?itemName=rubberduckdev.SDKStyleTemplatesNet) above, which is open source and any comments/suggestions are welcome on that.

## NuGet techniques
Before we jump into the obfuscation nuget development, let me show a few useful tips with nuget, which we will use.

## GeneratePackageOnBuild
In sdk style csproj, we can add `<GeneratePackageOnBuild>true</GeneratePackageOnBuild>` which can automatically generate the nupkg file for us upon build. This makes it much easier, especially if you come from the times when we had to use nuspec files. Now all references, nuget properties etc can all stay in the csproj. Refer [Automatically generate package on build](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#automatically-generate-package-on-build) for documentation.

## NuGet package folder structure
Microsoft has a [convention-based directory structure](https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package#from-a-convention-based-working-directory) for the nupkg file. A nupkg file is essentially a zip file and the different folders mean something specific. For example, the one we are going to use the `build` folder that can have targets and props file which will be triggered during the build of the project that references our nupkg. *Note* that the props or targets file name in the build folder has to be the same as the package id.

## MSBuild props and targets in nupkg
This is what we discussed a bit in the previous point. Any props files in the build folder are imported at the top of the consuming project and any targets are imported at the end of the csproj. The convention is that they have to be named after the package id, else they will be ignored.

## IncludeBuildOutput
Another important property which we can include in sdk style csproj is `<IncludeBuildOutput>false</IncludeBuildOutput>`. This is so that if say the objective of the nupkg is just to ship a targets file (which is what we will do in a bit), it doesn't need to include any build output. *Note* that without this property, by default class library projects will include an empty dll in the nupkg.

## Demo plan
As presented, in the architecture diagram below, we will have a .net framework project that generates a nupkg. This package is referenced by a second .net framework project. When the second project builds, it automatically triggers the obfuscation of the generated dll.

![architecture](./img/obfuscation-using-nuget/architecture.png)

## Code
The full code is on [github](https://github.com/realrubberduckdev/NuGetAndMSBuild) and I will run through the csproj file here which generates the nuget package to help obfuscate the output dll of the referencing project.

### RDD.Obfuscation.AfterBuild.csproj
```
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <PackageId>RDD.Obfuscation.AfterBuild</PackageId>
    <IncludeBuildOutput>false</IncludeBuildOutput>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="ConfuserEx.Final" Version="1.0.0" />
  </ItemGroup>
  <ItemGroup>
    <None Include="RDD.Obfuscation.AfterBuild.targets" Pack="True" PackagePath="build" />
  </ItemGroup>
</Project>
```
The RDD.Obfuscation.AfterBuild.csproj produces the obfuscation helper nuget package. The nupkg is a simple nuget package with a targets file shown below.
```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>

    <!-- ConfuserToolsPath -->
    <ConfuserToolsPath>$(MSBuildThisFileDirectory)..\..\..\ConfuserEx.Final\1.0.0\tools</ConfuserToolsPath>
    <ConfuserExePath>$(ConfuserToolsPath)\Confuser.CLI.exe</ConfuserExePath>

    <!-- Confuser command -->
    <ConfuserCommand Condition=" '$(OS)' == 'Windows_NT'">"$(ConfuserExePath)"</ConfuserCommand>

    <!-- ProjectFileName -->
    <ProjectFileName>$(ProjectDir)Confuser.crproj</ProjectFileName>

    <!-- Commands -->
    <ConfuseCommand>$(ConfuserCommand) "$(ProjectFileName)"</ConfuseCommand>
  </PropertyGroup>

  <Target Name="Confuser" AfterTargets="AfterBuild">
    <Exec WorkingDirectory="$(ProjectDir)" Command="$(ConfuseCommand)" />
  </Target>
</Project>
```

The targets file locates `Confuser.CLI.exe` at nuget packages location and the needed `Confuser.crproj` at the consuming project's root. Then it triggers obfuscation after target `AfterBuild` has finished. Thus ensuring the generated dll gets obfuscated.

# MSBuild & dotnet build
To generate the nuget, we can simply run `msbuild RDD.Obfuscation.AfterBuild.csproj` and it will give us `RDD.Obfuscation.AfterBuild.1.0.0.nupkg`. We could also pass in parameters such as verion `msbuild RDD.Obfuscation.AfterBuild.csproj /P:Version=2.0.0`.

Can we do these using dotnet? Yes, we can. Let me demonstrate the relation between msbuild and dotnet by showcasing how nuget restore is implemented.

![using-nuget](./img/obfuscation-using-nuget/using-nuget.png)

In 2016, [dotnet restore used nuget restore](https://github.com/dotnet/cli/blob/6cde21225e18fc48eeab3f4345ece3e6bb122e53/src/dotnet/commands/dotnet-restore/Program.cs#L36
) under the hood.

![using-msbuild](./img/obfuscation-using-nuget/using-msbuild.png)

In 2019, this has [changed to using msbuild restore](https://github.com/dotnet/sdk/blob/master/src/Cli/dotnet/commands/dotnet-restore/Program.cs#L41
).

So, in essence, we are using msbuild under dotnet. But to do msbuild bits, as far as I know, we need to use [dotnet msbuild command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-msbuild). Which can be an inconvenience if you have mixed (framework and dotnet) codebase.

# Recommendations
Here are a few recommendations if you are using dotnet, msbuild, nuget etc in your development environment.

- Migrate to sdk style csproj
- Use MSBuild if the codebase is .Net Framework or mix of core/standard and framework, else use dotnet.
- Migrate to core/standard where possible
- Avoid using multiple tools, msbuild, dotnet and nuget. Very likely you can use just one of those.

# Talk video
I presented a talk on this topic at [.Net Oxford](https://www.dotnetoxford.com/posts/2020-05-lightning-talks). Thanks to [Dan Clarke](https://twitter.com/dracan), the video of the talk is now published on youtube.

`video: https://youtu.be/Bo2kuGnOfKs`

# Conclusion
In conclusion, nuget, msbuild, dotnet together give us a powerful combination of tools to make obfuscation or any other similar operations faster, easier & reusable. Any common shared tool, utility, libraries etc can be easily shared using nuget and I would highly recommend we did so instead of direct assembly/project references. And if you have something amazing to share, definitely publish it to nuget.org and share with all.

repository: realrubberduckdev/dp-blog

gha_language: TypeScript

repo_name: realrubberduckdev/dp-blog


text:
# Lazerbox readme

Lazerbox is a script for  Autodesk Fusion 360 that generates a sketch of a notched 'fingerjoint' box that is suitable for laser cutting.

Lazerbox builds on the [Boxmaker](https://github.com/lukecyca/BoxMaker)  but does not generate the object and uses the notch style of [Makercase](http://www.makercase.com/)

## Installation

To install Lazerbox into Fusion 360 follow the [instructions](https://knowledge.autodesk.com/support/fusion-360/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-install-an-ADD-IN-and-Script-in-Fusion-360.html)

lazerbox is a script, so make sure to install into the correct location for a script

Once installed Lazerbox can be accessed from ADD-INS > Scripts and Add-Ins . It should appear in the My Scripts section

## Running

Enter the dimensions of the box that you require.  These are the outside dimensions
Enter the material thickness that you will be using.
Enter the width of the notches that you want to create.

The notch width  should be no smaller than the thickness of the material and no larger than 20% of the smallest of the three dimensions (Width,Height, Depth)

Optionally select an existing component to generate the sketch onto.

Hit ok and a sketch will be created.

repository: weirdworkshop/Lazerbox

repo_name: weirdworkshop/Lazerbox


text:
---
layout: post
title: Damn Vulnerable DeFi - Unstoppable
---

## Description
There's a lending pool with a million DVT tokens in balance, offering flash loans for free.

If only there was a way to attack and stop the pool from offering flash loans ...

You start with 100 DVT tokens in balance.

## Solution
One exploit strategy is to see which invariants a contract enforces and then
try to break those invariants.

The key error in _UnstoppableLender_ is this assertion

```
// Ensured by the protocol via the `depositTokens` function
assert(poolBalance == balanceBefore);
```

As we'll see, this equality is not an invariant after all...

The assertion would hold if `depositTokens` was the **only** way to transfer tokens to the contract,
but it's not. We can simply transfer tokens directly from the attacker to the contract and with the
ERC20 `transfer` function and bypass `depositTokens` altogether. This causes `balanceBefore` to be greater
than `poolBalance`, breaking the assertion for all future calls to `flashLoan`.

This exploit doesn't require a contract. We can do it direclty in Javascript
```
it('Exploit', async function () {
    /** CODE YOUR EXPLOIT HERE */
    // Directly transfer DamnValuableToken to the Lender and bypass depositTokens
    // This will break the poolBalance == balanceBefore assertion
    await this.token.connect(attacker).transfer(this.pool.address, INITIAL_ATTACKER_TOKEN_BALANCE)
});
```

## Patched Contract
`poolBalance` is a redundant variable. To patch this contract
we remove `poolBalance` and track the balance with ERC20 `balanceOf` instead.

```
contract UnstoppableLenderV2 is ReentrancyGuard {

    IERC20 public immutable damnValuableToken;

    constructor(address tokenAddress) {
        require(tokenAddress != address(0), "Token address cannot be zero");
        damnValuableToken = IERC20(tokenAddress);
    }

    function depositTokens(uint256 amount) external nonReentrant {
        require(amount > 0, "Must deposit at least one token");
        // Transfer token from sender. Sender must have first approved them.
        damnValuableToken.transferFrom(msg.sender, address(this), amount);
    }

    function flashLoan(uint256 borrowAmount) external nonReentrant {
        require(borrowAmount > 0, "Must borrow at least one token");

        uint256 balanceBefore = damnValuableToken.balanceOf(address(this));
        require(balanceBefore >= borrowAmount, "Not enough tokens in pool");

        damnValuableToken.transfer(msg.sender, borrowAmount);

        IReceiver(msg.sender).receiveTokens(address(damnValuableToken), borrowAmount);

        uint256 balanceAfter = damnValuableToken.balanceOf(address(this));
        require(balanceAfter >= balanceBefore, "Flash loan hasn't been paid back");
    }
}
```

You can verify yourself that the exploit no longer works with `UnstoppableLenderV2`!


text:
[![Build status](https://ci.appveyor.com/api/projects/status/pvv1qvafomvmen9e/branch/master?svg=true)](https://ci.appveyor.com/project/davidobrien1985/githubconnect/branch/master)

This module implements PowerShell cmdlets using the Github public API and abstracts direct API calls to the user.

Cmdlets currently available:

  - Connect-Github
  - Get-GithubBranch
  - Get-GithubOrgRepository
  - Get-GithubOwnRepositories
  - Get-GithubPublicRepositories
  - Get-GithubWebhook
  - List-GithubBranches
  - New-GithubRepository
  - New-GithubWebhook
  - Remove-GithubRepository

gha_language: PowerShell


text:
# basic-auth

[demployment](https://emran-basic-auth.herokuapp.com/)

[Pull Request](https://github.com/emranaloul/basic-auth/pull/1)

[Actions](https://github.com/emranaloul/basic-auth/actions)

[Repo](https://github.com/emranaloul/basic-auth)

## About
A REST Express API, has various endpoints that using to sigup or sign in by username and password

## Author
Emran Aloul

## Links

* [Pull Request](https://github.com/emranaloul/basic-auth/pull/1)
* [demployment](https://emran-basic-auth.herokuapp.com/)
* [Actions](https://github.com/emranaloul/basic-auth/actions)
* [Repo](https://github.com/emranaloul/basic-auth)

## Setup
1. `(.env)` file

```
PORT=6000
MANGOOSE_URI=mongodb+srv://emran:Ltuc<EMAIL_ADDRESS>MONGOOSE_TEST_URI=mongodb+srv://emran:Ltuc<EMAIL_ADDRESS>
```
2. Install the following dependencies

```
npm init -y
npm i cors dotenv express morgan mongoose
npm i -D jest supertest
npm i @code-fellows/supergoose
mongod --dbpath=/Users/path/to/data/db

```
## Running the app
1. clone the repo.
2. Enter the command `npm start`
3. Use endpoints :
   ## signup

  ### *  `/signup`

- **Method** : post
- **CRUD Operation** : Create / Add username and password
- **Response Body**   : JSON

```
{
    "_id": "60aad367288af8560e1836af",
    "username": "sameer",
    "password": "$2b$10$O/lBLiL/rQX3HR/TtUW5FOX4XANrU4YbmENxXFRy/ey0TQG4AMnku",
    "__v": 0
}

```
   ## sigin
  ### * `/signin`

- **Method** : post
- **CRUD Operation** : signin to exist user
- **Response Body**  : JSON

```
{
    "_id": "60aa8018fab6792ca70a801a",
    "username": "emran",
    "password": "$2b$10$4HjDK20tVPvUcrisx8b0qu1PGhiw9BgK99d.TrI1pX3KPLHJvzm9i",
    "__v": 0
}

```

4. Test .
* There's 2 test files . basic-auth.test.js
* In terminal run :

```
npm test

```

## UML Diagram
![basic-auth](basic-auth.png)

repository: emranaloul/basic-auth

gha_language: JavaScript

repo_name: emranaloul/basic-auth


text:
---
layout: post
title: "Episode 123: Salary Promise Fail and Slacker Coworkers"
date: 2018-09-10 12:00:00 -0700
guid: 41676567-fb35-4b50-aea5-ead69c9d5dc7
duration: "29:26"
length: 24145459
file: "https://dts.podtrac.com/redirect.mp3/download.softskills.audio/sse-123.mp3"
categories: episode
enable_comments: true
---

In this episode, Dave and Jamison answer these questions:

1. Great podcast! Love what you guys are doing and very happy that you are doing this for such a long time! Here's the question.

   I started to work in a Startup a year ago. When we were negotiating the salary we agreed on amount X, and CTO promised that after a year it will be increased. He did say the exact sum. So, the year has passed, I followed up CTO about the salary raise, and he delegated the task to the manager, who decided not to give me a raise. When I asked 'why?' he said that I am good at negotiating my salary and I'm getting what the market is offering. I don't feel bad about not getting more money, but the fact that the CTO break his word concerns me. I don't think I can trust this company when they are promising anything and I started to care less about what I'm doing here. Am I delusional that a programmers salary has to increase even by 2% on a yearly basis and how to find a way to trust company in the future? Or just drop this and take the default SSE case - look for another job?

   Thank you for your answer.

2. Hi Dave and Jamison, Absolutely love the show.

   I share an office with a peer who works on my team. We are both early in our career and are lucky to work under a very hands off manager. However, I feel my peer is taking advantage of the situation and is slacking off. He is rarely in his office and often states that he is ""working"" from home. When he graces us with his appearance in the office, he asks the most basic questions. Granted, those questions are internal and specific (not easily Google-able), but still, I feel he should have known the answers after a year on the job.

    Then plays video games in the office until the build is complete (about 4 hours). Then makes a minor change in his feature code and kicks off a full build again, even though he could build incrementally (about 2-3 minutes).

   What do you recommend me to do? Should I spend time and energy to answer his lifeless questions? Should I confront him?

repository: soft-skills-engineering/website

branch_name: refs/heads/gh-pages

repo_name: soft-skills-engineering/website


text:
## [v0.32.0] - 2022-11-22

### BREAKING CHANGE

Following changes in AccelByte Gaming Services OpenAPI specification:
- Model `TrackedEntitlementInfo` is replaced with `EntitlementDecrementResult`

The new model(s) above are compatible with the models it is replacing. If you are affected, a simple rename should be sufficient; i.e. rename `TrackedEntitlementInfo` with `EntitlementDecrementResult`.

[v0.32.0]: https://github.com/AccelByte/accelbyte-go-sdk/compare/v0.31.2...v0.32.0

repository: AccelByte/accelbyte-go-sdk

repo_name: AccelByte/accelbyte-go-sdk


text:
# A minimal Clojure webapp

## Structure

``` shell
mkdir -p hey-clj/src/hey
```

## project.clj

``` clojure
(defproject hey "0.0.1"
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [ring/ring-core "1.6.3"]
                 [ring/ring-jetty-adapter "1.6.3"]]
  :main hey.core)
```

## hey.core

``` clojure
(ns hey.core
  (:gen-class)
  (:require [ring.adapter.jetty :as jetty]))

(defn handler [my-name request]
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body (format "Hello %s from Clojure, Docker, and Kubernetes." my-name)})

(defn -main [& args]
  (let [my-name (or (System/getenv "MY_NAME")
                     "World")]
    (jetty/run-jetty (partial handler my-name) {:port 3000})))
```

## Run it locally, without an environment variable

``` console
$ lein run
```

## Run it locally, with an environment variable
``` console
$ MY_NAME=Monty lein run
```

Next: [Create the Docker Image](05-create-image.md)

If you need to take down your cluster, see [Cleanup](99-cleanup.md)


text:
---
applied_at: "2022-04-06"
applies_to:
- api
is_impactful: false
is_new_feature: false
collapse: true
show_excerpt: true
release_source_url: ''
---

# Notice of behavior change for collaboration events on the changes stream

Starting today, we will begin rolling out changes to the behavior of
collaboration events when an application consumes those events from our
[event API endpoints][event-apis].

This change will only affect `COLLAB_INVITE_COLLABORATOR`,
`COLLAB_ADD_COLLABORATOR`, `COLLAB_ROLE_CHANGE`, and
`COLLAB_REMOVE_COLLABORATOR` [user events][user-events]
with the query parameter `stream_type` set to `changes`.
This will not affect existing [enterprise events][enterprise-events].
The new behavior will not cause downtime within existing applications
or require any application changes to prevent uptime disruptions.

<!-- more -->

## Change overview

Previously, events of type `COLLAB_INVITE_COLLABORATOR`,
`COLLAB_ADD_COLLABORATOR`, `COLLAB_ROLE_CHANGE`, and
`COLLAB_REMOVE_COLLABORATOR` created notifications
for the acted upon users that were listening to the `changes` stream.
Owners of the collaborated item would not receive these events unless
they were listening to the `all` stream as well.

We are cleaning up this discrepancy by establishing parity
between the `all` and `changes` stream. With this new behavior,
notifications of a collaboration will be created for the content owner
on the `changes` stream as well. Collaboration owners will now see an
additional event that matches what they see on the `all` stream.

## Where to get support

Should you have any issues or need further guidance, please post a request to
our [developer forum][forum] for any help needed.

[event-apis]: https://developer.box.com/reference/get-events/
[user-events]: https://developer.box.com/guides/events/user-events/for-user/#event-types
[enterprise-events]: https://developer.box.com/guides/events/enterprise-events/for-enterprise/
[user-access-token]: g://authentication/jwt/user-access-tokens/
[forum]: https://support.box.com/hc/en-us/community/topics/360001932973-Platform-and-Developer-Forum

repository: box/box-developer-changelog

repo_name: box/box-developer-changelog


text:
# Asset Pipeline

## What is it?
The asset pipeline provides a framework of concatenating and compressing your JavaScript and CSS assets. Instead of loading all of your JS and CSS files, only one JS and one CSS file are loaded.

## How is it included?
Via sprockets-rails gem

You can manually disable it upon rails app creation by executing the following on the command line:

```
rails new appname --skip-sprockets
```

## Key Features

### Concatenation
Reduces the number of assets loaded by combining all JS files into one JS file and all CSS files into one CSS file.

This single file is called the 'manifest file'. Represented as application.js or application.css

### Compression
Removes whitespace and comments from CSS files.

"Uglifies" JavaScript (reduces unnecessary whitespace and performs other optimizations)

### Pre-compilation of higher level languages
Sass -> CSS

CoffeeScript -> JavaScript

## Example
http://secret-shore-70824.herokuapp.com/

gha_language: Ruby


text:
# 1.02 - NoSQL

## Definition of NoSQL per Wikipedia

> A NoSQL (originally referring to "non-SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases.

See https://en.wikipedia.org/wiki/NoSQL

Others models pre-dated Relational, such as **hierarchical** [IMS](https://www.ibm.com/it-infrastructure/z/ims)

---

---

## Spectrum

Think of relational databases as the narrow (i.e. - **ANSI SQL standard**) but dense band of wavelengths that is visible light.

**NoSQL is all the other wavelengths; there is tremendous variety**.

---

## Example NoSQL Databases/Datastores

- [Redis](https://redis.io/)
- [Apache HBase](https://hbase.apache.org/)
- [Apache Cassandra](https://cassandra.apache.org/)
- [Apache CouchDB](https://couchdb.apache.org/)
- [Apache TinkerPop / Gremlin](https://tinkerpop.apache.org/)
- [MongoDB](https://www.mongodb.com/)
- [CosmosDB](https://azure.microsoft.com/en-us/services/cosmos-db/)
- ...many more...

---

## Why use NoSQL?

- Size of data; horizontally distributed
- Speed of throughput; capable of millions of operations per second
- Development Speed and Agility.  Schemaless
- End-to-End JSON applications, reduce transformations, increase speed
- High Availability.  Your data is stored on multiple nodes
- Storage is relatively very inexpensive now, vs 1970.  3NF not necessary.
- New types of applications, such as IoT, Social Networks, Graph

## Differences between NoSQL and relational databases

- https://docs.microsoft.com/en-us/azure/cosmos-db/relational-nosql

---

## What NoSQL Isn't

**Relational**

---

[toc](0_table_of_contents.md)   |    [previous](1_01_azure.md)   |   [next](0_table_of_contents.md)

repository: daniloescolin/azure-cosmosdb

repo_name: daniloescolin/azure-cosmosdb


text:
# Tesseract OCR for PHP

A wrapper to work with Tesseract OCR inside PHP.

## Installation

Via [Composer][]:

    $ composer require IkerST/tesseract_ocr

:bangbang: **This library depends on [Tesseract OCR][], version _3.02_ or later.**

### Note for Windows users

There are [many ways][tesseract_installation_on_windows] to install
[Tesseract OCR][] on your system, but if you just want something quick to
get up and running, I recommend installing the [Capture2Text][] package with
[Chocolatey][].

    choco install capture2text --version 3.9

:warning: Recent versions of Capture2Text stopped shipping the `tesseract` binary.

### Note for macOS users

With [MacPorts][] you can install support for individual languages, like so:
```bash
	sudo port install tesseract-<langcode>
```

But that is not possible with [Homebrew][]. It comes only with **English** support
by default, so if you intend to use it for other language, the quickest solution
is to install them all:

```bash
brew install tesseract --with-all-languages
```

## Usage

### Basic usage

```php
use IkerST\TesseractOCR\TesseractOCR;
echo (new TesseractOCR('text.png'))
    ->run();
```

### Other languages

```php
use IkerST\TesseractOCR\TesseractOCR;
echo (new TesseractOCR('german.png'))
    ->lang('deu')
    ->run();
```

### Multiple languages

```php
use IkerST\TesseractOCR\TesseractOCR;
echo (new TesseractOCR('mixed-languages.png'))
    ->lang('eng', 'jpn', 'spa')
    ->run();
```

### Inducing recognition

```php
use IkerST\TesseractOCR\TesseractOCR;
echo (new TesseractOCR('8055.png'))
    ->whitelist(range('A', 'Z'))
    ->run();
```

## API

### image

Define the path of an image to be recognized by `tesseract`.

```php
$ocr = new TesseractOCR();
$ocr->image('/path/to/image.png');
$ocr->run();
```

### imageData

Set the image to be recognized by `tesseract` from a string, with its size.
This can be useful when dealing with files that are already loaded in memory.
You can easily retrieve the image data and size of an image object :
```php
//Using Imagick
$data = $img->getImageBlob();
$size = $img->getImageLength();
//Using GD
ob_start();
// Note that you can use any format supported by tesseract
imagepng($img, null, 0);
$size = ob_get_length();
$data = ob_get_clean();

$ocr = new TesseractOCR();
$ocr->imageData($data, $size);
$ocr->run();
```

### executable

Define a custom location of the `tesseract` executable,
if by any reason it is not present in the `$PATH`.

```php
echo (new TesseractOCR('img.png'))
    ->executable('/path/to/tesseract')
    ->run();
```

### version

Returns the current version of `tesseract`.

```php
echo (new TesseractOCR())->version();
```

### availableLanguages

Returns a list of available languages/scripts.

```php
foreach((new TesseractOCR())->availableLanguages() as $lang) echo $lang;
```

__More info:__ <https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#languages-and-scripts>

### tessdataDir

Specify a custom location for the tessdata directory.

```php
echo (new TesseractOCR('img.png'))
    ->tessdataDir('/path')
    ->run();
```

### userWords

Specify the location of user words file.

This is a plain text file containing a list of words that you want to be
considered as a normal dictionary words by `tesseract`.

Useful when dealing with contents that contain technical terminology, jargon,
etc.

```
$ cat /path/to/user-words.txt
foo
bar
```

```php
echo (new TesseractOCR('img.png'))
    ->userWords('/path/to/user-words.txt')
    ->run();
```

### userPatterns

Specify the location of user patterns file.

If the contents you are dealing with have known patterns, this option can help
a lot tesseract's recognition accuracy.

```
$ cat /path/to/user-patterns.txt'
1-\d\d\d-GOOG-441
www.\n\\\*.com
```

```php
echo (new TesseractOCR('img.png'))
    ->userPatterns('/path/to/user-patterns.txt')
    ->run();
```

### lang

Define one or more languages to be used during the recognition.
A complete list of available languages can be found at:
<https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#languages>

Use the combination `->lang('chi_sim', 'chi_tra')`
for proper recognition of Chinese.

```php
 echo (new TesseractOCR('img.png'))
     ->lang('lang1', 'lang2', 'lang3')
     ->run();
```

### psm

Specify the Page Segmentation Method, which instructs `tesseract` how to
interpret the given image.

__More info:__ <https://github.com/tesseract-ocr/tesseract/wiki/ImproveQuality#page-segmentation-method>

```php
echo (new TesseractOCR('img.png'))
    ->psm(6)
    ->run();
```

### oem

Specify the OCR Engine Mode. (see `tesseract --help-oem`)

```php
echo (new TesseractOCR('img.png'))
    ->oem(2)
    ->run();
```

### whitelist

This is a shortcut for `->config('tessedit_char_whitelist', 'abcdef....')`.

```php
echo (new TesseractOCR('img.png'))
    ->whitelist(range('a', 'z'), range(0, 9), '-_@')
    ->run();
```

### configFile

Specify a config file to be used. It can either be the path to your own
config file or the name of one of the predefined config files:
<https://github.com/tesseract-ocr/tesseract/tree/master/tessdata/configs>

```php
echo (new TesseractOCR('img.png'))
    ->configFile('hocr')
    ->run();
```

### setOutputFile

Specify an Outputfile to be used. Be aware: If you set an outputfile then
the option `withoutTempFiles` is ignored.
Tempfiles are written (and deleted) even if `withoutTempFiles = true`.

In combination with `configFile` you are able to get the `hocr`, `tsv` or
`pdf` files.

```php
echo (new TesseractOCR('img.png'))
    ->configFile('pdf')
    ->setOutputFile('/PATH_TO_MY_OUTPUTFILE/searchable.pdf');
    ->run();
```

### digits

Shortcut for `->configFile('digits')`.

```php
echo (new TesseractOCR('img.png'))
    ->digits()
    ->run();
```

### hocr

Shortcut for `->configFile('hocr')`.

```php
echo (new TesseractOCR('img.png'))
    ->hocr()
    ->run();
```

### pdf

Shortcut for `->configFile('pdf')`.

```php
echo (new TesseractOCR('img.png'))
    ->pdf()
    ->run();
```

### quiet

Shortcut for `->configFile('quiet')`.

```php
echo (new TesseractOCR('img.png'))
    ->quiet()
    ->run();
```

### tsv

Shortcut for `->configFile('tsv')`.

```php
echo (new TesseractOCR('img.png'))
    ->tsv()
    ->run();
```

### txt

Shortcut for `->configFile('txt')`.

```php
echo (new TesseractOCR('img.png'))
    ->txt()
    ->run();
```

### tempDir

Define a custom directory to store temporary files generated by tesseract.
Make sure the directory actually exists and the user running `php` is allowed
to write in there.

```php
echo (new TesseractOCR('img.png'))
    ->tempDir('./my/custom/temp/dir')
    ->run();
```

### withoutTempFiles

Specify that `tesseract` should output the recognized text without writing to temporary files.
The data is gathered from the standard output of `tesseract` instead.

```php
echo (new TesseractOCR('img.png'))
    ->withoutTempFiles()
    ->run();
```

### Other options

Any configuration option offered by Tesseract can be used like that:

```php
echo (new TesseractOCR('img.png'))
    ->config('config_var', 'value')
    ->config('other_config_var', 'other value')
    ->run();
```

Or like that:

```php
echo (new TesseractOCR('img.png'))
    ->configVar('value')
    ->otherConfigVar('other value')
    ->run();
```

__More info:__ <https://github.com/tesseract-ocr/tesseract/wiki/ControlParams>

### Thread-limit

Sometimes, it may be useful to limit the number of threads that tesseract is
allowed to use (e.g. in [this case](https://github.com/tesseract-ocr/tesseract/issues/898)).
Set the maxmium number of threads as param for the `run` function:

```php
echo (new TesseractOCR('img.png'))
    ->threadLimit(1)
    ->run();
```

repository: mustafakarali/TesseractOCR

repo_name: mustafakarali/TesseractOCR


text:
# Changelog

All notable changes to `laravel-json-api-paginate` will be documented in this file

## 1.13.0 - 2023-03-27

### What's Changed

- Add macros for BelongsToMany and HasManyThrough by @philipgunther in https://github.com/spatie/laravel-json-api-paginate/pull/65

### New Contributors

- @philipgunther made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/65

**Full Changelog**: https://github.com/spatie/laravel-json-api-paginate/compare/1.12.2...1.13.0

## 1.12.2 - 2023-01-25

### What's Changed

- Add PHP 8.2 Support by @patinthehat in https://github.com/spatie/laravel-json-api-paginate/pull/71
- Laravel 10.x Compatibility by @laravel-shift in https://github.com/spatie/laravel-json-api-paginate/pull/72

### New Contributors

- @patinthehat made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/71
- @laravel-shift made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/72

**Full Changelog**: https://github.com/spatie/laravel-json-api-paginate/compare/1.12.1...1.12.2

## 1.12.1 - 2022-11-19

### What's Changed

- Refactor tests to Pest by @alexmanase in https://github.com/spatie/laravel-json-api-paginate/pull/68
- Append query parameters to URLs when using cursor pagination by @NizarBerjawi in https://github.com/spatie/laravel-json-api-paginate/pull/69

### New Contributors

- @alexmanase made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/68
- @NizarBerjawi made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/69

**Full Changelog**: https://github.com/spatie/laravel-json-api-paginate/compare/1.12.0...1.12.1

## 1.12.0 - 2022-05-16

## What's Changed

- Add cursor pagination by @AyoobMH in https://github.com/spatie/laravel-json-api-paginate/pull/61

## New Contributors

- @AyoobMH made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/61

**Full Changelog**: https://github.com/spatie/laravel-json-api-paginate/compare/1.11.2...1.12.0

## 1.11.2 - 2022-05-13

## What's Changed

- change wording to say that it does not follow the json spec by @brettnielsen in https://github.com/spatie/laravel-json-api-paginate/pull/60
- Make negetive page[size] exception safe by @ifduyue in https://github.com/spatie/laravel-json-api-paginate/pull/62

## New Contributors

- @brettnielsen made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/60
- @ifduyue made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/62

**Full Changelog**: https://github.com/spatie/laravel-json-api-paginate/compare/1.11.1...1.11.2

## 1.11.1 - 2022-01-11

- allow Laravel 9

## 1.11.1 - 2021-01-11

- allow Laravel 9

## 1.11.0 - 2021-11-27

## What's Changed

- Pagination is not part of the JSON:API specification by @bbrala in https://github.com/spatie/laravel-json-api-paginate/pull/56
- Adds the JsonPaginate macro to the base Query Builder by @troy-whitespark in https://github.com/spatie/laravel-json-api-paginate/pull/58

## New Contributors

- @bbrala made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/56
- @troy-whitespark made their first contribution in https://github.com/spatie/laravel-json-api-paginate/pull/58

**Full Changelog**: https://github.com/spatie/laravel-json-api-paginate/compare/1.10.0...1.11.0

## 1.10.0 - 2020-11-27

- Add PHP 8 support
- Drop support for Laravel 5.8

## 1.9.0 - 2020-09-30

- add simple pagination option (#43)

## 1.8.0 - 2020-08-09

- add support for Laravel 8.0

## 1.7.0 - 2020-03-02

- add support for Laravel 7.0

## 1.6.0 - 2019-09-04

- add support for Laravel 6.0
- added configurable pagination query parameter (#35)

## 1.5.0 - 2019-02-27

- drop support for Laravel 5.7 and below
- drop support for PHP 7.1 and below

## 1.4.3 - 2019-02-27

- add support for Laravel 5.8

## 1.4.2 - 2019-02-01

- use Arr:: and Str:: functions

## 1.4.1 - 2018-09-04

- add support for Laravel 5.7

## 1.4.0 - 2018-06-15

- add `base_url` config option

## 1.3.2 - 2018-05-15

- fix casting of size parameter

## 1.3.1 - 2018-02-08

- add support for Laravel 5.6

## 1.3.0 - 2018-01-04

- add `default_size` config and parameter option

## 1.2.1 - 2017-10-16

- fix for setting max results

## 1.2.0 - 2017-08-21

- add support for Laravel 5.5

## 1.1.0 - 2017-06-15

- make the `page[x]` parameter names configurable
- add support for L5.5's auto package discovery

## 1.0.0 - 2017-06-14

- initial release

repository: spatie/laravel-json-api-paginate

gha_language: PHP

repo_name: spatie/laravel-json-api-paginate


text:
---
layout: kanji
v4: 185
v6: 197
kanji: 字
keyword: character
elements: character, house, child
strokes: 6
image: E5AD97
on-yomi: ジ
kun-yomi: あざ、あざな、-な
permalink: /rtk/字/
prev: 尚
next: 守
---

1) [Christine_Tham] 30-7-2007(110): CHILDren learn Kanji characters underneath a HOUSE.

 It builds character!".

3) [axelb] 19-3-2008(53): The first kanji characters you will learn in Japan is probably learnt at home (in the house of your family) when you are still a child.

4) [harusame] 30-4-2009(22): The way a child grows up in his house determines his character.

5) [applesuki] 15-2-2006(19): Imagine a child in his home (under the roof) sitting at the kitchen table practicing his kanji characters.


text:
# InstancedUniformsMesh

This package provides a `InstancedUniformsMesh` class which extends Three.js's [`InstancedMesh`](https://threejs.org/docs/#api/en/objects/InstancedMesh) to allow its material's shader uniforms to be set individually per instance. It behaves just like `InstancedMesh` but exposes a new method:

```js
mesh.setUniformAt(uniformName, instanceIndex, value)
```

When you call `setUniformAt`, the geometry and the material's shaders will be automatically upgraded behind the scenes to turn that uniform into an instanced buffer attribute, filling in the other indices with the uniform's default value. You can do this for any uniform of type `float`, `vec2`, `vec3`, or `vec4`. It works both for built-in Three.js materials and also for any custom ShaderMaterial.

For example, here is how you could set random `emissive` and `metalness` values for each instance using a `MeshStandardMaterial`:

```js
import { InstancedUniformsMesh } from 'three-instanced-uniforms-mesh'

const count = 100
const mesh = new InstancedUniformsMesh(
  someGeometry,
  new MeshStandardMaterial(),
  count
)
const color = new Color()
for (let i = 0; i < count; i++) {
  mesh.setMatrixAt(i, someMatrixValue)
  mesh.setUniformAt('metalness', i, Math.random())
  mesh.setUniformAt('emissive', i, color.set(Math.random() * 0xffffff))
}
```

While this is obviously useful for Three.js's built in materials, it _really_ shines with custom shaders. Just declare any configurable parameters as uniforms in your custom shader, and then you can use that either on a single non-instanced `Mesh` by setting the material's uniforms directly, or instance it using `InstancedUniformsMesh` by calling `setUniformAt`. Your shader doesn't need to change at all to support the instancing!

> Note: Calling `setUniformAt` automatically marks the underlying buffer attributes for upload, so unlike [`setMatrixAt`](https://threejs.org/docs/#api/en/objects/InstancedMesh.setMatrixAt) or [`setColorAt`](https://threejs.org/docs/#api/en/objects/InstancedMesh.setColorAt) you don't need to set `needsUpdate` manually.

### Value Types

The type of the `value` argument should match the type of the uniform defined in the material's shader:

| For a uniform of type:    | Pass a value of this type:       |
|---------------------------|----------------------------------|
| float                     | Number                           |
| vec2                      | `THREE.Vector2`                  |
| vec3                      | `THREE.Vector3` or `THREE.Color` |
| vec4                      | `THREE.Vector4`                  |
| mat3 (ThreeJS r132+ only) | `THREE.Matrix3`                  |
| mat4 (ThreeJS r132+ only) | `THREE.Matrix4`                  |

### Resetting to defaults

If you have set instance-specific values for a given uniform but you want to revert all those to the single original uniform value, you can call:

```js
mesh.unsetUniform(uniformName)
```

### Examples

- [Instanced spheres with varying metalness/roughness](https://codesandbox.io/s/instanceduniformsmesh-r3f-lss90?file=/src/index.js) (uses [react-three-fiber](https://github.com/pmndrs/react-three-fiber))

- [Instanced beziers with varying control points](https://ibyou.csb.app/) (plain Three.js + [BezierMesh](https://github.com/protectwise/troika/tree/master/packages/troika-three-utils#beziermesh))

repository: protectwise/troika

repo_name: protectwise/troika


text:
# Electron Scroller

Electron Scroller is a package designed to manage scrolling of historical pages
in `<webview>` tags.  Webviews in electron manage page history, offering forward
and back, but when navigating to the pages, the scroll position is lost.  This
package allows you to maintain the scroll position and automatically reposition
the page to the proper scroll position upon navigation (back, forward, reload).

## Installation
To install Electron Scroller, use [npm](https://docs.npmjs.com/).  The preferred
method is to install Electron Scroller as an dependency in your app:

```sh
npm install --save electron-scroller
```

## Quick Start
It is necessary to include Electron Scroller in two places in your app:
1. In your render javascript (called via a `<script>` in the HTML source)
1. In the preload file (specified in the `<webview preload="file.js"`)

### Example HTML
```HTML
<!DOCTYPE html>
<html>
<head>
  <title>Browser</title>
</head>
<body>
  <div id="buttonBar">
    ...
  </div>
  <div id="browser">
    <webview id="browserView" preload="preload.js"></webview>
  </div>
  <script src="browser.js"></script>
</body>
</html>
```

### Render Javascript
Require the package and use the `add()` method. Pass to `add()` a string
containing a single
[CSS selector](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)
that describes the specific webview to be managed. If only a single webview
exists, the selector is not required. Because the Scroller hooks
into the methods of the webview, it may be best to call `add()` early in the
process and before configuring the webview. In this example, in the file
`browser.js`:

```javascript
const scroller = require('electron-scroller')

onload = function() {
  let selector = '#browserView'
  scroller.add(selector)
  // The selector is not required if there is only a single webview:
  // scroller.add()
}
```

### Preload Javascript
The Scroller has to be included in the preload file by calling the `preload()`
method. It is not necessary to pass the selector.  In this example, in the file
`preload.js`:

```javascript
require('electron-scroller').preload()
```

# License
[ISC](https://opensource.org/licenses/ISC)

license: ISC

repository: nos/electron-scroller

gha_license_id: ISC

repo_name: nos/electron-scroller


text:
---
category: [Gears, Spur Gears]
title: Diametral Pitch
weight: 40
---

## Diametral pitch

All gears have a pitch (or module, if you're dealing with metric) which specifies how many teeth per inch of gear there will be.

What happens when you adjust the pitch slider?

@{PitchSlider}

The gear changes size! If you want to change how many teeth per inch of gear there is, then the spacing between each tooth will have to adjust accordingly. This is why the gear gets bigger or smaller.

To put this into perspective, here is a table which describes how the pitch changes a standard gear (in terms of full diameter):

| Teeth | Pitch | Full Diameter (in) | Full Diameter (mm) |
| ----- | ----- | ------------------ | ------------------ |
| 24    | 12    | 2.167"             | 50.03mm            |
| 24    | 10    | 2.6"               | 66.04mm            |
| 24    | 8     | 3.25"              | 82.55mm            |
| 24    | 6     | 4.33"              | 110.067mm          |
| 24    | 4     | 6.5"               | 167.10mm           |
| 24    | 2     | 13"                | 330.20mm           |

repository: SharpCoder/gear-academy

repo_name: SharpCoder/gear-academy


text:
---
title: Voluntary Work - Association
featuredimage: /assets//images/voluntarywork/voluntary_background.jpg
---
# VOLUNTARY WORK

Another volunteeting experince of mine was as an Art Therapy Volunteer at [Association Plus5](https://pomoczumetnostjo.blogspot.pt/) in Ljubljana (Slovenia).

The Association Plus5 is an association that aims to use art therapy methods as a therapeutic techniques to help clients understand their emotional conflicts, develop social skills, improve self-esteem, manage addictions, reduce anxiety, and restore normal functions to their lives.

{% include figure.html url="/assets/images/voluntarywork/voluntarywork_6.jpg" derescription="" %}

## MY ROLE

While working as the **art therapy volunteer** I have implemented workshops for people with disabilities, elderly and children, always using **creative arts approches**.

My role was to prepare and deliver art tharapy expercises adapted to each customer group. I also partipcated in team briefing with other volunteering when needed as well as held team restrospectives after workshops.

{% include figure.html url="/assets/images/voluntarywork/voluntarywork_3.jpg" derescription="" %}


text:
---
layout: layout.pug
navigationTitle: ZooKeeper
title: ZooKeeper
menuWeight: 5
excerpt: Deploying ZooKeeper in a project
---

## Getting started

To get started with creating ZooKeeper clusters in your project namespace, you first need to deploy the [ZooKeeper operator](../../../../../../workspaces/applications/catalog-applications/dkp-applications/zookeeper-operator/) in the workspace where the project exists.

After you deploy the ZooKeeper operator, you can create ZooKeeper Clusters by applying a `ZookeeperCluster` custom resource **on each attached cluster** in a project's namespace.

A [Helm chart](https://github.com/pravega/zookeeper-operator/tree/master/charts/zookeeper) exists in the ZooKeeper operator repository that can assist with deploying ZooKeeper clusters.

### Example deployment

NOTE: If you need to manage these custom resources across all clusters in a project, it is recommended you use Project Deployments which enables you to leverage GitOps to deploy the resources. Otherwise, you will need to create the resources manually in each cluster.

Follow these steps to deploy a ZooKeeper cluster in a project namespace. This procedure results in a running ZooKeeper cluster, ready for use in your project's namespace.

1.  Set the `PROJECT_NAMESPACE` environment variable to the name of your project’s namespace:

    ```bash
    export PROJECT_NAMESPACE=<project namespace>
    ```

1.  Create a ZooKeeper Cluster custom resource in your project namespace

    ```yaml
    kubectl apply -f - <<EOF
    apiVersion: zookeeper.pravega.io/v1beta1
    kind: ZookeeperCluster
    metadata:
      name: zookeeper
      namespace: ${PROJECT_NAMESPACE}
    spec:
      replicas: 1
    EOF
    ```

1.  Check the status of your ZooKeeper cluster using `kubectl`:

    ```bash
    kubectl get zookeeperclusters -n ${PROJECT_NAMESPACE}
    ```

    ```text
    NAME        REPLICAS   READY REPLICAS    VERSION   DESIRED VERSION   INTERNAL ENDPOINT    EXTERNAL ENDPOINT   AGE
    zookeeper   1          1                 0.2.13    0.2.13            <IP_ADDRESS>:2181   N/A                 94s
    ```

## Deleting ZooKeeper clusters

Follow these steps to delete the Zookeeper clusters.

1.  View `ZookeeperClusters` in all namespaces:

    ```bash
    kubectl get zookeeperclusters -A
    ```

1.  Delete a specific `ZookeeperCluster`:

    ```bash
    kubectl -n ${PROJECT_NAMESPACE} delete zookeepercluster <name of zookeepercluster>
    ```

## Resources

- [ZooKeeper Operator Documentation](https://github.com/pravega/zookeeper-operator)
- [ZooKeeper Cluster Helm Chart](https://github.com/pravega/zookeeper-operator/tree/master/charts/zookeeper)
- [ZooKeeper Documentation](https://zookeeper.apache.org/documentation)

repository: mesosphere/dcos-docs-site

repo_name: mesosphere/dcos-docs-site