<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[The Brain of Nimish]]></title><description><![CDATA[Life, programming, the usual]]></description><link>https://blog.nimishg.com/</link><image><url>https://blog.nimishg.com/favicon.png</url><title>The Brain of Nimish</title><link>https://blog.nimishg.com/</link></image><generator>Ghost 4.34</generator><lastBuildDate>Thu, 05 Mar 2026 05:57:56 GMT</lastBuildDate><atom:link href="https://blog.nimishg.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Moving to Wordpress...sometimes]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Different tools have different uses. Ghost is great for creating something like a long-form Facebook post. Doing more, though, requires a more powerful tool. Despite its dated interface and feel, Wordpress has the community and ecosystem needed to run a more &apos;serious&apos; site.</p>
<p>So I&apos;ll be</p>]]></description><link>https://blog.nimishg.com/different-tools-different-uses/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb68d</guid><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Fri, 11 May 2018 17:52:09 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1526030394972-7881873e4e40?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=cda5e7b9da730409d2c9c822349931e4" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1526030394972-7881873e4e40?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=cda5e7b9da730409d2c9c822349931e4" alt="Moving to Wordpress...sometimes"><p>Different tools have different uses. Ghost is great for creating something like a long-form Facebook post. Doing more, though, requires a more powerful tool. Despite its dated interface and feel, Wordpress has the community and ecosystem needed to run a more &apos;serious&apos; site.</p>
<p>So I&apos;ll be moving more professional work to Wordpress while keeping this blog running for personal work, opinions etc.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[The linguist in me sees the linguist in you]]></title><description><![CDATA[What does 'namaste' actually mean?]]></description><link>https://blog.nimishg.com/the-linguist-in-me-sees-the-linguist-in-you-2/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb68c</guid><category><![CDATA[Linguistics]]></category><category><![CDATA[Philosophy]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Sat, 17 Mar 2018 15:15:21 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1504203177881-36372ced5087?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=78112678d91574d164b6ba74f16c9b99" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1504203177881-36372ced5087?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=78112678d91574d164b6ba74f16c9b99" alt="The linguist in me sees the linguist in you"><p>What does <strong>namaste</strong> mean? Depends on what language you&apos;re speaking.</p>
<ol>
<li><strong>namaste</strong>, <strong>&#x928;&#x92E;&#x938;&#x94D;&#x924;&#x947;</strong> <span style="font-family:Helvetica Neue">(<em>/n&#x259;m&#x259;s&apos;t&#x32A;e:/</em>)</span>: <em>interj.</em></li>
</ol>
<ul>
<li>Commonly-used greeting in <a href="https://en.wikipedia.org/wiki/Prakrit">Prakriti</a>-derived languages</li>
<li>Meaning: <em>greetings</em>, <em>hello</em>, sometimes <em>goodbye</em></li>
<li>originally used this way ~500 BCE</li>
<li>etymology: Sanskrit &#x928;&#x92E;&#x903; (<em>nama&#x1E25;</em>) <sup><a href="#bottomnote">1</a></sup> + &#x924;&#x947; (<em>te</em>), &apos;hail&apos; + &apos;to you&apos;</li>
</ul>
<ol start="2">
<li><strong>namaste</strong> <span style="font-family:Helvetica Neue">(<em>/n&#x251;&#x2D0;m&#x251;&#x2D0;s&apos;te&#x26A;/</em>)</span>: <em>interj.</em></li>
</ol>
<ul>
<li>A specialized greeting, usually used at the beginning or end of <a href="https://en.wikipedia.org/wiki/Hatha_yoga">Hatha yoga</a> classes in the United States and Europe.</li>
<li>Meaning: <em>The divine in me sees the divine in you</em></li>
<li>originally used this way ~2000 AD</li>
<li>etymology: Hindi <em>namaste</em>, &apos;hello&apos; + mystic connotations with the East</li>
</ul>
<h1 id="whenisawordaword">When is a word a word?</h1>
<p>To be clear, <strong>namaste</strong>, as used in modern Indic languages, is just a normal greeting and does not carry any special mystical meaning (at least no more than any other words). In recent years, however, memes have cropped up saying saying it means &apos;the divine in me sees the divine in you&apos;.</p>
<p>As poetic of an interpretation as that is, no native Indic language speaker consciously intends this meaning when using the word. In the strictest sense, we can&apos;t say this word has that meaning.</p>
<p>As a know-it-all nerd, I have a really strong urge to tell people that, and throw in a little history lesson while I&apos;m at it &#x1F642;</p>
<p>But, the meme and divine interpretation have become so ubiquitous that people have started to behave as if it were true. People (mostly in the West) <em>are</em> using <strong>namaste</strong> with the intent of expressing &apos;the divine in me sees the divine in you&apos;.</p>
<p>If one person uses a word to mean X, and the person listening understands it to mean X, doesn&apos;t that word now have that meaning? In the end, that&apos;s all words are: arbitrary sounds whose meanings are agreed upon. If everyone using it agrees that <strong>namaste</strong> means &apos;the divine in me sees the divine in you&apos;, the word now has that meaning.</p>
<p>So, as a linguist, I have to recognize that this word now exists in both Indic and Western cultures. The Western word was borrowed from the Indic word, but they&apos;re now their own seperate entities, with their own proper uses, contexts, and meanings. This is how languages grow, and there&apos;s no &apos;right&apos; or &apos;wrong&apos; to word usage once it has become popularly adopted.</p>
<p>Besides, I really like the new meaning &#x1F642; I think it&apos;s poetic and beautiful. The linguist in me acknowledges the linguist in those of you who choose to use it that way.</p>
<p>Namaste. &#x1F64F;&#x1F3FD;</p>
<hr>
<div style="font-size:0.75em;">
    <h6 id="bottomnote" style="font-weight:normal;">A  note on &#x928;&#x92E;&#x903; (_nama&#x1E25;_), the word at the root of <strong>namaste</strong></h6> <br>
This word is seen in prayers as a greeting to gods. Some people argue that because of this use, when using it with people, it has &apos;divine&apos; connotations. <br><br>
<p>This would be true if it was used exclusively in prayers and <em>occasionally</em> used with a person of importance to imply divinity. It&apos;s not; it&apos;s used as a common greeting, meaning it&apos;s a word suitable for both prayers <em>and</em> normal use, like &quot;with&quot; or &quot;the&quot;. If we took usage in prayer to imply prayer, then every word would be seen as divine and every utterance would be prayer &#x1F642;</p>
<p>I think this is a beautiful interpretation, but doesn&apos;t match the real-world use.</p>
<p>That having been said, the word <em>does</em> carry the additional meanings of &apos;bowing&apos; or in some other way showing respect. When reading translations of prayers in other languages, I see this concept translated as &apos;hail&apos;, and that word seems to properly convey all the connotations of <em>nama&#x1E25;</em> as well.</p>
</div>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Word2Vec on Swedish Parliament Speeches]]></title><description><![CDATA[Can we find biases in political speeches with word2vec?]]></description><link>https://blog.nimishg.com/word2vec-on-swedish-parliament-speeches/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb68b</guid><category><![CDATA[Visualizations]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Wed, 14 Feb 2018 09:33:21 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1509356843151-3e7d96241e11?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=cb4acd521b3ef5a9692c9819f9768881" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1509356843151-3e7d96241e11?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=cb4acd521b3ef5a9692c9819f9768881" alt="Word2Vec on Swedish Parliament Speeches"><p>This is more &apos;data exploration&apos; than visualization, but still some interesting results.</p>
<h2 id="word2vecexplanation">Word2vec explanation</h2>
<p><a href="https://en.wikipedia.org/wiki/Word2vec">Word2vec</a> is an algorithm that takes words in a corpus, and puts them into a multidimensional space, turning each word into a dimension. It then takes each individual word and creates a &apos;word vector&apos; out of it, based on words it&apos;s found next to in that multidimensional space (within a given window).</p>
<p>So if you said &apos;I like cats&apos;, and &apos;I like dogs&apos;, the vectors for the words &apos;cats&apos; and &apos;dogs&apos; would be pointing (roughly) towards the &apos;I&apos;, and &apos;like&apos; dimensions. The cool part is that these are still 1-dimensional lines, so you can compare them by taking the cosine of the angle they make.</p>
<p>If two words occur in the exact same context together, they&apos;ll have a cosine of 1. If they&apos;re completely independent of eachother, they&apos;ll be orthogonal and have a cosine of 0. If they occur inversely to one another, you&apos;ll get a cosine of -1.</p>
<p>When done on real data sets with real words, we <em>do</em> actually see that words with similar contexts have very strong semantic relationships (just google &apos;word2vec&apos; and you&apos;ll see what I mean).</p>
<h2 id="theexperiment">The experiment</h2>
<p>So, we know word2vec can approximate semantic groupings based on the corpus of data its been fed. But, I wondered, would it be able to detect <em>biased</em> semantic groupings based on <em>biased</em> data? Like, say, political speeches given in parliament?</p>
<h2 id="swedishparliamentdata">Swedish parliament data</h2>
<p>Swedish parliament has all of its speech data available <a href="https://data.riksdagen.se">here</a>. I downloaded the XML for speeches between 2006 and early 2018. I did some basic cleanup (capitalization, punctuation etc) and created groupings by political party. The assumption is that training on the sum of a political party&apos;s speeches might surface the bias in that party.</p>
<p>Obviously, there are <em>tons</em> of caveats here. Some political parties are older than others, the memberships change over time, my cleanup is overly simplistic (not combining singular and plurals for instance), this is nowhere near enough data, etc.</p>
<p>All that having been said though, what does this &apos;first attempt&apos; yield?</p>
<h2 id="explorer">Explorer</h2>
<p>I made a fairly simple data explorer. You pick the political party, type in a word, and you get the top 25 or so words matching the given word (so the 25 words with the highest cosine similarity).</p>
<p>Hovering over the word will give you the cosine similarity to 2 decimal places, multiplied by 100 (so a similarity of 0.5539650 = 55). You can click on the words returned and search <em>that</em> word, and so on.</p>
<h2 id="interpretingtheresults">Interpreting the results</h2>
<p>Because cosine similarities come back with a value between 0 and 1 for positive results, it&apos;s very easy to (mistakenly) interpret them as percentages. They&apos;re not. That having been said, though, I needed a way to show some words were &apos;more&apos; similar than others visually. So I kind of treated the similarity metric as a percentage in terms of scaling the font for the words displayed.</p>
<p>Unfortunately, the &apos;meaningfulness&apos; of the similarity depends on the size of the corpus and the relative frequency of that word in the corpus. Frequently used words, like &quot;Sweden&quot; give fairly intuitive results, but less-frequent words might show a strong similarity metric just because they were used together a handful of times.</p>
<p>The only way to know how similar is &apos;similar enough&apos; is to sanity-check against an expert who knows Swedish parliamentary speeches, history, and data really well. I don&apos;t have access to such an expert, so rather than tweaking it myself based on my limited knowledge, I left it all as-is.</p>
<h2 id="endresult">End result</h2>
<p>The end result is, well, not very clear-cut.</p>
<p>Some associations make sense, such as Sweden being in the same semantic category as Norway, Denmark etc.</p>
<p>There are also some of the expected associations (xenophobia in the xenophobic party, environmentalism in the environmentalist party etc) but not as many as I would have guessed.</p>
<p>A fast majority, though, is noise and random chance. We see &apos;enemy&apos; and &apos;12-year-old&apos; paired up for the Social Democrats. I doubt they see 12-year-olds as enemies. It&apos;s most likely that these two words are very infrequent, and happened to have similar contexts the small handful of times they were used.</p>
<p>Still, it&apos;s kind of cool when you put in something like &apos;cultural heritage&apos; (<em>kulturarv</em>) and see that every political party wants to protect it(<em>f&#xF6;rsvar</em>), but they all have different ideas of what it is.</p>
<h2 id="whyreleasethis">Why release this?</h2>
<p>I wasn&apos;t sure if I should release this or not in the given state. I mean, it obviously has <em>potential</em>, but still has lots of data cleanup needed before it can be <em>meaningful</em>. Also, a more meaningful version would only return words that are frequent enough and co-occur enough to not give any &apos;false-positives&apos; (which, again, would only be impirically found with the help of an expert).</p>
<p>So why release it at all? Well, to let people know that such topic analysis <em>is</em> possible in the first place, and to hopefully inspire others to take this kind of topic analysis to the next level. And, who knows, maybe now some Swedish parliamentary expert might want to team up with me afterwards &#x1F603;</p>
<p><strong>So, please look at this more as interactive word-art, and not a rigorous, scientific study</strong></p>
<h2 id="codeandlivedemo">Code and Live Demo</h2>
<ul>
<li>Play with it live <a href="http://alpha.nimishg.com/sv_politi_word/frontend/">here</a>.</li>
<li>Code on <a href="https://github.com/nimishgautam/politician-words-sv">github</a>.</li>
</ul>
<h2 id="anoteonpreviousworkwithdanishdata">A note on previous work with Danish data</h2>
<p>I did <a href="https://www.zetland.dk/historie/s8qDGPQ9-aekXrv2R-07e35">work</a> similar to this for <a href="https://zetland.dk">zetland.dk</a>. The Zetland article was done in conjunction with Philip Flores, who is an expert about happenings in the Danish parliament. He was able to put some of the seemingly random results we got into context.</p>
<p>As such, everything reported in the article had been &apos;sanity-checked&apos; to be sure the information was not the result of errant artefacts of undersampling.</p>
<p>In contrast, the data for the Swedish tool is provided &apos;as-is&apos;, and is upto the user to do further research if they so desire.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[An honest response to "Will you work late?"]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><em>[Note: this is a re-working of an older <a href="https://42hire.com/will-you-work-late-how-to-respond-honestly-8b0dba5df667">medium post</a> I&apos;ve written]</em></p>
<p>&quot;Will you work late?&quot; It&apos;s one of the worst questions to hear from a prospective employer. Other forms of the question include:</p>
<ul>
<li>Are you ready to do &apos;whatever it takes&apos;</li></ul>]]></description><link>https://blog.nimishg.com/will-you-work-late-an-honest-response/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb68a</guid><category><![CDATA[Startup Culture]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Fri, 09 Feb 2018 18:17:33 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1483917230214-03a12822f825?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=9cfe0f0145f3fe957f7beee965e58129" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1483917230214-03a12822f825?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=9cfe0f0145f3fe957f7beee965e58129" alt="An honest response to &quot;Will you work late?&quot;"><p><em>[Note: this is a re-working of an older <a href="https://42hire.com/will-you-work-late-how-to-respond-honestly-8b0dba5df667">medium post</a> I&apos;ve written]</em></p>
<p>&quot;Will you work late?&quot; It&apos;s one of the worst questions to hear from a prospective employer. Other forms of the question include:</p>
<ul>
<li>Are you ready to do &apos;whatever it takes&apos; to ship on time?</li>
<li>Will you turn your avocation into your vocation?</li>
<li>Are you dedicated?</li>
<li>Are you ready for a healthy work-life balance?</li>
</ul>
<p>All of these are essentially the same question. They all probe for the same quality and should be answered the same way.</p>
<h2 id="whywouldanyoneask">Why would anyone ask?</h2>
<p>There are two possible reasons for asking this question: one ethical and one not.</p>
<h3 id="whattoexpectinacrisis">What to expect in a crisis</h3>
<p>The legitimate version of this question is probing to find out what the employer can expect from you in a crisis.  Sometimes projects were made with unrealistic deadlines, or with resources that suddenly get taken away, or a slew of other unexpected problems. In these cases, heroics are necessary to save the project. It might mean extra work for weeks or months on end.</p>
<p>Irrespective of how these circumstances arose, the employer is essentially asking what you will do if you encounter such circumstances at this job. They want to know you&apos;ll pitch in.</p>
<h3 id="canweexploityou">Can we exploit you?</h3>
<p>This is the non-legitimate version of the question, and is also used by (unfortunately) many organizations, especially against younger and inexperienced employees.</p>
<p>Basically, you&apos;ll start a project, and then at some point you&apos;ll recieve nonsensical reasons as to why you&apos;ll need to work beyond your initial agreement, and without extra pay. It&apos;s actually part of the organization&apos;s standard operating proceedure, and they need to know that you&apos;ll be OK with this ahead of time.</p>
<h2 id="probingforthedifference">Probing for the difference</h2>
<p>So, as a prospective employee, you want to indicate that you are reasonable enough to help out if it&apos;s an emergency, but that you won&apos;t be exploited regularly. My go-to response sounds something like this:</p>
<blockquote>
<p>&#x201C;I understand that there are emergencies and that the unexpected happens. When it does, I&#x2019;ll do everything within reason, including working late and off-hours, to solve the problem. <em>(pause)</em> How often do you have those kinds of emergencies here?&#x201D;</p>
</blockquote>
<p>The answer to the second part will tell you what you need to know.</p>
<p>To be clear, <em>any time</em> an employee is asked to work beyond what they&apos;ve contractually agreed to, it&apos;s a failure in management. The manager had certain resources (time, money, human resources etc) and was not able to acquire and allocate them in the right way to complete the project. This is ok; managers are human and mistakes happen, but <strong>it must be treated as a mistake</strong>.</p>
<p>That means, organizationally, there should be an analysis, a post-mortem, or some proactive steps to determine the original cause of the mistake and actions to stop it from happening again.</p>
<p>If no such steps are taken, then it <em>will</em> happen again. Sometimes, it happens so much it becomes standard business practice. The organization reaches a point where it actually can&apos;t operate without heroics, meaning if you join, you will be exploited and burned through.</p>
<p>So listen to the response you&apos;re given. If it&apos;s overly defensive or otherwise dismissive, you probably don&apos;t want to be working there.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Sweden: Crime vs Fear]]></title><description><![CDATA[Crime vs Fear of Crime for Sweden (Data from 2016 crime surveys)]]></description><link>https://blog.nimishg.com/sweden-crime-vs-fear/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb689</guid><category><![CDATA[Visualizations]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Mon, 22 Jan 2018 08:05:04 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2018/01/Screen-Shot-2018-01-22-at-08.58.31.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.nimishg.com/content/images/2018/01/Screen-Shot-2018-01-22-at-08.58.31.png" alt="Sweden: Crime vs Fear"><p>Sweden has an organization dedicated to monitoring crime reports across the country, <a href="https://bra.se">Brottsf&#xF6;rebyggande r&#xE5;det</a>.</p>
<p>Beyond crime monitoring, though, this organization also assembles the results of crime surveys, police interaction surveys, and lots of other amazing public data. They have a collection of historical data and surveys <a href="https://www.bra.se/brott-och-statistik/statistiska-undersokningar.html">here</a>.</p>
<p>Two data points that particularly interested me were <em>Brott mot enskilda personer i olika befolkningsgrupper</em> (Crime against individuals in different demographics), and <em>Otrygghet och oro f&#xF6;r brott i olika befolkningsgrupper</em> (un-safety and un-calm for crime in different demographic groups). Ok, so I don&apos;t really know how to directly translate <em>otrygghet</em> or <em>oro</em>, but I loosely translated them as &apos;fear&apos;.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<p>I thought it would be cool to put these two things side-by-side; that is, the chance of someone being the victim of a crime next to how afraid they are that they might be the victim of a crime.</p>
<p>Of course, we know people are more afraid of being victims than are actually victims. That&apos;s not the amazing find here. The question is <em>how much more</em> are people afraid, and are people afraid in proportion to how much they&apos;re affected by crime? That is, are old people more afraid of being mugged, even though young people are the ones <em>actually</em> being mugged?</p>
<p><a href="https://blog.nimishg.com/public/crime-vs-fear-in-sweden/docroot/brott.html">Click around and (hopefully) find out!</a></p>
<p>The most interesting thing I found is how much more single parents are impacted by crime than other groups... I genuinely had no idea.</p>
<p>This is also on <a href="https://github.com/nimishgautam/crime-vs-fear-in-sweden">github</a>.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>This &apos;fear&apos; data is derived from the Swedish Crime Survey (<em>Nationella trygghetsunders&#xF6;kningen</em>). <a href="#fnref1" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
</ol>
</section>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Wikipedia Clickstream Visualization]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>The Wikimedia Foundation has recently released <a href="https://figshare.com/articles/Wikipedia_Clickstream/1305770">Clickstream data</a>.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<p>This is the data that shows the &quot;clicking around randomly&quot; effect we&apos;re all familiar with when browsing Wikipedia.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<p>I tried to do some initial clustering analysis on it, but thought, for the time being, it might</p>]]></description><link>https://blog.nimishg.com/wikipedia-clickstream-visualization/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb682</guid><category><![CDATA[Visualizations]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Tue, 07 Jun 2016 11:04:39 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2016/06/2000px-Wikidata-logo-en-svg.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.nimishg.com/content/images/2016/06/2000px-Wikidata-logo-en-svg.png" alt="Wikipedia Clickstream Visualization"><p>The Wikimedia Foundation has recently released <a href="https://figshare.com/articles/Wikipedia_Clickstream/1305770">Clickstream data</a>.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<p>This is the data that shows the &quot;clicking around randomly&quot; effect we&apos;re all familiar with when browsing Wikipedia.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<p>I tried to do some initial clustering analysis on it, but thought, for the time being, it might be more fun to do a pure data visualization application instead, and let people click around for themselves.</p>
<p>Here&apos;s a screenshot while still in development:</p>
<p><img src="https://blog.nimishg.com/content/images/2016/06/Screen-Shot-2016-06-03-at-12-30-07.png" alt="Wikipedia Clickstream Visualization" loading="lazy"></p>
<p>The wedges on the left show the incoming links, while the wedges on the right show outgoing links.  The size of the wedges shows the amount of clicks going in that direction relative to the others. The darkness of the color shows how popular that article is overall.</p>
<p>Because this exploration requires a back-end as well (to serve up the data), I&apos;ve spun up a special server to host it and possibly other such projects.</p>
<p>I&apos;m not sure how much of those I&apos;ll do, or even if I&apos;ll keep the server running for long, so, if/when I take it down, I&apos;ll leave a &apos;static&apos; version here.</p>
<p>It&apos;s enough to get the gist of it, and once it&apos;s more polished, I&apos;ll factor out some of the personal information (Google Analytics, Paypal, etc) and host it on github.</p>
<p><a href target="_blank" style="display:none">Static visualization <svg width="10" height="10"><path transform="scale(.02)" d="M341.342,0H512v170.664l-64,64V117.336L213.336,352L160,298.658L394.658,64H277.342L341.342,0z M0,85.336h320l-64,64H64V448  h298.658V256l64-64v320H0V85.336z"/></svg></a></p>
<p><a href="http://alpha.nimishg.com/wikiviz/wiki_viz.htm" target="_blank">&quot;Live&quot; visualization (link unstable) <svg width="10" height="10"><path transform="scale(.02)" d="M341.342,0H512v170.664l-64,64V117.336L213.336,352L160,298.658L394.658,64H277.342L341.342,0z M0,85.336h320l-64,64H64V448  h298.658V256l64-64v320H0V85.336z"/></svg></a></p>
<hr>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p><a href="https://meta.wikimedia.org/wiki/Research:Wikipedia_clickstream">Wikimedia Research: Clickstreams</a> <a href="#fnref1" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
<li id="fn2" class="footnote-item"><p><a href="https://xkcd.com/214/">XKCD - The problem with Wikipedia</a> <a href="#fnref2" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
</ol>
</section>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Changes in Danish Political Parties from 2009 to 2011]]></title><description><![CDATA[<!--kg-card-begin: markdown--><iframe src="https://blog.nimishg.com/public/dk-election/dk-results.html" style="border-style: dotted; border-color:#ccc; border-width:1px; width: 960px !important; height:700px; float:left; margin-left:-90px; overflow:hidden;" scrolling="no">
</iframe><div style="clear:both;"></div>
<div style="text-align:right">
<a href="https://blog.nimishg.com/public/dk-election/dk-results.html" target="_blank">Open in new window <svg width="10" height="10"><path transform="scale(.02)" d="M341.342,0H512v170.664l-64,64V117.336L213.336,352L160,298.658L394.658,64H277.342L341.342,0z M0,85.336h320l-64,64H64V448  h298.658V256l64-64v320H0V85.336z"/></svg></a>
</div>
---
<h2 id="politicalsupportaspercentages">Political Support as Percentages</h2>
<p>There have been plenty of maps showing the outcome of the Danish 2015 election, though I don&apos;t know of any (so far) that look at percentage changes.</p>
<p>I thought it would be interesting to take the percentage of votes</p>]]></description><link>https://blog.nimishg.com/changes-in-danish-political-parties-from-2009-to-2011/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb680</guid><category><![CDATA[Visualizations]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Mon, 23 May 2016 18:50:19 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1514120894977-9650134973b0?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=2536a830a4e9ce2778a84fb0b9386a50" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><iframe src="https://blog.nimishg.com/public/dk-election/dk-results.html" style="border-style: dotted; border-color:#ccc; border-width:1px; width: 960px !important; height:700px; float:left; margin-left:-90px; overflow:hidden;" scrolling="no">
</iframe><div style="clear:both;"></div>
<div style="text-align:right">
<a href="https://blog.nimishg.com/public/dk-election/dk-results.html" target="_blank">Open in new window <svg width="10" height="10"><path transform="scale(.02)" d="M341.342,0H512v170.664l-64,64V117.336L213.336,352L160,298.658L394.658,64H277.342L341.342,0z M0,85.336h320l-64,64H64V448  h298.658V256l64-64v320H0V85.336z"/></svg></a>
</div>
---
<h2 id="politicalsupportaspercentages">Political Support as Percentages</h2>
<img src="https://images.unsplash.com/photo-1514120894977-9650134973b0?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=2536a830a4e9ce2778a84fb0b9386a50" alt="Changes in Danish Political Parties from 2009 to 2011"><p>There have been plenty of maps showing the outcome of the Danish 2015 election, though I don&apos;t know of any (so far) that look at percentage changes.</p>
<p>I thought it would be interesting to take the percentage of votes each party earned in 2011 and see how those percentages changed in 2015.</p>
<h2 id="howtousethis">How to use this</h2>
<p>Clicking on a political party name will change the colors of the map (meanings defifned below).</p>
<p>Clicking on the party name again makes the menu visible.</p>
<p>Hovering over a district will show the district&apos;s name, and numeric percentage value.</p>
<h2 id="howtoreadthis">How to read this</h2>
<p>When a party is selected, the darker the color, the higher the change in the number of votes (expressed as percentage points) for that party in 2015 <em>relative to the rest of the country</em>. Let&apos;s take Radikale Venstre in Frederikshavn as an example.</p>
<p>In 2011, they received 1970 out of 41748 votes in Frederikshavn, giving them 4.7% of the vote. In 2015, they received 801 out of 40815 votes in that same district, giving them 2% of the votes. The change, as I&apos;m calculating it, is -2.7%.</p>
<p>If we look at the average across the voting districts, however, (not normalizing for population) we see an average of -4.9% for Radikale.</p>
<p>So, though support for Radikale dropped across the whole country, we see that it dropped <em>less</em> in Frederikshavn than it did in the rest of the country.  How much less? That&apos;s what the intensity of the color shows<br>
&#x1F603;</p>
<h4 id="notesonmethodology">Notes on methodology</h4>
<p>Note that the change I&apos;m calculating is different from percentage change (which could be written -59% in this case), and also different from net gains or losses nation-wide.</p>
<p>Also, as noted above, I&apos;m not normalizing for population shifts or changes.</p>
<p>This means the types of conclusions that can be reached from this graphic are deliberately limited to discover possible trends in local initiatives.</p>
<p>For instance, we can say the people of Aarhus were much more amenable to voting for someone without a party in 2015 than they were in 2011, possibly indicating a positive trend for those wishing to run unaffiliated next election.</p>
<p>Similarly, we can say that Viberg &#xD8;st showed the greatest positive change towards Konservative, also possibly indicating a shifting locality of interest.</p>
<h2 id="sources">Sources:</h2>
<ul>
<li>2011 election results: <a href="http://www.dst.dk/valg/SE_FV2011.pdf">Danmarks Statistik</a></li>
<li>2015 election results: <a href="http://www.statistikbanken.dk/">Danmarks Statistik</a></li>
<li>Denmark Topography files: <a href="https://github.com/Neogeografen/dagi/">Neogeografen</a></li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Sweden Population Visualization]]></title><description><![CDATA[<!--kg-card-begin: markdown--><iframe src="https://blog.nimishg.com/public/sweden-population/svpop.html" style="border-style: dotted; border-color:#ccc; border-width:1px; width: 960px !important; height:490px; float:left; margin-left:-90px; overflow:hidden;" scrolling="no">
</iframe><div style="clear:both;"></div>
<div style="text-align:right">
<a href="https://blog.nimishg.com/public/sweden-population/svpop.html" target="_blank">Open in new window <svg width="10" height="10"><path transform="scale(.02)" d="M341.342,0H512v170.664l-64,64V117.336L213.336,352L160,298.658L394.658,64H277.342L341.342,0z M0,85.336h320l-64,64H64V448  h298.658V256l64-64v320H0V85.336z"/></svg></a>
</div>
---
<p>Sorry about the painful navigation above. I wasn&apos;t sure what the best way to embed it would be.</p>
<h2 id="howtoreadthis">How to read this</h2>
<p>This shows the population change in Sweden from 1749 to (as of this writing) 2015 according to <a href="http://www.scb.se/">Statistika Centralbyr&#xE5;n</a></p>]]></description><link>https://blog.nimishg.com/sweden-population-visualization/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb67f</guid><category><![CDATA[Visualizations]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Mon, 23 May 2016 08:13:44 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1501543127443-90ce373a0028?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=7921938305118ddea929cffbec8e2329" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><iframe src="https://blog.nimishg.com/public/sweden-population/svpop.html" style="border-style: dotted; border-color:#ccc; border-width:1px; width: 960px !important; height:490px; float:left; margin-left:-90px; overflow:hidden;" scrolling="no">
</iframe><div style="clear:both;"></div>
<div style="text-align:right">
<a href="https://blog.nimishg.com/public/sweden-population/svpop.html" target="_blank">Open in new window <svg width="10" height="10"><path transform="scale(.02)" d="M341.342,0H512v170.664l-64,64V117.336L213.336,352L160,298.658L394.658,64H277.342L341.342,0z M0,85.336h320l-64,64H64V448  h298.658V256l64-64v320H0V85.336z"/></svg></a>
</div>
---
<img src="https://images.unsplash.com/photo-1501543127443-90ce373a0028?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ&amp;s=7921938305118ddea929cffbec8e2329" alt="Sweden Population Visualization"><p>Sorry about the painful navigation above. I wasn&apos;t sure what the best way to embed it would be.</p>
<h2 id="howtoreadthis">How to read this</h2>
<p>This shows the population change in Sweden from 1749 to (as of this writing) 2015 according to <a href="http://www.scb.se/">Statistika Centralbyr&#xE5;n</a>.</p>
<p>There are 3 different locations represented:</p>
<ul>
<li>the world (excluding Sweden)</li>
<li>Sweden</li>
<li><a href="https://en.wikipedia.org/wiki/Yggdrasil">Yggdrasil</a></li>
</ul>
<p>Every pixel in Sweden represents a fixed number of people.  As time progresses and Sweden&apos;s population grows, the size of the Sweden graphic changes to reflect the population.</p>
<p>There are 4 possible changes to the population, each one shown with a different graphic:</p>
<ul>
<li><strong>Births</strong> are represented by a circle travelling from Yggdrasil to Sweden</li>
<li><strong>Deaths</strong> are represented by a circle travelling from Sweden to Yggdrasil</li>
<li><strong>Immigrants</strong> (those coming in to Sweden) are represented by a circle travelling from the world into Sweden</li>
<li><strong>Emigrants</strong> (those travelling out of Sweden) are represented by a circle travelling from Sweden to the world</li>
</ul>
<p>The circles are on the same scale as the Sweden graphic, so 1 pixel in the circles represents the same number of people as 1 pixel in the Sweden graphic.</p>
<p>Note: the circles take transparency into account, so a transparent circle represents more people than an opaque circle. (Think of it as the people being more spread out when it&apos;s transparent.)</p>
<h2 id="howtousethis">How to use this</h2>
<p>Clicking within the graphic will increment it by one year.</p>
<p>Additionally, viewing the standalone <a href="https://blog.nimishg.com/public/sweden-population/svpop.html">link</a> shows a few more controls at the bottom:</p>
<ul>
<li>The &quot;Base Year&quot; is the year to start the animation on; you can skip around &#x1F603;</li>
<li>The &quot;Animation Speed&quot; is how long it takes the circles to travel from the source to the destination</li>
</ul>
<h2 id="justthedata">Just the data</h2>
<p>If you just want to see the underlying data in graph form, click <a href="https://blog.nimishg.com/public/sweden-population/svpop_chart.html">here</a>.</p>
<h2 id="howimadethis">How I made this</h2>
<p>I coded this primarily using the <a href="https://d3js.org/">d3</a> javascript library.</p>
<h4 id="code">Code</h4>
<p>I&apos;ve put this code up on <a href="https://github.com/nimishgautam/sweden-population">github</a>. Feel free to contact me there with any technical questions.</p>
<h2 id="references">References</h2>
<p>For a full list of references, see the <a href="https://github.com/nimishgautam/sweden-population/blob/master/References.md">github</a> reference file.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Internationalizing a static site with  PHP and nginx]]></title><description><![CDATA[<!--kg-card-begin: markdown--><script src="https://blog.nimishg.com/public/prism.js"></script>
<link rel="stylesheet" href="https://blog.nimishg.com/public/prism.css">
<p>I&apos;m getting married (yay!) and a majority of the guests speak some combination of Swedish, Nepali, or English.</p>
<p>I thought it would be nifty to have a multi-lingual wedding site, where the same URL would present different language versions of the same content based on the user.</p>
<p>Here&</p>]]></description><link>https://blog.nimishg.com/internationalizing-a-static-site-with-php-and-nginx/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb67c</guid><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Sun, 15 May 2016 17:08:49 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2016/05/Screen-Shot-2016-05-15-at-19-04-40.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><script src="https://blog.nimishg.com/public/prism.js"></script>
<link rel="stylesheet" href="https://blog.nimishg.com/public/prism.css">
<img src="https://blog.nimishg.com/content/images/2016/05/Screen-Shot-2016-05-15-at-19-04-40.png" alt="Internationalizing a static site with  PHP and nginx"><p>I&apos;m getting married (yay!) and a majority of the guests speak some combination of Swedish, Nepali, or English.</p>
<p>I thought it would be nifty to have a multi-lingual wedding site, where the same URL would present different language versions of the same content based on the user.</p>
<p>Here&apos;s how I did it.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<h4 id="toolingchoices">Tooling choices</h4>
<p>I decided to use nginx for the web server. I&apos;ve been converting from Apache over the last few years and I figure this would be a great use case.</p>
<p>I decided on PHP for scripting because I wanted something that can stitch HTML files together and deal with a few server variables, nothing fancier.</p>
<p>I chose <a href="https://www.gnu.org/software/gettext/">GNU gettext</a> to handle the various translation files, because it&apos;s fully compatible with <a href="https://poedit.net">poedit</a>.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<p>Finally, the translation strings themselves were provided by friends and family who speak Nepali or Swedish.</p>
<h4 id="selectingalanguage">Selecting a language</h4>
<p>First I had to decide on a mechanism to select a language (other than URL path) and GeoIP wasn&apos;t feasible because the geography of our guests wasn&apos;t a good predictor their language preference.</p>
<p>Luckily, there&apos;s the <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">HTTP Accept-Language</a> header, which specifies what languages a user agent accepts.</p>
<p>Of course, this isn&apos;t always accurate, so I wanted to leave a way of manually selecting a language, and remembering that preference.</p>
<p>And finally, for testing, I wanted to be able to force a particular language to be used no matter what.</p>
<p>In the end, I decided on three separate methods of selection, along with the order that they should be checked:</p>
<ul>
<li>URL query parameter</li>
<li>Saved user preference (via cookie)</li>
<li>The Accept-Language header</li>
</ul>
<p>So, if you&apos;ve never been to the site, you&apos;ll get a translation based on your Accept-Language header. If that&apos;s wrong, you can set your preference and it&apos;ll persist in a cookie. And if you want to override these and force a language, a URL parameter will do it.</p>
<p>For consistency, I decided that the cookie and the URL parameter should both be called &quot;locale&quot;.</p>
<h4 id="acceptlanguageheadernote">Accept-Language Header note</h4>
<p>The header has a format like this:</p>
<pre><code class="language-http">Accept-Language: en;q=0.7
</code></pre>
<p>The <code>q</code> parameter is the quality preference (from 0 to 1) of the user wanting content in that language, but really it&apos;s a best-guess at the user&apos;s language preferences.</p>
<p>Rather than going crazy with this parameter, I decided the presence of a particular language code means that the user will find it pleasantly surprising to get content in that language &#x1F60A;</p>
<h4 id="forcingphptranslation">Forcing PHP translation</h4>
<p>When requesting any HTML page, I wanted to have a PHP script evaluate the proper locale first and do the translation server-side.</p>
<p>This meant all HTML request traffic has to be routed to a single PHP script, and that script, in turn, has to be given the user language preference.</p>
<p>Using <a href="https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html">FastCGI</a>, I put the following into my nginx configuration:</p>
<pre><code class="language-nginx">location ~ [^/]\.htm(l)(/|$)  {
     fastcgi_param PREF_LANGUAGE $pref_language;
     include fastcgi_params;
     fastcgi_param SCRIPT_FILENAME router.php;
     fastcgi_pass unix:/var/run/php5-fpm.sock;
  }
</code></pre>
<p>This forces all .htm and .html locations to go through the <code>router.php</code> file, which will recieve the request URI as <code>$_SERVER[&apos;REQUEST_URI&apos;]</code> and parse/route it accordingly.</p>
<p>The user&apos;s language preference will also be passed along to PHP as <code>$_SERVER[&apos;PREF_LANGUAGE&apos;]</code></p>
<h4 id="cacheing">Cacheing</h4>
<p>I don&apos;t want to repeatedly call PHP to render static pages, so I decided to use nginx&apos;s <a href="https://www.nginx.com/blog/nginx-caching-guide/">built-in cacheing</a> as much as I could.</p>
<p>Every URI being routed by PHP will need to be cached to multiple addresses based on language preference, but everything else about the request (including URL parameters) can be ignored for cacheing purposes.</p>
<p>This means the ideal cacheing scheme is just:</p>
<pre><code class="language-nginx">fastcgi_cache_key &quot;$uri$pref_language&quot;;
</code></pre>
<h4 id="definingtheuserprefvariable">Defining the user pref variable</h4>
<p>Unfortunately, there is no magic variable called <code>$pref_language</code> in nginx &#x1F600;</p>
<p>We need to define it, and due to the <a href="https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if">limitations</a> of nginx&apos;s if-statement, it looks like this: <sup class="footnote-ref"><a href="#fn3" id="fnref3">[3]</a></sup></p>
<pre><code class="language-nginx">set $pref_language &apos;en_US&apos;;
if ($http_accept_language ~* &apos;sv&apos;) {
    set $pref_language &apos;sv_SE&apos;;
}
if ($http_accept_language ~* &apos;ne&apos;){
    set $pref_language &apos;ne_NP&apos;;
}
if ($cookie_locale ~* &apos;sv&apos;){
    set $pref_language &apos;sv_SE&apos;;
}
if ($cookie_locale ~* &apos;ne&apos;){
    set $pref_language &apos;ne_NP&apos;;
}
if ($arg_locale ~* &apos;sv&apos;){
    set $pref_language &apos;sv_SE&apos;;
}
if ($arg_locale ~* &apos;ne&apos;){
    set $pref_language &apos;ne_NP&apos;;
}
</code></pre>
<p>This sets a reasonable default (en_US) and then checks the Accept-Language header, followed by the &apos;locale&apos; cookie, and finally the &apos;locale&apos; URL query parameter for any supported languages.</p>
<p>If it finds any, that language is set as the language preference, otherwise the default is passed along to PHP.</p>
<h4 id="serversidetranslation">Server-side translation</h4>
<p>Finally, we need to get the server to pull up the proper translation and send it back.</p>
<p>First, PHP needs to have <code>gettext</code> defined, so the following line (or something close to it) needs to be in the php.ini file:</p>
<pre><code>extension=gettext.so
</code></pre>
<p>Now, for the PHP routing file itself.</p>
<p>Checking for a valid locale and using the <code>$pref_language</code> variable we defined above is simple enough:</p>
<pre><code class="language-php">$valid_locales = [&apos;en_US&apos;, &apos;sv_SE&apos;, &apos;ne_NP&apos;];
$locale = &apos;en_US&apos;;
if (in_array($_SERVER[&apos;PREF_LANGUAGE&apos;], $valid_locales)){
  $locale = $_SERVER[&apos;PREF_LANGUAGE&apos;];
}
</code></pre>
<p>The second part is a bit trickier because gettext is a little quirky and isn&apos;t easy to debug.</p>
<p>As of this writing, PHP&apos;s Linux implementation of gettext requires you to actually have the desired target locale installed on your machine. If you don&apos;t, everything will appear to be running fine, but you will never see any translated text.</p>
<p>I looked into some of the workarounds, but in the end, the fastest way was to just install the locales. You can do this with the <a href="https://manpages.debian.org/cgi-bin/man.cgi?query=locale-gen&amp;sektion=8"><code>locale-gen</code></a> command. I installed both the regular locales (ne_NP, sv_SE) and their UTF-8 versions (ne_NP.utf8, sv_SE.utf8) just to be safe.</p>
<p>After that, the PHP file should include code to switch to any of the now supported locales.</p>
<pre><code class="language-php">putenv(&quot;LANG=&quot; . $locale);
putenv(&quot;LANGUAGE=&quot; . $locale);
setlocale(LC_ALL, $locale);
</code></pre>
<p>Finally, gettext needs to know the location of the .MO files compiled from poedit.<sup class="footnote-ref"><a href="#fn4" id="fnref4">[4]</a></sup></p>
<p>In the following example, the folder structure is assumed to look like this:</p>
<pre><code>./
&#x251C;&#x2500;&#x2500; router.php
&#x2514;&#x2500;&#x2500; Locale/
    &#x251C;&#x2500;&#x2500; en_US/
    |   &#x2514;&#x2500;&#x2500; LC_MESSAGES/
    |       &#x2514;&#x2500;&#x2500; messages.mo
    &#x251C;&#x2500;&#x2500; ne_NP/
    |   &#x2514;&#x2500;&#x2500; LC_MESSAGES/
    |       &#x2514;&#x2500;&#x2500; messages.mo
    &#x2514;&#x2500;&#x2500; sv_SE/
        &#x2514;&#x2500;&#x2500; LC_MESSAGES/
            &#x2514;&#x2500;&#x2500; messages.mo
</code></pre>
<p>The encoding is also assumed to be UTF-8, which can be set in poedit.</p>
<p>Given the above, the .MO files are specified with the following code:</p>
<pre><code class="language-php">$folder_name = &quot;Locale&quot;;
$translation_file = &quot;messages&quot;;
bindtextdomain($translation_file, $folder_name);
bind_textdomain_codeset($translation_file, &apos;UTF-8&apos;);
textdomain($translation_file);
</code></pre>
<p>From this point onwards, gettext will be aliased to the <code>_()</code> function, meaning <code>_(&quot;Text&quot;)</code> will evaluate out to the translation of the string <code>&quot;Text&quot;</code> in the desired locale assuming everything went well.</p>
<h4 id="code">Code</h4>
<p>Unfortunately, I bought a proprietary (but very nice) <a href="http://themeforest.net/item/aimer-wedding-template-for-lovers/11308572">theme</a> for the skeleton of the site, so I can&apos;t share the full code in a public repo. If there&apos;s interest, though, I can check in some of the example configs shown here.</p>
<p>Hope this helps some others wandering into internationalization territory!</p>
<hr>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>My code was much more redundant and complicated; I&apos;ve simplified here so others can get a more usable example. <a href="#fnref1" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
<li id="fn2" class="footnote-item"><p>Poedit is a program for non-technical people to be able to generate .MO and .PO translation files and is way better than giving your friends and family a random list of strings and asking them to translate it. <a href="#fnref2" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
<li id="fn3" class="footnote-item"><p>It&apos;s much better to define this variable in PHP, but it needs to (at least partially) be defined in nginx for cacheing as well. My actual version of this code does it in a less monolithic if-statement way, but was simplified for clarity here. <a href="#fnref3" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
<li id="fn4" class="footnote-item"><p>You can compile the messages yourself with the <strong>msgfmt</strong> command as well. <a href="#fnref4" class="footnote-backref">&#x21A9;&#xFE0E;</a></p>
</li>
</ol>
</section>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Org-Mode: the reason to use Emacs]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><a href="https://orgmode.org">Org-mode</a> is a subsystem inside the <a href="https://www.gnu.org/software/emacs/">emacs</a> text editor that&apos;s used for making todo lists and organizing tasks.</p>
<h2 id="whyitsawesome">Why it&apos;s awesome</h2>
<p>I&apos;ve tried to find some task-tracking system that works for me personally for years now. Despite all the high tech solutions available, I&</p>]]></description><link>https://blog.nimishg.com/org-mode-the-reason-to-use-emacs/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb67b</guid><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Sun, 15 May 2016 14:52:17 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2016/05/mobileorg-1.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.nimishg.com/content/images/2016/05/mobileorg-1.jpg" alt="Org-Mode: the reason to use Emacs"><p><a href="https://orgmode.org">Org-mode</a> is a subsystem inside the <a href="https://www.gnu.org/software/emacs/">emacs</a> text editor that&apos;s used for making todo lists and organizing tasks.</p>
<h2 id="whyitsawesome">Why it&apos;s awesome</h2>
<p>I&apos;ve tried to find some task-tracking system that works for me personally for years now. Despite all the high tech solutions available, I&apos;ve always used pen and paper and then transcribed my information into different tools when needed.</p>
<p>With Org-mode, I&apos;ve finally found something computer-based that I can adapt to my needs.</p>
<h4 id="fluidstructure">Fluid structure</h4>
<p>Most <abbr title="Personal Information Management">PIM</abbr> systems require you to make a decision upfront about what you&apos;re creating. Is it a todo item? A checklist? Is it a random side-note? An appointment?</p>
<p>Even with the best UI, being asked to categorize the task is enough to take you away from the mental context you&apos;re in. For a brainstorming session, which usually takes place in a creative setting, you can permanently lose some ideas in the context-switch.</p>
<p>Conventional wisdom solves this by having you take free-form creative notes first, and then structure them afterwards. At best, this would be during the planning session&apos;s downtime. Even then, though, you need to have mastered your tools enough to take advantage of built-in calendars, reminders, and trackers without losing your train of thought.</p>
<blockquote>
<p>Org-mode keeps you in the flow.</p>
</blockquote>
<p>Fundamentally, in Org-mode, you&apos;re just adding supplemental annotations to your unstructured, free-form notes.</p>
<h4 id="singlepointsofreference">Single points of reference</h4>
<p>This simple non-structure lets you keep all information associated with a task or event in one spot.</p>
<p>Linking between and within files is also done in a dynamic and natural way, so you can keep a single point of reference without having to copy/paste arbitrary reference strings.</p>
<p>For instance, typing in <code>[[foo]]</code> will create a link to the first occurrence of &apos;foo&apos; in the document, done internally as a search, so the anchor point won&apos;t ever be out of sync with the anchor content.</p>
<h4 id="humanreadabledata">Human-readable data</h4>
<p>All annotations are human-readable and editable as plain text.</p>
<p>Simply writing <code>TODO</code> in front of a bullet point is enough to mark it as a task, or <code>DEADLINE</code> followed by a date in angle brackets to mark a deadline.</p>
<p>All such annotations have faster ways of entering them, but the end result is always something that can be edited and that makes sense as plain text.</p>
<h4 id="ideconveniences">IDE conveniences</h4>
<p>Because emacs cas the capacities of an IDE, you get everything you&apos;re used to in an IDE.</p>
<p><strong>Syntax Highlighting</strong><br><br>
This comes in handy for easily viewing different task states</p>
<p><strong>Folding Code Blocks</strong><br><br>
In this case, the &apos;code blocks&apos; are bullet points for an outline, but it lets you hide away long chunks of text that might not be relevant.</p>
<p>Actually, quite a few features center around giving you a folded/unfolded configuration that surfaces the most relevant information.</p>
<p><strong>Code Outlines</strong><br><br>
Though this requires an <a href="https://www.emacswiki.org/emacs/SpeedBar">additional component</a>, you can get outlines of multiple files on a side pane, so you can see where specific tasks and events are defined.</p>
<p><strong>Heavy customization</strong><br><br>
There are quite a few per-file directives that can be included depending on what IDE behavior you want while handling that given file. Though this wouldn&apos;t make sense with normal source files, it&apos;s very convenient here when the content of every file can vary so greatly.</p>
<h4 id="supportfromtheemacsuniverse">Support from the Emacs universe</h4>
<p>Emacs lends itself to heavy tweaking and customization, and this particular extension has been used for over a decade, so there are plenty of user plugins available to create whatever behavior you might need.</p>
<h2 id="whyitsnotsoawesome">Why it&apos;s not so awesome</h2>
<p>Of course, there are pain points as well. These are some of the biggest ones I&apos;ve encountered.</p>
<h4 id="confinedtotheemacsuniverse">Confined to the Emacs universe</h4>
<p>A bit of a double-edged sword &#x1F600;</p>
<p>While there&apos;s great integration with Emacs&apos;s own <a href="https://www.emacswiki.org/emacs/CategoryBbdb">contact manager</a>, and <a href="https://www.emacswiki.org/emacs/CategoryMail">email managers</a> it feels very unstable when integrating with other technology.</p>
<p>For instance, I&apos;ve set up a sync with Google Calendar, but the code is very brittle, uses some hacks to make these two formats compatible and will most likely take hours of tweaking to fix if/when anything changes with Google API.</p>
<h4 id="requiresanide">Requires an IDE</h4>
<p>Though it&apos;s great while using a computer or laptop, it comes from an era without cloud storage and mobile dominance, and it shows.</p>
<p>There is <a href="http://orgmode.org/manual/MobileOrg.html">MobileOrg</a>, which allows you to read and write org files (syncing via <a href="http://www.webdav.org/">WebDAV</a>), but the use cases with mobile just don&apos;t as easily lend themselves to unstructured annotated text, meaning without an IDE and a keyboard, there&apos;s no clear advantage anymore.</p>
<h4 id="youneedtobeaprogrammer">You need to be a programmer</h4>
<p>This isn&apos;t <em>strictly</em> true, of course, but it definitely helps.</p>
<p>I like having desktop notifications about calendar activities, and it only took me a few hours to find out how to get Emacs to produce them in OSX. For a non-technical person, making this small tweak might be impossible.</p>
<p>There&apos;s lots of documentation available, but you need to come in with a heavy amount of programming experience to really make it work for you.</p>
<h4 id="noreasonabledefaults">No reasonable defaults</h4>
<p>This is also subjective, but the default settings and appearance make it feel unusable. As mentioned above, you can change this, but not without significant time and effort.</p>
<p>I&apos;ll write a future blog post about the changes I made, along with why.</p>
<h2 id="overall">Overall</h2>
<p>All that being said, I really like it; I&apos;ve been using it to organize tasks for the last few months and I keep finding new, useful, &apos;hidden&apos; features in it every day.</p>
<p>So, use it if:</p>
<ul>
<li>You are an efficiency nerd</li>
<li>You want a heavily customized task/note-taking/scheduling system</li>
<li>You are comfortable with programming</li>
<li>You&apos;re ok with picking up a new programming language (elisp)</li>
<li>You want to design your perfect workflow system</li>
</ul>
<p>Do not use if:</p>
<ul>
<li>You don&apos;t know your own workflow well enough describe your ideal system</li>
<li>Building a system like the above doesn&apos;t sound fun for you</li>
<li>You do task/note-taking/scheduling more on mobile devices than desktop</li>
</ul>
<p>Happy organizing!</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Ergodox - one week in]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><em>(continued from <a href="https://blog.nimishg.com/ergo-all-the-way/">earlier</a>)</em></p>
<p>I&apos;ve been typing on my Ergodox keyboard for about a week now.  First off, though, the keycaps haven&apos;t come in, so I&apos;ve had to make due with a standard set from a normal keyboard. This means that the keys are raisesd</p>]]></description><link>https://blog.nimishg.com/ergodox-the-first-stages-2/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb688</guid><category><![CDATA[Tech]]></category><category><![CDATA[Ergonomics]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Sun, 25 Jan 2015 16:47:44 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><em>(continued from <a href="https://blog.nimishg.com/ergo-all-the-way/">earlier</a>)</em></p>
<p>I&apos;ve been typing on my Ergodox keyboard for about a week now.  First off, though, the keycaps haven&apos;t come in, so I&apos;ve had to make due with a standard set from a normal keyboard. This means that the keys are raisesd (the Ergodox was designed for flat keys) but also means that the nonstandard-sized keys are just arranged on there randomly.</p>
<p>Observe:</p>
<p><img src="https://blog.nimishg.com/content/images/2015/01/IMG_0044.JPG" alt="Random keys everywhere" loading="lazy"></p>
<h4 id="mappings">Mappings</h4>
<p>I&apos;ve been adjusting and tweaking the key mappings as much as I can, and adding a surprising number of application-specific mappings in there as well.</p>
<p>For instance, I find it much easier to just know that I have special arrow-keys that move the cursor left and right in the terminal or the Ipython QTconsole rather than trying to remember the keybindings on these programs.</p>
<p>I&apos;ve also tried to use keycaps that roughly correspond to my layer 0 mappings, and I suspect I&apos;ll need or want a visual reminder for quite some time.</p>
<h4 id="overallimpressions">Overall impressions</h4>
<p>I have to say, I&apos;m not sure if it&apos;s the psychology behind it or what, but the Cherry MX switches actually feel really really nice to type with. Also, because the muscles required are slightly different than they are when using a laptop, there&apos;s this feel of slightly new fine motor awareness developing in my hand.</p>
<p>The thumb buttons, the biggest reason I wanted to switch over, do take a while to get adjusted to. Particularly, the two thumb buttons at the very top are hard to reach without moving your hand significantly.</p>
<p>In general, I&apos;m liking it, but like I said, I&apos;m still tweaking the layout and playing with different possible functions.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Ergo all the way]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="theproblem">The problem</h3>
<p>A few weeks ago, I noticed my right pinkie was sore. Not just sore, but it felt like it&apos;d been severely strained.</p>
<p>I started looking at what I did all day. Here&apos;s the keyboard I use at work, with all the keys I use</p>]]></description><link>https://blog.nimishg.com/ergo-all-the-way-2/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb687</guid><category><![CDATA[Tech]]></category><category><![CDATA[Ergonomics]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Wed, 21 Jan 2015 17:49:33 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2015/01/mac-keybd-right-pinkie-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="theproblem">The problem</h3>
<img src="https://blog.nimishg.com/content/images/2015/01/mac-keybd-right-pinkie-1.png" alt="Ergo all the way"><p>A few weeks ago, I noticed my right pinkie was sore. Not just sore, but it felt like it&apos;d been severely strained.</p>
<p>I started looking at what I did all day. Here&apos;s the keyboard I use at work, with all the keys I use my right pinkie for highlighted:<br>
<img src="https://blog.nimishg.com/content/images/2015/01/mac-keybd-right-pinkie.png" alt="Ergo all the way" loading="lazy"></p>
<p>There are probably hand positions that would allow me to hit these keys better, but I had it hammered in to me in highschool that your hands <strong>never</strong> leave the home row.  So, I have a sore pinkie.</p>
<p>This seems a bit insane considering this is the <em>normal</em> usage an adult pinkie gets:<br>
<img src="https://blog.nimishg.com/content/images/2015/01/pope_pinkie.jpg" alt="Ergo all the way" loading="lazy"></p>
<p>Meanwhile, my thumbs, 2 of the stronger more dexterous fingers, are stuck using the comedically large spacebar.</p>
<h3 id="theanalysis">The analysis</h3>
<p>Well, there are two issues here:</p>
<ol>
<li>The keyboard, as it is designed right now, sucks.</li>
</ol>
<ul>
<li>My usage of many of these keys, most notably the arrow keys, needs to be improved.</li>
</ul>
<p>So, this gives me two seperate solutions to explore.</p>
<h5 id="ergodoxthekeyboardmoneycantbuy">Ergodox, the keyboard money can&apos;t buy</h5>
<p>Yeah, I could find an &apos;ergonomic&apos; keyboard, but those still overutilize your pinkies and underutilize your thumbs.</p>
<p>I started searching for keyboards that might actually take this into consideration, and, commercially, I could only really find one: <a href="http://www.kinesis-ergo.com/shop/advantage-for-pc-mac/">The Kinesis Advantage</a>.</p>
<p>It&apos;s a weird-looking keyboard, also kind of huge. It&apos;s also maybe not the best layout. It looks like it had regular typists in mind and not really programmers. So I looked for a programmer-keyboard.</p>
<p>I finally found one: <a href="http://ergodox.org/">The Ergodox</a><br>
<img src="https://blog.nimishg.com/content/images/2015/01/ErgoDox_001.png" alt="Ergo all the way" loading="lazy"></p>
<p>Pretty sweet looking, huh? Not only that, but it&apos;s open-source design and fully programmable, meaning the keys do whatever you want them to. Make the mouse click, write out a sentence, whatever.  Just one problem: <strong>no one sells them</strong>.</p>
<p>Yep, that&apos;s just a rendering. If you want one, you&apos;ll have to 3D print all the parts, solder it together, compile the firmware, and then maybe you can start typing.</p>
<p>Eventually, I found a website called <a href="https://www.massdrop.com/buy/ergodox?s=ergodox">massdrop</a> that sells them in bulk, unassembled, from time to time. This is alot of work for a keyboard.</p>
<p>After some more hunting around, I found this website called <a href="http://falbatech.pl">Falbatech</a> that offers the individual keyboard components, and assembly at a fee.</p>
<p>So, basically the keyboard except for the actual key tops. Fair enough. I ordered it piecemeal and it costed a bit more, but I&apos;m impatient, so it worked out ok.</p>
<h5 id="vimtheeditorthatjustwontquit">Vim, the editor that just won&apos;t quit</h5>
<p>So, now the next part is my typing habits.</p>
<p>I navigate around with the arrow keys quite a bit. Rather than copying and pasting or doing anything sensible like that, typically I&apos;ll just backspace mindlessly until I hit the word I wanted to edit, and re-write everything afterwards.</p>
<p>Enter <a href="http://www.vim.org/">Vim</a>, the text-editor based off the editing system designed <a href="https://en.wikipedia.org/wiki/Vi">in 1976</a>. Those who don&apos;t know, there&apos;s a holy-war amongst Computer Programmers as to which is the better editor, Vim or <a href="http://www.gnu.org/software/emacs/">Emacs</a>.</p>
<p><img src="https://blog.nimishg.com/content/images/2015/01/emacs-vim-icons.png" alt="Ergo all the way" loading="lazy"></p>
<p>While both sides have some interesting points, the key came down to ergonomics for me. Most of Emacs&apos; functions come from chorded keystrokes, and because of this, I&apos;ve read more from Emacs users about repetitive stress injuries.</p>
<p>In fact, they get the very <a href="https://www.google.com/#safe=off&amp;q=emacs+pinky">right pinkie</a> injury I&apos;m trying to fix. There are reccomendations on how to avoid it, but I think I should just play it safe and stick to the editor commands that will better suit my neeeds.</p>
<p>Vim + Ergodox. Let the experiment begin!</p>
<h6 id="noteonergodoxfirmware">Note on Ergodox firmware:</h6>
<p>So, while massdrop gives you a nice <a href="https://www.massdrop.com/ext/ergodox/">configurator tool</a> for your keyboard,  <a href="https://github.com/benblazak/">this guy</a> wrote the actual firmware and you&apos;ll want to use that if you want macros or anything interesting like that.</p>
<p>I forked the code and attempted a manual merge of some <a href="https://github.com/benblazak/ergodox-firmware/pull/28/files#diff-68c80b7ec6db8052483242e86572c46eR56">older code</a>.  This is <a href="https://github.com/nimishgautam/ergodox-firmware/tree/partial-rewrite">my fork</a>.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Infinite Hype]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>After several years, I&apos;m suddenly working for a for-profit. Not just a for-profit, but one that exists in the realm of &quot;Social Media&quot;. I still don&apos;t know how I feel about that.</p>
<p>Generally, my eyes glaze over and my brain tunes out when I</p>]]></description><link>https://blog.nimishg.com/infinite-hype-2/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb686</guid><category><![CDATA[Philosophy]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Tue, 07 Oct 2014 18:51:55 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2014/10/Screen-Shot-2014-10-01-at-21-55-08.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.nimishg.com/content/images/2014/10/Screen-Shot-2014-10-01-at-21-55-08.png" alt="Infinite Hype"><p>After several years, I&apos;m suddenly working for a for-profit. Not just a for-profit, but one that exists in the realm of &quot;Social Media&quot;. I still don&apos;t know how I feel about that.</p>
<p>Generally, my eyes glaze over and my brain tunes out when I hear the phrase. When someone says &quot;I work in social media,&quot; I hear &quot;I study the hype that&apos;s left over once you&apos;ve stripped an idea of its honesty and creativity.&quot;</p>
<p>Then I think of what happens when this field is legitimized. We end up trading and exchanging <em>hype</em> about goods instead of the goods themselves.  Taken to the exteme, you get markets that crash <a href="http://www.marketwatch.com/story/twitter-trading-influence-laid-bare-by-fake-tweet-2013-04-23">because of a tweet</a>.  This is nothing new; the stock market has always been subject to rumors and speculation.</p>
<p>Only now, we capture every microscopic inclination anyone has; every granular move towards or away from liking or disliking a product becomes a ripple that&apos;s amplified and magnified to something beyond what the original person could have ever intended.</p>
<p>On some level, it deeply disturbs me that social value is being created by this process. On the other hand, it deeply fascinates me.</p>
<p>I&apos;ve seen so many projects, products and services that were genuinely amazing. The problem is, no one else knew about them. I have a laptop that&apos;s 14 years old and accepts pressure-sensitive input on its LCD surface and has a pixel density that makes it look like actual paper.  Apple came up with the same technology a decade later, without the pressure-sensitivity, called it an iPad Retina, and made a fortune.</p>
<p>Inferior technology, inferior imagined applications, but superior hype. When done right, social media and marketing campaigns take something second-rate and make it cutting-edge.</p>
<p>And I wonder if this can&apos;t be used for good. I want to believe it&apos;s possible.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[History auto-complete in bash]]></title><description><![CDATA[<!--kg-card-begin: markdown--><script src="https://blog.nimishg.com/public/prism.js"></script>
<link rel="stylesheet" href="https://blog.nimishg.com/public/prism.css">
<p>Sometimes, when using <a href="https://www.gnu.org/software/bash/bash.html">bash</a>, you want to find a command in your history that starts with something you remember. Rather than scrolling through hundreds of commands that just read <em>cd</em>, <em>ls</em>, <em>pwd</em>, etc, you can search your bash history.</p>
<p>Put the following in your <em>.bashrc</em> file:</p>
<pre><code class="language-bash">bind &apos;&quot;\e[</code></pre>]]></description><link>https://blog.nimishg.com/history-auto-complete-in-bash-2/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb685</guid><category><![CDATA[Tech]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Sun, 07 Sep 2014 15:18:42 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><script src="https://blog.nimishg.com/public/prism.js"></script>
<link rel="stylesheet" href="https://blog.nimishg.com/public/prism.css">
<p>Sometimes, when using <a href="https://www.gnu.org/software/bash/bash.html">bash</a>, you want to find a command in your history that starts with something you remember. Rather than scrolling through hundreds of commands that just read <em>cd</em>, <em>ls</em>, <em>pwd</em>, etc, you can search your bash history.</p>
<p>Put the following in your <em>.bashrc</em> file:</p>
<pre><code class="language-bash">bind &apos;&quot;\e[A&quot;: history-search-backward&apos;
bind &apos;&quot;\e[B&quot;: history-search-forward&apos;
</code></pre>
<p>This will bind the up and down arrows and let you search easier.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Hello World: A web presence]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I <em>finally</em> have a web presence.</p>
<p>I bought a domain name a few years back and literally never used it for anything. I was able to repurchase it, thankfully.</p>
<p>I think, working in the world of computers, I felt that I would be expected to make something amazing as my</p>]]></description><link>https://blog.nimishg.com/hello-world-a-web-presence-2/</link><guid isPermaLink="false">61f53ddc83ff8a56ca1bb684</guid><category><![CDATA[rambling]]></category><dc:creator><![CDATA[Nimish Gåtam]]></dc:creator><pubDate>Sun, 07 Sep 2014 15:11:23 GMT</pubDate><media:content url="https://blog.nimishg.com/content/images/2014/09/hello-world.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.nimishg.com/content/images/2014/09/hello-world.png" alt="Hello World: A web presence"><p>I <em>finally</em> have a web presence.</p>
<p>I bought a domain name a few years back and literally never used it for anything. I was able to repurchase it, thankfully.</p>
<p>I think, working in the world of computers, I felt that I would be expected to make something amazing as my personal site. Of course, the practical result of this thought process is that I ended up making nothing.</p>
<p>So now, I&apos;ve created something, and set up lots of new technology on a cloud server that I&apos;ll hopefully be able to curate in some way or another. And I&apos;ll try to actually use it. Even if it is just a resume-site, even if I just post pictures of my breakfast and occasional (hopefully useful) snippets of code, I&apos;ll try to use these things instead of letting them go to waste.</p>
<p>Because each one of those things mentioned above helps to improve writing and expression, so when it comes time to talk about something more important than breakfast, I&apos;ll be ready.</p>
<p>Hello world.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>