My First Pull Request
Talk by Gil Yehuda
We had a guest speaker Gil Yehuda, who is working at Verison Media as a Sr. Director of the Open Source department. I appreciate his spending time with our class. His main point was how essential for us to (especially for students looking for a job) to be involved with open-source projects. Contributing to a project with quality validates your skills because that means the maintainers officially accept your work.
One of my classmates had a question about managing our confidence. Thanks to the person who asked about it since I wanted to ask the same thing. He responded to the question that all of us have Impostor syndrome. Then, he gave us an example of a Violinist who responded, “I do it fourteen hours every day” when he was told how talented he is. This example illustrates one of my perspectives about saying if one is “talented” or not. I am not to say that if such a thing doesn’t exist, and I rather believe it does. However, to me, expressing that a person is “talented” just because one is capable of something is meaningless. That is because what you are mentioning could be just a normal thing for that person, and at the same time, more importantly, it could be disrespectful if he/she has been making a lot of effort to it.
Inkscape
This week, I opened my first merge request. Since the ci project is not as important compared to the main Inkscape project, This will probably take some more time for a review. For the team, we are meeting today (04-05-2020) on Discord.
Debugging Inkscape
I was browsing the Inkscape page last week, and found a section about debugging the project using GDB. I have only used them on some IDEs (yes.., I remember there was a lecture about debugging software in 136, but I didn’t pay too much attention), so I tried running it manually to see how it goes. I had to recompile the project to enable debugging symbols. The instructions are on this page. To run the project with gdb, you can pass the executable as an argument to the command.
gdb path/to/executable
Completed:
- Fixed (hopefully) the issue that I opened on
inkscape-ci-docker- Made a merge request with the above fix
Todos:
- Find a issue and try to catch a crash with GDB
- Working on this issue
Outside Activity
Completed:
- OSM:
- Added a pond near my house
- Wikipedia:
- Edited a page of the city I was born, which had incorrectly formatted info section.
- Blog Editing:
- Fixed some typo on one of Umar’s posts and made a pull request
Todos:
- Some more blog edits
- Keep working on the Wikipedia page about the band
Shell Script
Fixing the issue, I learned a new stuff that could be useful. The problem is
something like this, given a string genres which consists of one or more
string(s) representing the genre(s) of a musical artist or group, and genre that
represents a specific genre of music. Find if genres contains the string
genre. It’s the simplest substring problem, but trying things in a new language
is sometimes not that simple. I first tried with the grep. The command
echo "Blues Jazz Gospel" | grep -o "Jazz"
generates an output "Jazz" meaning the string "Jazz" is a substring of
"Jazz Blues Gospel". To make the matching case-insensitive, adding -i option
to the grep will do it. Since I need a boolean value for a if statement,
the script looks something like:
#!/bin/bash
input="blues jazz gospel"
target="jazz"
if [[ $(echo "$input" | grep "$target") ]];
then
printf '%s is in "%s"\n' "$target" "$input"
else
printf '%s is not in "%s"\n' "$target" "$input"
fi
Although it works fine, the condition looks too much for this simple step. After
some research, I found a way to simplify this (from this post
). It uses a Linux command-line tool called Standard Wildcards. The man page
says,
“* or an asterisk can represent any number of characters
(including zero, in other words, zero or more characters). If you specified a
“cd*” it would use “cda”, “cdrom”, “cdrecord” and anything that starts with
“cd” also including “cd” itself. “m*l” could by mill, mull, ml, and anything
that starts with an m and ends with an l.”
which indicates “*jazz*” will match “blues jazz gospel”. Therefore, the if
statement from the above script can be rewritten as:
if [[ "$input" == *"$target"* ]];
This looks much better and could be useful for some other cases.