fabiochiu/medium-articles huggingface dataset:
Hard Times Can Make You Stronger and More Successful
By: Matthew Royse
Tags: Personal Development, Business, Entrepreneurship, Self Improvement, Life Lessons

Hard Times Can Make You Stronger and More Successful

There are benefits to overcoming adversity.

Photo by Johnson Wang on Unsplash

We all go through difficult times in life. It can help us build up the strength to make it through anything.

Going through hard times is beneficial. It makes you tougher, stronger, and more successful.

“Tough times never last, but tough people do.” — Robert Schuller, an American Christian televangelist, pastor, motivational speaker, and author

No one really enjoys the experience of losing your job or getting robbed at gunpoint.

Both of things have happened to me and they made me stronger.

Psychologists say traumatic events can make you stronger physically and mentally. Research shows people who lived through post-traumatic growth report positive changes in their relationships with others, a better appreciation of life, and new possibilities in life.

“Where there is no struggle, there is no strength.” — Oprah Winfrey, an American TV personality, actress, and entrepreneur

There’s a benefit to overcoming adversity. When you make your way through tough times, you’ll become stronger and more successful in life. That’s why the phrase “what doesn’t kill you, makes you stronger” really does ring true.

The wisest and most well-rounded people you meet are usually those who have gone through tough times themselves. They have overcome challenges and they have great stories to tell.

As Train and Ashley Monroe sing in one of my favorite songs, Bruises:

“Everybody loses. We all got bruises. These bruises make for better conversation.”

Let’s dive into how tough times can make you stronger and more successful.
Clustering: A Deeper Look
By: Anirudh Gupta
Tags: Machine Learning, Data Science, Clustering, K Means, Statistics

Clustering is an unsupervised learning technique in which we are trying to find groupings in the data set based on some known or unknown properties which might exist. Irrespective of which technique you may use these are the things we are trying to achieve:

Within a cluster the points should be similar to each other.

Between two clusters you need to have a dissimilarity.

Depending on how we define these similarities and dissimilarities there are a number of techniques which one can use. Let us make the problem more concrete.

Where d is the Eucledian distance between two points. We want to find partitions which minimize L. Let us think about the problem in more detail. Suppose you want to divide 4 points into 2 clusters. How many such partitions can we have? For each point we have two choices and we are not considering all points in one cluster and no point in a cluster. So that becomes 2²/2. We can increase the number of points to n and number of clusters to K so that the total partitions become [K^(n-K)]/K!

Now we get close to understanding the complexity of this problem. We can get some estimates by doing an exhaustive search but it becomes very difficult to find the optimal solution.

All solutions in this case are actually sub optimal solutions.

If we think about only two clusters for the time being and we have already found their centers denoted by y₁ and y₂. Now suppose if we want to associate another point with one of the clusters, we have to find the distance between the point and centers of the clusters. We assign a point to a cluster whose distance from center is minimum from the point.

In the diagram above we want to assign the red point to one of the clusters. We can calculate its distance from y1 and y2 and assign it accordingly. What we can also do is we draw a perpendicular bisector of the straight line joining y1 and y2. Then all the points lying on one side of ther perpendicular bisector belong to one of the clusters. Basically, we are creating sets called half spaces. These half spaces are convex. There is an analytical proof for this but if you consider any two points in a half space and join them by a line segment, all points on the line segment will be completely contained within that half space. Now, if we have more than two clusters, we will have more half spaces. And intersection of these half spaces will be again convex. So, this method provides convex shaped clusters. It should be noted that we are still not talking about shape of the finitely many points in the cluster.

There’s also a more subtle point here. Why did we use L₂ norm instead of L₁ norm for calculting distance between the two points in the loss function? As seen in the previous example in case of a 2 dimensional space, the half space is obtained easily by the perpendicular bisector of the line joining the cluster centres. A line has zero measure in the Lebesgue sense. In the case of L₁ norm there will be many points which have the same distance from both cluster centres and such a surface has infinite Lebesgue measure.
How To Upload Images to a Rails API — And Get Them Back Again
By: Angus Morrison
Tags: React, Programming, Rails, JavaScript, Ruby on Rails

2. Associate the Image With a Newly-Created Post Record in the Database

On the back end, I used ActiveStorage to create associations between images and their owning objects. It’s the standard gem for file associations as of Rails 5.2 and is steadily replacing older solutions like CarrierWave and Paperclip.

To get started, simply run rails active_storage:install . It will create migrations for two new tables in your database, active_storage_blobs and active_storage_attachments . These are managed automatically; you don’t need to touch them. Run rails db:migrate to complete the process.

By default, ActiveStorage will use local storage for uploaded files while running in a development environment. In production, this is almost certainly not what you want. It also poses some unique challenges for returning image URLs from the server. We’ll configure this properly in part three, after we take a look at our Post model and accompanying endpoint.

Post migration/model

Study this migration for my post model. There’s something odd about it.

You’ll notice that there is nothing about an image here. Neither the image nor a reference to the image lives in the Posts table.

Now check out the model:

The essential line here is has_one_attached :image . This tells ActiveStorage to associate a file with a given instance of Post.

The name for the attached object should match the parameter being sent from the front end. I’ve called it :image , because that’s what I named the corresponding upload form field. You can call it whatever you like, so long as the front end and back end agree.

As a bonus, I’ve added validation to ensure that posts cannot be created without images. Change this to suit your purposes.

Curious about the include statement and my get_image_url method? Let’s inspect the post creation endpoint before coming back to these.

Post creation endpoint

The post_params method is arguably the most important here. The data from our front end has ended up in a Rails params hash with a body that looks roughly like: { "caption" => "Great caption", "image" => <FormData> } .

The keys of this hash must match the attributes expected by the model.

My particular post model requires a user_id, which wasn’t sent in the request body but is instead decoded from an Authorization token in the request headers. That’s happening behind the scenes in get_current_user() , and you don’t need to worry about it.
The Music Plays On — Schubert Lieder
By: Donato Cabrera
Tags: John Wustman, Las Vegas Philharmonic, California Symphony, Donato Cabrera, Music

This will be the first of probably many blog posts on this subject since, first and foremost, Schubert wrote over 600 secular songs, and every one of them could be individually discussed in great detail. Also, there have been many singers, each one deserving a retrospective, who have made it part of their life work to specialize in singing these very special pieces.

John Wustman

The primary reason I decided to study conducting at the University of Illinois at Champaign-Urbana was to work with Donald Schleicher, an excellent teacher of conducting. However, the second reason was to be a fly on the wall of the great accompanist, John Wustman. He had visited my hometown of Reno, Nevada, to give a masterclass and he was the first person to reveal why I had such a fascination with Schubert’s songs. I wasn’t much of a singer, although I sang in chorus, and I wasn’t much of a pianist, although it is my first instrument and a tool I use to study scores. My main instrument was the French horn. However, I had a love for Schubert’s songs since high school and I think Mr. Wustman was rather bemused by my extensive knowledge, if I do say so myself, on something for which I had no vested interest as a student, per se.

I audited Mr. Wustman’s Schubert Class for my entire first year. I watched my fellow students, singers and pianists, go through dozens of songs. We explored any and all meanings - and double-meanings — of every word, studied the myths that were referenced, ruminated on all emotional and philosophical content. It remains the most musical and intellectual class that I have ever taken and I learned more about music making than the majority of time I have spent making music. Here’s a wonderful example of his teaching:

Here are some of Schubert’s Lieder I remember exploring during that glorious year with Mr. Wustman. I ended up being his page-turner for most of the class….I’ll never forget his “click, click” whenever he played Der Einsame….
Step-By-Step Classification Modeling
By: Ulku Guneysu
Tags: Programming, Machine Learning, Classification, Data Science, Python

4. Model Check

Model prediction and residuals

The .predict method will provide model predictors:

y_hat_train = pipeline.predict(X_train) y_hat_test = pipeline.predict(X_test)

Residuals can be calculated by subtracting predictions from the original values, which are y_train and y_test .

Confusion matrix

To plot a confusion matrix, use the plot_confusion_matrix function from sklearn.metrics :

plot_confusion_matrix(pipeline, X_test, y_test, cmap=plt.cm.Blues)

It is a great way to visualize Actual Labels versus Predicted Labels.

Confusion matrix

Above, you can see a confusion matrix plot. By your classification model, the y-axis is True Labels and the x-axis is Predicted Labels. The target has 708 (673+35) values in 0-class and 126 (101+25) values in 1-class.

The box on the top left corner(673) represents the 0 values that are predicted correctly by the classification model. The box on the top right corner (35) represents the 0 values that are predicted incorrectly by the classification model. Your aim is to lower the number of incorrectly predicted values.

Classification report

Use the classification_report function from sklearn.metrics to create an evaluation metrics table. This table represents the quality of a model:

classification_report(y_test, y_test_pred)

Classification matrix

Precision measures how precise the predictors are:

Precision = Number of True Positives / Number of Predicted Positives

Recall indicates what percentage of the class is captured by the model:

Recall = Number of True Positives / Number of Actual Total Positives

F1-Score is the weighted average of Precision and Recall :

F1-Score = 2 * (Precision * Recall) / (Precision + Recall)

When checking for the quality of a model, it is imperative to decide which are evaluation metrics are more important for your dataset.

AUC Score and ROC Curve

AUC Score and ROC Curve are other evaluation metrics that provide information on the quality of the model:

If your model doesn’t have the decision_function property, you may try using the model.predict_proba function.

For the perfect ROC Curve, the area under the curve should be 1.0. The AUC value lies between 0.5 to 1, where 0.5 denotes a bad classifier and 1 denotes an excellent classifier.

ROC Curve

The graph above represents the ROC Curve for a classification model. It is obvious that the model is not doing very well. The goal is to get the AUC Score close to 1 and a ROC Curve with the max area (1.0) under the curve. An AUC Score around 0.5 is no better than predicting a random coin toss.

Feature importance

This evaluates the importance of the features in the classification model:
Google Cloud Data Catalog — Live Sync Your On-Prem Hive Server Metadata Changes
By: Marcelo Costa
Tags: Database, Big Data, Google Cloud Platform, Apache Hive, Data

Disclaimer: All opinions expressed are my own, and represent no one but myself…. They come from the experience of participating in the development of fully operational sample connectors, available at: github.

The Challenge

Entering the big data world is no easy task, the amount of data can quickly get out of hand. Look at Uber story, on how they deal with 100 petabytes of data using the Hadoop ecosystem, imagine if every time they would sync their on-premise metadata into a Data Catalog, a full run was executed, that would be impractical.

We need a way to monitor changes executed at the Hive server, and whenever a Table or Database is modified we capture just that change and incrementally persist it in our Data Catalog.

If you missed the last post, we showcased ingesting on-premise Hive metadata into Data Catalog, in that case we didn’t use an incremental solution.

To grasp the situation, a full run with ~ 1000 tables took almost 20 minutes, even if only 1 table had changed. In the Uber story, that would be no fun, right?
Follow Policy: Twitter, Facebook, LinkedIn, et al.
By: Robert Merrill
Tags: Facebook, Follow Policy, Follow

Social networks are powerful, meaningful tools I have had the opportunity to leverage we ll for personal and professional benefit. Just last week I was trying to find good camping locations and received several good recommendations.

I have also gone overboard at times with my virtual social life by, for example, facebooking when I should be playing with my kids, or being glued to twhirl instead of my work.

It’s time to make some changes to who and why I follow/friend/add people to these networks. In the past, I have allowed LinkedIn to be my most conservative network, but time and life dictates that I need to be much more selective about my other social interactions, too.

So, with a hat tip to Shel, here’s my Twitter, LinkedIn and Facebook (“TwinkedInBook”?) follow policy:

As a general rule, I only add/follow people I actually know . That means we have had some meaningful interaction and that your connection aligns with the things I care about.

. That means we have had some meaningful interaction and that your connection aligns with the things I care about. I welcome conversations. If I have said something you want to comment on, please do, but be real, and open about who you are. I don’t have to follow you to hear you . This is the Internet. @robertmerrill me, and I will find it. If you really need to reach me, um, my full name at gmail dot com is a pretty good starting point.

. This is the Internet. @robertmerrill me, and I will find it. If you really need to reach me, um, my full name at gmail dot com is a pretty good starting point. I get that networking is not just socializing [via @jibberjobber]. I like both, but I am primarilly online for networking in the sense of a professional relationship. I believe networking is about what you give and get. I wont follow you if I don’t think I can meaningfully give to you and/or that I can receive from you appropriately as well . By the way, I still believe the appropriate balance is to GIVE 10x what you RECEIVE in any relationship, but I will not follow you unless you’re providing a relevant, useful and thought-provoking connection.

. By the way, I still believe the appropriate balance is to GIVE 10x what you RECEIVE in any relationship, but I will not follow you unless you’re providing a relevant, useful and thought-provoking connection. If I don’t follow you, or just stopped following you, please don’t be offended. Really. It’s not you. It’s me.

I will follow companies when I want announcements or information. I will follow people when I see relevance in what you’re talking about. I will unfollow and/or block both when the conversation becomes you selling something, or regurgitating, or just “@username lol!” -ing all day long.

The things I say are my opinions and beliefs. Yours are your own. Keep that clear and we will get along just fine :)

:) I reserve the right to change this or update it at any time, or at no time, for any or no reason.

And now begins the purging of the accounts…
Creating a Shared and Cached Fetch Request
By: Aditya Purwa
Tags: Typescript, Frontend, Web Development, JavaScript, Software Development

There are cases when you have multiple components that display the same data from the same source. If every component that requests the data need to fetch it from the source, you would end up with too many fetch request; thus consuming many of the user network resources.

Typically, this can be solved by requesting the data only once on the parent component, then pass down the data to the components that might need it. However, now you have to responsibly manage the state of the data on the parent component and pass it around.

What if we could reuse the same code, that it is written like every component is requesting the data, but the data was actually shared and cached instead of fetching it every time from the source?

The concept is simple, wrap the fetch call into a function that handles sharing fetch state and cache expiration.

You can play with this example on https://codesandbox.io/s/shared-cached-fetch-9szql

Another Approach

What do you think about this approach? Do you have a better alternative or addition to this implementation? Feel free to share your thoughts!

I remember using saga patterns that handle this kind of issue, but adding a whole saga pattern seems like an overkill for my small project.
Recording MP3 audio using ReactJs under 5 minutes
Tags: React, ES6, MP3, JavaScript, Audio Recording

Hello folks. I was building a website using ReactJs and I came across a requirement to record an audio file on the web. Like, everyone, I started Googling it.

After googling some time, I came across an npm package that records mp3 files called mic-recorder-to-mp3 . You can find it in the below link.

https://www.npmjs.com/package/mic-recorder-to-mp3

Install and Import

To install the above npm package into your React project, do the following

npm install --save mic-recorder-to-mp3

After installing it you have to import the package in the project.

import MicRecorder from 'mic-recorder-to-mp3';

Configure MicRecorder

Now set the bit rate for the audio to be recorded to 128 bits

const Mp3Recorder = new MicRecorder({ bitRate: 128 });

Check for Browser Permissions

First set some basic state values like

this.state = {

isRecording: false,

blobURL: '',

isBlocked: false,

}

Before we start recording we should check if the permission for the microphone is allowed in the browser. To do that we need to use "navigator.getUserMedia()" function. Look more about it here.

I recommend using the below code in componentDidMount()

navigator.getUserMedia({ audio: true },

() => {

console.log('Permission Granted');

this.setState({ isBlocked: false });

},

() => {

console.log('Permission Denied');

this.setState({ isBlocked: true })

},

);

The above code checks the permissions of the web browser to access the microphone for recording audio. If permission is given the isBlocked is set to true or else false

Recording Audio

Set up two buttons and an HTML5 audio tag in the render() function.

<button onClick={this.start} disabled={this.state.isRecording}>

Record

</button> <button onClick={this.stop} disabled={!this.state.isRecording}>

Stop

</button> <audio src={this.state.blobURL} controls="controls" />

To start the audio recording call the start() function in the Mp3Recorder which in turn returns a Promise.

start = () => {

if (this.state.isBlocked) {

console.log('Permission Denied');

} else {

Mp3Recorder

.start()

.then(() => {

this.setState({ isRecording: true });

}).catch((e) => console.error(e));

}

};

Now the audio starts to record once the above function is called. It continues to record until the stop() function is called.

After the recording is stopped, getMp3() is called which returns a Promise.

A blob and buffers are received as arguments when the Promise is resolved. We can create a “blob URL” from the received blob using URL.createObjectURL(). Now set the received URL as src for the audio tag.

stop = () => {

Mp3Recorder

.stop()

.getMp3()

.then(([buffer, blob]) => {

const blobURL = URL.createObjectURL(blob)

this.setState({ blobURL, isRecording: false });

}).catch((e) => console.log(e));

};

Hooray!!, Now you can record audio in MP3 format by clicking the start button.

The complete example is available in the GitHub link given below.

Say Hi, It’s free @matheswaaran_S or https://matheswaaran.com
My Favorite Books & Online Courses for Statistical Learning, Data Visualization & Machine Learning
By: Niannian Wu
Tags: Python, Data Visualization, Data Science, Statistics, Programming

Statistics and Probability

I had my statistics and probability courses in university, but if you’re looking for an online course, I believe that the MIT course Introduction to Probability and Statistics is an excellent choice.

This course provides an introduction to basic probability definitions and theorems, and it also talks about basic statistics topics — Bayesian Inference, Frequentist Inference (NHST Null Hypothesis Significance Testing), Confidence Intervals, and Regression.

For Bayesian Inference, I also enjoy two Coursera courses from the University of Califonia Santa Cruz: Bayesian Statistics: From Concept to Data Analysis and Bayesian Statistics: Techniques and Models.

And want to know something about history in statistics? The book “The Lady Tasting Tea: How Statistics Revolutionized Science in the Twentieth Century” talks about the revolutionary ideas that changed our life.
You Know Frank Lloyd Wright, but Did You Know His Wisconsin Home Was the Site of a Massacre?
By: Jennifer Geer
Tags: True Crime, Relationships, Society, Architecture, History

An American architect

Even if you are not a student of architecture, chances are you have heard of Wright. He began his career in Chicago, but his most famous works are the Solomon R. Guggenheim Museum in New York and Fallingwater in Pennsylvania.

His Prairie style of residential architecture, featuring simple decor, horizontal lines (to mimic the midwest prairie), and flat roofs, were widely popular in the US. His home in Oak Park, Illinois, is an example of Prairie style, and it is open for tours to the public.

Additionally, there is a walking tour that can be taken starting from his house through the Oak Park neighborhood, which highlights some of his most significant houses in the area.

He shared his home and studio with his wife and six children. It’s remarkably modern looking for a house built in 1889. One of the most striking features of the house is the expansive playroom on the second floor.

(Children’s playroom in Wright’s Oak Park home and studio) Image by Carol M. Highsmith, Public domain, via Wikimedia Commons

You will learn lots of interesting facts on the tour of his Oak Park home. It’s fascinating, and I recommend it if you are ever in the area.

But don’t expect to learn from your tour guide the story of how Wright scandalously left his wife and children for a mistress in 1909. And then built a home for her in Wisconsin that he dubbed his “love cottage,” where she was tragically murdered along with her two children and four of Wright’s employees.
Highlights: Week #24
By: 𝘋𝘪𝘢𝘯𝘢 𝘊.
Tags: Short Story, Inspiration, Highlights, Energy, Creativity

Dear lovely people of KTHT and beyond,

Thank you for all the submissions, engagement and constant efforts to make this community a welcoming, warm, uplifting, safe place for us to open our hearts and share things we wouldn’t otherwise share. I am humbled, grateful and excited to be on this journey with you.

Looking at 2020 in hindsight, I don’t think it was all doom and gloom. Although I felt very lonely at times, as I am sure a lot of you have, having this platform to share my thoughts and emotions on has been a blessing, a game changer. I really don’t know how I would’ve survived quarantine without it…

Fast forward to today, I have another list of revelatory, insightful, awe-inspiring stories to share with you that I hope will keep you warm this cold winter day. Find a cozy place, get comfortable and enjoy the ride these articles will take you on.

Ready?
Temas en Dataviz: Una Base para Empezar
By: Martin Telefont
Tags: Typography, Process, Storytelling, Communication, Data Visualization

Sign up for The 'Gale

By Nightingale

Keep up with the latest from Nightingale, the journal of the Data Visualization Society Take a look
How to Come Up With Programming Project Ideas
By: Jun Wu
Tags: Learn To Code, Software, Programming, Software Engineering, Software Development

Elements of Good Project Ideas

I have project ideas all the time. But the good project ideas are the ones that I end up pursuing for months on end. This is the framework I go by when picking good project ideas. The way I see it, every good project idea has the chance of turning into something more.

The starting point of the project is as important as the journey itself. You want to orient your journey by the correct compass. For me, my compass is always applications in the real world. I don’t program just for myself. I program to use my skills to solve some problems.

Fun — First and foremost, are you having fun? Going through life clocking in from 9 to 5 can get repetitive at any job. Are you having fun in your weekend projects? I don’t sit in front of my computer if I’m not having fun on my weekends. You shouldn’t either.

Solve a problem — What is the one thing that you want to improve in your life? How can you develop a product to solve that?

Provide value — Providing value with your product is one thing. But is the project providing you with value? Are you learning new skills? Are you gaining new information?

Starting from scratch — Often, programmers like to start from scratch. Can you google and see if anyone in the community has developed a project similar to yours? Not starting from scratch means time saved.

Build to keep — Many programmers don’t think of side projects as anything that they want to keep. But good side projects can be turned into startups. You want to build and design it so that you can keep it. Side projects can generate side revenues. You’re investing in side projects.

Start simple — Every project I’ve ever started was so simple in the beginning. You want to concentrate on just one idea and one functionality. Think microservices. Take the workflow you want apart. Just automate one piece of the puzzle.

Synergy — You’re a programmer. But who are you as a person? When you have synergy between who you are and what you do, now that’s the recipe for a good life. Create projects that you’re passionate about because they align with who you are as a person. You can also create synergy between work projects and side projects. Once I wrote some functionality to solve one of my problems. Later on, I used the code to apply to a work project as well.
ITSM Analytics
By: Ivett Kovács
Tags: Tableau, Data Visualization, Management, Itsm, Dataviz

Information Technology has become the backbone of almost every business in the last few decades, driving productivity and efficiency in every business function. Today, IT organizations have more data than ever before. Whether its service ticket management, asset tracking, budgeting, staffing, or infrastructure and platform monitoring — that data has the power to speed up and simplify your job.

The 4 core IT processes

ITSM (or IT Service Management) refers to all the activities involved in designing, creating, delivering, supporting and managing the lifecycle of IT services.

What are IT services? Think of any piece of information technology at your workplace — from business critical services like ERP systems to less critical stuff like your laptop, the apps installed on it. They’re all services provided by internal or external IT service providers who are responsible for the end-to end service lifecycle from design through deployment to continuous improvement and termination.

Why you need ITSM?

· Improve (internal) customer experience

· Better control and governance

· Better Business — IT alignment

· Reduce costs and risk

· Increased efficiency

· Transparent Service Levels

· Standardization

There are many tools that provide service desk and/or monitoring functionalities, but ITSM tools generally lack the sophisticated analytics and dashboarding capabilities we data heads are used to. Luckily we can always use our favourite analytic tools to tackle these kind of challenges.

Why you need ITSM Analytics?

In a complex, heterogeneous environment of tools, infrastructure and organizations, there is no single window to access and analyze IT Service Management data. This lack of visibility is a barrier of sufficient governance, driving inefficiencies and increasing the cost of delivering services.

Platforms like Tableau or Power BI allow companies to bridge the gap between information silos and to analyze all IT service related data in one single place. This integrated approach enables you to create detailed domain specific dashboards for the various roles including subject matter experts, service managers and executives to provide insights into the performance, costs, health and availability of IT services. These dashboards need to be easily customizable and be able to provide drill-down and drill-across functionality. This will allow businesses to understand how well IT services are meeting business objectives and agreed service levels.

Our two example ITSM dashboards help application owners and service managers track the performance and availability of all applications, number of incidents and requests as well as trends in resolution time.

Let me know if you have feedback, suggestions or questions.
Sound
By: Sean Zhai
Tags: Poetry, Environment, City Living, Civilization, Art

Haiku is a form of poetry usually inspired by nature, which embraces simplicity. We invite all poetry lovers to have a go at composing Haiku. Be warned. You could become addicted.

Follow
“Dr. Google” Thinks I Have a Tumor
By: Rose Bak
Tags: Self, Health, Medical, Internet, Self Help

We have all had this experience of the cancer diagnosis on Google. We can laugh it off, but sometimes these doomsday experiences can make us less likely to believe something is wrong when there is an actual problem.

For example, one night I suddenly became quite ill. I was in terrible pain and had a bunch of weird symptoms. I tried a few things that didn’t work and then, alone and freaked out in middle of the night, I huddled over the laptop and started googling.

Soon I realized I was dying. At least according to Dr. Google.

I was sad at first, but then I took a deep breath and told myself, “wow this is ridiculous, you are not dying, you are just being a huge hypochondriac”.

I got up and went to work, because I’m a 50-something-year-old woman who grew up in the Midwest. Unless there’s a bone sticking out or you’re bleeding from the head, I was raised that you should get your butt to work.

I felt a little better with the distraction of work. But later in the morning, I suddenly felt like someone had hit me with a truck. I went from feeling vaguely unwell to “I’m about to pass out and die at my desk” in the course of five minutes.

I called the Advice Nurse, who said I needed to get to the ER right away. I argued, because who wants to spend the day in the ER for something that’s probably nothing.

Despite the sudden onset of symptoms and how terrible I felt, I continued to work for a little while longer. But it kept on, so I finally left and headed to the Emergency Room for only the second time in my life.

While I didn’t have any of the terrible things that Dr. Google or the Advice Nurse suggested, I did need actually need care for something. There was an actual problem.

I suffered in pain for hours and worried that something terrible was wrong with me because I stubbornly avoided going to the ER.

The therapeutic benefits of an IV, pain meds, and a battery of tests to rule out your worst fears cannot be overstated. I say that recognizing my privilege as a person with good health insurance and coming from a group that traditionally receives better healthcare treatment.

That experience made me think about catastrophizing versus minimizing.

It’s such a balance. You don’t want to be that person who runs to the doctor every other day for every tiny symptom, but you also don’t want to be the person who ignores something serious.
Yes, Singleton Can Be Better
By: Alen Huskanović
Tags: Android, Software Development, Design Patterns

Recently, at my University, I was listening to subject Design patterns where they forced us to use design patterns while making our homework and projects. I was using Singleton pattern as standard implementation where I defined types that I wanted to use, but then I saw an interesting implementation from one guy. As a software enthusiast I always try to find better ways to make some piece of code more effective so I started to use his approach.

“In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.” according to Wikipedia. There are some discussions how Singleton is bad and have nickname “ant-pattern” but I will not enter that discussion in this article, I will just show this approach. In this approach we will define just Hashmap that will have Object as second parameter,with this way we can put any object that we need without worry to define new variable in our singleton class.

Implementation

First we need to create a class Registry and define protected constructor.

public class Registry { private static volatile Registry instance = null;



protected Registry() {

} public static Registry getInstance() {

if (instance == null) {

instance = new Registry();

}

return instance;

}

}

As I said before, we will not define every variable, we will have just one that will be HashMap, so we will add that in our Registry class and put initialization in our constructor.

private final HashMap<String, Object> items; protected Registry() {

items=new HashMap<>();

}

Also, we need to have setters and getters for our data in Singleton, we will do that through these two methods.

public void set(String key, Object value) {

this.items.put(key, value);

} public Object get(String key) {

return this.items.get(key);

}

You should use it in this way

Registry.getInstance().set("model.cat", new Cat("Lion", 1)); Object object=Registry.getInstance().get("model.cat"); if(object instanceof Cat){

System.out.println(((Cat)object).getName());

}

That’s it, we are done, we have our Singleton and we can start working with it! Also, full source code is released at my Github profile. If you are interested in full implementation (example included) check it RegistryExample
Americans Love to Suffer, and That’s Why Nothing Ever Changes
By: Jessica Wildfire
Tags: Politics, Society, Opinion, Culture, Economics

Americans Love to Suffer, and That’s Why Nothing Ever Changes

Requiem for the American Dream.

Photo by Allef Vinicius on Unsplash

My uncle lives out in the woods, on a hundred acres my family stole generations ago. There’s a cemetery out there I’ve never been to, but it’s where most of my ancestors are buried.

He doesn’t care about the pandemic at all. It doesn’t affect him. He’s been alone for years, and doesn’t care to be around people. He came back from the Vietnam War broken, and stayed that way. That’s the America I know. You’re supposed to suffer. It’s noble.

The rest of the world looks at us and scratches their heads. They don’t get us. They think something went horribly wrong, but the truth is simpler than that. We were flawed from the start. This pandemic, and all the chaos that comes with it, is a fulfillment of our destiny.

We could change it, but do we want to?
12 (+Bonus) amazing Youtube Channels To Learn Python Programming for Free
By: Jair Ribeiro
Tags: Python Programming, Programming Languages, Programming, Python, Learning To Code

Photo by CardMapr on Unsplash

12 (+Bonus) amazing Youtube Channels To Learn Python Programming for Free

Here you have a great list of Youtube channels if you want to dig into Python programming and learn from the best.

A few days ago, I published an article with 21 of the best channels on Youtube where you can learn Data Science, AI, and Machine Learning for free and... Boom! It was a great success; many people wrote to me that the article was handy and helped them find great content!

If you are looking for the best Youtube channels to dig into Python programming and learn from the best, you have a great list with 12 (my lucky number) amazing programmers who share tips and secrets that will help you to become a master!
Strict Types in PHP
By: Jose Maria Valera Reales
Tags: Software Engineering, PHP, Programming, Software Development, Web Development

In December 2015, PHP 7 introduced scalar type declarations and with it the strict types flag.

To enable the strict mode, a single declare directive must be placed at the top of the file. This means that the strictness of typing for scalars is configured on a per-file basis. This directive not only affects the type declarations of parameters, but also a function’s return type.

The good thing about declaring a PHP file as strict is that it actually applies to ONLY the current file. It ensures that this file has strict types, but it doesn’t apply to any other file in the whole project. It allows you to do, step by step, this migration from non-strict code to strict code, especially for new files or projects.

Strict types affect coercion types

Using hint type without strict_types may lead to subtle bugs.

Prior to strict types, int $x meant $x must have a value coercible to an int . Any value that could be coerced to an int would pass the hint type, including:

a proper int (example: 42 -> 42)

(example: 42 -> 42) a float (example: 13.1459 -> 13)

(example: 13.1459 -> 13) a bool (example: true -> 1)

(example: -> 1) a null (example: null -> 0)

(example: -> 0) a string with leading digits (example: “15 Trees” -> 15)

By setting strict_types=1 , you tell the engine that int $x means $x must only be an int proper, no type coercion allowed . You have the great assurance you're getting exactly and only what was given, without any conversion or potential loss.

Who should care about this “strict type” line?

Actually, declare(strict_types=1); is more for the reader than for the writer. Why? Because it will explicitly tell the reader:

The types in this current scope (file/class) are treated strictly.

'strict_types=1' is more for the reader than for the writer

The writer just needs to maintain such strictness while writing the expected behavior. That said, as a writer, you should care about your readers, which also includes your future self. Because you are going to be one of them.
Do the Rosling
By: Judit Bekker
Tags: Data Visualization, Dataviz, Social Change, Hans Rosling, Tableau

Anyone who has learned Tableau online (via Udemy or any other similar platform) did the Hans Rosling chart as an exercise. So did I, and I felt it was time to do justice to that old visualization. Bear with my story on how I designed this dashboard, and you can see that early viz of mine at the end of the post.

Despite all the bad news we face in media’s coverage of our modern times, the world is getting better in so many ways. This visualization shows how life expectancy has risen all over the globe in the past five decades, while the fertility rate has declined. The causes of these trends are rooted in several factors, but one thing is for sure: we’re living longer than any generation before us.

Click here for the interactive version.

Final dashboard design in Tableau

I might not be the most technical Tableau specialist in the world, but my main drive is conveying straightforward messages in a clear and minimalist style. When I’m doing visualizations for fun, design is my №1 principle to follow. I usually combine Tableau with Adobe Illustrator to pre-design the background and add it back to the software as an image. This way I have better control over the look and feel of the dashboard and don’t have to load all the texts and images one by one.

Another reason I use Illustrator is that I fell in love with the Futura typeface after listening to a TED talk about its rise in popularity after being used on the Apollo 11 mission. In fact, if I had to choose only one font to use till the end of my life, I’d say Futura in the blink of an eye. Unfortunately, Tableau only supports a couple of web safe options and Futura is not one of them.
Daft Punk Releases 6 Minutes of Samples From TRON: Legacy Soundtrack
By: Wade Tandy
Tags: Daft Punk, Movies, News, Disney, Music

So it’s Monday and you’re back at the office/Fortress of Solitude/evil science lair of evil preparing for the long push until next week when you get to kick back for Thanksgiving. Perhaps this will help. Disney just dropped 6 minutes of score samples from the upcoming TRON: Legacy, and I must say that I find them quite awesome. As Third has pointed out before, Daft Punk is what some scholars have referred to as, “fucking awesome” and the six minutes of audio splendor presented here are no exception. I’ve had it running on repeat all morning. Thanks to Consequence of Sound for the news.

Embedded player after the break.
5 of the Best Themes for VS Code
By: Uditha Maduranga
Tags: Vscode, Software Development, Software Engineering, Programming, Software

Get Themes From Extension Marketplace

From the community, VS Code has a large number of themes. Users can get these themes from the Visual Studio Code Marketplace by using the browser. There are hundreds of themes for you to select from, and they vary from colours to popular TV series.

Each theme will have a rating and a full “Getting Started” guide to make life easier for you.

Another alternative is that you can directly select and install themes by going to the “Extensions” view in your VS Code window. If you find one you want to use, simply install it, restart VS Code, and the new theme will be available.

Install theme using VS Code Extensions

Let’s dive into our top five themes!
Team Update
By: Your Data Safe
Tags: Blockchain, Crypto, Data, Cloud Computing, Microsoft

We are delighted to announce and welcome Vincent Dsouza our technical adviser to the team.

Vincent is a Cloud Computing and Blockchain Specialist.

He is an accomplished IT professional with 16+ years of experience in the roles of lead solution architect, technical consultant, pre-sales/business development, service delivery, hands-on deployment in IT Infrastructure Management Services, Cloud Solutions and Blockchain Services.

Vincents’ expertise includes IT Infrastructure Management tools, Cloud Solutions (migration services) and Data Center migration services.

Vincent is certified in IBM Blockchain, AWS, Microsoft Azure, Google Cloud, IoT, Bigdata, Machine Learning and Artificial Intelligence.

For more details on our Private sale please visit www.YourDataSafe.io
A Back-End Developer’s Guide to Vue.js Component Testing
By: Summer Mousa
Tags: Programming, Unit Testing, Vuejs, JavaScript, Vue

Stylistic Changes to a Component

What if our component contains a property that changes the color of the background?

The truthiness of the success prop determines the outcome of the background-color attribute. Therefore, more tests are needed to validate that specific behavior.

Notice that although the component has a prop for message , it is neither described nor mentioned in either of these tests. Why? Because message has no impact on whether or not the color of the component is modified. Another way to think about this is, instead of a Vue component, what if this object were described as a class:

If you are testing the resulting value of success, you would set and call .success . Setting and getting the value of .message has no impact on the outcome of the .success field and should have its own separate set of validations.

To go a bit further, in addition to setting the background color of the element to green, the message text needs to be underlined. The template could look like so:

It is possible to write a test to validate the style of the div element and then validate the style of the p element. But what if more stylistic features are added or changed? That becomes a bit of a hassle and in turn makes the test more brittle. At the end of the day, component testing isn’t really about how a component looks, it’s about how it functions. So functionally this implementation is equivalent to the following.

And the test would be this:

And if you are shitty at stylesheets like I am, you could even get away with a template like this one:
This December, Improve Your Coding Daily with Advent of Code
By: Anthony Agnone
Tags: Machine Learning, Artificial Intelligence, Software Development, Software Design, Data Science

What It Is

Advent of Code is an annual series of daily coding challenges that happens during the year-end holiday season. While its name alludes to Christian traditions, it is a simple pun choice meant to convey the 25-day nature of the series (come one, come all!). Each day, between the 1st and 25th of December, a new puzzle is published. The puzzles usually string along a wonderfully-constructed storyline, keeping you entertained as you are challenged. Here’s an example from 2018:

Example Puzzle (Day 1 2018) After feeling like you’ve been falling for a few minutes, you look at the device’s tiny screen. “Error: Device must be calibrated before first use. Frequency drift detected. Cannot maintain destination lock.” Below the message, the device shows a sequence of changes in frequency (your puzzle input). A value like +6 means the current frequency increases by 6; a value like -3 means the current frequency decreases by 3. For example, if the device displays frequency changes of +1, -2, +3, +1, then starting from a frequency of zero, the following changes would occur: Current frequency 0, change of +1; resulting frequency 1. Current frequency 1, change of -2; resulting frequency -1. Current frequency -1, change of +3; resulting frequency 2. Current frequency 2, change of +1; resulting frequency 3. In this example, the resulting frequency is 3. Here are other example situations: +1, +1, +1 results in 3 +1, +1, -2 results in 0 -1, -2, -3 results in -6 Starting with a frequency of zero, what is the resulting frequency after all of the changes in frequency have been applied? - Day 1 2018, Advent of Code

At this point, a link is available on the page for you to obtain the full input sequence (about a thousand inputs) as a text file. This is where the rubber meets the road between your problem-solving skills and software implementation know-how.

Be careful! Most people will happily nose dive into regurgitating code that reads the input, and then face-plant when they realize it’s time to implement the core algorithm. Take the time first to make sure you fully understand the problem at hand, and (at least mentally) form the algorithmic solution before rushing to the I/O code.

Additionally, do not underestimate the complexity of the series. By design, it starts gently, allowing everyone to get their feet wet with it. Day after day, you will notice the complexity creep in, with the puzzles taking you minutes longer. Stick with it! You will be challenged before it is over.

Most of the participants I know use Advent of Code as a way to simply practice. For the more competitive spirits, a global (and within-group, if you join one) leaderboard provides additional motivation to find the solution quickly. You can find the derivation of the scoring mechanism as well as the top 25 of 2019’s competition in the image below. Regardless of your motivation, it’s a lot of fun and good for your professional development.