fabiochiu/medium-articles huggingface dataset:
How to Quickly Authenticate Users With Ruby on Rails
By: Fatos Morina
Tags: Ruby on Rails, Cybersecurity, Development, Technology, Programming

How to Quickly Authenticate Users With Ruby on Rails

Using basic authentication

Photo by Luca Bravo on Unsplash

You may have cases when you may need to do some authorizations for certain pages so they can’t be accessed by unauthorized clients. There are many authorization methods you can use in a Ruby on Rails application.

In this article, I’ll mention one very simple (yet not so famous) method that comes implemented and ready to be used each time you create a new Rails application.

ActionController::HttpAuthentication::Basic has a method called http_basic_authenticate_with that you usually need to invoke in the top lines of your controller.

Rails is an open-source framework, so we’re thankfully able to see the implementation and the work that’s being done by this method:

Let’s take an example of a DocumentsController . I have two methods that render views. I want to display a list of documents to anyone, regardless of whether they’re already authenticated or not.

I want to restrict the privileges to modify documents to only the users that are authorized. Namely, they know a name and a password I’ve set in the beginning that can be used.

I should certainly use parametrized values that are set in the config files, but for the purpose of this example, I’m using actual values at the time this method is being invoked.

Yes, I know it’s not too difficult to find out, but it’s only used for this article and maybe a few grandmas out there.

That single line of code calls the method that protects your documents from being modified by people you don’t want. That’s really awesome and time-saving so you don’t have to write everything by yourself.

If you need to do this type of authorization for many controllers, then you can simply declare it at ApplicationController :

That’s all you need to do to use this incredibly easy-to-use way of authorization for your application.

Here you can check out the other methods that are included in this Rails module.

Happy coding!
Rheostat Government: Replacing the On/Off Switch with a Dimmer
By: Harvard Ash Center
Tags: Local Government, Leadership, Crisis Management, Coronavirus, Cities

Rheostat Government: Replacing the On/Off Switch with a Dimmer

When the coronavirus pandemic begins to subside, communities should use a nuanced, calibrated approach to allowing businesses to reopen and residents to return to work and school, argues Kennedy School Professor Stephen Goldsmith.

Written by Stephen Goldsmith, originally published on Governing

Two friends in different states told me similar stories recently about how social distancing was being enforced at parks with relatively isolated hiking trails. Because getting to the trails caused too many people to use the same narrow steps or park their cars too close together, access was blocked for everyone.

Clearly government needs to take action in these kinds of situations, which it did, in this case, the way it knows best: by throwing a switch — you are open or you are closed. But when the coronavirus nightmare begins to subside, state and local officials will face difficult decisions about when and how to begin reviving local economies by allowing residents to return to work and visit shops and restaurants. It will be a time for officials to embrace rheostat government, replacing the binary on/off switch with a dimmer. Instead of closing the park, perhaps meter the number of people climbing the steps or parking cars, or even the hours the park is open, to spread out usage.

Nuanced, calibrated use of regulatory powers can help local governments in metering normal life back on….
BuyUcoin 3.0 — What’s New for Crypto in India?
Tags: Cryptocurrency, News, Blockchain, Bitcoin, Startup

Experience the best!

Nobody can touch bitcoin, but anybody can have it!

At BuyUcoin, we foresee Bitcoin’s future as a ‘household commodity’, and ever since our inception in 2016, we have made consistent leaps & bounds in our efforts to nurture the domestic crypto & blockchain ecosystem.

We take pride in a culture that harnesses a team of gifted blockchain demi-gods, customer success obsessionists, product wizards and design maestros who are putting in some of the best work of their lives focussed towards a shared vision — “To make Bitcoin exchange easier than online Shopping’.

Together we BUIDL!

But to claim that our services are ‘perfect’ or ‘flawless’ would be an overstatement, and we consider it as our foremost duty to really listen to our customers and constantly scale-up our product as per their demands and expectations.

We conduct interactive sessions with thousands of our platform users to expand on our understanding of the problems that many of them face during their interaction with our offerings. Based on the said research, we try to solve all such pain-points that our community reports to us.

And ever since the historic judgment by The Supreme Court of India on crypto-jurisdiction in India was announced on March 5, we have been working day-in and day-out to release the latest set of offerings along with updates on earlier features and experiences that our users have known and entrusted us since the beginning.

We’re excited to let you know that these efforts have culminated in the launch of BuyUcoin 3.0 this week.
What to Say on a Date (When You Have Nothing to Say)
By: Keith Dias
Tags: Relationships, Advice, Books, Self Improvement, Love

What to Say on a Date (When You Have Nothing to Say)

A surprisingly simple FBI tactic to keep a conversation going

Photo by cottonbro from Pexels

The Koothrappali conundrum

“Two words: deaf chick. It doesn’t matter if I can’t talk ‘cause she can’t hear me.” — Raj Koothrappali explaining the type of girl that might be attracted to him

You probably remember the character Raj Koothrappali from the hit sitcom “The Big Bang Theory”. He was the brilliant astrophysicist who was also brutally awkward with girls.

Poor Raj had a tough time in the dating world because he was so nervous in the company of a female that he couldn’t utter a complete sentence. Later in the series, he found out that he was able to overcome this problem with the help of alcohol.

What a terrible predicament. On one hand, with alcohol, he became much more socially adept. On the other hand, in the pursuit of the opposite sex, he might also have been risking a dangerous addiction.

While extreme, Raj’s situation is something that many of us experience to varying degrees. We sometimes find ourselves in the company of an attractive person, and we just don’t know how or what to say to keep the conversation going.

In these circumstances, do we take a stiff shot of tequila and hope for the best, or are there other options?
How to animate a pie chart with Victory in React Native?
By: Matías Grote
Tags: Data Visualization, React, Mobile, React Native, Software Development

I was using another library for graphics, but when Apple announced that UIWebView was deprecated I had to change that library. So, I started to search on Google for libraries that don’t use UIWebView, and that’s when I found Victory.

Victory is great! It has multiple charts and the best thing about it is that you can customize almost everything.

What’s Victory?

Victory Native is a React Native library that offers different types of charts, such as line, bar and pie charts. This library is one of the most frequently used alternatives for developers when it comes to adding graphics to an app.

I’ve recently used it in one of my projects. I’ve used the <VictoryChart /> , <VictoryLine /> , <VictoryPie /> and <VictoryAxis /> components.
Acrotrend and Nuffield Health’s Strategic Partnership
By: Acrotrend Consultancy
Tags: Data Science, Big Data, Fitness Industry, Customer Experience, Customer Analytics

Thanks to the recent updates Acrotrend has helped us make to our organisation, we are now more competitively positioned to provide our customers with an enhanced service. DAVE ANKERS, TECHNOLOGY, STRATEGY & PLATFORM DELIVERY DIRECTOR, NUFFIELD HEALTH

We have been working as a strategic partner to Nuffield Health — the UK’s largest not-for-profit healthcare provider — to create a more amenable data environment for their current and future analytics needs and capabilities.

Nuffield Health holds enormous quantities of data. This data was creating data silos and making it difficult not only to obtain a true and consolidated view of customers, but to pull business-critical reports required to guide their key strategy of ‘Connected Health’.

Acrotrend’s team worked with Nuffield Health’s key business stakeholders to understand their functional and business goals from an insight and analytics perspective and mapped these requirements onto a fit-for-purpose and ready-for-future tech stack.

Our architecture and technology selection instantly made the data environment more amenable for their analytics needs and capabilities, and together with the implementation roadmap, made it really clear on how Nuffield Health could get the most of the proposed solution.

Fill out the form here to read the full case study and find out more about how we did this.

To find out more about how Acrotrend can help your business become truly data-driven, please contact us today to request a free consultation.
Bad 1990s design habits
By: Jan Schultink
Tags: PowerPoint, Design, Presentations

You can design better presentation slides by getting rid of engrained habits that can go back decades.

Sometimes I work with teenagers to teach them about presentation design. To my surprise, they often are much better students than “grown ups” who are supposed to benefit from decades of business experience. Here is a theory why.

Transparencies for overhead projectors encouraged you to copy pages out of a book and uncovering paragraphs or key points bullet by bullet. Moving to PowerPoint, people just kept writing these bullets.

The first visuals that you felt compelled to project to an audience were data charts: lines, bars, columns. These type of graphs needed to have a title in the top left and a source at the bottom. Most slide designs today use a big title at the top left, other typography on the page is almost never bigger than the title. Very rarely, people leave the title out all together.

Pictures are low resolution and take a lot of memory, hence you can only put in small images in a presentation document that you need to email someone.

PowerPoint was created as a mouse-based drawing software, rising alongside Microsoft Windows. Everything could be dragged, and resized easily to fit. Cropping an image was tricky. The first plasma TV screens confirmed to us that it was OK to stretch an image out of proportion, as long as it fitted whatever you needed to fill easily.

Word processors enabled us to ponder a sentence over and over, editing, adding words until it encapsulated everything we wanted to say. This leads to buzzword-loaded, fluffy, mission statement-type business prose that you would never use in spoken conversation. We were not trained to write razor sharp newspaper headings.

In a word processor, the time it takes to read a document equals the total number of pages. So, to cut the time it takes to deliver your presentation, you need to cut slides. If you still want to cover the same content, just reduce the font size and cram in more information in a slide. Page count rules.

When writing, you create thought flow from top to bottom, so in PowerPoint there is no need to use other visual techniques to express contradictions, overlaps, tensions, win-wins, from-to movements, transitions.

There were only 3 types of fonts: sans serif, serif and Comic Sans, so that’s what we use in Microsoft Office documents.

To make a point we use all those powerful software tools to add stuff: bold, underline, shadows, bright colors. It never occurred to us that by de-emphasising things around what we want to emphasise, it would stand out naturally and more beautifully.

Next time you design a presentation, think how you would tackle it without the baggage from the 1990s, just like a teenager today.
Imperfect Words Submissions *** UPDATED***
By: Edie Tuck
Tags: Write For Us, Writing, Submission Guidelines, Misfits, Join The Club

Welcome, and thank you for your interest in becoming a contributor to Imperfect Words! I created this modest little publication originally for my own pieces that didn’t fit anywhere else, but now I’m feeling a little lonely in here all by myself, and would love for you to join me!

The guidelines are quite simple:

The piece has to be your own — and in DRAFT form

form Credit the image…Always

Try to use the proper cases

Spell-check and grammar-check your work (Grammarly is a great tool!)

What is welcome:

Poetry (of any kind)

Short stories (fiction or non-fiction — no length restrictions)

Opinion pieces (no length restrictions)

What is not welcome:

Hate speech and/or racism will not be tolerated

Blatant violence (unless it’s fictional and not opinion-based — ask if uncertain)

Political stances / triggering pieces — there are publications for those types of pieces, and this is a peaceful place.

Attacks on other writers — we’re all friends here

( Photo by Duy Pham on Unsplash)

*** The publication reserves the right to fix any missed spelling or grammar mistakes, as well as correct title cases where appropriate. The publication also reserves the right to add an image if there isn’t one on the draft. ***

If you think your work would fit in here and you’re interested in becoming a writer, simply comment below! :) (I’ll do my best to respond within a day, but please be patient as it might take a bit longer sometimes)
Improper Theft
By: Sukhroop Singh
Tags: Short Story, Life, Creativity, Creative Writing, Art

Improper Theft

It’s not robbery, it’s just how life flows through you…

I never said she stole my money. My parents are getting it wrong. I mean, she’s my best friend! Why would she steal it, of all people?

Suddenly, my door opens and Natasha walks in. She has a glum look on her face, as if the corpse of Hitler suddenly appeared in the US. In her right hand she’s holding, very tightly it seems, a small leather journal. I like that journal — it’s our history journal. Every time we find cool information about history that we want to keep, we write it in that journal. We’ve been recording in it for years, and it’s almost full. However, we haven’t put together an entry in it for over six months.

I close the book I was reading and lay it gently on my bookcase. I nod toward Natasha, who takes the hint and plops onto the bed.

“So what’s going on?” I ask, but in a lighter voice than I usually do. Something is wrong.

“Nothing,” she responds quickly, but she doesn’t look at me. She’s staring intensely at my bookcase, as if searching for something.

After a couple more moments of silence, I speak up.

“What do you want to do today?”

“Er…actually, Julia, I have something to say.”

Oh no. “Alright. What is it?”

“I was the one who stole the money.”
Rule, Rule, Joke
By: Hugo Cornejo
Tags: Comedy, Poetry, Writing, Neil Patrick Harris, Beauty And The Beast

Just a few days ago I wrote about comedy clichés, well this is one of my favourite manoeuvres of all time. One so great that even when you obviously see it coming you can’t help but listen and wait for the punch line.

I’ve searched a bit and it seems it’s called The Triple. It consists on stating something that is true or reasonable (defining a rule), then something else that is also true or sensible for the same reason (confirming the rule) only to, right in sequence, mention a third element that breaks the rule and delivers the joke.

Here’s an example I’m sure you remember…

Beast: “I wanna do something for her… but what?”

Beauty and the Beast (1991)

Another great example, right in the middle of the fantastic “Not Just for Gays Anymore” by Neil Patrick Harris…

“The Triple” starts on 2:55

So, yeah, embrace The Triple in your jokes and you’ll make me extremely happy.
Intercepting ADF Table Column Show/Hide Event with Custom Change Manager Class
By: Andrej Baranovskij
Tags: Oracle Adf, Java

Ever wondered how to intercept ADF table column show/hide event from ADF Panel Collection component? Yes, you could use ADF MDS functionality to store user preference for table visible columns. But what if you would want to implement it yourself without using MDS? Actually, this is possible through custom persistence manager class. I will show you how.

If you don’t know what I’m talking about. Check below screenshot, this popup comes out of the box with ADF Panel Collection and it helps to manage table visible columns. Pretty much useful, especially for large tables:

Obviously, we would like to store user preference and next time the user comes back to the form, he should see previously stored setup for the table columns. One way to achieve this is to use out of the box ADF MDS functionality. But what if you don’t want to use it? Still possible — we can catch all changes done through Manage Columns popup in custom Change Manager class. Extend from SessionChangeManager and override only a single method — addComponentChange. This is the place where we intercept changes and could log them to DB for example (later on form load, we could read table setup and apply it before fragment is rendered):

Register custom Change Manager class in web.xml:

Manage Columns popup is out of the box functionality offered by ADF Panel Collection component:

Method addComponentChange will be automatically invoked and you should see similar output when changing table columns visibility:

Download sample application code from my GitHub repository.
The Lottery Ticket Hypothesis
By: Viktor Karlsson
Tags: Machine Learning, Summary, Artificial Intelligence

The Lottery Ticket Hypothesis

When randomness works in our favour

Development towards incrementally faster and easier-to-train neural networks has been an active area of study during the last decade. While many methods and techniques have evolved from this — Batch norm, Adam and residual connections, just to name a few — what if the true answer to more efficient models lies in their random initialisation?

This hypothesis is strengthened by some key observations. In particular, researchers studying pruning have found that it’s possible to train relatively smaller networks successfully as long as its parameters are initialised properly. Otherwise, such small models often struggle during training, which in many cases are attributed to their limited capacity. Below are two quotes from researchers which highlight these findings and the role initialisation plays.

Training a pruned model from scratch performs worse than retraining a pruned model, which may indicate the difficulty of training a network with a small capacity — Li et al. During retraining, it is better to retrain the weights from the initial training phrase for the connections that survived pruning than it is to reinitialise the pruned layers… gradient decent is able to find good solutions when the network is initially trained but not after re-initialising some layers and retraining them — Han et al.

It seems like, if we train a model, prune the weights of smallest magnitude and then reinitialise the resulting model with its original parameters we end up with a small model that is trainable. If the same, pruned model, on the other hand, is reinitialised with random parameters the performance achieved is often significantly lower if training succeeds at all.

It can, therefore, be assumed that the initialisation uncovered by pruning holds some property that allows the subnetwork to be effectively trained. But there is actually more to it than that! In this article, we explore the findings of Frankle and Carbin in their paper The Lottery Ticket hypothesis where they thoroughly study this phenomenon and discuss its implications.

The Hypothesis

The hypothesis is postulated as follows:

A randomly-initialised, dense neural network contains a subnetwork that is initialised such that — when trained in isolation — it can match the test accuracy of the original network after training for at most the same number of iterations

The hypothesis state that the initialisation of this subnetwork allows us to train this smaller network for fewer iterations while at the same time reaching a higher test accuracy! This almost sounds too good to be true. Fortunately, the authors strengthen their claims through a thorough analysis of this phenomenon.

To illustrate the process of finding the subnetworks referred to in the hypothesis, please have a look at the animation below.
Crown development meeting minutes 17/08/2020
Tags: Bounty Program, Electrum, Development, Codebase Update

Crown development meeting minutes 17/08/2020

Just the facts, ma’am

Present: ahmedbodi, ashot, crowncoin-knight, pjcltd, walkjivefly

Ashot

Ashot investigated the possibility of including the Dash deterministic MN code in the Bitcoin codebase update. He judged it too much work and too high risk. In view of this he thinks we should proceed with the “vanilla” Bitcoin codebase update and only later address deterministic nodes.

He has been working on some sync issues in his own small testnet. Hopefully he’ll soon be ready to progress to a larger testnet. In preparation for this he will take a look at the testnet halvening problem (issue 333).

Bitcore/Insight

After adding NFT support to Bitcore, the Crown Insight explorers are able to operate again. insight-02.crownplatform.com is already running, the other two sites will be cloned from it and functional again soon.

New website

The new website is nearly ready for launch. It is simplified and updated for a contemporary audience and optimised for use on mobile devices.

Designed for Generation Screen

ElectrumX

We have one new version ElectrumX server running. The infrastructure team will set up a second server soon. Community developer, Ahmed, is running one too so there will be three servers for Electrum Crown wallet users to connect to.

Electrum Crown

There is no good technical solution to the derivation path incompatibility between Electrum Crown v1.2 and v4. Ahmed is about to go on holiday for two weeks but will look into ways to facilitate migration from old version to new version wallets when he returns. It would be helpful to know how many users are affected by this incompatibility. If you are an Electrum Crown v1.2 user with a Trezor hardware-backed wallet please let us know through Discord.

Bang up to date with the latest Electrum codebase, NFT compatibility and Trezor integration

Crown Network Crawler

Ahmed is making solid progress on the Crown network crawler bounty project. Due to other commitments and his imminent holiday he won’t finish by the initial estimated completion date. Instead, he hopes to complete the project by the end of September.

Crown Sweeper

Community developer, Adrian, has demonstrated a first pass at the Crown sweeper bounty project. This graphical tool will run on linux, Mac and Windows, and provide an easy way to consolidate masternode/systemnode rewards. The remaining issues are mainly cosmetic and we hope to release the project soon.
Changing Mind
Tags: Decision Making, Life, Work, Self-awareness

A member of Mutrack and Inthentic. I lead, learn, and build with vision, love and care. https://piyorot.com

Follow
Guide to Material Motion in After Effects
By: Jonas Naimark
Tags: Animation, Technology, Visual Design, Material Design, Design

I’ve already shared why Motion Design Doesn’t Have to be Hard, but I wanted to make it even easier for designers to use the Material motion principles I know and love. After Effects is the primary tool our team uses to create motion examples for the Material guidelines. Having used it to animate my fair share of UIs, I wanted to share my workflow tips and…

My After Effects sticker sheet

Download this basic sticker sheet to see a project completed using my streamlined workflow (outlined below). It contains a collection of Material components, baseline UIs, and navigation transitions.

Download it here 👈

Available under Apache 2.0. By downloading this file, you agree to the Google Terms of Service. The Google Privacy Policy describes how data is handled in this service.

Importing assets into AE

First things first, we need assets to animate. Most of the visual designers on our team use Sketch, which by default doesn’t interface with AE. Thankfully Adam Plouff has created this plugin that adds this functionality. I used it to import our library of baseline Material components from Sketch into AE. These assets are found in the sticker sheet’s Components folder.

Creating UIs

With this library of baseline components, new UIs can quickly be assembled by dragging them into a new AE comp.
The Language of the Heart
By: Darshak Rana
Tags: Poetry, Happiness, Blue Insights, Writing, Life

Pampering my fragile ego,

I lost many years, writing,

to please the readers.

I depended on their affirmations,

Craving for their attention and acceptance.

But everything went in vain.

When I realized my mistake.

It’s not how things work.

Choices and preferences change daily.

Trying to fit in is more than a sin.

This feeling has plagued me,

And I want to feel better,

So I write what I feel.

I feel what I write.

This has brought me more success.

The lesson I learned will stay forever.

My life is short; I want to make it count.

I am creating new spaces.

Rather than fitting into the existing ones.

I am happier now!

I am no one to advise.

But a wise learns from others.

Makes his own path,

chasing his own dreams,

Following his heart.
My 6-Year-Old Is Chill AF. She Also Has Anxiety and OCD.
By: Shannon Ashley
Tags: Parenting, Life Lessons, Family, Life, Mental Health

Over the past eight months, I have been routinely amazed by my kid. The coronavirus pandemic changed her life. Preschool shut down. We quit going shopping, quit dining out. Her Frozen II birthday party was canceled. We didn’t get to go to the pool this summer or hang out with friends.

There’s a whole lot we quit doing, all to be safe, just in case. I never expected that to be easy for my daughter. I know it’s tough. It’s hard on me and we miss everything from leisurely Target trips to Saturdays spent at the library.

I keep waiting for her to have a meltdown because she misses the McDonald’s play place, or because we drive past the old “bounce house” every single day. The bounce house was one of our favorite hangouts — a place where I could work on my writing and she could play with other kids — but they had to close their doors months ago.

Many of our favorite places have closed over the past few months, even the American Girl store just outside of Atlanta, where we always planned to have her golden birthday in a few years. It feels like life has been one disappointment after another this year, and yet, my daughter takes it all in stride.

Nothing is quite “normal,” but my kid’s easygoing nature means that every socially-distanced holiday so far has been her definition of the “best day ever.”

Seriously. Her Zoom birthday party and home festivities? “This is the best birthday ever,” she declared. No trick or treating this Halloween, but we still managed to do a socially-distanced play date. “Best Halloween ever!” She talked about that celebration every day for a week.

In a lot of ways, I’ve lucked out because my daughter is so damn easy to please. Sure, she’s still a kid, so she sometimes thinks she wants every single toy she sees on TV, but she totally gets it when I tell her no, not today, maybe never, etc. She trusts me, I think, to look at most situations on a case-by-case basis. I trust her to not lose her shit when I say no.

“Hey, I don’t think I’m up to putting the big tree up for Christmas this year,” I told her last week. “I feel bad about that. What do you think? What if we do a real small tree instead?”

My daughter barely missed a beat.

“Yeah, we could use my doll tree,” she said. “That would be fun.”

“I’ll put an advent calendar tree on the wall too,” I told her.

THIS is the only tree I feel like putting up in 2020 | Image by Pottery Barn Kids

“Ooh, yeah!” As she replied, I almost couldn’t believe it. How did I ever get such an easy-going kid?
When Depression Refuses to let go
By: A Singular Story
Tags: Mental Health, Disability, Self, Work, Freelancing

After losing five years to depression, I’m now a human in transit between a past that holds me back and a future calling out to me.

As I strive to imagine a life that I haven’t been part of for a long time and haven’t reintegrated yet, my present is pure longing. I’m chomping at the bit, itching to transcend my illness, and self-actualize.

Although the deep-seated desire to get better means progress, there’s no wishing away depression.

Chronic illness is your partner for life, a shape-shifter that never goes away.

Accepting this is probably the most important coping skill you can develop but it forever changes your self-image. Whether you suffer from chronic mental illness as I do or a chronic physical condition invisible to the naked eye, you are now disabled.

Major depressive disorder like mine falls under the ADA (Americans with Disability Act). This means that I technically can’t be discriminated against when applying for a job. Then again, this is likely to make for awkward interviews in the future as HR departments wring their hands in despair not knowing how to handle my openness. Hence freelance work, for now.

Granted, willingly turning your diagnosis into a portfolio is non-standard but stigma and silence kill. Consider this my minuscule journalistic contribution to a more tolerant and tolerable world, the kind of world I don’t live in yet but would like to live in someday.

Because ideals without action are worthless. Last year, the Trump administration even proposed barring people with disabilities from immigrating to the U.S.

In short, had I been sick when I immigrated rather than falling sick shortly afterwards, America could well have slammed the door in my face.
How to Stop Mac Apps From Launching at Startup
Tags: Tips And Tricks, Mac, Technology, Apps, Apple

Does your Mac slow to a crawl thanks to apps that spring to life upon startup? Here’s how to disable and manage startup items so you can stop them in their tracks.

By Jason Cohen

Does your Mac take a long time to boot up? And when it does start, are you bombarded with a series of programs you didn’t open? Startup apps are convenient, but too many can eat up precious memory and slow down your computer. The good news is that you can fight back and manage your startup apps. If you love your Mac but hate waiting around for apps to load, here’s how to disable them on startup.

Disable Startup Apps From the Dock

The simplest way to disable an app from launching on startup is to do it from the Dock. Right-click on the app and hover over Options in the menu. Apps that are set to open automatically will have a check mark next to Open at Login. Tap that option to uncheck it and disable it from opening.

Hide or Disable Login Items

You can also manage multiple startup items at once. Go to System Preferences > Users & Groups > Login Items for a list of apps set to launch on startup. To remove a specific app, highlight it and click the minus button under the list.

If you prefer, certain apps can be set to launch at startup without necessarily popping up onto the screen. This ensures the program won’t get in your way but will be ready to use when it’s needed. You can hide a startup app to only run in the background until you’re ready to use it by ticking the Hide box next to each app listed.

Temporarily Disable Startup Apps

You’re starting up your Mac in a hurry and don’t have time for the computer’s normal boot process. Instead of waiting for all those startup apps to load, you can temporarily stop them for just this one session. Enter your login information as you normally would, but hold down the Shift key on the keyboard before submitting your credentials. Continue holding until the Dock appears, and the startup apps won’t load this time.

Delay Startup Apps with Delay Start

You can delay the launch of startup apps rather than disable them entirely. The third-party app Delay Start lets you set a timer for specific apps to control when they start up. Delay Start works similarly to the Mac’s own internal interface. Click the plus sign to add a program to the list. Change the time setting to indicate how long (in seconds) you want the apps to be delayed. On the next startup, the items you added will launch with the delay you set.
Why It’s OK to Divorce Your Family
By: Rose Bak
Tags: Self Care, Relationships, Family, Life, Mental Health

Why It’s OK to Divorce Your Family

How to decide if it’s time to break ties with your family members.

Photo by National Cancer Institute on Unsplash

We all have our own ideas of the “perfect family”. Maybe it’s the Cleavers or the Bradys or the Father Knows Best family (am I aging myself here?).

The reality of it is, most of our families don’t measure up to those impossible standards.

Family can be difficult, we all get that. Some family relationships take a lot of work, or a lot of gritting your teeth, or a lot of self-care to navigate. But sometimes you have a family relationship that is beyond repair.

Maybe it’s a parent with severe alcoholism or a sibling with mental illness. Maybe it’s a family member who has done something so awful, there’s no coming back from that. What do you do then?

Sometimes your best option is to sever the relationship and divorce your family member.
Performance Tuning Apache Sqoop
By: Thomas George Thomas
Tags: Data Science, Big Data, Analytics, Database, Sqoop

Controlling Data Transfer Process

Photo by Keszthelyi Timi on Unsplash

A popular method of improving performance is by managing the way we import and export data. Here are a few ways:

Batching

Batching means that related SQL statements can be grouped into a batch when you export data.

The JDBC interface exposes an API for doing batches in a prepared statement with multiple sets of values. With the --batch parameter, Sqoop can take advantage of this. This API is present in all JDBC drivers because it is required by the JDBC interface.

Batching is disabled by default in Sqoop. Enable JDBC batching using the --batch parameter.

sqoop export

--connect jdbc:mysql://mysql.example.com/sqoop \

--username sqoop \

--password sqoop \

--table cities \

--export-dir /data/cities \

--batch

Fetch Size

The default number of records that can be imported at once is 1000. This can be overridden by using the Fetch-size parameter which is used to specify the number of records that Sqoop can import at a time using the following syntax:

sqoop import

--connect jdbc:mysql://mysql.example.com/sqoop \

--username sqoop \

--password sqoop \

--table cities \

--fetch-size=n

Where n represents the number of entries that Sqoop must fetch at a time.

Based on the available memory and bandwidth, the value of the fetch-size parameter can be increased w.r.t the volume of data that needs to be read.

Direct Mode

By default, the Sqoop import process uses JDBC which provides a reasonable cross-vendor import channel support. However, some databases can achieve higher performance by using database-specific utilities since they are optimized to provide the best possible transfer speed while putting less strain on the database server.

By supplying the --direct argument, Sqoop is forced to attempt using the direct import channel. This channel may be higher performance than using JDBC.

sqoop import \

--connect jdbc:mysql://mysql.example.com/sqoop \

--username sqoop \

--password sqoop \

--table cities \

--direct

There are several limitations that come with this faster import. For one, not all databases have available native utilities. This mode is not available for every supported database.

Sqoop has direct support only for MySQL and PostgreSQL.

Custom Boundary Queries

As seen before split-by uniformly distributes the data for import. If the column has non-uniform values, boundary-query can be used if we do not get the desired results while using the split-by argument alone.

Ideally, we configure the boundary-query parameter with the min(id) and max(id) along with the table name.

sqoop import \

--connect jdbc:mysql://mysql.example.com/sqoop \

--username sqoop \

--password sqoop \

--query 'SELECT normcities.id, \

countries.country, \

normcities.city \

FROM normcities \

JOIN countries USING(country_id) \

WHERE $CONDITIONS' \

--split-by id \

--target-dir cities \

--boundary-query "select min(id), max(id) from normcities"
WeGroup, communication with digital customers
By: Kevin Hart
Tags: Insurance, Insurtech, Startup, Customer Service

WeGroup has raised €1.5M in total. We talk with Arvid de Coster, its CEO.

PetaCrunch: How would you describe WeGroup in a single tweet?

Arvid de Coster: WeGroup helps insurance providers to better connect with their growing group of digital customers

PC: How did it all started and why?

AC: Insurance is a very conservative and slow industry, that has been lacking behind on technology when you compare it to other financial industry players such as banking. A lot of processes are very inefficient and result in high overhead costs and a lot of customer frustration. It also fails to use modern technology and resources, such as the vast amounts of open data available, which gives insurance players a big disadvantage in today’s market. WeGroup is destined to solve these problems. Initially, we were a B2C startup, trying to build ‘the insurance company of the future’. After a while, however, we found out that we could solve these problems better while working together with traditional players, both insurance carriers and distributors, which is why we pivoted away from B2C.

PC: What have you achieved so far?

AC: Since our founding in 2017, we are proud to have grown our team from three founders on an attic in Belgium to a growing company of 25 people, with offices in 3 European countries and active in the entire European Union. Thanks to landing some major international clients fast, we were able to raise €1.5M in seed funding, and our now working towards a Series A of €5M. Of our product development, we are equally proud. There is a lot of buzz around words like artificial intelligence and all its side domains, but we actually explored fields like deep learning and natural language processing to build actual working products, solving actual industry problems.

PC: How will you use your recent funding round?

AC: The money raised will be used mainly to accelerate our international expansion. Being operational in several European countries comes with different languages as well as cultural and economic differences. Therefore it is important to have team members all over the place, familiar with all these variables. This means both technical people (for support) as well as business people for sales and marketing.

PC: What do you plan to achieve in the next 2–3 years?

AC: In the next few years, we should proof that our solution is scalable on an international level. The diversity in Europe is great to put product and growth to the test, but of course our ambitions rise beyond that. The same industry challenges European companies are facing can be felt by their counterparts in the US and Asia. Therefore, we work towards scalable and healthy expansion in order to prepare ourselves to cross the ocean.
Oversimplified ML(3): Outputs
By: Theo De Quillacq
Tags: AI, Data Science, Statistics, Machine Learning, Mathematics

Another Data set

The third type of output from a model is an altered data set. Sometimes data sets require processing before use in regression or classification. This is especially true of “wide” datasets with many columns. This type of machine learning will reduce the number of columns until the data set is more manageable.

One method to simplify data is called principal component analysis, or PCA.

Line of best fit (pink/black) and orthogonal paths (red)

This method assigns a line through data that best represents it. Points are then moved across the orthogonal (diagonal) line to the line of best fit.

After moving this process each point can be represented with two new values. Instead of (x,y) defining a data point PCA will represent each point with the position on the line of best fit and the orthogonal distance. Since the line of best fit comes first, the first number will be more significant than the second.

Line of best fit (blue) and the perpendicular plane (gray)

In 3D and higher dimensions we largely follow the same process.

To start, we choose the line which has the lowest orthogonal squared error. This is the sum of the length of each orthogonal line squared.

Next, each point’s first principal component is recorded. This is done by finding the intercept between the line of best fit and the orthogonal distance. The distance along the line of best fit is the first principal component. A point in the top right would have a large first component while a point closer to (0,0,0) has a smaller first principal component.

After the first principal component is collected all points are moved to the perpendicular plane. Another line of best fit is calculated and the second principal component is derived. This process is repeated until only one dimension is left. That dimension becomes the final principal component.

The data set is now described with the most important variables first and the least important variables last. We can safely remove the least important variables without losing much of the original information.

To explore how efficient our transformation is we need to compare the new and old data sets. To compare these data sets they must be in the same dimensions.

Equation for a line

Using the equation for a line we are able to return to the old data’s dimensions for each point. Plug in the first component’s value in for t. The other variables come from the line used in PCA.

Repeat this process for the first k number of columns in the PCA data set. Now we have x (the original point) and x_approx (the new point in x dimensions).

Losing less than 5% of variance will make the above equation true

To measure how much information is lost we will look at the variance before and after the transformation. If we have lost too much variance we should add another column from PCA. If we still have almost all the variance we can ‘simplify’ the data by removing the rightmost column of PCA. Repeat until an acceptable amount of variance and number of columns is reached
New Union Operators to Merge Dictionaries in Python 3.9
By: Indhumathy Chelliah
Tags: Python, Python3, DevOps, Data Science, Programming

Different Ways to Merge Dictionaries Before Python 3.9

1.dict.update()

d1.update(d2) Update the dictionary d1 with the key/value pairs from d2 , overwriting existing keys. Return None .

d1={'a':1,'b':2}

d2={'c':3,'b':9999}

d1.update(d2)

print (d1)

#Output:{'a': 1, 'b': 9999, 'c': 3}

Limitations

d1.update(d2) will modify the original dictionary d1 . If the original dictionary need not be modified, create a copy of dictionary d1 and then update it.

d1={'a':1,'b':2}

d2={'c':3,'b':9999}

from copy import copy

d3=copy(d1)

d3.update(d2)

print (d3)

#Output:{'a': 1, 'b': 9999, 'c': 3}

2. Dictionary unpacking {**d1,**d2}

d3={**d1,**d2}

A double asterisk ** denotes dictionary unpacking.

It will expand the contents of dictionaries d1 and d2 as a collection of key-value pairs and update the dictionary d3 . Keys that are common in d1 and d2 will contain values from d2 .

d1={'a':1,'b':2}

d2={'c':3,'b':9999}

d3={**d1,**d2}

print (d3)

#Output:{'a': 1, 'b': 9999, 'c': 3}

Limitations

{**d1, **d2} ignores the types of mappings and always returns a dict .

3. collections.ChainMap

ChainMap : A ChainMap groups multiple dictionaries or other mappings together to create a single, updateable view.

collections.ChainMap(*maps)

Return type is collections.ChainMap . We can convert to dict using the dict() constructor.

d1={'a':1,'b':2}

d2={'c':3,'b':9999}

from collections import ChainMap

from collections import ChainMap

d3=ChainMap(d1,d2)

print (d3)

#Output:ChainMap({'a': 1, 'b': 2}, {'c': 3, 'b': 9999})

print (dict(d3))

#Output:{'c': 3, 'b': 2, 'a': 1}

Limitations

It also ignores the types of mappings and always returns a dict . ChainMap s wrap their underlying dict s, so writing to the ChainMap will modify the original dict .

In the above-mentioned example, if we modify the ChainMap object, d1 will also be modified. d3=ChainMap(d1,d2)

d3['a']=555555

print (d1)

#Output:{'a': 555555, 'b': 2}

4. dict(d1,**d2)

d3 = dict(d1,**d2)

d3 will contain key-value pairs from d1 and d2 . Keys that are common in d1 and d2 will contain values from d2 .

d1={'a':1,'b':2}

d2={'c':3,'b':9999}

from collections import ChainMap

d3=dict(d1,**d2)

print (d3)

#Output:{'a': 1, 'b': 9999, 'c': 3}

Limitations

d 3=dict(d1,**d2) will work only when d2 is entirely string-keyed.

If int is given as a key in d2 , it will raise TypeError .
3 to read: Bottomless Pinocchio | Good Google? Gone | Congress misses its chance
By: Matt Carroll
Tags: Media Criticism, Journalism, Matt Carroll, Journalism Criticism, Media

By Matt Carroll <@MattCData>

Dec. 18, 2018: Cool stuff about journalism, once a week. Get notified via email? Subscribe: 3toread (at) gmail. Originally published on 3toread.co

The WaPo’s ‘Bottomless Pinocchio’: A new rating for a false claim repeated over and over again: Love this. You have to give the WaPo credit for their aggressive coverage of Trump. For instance, not so long ago, a politician caught lying would be embarrassed enough to stop repeating the lie. Not Trump. So the WaPo has upped its game w this interesting new system for ranking repeat liars. Kudos to Glenn Kessler.

What happened to the good Google?: Google’s Dragonfly will intensify surveillance of journalists in China: Many Google watchers and company employees were shocked when they found out the search company was working hand-in-hand with the Chinese gov’t to create a censorship-compliant search engine. When word leaked out, it caused protests within the company. Well, apparently they weren’t enough to derail the project. Money talks, and the Chinese market is too big to give up over the principles of democracy, apparently. Mia Shuang Li for CJR.

The missed point of Google’s Congressional hearing: Congress had a chance to dig deep into Google’s business practices and how they can hurt consumers across the country, notes Charlie Warzel of BuzzFeed. So did pols look at how people are tracked? Or how their personal data is sold? No. Instead pols focused on perceived political bias, asking shallow questions. And not surprisingly, the Google CEO gave evasive answers. All in all, a chance to shine a little light on the internal workings of one of the most influential corporations in the world was flubbed.