fabiochiu/medium-articles huggingface dataset:
Excel Addin Software Frameworks — Extending the Microsoft Office Platform
By: Bishr Tabbaa
Tags: Microsoft, Excel, Software, Architecture, Design

Although the desktop may be slowly dying as phones, tablets, and other devices encroach, many businesses and consumers remain loyal fans and active users of Microsoft Office and Excel. According to Microsoft, there were 1.2 Billion users of Office desktop and 60 million users of Office 365 in the cloud as of March 2016; the latter amount more than doubled to 135 million active users in April 2018. Excel’s core capabilities include a flexible tabular data representation indexed by rows and columns, a catalog of built-in functions, a charting module, a data import module, and a rich programming model using VBA. For heavy, data intensive commercial and academic users of Excel, there is a need to extends Excel’s features with custom calculations, new data sources, real-time refresh, and embedded GUI’s.

In this series, I will be covering several advanced topics for extending Excel’s core capabilities.

Excel Addin Framework Choices

UDF

Embedded GUI

RTD

Portability

Deployment

Troubleshooting

There are are several criteria when deciding which Excel add-in framework to use.

Excel Addin Software Frameworks

If you are looking to build an Excel product suite or family of add-ins, then I strongly encourage you to examine Add-in Express or Excel DNA. Both are fully featured and have broad language support (unlike PyXLL), and both are much easier to use than the native Microsoft VSTO libraries. Both have active user communities with 1000’s of developers each.

If you intend to support other Office products such as Word or Outlook and are also not comfortable with using open source software, then choosing Add-in Express makes wise sense from a long-term maintenance, TCO perspective.

If you intend to develop Excel add-ins which use native, platform features that are idiosyncratic to a specific version of Office (which I do NOT recommend), then use VSTO.

If you are budget conscious and are developing a PoC or MVP for just Excel, then choosing Excel DNA and Net Office is a solid starting point that you can build upon.

References

Enjoy the article? Follow me on Medium and Twitter for more updates.

This story is published in The Startup, Medium’s largest entrepreneurship publication followed by +392,714 people.

Subscribe to receive our top stories here.
How to Render Next.js with NestJS
By: Alex Toth
Tags: Nestjs, Nodejs, Nextjs, JavaScript, React

How to Render Next.js with NestJS

Did I just make Next.js better?

If you read this article you probably have a little knowledge about these two frameworks, if not I would recommend you first to take a look at these, they have very good documentation on their websites.

Storytime

So apparently I started a little Github repository where I created some web-app boilerplates and I wanted a server-side rendering solution as well. So while I was sinking in the deeps of the monorepo magic world🎩, I faced a question regarding Next.js and NestJS. Do I really need two node servers?🤔 One to render the react application and one for the backend APIs? NO! So here came the idea to let’s just merge these two.

Next.js is amazing!

The guys at Next.js already thought about this, they have a description on their website regarding how can you use a custom server, so from here my job becomes 100% easier.

But there’s a catch, nothing comes without a price. The price that we will lose the Automatic Static Optimization but I’m okay with it. In my projects, almost every page has “blocking data requirements”, so it’s not a big drawback in my situation.

Integrating with NestJS

In NestJS we wrap up controllers and services in modules, so in my case, I think the best option is to create a module which purpose is only to serve the UI side, so basically to render our react pages.

Let’s call this module View Module, and it will contain the View Controller(route handling), View Service(providing the next render).
If I have 6 hours to chop down a tree…
By: Pete Woodhouse
Tags: Design Thinking, Product Design, Product Management, Productivity, UX

If I have 6 hours to chop down a tree…

…would I spend 4 hours sharpening the axe?

Should I even chop down the tree?

Will there be consequences — for me, for anyone else, or for anything nearby?

Is it the right axe?

Is there a more suitable axe for me, for the type of tree?

Am I the right person to chop down the tree?

I’ve never chopped down a tree before — should I find someone more experienced?

Do I need a brand new axe?

Is it time to look at the latest axes on the market?

Is it a team sport?

Is it a one, two, three, or even a four-person job?

Is it even the right tree to chop down?

Have I understood the instructions correctly?

Would it lead to the right outcome?

Has anyone considered the bigger picture?

Does the axe even need sharpening?

I’ll take a few practice swings to see how much it needs sharpening.

Is there a better way?

Could the tree be replanted elsewhere instead of chopping it down?

So, if you had 6 weeks to improve a product…

…How would you spend 4 weeks?
Why Hustle Culture Is Frowned Upon
By: Aushaf Widisto
Tags: Productivity, Self Improvement, Hustle, Advice, Work

Why Hustle Culture Is Frowned Upon

Isn’t ‘being productive’ good? Well…

Photo by Austin Distel on Unsplash

A few days ago, one of my favorite writers tweeted something that caught my attention. He had just finished speaking in a webinar, and remarked that during the Q&A session, he received many variants of this question: “How can we stay productive during quarantine?”

Afterward, he proceeded to rant, saying things like “Why are we so fixated on productivity?” and “At this rate, we’ll all die from productivity.”

I mean, this guy’s actually an amazing writer and I love his work, but I have to admit that these particular tweets of his are a little overdramatic.

They do have some merit, though. Productivity can be toxic sometimes, and this is more or less a byproduct of that infamous hustle culture.
醫院＆診所都需要的專屬線上預約 / 網路掛號 系統！
By: Simplybook.Me
Tags: Simplybook, 五分鐘打造專屬預約系統, Productivity, Medical, Simplybookrecommend

免費的跨平台線上預約排程系統，同時支援網頁版以及行動裝置

Oh, Instagram, the source of inspiration for countless millennials, a visual gem and the perfect “look at how cool I…
Review: PolyNet — 2nd Runner Up in ILSVRC 2016 (Image Classification)
By: Sik-Ho Tsang
Tags: Artificial Intelligence, Machine Learning, Image Classification, Data Science, Deep Learning

Review: PolyNet — 2nd Runner Up in ILSVRC 2016 (Image Classification)

By Using PolyInception Module, Better Than Inception-ResNet-v2

In this story, PolyNet, by CUHK and SenseTime, is reviewed. A building block called PolyInception module is introduced. A Very Deep PolyNet is composed based on the module. Compared to Inception-ResNet-v2, PolyNet reduces the Top-5 validation error on single crops from 4.9% to 4.25%, and that on multi-crops from 3.7% to 3.45%.

PolyNet, By using PolyInception module, better than Inception-ResNet-v2

As a result, PolyNet (with the team name CU-DeepLink) obtains 2nd Runner Up in ILSVRC 2016 classification task as below. And it is published as 2017 CVPR paper. (Sik-Ho Tsang @ Medium)

Compared with ResNet (The winner in ILSVRC 2015), which got 3.57%, PolyNet got 3.04% as shown below:

ILSVRC 2016 Classification Ranking (Team Name: CU-DeepLink, Model Name: PolyNet) http://image-net.org/challenges/LSVRC/2016/results#loc

This relative improvement is about 14%, which is not trivial!!!
To My Neighbor At WeWork
By: Christine Stevens
Tags: Satire, Humor, Funny, Startup, Work

Hi, Derrick. This is Leanna, I am working near you this week at WeWork on Maple, and I just wanted to talk to you about something.

Are you just watching porn while you work or are you actually working on those porn videos which you blare so loudly on your laptop? I mean I can’t tell. You’re doing something with your hands on the machine, which actually is kind of comforting to me, because it at least communicates that you’re not jerking off, which would be even worse, of course.

But if you are editing or mixing or transcribing these porn videos, I have to ask you, Gees, doesn’t it just seem kind of basic that you would use head phones?

I can avoid looking over at your laptop, which usually seems to be displaying an enormous erection in closeup entering some hideously large looking labia like some sort of hellish tunnel boring machine.

But the sound is a problem. I did come over and ask you to turn it down or put on headphones, and you just kind of shook your head and completely ignored me.

I mean, really.

I don’t know what it is about our generation. Was it really that we all got trophies? Is that our problem? Do we think that everything we do is just great and nobody can criticize us or make any kind of request of us?

Or is it that you have some kind personal issue with me?

Listen Derrick, I’ve seen you looking over at me while I work as if there was some kind of problem with what I’m doing here at WeWork this week. Of all the nerve!

I have news for you mister. What I’m doing is a perfectly safe, natural and in fact very necessary job, and if you have a problem with it, you need to take it up with the State of California and Governor Gavin Newsom. Because the State makes it very clear that embalming dead bodies if you are using all natural products and no dangerous chemicals, does not in fact have to take place at a licensed morgue, funeral home or other facility.

In other words, it is perfectly within my rights to bring the bodies here this week. We are renovating our lab at the funeral home. I have only three more bodies and I will only be at WeWork until the end of the week.

So please, can we agree to work with each other in a spirit of cooperation and civility?

Or do I have to come over there and pump some stevia-based formaldehyde up your ass?

Thank you,

Leanna Adams

Licensed Embalmer,

Soft and Soothing Liquids

All natural, All Organic, All Artisanal Embalming Services and Products
Adopting TypeScript Will Make You Suffer.
By: Ilya Suzdalnitski
Tags: Programming, JavaScript, Reasonml, Software Development, Typescript

Immutability?

I think that large objected-oriented programs struggle with increasing complexity as you build this large object graph of mutable objects. You know, trying to understand and keep in your mind what will happen when you call a method and what will the side effects be. — Rich Hickey, creator of Clojure.

Programming with immutable values nowadays is becoming more and more popular. Even modern UI libraries like React are intended to be used with immutable values. Immutability definitely eliminates a whole category of bugs from our code.

What is immutable state? Simply put, it is data that doesn’t change. Just like strings in most programming languages. For example, capitalizing a string will never change the original string — a new string will always be returned instead.

Immutability takes this idea further, and makes sure that nothing is ever changed. A new array will always be returned instead of changing the original one. Updating user’s name? A new user object will be returned with its name updated, while leaving the original one intact.

With immutable state, nothing is shared, therefore we no longer have to worry about the complexity of thread safety. Immutability makes our code easy to parallelize.

Functions that do not mutate(change) any state are called pure, and are significantly easier to test, and to reason about. When working with pure functions, we never have to worry about anything outside of the function. Simply focus on just this one function that you’re working with, while forgetting about everything else. You can probably imagine how much easier development becomes (in comparison to OOP, where an entire graph of objects has to be kept in mind).

Immutability in TypeScript?

Dealing with immutable data structures in TypeScript is significantly worse than in JavaScript. While JavaScript developers can use libraries that help with immutability, TypeScript developers typically have to rely on the native array/object spread operators (copy-on-write):

Unfortunately, the native spread operator doesn’t perform a deep copy, and manually spreading deep objects is cumbersome. Copying large arrays/objects is also not good for performance.

The readonly keyword in TypeScript is nice, it makes properties immutable. However it is a long way from having support proper immutable data structures.

JavaScript has good libraries for working with immutable data (like Rambda/Immutable.js). However, getting such libraries to work with the TypeScript type system can be very tricky.

JavaScript is a clear winner for immutability. Too bad, TypeScript.
Roman and Jewel. A AAMBC Review. - The AAMBC Journal
By: Aambc Review Community
Tags: Book Review, Book Recomendations, Black Writers, Black Books Matter, Books

We were very excited to received Roman and Jewel by Dana L. Davis after having read the synopsis. Dana L. Davis is an accomplished actress and author. She has previously written 2 young adult novels, both boasting 4 and 5-star reviews.

Roman and Jewel is centered on 16-year-old actress Jerzei Jhames. She has auditioned for the Romeo and Juliet broadway retelling, Roman and Jewel, for the main female role. However, even after losing the role to celebrity, Cinny, her undeniable talent does not go unnoticed by producers and the male lead, Zeppelin. The novel follows the self-proclaimed “Good Girl” through her journey of self-discovery and her navigation of the teen romance world.

We rate this novel 4.5 out of 5 stars. The novel was very well written and was captivating from the first few pages. The characters were well developed and seemed to come alive off the pages. Another plus to this novel is that the characters were multicultural and from different walks of life. Although this novel’s intended audience is teens, the novel was still very entertaining and age-appropriate. The novel is centered on a theater show, and there is a great deal of mentioning theater shows, techniques, and infamous people. As a person who may not be deeply involved in the theater world, these mentions could become cumbersome.
Confessions Of A $100,000 Copywriter
By: David Pennington
Tags: Copywriting, Lifestyle, Careers, Writing, Freelancing

He was a referral, so I had to be a little bit polite. He booked time on my calendar and I sent him across some samples to review.

“Tim said you’re a great writer, good to work with. I was reading the samples you sent over, and I thought to myself: ‘I bet this guy wants to make a hundred thousand dollars this year!’”

Imagine a pause here. A pregnant one. Eight and a half month’s worth.

“I don’t bill by the year,” I said. I started up on my option for a monthly retainer.

“Nah, I’m serious. We’ll get a contract started, and you’ll be on your way to making $100k a year.”

I had heard this before. It was the same pitch I heard when I sold vacuum cleaners door-to-door. It’s what you hear when your friend really wants to tell you about how they’ve found financial freedom with a vitamin shake.

It’s not that I couldn’t use a hundred grand, who couldn’t?

There’s just a weird stipulation when one person offers you that much money to write.

You might get it as an advance for a novel. If that’s the case, you’ve already written five novels, three of them were turned into movies, one of which starred a bubbly Disney airhead.

You might also get that kind of money if you are handling a VERY large copy project. The type you have to hire other writers for. The kind that comes with TV commercials on national broadcast and writing in product placements for the movies.

A referral? And one who opens the conversation with cash?

“Imma send you a link,” he says to me. It pops up in my email, and I open it. It’s a three-page job description that reads like a sales pitch.

The third sentence in: I’m here to resolve all of the woes you have as a freelance writer.

He’d handle the prospecting; he’d close the sales. I’d put pen to paper.

“I need someone who can work fast,” he says. “I need copy turned around in like 24 hours, tops. Can you do that?”
She Doesn’t Think She’s Beautiful
By: Elyse Wright
Tags: Beauty, Poetry, Writing, Poem, Friendship

Sign up for Reflective Vibes

By Know Thyself, Heal Thyself

Reflection, reflection and more reflection. Each Sunday* we'll be sending out an inspirational quote followed by a short commentary, either in written form, video or link. Enjoy! Take a look
If You Failed to Get a Job, You Are Not Alone
By: Fatos Morina
Tags: Life Lessons, Programming, Startup, Life, Technology

If You Failed to Get a Job, You Are Not Alone

How industry titans have contextualized and dealt with failure

When you get rejected from a job, you get the impression that you are a failure, the only person who didn’t manage to get that, that you are doomed.

You beat yourself up.

However, if you look at the data, it is hard to find someone who never failed, or was never rejected.

In this category, we include people who also currently amaze us with the work that they have done.
Gap Trading. An Introduction & Back-test in Python.
By: Sofien Kaabar
Tags: Artificial Intelligence, Finance, Machine Learning, Data Science, Trading

Gaps can occur due to fundamental and technical reasons, but we are mostly interested in identifying and trading them. In the currencies market, the visible gaps are the ones that occur during the weekend. Since it is traded all day long for 5 days a week, the presumed gaps would probably look like giant candles, but since we cannot know for sure, we will stick to the common definition of gaps.

“We call the act of trading based on gaps: Playing the gap.”

There are different types of gaps and distinguishing them can be quite tricky:

A common gap: It generally occurs in a sideways markets. It is likely to be filled because of the market’s mean-reversion dynamic.

It generally occurs in a sideways markets. It is likely to be filled because of the market’s mean-reversion dynamic. A breakaway gap: It generally resembles a common gap but the gap occurs above a graphical resistance or below a graphical support. It signals acceleration in the new trend.

It generally resembles a common gap but the gap occurs above a graphical resistance or below a graphical support. It signals acceleration in the new trend. A runaway gap: It generally occurs within the trend but it confirms it more, therefore, it is a continuation pattern.

It generally occurs within the trend but it confirms it more, therefore, it is a continuation pattern. An exhaustion gap: It generally occurs at the end of a trend and close to a support or resistance level. It is a reversal pattern.

Note that most of the above specificities come from personal experience as some sources state that common gaps are least likely to be filled. Also, the runaway and exhaustion gaps are so similar that it is almost impossible to know which is which at the moment they appear, therefore, they suffer from hindsight bias.
Bilingual Poem (SP and EN): Radio
By: Miguel Adrover
Tags: Puerto Rico, Poetry, Astronomy, Polyglot Poetry, Science

Towers fell and up flew

metaphors, lamentations.

A drone, Herzog ersatz, shot the collapse.

No more blue pulsar impressions.

The staff chilled Hope in their icebox

(The most desired reply).

Instruments probed cold, vast, void;

Crashed and carved unknown pleasures.

We missed the cosmic bus,

Delayed by stale supremacies;

Old rotten tensions gave way

To anemic celebrations

Of bubbly-worthy star gazers…

In Another Time-Slice,

Arecibo collected aural debris —

Never San Salvador; always Guanahani…

We’ll weave neural simulacra,

And dull the pain of conquest.

This encryption is from a non-human source.
Best in Show: Fairs and Exhibitions Turn to Online 50/50 Fundraisers
By: Robb Clarke
Tags: Canada, Technology, Fundraising, Startup, Charity

Glencoe Agricultural Society

The Glencoe Agricultural Society in Ontario saw COVID cancel their 2020 events but that didn’t cancel their operational costs. They approached The Lotto Factory to do something a little different than other groups to help them through these tough times.

We’re operating a one-time Classic 50/50 fundraiser for them, drawing in late September. Unlike our Progressive draws which can see people playing months in advance, our Classic differs in that 100% of purchases go into the current draw. There are no rollovers. Somebody is walking away with half the jackpot when it’s drawn at the end of September.

The Classic 50/50 allows for ‘deals’ on tickets sales so for the Glencoe Agricultural Society we are offering 1 for $10, 10 for $40, 25 for $75, and 50 for $100. Each purchase pushes their jackpot higher and higher.

Their jackpot rolled over $2,000 in no time and we won’t be surprised if it’s five digits when it draws in a month.

Click here to play!
Chrome Extensions to Boost Your Productivity
By: Nabil Nalakath
Tags: JavaScript, Software Development, Productivity, Programming, Web Development

Chrome Extensions to Boost Your Productivity

10 must-have Chrome extensions for developers

BG Photo by Pierre Châtel-Innocenti on Unsplash

Over the past decade, Google Chrome has become the go-to application when anyone wants to browse the web on desktop and mobile. Many people don't even like to browse on their devices until they install Chrome. That being said, it is also infamous for consuming device memory and even slowing it down. But there is one more reason why it’s still the most popular browser: support for the latest web features and developer tools.

Chrome is the go-to browser for all developers due to its large user base that no developer can ignore and also the tools it provides during the development stage of a website or even mobile application. The Chrome Marketplace also has some of the best apps and extensions to help developers with a lot of add-on features during development and testing. In this article, we will go through a list of extensions that can come in handy during various stages of development.
Worship My Feet!
By: Ena Dahl
Tags: Body Positive, Short Story, Psychology, Fetish, Sexuality

You’re in good company, you see, but I doubt the majority are as spellbound by my digits as you are.

I can control you with them, torture you even, and while I usually let you be in charge, I’m the boss now. With the smallest of movements, I pull you towards me, hooked by an intangible thread.

—Want a foot rub? you suggest, also playing blasé, not wanting to reveal just how defenseless you are.

I answer by swinging my body sideways, landing my pods in your open lap to recline back on the sofa. You start with stroking, lightly running your fingers alongside and underneath, tracing toes. Your touch sends tingles up my spine that makes my brain buzz. I begin to feel something else buzzing too. You push your crotch against me. I push back. It’s a tug of war. Who controls who? I’m losing track.

I used to think only submissives worship feet, that the action defined our roles in the bedroom and vice versa. I’ve since been proven wrong. Partially by you.

A person can be dominant on their knees; in charge with their tongue coiled around toes. You can find submissives on top, even with a flogger in hand. Neither tools nor body placement determines who’s in control. Power is more fluent than that; it’s in our words, spoken with our mouths or with our bodies alone. It’s in our minds.

As you lift my foot to your lips and let my big toe part them we’re both in charge, and equally at each other’s mercy. Watching my eyes you slowly swallow the whole thing, suck and twirl it around, then, slide it out.

Funnily, I feel this in my gut more than anywhere else. Is this explained by reflexology? Where feet are thought to be fitted with pressure points that correspond to parts of the body. They say our toes have meridians that connect to our organs; the big toe sends signals to the liver and spleen. Is that what I’m feeling?

My crotch floods with warmth in response as I rock back and forth in concert with your movements. You have your way with each of my toes, tantalizing my digestive system via secret pathways.
Moon and Sun
By: Randy Shingler
Tags: Self-awareness, Spiritual, Moon, Poetry, Mindfulness

Fainting moon and morning sun,

My companions while all alone

Dazzled by their changing lights,

Mirrors of thriving spirits within

Fleeting moments of spiritual bliss.

Quieting my mind’s racing thoughts,

Awareness in these mindful moments

Letting peacefulness settle over me,

Cool winds blowing against my face

Morning freshness to be absorbed.

Bright moon’s face has disappeared

Sun’s crimson rays have taken hold

Sun and thoughts, companions now,

Contemplations on why we’re here

Purposeful lives we are meant to have.

Philosophical musings and meditations

Illusions, realities, mixed and churned

Discerning images that are revealed,

What is real and what is not?

Moon and sun, we know they’re real.

Mind and spirit, relaxing into solitude.
The Technologist’s Guide to The Circular Theory
By: Ilexa Yardley
Tags: Circular Theory, Leadership, Life Lessons, Universal Relativity, Productivity

Zero and one is X and X’.

Zero and one is X and X’. (Photo by Todd Diemer)

The technologist understands everything reduces, and, expands, to, zero, and-or, one. This makes his, and-or, her, life easier, when it comes to everything. Zero, and-or, one, is yin, and-or, yang, is circumference, and-or, diameter, literally (and figuratively).

Meaning, any combination of traits, X and Y, X and X, X and X’, duplication and negation, reduces and expands to, zero, and-or, one. From the technologist’s point of view, there is no difference between a zero, and-or, a one, because zero, and-or, one, articulate, and, must, conserve, a circle.

Therefore, there is a circular relationship between any pair of attributes, (zero and one is circumference and diameter). This means the circular relationship has control of all attributes. Any discipline (technology, especially).

Complementarity is the basis for identity because duplicity is the basis for a unit. This means zero and-or one is one and-or two. From the circle’s point of view, then, zero is, always, two (you have to have both circumference and diameter in order to have either).

This means the technologist has the flexibility to function, realistically, when it comes to understanding life. Expectations, and experience, share a circular relationship, meaning, the technologist understands we live a self-fulfilling prophesy. Half-the-time we are zero, the other half, we’re one.

Half-the-time we’re one. The other half we’re two. Where zero, one, and, two, are pi, diameter, and, circumference. In any order, combination. Meaning, no way around it, everything is 50–50.

Conservation of the circle is the core dynamic in nature.
Supercharge your website’s page load time with color
By: Andres Zapata
Tags: Product Design, Design, Design Thinking, Web Development, User Experience

No, color alone can’t actually speed up your website. That’d be silly. But the right color, value and chroma can elicit the perception of a faster loading website.

We know the brain functions under a limited processing model. It’s a giant guessing machine tuned over the millennia to quickly process lots of stimuli and “guess” based on the person’s experience and situational expectations to form actionable perceptions.

Since the brain is for guessing, it’s fairly easy to trick it. As user experience designers, we have to ask ourselves: can we trick the brain to advance our UX agendas? A study, Waiting for the Web: How Screen Color Affects Time Perception, published by the Journal of Marketing Research, says you can.

These researchers found that designers can adjust hue, value and chroma to induce more or less relaxed feelings states — and less relaxed feeling states lead to greater perceived page load quickness. The researchers concluded that by using soothing color trickery, a website could be perceived to run up to 53% faster.

It turns out, we can trick users to perceive interfaces loading faster simply by using blues, higher-value, and low chroma. What’s more, users that perceive faster loading websites are more likely to recommend the website to their friends. Wow. Just, wow.

A word of caution: sometimes, users “need” the website to take a second or two to process information so they “believe” their input (actions) had the intended outcome (feedback). The use of blue, higher-value and low chroma “speeds up” your website, but be careful to not to lose your users along the way… throttle with good feedback and perhaps a few microinteractions.

Reference:

Gerald J. Gorn, Amitava Chattopadhyay, Jaideep Sengupta, & Shashank Tripathi. (2004). Waiting for the Web: How Screen Color Affects Time Perception. Journal of Marketing Research, (2), 215. Retrieved from http://proxy-ub.researchport.umd.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&db=edsjsr&AN=edsjsr.30162328&site=eds-live
Conducting Bayesian Inference in Python using PyMC3
By: Dr. Robert Kübler
Tags: Bayesian Statistics, Bayesian Machine Learning, Pymc3, Python, Editors Pick

Solving the Coin Problem using PyMC3

The moment you have waited for. First, install PyMC3 via a simple

pip install pymc3 .

Inside the programming environment of your choice, prepare the imports and the coin toss data.

import pymc3 as pm tosses = [

1, 1, 0, 0, 0, 1, 1, 1, 1, 1,

0, 1, 0, 1, 0, 1, 0, 1, 1, 0,

1, 0, 1, 1, 1, 1, 1, 1, 1, 1,

1, 1, 1, 1, 1, 0, 0, 0, 1, 1,

0, 1, 0, 1, 1, 1, 0, 0, 1, 0,

0, 1, 1, 0, 1, 1, 1, 0, 0, 0,

1, 0, 1, 0, 0, 0, 0, 0, 0, 1,

1, 1, 1, 1, 0, 0, 0, 0, 0, 1,

0, 1, 1, 1, 0, 0, 1, 0, 1, 1,

1, 1, 1, 0, 0, 0, 1, 0, 1, 0

]

So far, so good. The actual model is even shorter than this piece of code, so I will just present it to you and explain it afterward.

with pm.Model() as model:

# define the prior

theta = pm.Beta('theta', 2, 2)



# define the likelihood

data = pm.Bernoulli('data', theta, observed=tosses)



# get the samples

trace = pm.sample()

Basically, that’s it, the entire Bayesian inference. Probably you expected more, but this speaks even more for the awesomeness of PyMC3. Don’t be fooled, however: Under the hood, a lot of processes are running, more than I can explain.

Anyway, we end up with this variable trace which contains 500 * #cores_of_your_machine samples, 2000 for me. It involves the number of cores because PyMC3 generates samples in parallel, without us having to specify anything. Reasonable defaults, I love it!

Understanding the Code

If you followed this and my older articles that I mentioned in the beginning closely, the code should make kind of sense for you.

The only weird part should be the context manager in the first line, with pm.Model() as model: . It’s just a programmatic design choice that the PyMC3 people have made. You open up a model (like you open a file in plain Python) and do things inside this context. In our case, we define distributions and sample.

We then start defining our prior θ~Beta(2, 2), which in PyMC3 language is

theta = pm.Beta('theta', 2, 2)

PyMC3 distributions always want a name, that’s always the first parameter you have to specify. Usually, I just use the variable name again. Then the two parameters for the Beta distribution follow, in our case a=2, b=2. Done with the prior!
How to Keep Yourself Amused on Zoom
By: Joshua Gans
Tags: Covid 19, Zoom, Coronavirus, Technology, Education

How to Keep Yourself Amused on Zoom

The lessons I’ve learned in 2020 as a university professor

Photo: Sam Wasson/Stringer/Getty Images

Zoom has taken over our lives and will continue to rule for the foreseeable future. But if those meetings drag on, what games can you play to keep yourself amused? After nine months of this, I have some suggestions.

Where will they end up?

You are in a meeting and suddenly someone gets up and starts walking. They are holding their laptop and so you can see right up their nose at the ceiling going by. A fun little game is to predict 1) where they are going and 2) how long they will take to get there. It really raises the whole energy level of the meeting.

Who’s paying attention?

The nature of Zoom meetings is that you can only see someone’s headshot. Unlike in-person meetings, it is therefore not immediately apparent whether attendees are paying attention or doing something else.

Can you tell who is really paying attention? The signs I use are as follows:

Do they have too much attention? Anyone starting intently at the screen is not actually paying attention. Your average Zoom speaker is not that interesting, so if a person is rapt, it is likely they are doing something else.

Do their emotions match the situation? Someone is saying, “and if we are lucky we may only lose $8 million this quarter” and there is someone there smiling. This happens. They aren’t paying attention.

If you notice any of these “tells,” the appropriate response, and I know this from being a university professor, is to then ask the most certainly distracted person what they think and/or if they are happy to take this unusually complicated and arduous project on. Hijinks ensue.

Who’s messaging who?

This is a good one. When we met in person, if someone said something stupid or typical, you could glance at a co-worker and roll your eyes — “Can you believe this guy?” For Zoom, that is not really possible. So people resort to the private Zoom chat. Now, this is already a dangerous activity because Zoom has ways of causing you to mistake who you are talking to. But what this also means is that whenever people are doing this, what they are discussing must be really good.

Trying to catch a private chat in action is one of the most fulfilling Zoom games there is. If you see one person looking like they are typing something wait until they stop and then immediately search your screen to see if someone else’s eyes light up right before they start typing. Once you have your mark, it is easy to confirm whether a chat is going on.

In this situation, you can then use the Zoom chat function to out someone with a “did you mean to send that to everyone?” in the chat. Then you can watch their face. Priceless.

These games keep me amused but I am sure you have invented more. Let me know in the comments. I need to stay entertained until this is all over.
Gentle Introduction to AutoML from H2O.ai
By: Mohammad Shahebaz
Tags: Data Science, Automation, Python, Machine Learning

In recent years, the trend for data science skills and its demand had outpaced the skill supply. As artificial intelligence penetrates every corner of the industry its hard to place data scientists in every possible use case.

To bridge this gap, companies have started building frameworks that automatically process the dataset and build a baseline model. We see many of these implementations going open-source. According to one of the industry leaders, H2O.ai,

AutoML interface is designed to have as few parameters as possible so that all the user needs to do is point to their dataset, identify the response column and optionally specify a time constraint or limit on the number of total models trained.

According to Google Trends, the rise of Auto ML began in Q2 2017:

AutoML Google Trends

AutoML is a function in H2O that automates the process of building large number of models, with the goal of finding the “best” model without any prior knowledge. In this article, we will look into AutoML from H2O.ai.

The implementation is available in both R and Python API and the current version of AutoML (in H2O 3.20 ) performs:

Trains and cross-validates a default Random Forest (DRF), an Extremely Randomized Forest (XRT), a random grid of Gradient Boosting Machines (GBMs), a random grid of Deep Neural Nets, a fixed grid of GLMs. AutoML then trains two Stacked Ensemble models. First ensemble containing all the models and second ensemble containing just the best performing model from each algorithm class.

Install H2O.ai

The installation procedure is quite simple. All you need to do is have the following dependencies installed and then pip install ;

If you are already having anaconda installed you could directly proceed with the conda command;

conda install -c h2oai h2o=3.20.0.1

Note: When installing H2O from pip in OS X El Capitan, users must include the --user flag. For example -

pip install -f http://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o --user

For R and Hadoop installation please refer to the official documentation here.

Getting Started

Start the H2O.ai instance by importing h2o.ai and H2OAutoML instance.

import h2o

from h2o.automl import H2OAutoML

h2o.init()

If the setup was successful then will see the following cluster information.

In this example, we are going to use a dataset from DataHack Practice problem Loan Prediction III

The goal here is to predict whether or not a loan will be paid by the customer wherein we are provided with details like — Gender, Marital Status, Education, and others.

First, let’s import the training set and check out .head() and the datatypes of the data frame.

df = h2o.import_file('train_u6lujuX_CVtuZ9i.csv')

df.head()

.head() method frame
The easy grain bowl you’ll want to make all throughout the winter
Tags: Nutrition, Healthy Foods, Wellness, Recipe, Healthy Eating

This post was originally published on blog.healthtap.com on January 9, 2018.

As we get deep into the dark and cold months of winter, we find ourselves turning toward nourishing, hot, and hearty foods to warm our bodies and our spirits.

This simple, nutrient rich grain bowl is effortless to throw together, and is a perfect option for dinner when you want something savory and filling but don’t want to spend too much time in the kitchen. Extra roasted veggies also make perfect leftovers for your lunches and meals all week long.

This bowl nails comforting, hearty flavor while being a perfectly balanced meal: dark leafy greens are topped with seasonal roasted veggies, whole grains, protein-packed chickpeas, and nourishing monounsaturated fat from creamy, sliced avocado. This nutritionally powerful, veggie-based winter bowl is sure to be something you’ll want to whip up all throughout the rest of these chilly months.

Winter Grain Bowl

What you’ll need:

Cooked quinoa

Raw (or steamed) kale

Sweet potato

Can of chickpeas, drained and rinsed

Bell pepper

Avocado

Spices: salt, pepper, paprika, rosemary, garlic powder

Olive oil

To Serve:

Lemon tahini dressing

1/3 cup tahini

1/3- 1/2 cup water (depending on desired consistency)

2 tbsp lemon juice

1 tablespoon olive oil

1 garlic clove, minced

Salt and pepper, to taste

What you need to do:

Preheat your oven to 400F. Slice your sweet potato into wedges, and evenly coat them with olive oil, salt, pepper, and rosemary. Brush your bell pepper with olive oil, and sprinkle with salt and pepper.

Spread your veggies evenly on a baking sheet, and roast them or 35–40 minutes until the bell pepper is slightly blackened and the sweet potato wedges are soft throughout.

While your veggies are roasting, Add the chickpeas, a tablespoon of olive oil, 1/2 tsp smoked paprika, 1/4 tsp garlic powder, and salt and pepper to taste in a skillet. Stir the chickpeas over medium heat for about 5 minutes until they become hot and a little crispy.

To make the dressing, combine all ingredients in a blender and blend until creamy.

Once the veggies, chickpeas, and dressing are done, slice your avocado. Finally, layer your bowls with kale, quinoa, sweet potatoes, peppers, chickpeas, and add sliced avocado over the top. For a finishing touch, drizzle all with your lemon tahini dressing. Enjoy!

Author: Maggie Harriman
Leverage Python and Selenium based Automation
By: Tarun Gupta
Tags: Python, Instagram, Bots, Automation, Towards Data Science

You right click on any element that you want the xpath of.

You inspect the element.

Go to the element in the HTML in the developer console.

Right click on the element.

Click on Copy and go down to the option Copy XPath.

Refer above image for this.

All the statements with sleep() are there to simulate some delays. Also there are try blocks in the code in order to not stop execution if there is any error occured.

Lines 4–8

These are the import statements to include all the necessary libraries used for this project.

Lines 11–23

This is a method for logging into your Instagram account. The webdriver enters your credentials in the browser controlled by this script and executes the commands given to it. Line 17 requires you to add your username and line 20 requires you to add your password.

Lines 26–34

This is a method to click on the pop-ups that you get in between the login and the home page of your account.

Lines 37–39

A driver object based on webdriver.Chrome() is created. This is the driver emulating all the user actions. It is followed by calling of login() and post_login() methods described above.

Lines 41–51

The hashtag_list is the list of hashtags you have selected based on your niche. You need to add them here as strings separated by commas.

Lines 43–45

These are the lines where you get the list of already followed users. This is there in order to not unfollow the users that you have already followed. When you run the bot for the first time, uncomment the line 43 and comment lines 44 and 45. Next time onwards, comment 43 and uncomment 44 and 45 and don’t forget to change the file name on line 44.

Lines 47–51

These are variables keeping track of new followed people, new likes and comments posted. This information will be printed at the end when the bot is done executing.

Lines 53–119

Let’s understand this big chunk of code in steps:
A Bold And Beautiful Salad For Summer Days
By: Melissa A. Matthews
Tags: Summer, Cooking, Vegan, Food, Recipe

A Bold And Beautiful Salad For Summer Days

This feisty vegan fajita salad will leave you wanting more.

Feisty Fiesta Salad, photo by author

Okay, so full disclosure: I’m OBSESSED with walnut “meat!” I’ve been making up any excuse to make it and use it. It’s one of my favorite meat substitutes right now because it is sooo easy to make and as delicious as you allow it to be. If you season it well, you’ll be licking your fingers and asking “Walnuts?! What walnuts?!” It’s meaty, hearty and reminiscent of minced chicken or pork on its own. If you add mushrooms to the mix with the right seasoning, you can easily get a beefy flavor. And, you know what else?You can control the salt, and season it exactly to your liking unlike the prepackaged vegan sausages that I love.

I tried Beyond Meat Hot Italian Sausages and I’m not going to lie, they SLAP! However, this here walnut meat is a great quick substitute for days when you want to eat a little cleaner.

You might be asking yourself why I am waxing poetic about walnut meat when this is a fajita salad recipe, but the truth is, the walnut meat is the centerpiece of this recipe for me. Along side some crisp sweet peppers, onions, corn, cucumbers and tomatoes (optional), the walnut meat makes this the perfect fajita salad. Not to mention, it’s literally the only thing that you need to cook in this entire recipe. AND, you don’t even have to do that; you can make your walnut meat raw if you like because as Tabitha Brown says “that’s your business!”

If you don’t like walnuts, try pecans. If you have an allergy or nuts are not your jam, you can add whatever vegan mince or grounds you like. For the love of all that is holy, just season them up really well.

Ingredients:

1/4 cup of walnut pieces

Trini green seasoning

Paprika

Garlic powder

Roucou/ Goya Sazon/ achiote powder (optional)

Liquid aminos (soy sauce, coconut aminos, or tamari will work)

2 medium-sized cucumbers diced

1 can of sweet corn (drained and washed)

1–2 small white onions julienned

1 medium-sized green bell pepper (sweet pepper) julienned

1 medium-sized tomato diced

1 large clove of garlic

Red chili flakes (optional)

Black pepper

Olive oil

Lime juice

Mustard

Agave (honey or brown sugar will work)
Upgrading Python lists
By: Dipam Vasani
Tags: Programming, Python

Upgrading Python lists

Adding useful functionalities to Python lists

Image source: JoeyBLS photography

Introduction

Python lists are good. But they’re not great. There is so much functionality that can be easily added to them but is still missing. Indexing with booleans, easily creating dictionaries from them, appending more than one element at a time, so on and so forth. Well, not anymore.

Fastai has come up with their own data structure called L . It can do everything that a Python list can do and much more.

The purpose of this article is to show you how easy it is to write such useful functionalities on your own. Especially if you are a beginner, try creating a mini-version of this library. Try writing some of the functionalities you hoped existed. It’ll be a good learning experience.

For now, let’s learn about L. Here is the Colab link if you’d. Make a copy on your Colab (File->Save a copy in drive)and run the first cell only once. Your notebook will crash. But you’ll be ready to use the library right away.

Google Colaboratory Link.

What is L?
Evolution to Advanced Coding : Any Kid Can Code
By: Laxman Singh
Tags: Python, Python3, Kids, Python Programming, Kids And Tech

PYTHON IS OBJECT ORIENTED PROGRAMMING LANGUAGE.

What does this mean? In python, everything is an object and object has one good thing they can be assigned to variable and instance can be created for the objects.

What is OOP (Object oriented programming)?

OOP is the concept which preaches to create objects. And, objects contains their own properties and functions. Let us correlate this to real life, any object like computer mouse, has its own properties and functions. Properties: mouse has button (right/left), it has scroller on top etc. Functions: move cursor, click, scroll etc. I hope it makes easy to correlate coding to real life examples.

Here in programming, object is created as instance of class which is created using keyword “class” and then, inside class we can create different variables and functions (this we have learnt earlier). Those functions can be used by object and we can create any number of objects in a class. You can refresh your basic knowledge:

Here we go, we have exposure to most important concept of programming i.e, oOP. We are growing in the same manner as the word looking like.

Benefit of using OOP: Modularity, reusability and scalability. We will go in depth when the time comes or we will understood when we do practice.

How it makes code compact — Let us assume you bought a computer mouse, it has various functions and it works plug n play manner. If you want to attach it to laptop, TV or any other device, it will function as same. So, you need not to buy multiple mouse. This is just to understand the concept of object as an instance. We will deep dive into that as and when required.

Just focus that object is an instance of class and there can be many instances to the class. Animal is class and dog, cat etc are their instances with different functions

OOP has many other concept like polymorphism, inheritance, encapsulation and abstraction. We will learn all over the time.

You can understand how important and easy it will become, if we have class widgetObject which allows to create different instance and it has function of move object. Let us now wait too much. First do the program using loop and then use the concept just learnt. And, I will leave it to you to see the difference for understanding and easiness.