text:
# Search

## Adding a new Search Field

- Add a new entry to the `searchfields` in `config/custom.php`.
- Add the new valuelist to `Term::getValueList()`. Don’t forget the break in the switch construction.
- Add a new case to `AntonObject::scopeDtQuery()`. If it is complicated, use a new scope.

## Create an individual List of available Search Fields

Just create your own `searchfields` array in the `settings`. You can use all lines from the `config/custom.php`.

Grab the full list here: https://kr.anton.ch/admin/searchfields

repository: PascaleSSRQ/anton-documentation

repo_name: PascaleSSRQ/anton-documentation


text:
# oauth-node-example-app

## Setup

```
$ npm install
```

## Usage: index.js

This example demonstrates a basic client using the Authorization Code grant flow.

Edit the following values in `index.js` to match your OAuth App configuration.

 - `clientID`
 - `clientSecret`
 - `callbackURL`
 - `scopes`

Next, run the application.

```
$ node index.js
```

The application will be available at `http://localhost:5050`.

## Usage: pkce.js

This example demonstrates a basic client using the Authorization Code grant flow with [Proof Key for Code Exchange (PKCE)](https://oauth.net/2/pkce/).

Edit the following values in `index.js` to match your OAuth App configuration.

 - `clientID`
 - `callbackURL`
 - `scopes`

Next, run the application.

```
$ node pkce.js
```

The application will be available at `http://localhost:5050`.

license: MIT

repository: Frameio/oauth-node-example-app

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: Frameio/oauth-node-example-app


text:
# Jacobi Solver

<img src="http://appgallery.maxeler.com/v0.1/app/Jacobi%20Solver/icon" alt="Jacobi Solver">

## Description

This App implements a solver for equations of the type Ax=b, where A is constant but where we have a set of possible b. Both the matrix A and the vectors b are randomly generated. This App always runs both the DFE and the CPU implementation and compares respective times taken.

####This App requires [maxpower](https://github.com/maxeler/maxpower) Maxeler standard library.####

## Content

The repo root directory contains the following items:

- APP
- LICENCE.txt

### APP

Directory containing project sources.

### LICENSE.txt

License of the project.

## Information to compile

Ensure the environment variables below are correctly set:
  * `MAXELEROSDIR`
  * `MAXCOMPILERDIR`

To compile the application, run:

    make RUNRULE="<ProfileName>"

If would like to remove the distributed maxfiles before recompiling the application run the following command before compilation:

    make RUNRULE="<ProfileName>" distclean

## Makefile targets

### build

Compiles the application

### clean

Removes results of compilation from build directories

### distclean

Removes all results of comakempilation from build directories, including all maxfiles

Jacobi Solver on [AppGallery](http://appgallery.maxeler.com/)

repository: maxeler/Jacobi-Solver

gha_language: C

repo_name: maxeler/Jacobi-Solver


text:
---
title: "Python Character Analysis"
author: "Eric Peña"
date: 2019-10-03T00:00:00-07:00
description: "Python Character Analysis"
type: non-technical_note
draft: false
---

## Introduction

I have separated my work into sections so ease of flow. All Python code is included in this article. Observations of the data are shown in the histogram and heatmap below.

## Header

The header of my python file gives general information:

```python
Title: Python Character Analysis
Author: Eric Pena
Date: Oct. 2019

Text Source:
Academic Sample
http://www.thegrammarlab.com/?nor-portfolio=1000000-word-sample-corpora
```

## Packages
Below are important packages that I am importing for the program to work properly.

```python
import pandas as pd
import fileinput as fi
import matplotlib.pyplot as plt
import seaborn as sns
import string
```

## User Defined Functions
I have defined several functions used by the \verb|main()| function:

```python
def read(file):
	"""Reads given file and parses characters

	Args:
		file: the text file to be parsed
	Returns:
		charArr: parsed character array
	"""
	return [i for line in fi.input(file) for i in line]

# -------------------------------------------------------------------

def count(array):
	"""Counts characters and creates freq table

	Args:
		array: character array of text
	Returns:
		freq: dictionary that represents freq table
	"""
	return {c: array.count(c) for c in array}

# -------------------------------------------------------------------

def partition2(array):
	"""Works similar to Mathematica's partition function
		but slightly differently. This function will create
		a string that combines each pair of characters in
		order to be hashed through by the count function.

	Args:
		array: this array
	Returns:

	"""
	return [str(array[i]) + str(array[i + 1]) for i in range(len(array) - 1)]
# -------------------------------------------------------------------

def dict_print(d):
	"""Print function specifically for dictionary

	Args:
		d: dictionary
	Returns:
		None: only prints out the contents of the dictionary
	"""
	[print(key[0] + ' --- ' + key[1] + ' :\t' + str(val)) for key, val in d.items()]

# -------------------------------------------------------------------

def to_dataframe(d):
	"""converts the dictionary of transitions to a dataframe from which
		can be turned into a heatmap

	Args:
		d: dictionary
	Returns:
		df: dataframe
	"""
	# :: Create dataframe
	df = pd.DataFrame(columns=('First', 'Second', 'Frequency'))

	# :: Initialize matrix
	alpha = list(string.ascii_letters)[:26]
	alpha.append(' ')
	for i in alpha:
		for j in alpha:
			df = df.append(pd.Series([i, j, 0], index=df.columns), ignore_index=True)

	# :: Pivot our dataframe to make a matrix for heatmap
	df = df.pivot("First", "Second", "Frequency")

	# :: Add relevant frequencies to the matrix
	for k in d:
		df[k[1]][k[0]] = d[k]

	df = df[df.columns].astype(int)

	return df
# -------------------------------------------------------------------

def show_heatmap(df, filename):
	"""Create and plot heatmap of data

	Args:
		df: dataframe of frequencies
	Returns:
		None: Instead will plot a heatmap of the data
	"""
	# :: Creae heatmap and customize
	sns.set()
	ax = sns.heatmap(df, cmap="binary", robust=True, xticklabels=True, yticklabels=True)
	ax.xaxis.set_label_position('top')
	ax.xaxis.set_ticks_position('top')
	ax.spines['top'].set_visible(False)
	ax.tick_params(top=False, left=False)
	ax.xaxis.label.set_color('darkgray')
	ax.yaxis.label.set_color('darkgray')
	ax.tick_params(axis='x', colors='darkgray')
	ax.tick_params(axis='y', colors='darkgray')
	plt.xlabel('Second Letter', fontsize=18)
	plt.ylabel('First Letter', fontsize=18)
	plt.show()

	figure = ax.get_figure()
	figure.savefig(filename, dpi=400)
```

## Main Program
This shows the code for the main program which utilizes the functions above.

```python
def main():
	# ---------------------------MAIN PROGRAM---------------------------
	# :: Reads in text file
	# :: Counts the frequencies
	# :: Data stored in dictionary
	# :: Plots histogram of results

	freq_dict = count(read('text.txt'))
	plt.bar(freq_dict.keys(), freq_dict.values(), color='gray')
	plt.title('Character Histogram')
	plt.xlabel('Characters')
	plt.ylabel('Frequency')
	plt.show()

	# :: Reads in text file
	# :: Partitions in 2-tuples for transitions
	# :: Data stored in dictionary
	# :: Frequencies are printed to console/terminal

	dict_print(count(partition2(read('text.txt'))))

	df = to_dataframe(count(partition2(read('text.txt'))))
	print(df)

	filename = '/Users/ericpena/iCloud/Binghamton_Courses/500_Computational_Tools/HW2/heatmap.png'
	show_heatmap(df, filename)

if __name__ == '__main__':
	main()
```

## Plot of Histogram

![](img_character_analysis/hist.png)
Figure 1 — Histogram that shows frequencies of characters appearing in the text

## Histogram Observations

Here are a few observations about the histogram above:

* $space\ character$: The space character is by far the most frequent. This makes sense since after each word, a space appears
* ${j, z, x, k}$: Characters such as $j$, $z$, $x$, and $k$ are low frequency --- not often present in common words
* $vowels$: It makes sense for the frequency of the vowels to be higher than consonants given how English is structured

## Heatmap of Character Transitions

The heat map below visually represents the frequencies of the transitions $c_i \rightarrow c_{i+1}$ where $c_i$ is the $i^{th}$ character in the supplied text file.

![](img_character_analysis/heatmap.png)
Figure 2 — Heatmap that shows the frequencies of character transitions

#### Heatmap Observations

Here are a few observations about the heatmap above:

* $Common\ Occurences$: Some common occurrences: $t \rightarrow h$, $i \rightarrow n$, $n \rightarrow t$, $r \rightarrow e$, $t \rightarrow i$
* $Spaces$: As expected the row and column of the $space$ is quite active --- this makes sense since all words start and end with a $space$
* $Bare$: It's interesting but not unexpected that the right bottom right is quite bare --- very low frequencies later in the alphabet

## Robustness Parameter

The heatmap above is actually using a `robust=True` parameter that normalizes the frequencies into a small range in order to improve the visualization. This is an improvement over the heatmap with the original frequencies. See below for the difference between the $RAW$ heatmap and the $ROBUST$ heatmap.

repository: ericpena/pena-notes

repo_name: ericpena/pena-notes


text:
# weather-app

Here's the latest addition to the weather apps available in the open source community. It is built using `React.js` and uses `OpenWeatherMap` API to get the weather forecast data.

## Demo
  The project is deployed to github pages. See [Demo](https://pratikju.github.io/weather-app)

## Manual Installation

  Assuming a [Node.js](https://nodejs.org/en/) environment with the latest version installed,
  ```sh
  $ git clone https://github.com/pratikju/weather-app.git
  $ cd weather-app
  $ npm install
  $ npm start
  ```
  Go to `localhost:3000` and you will see the weather of Kolkata, India

## Deploying to github pages

  From project root directory,

  ```sh
  $ npm run deploy
  ```

## Future prospects

  - Improvements in UI for better usability
  - Graphical representation of hourly data
  - Allow user search for weather of a desired location

# License

  MIT, see the [LICENSE](https://github.com/pratikju/weather-app/blob/master/LICENSE)

repository: pratikju/weather-app

repo_name: pratikju/weather-app


text:
---
layout: about
title: about
permalink: /
subtitle: PhD Student in Cognitive Science. Johns Hopkins University.

profile:
  align: right
  image: me.jpg
  image_circular: false # crops the image to make it circular
  address: >

Krieger Hall 119

3400 N Charles St

Baltimore, MD 21218

news: true  # includes a list of news items
selected_papers: false # includes a list of papers marked as "selected={true}"
social: true  # includes social icons at the bottom of the page
---

I am a 4th year PhD student working with Drs. Leyla Isik and Michael Bonner. Broadly, I am interested in visual neuroscience. My PhD work has focused on social vision. In particular, my work has investigated how social visual features are organized in the human brain using fMRI, intracranial recordings, and soon EEG.

Prior to JHU, I attend the University of Tennessee, Knoxville and was then a research assist with Leslie Ungerleider and Maryam Vaziri-Pashkam at NIMH.

In my free time, I enjoy cooking and hiking with my partner and dog. I am also a hobby science fiction enthusiast and have brought that interest to a course that I will be teaching in winter 2023 titled "Cognitive Science Fiction."


text:
---
layout: post
title:  "Meeting Minutes: April 15"
categories: minutes
---

#Forum

##New Cases

- The cases that were purchased prior have come in
- Decided to install new cases this upcoming weekend during the night.

---

#Lightning Talks

##Laser Safety Talk

- Kyle Pedersen described different classifications of lasers.
- Class 2: Completely safe (less than 1 milliwatts)
- Class 3R: Safe when handled carefully (1-5 milliwatts)
- Class 3B: medium range, eyewear is suggested (5 - 499 milliwatts)
- Class 4: dangerous to eye exposure, can burn materials (500+ milliwatts)

##Blueberry Pi Photoelectric Effect

- Graham Northup reset the power regulator of a Rasberry Pi 2 w/ a laser.
- by aiming a laser at the power regulator, the Pi rebooted
- Called a Blueberry Pi since the Raspberry Pi was inside an empty blueberry poptarts box

##7HRL: 7 Hour Rogue-Like

- Many people in COSI participated in a rogue-like competion (5 hours due to a fire alarm) on April 11th
- Consisted of coding for the allotted time and presenting what was created during the hours before.
- Many people presented their games at today's meeting
- Link to people's repos thread on the [COSI subreddit](http://www.reddit.com/r/COSI/comments/32quty/7_hour_roguelike/)

##Let's Encrypt

- A new encryption authority that will be automatic and open
- link: [Let's Encrypt](https://letsencrypt.org/)

##ISTF

- April 6th, a VM was compromised.
- Graham Northup was able to find a SSH worm on this VM and debugged (but didn't run) through it during the talk.

##C Preprocessor

- Ethan Miller described how the preprocessor switches ??!??! with OR operator

---

#Project Updates / Announcements

##Print Update

- You can now reset your password on the print server

##Comm Server: Hal

- Eric Richter will be leaving at the end of the semester, so he is planning on giving a workshop to overview Hal

##C Preprocessor Workshop

- Ethan is planning on running a workshop on C Preprocessor tricks

##Unity 5 Workshop

- Clarkson's IDEA Club is hosting RIT's Steve Maier who is giving a workshop for an introduction to Unity 5
- April 16, 6-9pm, SC166, Free food

---

#After Meeting Slot

- Graham Northup gave a workshop on pointers.

repository: COSI-Lab/meeting-minutes

branch_name: refs/heads/gh-pages

gha_language: HTML

repo_name: COSI-Lab/meeting-minutes


text:
# datacite-jsonapi-annotator

This module contains only one class [JsonApiAnnotator](src/main/java/org/gbif/datacite/jsonapi/annotator/JsonApiAnnotator.java).
That was moved to the separate module because of jsonschema2pojo-maven-plugin requires a standalone dependency to
enable annotating with customAnnotator.
See the plugin configuration in datacite-rest-client-parent pom dependencyManagement section.

JsonApiAnnotator adds some annotation from com.github.jasminb:jsonapi-converter to enable handle generated model as JSON:API.

[Parent](../README.md)

repository: gbif/datacite-rest-client

gha_language: Java

repo_name: gbif/datacite-rest-client


text:
# HTTP service - Response interceptor

The `http:ResponseInterceptor` is used to intercept the response and execute custom logic. A `ResponseInterceptor` is a service object with a remote method called `interceptResponse`, which is executed before dispatching the response to the client. A `ResponseInterceptor` can be created from a service class, which includes the `http:ResponseInterceptor` service type.

This service object can be engaged at the service level by declaring an `http:InterceptableService` object. This accepts an interceptor service object or an array of interceptor service objects as an interceptor pipeline and the interceptors are executed in the order in which they are placed in the pipeline.

Use `ResponseInterceptors` to execute common logic such as logging, header manipulation, state publishing, etc., for all outbound responses.

::: code http_response_interceptor.bal :::

Run the service as follows.

::: out http_response_interceptor.server.out :::

Invoke the service by executing the following cURL command in a new terminal.

::: out http_response_interceptor.client.out :::

>**Tip:** You can invoke the above service via the [Send request/Receive response client](/learn/by-example/http-client-send-request-receive-response/).

## Related links
- [`http` module - API documentation](https://lib.ballerina.io/ballerina/http/latest/)
- [HTTP service response interceptor - Specification](/spec/http/#812-response-interceptor)


text:
---
title: Type inference rules
summary: Part 2 of the type inference series
thumbnail: T
author: asterite
---

Here we'll [continue explaining](/2013/09/23/type-inference-part-1/) how Crystal assigns
types to each variable and expression of your program. This post is a bit long, but in the end
it's just about making Crystal behave in the most intuitive way for the programmer, to make it
behave as similar as possible to Ruby.

We'll start with literals, C functions and some primitives. Then we'll continue with flow
control structures, like ```if```, ```while```, and blocks. Then we'll talk about the special
```NoReturn``` type and type filters.

### Literals

Literals have a type of their own, known by the compiler:

```ruby
true     # Boolean
1        # Int32
"hello"  # String
1.5      # Float64
```

### C functions

When you define a C function you must tell the compiler its types:

```ruby
lib C
  fun sleep(seconds : UInt32) : UInt32
end

sleep(1_u32) # sleep has type UInt32
```

### allocate

The allocate primitive gives you an uninitialized instance of an object:

```ruby
class Foo
  def initialize(@x)
  end
end

Foo.allocate # Foo.allocate has type Foo
```

You don't normally invoke it directly. Instead, you invoke ```new```, which
is automatically generated by the compiler to something like this:

```ruby
class Foo
  def self.new(x)
    foo = allocate
    foo.initialize(x)
    foo
  end

  def initialize(@x)
  end
end

Foo.new(1)
```

A similar primitive is ```Pointer#malloc```, which gives you a typed pointer to a
memory region:

```ruby
Pointer(Int32).malloc(10) # has type Pointer(Int32)
```

### Variables

Next, when you assign an expression to a variable, the variable will be bound to
that expression's type (if the expresision's type changes, so the variable's type
changes).

```ruby
a = 1 # 1 is Int32, so a is Int32
```

The compiler tries to be as smart as possible when you use variables. For example,
you can assign multiple times to a variable:

```ruby
a = 1       # a is Int32
a.abs       # ok, Int32 has a method 'abs'
a = "hello" # a is now String
a.size    # ok, String has a method 'size'
```

To achieve this, the compiler remembers which expression was the last one assigned
to a variable. In the above example, after the first line the compiler knows that
```a``` has type ```Int32```, so a call to ```abs``` is valid. In the third line we assign
a ```String``` to it, so the compiler remembers this and, on the fourth line, it's perfectly
valid to invoke ```size``` on it.

Additionally, the compiler remembers that both an ```Int32``` and a ```String``` were
assigned to ```a```. When generating LLVM code, the compiler will represent ```a```
as a union type that can be Int32 or String. It would be something like this in C:

<pre class="code">
struct Int32OrString {
  int type_id;
  union {
    int int_value;
    string string_value;
  } data;
}
</pre>

This might seem inefficient if we continually assign different types to the same variable.
However, the compiler knows that when you invoked ```abs```, ```a``` was an Int32, so it never
checks the ```type_id``` field: it directly uses the ```int_value``` field. LLVM notices this
and optimizes this out, so in the generated code there will never be a union (the ```type_id```
field is never read).

Going back to Ruby, if you assign a variable multiple times in a row, the last value (and type)
is the one that counts for subsequent calls. Crystal mimics this behaviour. A variable then just
becomes a name for the last expression that we assigned to.

### If

Let's take a piece of Ruby code and analyze it:

```ruby
if some_condition
  a = 1
  a.abs
else
  a = "hello"
  a.size
end
a.size
```

In Ruby, the only line that can fail at runtime is the last one. The first call to ```abs```
will never fail, as an ```Int32``` was assigned to ```a```. The first call to ```size``` will
also never fail, as a ```String``` was assigned to ```a```. However, after the ```if```, ```a``` can
either be an ```Int32``` or a ```String```.

So Crystal tries to keep this intuitive reasoning about ```a```'s type. When a variable is assigned
inside an ```if```'s then or else branch, the compiler knows that it will continue to have that type until the ```if```
ends or until it is assigned a new expression. When an ```if``` ends, the compiler will let ```a```
have the type of the last expressions that it was assigned to in each branch.

The last line in Crystal will give a compiler error: "undefined method 'size' for Int32".
That's because even though ```String``` has a ```size``` method, ```Int32``` doesn't.

In designing the language we had two choices: make the above a compile-time error (like now) or just make
it a runtime error (like in Ruby). We believe it's better to make it a compile-time error. In some
cases you might know better than the compiler and you will be sure that a variable has the type
that you might think. But in some cases the compiler will let you know that you overlooked a case or some
logic, and you'll thank it for that.

The ```if``` has some more cases to take into account. For example, the variable ```a``` might not exist
before the ```if```. In this case, if it's not assigned in one of the branches, at the end of the
```if``` it will also contain the Nil type if it's read:

```ruby
if some_condition
  a = 1
end
a # here a is Int32 or Nil
```

This, again, mimics Ruby's behaviour.

Finally, an ```if```'s type is the union of the last expressions in both branches. If a branch
is missing, it's considered to have a ```Nil``` type.

### While

A ```while``` is in a way similar to an ```if```:

```ruby
a = 1
while some_condition
  a = "hello"
end
a # here a is Int32 or String
```

That's because ```some_condition``` might be falsy the first time.

However, since a ```while``` is a loop there are some more things to consider. For example,
the last expression assigned to a variable inside a ```while``` determines the type of that
variable in the next iteration. In this way, the type at the beginning of the loop
will be a union of the type before the loop and the type after the loop:

```ruby
a = 1
while some_condition
  a           # here a is actually Int32 or String
  a = false   # here a is Bool
  a = "hello" # here a is String
  a.size    # ok, a is String
end
a             # here a is Int32 or String
```

Some other things to consider inside a ```while``` are ```break``` and ```next```. A ```break```
makes the types right before the break add to the type at the exit of the ```while```:

```ruby
a = 1
while some_condition
  a             # here a is Int32 or Bool
  if some_other_condition
    a = "hello" # we break, so at the exit a can also be String
    break
  end
  a = false     # here a is Bool
end
a               # here a is Int32 or String or Bool
```

A ```next``` adds the type to the beginning of the ```while```:

```ruby
a = 1
while some_condition
  a             # here a is Int32 or String or Bool
  if some_other_condition
    a = "hello" # we next, so in the next iteration a can be String
    next
  end
  a = false     # here a is Bool
end
a               # here a is Int32 or String or Bool
```

### Blocks

Blocks are very similar to a ```while```: they can be executed zero or more times. So
the logic for variables' types is very similar to that of a ```while```.

### NoReturn

There's a mysterious type in Crystal called ```NoReturn```. One such example is
C's ```exit``` function:

```ruby
lib C
  fun exit(status : Int32) : NoReturn
end

C.exit(1)    # this is NoReturn
puts "hello" # this will never be executed
```

Another very useful method that is NoReturn is ```raise```: raising an exception.

The type basically means: after this point there's nothing else. Nothing gets returned,
and nothing that comes afterwars is executed (of course, a ```rescue``` will be executed
if there's one surrounding the code, but the normal path won't be executed).

The compiler knows about ```NoReturn```. For example, take a look at the following code:

```ruby
a = some_int
if a == 1
  a = "hello"
  puts a.size # ok
  raise "Boom!"
else
  a = 2
end
a # here a can only be Int32
```

Remember that after an ```if``` a variable's type is the union of the types of
both branches. However, since the first branch ends there, because ```raise``` is ```NoReturn```,
the compiler knows that code after the ```if```, if that branch is taken, will never be
executed. So it can definitely say: ```a``` will only have the type of the ```else```
branch.

The same logic applies when you have ```return```, ```break``` or ```next``` inside an ```if```.

Also, when you define a method whose type is ```NoReturn```, that method is in turn ```NoReturn```:

```ruby
def raise_boom
  raise "Boom!"
end

if some_condition
  a = 1
else
  raise_boom
end
a.abs # ok
```

### Union of NoReturn

Remember that an ```if```'s type is the union of the last expressions of the ```if```'s branches.

What type has the following ```if``` (and consequently the ```a``` variable)?

```ruby
a = if some_condition
      raise "Boom!"
    else
      1
    end
a # a is...?
```

Well, the ```then``` branch is definitely ```NoReturn```. The ```else``` branch is definitely
```Int32```. We could conclude then that ```a``` has type ```NoReturn``` or ```Int32```.
However, ```NoReturn``` means that nothing gets executed afterwards. So ```a``` can only
be ```Int32``` at the end of the previous snippet, and that's how the compiler behaves.

With this we can implement a little method called ```not_nil!```. Here it is:

```ruby
class Object
  def not_nil!
    self
  end
end

class Nil
  def not_nil!
    raise "Nil assertion failed"
  end
end

a = some_condition ? 1 : nil
a.not_nil!.abs # compiles!
```

```a```'s type is ```Int32``` or ```Nil```. One thing that we didn't say yet is that when you
have a union type and you invoke a method on it, and all types respond to that method, the resulting
type is the union of the types of each method.

In this case, ```a.not_nil!``` will have the type ```Int32``` if ```a``` is ```Int32```, or
```NoReturn``` if it's ```Nil``` (because of the ```raise```). Combining these types just
gives ```Int32```, so the above code is perfectly valid. And that's how you can discard ```Nil```
from a variable and turn it into a runtime exception if it turns out to be ```nil```. No special language
construct is needed. All is made with the logic explained so far.

### Type filters

Now, what if we want to execute a method on a variable whose type is ```Int32``` or ```Nil```,
but only if that variable is ```Int32```. If it's ```Nil```, we don't want to do anything.

We can't use ```not_nil!```, because that will raise a runtime exception when nil.

We can define another method, ```try```:

```ruby
class Object
  def try
    yield self
  end
end

class Nil
  def try(&block)
    nil
  end
end

a = some_condition ? 1 : nil
b = a.try &.abs # b is Int32 or Nil
```

(if you are not sure what ```&.abs``` means, [read this](/2013/09/15/to-proc/))

Since doing something depending on whether a value is ```Nil``` or not is so common, Crystal
provides another way to do the above. This was shortly explained
[here](/2013/07/13/null-pointer-exception/), but now we'll explain it
better and combine it with the previous explanations.

If a variable is an ```if```'s condition, the compiler assumes the variable is not ```nil```
inside the ```then``` branch:

```ruby
a = some_condition ? 1 : nil # a is Int32 or Nil
if a
  a.abs                      # a is Int32
end
```

This makes sense: if ```a``` is truthy then it means it is not ```nil```. Not only this,
but the compiler also makes ```a```'s type be that one after the ```if```, combined with
whatever type ```a``` has in the ```else``` branch. For example:

```ruby
a = some_condition ? 1 : nil
if a
  a.abs   # ok, here a is Int32
else
  a = 1   # here a is Int32
end
a.abs     # ok, a can only be Int32 here
```

Just like a programmer expects the above to always work in Ruby (never raise an
"undefined method" error in runtime), so it works in Crystal.

We call the above a "type filter": ```a```'s type got filtered inside the ```if```'s
```then``` branch by removing ```Nil``` from the possible types ```a``` can have.

Another type filter happens when you do ```is_a?```:

```ruby
a = some_condition ? 1 : nil
if a.is_a?(Int32)
  a.abs # ok
end
```

And another type filter happens when you do ```responds_to?```:

```ruby
a = some_condition ? 1 : nil
if a.responds_to?(:abs)
  a.abs # ok
end
```

These are special methods, known by the compiler, and that's why the compiler is
able to filter the types. On the contrary, the method ```nil?``` is not special right now
so the following won't work:

```ruby
a = some_condition ? 1 : nil
if a.nil?
else
  a.abs # should be ok, but now gives error
end
```

We'll probably make ```nil?``` a special method too, so it's more consistent with the
rest of the language and the above works. We'll also probably make the unary ```!``` method
special, not overloadable, so you could do:

```ruby
a = some_condition ? 1 : nil
if !a
else
  a.abs # should be ok, but now gives error
end
```

### Conclusion

In conclusion, as was said in the beginning of this post, we want Crystal to behave
as much as possible as Ruby, and if something is intuitive and makes sense for the programmer
to make the compiler understand it too. For example:

```ruby
def foo(x)
  return unless x

  x.abs # ok
end

a = some_condition ? 1 : nil
b = foo(a)
```

The above shouldn't give you a compile time error. The programmer knows that if ```x```
was ```nil``` inside ```foo```, the method returns. It follows that ```x``` can never be
```nil``` afterwards so it's ok to invoke ```abs``` on it. How does the compiler know this?

Well, first, the compiler rewrites an ```unless``` to an ```if```:

```ruby
def foo(x)
  if x
  else
    return
  end

  x.abs # ok
end
```

Next, inside the ```then``` branch of the ```if``` we know that ```x``` is not ```nil```.
Inside the ```else``` branch the method returns, so we don't care about the type of ```x```
afterwards. So, after the ```if```, ```x``` can only be of type ```Int32```. This is idiomatic
code in Ruby, and so it is in Crystal if we carefully follow the language rules.

We still have to talk about methods and instance variables, but this post is already long
enough so that will have to be explained in a following post. Stay tuned!

repository: crystal-lang/crystal-website

gha_language: SCSS

repo_name: crystal-lang/crystal-website


text:
# ValidatingWebhook for distributedredisclusters

## Prerequisites

Kubernetes with the `admissionregistration.k8s.io/v1beta1` API enabled. Verify that by the following command:
```
kubectl api-versions | grep admissionregistration.k8s.io/v1beta1
```
The result should be:
```
admissionregistration.k8s.io/v1beta1
```

In addition, the `MutatingAdmissionWebhook` and `ValidatingAdmissionWebhook` admission controllers should be added and listed in the correct order in the admission-control flag of kube-apiserver.

## Deploy

1. Create a signed cert/key pair and store it in a Kubernetes `secret` that will be consumed by operator deployment
```
./create-signed-cert.sh --service drc-admission-webhook --secret drc-webhook-cert --namespace default
```

2. Patch the `ValidatingWebhookConfiguration` by set `caBundle` with correct value from Kubernetes cluster
```
cat validatingwebhook.yaml | \
    patch-ca-bundle.sh > \
    validatingwebhook-ca-bundle.yaml
```

3. Deploy resources
```
kubectl delete -f operator.yml
kubectl create -f operator.yml
kubectl create -f validatingwebhook-ca-bundle.yaml
kubectl create -f service.yaml
```

repository: TykTechnologies/redis-cluster-operator

branch_name: refs/heads/main

gha_language: Go

repo_name: TykTechnologies/redis-cluster-operator


text:
##CSS3 / SCSS Advance Exercises.

1. What does SCSS stand for? What's the difference between SCSS and SASS?

2. What are advantages of SCSS over using regular CSS?

3. How to refer parent selector in the SCSS?

4. How to use placeholder selector in SCSS?

5. Describe about Variables in SCSS.

6. Describe about nesting in SCSS.

7. Explain the ```extend``` directive in SCSS with example.

8. Describe about partials and import in SCSS.

9. Describe about Mixins in SCSS.

10. Describe about operators in SCSS.

11. How to start an animation with a delay? Describe with example.

12. How to Use CSS3 Transitions? Describe with example.

13. How to Specify the Speed Curve of CSS Transition.

14. What is Image Sprites? How to use it in application? Describe with example.

15. What is a Media Query? How to add breakpoints? Explain with example.

16. Describe about bootstrap Grid system. Explain with example.


text:
---
layout: page
show_meta: false
title: "Recognition"
subheadline: "Awards and Accolades"
teaser: "Thozhan has been recognized on many occasions for the service rendered to the society. Few of them are:"
header:

permalink: "/recognition/"
---
1. Our founder M. Radhakrishnan was selected as one among the “100 youngsters that Swami Vivekanandha searching for” – a search for promising young change makers organized by Puthiya Thalaimurai Channel.

1. Thozhan was recognized by “India Book of Records” for conducting Traffic Awareness Campaigns in 100 signals across Chennai in same day and same time as “Largest Traffic Awareness Campaign”
1. Received an award from Ma Foi K. Pandiarajan, cabinet minister with portfolios of archaeology, Tamil language and Culture as one of the best NGOs in Tamil Nadu.
1. Honored by Dr. C. Sylendra Babu for our continuous effort in creating awareness on road safety through various initiatives across the state.
1. Our MIME coordinator and physically challenged volunteer Veeramani Sekar was awarded as “Best Social Worker of the Year” by “Kalam Book of Records”
1. Thozhan was acclaimed with “Gandhi Award” by NDSO organization.

Subscribe to our newsletter >

 [1]: {{ site.url }}{{ site.baseurl }}/documentation/


text:
# Using-Eigenvectors-for-Graph-Partition

In this project, I focus on using eigenvectors and K-means clustering method to partition a set of vertices V into k groups 𝑉1, 𝑉2..., 𝑉𝑘 in an undirected graph G = (V, E).

## Getting Started

These introduction will get you a copy of the project up and running on your local machine purposes. See deployment for notes on how to deploy this project on a live system.

### Algorithms

Input graph G, number k

1. Form graph adjacency matrix A
2. Form diagonal matrix D
3. Form normalized Laplacian matrix *L' = I -  D-1/2AD-1/2*
4. Compute the first k eigenvectors u1,...,uk of L'
5. Form matrix U ∈ Rn×k with columns u1,...,uk
6. Normalize U so that rows have norm 1
7. Consider the i-th row of U as point yi ∈ Rk,i=1,...,n
8. Cluster the points {yi}i=1,...,n into clusters C1,...Ck, using k-means clustering

### Prerequisites

* Python3

* numpy

* sklearn

* scipy

### Installing

First install [python3](https://www.python.org/downloads/), then using pip command to download required packages that demonstrate above.

For Example:

```python
pip3 install numpy
```

### Running the project

a. In command line, type this command in the ***code*** directory:

```
python3 graph_partitioning.py
```

b. In pycharm:

Just open this project and configure the running environment as we said above. Then run the ```graph_partitioning.py ``` python file.

You can change the test file by altering the input txt filename in the bottom of ```graph_partitioning.py ```:

```python
if __name__ == '__main__':
    labels = partitioning_1('Oregon-1.txt')
    for i in labels:
        print(i)
        print(len(i))
```

Change **Orgen-1.txt** to other filenames in ***data*** directory.

### Authors

Xiaobo Wu, Aalto University

## License

This project is licensed under the MIT License - see [this page](https://opensource.org/licenses/MIT) for details.

## Acknowledgments

* Konstantin Andreev, Harald Racke. (2006). Balanced Graph Partitioning. Theory

  of Computing Systems.

* Bojan Mohar. The Laplacian Spectrum of Graphs. University of Ljubljna.

* https://www.geeksforgeeks.org/sparse-matrix-representation

* https://en.wikipedia.org/wiki/Laplacian_matrix

* https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors

* https://en.wikipedia.org/wiki/Graph_partition


text:
---
title: Announcing Istio 1.15.3
linktitle: 1.15.3
subtitle: Patch Release
description: Istio 1.15.3 patch release.
publishdate: 2022-10-27
release: 1.15.3
---

This release contains bug fixes to improve robustness. This release note describes what’s different between Istio 1.15.2 and Istio 1.15.3.

{{< relnote >}}

## Changes

- **Updated** the default value for `TRUSTED_GATEWAY_CIDR`. Previously this was empty, which caused the XFCC authenticator to reject non-loopback requests.

- **Added** validation warnings when a `DestinationRule` specifies failover policies but does not provide an outlier detection policy. Previously, istiod was silently ignoring the failover settings.

- **Fixed** an issue causing `kube-inject` to crash when the pod annotation `proxy.istio.io/config` is set.

- **Fixed** an issue with a missing `service_name` in the Telemetry API when configuring a Datadog tracing provider. ([Issue #38573](https://github.com/istio/istio/issues/38573))

- **Fixed** an issue where an incorrect schema configuration caused the Istio Operator to go into an error loop. ([Issue #40876](https://github.com/istio/istio/issues/40876))

- **Fixed** network port forward issue to support IPv4 and IPv6. ([Issue #40605](https://github.com/istio/istio/issues/40605))


text:
It simply
allows use of the [wrapfig][] package so that (specified) figures will have text
wrapped around them.

## Installation

Obviously, the wrapfig package must be installed.

A pandoc template must be used that contains `\usepackage{wrapfig}`. The
included template is the default pandoc LaTeX template with this line added.

## Usage

Simply include ` {x}` at the end of the captions for figures that are to be
wrapped. `x` is a number that specifies the width of the wrap in inches. Setting
it to 0 will cause the width of the figure to be used (as per the wrapfig
package instructions). Figures without the tag will float as usual. Optionally
precede x with a character in the set {l,r,i,o} to set wrapfig's placement
parameter; the default is 'l'. Optionally follow ?  with a '-' and another width
specification to set wrapfig's overhang parameter and push the figure that far
into the margin.

To use a specific length, you may also add `cm`,`pt`or `in` like `{5cm}`.

Also, wrapfig allows optional specification of the "number of narrow lines" that
are aquivalent to height of the image. Though guessed by wrapfig, this sometimes
has to be adjusted. This is possible by adding a second number to the `{}`
argument like: `{5cm,28}`.

Wrapping is specific to pdf/LaTeX output. For other formats, the tag is simply
removed.

### Tufte-latex margin figures

For users of the [tufte-latex](https://ctan.org/pkg/tufte-latex?lang=en)
package, pandoc-wrapfig can produce margin figures with tufte-latex's
marginfigure environment. Example:

```markdown
![Image caption {m0}](image.png)
```

You must have tufte-latex and its dependencies installed and your document class
must of course be set to `tufte-handout` or `tufte-book`.

[pandoc]: http://pandoc.org
[wrapfig]: https://www.ctan.org/pkg/wrapfig?lang=en
[tufte-latex]: https://ctan.org/pkg/tufte-latex?lang=en

repository: scotthartley/pandoc-wrapfig

gha_language: TeX

repo_name: scotthartley/pandoc-wrapfig


text:
## ex3: R Markdown website with subdirectories

This website adds a configuration file, `_repdoc.yml`, to control the
reproducibility settings across the website files. Specifically it sets the
`knit_root_dir`. The R Markdown files are saved in `analysis/`, but the code is
executed in the root of the website directory. It also uses
`devtools::session_info()` instead of `sessionInfo()` by specifying this in
`_repdoc.yml`. Since it is a website, use `rmarkdown::render_site` or the
RStudio Knit button to render the file.

repository: jdblischak/repdoc

repo_name: jdblischak/repdoc


text:
## contentr [![Build Status](https://travis-ci.org/metaminded/contentr.svg?branch=master)](https://travis-ci.org/metaminded/contentr)

## Requirements

* Ruby 2.0.0 or higher
* Rails 4.0.0 or higher
* [Bootstrap from Twitter](http://getbootstrap.com)

## Installation

Add `contentr` to your Gemfile:

```ruby
gem 'contentr', github: 'metaminded/contentr'
```

You'll also want to include `contentr` in your CSS

```css
@import 'contentr';
```

And in your `application.js`

```javascript
//= require contentr/contentr
```

## Usage

You get three new methods which you should override in your user model:

- `allowed_to_interact_with_contentr?`
- `allowed_to_use_paragraphs?`
- `contentr_authorized?`

The `contentr_authorized?` method takes two arguments which are `type` and `object`.
`type` is a symbol and either `:manage` or `:see`. `object` is the object for
which an action needs to be authorized.

The `allowed_to_use_paragraphs?` method is used to determine if a user is
allowed to use paragraphs, depending on multiple arguments. The first argument
is `area`, which is a String  with the name of the name of the effected area.
If the second parameter `subject` is set to a paragraph object
the method should only determine if a user is allowed to use the specified `subject`.

repository: metaminded/contentr

extension: markdown

gha_language: Ruby

repo_name: metaminded/contentr


text:
# Protogen sample project

The main goal of this project is to provide a **reference model** of how to write **maintainable Ansible code**. That includes collections, playbooks, roles, modules, plugins and filters.

By maintainable it means fully testable on **CI/CD pipelines or locally** using the most appropriate testing method like linting, unit, functional, integration.

The project will use the most appropriate test isolation solution for each testing stage: tox for unittests, containers for code that can be tested using a container and, as a last resort, VMs run localy using libvirt or remotely on a cloud.

The project goal is to become a living template or **reference implementation** that can be used by developers for creating new Ansible content or for adopting good practices.

This project will make use of popular testing tools like: [pytest](https://github.com/pytest-dev/pytest), [ansible-lint](https://github.com/ansible/ansible-lint), [molecule](https://github.com/ansible-community/molecule) in order to achieve its goals.

If possible, we would be pleased if this project would become part  of the official Ansible development documentation, which at this point does  not cover some essential cases like: how to write and run unittests for a module inside your collection.

# Joining this community effort

If you have an interest about promoting good coding standards, feel free to [join
our group](https://github.com/ansible-community/protogen/issues/1). Even if you do not
have time to propose new changes, your help as a reviewer would be essential in
order to assure we adopt only the best practices.

# History

The idea to name the project [Protogen](https://expanse.fandom.com/wiki/Protogen) came from the company behind viral protomolecule from [Expanse TV series](https://en.wikipedia.org/wiki/The_Expanse_(TV_series)). Originally, @ssbarnea considered using protomolecule as name of the project because it was aimting to create a prototype example of molecule use.

Even the original slogan **"First. Fastest. Furthest"** does apply very well with the **testing** goal of the project. Mainly the project aims to create a set of testing practices that could get a viral adoption among Ansible universe.

![protogen-logo](https://repository-images.githubusercontent.com/257321711/e95a5600-832d-11ea-8e55-a81114b6c965)

repository: ssbarnea/protogen

repo_name: ssbarnea/protogen


text:
---
layout: post
title: First Post
---
SpikeGadgets is considering of moving over to GitHub. While Bitbucket has worked for us, Github may prove more useful to us in the future. Home to more free and open source projects, users, and features, Github is a larger provider of free and open source software, especially popular amongst researchers. Not only do we currently support Trodes, modules, and export programs, in the future we plan to also provide to our users a networking API, integration with Neuroscience Without Borders, Python libraries, and integration with other popular open source neuroscience tools.

For now, our Github will be used as a base for random libraries and projects, updates on our software, and documentation. Even though both Github and Bitbucket have wiki functionality, they are difficult to use to edit, hard to find, and ugly to look at. Putting it here may be a better alternative. In fact, moving our entire software page here is another idea to consider. Until then...

Coming soon: posts on the newest Trodes release 1.7.2, current projects in our software, and future projects.

<!-- You can write regular [markdown](http://markdowntutorial.com/) here and Jekyll will automatically convert it to a nice webpage.  I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.

**Here is some bold text**

## Here is a secondary heading

Here's a useless table:

| Number | Next number | Previous number |
| :------ |:--- | :--- |
| Five | Six | Four |
| Ten | Eleven | Nine |
| Seven | Eight | Six |
| Two | Three | One |

How about a yummy crepe?

![Crepe](http://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)

Here's a code chunk:

~~~
var foo = function(x) {
  return(x + 5);
}
foo(3)
~~~

And here is the same code with syntax highlighting:

```javascript
var foo = function(x) {
  return(x + 5);
}
foo(3)
```

And here is the same code yet again but with line numbers:

{% highlight javascript linenos %}
var foo = function(x) {
  return(x + 5);
}
foo(3)
{% endhighlight %}

## Boxes
You can add notification, warning and error boxes like this:

### Notification

{: .box-note}
**Note:** This is a notification box.

### Warning

{: .box-warning}
**Warning:** This is a warning box.

### Error

{: .box-error}
**Error:** This is an error box. -->


text:
# 1687. Delivering Boxes from Storage to Ports

Difficulty: Hard

https://leetcode.com/problems/delivering-boxes-from-storage-to-ports/

You have the task of delivering some boxes from storage to their ports using only one ship. However, this ship has a limit on the number of boxes and the total weight that it can carry.

You are given an array boxes, where boxes[i] = [portsi, weighti], and three integers portsCount, maxBoxes, and maxWeight.

* portsi is the port where you need to deliver the ith box and weightsi is the weight of the ith box.
* portsCount is the number of ports.
* maxBoxes and maxWeight are the respective box and weight limits of the ship.

The boxes need to be delivered in the order they are given. The ship will follow these steps:

* The ship will take some number of boxes from the boxes queue, not violating the maxBoxes and maxWeight constraints.
* For each loaded box in order, the ship will make a trip to the port the box needs to be delivered to and deliver it. If the ship is already at the correct port, no trip is needed, and the box can immediately be delivered.
* The ship then makes a return trip to storage to take more boxes from the queue.

The ship must end at storage after all the boxes have been delivered.

Return the minimum number of trips the ship needs to make to deliver all boxes to their respective ports.

**Example 1:**
```
Input: boxes = [[1,1],[2,1],[1,1]], portsCount = 2, maxBoxes = 3, maxWeight = 3
Output: 4
Explanation: The optimal strategy is as follows:
- The ship takes all the boxes in the queue, goes to port 1, then port 2, then port 1 again, then returns to storage. 4 trips.
So the total number of trips is 4.
Note that the first and third boxes cannot be delivered together because the boxes need to be delivered in order (i.e. the second box needs to be delivered at port 2 before the third box).
```

**Example 2:**
```
Input: boxes = [[1,2],[3,3],[3,1],[3,1],[2,4]], portsCount = 3, maxBoxes = 3, maxWeight = 6
Output: 6
Explanation: The optimal strategy is as follows:
- The ship takes the first box, goes to port 1, then returns to storage. 2 trips.
- The ship takes the second, third and fourth boxes, goes to port 3, then returns to storage. 2 trips.
- The ship takes the fifth box, goes to port 3, then returns to storage. 2 trips.
So the total number of trips is 2 + 2 + 2 = 6.
```

**Example 3:**
```
Input: boxes = [[1,4],[1,2],[2,1],[2,1],[3,2],[3,4]], portsCount = 3, maxBoxes = 6, maxWeight = 7
Output: 6
Explanation: The optimal strategy is as follows:
- The ship takes the first and second boxes, goes to port 1, then returns to storage. 2 trips.
- The ship takes the third and fourth boxes, goes to port 2, then returns to storage. 2 trips.
- The ship takes the fifth and sixth boxes, goes to port 3, then returns to storage. 2 trips.
So the total number of trips is 2 + 2 + 2 = 6.
```

**Example 4:**
```
Input: boxes = [[2,4],[2,5],[3,1],[3,2],[3,7],[3,1],[4,4],[1,3],[5,2]], portsCount = 5, maxBoxes = 5, maxWeight = 7
Output: 14
Explanation: The optimal strategy is as follows:
- The ship takes the first box, goes to port 2, then storage. 2 trips.
- The ship takes the second box, goes to port 2, then storage. 2 trips.
- The ship takes the third and fourth boxes, goes to port 3, then storage. 2 trips.
- The ship takes the fifth box, goes to port 3, then storage. 2 trips.
- The ship takes the sixth and seventh boxes, goes to port 3, then port 4, then storage. 3 trips.
- The ship takes the eighth and ninth boxes, goes to port 1, then port 5, then storage. 3 trips.
So the total number of trips is 2 + 2 + 2 + 2 + 3 + 3 = 14.
```

**Constraints:**

* 1 <= boxes.length <= 105
* 1 <= portsCount, maxBoxes, maxWeight <= 105
* 1 <= portsi <= portsCount
* 1 <= weightsi <= maxWeight

url: https://raw.githubusercontent.com/jiadaizhao/LeetCode/4ddea0a532fe7c5d053ffbd6870174ec99fc2d60/1601-1700/1687-Delivering Boxes from Storage to Ports/README.md

repository: jiadaizhao/LeetCode

repo_name: jiadaizhao/LeetCode


text:
#Level2_pdfExample
--
![Screenshot of Example](pdfExample.png)

### Learning Objectives

This openFrameworks Example is designed to demonstrate how to save PDF versions of an OF app output.

In this example, pay attention to the following code:

* ```ofBeginSaveScreenAsPDF(...) ``` outputs PDF file based on the following parameters that are passed through:
  * string filename,
  * bool bMultipage,
  * bool b3D,
  * ofRectangle outputsize
* ```ofEndSaveScreenAsPDF(...) ```

### Expected Behavior

When launching this app, you should see:

* 3 same sized rectangles as image holders; the first image autopopulates with an OF image
* the other two rectangles are areas to drag and drop your own images in
* Counter for the framerate
* Moving box and box trail

Instructions for use:

* Press 'r' to save a multi-page PDF file
* Press 's' to save a one-page, screenshot PDF file
* Drag and drop images into the recetangles with "drop images here" command

### Other classes used in this file

This Example does not use any other classes.

repository: openframeworks/openFrameworks

gha_license_id: NOASSERTION

repo_name: openframeworks/openFrameworks


text:
# Capistrano::Rudy

Notify the telegram bot @RudyIsBot on deploy.

## Installation

Add this line to your application's Gemfile under the 'development' group:

```ruby
gem 'capistrano-rudy'
```

Execute:

```
bundle
```

Add this to `Capfile`:

```ruby
require 'capistrano/rudy'
```

## Usage

Add this to `deploy.rb` or to stage configuration file.

```ruby
set :rudy_token, TOKEN
```

repository: iamdeuterium/capistrano-rudy

repo_name: iamdeuterium/capistrano-rudy


text:
# FunAsync
Fun(tional)Async(hronous) is a Swift project to simplify asynchronous programming but not using iOS 13 only Combine or great but complex RxSwift

## The purpose
1. do **asynchronous** operation by **functional** programming
1. What operations to apply:
  1. Web API query
  1. Notification center
  1. UI components actions

## What it is going to be like
1. Web API query asyncronously with functional
```swift
URLSession.shared.dataTask(urlString: "http://validate.jsontest.com/", params: ["json":"{\"key\":\"value\"}"])
.jsonResponse() // general map for parsing response into JSON
.map(clousre: { (jsonResponse) -> Bool? in // process the JSON dictionary to get the target data
    guard let dict = jsonResponse as? [String:Any] else { return nil }
    return dict["validate"] as? Bool
})
.catchError { (error) in
    // deal with the error
    print(String(describing: error))
}
.observe(on: DispatchQueue.main) // set the target dispatch queue to main queue
.subscribe {
    if let validate = $0, validate {
        print("Yeah")
    }
}
```
1. Wait and receive notification center notifications with functional
```swift
NotificationCenter.default.requestNotification(notification2Receive: "testNotification")
.map { (notification) -> String? in
    guard let userInfo = notification.userInfo else { return nil }
    guard let ret = userInfo["info"] as? String else { return nil }
    return ret
}
.subscribe { (info) in
    guard let info = info else { return }
    print("received info from notification: \(info)")
}
```


text:
---
layout: post
date:	2011-11-19 14:41:00
title:  Puttenahalli Lake Walk, 191111, for some children from Magic Puddles.
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
I've been interested in, and involved with,

 Magic Puddles

a daycare and children's activity centre, for a while now, since I did a project with the children about trees. And having done the

 Puttenahalli Lake Walk

a little while ago, I wanted to take the children there, too; so this morning, Viji and I rounded up some children and off we went!

We started at the Brigade Millenium arch entrance:

And as we went, I pointed out various interesting things to them. Here they are, keenly observing a grasshopper!

The children were full of curiosity...their sentences always seem to end in either question marks or exclamation marks! We were joined by

 Usha Rajagopalan of the Puttenahalli Neighbourhood Lake Improvement Trust

who, with her band of tireless volunteers, has been maintaining the lake...and saving it from almost-certain disaster.

They looked at various insects, trees (that PNLIT has planted, and others, too) and birds...and Usha explained various things about the lake.

She gave each child a pencil to write or sketch with (several of the children were already writing down what they saw, or sketching it!), and I asked everyone to pose for a group photo:

Here are some of the birds we saw:

Coot, Common
Cormorant, Little
Crow, House
Crow, Jungle
Duck, Spot-billed
Egret, Cattle
Egret, Little
Garganey
Heron, Pond
Heron, Purple
Jacana, Pheasant-tailed
Kingfisher, White-breasted
Kite, Common (Pariah)
Moorhen, Purple
Munia, Scaly-breasted
Mynah, Common
Waterhen, White-breasted

Here is the

PURPLE MOORHEN:

and the

PHEASANT-TAILED JACANA:

We wound up with a lovely breakfast of Uthappam and coconut chutney, delicious after the sunny walk!


text:
# How to Contribute

We'd love to accept your contributions to this project. There are just a few small guidelines you need to follow.

## How to add a model into examples

Here are some steps for your reference:

1. **Clone cvpods and cvpods_playground, switch to your own branch:**

   ```shell
   # fork and clone cvpods
   git clone https://github.com/Megvii-BaseDetection/cvpods.git
   git checkout -b [user]

   # cvpods_playground
   cd cvpods/playground
   mkdir [username]
   ```

2. **Add the code for the new model to cvpods:**

   In general, you need to add the code files of the new model to the following two paths:

   1. **backbone:** [`cvpods/modeling/backbone`](https://git-core.megvii-inc.com/zhubenjin/cvpods/tree/megvii/cvpods/modeling/backbone)

      This step is optional because there are already many commonly used [backbones in cvpods]((https://git-core.megvii-inc.com/zhubenjin/cvpods/tree/megvii/cvpods/modeling/backbone)), for example: [ResNeSt](https://git-core.megvii-inc.com/zhubenjin/cvpods/blob/megvii/cvpods/modeling/backbone/resnet.py), [FPN](https://git-core.megvii-inc.com/zhubenjin/cvpods/blob/megvii/cvpods/modeling/backbone/fpn.py).
      When the backbone needed for the new model does not exist, you need to add it.

   2. **meta_arch:** [`cvpods/modeling/meta_arch`](https://git-core.megvii-inc.com/zhubenjin/cvpods/tree/megvii/cvpods/modeling/meta_arch)

      You need to add the model architecture code (except backbone) here, for example：[RetinaNet](https://git-core.megvii-inc.com/zhubenjin/cvpods/blob/megvii/cvpods/modeling/meta_arch/retinanet.py), [FCOS](https://git-core.megvii-inc.com/zhubenjin/cvpods/blob/megvii/cvpods/modeling/meta_arch/fcos.py).

3. **Create a new project in the cvpods_playground, for example:**

   ```shell
   mkdir -p examples/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x
   ```

   > **Note:** When creating a new project, please follow this directory hierarchy: `examples/task/dataset/method_name/model_name` (model_name means the project name of the method in different configurations).

   A new project must contain the following two files：

   - `config.py`：configuration file, used for environment and hyperparameter setting.
   - `net.py`：network structure build file, used to create builders for each module of the model, such as backbone builder, anchor generator builder, etc.

4. **Train & test the model until it achieves your expectations:**

   ```shell
   # Train
   pods_train --num-gpus 8
   # Test
   pods_test --num-gpus 8
   ```

   > **Note:** After the model test is completed, please make sure that the project directory contains the `README.md` file with model evaluation metrics and corresponding scores, for example: [FCOS](https://github.com/Megvii-BaseDetection/cvpods/blob/master/playground/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x).

5. **Update MODEL_ZOO:**

   Add new model information in the [`README.md`](https://github.com/Megvii-BaseDetection/cvpods/blob/master/playground/README.md) file in playground.

6. **After all the above work is completed, push the code to Gitlab and submit merge request to cvpods and cvpods_playground respectively.**

   > **Note:**
   >
   > 1. Before pushing, please make sure your code style conforms to [PEP8](https://www.python.org/dev/peps/pep-0008/).
   >    ```shell
   >    pip install flake8
   >    # Run the following command in the root of cvpods and cvpods_playgroun
   >    flake8 ./
   >    ```
   >
   > 2. When submitting the merge request to playground, **please attach the final checkpoint file of each model in merge request description**, for example: `/url/to/your/playground/examples/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x/model_final.pth`.

repository: Megvii-BaseDetection/cvpods

gha_language: Python

repo_name: Megvii-BaseDetection/cvpods


text:
## The Game of Life

The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.

This implementation aims to meet all the following:

 - It is hosted statically.
 - It runs in any browser.
 - It is mobile-friendly.
 - The size of the map is user configurable.
 - The initial generation is user-configurable.
 - All configuration is done with the mouse (or touchscreen).
 - Initial generations can be saved in browser storage, retrieved to re-run and displayed as JSON or written to an email so they can be shared.
 - When run, the speed of the simulation can be varied by the user.
 - The simulation will run at a reasonable speed, e.g. up to 10 generations/sec or better depending on the size of the map.

The entire script can be seen at the [~ec~ repository](https://raw.githubusercontent.com/easycoder/easycoder.github.io/master/resources/ecs/lifedemo.ecs). Note: The formatting may look a little uneven because all editing was done in a tabbed editor. There's just one ~ec~ script, comprised mostly of subroutines. Here's a brief description of its functionality:

The script starts by defining all the variables it will use. Many of these are just temporary values; of the rest, the most important are `Map` and `Cell`, which hold information about the array of cells. `Map` is an array of true/false values to say which cells are occupied, and `Cell` is an array of DIVs, one for each cell.

Next, a few constants are assigned for the colours used.

Finally, the code sets up the screen; the map and the various controls under it, then waits for some interaction from the user. This can be either in one of the controls or a click on the map itself, which turns a cell from dead to alive or vice versa. Map setup is all handled by the `SetupMap` subroutine - see below.

After this are the various subroutines, that I'll describe briefly:

**`DoClear`**

Clears the entire map.

**`DoSave`**

Save the current map contents. The saved value is a JSON string giving the column and row numbers for each of the 'alive' cells. The origin is set at the center of the map; values to the left and above are negative. This is to permit the saved value to be reimported into any map with optional column and row offsets.

Data is saved to browser storage. You will be asked for a name for the item. All the saved items will appear under the `Load` button when it is clicked.

**`DoLoad`**

Load a saved configuration. The contents will be loaded at a position given by the top left of the screen plus the values given in the `Offset X` and `Offset Y` boxes. If either of the `Flip` checkboxes is checked, the corresponding transformation will be made before the item is placed on the map.

**`FlipHorizontal`**

Flips the item horizontally as it is loaded.

**`FlipVertical`**

Flips the item vertically as it is loaded.

**`DoRun`**

Run the game from the current configuration.

**`DoPause`**

Pause the game.

**`ResetKeySelector`**

When a saved item is selected in the `Load` dropdown this subroutine restores the selector to its default state. It is also called after a new item is saved, to ensure it appears in the list.

**`SetNCells`**

Sets the number of cells and updates the saved value. This falls into **`SetupMap`** to refresh the display.

**`SetupMap`**

Sets up the map, computing the appropriate dimensions from the size of the container provided. It initialises the `Map` and `Cell` arrays and sets click listeners on each cell. Note that in ~ec~ an array only needs a single `on click` listener.

**`SetDeadBackground`**

Sets a cell to its 'dead' state. The center cell has a slightly darker background, to help with positioning shapes by hand.

**`ComputeNextGeneration`**

Computes the next generation from the current one, using the standard rules. At the end it falls into **`Redraw`**.

**`Redraw`**

Redraws the map in its new state.

**`CountNeighbours`**

For each cell in the map, count how many neighbours it has in the 'alive' state. This is by far the most time-consuming part of the entire script and is the first candidate for optimisation. in a 20x20 map it calls **`CheckCell`** 400 times; for a 60x60 map that's 3600 times. This puts a severe limit on the speed of the animation and also causes the computer itself to run hot. This is a good example of the relative merits of system programming languages and high-level scripts. The latter are very good at expressing _intentions_, that is, the look and feel of an app, but rather poor at handling _algorithms_. System languages, on the other hand, do algorithms well but are very clumsy when asked to express intentions.

**`CheckCell`**

Check if a specified cell is alive, using one of the 8 neighbour offsets added to the current column and row numbers.


text:
# Fire Control

Now let's put the bullets under GigaGal's control, adding a shoot key, and making sure the bullets spawn at the right position, that is, coming out of GigaGal's cannon, and moving in the right direction, whatever direction GigaGal is facing.

Check out the TODOs to let GigaGal fire her cannon!


text:
---
title: toc-lib-utils-image-screenshot-preview
tags: [image, preview, screenshot, toc, utils]
created: 2021-01-30T15:35:07.367Z
modified: 2023-04-16T13:34:33.706Z
---

# toc-lib-utils-image-screenshot-preview
- guide
  - preview实时预览更适合直接展示dom，支持动态交互
  - screenshot更适合静态内容
# react-comp-screenshot
- https://github.com/fayeed/use-screenshot
  - https://use-screenshot.now.sh/
  - React hook to take screenshot for React components.
  - 依赖 html-to-image
- https://github.com/salman-monetate/react-component-export-image
  - https://codesandbox.io/s/nostalgic-poincare-7xfrl?file=/src/App.js
  - Export component as jpeg, png or pdf
  - 依赖html2Canvas、jspdf
# js-screenshot
- https://github.com/niklasvh/html2canvas /ts
  - https://html2canvas.hertzen.com/
  - Screenshots with JavaScript
  - The script allows you to take "screenshots" of webpages or parts of it, directly on the users browser.
  - how it works
    - The script renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements.
    - It does not require any rendering from the server, as the whole image is created on the client's browser.
    - However, as it is heavily dependent on the browser, this library is not suitable to be used in nodejs.
    - The html2canvas library utilizes Promises and expects them to be available in the global context.
- https://github.com/johnnywang1994/jsPDF-html2canvas
  - A combine usage with jsPDF & html2canvas, which translating html content to PDF file.

- https://github.com/rsify/pico /ts
  - Pico's goal is to produce high precision screenshots of any viewport entirely client side.
  - This is different from simply capturing a webpage using Puppeteer or a similar tool in that the **screenshot taking happens entirely client side**.
  - This program renders whatever is displayed in the given `Window` into an image, thanks to svg's `<foreignObject>`.
  - **No server side code is required to produce the screenshot**.
  - Pico's selling point is representing the whole viewport as accurately as possible. If you want to render a single DOM node instead, consider using one of the above libraries.
  - Pico is built using Fluture and in addition to the Promise also provides a direct API to Fluture via functions suffixed with Fluture

- https://github.com/bubkoo/html-to-image /540Star/MIT/202101/ts
  - Generates an image from a DOM node using HTML5 canvas and SVG.
  - Fork from `dom-to-image` with more maintainable code and some new features.

- https://github.com/1904labs/dom-to-image-more /js
  - a library which can turn arbitrary DOM node, including same origin and blob iframes, into a vector (SVG) or raster (PNG or JPEG) image, written in JavaScript.
  - Anatolii's version was based on domvas by Paul Bakaus and has been completely rewritten
  - This fork of `dom-to-image`

- https://github.com/tsayen/dom-to-image /7kStar/201706/inactive
  - turn arbitrary DOM node into a vector (SVG) or raster (PNG or JPEG) image, written in JavaScript.
  - It's based on domvas
- https://github.com/pbakaus/domvas /370Star/201307
  - Domvas implements the missing piece that connects the DOM and Canvas.
  - It gives to the ability to take arbitrary DOM content and paint it to a Canvas of your choice.
  - Domvas uses a feature of SVG that allows you to embed XHTML content into the SVG
  - the actual SVG can be used as a data uri, and therefore behaves like a standard image.
  - I brought CSS transforms to browsers that did not have them.
    - HTML content needs to be serialized to XML, and all styles have to be inlined.
  - The DOM object is not linked, but copied
  - Content outside the bounding box of the element will be cut of per default if painted to Canvas. Don't worry though, simply pass a more comfortable offset to the toImage function

- https://github.com/cburgmer/rasterizeHTML.js /js
  - http://cburgmer.github.io/rasterizeHTML.js
  - Renders HTML into the browser's canvas
  - it is possible by embedding the HTML into an SVG image as a `<foreignObject>` and then drawing the resulting image via `ctx.drawImage()`.
  - SVG is not allowed to link to external resources and so rasterizeHTML.js will load external images, fonts and stylesheets and store them inline via data: URIs (or inline style elements respectively).

## capture-utils

- https://github.com/likaia/js-screen-shot /ts
  - web端自定义截屏插件(原生JS版)
  - 支持electron环境下使用插件

- https://github.com/xataio/screenshot /ts
  - zero-dependency browser-native way to take screenshots powered by the native web MediaDevices API.

- https://github.com/sindresorhus/pageres
  - Capture screenshots of websites in various resolutions.
  - It can also be used to render SVG images.
  - 基于puppeter

- https://github.com/premieroctet/screen-guru
  - Take clean screenshot of any websites
  - 基于puppeter

- https://github.com/flowko/website-shot /vue
  - 基于puppeter
# screenshot-browser-extensions
- https://github.com/Chromo-lib/screenshot /202210/js
  - Screenshot tool for making a full page or partial screen capture with further edit, download.
  - 只支持firefox和edge，不支持chrome
  - built with Chrome DevTools Protocol

- note-it /16Star/Apache2/202208/ts/tiptap
  - https://github.com/MuhametSmaili/note-it
  - 支持截图及批注
  - NoteIt is a feature-packed, note-taking extension with OCR support for chrome.
  - 依赖React、Tiptap、tesseract.js、pdfmake、html-to-pdfmake
  - You can take notes, convert images to text, download notes to pdf, and more.

- https://github.com/felixfbecker/svg-screenshots /726Star/MIT/202105/ts
  - Browser extension to take scalable, semantic, accessible screenshots of websites in SVG format.
  - The SVG will not run any JavaScript.
  - 截图某些动态元素时，可能会变颜色
  - 依赖dom-to-svg、svgo
  - https://github.com/felixfbecker/dom-to-svg

- https://github.com/lxieyang/screenshot-extension /202011/ts
  - browser extension that takes full-page or partial screenshots!
  - 仅截图全屏，无滚动和编辑
  - https://chrome.google.com/webstore/detail/screenshot-extension-open/hmkbkbpdnembpeadgpcmjekihjmckdjh

- https://github.com/mrcoles/full-page-screen-capture-chrome-extension /js
  - Go FullPage
  - takes a screen capture of a full web page.
  - 提供了付费版-未开源

- https://github.com/timii/Snapper /202207/js
  - An easy-to-use extension for taking screenshots in your browser

- https://github.com/simov/screenshot-capture /202212/js/功能简单
  - Screenshot Capture / Browser Extension
  - https://chrome.google.com/webstore/detail/screenshot-capture/giabbpobpebjfegnpcclkocepcgockkc

- https://github.com/Aminadav/1click-webpage-screenshot /201902/js/功能丰富
  - Entire page Screenshot extension for Google Chrome
  - Annotate it with rectangles, circles, arrows, lines and text.

- https://github.com/folletto/Blipshot /202108/js
  - simple one-click full-page screenshots with drag and drop.
  - [This plugin isn't in development anymore](https://github.com/folletto/Blipshot/issues/28)

- https://github.com/ashrene-roy/blackboard /202107/js
  - annotate webpages, capture and save full page screenshots

- https://github.com/CamilleCharp/browsershot
  - take a screenshot and put it in a browser-like window, it is inspired by code-snapshot on VsCode.
  - Use the chrome extension api to capture the tab and html2canvas to download the final image.

- https://github.com/balduvian/ebetshot
  - A video screenshot extension for Chrome.

- https://github.com/williamemir/driveshot
  - takes screenshots and uploads to google drive, only for testing of manifest v3

- web-clipper /4.7kStar/GPLv2/202208/ts
  - https://github.com/webclipper/web-clipper
  - https://clipper.website/
  - use Web Clipper to save anything on the web to anywhere.
  - 支持收藏链接、选区文字
  - 支持
    - flowus、wolai、语雀、有道、flomo
    - notion、github、onenote、joplin
  - https://chrome.google.com/webstore/detail/web-clipper/mhfbofiokmppgdliakminbgdgcmbhbac
# source-code-screenshot
- https://github.com/riccardoperra/codeimage /ts
  - https://codeimage.dev/
  - A tool to beautify your code screenshots. Built with SolidJS

- https://github.com/carbon-app/carbon /js
  - https://carbon.now.sh/
  - Create and share beautiful images of your source code
  - 对源码生成截图时支持多种theme

- https://github.com/Idered/chalk.ist /ts/vue
  - https://chalk.ist/
  - Create beautiful images of your source code

- https://unhtml.com/code
  - unhtml for code/markdown/picture
  - https://unhtml.404.ms/code

- https://ray.so/
  - code screenshot

## vscode

- https://github.com/jeffersonlicet/snipped /ts
  - Save SVG or PNG screenshots of code selection or all lines of your file.

- https://github.com/kufii/CodeSnap /js
  - Take beautiful screenshots of your code in VS Code

- https://github.com/octref/polacode /js
  - Polaroid for your code
  - Resize the snippet / container by dragging the lowerright corner
# more
- https://github.com/antfu/broz
  - A simple, frameless browser for screenshots


text:
# Silexicon
This application looks up English words from a MySQL dictionary.

## What is this?
This is an example application for a simple English Dictionary REST API. I have created this to practice and (someday) teach the following concepts:

- Silex
- Symfony2 Components
- Building Microservices
- Design Patterns in OOP
- HATEOAS
- Documenting a REST API
- TDD/BDD

## What can I use this for?
I encourage you to fork, learn from, or otherwise abuse this code in any way you see fit. I ask, however, that you follow the respective licenses of the open source software contained within.

## Documentation
A fully documented REST API will be provided once the code is stable.

## Installation
Coming soon but, for now, I would expect to use [Composer](http://getcomposer.org) to download project dependencies.

## Credits
This is based on the excellent [Silex](http://silex.sensiolabs.org) microframework which is, in turn, based on a few excellent [Symfony2](http://symfony.com/components) components. I've also used the [MySQL English Dictionary](http://sourceforge.net/projects/mysqlenglishdictionary/) from sourceforge.net to provide the data.

repository: webkenny/silexicon

repo_name: webkenny/silexicon


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.1.0] - 2020-02-05

### Added
- Now the loader listens for changes in the DOM, new elements inserted after the loader
instantiation will be tracked as well.

repository: adinan-cenci/lazy-loader

repo_name: adinan-cenci/lazy-loader


text:
# MotivationalBook

[![CI Status](https://img.shields.io/travis/wenchao8023/MotivationalBook.svg?style=flat)](https://travis-ci.org/wenchao8023/MotivationalBook)
[![Version](https://img.shields.io/cocoapods/v/MotivationalBook.svg?style=flat)](https://cocoapods.org/pods/MotivationalBook)
[![License](https://img.shields.io/cocoapods/l/MotivationalBook.svg?style=flat)](https://cocoapods.org/pods/MotivationalBook)
[![Platform](https://img.shields.io/cocoapods/p/MotivationalBook.svg?style=flat)](https://cocoapods.org/pods/MotivationalBook)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

MotivationalBook is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'MotivationalBook'
```

## Author

wenchao8023<EMAIL_ADDRESS>
## License

MotivationalBook is available under the MIT license. See the LICENSE file for more info.


text:
---
layout: blog
categories:
  - blog
title: "Intro to being anti-racist in civic tech"
description: "In recognition of Chi Hack Night’s commitment to Black Lives Matter and the racial justice movement, we believe it’s important for our community to continue taking steps to address white supremacy culture. But what does it mean to be anti-racist? What is white supremacy culture and how does it show up? Over the past months, Chi Hack Night’s DEI committee has discussed and researched these questions. Now we’re sharing what we learned so that we can all work to make our communities more equitable and just."
date: 2021-03-25
image:
author: Ryan Spencer
author_url:
author_image: /images/people/board/ryan_spencer.jpg
author_bio: "Chi Hack Night Board Member"
author2: "Derek Eder"
author2_image: /images/people/board/derek.jpg
author2_url: https://twitter.com/derekeder
author2_bio: "President, Chi Hack Night"
published: true
featured: false
---

**Update:** Chi Hack Night Board Members Ryan Spencer, Derek Eder and Samantha Evans gave a [presentation on April 13, 2021](/events/2021/04/13/anti-racist-in-civic-tech.html) based on this blog post. You can watch it here:

In recognition of [Chi Hack Night's commitment](https://chihacknight.org/blog/2020/06/06/black-lives-matter.html) to Black Lives Matter and the racial justice movement, we believe it’s important for our community to continue taking steps to address white supremacy culture. But what does it mean to be anti-racist? What is white supremacy culture and how does it show up? Over the past months, Chi Hack Night’s DEI committee has discussed and researched these questions. Now we’re sharing what we learned so that we can all work to make our communities more equitable and just.

What does it mean to be Anti-racist? What is white supremacy culture and how does it show up?

Although there is a broad acceptance amongst most of us to not be racist, there is a need to become actively anti-racist. That is why we are asking the Chi Hack Night community to reflect on how white supremacy culture permeates our personal and professional environment, as well as the larger communities in which we live.

White supremacy culture can be harmful for both people of color and white people, though how it shows up in our lives and communities can be subtle. It’s the ideology that the beliefs, norms, customs, and actions of white people are the superior standard or ‘default’ in which all society- including people of color- should be judged. This ideology becomes reinforced by our institutions, from the tech industry to medicine, education, and media. Common manifestations of white supremacy culture include perfectionism, a sense of urgency, defensiveness, and paternalism. We recommend you review the [Characteristics of White Supremacy Culture](https://www.showingupforracialjustice.org/white-supremacy-culture-characteristics.html) and ask yourself how these traits play a role in your organization, community, and personal life. Recognizing the characteristics of white supremacy that may be present at Chi Hack Night is also an  goal of the DEI committee.

Learning how to talk about cultural racism

At Chi Hack Night, part of upholding our commitment to racial equity includes providing a safe space dedicated to discussing these topics and other relevant issues with our community members. One of the major reasons why we formed our Diversity, Equity, and Inclusion (DEI) breakout was to normalize having these discussions and offer our findings as a resource for the larger civic tech community in Chicago. If topics related to DEI have never seemed pertinent to you, we ask that you commit to attending at least one DEI group meeting. Below are resources you can use to learn more about how to effectively and respectfully engage in dialogue on DEI topics.

So you want to talk about race by Ijeoma Oluo

**Additional resources for further learning**

* Book: [So You Want to Talk About Race](https://bookshop.org/books/so-you-want-to-talk-about-race/9781580058827) by Ijeoma Oluo
* Article: [Racism Defined](https://www.dismantlingracism.org/racism-defined.html), dismantlingracism.org
* TED Talk: [Let's Get to the Root of Racial Injustice ](https://www.youtube.com/watch?v=-aCn72iXO9s)by Megan Ming Francis
* Article: [White Supremacy Culture](https://www.dismantlingracism.org/white-supremacy-culture.html), dismantlingracism.org

What does this have to do with civic tech? What is occurring in tech equity?

The promise of civic technology is vast; however, there is still the possibility of reinforcing racial disparities via technology, even when you’re setting out with good intentions. Below are some questions to ask before building technology, starting a breakout group, or creating a new tool.

* Whom are you empowering with this technology?
* Whom does this technology potentially harm?
* What steps can you take to minimize the potential for harm?

It is important to understand the demographics of our own community and recognize who is and is disproportionately represented in civic technology circles:

Demographic survey of civic tech from the More Than Code report

**Additional resources for further learning**

* Report: [More Than Code (see section on Demographics)](https://morethancode.cc/report/demographics/)
* Report: [Advancing Racial Literacy in Tech](https://datasociety.net/wp-content/uploads/2019/05/Racial_Literacy_Tech_Final_0522.pdf), Data & Society
* Article: [Machine Bias](https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing), ProPublica
* Presentation slides: [The opportunity of Civic Tech](https://docs.google.com/presentation/d/1DKSews9HVwxd8-2fH1aeFlNth20D0nP6tEZqB5Rmn5U/edit#slide=id.g50fb9ce99_0_67), Derek Eder

Where can I find ongoing resources to stay informed and learn how I as an  individual can help change the system?

White supremacy culture affects all of us….regardless of our racial background. Whether you’ve benefited from the perceived superiority or have been at the receiving end of discrimination and institutionalized racism, you’ve experienced white supremacy culture. Being actively anti-racist requires action in our personal lives and within our organizations. As we seek to understand the role that technology and the broader tech community plays in reinforcing white supremacy culture, it’s important to stay informed with up-to-date resources. This work is actively ongoing, so we will be updating the resources below to help you stay informed.

Protecting Queer Communities Through Data, Soren Spicknall

**Additional resources for further learning**

* Chi Hack Night Presentation: [Protecting Queer Communities Through Data](https://chihacknight.org/events/2019/06/25/soren-spicknall.html), Soren Spicknall
* Book: [Design Justice: Community-Led Practices to Build the Worlds We Need by Sasha Costsnza-Chock](https://design-justice.pubpub.org/) by Sasha Costanza-Chock

What actions can I take today individually to promote racial equity?

* Join the Chi Hack Night [Diversity, Equity and Inclusion (DEI) Breakout Group](https://github.com/chihacknight/breakout-groups/issues/212) every Tuesday at Chi Hack Night
* Join Chi Hack Night’s **#anti-racist-resources** [Slack channel](http://slackme.chihacknight.org/)
* Use the resources posted here or from other organizations to continue learning

branch_name: refs/heads/production


text:
# Vue 2.x Official Single-filed Component (SFC) Parser That's Extracted

<link rel="stylesheet"<EMAIL_ADDRESS>
## Multilingual Editions of this Article

- 《[本文之简体中文版](../../ReadMe.md)》

## NPM Page

NPM Name

[@wulechuan/vue2-official-sfc-parser](https://www.npmjs.com/package/@wulechuan/vue2-official-sfc-parser)

Reviser

wulechuan (南昌吴乐川)

## Introduction

### What is it

This tools is extracted manually from the official source codes of Vue `v2.6.11`.

As we know, Vuejs allows so-called Sinlge-filed Component(SFC), to write markups (`<template>`), JavaScritp codes (`<script>`) and CSS codes (`<style>`) all together within a single file. And the said file by default takes `.vue` as its file extension. This tool parses the content string for a `.vue` file, and outputs an object, containing all parts separately. Thus you get pure markups, pure javascript codes, pure CSS codes, or even pure customized codes if any.

Simply put, this tool tears a `.vue` file apart, and provides all parts under a single object, so that other JavaScript codes can make use of these parts separately.

### Why should this tool exist

-   Maybe we need to extract only the Stylus codes within a given `.vue` file, and then compile these Stylus codes into CSS codes.

-   Or say we are writting a Vue component as a lib, but we choose to write this component in TypeScript instead of JavaScript. When a project of pure JavaScript needs to make use of the lib written by us, that project might have difficulties to import our `.vue` file of TypeScript directly. So, as the author of the lib, we should provide a JavaScript version of our `.vue` file besides the oringial TypeScript version. That is, we shall provide both versions and let other developers to choosen either of them. This is a nice example that my tool (well, not exactly mine) plays a role. You write your `.vue` lib component in TypeScript, then you design a simple tool chain to convert the TypeScript version into a JavaScript version. Then obviously my tool can help you build your tool chain.

### Modifications over Original Codes

To satisfy the eslint, I did modify the orginal codes a bit.

1.  Such as, change all this kind of codes:

    ```ts
    let a, b
    ```

    into this kind:

    ```ts
    let a
    let b
    ```

1.  Additionally, I've also changed some function names.

## Usage

### Installation

```sh
npm  i  @wulechuan/vue2-official-sfc-parser
```

### Notice

This tool accept no file path string, but a file content string. So the codes for reading a file should write separately. This design makes this tool a bit more flexible.

### An Example

```js
import { readFile } from 'fs-extra'
import { vueSFCParser } from '@wulechuan/vue2-official-sfc-parser'

test2('./测试集/testing-source-2.vue')

async function test2(testingSourceFilePath) {
    const vueFileRawContent = await readFile(testingSourceFilePath, 'utf8')
    const vueFileContentString = vueFileRawContent.toString()
    const sfcDescriptor = vueSFCParser(vueFileContentString)
    console.log(sfcDescriptor)
}
```

### API

This tool provides the only function named `vueSFCParser`. The signature of the said function is:

```ts
function vueSFCParser (
    content: string,
    options?: ParseComponentOptions
): SFCDescriptor
```

The involved Official Types:

```ts
interface SFCBlock {
    type: string;
    content: string; // Content of a single part. It could be JavaScript codes, markup codes, or CSS codes, etc.
    attrs: Record<string, string>;
    start?: number;
    end?: number;
    lang?: string; // The language of the given part. It could be 'ts', 'stylus', etc.
    src?: string;
    scoped?: boolean;
    module?: string | boolean;
}

interface SFCDescriptor {
    template: SFCBlock | undefined | null;
    script: SFCBlock | undefined | null;
    styles: SFCBlock[];
    customBlocks: SFCBlock[];
    errors?: any[];
}

type ParseComponentOptions = {
    outputSourceRange?: any;
    pad?: any;      // TODO To avoid use 'any' here, further investigations are required.
    deindent?: any; // TODO To avoid use 'any' here, further investigations are required.
};
```

gha_language: TypeScript


text:
# Course Project for Getting and Cleaning Data

This repository holds the Course Project for the [Getting and Cleaning Data](https://www.coursera.org/course/getdata) course at Coursera.

This document describes how the `run_analysis.R` script works. Its objective is to tidy up the [source dataset](https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip). Detailed information on the source dataset can be found [here](http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones).

## Files

There are 3 files in this repository:

* `README.md` - describing how the analysis work;
* `CodeBook.md` - describing the data the analysis produces;
* `run_analysis.R` - the analysis script.

The script assumes that a `UCI HAR Dataset` directory exists in the current directory and contains the unzipped contents of the source dataset.

After the script is run, a `tidy.txt` file is created in the current directory. The contents of this file are described in the [code book](CodeBook.md).

## How the analysis is done

The first step in the analysis is downloading and unzipping the source dataset if it does not exist in the current directory.

With the data on disk, the script continues by loading the `features.txt` and `activity_labels.txt` files adding column names to the last one.

It then loads in sequence the `X_test.txt`, `subject_test.txt` and `y_test.txt` files. It uses the contents of the features dataset as the column names for the X_test dataset. It then adds the contents of the subject_test and y_test datasets as columns to the test dataset.

At this point we have the test dataset with column names from the features dataset, the original measurement data columns and the subject ids and activity ids columns.

The script does the same thing for the similar group of train files.

After the two datasets, test and train, are ready, the script adds the rows in the train at the end of the test dataset creating a new merged dataset.

Now it fixes column names by transforming them into lower case and removing all dots.

It proceeds by selecting only the columns that have `mean` and `std` in their names plus the subject and activity id columns.

Later it uses the activity id column to match the activity labels to the corresponding rows. Afterwards it removes the activity id from the dataset.

The last step is to gather the measurements columns into two columns, one for the type of measurement and the other for the measurement value. With the data tidily formatted, it computes the mean of each measure by subject id and activity.

The data is finally written to disk.

## How to read the data

In order to view the tidy data produced by the analysis, the following R expression can be used:

```R
data <- read.table(file_path, header = TRUE)
View(data)
```


text:
# RAT or CAT - Image Microservice

## Description

Returns images of cats or rats, that is all.

## Installation

```bash
$ yarn install
```

## Running the app

```bash
# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod
```

## Test

```bash
# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov
```

## Support

Ask and thee shall receive.

## License

  Cat images have been taken from here: [https://github.com/maxogden/cats]

  Rat images have been stolen from Reddit. Thanks Reddit rat lovers [https://reddit.com/r/rats]

  RAT or CAT is [MIT licensed](LICENSE).

repository: brendan-mccheese/rat-or-cat

repo_name: brendan-mccheese/rat-or-cat


text:
---
# Display name
name: Egon Luis Vilela do Valle

# Username (this should match the folder name)
authors:
- Egon

# Is this the primary user of the site?
superuser: false

# Role/position
role: PhD Student

# Organizations/Affiliations
organizations:
- name: Universidade Federal de Goiás, Brasil
  url: "https://www.ecoevol.ufg.br/"

# Short bio (displayed in user profile at end of posts)
bio:

interests:
- Macroecology
- Evolution
- Bats
- Bioacustics

education:
  courses:
  - course: PhD in Ecology an Evolution
    institution: Universidade Federal de Goiás, Brasil
    year: Ongoing
  - course: MSc in Ecology and Conservation
    institution: Universidade Federal de Uberlândia, Brasil
    year: 2019
  - course: BSc in Biological Sciences
    institution: Universidade Federal Rural do Rio de Janeiro, Brasil
    year: 2017

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/page-builder/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.
# social:
# - icon: envelope
#  icon_pack: fas
  link<EMAIL_ADDRESS># - icon: twitter
#  icon_pack: fab
#  link: https://twitter.com/FabroVillalobos
# - icon: google-scholar
#  icon_pack: ai
#  link: https://scholar.google.com/citations?user=9CxnRG4AAAAJ&hl=es&oi=ao
# - icon: github
#  icon_pack: fab
#  link: https://github.com/fabro
# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
# - icon: cv
#   icon_pack: ai
#   link: files/cv.pdf

# Enter email to display Gravatar (if Gravatar enabled in Config)
# email: fabricio.villalobos at gmail.com

# Organizational groups that you belong to (for People widget)
#   Set this to `[]` or comment out if you are not using People widget.
user_groups:
- Grad Students
---

I am a biologist with a M.Sc. degree from Universidade Federal de Uberlândia (UFU), Brazil. Currently, I am working on a research project as a Ph.D. student at Universidade Federal de Goiás (UFG). My research focuses on the role of evolution on geographic range size, climatic niche, and dispersion ability within species of the Chiroptera order.

I am interested in everything about the Chiroptera order, but mostly its flight and bioacoustics evolution, and although I am not currently engaged on it, taxonomy and taxidermy.

repository: fabro/academic-kickstart

repo_name: fabro/academic-kickstart