Hexbyte  News  Computers Micro-promotions and mentorship: the big impact of small actions in an engineering culture

Hexbyte News Computers Micro-promotions and mentorship: the big impact of small actions in an engineering culture

Hexbyte News Computers

Hexbyte  News  Computers Inclusion_Kindness.jpg

For the last decade, I have worked in male-dominated environments. While during this time I’ve encountered many nitwits and detractors, I’ve also been fortunate to encounter many proponents and advocates. Although no company is perfect, at CircleCI I’ve had opportunities to grow my career in an environment I enjoy. Some of that is thanks to me, and a good slug of that is thanks to my coworkers. They have mentored, sponsored, and advocated for me through a series of real, substantive, micro-promotions. Their actions make a difference. Regardless of who you are or what your organizational role is, your actions do too. An inclusive team is either strengthened or weakened by the gestures of each individual on it. Start small.

Note: If you are a leader, it is your responsibility to work deliberately towards creating environments that make every individual feel welcome. Self-directed employee actions do not constitute a comprehensive solution for solving the problems of diversity and inclusion in tech.

In roughly chronological order, here are specific things my team did that have made a difference in my career, and are worth emulating:

Justin sponsored me. He recommended me to the company and introduced me to Jeff, our VP of Engineering. He gave me a foot in the door.

Jeff took action when I expected none. Following a preliminary informational-interview lunch, he:

  1. Expressed remorse that he’d met me only after the closing of the latest hiring wave.
  2. Offered to put me in touch with some of his professional contacts.
  3. Actually put me in touch with some of his contacts.

At the time I was a recent coding bootcamp graduate and had few entrées into the tech world. Jeff provided more and ultimately offered me a job. Spoiler alert: I accepted.

During my first year at CircleCI, a host of my coworkers provided me with technical mentorship. Rishi kept our Kanban board populated with right-sized JIRAs for small-sized skills. My colleague An taught me how to dig into a problem, how to determine where to test it and not to be afraid of breaking things to fix them. Matt replied to naive questions with thoughtful explanations. Phil answered queries with complete histories, elucidating context, codebase histories, and the evolution of various popular programming belief-systems. He also uses Emacs, which is terrible, but nobody’s perfect.

On frustrating days (CircleCI is great, it’s not utopia) men like Tad, Eugene, and Kyle invited me on coffee walks to talk things out. They provided solid advice and new perspectives.

In that first year, my peers gave me the support, the challenging work, and the space to grow to a point where I could comfortably call myself a “software engineer” without doing an internal double-take.

My peers were patient with me that year (a tolerance I admittedly fostered by round-robining questions in order to spread the burden). Significantly, they also acknowledged the contributions I made. Acknowledgment doesn’t require a parade. These are small gestures that folks made that were meaningful to me:

  1. Using the :clap: emoji in a pull request comment to highlight a clever bit of my code.
  2. Sending a direct message of thanks upon realizing they were actively benefiting from a refactor I’d made to a previously gnarly bit of code.
  3. Posting a note to our #gratitude channel on Slack recognizing how helpful some documentation I’d written had been to them, and encouraging others to use it.

Despite all these positive interactions, there were also a limited number of times when things that people said or did were unprofessional, arguably out-of-line, and made me feel uncomfortable. In each situation, when I expressed my discomfort to my manager (or even when they realized I was becoming uncomfortable), they intervened without question. Sometimes being an ally means having someone’s back.

Sometimes it just means listening and learning when you’ve overstepped. In most cases, the antagonists were blissfully ignorant of the discomfort they’d caused, and sought to change their triggering behaviors. Expectations were set early and misbehavior was corrected before situations devolved.

Granted the respect and latitude I needed to progress, I entered my second year at CircleCI. Over that year, I faced new kinds of challenges. New coworkers, new team dynamics, new codebases, and my own expectations to level-up and to do it well. I was again lucky in my peers.

As I tried to understand more technical concepts, like how systems relate and what libraries to use and when, John aided my growth through regular pairing. He corrected my faulty assumptions and introduced me daily to new concepts and tools, all while typing furiously, flinging tmux sessions across the screen, and miraculously managing not to wake the one-year-old (his one-year-old) strapped to his chest. John also uses Emacs, which is terrible, but nobody’s perfect.

Later that year on Eric’s recommendation, I began acting as my team’s Delivery Review Lead, and soon after as our acting Team Lead. Once again, I was new to something and not especially talented at it. Once again, my coworkers provided me with the support, space, and challenges necessary to grow and gain confidence.

Nathan purposefully passed technical questions to me in meetings and provided guidance in navigating tricky situations. When I awkwardly joked about needing a laugh track for remote meetings (where participants are muted and audience feedback is difficult to gauge), Brady started playing one during particularly long pauses. Marc gave me crash courses in new codebases and told me, with his words, that he enjoyed working with me and appreciated the order I brought to our team.

In larger organization-wide meetings, Nate plus-oned my comments, giving me credit for my ideas and building on them to drive points home and improve deliverables. Bear nominated me for recognition for cross-team collaborative work. Pat thanked me for glue work.

In my time here I have messed things up, dropped the ball and caused incidents. With my coworkers, we’ve righted the incidents and blamelessly charted better paths forward. These incidents were treated as stand-alone events, mistakes that anyone could have made. I’m not uniquely gifted at causing failure, and nobody made me feel like I am.

Instead, I’ve felt mentored, sponsored and advocated for. Diversity is an ongoing challenge in our industry. Equalizing the imbalances can feel like a Sisyphean task. Start small. Comment on something you find clever in your next code review, ask a quiet coworker for their opinion during a meeting, give credit to folks whose ideas inspire you. Feeling ambitious? Tackle this game of bingo. Your actions make a difference, they build an inclusive environment where I and others want to work.

If you’d like to come make that difference with me, and to write some really cool code with some very smart people, check out our open job postings!

Read more:

Read More

Hexbyte  News  Computers Bézier Curves and Surfaces: the Utah Teapot

Hexbyte News Computers Bézier Curves and Surfaces: the Utah Teapot

Hexbyte News Computers

Bézier Curves and Surfaces: the Utah Teapot

Keywords: Bézier curve, Bézier surface, parametric surface, Utah teapot, Newell, Bernstein polynomials, quadratic, cubic, Bézier basis matrix, De Casteljau algorithm, tesselation, Taylor series, forward difference, Bézier patch normal.


Try out our new interactive applet at the bottom of this chapter.

Hexbyte News Computers Newell’s Teapot

Figure 1: Newell’s original drawing of the teapot.

In 1975, computer researcher Martin Newell needed a new 3D model for his work. In these days of age, very few models where available to the computer graphics community and creating them was also far from easy. Most models had to get their points entered in the computer program by hand or with a graphics tablet (“a computer input device that allows hand-drawn images and graphics to be input. It may be used to trace an image from a piece of paper laid on the surface. Capturing data in this way is called digitizing”). The story goes that Newell drew a teapot he had at home and digitized these drawings to create the model we know today as the Utah Teapot (figure 1). The teapot is now usually available in rendering or modeling programs along with other geometric primitives, such as spheres, cubes, tori, etc. The walking teapot toys given by Pixar at SIGGRAPH since 2003 in tribute to Newell’s work and his iconic teapot, have even become a cult phenomenon (figure 2).

Figure 2: Pixar’s RenderMan walking teapot. A tribute to Newell’s work and iconic teapot.

One of the interesting properties of the teapot created by Newell is that the mathematical model used to define the surface of the object is very compact. The teapot contains 32 patches each defined by 16 points (the original data set contains 28 patches). You might wonder: “how it is possible to create a complex and smooth shape such as the teapot with such few points?”. The main idea of the technique is that these 16 points do not define the vertices of polygons as with the polygon mesh we have studied in the previous section. They represent the control points of something like a grid or lattice that influence the shape of an underlying smooth surface. You can see these points as magnets that push or pull the underlying surface. The surface itself actually doesn’t exist as such. To visualise it, we need to compute it by combining together these 16 controls point weighted by some coefficients. Because the creation of the surface is based on equations it falls under the category of parametric surfaces. The model used by Newell for the teapot (as many other types of parametric surface exist) is called a Bézier surface (or Bézier curve for curves). It was first described by Pierre Bézier in 1962. The principle of this technique is easier to understand with curves than with surfaces. Its application to 3D surfaces though is straightforward.

Hexbyte News Computers Bézier Curve

To create a Bézier curve we only need 4 points. These point are control points defined in 3D space. As with surfaces, the curve itself doesn’t exist until we compute it by combining these 4 points weighted by some coefficients.

Figure 3: a Bézier curve and its 4 control points.

How do we compute this curve? Parametric curves are curves which are defined by an equation. As with every equation, this equation has a variable, which in the case of parametric curve, is called a parameter. Generally, this parameter is given the letter (t). In figure 4 for example, we have plotted the equation of a parabola (y=t^2). As with the example of the parabola, (t) doesn’t have to be contained within any specific range. It can as well go from minus to plus infinity. In the case of a Bezier curve though, we will only need value of t going from 0 to 1.

Figure 4: example of a parametric curve (plot of a parabola).

Evaluating the curve’s equation for values of (t) going from 0 to 1, is sort of the same as walking along the curve. It is important to understand that (t) is a scalar but that the result of the equation for any (t) contained in the range [0:1] is a position in 3D space (for 3D curves, and obviously a 2D point for 2D curves). In other words, if we need to visualise a parametric curve, all we have to do is to evaluate the curve’s equation for increasing values of (t) at some regular positions (it doesn’t have to be though), and connecting the resulting positions in space to create a polygonal path (as illustrated in figure 5).

Figure 5: legend a curve can be approximated by connecting a finite number of points on the curve using line segments to create a polygonal path.

With only 4 segments we can start to see what the overall shape of the curve looks like. To get a smoother result all there is to do is to increase the number of points and segments. This is in essence, how we will build and visualize Bézier curves. We will sample it at regular intervals and connect the point to create a series of connected line segments. The question now is how do we compute these positions? We mentioned before that shape of the curve was the result of the combining the control points weighted by some value (equation 1):

$$P_{curve}(t) = P1 * k_1 + P2 * k_2 + P3 * k_3 + P4 * k_4$$

where P1, P2, P3, P4 are the Bézier control points and (k_1), (k_2), (k_3), (k_4) are coefficients (scalar) weighting the contribution of the control points. Looking at figure 3, intuitively you can see that when (t) = 0, the first point on the curve coincides with the control point P1 (for (t) = 1, the end point coincides with P4). In other words you can write that:

P_{curve}(t) = left{
P_{curve}(0)= P1 * 1 + P2 * 0 + P3 * 0 + P4 * 0\
P_{curve}(1)= P1 * 0 + P2 * 0 + P3 * 0 + P4 * 1\

Now the parameter (t) appears nowhere in these equations. The value of (t) is actually used to compute the coefficients (k_1), (k_2), (k_3), (k_4) themselves with the following set of equations (equation 2):

k_1(t) = (1 – t) * (1 – t) * (1 – t)\
k_2(t) = 3(1 – t)^2 * t\
k_3(t) = 3(1 – t) * t^2\
k_4(t) = t^3

When we need to evaluate a position on the curve for a particular (t), we need to replace (t) in these four equations to compute the four coefficients (k_1), (k_2), (k_3), (k_4) which are then multiplied to the four control points. That gives us a position in 3D space for a given value of (t). If we wish to create a polygon path made out of 10 segments for instance, we compute 11 points by regularly incrementing (t) by 1/10. The following code example would compute these 11 positions along the curve:

int numSegments = 10;
for (int i = 0; i <= numSegments; ++i) { float t = i / (float)numSegments; // compute coefficients float k1 = (1 - t) * (1 - t) * (1 - t); float k2 = 3 * (1 - t) * (1 - t) * t; float k3 = 3 * (1 - t) * t * t; float k4 = t * t * t; // weight the four control points using coefficients point Pt = P1 * k1 + P2 * k2 + P3 * k3 + P4 * k4; }

Hexbyte  News  Computers

Figure 6: