|
| int32_t | pi_ble_open (struct pi_device *device) |
| | Open a BLE device. More...
|
| |
| void | pi_ble_close (struct pi_device *device) |
| | Close a BLE device. More...
|
| |
| int32_t | pi_ble_ioctl (struct pi_device *device, uint32_t cmd, void *arg) |
| | IOctl commands. More...
|
| |
| int32_t | pi_ble_at_cmd (struct pi_device *device, const char *cmd, char *resp, uint32_t size) |
| | Send AT command to BLE device. More...
|
| |
| int32_t | pi_ble_peer_connect (struct pi_device *device, const char *addr) |
| | Connect to a peer. More...
|
| |
| int32_t | pi_ble_peer_disconnect (struct pi_device *device, const char *addr) |
| | Close a connection to a peer. More...
|
| |
| void | pi_ble_data_send (struct pi_device *device, uint8_t *buffer, uint32_t size) |
| | Send data to BLE device. Blocking API. More...
|
| |
| void | pi_ble_data_send_async (struct pi_device *device, uint8_t *buffer, uint32_t size, pi_task_t *task) |
| | Send data to BLE device. Blocking API. More...
|
| |
| void | pi_ble_data_get (struct pi_device *device, uint8_t *buffer, uint32_t size) |
| | Get data from BLE device. Blocking API. More...
|
| |
| void | pi_ble_data_get_async (struct pi_device *device, uint8_t *buffer, uint32_t size, pi_task_t *task) |
| | Get data from BLE device. Non blocking API. More...
|
| |
The BLE driver provides support for wireless data transfer between the host and an external peripheral such as a smartphone, using Bluetooth connection.
◆ pi_ble_at_cmd()
| int32_t pi_ble_at_cmd |
( |
struct pi_device * |
device, |
|
|
const char * |
cmd, |
|
|
char * |
resp, |
|
|
uint32_t |
size |
|
) |
| |
This function is used to send AT commands to BLE device.
- Parameters
-
| device | Pointer to the BLE device structure. |
| cmd | Command string to send. |
| resp | Buffer to store response. |
| size | Size of the response to store, in Bytes. |
- Return values
-
| 0 | If operation is successful. |
| ERRNO | Error code otherwise. |
- Note
- The command string should be plain command, i.e. without the "AT" part.
-
The command may or may not return a response.
◆ pi_ble_close()
| void pi_ble_close |
( |
struct pi_device * |
device | ) |
|
This function closes an opened BLE device. It frees all allocated objects and interfaces used.
- Parameters
-
| device | Pointer to the BLE device structure. |
◆ pi_ble_data_get()
| void pi_ble_data_get |
( |
struct pi_device * |
device, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
This function is used to retrieve data from BLE device.
- Parameters
-
| device | Pointer to the BLE structure. |
| buffer | Buffer to store data. |
| size | Size of data. |
- Note
- This function is synchronous, caller is blocked until transfer is finished. The pending asynchronous function is below : pi_ble_data_get_async().
◆ pi_ble_data_get_async()
| void pi_ble_data_get_async |
( |
struct pi_device * |
device, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size, |
|
|
pi_task_t * |
task |
|
) |
| |
This function is used to retrieve data from BLE device.
- Parameters
-
| device | Pointer to the BLE structure. |
| buffer | Buffer to store data. |
| size | Size of data. |
| task | Event task used to check end of transfer. |
- Note
- This function is asynchronous. The pending synchronous function is : pi_ble_data_get().
◆ pi_ble_data_send()
| void pi_ble_data_send |
( |
struct pi_device * |
device, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
This function is used to send data to BLE device.
- Parameters
-
| device | Pointer to the BLE structure. |
| buffer | Buffer to send. |
| size | Size of data to send. |
- Note
- This function is synchronous, caller is blocked until transfer is finished. The pending asynchronous function is below : pi_ble_data_send_async().
◆ pi_ble_data_send_async()
| void pi_ble_data_send_async |
( |
struct pi_device * |
device, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size, |
|
|
pi_task_t * |
task |
|
) |
| |
This function is used to send data to BLE device.
- Parameters
-
| device | Pointer to the BLE structure. |
| buffer | Buffer to send. |
| size | Size of data to send. |
| task | Event task used to check end of transfer. |
- Note
- This function is asynchronous. The pending synchronous function is : pi_ble_data_send().
◆ pi_ble_ioctl()
| int32_t pi_ble_ioctl |
( |
struct pi_device * |
device, |
|
|
uint32_t |
cmd, |
|
|
void * |
arg |
|
) |
| |
This function is used to send special command to BLE device.
- Parameters
-
| device | Pointer to the BLE device structure. |
| cmd | Ioctl command. |
| arg | Ioctl command arg. |
- Returns
- Value Value depends on ioctl command.
◆ pi_ble_open()
| int32_t pi_ble_open |
( |
struct pi_device * |
device | ) |
|
This function opens and intializes a BLE device. This function must be called before using device.
- Parameters
-
| device | Pointer to the BLE device structure. |
- Return values
-
| 0 | If the operation is successful. |
| ERRNO | Error code otherwise. |
◆ pi_ble_peer_connect()
| int32_t pi_ble_peer_connect |
( |
struct pi_device * |
device, |
|
|
const char * |
addr |
|
) |
| |
This function should be used to connect to a remote peer.
- Parameters
-
| device | Pointer to the BLE device structure. |
| addr | Address in string format. |
- Return values
-
| 0 | If operation is successful. |
| ERRNO | Error code otherwise. |
◆ pi_ble_peer_disconnect()
| int32_t pi_ble_peer_disconnect |
( |
struct pi_device * |
device, |
|
|
const char * |
addr |
|
) |
| |
This function closes an existing peer connection.
- Parameters
-
| device | Pointer to the BLE device structure. |
| addr | Address in string format. |
- Return values
-
| 0 | If operation is successful. |
| ERRNO | Error code otherwise. |


Three eggs.
Regular readers will be aware that whenever I quote from George Orwell's diaries I give the full and unabridged entry for the day in question. Tomorrow we will have to move on to a different diarist, so it is only fair that I take the opportunity to draw your attention to further, ornithologically significant, excitements in Orwell's life which took place on the ninth of January 1939. Not merely
Two eggs
but
Saw large flock of green plover, apparently the same as in England.
Did he think foreign plovers would somehow differ from clean, decent, English plovers?


Queues are ubiquitous. From cafeterias, bus stops, to daily traffic, customers have all experienced waiting, and expected to be served as soon as possible ("Demand"). On the other hand, service providers are searching for ways to improve their efficiency ("Supply"). To capture the nuances between demand and supply, simulations can be run to optimize the queuing system. Under the hood, there are many complex equations governing various scenarios. However, they can be greatly simplified without losing much accuracy in calculation. On this page, we will gain some intuitions about queuing system.
2. A Brief Description of Queuing System Modeling
The figure above illustrates a typical queuing system with one server. Customers arrive in a random fashion with expected rate λ, whereas the server processes customers at μ. Such randomness can be approximated stocastically using either exponential or poisson distributions. For large customer flow, such as car traffic at a highway bottleneck, uniform distribution can be applied. In this case, the queuing system is deterministic.
3. Intuition
A deterministic queue with one server can be interpreted as a cumulative frequency graph shown in the figure above. We hypothesize that two counters are placed on both ends of the queuing system. One records the total customers arrived, the other records total customers served. Both counters start, capture trend, and stop simultaneously.
Key quantities can be derived from the figure above. The slope of red line represents arrival frequency λ, whereas that of blue line indicates service frequency μ. The vertical distance between two lines is the queue length, the horizontal means the time taken for a customer to exit the queue. The area enclosed by two lines is the total wait time. When divided by time elapsed, the average wait time can be computed.
Another meaningful intuition is that the cumulative service count (blue line) can never exceed arrival count. This is equivalent to conservation of energy, where the amount of people entering the system ("energy input") is always greater, or equal to the number exiting the system ("energy output"). The "absorbed energy" is equivalent to the number of people waiting in line.
4. Let's Visualize
We can reinforce our intuition by running the mini-simulation below. This is a dynamic visualization, in which three parameters (arrival and service rates, plot density) can be selected via sliders in real time. Meanwhile, you can look at how the key quantities change from "Queue Status". If you wish to clear the charts and retart from scratch, simply refresh your browser.
Change parameters any way you want. Have you observed any unexpected trends?


Date Mean Squared Error
Table of Contents
What is this?
This is a short sketch to figure out how to group a bunch of values by month and calculate the Root-Mean-Squared-Error (RMSE) for the mean for the values in that month. This probably isn't the most efficient way to do this, but I'm trying to double check everything as I go and doing the typical Train Wreck like you see in most examples on Stack Overflow.
Imports
From PyPi
Just pandas.
import pandas
The Data
I'm going to create some simple values so that it's easy(ish) to do the math by hand and double-check what comes out. I'll use the pandas Timestamp for the dates. I'm still not one-hundred percent sure why it's better than date-time, but hopefully it's optimized or something.
data = {"date": [
pandas.Timestamp("2018-09-01"),
pandas.Timestamp("2018-09-05"),
pandas.Timestamp("2018-09-05"),
pandas.Timestamp("2018-10-01"),
pandas.Timestamp("2018-10-05"),
],
"value": [1, 2, 3, 1, 2]}
frame = pandas.DataFrame.from_dict(data)
I'm going to use pandas' resample method to group the data by months. the resample
method expets the data to have the dates as the index, so I'm going to create a new frame by setting the index to the date-column.
date_frame = frame.set_index("date")
The Mean
The value I'm going to use to estimate the values for each month is the mean.
monthly = date_frame.resample("M")
means = monthly.mean()
print(means)
assert all(means.value == [2.0, 1.5])
value date 2018-09-30 2.0 2018-10-31 1.5
Getting the Mean Back Into the Frame
Now that we have the monthly means, I want to re-add them to the original data-frame by giving them a common column named year_month
(using apply) so I can broadcast the means by merging the two data-frames.
frame["year_month"] = frame.date.apply(
lambda date: pandas.Timestamp(year=date.year,
month=date.month, day=1))
print(frame.head())
date value year_month 0 2018-09-01 1 2018-09-01 1 2018-09-05 2 2018-09-01 2 2018-09-05 3 2018-09-01 3 2018-10-01 1 2018-10-01 4 2018-10-05 2 2018-10-01
mean_frame = means.reset_index()
mean_frame["year_month"] = mean_frame.date.apply(
lambda date: pandas.Timestamp(year=date.year,
month=date.month,
day=1))
print(mean_frame)
date value year_month 0 2018-09-30 2.0 2018-09-01 1 2018-10-31 1.5 2018-10-01
The value
column in the mean_frame
is actually the mean of the values for that month so I'll re-name it before I forget.
mean_frame.rename(dict(value="mean"), axis="columns",
inplace=True)
print(mean_frame)
date mean year_month 0 2018-09-30 2.0 2018-09-01 1 2018-10-31 1.5 2018-10-01
Now I'll merge the two data frames on the year_month
column using the default inner-join (intersection) method.
merged = frame.merge(mean_frame, on="year_month")
del(merged["date_y"])
merged.rename(dict(date_x="date"), axis="columns", inplace=True)
print(merged)
assert all(merged["mean"] == [2, 2, 2, 1.5, 1.5])
date value year_month mean 0 2018-09-01 1 2018-09-01 2.0 1 2018-09-05 2 2018-09-01 2.0 2 2018-09-05 3 2018-09-01 2.0 3 2018-10-01 1 2018-10-01 1.5 4 2018-10-05 2 2018-10-01 1.5
Note that I had to use the merged["mean"]
form because the data-frame has a mean method which the dot-notation (merged.mean
) would call instead of grabbing the column.
Calculating the RMSE
Error
Since I'm estimating the values for each month using the mean the error is the difference between the mean and each of the values.
merged["error"] = merged["value"] - merged["mean"]
print(merged)
assert all(merged.error==[-1, 0, 1, -.5, .5])
date value year_month mean error 0 2018-09-01 1 2018-09-01 2.0 -1.0 1 2018-09-05 2 2018-09-01 2.0 0.0 2 2018-09-05 3 2018-09-01 2.0 1.0 3 2018-10-01 1 2018-10-01 1.5 -0.5 4 2018-10-05 2 2018-10-01 1.5 0.5
Error Squared
Now I'll square the error to get rid of the negative error values (which would cancel each other out when we take the mean errors) and to make the effect of the errors non-linear (the errors are exagerrated).
merged["error_squared"] = merged.error.pow(2)
print(merged)
date value year_month mean error error_squared 0 2018-09-01 1 2018-09-01 2.0 -1.0 1.00 1 2018-09-05 2 2018-09-01 2.0 0.0 0.00 2 2018-09-05 3 2018-09-01 2.0 1.0 1.00 3 2018-10-01 1 2018-10-01 1.5 -0.5 0.25 4 2018-10-05 2 2018-10-01 1.5 0.5 0.25
Mean Squared Error
So now we take the mean of our squared errors to get an initial estimate of how much we are off each month.
mean_of = merged.groupby("year_month").mean()
print(mean_of.error_squared)
year_month 2018-09-01 0.666667 2018-10-01 0.250000 Name: error_squared, dtype: float64
RMSE
Since the squared error would have units squared, I'll take the root of it to get a more interpretable estimate of the error.
print(mean_of.error_squared.pow(.5))
year_month 2018-09-01 0.816497 2018-10-01 0.500000 Name: error_squared, dtype: float64


We'd like for you to have routine and tangible influence over our campaign and, if elected, our congressional office. We will begin with listening points, and what we hear will guide our platform and decision making.
We will bring these listening points with us, door to door and digitally, to connect with as broad a population as we can. We will publish the stories we have heard and the influences they have on our campaign.
It's government by the people after all.
Costa has worked on long term planning for astrobiology with NASA scientists, on improving public health policies with the National Cancer Institute, on education reform efforts across US universities, and much more. His job is always to help groups of people with different jobs and viewpoints to think creatively in order to solve incredibly complex problems. Congress very much needs this kind of problem solver.
Costa grew up in a family construction company, renovating homes, and building playgrounds. He lives in Whitestone, NY, and is very excited to listen to New Yorkers about the change they’d like to see in their government.
We’ve been thinking hard about how best to run our congressional campaign, and we’re going to continue to take in feedback and adjust accordingly. We see our campaign not as a contest but as a conversation with the community. We are accountable to you, and no one else! Here’s how we’re setting up to operate...
The first and most important job of a Representative is to listen to constituents. By listening to the community, we can understand what the important issues are, and how best to get prepared to solve them.
My team and I will do all that we can to listen to you, the constituents, through the use of social media, and by showing up in person in the communities across NY District 3.
Read “Good Government Start with Listening”One of the greatest challenges we face is division. If a campaign divides people further, it causes more harm than good. We have to listen to different opinions on an issue, otherwise the policies we craft to address that issue will be severely limited.
My team and I will listen to you regardless of what political camp your views fall into, and we will work to bridge the gaps and rifts that have formed between various members and groups in the community.
Read “The Divided States of America”Americans get to work every day and solve problems. Teachers, engineers, retail staff, chefs, moms, and astronauts all work hard every day to solve problems, and public servants need to do the same. Our Congress’s inability to solve critical issues is massively disheartening, frustrating, and we can do better!
My team and I will take action on challenges and issues you raise with us. Wherever possible, we will go beyond talk, and work to solve problems.
Find out which district you are in using the NY Voter Lookup.
Costa 2018
159-15 Cross Island Pkwy
Whitestone, NY 11357


AI Katy 10K
Dates 2019-09-19 to 2019-09-30
Max Laps 4
Lapis Cost per Lap 10000
Base 5★ in EX pool 130
Summary
| 1 Lap | 2 Laps | 3 Laps | 4 Laps | |
|---|---|---|---|---|
|
Probability for
|
100.0% | 100.0% | 100.0% | 100.0% |
|
Probability for 7★
|
33.55% | 100.0% | 100.0% | 100.0% |
|
Probability for STMR
|
0.68% | 19.18% | 70.65% | 100.0% |
Stats per Lap
Pulls and Rates
| Pulls |
Rate
|
Rainbow Rate
|
|---|---|---|
| 10 | 2% | 3% |
| 9 | 1% | 3% |
| 1 | 100% | 100% |
| 1 | 7.5% | 8.75% |
| 1 | 3.75% | 5% |
Expected Value
A.I. Katy
1.4
Rainbows
1.71
Probability for at least X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 1 | 100% | 100% |
| 2 | 33.546% | 51.402% |
| 3 | 5.966% | 15.626% |
| 4 | 0.68% | 3.191% |
| 5 | 0.055% | 0.473% |
| 6 | 0.003% | 0.053% |
| 7 | 0% | 0.005% |
Probability for exactly X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 0 | 0% | 0% |
| 1 | 66.454% | 48.598% |
| 2 | 27.581% | 35.776% |
| 3 | 5.286% | 12.436% |
| 4 | 0.625% | 2.718% |
| 5 | 0.051% | 0.419% |
| 6 | 0.003% | 0.049% |
| 7 | 0% | 0.004% |
Pulls and Rates
| Pulls |
Rate
|
Rainbow Rate
|
|---|---|---|
| 20 | 2% | 3% |
| 18 | 1% | 3% |
| 2 | 100% | 100% |
| 2 | 7.5% | 8.75% |
| 2 | 3.75% | 5% |
Expected Value
A.I. Katy
2.8
Rainbows
3.42
Probability for at least X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 1 | 100% | 100% |
| 2 | 100% | 100% |
| 3 | 55.839% | 76.382% |
| 4 | 19.182% | 41.61% |
| 5 | 4.55% | 16.724% |
| 6 | 0.804% | 5.184% |
| 7 | 0.111% | 1.285% |
Probability for exactly X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 0 | 0% | 0% |
| 1 | 0% | 0% |
| 2 | 44.161% | 23.618% |
| 3 | 36.657% | 34.772% |
| 4 | 14.632% | 24.886% |
| 5 | 3.747% | 11.54% |
| 6 | 0.693% | 3.899% |
| 7 | 0.099% | 1.023% |
Pulls and Rates
| Pulls |
Rate
|
Rainbow Rate
|
|---|---|---|
| 30 | 2% | 3% |
| 27 | 1% | 3% |
| 3 | 100% | 100% |
| 3 | 7.5% | 8.75% |
| 3 | 3.75% | 5% |
Expected Value
A.I. Katy
4.21
Rainbows
5.12
Probability for at least X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 1 | 100% | 100% |
| 2 | 100% | 100% |
| 3 | 100% | 100% |
| 4 | 70.653% | 88.522% |
| 5 | 34.114% | 63.174% |
| 6 | 11.946% | 35.703% |
| 7 | 3.207% | 16.226% |
Probability for exactly X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 0 | 0% | 0% |
| 1 | 0% | 0% |
| 2 | 0% | 0% |
| 3 | 29.347% | 11.478% |
| 4 | 36.54% | 25.348% |
| 5 | 22.168% | 27.471% |
| 6 | 8.739% | 19.477% |
| 7 | 2.519% | 10.162% |
Pulls and Rates
| Pulls |
Rate
|
Rainbow Rate
|
|---|---|---|
| 40 | 2% | 3% |
| 36 | 1% | 3% |
| 4 | 100% | 100% |
| 4 | 7.5% | 8.75% |
| 4 | 3.75% | 5% |
Expected Value
A.I. Katy
5.61
Rainbows
6.83
Probability for at least X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 1 | 100% | 100% |
| 2 | 100% | 100% |
| 3 | 100% | 100% |
| 4 | 100% | 100% |
| 5 | 80.498% | 94.422% |
| 6 | 48.122% | 77.997% |
| 7 | 21.762% | 54.151% |
Probability for exactly X units
| X |
A.I. Katy
|
Rainbows
|
|---|---|---|
| 0 | 0% | 0% |
| 1 | 0% | 0% |
| 2 | 0% | 0% |
| 3 | 0% | 0% |
| 4 | 19.502% | 5.578% |
| 5 | 32.376% | 16.425% |
| 6 | 26.36% | 23.846% |
| 7 | 14.036% | 22.758% |


--- title: One App's Poison layout: post ---
It seems simple in retrospect. Surf's Up went to heroics to swallow signals: its background threads continually set signal handlers that cause only the signalling thread to exit, but leave the remaining threads unharmed. And the app didn't really need its main thread after all.


Descriptor class for PxHeightField. More...
#include <PxHeightFieldDesc.h>
Public Member Functions | |
| PX_INLINE | PxHeightFieldDesc () |
| Constructor sets to default. More... | |
| PX_INLINE void | setToDefault () |
| (re)sets the structure to the default. More... | |
| PX_INLINE bool | isValid () const |
| Returns true if the descriptor is valid. More... | |
Public Attributes | |
| PxU32 | nbRows |
| Number of sample rows in the height field samples array. More... | |
| PxU32 | nbColumns |
| Number of sample columns in the height field samples array. More... | |
| PxHeightFieldFormat::Enum | format |
| Format of the sample data. More... | |
| PxStridedData | samples |
| The samples array. More... | |
| PxReal | convexEdgeThreshold |
| PxHeightFieldFlags | flags |
| Flags bits, combined from values of the enum PxHeightFieldFlag. More... | |
Descriptor class for PxHeightField.
| PxReal PxHeightFieldDesc::convexEdgeThreshold |
This threshold is used by the collision detection to determine if a height field edge is convex and can generate contact points. Usually the convexity of an edge is determined from the angle (or cosine of the angle) between the normals of the faces sharing that edge. The height field allows a more efficient approach by comparing height values of neighboring vertices. This parameter offsets the comparison. Smaller changes than 0.5 will not alter the set of convex edges. The rule of thumb is that larger values will result in fewer edge contacts.
This parameter is ignored in contact generation with sphere and capsule primitives.
Range: [0, PX_MAX_F32)
Default: 0
| PxHeightFieldFlags PxHeightFieldDesc::flags |
Flags bits, combined from values of the enum PxHeightFieldFlag.
Default: 0
| PxHeightFieldFormat::Enum PxHeightFieldDesc::format |
Format of the sample data.
Currently the only supported format is PxHeightFieldFormat::eS16_TM:
Default: PxHeightFieldFormat::eS16_TM
| PxU32 PxHeightFieldDesc::nbColumns |
Number of sample columns in the height field samples array.
Range: >1
Default: 0
| PxU32 PxHeightFieldDesc::nbRows |
Number of sample rows in the height field samples array.
Range: >1
Default: 0
| PxStridedData PxHeightFieldDesc::samples |
The samples array.
It is copied to the SDK's storage at creation time.
There are nbRows * nbColumn samples in the array, which define nbRows * nbColumn vertices and cells, of which (nbRows - 1) * (nbColumns - 1) cells are actually used.
The array index of sample(row, column) = row * nbColumns + column. The byte offset of sample(row, column) = sampleStride * (row * nbColumns + column). The sample data follows at the offset and spans the number of bytes defined by the format. Then there are zero or more unused bytes depending on sampleStride before the next sample.
Default: NULL


Tweet
crafted with love by
Grace Dobush, Crafty Superstar
&
Paul Henrich
spot another indie craft trend?
tell us
or open a
pull request
Tapirs are the new narwhals, and CRAFTS are the new CRAFTS! (sorry, you need javascript enabled for this site to work properly)


bedtools
A swiss-army knife of tools for genomic-analysis tasks.
Used to intersect, group, convert and count data in BAM, BED, GFF/GTF, VCF format.
More information: home page
- Intersect two files regarding the sequences' strand and save the result to the specified file:
bedtools intersect -a path/to/file_1 -b path/to/file_2 -s > path/to/output_file
- Intersect two files with a left outer join, i.e. report each feature from file_1 and NULL if no overlap with file_2:
bedtools intersect -a path/to/file_1 -b path/to/file_2 -lof > path/to/output_file
- Using more efficient algorithm to intersect two pre-sorted files:
bedtools intersect -a path/to/file_1 -b path/to/file_2 -sorted > path/to/output_file
- Group file `path/to/file` based on the first three and the fifth column and summarize the sixth column by summing it up:
bedtools groupby -i path/to/file -c 1-3,5 -g 6 -o sum
- Convert bam-formatted file to a bed-formatted one:
bedtools bamtobed -i path/to/filehome pagebam > path/to/filehome pagebed
- Find for all features in file_1home pagebed the closest one in file_2home pagebed and write their distance in an extra column (input files must be sorted):
bedtools closest -a path/to/file_1home pagebed -b path/to/file_2home pagebed -d


- open - Variable in class com.alk.kucoinsdk.business.KucoinConnection
-
- Open() - Constructor for class com.alk.kucoinsdk.business.KucoinConnection.Open
-
- Order - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 12/07/18.
- Order() - Constructor for class com.alk.kucoinsdk.business.trading.Order
-
- OrderBook - Class in com.alk.kucoinsdk.business.market
-
Created by alksentrs (aleksander medella) on 25/06/18.
- OrderBook() - Constructor for class com.alk.kucoinsdk.business.market.OrderBook
-
- OrderBookData - Class in com.alk.kucoinsdk.business.market
-
Created by alksentrs (aleksander medella) on 25/06/18.
- OrderBookData() - Constructor for class com.alk.kucoinsdk.business.market.OrderBookData
-
- OrderBookDirection - Class in com.alk.kucoinsdk.business.market
-
Created by alksentrs (aleksander medella) on 25/06/18.
- OrderBookDirection() - Constructor for class com.alk.kucoinsdk.business.market.OrderBookDirection
-
- OrderData - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderData() - Constructor for class com.alk.kucoinsdk.business.trading.OrderData
-
- OrderDealt - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDealt() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDealt
-
- OrderDealtData - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDealtData() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDealtData
-
- OrderDealtDataDatas - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDealtDataDatas() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDealtDataDatas
-
- OrderDealtSpecific - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDealtSpecific() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDealtSpecific
-
- OrderDealtSpecificData - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDealtSpecificData() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDealtSpecificData
-
- OrderDealtSpecificDataDatas - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDealtSpecificDataDatas() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDealtSpecificDataDatas
-
- OrderDetails - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDetails() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDetails
-
- OrderDetailsData - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrderDetailsData() - Constructor for class com.alk.kucoinsdk.business.trading.OrderDetailsData
-
- Orders - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- Orders() - Constructor for class com.alk.kucoinsdk.business.trading.Orders
-
- OrdersData - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrdersData() - Constructor for class com.alk.kucoinsdk.business.trading.OrdersData
-
- OrdersDataDatas - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrdersDataDatas() - Constructor for class com.alk.kucoinsdk.business.trading.OrdersDataDatas
-
- OrdersDataDatasDealOrders - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrdersDataDatasDealOrders() - Constructor for class com.alk.kucoinsdk.business.trading.OrdersDataDatasDealOrders
-
- OrdersDataDatasDealOrdersDatas - Class in com.alk.kucoinsdk.business.trading
-
Created by alksentrs (aleksander medella) on 07/07/18.
- OrdersDataDatasDealOrdersDatas() - Constructor for class com.alk.kucoinsdk.business.trading.OrdersDataDatasDealOrdersDatas
-


Wikipedia - Wikipedia offers a basic summary and description of SWOT Analysis. It provides information on its uses and when it should be used.
Mindtools - Mindtools provides a more indepth look at SWOT Analysis. It provides information about how to properly complete the form and what sort of information to put down.


{% extends "base.html" %} {% block content %}
The user {{ current_user }} was registered with the given password. Now go to JupyterHub!


Artifact archiver uses Ant
org.apache.tools.ant.DirectoryScanner
which by default is case sensitive. For instance, if the job produces *.hpi
files, pattern "**/*.HPI" will fail to find them.
This option can be used to disable case sensitivity. When it's unchecked,
pattern "**/*.HPI" will match any *.hpi files, or pattern
"**/cAsEsEnSiTiVe.jar" will match a file called caseSensitive.jar.


{% extends 'base.html' %} {% block content %} {{ content|safe }} {% load static %}
Hi, my name is Alex and I'm an engineer living in Chicago, IL. I have applied experience
ranging from electrical hardware design and fabrication to embedded and customer-facing software
development. You'll currently find me exploring the consumer product development lifecycle, tinkering
with autonomous robots, or out adventuring in the city.
If you'd like to see bit of what I've worked on, please check out the selection of projects shown below!
Select a skill to see more information.
{{ job.employer }} ({{ job.location }}) — {{ job.started|date:"F Y" }} - {{ job.ended|date:"F Y" }}
{{ education.school }} — {{ education.started|date:"F Y" }} - {{ education.ended|date:"F Y" }}


--prefixedit
Incidenceedit
This flag only functions within the scope of index selection or snapshot selection.
Summaryedit
Beginning with Curator v3, --prefix
is interpreted as part of a regular
expression pattern. This means that if you specify --prefix l
, it will match
indices or snapshots named, logstash, local, l-2015.03.05, or
anything that begins with the letter l. The --suffix flag exhibits similar
behavior, but with the pattern matching the end of the line instead.
Flagsedit
-
--prefix
Prefix that indices or snapshots must match.
Exampleedit
Show indices beginning with the letter l :
curator show indices --prefix l


Store
public protocol Store
Defines the interface of Stores in Swift Flow. MainStore
is the default implementation of this
interaface. Applications have a single store that stores the entire application state.
Stores receive actions and use reducers combined with these actions, to calculate state changes.
Upon every state update a store informs all of its subscribers.
-
Initializes the store with a reducer and an intial state.
Declaration
Swift
init(reducer: AnyReducer, appState: StateType)
-
Initializes the store with a reducer, an initial state and a list of middleware. Middleware is applied in the order in which it is passed into this constructor.
Declaration
Swift
init(reducer: AnyReducer, appState: StateType, middleware: [Middleware])
-
The current state stored in the store.
Declaration
Swift
var appState: StateType { get }
-
The main dispatch function that is used by all convenience
dispatch
methods. This dispatch function can be extended by providing middlewares.Declaration
Swift
var dispatchFunction: DispatchFunction! { get }
-
Subscribes the provided subscriber to this store. Subscribers will receive a call to
newState
whenever the state in this store changes.Declaration
Swift
func subscribe(subscriber: AnyStoreSubscriber)
Parameters
subscriber
Subscriber that will receive store updates
-
Unsubscribes the provided subscriber. The subscriber will no longer receive state updates from this store.
Declaration
Swift
func unsubscribe(subscriber: AnyStoreSubscriber)
Parameters
subscriber
Subscriber that will be unsubscribed
-
Dispatches an action. This is the simplest way to modify the stores state.
Example of dispatching an action:
store.dispatch( CounterAction.IncreaseCounter )
Declaration
Swift
func dispatch(action: Action) -> Any
Parameters
action
The action that is being dispatched to the store
Return Value
By default returns the dispatched action, but middlewares can change the return type, e.g. to return promises
-
Dispatches an action creator to the store. Action creators are functions that generate actions. They are called by the store and receive the current state of the application and a reference to the store as their input.
Based on that input the action creator can either return an action or not. Alternatively the action creator can also perform an asynchronous operation and dispatch a new action at the end of it.
Example of an action creator:
func deleteNote(noteID: Int) -> ActionCreator { return { state, store in // only delete note if editing is enabled if (state.editingEnabled == true) { return NoteDataAction.DeleteNote(noteID) } else { return nil } } }
This action creator can then be dispatched as following:
store.dispatch( noteActionCreatore.deleteNote(3) )
Declaration
Swift
func dispatch(actionCreator: ActionCreator) -> Any
Return Value
By default returns the dispatched action, but middlewares can change the return type, e.g. to return promises
-
Dispatches an async action creator to the store. An async action creator generates an action creator asynchronously.
Declaration
Swift
func dispatch(asyncActionCreator: AsyncActionCreator)
-
Dispatches an action and calls the callback as soon as the action has been processed. You will receive the updated store state as part of this callback.
Example of dispatching an action and implementing a callback:
store.dispatch( CounterAction.IncreaseCounter ) { state in print("New state: \(state)") }
Declaration
Swift
func dispatch(action: Action, callback: DispatchCallback?) -> Any
Parameters
action
The action that is being dispatched to the store
Return Value
By default returns the dispatched action, but middlewares can change the return type, e.g. to return promises
-
Dispatches an action creator to the store. Action creators are functions that generate actions. They are called by the store and receive the current state of the application and a reference to the store as their input.
Based on that input the action creator can either return an action or not. Alternatively the action creator can also perform an asynchronous operation and dispatch a new action at the end of it.
Example of an action creator:
func deleteNote(noteID: Int) -> ActionCreator { return { state, store in // only delete note if editing is enabled if (state.editingEnabled == true) { return NoteDataAction.DeleteNote(noteID) } else { return nil } } }
This action creator can then be dispatched as following:
store.dispatch( noteActionCreatore.deleteNote(3) )
This overloaded version of
dispatch
will call the providedcallback
as soon as a new state has been calculated based on the dispatch action.Note
If the ActionCreator does not dispatch an action, the callback block will never be called
Declaration
Swift
func dispatch(actionCreator: ActionCreator, callback: DispatchCallback?) -> Any
Return Value
By default returns the dispatched action, but middlewares can change the return type, e.g. to return promises
-
Dispatches an async action creator to the store. An async action creator generates an action creator asynchronously. Use this method if you want to wait for the state change triggered by the asynchronously generated action creator.
This overloaded version of
dispatch
calls the providedcallback
as soon as the asynchronoously dispatched action has caused a new state calculation.Note
If the ActionCreator does not dispatch an action, the callback block will never be calledDeclaration
Swift
func dispatch(asyncActionCreator: AsyncActionCreator, callback: DispatchCallback?)


JSONClient
open class JSONClient : NSObject
A REST client that uses OAuth authentication and gets and posts JSON data.
-
Declaration
Swift
public typealias Headers = [String : String]
-
Declaration
Swift
public typealias Parameters = [String : String]
-
Errors that can be thrown by the
See moreJSONClient
. Don’t confuse the name withFoundation.JSONError
, which are thrown by Foundation parsing calls.Declaration
Swift
public enum JSONErr : Error
-
The root URL for server requests.
Declaration
Swift
public let baseUrl: URL?
-
The session that will handle all REST calls.
Declaration
Swift
open var urlSession: URLSession
-
Create the client.
Declaration
Swift
public init(baseUrl: URL? = nil)
Parameters
baseUrl
The URL against which all relative paths will be resolved. If it’s
nil
, then paths passed to client’s methods must be absolute ones.
-
Get the JSON data at the specified path (relative to the
baseUrl
) and decode it to the expected type.Throws
JSONError.invalidUrl
ifpath
contains illegal characters,JSONError.nilData
ifpath
is valid, but has no content that can be parsed,JSONError.parseFailed
if the JSON atpath
isn’t valid for the expected type.Declaration
Swift
open func get<T: Codable>(path: String, headers: Headers = Headers(), parameters: Parameters = Parameters()) -> Promise<T>
-
Declaration
Swift
open func handleSuccessfulData<T>(_ data: Data) throws -> T where T : Decodable, T : Encodable
-
Declaration
Swift
open func request(forPath path: String, headers: Headers = Headers(), parameters: Parameters = Parameters()) throws -> URLRequest


First Name: {{username.first_name}}
Last Name: {{username.last_name}}
User Name: {{username.username}}
Mail: {{username.email}}
No user data are available.


Copyright: © Less than: < Grater than: > Quotation: "
Indian Rupee: ₹ Dollar Currency: $ or $ Euro Currency: €
Smile: 😀 Victory sign: ✌ Apple: 🍎


#include <sha1.h>
◆ addUncounted()
| void Sha1Class::addUncounted |
( |
uint8_t |
data | ) |
|
|
private |
◆ hashBlock()
| void Sha1Class::hashBlock |
( |
| ) |
|
|
private |
◆ init()
| void Sha1Class::init |
( |
void |
| ) |
|
◆ initHmac()
| void Sha1Class::initHmac |
( |
const uint8_t * |
secret, |
|
|
int |
secretLength |
|
) |
| |
◆ pad()
◆ result()
| uint8_t * Sha1Class::result |
( |
void |
| ) |
|
◆ resultHmac()
| uint8_t * Sha1Class::resultHmac |
( |
void |
| ) |
|
◆ rol32()
| uint32_t Sha1Class::rol32 |
( |
uint32_t |
number, |
|
|
uint8_t |
bits |
|
) |
| |
|
private |
◆ write()
| size_t Sha1Class::write |
( |
uint8_t |
data | ) |
|
|
virtual |
◆ buffer
◆ bufferOffset
| uint8_t Sha1Class::bufferOffset |
|
private |
◆ byteCount
| uint32_t Sha1Class::byteCount |
|
private |
◆ innerHash
◆ keyBuffer
◆ state
The documentation for this class was generated from the following files:
- lib/arduino-websocket-client/sha1.h
- lib/arduino-websocket-client/sha1.cpp


GEO2ARIDEG converts geographic angles to arithmetic angles. geoAng is a scalar, vector, or matrix of geographic angles in degrees, i.e., geographic headings (North = 0, with angles positive clockwise) ariAng is an output of size(geoAng) with angles converted to angles such as those produced with atan() or atan2(). EXAMPLE USAGE geoAng = 300 [ariAng] = mcsADCP.geo2arideg(geoAng) ariAng = 150 Frank L. Engel, USGS SEE ALSO: mcsADCP, ari2geodeg
0001 function [ariAng] = geo2arideg(geoAng) 0002 %GEO2ARIDEG converts geographic angles to arithmetic angles. 0003 % geoAng is a scalar, vector, or matrix of geographic angles in 0004 % degrees, i.e., geographic headings (North = 0, with angles 0005 % positive clockwise) ariAng is an output of size(geoAng) with 0006 % angles converted to angles such as those produced with atan() 0007 % or atan2(). 0008 % 0009 % EXAMPLE USAGE 0010 % geoAng = 300 0011 % [ariAng] = mcsADCP.geo2arideg(geoAng) 0012 % ariAng = 0013 % 0014 % 150 0015 % 0016 % Frank L. Engel, USGS 0017 % 0018 % SEE ALSO: mcsADCP, ari2geodeg 0019 ariAng = 360 - geoAng + 90; 0020 ariAng(ariAng>360) = ariAng(ariAng>360) - 360; 0021 end % function geo2arideg


Last week for EDA foundations we spent time learning HTML and CSS.
(Hypertext Markup Language and Cascading Style Sheets)
I began to develop my understanding of these languages and what we can achieve with them.
This blog is made with HTML and CSS (and with the help of a CSS framework 'Bootstrap'). HTML is made up of various tags that follow a structure. We can enclose information like text and images in these tags, and our browser will interpret these tags and display our page.
HTML alone looks incredibly plain, basically like a simple Word document. We can style our HTML with CSS. Our CSS document will target "IDs" and "Classes" that we defined in our HTML. Once we have targeted these elements, we can begin to modify them and apply styling. We can style anything from background colour, font style, size and colour, we can position elements, and modify their margin, border, and padding. This just scratches the surface of possibility!
I began to imagine these concepts and how they might relate to something like a house. HTML could be the structure and foundation of the house, and CSS could style the wallpaper, rooms, and positioning of furniture around the house. Now you go into a room and reach for the light switch. Let's introduce Javascript!
Javascript (JS) is a programming language that is used in web development. We can define variables, store data in the form of objects and arrays, create and execute functions, and ultimately interact with our HTML and CSS.
Control flow is a foundational principle in programming including JS. It is the order that the code we write is executed. Our code can include conditional statements, loops, and functions. When the control flow reaches a conditional statement, an example in JS would be an 'if/else conditional statement', the flow will run through it, and it will function in accordance to how we created it.
If we go back to the house example, a simple way I can describe an if/else statement could be in the following way:
Loops are used to run code until the conditions we specify are met. A 'for loop' first initializes the loop, it then checks the condition it needs to meet so it can stop looping, and then we define how we update the loop after each iteration. Let's say we need 4 walls to build our home. We could run a for loop that has if/else statements enclosed that updates and reports back each time a wall was built, until we have 4 walls.
We can enclose the for loop from the previous example in a function. Functions are useful in javascript, they are blocks of code that perform a specified task. We can "call" them to perform their task when we want them to run. We can create paramaters for the function, and then call it back with arguments. When the previous example is created into a function, it will perform the task when the control flow reaches the stage where the function is called. The control flow will jump back to where the function was defined and execute from there. We can also call manually in the console. In the example below, the for loop only executes when the function is called on line 18.
An array enables us to store a collection of data entries in a single variable. We can add and remove from an array [ ], as well as read the contents. The first element of an array is indexed at 0. The image below demonstrates how we can access the data in an array.
Objects in JS can be thought of similarly to how we describe objects in real life. We define a variable and make it an object { } that contains properties and their description. We refer to the properties as "keys", and the description as "values" (key value pairs). These are essentially variables in an object. Similar to arrays, we can access the data, as well as manipulate it.
The Document Object Model (DOM) is what ties our HTML and CSS with Javascript. It is an interface for our web pages, known as an application programming interface (API). It is what enables our browser to interpret and render our code. We can access the DOM and manipulate it with JS, allowing us to change our HTML and CSS on demand. That means we can modify our content, structure, and styling of our web page.
Image from Kirupa


Home
(current)
Link
Dropdown
Action
Another action
Something else here
Disabled
Search
Forgot Password?


Welcome to my online portfolio where I showcase my interests in 3D Modeling, photography, and music. I hope you enjoy looking around! Feel free to contact me through LinkedIn if you’d like to get in touch.
I was introduced to 3D modeling when I was ten years old. I started by creating a copy of my elementary school in Google Sketchup and posting it on Google Earth. Since then, I’ve become a self-taught modeler in Blender. Now I model for online competitions, for 3D printing projects, and for fun. I’m interested in learning more and having a career in computer-aided design.
I've been doing photography and photo editing for ten years. In that time I've mainly focused on landscapes, and I especially enjoy taking pictures on vacation in Arches, Zion, the Redwoods, and other national parks. I started on a handheld digital camera, and now I use a Nikon DSLR. I also enjoy the photo editing process, and I'm an avid Adobe Photoshop user.
I’ve been playing trumpet since 5th grade. I have taken private lessons from Bob Peterson and am currently a student of David Blackinton. I this past year I was a member of the Timpview Symphonic Band (1st chair) and Marching Band (section leader). I was also a part of the Utah All State Band for 2016 and 2018, and I have received a superior rating at State Solo Ensemble in 2015, 2016, 2017, and 2018. I especially enjoy the teamwork and leadership opportunities that come from having played in an excellent high school band. During my time at Timpview, we have received numerous marching band awards, including 1st in division and sweepstakes. I have recently been accepted into Brigham Young University's trumpet studio as a performance major.


"BACA", VALLEY OF (Psalm 84:6; R.V., “valley of weeping,” marg., “or balsam trees”), probably a valley in some part of Palestine, or generally some one of the valleys through which pilgrims had to pass on their way to the sanctuary of Jehovah on Zion; or it may be figuratively “a valley of weeping.”
"BACA", VALLEY OF (Psalm 84:6; R.V., “valley of weeping,” marg., “or balsam trees”), probably a valley in some part of Palestine, or generally some one of the valleys through which pilgrims had to pass on their way to the sanctuary of Jehovah on Zion; or it may be figuratively “a valley of weeping.”


The work of Verena Zuber and Korbinian Strimmer1 2 3 has inspired me to create this post. The journal articles I linked to in the footnote are absolutely worth reading! I certainly enjoyed them. In this blog, I try to convey my understanding of their work on gene selection and data whitening / decorrelation as a preprocessing step.
I stumbled upon whitening through my thesis research. In my thesis, I am looking at filter methods for feature selection in high-dimensional data, specifically in microarray (genetic) data. There are many different microarray and gene sequencing methods, but for simplicity let’s assume that microarray data is information on the level of gene expression for each hybridised4 gene. The goal with these data is often classification into two groups, e.g., malignant or benign. Because the high-dimensional nature of these data does not allow us to build a simple classification model (sometimes over 20 000 genes are hybridised!), we need to select genes which are important for classification5.
Let’s take an example: we want to classify tissue in two categories: green and blue. For this, we collect pieces of green and blue tissue from as many participants (\(n\)) as possible, and we process those pieces to get their high-dimensional genomic microarray data. What results is an \(n \times p\) data matrix, where \(p\) is the amount of columns or genes hybridised6. Our task is to select the subset \(q \in p\) of genes (features) which can predict the classes best.
Aside from using black-box methods such as regularisation, support vector machines, or random forests, the most simple way of selecting the subset \(q\) is through filter methods. Many filter methods exist7, but the most straightforward one is as follows: Select the \(k\) genes with the highest differential expression, that is \(\text{abs}(\mu_{green}-\mu_{blue})\). The intuition behind this is this: genes that vary a lot across groups are very “predictive” of the class which their objects of study come from. For example, take the two hypothetical genes with expression levels below:
par(family="serif")
# Large DE
polygon(curve(expr = dnorm(x, mean = -2, sd = 1.2),
from = -7, to = 7, ylab = "Density",
xlab="Expression", bty = "L", ylim = c(0,0.37)),
border = "#006400", col = "#32CD3288")
abline(v = -2, col= "white")
par(new=TRUE)
polygon(curve(expr = dnorm(x, mean = 2, sd = 1.2),
from = -7, to = 10, ylab = "", xlim = c(-7,7),
xlab="", bty = "n", axes=FALSE, ylim = c(0,0.37)),
border = "#00008B", col = "#1E90FF88")
abline(v = 2, col= "white")
lines(x=c(-2,2), y = c(0.36, 0.36))
lines(x=c(-2,-2), y = c(0.36, 0.35))
lines(x=c(2,2), y = c(0.36, 0.35))
mtext(text = "Gene A: Large Differential Expression", side = 3)
# Small DE
polygon(curve(expr = dnorm(x, mean = -1, sd = 1.2),
from = -7, to = 7, ylab = "Density",
xlab="Expression", bty = "L", ylim = c(0,0.37)),
border = "#006400", col = "#32CD3288")
abline(v = -1, col= "white")
par(new=TRUE)
polygon(curve(expr = dnorm(x, mean = 1, sd = 1.2),
from = -7, to = 10, ylab = "", xlim = c(-7,7),
xlab="", bty = "n", axes=FALSE, ylim = c(0,0.37)),
border = "#00008B", col = "#1E90FF88")
abline(v = 1, col= "white")
lines(x=c(-1,1), y = c(0.36, 0.36))
lines(x=c(-1,-1), y = c(0.36, 0.35))
lines(x=c(1,1), y = c(0.36, 0.35))
mtext(text = "Gene B: Small Differential Expression", side = 3)
The gene with the small differential expression has more overlap between classes. Hence, if we would classify based on this gene with a method such as LDA8 or logistic regression, our misclassification rate would be higher.
There is a problem with this approach: the variance of gene expression might differ. Not taking this into account might mean that you consider a gene with high mean difference and even higher variance to be more important than a gene with moderate mean difference but a low variance. Luckily, this problem has been solved ages ago, by using the following quantity instead of the simple mean difference: \[ \frac{\mu_{green}-\mu_{blue}}{\sigma} \cdot c \], where \(c = \left( \frac{1}{n_{green}} + \frac{1}{n_{blue}} \right)^{-1/2}\)
Yes, this is a t-score. As can be seen from the equation, we are correcting for the variance in the original data. We can do this for many genes \((a, b, ...)\) at once, if we collect the variance of each gene expression in a diagonal matrix and the group means in vectors like so:
\[\mathbf{V} = \begin{bmatrix}\sigma_{a} & 0 \\ 0 & \sigma_{b}\end{bmatrix}, \quad \vec{\mu}_{green} = \begin{bmatrix} \mu^{a}_{green} \\ \mu^{b}_{green} \end{bmatrix}, \quad \vec{\mu}_{blue} = \begin{bmatrix} \mu^{a}_{blue} \\ \mu^{b}_{blue} \end{bmatrix}\]
Then we could write the t-score equation as follows9:
\[t = c \cdot \mathbf{V}^{-1/2}(\vec{\mu}_{green}-\vec{\mu}_{blue})\]
Using this score is the same as performing a differential expression score analysis on standardised data10. In standardisation, for each gene expression vector you would subtract the mean and divide by the standard deviation. The resulting vector has a standard deviation of 1 and a mean of 0. If you standardise, you basically rescale the variable, so the function in R
to do this is called scale()
.
Over and above t-score filter feature selection, there is one more issue. This issue is more complex, because unlike the previous issue it lives in multivariate space. Consider the following figure:
par(family = "serif")
blue <- function(x, y) dmvnorm(cbind(x, y), c(0.6, -0.6), matrix(c(1, 0.7, 0.7,
1), ncol = 2))
green <- function(x, y) dmvnorm(cbind(x, y), c(-0.6, 0.6), matrix(c(1, 0.7,
0.7, 1), ncol = 2))
precision <- 1000
colblue <- colorRamp(c("#1E90FF88", "#00008BDD"), alpha = T)(seq(0, 1, 0.001))
colgreen <- colorRamp(c("#32CD3288", "#006400DD"), alpha = T)(seq(0, 1, 0.001))
bmat <- outer(seq(-5, 5, length = precision), seq(-5, 5, length = precision),
blue)
gmat <- outer(seq(-5, 5, length = precision), seq(-5, 5, length = precision),
green)
blueplot <- contourplot(bmat, at = seq(0.005, 0.3, 0.01), row.values = seq(-5,
5, length = precision), column.values = seq(-5, 5, length = precision),
region = T, labels = F, contour = F, col = "white", colorkey = F, col.regions = rgb(colblue[,
1:3], alpha = colblue[, 4], maxColorValue = 255), xlab = "Gene a", ylab = "Gene b",
par.settings = list(axis.text = list(fontfamily = "serif"), par.xlab.text = list(fontfamily = "serif"),
par.ylab.text = list(fontfamily = "serif"), par.main.text = list(fontfamily = "serif"),
par.sub.text = list(fontfamily = "serif")))
greenplot <- contourplot(gmat, at = seq(0.005, 0.3, 0.01), row.values = seq(-5,
5, length = precision), column.values = seq(-5, 5, length = precision),
region = T, labels = F, contour = F, col = "white", col.regions = rgb(colgreen[,
1:3], alpha = colgreen[, 4], maxColorValue = 255))
print(blueplot + as.layer(greenplot))
In this case, Gene a and Gene b individually have a hard time separating the blue and the green category both on their differential expression scores and on their t-scores. You can visualise this by looking at the marginal distributions11.
Multivariately, however, there is little overlap between the green and blue classes. This happens because Gene a and Gene b are correlated. To correct for this correlation, we can perform another step over and above standardisation: whitening, or decorrelation. Hence the title of this blog. In the linear algebra notation of transforming the original data \(x\) to the whitened data \(z\) (specifically using ZCA-cor whitening), it is easy to see why it is an additional step:
\[z = \mathbf{P}^{-1/2}\mathbf{V}^{-1/2}x\], where \(\mathbf{P}\) indicates the correlation matrix.
So let’s see what this transformation does. Below you can find a scatterplot of randomly generated correlating bivariate data, much like one of the ellipses in the graph above. It moves from raw data in the first panel through standardised data (see the axis scale change) to decorrelated data in the third panel. The variance-covariance matrix used for generating the data was as follows:
\[\mathbf{\Sigma} = \begin{bmatrix}5 & 2.4 \\ 2.4 & 2 \end{bmatrix}\]
par(mfrow=c(1,3), family = "serif", mar = c(5,5,5,2))
# Covariance matrix
sigma <- matrix(c(5,2.4,2.4,2),ncol=2)
# Generate raw data
df <- rmvnorm(1000,c(0.6,-0.6),sigma)
plot(data.frame(df), xlab = "Gene a", ylab = "Gene b", main = "Raw data",
pch=19, col = "#1E90FF88", cex.lab=2, cex.main=2, cex.axis=1.5)
# Extract variance diagonal matrix and standardise data
V <- diag(diag(sigma))
dfstd <- data.frame(t(solve(sqrt(V))%*%t(df)))
plot(dfstd, xlab = "Gene a'", ylab = "Gene b'", main = "Standardised data",
pch=19, col = "#1E90FF88", cex.lab=2, cex.main=2, cex.axis=1.5)
# Perform ZCA-cor whitening (see paper) to decorrelate data
P <- solve(sqrt(V))%*%sigma%*%solve(sqrt(V))
W <- solve(sqrtm(P))%*%solve(sqrtm(V))
dfwhite <- data.frame(t(W%*%t(df)))
plot(dfwhite, xlab = "Gene a''", ylab = "Gene b''", main = "Whitened data",
pch=19, col = "#1E90FF88", cex.lab=2, cex.main=2, cex.axis=1.5)
The third panel shows where the name “whitening” comes from: the resulting data looks like bivariate white noise. So what happens if we perform this transformation to the two-class case? Below I generated this type of data and performed the whitening procedure. I have plotted the marginal distributions for Gene a as well, to show the effect of whitening in univariate space (note the difference in scale).
par(mfrow=c(2,2), family = "serif", mar=c(5,5,5,2))
set.seed(3665364)
# Covariance matrix
sigma <- matrix(c(5,2.4,2.4,2),ncol=2)
# Generate raw data
df <- data.frame(rbind(rmvnorm(1000,c(0.6,-0.6),sigma),
rmvnorm(1000,c(-0.6,0.6),sigma)),
colour=rep(c("#32CD3255", "#1E90FF55"), each=1000),
stringsAsFactors=F)
with(df, plot(X1, X2, xlab = "Gene a", ylab = "Gene b", main = "Raw data",
xlim=c(-6,6), ylim=c(-6,6), pch=19, col = colour, cex.lab=2,
cex.main=2, cex.axis=1.5))
# Perform ZCA-cor whitening (see paper) to decorrelate data
V <- diag(diag(sigma))
P <- solve(sqrt(V))%*%sigma%*%solve(sqrt(V))
W <- solve(sqrtm(P))%*%solve(sqrtm(V))
dfwhite <- data.frame(t(W%*%t(as.matrix(df[,1:2]))),
colour=rep(c("#32CD3255", "#1E90FF55"), each=1000),
stringsAsFactors=F)
with(dfwhite, plot(X1, X2, xlab = "Gene a'", ylab = "Gene b'", xlim=c(-4.5,4.5),
ylim=c(-4.5,4.5), main = "Whitened data", pch=19, col = colour,
cex.lab=2, cex.main=2, cex.axis=1.5))
# plot marginal gene A Raw Data
plot(NA, ylim=c(0,0.45), xlim=c(-6,6), xlab = "Gene a", ylab = "Density", main = "Raw data",
cex.lab=2, cex.main=2, cex.axis=1.5)
polygon(density(df$X1[1001:2000]), col = "#1E90FF88", border = "#00008B")
polygon(density(df$X1[1:1000]), col = "#32CD3288", border = "#006400")
# plot marginal gene A Whitened Data
plot(NA, ylim=c(0,0.45), xlim=c(-4.5,4.5), xlab = "Gene a'", ylab = "Density",
main = "Whitened data", cex.lab=2, cex.main=2, cex.axis=1.5)
polygon(density(dfwhite$X1[1001:2000]), col = "#1E90FF88", border = "#00008B")
polygon(density(dfwhite$X1[1:1000]), col = "#32CD3288", border = "#006400")
As can be seen from the plots, the whitened data shows a stronger differentiation between the classes in univariate space: the overlapping area in the marginal distribution is relatively low when compared to that of the raw data. Taking into account the correlation it has, Gene a thus has more information about the classes than we would assume based on its differential expression or its t-score.
Using this trick, Zuber and Strimmer (2009) developed the correlation-adjusted t-score, or cat score, which extends the t-score as follows:
\[\text{cat} = c \cdot \mathbf{P}^{-1/2}\mathbf{V}^{-1/2}(\vec{\mu}_{green}-\vec{\mu}_{blue})\]
In their original paper, they show that this indeed works better than the unadjusted t-score in a variety of settings. One assumption that this procedure has is that it assumes equal variance in both classes. This might be something to work on!
If you made it all the way here, congratulations! I hope you learnt something. I certainly did while writing and coding all of this information into a legible format. Let me know what you think via email!
Kessy, A., Lewin, A., & Strimmer, K. (2015). Optimal whitening and decorrelation. arXiv preprint arXiv:1512.00809.↩
Zuber, V., & Strimmer, K. (2009). Gene ranking and biomarker discovery under correlation. Bioinformatics, 25(20), 2700-2707.↩
Zuber, V., & Strimmer, K. (2011). High-dimensional regression and variable selection using CAR scores. Statistical Applications in Genetics and Molecular Biology, 10(1).↩
Hybridisation is the process of the material (often dna or rna) attaching to the cells of the microarray matrix. The more specific material there is, the higher the resulting intensity in that matrix cell↩
or use more complex methods with other disadvantages↩
Note that the problem of high dimensionality is often denoted the \(n \gg p\) problem↩
Look at this pdf page of the CMA r package user manual↩
Isn’t linear algebra great?↩
All the math comes from Kessy, Lewin, & Strimmer (2015)↩
by collapsing the densities of the green and the blue classes onto the margin (either the x or y axis) we can construct a figure such as the first two images in this post. See this image I blatantly ripped from somewhere for an example of a bivariate distribution decomposed into two marginals↩


Scraping financial data from finviz with R and rvest package
Learn how to use rvest R package to scrape finviz financial data in less than 30 lines of code. Quick rvest tutorial to start your path in financial analysis with R
Introduction
If you’re an active trader or investor, you’re probably aware of the importance of keeping up with the latest stock market news and trends. One tool that many traders use to stay on top of market movements is Finviz, a popular financial visualization website that offers a range of powerful tools and data visualizations to help traders make informed investment decisions.
While Finviz is a valuable resource for traders, manually collecting and analyzing data from the website can be time-consuming and inefficient. But this is a data science blog, right? Let’s build a scraper to make our life easier! With this simple function I’m about to show, you will be able to extract the data from the website and analyze it in a streamlined way.
Disclaimer
Before diving into the topic, it’s important to note that web scraping can potentially violate website terms of service and can even be illegal in some cases. Let’s be polite and don’t use this code to resell any information, as this is not permitted by their terms of use. For educational and personal purposes only.
Into the water
To build this simple scraper we are going to use the rvest
package. R developers are quite funny, aren’t they?
First thing is to get the full html we will parse later.
symbol <- "MSFT"
finviz_url <- glue::glue("https://finviz.com/quote.ashx?t={symbol}")
finviz_html <- tryCatch(rvest::read_html(finviz_url), error=function(e) NULL)
This is what the website look like after searching for a ticker.
We want to focus mainly on the table at the bottom which contains a ton of information for the company, including relevant data such as market capitalization, P/E, insider and institutional ownership or short interest. Also, it’s nice to have our companies organized by sector and industry, as this information is also relevant for potential analysis. Let’s get this small piece of information first, which sits right below the chart, in the middle of the page:
sector_str <- finviz_html %>%
rvest::html_element(xpath = '/html/body/div[4]/div/table[1]') %>%
rvest::html_table() %>%
head(1) %>%
pull(X4)
sector_str
## [1] "Technology | Software - Infrastructure | USA"
Finding the path to the specific element we are looking for is as easy as stepping into developing mode in the web browser (F12) and find your way to the element within the html code. Right-click and copy XPath as shown in the image below:
It’s easy to notice that the information we got above it’s all stored as a character of length one. This is typically undesirable as they represent different variables.
We can clean it easily with some text engineering. Tidyverse saves the day again:
sector_df <- sector_str %>%
str_split("[|]", simplify = T) %>%
str_squish() %>%
as_tibble() %>%
mutate(variable = c("sector", "industry", "country")) %>%
relocate(variable) %>%
add_row(variable = "ticker", value = symbol, .before = 1)
sector_df
## # A tibble: 4 × 2
## variable value
## <chr> <chr>
## 1 ticker MSFT
## 2 sector Technology
## 3 industry Software - Infrastructure
## 4 country USA
Much better.
We will scrape now the main table:
raw_tbl <- finviz_html %>%
rvest::html_element(xpath = '/html/body/div[4]/div/table[2]') %>%
rvest::html_table()
However, in this case variables and values are totally mixed up in the table:
## # A tibble: 12 × 12
## X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12
## <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 Index DJIA,… P/E 28.99 EPS … 8.99 Insi… 0.06% Shs … 7.45B Perf… 2.61%
## 2 Market Cap 1970.… Forw… 24.27 EPS … 10.75 Insi… -0.7… Shs … 7.44B Perf… -0.8…
## 3 Income 67.45B PEG 2.42 EPS … 2.23 Inst… 72.4… Shor… 0.46… Perf… 6.26%
## 4 Sales 204.0… P/S 9.65 EPS … 19.8… Inst… 0.46% Shor… 34.3… Perf… -2.2…
## 5 Book/sh 24.58 P/B 10.61 EPS … 14.8… ROA 18.8… Targ… 285.… Perf… -6.8…
## 6 Cash/sh 13.17 P/C 19.80 EPS … 12.0… ROE 39.3… 52W … 213.… Perf… 8.74%
## 7 Dividend 2.72 P/FCF 48.47 EPS … 24.3… ROI 31.3… 52W … -17.… Beta 0.91
## 8 Dividend % 1.04% Quic… 1.90 Sale… 15.5… Gros… 68.2… 52W … 22.1… ATR 6.40
## 9 Employees 221000 Curr… 1.90 Sale… 2.00% Oper… 40.5… RSI … 57.55 Vola… 2.75…
## 10 Optionable Yes Debt… 0.35 EPS … -11.… Prof… 33.0… Rel … 1.07 Prev… 253.…
## 11 Shortable Yes LT D… 0.32 Earn… Jan … Payo… 28.1… Avg … 31.2… Price 260.…
## 12 Recom 1.90 SMA20 2.01% SMA50 4.88% SMA2… 3.30% Volu… 33,6… Chan… 2.71%
We can extract headers and values with the following chunk of code:
# flatten_chr will collapse all columns into one vector
headers <- raw_tbl %>% select(seq(1,11,2)) %>% flatten_chr()
values <- raw_tbl %>% select(seq(2,12,2)) %>% flatten_chr()
This is what the header vector looks like now:
## [1] "Index" "Market Cap" "Income"
## [4] "Sales" "Book/sh" "Cash/sh"
## [7] "Dividend" "Dividend %" "Employees"
## [10] "Optionable" "Shortable" "Recom"
## [13] "P/E" "Forward P/E" "PEG"
## [16] "P/S" "P/B" "P/C"
## [19] "P/FCF" "Quick Ratio" "Current Ratio"
## [22] "Debt/Eq" "LT Debt/Eq" "SMA20"
## [25] "EPS (ttm)" "EPS next Y" "EPS next Q"
## [28] "EPS this Y" "EPS next Y" "EPS next 5Y"
## [31] "EPS past 5Y" "Sales past 5Y" "Sales Q/Q"
## [34] "EPS Q/Q" "Earnings" "SMA50"
## [37] "Insider Own" "Insider Trans" "Inst Own"
## [40] "Inst Trans" "ROA" "ROE"
## [43] "ROI" "Gross Margin" "Oper. Margin"
## [46] "Profit Margin" "Payout" "SMA200"
## [49] "Shs Outstand" "Shs Float" "Short Float / Ratio"
## [52] "Short Interest" "Target Price" "52W Range"
## [55] "52W High" "52W Low" "RSI (14)"
## [58] "Rel Volume" "Avg Volume" "Volume"
## [61] "Perf Week" "Perf Month" "Perf Quarter"
## [64] "Perf Half Y" "Perf Year" "Perf YTD"
## [67] "Beta" "ATR" "Volatility"
## [70] "Prev Close" "Price" "Change"
Perfect! Finally pasting all the info together, we get this fine data frame containing all the information:
finviz_df <- tibble(value = values) %>%
bind_cols(variable = headers, .) %>%
bind_rows(sector_df, .)
finviz_df
## # A tibble: 76 × 2
## variable value
## <chr> <chr>
## 1 ticker MSFT
## 2 sector Technology
## 3 industry Software - Infrastructure
## 4 country USA
## 5 Index DJIA, NDX, S&P 500
## 6 Market Cap 1970.40B
## 7 Income 67.45B
## 8 Sales 204.09B
## 9 Book/sh 24.58
## 10 Cash/sh 13.17
## # … with 66 more rows
Function to take away
We can easily assemble a function joining all these pieces together. Ready to rumble:
Get_finviz_data <- function(symbol){
Sys.sleep(1) # It's a good practice to use a sleep to make repeated calls to the server
finviz_url <- glue::glue("https://finviz.com/quote.ashx?t={symbol}")
finviz_html <- tryCatch(rvest::read_html(finviz_url), error=function(e) NULL)
if(is.null(finviz_html)) return(NULL)
sector_str <- finviz_html %>%
rvest::html_element(xpath = '/html/body/div[4]/div/table[1]') %>%
rvest::html_table() %>%
head(1) %>%
pull(X4)
sector_df <- sector_str %>%
str_split("[|]", simplify = T) %>%
str_squish() %>%
as_tibble() %>%
mutate(variable = c("sector", "industry", "country")) %>%
relocate(variable) %>%
add_row(variable = "ticker", value = symbol, .before = 1)
raw_tbl <- finviz_html %>%
rvest::html_element(xpath = '/html/body/div[4]/div/table[2]') %>%
rvest::html_table()
headers <- raw_tbl %>% select(seq(1,11,2)) %>% flatten_chr()
values <- raw_tbl %>% select(seq(2,12,2)) %>% flatten_chr()
finviz_df <- tibble(value = values) %>%
bind_cols(variable = headers, .) %>%
bind_rows(sector_df, .)
return(finviz_df)
}
And there you have it! A functional scraper in less than 30 lines of code where we showed how to use the convenient library rvest
to download financial data from any public company. If you are interested in using R to work with financial data, check out this series we are working on.


Carry on Abroad
Written by Graeme Huggan
Copyright 1998
This is the last Carry on film with its full regular cast in attendance, and a sense of fun is still evident in this movie. 'Wundatours Holidays' take a group of holidaymakers to the 'lovely' resort of Elsbels in Spain. In charge of the tour is Stuart Farquhar (Kenneth Williams) and his assistant Moira (Gail Granger). When they arrive, they find a shoddy and half-built hotel. The hotel manager Pepe (Peter Butterworth) takes on a number of different roles, as the butler, the manager and the porter. Meals are sub-standard due to the put-upon cook Floella (Hattie Jacques), who cannot handle her old stove. Various storylines include the prude Evelyn Blunt (June Whitfield) and her husband Stanley's (Kenneth Connor) attempt to 'enlighten' her, the complications for Vic Flange (Sid James) as he is on holiday with his wife Cora (Joan Sims) and his love interest Miss Sadie Tomkins (Barbara Windsor), and Brother Bernard's (Bernard Bresslaw) attempt to leave his order (who are on holiday) as he has become increasingly attracted to Lily (Sally Geeson). The motley bunch leave the hotel for a day in town. However, when they get there, Eustace Tuttle (Charles Hawtrey) wanders into the brothel wanting to play piggy-back! When Madame Fifi throws him out, a fight ensues involving all the holidaymakers. They are thrown in prison but are let out when Moira uses her special charms. Back at the hotel, they enjoy a farewell party. Little do they know that Pepe has built his hotel on a riverbed and the recent torrential rain is flowing down in streams! A good Carry on film because of its regular cast and its interesting characterisations, but the jokes are waring thin and some comical moments do not work such as the fight sequence. Sid James is as lecherous as ever, Joan Sims is good as the downtrodden wife (again!) and Barbara Windsor goes through the motions as Sadie. Peter Butterworth expertly plays the crazy Spanish hotel manager and Hattie Jacques shows that she can be comical in a small but very different part (not as a Matron-type figure again). Furthermore, the performances of Kenneth Connor and June Whitfield are very memorable. On the other hand, Kenneth Williams takes a back seat in the proceedings, Carol Hawkins is annoying as Marge (Lily's friend), and David Kernan as Nicholas and John Clive as Robin provide us with two irritating and annoying performances. Also, we are subjected to the abysmal performances of Jimmy Logan as Bert Conway (Sadie's eventual love interest) and a cameo by Jack Douglas as Harry. I would suggest you press the mute button on your remote control when these two appear! Carry on Abroad was the last Carry on film with Charles Hawtrey. This was probably due to him being drunk on set. His performance as Eustace is very amusing, especially his scenes with his mother and on the bus. The final scene, which alludes to Eustace's alcoholism, is rather poignant. There are many good aspects and flaws in this Carry on film. The story is okay, the regular cast are entertaining as usual, but the supporting cast of non-regulars leave a lot to be desired.
My rating:- 3 out of 5 stars.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


var expectedFailures = new goog.testing.ExpectedFailures(); function tearDown() { expectedFailures.handleTearDown(); } function testSomethingThatBreaksInWebKit() { expectedFailures.expectFailureFor(goog.userAgent.WEBKIT); try { ... assert(somethingThatFailsInWebKit); ... } catch (e) { expectedFailures.handleException(e); } }
| goog.testing.ExpectedFailures |
|
expectFailureFor(condition, opt_message)
Register to expect failure for the given condition. Multiple calls to this
function act as a boolean OR. The first applicable message will be used.
Arguments:
|
code » | |||
|
getExpectationMessage_()
⇒
No description.
Returns:
A warning describing an expected failure that didn't occur.
|
code » | |||
|
handleException(ex)
Handle an exception, suppressing it if it is a unit test failure that we
expected.
Arguments:
|
code » | |||
|
handleTearDown()
No description.
|
code » | |||
|
isExceptionExpected(ex)
⇒
Determines if the given exception was expected.
|
code » | |||
|
reset_()
Reset internal state.
|
code » | |||
|
run(func, opt_lenient)
Run the given function, catching any expected failures.
Arguments:
|
code » |
|
logger_
:
Logger for the expected failures.
|
Code » |
|
goog.testing.ExpectedFailures.setUpConsole_()
Sets up the debug console, if it isn't already set up.
|
code » |
|
The lazily created debugging console.
|
Code » |


×
My post title
Load Comments ↓
Edit Post
×
Post title
Post body
Delete Post
×
Are you sure you want to delete the post?


After 7 successful years working in the travel industry, I am ready for my next challenge. I love technology, so studying web development seemed obvious to me. I love to learn and I am passionate about giving back. My skill set and passions give me a unique perspective.I can't wait to share it with the world!


We optimize cats!
- e-enable frictionless niches
- innovate virtual e-services
- optimize intuitive convergence
- revolutionize interactive metrics
- transition open-source markets
- incentivize revolutionary functionalities
- incentivize front-end systems
- incubate front-end infomediaries
- productize integrated markets
- redefine 24/7 e-commerce
- reintermediate end-to-end models


{% extends 'base.html' %} {% load widget_tweaks %} {% block title %} Request list {% endblock %} {% block judgerequest_active %} class="active" {% endblock %} {% block content %}
| Feature | Judge 1 score | Judge 2 score | Final score | Passed | Status | {% for judge_request in judge_requests %}
|---|---|---|---|---|---|
| {{ judge_request.feature }} | {{ judge_request.judge1_score }} | {{ judge_request.judge2_score }} | {{ judge_request.score }} | closed{% else %}green">open{% endif %} |


Click each image to see how attacked deep reinforcement learning agents
act in Atari 2600.
We introduce two tactics to attack agents trained by deep reinforcement learning algorithms
using
adversarial examples:
Strategically-timed attack: the adversary aims at minimizing
the agent's reward by only attacking the
agent at a small subset of time steps in an episode.
Limiting the attack activity to this subset helps prevent
detection of the attack by the agent. We propose
a novel method to determine when an adversarial
example should be crafted and applied.
Enchanting attack: the adversary aims at luring
the agent to a designated target state. This
is achieved by combining a generative model and
a planning algorithm: while the generative model
predicts the future states, the planning algorithm
generates a preferred sequence of actions for luring
the agent. A sequence of adversarial examples are
then crafted to lure the agent to take the preferred
sequence of actions.
We apply the two tactics to
the agents trained by the state-of-the-art deep reinforcement
learning algorithm including DQN and
A3C. In 5 Atari games, our strategically-timed attack
reduces as much reward as the uniform attack
(i.e., attacking at every time step) does by attacking
merely 25% of timesteps on average. Our enchanting attack
lures the agent toward designated target states with
a more than 70% success rate.


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 2
A must for all recipe binders - this quick and easy, healthy steamed fish recipe is bursting with fresh flavour.
This meal provides 346 kcal, 38.7g protein, 2.4g carbohydrate (of which 2.3g sugars), 20.1g fat (of which 3.4g saturates), 2.8g fibre and 4.7g salt per portion.
In a food processor blend together the coriander leaves and stalks, the mint leaves, ginger, garlic, salt, chilli, lime juice and fish sauce and process until smooth.
Place the salmon fillets in a shallow dish and pour over half of the sauce. Leave to marinate for 20 minutes.
Pour the rice into a pan of boiling water and cook according to the packet instructions.
Turn on the steamer and place the bok choi on the bottom layer. Place the marinated salmon fillets in the top half of the steamer and cook for 6- 8 minutes until the fish is just cooked and the bok choi is tender.
Drain the rice and stir through the sliced chilli and roughly chopped coriander. Season with salt and divide between serving plates.
Remove the salmon and bok choi from the steamer and arrange on top of the rice. Pour the reserved sauce over the salmon and serve immediately with a wedge of lime.


OUTER HEAVEA
Life is a game, so level up and enjoy it.
About Me
Student
Programer
Video Gamer
Soccer Player
Find Me
<EMAIL_ADDRESS>github
stackoverflow
{{content}}


[Erowid Note: '4ace' is more commonly used to describe 4-AcO-DiPT, which leads to some confusion about the identity of the substance described in this report.]
set: party mode
setting: hanging with 3 friends indoors and then outdoors for a bit
I dose out 4 x 45mg parachutes of 4aces. Two of my friends back out and decline, so it's just me and a friend tripping. We swallow the ball of tissue down with a beer and begin smoking a blunt.
10 minutes later I'm starting to feel very, very relaxed, in that unmistakable serotonergic way that these psychedelics work through. I'm starting to feel my mindspace becoming larger every second, that space where my thoughts are . . . expanding, a vast auditorium now echoing with my inner chatter and sensations. The expansion comes with a physical sensation of warmth, vibration, and a kind of subtle poisoning effect; some medicines work this way.
I begin to feel a discomfort in my stomach, which rapidly escalates to a pain and nausea, and I run to the bathroom and in one or two heaves empty my stomach. I had previously eaten some shady lebanese food that was a little weird for my stomach, it came up. I felt much better right away and the vomiting was quick and painless. I'm glad I didn't fight it and let it happen.
I come back and my friend takes one look at me and says 'you are SO HIGH!'. He says it as though he's afraid for me, which makes me giggle inside . . . degree does not imply quality, and in my experience, if it does, then in psychedelics greater degree of effects implies more positive degree of effects, if only in hindsight. The medicine always, always heals, and more of it will heal more, though individual chemical nuances must be taken into account when increasing dose.
The two sober friends leave for a while to go grab some K, leaving me and my friend M alone. M is not feeling so hot . . . this is very intense for her, and she feels a bit queasy too but doesn't vomit. The stomach ailments only last for about 30 minutes, during the come up, invariably the most uncomfortable part of a psychedelic journey.
We lay on the bed, staring at that which eyes cannot see, looking at each other with understanding and warmth. She searches for a cigarette to help with the jitters of being blasted to a +++/++++ within 15 minutes, but alas one of the departed sober friends took them. She sits on the ground and stares at her dog who is running in his sleep, kicking her kitten who is trying to snuggle with him. The scene is far too precious even in a sober state, and it causes us to absolutely fall apart with giggles and happiness . . we laugh, and laugh, and she starts crying from the laughter . . . I can see she is emotionally overwhelmed by this medicine.
This was not a good time for her to trip, and I am worried that I have brought her on a journey she should not be taking. I only gave her this dose because she'd done it once before and wasn't too blown away. But every trip is different, even with the same substance and same dosage . . . and course when you're dealing with an accuracy of +/- 3mg, that can make a huge difference. 40mg might be a great fun light trip, 43mg might be a horribly difficult excursion into the depths of your deepest darkest self.
I look at her a while and ask her gently if she's ok, and she nods her head, and I can tell they are tears of emotional release, she's been needing to cry them for a while. She cries and laughs some more and then fixes her makeup, which is not easy to do at this point.
 Me and M are so high this time that the two other friends I feel are getting annoyed, we are just lost in the process. I am accosted several times in the night by them for sitting cross legged staring at a wall motionless . . . it's unfortunate that we took something that is best used for individual use or in a setting where everyone is on the same page. You know it's awful to do psychedelics around sober people as a general rule, but it can be even worse to do them around people who are on other substances than I am (like booze pot and k). Not being on the same page mentally in a social situation can lead to some friction and baseless drama and such, but in my state I could see the causes and effects of these things happening and was not worried, I knew there wouldn't be any lasting nastiness.
Eventually it's time to go home and I walk home, very shakingly, make it home, tire myself out some more, smoke some more, and sleep.
There was virtually no visual aspect of the trip to speak of . . . very very light on that end, as 4aces can be. It was all to do with thought processes, introspection, revealing inner drives and wants and truths. I think I bonded very well with M and we were very close to begin with. I think she found herself in a scary vulnerable spot and me just being there with her, in that same spot, calm and understanding, allowed her to breathe and not drown.
Overall a poor choice of substance and dose. I will be saving all my 4-aco-dmt for only the most serious of sessions. It is far too heavy, extremely heavy. Heavier than LSD imo.  It pushes my face into the most unfaltering and honest exposure of the minutiae of what I am . . . to be forced to perceive the normally invisible machinations of my mind is always shocking, both in what it is I see and in the knowledge that this is nothing new; I am only being shown what was always there, hidden from my attention, below and above my magnification and normal conscious context, unavailable in standard resolution.
This one sometimes makes me think 'psychological', not 'psychedelic'. Handle with care :)
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Answer all questions in a plain text file
named questions8.txt
.
At the top of your plain text file, include your name, student ID, and lab section.
pestp1.t
should be a separate .t file.
Do not add a .txt extension.
Your source code should be a plain .t file.
Use scp
to retrieve this file from tux.
Failure to do so will result in a 0.
This is the first step in a series of labs that will culminate in the development of your own virtual pet implemented using HTML and Tranquility
There are several steps to this phase of the project:
For this question, put the link to your webpage titled pestp1.html
Submit on BBLearn
questions8.txt : A plain text file with your answers to the questions (25pts)
pestp1.t : Your resulting source code (75pts)
Webpage on tux
pestp1.html : Your resulting webpage you make


All Files (44.59% covered at 0.83 hits/line)
11 files in total.
74 relevant lines.
33 lines covered and
41 lines missed
| File | % covered | Lines | Relevant Lines | Lines covered | Lines missed | Avg. Hits / Line |
|---|---|---|---|---|---|---|
| app/controllers/application_controller.rb | 100.0 % | 3 | 2 | 2 | 0 | 1.0 |
| app/controllers/comments_controller.rb | 30.0 % | 17 | 10 | 3 | 7 | 0.3 |
| app/controllers/home_controller.rb | 100.0 % | 4 | 2 | 2 | 0 | 1.0 |
| app/controllers/scotches_controller.rb | 20.0 % | 86 | 40 | 8 | 32 | 0.2 |
| app/helpers/application_helper.rb | 100.0 % | 2 | 1 | 1 | 0 | 1.0 |
| app/helpers/comments_helper.rb | 100.0 % | 2 | 1 | 1 | 0 | 1.0 |
| app/helpers/home_helper.rb | 100.0 % | 2 | 1 | 1 | 0 | 1.0 |
| app/helpers/scotches_helper.rb | 66.67 % | 5 | 3 | 2 | 1 | 0.7 |
| app/models/comment.rb | 100.0 % | 4 | 3 | 3 | 0 | 1.0 |
| app/models/scotch.rb | 87.5 % | 11 | 8 | 7 | 1 | 0.9 |
| app/models/tag.rb | 100.0 % | 5 | 3 | 3 | 0 | 1.0 |
Controllers (27.78% covered at 0.63 hits/line)
4 files in total.
54 relevant lines.
15 lines covered and
39 lines missed
| File | % covered | Lines | Relevant Lines | Lines covered | Lines missed | Avg. Hits / Line |
|---|---|---|---|---|---|---|
| app/controllers/application_controller.rb | 100.0 % | 3 | 2 | 2 | 0 | 1.0 |
| app/controllers/comments_controller.rb | 30.0 % | 17 | 10 | 3 | 7 | 0.3 |
| app/controllers/home_controller.rb | 100.0 % | 4 | 2 | 2 | 0 | 1.0 |
| app/controllers/scotches_controller.rb | 20.0 % | 86 | 40 | 8 | 32 | 0.2 |
Models (92.86% covered at 0.97 hits/line)
3 files in total.
14 relevant lines.
13 lines covered and
1 lines missed
| File | % covered | Lines | Relevant Lines | Lines covered | Lines missed | Avg. Hits / Line |
|---|---|---|---|---|---|---|
| app/models/comment.rb | 100.0 % | 4 | 3 | 3 | 0 | 1.0 |
| app/models/scotch.rb | 87.5 % | 11 | 8 | 7 | 1 | 0.9 |
| app/models/tag.rb | 100.0 % | 5 | 3 | 3 | 0 | 1.0 |
Mailers (100.0% covered at 0.0 hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File | % covered | Lines | Relevant Lines | Lines covered | Lines missed | Avg. Hits / Line |
|---|
Helpers (83.33% covered at 0.93 hits/line)
4 files in total.
6 relevant lines.
5 lines covered and
1 lines missed
| File | % covered | Lines | Relevant Lines | Lines covered | Lines missed | Avg. Hits / Line |
|---|---|---|---|---|---|---|
| app/helpers/application_helper.rb | 100.0 % | 2 | 1 | 1 | 0 | 1.0 |
| app/helpers/comments_helper.rb | 100.0 % | 2 | 1 | 1 | 0 | 1.0 |
| app/helpers/home_helper.rb | 100.0 % | 2 | 1 | 1 | 0 | 1.0 |
| app/helpers/scotches_helper.rb | 66.67 % | 5 | 3 | 2 | 1 | 0.7 |


HOME
ABOUT US
ORDERS
STORE
SALES
Salmon Cookies
Store Location
Min Customer
Max Customer
Average Sale


My first buy of KMD was a bit during their presentation in that library a few years back. I think around .0008 at the time...we’ve come so far since
Kay Gee26-Jun-19 05:21 AM
@Markus yeah.
Kay Gee26-Jun-19 05:22 AM
I’m assuming you have that saying wherever you guys are...?
Markus26-Jun-19 05:23 AM
Lets hope next update bring it back to arleast 20k
tolken26-Jun-19 05:23 AM
I predict by September we’ll be at > 0.0004
Kay Gee26-Jun-19 05:24 AM
My only issue is the mixed messages we get
For right or for wrong, I was expecting a rebrand and rename last winter
I was waiting on updates GUI on Dex From last summer
grumpygoron26-Jun-19 05:24 AM
We’ve been waiting a long time for stuff promised to be delivered long ago
Kay Gee26-Jun-19 05:24 AM
I’ve been hearing rumblings about mobile DEX for what seems to be an age
Markus26-Jun-19 05:24 AM
im starting to wonder if ppl really sell with this huge loss against btc and being so greedy for the btc profits
tolken26-Jun-19 05:25 AM
I expected it last summer. Pretty sure it’s happenin now though
Markus26-Jun-19 05:25 AM
or if there is something wrong
Kay Gee26-Jun-19 05:27 AM
@tolken , you’re prediction is in line with my optimism. Not sure who discernible the two are!
actionslacks26-Jun-19 05:35 AM
the team has delivered the tech in the past. there's no reason to believe anything will stop the tech thats coming. maybe war.
LocoMB26-Jun-19 05:53 AM
BTC still chugging away fast forward .. cool! Dramatic overnight effect for european time zones, $1100(edited)
Cryptoon26-Jun-19 06:03 AM
Btc dominance at 61.8%
Almost there
p.26-Jun-19 06:09 AM
Almost where
Death?
ComputerGenie 👴👴👴26-Jun-19 06:13 AM
that moment when you want to flag someone's good comment and they blocked you because they are juvenile....
Cryptoon26-Jun-19 06:24 AM
Almost at top dominance from last bullrun @p.
ComputerGenie 👴👴👴26-Jun-19 06:25 AM
12.5....
Just think of the poor dumb bastids that thought they did good getting out at 6800
actionslacks26-Jun-19 06:31 AM
not so bad if you bought at $600. but, yeah, it stings a little. 12.6


Reminder: ‘All welcome’ for Dublin Macra club fundraiser
by Charles O'DonnellHill 16 – one of Macra na Feirme’s top clubs in Co. Dublin – is set to hold its annual fundraiser tonight, Wednesday, November 20, in aid of Hugh’s House charity and the northside club.
The charity, located in the city centre, provides ‘home-from-home’ accommodation to the families of children that are long-term in-patients at Temple Street Children’s Hospital, The National Maternity Hospital at Holles Street, The Coombe Hospital and The Rotunda Hospital.
The service – which operates all year round – was established by Ade Stack and Martin Curley, from Malahide, in May 2015, in memory of their son, Hugh.
Born on December 12, 2012, Hugh battled a rare illness at The Rotunda Hospital for 247 days, before tragically succumbing to his illness. He was just eight months old.
Throughout their journey at the hospital with Hugh, Ade and Martin observed many other struggling and exhausted families, under severe pressure, who were left with no option but to sleep on chairs, floors and in corridors – often for months at a time.
The reasons being that these parents and families often came from rural areas hundreds of miles from the capital, or because they didn’t have the financial resources to cover the cost of accommodation near the hospital where their child was undergoing crucial treatment.
After their son’s passing, Ade and Martin decided that they wanted to help these families by offering them a bed, a hot meal, a cup of tea and a garden space.
And so, the couple decided to invest in the purchase of a property located just five minutes walking distance from the main hospitals – they called it Hugh’s House.
The property can now accommodate up to 11 families, with many staying there for quite substantial periods.
Table quiz
Macra’s Hill 16 club – one of three clubs in the capital at the moment – has built a strong relationship with the nearby charity over recent years and it has hosted a number of events in support of Hugh’s House.
The club will this year hold a table quiz to help bolster funds for the cause.
The table quiz will take place at Doheny & Nesbitt’s bar, located along Baggot Street Lower, Dublin 2, tonight, Wednesday, November 20, at 7:30pm.
All funds raised at the event will go towards Hugh’s House and towards the Macra Hill 16 club. Organisers say “all are welcome to attend”.


If you deposit Null, at an interest rate of Null%. You will receive an amount of Null, in the year Null