fabiochiu/medium-articles huggingface dataset:
Can You Autorun RxJS?
By: Kostia Palchyk
Tags: Typescript, Angular, JavaScript, React, Rxjs

It’s a sweetened countdown

Our first example! A simple mapping

Say, we want to prettify each value on a timer stream. So we’ll write such an expression:

Explanation: computed takes a function that uses some streams and re-evaluates it when those streams update. It returns an observable that you can manipulate further. And $(a) indicates that a is a stream and its updates should be listened to.

So technically this expression is equivalent to a.pipe( map(x => x + '🍰') )

But let’s keep discovering what else this tiny lib can do:
6 Marketing ‘Post-COVID’ trends in 2021.
By: Bryan Dijkhuizen
Tags: Money, Marketing, Business, Entrepreneurship, Covid 19

Transparency and Reliability.

If the corona crisis has taught us one thing, it is the importance of transparency and data reliability. Transparency and reliability will play an increasingly important role.

You can see that Google is already working with E-A-T on verifying the expertise, authority, and trustworthiness of authors. This will weigh even more heavily. Referring to reliable sources is becoming increasingly important post-corona.

Are you referring to a reliable source with an external link? Then that is a positive signal. On the other hand, links to different or even unreliable sources have a negative impact. That is the development we need.

Post-corona trust is the new credo. The virtual world has increasingly become a battlefield of fake news and misinformation. Clear, reliable, and consistent communication is a relief for the consumer. Therefore, ensure a clear brand image and brand value pattern. Work this consistently into all your communication. In short: prove the wording, win and strengthen the relationship with customer and prospect.
Stories About the Art of Making Art
By: Human Parts
Tags: Writing, Stories, Recommendations, Reading Roulette, Creativity

“Repressive forces don’t stop people expressing themselves, but rather force them to express themselves,” wrote French philosopher Gilles Deleuze in 1985. Over 30 years later, writer and artist Jenny Odell used the quote as a jumping-off point for a legendary lecture (and later, a book) about reclaiming our attention — and creative spirit — in an era of endless distraction. When the world feels like it’s closing in on us, art is humanity’s way of prying it back open.

On that note, this week’s Reading Roulette explores creativity and expression — what it is, where it comes from, and how to cultivate it.

First step? Do nothing. Or try to. As Odell writes, “the artist creates a structure […] that holds open a contemplative space against the pressures of habit and familiarity that constantly threaten to close it.”

Sergey Faldin explains it like this: Creativity is like building a tunnel between your subconscious (where your best ideas reside) and the world. You can craft your tunnel out of anything — a blank piece of digital paper, a guitar, a sketchpad, or a fridge full of ingredients that don’t seem to match. To communicate more complex ideas, you must widen your “Idea Tube” — which sounds weird, but it’s just another term for the contemplative space you create within yourself.

Doing so requires hard work. It also requires freedom. As John Gorman advises, creativity (in writing, specifically) is about experimenting “with form and format, rhythm and cadence.” Break the rules. Play.

Or, as Felicia C. Sullivan writes, “Great stories bear the weight of the ephemeral. There are no rules, only the ones you make for yourself that align with your work and how you wish to communicate it.”

And breaking the rules doesn’t just apply to writing essays, or fiction — it even applies to copywriting, as Clare Barry explains. Your favorite brands stand out because they’re human (or their voices are, at least).

So, whether you doodle or free-write or embroider your mask this weekend, remember: Rules are an illusion, and they always were.
The Holocene expired
By: Miguel Adrover
Tags: Sustainability, Philosophy, Climate Change, Essay, Science

I am here when cities are gone.

I am here before the cities come.

I nourished the lonely men on horses.

I will keep the laughing men who ride iron.

— Carl Sandburg [1]

We owe Anthropocene to Paul Crutzen, winner of the Nobel Prize.

He believes that —

“The stratigraphic scale had to be supplemented by a new age to signal that mankind had become a force of telluric amplitude. After the Pleistocene, which opened the Quaternary 2.5 million years back, and the Holocene, which began 11,500 years ago, ‘It seems appropriate to assign the term “Anthropocene” to the present, in many ways human-dominated, geological epoch’”. [2]

This universe is 13.8 billion years old — we’re in the Phanerozoic Eon, which is divided in Eras, we’re currently in the Cenozoic; Eras are divided in periods, we’re in the Quaternary; these Periods are broken into Epochs, we’re currently living in the Holocene (the last 11,550 years of the Quaternary Period)…a matryoshka doll of time sets:

Eons with detail, down to the epoch. Public Domain Image.

Humanity has managed to mess things up to such an extreme, that the geological time scale requires its signature: Anthropo, our cosmic We were here. To put our meager centuries next to eons and epochs…mere mortals like me see timescales in 1,000-year intervals; but it seems likely that Time will have to be updated. We face global post-corona problems: complex and accelerating challenges. Meanwhile, we live our lives scared, scarred, and shocked.

Could this this trauma be eased with naming the mess?

In The shock of the Anthropocene, Bonneuil & Fressoz are a big help on this quest for crisis nomenclature, which requires scientific consensus. This new age of the scale is by no means set in stone. Anthropo can be easily replaced: Phagocene, Capitalocene…Regardless of the permutation that sticks, we’re tasked with asking questions as old as civilizations: is it immoral to bring children into this world? Are we facing the beginning of the end?

Is this essay another example of apocalyptic porn? Maybe it is, nevertheless, it might be wise to consider the implications of our agency: we probably triggered a mass extinction event.

Here I will review some remarks — critiques and commentary — taken from French authors, about the concept in question. As with anything new and emergent, Anthropocene cannot be but pregnant of use and abuse.

Please, forgive the eschatological tone of my comments.

The legacy of our agency reverberates across Eons & Epochs. History is no longer enough to assess our impact and its consequences. In that sense, Anthropocene is important, “It attributes practical — that is to say, stratigraphic — truth to the notion of epoch as studied by a historian”.[3] In other words, human agency should be measured in terawatts, a unit useful for massive amounts of energy — like the rumblings of a volcano, or the motion of plate tectonics.

It is no small thing to accept such a hypothesis: that humanity occupies a tangible locus in the Natural History of the planet, plastic being our cosmic smoking gun:
How To Launch Your Brand Like a Successful Instagram Influencer
By: Fab Giovanetti
Tags: Business, Startup, Marketing, Influencer Marketing, Social Media

How To Launch Your Brand Like a Successful Instagram Influencer

A case study of three popular businesses

Photo by @Wearetala on Instagram

The world of influencer marketing and influencer business has changed massively in the last year or so.

Sponsored content is no longer the sole way influencers are monetising their audiences — but that shouldn’t come as a surprise, really. Make way for different kinds of collaborations.

From publishing books to launching podcasts, influencers and content creators are stepping up their revenue game.

One of the latest trends on this subject has been influencer-driven product collaborations, something that has swept across every industry, including health and wellness.

Using examples such as Carly Rowena’s jewellery line, more and more influencers are finding smart and fitting ways to tap into bigger audiences and create branded products.

The most notable initiative to date comes from the world of fashion, and it involves Amazon’s “The Drop.”

This is an influencer-lead initiative that will give customers limited-edition, “street style-inspired” collections from global bloggers and social media famous folks.

Designs from “The Drop” will be available internationally for only 30 hours, which the homepage of “The Drop” promises will mean less waste as things are only made to order.

Influencer Quigley Goode is among the influencers collaborating with Amazon on the initiative, and as she shared in one of her latest Instagram posts:

“I announced recently that I’ve been working on designing a collection for @amazonthedrop — and my heart just about exploded from the amount of support and excitement I felt from this community. I can’t thank you enough for cheering me on.”

In this article, I outline a few lessons from three successful brands launched by influencers, and how they seamlessly marketed their products.
My Recap of KubeCon 2019’s “Running Istio and Kubernetes On-Prem at Yahoo Scale”
By: Tremaine Eto
Tags: Software Engineering, Technology, Software Development, Kubernetes, Istio

This article will summarize a talk given by Suresh Visvanathan & Mrunmayi Dhume of Verizon Media at KubeCon San Diego 2019. If the video recording of the presentation is posted, I will link it here directly in the article so you can follow along.

Yahoo! has more than 18 production grade Kubernetes clusters; Visvanathan’s team operates one that has more than 150,000 containers, 500 applications, and 1,000,000 requests per second.

Their most mission-critical applications, such as Yahoo! Sports, Yahoo! Finance, and Yahoo! Home, are deployed and enabled by Kubernetes and Istio platforms.

The talk covered how the teams worked on modernizing their platform to a microservices architecture. Among their goals were:
How a Bowl of Yogurt Can Make You Mindful
By: Yuta Morinaga
Tags: Lifestyle, Health, Productivity, Mindfulness, Meditation

The Yogurt

Does 227g mean anything to you?

It’s a typical serving size of yogurt.

If you have a tub of yogurt in your fridge, pour yourself a serving in a bowl. Shower it with your favorite assortment of fruits or toppings.

If you don’t have any of the items above, add them to your shopping list. You’re just going to have to visualize this bit, and it might make you hangry.

Take a spoonful of yogurt into your mouth. Continue this process, but by following this one rule: only one spoonful per minute.

Photo by Pascal Meier on Unsplash

Only taking one spoonful per minute might seem like a difficult task at first. You might think that you can’t afford that much time on a single bowl of yogurt.

The thing is, the more you focus on the time, the more you have to wait. Have you ever stood next to a boiling pot of water, waiting for the bubbles to start forming on the bottom? Contrast that to when you decide to step away, do some chores, and you come back to a pot that’s about to burst.

Coming back to the yogurt, instead of fixating on time, focus on what you’re sensing inside your mouth. What flavors are bursting? How’s the texture of your food changing as your saliva starts breaking the bits down?

If you’re eating a standard serving of yogurt, you probably just spent 5–10 minutes meditating.

This ten-minute practice can help reset your notion of time. It can reset your senses. The ten minutes can feel long or short, depending on what you decide to focus on.

The thing is, we can’t afford not to spend some time sitting with something as simple as a bowl of yogurt to “meditate.” We need to check in on our relationship with time frequently.

We will always be a slave to our excuses and confinements created by what’s outside of us unless we can start controlling our sense of time and manipulate it as we see fit.
How the Night I Struggled for Breath Changed My Life
Tags: Self Improvement, Self, Self-awareness, Health, Encouragement

How the Night I Struggled for Breath Changed My Life

A sudden deterioration in your health might be the best wake-up call out there.

Photo by Daniel Torobekov on Pexels

It was the first week of December and I hadn’t been feeling well all week.

I was 23 and couldn’t breathe freely anymore. Every breath hurt and my lungs felt like they were burning.

My heart didn’t feel right and I had random palpitations that no doctor could explain.

I suddenly had no idea what was wrong with me.

My mother sat by me terrified, reading the Qur’an until it became gibberish and I couldn’t understand what she was even saying.

We went to the doctor. We did all the tests. I still couldn’t breathe properly.

I heaved and gasped suddenly throughout the day, crying for my ability to breathe in and out normally.

My mother was convinced it was black magic or a curse at one point when there seemed to be no explanation for how badly my lungs were doing.

She was desperate for an explanation, as was I, but we weren’t given one.

This culminated in me being rushed to the hospital on the night of Saturday, December 9th, 2017.
5 Quotes That Will Unblock Your Writing and Uncover Your Creativity
By: Itxy Lopez
Tags: Quotes, 5 Tips, Writing, Writing Tips, Creativity

1. If You Want to Write Better, You Have to Write More

“The more you do, the more you can do.” — Annie Clark (Stage name: St. Vincent)

One of the best parts of being a writer is that if you want to see how much you’ve grown as an artist, all you have to do is look at your past work. Without realizing it, you improve with every new project you tackle. Because what St. Vincent is saying is that the more you practice, the better you’ll get.

In 2017, I started writing fanfiction. I genuinely believed that the first story I wrote was epic. For two years, I kept writing — short stories, and a few longer fics (50,000 to 80,000 words). Two years later, after writing my final fanfic, I decided to read through that first one, and well, I couldn’t. I could only cringe, but that’s a good thing. Cringing at past work means you’ve grown. But you don’t grow unless you practice.

The more you write, the better you’re writing will be. In the beginning, practicing when you think you suck is one of the hardest things to do as an artist. When the story is clearer in your head than it is on the page or when you can’t transcribe your thoughts just right, it’s tempting to want to quit.

Unfortunately, you can’t fast forward the bad. You can’t improve without being bad. Keep in mind that this is a learning process and that you’re supposed to fuck up. Just make stuff. Even if it’s ugly. Even if it makes so sense. Because the more you make, the more you can make, and the better the results.
Class 6: Designing AI: Part 2
By: Jennifer Aue
Tags: Adfclass, Big Ideas, Design, AI, Design Thinking

Jennifer Sukis is a Design Director for AI Transformation at IBM, based in Austin, TX. The above article is personal and does not necessarily represent IBM’s positions, strategies or opinions.
How to Avoid Tedious CSS and XPath Queries in End-to-End and Component Tests
By: Ali Kamalizade
Tags: Software Engineering, Tdd, Programming, React, JavaScript

How to Avoid Tedious CSS and XPath Queries in End-to-End and Component Tests

Five tips to improve your front-end tests

Photo by Caleb Jones on Unsplash

Component tests and end-to-end tests have some things in common. Here’ a brief overview about the two types of tests we’re looking at:

Component tests (sometimes just referred as unit tests) are cheap to develop and easy to execute and debug because they isolate failures. Besides, they can usually run without a browser. Example frameworks: Jest, Mocha. End-to-end (e2e) tests simulate real user scenarios, which allows you to spot errors quickly. Execution of these tests takes longer, and these can be more complex compared to unit tests. On the other hand, end-to-end tests provide a higher validity that your application works as intended. Example frameworks: Protractor, Selenium.

One of the most common things to do is to find some element in the DOM and do something with it (e.g., click it and expect some output). If you’ve worked with JavaScript-based Angular and React before, then you’re probably familiar with querying DOM elements using either jQuery or vanilla JavaScript.

Most web developers should be somewhat familiar with CSS. However, for testing or scraping, there’s also XPath, which offers some interesting features not available in CSS. While XPath isn’t directly supported in JavaScript, you can use it in component and e2e tests as well as in any modern web browser, like Google Chrome.

Sadly, this power often comes with a caveat:

XPath can do anything CSS can do plus more: e.g., access the parent of an element. This is sometimes much appreciated as XPath supports many kin.

This advantage can turn into a disadvantage — as using XPath often leads to long and complex queries which wouldn’t be possible in CSS

In this piece, I want to take a look at common problems with XPath and CSS queries. After that, we’ll explore some ways to avoid these problems.

Tip: Browsers like Google Chrome allow you to copy and run CSS and XPath queries in the developer tools.
Ideas
By: Matthew Donnellon
Tags: Ideas, Poetry, Writing, Creativity, Creative Writing

Matthew Donnellon is a writer, artist, and sit down comedian. He is the author of The Curious Case of Emma Lee and Other Stories.

Follow
Organum Hydraulicum
By: Paul Fishwick
Tags: Automaton, Engine, Music, Science

Athanasius Kircher was a 17th century German jesuit scholar who produced many publications on machinery. One of them, Musurgia Universalis, was written in 1650 and described ways of creating automatic music. The machine shown above, a water organ, is from Book 9 of that work. Water and air are introduced at the right side into a vessel termed a camera aeolis. The rate of water flow introduces a displacement of air which exits into the vertical pipes comprising the musical organ. The control of which notes are produced, and when, is achieved through barrel rotation. The water not only displaces air for the organ, but also drives the barrel. The barrel has protrusions that interact with the keys as the levers interact with the protrusions. There is a separate mechanism shown in the upper left of the illustration.
Everyone Is a Teacher to Someone
By: Tochukwu Okoro E.
Tags: Content Marketing, Startup, Education, Creativity, Teaching

Sometimes, what might be stopping you from starting your journey as a content creator is that you feel like you don’t know enough. It’s normal to feel that way, because what will you teach someone if you don’t know much yourself?

But the irony of it is, even with the little you know, there are still people who will find the little you have to say helpful. And that’s why you should start because those people need you.

Nobody started with a million fans. You have to build your loyalty from the ground up. People need to see that you’re willing to help. And if you can keep showing up over the long haul, they will stay.

It’s a long process that begins when you publish your first content online, and not just when the idea first came to you.

Content creation revolves around helping the people around you; although it might require some confidence to publish what you know on the internet, it can still be terrifying. But at the same time, we enter into arguments because we feel like we know what the person we’re arguing with doesn’t know. So, if we can do this, then it means we know something, and creating content shouldn’t be so difficult as we have imagined.

It is quite exciting to see people engaging with our content and thanking us for our insights. It gives you the confidence to do more.

And the amazing thing about creating content is that new ideas will always come up if you look for them. So, what’s limiting you is not that you don’t know enough, but that you don’t believe you do.
5 Practical Tips for Positive Code Reviews
By: Boris Cherkasky
Tags: Software Engineering, Startup, Software Development, Programming, Code Review

4. Educate Towards Small PRs

Small PRs are like pizza: They make everyone happier. Reviewers have less work and can easily reason about the code, the proposed change, its quality, and can therefore give better feedback. The author, on the other hand, gets the feedback faster — and the feedback is usually better. Moreover, with a chain of small PRs that are combined to a large feature, snippets of the code are reviewed earlier, making following PRs better and better.

My rule of thumb is that a PR should be smaller than 12 files. That’s my sweet spot.

You will rightfully argue that there are features that require larger changesets, and I would agree. Those features can still be broken up into smaller PRs.

From my experience, there are a few ways to do it effectively (in order of preferability):

Push small (possibly partial) changes into master. I usually start with pushing the building blocks I need (schemas, models), then another PR for the infrastructure code (Kafka publishers, message buffers, DB queries), and finally a pull request for wiring this code altogether. If possible, I also separate the last pull request of wiring the whole feature into the existing system.

Bite-size PRs using feature branches. Photo by the author.

2. Create a “release branch” out of it to create small changes that get you closer to a working feature. Create pull requests for “mature changes” into your “release branch.” This way, each change is small and eventually all the code in the “release branch” has been reviewed in pieces.

Bite-size PRs using release branch

3. When your branch already contains a large changeset, you can break it into smaller “reviewable” chunks and optionally create pull requests for each of those. There are some ways to do it (e.g. separated into meaningful commits using git interactive rebase to create a PR with a subset of the changes).

Breaking a big changeset to bite-size PRs

Lastly, it’s the author’s responsibility to identify in time that the future pull request will turn out to be huge and take proactive measures to make it better.
5 Inconvenient Things All Writers Must Do
By: Itxy Lopez
Tags: Creativity, Success, Advice, 5 Tips, Writing

How to Become Better at Writing Headlines

Ayodeji Awosika recommends writing ten headlines every day. (I write five.) As Jeff Olsen says in The Slight Edge: it’s easy to do and easy not to do.

It might feel like a chore, but writing headlines give you ideas to write about, strengthens your titles, attracts more readers, and ultimately, earns you more money. Grueling over ideas might not be fun, especially when you feel like you’ve run out of them, but the work pays off.

This is the equivalent of a workout, of strengthening a muscle. Show up often, and you’ll reap the benefits. It’s important to take this seriously. If you’re only going to half-heartedly workout, to the point where your legs and abs aren’t even burning, then what’s the point in working out at all, right?

I used to write whatever came to mind — crappy titles that didn’t require much thought — but that was a waste of time. It wasn’t benefitting me or helping me improve.

Sit down and write the best five headlines you can draft for that day. Some days will take you longer than others, but your titles will improve and attract more readers over time.
Pinterest + ktlint = ❤
By: Pinterest Engineering
Tags: Kotlin, Mobile App Development, Open Source, Engineering

Sha Sha Chu | Android Core Experience

It’s been nearly a year since Pinterest’s Android codebase became Kotlin-first, and about two years since we adopted ktlint for Kotlin linting and formatting. Today, we’re sharing that Pinterest has officially taken ownership over the project.

Initially, we chose ktlint because of its simplicity, active community, extensibility, and extremely responsive owner. It also integrated easily with our existing Phabricator-based workflow, and, after adding about 65 lines of PHP to our Arcanist library, we were able to apply linting and formatting to our Kotlin files on a per-diff basis.

When Stanley Shyiko (the developer of ktlint) put a call out a few months ago looking for new ownership for the project, we were immediately interested. Not only was it a tool we use every single day at Pinterest, but it would be a tangible way for us to give back to the Kotlin community. After a few meetings with Stanley, it was clear that it was a great fit, and we were excited to move forward as owner.

In the short term, nothing is going to change about the way the project is run and maintained. We still welcome and encourage outside contributions to the project in the form of Issues and Pull Requests. In the medium-to-long term, we plan to follow Stanley’s proposed roadmap by implementing a way to globally disable rules (ktlint’s most-requested feature), integrating an official Gradle plugin, and updating some of the APIs in ktlint-core to enable cleaner Rule writing. If any of these projects seems interesting to you, please reach out or go ahead and open a Pull Request. Finally, if you or your company uses ktlint, please open a Pull Request to add yourself to the Adopters list.

We’re committed to continuing the great work Stanley started, and collaborating with other developers in the growing Kotlin community.

Thank you to Garrett Moon and Jon Parise for their assistance in bringing ktlint to Pinterest, as well as Kevin Bierhoff, Beth Cutler and James Lau at Google for their technical input.
3 Things I’ve Learned After 3 Weeks on the Partner Program
By: Andrew Dacey
Tags: Authenticity, Writing, Lessons Learned, Creativity, Integrity

I decided to dive into Medium’s Partner Program three weeks ago. I’ve talked about my long-term plan to build a creative life. A crucial piece of that was to start earning a side income. I’m working on the transition away from my current day job, and I knew that I needed to start building the foundation.

I’ve been incredibly fortunate by being curated early in my process. That’s helped kickstart this whole project immensely. It’s both given me a massive boost of encouragement, and far exceeded what I thought I’d achieve this soon.

I was expecting to earn a few cents this month. Instead, I broke past ten dollars. Even in my wildest dreams, I wasn’t hoping to make double-digits in my first month on Medium.

It’s not just about the money, but the money is a validation that I’m on the right path. I’ve wanted to be a writer for as far as I can remember, and now I’m being paid for it.

I’ve made a few minor mistakes so far, nothing major. I’ve also learned three essential lessons.

1. I rediscovered my integrity

I try to live with integrity. It’s something I value highly in my day job. I consistently push to do the right thing, not just the quick fix. Sometimes that causes problems for me when I’m too unwilling to bend.

I wasn’t aware of how this carried over to my beliefs as a writer. I quickly discovered that I still have the same value when it comes to my writing. I’ve passed on publishing this article twice already. I started putting this together around my 2-week mark while I was waiting for some stories to come out in publications where I’d submitted.

I’ve decided to take the high-ground

I was getting a bit uneasy about not having something released. I quickly wrote the original draft for this article. Most of it was just simple comments about curation, getting a signal boost from a publication, that sort of thing. There wasn’t anything new there. There was very little of myself in that writing. So I didn’t publish it.

I hit the same feeling yesterday and nearly published this article then. It was late on Monday, and I didn’t have anything to release. It wasn’t bad. But it was nowhere near the work I’d recently written. For the second time, I held back on publishing this story.
Silhouette Method — Better than Elbow Method to find Optimal Clusters
By: Satyam Kumar
Tags: Machine Learning, Artificial Intelligence, Education, Data Science, Clustering

Silhouette Method — Better than Elbow Method to find Optimal Clusters

Deep dive analysis of Silhouette Method to find optimal clusters in k-Means clustering

Image by Mediamodifier from Pixabay

Hyperparameters are model configurations properties that define the model and remain constants during the training of the model. The design of the model can be changed by tuning the hyperparameters. For K-Means clustering there are 3 main hyperparameters to set-up to define the best configuration of the model:

Initial values of clusters

Distance measures

Number of clusters

Initial values of clusters greatly impact the clustering model, there are various algorithms to initialize the values. Distance measures are used to find points in clusters to the cluster center, different distance measures yield different clusters.

The number of clusters (k) is the most important hyperparameter in K-Means clustering. If we already know beforehand, the number of clusters to group the data into, then there is no use to tune the value of k. For example, k=10 for the MNIST digit classification dataset.

If there is no idea about the optimal value of k, then there are various methods to find the optimal/best value of k. In this article we will cover two such methods:

Elbow Method

Silhouette Method

Elbow Method:

Elbow Method is an empirical method to find the optimal number of clusters for a dataset. In this method, we pick a range of candidate values of k, then apply K-Means clustering using each of the values of k. Find the average distance of each point in a cluster to its centroid, and represent it in a plot. Pick the value of k, where the average distance falls suddenly.

(Image by Author), Elbow Method to find optimal k

With an increase in the number of clusters (k), the average distance decreases. To find the optimal number of clusters (k), observe the plot and find the value of k for which there is a sharp and steep fall of the distance. This is will be an optimal point of k where an elbow occurs.

In the above plot there a sharp fall of average distance at k=2, 3, and 4. Here comes a confusion to pick the best value of k. In the below plot observe the clusters formed for k=2, 3, and 4 with their average distance.

(Image by Author), Scatter plot of clusters formed at k=2, 3, and 4

This data is 2-D, so it's easy to visualize and pick the best value of k, which is k=4. For higher-dimensional data, we can employ the Silhouette Method to find the best k, which is a better alternative to Elbow Method.
How Creative People Work
By: Caitlin Kunkel
Tags: Creative Process, Writing Life, Writing, Writing Tips, Creativity

How Creative People Work

I asked a bunch of writers, journalists, and other creatives how they manage their creative systems.

Recently, I’ve been doing two things that have really helped my writing:

1. For the past year, I’ve been using a spreadsheet to track my writing, input, and a few other factors. I’ve found it really illuminating to see how streaks of writing daily can benefit me, when I really need to take a break to recharge, how reading/watching in new genres has helped me break out of ruts, and how exercise, unfortunately, is very highly correlated with me writing more, and drinking alcohol is not. This is not about productivity as much as finding a balance that lets me enjoy the act of creating, and make it special and distinct from my other work.

Here’s the spreadsheet I use, which is a version of something I saw from writer Leigh Stein (if you haven’t read her excellent satirical novel “Self Care” yet, buy it here!). Feel free to make a copy and give it a try yourself, or adjust the columns, or create something totally new.

2. Since October, I’ve been using a simple word count template (created by author Hannah Orenstein) to track the progress on my novel draft on Instagram. This works for me because as a short piece writer, I was used to creating, submitting, and publishing on a much faster pace, and I missed the engagement with other people as I went. So now I get people weighing in, cheering me on, and giving me little bits of encouragement to keep going. Follow me on IG here to see them, and if you DM me there I’ll share the template with you!

These two systems work for me. What hasn’t worked for me? Trello, A paper journal. My Notes app. Voice dictation. Many other things. But as you’ll see below, those tools DO work for a lot of other writers! I asked people to share their creative working systems as well as something they wanted to shout out this year. Check them out, and see if any of them might be something to try in 2021:
On Becoming A Writer
By: Renee Chen
Tags: Life Lessons, Writing, Self Improvement, Life, Creativity

When Jeff Nobbs (my partner) and I returned to San Francisco last September after several months on the road, I fell into a deep panic because I didn’t know what the heck I was going to do next with my life. Naturally, the most frequently asked question of us at that time was: “So, what’s next for you guys?”

This anxiety was further magnified because Jeff always had a good answer to the question — he had many options awaiting him, and by October, he’d picked one and pursued it. Yes, yes, I know comparison is the thief of joy, but I felt like I’d regressed to my post-college years, totally clueless as to what my life calling was, what I was good at, what I enjoyed and where I might add value. I was simultaneously paralyzed by the infinite optionality put forth by modern society. At one point, I’d listed out 30+ career paths I would be interested in exploring further, one of which was a “Wholeness Mentor” — like wtf is that? I don’t even know.

For the next couple of months, I worked on a project here, a project there, and explored, however briefly, what it would be like to start a business with my best friend. It was fun while it lasted, but I came to realize while I liked the idea of being an entrepreneur, I didn’t actually like being one. The zealous city of San Francisco and its people had primed me into thinking everyone and anyone could be an entrepreneur, including myself, but when it came down to it, I, quite simply, didn’t enjoy the day-to-day of being one, of always having to be “on” and having to answer to everyone and their mothers. I’d deluded myself into believing I wanted to be an entrepreneur, but I quickly realized: 1) I’m not that motivated by problem-solving, and 2) I’m not that ambitious.

These are lamentable things to admit to yourself, especially living in a city that often feels like it’s populated by the world’s valedictorians, over-achievers and people who won “Best All-Around” in their high school yearbook, where every single person wants to change the world for the better. To admit that I didn’t care much about making the world a better place without eroding my sense of self-worth was tough, really tough.
How to Support Secured Connections inside Micronaut’s GraalVM
By: Vladimír Oraný
Tags: Graalvm, Java, AWS, Micronaut, Tech

Micronaut has great out-of-box support for GraalVM. I've tried a simple task to create a Micronaut function to be handled by Amazon API Gateway which connects to Amazon RDS PostgreSQL. The following command generates the skeleton of the function handling API Gateway Proxy using GraalVM:

mn create-app graalvm-function --features aws-api-gateway-graal

See Custom GraalVM Native Runtimes for more information about API Gateway and GraalVM functions.

Next, we create a domain class, controller and repository using Micronaut Data JDBC. Feel free to copy from Pet Clinic example. How to use Micronaut Data JDBC goes beyond this post but there is one important part of the documentation which is Going Native with GraalVM. Please, follow the Configuration for Postgres section.

Now we come to the part which is not included in any guide yet. If you deploy the function with deploy.sh command and test it either from the AWS Lambda or by setting up API Gateway endpoint and executing the HTTP command then you will get the following warning with exception:

WARNING: The sunec native library, required by the SunEC provider, could not be loaded. This library is usually shipped as part of the JDK and can be found under <JAVA_HOME>/jre/lib/<platform>/libsunec.so. It is loaded at run time via System.loadLibrary("sunec"), the first time services from SunEC are accessed. To use this provider's services the java.library.path system property needs to be set accordingly to point to a location that contains libsunec.so. Note that if java.library.path is not set it defaults to the current working directory. com.amazonaws.serverless.exceptions.ContainerInitializationException: Error starting Micronaut container: Bean definition [javax.sql.DataSource] could not be loaded: Error instantiating bean of type [javax.sql.DataSource]: sun.security.ec.ECKeyPairGenerator.isCurveSupported([B)Z [symbol: Java_sun_security_ec_ECKeyPairGenerator_isCurveSupported or Java_sun_security_ec_ECKeyPairGenerator_isCurveSupported___3B]

The reason is that the function sets up a secured connection to the PostgreSQL inside the VPC using SunEC library. The library is provided by libsunec.so file inside GraalVM distribution. There are two steps which need to be accomplished.

First, copy libsunec.so file into the deployment archive function.zip . In Dockerfile located in the root of the project replace the line RUN zip -j function.zip bootstrap server with following two lines:

RUN cp /usr/lib/graalvm/jre/lib/amd64/libsunec.so libsunec.so

RUN zip -j function.zip bootstrap server libsunec.so

Second, replace the last line of bootstrap script with following to let the application find libsunec.so library file:

./server -Djava.library.path=$(pwd)
Mental Health Awareness is More Than Just a Meme
By: Lizzie Finn
Tags: Life Lessons, Mental Illness, Mental Health, Depression, Health

I speak candidly from my own experience with PTSD and clinical depression, which were exacerbated by six years of late-stage neurological Lyme disease and the hormonal and emotional upheaval brought on during menopause.

I was in a very dark place for years. I could barely muster the energy to get out of bed, and I was miserable every minute of every day from constant, debilitating pain. Without sleep or physical healing, my emotional and mental faculties were overwhelmed, and I became an overly-sensitive, anxious, irritable, melancholy mess.

Instead of earning compassion and kindness from those around me, I earned disdain and alienation. Part of me doesn’t blame others. Clearly, I was not a fun person to be around. The truth is — I was drowning, and even I didn’t understand how far I’d fallen into the pit of depression until I no longer recognized myself.

Sadly, some of the worst offenders when it came to recognizing my mental illness were people in the medical or therapeutic fields.

However, mental illness in real life isn’t always like it is in the movies. We aren’t all banging our heads against walls and running naked through the halls in the Cuckoo’s Nest.

These also happen to be the very people who post enthusiastically online about how woke they are when it comes to mental illness. They make sure everyone knows they are ‘warriors’ who donate money and support the mental health community.

What I’ve seen from many of these mental health and medical professionals is outdated knowledge gleaned from college courses they took thirty years ago. On stage, they can pontificate about theory and collect awards for their service and valor. They recognize people with extreme mental illness who need heavy-duty medications or hospitalization or constant supervision to survive.

However, mental illness in real life isn’t always like it is in the movies. We aren’t all banging our heads against walls and running naked through the halls in the Cuckoo’s Nest.

In every-day life, many people, including therapists and clinicians, fail to recognize that millions of people — their friends and family members included — are living and working and struggling with varying degrees of mental illness.

Just because we are functioning at high levels and look normal on the outside doesn’t mean we aren’t silently struggling every minute of every day.

We’re not just having bad days.

We’re not just a Debbie Downer.

We’re fighting demons.

And sometimes the demons are winning.
Data visualization using Pandas
By: Jayashree Domala
Tags: Pandas, Python, Data Science, Data Visualization, Exploratory Data Analysis

Data visualization using Pandas

This article will help you to use in-built Pandas methods for visualizing data and drawing insights.

How to import the packages?

Numpy and Pandas package is imported. Along with this the magic function ‘%matplotlib inline’ is mentioned to make sure that the plots are displayed in the notebook.

>>> import numpy as np

>>> import pandas as pd

>>> %matplotlib inline

For the purpose of understanding, a dataset is taken which has random values.

>>> df1 = pd.read_csv('dataset2.csv')

>>> df1.head()

How to create a histogram plot?

A histogram plot can be generated by using the method ‘hist’ on a column of a dataframe. The number of bins can also be specified.

>>> df1['b'].hist(bins=15)

In case you want to view the plots in the seaborn style then import the package of seaborn, set the style and run the code again.

>>> import seaborn as sns

>>> sns.set_style('whitegrid') >>> df1['b'].hist(bins=15)

How to deal with general plot kinds?

You can also call the ‘plot’ method off the dataframe and mention the kind of plot needed.

>>> df1['c'].plot(kind='hist',bins=10)

You can also call the hist method directly through the plot method.

>>> df1['c'].plot.hist()

How to create area plots?

It plots the area of the dataframe columns. The alpha keyword can be specified to tweak the transparency.

>>> df1.plot.area(alpha=0.7)

How to create bar plots?

The ‘bar’ method plots the bar plot.

>>> df1.plot.bar()

In case you do not want the bars to be plotted separately and instead be stack on each other, pass the value True to the stacked keyword.

>>> df1.plot.bar(stacked=True)

How to create line plots?

A line plot can be drawn by calling the line method and pass the x and y values.

>>> df1.plot.line(y='d')

The figure size and line style can also be changed like linewidth.

>>> df1.plot.line(y='a',figsize=(5,3),lw=2)

How to create scatter plots?

The scatter method is called and the x and y values are passed.

>>> df1.plot.scatter(x='b',y='d')

If you want to compare with another column then mention the column name to the ‘c’ value. You can also change the color of the plot using the cmap keyword.

>>> df1.plot.scatter(x='b',y='d',c='a',cmap='rainbow')

How to create box plots?

The box method can be called to create box plots.

>>> df1.plot.box()

How o create hex plots?

This is just like the scatter plot but the data points are represented as hex cells.

>>> df1.plot.hexbin(x='b',y='d',gridsize=15)

How to create KDE plot?

KDE stands for kernel density estimation. The kde method can be called to plot it.

>>> df1['d'].plot.kde()

>>> df1.plot.kde()

For more detailed information on Pandas data visualization, check the official documentation here. Refer to the notebook for code here.
Dear APEX Community Members
By: Jimmy Hu
Tags: Big Data, Technology, Blockchain, AI

Updates — Technology and enterprise pilots

We are on track to have 4–5 enterprise pilots this year that will use APEX Network in production mode. Currently we cannot yet disclose the names of the enterprise pilot users but there are three piloting enterprises from two different industries that are well into the process and already beginning to see value:

One previously announced budget Chinese airline (similar to Southwest in the US)

One top 5 Chinese car brand (Tesla competitor)

One high-end Chinese airline

We are expecting first experimentations of pilots on the official APEX Network mainnet as soon as 1–2 months after launch. We are also in the process of experimenting with a hybrid model where user data is stored on a private or alliance chain version of APEX Network, but cross-enterprise transactions occur on the main network.

Pilots are actively pushed by the partnership development team if they assess the enterprise to be a good fit. At least 70% of our enterprise base are aware of our blockchain technology offerings.

Federated Learning, of which an early introduction was given by the team, is one of the latest blockchain technology features we are developing, and it will eventually be available for use both on the main network as well as private/hybrid chains. As previously stated, the goal is ultimately to have it run on the public chain. Indeed, FL at scale only makes sense at the public chain level, though to ease adoption and reduce hesitance I’m sure certain enterprises would like to test it at the private level first.
6 Tips to Stay Motivated on Your Side Projects
By: Eric Chi
Tags: Programming, Technology, Motivation, Software Development, Software Engineering

1. Define the MVP

This is my most important rule when it comes to staying motivated on side projects: the MVP. MVP stands for Minimum Viable Product. It is the minimum amount of features required to achieve functionality so that users can use it.

Photo by Halacious on Unsplash.

Why do you need to do this?

This is extremely important when working on a side project because it is the first major goal or the major goal you are trying to hit. It is what keeps you on track during your project and keeps you motivated to finish since you have a clear idea of what needs to be done.

Write down all the features you want to be implemented for the first iteration of your project. Ask yourself the following questions:

What is my application trying to accomplish?

Is this a must-have in order for my application to work? Or this a nice-to-have?

Once you release the MVP, you can iterate on top of it, introducing more features that would enhance the user experience. Some side projects never see the light of day because tasks keep making their way into the backlog, fighting an endless battle of scope creep.

For my projects, I will make a v1.0.0 release of the application I am trying to build and iterate through the weeks (v0.1.0, v0.2.0, etc.) until I hit that prized v1.0.0 version that I consider the MVP.
I Strived to Be an Instagram Influencer, Now I Write
By: Cal Axe
Tags: Marketing, Content Marketing, Writing, Business, Influencer Marketing

More content, more brand.

I once hosted an Instagram Live morning show for my commercial real estate business. Each Friday, while the rest of the office enjoyed a jeans day, I showed up to work in a blue suit and tie, reserved a conference room, and recorded myself regurgitating real estate news.

“Nationwide Insurance moved into their new 400,000 square foot headquarters, and office rent prices rose to all-time highs”

This was before COVID, office space was actually leasing then.

Optimistically, I wanted to be the Jimmy Fallon of commercial real estate, but sounded more like a professor addressing students cramming for a final.

I posted ten episodes, grew a small audience, then decided, I hate this.

Why do it at all?

I was looking for something to spark sales and stumbled upon the world of content marketing and the influencers who champion such a strategy, notably Gary Vaynerchuk.

If you don’t know him, his message goes like this: Unless you want to sit Shiva while your business peels, you better post daily on Instagram, Facebook, Snapchat, Twitter, LinkedIn, and TikTok.

Gary says people don’t post because they’re worried mean girls from high school will DM poop emojis. A pleasant way of saying, insecure.

Of course he’s right. I’m no Jimmy Fallon, but I wasn’t about to give up. I ditched the morning show and started documenting my work life. I filmed myself cold calling, took pictures of clients on building tours, and even created a “day in the life” TikTok.

I posted about twenty behind-the-scenes clips, grew a small audience, and decided, I hate this.

After twenty pieces of content, things became repetitive. Plus, just because I approached work like Hearts of Darkness didn’t mean my coworkers or clients felt as much. I received many stink eyes and several “what do you think you’re doing?”

Clearly, I’m not Jimmy Fallon or Francis Ford Coppola.