text:
---
layout: post
title: Challenge Project Step 1
readtime: true
date: Mon Feb  6 2023
---

# Introduction

The goal of this project is for you to choose your favorite feature of an
Operating System and then add that feature (or some simplified version of it) to
the xv6 kernel. The idea behind this exercise is for you to design, tune, and
implement a simple OS features, based on your own research and understanding of
the material we covered in class.

As part of your implementation plan, you might need to make multiple assumptions
to simplify certain aspects of the problem that cannot be handled by your design
and implementation. An important part of this exercise is to train in
__documenting your assumptions__ so that a user of your feature can know exactly
what to expect when deploying. This is a really important aspect of OS design as
your code will be running at a high privilege level and it must thus be very
clear what your code can and cannot do.

Another important part of this exercise is designing and writing test cases. Say
for example you decide to write a new xv6 process scheduler, then you will need
to write a few test cases that actually showcase or stress the features of your
scheduler. Running all processes to completion is great, but if your scheduler
has support for some form of priorities, then you will need to write, and
document, test cases that exercise those priorities.

# Learning Objectives

At this end of this project, you should be able to:

- Design a basic OS feature and implement it in xv6.
- Document your assumptions about your OS feature.
- Write test cases that showcase and stress your implementation.
- Write a report that highlights the advantages and limitations of your
  approach.

# Project Requirements

There are several requirements that your project must meet at the end of the
term.

## Teams

You should complete this project in teams of 2 or 3 students, you are free
to pick your group-mates based on your preferences and connections. I strongly
discourage lone-wolf projects; sharing ideas, pair programming, and task
planning can be very helpful for you to have a smooth experience.

It is __okay__ to form teams across the class sections as long as all team
members can show to the project meetings at the same time. If a student fails to
show up to the meeting without a valid excuse, then they will automatically fail
the project.

## Project Meetings

During class time (as determined by the schedule page), I will meet with every
group to discuss their ideas and potential plans. Those meetings will be crucial
in making sure that your ideas are at an appropriate scale. __All team members
should be present at those meetings__.

## Completion Requirements

At the end of the term, your project will be assessed based on the
following requirements:

1. The assumptions that you make throughout your design, and how well they are
   documented.

2. The test cases that you write to stress your design and showcase where it
   excels/fails.

3. A small design document that walks me through your design features, how you
   came up with them, any challenges you faced, and how (or why not) where you
   able to overcome them.

4. Your implementation in the xv6 kernel.

5. The performance of your implementation (runtime, memory footprint, etc.).

Particularly, I am very interested in seeing how you would design your feature
and implement it, given the many limitations of the xv6 kernel. That is not to
say that your project should not be implemented, but more to say that the
process that lead you to make the choices you made (for example which data
structures to use, concurrency issues, trade-offs you had to make, etc.) are
very important.

### Documentation

As per the completion requirements, documenting your approach is of the utmost
importance. Think of it as the means by which you can demonstrate how well you
understand OS concepts by designing and implementing one of them, and
basically what you can use to argue for the grade that you deserve on the
project. When reading your document, I should be able to understand the design
options that have been considered, the design decisions that have been made, and
the rationale for those decisions

At the same time, a tutorial on how to run and use the OS features that you have
implemented would be crucial for us to determine how usable your added
feature(s) is.

Finally, in your design document, you will get to assign yourself (or your group
for that purpose) that grade that you think you deserve for the project, and
make the argument as to why you think that would be an appropriate grade.

# Ideas

In what follows I will list a couple of ideas that I think would be doable
within the time that we have allocated for this project. However, if you have
ideas of your own that you'd like to explore, then I definitely encourage you to
go after them. I am more than happy to meet with you and discuss your ideas and
make sure to scale them down to be done within the time allowed for this
project.

Note that for all these ideas (and your own), you will find that the [xv6
book]({{ site.xv6_book_url }}) to be very useful and very informative. The
source code is also pretty readable and very easy to understand.

<!--
## 1. Memory Management: Buddy Allocator

In its current form, the xv6 kernel allocates physical memory in a
straightforward way, and only one page of memory at a time. For example, take a
look at `kalloc` and `kfree` in `kernel/kalloc.c`, you can see that the
implementation is fairly simple. The kernel maintains a freelist
`kmem.freelist` as a singly linked-list. Allocation simply picks a free page
from the list, while freeing returns an allocated page to the list. This is very
simply and efficient, but clearly not very useful.

In this task, your job is to modify the kernel's physical page allocator to use
a buddy memory allocator scheme. The buddy allocator was originally devised by
Kenneth Knowlton in the paper [A Fast Storage
Allocator](https://dl.acm.org/doi/pdf/10.1145/365628.365655) and has been ported
into the Linux kernel, and has shown several performance improvement over other
schemes of memory allocation.

You can find a great discussion of how the buddy allocator is implemented in the
[Linux
kernel](https://www.kernel.org/doc/gorman/html/understand/understand009.html)
with plenty of nice diagrams that can help you understand how it can be built.
You can make any simplifying assumptions that will help you spin up a working
implementation, but make sure to document all of your assumptions in your design
document.
-->

## 1. Process Management: Kernel Threads

In its current form, the xv6 kernel only supports single-threaded processes with
separate address spaces. That is great for a start, but it has to incur a pricey
context switching overhead every-time we switch from one process to another.
Therefore, we would like to provide support for kernel threads that can share a
process's address space (something like `pthreads`) thus speeding up context
switching and providing parallelism.

In this task, you should provide support for kernel threads in the xv6 kernel.
Essentially, we need to provide support for a new system call called `clone`
that creates a child thread sharing the same address space as that of its
parent, except that it has its own stack. You would also need to create a system
call, most likely called `join`, that will wait for a child thread to exit.

I suggest that you start this task by reading the [man page of the `clone`
system call](https://www.man7.org/linux/man-pages/man2/clone.2.html) and then
writing a few examples that uses `clone` and run them on your Linux machine.
You'd then want to select a small subset of the options that are provided by
`clone` and implement them in xv6. Then you can move on to implementing
`join`. Your implementation must provide support for a user-level API that
allows users to create and manipulate kernel threads (something similar to the
`pthreads` library).

## 2. Process Management: Userspace Threads

The goal of this exercise is to build a user-space threading library for xv6.
What makes this project unique is that it doesn't involve any coding in kernel
space, i.e., all of your files will go into the `user/` directory. However, it
will require you to write some RISC-V assembly.

From a kernel's point of view, nothing changes. The kernel still only sees one
process and is not aware of the user-space threads that you should be creating.
You can definitely use the code from the user-space threads lab as a starting
point, however, what we are looking to implement here are the `makecontext` and
`swapcontext` functions that we used in that lab.

At an initial stage, you do not have to worry about any concurrency issues.
However, your implementation __must__ provide support for at least one means for
concurrency along with its corresponding implementatin and usable API.

## 3. Process Management: MLFQ Scheduling

As we have seen in class, the xv6 scheduler is a fairly straightforward round
robin preemptive scheduler with a fixed quantum. That is great if what we care
about achieving is fairness and good response time. However, the scheduler does
not take into consideration the behavior of the processes and their patterns of
execution.

Your job is to implement the Multi-Level Feedback Queue scheduling policy that
we discussed in class in the xv6 kernel. This will require substantial changes
to the scheduling algorithm implementation; we can no longer loop entirely over
the full list of processes, we will need different data structures.

One challenging aspect of this task is the design of test cases. If all of your
processes behave in the same way, then pretty much MLFQ will devolve into round
robin, and we are back to square one. So in order to showcase your
implementation, you will have to carefully design your tests cases to trigger
the different aspect of the MLFQ algorithm.

## 4. Process Management: Signals

In its current form, the xv6 kernel does not support for process signaling. In
this task, we would like to change that. Pick some set of signals that you would
like to provide for and then implement support for those signals in the kernel.
Of course, you should define default behavior for those signals once they are
received by a process.

Naturally, after that, you should allow for user to write their own signal
handlers. This can be a bit tricky and would require you to carefully design,
and possibly put restrictions on, what can be considered as a signal handler.
For example, it might be a good idea to force all signal handlers to have a
certain pattern or to call certain functions once they enter or when they exit.

## 5. Process Management: Lottery Scheduler

In class, we focused on deterministic scheduling policies. However, another
class of CPU scheduling policies are _probabilistic_ policies, where the process
that gets to run next is selected based on a probabilistic approach to provide
certain guarantess. Here's a really good description of _lottery scheduling_
from the
[paper](https://www.usenix.org/legacy/publications/library/proceedings/osdi/full_papers/waldspurger.pdf)
that introduced it to the OS community:

> Lottery scheduling provides efficient, responsive control over the relative
  execution rates of computations. Such control is beyond the capabilities of
  conven- tional schedulers, and is desirable in systems that service requests
  of varying importance, such as databases, media-based applications, and
  networks. Lottery scheduling also supports modular resource management by
  enabling concurrent modules to insulate their resource allocation policies
  from one another. A currency abstraction is introduced to flexibly name,
  share, and protect resource rights. We also show that lottery scheduling can
  be generalized to manage many diverse resources, such as I/O bandwidth, mem-
  ory, and access to locks.

Your job in this task is to implement a lottery-based scheduling policy in xv6
(or any probabilistic scheduling policy). Similar to the case of the MLFQ
scheduling project, a challenging aspect of this project is to design test cases
that highlight the features of your implementation and how it differs from
other policies. You might find it helpeful to look at the original
[paper](https://www.usenix.org/legacy/publications/library/proceedings/osdi/full_papers/waldspurger.pdf)
or
this [book chapter](https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-sched-lottery.pdf) for some evaluation metrics.

<!--
## 6. Defensive Security: Users and Authentication

Currently, xv6 has no notion of users and thus has no mean for authentication.
Once you launch a shell, you are pretty much in change of everything and can
mess around with anything in the machine. That is not idea.

In this task, we would like to add support for users and authentication in the
xv6 kernel. We will start off real simple, we are not seeking isolation between
different users, we just need the concept of a user and a way to create and
authenticate users. In other words, when xv6 starts, we would like to have a
prompt that asks the user for their username and password, and then we only give
them access if those match our database. At this point, we don't really care
about what happens after that (i.e., who accesses what and when), xv6 goes back
after that to its old ways.

However, one thing that we would like to care about is how we store our database
of passwords. Storing it in plain text is definitely a bad idea since anyone can
steal them, so you'd have to think of a way to store passwords and authenticate
users. I suggest you take a look at password hashing, the Unix `passwd` file,
and the Unix `shadow` file. Note that you might need to implement some
cryptography functions manually since we don't have access to outside crypto
libraries.

Of course, doing authentication with proper access control is not very useful.
So eventually, we would like to support some form of access control over files
in the kernel. Given our timeline, that is definitely out of scope, yet it would
be great if you could draw a plan about how you would approach such a design.
-->

## 6. Defensive Security: Kernel Auditing

As we mentioned in class, auditing is an important part of the OS's roles in
providing security guarantees. When something bad happens, we would like to be
able to trace it back to its origins and to also be able to evaluate what that
bad event impacted in our system (think of it as backward analysis and forward
analysis over data).

In this task, we would like to add to the xv6 kernel the ability to keep a log
of important security (or non-security) events that happen in our system. For
example, anytime a process touches a file, we would like our kernel to keep
track of that event in a log stating something like `Process PID opened file
file with permissions PERM at TS` where `<PID>` is the process id, `<file>`
is the file descriptor of the file that we opened, `<PERM>` is the permissions
that the process opened the file with, and `<TS>` is a timestamp of when that
even happens. You will need to think of a way to intercept such events and log
them into an appropriate location (first in-memory, then maybe on disk?).

Similarly, we would also be interested in tracking the system calls that were
executed by any process in our system. You might find it useful to checkout the
[Linux audit framework](https://wiki.archlinux.org/title/Audit_framework) and
[`auditctl`](https://www.man7.org/linux/man-pages/man8/auditctl.8.html).

You might want to start by selecting a fixed subset of events that you would
like to audit in your system, and then add more events once you have the
infrastructure in place. A challenging aspect of this project is to manage
how logs are buffered and when they would be flushed to disk to be saved.
Writing to disk on every monitored even would be very slow and would become a
bottleneck. So it would be your job to determine how to avoid constantly dumping
logs to disk. This also introduces concurrency issues that you must struggle
with.

## 7. Offensive Security: Return-Oriented-Programming (ROP)

Return-Oriented-Programming (ROP) is a dangerous form of attack that chains
several small pieces of benign code (called gadgets) to allow for arbitrary code
execution. There are plenty of ROP examples that work on different popular
architectures like x86-64, i386, ARM, etc. However, there are very few examples
of running those attacks on an RISC-V system.

Since xv6 is built to run on a RISC-V architecture, we would like to develop a
vulnerable user-space program and a corresponding exploit that can allow a
malicious user to run arbitrary code on the xv6 machine by chaining several
RISC-V gadgets. RISC-V has of course different calling conventions than other
architectures, so the patterns and the makeup of our gadgets will change. You
will need to spend some time reading the RISC-V specifications document and
taking some examples and working through them (I can help you set up debugging
for xv6).

Some references you might find useful are the following:

- [ROPGadget](https://github.com/JonathanSalwan/ROPgadget): It is a great tool
  that finds ROP gadgets in a given binary, yet has no support for RISC-V as of
  yet.

- [Return-Oriented Programming without
  Returns](https://hovav.net/ucsd/dist/noret-ccs.pdf).

- [When Good Instructions Go Bad: Generalizing Return-Oriented Programming to
  RISC](https://cseweb.ucsd.edu/~savage/papers/CCS08GoodInstructions.pdf).

- [No RISC No Reward: Return-Oriented Programming on
  RISC-V](https://arxiv.org/pdf/2007.14995.pdf)

## 8. Other Ideas?

If there is anything specific that you are interested or excited about that you
would want to see come to alive, I would be more than happy to sit down and talk
to you about it. We would devise a plan that simplifies the problem as much as
possible to make it doable within the time available.

# Submission

After our in-class discussions, please submit a proposal __IN PDF FORMAT__
listing your group members, your idea that you would like to implement, and a
tentative plan at implementing it. Your proposal __must contain__ a plan for
exactly how you plan to implement your idea, including needed data structures,
places in the xv6 code-base where your code should be added, and so on. The more
details you add the more we can help you identify what is feasible in the
current timeline and what is not.

gha_language: C


text:
# Importing Content

!!! warning
    This guide assumes that you already have obtained the content legally, RetroArch does not provide users with copyright content.

This guide uses the "scan" functionality to import your games into RetroArch's playlists sorted by console. The scan is recursive so you can organise your collection into sub-folders or potentially scan your whole computer.

## Step 1: Download database

In order to have RetroArch recognise your games, you need to have a database of all the titles.

From the RetroArch main menu select "Online Updater", then choose "Update Databases"

Wait for this to finish downloading

## Step 2: Scan and import

From the RetroArch Main Menu navigate to "Import content". You will be met by two options, "Scan Directory" or "Scan File".

To import a collection of ROMs, you should select "Scan Directory". Using the file browser, navigate to the folder with your ROM collection and select **"<Scan This Directory>"**.

Please be patient while it scans, large collections could take a few minutes.

## Step 3: Add box art

This is optional, but some games have box art that can make the menu more prettier, head back to the main menu, select "Online Updater", then choose "Thumbnails Updater". Here you need to select the console you want to download.

Please be patient, these take quite some time to download, especially on a slow internet connection.

repository: fpscan/docstest

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: fpscan/docstest


text:
---
layout: AtomLayout
hideBreadcrumbs: true
---

# Rating

::: slot usage

`SfRating` gives you a nice way to display a rating both with graphics and through text. This can be used to show the rating of a product, score for a review, or any other rating you might need.

## Examples

### Value handling

The `value` prop allows you to set the current rating and max number of stars via `max` prop.

If you need to support partial stars, you can show half-filled star icons by passing the `half-increment` prop.

<Showcase showcase-name="Rating/RatingValues">

<!-- vue -->
<<<../../preview/nuxt/pages/showcases/Rating/RatingValues.vue
<!-- end vue -->
<!-- react -->
<<<../../preview/next/pages/showcases/Rating/RatingValues.tsx#source
<!-- end react -->

</Showcase>

### Sizes

`SfRating` supports 6 sizes that can be set with the `size` prop: `'xs'`, `'sm'`, `'base'`, `'lg'`, `'xl'`.

<Showcase showcase-name="Rating/RatingSizes" style="min-height:250px">

<!-- vue -->
<<<../../preview/nuxt/pages/showcases/Rating/RatingSizes.vue
<!-- end vue -->
<!-- react -->
<<<../../preview/next/pages/showcases/Rating/RatingSizes.tsx#source
<!-- end react -->

</Showcase>

### Colors

Rating by default uses a `warning-500` for filled and partially filled stars and `disabled-500` as an empty icon color. You can change these values in your [Tailwind configuration](https://tailwindcss.com/docs/configuration#theme) or override them for a single element using [`important modifier`](https://tailwindcss.com/docs/configuration#important-modifier).

<Showcase showcase-name="Rating/RatingColors">

<!-- vue -->
<<<../../preview/nuxt/pages/showcases/Rating/RatingColors.vue
<!-- end vue -->
<!-- react -->
<<<../../preview/next/pages/showcases/Rating/RatingColors.tsx#source
<!-- end react -->

</Showcase>

### Single star with value

For a more minimal look, you can also present ratings a single star icon with a text label.

<Showcase showcase-name="Rating/SingleStar" style="min-height:220px">

<!-- vue -->
<<<../../preview/nuxt/pages/showcases/Rating/SingleStar.vue
<!-- end vue -->
<!-- react -->
<<<../../preview/next/pages/showcases/Rating/SingleStar.tsx#source
<!-- end react -->

</Showcase>

## Accessibility notes

For better out-of-the-box accessibility, `SfRating` adds `role="img"` and an `aria-label` property with value `Rating: [Avg value] out of [Max value] stars` where the values are replaced with the actual values. This can be overridden by passing an `aria-label` property to the component.

## Playground

<Generate style="height:400px" />
:::

::: slot api

## Props

| Prop name     | Type                | Default value | Possible values            |
| ------------- | ------------------- | ------------- | -------------------------- |
| `size`          | `SfRatingSize`    | `'base'`        | `'xs'`,`'sm'`,`'base'`,`'lg'`,`'xl'` |
| `value`         | `number`            | `0`           |                            |
| `max`           | `number`            | `5`           |                            |
| `halfIncrement` | `boolean`           | `false`       |                            |
:::

::: slot source
<SourceCode>
<!-- vue -->
<<<../../../packages/sfui/frameworks/vue/components/SfRating/SfRating.vue
<!-- end vue -->
<!-- react -->
<<< ../../../packages/sfui/frameworks/react/components/SfRating/SfRating.tsx
<!-- end react -->
</SourceCode>
:::

license: MIT

repository: vuestorefront/storefront-ui

gha_language: TypeScript

gha_license_id: MIT

repo_name: vuestorefront/storefront-ui


text:
---
uuid: 29b36ca0-0285-11e7-b031-b5bb6c0877a6
title: The Cuban Twitter Scandal
hide_title: false
description: How Washington and its Allies Use Social Media to Topple Governments & Manipulate Public Opinion
hide_date: false
push_update: false
show_update: false
permalink: the-cuban-twitter-scandal
tags: [cuban twitter, daily beast, liz wahl, ukraine, usaid, victoria nuland]
category: []
hash_tag: ''
date: 2014-04-10 19:12:36
links:
links_title:
thumbnail:
video: http://youtu.be/MqUztAX7ozw
featured_image:
enable_parallax:
slideshow:
first_visit:
cookie_name:
feed_title:
feed_description:
hide_from_feed:
show_tags:
custom_js_files:
custom_json_files:
---
On April 2nd  the Associated Press released an report exposing how the U.S. government recently attempted to topple the Cuban government yet again. This time the plot hinged on the creation of a communications network called "ZunZuneo" which was essentially a primitive version of Twitter. The plan, which was cooked up by the US Agency for International Development (USAID) and the U.S. State Department, was to build up a large following of users and then push them towards revolt. The network was built using shell companies and financed through a foreign bank to hide their connection to Washington. The Obama administration defended the program saying that it "had disclosed the initiative to Congress".

Of course we all know that attempting to topple a foreign government is perfectly fine as long as you let congress know a bit in advance.

As shocking and absurd as these revelations may be to the general public, the truth of the matter is that this is just the tip of the iceberg. The U.S. government and its allies have been using the internet as a covert weapon for some time now. Much of the evidence of these activities got mainstream coverage, but the corporate media is very careful not to refer to that evidence in the context of current events.

So let's connect a few dots here.

In 2011 it came to light that the U.S. military had developed a 'sock puppet' software for creating and managing fake online identities. These sock puppet accounts were to be used to spread propaganda on social media sites, forums and blogs. The software which was described as an "online persona management service" allows one soldier to control up to 10 separate identities based all over the world. When this program was exposed the U.S. government claimed that the program was never used on English speaking audiences. Considering that these are the same people who swore up and down that the NSA surveillance program never targeted U.S. citizens, we can take that with a grain of salt, but it's worth noting that they explicitly acknowledged in their statement that the program was intended for covert operations in foreign countries.

A leaked document recently made public by Glenn Greenwald showed that the UK's GCHQ has been running a similar program through a unit called the Joint Threat Research Intelligence Group (or JTRIG). You can download the file that Greenwald leaked here.

According to the documents, JTRIG relies on two primary tactics: (1) the injection of false material onto the internet in order to destroy the reputation of its targets; and (2) the use of social sciences and other techniques to manipulate online discourse and activism towards desired outcomes.

Among the methods promoted in the document were "false flag operations" (posting material to the internet and falsely attributing it to someone else), fake victim blog posts (pretending to be a victim of the individual whose reputation they want to destroy), posting “negative information” on various forums, luring targets into sexual encounters to destroy their reputations (honey-traps), sending emails and text messages to the target's friends, neighbors and coworkers, and “crafting messaging campaigns to go ‘viral’."

The documents placed an emphasis on using online techniques to trigger events in the real world.

Now remember the copy cat Twitter network designed to topple Cuba was put together by USAID. USAID maintains a public front of humanitarian aid and democracy promotion, but the Cuba scandal confirms what many geopolitical analysts have been saying for years: that USAID, like it's sibling The National Endowment for Democracy, is nothing more than a branch of the U.S. intelligence apparatus in disguise.

This confirmation also further exposes Washington's hand in toppling the Ukrainian government earlier this year.

Remember Victoria Nuland, the U.S. State Department diplomat who got caught in a leaked phone call discussing who should and should not be allowed into the new Ukrainian government?

http://www.youtube.com/watch?v=2QxZ8t3V_bk

In December of 2013 that same Victoria Nuland, made a speech at the U.S. - Ukraine Foundation in which she talked about how the U.S. government had invested over 5 billion dollars in Ukraine since 1991 to strengthen democracy.

http://vimeo.com/88290604

She also specifically highlighted the important role the U.S. - Ukraine Foundation played in achieving their objectives.

Her statements taken on their own aren't incriminating,  but if you go to the U.S. - Ukraine foundation's website you'll find that their programs are funded and run by the U.S. State Department and USAID. Remember this  is the same USAID that just got caught attempting to topple Cuba.

USAID's connections to the Ukrainian coup don't end there.

It just so happens that Larry Diamond, the executive producer of the "I am Ukrainian" video that went viral at the height of the crisis in Kiev, isn't just a member of the Council on Foreign Relations and the National Endowment for Democracy, and an advisor for the U.S. State Department, his public profile also mentions that he works for USAID.

That's interesting. Let's connect the dots a bit more shall we?

Remember that drama in March where Lis Wahl quit RT News on air in protest over their coverage of the events in Ukraine? It created quite the stir, even among activists that are usually critical of U.S. foreign policy.

http://www.youtube.com/watch?feature=player_embedded&v=2h79v9uirLY

That event was staged. A neo-con think tank called the Foreign Policy Initiative knew the stunt was about to happen and began tweeting out hints twenty minutes in advance.

The first tweet:
“#WordOnTheStreet says that something big might happen on RT in about 20-25 minutes.”

Then, 10 minutes before Wahl would quit on air they tweeted:
“#WordOnTheStreet says you’re really going to want to tune in to RT: http://rt.com/on-air/rt-america-air/ #SomethinBigMayBeGoingDown”

And finally, at 5:26 p.m., at the very moment Wahl quit, the Foreign Policy Initiative's Twitter account broke the news: "RT Anchor RESIGNS ON AIR. She ‘cannot be part of a network that whitewashes the actions of Putin.’ "

Remember our friend Victoria Nuland? It just so happens that her husband, Robert Kagan, sits on the board of directors for the Foreign Policy Initiative. Wow, what a coincidence. An organization that Victoria Nuland's husband controls launches a smear campaign against RT at a time when RT is one of the few major outlets broadcasting her  leaked audio.

Robert Kagan also serves on the U.S. State Department's Foreign Affairs Policy Board and he co-founded the Project for the New American Century (PNAC) with William Kristol, who also sits on the board of the Foreign Policy Initiative. Do a little research into the Project For a New American Century if you want to really dig up some interesting connections.

All just coincidences.

I'm sure it's also just a coincidence that James Kirchick, who happens to be a member of the Foreign Policy Initiative, released an exclusive interview with Lis Wahl on the DailyBeast just one hour after her choreographed stunt.

Here's James and Lis posing together in a "freedom selfie".

The Liz Wahl stunt was a fairly benign example of social media being used to manipulate public opinion. To really understand how far these kinds of psychological operations are taken we need to step back to February 20th when a video went viral showing snipers shooting protesters in Kiev.

Almost everyone assumed that these were Ukrainian government forces firing the shots, but they weren't. The following phone conversation between EU foreign policy chief Cathy Ashton and Estonia's foreign minister Urmas Paet, which was leaked to the public on March 5th, makes this very clear.

The short version of the leaked call:

Urmas Paet: "All the evidence shows that the people who were killed by snipers from both sides, among police men and people in the street, that they were the same snipers killing people from both sides."

Cathy Ashton: "Well that's, yeah..."

Urmas Paet: "And she also showed me some photos and she said that has medical doctor, she can say that it is the same handwriting..."

Cathy Ashton: "Yeah..."

Urmas Paet: "Same type of bullets... and it's really disturbing that now the new coalition, that they don't want to investigate what exactly happened. So that there is now stronger and stronger understanding that behind the snipers, it was not Yanukovich, but it was somebody from the new coalition."

The long version of the leaked call:

It doesn't a rocket scientist to figure out that the only parties who would benefit from shooting both police and protesters at the same time are those who were working to topple the Ukrainian government.

That much is obvious.

The only real question here is whether the footage of the shootings in Kiev was filmed and released by the perpetrators themselves. We'll never know for sure unless there's a real investigation, and no, having the primary suspect run an investigation doesn't count.

We saw this same tactic of killing civilians, and using a coordinated social media campaign to pin the blame on a government targeted for regime change, in Syria in 2013.

http://www.youtube.com/watch?v=LBsW342pMKM

These were U.S. backed rebels that killed thousands of innocent civilians with nerve gas. Those that funded this atrocity are still walking free. Those who coordinated the sniper killings in Kiev are still walking free, and the mainstream media, and these so called   world leaders don't even so much as call them out.

Think about that.

http://www.youtube.com/watch?v=dkamZg68jpk

http://youtu.be/fWkfpGCAAuw

Front groups, sock puppets, public relations stunts, and outright murder. That's how Washington and its allies topple governments and manipulate public opinion in the age of the internet, but make no mistake this is not new.

http://www.youtube.com/watch?v=cDCfTIapds0

repository: ParadigmfortheNextGeneration/hexo

repo_name: ParadigmfortheNextGeneration/hexo


text:
# Django-Rest-User-Onboarding
_Using [Dj-Rest-Auth](https://github.com/jazzband/dj-rest-auth) and [Django-All-Auth](https://github.com/pennersr/django-allauth)_

A Django web application to search YouTube API. The web application has a search box where user can input search text and a search button to click afterwards to initiate the search. When the button is clicked and the search query is submitted then it leads the user to a page displaying the results of the search.

## How to Set up

### Prerequisite
For this repository code to work you will need the following tools/softwares installed.
- *Python 3.6+ (Download [here](https://www.python.org/downloads/), instructions [here](https://realpython.com/installing-python/))
- *pip (Set up instructions [here](https://www.liquidweb.com/kb/install-pip-windows/) or [here](https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line))
- Git (Download [here](https://git-scm.com/downloads))
- virtualenv (Set up instructions [here](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments))

*__Note__: the __\*\__ indicates the tool/software is required!.*

### Set up steps
To set up the project from scratch [here](https://github.com/Semicolon-Tech/django-rest-user-onboarding/blob/master/READMORE.MD) is a walk through on how to do so. The following steps shows how to set up the code in this repo locally on your PC.

1. Open your CLI (Terminal for linux users and Command prompt for windows users)
2. Navigate to your __workspace_folder__ using the `cd` command.
3. If you have Git installed simply type the following commands (for both windows and linux users)
```
    git clone https://github.com/Semicolon-Tech/django-rest-user-onboarding
    cd django-rest-user-onboarding
```

For those that don't have git pre-installed simply click the code button above and click __Download ZIP__. Once the Zip file download is complete, extract the contents to the __workspace_folder__. You should rename the directory named __django-rest-user-onboarding-master__ which you should rename to __django-rest-user-onboarding__.

4. This step is optional but __advised__. Set up your __virtualenv__ and __activate__ it by running the following commands
    - #### Windows Users
    ```
        virtualenv venv
        venv\Scripts\activate
    ```

    - #### Linux Users
    ```
        virtualenv venv
        source venv/bin/activate
    ```

Once that is done your next terminal prompt will be prefixed with this __(venv)__. For example,
```
    C:\Users\christian\Desktop\youtube-api-search>
```
will become
```
    (venv) C:\Users\christian\Desktop\youtube-api-search>
```

By the way, the name __venv__ can be changed to a different word/name but we will be using __venv__ in this setup instructions.

5. Upgrade your pip by typing the following command
```
    python -m pip install pip --upgrade
```

6. Install all python modules in requirements.txt file by typing the following file
```
    pip install -r requirements.txt
```

7. Set up the models and database (using SQLite locally)
```
    python manage.py migrate
```

8. Create super user credentials
```
    python manage.py createsuperuser
```

Fill the required fields when the prompt comes up.

9. Once all packages have been successfully installed run the following command
```
    python manage.py runserver
```
it will output a url looking like this `http://<IP_ADDRESS>:8000`, visit the url to interact with the application

__Note__: you can find all the API endpoints in the [urls.py]() files. You can also visit `http://<IP_ADDRESS>:8000/admin` to see the admin dashboard.

## References
1. [Python 3 Installation & Setup Guide](https://realpython.com/installing-python/)
2. [How to Install PIP on Windows](https://www.liquidweb.com/kb/install-pip-windows/)
3. [Installing Packages (in python)](https://packaging.python.org/tutorials/installing-packages/)
4. [Dj-Rest-Auth](https://github.com/jazzband/dj-rest-auth)
5. [Django-All-Auth](https://github.com/pennersr/django-allauth)


text:
# Car Ads - A REST repo for storing car adverts

### About Git

To make writing commit messages easier, please read the first line prepended with *After this commit...*, e.g. for a message as *Adverts repo allows creation* should be read as *After this commit, adverts repo allows creation*.

Naturally this only applies to the title, not the extended description, if any.

### Configuring the project

##### Scala, SBT, Activator

The project has been created using TypeSafe Activator with version _sbt launcher version 0.13.8_. It uses Play 2.4 and Scala 2.11.

##### MySQL

For the first version of the project, a JDBC-based storage has been chosen. MySQL seems to have good support (attempts to use SQLite were not very promising). Configuring it involves:

 1. Install MySQL 5.6
 2. Run the script `setup.sql` with the MySQL root user: `mysql -u root -p$MYSQL_ROOT_PWD < setup.sql`

It will create a user `carads` with access to the database `carads`, and then source the script `schema.sql`, which creates the required tables.

Note: Being completely new to Scala and Play, choosing something I knew for the storage seemed like the best choice. Nevertheless, the application design allows to easily switch the persistent repository implementation.

### Model

##### Advert

Abstract class with the following parameters:

* **id** (_required_): **int** or **guid**, choose whatever is more convenient for you;
* **title** (_required_): **string**, e.g. _"Audi A4 Avant"_
* **fuel** (_required_): **fuel**
* **price** (_required_): **integer**
* **new** (_required_): **boolean**, indicates if car is new or used
* **mileage** (_optional_): **integer**
* **first registration** (_optional_): **date** without time.

The following classes extend it:

* **AdvertForUsed**: forces to pass a **mileage** and **first registration** in addition to the *Advert* required fields.
* **AdvertForNew**: doesn't allow a **mileage** and **first registration** to be passed, initialising them as *None* instead.

Scala seems to have multiple choices when it comes to model something like this. When in doubt, favor *composition over inheritance*, except for real hierarchies. This one seems to be one.

Without having further experience with the language, seems to me that the chosen approach is the most flexible one - a top level abstract class that has all the properties, wrapped by an *Option* when required, extended by case classes that forces the option properties to be present or not.

This way, most of the code can deal with the top level class without worrying about its implementation details.

##### Fuel

Abstract class with no parameters and the following case objects extending it:

* **Gasoline**
* **Diesel**

Note: Both *enumeration* and *case classes* where considered for Fuel. Seems that [enumeration has more problems](http://underscore.io/blog/posts/2014/09/03/enumerations.html), but case classes with no parameters are deprecated. Using *case objects* seems like [a good compromise](http://www.quora.com/Whats-the-difference-between-case-class-and-case-object-in-Scala) instead.

Switching between one or the other doesn't look very painful though (see [this SO answer](http://stackoverflow.com/questions/1898932/case-objects-vs-enumerations-in-scala#answer-1899887) for some *case class ala enum* helper methods).

### REST interface

The REST API is based on the resource advert, available as as the root of the context path (`BASE_URL/advert`). It uses the appropriate HTTP verbs depending on the operation type and its safeness and idempotency. Thus, `GET` is used for show and list, whereas `POST` is reserved for creations, `PUT` for updates and `DELETE` for deletions.

When an `id` needs to be specified, it must be appended to the resource URL. Adverts are represented as `JSON` both in responses and request bodies (`PATCH` is not implemented, so updates must fully include the resource). Other parameters, such as `sortBy` to specify a sorting criteria when listing, must be included in the query string (other possibilities such as headers seemed less appropriate).

##### Swagger spec

The REST API is described in detail using  [Swagger](http://swagger.io). The source in YAML format is part of the project with the name `swagger.yaml`. It can be examined in a developer's friendly GUI using the [Swagger UI](http://petstore.swagger.io/?url=https://carads-repo.herokuapp.com/assets/swagger.yaml), or copy-pasted to the [Swagger editor](http://editor.swagger.io/) for assisted edition.

### Tests

##### Unit / Integration

Due to the limited amount of time, tests are not as comprehensive as they should. There are 3 parts being tested:

 - JSON parsing and serialisation (through `AdvertsFormatterSpec`).
 - Adverts storage and retrieval (through `AdvertsRepositorySpec`).
 - REST API (through `AdvertsRestSpec`).

The first two are unit tests in the sense that they don't interact with other parts of the application - they only do so with third party components like JDBC drivers or JSON libs, which we assume correct.

The latter is more an integration test, though it focuses on the HTTP part (correct response bodies and status, etc). Still, it uses the previous 2 components and depends on them being correct. Mocking them would be more correct, but due to the lack of experience in the framework it has being discarded for the time being.

##### Functional

A next step would be to create pure functional tests. An idea for that would be to create a separate project that leverages the [Swagger ability to generate client-side code](http://swagger.io/swagger-codegen/).

This external project would use that client code to operate against a test environment. That way, both the application and the Swagger spec would be tested, ensuring one corresponds to the other accurately.

One clear benefit is that the tests would have to be truly functional. In addition to that, the technology could be other than the one used for the server (Gradle + Spock + generated client using Retrofit is my current favourite).

Another benefit would be that the client could be distributed to API consumers with the certainty that it works as expected.

##### Postman

A [Postman](https://www.getpostman.com/) collection (with the corresponding environment) is available in the `postman` directory. Is not really a test, but more a utility for the developer to quickly test the existing APIs.

Still, if the whole collection is ran in the defined order ([newman](https://github.com/postmanlabs/newman) is ideal for that) against a clean database it tests some aspects of the API, and invokes all existing operations

### Deployment

##### Preproduction

A deployed version is available in [Car Ads on Heroku](https://carads-repo.herokuapp.com), using the free tier (only suitable for pet projects). Only Git is needed for the deployment, and of course, the appropriate Heroku permissions, MySQL ad-on and config variables.

repository: deigote/carads

repo_name: deigote/carads


text:
---
title: "UDP client"
linkTitle: "UDP client"
weight: 4
description: >
  A basic, stand-alone UDP client is included in Butler.
---

Butler includes a very basic UDP client, which can be used to send test messages to Butler's UDP servers.
This can be useful when debugging a Butler server, when adding new UDP handlers etc.
The client is built using node.js, and is found in the src/udp_client directory.

Run the app to show its help text (in this case the UDP client is executed on a Mac):

    $ node udp_client.js
    Usage: node udp_client.js [options]

    This app sends messages to the UDP server(s) built into Butler (or any other UDP
    server)

    Options:
      --version   Show version number                                      [boolean]
      -i, --ip    IP address of UDP server message will be sent to        [required]
      -p, --port  Port on UDP server                                      [required]
      -m, --msg   Message to send                          [default: "Test message"]
      -h, --help  Show help                                                [boolean]

    Missing required arguments: i, p
    $

## Testing the session start/stop, connection open/close UDP server

Sending a message to Butler looks like this (with a fake IP address):

    $ node udp_client.js --ip <IP_ADDRESS> -p 9997 -m "Abc;123;456;test"
    UDP message sent to <IP_ADDRESS>:9997, 16 bytes.
    $

Butler will receive the message, parse it, and
a) send a message to a Slack channel (customizable in the [Butler config file](/docs/getting-started/setup/config_file_syntax/)), and
b) publish a MQTT message to the topic specified in, again, the Butler config file.

The output to Slack looks like this (the default use of port 9997 is to handle audit events, i.e. users starting/ending sessions etc):

![alt text](slack_audit_event_test_1.jpg "Slack audit event test")

## Testing the failed task UDP server

Sending a message to port 9998 will test the UDP server responsible for handling task failure messages:

Sending a message to Butler looks like this (with a fake IP address):

    $ node udp_client.js --ip <IP_ADDRESS> -p 9998 -m "Abc;123;456;test"
    UDP message sent to <IP_ADDRESS>:9998, 16 bytes.
    $

The resulting Slack message looks like this:

![alt text](slack_failed_task_1.jpg "Slack failed task")

repository: daudballing/butler-docs

repo_name: daudballing/butler-docs


text:
About {#mainpage}
=================

For more information on MNE-CPP please visit https://mne-cpp.github.io/.

A guide on how to integrate this documentation into the QtCreator can be found [here](https://mne-cpp.github.io/pages/contribute/conv_style.html).

repository: mne-tools/mne-cpp

branch_name: refs/heads/main

repo_name: mne-tools/mne-cpp


text:
# Unsupervised machine learning of topological phase transitionsfrom experimental data
This repository contains the notebooks and scripts to reconstruct the results in our paper https://arxiv.org/abs/2101.05712.

# Where to get the data
We provide access to the data via zenodo 10.5281/zenodo.4459311. You can download the zip archieve there and unzip it. It will contain the data.

# Structure
**.**: The root folder contains the notebooks for the different figures. In general they can be run individually. If you want to use them to experiment or for your own data you need to run them according to their order in the paper.

**data**: The data folder contains the data. This folder needs to be extracted from the zip archive we provide via zenodo 10.5281/zenodo.4459311. You'll find 7 hdf5 files there. They contain the image pixel data and the experimental parameters. See the notebooks for details. We provide the raw dataset cropped to 56x56 pixels which restricts us to data of the first BZ. The files with the rephased postfix correspond to the data which is rephased to a fixed micromotion phase by our VAE.
* phase_diagram_56.h5 The original data of the complete phase diagram cropped to 56x56px.
* phase_diagram_rephased.h5 The rephased data to a micromotion phase of 0 of the phase_diagram_56.h5 data.
* phase_diagram_theory.h5 The theory prediction for the complete Haldane phase diagram
* single_cut_56.h5 The original data of a single cut fur the fixed shaking phase of -90°
* single_cut_rephased.h5 The rephased data to a micromotion phase of 0 of the single_cut_56.h5 data.
* validation_single_cut_56.h5 A validation data set for a shaking phase of -90°. We use it to validate the micromotion removal with influence functions.
* validation_single_cut_rephased.h5  The rephased data to a micromotion phase of 0 of the validation_single_cut_data_56.h5 data.

**networks**: We provide our trained networks here.

**lib**: We save our helper files there.

gha_language: Jupyter Notebook


text:
---
layout: post
title:  "Inkantation"
description: "3D physics-based casual puzzle game where players control a squid that can stick to walls in order to navigate through levels, collect the objective, and escape without being seen."
date:   2019-11-01 11:15:33 -0400
tags: [Illustrator, Maya, Unity, C#]
categories:  projects
category: Class
banner_preview: preview-ink.png
banner_image: banner-wip.png
---

This project was completed in 5 weeks by a team of 5 people. For this project I was primarily focused 3D modeling and rigging of a Squid mode.

Rigging a eight tentacled squid to ragdoll proved challenging given our limited timeframe. To combat this, I shortened the tentacles into little nubs and used sphere colliders to smooth out the physics calculations.

<!--more-->

![title]({{site.url}}/media/class/Ink/INKANTATION.png)

For this project I also developed the world space UI. We added the main, settings, and credits to different parts of the starting room and then animated the camera between those views for a dynamic menu system.

## Screenshots

![Screenshot1]({{site.url}}/media/class/Ink/Screenshot1.PNG)
![Screenshot2]({{site.url}}/media/class/Ink/Screenshot2.PNG)
![Screenshot3]({{site.url}}/media/class/Ink/Screenshot3.PNG)
![Screenshot4]({{site.url}}/media/class/Ink/Screenshot4.PNG)
![Screenshot5]({{site.url}}/media/class/Ink/Screenshot5.PNG)

extension: markdown

gha_language: JavaScript


text:
---
layout: default
title: "Applications Open!"
---

Need financial aid? Have a 3.0+ GPA or 1250+ SAT or 28+ ACT? How does receiving up to **$32,500 over 4 years** sound?

We are now accepting applications for the Fall 2020 Community Engaged Scholars in Computer Science scholarship program at the University of San Francisco. For full consideration, applications are due on **Friday April 10, 2020**.

For full details, see [What's Included](/scholarships/included.html) with the scholarships, the [Eligibility](/scholarships/eligibility.html) requirements to receive and continue funding, and [How to Apply](/scholarships/apply.html) for the 2020 scholarship program.

We are also hosting two **live webinars** to answer your questions about the scholarship program:

  - Monday, March 30, 2020 from 5:00pm -- 7:00pm PT
  - Monday, April 6, 2020 from 5:00pm -- 7:00pm PT

You are welcome to join the webinar anytime between 5:00pm -- 7:00pm PT on either of those days. Register now to receive reminders!

[ Register Now](https://usfca.zoom.us/webinar/register/WN_a2YXki29R864Mz9gZjm49w)
{: .button .is-primary .inherit}

gha_language: Sass


text:
# OTP Crack: Crib Drag Calculator

One-Time Pad (OTP) is an encryption technique that cannot be cracked, but requires the use of a one-time pre-shared key.

So what if we use same key to encrypt two message? The ans is we can decrypte them by using Crib Drag method without the shared key. You can read this  blogs for more details:

## Getting Started

Go to this  website

## Running the tests

You can try this with the following example, they are encrypted with same OTP key.

cipher-text1: "3b101c091d53320c000910"

cipher-text2: "071d154502010a04000419"

## License

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

repository: lotusfa/Crib-Drag-Calculator

gha_language: HTML

repo_name: lotusfa/Crib-Drag-Calculator


text:
# Entomophthora weberi G. Lakon ex Samson, 1979 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Samson, Ramakers & Oswald, Can. J. Bot. 57(12): 1322 (1979)

#### Original name
Entomophthora weberi G. Lakon ex Samson, 1979

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
## 1.0.2

* [@KensoDev] - 2017/01/12 - Adding the `Version` to the `ProxyConfiguration`
  so it will be sent with the json

## 1.0.0

* [@KensoDev] - 2016/01/11 - Multiple big changes
* Added support to Skip the S3 write with the `--disable-upload` flag.
* All documents are now written with the collection prefix after the env prefix. This is now ready to accept a mult-core SOLR installation
* Some code refactoring

At this point, this has been running in production for over a year with zero issues

## 0.5.0

* [@KensoDev] - 2015/06/30 - Added a complete docker workflow
  * `/proxy/configuration` will now respond with the configuration JSON so you
  can view the config and make sure it's right.
  * Refactoring

## 0.2.0

* [@KensoDev] - 2015/06/29 - Added the `BucketPrefix` to `AWSConfig`.
  Added release.sh script

## v0.1.0

* [@KensoDev] - 2015/06/29 - First production ready release. Pre stress
  testing.

repository: KensoDev/go-solr-proxy

gha_language: Go

repo_name: KensoDev/go-solr-proxy


text:
# Lessons learned
## Life
- Prioritise.
	- Do the important things first.
		- Define these _important_ things for myself and be clear with what I want to achieve.
- Automate backups.
	- Make sure the backups I've made are actually successful. And I have at least 1 week fresh backup of everything I did.
- Study smart.
	- Ask myself the question of what it is I am trying to solve or understand.
	- Start working to solve the problems before the deadline
		- And __prioritise__.
- Move fast.
	- Ask questions whenever you don’t understand.
	- Don’t sit idly.
- Focus.
	- Focus is the ability to say __no__ to things.
- Write more.
	- Document my thoughts and findings and share it.
	- Research really well the topic you are trying to share.
	- Make sure I don’t repeat what has been said before and if it was.
		- Link to it and make my own observations and conclusions.
- Track my expenses.
- Get into the flow state as early as possible during the day.
- Just being exposed to concepts through videos or tutorials is not going to help me pass interviews.
	- Actually code everything up and implement it.
- Don’t be careless on the exams and when doing exercises.
	- Check back on my work and go through my calculations.
	- It is very easy to miss something.
- Sit up right.
	- My body language dictates how I feel.
	- Sit straight and don’t slouch my back.
- Drink water.
	- Always stay hydrated.
- Pay attention to my health and well being.
	- Do not consume excess sugar.
- Learn by investigation.
	- Rather than by consuming some data points.
	- That is __strive to understand__.
		- Why?
		- And how?
- Use paper.
	- Don’t be full digital and try out my calculations and thinking on paper.
- Read documentation.
	- It saves a lot of time.
- Keep receipts of expensive purchases.
	- You never know what happens and a lot of more expensive items have warranty.
- Specialise.
	- Don’t jump at everything and try to know it all.
	- Be really great at one thing and then you can branch out.
- Check everything once I leave a room.
	- Did I forget anything?
- Learn from my mistakes.
	- Be conscious of mistakes that I have already done.
	- Learn why they happened and do my best to never repeat them again.
- Look at the price of the delivery.
- [Don’t assume it’s difficult until it is](https://news.ycombinator.com/item?id=10872970).
- Simplicity matters.
	- Don't overcomplicate things for no reason.
- Try to avoid confusion as much as possible.
	- Don't use anything only you can understand and release it in the public.
- Ask questions.
	- Asking questions is a a great thing and being stuck on the same problem or being oblivious how to do some thing is not always a great thing.
	- Be wary of how to [ask questions the right way](../research/asking-questions.md) though.
- Be aware of my quirks and ask myself why I have them and why I do what I do.
	- For example I at once had a weird obsession with lowercasing everything just because it `felt` nicer to have everything lowercased.
	- But that is obviously a weird quirk and does no good to anyone including myself.
- What I make doesn't have to be perfect. It's better to make something than nothing at all, and it's better to share things early to get feedback than spending years trying to perfect something.
- I won't be able to do everything. Setting constraints is key. I want my projects to be focused, rather than growing too much in scope and becoming a "catch all".
- Do one thing at a time. Rather than trying to achieve all of my goals at once, it's best focus on completing one thing at a time. Sometimes external pressure can make this hard, but I try to stick to it as much as possible. I've found that it enables me to move way faster.
- Change location.
	- Work from different places.
	- Meet new people.
	- You are not productive staying in the same spot for too long.
- Focus on the foundations fist.
	- Health (Exercise and Nutrition).
	- Good state of mind.
	- And all else will follow.
- Experiment often.
	- Try out any new ideas I have (it is the only way to see if the idea is any good).
- Use my brain. Actually think about the problems I have an things I can do with what I have instead of giving up and resorting to other things or exterior help. Think first.
- Share. Without sharing the things you have made, there's a very slim chance someone will ever see them.

## Programming
- Use switch cases over long ifs.
- It’s a lot easier to actually just use one screen.
	- Much easier to context switch.
- Use version control.
	- And commit my changes
	- It is a pain to reverse and fix things when you don't know where the problem is.
	- Do __atomic__ commits.
- Write proper commit messages.
- Comment over my code!
	- Especially zsh functions, makes things easier to read.
- Run/Right/Fast.
	- Make the code work then make is clean then make it fast (if necessary). Solving the “correct/clean/performant code” problem all at once can be overwhelming. Don’t be overwhelmed. Solve one at a time.
- Reducing the maintenance burden is, for most codebases, the biggest optimization you can do.
	- Of course it's all about striking a balance, but 99% of the time there is a choice between performance and readability, readability is the right answer. Performance should only be chosen if it is absolutely necessary.

## Using Mind maps
- Don’t index information for the sake of indexing.
	- Try to see how this piece of knowledge plays a role in on a more higher level.
- Be smart about how to present information in the mind maps.
	- It should be more of a guide and a glue between different things rather than as a way to dump everything in one single file.

## Productivity
- Just start.
	- Getting distracted is easy but starting is hard.
- Use the right tool for the job.
	- i.e. mind maps are great for visualising things so don't use them to dump things inside to filter for things.
	- I can use simple markdown and text files for that where it is easier to maintain and extend.
- Slow down. Think about the problem. Don't rush things.

## Asking questions
- When posting an error or an issue on some forum or GitHub, give as much information as you can to help debug it.
	- In the case of posting an issue with an Alfred workflow, it is best to link to the workflow you are using and also link what the debugger says when you are running into the issue.

## Design
- Giving users many options is more often a bad idea.
	- Instead give very few options but make each one of them count and stand out.

## Keyboard Maestro
- Minimise inputs to the macros. Sometimes it's possible that the input I need to a macro, I can get from another place.

## Other
- When proposing feature requests, _"for me"_ is never a good argument for a feature request.
	- If I want someone to add a feature to their software, show how it would be useful to lots of users.
- Explicit over implicit is almost always better.


text:
---
metaTitle: "MySQL - Recover from lost root password"
description: "Set root password, enable root user for socket and http access"
---

# Recover from lost root password

## Set root password, enable root user for socket and http access

Solves problem of: access denied for user root using password YES
Stop mySQL:

```sql
sudo systemctl stop mysql

```

Restart mySQL, skipping grant tables:

```sql
sudo mysqld_safe --skip-grant-tables

```

Login:

```sql
mysql -u root

```

In SQL shell, look if users exist:

```sql
select User, password,plugin FROM mysql.user ;

```

Update the users (plugin null enables for all plugins):

```sql
update mysql.user set password=PASSWORD('mypassword'), plugin = NULL WHERE User = 'root';
exit;

```

In Unix shell stop mySQL without grant tables, then restart with grant tables:

```sql
sudo service mysql stop
sudo service mysql start

```

repository: haifenghuang/generate

repo_name: haifenghuang/generate


text:
# RFC: JSONTableLoader

- **Authors**: Ib Green
- **Date**: Jun 2019
- **Status**: Draft

## Abstract

This RFC proposes creating a special JSON Loader for parsing JSON "tables", i.e JSON files that contain arrays of similar objects. In contrast to `JSON.parse()`, this loader would support batched parsing ("streaming"), binary columnar output, and performant operation on a worker.

## Background

This RFC provides appendices with information on "Streaming JSON formats" and "Survey of Prior Art" looking at existing OSS solutions.

### Why JSON.parse is not good enough

In JavaScript, JSON is supported natively through `JSON.parse` (which because it is native function can be expected to perform at least as good as any JS implementation). However there are a number of reasons why you might consider a custom JSON loader:

- **Atomic/No streaming** `JSON.parse` is atomic. It requires a complete string and produces a complete output. It can not work on partial data chunks as they arrive.
- \*Defeats Worker performance gains\*\* - The input to `JSON.parse` is a string (not binary) output is a non-binary and will have to be serialized and deserialized if sent from a worker to the main thread - essentially triggering a new `JSON.parse` on the main thread, more than negating any benefits from moving to a worker.
- **Poor error messages**: `JSON.parse` tends to have unhelpful error messages: `Syntax error at "a"`, with no indication that this is was related to JSON parsing or what line or even position in the file that caused the error.

## Proposals

### Proposal: New `JSONTableLoader` in new<EMAIL_ADDRESS>module

A new JSON loader would be provided by the loaders, tentatively names `JSONTableLoader`.

The new loader would parse tabular data from loaders in a streaming fashion:

```js
import {parse} from<EMAIL_ADDRESS>import {JSONTableLoader} from<EMAIL_ADDRESS>const table = parse(fetch('geo.json'), JSONTableLoader, {jsonpath: "features"});
```

We would also provide a worker loader variant for binary output:

```js
import {parse} from<EMAIL_ADDRESS>import {JSONTableWorkerLoader} from<EMAIL_ADDRESS>const table parse(fetch('geo.json'), JSONTableWorkerLoader, {binary: true, jsonpath: 'features'});
```

Notes:

- The new loader could replace the existing `JSONLoader` loader (and take its name), though perhaps the generic, trivial `JSONLoader` should be kept as a fallback JSON loader (perhaps even moved into core) as it is very small (very low bundle size impact).

### Binary Columnar AsyncIterator output

As for all _table category_ loaders, when called with `parseInBatches`, the `JSONTable*Loader` would return an `AsyncIterator` that yields binary columnar batches, essentially serving up slices of the full JSON-encoded table as the binary data chunks arrive over the network.

```js
import {parseInBatches} from<EMAIL_ADDRESS>import {JSONTableWorkerLoader} from<EMAIL_ADDRESS>const table parseInBatches(fetch('geo.json'), JSONTableWorkerLoader, {binary: true, jsonpath: 'features'});
```

Note that deck.gl is being extended to accept AsyncIterators as `data` props. The `AsyncIterator` returned by `parseInBatches` could be passed directly to deck.gl which would start incrementally rendering the data rows in the json file as they arrive over the wire.

### Proposal: JSONTableLoader Options

- `table`: `auto` - assume the file contains a table of objects with the same "schema". E.g. multiple top level JSON objects (or a top-level array of objects).
- `jsonpath`: `auto` - A JSONPath string. Specifies how to extract the table rows from the JSON payload with one or more wildcard paths (see JSONPath discussion below).

Low-priority

- `lengthPrefixed`: `auto` - Enable support for length prefixed json (we don't need the prefixes, but we'd need to ignore them). `auto` - If the first value in the file is a number, assumes the file is length prefixed and discards every other value assuming it is a number.

## Proposal: Specifying how to extract rows (JSONPath)

For non-trivial JSON formats (i.e. when the top level JSON object is not an array), we need a mechanism for the user to tell the `JSONTableLoader` (through a loader option) how to find the array and extract the individual table rows.

E.g. in the case of geojson, we would be looking for the array in the `features` key (possibly merged with additional arrays in `FeatureCollection` objects).

A (possibly partial) implementation of the `JSONPath` specification seems like a good choice.

```js
import {parse} from<EMAIL_ADDRESS>import {JSONTableLoader} from<EMAIL_ADDRESS>const table parse(fetch('geo.json'), JSONTableLoader, {jsonpath: "features"});
```

JSONPath is inspired by XPath, a specification for how to access tree nodes in XML documents.

- [JSONPath original page?](https://goessner.net/articles/JsonPath/)
- [JSONPath Playground](https://jsonpath.com/)
- [JSONPath Syntax](https://restfulapi.net/json-jsonpath/)

The [JSONStream] module contains a minimal JSONPath implementation, together with some conventions for expressing paths as JavaScript arrays (rather than strings).

Possible alternatives to JSONPath:

- JSON pointers, while well specified/standardized, they do not seem to support wildcarding.
- IBM has developed [jsonata](http://jsonata.org/) which has some proponents

### Proposal (P1): Arrow-like columnar data packing of variable-length data

Arrow supports variable length values, both strings, and binary blobs. It would be good to be able to pack such non-fixed-length values into binary columns according to conventions that would allow them to be parsed on the client side.

Using geojson as a pilot use case:

- feature.coordinates contains nested arrays of coordinates (which are variable length)
- feature.properties can contain strings (which are variable length)

Binary packing of variable length data is a more general topic for the "table loader category", but the geojson pilot use case means that realistically it will be solved as part of this effort.

## Proposal (P2): Support Streaming JSON

As described in the appendices, there are several variants of streaming JSON (they all involve multiple top-level JSON objects, one per "row", rather than wrapping the rows in an array).

This will be easy to support using our own JSON parser, as we can keep just looking for new top-level JSON objects in the stream. However unclear if we have any use cases.

### Proposal (P2): Autodetection of "tabular" JSON

The `JSONTableLoader` would be expected to fail if it could not detect a table.

For data in non-streaming JSON format, the presence of a top-level array will start streaming of objects.

A number of hints can be used to determine if the data is formatted using a streaming JSON format

- if the filename extension is `.jsonl`
- if the MIMETYPE is `application/json-seq`
- if the first value in the file is a number, assume the file is length prefixed.

For embedded arrays, we could look for first array (would cover geojson case), but for more general handling, we'll need a path specifier may need to be supplied (or

## JSON Parser Implementation Thoughts

The implementation needs a JSON parser

- works on binary input (which means it needs to recognize UTF8 character sequences).
- that can accept chunks of input, generate objects and keep the unused bytes until next chunk arrives.
- tokenizes the input bytes
- recognizes the JSON structure and calls callbacks.
- stringifies keys
- does not automatically create JS objects/arrays for unneeded parts
- does not automatically stringify strings/numbers.

### Appendix: Streaming JSON Formats

- Overview of [JSON Streaming Formats](https://en.wikipedia.org/wiki/JSON_streaming) (Wikipedia).

- [Line-delimited JSON](http://jsonlines.org/) (LDJSON) (aka JSON lines) (JSONL).
- [NewLine delimited JSON](https://github.com/ndjson/ndjson-spec)
- [Record separator-delimited JSON](https://tools.ietf.org/html/rfc7464) (IETF RFC 7464) (aka Json Text Sequences).
- Concatenated JSON
- Length-prefixed JSON

### Appendix: MIME Types and File Extensions

Overview of extensions and MIME types defined by JSON and delimited JSON formats.

| Format                          | Extension | MIME Media Type [RFC4288](https://www.ietf.org/rfc/rfc4288.txt) |
| ------------------------------- | --------- | --------------------------------------------------------------- |
| Standard JSON                   | `.json`   | `application/json`                                              |
| Line-delimited JSON             | `.jsonl`  | -                                                               |
| NewLine delimited JSON          | `.ndjson` | `application/x-ndjson`                                          |
| Record separator-delimited JSON | -         | `application/json-seq`                                          |

<EMAIL_ADDRESS>does not currently use or generate MIME types but this would be a natural extension to e.g. the loader selection subsystem.

## Appendix: Prior Art

There are a number of open source modules on that tackle the problem of parsing JSON in a more streaming fashion in JavaScript. To make sure we are not reinventing the wheel.

Some issues with these modules are that they are often

- Focused on Node.js only - Use `Stream`s and more seriously `Buffer` classes.
- Do not provide granular control of object creation.

### jsonstream

Contains a small implementation of JSONPath that is potentially of interest, otherwise relies on `jsonparse`. Stream parts can be replaced with async iterators.

### jsonparse

The underlying `JSONParser` class is a fork of Tim Caswell's [`jsonparse`](https://github.com/creationix/jsonparse) under MIT license, and looks quite usable.

### [oboe](http://oboejs.com/)

A JSON parser with a high-level (JSONPath like API)

Comparison of [DOM vs SAX (Clarinet) vs Oboe APIs](http://oboejs.com/parsers).

- PRO: High level API good for letting app pick "rows" from table.
- CON: Not enough low-level control of object build-up for efficient binary data generation (without incurring excessive temporary object creation).

### [clarinet](https://github.com/dscape/clarinet)

A "sax-style" JSON Parser with a fine grain API:

- PRO: Very fine grain API (see below)
- CON: Builtin Stream (not useful as we want to work on async iterators)
- CON: Uses `Buffer` instead of `ArrayBuffer` (pulls in Node polyfills)

clarinet sample code, illustrating the "sax-like" callbacks

```js
var clarinet = require('clarinet'),
  parser = clarinet.parser();

parser.onerror = function(e) {
  // an error happened. e is the error.
};
parser.onvalue = function(v) {
  // got some value.  v is the value. can be string, double, bool, or null.
};
parser.onopenobject = function(key) {
  // opened an object. key is the first key.
};
parser.onkey = function(key) {
  // got a subsequent key in an object.
};
parser.oncloseobject = function() {
  // closed an object.
};
parser.onopenarray = function() {
  // opened an array.
};
parser.onclosearray = function() {
  // closed an array.
};
parser.onend = function() {
  // parser stream is done, and ready to have more stuff written to it.
};

parser.write('{"foo": "bar"}').close();
```

### [sax](http://www.saxproject.org/)

Not a JSON parser per se, however many of the JavaScript JSON loaders refer to sax, callinh themselves a "sax-style" parser etc.

From the webpage: SAX is the _Simple API for XML_, originally a Java-only API. SAX was the first widely adopted API for XML in Java, and is a “de facto” standard. The current version is SAX 2.0.1, and there are versions for several programming language environments other than Java.

[sax-js](https://github.com/isaacs/sax-js) is a (Node.js-first) JavaScript implementation.

Side Note: We may consider adopting SAX API for a streaming XML / KML parser...

`sax-js` sample code, illustrating the callbacks:

```js
var sax = require('./lib/sax'),
  strict = true, // set to false for html-mode
  parser = sax.parser(strict);

parser.onerror = function(e) {
  // an error happened.
};
parser.ontext = function(t) {
  // got some text.  t is the string of text.
};
parser.onopentag = function(node) {
  // opened a tag.  node has "name" and "attributes"
};
parser.onattribute = function(attr) {
  // an attribute.  attr has "name" and "value"
};
parser.onend = function() {
  // parser stream is done, and ready to have more stuff written to it.
};

parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
```

## Appendix: Full stack approaches

There are several articles worth reading dealing with the problem of loading large JSON/GeoJSON, involving not just loading optimizations but also rendering or server side solutions:

- [Working with large GeoJSON sources in Mapbox GL JS](https://docs.mapbox.com/help/troubleshooting/working-with-large-geojson-data/) some tips for large geojson in mapbox
- [Manage large data files for Mapbox Studio with Tippecanoe](https://docs.mapbox.com/help/troubleshooting/large-data-tippecanoe/) - Off-line "data splitter".

gha_license_id: NOASSERTION


text:
# webppl_repl
An interactive code editor, compiler, and interpreter for WebPPL, with slight modifications from http://webppl.org/


text:
# Apache 2 Setup

Edit the following files via the commands below. Make sure the Directory paths match the path to the root PHP folder.

    sudo vim /etc/apache2/apache2.conf
    sudo vim /etc/apache2/sites-enabled/000-default.conf

If you see '/var/www/' change to '/var/www/html/path/to/php/files', or where ever your root apache files are located. Mine are in '/var/www/html'. After saving the changes, restart apache2 service.

	sudo service apache2 restart

# Slim Framework 3 Skeleton Application

Use this skeleton application to quickly setup and start working on a new Slim Framework 3 application. This application uses the latest Slim 3 with the PHP-View template renderer. It also uses the Monolog logger.

This skeleton application was built for Composer. This makes setting up a new Slim Framework application quick and easy.

## Install the Application

Run this command from the directory in which you want to install your new Slim Framework application.

    php composer.phar create-project slim/slim-skeleton [my-app-name]

Replace `[my-app-name]` with the desired directory name for your new application. You'll want to:

* Point your virtual host document root to your new application's `public/` directory.
* Ensure `logs/` is web writeable.

To run the application in development, you can run these commands

	cd [my-app-name]
	php composer.phar start

Run this command in the application directory to run the test suite

	php composer.phar test

# Adding to the Composer

Your PHP controller files will be using namespaces. These namespaces need to point to the correct file path. Here is a default configuration that must be added to composer.json:

	"autoload": {
	    "psr-4": {
	        "app\\" : "",
	        "App\\" : "src/"
	    }
	}

When you define the namespace,

	namespace app/controller;

the code will find "app\\" in the autoloader object defined above, and mark that as the path to the class object you are defining. If you had a folder structure such as:

	slim-php-app
		-controller
			--LoginController.php
		-src
			--routes.php
		-etc...

Then you would say the namespace is 'app/controller', not 'slim-php-app/controller'. If you changed the autoload to 'slim-php-app\\' THEN you would use the latter definition.

That's it! Now go build something cool.


text:
# Bootstrap boilerplate for Harp

Allows you to generate a Bootstrap enabled website in seconds using [Harp](http://harpjs.com):

- Includes documentation
- Offers theme support that doesn't interfere with Bootstrap updates
- Allows you to easily customize Bootstrap for each individual theme
- Uses Bower to install Bootstrap (and automate updates)
- Supports hosting in a subdirectory using a `baseUrl` variable
- Prevents CSS bloat by allowing you to only include the Bootstrap components that you really need
- Includes a showcase page that allows you to conveniently see what the Bootstrap components look like while your are customizing your Bootstrap styles

## Demo

A clean installation of the boilerplate looks like this: [http://jvandemo.github.io/hb-bootstrap/](http://jvandemo.github.io/hb-bootstrap/)

## Installation

First make sure you have Harp and Bower installed:

```sh
$ sudo npm install -g harp
$ sudo npm install -g bower
```

Then initialize the boilerplate:

```sh
$ harp init -b jvandemo/hb-bootstrap myproject
```

Change the directory to the new `myproject` directory:

```sh
$ cd myproject
```

Download Bootstrap using bower:

```sh
$ bower install
```

Start the harp server from your project directory:

```sh
$ harp server
```

And navigate to `http://localhost:9000` in your browser:

![](http://i.imgur.com/n9bcerv.png)

## Documentation

The documentation is included in the boilerplate for your convenience (at the same time it demonstrates how you can easily create new layouts in your website):

![](http://i.imgur.com/mJTLMQz.png)

## Showcase page

The boilerplate includes a showcase page to easily see what the Bootstrap components look like while your are customizing your Bootstrap styles:

![](http://i.imgur.com/g43CZge.png)

## Changelog

### v0.4.0

- Added support for `baseUrl`

### v0.3.0

- Added documentation as part of boilerplate
- Update README.md

### v0.2.0

- Added support for customizing Bootstrap
- Added two sample themes: default and flat

### v0.1.0

- Initial boilerplate

repository: jvandemo/hb-bootstrap

repo_name: jvandemo/hb-bootstrap


text:
This sample Workflow demos context propagation through a Workflow. Details about context propagation are
available [here](https://docs.temporal.io/docs/go/tracing).

The sample Workflow initializes the client with a context propagator which propagates
specific information in the `context.Context` object across the Workflow. The `context.Context` object is populated
with the information prior to calling `StartWorkflow`. The Workflow demonstrates that the information is available
in the Workflow and any activities executed.

Also, this sample initializes a Jaeger global tracer and pass it to the client. The sample will work without
actual Jaeger instance -- just report every tracer call to the log. To see traces in Jaeger run it with follow command:
```
$ docker run --publish 6831:6831 --publish 16686:16686 jaegertracing/all-in-one:latest
```

Steps to run this sample:
1) You need a Temporal service running. See details README.md.
2) Run
```
go run ctxpropagation/worker/main.go
```
to start worker for `ctxpropagation` Workflow.

3) Run:
```
go run ctxpropagation/starter/main.go
```
to start Workflow.

You should see prints showing the context information available in the workflow and activities.

repository: mfateev/temporal-go-samples

repo_name: mfateev/temporal-go-samples


text:
# Scala.js typings for apollographql__graphql-playground-html

Typings are for version 1.6.29

## Library description:
GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).

|                    |                 |
| ------------------ | :-------------: |
| Full name          | @apollographql/graphql-playground-html |
| Keywords           | - |
| # releases         | 4 |
| # dependents       | 0.0 |
| # downloads        | 8117617.333333333 |
| # stars            | ? |

## Links
- [Homepage](https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-html)
- [Bugs](https://github.com/graphcool/graphql-playground/issues)
- [Repository](https://github.com/graphcool/graphql-playground)
- [Npm](https://www.npmjs.com/package/%40apollographql%2Fgraphql-playground-html)

## Note
This library has been generated from typescript code from first party type definitions.

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

repository: ScalablyTyped/Distribution

repo_name: ScalablyTyped/Distribution


text:
# slacklog-action
An action to post changelog of your commits to the slack channel.

### Workflows config
```$xslt
name: CI
on:
  push:
    branches: [ master ]
jobs:
  build:
    name: Slacklog
    runs-on: ubuntu-latest
    steps:
      - uses: dzheky/slacklog-action@master
        with:
          SLACK_CLIENT_TOKEN: ${{ secrets.SLACK_CLIENT_TOKEN }}
          SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
```

`SLACK_CLIENT_TOKEN` needs to have scope to send messages like: `chat:write`, `chat:write.public`, `groups:write`

repository: Dzheky/slacklog-action

repo_name: Dzheky/slacklog-action


text:
---
title: strings.RuneCount
description: Determines the number of runes in a string.
categories: [functions]
menu:
  docs:
    parent: functions
keywords: [counting, character count, length, rune length, rune count]
signature: ["strings.RuneCount INPUT"]
relatedfuncs: ["len", "countrunes"]
---

In contrast with `strings.CountRunes` function, which strips HTML and whitespace before counting runes, `strings.RuneCount` simply counts all the runes in a string. It relies on the Go [`utf8.RuneCountInString`] function.

```go-html-template
{{ "Hello, 世界" | strings.RuneCount }}
<!-- outputs a content length of 9 runes. -->
```

[`utf8.RuneCount`]: https://golang.org/pkg/unicode/utf8/#RuneCount

repository: bep/hugo

repo_name: bep/hugo


text:
## Test environments

* local OS X install, R 3.6.1 Patched
* ubuntu 14.04 (on travis-ci), R 3.6.1
* win-builder (devel and release)

## R CMD check results

0 errors | 0 warnings | 0 notes

## Reverse dependencies

* I have run R CMD check on the 25 reverse dependencies.
(Summary at <https://github.com/ropensci/vcr/blob/master/revdep/README.md>).

--------

This version adds some major features including supporting http requests that write to disk, ignoring certain requests, and turning vcr completely off during a test suite run.

Thanks very much,
Scott Chamberlain

repository: zachary-foster/vcr

repo_name: zachary-foster/vcr


text:
# KDTree

[![Build Status](https://travis-ci.org/Sciss/KDTree.svg?branch=master)](https://travis-ci.org/Sciss/KDTree)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.sciss/kdtree/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.sciss/kdtree)

## statement

A static spatial index data structure, implemented in Java.

Forked from [here](https://github.com/Jilocasin/nearest-neighbour). The original author is Jilocasin (Daniel Obermeier).
License of fork is original license: Apache 2.0.

What I did is use [sbt]() for building,
move classes into my own package `de.sciss.kdtree` to avoid confusion, and add some optimised special cases
such as 2D float tree. I publish this artifact to Maven Central:

    "de.sciss" % "kdtree" % v

The current version `v` is `"0.1.1"`.

The library requires a JVM 1.8 or newer.

To-do:

- the junit tests somehow don't run through `sbt test`. You can execute them from IntelliJ, for example.

Below is the original 'read-me':

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

Finding the [nearest neighbour](https://en.wikipedia.org/wiki/Nearest_neighbor_search) of a k-dimensional set of
points using an efficient [k-d tree](https://en.wikipedia.org/wiki/K-d_tree) data structure.

## Installation

Just download the repository and include the sources in your project.

## Usage

To search for any nearest neighbours points, you first need to set up a `KdTree` based on a list of `KdPoints`. Both
classes use generics to allow any point data payload. Use `Integer`, `Double` or any other class extending
`java.lang.Number` and implementing the `Comparable` interface.

Start by setting up a list of k-dimensional points:
```java
List<KdPoint<Integer>> points = new ArrayList<>();

points.add(new KdPoint<>(5, 8));
points.add(new KdPoint<>(5, 5));
points.add(new KdPoint<>(9, 1));
```

Now set up a `KdTree` based on those points. Pay attention to the correct dimension value, matching the amount of
individual axis values used when creating the points. For performance reason the number of axis values per point
is not checked during tree creation.

```java
int dimensions = 2;
KdTree<Integer> tree = new KdTree<>(dimensions, points);
```

To calculate the nearest neighbour of an arbitrary point, use a generic ```NNSolver``` for the used axis type.
```java
NNSolver<Integer> solver = new NNSolver<>(tree);

KdPoint<Integer> searchPoint = new KdPoint<>(5, 10);
KdPoint<Integer> nearestOtherPoint = solver.findNearestPoint(searchPoint);

// Returns the point at (5, 8)
```

This library allows nearest neighbour search for arbitrary point instances not used during tree setup, as well as
existing tree points. When providing a point instance included in the tree data, the closest point except the search
point itself will be returned.

```java
KdPoint<Integer> searchPoint = points.get(0);
KdPoint<Integer> nearestOtherPoint = solver.findNearestPoint(searchPoint);

// Returns the nearest point at (5, 5) to this instance,
// instead of the point instance at (5, 8) we used to search.
// When provided a new point instance at (5, 8) instead,
// the closest point would be the original point at (5, 8).
```

You should always use a `NNSolverOrchestrator` to get the best performance. It will distribute the workload to a
given number of threads.

Using an orchestrator is just as easy:

```java
int workerThreadsCount = Runtime.getRuntime().availableProcessors();

List<KdPoint<Integer>> searchPoints = new ArrayList<>();
searchPoints.add(new KdPoint<>(1, 1));
searchPoints.add(new KdPoint<>(7, 7));

NNSolverOrchestrator<Integer> solverOrchestrator = new NNSolverOrchestrator<>(tree, workerThreadsCount);

List<KdPoint<Integer>> nearestPoints = solverOrchestrator.findNearestPoints(searchPoints);
```

Note that the orchestrator simply returns a new list of points. The index of each result point corresponds to the
index of the provided search points. So, the nearest point for the first search point will be returned at
`nearestPoints.get(0)` etc.

repository: Sciss/KDTree

repo_name: Sciss/KDTree


text:
---
title: "Tropical House"
date: 2020-09-29T15:55:48+10:00
hero: /images/corrugated-leaf.jpg
author: "Gabriel Furber"
excerpt: "Meaningless sensory delight?"
draft: false
---

Tropical House is a genre that you may not know the name of, but if you were listening to the radio sometime between 2013 and 2016 (Turner, 2016), you're certainly familiar with the sound - a slower, chiller, house beat with more bright synths, washy reverb, and perhaps most importantly, steel drums. Well, synthesized ones at least. The song structure also leans away from the repetition typical of house, towards a poppier verse-chorus structure.
These elements, along with the hazy, summery production, more cheerful chords, and marimbas, define the sonic character.

Here's what I'm talking about:

{{< rawhtml >}}
<iframe
	frameborder="0"
	scrolling="no"
	marginheight="0"
	marginwidth="0"
	width="788.54"
	height="443"
	type="text/html"
	src="https://www.youtube.com/embed/VvdhCmeFQfU?autoplay=0&fs=0&iv_load_policy=3&showinfo=0&rel=0&cc_load_policy=0&start=0&end=0">
</iframe>
{{< /rawhtml >}}

## So where did it come from?
The sonic roots of the genre are in Deep and Melodic House (EDM Exclusives, 2014; Turner, 2016), but also in the sound of dancehall (Brown, 2016). This can be most clearly heard  with the Dembow rhythm present in some tracks.

Kygo - remixer of the track above - came up with the style when he was experimenting with different sounds in his cold, rainy Norwegian hometown.

>"That rain might definitely be a reason, like when you’re sitting inside and you look out the window and you kind of daydream about being somewhere else" (Orlov, 2016)

A feeling emblematic of the genre.

## Who cares?

Fair question - it's not a mood that appeals to everybody, with some people dismissing the genre as "meaningless and ironic" (Trooper, 2016). Such cheerful music can come off as saccharine, or inauthentic. Both Kygo and Thomas Jack - another pioneer of the genre - have expressed their desire to move on. (Orlov, 2016; Turner, 2016)

It clearly has some appeal however, since Kygo was the fastest artist to pass 1 billion Spotify streams (Barshad, 2016; Turner, 2016). Besides, it never took itself that seriously anyway. The very name of the genre originated as a joke by Thomas Jack (Guarino, 2014).

Personally, I think the meaningless escapism one of it's strongest qualities. It doesn't have to be complex, only to provide good vibes and a danceable beat. Such restrictions mean it may never advance beyond what was in 2016, but when you need to pretend you're relaxing on the beach, Tropical House will be waiting for you, piña colada in hand.

### Bibliography

Barshad, A. (2016, February 19). Billboard Cover: Kygo on His Rise to Fame -- “I Have to Enjoy It While It Lasts.” Billboard. https://www.billboard.com/articles/news/cover-story/6882495/billboard-cover-kygo-rise-fame-dance

Brown, H. (2016, January 27). Rihanna Was Making ‘Tropical House’ Before Justin Bieber — It’s Called Dancehall. Spin. https://www.spin.com/2016/01/rihanna-tropical-house-dancehall-kygo-charlie-puth-justin-bieber-selena-gomez/

EDM Exclusives. (2014, December 3). Kygo – Bringing Tropical House to Center Stage. EDM Exclusives. https://web.archive.org/web/20150104074129/http://edmexclusives.com/2014/12/03/kygo-bringing-tropical-house-to-center-stage/

Guarino, N. (2014, May 19). World Premiere: Thomas Jack Presents Tropical House Vol. 3 Bakermat Guest Mix [Free Download]. This Song Is Sick. https://web.archive.org/web/20160427205149if_/http://thissongissick.com/blog/2014/world-premiere-thomas-jack-tropical-house-vol-3-bakermat/

Orlov, P. (2016, May 26). Kygo on Birth of Tropical House, Billy Joel Fandom. Rolling Stone. https://www.rollingstone.com/music/music-news/kygo-on-birth-of-tropical-house-billy-joel-fandom-184225/

Trooper, J. (2016, April 1). Tropical house is the music of our generation: mindless, meaningless and complacent. The Tab. https://thetab.com/2016/04/01/tropical-house-music-generation-mindless-meaningless-complacent-83294

Turner, D. (2016, December 9). Tropical House Lives On At Electric Zoo. MTV News. http://www.mtv.com/news/2930970/tropical-house-lives-on-at-electric-zoo/

repository: owlsecco/gabefurber

repo_name: owlsecco/gabefurber


text:
# responsive-UX-theme
Responsive UX template-is the modern and responsive html a template. It was developed by means of Responsive framework. The template responds all
the modern of the requirement. In case of creation were used next technologies were used: HTML5, CSS3. Also in it
the responsive grid, css3 animation and many other components are included. It is prepared documentation is qualitative,
which will help you to use it.
# DEMO
http://stas-melnikov.ru/themes/responsive_ux_template
#Help(Donate)
If you liked this theme, please donate to me on PayPal or contact me. Thanks!
#Browsers
IE10+, Opera, Safari, Yandex browser, Chrome, Firefox, Mobile Safari, Android
#License
MIT

repository: DiTso/responsive-UX-theme

repo_name: DiTso/responsive-UX-theme


text:
---
title: "Import WordPress RSS Data into a Glide App."
id: "POST 060"
date: "2019-07-12"
---

As part of my experimentation with Glide Apps (and by extension Google Sheets), I asked myself whether I could bring RSS data into my app. After a cursory Google search, I found that this is possible and very easy.

### IMPORTFEED.

First off, Google Sheets makes it very easy to import RSS data (from any RSS feed) using the [IMPORTFEED](https://support.google.com/docs/answer/3093337?hl=en) formula.

I refer to the Google Sheets documentation which says that the format of the IMPORTFEED formula is as follows:

`IMPORTFEED(url, [query], [headers], [num_items])`

### WordPress RSS.

Self-hosted WordPress sites, by default, provide an RSS feed at the [/feed URL](https://wordpress.org/support/article/wordpress-feeds/). If we were to use the [official WordPress blog](https://wordpress.org/news/) itself as an example you could find the RSS feed at:

`https://wordpress.org/news/feed/`

Based on the IMPORTFEED documentation, I want to request the following:

* url will be https://wordpress.org/news/feed/
* query will not be supplied since I am just looking to get the basic feed
* headers will be set to TRUE since I want the headers to populated as the title row in the spreadsheet
* num_items will be set to 5 since this is an example and I only want to bring in a few items as a test.

With that in mind, as a test, we can create a "News" tab in our Google Sheet. Then in the first cell add the following:

`=IMPORTFEED("https://wordpress.org/news/feed/",,TRUE,5)`

If all is well, you will receive data populated into your Google Sheet!

From there, you can setup your page as is typical in Glide.

repository: nicholaspretorius/npgh

repo_name: nicholaspretorius/npgh