fabiochiu/medium-articles huggingface dataset:
Pricing Bitcoin Options using Black-Scholes in R
Tags: Bitcoin, Options Trading, Trading, Trading Ideas, Cryptocurrency

Pricing Bitcoin Options using Black-Scholes in R Cassius Follow Oct 16 · 2 min read

How to calculate the intrinsic value of a BTC call or put in R.

More than $100m of Bitcoin options are traded daily, however, most of the volumes are with a single exchange — Deribit.

Bitcoin option volumes

We find that ATM implied vol is significantly lower than OTM implied vol on Deribit. Nevertheless, ATM implied volatility is several times higher than VIX (equity implied vol). High implied volatility naturally means Bitcoin options are considerably more expensive than equity (especially index) options. This means that potentially it could be profitable writing puts and calls on Deribit.

Implied annual volatility for BTC

Pricing Bitcoin options in R

Let us first create a list, storing the option specifications.

When does this European option expire?

Is it a call or put? (type = “call” or “put”)

Are you buying or selling? (position +1 or -1)

What is the strike price?

It should look something like this:

optSpec <- list(

expiryDate = as.Date("2020-12-25"), # date of expiry

type = "call", # call or put

position = 1, # 1 for long and -1 for short

strike = 10000 # strike price

)

Next we create a function that calculates option prices:

optSpec is the option specifications we discussed above — it is a list of option parameters

is the option specifications we discussed above — it is a list of option parameters underlyingPrice is the price of Bitcoin

is the price of Bitcoin sigma is the volatility of Bitcoin (annualized)

is the volatility of Bitcoin (annualized) curDate is the current date, if nothing inputted, then it finds out today’s date

is the current date, if nothing inputted, then it finds out today’s date r is the risk-free rate; default is 0%

calcOptPrice <- function(optSpec, underlyingPrice, sigma, curDate = NULL, r= 0) {

if (is.null(curDate)) {

curDate <- Sys.Date()

}

Time <- as.numeric(optSpec$expiryDate - curDate) / 365

d1 <- (log(underlyingPrice/optSpec$strike) + (r + sigma^2/2 ) *Time ) / (sigma*sqrt(Time))

d2 <- d1 - sigma*sqrt(Time)



if (optSpec$type == "call") {

value <- underlyingPrice*pnorm(d1) - optSpec$strike*exp(-r*Time)*pnorm(d2)

return(value)

} else if (optSpec$type == "put") {

value <- (optSpec$strike *exp(-r*Time))*pnorm(-d2) - underlyingPrice*pnorm(-d1)

return(value)



} else {

return(0)

}

}

Example:

Say we’re trying to price a December Put at 9,000:

optSpec <- list()

optSpec$expiryDate <- as.Date("2020-12-25")

optSpec$strike <- 9000

optSpec$type = "put"

optSpec$position = -1

underlyingPrice <- 11095

sigma <- 0.72 calcOptPrice(optSpecs, underlyingPrice, sigma)

With a volatility estimate of 72%, the value of the option is $475.22
Data are Beautiful
By: Philip Shemella
Tags: Language, Data Visualization, Data Journalism

A datum is a single piece of information. There are two plural forms for datum. The lesser known form, datums, is used exclusively in surveying and geodesy. The other plural form surrounds us both physically and figuratively. It can be big or small, right or wrong, new or old, dull or interesting. In the end it’s just a long line of 1s and 0s, stored right here or way over there. I’m talking about data.

There are even multiple ways to pronounce it.

Because data is a plural noun, it's technically more correct in English to say “data are”. But in the real-world, using “data is” is fine, especially because it’s considered to be a mass noun. Outside of the real world, there is some debate between “data is” and “data are” (here, here or here, for example). But languages evolve — I’m cool with that. I don’t even care if you say datas, as long as those datas are good.

It turns out that "data is" and "data are" occur about equally, after the strong decline of "data are" in the 80s and 90s. And this data ain't for chatspeak, it's text that was published and hopefully edited, according to Google's N-gram viewer.

Who is more likely to still use the proper phrasing? It's those pesky British English speakers and writers in red that are holding on. (As compared to American English, in blue.)

In all forms of English, an interesting observation stands out: When starting a sentence, the trend reverses. "The data are" and "Data are" are approximately twice as common as "The data is" and "Data is".

I have no idea why, but I'll list any good guess here:

Idea 1. People tend to be more careful with their words at the beginning of a statement...

Idea 2. ________________________

Whatever you prefer, we can agree that Data was, were, is, are, and will be Beautiful. (And sometimes ugly.)

Data - it’s still more popular than sex, drugs, and rock & roll.

But only in books.

Across the entire internet,

sex still wins.

Made it this far? Why not say Hi! on Twitter? @philshem
What is a Bitcoin ATM?
Tags: Bitcoin, Bitcoin Atms, Cryptocurrency, Crypto, Finance

A Bitcoin ATM (also referred to as a Bitcoin kiosk) is a physical device used for withdrawing Bitcoin and other cryptocurrencies available as cash. Users can also use Bitcoin ATMs to buy cryptocurrencies with money and have the purchased cryptocoins sent to their software or hardware wallets immediately.

BTMs are much like the traditional ATM that dispenses fiat currencies where you use your debit card to withdraw TRY, EUR, INR etc. However, unlike the traditional fiat ATMs, some Bitcoin ATMs actually allow you to withdraw Bitcoin from it. Some help you convert your Bitcoin into fiat currencies, while there are also some that help with both like Gobaba Bitcoin ATMs. Currently there are 3110 Bitcoin ATMs in 7o countries from all over the world. You can find the full list below.

How Gobaba Bitcoin ATM works

You can buy Bitcoin and other cryptocurrencies in 3 simple steps:

Scan Your QR Code — Use your crypto wallet’s and scan the QR code of your wallet address you’d like to send Bitcoin.

— Use your crypto wallet’s and scan the QR code of your wallet address you’d like to send Bitcoin. Insert Notes — Enter the amount of cash to be exchanged for cryptocurrencies.

— Enter the amount of cash to be exchanged for cryptocurrencies. Receive Cryptocoins— Press ‘Send Bitcoin’ and once your transaction is confirmed within seconds you will have your fresh cryptocoins right in your wallet!
Family Online Shopping
By: Pretheesh Presannan
Tags: Humor, Short Read, Comedy, Funny, Creative Writing

Family Online Shopping

Just for fun

Photo by visuals on Unsplash

Mr. Arnold and his wife ordered some stuff online. They got worried as the date of arrival had passed and the ordered items had not yet arrived. They contacted the company. The company asked them to send some proof showing that they had not actually received the ordered items.

He was so confused that what possible proof could he send anyway. Later an idea clicked on his head. He took the photo of his empty wrist, as it was a watch which he ordered online. He believed posting the photo of his empty wrist on that company’s Facebook page with a note would serve as proof for non-arrival of the watch and possibly force them to take immediate action.

As expected, a lot of people saw his post on the company’s Facebook page. He not only got a lot of likes and comments for the post but also a lot of friend requests and followers.

He felt so happy and took great pride in his idea. He immediately shared it with his beloved wife. Even she patted on his back and went away. He had never received such applause from his wife all these years.

Sitting in his bed relaxed, thinking again about his idea, Mr. Arnold had a frightening thought pop up in his head: “Wait? Is my wife going to do the same? And what did she ordered? Bra…fucking bra…. He ran towards his wife before it was too late.
Greetings From a Galaxy Far, Far Away
By: Pixel Magazine
Tags: Advertising, Star Wars, Art, Photography

There are times when less is more. With a sweeping, cinematic vision for this fantastic project that could have been a candidate for a lot of post-production reworking, I pulled back and went as old school as I could. I approached this series of images almost as an old Ray Harryhausen stop action movie. I wanted all of the elements to be tangibly together, for these toys to inhabit sets that had been built with great care and detail to evoke another world. Continuous lights were used, as were colored gels to shift the color to the worlds of the Star Wars narrative.

Special effects were used on set so everything was captured in camera. In post, working again with Sugar Digital, we simply modified color and tones to play up the drama of the sets and accentuate the pop of Target red. Even when I pour myself into the in-camera construction, precise post is quietly vital to sharpen the product.

Tea Time, Starbucks at the Greystone Mansion

I’ve been working with movie lights and crews for approximately 10 years now. When the Starbucks campaign for Tazo became a possibility, I knew I wanted to incorporate a cinematic and enchanted look and feel. Lighting and location were the driving force behind this project. The Greystone mansion is an historic and cinematically recognizable location from movies such as There Will Be Blood. The interiors had windows that never received direct sunlight so everything was lit artificially. I’m a nerd, a lighting nerd at that, and I love working with continuous lights and instruments because of the natural lighting effect they create.
Colonists’ and Emigrants’ Route to Texas
By: Texas General Land Office
Tags: Maps, Railroad, Texas, History

Railroads spread across the country, creating a connected transportation network.

An inset in the upper right corner shows the spread of railroads throughout the Midwest, the South, and the eastern portion of the country, encouraging immigration to Texas from throughout the United States. There are connections to Texas as far north as Chicago, New York, and Canada. According to information provided by the company, the I&GN controlled almost 520 miles of rail in the state by 1878.

The map’s verso is a portable advertisement for the International & Great Northern Railroad, which sought to draw the attention of immigrants by outlining the company’s benefits. The railroad prided itself on extending the greatest hospitality to newcomers, claiming to make “every effort, under a well-organized system, to promote the welfare of those seeking new homes and better fortunes in our great and growing State.”

The International & Great Northern Railroad Immigrants’ Home provided newcomers with a safe place to stay while they located permanent housing in the state. Women and children depicted on the balcony, and a church steeple included in the background, indicated the positive moral atmosphere for families in Texas.

The company sponsored an “Immigrants’ Home” in Palestine, which provided “stoves and cooking utensils…fuel, water, and lights” free of charge, and promised a stay for “families for a reasonable time in comfort and under protection” until permanent settlement could be found. They drew attention to the “very low rates” of tickets for immigrants, the luxury of the rides, and promoted the new dining cars available on their trains. Times tables were made available, advertising the speed of an I&GN journey from the rest of the rail-accessible country to the Lone Star State. The company also promotes easy access to Mexican rail lines and markets on the Pacific coast.

The I&GN paid special attention to Austin and San Antonio and their favorable climates. Boasting of the railroad’s benefit to the capital city, the advertisement announced that “if Texans love the great commonwealth, and are boastful and hopeful of its future, and proud of the virtues of great men and pure and faultless women, they may also congratulate themselves that the International & Great Northern Railroad and nature are doing their utmost, and contributing alike with lavish hands, to the perfection of every charm that makes Austin the worthy capitol of the mighty commonwealth.”

The railroad prided themselves on the superior amenities of their trains. Among these was the advent of the “dining car,” which provided a welcome convenience to those who could afford it.

The International & Great Northern Railroad was one of the many rail companies which greatly increased access to Texas after the Civil War. The railroads stimulated immigration and introduced new culture and commerce to the state, and this map was a useful tool in encouraging growth.
【程式學習之路：Day52】物聯網應用與實作： 感測器
By: 莎莉 Sally
Tags: Coding, 程式語言, Data Science, IoT, Sensor

in In Fitness And In Health
Coindelta — We have decorated our home for Diwali celebrations, have you?
By: Rajdeep Singh
Tags: Blockchain, Exchange, Ethereum, India, Qtum

Diwali is coming, everyone is working on decorating their homes. We have tried to do the same for past few weeks, yes we stay at coindelta.com! it’s a home for us. We have revamped our home with new features and design changes. After inputs from the community, we have introduced the most desired functionalities that we felt were necessary to give a better trading experience and keep the users active on the platform.

The new features include but not limited to:

1. Anonymous troll box: A place for the users to shout anonymously. We kept it anonymous to keep up the secrecy of our users while giving them a place to present their views to others. You can pick a cool username which is a one time pick, so you better hurry if you want to pick a name of your choice.

2. Payment Gateway: Now users can instantly add money to their account by using a payment gateway by paying a small fee to the gateway provider. We have kept the IMPS, NEFT, and RTGS deposits for the users who want to avoid the extra fees.

3. Charts: The new charts on the market pages have been introduced for the better analysis of markets. Users can select the time, zoom in and out and select candlestick time to analyse the behaviour of the market.

4. Last 24 hr Change: Last 24 hr change has been added in the price ticker as an indicator for the market shifts.

5. Twitter Feed: We have added the Twitter feed on the market page to keep you updated about what are we up to.

6. Apart from these, there were some security improvements and few bug fixes.

While updating these features, we have also added a new cryptocurrency Qtum with markets in QTUM-INR and QTUM-BTC. Qtum is a smart contract platform for industry use cases, allowing the mobile use of smart contracts and employing a Proof-of-Stake consensus protocol. You can get more details on by visiting their website.

We are working on adding few more cryptocurrencies in coming weeks, the names cannot be disclosed at this moment. But you can get the hints by joining our telegram community (We will add what people in our community are looking for).

A HAPPY DIWALI TO ALL OF YOU! MAY YOUR CRYPTOS PROVIDE YOU WITH A ROCKET TO THE MOON!
Web accessibility is not a design constraint
By: Clayton Hopkins
Tags: A11y, Human Centered Design, UX Design, Web Development, Accessibility

Most people cannot imagine life without the Internet. But can you imagine being the only person without access while the rest of the world carries on without you? I don’t know about you, but I’d give up a lot of other things before giving up the Internet.

Recently, web accessibility specialist at the University of California, Berkeley, Anna Gazdowicz, spoke with me about effective ways designers and developers can be more practical web accessibility advocates.

“Accessibility is contagious. Once you learn a few basic concepts about making the web more accessible, there’s ‘no going back’ because good design principles go hand in hand with designing and developing a web-accessible site.” — Anna Gazdowicz

At this point, I neither consider myself an accessibility expert nor had I gone out of my way to learn more. Who defines accessibility requirements, anyway? I needed to get beyond the mindset of “web accessibility is important” and instead learn the basics to design better web products with vision, hearing, or motor skill disabilities in mind.

People easily agree that designers and developers should strive for web accessibility, but what can we do right now to be more practical advocates for accessibility? Here are three easy tips to try today on any website project to become a better advocate for web accessibility:
Living Visual
Tags: Nature, Life Lessons, Meditation, Perspective, Photography

Living Visual

a free-flow photo manifesto

Today the world is emotionally active, but even more impatient. The digitation increases, the physical disengagement grows. What emerges from this fragmented reality? Inconsistency. There’s a fabrication embedded into the general experience, playing out like a flawed story line…

… made up of all peaks and no valleys.

But lighten your heart. This is the world’s pattern, not yours.

Learn to observe it from afar, and be at peace with your own valleys. Know their heart rate. Start to see the long-term vision. Sense yourself, and observe this ‘living visual’. It will change as you do, in the present.

Each day you choose to engage with the living visual, you will cultivate a gradual incline. Move past the trappings of premature, reward-laden expectations. Follow a natural consistency, inspired by the willingness to grow your sense of concentration and gratitude.

Life will be difficult. It will interrupt you, it will hurt you. It will burden your spirit, exhaust your consistency. But only in moments. Let them pass through you at their own speed. Then pause and drift… drift into purpose.
How Unsolicited Advice is My Favorite Holiday Gift
By: Sarah Paris
Tags: Fiction, This Happened To Me, Satire, Humor, Self

HUMOR

How Unsolicited Advice is My Favorite Holiday Gift

Random strangers bless me with this gift daily

Sweat dripped into my eyes and blurred my vision. I shifted the weight of my pack from my hips and paused to take in the view. I’d taken a solo trip to a 10,000-foot peak I frequented. I wanted to best my time running up the trail — thirty minutes to reach timberline. And I did.

I summited the last line of Evergreens in twenty-three minutes. But, my chest threatened to erupt and sweat soaked my hair. I wanted to give up.

Thankfully, a man in a visor, sweatshirt, and jeans sat with his family just off the trail. He anticipated my arrival, and waited with the gracious gift of unsolicited advice.

He was wearing Crocs — with socks, and most likely, he’d strolled up the trail in an hour or so. But he yelled to me, “You can do it, champ! ‘Just lock those legs and take long strides. Heck, if we can make it, so can anyone.” He laughed as he motioned toward his family.

My heart swelled, and I was so relieved. What a thoughtful and kind gesture to make. Patronizing barks toward a perfect stranger — so compassionate and an excellent example for the kids sitting by his side. An internal warmth filled me and my smile widened at this amazing gift.
Perjalanan Panjang Menuju Psikologi UI
By: Ikigai Asia
Tags: People Story, Kuliah, Ikigai Asia, Education, Pendidikan Indonesia

We are education technology company in Indonesia. The purpose of this page is to share our opinion and story how we help revolutionizing education in Indonesia

Follow
Careful How You Answer
By: Mark Starlin
Tags: Three Line Conversations, Questions, Relationships, Humor, House

“Does this gray paint make me look fat?”

“Um. Not at all. You know what they say, the water adds 20 square feet.”

“Nice recovery.”
How to Create iOS Widget (Today Extension)
By: Tri Rejeki
Tags: Developer Stories, iOS, Widget, Swift, iOS App Development

Today Extension

Today Extension is an extension that help you to share your app’s functionality. These allow you to present information in the Notification Center and Lock Screen. These are a great way to provide immediate and up-to-date information that the user is interested in.

Today Extension can only exist if you already have main application. If you have not have the main application, please make it first. ^_^

How to Add Today Extension

In your existing project choose File > New > Target.

New Target Option Dialog

After that, you will need to fill the product name of Today Extension and click Finish button. It will generate the basic file of Today Extension.

Generated File for Today Extension

As you can see, after creating Today Extension, you will have TodayExt folder (TodayExt is the product name). The files that are contained in Today Extension are:

• TodayViewController.swift — Contains the source code for the View Controller representing the widget in the Today view

• MainInterface.storyboard — The storyboard file containing the user interface of the widget as it will appear within the Today view

• Info.plist — The information property list for the extension.

How to Run the Widget

Now, shall we run the widget?

First, run your application Command (⌘)-R, then after your application is running, move your application into widget pages.

Screenshot of Simulator How to Run/Add Widget (Today Extension)

On Widget/Search pages, click the Edit button. It will display Widgets in your device. As you can see, there is TodayExt from widget list. Click at green + button on the left. Press Done button.

That’s it! Congratulation on your first widget!

Now, you can modify your Today Extension.
Coindelta Lists Decision Token (HST)
By: Vilakshan Bhargava
Tags: Blockchain, Cryptocurrency, Listings, Announcements

Dear Community,

Coindelta is happy to list another unique ERC20 token Decision Token (HST).

Deposit & Withdrawal are live Now and trading will begin at 6:00PM IST 27th Of June 2018.

Pre-requisites before trading in Decision Token (HST) —

The withdrawal fee for Decision Token (HST) will be 10. Minimum deposit for HST is 15. Recovery fee for HST is 5. The number of blockchain confirmations required for deposit is 25.

What is Decision Token (HST)?

In an effort to improve democratic processes around the world tech startup Horizon State has built a digital ballot box, secured by blockchain. The company is working with governments across the world to enable e-voting on the blockchain, making it more secure and trustworthy than traditional voting methods.

The secure platform allows citizens to cast their votes on smartphone apps, rather than having to queue up at polling stations.

The platform is operated through the use of Decision Tokens (HST). These tokens act as access rights for both customers and third-party developers, for permission to submit votes or polling of opinions to a distributed ledger.

This platform deploys “digital ballot boxes” that are transparent yet secure. Each and every voter is registered within the system.

Key Features of Horizon State (HST) —

Horizon State delivers a blockchain-secured digital ballot box that manages the formal voting process from end-to-end.

The system maintains the anonymity of all voters .

. Results and outcomes are not only faster but also much cheaper and more efficient.

It can be adopted freely by organizations of all sizes without having to change their existing infrastructures.

The platform is user-friendly and does not require extensive technical knowledge pertaining to the blockchain.

With unfair voting and biased elections being reported all across the globe, Horizon State is offering the public a highly useful platform that can reinvigorate the democratic process.

That is all for now! For any enquiries, feel free to reach out to us!

Stay tuned for more announcements!

Coindelta Website

Coindelta Twitter

Coindelta Telegram Group

Coindelta Announcements

With love for the Blockchain and Cryptocurrencies,

Coindelta Family
Nested reduce() in JS
By: Abrar Shariar
Tags: Functional Javascript, JavaScript, Reduce

Sample data structure:

Now, we want to find the total prices, for which we would need to add all the prices in the two records which are essentially part of two objects in the purchases array.

The following code solves it:
To the Protector of the Desert…..
By: Salitha Nirmana Meththasinghe
Tags: Sphinx, History, Egypt, Poetry, Culture

Sphinx,

Oh! Ruler of the desert,

With the same equanimity

please accept my humble greetings.

Desert is you,

And you are the desert.

To the Bedouins,

you are father of terror,

But without you

desert will be a loner.

Civilizations have risen,

Kingdoms have fallen,

You have been the silent witness

for ages,

Yet nothing could erase

the gentle smile of yours.

I wonder,

What’s the true purpose

of your being?

Are you conversing with silence?

About something which is beyond

simple understanding?

Or are you just teasing the emptiness?

Like you have been doing for centuries?

Your very presence blows

my soul and imagination,

while your splendour making me

kneel in front of you,

Spontaneously you become

the center of my contemplation,

Yet, no matter what I am to you,

Just embrace being a devotee

who bows down to you.

Time will flow

and the nations will change,

More pilgrims will arrive

and the old trails will be erased,

They will recite the holy words

trying to draw the attention of yours,

Yet you will remain the same

while hiding eternity within yourself.
Validating successful execution of BigQuery scripts using ASSERT
By: Lak Lakshmanan
Tags: Bigquery, Sql, Google Cloud

Validating successful execution of BigQuery scripts using ASSERT

Use ASSERT to verify pre- and post- conditions

When you are writing a BigQuery script, you will often want to make sure that the data matches your expectation. How many times have you written a script that worked when you deployed it. Then, someone changed your input data upstream and it was months before you discovered that the script was silently creating erroneous/empty tables? Wouldn’t it be better if the script failed and you got a heads up?

Build solid scripts using assertions! Image by Pawel Kozera from Pixabay

The script

Imagine that your script (you might be scheduling it, or it might be run on a trigger) creates a table of average duration of bicycle rides for some set of stations:

CREATE OR REPLACE TABLE ch07eu.hydepark_rides AS

SELECT

start_station_name,

AVG(duration) AS duration

FROM `bigquery-public-data`.london_bicycles.cycle_hire

WHERE

start_station_name LIKE '%Hyde%'

GROUP BY start_station_name;

The result:

Post-condition

How do you know that the script executed correctly? One easy way to check is that the output table exists and contains data corresponding to a known station. You can do that with ASSERT:

ASSERT EXISTS(

SELECT duration FROM ch07eu.hydepark_rides

WHERE start_station_name = 'Park Lane , Hyde Park'

);

Basically you call ASSERT and follow it with a SQL statement that returns TRUE or FALSE. If it returns FALSE, the script fails. This way, if the input table’s start_station_name column for some reason doesn’t contain the Hyde Park stations (maybe there was a network problem), you will know.

Without the ASSERT, the script would silently create an empty table and say that it was successful.

You are not limited to checking the existence of rows in the table. You can even apply data quality checks. For example, the minimum possible duration is 60 seconds, so we can verify that the output table does not contain any corrupt values:

ASSERT (SELECT min(duration) FROM ch07eu.hydepark_rides) > 60;

Pre-condition

It’s a good idea to make sure of any assumptions you are making. For example, we could verify that we are getting the station names correctly:

ASSERT EXISTS (

SELECT name

FROM `bigquery-public-data`.london_bicycles.cycle_stations

WHERE name LIKE '%Hyde%'

);

This way, if someone decides to change the table to remove the , Hyde Park from the station names, we will get a heads-up because the script will fail.

Full script

Here’s the full script with pre- and post- conditions:

ASSERT EXISTS (

SELECT name

FROM `bigquery-public-data`.london_bicycles.cycle_stations

WHERE name LIKE '%Hyde%'

); CREATE OR REPLACE TABLE ch07eu.hydepark_rides AS

SELECT

start_station_name,

AVG(duration) AS duration

FROM `bigquery-public-data`.london_bicycles.cycle_hire

WHERE

start_station_name LIKE '%Hyde%'

GROUP BY start_station_name; ASSERT EXISTS(

SELECT duration FROM ch07eu.hydepark_rides

WHERE start_station_name = 'Park Lane , Hyde Park'

); ASSERT (SELECT min(duration) FROM ch07eu.hydepark_rides) > 60;

Enjoy!
Afternoon kiss
By: Iva Hotko
Tags: Passion, Kiss, Poetry, Love, Poem

Poetry

Image by Iva Hotko

There is nothing innocent

in the kiss in the afternoon,

nothing obedient

in hand striving to touch.

It’s only for so long

things can be kept decent.

Fallen angel you call me,

when demon is more likely.

Never so eager,

longing to please,

we burn.

~ Iva
Searching for a Moon
By: Evans Kyritsis
Tags: Life Lessons, Short Story, Poetry, Fiction, Short Fiction

Cupid grew as any other lost porcupine

His nest is by the lake at their forest’s end

He owns the best view of the horizon’s line

And he’s madly in love with his best friend.
XᵀX, Covariance, Correlation and Cosine matrices
By: Alex Dasilva
Tags: Analytics, Data Science, Statistics, Programming

XᵀX, Covariance, Correlation and Cosine matrices

A walk through for calculating several popular association matrices

Below, we’ll unpack the calculations underlying plots like these

Ever been in a scenario where you needed to come up with pairwise covariance, correlation, or cosine matrices for data on the fly without the help of a function? Probably not.

Even so, it’s worth taking a look at how these matrices could be calculated as there are some neat commonalities in their respective calculations. At the center of it all is the XᵀX matrix. Here, you can think of X as some data you’ve collected where every column is a different measure and every row a different subject.

Taking the transpose of X and multiplying it by itself, results in the sum of squares cross products matrix (SSCP) where SS fall on the diagonal and cross products on the off diagonal.

Centering X, multiplying its transpose by itself, and dividing by n-1 (where n = # of rows in X) results in the variance-covariance matrix with variances on the diagonal and covariances on the off diagonal.

Standardizing X, multiplying its transpose by itself, and dividing by n-1 (where n = # of rows in X) results in the pearson correlation between variable pairs.

Unit-scaling X and multiplying its transpose by itself, results in the cosine similarity between variable pairs

Below, we will illustrate what was just reviewed by creating a function that outputs one of the aforementioned matrices based on user input.

Now, we can put it to the test by creating some data and calculating the previously mentioned associations.

Sum of Squares Cross Products

Variance-Covariance

Pearson correlation

Cosine similarity

We’ll load the library “philentropy” to check our work here as it

contains many useful distance functions. Note that we are transposing

our data as the default behavior of this function is to make pairwise

comparisons of all rows.

In sum, we’ve shown that the XᵀX can be manipulated to derive many of the common association matrices we use on a daily basis. Hopefully you’ll keep this in the back of your mind the next time you’re running correlations or checking out the cosine distance between variables in your data set!
This Zen Story Will Bring You One Step Closer to Enlightenment
By: Karolin Wanner
Tags: Spirituality, Lifestyle, Mindfulness, Self, Self Improvement

This Zen Story Will Bring You One Step Closer to Enlightenment

How non-reaction can solve all your problems.

Photo by Aleksandar Pasaric from Pexels

We love to make life complicated for others and ourselves. We see problems everywhere. But if we ignore our ego and don’t react to problems, then life becomes simple.

It becomes so simple that it confuses people. This Zen story is an invitation to look at yourself from a fresh perspective. Listen inwards. How does this story make you feel?

There was a Zen master called Hakuin. He was well respected in his community. One day a couple knocked at his door and accused him of making their daughter pregnant.

The Zen master only replied: “Is That So?” and everybody in his community was outraged and furious.

When the baby was born, the family brought it to the Zen master. He accepted the child and took good care of it.

A while later, the daughter revealed that the monk was not the father of the child, and she had only said this out of fear of revealing who the actual father was.

The family went back to the Zen master’s house and asked for forgiveness. Again the Zen master just answered: “Is That So?”. The family asked for the baby and the Zen master gave it back and life went on as before.

Do you feel confused and ask yourself why did the monk not tell the truth? The Zen master reacted from a place of calm. He knew that the truth is not subjective. It is what it is. It doesn’t matter to him if other people around him can see it or not.

He faced the situation with non-reaction and acceptance. The Zen master has no ego telling him to defend himself and create problems. Life can be so simple when we catapult our ego’s on the backseat.

No self, no problem. — Anam Thubten

What can we learn from this story, and how can we apply the wisdom of Zen master Hakuin into our daily lives?
Water Log
By: Ré Harris
Tags: City Planning, Politics, Water, Poetry, Resistance Poetry

Photo by jlfajardo via Pixabay

Water Log

“Draw the lines

however we want,

as if we’re in control,

as if nature heeds

our boundaries.

We’ll plan for this,

and only this.

We can say

once-in-a-lifetime

won’t happen again

in ours,

or keep our plans

under the radar

so questions echo away

and fade out of view.

Fingers crossing are stronger than

water crossing.

Forget the history

of the absolute reverse.

Let’s just

let money control.

Ignoring nature won’t affect

our savings.

Not as much as the water

will affect theirs.

Let’s just not think

about the lives.”
3 Crucial Things to Know About NavigationLink in SwiftUI
By: Anupam Chugh
Tags: Mobile, iOS, Swift, Swiftui, Programming

3 Crucial Things to Know About NavigationLink in SwiftUI

Build robust iOS apps

Photo by Dan Chung on Unsplash.

Navigation is an essential component of any application, and with SwiftUI, Apple introduced NavigationLink and NavigationView to allow us to create routers with ease.

However, there were a few hiccups in the first iteration of SwiftUI. Specifically, destination views inside a navigation link were getting loaded immediately. But now in iOS 14, we have lazy views — namely LazyHStack and LazyVStack — to make our lives easier.
An Introduction to Angular HTTP Interceptors
By: Denis Nuțiu
Tags: Angular, Framework, Front End Development, JavaScript, Https

Implementing Interceptors

Writing an HTTP interceptor is dead simple, all you have to do is follow the following steps:

Create a class that implements HttpInterceptor , then decorate it with @Injectable Provide the interceptor

If you’re an Angular developer you already know how to provide services, there’s a catch though, for HttpInterceptor , you must provide it in the AppModule .

You’ll also do it like this:

It’s good practice to follow the instructions from the official documentation and create a new array in which to store all of the interceptors so that you only have to add new interceptors to the array and then provide the array in the AppModule ’s root.

The way interceptors work is that they first look at the request, then they call next on it. The following interceptor is a no operation interceptor, it does nothing:

intercept(req: HttpRequest<any>, next: HttpHandler):

Observable<HttpEvent<any>> {

return next.handle(req);

}

As far as I know, you can’t configure interceptors to activate on certain conditions (if you do, please let me know how!). You can configure an interceptor to activate only for some routes by inspecting the req parameter, as seen in this example :

If you have an application that uses JWT as an authentication method, you can write an HTTP interceptor that sets the JWT header if available. With the intercept method, you would do something like the following:

Thanks for reading! I hope you found this helpful.

The full code can be found here: https://stackblitz.com/angular/kmeqdgdrenj
Abe Ape (Nouk): “My Apology”
By: Tania Sheko
Tags: Sorry, Spoken Word, Poetry, Abe Nouk

Poetry selected daily by Blair Mahoney for his English classes. Images found by Tania Sheko, most selected from the curated collections of Stephen Ellcock on Facebook https://www.facebook.com/stephen.ellcock and Instagram https://www.instagram.com/stephenellcock/.

Follow
US sanctions crypto wallets?
By: Alexandra Petrova
Tags: Cryptocurrency, Bitcoin, USA, Sanctions, Media

The US Treasury claimed that it might publish IDs of crypto wallets whose owners are currently under sanctions. This, according to several sources quoting the US Treasury, should reduce the number of transactions with suspicious counterparts. However, this decision might not even have any serious consequences or even jeopardize those wallets holders, believes Vladimir Smerkis, Tokenbox co-founder and managing partner: «Since now crypto world is not really regulated, this matter might be resolved in the nearest future. Another year or two, maybe more, will be needed to make such list go public. It is technically impossible to ban sending money from one address to another. You can actually see if from wallet A to wallet B some funds were transferred, so this wallet B probably belongs to the person who is on the sanctions lists. However, there is no direct binding of wallet to any ID or passport. Therefore, even if funds were transferred from one wallet to another, it's very difficult to prove that a specific person owns the wallet." - said Mr. Smerkis

Source: https://www.kommersant.ru/doc/3580396
Consentium: Rewarding Community Engagement
By: Goh Jian Wei Nigel
Tags: Cryptocurrency, Bitcoin, Consentium, Blockchain, Social Media

Consentium: Rewarding Community Engagement

Easy Transfer of Cryptocurrency

Current chat applications such as Whatsapp and Telegram fulfil users’ needs of social messaging or for work. However, such applications lack the ability to reward users for the time and effort that they put into the platform. This is where Consentium can come in to bridge this gap by allowing its users to transfer cryptocurrency on its platform.

Consentium boasts the ability to transfer cryptocurrency from consumer to consumer and acts as crypto wallet for multiple cryptocurrencies.

Transfers of cryptocurrencies between users incurs a 1% fee that is borne equally by both the transferor and transferee. This fee is kept in a distribution pool and funds from the distributor pool will automatically reallocated fully to community creators and users based on their level of contribution to the community. This encourages community members to contribute higher quality content on the platform more frequently.

Community Reputation

Table taken from Consentium Whitepaper https://drive.google.com/file/d/1WNx5aExp_DI38sNDqSterYDm2jNt7f73/view

Users of the Consentium platform are rated on a scale of 1–10 in terms of their reputation. This rating is based on the number of transactions or total size of the transactions in the last 30 days. Beyond the 30 days, users who are unable to keep up with the required amount of transactions will experience a reduction in their reputation level. This ensures that users are incentivized to continue using Consentium.

Quality over Quantity

Quality messaging groups are established based on the total number of users with a reputation level of 5 and above. Each group type is given a particular share of the pool. For example, all the “Massive” groups are allocated 30% of the pool and this amount is split evenly between all the groups within the “Massive” category. Such community rewards set Consentium apart from not just other social messaging applications like Whatsapp, but even current cryptocurrency-based chat applications. Thus, this provides a strong incentive for cryptocurrency communities to use Consentium over the other applications.
Using Delegation in SwiftUI to Segue
By: Mark Lucking
Tags: Programming, iOS, Segue, Delegation, Swift

Using Delegation in SwiftUI to Segue

A new way to change views

Segue between three views using delegation together with the Combine framework

I wrote an article a while back about changing views in SwiftUI, this one.

Within it suggesting the preferred method was using Published ObservableObjects. The best option of the choices presented, but playing around with protocols, delegation and singletons I think I found a better way. It is better way because — well deep down I have a quiet reservation with ObservedObjects since they are in effect global variables. Using the method presented here you can achieve the same sort flexible switching, without the need for global variables at all. Read on.

The brief — I am going to create three SwiftUI views all of which will be singletons along with with a class which will also be singleton that I’ll use to segue between them. I am going to use a protocol to make sure we’re all on the same page. To code.

We start with a protocol of course. A very simple one that stipulates that you need to create a reference for all the views we’re going to use.

protocol Connections {

var delegateA: SwiftUIViewA? { get }

var delegateB: SwiftUIViewB? { get }

var delegateC: SwiftUIViewC? { get }

}

We then create a class that will confirm to the said protocol, a central point through which we can reference any of our views, another singleton.

class ConnectABC: Connections {

var delegateA: SwiftUIViewA?

var delegateB: SwiftUIViewB?

var delegateC: SwiftUIViewC?

static var shared = ConnectABC()

}

Next I setup the values for the class and reference all the views [yet to be created] with this code.

This creates an instance of the class and adds all the views [as singletons] and then sets the delegate variables to point to said views.

Finally I create the views, this is the code for SwiftUIViewA.

With SwiftUIViewB looking like this.

And SwiftUIViewC view looking like this.

Finally, sorry I almost forgot; the code you need to tie everything together.

Put all together and you get the animated gif I included at the top of this article. Although I must confess I changed the Spacer()s seen here so that I could do landscape.

All of which brings this short and sweet paper to an end. I hope you find it interesting and indeed go on to try out the method illustrated here in your own apps. Nay — you can even extend it to manage views within your views. Now there’s food for thought.

Keep calm, keep coding.
Write for FanFare
By: Eric Pierce
Tags: Pop Culture, Fanfare

Perhaps you’ve been there. You’ve written a great essay on Star Wars or Marvel or Fortnite. You’re anxious to share it with the world, but there’s a problem — no publications are interested. Leaving you to play the curation lottery; lose, and watch your work disappear into the void, largely unread.

I recognized the issue when one of my essays on writing had too much Star Wars. I could cut the Star Wars, but that was its raison d’être, its essential essence. If I can’t write about Star Wars… what am I even doing here?

There had to be another way.

Enter FanFare.

We are a publication solely interested in Pop Culture potpourri: films, TV shows, books, and games (video games, tabletop, etc). Reviews, theories, deep cuts — we want it all.

Does that sound interesting? Hit the Follow button to keep up with all our great content!

But there’s a catch.

We only want the best of the best.

FanFare is part publication, part curator.

We want to be one of the top sites for this kind of content, a brand synonymous with entertaining, well-written articles.

Write for FanFare

We’re always looking for talented writers to add to our team! Send a sample of your best work to fanfarepub@gmail.com. If it fits what we’re looking for, we will add you as a writer!

Note: we are looking to build a thriving community here, and ask that all FanFare writers regularly respond to reader comments on their stories.

Also — please follow the site! If you like writing this type of material, chances are very good you will also like reading it!

General Submission Guidelines

We only accept stories previously unpublished on Medium.

Use a header image before or immediately after your title.

All images should be credited.

Posts should be visually pleasing. Leverage white space.

You must include one of the following tags: Books, Film, Gaming, Television.

include one of the following tags: Books, Film, Gaming, Television. You may use a brief (1–3 sentence) call to action at the end of your article, so long as it complies with Medium’s guidelines.

We do not pay but you may freely use the Medium Partner Program.

We may tweak your tags to align with the guidelines noted above.

We claim no ownership of your work.

General reasons for rejection
PIBBLE will be listed on CPDAX exchange!
By: Bryan High
Tags: Cryptocurrency, Blockchain, Cryptocurrency Exchange, Social Media, Investing

The week of exciting announcements for PIBBLE continues. PIBBLE has been selected to join other premier cryptocurrencies on the CPDAX exchange.

CPDAX stands for Coinplug Digital Asset Exchange, a new digital asset exchange created through Coinplug’s technical experience and exchange knowhow. We provide trading services for various digital assets starting with Bitcoin, Bitcoin Cash, Ethereum, Ethereum Classic and Litecoin for convenience of domestic and international users.

CPDAX provides a differentiated platform to lead the growth of digital asset market and minimize the risk and inconvenience of domestic exchange users. Through a workforce with over 60% in blockchain research experts, Coinplug highly values security through crypto algorithms and various security systems. We confidently assures that our security is superior to all other exchanges.

CPDAX provides differentiated service for the convenience of users.

We provide a professional trading UI that shows the orderbook, chart and order page in one view, allowing everyone from beginners to experts to trade quickly and easily.

CPDAX is the first exchange to provide a comprehensive profit estimation of your trades.
More Amazing News in October
By: Andrew Zhuk - Bitupper.Com
Tags: Bip173, Bech32, Segwit, Bitupper, Blockexplorer

Greetings, Bitupper community!

We have amazing news for you! Sit tight and buckle up, since we are about to take off.

As you know, our team has been working really hard lately to launch one of the most important part in our ecosystem: Bitupper Explorer — multi-currency block explorer.

And we did it! We would like to gladly inform you that BTC and LTC sync is complete!

It means that Bitupper Explorer is live and you are welcome to use it and enjoy its simplicity, speed and functionality.

Try Bitupper Explorer for yourself at:

BTC — https://bitupper.com/en/explorer/bitcoin,

LTC — https://bitupper.com/en/explorer/litecoin

SegWit full support

Bitupper Explorer fully supports SegWit addresses, or in other words — bech32 addresses. We were somewhat reluctant to promote it widely and we thought that it wouldn’t be a big deal, but it actually is. Bitupper had the support of SegWit starting from the day it was introduced.

Since the introduction of SegWit in 2017 for BTC not many block explorers actually made the update to support SegWit. But now, when SegWit addresses are being used more and more, the need for an explorer with support of bech32 addresses has grown too.

We are proud to announce that Bitupper is one of the few explorers giving users SegWit support making Bitupper one of the most advanced and up to date explorers on the market.

Multi-language support

Apart from multi-currency support Bitupper Explorer is also multi-lingual. So far you can switch between English, Russian, Spanish, Ukrainian. Many more languages are to be added really soon.

Stay tuned for more updates on Bitupper.

Join Bitupper community

Telegram https://t.me/bitupper_en