The Experiment / A experiência

Disclaimer: I wrote the first draft of this post on December 19th 2022 while in Chile. I wrote the final draft after spending two weeks in Brazil.

Table of Contents

Introduction

This week, I’m going to Brazil to spend Christmas with two friends from university. I’ve decided that, after they leave, I’m going to try to stay in the country until the end of February. Why? Because I want to learn Portuguese.

This wasn’t the original plan. The original plan was to go to Chile for three months to immerse myself in Spanish and experience life in a language that I’d spent a few years studying. I felt confident I could reach a new level of Spanish fluency after three months since I had study and preparation under my belt before arriving. But Portuguese? I don’t know anything about Portuguese. The extent of my study has been using Duolingo and some Anki flashcards for the past two months. It feels a little incredibly naive of me to expect to be able to learn Portuguese during a two month stay in Brazil with close to no preparation. Beyond that, I have no idea when I’ll ever use Portuguese again, since right now I have no plans to spend an extended period of time in either Brazil or Portugal or any other country where it’s mainly spoken. I’m worried that I’m confusing the mission. Wouldn’t two months struggling to learn Portuguese be better spent continuing to improve my Spanish? I just started feeling confident and fluent in Spanish, and now I’m going to Brazil? Uruguay is right there, after all, and a flight to Buenos Aires is under $100. Maybe I’m making a mistake.

Well, I’m gonna do it anyway. Because I want to. And because, at this point in my life, I’ve got a superpower and a super privilege: I can afford to make these kinds of mistakes. I have no debt, I have no looming responsibilities, and I have enough money to do it. A friend of mine, who is a few years older than me, told me that one of the best things I can do at my age is to try a whole lot of things. Right now, I can afford to make mistakes, and mistakes are how I’ll learn. So that’s what I’m going to do. I’m going to try to learn Portuguese, with zero preparation, no definite plans to come back to Brazil, and with possibly less than two months in the country. It’s going to be an experiment. And therefore,

“Remember kids, the only difference between screwing around and science is writing it down”

— Adam Savage, Mythbusters

If I’m going to think of this as an experiment, then I want to make an effort to document it. Hence this blog post. Even if this experiment turns out to be a colossal embarrassing failure, if I write it down, I’ll at least have some concrete data to learn from. I’ll have produced something of value. Or at least, this is what I’m telling myself to make myself feel better. So let’s get into the specifics.

Background and previous research

Despite the aforementioned hullabaloo about not having any preparation in Portuguese, I don’t actually think I’m starting from zero. I once read (or at least I think I did, can’t find the quote right now) that the hardest language to learn is the first one that isn’t your native language. I like this, because it suggests no language is more or less difficult than another one, and also that learning gets easier over time. I’m going to make the bold claim that having seriously studied a second language is preparation for learning a third. After spending three months trying to learn Spanish in Chile, I have an idea of what I’ll be in for: Asking a question and not understanding the answer, only understanding 10% of a conversation, not even knowing how to ask the question, feeling embarrassed, etc. I know that these things are (hopefully) a normal part of learning a foreign language. I know not to get discouraged by them, and that with time and dedication, it will get better. On top of that, I’ve already got some practice wrapping my head around grammatical concepts that might be unfamiliar to a native English speaker, like verb moods, verb tenses, grammatical gender, etc. Maybe the second time I run into these concepts, they won’t take as much time to sink in.


Aside from giving me an idea of what to expect when starting out learning Portuguese, I think having proficiency in specifically Spanish also means I’m not starting from zero. People, including those I met in Chile, told me that Spanish and Portuguese are very similar. I was told to just try saying something in Spanish if I couldn’t say it in Portuguese, a.k.a. I could try speaking portunhol. While the two languages are different, it seems that there is a lot of overlap, both in pronunciation, vocabulary, and grammer. Yo soy Sam becomes Eu sou Sam and Tengo hormigas en la boca becomes tenho formigas na boca. It seems credible that the languages would be similar in many ways given that they are both romance languages, so I don’t think it’s unreasonable to claim that I’m not starting from zero in Portuguese.

Motivation

Why do I even want to do this? I’ve got four main reasons:

  1. Brazil sounds super cool. All I know about Brazil comes from listening to Samba and Bossa Nova and what my friends have told me, but I like what I’ve heard. Supposedly, the people, music, beaches, and parties are all amazing, and there’s some danger of going to Brazil and never wanting to leave. Knowing the language of a place makes it easier to get around and connect, so knowing some Portuguese would be worth it to be able to explore Brazil. It would also be cool to be able to come back to Brazil some day or to make a trip to Portugal.
  2. Learning another language is generally a good thing. It teaches you a new way to think and lets you connect to a culture and other people that you might otherwise know nothing about. This was my experience in Chile and it would be great to replicate it in Brazil.
  3. I think it will impress my friends. I know this is not a good motivation but I feel I have to expose that this thought is lingering at the back of my mind. It would just be so delicious to say that I set out to Chile for three months to improve my Spanish and then “accidentally” learned Portuguese.
  4. I kind of just want to see what will happen if I try.

These are the reasons. There are more, but these are the ones I feel good writing down.

Procedure

The plan is to immerse myself in the language by finding one or two voluntariados through either Wordpackers or Workaway and trying to speak Portuguese whenever I have the chance. This is more or less what I did in Chile, and in retrospect, it worked well. Doing two voluntariados allowed me to make friends who only spoke Spanish, challenged me to use the language in new situations, and also gave me a view of what daily life is like in Chile. I’m hoping that I can replicate this in Brazil. As of now, I have spoken to a language school in Farroupilha that is willing to take me on as an English teaching assistant. They’re going to set me up with a host family, which to me seemed like an excellent way to get the language immersion and day-in-the-life experience I had in Chile. The biggest caveat is that if I’m teaching English for five hours each day, I’m worried that I won’t develop my language abilities as well as if I were doing a voluntariado that was entirely in Portuguese. That said, I’ll supposedly only be doing five hours of English instruction per day. That leaves at least 10 other waking hours in the day that I can use for Portuguese language immersion, and on top of that I’ll be living with a Portuguese host family. Other challenges will arise, but this is the overall plan for Portuguese language immersion.

With the plan in mind, are three things I’ll do to document this experiment:

  1. Each day, I will record a one minute video of me speaking Portuguese. I’ll try to talk about what I did that day, but I’m giving myself permission to talk about anything that comes to mind, as long as it’s in Portuguese. At the end of my time in Brazil, I should have a collection of videos showing my progress in the language that I can review.
  2. Each day, I will write three sentences in Portuguese explaining what I did that day or something new that I learned. I sort of did this in Chile, and I found that it was a good way to improve my vocabulary in a targeted way, since it would require me to look up words I didn’t know. This will both help me with my vocabulary and help me document my experience.
  3. Each week, I will create a blog post with a summary of my progress during that week. I don’t want to specify too much what the “summary” has to be, but I’m imagining it could include the videos and sentences from the above two points and maybe some reflections about my experience trying to learn the language.

My hope is that these will be easy enough to do that I can stick with them during my time in Brazil, but that they will also be useful when I want to look back on my experience.

Conclusion

It’s possible that this is a mistake, but I feel that it probably isn’t. Even if I come away from this without being able to speak any Portuguese, I think that by making the effort I’m bound to form connections with the people I meet and deepen my experience there. As for the fear that I could be spending this time speaking Spanish, I’m confident my journey with Spanish is far from over. This year, I’m planning on applying to (and being accepted to) NALCAP. It’s a program offered by the Spanish government where fluent English speakers from North America are placed in classrooms across Spain as English teaching assistants. The placements are for about 8 months, so even if I’m missing out on two more months of Spanish language immersion now, the plan is to have 8 months of immersion starting next September. In fact, this makes the outcome of this experiment with Portuguese more valuable: if I can get a language immersion experience while teaching English in Brazil, that will make me confident I can replicate that result while teaching English in Spain, or elsewhere.

So in conclusion: I’m going to try to learn Portuguese. It’s going to be an experiment, and I’m going to document it. It could go wrong, but not horribly, and I don’t think it will. Stay tuned for results.

Three tips to communicate effectively as a remote data science intern

Any student who has worked on a group project (especially a programming project) or anyone who has worked within a large organization understands how important effective communication is. This is something I learned very quickly during my data science internship. I’d like to share three simple ways I learned to practice and promote effective communication during my remote data science internship.

1. Ask questions during meetings

I tend to be afraid to ask questions because I think that everyone else already knows what’s going on and I’m wasting everyone’s time by asking the question. I can say from experience now that this isn’t true. If you genuinely have a question, then there’s a high probability that other people have that same question. By asking it and getting an answer, you’re helping your team by making sure everyone is on the same page (and you’re also showing your team that you’re paying attention and don’t just have the zoom window minimized). Moreover, you’re challenging everyone to check their assumptions and ensure they really understand the details of what they’re talking about. At the end of my internship, one of my co-workers nicely told me that she appreciated all of the questions I had asked during my internship, for all the reasons I gave above.

2. Answer questions during meetings

This can be intimidating as an intern, since you might (like me) think that your non-intern teammates are more qualified to answer than you. It might be that they are more qualified, but if you genuinely think you have some answer to the question (even a partial answer), then you deserve to be heard and your answer has value. As an example, I was in a meeting where the data science team was discussing how to use some user collected data to improve the company’s machine learning models. Even though the team was composed of extremely smart people (4 PhDs and 1 Math+CompSci double major), no one floated an idea that everyone was excited about. I decided to pitch in my two cents, and to my surprise, they liked it. In fact, my idea turned into a project that was allowed to work on and eventually deploy for customer use in production. Had I not decided to participate in that original discussion, that would have never happened.

3. Use visuals to articulate your ideas

This one sounds obvious, but there were many occasions where whiteboarding an idea or creating a flowchart helped everyone on the data science team get on the same page about a problem we were trying to solve. Drawing your idea helps you think about it in a more abstract way and can serve as a guide for how to implement it or refine it. Drawing can be tough if you’re working remotely and don’t have access to a tablet you can use for digital art, but even mouse-drawings can be helpful and flowcharts typically don’t require you to freehand draw.

Conclusion

I like these three ideas of communication because they’re simple and effective. I hope you find them useful, and I intend to continue to do this as a student and in my future work.

How to store GitHub PATs without storing your other git credentials in plaintext (Ubuntu 20.04)

Motivation and solution

I recently discovered that enabling two-factor-authentication (2FA) on your GitHub account prevents you from using your GitHub account password for authentication to GitHub on the command line. Instead, you need to generate a personal access token (PAT) from your GitHub account and use that in place of your password when authenticating to GitHub.

Obviously, it’s inconvenient to need to enter a long personal access token each time you want to interact with a GitHub repo. Adding the following lines to your ~/.gitconfig will store your GitHub PAT in ~/.git-credentials and automatically use it when authenticating to GitHub:

# Automatically store GitHub credentials
[credential "https://github.com"]
    username = your_user_name
    helper = store

What’s going on

Git allows you to specify third-party “credential helpers” that can manage authentication to specific hosts. Git has two built-in helpers, credential-store and credential-cache. The first will store all of your git authentication in plaintext in ~/.git-credentials, while the other will cache your credentials in memory for a custom amount of time. These credential helpers can be used to store your GitHub PAT. When you specify [credential "https://github.com"] with helper = store, you’re telling git to use the credential-store manager to manage authentication to GitHub over HTTPS, which just stores and retrieves credentials in ~.git-credentials. So the next time you authenticate to GitHub, git will attempt to store your PAT in ~.git-credentials or retrieve it if it’s already there.

You can specify third-party credential managers besides the two built into git. As explained in this Stack Overflow answer, Windows and macOS users can use the Microsoft Git-Credential-Manager-Core to manage their git credentials, while Ubuntu 20.04 users have the option of using the libsecret library along with the built-in desktop password manager (details here).

Final thoughts

If you search for a way to store your GitHub PAT with git, one of the first answers that comes up is this one, and it suggests using the command

git config --global credential.helper store

However, I don’t like this because this command will store all of your git credentials in a plaintext file. You might not want to do this. For example, I have a git repo I access via SSH on a remote host, and using this command would store my SSH key in plaintext. The solution I’ve given here will only store your GitHub PAT in plaintext, and no other git credentials. Even though your PAT is stored in plaintext, my understanding from this answer is that a PAT is not like a password, so storing it in plaintext is fine in this situation.

Finally, you probably get a lot more control over how your credentials are stored if you opt to use a third-party credential manager, but I have not personally explored this option.

What I learned from four weeks of Philosophy 142 (and why I’m dropping it)

A pictorial description of a model.

During my semester off, I became interested mathematical logic, especially how it connects to computer science. To that end, I decided to take Berkeley’s Philosophy 142: Philosophical Logic (taught by the very cool author of pandoc). I was hoping the course would me help locate my fuzzy ideas about math, logic, and computer science within the established ideas of philosophy. After four weeks of the course, I did get some answers, but I also got the sense that the bulk of the course content didn’t really align with my motivations for taking the course. Also, the problem sets were kind of killing me while trying to handle my other courses. Here are some of the clues I got related to the questions I’m interested in:

  • Fitch-style natural deduction proofs look suspiciously like environment diagrams (or Pyagrams). Why? Is a function in a programming language (or even in a mathematical context) kind of like a proof?
  • Use and mention… are things that are important. This is basically the idea that we want to avoid the apparent contradiction in sentences like “Boston is a city. Boston is a six-letter word.” by adding quotes around “Boston” to indicate we are referring to a name and not the object labeled by the name. This feels suspiciously like quoting expressions in Lisp, and the section on use and mention in the textbook even includes a footnote about Lisp.
  • Schema and quasi-quotations feel a lot like macros… (hence the name “Scheme” for the programming language?). My understanding is that a “schema” is something that is like an axiom of your language, but doesn’t actually exist in your language, rather it exists in the meta language. As an example, I could say “Whenever you have a true formula ‘p’ and a true formula ‘q’, you may write down ‘p ^ q'”. That instruction isn’t really part of my language, it’s a sentence that exists outside my language that tells me something about my language. So it’s a schema, not an axiom. Similarly, a quasi-quotation allows you to selectively substitute values into a quoted expression, kind of like a macro in Lisp.
  • First order logic cannot express a non-standard model of arithmetic (I think?).
  • Consider the following riddle: There exists a population of people on an island. Everyone on this island loves exactly one person, all love is unrequited, and there is one person whom no one loves. What is the size of the population? I think this riddle describes the natural numbers. Love is precedence. Everyone precedes exactly one person, and that person does not precede them. No one precedes 0.
  • A lot of problems in math and science can be formulated as trying to find a model for a sentence, and models are easily formulated in terms of set theory. This makes me think I ought to study some set theory.
  • A proof system can be sound, complete, both, or neither. I’d like to know how you can prove that a system is any of those.

I think I would have enjoyed the course more if it touched more on the topics I’m interested in, but it was my perception that it was instead going to catalog the different ways that philosophy is used in logic and the different types of logics out there. Even though I’m dropping the class, I’d like to still keep in mind the questions and clues I’ve outlined above. I’m hoping that by writing them here, I’ll hold myself accountable to continue looking for answers.