<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dan Dascalescu</title>
    <description>The latest articles on DEV Community by Dan Dascalescu (@dandv).</description>
    <link>https://dev.to/dandv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F96354%2F7f5fa927-e780-4974-bd27-b6a8502bc376.jpg</url>
      <title>DEV Community: Dan Dascalescu</title>
      <link>https://dev.to/dandv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dandv"/>
    <language>en</language>
    <item>
      <title>How to choose a vector database: Pinecone, Weaviate, MongoDB Atlas, SemaDB</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 11 Sep 2024 14:09:15 +0000</pubDate>
      <link>https://dev.to/dandv/how-to-choose-a-vector-database-pinecone-weaviate-mongodb-atlas-semadb-a09</link>
      <guid>https://dev.to/dandv/how-to-choose-a-vector-database-pinecone-weaviate-mongodb-atlas-semadb-a09</guid>
      <description>&lt;p&gt;While building a RAG application to search through my extensive public bookmarks collection (~15,000+ items collected since 2006), I looked in more or less detail at some of the available vector database solutions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Pinecone - a SaaS offering that only stores vectors&lt;/li&gt;
&lt;li&gt;  Weaviate - an open-source vector DB with optional cloud hosting&lt;/li&gt;
&lt;li&gt;  SemaDB - a new entrant in the space, open-source&lt;/li&gt;
&lt;li&gt;  MongoDB Atlas - a mature document-oriented database that has &lt;a href="https://www.mongodb.com/blog/post/introducing-atlas-vector-search-build-intelligent-applications-semantic-search-ai" rel="noopener noreferrer"&gt;added vector search in June 2023&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Milvus - open source + &lt;a href="https://zilliz.com/cloud" rel="noopener noreferrer"&gt;cloud offering by Zilliz&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Vespa, Qdrant, Chroma, &lt;a href="https://vald.vdaas.org/" rel="noopener noreferrer"&gt;Vald&lt;/a&gt;, FAISS (a vector search &lt;em&gt;engine&lt;/em&gt;, not a database)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My requirements were flexible, but looking at the entire landscape helped narrow them down. When comparing a relatively large number of offerings, some choices become clearer, and the search space can be rapidly reduced. For example if two products seem largely similar but one doesn't have an important feature you (may) need, it's easy to pick the other one.&lt;/p&gt;

&lt;p&gt;Thus, my requirements were refined to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Open source, to avoid vendor lock-in. This disqualified Pinecone.&lt;/li&gt;
&lt;li&gt;  Single source of truth for the documents (bookmarks) and the vectors. This further disqualified Pinecone, which is centered around vectors and regards "metadata" as a secondary object associated with the vectors&lt;/li&gt;
&lt;li&gt;  Mature. This disqualified SemaDB, though it's a highly promising solution, and one of the only two that &lt;a href="https://github.com/Semafind/semadb/issues/13" rel="noopener noreferrer"&gt;supports nested documents&lt;/a&gt; (the other one being MongoDB). Take a look at &lt;a href="https://semadb.com/docs/search/kitchen/" rel="noopener noreferrer"&gt;SemaDB's powerful search capabilities&lt;/a&gt;!&lt;/li&gt;
&lt;li&gt;  Notably, performance wasn't a goal, given the small dataset size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also when comparing a large number of offerings, it's easy to dismiss products on more "superficial" grounds. For instance, Milvus presents with shoddy English in its documentation, and relatively scary complexity, and it's not clear what it would bring over Weaviate, so Weaviate wins.&lt;/p&gt;

&lt;p&gt;That leaves us with Weaviate and MongoDB Atlas. It's unclear if &lt;a href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/" rel="noopener noreferrer"&gt;Atlas vector search&lt;/a&gt; can be run on-prem, or if &lt;a href="https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start/" rel="noopener noreferrer"&gt;MongoDB's cloud offering must be used&lt;/a&gt;. I've asked their documentation AI this very question, but it replied that it doesn't know. It didn't even point to &lt;a href="https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local/" rel="noopener noreferrer"&gt;Creating local Atlas deployments&lt;/a&gt;. That page says "You should use local deployments for testing and development only."&lt;/p&gt;

&lt;p&gt;While Atlas does have a &lt;a href="https://www.mongodb.com/pricing" rel="noopener noreferrer"&gt;free tier&lt;/a&gt;, Weaviate can be run on-prem, with a single binary even. Looks like we have a pretty clear winner.&lt;/p&gt;

&lt;p&gt;Of course, Weaviate isn't without its problems. The TypeScript and Python clients aren't fully crystallized (both moved very recently moved to new major versions that deprecate the previous ones), documentation on &lt;a href="https://forum.weaviate.io/t/how-to-run-weaviate-using-a-binary/100/5" rel="noopener noreferrer"&gt;running Weaviate on-prem without Docker is mysteriously lacking&lt;/a&gt;, and &lt;a href="https://github.com/weaviate/weaviate/issues/created_by/dandv" rel="noopener noreferrer"&gt;issues that have relatively simple fixes&lt;/a&gt; take a long time to get resolved.&lt;/p&gt;

</description>
      <category>vectordatabase</category>
      <category>rag</category>
      <category>ai</category>
    </item>
    <item>
      <title>The 5 settings to change in WebStorm right after installation</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Fri, 02 Jun 2023 14:48:22 +0000</pubDate>
      <link>https://dev.to/dandv/top-10-settings-for-webstorm-37fg</link>
      <guid>https://dev.to/dandv/top-10-settings-for-webstorm-37fg</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Map debugging keys to the &lt;a href="https://developer.chrome.com/docs/devtools/shortcuts/"&gt;shortcuts from Chrome&lt;/a&gt;, which can't be changed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step Over: F10&lt;/li&gt;
&lt;li&gt;Step Into: F11&lt;/li&gt;
&lt;li&gt;Resume: F8&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Editor -&amp;gt; Inlay Hints -&amp;gt; Position: Right, so you don't create a new line for the committer or number of usages of functions/methods&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206596255/comments/11397209581074"&gt;Disable reformatting on paste&lt;/a&gt;:&lt;br&gt;
Editor -&amp;gt; General -&amp;gt; Smart Keys -&amp;gt; Reformat on paste: None&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Editor -&amp;gt; General -&amp;gt; Tabs -&amp;gt; Mark modified (*)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.tojetbrains://WebStorm/settings?name=Editor--Code+Style--TypeScript"&gt;Editor -&amp;gt; Code Style -&amp;gt; TypeScript&lt;/a&gt;: use single quotes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you work with Markdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
Editor -&amp;gt; General -&amp;gt; Soft wraps -&amp;gt; Soft-wrap these files: add &lt;code&gt;.mdx&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;(&lt;a href="https://blog.jetbrains.com/webstorm/2023/01/webstorm-2023-1-eap-1/#new_smart_keys_settings_page_for_markdown"&gt;New&lt;/a&gt; in WebStorm 2023.1.2) Disable Markdown table reformatting on typing (if you don't want to create large diffs when updating just a few characters in a table that's formatted differently from how WebStorm would like):
Uncheck Editor -&amp;gt; General -&amp;gt; Smart Keys -&amp;gt; Markdown -&amp;gt; Reformat table when pasting
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Understanding vector embeddings</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 05 Apr 2023 08:59:07 +0000</pubDate>
      <link>https://dev.to/dandv/understanding-vector-embeddings-18p0</link>
      <guid>https://dev.to/dandv/understanding-vector-embeddings-18p0</guid>
      <description>&lt;p&gt;Originally published on the &lt;a href="https://weaviate.io/blog/vector-embeddings-explained"&gt;Weaviate blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ever wondered how search engines find what you mean, not just the keywords you type?&lt;/p&gt;

&lt;p&gt;Searching by the meaning of text, or by what objects are contained in images, is also called "semantic search". This is essentially a search by similarity, as opposed to keyword search.&lt;/p&gt;

&lt;p&gt;For example, consider a library of wine names and descriptions, one of which mentioning that the wine is “good with &lt;strong&gt;fish&lt;/strong&gt;”. A “wine for &lt;strong&gt;seafood&lt;/strong&gt;” keyword search, or even a synonym search, won’t find that wine. A meaning-based search should understand that “fish” is similar to “seafood”, and “good with X” means the wine is “for X”—and should find the wine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7cduwsTW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbtprqu8l09ow2eojxvt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7cduwsTW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbtprqu8l09ow2eojxvt.png" alt="Semantic vs. vector search" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How can computers mimic our understanding of language, and similarities of words or paragraphs? To tackle this problem, semantic search uses at its core a data structure called &lt;strong&gt;vector embedding&lt;/strong&gt; (or simply, &lt;strong&gt;vector&lt;/strong&gt; or &lt;strong&gt;embedding&lt;/strong&gt;), which is an array of numbers. A &lt;a href="https://weaviate.io/blog/vector-library-vs-vector-database"&gt;vector database&lt;/a&gt; like Weaviate (the startup I'm a Developer Advocate at) will compute an embedding for each data object as it is inserted or updated into the database. The embeddings are placed into an index, so that the database can &lt;a href="https://weaviate.io/blog/why-is-vector-search-so-fast"&gt;quickly&lt;/a&gt; find the &lt;a href="https://weaviate.io/blog/distance-metrics-in-vector-search"&gt;closest&lt;/a&gt; vectors to a given vector that will be computed for the query.&lt;/p&gt;

&lt;h2&gt;
  
  
  What exactly are vector embeddings?
&lt;/h2&gt;

&lt;p&gt;Vectors are numeric representations of data that capture certain features of the data. For example, in the case of text data, “cat” and “kitty” have similar meaning, even though the &lt;em&gt;words&lt;/em&gt; “cat” and “kitty” are very different if compared letter by letter. For semantic search to work effectively, representations of “cat” and “kitty” must sufficiently capture their semantic similarity. This is where vector representations are used, and why their derivation is so important.&lt;/p&gt;

&lt;p&gt;In practice, vectors are arrays of real numbers, of a fixed length (typically from hundreds to thousands of elements), generated by machine learning models. The process of generating a vector for a data object is called vectorization. Weaviate generates vector embeddings using &lt;a href="https://weaviate.io/developers/weaviate/modules"&gt;modules&lt;/a&gt;, and conveniently stores both objects and vectors in the same database. For example, vectorizing the two words above might result in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat = [1.5, -0.4, 7.2, 19.6, 3.1, ..., 20.2]
kitty = [1.5, -0.4, 7.2, 19.5, 3.2, ..., 20.8]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These two vectors have a very high similarity. In contrast, vectors for “banjo”, or “comedy” would not be very similar to either of these vectors. To this extent, vectors capture the semantic similarity of words.&lt;/p&gt;

&lt;p&gt;Now that you’ve seen what vectors are, and that they can represent meaning to some extent, you might have further questions. For one, what does each number represent? That depends on the machine learning model that generated the vectors, and isn’t necessarily clear, at least in terms of our human conception of language and meaning. But we can sometimes gain a rough idea by correlating vectors to words with which we are familiar.&lt;/p&gt;

&lt;p&gt;Vector-based representation of meaning caused quite a &lt;a href="https://www.ed.ac.uk/informatics/news-events/stories/2019/king-man-woman-queen-the-hidden-algebraic-struct"&gt;stir&lt;/a&gt; a few years back, with the revelation of mathematical operations between words. Perhaps &lt;em&gt;the&lt;/em&gt; most famous result was that of&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;“king − man + woman ≈ queen”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It indicated that the difference between “king” and “man” was some sort of “royalty”, which was analogously and mathematically applicable to “queen” minus “woman”. Jay Alamar provided a helpful &lt;a href="https://jalammar.github.io/illustrated-word2vec/"&gt;visualization&lt;/a&gt; around this equation. Several concepts (“woman”, “girl”, “boy” etc.) are vectorized into (represented by) an array of 50 numbers generated using the &lt;a href="https://en.wikipedia.org/wiki/GloVe"&gt;GloVe model&lt;/a&gt;. In &lt;a href="https://en.wikipedia.org/wiki/Vector_(mathematics)"&gt;vector terminology&lt;/a&gt;, the 50 numbers are called dimensions. The vectors are visualized using colors and arranged next to each word:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wfjNCq0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7knakd62nj5rdc1irot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wfjNCq0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7knakd62nj5rdc1irot.png" alt="vector embeddings visualization" width="800" height="412"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Credit: Jay Alamar&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We can see that all words share a dark blue column in one of the dimensions (though we can’t quite tell what that represents), and the word “water” &lt;em&gt;looks&lt;/em&gt; quite different from the rest, which makes sense given that the rest are people. Also, “girl” and “boy” look more similar to each other than to “king” and “queen” respectively, while “king” and “queen” look similar to each other as well.&lt;/p&gt;

&lt;p&gt;So we can &lt;em&gt;see&lt;/em&gt; that these vector embeddings of words align with our intuitive understanding of meaning. And even more amazingly, vector embeddings are not limited to representing meanings of words.&lt;/p&gt;

&lt;p&gt;In fact, effective vector embeddings can be generated from any kind of data object. Text is the most common, followed by images, then audio (this is how Shazam recognizes songs based on a short and even noisy audio clip), but also time series data, 3D models, video, molecules etc. Embeddings are generated such that two objects with similar semantics will have vectors that are "close" to each other, i.e. that have a "small" distance between them in &lt;a href="https://en.wikipedia.org/wiki/Vector_space_model"&gt;vector space&lt;/a&gt;. That &lt;a href="https://weaviate.io/blog/distance-metrics-in-vector-search"&gt;distance can be calculated in multiple ways&lt;/a&gt;, one of the simplest being "The sum of the absolute differences between elements at position &lt;code&gt;i&lt;/code&gt; in each vector" (recall that all vectors have the same fixed length).&lt;/p&gt;

&lt;p&gt;Let's look at some numbers (no math, promise!) and illustrate with another text example:&lt;/p&gt;

&lt;p&gt;Objects (data): words including &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;dog&lt;/code&gt;, &lt;code&gt;apple&lt;/code&gt;, &lt;code&gt;strawberry&lt;/code&gt;, &lt;code&gt;building&lt;/code&gt;, &lt;code&gt;car&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Search query: &lt;code&gt;fruit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A set of simplistic vector embeddings (with only 5 dimensions) for the objects and the query could look something like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Word&lt;/th&gt;
&lt;th&gt;Vector embedding&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[1.5, -0.4, 7.2, 19.6, 20.2]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dog&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[1.7, -0.3, 6.9, 19.1, 21.1]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apple&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[-5.2, 3.1, 0.2, 8.1, 3.5]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;strawberry&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[-4.9, 3.6, 0.9, 7.8, 3.6]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;building&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[60.1, -60.3, 10, -12.3, 9.2]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;car&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[81.6, -72.1, 16, -20.2, 102]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q: &lt;code&gt;fruit&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[-5.1, 2.9, 0.8, 7.9, 3.1]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If we look at each of the 5 elements of the vectors, we can see quickly that &lt;code&gt;cat&lt;/code&gt; and &lt;code&gt;dog&lt;/code&gt; are much closer than &lt;code&gt;dog&lt;/code&gt; and &lt;code&gt;apple&lt;/code&gt; (we don’t even need to calculate the distances). In the same way, &lt;code&gt;fruit&lt;/code&gt; is much closer to &lt;code&gt;apple&lt;/code&gt; and &lt;code&gt;strawberry&lt;/code&gt; than to the other words, so those will be the top results of the “fruit” query.&lt;/p&gt;

&lt;p&gt;But where do these numbers come from? That’s where the real magic is, and where advances in modern deep learning have made a huge impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  How are vector embeddings generated?
&lt;/h2&gt;

&lt;p&gt;The magic of vector search resides primarily in how the embeddings are generated for each entity and the query, and secondarily in how to efficiently search within very large datasets (see our &lt;a href="https://weaviate.io/blog/why-is-vector-search-so-fast"&gt;“Why is Vector Search so Fast”&lt;/a&gt; article for the latter).&lt;/p&gt;

&lt;p&gt;As we mentioned, vector embeddings can be generated for various media types such as text, images, audio and others. For text, vectorization techniques have evolved tremendously over the last decade, from the venerable &lt;a href="https://en.wikipedia.org/wiki/Word2vec"&gt;word2vec&lt;/a&gt; (&lt;a href="https://code.google.com/archive/p/word2vec/"&gt;2013&lt;/a&gt;), to the state-of-the-art transformer models era, spurred by the release of &lt;a href="https://en.wikipedia.org/wiki/BERT_(language_model)"&gt;BERT&lt;/a&gt; in &lt;a href="https://ai.googleblog.com/2018/11/open-sourcing-bert-state-of-art-pre.html"&gt;2018&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Word-level dense vector models (word2vec, GloVe, etc.)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://wiki.pathmind.com/word2vec"&gt;word2vec&lt;/a&gt; is a &lt;a href="https://www.tensorflow.org/tutorials/text/word2vec"&gt;family of model architectures&lt;/a&gt; that introduced the idea of “dense” vectors in language processing, in which all values are non-zero.&lt;/p&gt;

&lt;p&gt;Word2vec in particular uses a neural network &lt;a href="https://arxiv.org/pdf/1301.3781.pdf"&gt;model&lt;/a&gt; to learn word associations from a large corpus of text (it was initially trained by Google with 100 billion words). It first creates a vocabulary from the corpus, then learns vector representations for the words, typically with 300 dimensions. Words found in similar contexts have vector representations that are close in vector space, but each word from the vocabulary has only one resulting word vector. Thus, the meaning of words can be quantified - “run” and “ran” are recognized as being far more similar than “run” and “coffee”, but words like “run” with multiple meanings have only one vector representation.&lt;/p&gt;

&lt;p&gt;As the name suggests, word2vec is a word-level model and cannot by itself produce a vector to represent longer text such as sentences, paragraphs or documents. However, this can be done by aggregating vectors of constituent words, which is often done by incorporating weightings such that certain words are weighted more heavily than others.&lt;/p&gt;

&lt;p&gt;However, word2vec still suffers from important limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it doesn’t address words with multiple meanings (polysemantic): “run”, “set”, “go”, or “take” each have &lt;a href="https://www.insider.com/words-with-the-most-definitions-2019-1"&gt;over 300 meanings&lt;/a&gt; (!)&lt;/li&gt;
&lt;li&gt;it doesn’t address words with ambiguous meanings: “to consult” can be its own antonym, like many other words&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which takes us to the next, state-of-the-art, models.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transformer models (BERT, ELMo, and others)
&lt;/h3&gt;

&lt;p&gt;The current state-of-the-art models are based on what’s called a “transformer” architecture as introduced in &lt;a href="https://arxiv.org/abs/1706.03762"&gt;this paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Transformer_(machine_learning_model)"&gt;Transformer models&lt;/a&gt; such as BERT and its successors improve search accuracy, &lt;a href="https://en.wikipedia.org/wiki/Precision_and_recall"&gt;precision and recall&lt;/a&gt; by looking at every word’s context to create full contextual embeddings (though &lt;a href="https://aclanthology.org/D19-1445/"&gt;the exact mechanism of BERT’s success is not fully understood&lt;/a&gt;). Unlike word2vec embeddings which are context-agnostic, transformer-generated embeddings take the entire input text into account—each occurrence of a word has its own embedding that is modified by the surrounding text. These embeddings better reflect the polysemantic nature of words, which can only be disambiguated when they are considered in context.&lt;/p&gt;

&lt;p&gt;Some of the potential downsides include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;increased compute requirements: fine-tuning transformer models is much slower (on the order of hours vs. minutes)&lt;/li&gt;
&lt;li&gt;increased memory requirements: context-sensitivity greatly increases memory requirements, which often leads to limited possible input lengths&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Despite these downsides, transformer models have been wildly successful. Countless text vectorizer models have proliferated over the recent past. Plus, many more vectorizer models exist for other data types such as audio, video and images, to name a few. Some models, such as &lt;a href="https://openai.com/blog/clip/"&gt;CLIP&lt;/a&gt;, are capable of vectorizing multiple data types (images and text in this case) into one vector space, so that an image can be searched by its content using only text.&lt;/p&gt;

&lt;h4&gt;
  
  
  Vector embeddings with Weaviate
&lt;/h4&gt;

&lt;p&gt;For this reason, Weaviate is configured to support many different vectorizer models and vectorizer service providers. You can even bring your own vectors, for example if you already have a vectorization pipeline available, or if none of the publicly available models are suitable for you.&lt;/p&gt;

&lt;p&gt;For one, Weaviate supports using any Hugging Face models through our &lt;code&gt;text2vec-hugginface&lt;/code&gt; module, so that you can &lt;a href="https://weaviate.io/blog/how-to-choose-a-sentence-transformer-from-hugging-face"&gt;choose one of the many sentence transformers published on Hugging Face&lt;/a&gt;. Or, you can use other very popular vectorization APIs such as OpenAI or Cohere through the &lt;a href="https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai"&gt;&lt;code&gt;text2vec-openai&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-cohere"&gt;&lt;code&gt;text2vec-cohere&lt;/code&gt;&lt;/a&gt; modules. You can even run transformer models locally with &lt;a href="https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-transformers"&gt;&lt;code&gt;text2vec-transformers&lt;/code&gt;&lt;/a&gt;, and modules such as &lt;a href="https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-clip"&gt;&lt;code&gt;multi2vec-clip&lt;/code&gt;&lt;/a&gt; can convert images and text to vectors using a CLIP model.&lt;/p&gt;

&lt;p&gt;But they all perform the same core task—which is to represent the “meaning” of the original data as a set of numbers. And that’s why semantic search works so well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay Connected
&lt;/h2&gt;

&lt;p&gt;Thank you so much for reading! If you'd like to learn more about Weaviate, the open source vector database / semantic search engine, please check us out at &lt;a href="https://weaviate.io"&gt;weaviate.io&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>vectors</category>
      <category>embeddings</category>
      <category>ai</category>
    </item>
    <item>
      <title>The best sleep hygiene guidelines</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 22 Sep 2021 14:30:48 +0000</pubDate>
      <link>https://dev.to/dandv/the-best-sleep-hygiene-guidelines-5ghl</link>
      <guid>https://dev.to/dandv/the-best-sleep-hygiene-guidelines-5ghl</guid>
      <description>&lt;p&gt;Sleep is key for cognitive performance, which is key for being a successful software developer. Over the past 15 years, I've been consuming a lot of materials regarding sleep optimization, I've used some of the best consumer-grade sleep trackers (QS Emfit, Oura), and put together a summary of the best practices I have for optimizing sleep. 💤 Here we go: 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  Sleep Environment
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;No partner or pets in bed, or if a partner is a must, use an extra large bed and separate quilts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quiet&lt;/strong&gt; bedroom; earplugs are great at reducing ambient noise. Some people prefer white noise machines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cool&lt;/strong&gt; bedroom. The optimal sleep temperature is around 65F.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dark&lt;/strong&gt; bedroom. Blackout curtains work very well.&lt;/li&gt;
&lt;li&gt;Dim lights in the evening.&lt;/li&gt;
&lt;li&gt;This is less important than dimming lights, and more controversial, but see if it helps: reduce blue light exposure past sunset. Use apps/settings like "Night mode", or wear blue light blocking glasses.&lt;/li&gt;
&lt;li&gt;Invest in a quality mattress, and sleep on the same bed, slightly harder than what you'd intuitively select. My favorites nowadays are the Helix mattress (tested) and Purple (not tested, but felt even better than Helix in store).&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Timing
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Consistent time to go to sleep AND wake up. Even on weekends. (Details on the circadian rhythm from &lt;a href="https://drive.google.com/file/d/1gKsDmxyoZZxGmz_zaC_mQgjCAShxg75H/view"&gt;Menno Henselmans&lt;/a&gt; and &lt;a href="https://dev.to/dandv/better-sleep-for-programmers-according-to-andrew-huberman-4ajd"&gt;Andrew Huberman&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;If you're trying to shift your schedule earlier (which may &lt;a href="https://youtu.be/qAIT2nmqYd4?t=234"&gt;improve mental health and performance&lt;/a&gt;), do so in at most 30-minute increments (unless you're dead-tired). I've found myself many time trying to go to bed an hour or more earlier, only to be unable to fall asleep. Melatonin may (&lt;a href="https://www.gwern.net/Melatonin"&gt;Gwern&lt;/a&gt;) or may now (Huberman) help or be indicated.&lt;/li&gt;
&lt;li&gt;Bright light exposure as soon as possible after waking up, e.g. have breakfast by the window, walk outside. Note that Huberman cites research showing that glass reduces the effectiveness of light on circadian rhythm regulation by 50x (!). That means you'd need 10 minutes outside, or 500 minutes (a full workday) by the window to achieve the same benefits.&lt;/li&gt;
&lt;li&gt;No snoozing. When it's time to wake up, wake up.&lt;/li&gt;
&lt;li&gt;Avoid exercising 4 hours before sleep. [With the exception of sex]&lt;/li&gt;
&lt;li&gt;Avoid stimulation before sleep, such as reading news, or having stressful interactions. Best to read a physical book (or an electronic one in dark mode) until you notice you slightly lose focus. Slightly boring books help.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://news.utexas.edu/2019/07/19/take-a-warm-bath-1-2-hours-before-bedtime-to-get-better-sleep-researchers-find/"&gt;Showering/bath 1-2 hours&lt;/a&gt; before sleep may help.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Food/supplements
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Avoid caffeine 8 hours before sleep, or longer if you're particularly sensitive to it.&lt;/li&gt;
&lt;li&gt;Avoid alcohol before sleep. It may help with falling asleep, but reduces sleep quality.&lt;/li&gt;
&lt;li&gt;Ideally, avoid heavy meals several hours before sleep.&lt;/li&gt;
&lt;li&gt;Carbs may help with sleep, so target them for dinner.&lt;/li&gt;
&lt;li&gt;Experiment with melatonin, from 0.1 to 10g. Sensitivity is highly individual.&lt;/li&gt;
&lt;li&gt;Avoid sleeping pills. They may help fall asleep faster, but the expense of quality.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Further resources
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;My summary of an &lt;a href="https://pinboard.in/u:dandv/b:a98ad9f26b4f"&gt;excellent talk at Google&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.artofmanliness.com/articles/how-to-get-a-good-nights-sleep/"&gt;Art of Manliness on sleep&lt;/a&gt; (note that intermittent fasting may or may not work, by increasing cortisol)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fastcompany.com/3057465/why-six-hours-of-sleep-is-as-bad-as-none-at-all"&gt;Why 6 hours of sleep/night is surprisingly bad&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Better sleep for programmers, according to Andrew Huberman</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 22 Sep 2021 14:25:27 +0000</pubDate>
      <link>https://dev.to/dandv/better-sleep-for-programmers-according-to-andrew-huberman-4ajd</link>
      <guid>https://dev.to/dandv/better-sleep-for-programmers-according-to-andrew-huberman-4ajd</guid>
      <description>&lt;p&gt;One &lt;a href="https://twitter.com/hillelogram/status/1119709859979714560"&gt;controversial opinion&lt;/a&gt; in software is that your sleep quality and stress level matter far, far more than the languages you use or the practices you follow. Nothing else comes close: not type systems, not TDD, not formal methods, not ANYTHING.&lt;/p&gt;

&lt;p&gt;This is my summary of &lt;a href="https://www.youtube.com/channel/UC2D2CMWXMOVWx7giW1n3LIg"&gt;Andrew Huberman&lt;/a&gt;'s &lt;a href="https://www.youtube.com/watch?v=nm1TxQj9IsQ"&gt;Master Your Sleep &amp;amp; Be More Alert When Awake | Huberman Lab Podcast #2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My comments are [between square brackets]. Quotes are approximate.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TL;DR: view sunlight outside for 2 to 10 minutes in the morning, as early as possible, and before sunset. The spectral composition of low-angle sunlight controls the circadian rhythm much more than food or exercise. Avoid bright lights in the evening (or at least blue-ish lights), especially between 11pm and 4am. To fall asleep faster, practice Yoga Nidra, meditation, and &lt;a href="https://www.reveri.com/about"&gt;sleep hypnosis&lt;/a&gt;, and use compounds if you need to: magnesium 300-400mg and theanine - 100-200mg 30-60m before sleep.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;See my other post for the &lt;a href="https://dev.to/dandv/the-best-sleep-hygiene-guidelines-5ghl"&gt;most effective sleep hygiene tips&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Salient quotes
&lt;/h2&gt;

&lt;p&gt;"Sponsored by Helix mattress" [I slept on one for a moth, very good actually.]&lt;/p&gt;

&lt;p&gt;"Most people wake up about when the sun rises, maybe 1 or 2 hours later" [Not us programmers...]&lt;/p&gt;

&lt;p&gt;"Get 2-10 minutes of sunlight exposure regularly, as early in the morning as you can, &lt;strong&gt;outside&lt;/strong&gt;. Early in the day, your retina is not as sensitive, so it needs a lot of sunlight photons to set clock mechanisms. Sunrise light intensity &amp;amp; color temperature (from sun being low in the sky) is ideal to set our circadian and hormonal rhythm. Outside light intensity is &lt;a href="https://en.wikipedia.org/wiki/Lux#Illuminance"&gt;~1000x higher&lt;/a&gt; than indoors."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"It's 50x less effective to view the low-angle morning sunlight through a window"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[THAT would be the paradigm shift for me. I've known about light as a trigger of the circadian rhythm for decades, and got it through the window, e.g. by having breakfast by the window. But if you need 10 minutes of direct sunlight, you'd need 500 minutes through glass, i.e. 8 hours by the window. Might happen in an office setting, or might not. As to how accurate the "50x" figure is, that's &lt;a href="https://www.reddit.com/r/HubermanLab/comments/12bsg5t/i_have_searched_for_the_published_evidence_that/"&gt;debatable&lt;/a&gt;.]&lt;/p&gt;

&lt;p&gt;"The early morning light exposure needs to be done 2-3 days in a row for effects to manifest"&lt;/p&gt;

&lt;p&gt;"Early in the day, the retina is not sufficiently sensitive to be disrupted by light, so it's OK to look at your phone if you wake up before sunrise; you need to look at the sun for longer if it's overcast"&lt;/p&gt;

&lt;p&gt;"Blue blockers should be reserved for the evening (after 8pm), or if you wake up in the middle of the night and use screens (@53:15)"&lt;br&gt;
[That was contradicted by &lt;a href="https://doi.org/10.1016/j.cub.2019.10.028"&gt;this study on mice&lt;/a&gt;, which suggested that &lt;a href="https://www.theguardian.com/technology/shortcuts/2019/dec/17/not-such-a-bright-idea-why-your-phones-night-mode-may-be-keeping-you-awake"&gt;warm yellow light disrupts sleep worse than blue&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;"Viewing low-angle light when the Sun is setting can help protect the circadian mechanisms against the negative effects of light later in the day"&lt;/p&gt;

&lt;p&gt;[At 46 minutes in, he missed the opportunity to talk about sleep masks. Seems they're useless, because the eyes wouldn't see light while closed. I doubt that. You can still see strong light with your eyes closed.]&lt;/p&gt;

&lt;p&gt;~"The longer you've been awake, the more sensitive the retina becomes, so even small amounts of light can disrupt your sleep patterns. Get as much light as safely possible before sunset, and as little after ~8pm; and no bright light exposure 11pm-4am"&lt;/p&gt;

&lt;p&gt;~"Light that arrives in the eyes between ~11pm-4am suppresses the release of dopamine (endogenous antidepressant, learning facilitator)"&lt;/p&gt;

&lt;p&gt;"Red light won't trigger these issues"&lt;/p&gt;

&lt;p&gt;"The cells in our eyes that signal the central clock reside mostly in the bottom half of our retina which means it'€™s viewing our upper visual field. To avoid improper activation of neurons, place light low in your physical environment, on desktops or floor." [I don't like lights that low, you inevitably look at them and get retinal afterburn]&lt;/p&gt;

&lt;p&gt;"Candlelight and fireplaces are fine, very dim lights are fine"&lt;/p&gt;

&lt;p&gt;"Shift work needs an entire discussion" [how about us PARTY GOERS?!]&lt;/p&gt;

&lt;p&gt;@55:40 "If you turn on the lights ~45-60 minutes, even if your eyelisds are closed (provided you're not under the covers), that increases your total sleep time and makes you want to go to bed earlier each night" [this suggests sleep masks do make a difference]&lt;/p&gt;

&lt;p&gt;"So the light does penetrate the eyelids and activates the neurons that control the central clock"&lt;/p&gt;

&lt;p&gt;"You can advance or delay your sleep/wakefulness phase. If you see light late in the day, esp. in the middle of the night, your brain will think that's morning light, even though it's not sunlight, and will delay your clock, making you want to get up later and go to sleep later"&lt;/p&gt;

&lt;p&gt;"If you wake up early (4-6-7am) and get light exposure, it will phase-advance your clock"&lt;/p&gt;

&lt;p&gt;"..people's internal mechanisms aren't anchored to anything regular"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"If you can provide them consistent light anchors early in the day, and in the evening, and avoiding light at night, you'll be amazed at the tremendous positive effects - hormones, wellbeing"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Most people are not familiar with what it is [like] to sleep really really well on a consistent basis"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"Naps of ~20-30m (up to one hour) can be beneficial. If you wake up from a nap feeling groggy, that means you didn't sleep well enough during the night"&lt;/p&gt;

&lt;p&gt;"Non-Sleep Deep Rest: meditation, Yoganidra, hypnosis"&lt;/p&gt;

&lt;p&gt;"NSDR can help with emotional stability, wakefulness, and falling asleep more easily at night"&lt;/p&gt;

&lt;h2&gt;
  
  
  Supplements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;modafinil for narcolepsy&lt;/li&gt;
&lt;li&gt;adderall for wakefulness makes you feel more alert, there tends to be a heavy rebound, and there's addiction potential&lt;/li&gt;
&lt;li&gt;magnesium - increases GABA, makes mind drift in space &amp;amp; time. Magnesium threonate is the best for inducing drowsiness, 300-400mg 30-60m before sleep&lt;/li&gt;
&lt;li&gt;theanine - 100-200mg 30-60m before sleep&lt;/li&gt;
&lt;li&gt;50mg of apigenin can support falling and staying asleep. It's an estrogen inhibitor; esp. important for women"&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to fall asleep
&lt;/h2&gt;

&lt;p&gt;"Yoganidra - meditation you listen to that allows you to consciously bring your body to a state of deep relaxation; sometimes you fall asleep. It involves passively listening for 10-30 minutes to a script about body scanning and relaxation"&lt;/p&gt;

&lt;p&gt;Sleep hypnosis - &lt;a href="https://www.reveri.com/about"&gt;Reveri&lt;/a&gt; by colleague David Spiegel [I tried it once when I couldn't fall asleep, and it didn't work]&lt;/p&gt;

&lt;p&gt;"It's very hard to control the mind with the mind. When you have trouble falling asleep, you need to work with the body to control the mind"&lt;/p&gt;

&lt;p&gt;NB: try also this &lt;a href="https://www.daniel-timms.com/science-of-the-4-7-8-breathing-technique-for-sleep/"&gt;4-7-8 breathing technique&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to extract your Facebook Messenger messages from a conversation</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 22 Sep 2021 13:36:29 +0000</pubDate>
      <link>https://dev.to/dandv/how-to-extract-your-facebook-messenger-messages-from-a-conversation-2nik</link>
      <guid>https://dev.to/dandv/how-to-extract-your-facebook-messenger-messages-from-a-conversation-2nik</guid>
      <description>&lt;p&gt;If you communicate with people (or bots) over &lt;a href="https://messenger.com"&gt;FB messenger&lt;/a&gt;, you may find it useful to save a copy of your messages. You can do this by copy/pasting, but the output will be littered with "You sent", scrolling up is a pain, and you can't filter for only what &lt;em&gt;you&lt;/em&gt; said.&lt;/p&gt;

&lt;p&gt;Fortunately, Facebook provides &lt;a href="https://www.facebook.com/help/212802592074644"&gt;data exports&lt;/a&gt; in JSON format, which we can then filter easily with the &lt;a href="https://stedolan.github.io/jq/"&gt;jq&lt;/a&gt; utility.&lt;/p&gt;

&lt;p&gt;Go ahead, Request a Copy in the date range you care about, and select only "Messages":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--15XhStD5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/XXBIbGi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--15XhStD5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/XXBIbGi.png" alt="Facebook 'Download your information' screenshot" width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then extract from the archive the file &lt;code&gt;messages/inbox/&amp;lt;your_friend&amp;gt;/message_1.json&lt;/code&gt;. Once you have that file, here's how to filter all your messages, sorted chronologically by time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat message_1.json | jq -rc 'sort_by(.timestamp_ms) | .[] | select(.sender_name | contains("Dascalescu")) | .content'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(of course, replace "Dascalescu" with your name)&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;-r&lt;/code&gt; flag unquotes the strings. Useful to unescape &lt;code&gt;"&lt;/code&gt;s.&lt;/p&gt;

&lt;p&gt;That's it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Known issues
&lt;/h2&gt;

&lt;p&gt;Characters are output as raw bytes. This will break non-ASCII characters and emojis. Check for solutions &lt;a href="https://stackoverflow.com/questions/69285688/convert-emoji-unicode-byte-sequences-to-unicode-characters-with-jq"&gt;on StackOVerflow&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>facebook</category>
      <category>messenger</category>
    </item>
    <item>
      <title>How to unregister service workers in Firefox</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Sat, 08 May 2021 06:42:22 +0000</pubDate>
      <link>https://dev.to/dandv/how-to-unregister-service-workers-in-firefox-hle</link>
      <guid>https://dev.to/dandv/how-to-unregister-service-workers-in-firefox-hle</guid>
      <description>&lt;p&gt;Just a quick post because the Google search results for this are out of date.&lt;/p&gt;

&lt;p&gt;To stop (unregister) service workers in Firefox, go to&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;about:debugging#/runtime/this-firefox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Unfortunately there's no way to filter (as there is for cookies), so if you've been running that Firefox instance for a while, you'll likely have tens or hundreds of registered service workers.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Keep malicious Node modules behind bars!</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Mon, 12 Apr 2021 21:19:18 +0000</pubDate>
      <link>https://dev.to/dandv/keep-malicious-node-modules-behind-bars-2379</link>
      <guid>https://dev.to/dandv/keep-malicious-node-modules-behind-bars-2379</guid>
      <description>&lt;p&gt;When you use a Node module, have you thought that maybe a dependency of a dependency that your script uses, could &lt;a href="https://www.npmjs.com/advisories/1584"&gt;become malicious&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;That dependency has the same access to your computer as your own code. It could look through your files then phone home anything it wants, as recently seen with crypto wallets in the &lt;a href="https://www.zdnet.com/article/hacker-backdoors-popular-javascript-library-to-steal-bitcoin-funds/"&gt;event-stream attack&lt;/a&gt;, or &lt;a href="https://arstechnica.com/gadgets/2021/03/more-top-tier-companies-targeted-by-new-type-of-potentially-serious-attack/"&gt;sensitive Linux files&lt;/a&gt;. These types of attacks are called "open source supply chain attacks", and hundreds of malicious package attacks have been &lt;a href="https://link.springer.com/chapter/10.1007/978-3-030-52683-2_2"&gt;documented&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Deno &lt;a href="https://deno.land/manual/getting_started/permissions"&gt;forbids access to the filesystem by default&lt;/a&gt;, and you can whitelist specific directories. Node doesn't have this capability.&lt;/p&gt;

&lt;p&gt;One solution is to run your scripts in a sandboxed environment such as &lt;a href="https://github.com/netblue30/firejail/"&gt;firejail&lt;/a&gt;, &lt;a href="https://github.com/containers/bubblewrap"&gt;bubblewrap&lt;/a&gt;, or a VM (Docker is a containerization solution, &lt;a href="https://security.stackexchange.com/questions/107850/docker-as-a-sandbox-for-untrusted-code"&gt;not aimed at security&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Once you've installed and configured sandboxing, it would help to check if your scripts are indeed sandboxed correctly, and abort immediately otherwise, so that no dependency has a chance to execute. To that purpose, I've published a module called "&lt;strong&gt;&lt;a href="https://www.npmjs.com/package/behind-bars"&gt;behind-bars&lt;/a&gt;&lt;/strong&gt;", which does exactly that. All you have to do is add this line at the top of your script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;behind-bars&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The module will call &lt;code&gt;process.exit()&lt;/code&gt; immediately if it can access sensitive files or directories (browser profiles, cryptocurrency wallets, ~/*_history etc). It does so before any other imported module has a chance to run and steal data, by only using synchronous calls. You can optionally configure it to also ensure there's no Internet access, and you can define your own custom paths to sensitive files.&lt;/p&gt;

&lt;p&gt;So far it checks for common sensitive files on Linux and MacOS systems. PRs for Windows are welcome in &lt;a href="https://github.com/dandv/behind-bars"&gt;the repo&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation challenges
&lt;/h2&gt;

&lt;p&gt;To provide the maximum level of security, the module code needs to execute before any other imported code. Thus the developer must add the &lt;code&gt;import 'behind-bars'&lt;/code&gt; line &lt;em&gt;first&lt;/em&gt; at the top of the script. At that point, the module code needs to complete two types of requests before any other code runs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Checking the filesystem for accessible paths&lt;/li&gt;
&lt;li&gt;Checking for Internet access (by fetching a specified URL)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both these requests are normally asynchronous, which means other module code will get executed before they complete. This is unacceptable. Starting with Node v14.3.0, top-level &lt;code&gt;await&lt;/code&gt; has been unflagged, and we could use it to wait for the requests to complete. The problem is, when transpiling to CommonJS, top-level await doesn't actually block the other imports from executing.&lt;/p&gt;

&lt;p&gt;This leaves using synchronous requests as the only backwards-compatible option. Unfortunately this means using old libraries like &lt;code&gt;glob&lt;/code&gt; and &lt;code&gt;sync-requests&lt;/code&gt;, which pull a total of ~40+ dependencies. If dropping CommonJS compatibility were ok, we could use the far lighter &lt;a href="https://www.npmjs.com/package/tiny-glob"&gt;tiny-glob&lt;/a&gt;, and node's native &lt;code&gt;http&lt;/code&gt;/&lt;code&gt;https&lt;/code&gt; module.&lt;/p&gt;

</description>
      <category>security</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Proud to have reached 100k rep on StackOverflow</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 23 Dec 2020 19:50:43 +0000</pubDate>
      <link>https://dev.to/dandv/proud-to-have-reached-100k-rep-on-stackoverflow-3p28</link>
      <guid>https://dev.to/dandv/proud-to-have-reached-100k-rep-on-stackoverflow-3p28</guid>
      <description>&lt;p&gt;I haven't been active on SO lately, and I randomly found this old email in my inbox today - turns out indeed that I reached &lt;a href="https://stackoverflow.com/users/1269037/dan-dascalescu"&gt;100k rep&lt;/a&gt;, and almost 20 million people since I joined in 2009.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rLgk1Qei--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/492noafs14wu5zg25ydo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rLgk1Qei--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/492noafs14wu5zg25ydo.png" alt="Dan Dascalescu Stack Overflow reach" width="229" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Despite the &lt;a href="https://meta.stackexchange.com/questions/50967/question-deletions-are-getting-out-of-hand"&gt;more&lt;/a&gt; than &lt;a href="https://meta.stackoverflow.com/questions/251758/why-is-stack-overflow-so-negative-of-late"&gt;occasional&lt;/a&gt; &lt;a href="https://web.archive.org/web/20140712195215/http://www.mogosselin.com/one-aspect-stack-overflow-hate-fix/"&gt;frustration&lt;/a&gt;, StackOverflow has been the most useful community resource in my career as a software engineer, and I'm deeply grateful for its existence.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The most revolutionary software probably being developed right now</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Wed, 14 Oct 2020 01:18:46 +0000</pubDate>
      <link>https://dev.to/dandv/the-most-revolutionary-software-probably-being-developed-right-now-1dgh</link>
      <guid>https://dev.to/dandv/the-most-revolutionary-software-probably-being-developed-right-now-1dgh</guid>
      <description>&lt;p&gt;NOTE: I &lt;a href="https://dev.to/dandv/comment/10lhh"&gt;initially&lt;/a&gt; wrote this post before I was aware of GPT-3. I did somewhat anticipate GPT-3 (see the "rhetoric" bullet below), but its applications may be truly revolutionary in a few years. See &lt;a href="https://github.com/elyase/awesome-gpt3?fbclid=IwAR2fyyCIaE47CFf306Wlh8_noy1Dj9YuLlV0RVwviLZIeAVMlAgLiOeXT0I"&gt;Awesome GPT-3&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This post was inspired by a &lt;a href="https://dev.to/ben/what-is-the-most-potentially-revolutionary-software-currently-being-developed-38ea"&gt;previous discussion&lt;/a&gt; on the topic, that received a surprising number of very narrow examples: some CSS library, some JS framework, some project management app.&lt;/p&gt;

&lt;p&gt;By "revolutionary", I'm thinking about software with the potential to &lt;em&gt;profoundly&lt;/em&gt; impact life. This can be in established fields, or in emerging ones. I'm pretty sure there are efforts underway to build each of the examples below; we may just not know about them yet. Here are some that I know of, or have imagined:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;machine learning - &lt;a href="https://en.wikipedia.org/wiki/Automated_machine_learning"&gt;autoML&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;law - deep-learning digital attorney able to find the most appropriate legal precedent in a matter of minutes, vastly outsmarting human lawyers&lt;/li&gt;
&lt;li&gt;politics - liquid democracy, or other &lt;a href="https://democracy.earth/"&gt;voting systems&lt;/a&gt; solving the one-person-one-vote problem&lt;/li&gt;
&lt;li&gt;rhetoric - argument-making software able to persuade anyone on any controversial topic with a mix of flawless logic, appeal to emotion, and plain abuse of reasoning fallacies. This can have immense implications on politics, far beyond what fake news and social media manipulations have had, even at the current state of technology. &lt;strong&gt;UPDATE post GPT-3 and Neuralink&lt;/strong&gt;: imagine a leader whose brain is connected to Neuralink and can come up with a brilliant, convincing, fact-checked, (counter)argument to anything, better than Gary Shapiro and the Limitless protagonist. Society is not ready to openly accept AI-based governance, even though we are already at the mercy of various algorithms deciding loan interest rates and whatnot. In 20-50 years, a charismatic leader with hidden wireless access to the successor to several generations of GPT-3 like algorithms, can plausibly take over the world.&lt;/li&gt;
&lt;li&gt;molecular biology - figuring out protein folding&lt;/li&gt;
&lt;li&gt;blockchain - encrypted storage of surveillance data (CCTV footage, Internet traffic etc.), whose decryption can only be done with a combination of keys from the owner of the data source and the authorities, &lt;em&gt;and&lt;/em&gt; such decryption is permanently marked and visible in the blockchain. This would legitimize surveillance because the use of the data would be revealed.&lt;/li&gt;
&lt;li&gt;prediction markets - Augur looks promising&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://safenetwork.tech"&gt;SAFE Network&lt;/a&gt; - decentralized, autonomous and encrypted web&lt;/li&gt;
&lt;li&gt;transportation - &lt;a href="https://www.fastcompany.com/2682098/watch-out-google-this-19-year-old-built-a-cheap-self-driving-car-system"&gt;cheap self-driving modules&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;weather - high-accuracy weather prediction compensating for chaotic system effects&lt;/li&gt;
&lt;li&gt;BCIs - intepreting subvocalizations for &lt;a href="https://www.computerworld.com/article/3268132/mind-reading-tech-is-here-and-more-useful-than-you-think.html"&gt;silent computing&lt;/a&gt;, AI software to &lt;a href="https://fortune.com/2019/05/07/artificial-intelligence-mind-reading-technology/"&gt;decode brain waves&lt;/a&gt; in general&lt;/li&gt;
&lt;li&gt;synthetic biology - iGEM, &lt;a href="https://www.nature.com/articles/d41586-018-07662-w"&gt;GenoCAD&lt;/a&gt;, and &lt;a href="https://www.wikigenes.org/e/art/e/187.html"&gt;other tools&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm sure there are a lot more initiatives that can significantly change life as we know it. Please drop them in the comments below. After all, &lt;a href="https://a16z.com/2011/08/20/why-software-is-eating-the-world/"&gt;software has been eating the world&lt;/a&gt; for a decade now.&lt;/p&gt;

</description>
      <category>future</category>
      <category>predictions</category>
    </item>
    <item>
      <title>Modern TypeScript project template</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Mon, 27 Jul 2020 03:00:47 +0000</pubDate>
      <link>https://dev.to/dandv/modern-typescript-project-template-15kl</link>
      <guid>https://dev.to/dandv/modern-typescript-project-template-15kl</guid>
      <description>&lt;p&gt;Now that ES Modules are native to Node 14, it's time to make TypeScript generate ES Modules code, even though &lt;a href="https://github.com/microsoft/TypeScript/issues/18442#issuecomment-581738714"&gt;it doesn't support the .mjs extension yet&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Goals
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;emit modern ES modules code&lt;/li&gt;
&lt;li&gt;import modules that use Node built-ins&lt;/li&gt;
&lt;li&gt;import modules that don't have named exports (e.g. &lt;a href="https://github.com/apollographql/apollo-server/issues/1356#issuecomment-565277759"&gt;&lt;code&gt;apollo-server&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/node-influx/node-influx/issues/298"&gt;&lt;code&gt;node-influx&lt;/code&gt;&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;import your own modules without specifying an extension&lt;/li&gt;
&lt;li&gt;lint with ESLint, with TypeScript support&lt;/li&gt;
&lt;li&gt;test the TypeScript code instantly without having to build first&lt;/li&gt;
&lt;li&gt;run the resulting JavaScript code, with support for the optional chaining operator &lt;code&gt;?.&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bonus: continuous integration script for GitHub Actions. It automatically runs tests on every pushed commit.&lt;/p&gt;

&lt;p&gt;Bonus points: don't use Babel!&lt;/p&gt;

&lt;p&gt;OK, here's how to do this. We'll start with a new Node project (&lt;code&gt;npm init&lt;/code&gt;) and a standard &lt;a href="https://github.com/dandv/typescript-modern-project/blob/master/tsconfig.json"&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/a&gt; file, then highlight the important changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can see the complete template repo at&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/dandv/typescript-modern-project"&gt;https://github.com/dandv/typescript-modern-project&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Emit ES modules code
&lt;/h1&gt;

&lt;p&gt;In &lt;code&gt;tsconfig.json&lt;/code&gt;, set this under &lt;code&gt;compilerOptions&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"esnext"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"esnext"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Output&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;`import`/`export`&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;ES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;modules&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Import modules that use Node built-ins (&lt;code&gt;http&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt; etc.)
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;run &lt;code&gt;npm install --save-dev @types/node&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;in &lt;code&gt;tsconfig.json&lt;/code&gt; under &lt;code&gt;compilerOptions&lt;/code&gt;, set

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;"moduleResolution": "node"&lt;/code&gt;, so &lt;code&gt;tsc&lt;/code&gt; can find modules &lt;a href="https://github.com/Microsoft/TypeScript/issues/8189"&gt;when targeting ES6+&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"types": ["node"]&lt;/code&gt; to avoid errors related to Node built-in modules
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Import modules that don't have named exports
&lt;/h1&gt;

&lt;p&gt;Normally we could write in TypeScript&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { InfluxDB } from 'influx';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;but when generating ES modules code, that statement will be passed through as is, and will cause Node to fail with&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SyntaxError: The requested module 'influx' does not provide an export named 'InfluxDB'&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;because &lt;a href="https://github.com/node-influx/node-influx/issues/298"&gt;&lt;code&gt;node-influx&lt;/code&gt; doesn't provide named exports&lt;/a&gt; (and neither does an even more popular module, &lt;a href="https://github.com/apollographql/apollo-server/issues/1356#issuecomment-565277759"&gt;&lt;code&gt;apollo-server&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;One alternative would be to generate old ugly commonjs modules code by,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;removing the &lt;code&gt;"type": "module"&lt;/code&gt; line from &lt;code&gt;package.json&lt;/code&gt;, and&lt;/li&gt;
&lt;li&gt;changing the module line to &lt;code&gt;"module": "CommonJS"&lt;/code&gt; in &lt;code&gt;tsconfig.json&lt;/code&gt; (&lt;code&gt;allowSyntheticDefaultImports&lt;/code&gt; also becomes unnecessary)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What we'll do is import the entire module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Influx&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;influx&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;influx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Influx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;InfluxDB&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, this will generate &lt;code&gt;Error TS1192: Module '...' has no default export.&lt;/code&gt; To prevent that, set &lt;code&gt;"allowSyntheticDefaultImports": true&lt;/code&gt; in &lt;code&gt;tsconfig.json&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Import your own modules without specifying an extension
&lt;/h1&gt;

&lt;p&gt;When transpiling, &lt;a href="https://github.com/microsoft/TypeScript/issues/16577"&gt;TypeScript won't generate an extension for you&lt;/a&gt;. Run Node with the &lt;code&gt;node --experimental-specifier-resolution=node&lt;/code&gt; parameter:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node --experimental-specifier-resolution=node run.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Otherwise, &lt;a href="https://nodejs.org/api/esm.html#esm_mandatory_file_extensions"&gt;node mandates that you specify the extension&lt;/a&gt; in the &lt;code&gt;import&lt;/code&gt; statement.&lt;/p&gt;

&lt;p&gt;To support optional chaining, add the &lt;code&gt;--harmony&lt;/code&gt; flag to the node command line.&lt;/p&gt;

&lt;h1&gt;
  
  
  Run the resulting JavaScript code
&lt;/h1&gt;

&lt;p&gt;Add &lt;code&gt;"type": "module"&lt;/code&gt; to &lt;code&gt;package.json&lt;/code&gt;, because &lt;a href="https://github.com/microsoft/TypeScript/issues/18442#issuecomment-581738714"&gt;TypeScript can't generate files with the .mjs extension&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  ESLint
&lt;/h1&gt;

&lt;p&gt;To be able to run &lt;code&gt;eslint&lt;/code&gt;, we must create an &lt;code&gt;.eslintrc.cjs&lt;/code&gt; file, rather than a &lt;code&gt;.js&lt;/code&gt; one (due to &lt;code&gt;"type": "module"&lt;/code&gt; in &lt;code&gt;package.json&lt;/code&gt;). Then, install the required dependencies:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here's the &lt;a href="https://github.com/dandv/typescript-modern-project/commit/f816fe6e8d83ce554bd3066ac6638fb4406e917f"&gt;diff to add ESLint support&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Testing with Jest
&lt;/h1&gt;

&lt;p&gt;The cleanest way to fully support Jest with TypeScript, ES Modules and ESLint, is to use &lt;code&gt;ts-jest&lt;/code&gt;, which has &lt;a href="https://github.com/kulshekhar/ts-jest#ts-jest"&gt;a number of advantages over using Babel&lt;/a&gt;. What we need to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npm install --save-dev jest @types/jest eslint-plugin-jest&lt;/code&gt; - for ES Lint support&lt;/li&gt;
&lt;li&gt;add &lt;code&gt;"jest"&lt;/code&gt; to the &lt;code&gt;types&lt;/code&gt; array in &lt;code&gt;tsconfig.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;add the &lt;code&gt;'jest'&lt;/code&gt; plugin to &lt;code&gt;.eslintrc.cjs&lt;/code&gt; and also add &lt;code&gt;'jest/globals': true&lt;/code&gt; to its &lt;code&gt;env&lt;/code&gt; key&lt;/li&gt;
&lt;li&gt;use the &lt;a href="//jest.config.cjs"&gt;&lt;code&gt;jest.config.cjs&lt;/code&gt;&lt;/a&gt; generated by ts-jest &lt;code&gt;config:init&lt;/code&gt; (just renamed .js -&amp;gt; .cjs).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Normally, to run Jest from &lt;code&gt;package.json&lt;/code&gt;, we'd add a &lt;code&gt;"test": "jest"&lt;/code&gt; line. That won't be sufficient, because we need to pass the &lt;code&gt;--harmony&lt;/code&gt; flag to &lt;code&gt;node&lt;/code&gt; (for optional chaining support). &lt;br&gt;
To pass parameters to Node when running Jest, we'll use the following &lt;code&gt;test&lt;/code&gt; line:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"test": "node --harmony node_modules/.bin/jest"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The only caveat here is that Jest seems to prefer generated &lt;code&gt;.js&lt;/code&gt; files over their &lt;code&gt;.ts&lt;/code&gt; originals, so we'll exclude them via &lt;a href="//jest.config.cjs"&gt;&lt;code&gt;jest.config.cjs&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  testRegex: '.*.test.ts',  // test filenames matching this regex
  moduleFileExtensions: ['ts', 'js'],  // modules are only in .ts files, but 'js' *must* be specified too
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Source maps
&lt;/h1&gt;

&lt;p&gt;If your script generates an error, you'll see the line numbers from the generated &lt;code&gt;.js&lt;/code&gt; files, which is not helpful. We want to see the original paths and line numbers from the &lt;code&gt;.ts&lt;/code&gt; files. To do that, we'll add &lt;code&gt;sourceMap: true&lt;/code&gt; to &lt;code&gt;tsconfig.json&lt;/code&gt;, install &lt;a href="https://www.npmjs.com/package/source-map-support"&gt;&lt;code&gt;source-map-support&lt;/code&gt;&lt;/a&gt; and run node with the &lt;code&gt;-r source-map-support/register&lt;/code&gt; parameter. Note that Jest already takes care of source mapping so you'll see the &lt;code&gt;.ts&lt;/code&gt; line numbers without having to do anything extra.&lt;/p&gt;

&lt;p&gt;Here's &lt;a href="https://github.com/dandv/typescript-modern-project/commit/4e31278833f2ce07f474d9c6348bb4509082ee97"&gt;the diff to add source map support&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI testing
&lt;/h2&gt;

&lt;p&gt;Using &lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt;, we can configure automatic testing via &lt;code&gt;.yml&lt;/code&gt; files under &lt;a href="//.github/workflows"&gt;.github/workflows&lt;/a&gt;. You'll see a ✔️ in &lt;a href="https://github.com/dandv/typescript-modern-project"&gt;the repo&lt;/a&gt; when tests pass.&lt;/p&gt;

&lt;h1&gt;
  
  
  TODO
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;tsconfig.json&lt;/code&gt; settings generate &lt;code&gt;.js&lt;/code&gt; built files, and &lt;code&gt;.js.map&lt;/code&gt; source map files, next to the original &lt;code&gt;.ts&lt;/code&gt; file. While some IDEs conveniently hide these files, it may be desirable to output them in a separate directory, typically &lt;code&gt;dist&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This can be done using the &lt;code&gt;rootDir&lt;/code&gt;/&lt;code&gt;outDir&lt;/code&gt; settings in &lt;code&gt;tsconfig.json&lt;/code&gt;, but that sort of setup comes with an &lt;a href="https://github.com/microsoft/TypeScript/issues/9858"&gt;annoying limitation&lt;/a&gt; of Typescript that &lt;a href="https://stackoverflow.com/questions/52121725/maintain-src-folder-structure-when-building-to-dist-folder-with-typescript-3"&gt;forbids importing files outside the &lt;code&gt;rootDir&lt;/code&gt;&lt;/a&gt;. That can be a &lt;a href="https://github.com/microsoft/TypeScript/issues/17611"&gt;problem with monorepos&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;That's what you need to do, in order to get modern TypeScript code to produce modern ES Modules. Quite a lot of stuff. Thankfully, Deno compiles TypeScript natively, so I'm looking forward to those bright days 🌞&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>esmodules</category>
      <category>eslint</category>
      <category>jest</category>
    </item>
    <item>
      <title>9 problems with replacing "master" in Git</title>
      <dc:creator>Dan Dascalescu</dc:creator>
      <pubDate>Mon, 15 Jun 2020 22:27:46 +0000</pubDate>
      <link>https://dev.to/dandv/8-problems-with-replacing-master-in-git-2hck</link>
      <guid>https://dev.to/dandv/8-problems-with-replacing-master-in-git-2hck</guid>
      <description>&lt;p&gt;[Background for those unfamiliar with this debate: in summer 2020, as if the world didn't have enough real problems (Covid-19, the George Floyd protests), some activists craving social signalling, started to argue that the word "master" must be cancelled in all areas of human endeavor, because at some old point in time, it referred to the master of black slaves. One of those areas is software engineering, where the word master never had any association with slavery, but simply meant "primary", as opposed to "secondary". Why this particular war was started now, and not a continuation of the one &lt;a href="https://yaledailynews.com/blog/2015/12/02/harvard-princeton-abolish-master/"&gt;against Master's degrees&lt;/a&gt;, I don't know.]&lt;/p&gt;




&lt;p&gt;This post started as a comment reply to &lt;a href="https://dev.to/damcosset/replacing-master-in-git-2jim"&gt;"Replacing master in git"&lt;/a&gt; but it turned into a longer topic. The line that sparked my reaction was this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Master/slave is an oppressive metaphor"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There so many problems with that statement. First off...&lt;/p&gt;

&lt;h2&gt;
  
  
  1. There's no "slave" in Git
&lt;/h2&gt;

&lt;p&gt;Maybe &lt;a href="https://api.mongodb.com/internal/current/commands.html"&gt;MongoDB has this problem&lt;/a&gt;, but not git. So there's no "master/slave" metaphor in Git to speak of.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Words change meanings over time
&lt;/h2&gt;

&lt;p&gt;"Master" is a &lt;a href="https://dev.to/icatalina/comment/10b1c"&gt;term used the recording industry&lt;/a&gt;, or to talk about skill ("Master of Science", "Kung Fu Master" etc.). I'm not a native English speaker so "master" was strange to me too, but in American English "master" has been far more commonly used in the past 50 years to talk about vinyl records and CDs and degrees and expertise, than slavery. As someone else &lt;a href="https://dev.to/rolfstreefkerk/comment/10cii"&gt;said&lt;/a&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;These terms have existed for decades and now suddenly we feel they're racially loaded? I think this is a knee jerk reaction to a problem that doesn't exist. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Nothing is oppressive by itself
&lt;/h2&gt;

&lt;p&gt;People &lt;em&gt;choose&lt;/em&gt; meanings. Epictetus famously said this of insults (and "master" is far from an insult, but to illustrate the point):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Remember, it is not enough to be insulted to be harmed, you must believe that you are being harmed. If someone succeeds in provoking you, realize that your mind is complicit in the provocation. It is not he who reviles you who insults you, but your opinion that these things are insulting."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. Who does the word "master" in Git really offend?
&lt;/h2&gt;

&lt;p&gt;The vast majority of developers have nothing to do with oppression, and have never intended to oppress anyone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/assertnotnull/comment/10cma"&gt;Has anyone ever complained of being offended&lt;/a&gt; when they saw a "master" branch in a Git repo? From what I've seen so far, black developers haven't felt offended by this word.&lt;/p&gt;


&lt;div class="liquid-comment"&gt;
    &lt;div class="details"&gt;
      &lt;a href="/sduduzog"&gt;
        &lt;img class="profile-pic" src="https://res.cloudinary.com/practicaldev/image/fetch/s--yi0ONU6U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--iTyRuuQU--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_50%2Cq_auto%2Cw_50/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/86317/e8658a7e-0e1b-4463-beff-49f974146b1d.jpg" alt="sduduzog profile image"&gt;
      &lt;/a&gt;
      &lt;a href="/sduduzog"&gt;
        &lt;span class="comment-username"&gt;Beautus S Gumede&lt;/span&gt;
      &lt;/a&gt;
      &lt;span class="color-base-30 px-2 m:pl-0"&gt;•&lt;/span&gt;

&lt;a href="https://dev.to/sduduzog/comment/10cci" class="comment-date crayons-link crayons-link--secondary fs-s"&gt;
  &lt;time class="date-short-year"&gt;
    Jun 15 '20
  &lt;/time&gt;

    &lt;span class="hidden m:inline-block"&gt;• Edited on &lt;time class="date-no-year"&gt;Jun 15&lt;/time&gt;&lt;/span&gt;
    &lt;span class="m:hidden"&gt;• Edited&lt;/span&gt;
&lt;/a&gt;

    &lt;/div&gt;
    &lt;div class="body"&gt;
      &lt;p&gt;I think it's a good gesture. But it feels a bit awkward as a person of color to see such things when I've never felt that way as from the time I knew about computer science and to where I am now. This feeling though is influenced by many things, partly being that I'm from a different place where some terms aren't as heavy hitting in terms of my history and that I cannot speak for other people of color from other locations in the world.&lt;/p&gt;

&lt;p&gt;Re-purposing has more impact than renaming, in my opinion. Changing a branch name from 'master' to 'default' carries less weight compared to github just not working with government institutions like &lt;a href="https://github.com/drop-ice/dear-github-2.0/blob/master/README.md" rel="nofollow"&gt;Immigration and Customs Enforcement's ICE&lt;/a&gt;. Removing "blacklist/whitelist" in favour of something which is probably more harder to remember has less impact than &lt;a href="https://github.com/1995parham/github-do-not-ban-us" rel="nofollow"&gt;not blocking open source accounts and repositories from locations like Iran&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Historical names do way less harm than the inhumane practices corporations do today. But that's just my opinion&lt;/p&gt;


    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nsGuZfMy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/xyioyl2cw7d1e6u4bv0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nsGuZfMy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/xyioyl2cw7d1e6u4bv0u.png" alt="Blacks don't give a damn" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;div class="liquid-comment"&gt;
    &lt;div class="details"&gt;
      &lt;a href="/olivierjm"&gt;
        &lt;img class="profile-pic" src="https://res.cloudinary.com/practicaldev/image/fetch/s--8vPQA_QR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--QDxeb2la--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_50%2Cq_auto%2Cw_50/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/85523/bdc6c3dd-5f81-4101-970b-12d4b6676bd9.jpg" alt="olivierjm profile image"&gt;
      &lt;/a&gt;
      &lt;a href="/olivierjm"&gt;
        &lt;span class="comment-username"&gt;Olivier JM Maniraho&lt;/span&gt;
      &lt;/a&gt;
      &lt;span class="color-base-30 px-2 m:pl-0"&gt;•&lt;/span&gt;

&lt;a href="https://dev.to/olivierjm/comment/10dm5" class="comment-date crayons-link crayons-link--secondary fs-s"&gt;
  &lt;time class="date-short-year"&gt;
    Jun 16 '20
  &lt;/time&gt;

&lt;/a&gt;

    &lt;/div&gt;
    &lt;div class="body"&gt;
      &lt;p&gt;I totally agree with your points, I think these kind of changes are only making things worse than they were before, I never heard anyone who ever complained about this term.&lt;/p&gt;

&lt;p&gt;I am a developer and I am black(not speaking for anyone else of color) yet I have never felt offended by a word I see in a software that I use or don't use, I think there are far much better things we can do as a community if we agree to live with our different cultures. &lt;/p&gt;


    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Thanks to Ben Calder for &lt;a href="https://dev.to/blindfish3/comment/10dka"&gt;pointing out&lt;/a&gt; that some Drupal contributors felt offended by &lt;strong&gt;master/slave&lt;/strong&gt;. That's different from &lt;code&gt;master&lt;/code&gt; in the Git world.&lt;/p&gt;

&lt;p&gt;If nobody is &lt;em&gt;actually&lt;/em&gt; choosing to be offended by this word, then all we're doing is wasting time changing a perfectly working process just to virtue-signal that we're &lt;a href="https://www.urbandictionary.com/define.php?term=woke"&gt;"woke"&lt;/a&gt;, while annoying far more people in the process and wasting their time when "master" will no longer work and its replacement will break things.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What are the downsides of this rename?
&lt;/h2&gt;

&lt;p&gt;When making a decision of this scale, we need to realize that it invalidates &lt;a href="https://en.wikipedia.org/wiki/Git"&gt;15 years&lt;/a&gt; of scripts and build pipelines and CI processes and Git tutorials using the word "master". What is &lt;a href="https://dev.to/habereder/comment/10bc4"&gt;its ROI&lt;/a&gt;? That's a legitimate question. We &lt;em&gt;think&lt;/em&gt; "master" &lt;em&gt;may&lt;/em&gt; offend the sensibilities of some black developers, and OK, there might be some I haven't seen yet, but what about the actual pain inflicted on those who have to deal with the change? Broken builds, staying up al night fixing a P0 caused by the change, getting fired because you haven't exhaustively tested before deploying, downtime caused to customers who have no fault in this - these are &lt;strong&gt;real pains&lt;/strong&gt; the change &lt;em&gt;will&lt;/em&gt; cause, as any DevOps person will tell you.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Is this purely a PR move?
&lt;/h2&gt;

&lt;p&gt;By being outspoken against "master", brands benefit from stoking the fires of racial conflict to elevate themselves in the eyes of consumers. Sony, an organization using cobalt mined by literal black slaves, including children, is in favor of BLM. GitHub renaming a branch seems like a &lt;a href="https://dev.to/jdmg94/comment/10cgm"&gt;cheap PR stunt&lt;/a&gt; by comparison, when they could do far more meaningful things, like &lt;a href="https://github.com/drop-ice/dear-github-2.0/blob/master/README.md"&gt;not working with the ICE&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aS3hoiqw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/9anGA7L.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aS3hoiqw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/9anGA7L.png" alt="Github contact with the ICE" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...or not &lt;a href="https://github.com/1995parham/github-do-not-ban-us"&gt;banning Iranian developers&lt;/a&gt;, suggesting they &lt;a href="https://medium.com/@hamed/github-blocked-my-account-and-they-think-im-developing-nuclear-weapons-e7e1fe62cb74"&gt;use GitHub to develop nuclear weapons&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What shall we rename next?
&lt;/h2&gt;

&lt;p&gt;Slaves were hanged from branches at some point, should the word "branch" be changed? How about the &lt;a href="https://developers.google.com/web/tools/lighthouse"&gt;Lighthouse&lt;/a&gt; web speed auditing tool? Light is usually white... Going forward, we could realistically decide to rename "Master Degree"s.&lt;/p&gt;

&lt;p&gt;I know this is a slippery slope. We've been on it! In 2015, the &lt;strong&gt;file extension&lt;/strong&gt; &lt;a href="https://www.ghacks.net/2015/10/11/bro-file-extension-offensive-changed-to-br-instead/"&gt;".bro" was deemed offensive&lt;/a&gt; was deemed offensive and had to be changed to &lt;code&gt;.br&lt;/code&gt;. In various cultures (Australia, New Zealand), "bro" is a very positive term. But one irritated person was offended. The point of the slippery slope is, where will it stop? I bet whoever found "bro" offensive didn't stop at that. &lt;/p&gt;

&lt;p&gt;Have we, by changing the extension, helped that person be more tolerant, inclusive, resilient, calm, or in any way better than before?&lt;/p&gt;

&lt;p&gt;I wonder how that person reacted to this parody:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/ErisBlastar"&gt;
        ErisBlastar
      &lt;/a&gt; / &lt;a href="https://github.com/ErisBlastar/cplusequality"&gt;
        cplusequality
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Feminist Software Foundation C+=, a new language for us feminists
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/be938ef80e293720501b3c04c9abb0c196a88609a468ed335b9380fe18200b73/687474703a2f2f692e696d6775722e636f6d2f5a6854553872332e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/be938ef80e293720501b3c04c9abb0c196a88609a468ed335b9380fe18200b73/687474703a2f2f692e696d6775722e636f6d2f5a6854553872332e706e67" alt="FSF"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/1e7dd2d37a54f945197ff0d874baa94b485856ebf471676b62acf086d7b34c9d/687474703a2f2f692e696d6775722e636f6d2f596771315063682e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/1e7dd2d37a54f945197ff0d874baa94b485856ebf471676b62acf086d7b34c9d/687474703a2f2f692e696d6775722e636f6d2f596771315063682e706e67" alt="C-plus-Equality"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A project of the &lt;a href="http://feministsoftwarefoundation.org/" rel="nofollow"&gt;Feminist Software Foundation&lt;/a&gt;.  Feminist software is a cornerstone of any modern free society. We build this foundation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Trigger Warning, this repository uses satire and sarcasm and other types of humor that could trigger Feminazis into rage fits. Maintainer of this repository was gone for a while due to being source code raped by feminists who lack a sense of humor. Which is ironic as this language was written for feminists by women. We are trying to help out women and feminists to have a programming language not controled by the capitalist patricarchy and men.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now hosted on BitBucket, as &lt;strong&gt;&lt;a href="https://github.com/FeministSoftwareFoundation/C-plus-Equality"&gt;GitHub proves to be too misogynistic to support a feminist programming language&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h1&gt;
C+=&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;C+=&lt;/strong&gt; (pronounced either &lt;em&gt;C-plus-Equality&lt;/em&gt;, or &lt;em&gt;See Equality&lt;/em&gt;) is a feminist programming language, created to smash the toxic Patriarchy that is inherent in and that permeates all current computer programming languages.&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/ErisBlastar/cplusequality"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Anyway, odd fact about me: I actively dislike being called "bro". It's irrational, and I have no explanation for it. But I don't mind it when my Aussie friends call me "bro". They don't mean anything bad by that; on the contrary, "bro" is a term of fraternity, of endearment. Someone being offended &lt;strong&gt;by a file extension&lt;/strong&gt;, which doesn't mean anything but short for the compression algorithm "Brotli", is quite puzzling to me.&lt;/p&gt;

&lt;p&gt;A slippery slope is a fallacy when it's used to support an argument. Here, it's merely a fact. I'm not arguing we should not rename "master". Go right ahead, rename it. I'm just pointing out some problems with getting up in arms about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Don't we have better things to worry about?
&lt;/h2&gt;

&lt;p&gt;Could the time collectively spent on this debate have been better spent in other ways? Or do we like the illusion of doing something useful? I think that arguing about how we &lt;em&gt;think&lt;/em&gt; black people (should?) feel about a word takes attention away from real issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Is this humiliating to black developers?
&lt;/h2&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--JgKShno3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://pbs.twimg.com/profile_images/1025987698782175233/QayOmvkL_normal.jpg" alt="SK (Panda Global) profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        SK (Panda Global)
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @speedkicks
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kDgU_xDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Reading a thread of white people, including the CEO of GitHub, advocating changing the name of the "Master" branch to make black devs more comfortable...&lt;br&gt;&lt;br&gt;is the most racially uncomfortable I've ever felt about GitHub.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      21:44 PM - 14 Jun 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1272283853617459200" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OXOJJiQT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1272283853617459200" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--foTp-unf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1272283853617459200" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SFHqU4bF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;Last, and worst, by removing the word "master" blindly, we're uncritically reproducing a narrative that diminishes black agency in favor of a white-centric explanation. We're making the assumption that a black developer can't take the word "master" as simply a label and nothing more. Don't you think black developers may find that assumption humiliating?&lt;/p&gt;

&lt;p&gt;PS: I've looked at reactions to similar moves in the past. The &lt;a href="https://twitter.com/dhh/status/1032050325513940992"&gt;founder of Ruby on Rails pontificated about renaming master&lt;/a&gt; back in August 2018. The reaction of the developer community was pretty much the same as mine.&lt;/p&gt;

</description>
      <category>blm</category>
      <category>github</category>
      <category>racism</category>
      <category>words</category>
    </item>
  </channel>
</rss>
