Students often ask me for suggestions on how to improve their programming skills during their spare time. I typically mention personal projects that they could start (picking a project for which they genuinely have a dire need), open-source projects that they use and to which they could contribute, or any sort of hackathons they can enroll in.
Now, finding ideas of projects to work on can still be daunting so I thought I’d share my own list in case some students are looking for useful project ideas!
Below is a list of projects that I’m personally interested in, but that I unfortunately don’t have much time to work on. So please, feel free to implement any of those and let me know!
I run Arch Linux and the KDE desktop manager on my laptop, so most of these projects are related to this environment.
Note that these are _not_ academic projects for which I could officially supervise students and give research credits.
When I give a lecture, it would be great to have real-time captioning of my voice so that students could have access to subtitles as well. A lot of software have started doing that (Powerpoint, Zoom) but it’s only provided as part of their own products, not as a general service.
Here, the idea would be to make the real-time automatic captioning into some independent software so that it works on any Linux distribution. For example, it was thinking that the rendering could be similar to that of screenkey, a popular screencast tool to display keystrokes.
Services such as Github Gist already allow people to embed pieces of code on their blog or in online articles. However, none of the existing widgets showing code allow visitors to discuss the code itself. The only way for visitors to leave a comment is often via a separate commenting section (e.g., using services like Disqus at the bottom of an article) which is clunky to comment on code.
The idea here would be to develop the equivalent of Disqus both for showing snippets of code and also commenting them (like Soundcloud allows to comment on music at specific timestamps during a song).
I try my best to keep tabs on my work schedule (e.g., I maintain a daily log of what I’ve done) but sometimes it’s hard to fully comprehend how much time I spend on each task.
Since I typically separate my different types of activities into virtual desktops (e.g., one desktop for emails, one for teaching, one for research, etc.), it shouldn’t be too complicated to track the time spent on each virtual desktop.
Unfortunately, I haven’t found a good piece of software that can do that effectively and provide me with daily/weekly/monthly reports.
I recently bought a “Chromecast with Google TV” so that I could stream videos from my laptop to my projector wirelessly, without having to use a bulky HDMI cable. However, I encountered two types of issues:
Now, the audio issue seems to come audio codecs that my bluetooth sound bar doesn’t support. For instance, if the audio is encoded in AC3, then it is sent to Chromecast from my computer, the Chromecast acts as a passthrough and retransmits it directly to my sound bar which can’t decode it.
For now, I’ve come up with a hacky patch in gnomecast which forces the audio to always be transcoded to mp3 first.
But ideally, if I had more time, I would 1/ transform the transcoding into an option offered in the interface, and 2/ potentially reimplement gnomecast to make it more modular and to use QT instead of GTK so that it blends better in my desktop manager.
]]>Here is our status at the end of the fall quarter 2023.
This quarter (FQ23), I am teaching our lower-div course on computer organization and assembly language (ECS 50). The first couple of weeks are dedicated to how various types of data are represented in the computer. For instance, we study unsigned integers, signed integers, characters, and floating-point numbers.
In one of my slides about floating-point numbers, I briefly mention that the exponent is stored as a “biased value” but every time in lecture, I struggle to decide how much details I should provide. If I don’t give much detail, then students can get confused as to why the exponent’s value is simply not stored directly as a signed integer. On the other hand, if I start diving into the reasons for storing the exponent as a biased value, I could probably spend a whole lecture on it!
So I decided to explain the whole reasoning behind the exponent bias here (spoiler: it has to do with comparisons between floating-point numbers). This way I’ll be able to refer students to this article next time I teach this class!
Let’s start from the beginning with the representation of unsigned integers. Unsigned integers are integers that can hold a null or positive value.
The bits composing an unsigned integers directly represent their magnitude, by
adding the corresponding powers of two. So, for example, when considering 8-bit
word 01101000
as an unsigned integer, it gets interpreted as
$0*2^7 + 1*2^6 + 1*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 0*2^1 + 0*2^0 = 64 + 32 + 8 = 104$
in decimal.
Comparing the magnitudes of two unsigned words is conceptually straightforward.
Starting from the most significant bit (MSB), the first integer that has a 1
that the other doesn’t is the greater number. Here is an example between two
8-bit words that contain unsigned integers:
In practice, hardware comparators are able to compare all the bits of two N-bit
words at the same time (say, words A
and B
), and output whether A < B
, or
A > B
, or A == B
.
Here is an example of a 4-bit comparator:
Signed integers are integers that can hold a negative, null, or positive value.
The most common approach to encode signed integers is called two’s complement.
In this approach, the word’s MSB acts as a sign bit. If a signed word has its
MSB set to 0
, then it contains a positive value which can be decoded by simply
determining the magnitude represented by the remaining bits (just like the
unsigned interpretation). In that case, the sign bit itself carries no value
(i.e., it is not associated to a power of two), which makes sense since it’s
worth 0
anyway.
However, if the sign bit is 1
, then it is meant to represent a base value of
$-2^{w-1}$ where $w$ is the word size. The remaining $w-1$ bits are then
interpreted as an unsigned integer, and represent a (positive) offset from the
negative base value set by the sign bit.
Comparing two signed words is slightly more involved than with unsigned integers.
0
) is the greatest. We don’t even need to
compare any other bits.Here is an example of comparing two negative numbers:
Floating point numbers are typically represented using the IEEE 754 standard, in their binary normalized scientific notation: $\pm~M*2^E$.
For example, number $+1101.1001$, which represents $+ 2^3 + 2^2 + 2^0 + 2^{-1} + 2^{-4} = +13.5625$ in decimal, can be rewritten as $+1.1011001*2^3$ in its binary normalized scientific notation. The sign is positive ($+$), $M$ is known as the mantissa and only has one digit before the binary point ($1.1011001$), and the exponent $E$ (worth $3$ here) is the power of two multiplying the mantissa to adjust the binary point.
This is akin to representing rational decimal numbers using the normalized scientific notation. For instance, number $-4,321.768$ can be expressed as $-4.321,768 * 10^3$.
In single precision (i.e., float
in C), a floating point number is encoded in
a 32-bit word. In this format, the sign is expressed by the top bit, the exp
field on 8
bits is meant to represent the exponent $E$, and the frac
field
on 23
bits represents the fractional part of $M$.
If $E$ is negative, we can represent very tiny numbers, such as
$1.0*2^{-42}=0.000,000,000,000,227,373,675,443,232,1$. If $E$ is positive, we
can represent very large numbers, such as $1.0*2^{42}=4,398,046,511,104$. Since
exp
is on 8 bits, it gives 256 possible combinations that we can use to
represent a contiguous range of negative and positive numbers centered around
$0$. For example, if we assumed some standard two’s complement method, it could
represent range $[-128,127]$ (it’s just an example though, because it is not
what exp
represents).
Given a certain value $E$, all the combinations of frac
give $2^{23}$
equispaced values in the range $[2^E,2^{E+1})$. If $E$ is incremented by one, it
opens a new interval of $2^{23}$ equispaced values, which has no overlap with
the previous interval.
In terms of comparison, we can then already observe a few things. First, if two
numbers have opposite signs, then the positive number is automatically the
greatest. Otherwise, we have to then consider the signed value of $E$. That is,
between two floating-point numbers, the one with the greatest $E$ value is the
greater number. Finally, if both numbers have the same sign and the same $E$,
then the number with the greatest $M$, that is the greatest frac
field, is the
greater number.
$E$ is actually not directly stored in exp
as a signed integer, as
hypothesised above. Instead, it is stored as a “biased value”. This means that
$E$, which is meant to belong to a contiguous range of 256 negative and positive
numbers centered around 0, is offset by a bias in order to be stored in exp
as
a strictly positive value (i.e., an unsigned integer).
The bias for single-precision floating-point numbers (float
) is set to $127$.
So for instance, if, for a given float, the exp
field contains combination
00101010
(decoded as an unsigned integer as $42$), it would in fact represent
an exponent $E = 42 - 127 = -85$, which is negative. The float would be a rather
small number.
In this other direction, if we tried to represent a large floating point number
such as $1.frac * 2^{42}$ (we don’t care about the mantissa here), then $E$
would be equal to $42$, but it would be stored in field exp
as $42 + 127 =
169$ after being offset by the bias.
Why are we using this biased representation for $E$? Well, it has to do with being able to compare floating-point numbers very quickly and efficiently!
Let’s start by considering the case where $E$ was stored in exp
directly as a
signed integer, using the two’s complement method. In that case, the range of
$E$ would be $[-128, 127]$. If we had to compare two floats, it would be fairly
complex because we’d have to look at the sign bit, and then we’d have to apply
the comparison method for signed integers on the exp
field:
0
) is the greatest. We don’t even need to
compare any other bits.exp
field as signed integers (same technique as explained above).
0
) is the greatest.frac
field as unsigned integers. Whichever float has the largest magnitude is the
greater number.As you can see, we have to nest the signed comparison of the exponent, after having considered the sign of the floats themselves. Doing this type of comparison would require a specific, and complicated type of comparator.
Now, if we store the exponent of a floating-point number as a biased value, it becomes an unsigned integer, which considerably simplifies the comparison of two floats. In that case, the comparison becomes:
Hopefully, you’ve noticed that we can use the same type of comparator as for signed integers to compare floats, which makes things so much easier since we already have them in any standard processor!
By storing the exponent of a floating-point number as a biased value, we enable comparing floating-point numbers as if they were simple signed integers, that is using the same type of comparator.
]]>Here is our status at the end of the summer 2023.
xv88
, a fork of
xv6, which goal is to implement a
simple but realistic operating system that I can use in ECS 150, our OS
undergrad course.Here is our status at the end of the spring quarter 2023.
#include<cs>
has seen
its first new episode after an unfortunate three-year break (caused by the
pandemic)! This episode was produced by Saili Karkare and talks about the
impact of early CS education. It is available on the website or on your
favorite podcast app.I was recently invited to speak at a faculty panel event hosted by the Women in Computer Science (WiCS) at UC Davis. Since I had received a list of questions in advance, I had taken the opportunity to prepare some notes for the event. Now that the event has happened, I’ve expanded upon these notes, based on what I actually said during the event. I hope that someone will find these revised notes useful!
I have been at UC Davis for seven years! I first started in WQ17 as a temporary
part-time lecturer, initially to teach ECS 150, before quickly becoming a
full-time lecturer. A couple years later, I was hired for a faculty position.
It’s now been five years that I’m an Assistant Professor of Teaching, which is a
relatively new position in the UC system. My primary focus is on teaching
excellence, while my second focus is on research (which for me is geared towards
CS Education) – FYI, it is typically the other way around for regular
“research” professors, whose main focus is on research. As a faculty member, a
fair amount of my time is also spent on service duties, such as working on the
accreditations of our majors, hiring/reviewing lecturers, and a bunch of other
fun tasks.
Probably by a lucky mix of hard work and privilege.
They’re now long retired but my parents both graduated with a PhD and worked in academia during their entire career. As a kid, I used to spend a fair amount of time at my mom’s office, doing my homework, playing on her computer, and hanging out with her students and colleagues. When I became a college student myself some years later, it felt natural to embark on a PhD and pursue an academic career. It’s also been very useful all through my academic career thus far to be able to ask my parents for advice.
Now, don’t get me wrong; obtaining a PhD, holding multiple postdoc positions, being recruited in this job, etc. was really hard, and included working long hours, often suffering from insomnia, feeling miserable at times, etc.! But at least, I rarely felt like I didn’t belong, which removed a big burden that many people may otherwise experience.
I started by doing research in hardware security mechanisms. But after a PhD and a postdoc in this field, I realized that disciplinary research wasn’t for me and also found research in computer architecture frustrating. It is typically too expensive to implement anything physically, so research ideas are often developed in simulators only. I then pivoted towards kernel development, which was a lot more fun. The project of porting the Linux kernel to a novel 96-core processor architecture will always be one of my biggest achievements. With my new skills in kernel development, I worked in the industry for a little bit, and while it was a great experience, I had a hard time finding purpose working on industrial projects. That’s when I applied to UC Davis for a lecturer position, and found a passion for becoming an educator.
In France, our education system works very differently. As an undergrad, most of my work was done in class. I’d have lectures and various types of labs throughout the entire day. On average, I’d typically have class from 9-5 with a 1-hour lunch break. Unlike here, I’d have very little homework outside of class (especially if I was able to finish my labs within the allotted time, which was usually the case). Once class was over for the day, I’d have the entire evening to hang out with my friends, watch movies, play video games, walk around in Paris, etc. :)
It really depends on the day and on the quarter.
The days I’m teaching, I’ll typically spend most of the day on teaching-related tasks, such as preparing my lecture (reviewing my slides, and/or making some adjustments to them), holding a couple of office hours, publishing grades, sending announcements on Canvas, etc. I may also try to squeeze in some service-related tasks, such as participating in various committee meetings, writing documents, etc.
Since I usually teach three days a week (MWF), it leaves two days for research-related tasks. This quarter, I’ve used my Tuesdays to have most of my research meetings. This is when I meet with the students in my lab and discuss their progress on our projects. On Thursdays, I typically stay home and try my best not to schedule any meetings, so that I can fully focus on some research projects (or write an article for this website!).
Many things! :D
First, I like the overall purpose of my job. I truly enjoy being in the classroom and helping students learn about computer science so that one day they can have a successful career in this field. I also enjoy that all my research activities are focused on education, and how to make it more accessible and inclusive.
Second, in terms of logistics, I like the flexibility of this job and not having a boss. I’m regularly evaluated (every two years for merits, and on average every 5 to 6 years for promotions) so there are clear expectations to deliver results, such as being recognized as an excellent teacher, being involved in education-related research projects, etc. However, no one is over my shoulder every day. As long as I achieve these results, I have full control on my time and on the process I choose to follow.
Most of the classes that I teach are core courses in the CS curriculum: ECS 36C (data structures), ECS 50 (computer organization), ECS 150 (operating systems). I honestly love teaching all of them equally. It’s awesome to teach foundational topics to students and see them grow as computer scientist over the span of just one quarter.
I only teach one CS elective, which is ECS 158 (programming on parallel architectures). It’s a fun class to teach, especially since I often get the best students from ECS 150!
Luckily, I have not faced any discrimination in my career so far.
If ever I face some microagressions (e.g., having an accent and/or making language mistakes sometimes prompts people to make mocking comments), I typically try my best to confront my offender and let them know that I didn’t appreciate their comment(s).
I have had lots of work conflicts during my career. The best advice I’ve received is to have live conversations with people when there are issues to address. It’s especially easy to get upset and get into arguments online (e.g., over email, or chat), but a good, old face-to-face conversation usually does the trick to finding common grounds and solving conflicts.
Finally, we often talk about being on the receiving end of microagressions but we should also acknowledge that we’re sometimes the “aggressors” too. I’ve personally committed my fair share of microaggressions, and probably still do. So I try my very best to listen to people’s feedback and adjust my behavior accordingly. For example, I always read my course evaluations entirely and very carefully at the end of each quarter, and if I see that a number of students complain about the same thing (for instance, that I was unnecessarily harsh on the online forum for a particular class), I will try to think of ways I can prevent that from happening in the future.
Honestly, not so much. I admired many of my professors when I was a student and could tell how much work it seemed to represent. Now that I’m a professor, I feel like it matched what I expected.
It’s hard to answer. I’m so happy to be where I am today that I can’t regret any decisions I made. Even the numerous failures I experienced contributed to me landing here, so in many ways, they were useful failures!
If I really had to find one thing, I may say that I wish I had studied abroad earlier. My first experience abroad was in India, in between my master’s and PhD, and it was an eye opening experience between in a foreign country, speaking another language, and being surrounded by another culture. That’s what motivated me to apply for a postdoc in the US after my PhD, and eventually brought me here today.
I wish students asked me less questions about class and more questions about life in general!
There are so much more that professors can provide, beyond helping students on a particular homework. Whenever students approach me like I’m not (only) a resource towards their academic success, they quickly see that I’m also a human being with an interesting story to tell and a supportive ear. Among the many students who gave it a try over the years, I have occasionally formed meaningful friendships.
From my many interactions with female students (and even some of my own work on gender and class participation in CS classes), I know the struggle is unfortunately real.
I would encourage students to find a trusted mentor (like an older student, or a faculty) and/or make a tight group of STEM friends, and use them to support you throughout your CS journey. Whenever you have any doubts or face any hardships, you’ll have people to go for a friendly ear, advice, etc.
Unrelated to CS but since we’re in CA, I used to be into skateboarding a long long time ago! At the peak of my skateboarding abilities, I could do a 360-kickflip and I could ollie over 2 feet 🛹.
]]>