Category Archives: Julia

GitHub Sponsors – the good, the bad, and the ugly

By: Miguel Raz GuzmΓ‘n Macedo

Re-posted from: https://miguelraz.github.io/blog/githubsponsors/index.html

Saludos πŸ‘‹

Hola! Me llamo Raz y este es mi granito de arena para quienes quieren empezar con el software libre (o encontrar fuentes de ingreso en este mundo). Puedes ser mi sponsor en GitHub para que escriba mΓ‘s cosas como esta y contribuya al software libre de Julia/Rust y sus traducciones en espaΓ±ol.

GitHub Sponsors

with apologies to Holge and Randy and David and Logan and Hector and…

Summary:

You can get money via donations and your GitHub profile. This can take a few hours to setup and be a good side revenue, or an emergency lifeboat. Depending on where you live, your marketing skills, larger community environment and a slew of other factors, this may or may not work for you. This post is an exercise in Your Mileage May Vary from someone who spawned the game of life in Easy Mode (white cis english speaking STEM focused able male), so take what you can and dismiss what doesn't apply.

Make no mistake: living from GitHub sponsorship means charity with extra steps, and with a multinational corporation (ultimately, Microsoft, Github's owner) as your uncaring and all powerful boss. Assume they will use power to control your "wage" to align with their interests and diversify your risks accordingly.

If you live in the Global South and this program can apply for you, please consider getting started NOW. If you live in the Global North, consider sponsoring devs in the Global South with monthly payments – foreign exchange rate makes them life changing. If you are giddy for how to get started, my recommendations for a setup are farther down in this post.

Who what when where why

GitHub sponsors is a program you can sign up for (free) on github.com and receive donations from other people for (mostly) working on open source stuff. If you were already doing open source stuff, you can setup a profile and people can choose to give you one-time or monthly donations (more on that later) at tiers you are free to specify – from 1USD a month to full 666USD Bezos level patronage.

Github sponsors is attractive in comparison to other platforms because, at time of writing, they do not charge a percentage on your sponsorships.

Patreon charges (at time of writing), 5%+, and other (main stream) platforms are not far off.

This is an attractive proposition, but you should investigate before you launch yourself into the "content creator" lifestyle.

  1. GitHub has yet, to my knowledge, bound itself legally into always respecting this financial agreement. It could start changing it's terms tomorrow, lest you obey some orders from corporate, as was the case recently with Twitch streamer's revenue sharing overnight change with …Amazon. That news was the most recent one off the top of my head, but every subscription/donation based platform can, has, and will unilaterally change your ~~wage split~~donations how they see fit.

  2. This doesn't apply to every country. At time of writing, 68 regions can qualify for sponsorships of which, sadly, I only count 4 African countries, for a "global" program that has been running for almost 3 years now. Mexico initially wasn't on the beta list (for which there was promo where GitHub would match donations, to my chagrin), but I joined the waitlist and received my email after a while. Note that Iran, Venezuela, Russia and CubaN

  • who i am

    • how i got started, my presence

    • marketing

  • who i am not

    • orgs, umbrella, collectives

So. I think I've had what I would call a "moderately" successful run with my GitHub sponsors. A lot of people have asked me about tips and tricks, and I'm not the one for

  • what sponsors is

how it works

  • how to setup your profile

  • countries, bans, availability

  • taxes

  • Dos

  • public presence: famous code, repos, books, talks, online presence (pandemic podcasts, community building)*

  • big disclaimers, aka the don'ts:

  • don't assume you won't pay taxes.

  • uni might clash – grad students/scholarships may not work. dont knmow if amazon wish lists or payments in kind can be setup

  • make this yourplan A, at least forever.

130 graded exercises to train your Julia for data analysis muscle

By: Blog by BogumiΕ‚ KamiΕ„ski

Re-posted from: https://bkamins.github.io/julialang/2022/10/14/exercises.html

Introduction

My Julia for Data Analysis book will be soon published (now all its
chapters are already available in preview for free).

An important part of the book is its GitHub repository containing
all the codes used in the book and ensuring their reproducibility.

Since the book was prepared to fit one semester course on data analysis using
Julia I am now preparing supporting teaching materials that accompany it.

Today together with Daniel KaszyΕ„ski we have released first part of these
supporting materials. In the exercises folder of the
book’s GitHub repository we have added 130 exercises that should help you
master the material covered in the book.

The exercises are grouped by book chapter. There are 10 exercises for
each chapter. Each exercise has a proposed solution. We have prepared the
exercises so that they have a varying difficulty level. The exercises from
initial chapters should be relatively easy. However, to solve exercises
from the final chapters you might need to have a significant knowledge of
Julia’s ecosystem for data analysis.

In the post I use Julia 1.8.2, and DataFrames.jl 1.4.1.

A sample exercise

To have some concrete example of what a typical exercise is I have picked a
question that was asked today on Discourse that I liked. The
problem is stated as follows.

Consider the following data frame:

julia> using DataFrames

julia> df = DataFrame(country=["Poland", "Poland", "Canada", "Canada"],
                      city=["Olecko", "EΕ‚k", "Toronto", "Mississauga"])
4Γ—2 DataFrame
 Row β”‚ country  city
     β”‚ String   String
─────┼──────────────────────
   1 β”‚ Poland   Olecko
   2 β”‚ Poland   EΕ‚k
   3 β”‚ Canada   Toronto
   4 β”‚ Canada   Mississauga

The task is to reduce it by unique value in country column. More specifically
we want to create a new data frame with two columns. One of them should be
country that will store unique values of country column in the source data
frame df. The second column should be cities that should store a vector
of values in the city column from df that correspond to a given country.

Now let me show three ways how you can do it using the combine function.
The key to the solution is the following rule of how combine works
(taken from the documentation):

In all of these cases, function can return either a single row or multiple
rows. As a particular rule, values wrapped in a Ref or a
0-dimensional AbstractArray are unwrapped and then treated as a single row.

This means that in order to make a vector to be treated as a single row we have
three options:

  • wrap a vector in another vector as its single element (so we have a multi-row
    object but with a single row);
  • wrap a vector in Ref;
  • wrap a vector in a 0-dimensional AbstractArray, which can be done using the
    fill function.

So the three solutions to our problem are:

julia> combine(groupby(df, :country, sort=true), :city => (x -> [x]) => :cities)
2Γ—2 DataFrame
 Row β”‚ country  cities
     β”‚ String   SubArray…
─────┼─────────────────────────────────────
   1 β”‚ Canada   ["Toronto", "Mississauga"]
   2 β”‚ Poland   ["Olecko", "EΕ‚k"]

julia> combine(groupby(df, :country, sort=true), :city => Ref => :cities)
2Γ—2 DataFrame
 Row β”‚ country  cities
     β”‚ String   SubArray…
─────┼─────────────────────────────────────
   1 β”‚ Canada   ["Toronto", "Mississauga"]
   2 β”‚ Poland   ["Olecko", "EΕ‚k"]

julia> combine(groupby(df, :country, sort=true), :city => fill => :cities)
2Γ—2 DataFrame
 Row β”‚ country  cities
     β”‚ String   SubArray…
─────┼─────────────────────────────────────
   1 β”‚ Canada   ["Toronto", "Mississauga"]
   2 β”‚ Poland   ["Olecko", "EΕ‚k"]

Conclusions

I hope you will enjoy and benefit from doing the exercises that I have added
to the book’s GitHub repository.

Expect that soon two other sets of materials will be added to this repository:

  • For each chapter you will get a notebook which can serve as a starting point
    to develop teaching materials for a given chapter.
  • Several openly available notebooks with additional data analysis problems that
    are solved end-to-end. They will be prepared in a
    similar style to Hands-on Data Science with Julia notebooks and are
    meant to be studied as a follow-up material after you have studied the book.

When these are added I will post about it.