-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.json
More file actions
1 lines (1 loc) · 121 KB
/
index.json
File metadata and controls
1 lines (1 loc) · 121 KB
1
[{"content":"I am reframing the goals of this blog.\nFor a long time I wanted to create content like 3Blue1Brown or Math3ma. Short and insightful. Most importantly something brand new. I new way to look at something. Something unique. But I have come to the realization that I am not capable of that. At least not yet.\nAlso looking at the history of all the creators I admire, they have some terrible stuff under their belt. Making mistakes is the only way to get good. Making mistakes publically has always been emotionally challenging for me. But the only way to grow is to take on these kinds of challenges.\nSo this is going to be a rough ride. Please keep that in mind before referring to the content here.\n","permalink":"https://harshcurious.com/posts/restart/","summary":"I am reframing the goals of this blog.\nFor a long time I wanted to create content like 3Blue1Brown or Math3ma. Short and insightful. Most importantly something brand new. I new way to look at something. Something unique. But I have come to the realization that I am not capable of that. At least not yet.\nAlso looking at the history of all the creators I admire, they have some terrible stuff under their belt.","title":"Restart"},{"content":"Mean and It\u0026rsquo;s Variants Book Recommendation I started reading the book Practical Statistics for Data Scientists. I had read the time series portion of it during a work project, and put it on my to read list. I am finally getting around to it and I am really enjoying it so far. If you need like a quick overview of a lot of stats ideas this is great.\nIf you have seen stat/math like it and want a quick referesher/introduction than great. Otherwise I am not sure if this would be right for you.\nMean Obviously, $$ \\bar{x} = \\dfrac{\\sum_{i=0}{n-1}x_i}{n}$$ where n is the number of elements/datapoints\nEvery high school student has probably seen this. Remember that it gives very little information about your dataset.\n","permalink":"https://harshcurious.com/posts/mean_variants/","summary":"Mean and It\u0026rsquo;s Variants Book Recommendation I started reading the book Practical Statistics for Data Scientists. I had read the time series portion of it during a work project, and put it on my to read list. I am finally getting around to it and I am really enjoying it so far. If you need like a quick overview of a lot of stats ideas this is great.\nIf you have seen stat/math like it and want a quick referesher/introduction than great.","title":"Mean_variants"},{"content":" Source: https://stackoverflow.com/questions/36308531/how-to-uninstall-all-unused-packages-in-a-conda-virtual-environment\nIf you are anything like me you start multiple data science projects. To make things a little easier I make multiple conda environments. Conda does a decent job at reducing the space used my the packages[^symlinks]. But over time the conda folders can become boated. It\u0026rsquo;s a good idea to do this regularly.\nconda clean --yes --all The all flag clears packages, and tarball used in the installation process.\nYou can also add a dry-run flag:\nconda clean --all --dry-run to check the size of unused packages. Can be quite large, if you have deleted/updated any conda environment!\n","permalink":"https://harshcurious.com/posts/clean_conda_cache/","summary":"Source: https://stackoverflow.com/questions/36308531/how-to-uninstall-all-unused-packages-in-a-conda-virtual-environment\nIf you are anything like me you start multiple data science projects. To make things a little easier I make multiple conda environments. Conda does a decent job at reducing the space used my the packages[^symlinks]. But over time the conda folders can become boated. It\u0026rsquo;s a good idea to do this regularly.\nconda clean --yes --all The all flag clears packages, and tarball used in the installation process.","title":"Cleaning conda package cache"},{"content":"Option 1: GUI Right click on the app launcher and select Edit Applications from the menu. This should launch a menu editor. Make the desired edits and save them.\nOption 2: Terminal The menu applications are stored in /usr/share/applications/. If you want to make an edit to an existing application, edit the file: application_NAME.desktop. You can search for it using: ls | grep 'search_term'.[^ripgep] Don\u0026rsquo;t forget to use sudo for editing the file.\nIf you want to add a new application, create a new .desktop file:\ncd /usr/share/applications/ sudo touch program-shortcut.desktop sudo chmod +x program-shortcut.desktop sudo nano program-shortcut.desktop Edit the .desktop file by adding the following\n[Desktop Entry] Name=Display Name GenericName=Monitor Settings Comment=Add a description and other words to improve searchability Exec=/path/to/bin Icon=/path/to/icon Terminal=false #to start a terminal or not Type=Application Categories=GTK;Settings;HardwareSettings; Note that you can run python programs using Exec=python /path/to/python/app. Similarly, for other languages!\n","permalink":"https://harshcurious.com/posts/applicationmenushortcutkde/","summary":"Option 1: GUI Right click on the app launcher and select Edit Applications from the menu. This should launch a menu editor. Make the desired edits and save them.\nOption 2: Terminal The menu applications are stored in /usr/share/applications/. If you want to make an edit to an existing application, edit the file: application_NAME.desktop. You can search for it using: ls | grep 'search_term'.[^ripgep] Don\u0026rsquo;t forget to use sudo for editing the file.","title":"Application Menu Shortcut KDE"},{"content":"Adding Environments to JupyterLab Source: https://janakiev.com/blog/jupyter-virtual-envs/\nActivate the environment: conda activate my_env Install ipykernel in your environment. Using: pip install --user ipykernel conda install -c conda-forge ipykernel Run the following to add the current kernel1 to jupyterlab installation in base environment: python -m ipykernel install --user --name=udemy-data-science Removing Environments from JupyterLab Check the list using: jupyter kernelspec list Remove a kernel using: jupyter kernelspec uninstall myenv So don\u0026rsquo;t forget to activate the environment first.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/jupyterlab_environment/","summary":"Adding Environments to JupyterLab Source: https://janakiev.com/blog/jupyter-virtual-envs/\nActivate the environment: conda activate my_env Install ipykernel in your environment. Using: pip install --user ipykernel conda install -c conda-forge ipykernel Run the following to add the current kernel1 to jupyterlab installation in base environment: python -m ipykernel install --user --name=udemy-data-science Removing Environments from JupyterLab Check the list using: jupyter kernelspec list Remove a kernel using: jupyter kernelspec uninstall myenv So don\u0026rsquo;t forget to activate the environment first.","title":"JupyterLab Python Environments"},{"content":" From https://stackoverflow.com/questions/2545602/how-to-git-ignore-subfolders-subdirectories\nTo ignore Solutions/projects/bin/Debug but not bin/Debug\nSolution/*/bin/Debug you can also use the ** wildcard to match any level of subdirectories:\n**/bin/Debug/ Bonus Content: Remove existing git tracked files Now say you had a folder (commited to your git repository) that you now wanted to remove altogether from your repository. First add it to your gitignore file. Then do one of the following steps.\nhttps://stackoverflow.com/questions/7075923/resync-git-repo-with-new-gitignore-file\nExtreme\ngit rm -r --cached\rgit add .\rgit commit -m \u0026#34;Updated .gitignore\u0026#34; Controlled (didn\u0026rsquo;t work for me last time around):\ngit rm --cached `git ls-files -i --exclude-standard` ","permalink":"https://harshcurious.com/posts/gitignore_subfolder/","summary":"From https://stackoverflow.com/questions/2545602/how-to-git-ignore-subfolders-subdirectories\nTo ignore Solutions/projects/bin/Debug but not bin/Debug\nSolution/*/bin/Debug you can also use the ** wildcard to match any level of subdirectories:\n**/bin/Debug/ Bonus Content: Remove existing git tracked files Now say you had a folder (commited to your git repository) that you now wanted to remove altogether from your repository. First add it to your gitignore file. Then do one of the following steps.\nhttps://stackoverflow.com/questions/7075923/resync-git-repo-with-new-gitignore-file\nExtreme\ngit rm -r --cached\rgit add .","title":"How to remove subfolders/subdirectories from git tracking"},{"content":"Understanding Commands: pandas.append() Basic Usage \u0026gt;\u0026gt;\u0026gt; import pandas as pd \u0026gt;\u0026gt;\u0026gt; df = pd.DataFrame([[1, 2], [3, 4]], columns=list(\u0026#39;AB\u0026#39;), index=[\u0026#39;x\u0026#39;, \u0026#39;y\u0026#39;]) \u0026gt;\u0026gt;\u0026gt; df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list(\u0026#39;AB\u0026#39;), index=[\u0026#39;x\u0026#39;, \u0026#39;y\u0026#39;]) \u0026gt;\u0026gt;\u0026gt; df.append(df2) A B x 1 2 y 3 4 x 5 6 y 7 8 \u0026gt;\u0026gt;\u0026gt; df A B x 1 2 y 3 4 \u0026gt;\u0026gt;\u0026gt; new = df.append(df2) \u0026gt;\u0026gt;\u0026gt; new A B x 1 2 y 3 4 x 5 6 y 7 8 \u0026gt;\u0026gt;\u0026gt; df A B x 1 2 y 3 4 \u0026gt;\u0026gt;\u0026gt; df2 A B x 5 6 y 7 8 \u0026gt;\u0026gt;\u0026gt; new.loc(\u0026#39;x\u0026#39;) Traceback (most recent call last): File \u0026#34;/opt/anaconda/lib/python3.8/site-packages/pandas/core/generic.py\u0026#34;, line 546, in _get_axis_number return cls._AXIS_TO_AXIS_NUMBER[axis] KeyError: \u0026#39;x\u0026#39; During handling of the above exception, another exception occurred: Traceback (most recent call last): File \u0026#34;\u0026lt;stdin\u0026gt;\u0026#34;, line 1, in \u0026lt;module\u0026gt; File \u0026#34;/opt/anaconda/lib/python3.8/site-packages/pandas/core/indexing.py\u0026#34;, line 637, in __call__ axis = self.obj._get_axis_number(axis) File \u0026#34;/opt/anaconda/lib/python3.8/site-packages/pandas/core/generic.py\u0026#34;, line 548, in _get_axis_number raise ValueError(f\u0026#34;No axis named {axis} for object type {cls.__name__}\u0026#34;) ValueError: No axis named x for object type DataFrame \u0026gt;\u0026gt;\u0026gt; new.iloc(1) \u0026lt;pandas.core.indexing._iLocIndexer object at 0x7fb5d1ff09a0\u0026gt; \u0026gt;\u0026gt;\u0026gt; new.iloc[1] A 3 B 4 Name: y, dtype: int64 \u0026gt;\u0026gt;\u0026gt; new.iloc[0] A 1 B 2 Name: x, dtype: int64 \u0026gt;\u0026gt;\u0026gt; new.loc[\u0026#39;x\u0026#39;] A B x 1 2 x 5 6 Learnt/Recalled:\nappend does not work inplace by default! Need to call loc/iloc with square bracket, [], not parenthesis (). \u0026gt;\u0026gt;\u0026gt; df1 = pd.DataFrame([[1, 2], [3, 4]], columns=list(\u0026#39;CD\u0026#39;), index=[\u0026#39;x\u0026#39;, \u0026#39;y\u0026#39;]) \u0026gt;\u0026gt;\u0026gt; df.append(df1) A B C D x 1.0 2.0 NaN NaN y 3.0 4.0 NaN NaN x NaN NaN 1.0 2.0 y NaN NaN 3.0 4.0 \u0026gt;\u0026gt;\u0026gt; df3 = pd.DataFrame([[1, 2], [3, 4]], columns=list(\u0026#39;CE\u0026#39;), index=[\u0026#39;x\u0026#39;, \u0026#39;y\u0026#39;]) \u0026gt;\u0026gt;\u0026gt; df1.append(df3) C D E x 1 2.0 NaN y 3 4.0 NaN x 1 NaN 2.0 y 3 NaN 4.0 ","permalink":"https://harshcurious.com/posts/pandas_append/","summary":"Understanding Commands: pandas.append() Basic Usage \u0026gt;\u0026gt;\u0026gt; import pandas as pd \u0026gt;\u0026gt;\u0026gt; df = pd.DataFrame([[1, 2], [3, 4]], columns=list(\u0026#39;AB\u0026#39;), index=[\u0026#39;x\u0026#39;, \u0026#39;y\u0026#39;]) \u0026gt;\u0026gt;\u0026gt; df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list(\u0026#39;AB\u0026#39;), index=[\u0026#39;x\u0026#39;, \u0026#39;y\u0026#39;]) \u0026gt;\u0026gt;\u0026gt; df.append(df2) A B x 1 2 y 3 4 x 5 6 y 7 8 \u0026gt;\u0026gt;\u0026gt; df A B x 1 2 y 3 4 \u0026gt;\u0026gt;\u0026gt; new = df.append(df2) \u0026gt;\u0026gt;\u0026gt; new A B x 1 2 y 3 4 x 5 6 y 7 8 \u0026gt;\u0026gt;\u0026gt; df A B x 1 2 y 3 4 \u0026gt;\u0026gt;\u0026gt; df2 A B x 5 6 y 7 8 \u0026gt;\u0026gt;\u0026gt; new.","title":"Some basic experiments with the pandas' append command"},{"content":"Recently I was reading a beautiful interview of Amartya Sen done by The Harvard Gazette. You can read my higlights over at hypothes.is This reminded me of the first time I read a paper by Amartya Sen.\nBack when I was in the ninth grade I was required to do a project for my Social Studies class. The topic allotted to me was \u0026ldquo;Should we have caste based reservation?\u0026rdquo; Heavy stuff 😩, especially for my 14-year-old ass.1\nI did what every, I felt I needed to do. Read economics papers2 on caste-based economic inequality. Of those the most challenging one was a paper by Amartya Sen. (I tried to look it up, but I can\u0026rsquo;t find it anymore. From what I remember it was on social inequality and its economic consequences.) Athough I remember very little of the paper, it had a profound impact on me as a human being. In modern terminology it would probably be called intersectional social justice or something like that. I am not an expert.\nReading all the evidence I did, I came to the obvious conclusion that there is a genuine caste-based economic and social disparity. The caste based reservations don\u0026rsquo;t lead to much social progression for the SC and ST communities, but it does help some individuals from those communities to gain more social acceptance and economic. That\u0026rsquo;s something better than nothing. Don\u0026rsquo;t get me wrong, these reservations have lead to massive intra-caste inequalities within these castes. But that\u0026rsquo;s the story of modern capitalism. Capital begets capital in the modern world. Labour begets little if anything.\nBack to my story. I submitted an early version of my project to my school teacher. The only suggestion he made was correcting a few typos I had. But I could see it in his eyes that this was not the conclusion he agreed with. Eventually, I got a B for the project. Because I stuck with my guns. I had read at least 5 papers. I had read some NSSO (National Sample Survey Organisation) data. After this incident, I decided never to study anything related to humanities and social sciences. I felt that the quality didn\u0026rsquo;t matter in these fields, only conclusions did. Math was so much better. If you can prove something it\u0026rsquo;s true, if you can disprove something it\u0026rsquo;s false. Some random person is not going to decide based on whatever random criteria they came up with.\nFor context, I used to read most of my social studies books in the summer break before the academic year started. I came third at the all-India level of the INCA National Map Quiz right about then. These tiny things matter so much to a young student. It\u0026rsquo;s frightening how deep our influences go. How many trivial actions lead to where we are at!\nThis was the time of discussion of creamy layer. The whole gujjar protest to be included into the OBCs was coming soon. The upper-cast Hindus were starting to align against caset-bsed reservation.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nI found one of the papers I read. It\u0026rsquo;s this(link to pdf) one on The Effectiveness of Jobs Reservation. I did not understand the math in this paper so largely ignored the numbers this paper. I did not understand anything beyond mean, mode, and median in statistic at this point of time.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/social-sciences-hate/","summary":"Recently I was reading a beautiful interview of Amartya Sen done by The Harvard Gazette. You can read my higlights over at hypothes.is This reminded me of the first time I read a paper by Amartya Sen.\nBack when I was in the ninth grade I was required to do a project for my Social Studies class. The topic allotted to me was \u0026ldquo;Should we have caste based reservation?\u0026rdquo; Heavy stuff 😩, especially for my 14-year-old ass.","title":"The Source of My Social Sciences Hate"},{"content":" Brief Interviews with Hideous Men by David Foster Wallace\rMy rating: 5 of 5 stars\nI enjoyed it, but it was a tough read. Unlike what the title might suggest this book is a collection of short stories. Some, but not all, of them are structured like interviews. Some, but not all, focus on a male character. Some, but not all, are about awful people.\nThe vibe of the book is that it is a meditation on thinking. An extremely cynical meditation, but a meditation none the less. You could say it is a meditation on how useful it actually is to think. Almost all of the stories draw a contrast between a very thought out idea, and the very base (or trite or simple) version of the same. The suggestion being how similar they are. He manages to bring this out consistently, and often hilariously. My favorite of the bunch was the penultimate short story. It talks about love in very difficult circumstances. Has a lot of twists and turns. And is just really thought provoking. Another one I really likes is the story called Signifying Nothing. Just a hilarious of how we deal with our problems in real life. The Depressed Person is another impressive story about how thinking about a problem does not lead to a solution. There are also a lot of footnotes in this one, going waaaay meta. Speaking of meta, we have the Octet. Here the narrator is dealing with the problem of writing a cohesive collection of short stories.\nThat is the biggest problem with the book. It is sometimes, too meta for its own good. Sometimes it is hard to see where the story is going and if it is worthwhile to waste your brain cell to decipher what David Foster Wallace is trying to say. But it always leads you to an alleyway that you have never explored before. If you are willing to work through a book, and I mean work through it, then this is the book for you. Otherwise, might I suggest the Witcher series. It is a more fun, more sincere book that also has a lot of philosophy peppered in.\nAt the end I will just add that much like Consider the Lobster this book is going to remain with me a long while. I might even reread it at some point. After all, there are a number of stories in this book that I have no clue about (I am talking about you the last story 🥺). ","permalink":"https://harshcurious.com/posts/briefinterviewhideous/","summary":"Brief Interviews with Hideous Men by David Foster Wallace\rMy rating: 5 of 5 stars\nI enjoyed it, but it was a tough read. Unlike what the title might suggest this book is a collection of short stories. Some, but not all, of them are structured like interviews. Some, but not all, focus on a male character. Some, but not all, are about awful people.\nThe vibe of the book is that it is a meditation on thinking.","title":"Book Review: Brief Interviews with Hideous Men"},{"content":"healthygamer.gg Interview with Sasha Grey Being a Potential Cult Leader People come to Grey with her problems since she was 11. Difference between a person who is a therapist and who helps other people with their problems. Training; expertise; limitations. If a therapist can\u0026rsquo;t stream on Twitch, then under qualified people will do that job of giving advice. The more qualified you are, the less you are allowed to do the public advice action. Sasha says that people approach her for advice because she is experienced, participated in a taboo industry, and manged to change career. They trust her. They trust her advice based on her experience. Dr. K : but people came to her for advice when she was 11. Why is the reason they come to her now any different from what it was back then? Are you special? If you are humble you can\u0026rsquo;t say yes. Natural charisma. Intentionally hidden aspect of her personality. Real question is can you help someone! Try to give the best advice. IRL helpful person. Why are you able to when others can\u0026rsquo;t? Patient, and a good listener. Able to say what they need to hear without sugar coating anything. Transparent and authentic with people. Quite analytical and careful in speech Catchprase (more like motto) of SG is struggle continues. Move to another country, and help people. Move to the wilderness. (Cult 😊). Shadow banning from the internet. State of Mental Health We do a lot of interventions for physical health like trainers, nutritionists, massage therapists, doctors, and surgeons. We need something similar with mental health. That is what healthygamer.gg is about. Things like Twitch streamer can augment the mental health sphere. Mental health sphere has been monopolized by mental health professionals. Maybe we need to get the help we can get. Not possible to have a therapy session on camera. Camera changes people. People start projecting the best version of themselves on camera, even when they are unaware of the change. Provide a lot of regurgitated self-help advice. Procrastination Say armchair psychoanalysis shit like \u0026lsquo;you procrastinate because you are afraid of success\u0026rsquo;. Tried various techniques. Sometimes don\u0026rsquo;t know where to start, sometimes forgetting. Overwhelmed Schpeel later. Overwhelmed Do a lot of things. Tasks: YouTube, Twitch. Creative work. Need to be hands-on. Keeping up with trends. Injustices in the world. Lack of security. ","permalink":"https://harshcurious.com/posts/til15/","summary":"healthygamer.gg Interview with Sasha Grey Being a Potential Cult Leader People come to Grey with her problems since she was 11. Difference between a person who is a therapist and who helps other people with their problems. Training; expertise; limitations. If a therapist can\u0026rsquo;t stream on Twitch, then under qualified people will do that job of giving advice. The more qualified you are, the less you are allowed to do the public advice action.","title":"Today I Learnt 15"},{"content":"Lolita: Book review Lolita by Vladimir Nabokov\rMy rating: 3 of 5 stars\nPretty average. There are some impressive passages, with well flowing language. Overall didn't enjoy the story, and characterization. The ending was utterly bizarre. Disappointed. I guess the hype is because of the transgressive nature of the story, and not for its actual content.\r","permalink":"https://harshcurious.com/posts/lolita/","summary":"Lolita: Book review Lolita by Vladimir Nabokov\rMy rating: 3 of 5 stars\nPretty average. There are some impressive passages, with well flowing language. Overall didn't enjoy the story, and characterization. The ending was utterly bizarre. Disappointed. I guess the hype is because of the transgressive nature of the story, and not for its actual content.\r","title":"Book Review: Lolita"},{"content":"The State of Indian Economy https://www.hindustantimes.com/india-news/the-economy-story-is-unravelling-just-46-days-into-fy22-101621203348452.html\nThe recent surge in COVID-19 cases has also manged to crush the economic recovery hopes. Although there hasn\u0026rsquo;t been a three-month national lockdown, there are local lockdowns almost everywhere in the country. Google Mobility Data Google LLC \u0026ldquo;Google COVID-19 Community Mobility Reports\u0026rdquo;. https://www.google.com/covid19/mobility/ Accessed: May 17, 2021.\nhttps://www.gstatic.com/covid19/mobility/2021-05-13_IN_Mobility_Report_en-GB.pdf\nThe workplace mobility has fallen sharply (by about 54%) since its peak in March 2021.1 Retail and recreation related mobility is down by a whopping 63%. This is really important because the informal economy is the primary source of income for a large portion if the population in India. CMIE https://www.cmie.com/\nAccording to data from the Centre for Monitoring Indian Economy (CMIE), data the unemployment rate (calculated as a 30-day moving average) stands at 8.9%. The labour participation rate (LPR)2 has been dropping sharply since March. It fell to 39.98%. This is the lowest LPR since May 2020 during the national lockdown. The employment rate fell from 37.6 per cent in March to 36.8 per cent in April. (Link) Even with a decline in the labor force (of about 11 lakhs) looking for employment in April, they are still failing to find employment, resulting in the high unemployment rate. Salaried employee job losses saw a loss of 3.4 million jobs in April. The cumulative loss stands at staggering 12.6 million. Electoral Bonds TODO : Create an interactive way to present the publicly available data on electoral bonds.\nThe baseline is the median value, for the corresponding day of the week, during the five week period 3 Jan – 6 Feb 2020. I personlly think that this a very good indicator given the lack of privacy awareness and profusion of android phones in India.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nhttps://www.investopedia.com/terms/p/participationrate.asp LPR is a measure of an economy’s active workforce. $$ \\text{LPR} = \\dfrac{\\text{workers employed}+\\text{people actively seeking employment}}{total noninsitutionalized working-age population}. $$\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/til14/","summary":"The State of Indian Economy https://www.hindustantimes.com/india-news/the-economy-story-is-unravelling-just-46-days-into-fy22-101621203348452.html\nThe recent surge in COVID-19 cases has also manged to crush the economic recovery hopes. Although there hasn\u0026rsquo;t been a three-month national lockdown, there are local lockdowns almost everywhere in the country. Google Mobility Data Google LLC \u0026ldquo;Google COVID-19 Community Mobility Reports\u0026rdquo;. https://www.google.com/covid19/mobility/ Accessed: May 17, 2021.\nhttps://www.gstatic.com/covid19/mobility/2021-05-13_IN_Mobility_Report_en-GB.pdf\nThe workplace mobility has fallen sharply (by about 54%) since its peak in March 2021.1 Retail and recreation related mobility is down by a whopping 63%.","title":"Today I Learnt 14"},{"content":"India\u0026rsquo;s Covid-19 Emergency The situation is scary. Very scary. It has spread to the rural areas. There is severe lack of information and resources. There are a lot of quacks who can wreak havoc in the current climate of misinformation. The biggest fake Guru Ramdev has shown his true colors by blaming the victims of Covid-19 for all their breathing issues. We have RSS workers followed by our honorable PM dying without treatment. It isn\u0026rsquo;t just pathetic planning, it is veering towards negligent homicide. Arsenal vs Chelsea Arsenal eked out a lucky victory against Chelsea. They were utterly boring, but defended resolutely. Weird formation; three man back line; Saka and Tierney as wingbacks; defensive midfield of Partey and Elneny. Got a very lucky goal. Chelsea have been on an amazing run lately. Lolita Reading the book, I am utterly horrified most of the time. I don\u0026rsquo;t understand how people see beauty in it. Lolita seems like she is utterly depressed. There is a conflation of possession and love here. This is something I have been thinking about for a long time, but this recent article from Annie Zaidi has brought it to the fore. Let me now talk about the only love I know about, which is familial love. The way I would think about my relationship with my parents is the sense of mutual responsibility. There is barely any honest communication. I wouldn\u0026rsquo;t tell them if something good or bad happens to me. And I am sure they wouldn\u0026rsquo;t either to save me from extreme emotions. I am coddled to the point where I don\u0026rsquo;t feel like I belong in the home grew up in. My aim growing up had a lot to do with autonomy, I just wanted to feel more like me. As things have gone so far, I am further away from it then where I started from. And what about the traditional Indian1 Guru-shishya, teacher-student, relationship. The shishya is expected to give up complete control to their loving Guru. The Guru can beat them, make the shishya do their chores, ask for ridiculous things2 as gifts, and even fu_king rape them3. It\u0026rsquo;s all ok. It\u0026rsquo;s all out of love for their students. Another manifestation of this conflation of control and love can be seen with the relationship that a lot of Indians have with their dogs. When I walked around in the evening/morning I would encounter a lot of people walking their dogs🐕. That\u0026rsquo;s fairly normal. What\u0026rsquo;s weird is that they often carry sticks (made of heavy wood or metal). I have always wondered what kind of a relationship these people have with their pets! I am sure if I ask them about it they will say that they like their dogs, maybe even love them. Who knows 😕. But does their dog love them. It is dependent on them. It is afraid of them. Maybe he won\u0026rsquo;t run even if they let it off the leash. But does their dog love them or is it just really afraid of them that it would do anything to make it seem like it loves them. What I am trying to get at is that love is only truly perceptible when there is a fundamental equality between individuals. When everyone is genuinely allowed to be themselves. They are allowed to be honest. Don\u0026rsquo;t get me wrong this equality is impossible to judge from the outside. I am definitely not promoting the idea of love only possible between people in the same economic class. Economic status is just one part of the equation. Not the whole. This idea of equality is difficult to grapple with. There is no uniform formula applicable to everyone. Let\u0026rsquo;s take the case of a housewife for example. In some cases, this economic power imbalance might prevent a wife from getting out of an abusive relationship. At time another person might have this exact expectation out of their relationship and enjoy the housework. They might still feel a sense of equality in the relationship. It is for the individual to figure out among themselves. It\u0026rsquo;s a feeling, not a fact or figure. From what I have read, and I am not well informed on this topic. This is certainly not a nuancesed take on the topic. It\u0026rsquo;s absolutely not intended for a western audience unaware of the Indian context.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nDrona asks Ekalavya to cut off his right thumb as Guru Dakshina, a gift. Droṇa (Sanskrit: द्रोण) or Droṇāchārya is considered to be a model instructor in India. There is even a Dronacharya award for the best Indian coach for an Olympic sport.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nIn 2018, Asaram, an Indian self-proclaimed Guru, was found guilty of the rape of an underage girl and is currently serving life imprisonment in Jodhpur. You can go through some of the reference on the wikipedia page for more information.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/til13/","summary":"India\u0026rsquo;s Covid-19 Emergency The situation is scary. Very scary. It has spread to the rural areas. There is severe lack of information and resources. There are a lot of quacks who can wreak havoc in the current climate of misinformation. The biggest fake Guru Ramdev has shown his true colors by blaming the victims of Covid-19 for all their breathing issues. We have RSS workers followed by our honorable PM dying without treatment.","title":"Today I Learnt 13"},{"content":"Learning Kotlin Creating variables Notes from: https://www.programiz.com/kotlin-programming/variable-types and\nYou can define variables dynamically:\nvar firstname = \u0026#34;Harsh\u0026#34; var lastname = \u0026#34;Kumar\u0026#34; var age = 26 var happiness = 0.1 You can specify the type:\nvar firstname:String = \u0026#34;Harsh\u0026#34; var age:Int = 43 Kotlin variables can be declared in two ways:\nval: Immutable. var: Mutable. Basic variable types (https://kotlinlang.org/docs/basic-types.html)\nNumerical types: 6 built-in types\nByte: values between -128 and 127 Short: values between -32768 and 32767 (16-bit signed two\u0026rsquo;s complement integer). Int: values between $-2^{31}$ to $2^{31}-1$ (32-bit signed two\u0026rsquo;s complement integer). Long: values between $-2^{63}$ to $2^{63}-1$ (64-bit signed two\u0026rsquo;s complement integer). Float: (single-precision 32-bit floating point number) Double: (double-precision 64-bit floating point number) Type Size(bits) Significant bits Exponent bits Decimal digits Float 32 24 8 6-7 Double 64 53 11 15-16 Operations:\nfun main() { println(1 + 2) println(2_500_000_000L - 1L) println(3.14 * 2.71) println(10.0 / 3) println(5/3) println(11 % 3) println(10.0 % 3) } Gives the output:\n3\r2499999999\r8.5094\r3.3333333333333335\r1\r2\r1.0 Conversion: All number types support conversions to other types. toByte(): Byte toShort(): Short toInt(): Int toLong(): Long toFloat(): Float toDouble(): Double toChar(): Char Bitwise operations: They operate on the binary level directly with bits of the numbers\u0026rsquo; representation. They can be applied only to Int and Long. shl(bits) : signed shift left shr(bits) : signed shift right ushr(bits): unsigned shift right and(bits): bitwise and or(bits): bitwise or xor(bits): bitwise xor inv(): bitwise inversion Char: Characters. Use single quotes around them: '1'.\nSpecial characters: Start with a backslash:\\t, \\b, \\n, \\r, \\', \\\u0026quot;, \\\\ and \\$. Unicode characters: Use escape sequence syntax: '\\uFF00'. Boolean: objects that can have two values: true and false.\nBuilt-in boolean operations are ||: logical OR \u0026amp;\u0026amp;: logical AND !: logical NOT || and \u0026amp;\u0026amp; work lazily. String: string is a sequence of characters in double quotes: \u0026quot;abcd 123\u0026quot;.\nElements can be accessed via indexing operation: s[i]\nImmutable.\nConcatenated using the + operator: \u0026quot;abcd\u0026quot; + \u0026quot;xyz\u0026quot; or \u0026quot;abc\u0026quot; + 1. But remember that in most cases using string templates or raw strings is preferable to string concatenation.\nEscaped string: may contain escaped characters; delimited by double quotes (\u0026quot;)\nval s = \u0026#34;Hello, world!\\n\u0026#34; Raw string: can contain newlines and arbitrary text; delimited by triple quotes (\u0026quot;\u0026quot;\u0026quot;)\nval text = \u0026#34;\u0026#34;\u0026#34; for (c in \u0026#34;foo\u0026#34;) print(c) \u0026#34;\u0026#34;\u0026#34; String templates: String literals may contain template expressions - pieces of code that are evaluated and whose results are concatenated into the string. Starts with a dollar sign ($) followed by a variable name or an expression in curly braces.\nval i = 10 println(\u0026#34;i = $i\u0026#34;) // prints \u0026#34;i = 10\u0026#34; val s = \u0026#34;abc\u0026#34; println(\u0026#34;$s.length is ${s.length}\u0026#34;) // prints \u0026#34;abc.length is 3\u0026#34; Arrays: To create an array, use the function arrayOf() and pass the item values to it: so arrayOf(1, 2, 3) creates an array [1, 2, 3]. The class has get and set functions, size property, and a few other useful member functions.\nCount starts from 0 (like Python).\nArrays can contain strings:\nvar ages = arrayOf(15,16,20,35) You can update a list by simple reassignment:\nages[2] = 18 ArrayList: Dynamic arrays. Can create an array without any elements.\nvar name = ArrayList\u0026lt;String\u0026gt;() name.add(\u0026#34;Harshita\u0026#34;) name.add(\u0026#34;Sashi\u0026#34;) name.add(\u0026#34;Camile\u0026#34;) You can remove items by:\nname.removeAt(1) The basic datatypes don\u0026rsquo;t allow null values. To be able to use them, add a question mark (?) to the type. (From this beautiful article)\nval stars: Int? = null val name: String? = null Just remember Int and Int? are not the same type. Passing them incorrectly to a function might cause errors.\nTaking Input Take input from the user using the readLine() command. You get a string out of it. In order to convert it to Int use Integer.valueOf(readLine()). Control statements if-else is standard:\nif(age \u0026gt;18) { println(\u0026#34;welcome to the app\u0026#34;) }else { println(\u0026#34;You are not allowed to use this app\u0026#34;) } There is a when control statement:\nvar isValid = false //or true when(isValid) { false -\u0026gt; { println(\u0026#34;Please verify your account\u0026#34;) } true -\u0026gt; { println(\u0026#34;Welcome to the app\u0026#34;) } else -\u0026gt; { println(\u0026#34;Invalid state\u0026#34;) } } Creating functions Define functions using fun keyword.\nfun printHelloWorld{ println(\u0026#34;Hello world!\u0026#34;) } For functions with arguments you have to specify the argument type.\nfun printHelloWorldName(name:String) { println(\u0026#34;Hello world! \u0026#34;+ name) } For functions that return an output, you need to specify the output type as well.\nfun returnHelloWorldName(name:String):String { return \u0026#34;Hello world! \u0026#34; + name } Loops while loop Bog standard:\nvar count = 0\rwhile(count \u0026lt; 5) {\rprintln(\u0026#34;Step: \u0026#34; + count)\rcount++\r} gives the output:\nStep: 0\rStep: 1\rStep: 2\rStep: 3\rStep: 4 for loop\nstandard:\nfor(count in 0..4) { println(\u0026#34;Step: \u0026#34; + count) } gives the same output as above.\nA function to Loop through an array of strings:\nfun showNames(name:Array\u0026lt;String\u0026gt;) { for(item in name) { println(item) } } ","permalink":"https://harshcurious.com/posts/til12/","summary":"Learning Kotlin Creating variables Notes from: https://www.programiz.com/kotlin-programming/variable-types and\nYou can define variables dynamically:\nvar firstname = \u0026#34;Harsh\u0026#34; var lastname = \u0026#34;Kumar\u0026#34; var age = 26 var happiness = 0.1 You can specify the type:\nvar firstname:String = \u0026#34;Harsh\u0026#34; var age:Int = 43 Kotlin variables can be declared in two ways:\nval: Immutable. var: Mutable. Basic variable types (https://kotlinlang.org/docs/basic-types.html)\nNumerical types: 6 built-in types\nByte: values between -128 and 127 Short: values between -32768 and 32767 (16-bit signed two\u0026rsquo;s complement integer).","title":"Today I Learnt 12"},{"content":"Python List Operations If we start with a list\nseq = [1,2,3,4] then we have the following operations:\nPython Expression Results Descriptions seq + [5,6,7,8] [1,2,3,4,5,6,7,8] Concatenation seq * 4 [1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4] Repetition Go 101 This is a continuation of my notes on learning Go.\nKeywords From Go 101 Go has precisely 25 keywords: break default func interface select case defer go map struct chan else goto package switch const fallthrough if range type continue for import return var Identifiers Composed of Unicode letters, Unicode digits and _ (underscore)\nStarts with a Unicode letter or _. (Not a number!)\nIdentifier _ is a special identifier, it is called blank identifier.\nAll names of types, variables, constants, labels, package names and package import names are identifiers.\nExported identifier Non-exported/unexported identifier Starts with upper case letter Does not start with upper case letter Kinda like public Kinda like private Shared between files in a package Local to usually a function or file Eg: Player_9, DoSomething, VERSION, Ĝo, Π _, _status, memStat, book, π, 一个类型, 변수 Some items that cannot be used as identifiers:\nReason Examples Starting with a Unicode digit: 1234, 2clear Containing disallowed Unicode character a.b, *prime, $name, email@domain.com Keywords type, range Built-in Types Categories Examples Boolean type bool Integer numeric types int8, uint8, int16, uint16, int32, uint32, int64, uint64, int, uint, and uintptr Floating-point numeric type float32 and float64 Complex numeric type complex64 and complex128 string type string There are two built-in type aliases: byte: is an alias of uin8. rune: is an alias of int32. The integer types whose names starting with a u are unsigned types. The number in the name of a type means how many binary bits a value of the type will occupy in memory at run time. The size of int and uint values are 4 on 32-bit architectures, and 8 on 64-bit architectures. The size of uintptr value must be large enough to store the uninterpreted bits of any memory address. (I don\u0026rsquo;t understand this statement. How large can a memory address be?) The real and imaginary parts of a complex64 value are both float32 values, and the real and imaginary parts of a complex128 value are both float64 values. Zero value: Each built-in type has a zero/default value. Category of Type Zero Value Boolean type false Numeric types 0 (might have different size in memory) String type Empty string ","permalink":"https://harshcurious.com/posts/til11/","summary":"Python List Operations If we start with a list\nseq = [1,2,3,4] then we have the following operations:\nPython Expression Results Descriptions seq + [5,6,7,8] [1,2,3,4,5,6,7,8] Concatenation seq * 4 [1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4] Repetition Go 101 This is a continuation of my notes on learning Go.\nKeywords From Go 101 Go has precisely 25 keywords: break default func interface select case defer go map struct chan else goto package switch const fallthrough if range type continue for import return var Identifiers Composed of Unicode letters, Unicode digits and _ (underscore)","title":"Today I Learnt 11"},{"content":"Lambda Functions in Python First I looked at the following article from realpython.com History Lambda calculus (or $\\lambda$-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution.1\nIt is a universal model of computation. Alternative to a Turing Machine.\nUntil the 1960s, the lambda calculus was only a formalism. Since Richard Montague and other linguists\u0026rsquo; applied it in understanding the semantics of natural language, the lambda calculus has gained popularity in both linguistics, and computer science.\nComputable functions2 are a fundamental concept within computer science and mathematics. The lambda calculus provides a simple semantics for computation, enabling properties of computation to be studied formally.\nLambda calculus simplifies the semantics in two ways:\nLambda calculus treats functions “anonymously”, without giving them explicit names. For example:\nsquare_sum$(x,y) = x^2 + y^2$\ncan be turned anonymous form by rewriting it as\n$(x,y) \\mapsto x^2 + y^2$\nYou now think of it as a mapping of the tuple $x$, and $y$ to $x^2+y^2$.\nLambda calculus only uses functions of a single input. For instance, the square_sum function is equivalent to the functions\n$x \\mapsto (y \\mapsto x^2+ y^2)$\nThis method is known as currying. It transforms a function that takes multiple arguments into a chain of functions each with a single argument.\nWe understand this approach to functions by calculating square_sum at $(5,2)$.\n$((x,y) \\mapsto x^2 + y^2)(5,2)$ $= 5^2 +2^2$ $=29$\nOn the other hand, the curried version requires an additional step.\n$\\left( \\left( x \\mapsto (y \\mapsto x^2 + y^2) \\right)(5) \\right)(2)$ $= (y \\mapsto 5^2 + y^2)(2)$ $= 5^2 + 2^2$ $= 29$\nThe lambda calculus consists of a language of lambda terms, which is defined by a certain formal syntax, and a set of transformation rules, which allow manipulation of the lambda terms.\nLambda terms: The following three rules provide an inductive definition.\nA variable, $x$, is itself a valid lambda term. If $t$ is a lambda term, and $x$ is a variable, then $( \\lambda x, t )$ is a lambda term (called an abstraction). If $t$ and $s$ are lambda terms, then $(ts)$ is a lambda term (called an application). Nothing else is a lambda term. Thus, a lambda term is valid if and only if it can be obtained by repeated application of these three rules. I will look at the mathematical background in detail at some other time. Let\u0026rsquo;s move on to Python.\nUnderstanding Lambda Functions in Python Let\u0026rsquo;s consider the following simple code:\nlambda x: x + 1 It can be divided in the following three parts:\nThe keyword: lambda; indicates that a lambda function is being used. A bound variable: x; refers to the variable to which we are applying the lambda function. A body: x+1; indicates what the lambda function does to the bounded variable. Continuing with Go 101 Introduction to Source Code Elements https://go101.org/article/basic-code-elements-introduction.html\ncommand package any executable program importable semantic unit of functionality From Wikipedia.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nAccording to the Church–Turing thesis, computable functions are exactly the functions that can be calculated using a mechanical calculation device given unlimited amounts of time and storage space. Equivalently, this thesis states that a function is computable if and only if it has an algorithm. Note that an algorithm in this sense is a sequence of steps a person with unlimited time and an unlimited supply of pen and paper could follow. From Wikipedia.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/til10/","summary":"Lambda Functions in Python First I looked at the following article from realpython.com History Lambda calculus (or $\\lambda$-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution.1\nIt is a universal model of computation. Alternative to a Turing Machine.\nUntil the 1960s, the lambda calculus was only a formalism. Since Richard Montague and other linguists\u0026rsquo; applied it in understanding the semantics of natural language, the lambda calculus has gained popularity in both linguistics, and computer science.","title":"Today I Learnt 10"},{"content":"Go 101 Continued The simplest Go program:\npackage main func main() { } The first line package main specifies the package name (main here) of the containing source file.\nI just don\u0026rsquo;t understand this statement.\nLet me go back to the other book I was reading (Go in action). There I found the following statement:\nFor the build tools to produce an executable, the function main must be declared, and it becomes the entry point for the program. Function main is located in a package called main. If your main function doesn’t exist in package main, the build tools won’t produce an executable. Packages define a unit of compiled code and their names help provide a level of indirection to the identifiers that are declared inside them, just like a namespace. This makes it possible to distinguish identifiers that are declared with exactly the same name in the different packages you import. I am not sure if I understand the idea of packages in Go yet. What I think is happening is that the first line of a .go file declares its place in overall structure of the code.\nLooking at chapter 3 of Go In Action, I find the following:\nAll Go programs are organized into groups of files called packages. This is done so that code can be included in other projects as smaller reusable pieces. All .go files must declare the package that they belong to as the first line of the file excluding whitespace and comments. Packages are contained in a single directory. You may not have multiple packages in the same directory, nor may you split a package across multiple directories. This means that all .go files in a single directory must declare the same package name. The package name main designates to the Go command that this package is intended to be compiled into a binary executable. All of the executable programs you build in Go must have a package called main. Run Go Programs You can run a .go file by the command go run simplest-go-program.go. This will compile your .go file and return any syntax errors encountered. The go run command is not the recommended way to compile large Go projects. For larger Go projects you need to run the go build or the go install commands. Go project supporting Go modules needs a go.mod file located in the root folder of that project. The go.mod file can be generated by the go mod init subcommand. Some go Subcommands go vet: checks code for possible logical errors. go fmt: formats Go source code with a consistent coding style. go test: runs tests and benchmarks. go doc: opens Go documentation in terminal windows. go mod init example.com/myproject: generates a go.modfile in the current directory. This turns the current directory into the root directory of a module called example.com/myproject. go mod tidy: adds missing module dependencies into and removes unused module dependencies from the go.mod file by analyzing all the source code of the current project. ","permalink":"https://harshcurious.com/posts/til9/","summary":"Go 101 Continued The simplest Go program:\npackage main func main() { } The first line package main specifies the package name (main here) of the containing source file.\nI just don\u0026rsquo;t understand this statement.\nLet me go back to the other book I was reading (Go in action). There I found the following statement:\nFor the build tools to produce an executable, the function main must be declared, and it becomes the entry point for the program.","title":"Today I Learnt 9"},{"content":"Go 101 This sets more realistic expectations about Golang.\nAbout Go 101 Main selling point of Golang:\nFairly flexible for a static language. Unique combination of memory saving, fast program warming-up and fast code execution speed. Built-in concurrent programming support. Great code readability. Great cross-platform support. Vibrant group. I didn\u0026rsquo;t quite understand how this particular book is useful. He says a few things about it, but I did not understand it. I am sold on the style. So let\u0026rsquo;s see how this works out for me.\nAn Introduction of Go There are numerous features of Go listed here.\nGo programmers are often called gophers.1\nThe most popular Go compiler is gc, written in Go. There is a second compiler gccgo, but it is no longer a priority for the Go design team.\nGo Toolchain is a set of tools for Go development maintained by Go team. gc is a part of this collection.\nThe version of Go is consistent with the version of Go Toolchain. There were/are two major versions released each year.\nGo 1.8 made massive improvements in the concurrent garbage collection implementation. Lags caused by garbage collection were massively reduced.\nGo is popular for development in\nnetworks system tools databases block chain There are signs of usage in\ngame development big data AI Drawbacks\nGo doesn\u0026rsquo;t support arbitrary immutable values. Right now many values which are not supposed to be modified in standard packages are declared as variables. This is a security concern. Go also doesn\u0026rsquo;t support generics for custom types and functions. (I don\u0026rsquo;t understand this one.) The Go Toolchain In order to easily call the go command add the bin sub-folder to the PATH environment variable. Since Go 1.16, project dependencies are managed using modules. GOPATH is an environment variable. The default Go workflow happens entirely inside the GOPATH. By default, it\u0026rsquo;s the go folder under the home directory of the current user. It has three folders in there. bin: the place where Go program binaries end up. pkg: stores the cached versions of Go modules for local Go projects. src: the place where you should store your projects. The simplest Go program: package main func main() { } The first line package main specifies the package name. Apparently there is an old cartoon called Go Go Gopher. That\u0026rsquo;s probably where you get the Go mascot. Read about its history on the Golang blog \u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/til8/","summary":"Go 101 This sets more realistic expectations about Golang.\nAbout Go 101 Main selling point of Golang:\nFairly flexible for a static language. Unique combination of memory saving, fast program warming-up and fast code execution speed. Built-in concurrent programming support. Great code readability. Great cross-platform support. Vibrant group. I didn\u0026rsquo;t quite understand how this particular book is useful. He says a few things about it, but I did not understand it.","title":"Today I Learnt 8"},{"content":"Banana Pi M5 Learned of its existence from Explaining Computers Has onboard eMMC storage. SOC: Amlogic S905X3 with 4 x A55 cores (up to 2GHz), Mali-G31 MP2 GPU. Can boot from 16 GB eMMC or SD Card slot. Uses USB-C for power (5V @ 2A) and eMMC setup. Has 4 switch (The wiki says 3 : Reset, Power and U-Boot 😕). 4 GB LPDDR4 RAM. 10/100/1000 Mbit/s Ethernet. Wi-Fi/Bluetooth requires an optional USB dongle. One HDMI 2.0 (up to 4K@60Hz with HDR, CEC, EDID) Audio via 3.5 mm jack and HDMI. 4 x USB 3.0 ports. 3-pin UART connector and 40-pin GPIO connectors. Similar layout to Raspberry Pi. IR receiver. No Camera (CSI) or display (DSI) connector. Need to use an Amlogic burning tool to write to the built-in eMMC storage. Pre-built android, Ubuntu Mate, Ubuntu Server, Debian Buster, and CoreELEC images are available. The Quick Way to Display System and Shell Information in Powershell on Windows 10 I have added the following to my $Profile:\nWrite-Host @\u0026#34; ______________________________________________________________ __ ___ _ __ ___ \\ \\ / (_) | | /_ |/ _ \\ \\ \\ /\\ / / _ _ __ __| | _____ _____ | | | | | \\ \\/ \\/ / | | \u0026#39;_ \\ / _` |/ _ \\ \\ /\\ / / __| | | | | | \\ /\\ / | | | | | (_| | (_) \\ V V /\\__ \\ | | |_| | \\/ \\/ |_|_| |_|\\__,_|\\___/ \\_/\\_/ |___/ |_|\\___/ ____ ___ ______ _ _ _ _ / ___| / | | ___ (_) | | | | | / /___ / /| |______| |_/ /_| |_ | |_| | ___ _ __ ___ ___ | ___ \\/ /_| |______| ___ \\ | __| | _ |/ _ \\| \u0026#39;_ ` _ \\ / _ \\ | \\_/ |\\___ | | |_/ / | |_ | | | | (_) | | | | | | __/ \\_____/ |_/ \\____/|_|\\__| \\_| |_/\\___/|_| |_| |_|\\___| \u0026#34;@ -ForegroundColor Green $operatingsystem = Get-CimInstance -ClassName CIM_OperatingSystem Write-Host \u0026#34;Version: $($operatingsystem.Version)`n\u0026#34; -ForegroundColor Green Write-Host \u0026#34;Last Boot-up time for $($operatingsystem.CSName): $($operatingsystem.LastBootUpTime)\u0026#34; -ForegroundColor Green Write-Host \u0026#34;______________________________________________________________`n -ForegroundColor Green\u0026#34; Write-Host \u0026#34;PowerShell version: $($PSVersionTable.PSVersion)\u0026#34; -ForegroundColor Red Write-Host \u0026#34;______________________________________________________________`n -ForegroundColor Green\u0026#34; Now when I start my PowerShell I am greeted by the following: There are other options like Get-ComputerInfo and Get-WinEvent(depreceated from PowerShell 6 onwards). This one worked best for me. YMMV.\nI genenerated the ASCII art from this tool\nLearned a fair bit of PowerShell scripting today. I think can understand a PowerShell script now.\n","permalink":"https://harshcurious.com/posts/til7/","summary":"Banana Pi M5 Learned of its existence from Explaining Computers Has onboard eMMC storage. SOC: Amlogic S905X3 with 4 x A55 cores (up to 2GHz), Mali-G31 MP2 GPU. Can boot from 16 GB eMMC or SD Card slot. Uses USB-C for power (5V @ 2A) and eMMC setup. Has 4 switch (The wiki says 3 : Reset, Power and U-Boot 😕). 4 GB LPDDR4 RAM. 10/100/1000 Mbit/s Ethernet. Wi-Fi/Bluetooth requires an optional USB dongle.","title":"Today I Learnt 7"},{"content":"Thoughts Regarding My RSS Feed Emotinality as a predictor for cultural success Found orignally from marginal revolution. Couldn\u0026rsquo;t access the article 😪 This sounds very interesting AdaFruit Lately I have been really interested in using more sensors and display for my Raspberry Pi, but everything is so f**ing expensive. I don\u0026rsquo;t know if I can buy anything. One thing I definitely am going to try is make a pir activated night light using Pico and Led matrix. I have got all the ingredients. Spaced repetition in Mathematics I recently started using Anki again. With MathJax support it finally seems worth the effort. But I am still not sure about how to write my cards. To remedy that I am reading a number of articles on using Anki. I really like this take on spaced repetition. I think that my memory is weak. And there is a definite possibility that improving it can make me a better mathematician. The Ankification process 😘 of understanding math. **Understanding the proof : Requires multiple passes over the proof. Start by picking out single elements of the proof and converting them to Anki cards. Then restate the idea in multiple ways. One way to do this is by simplifying both questions and answers. Move to all the different ideas in the proof. Stay on an idea until it feels like it\u0026rsquo;s yours. You should feel comfortable in these spaces. That means understanding it in as many ways as possible and making as many connections as possible.1 The problem with this step is that it is undirected, and you never know when to stop. Have the following aim in mind: How do I describe the proof in one line. You should have enough chunks to prove the statement in one line. Think of this as the boundary condition for proof-learning optimization. Make both questions and answers as atomic as possible. This process can feel very wasteful, but over time this completely changes the understanding of the proof. In fact some older cards may start to seem bad and should be replaced by newer better ones. This is a long-term process; wait for it to run its course. Variations, pushing the boundaries: One way of deepening your understanding further is to find ways of pushing the boundaries of the proof and of the theorem. Ask yourself a few questions. Is every hypothesis necessary? What if I remove one? What if I change one? Why not? Can you get more out of the proof? Can you take the argument further? Try to apply it elsewhere! This phase really is open ended! Proofs are an interconnected network of simple observations. Learning about the various pathways reinforces the memory of the network.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/til6/","summary":"Thoughts Regarding My RSS Feed Emotinality as a predictor for cultural success Found orignally from marginal revolution. Couldn\u0026rsquo;t access the article 😪 This sounds very interesting AdaFruit Lately I have been really interested in using more sensors and display for my Raspberry Pi, but everything is so f**ing expensive. I don\u0026rsquo;t know if I can buy anything. One thing I definitely am going to try is make a pir activated night light using Pico and Led matrix.","title":"Today I Learnt 6"},{"content":"Open Source Smart Watch Very similar to another project I have already heard about called the Watchy Made by Paul Smith with news over at Hackster.io. The project has a website and a GitHub organization. It has got a micro-USB port for data transfer and charging. The main one has a SD-card slot for data storage. The lite one has no SD-card slot. The components used are: EPS32-micro-D4: 2×240 MHz, 320 KB RAM Bluetooth 4.2 BR/EDR BLE Wi-Fi 2.4GHz 802.11 b/g/n GC9A01 240×240 16bit TFT display (round) BMA400 Accelerometer + Pedometer MCP73831 LiPo Charger CH340E USB Serial In the GPS edition Quectel L96 GPS module 4 MB RAM microSD This is genuinely fascinating to me. Maybe someday I will make my own. Python list = [\u0026#34;E\u0026#34;, \u0026#34;D\u0026#34;, \u0026#34;C\u0026#34;, \u0026#34;B\u0026#34;, \u0026#34;A\u0026#34;] print(list) This gives you the following:\n[\u0026#39;E\u0026#39;, \u0026#39;D\u0026#39;, \u0026#39;C\u0026#39;, \u0026#39;B\u0026#39;, \u0026#39;A\u0026#39;] Now what if you wanted to print it a different format 🧐. Here are some options from geeksforgeeks:\nUsing for loop:\nfor x in list: print(x, end=\u0026#34; \u0026#34;) This will give you:\nE D C B A Without using loops: * symbol is used to print the list elements in a single line with space as the separator.\nprint(*list) # or print(*list, sep = \u0026#34;, \u0026#34;) You get:\nE D C B A # or E, D, C, B, A Convert the list into a string : using the join() method. 1\nprint(\u0026#39; \u0026#39;.join(list)) Output:\nE D C B A Using map() function : we can convert each item in a list to string and then join them.\na = [1, 2, 3, 4, 5] print(\u0026#39; \u0026#39;.join(map(str, a))) We get:\n1 2 3 4 5 Can use tables inside a footnote of Hugo As long as the table is aligned below the footnote, this works by default (Hugo version 81.0 with Papermod theme).\nAnki Python Lists are mutable.\ncount() method returns the number of non-overlapping occurrences of substring\nLists can have multiple occurrences of the same element.\nSlice works in [start:stop:step].\nNegative step in slice notation reverses the direction. Eg:\nt = \u0026#39;12345\u0026#39; print(t[::-1]) print(t[::-2]) produces the output:\n54321 531 // is a floor division operator, division rounded down.\n\u0026gt;\u0026gt;\u0026gt; a = 5//2 \u0026gt;\u0026gt;\u0026gt; print a 2 Math Simply Connected Domain Morera\u0026rsquo;s Theorem Cauchy\u0026rsquo;s Integral Theorem Winding Number Found the difference here.\nMethod Function called by its name; associated to an object (dependent) called by its name (independent) the object (where invoked) is implicitly passed parameters (if any) are explicitly passed may or may not return any data may or may not return any data only works in the class where it is defined no class involved \u0026#160;\u0026#x21a9;\u0026#xfe0e; ","permalink":"https://harshcurious.com/posts/til5/","summary":"Open Source Smart Watch Very similar to another project I have already heard about called the Watchy Made by Paul Smith with news over at Hackster.io. The project has a website and a GitHub organization. It has got a micro-USB port for data transfer and charging. The main one has a SD-card slot for data storage. The lite one has no SD-card slot. The components used are: EPS32-micro-D4: 2×240 MHz, 320 KB RAM Bluetooth 4.","title":"Today I Learnt 5"},{"content":"Industry TV series Just brilliant. The complexities of all the relationships and actions is well thought out. The decisions made were well suited to the characters. It was all around just a well made show. I am impressed. Would recommend to all most anyone. The only point against it is that it has a very cynical worldview\nMy notes from The Basics of CSS: Selectors Websites are composed of\nHTML : A markup language. 1 CSS : What this video is all about. Javascript : Logic that your browser can execute. To use css just pick a block element in the HTML (the selector) and put certain styling information under it (the properties). Eg:\nul { margin: 0; padding: 0; } Here ul is a selector which target the unordered list elements. In this particular case it changes the margin, and padding amount.\nYou can also target an HTML tag by the parent tag around it , i.e. compound selectors. For example to target an unordered list inside the nav tags, you can do the following:\nnav ul { margin: 0; padding: 0; } In this case the nav tag does not need to be the immediate parent. There can be other tags/layers between them.\nYou query for a class with a dot. Eg:\n.article-title { font-size: 2rem; } You can combine these two. Eg:\narticle.content{ font-size: 2rem; This looks for a class content inside an article tag. A given tag can have multiple classes. These classes are delineated by a space. Eg: \u0026lt;h1 id=\u0026quot;css-selector\u0026quot; class=\u0026quot;content body-head\u0026quot;\u0026gt; Pick a Heading \u0026lt;/h1\u0026gt;\nYou use a # to target an id. Eg, to target the prior \u0026lt;h1\u0026gt; tag we can write the following:\n#css-selector { width: 150%; } An id selector has higher priority to a class selector. It is more specific. Similarly h1.content is more specific than .content. This can be very tricky in CSS. Classes are more specific than just tags. For the same tag, the css mentioned at the bottom has higher priority than the one above it.\nLearning to Type I have decided to finally start learning how to type quickly using the 10 finger method. Why learn to type ? My current method of pecking is quick for short burst but not for proper note taking. My aim is to be able to type LaTeX notes live. Also, time is inversely proportional to typing speed. so we have the following :\nwords/min text input/day time spent in a year 10 2 hours 18 weeks 20 1 hour 9 weeks 30 40 min 6 weeks 40 30 min 4.5 weeks 60 20 min 3 weeks In the long-term this learning time is gonna pay for itself.\nWhat\u0026rsquo;s up with markup and markdown. Is it like a bottom-up vs top-down approach to text?\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://harshcurious.com/posts/til4/","summary":"Industry TV series Just brilliant. The complexities of all the relationships and actions is well thought out. The decisions made were well suited to the characters. It was all around just a well made show. I am impressed. Would recommend to all most anyone. The only point against it is that it has a very cynical worldview\nMy notes from The Basics of CSS: Selectors Websites are composed of\nHTML : A markup language.","title":"Today I Learnt 4"},{"content":"Arsenal vs Liverpool Oh well, Arsenal suck.\nSuperstore S05E02/E03 Deals with contemporary work related issues in US in a hilarious way. Much better than The Office. Much more diversity and much more realistic. Looks of Webhosting services This freeCodeCamp.org youtube lecture gives a good look of the the website hosting process at this moment in time.\nAnki There are a huge number of improvements in Anki since I last used it. Currently I am using a bunch of online decks to remember python and math results. It\u0026rsquo;s been a good experience so far.\n","permalink":"https://harshcurious.com/posts/til3/","summary":"Arsenal vs Liverpool Oh well, Arsenal suck.\nSuperstore S05E02/E03 Deals with contemporary work related issues in US in a hilarious way. Much better than The Office. Much more diversity and much more realistic. Looks of Webhosting services This freeCodeCamp.org youtube lecture gives a good look of the the website hosting process at this moment in time.\nAnki There are a huge number of improvements in Anki since I last used it.","title":"Today I Learnt 3"},{"content":"Awesome Browser Addons Learnt about some new and interesting Firefox addons (probably available for other browsers).\nViolent Monkey : Kinda like greasemonkey or tampermonkey. Open source. Let\u0026rsquo;s you run userscripts (basically Javascript assets) to change functionality on a website. It is getting updated regularly on github. LocalCDN : This could be rather interesting especially if I can do it on my pi hole. For now I have added it to Brave via the unofficial build for chromium browsers. Some incompatibilities exist. Maybe I will add it to Firefox too. Sponsorblock : This is cool. It blocks the mid roll ads for various creators. The sponsor timestamps are crowd-sourced. Interesting over all, but I am never going to use it. search by image: Can reverse search any image using various search engines. DownThemAll : Hasn\u0026rsquo;t been updated since Nov. 2019. Is it eve working anymore? Universal bypass : Allows you to bypass the link shortners. Don\u0026rsquo;t encounter them that often. I won\u0026rsquo;t be using it. A Side note about Brave. it has this interesting option to permit extensions to read and write site data when clicked. So now I don\u0026rsquo;t have to allow my password manager to read all my site data. Good privacy bonus.\nArmv9 Architecture announced New version of ARM architecture announced. Added support for more ML architecture. Armv8 is the standard used everywhere: Android, iPhone, etc. Armv6 in the first iPhone, feature phones, Raspberry PI zero. These generational changes don\u0026rsquo;t happen very often. Armv7 added conditional floating points, virtualization etc. Armv8 moved to 64 bits. Armv9 will probably be the standard for the next 10 years. Scalable Vector Extensions (SVE) : Vector based compute that enables better output per watt. Introduced in Armv8. SVE2 : Improvements in SVE. In Armv9. Hardware-level security improvements Memory padding to prevent memory leakage. Realm : Hardware level containers. Mediatek : Selling commercial chips in 2022 based on Armv9. Mid-year announcements of new A-cpu architectural designs every year by ARM. Expect three new chips. Successors to : X1, A78, and A55. Based on Armv9. All chips need same architectural level. Apple has been quick to adopt to new architectural changes in ARM design. First to use Armv7 (64 bits). The much speculated A15 bionic might be Armv9 chip. From the horse\u0026rsquo;s mouth Expects 100% of shared data to be processed on ARM (that includes the server space). Security: Armv9 introduces the Arm Confidential Compute Architecture (CCA). This protects portion of code and data from read or write while-in-use at the hardware level. Realms: Dynamically created regions that are separated from everything else while it is in-use, at rest, and in transit. Can be created by any application. AI : SVE (in partnership with Fujitsu) SVE2 enables better machine learning (ML) and Digital Signal Processing (DSP) capabilities. Improves 5G processing VR and AR Local ML processing like image processing and smart home applications Future aim to improve matrix multiplication within the CPU. AI innovations in Mali GPU and Ethos NPU. Expect performance increase of over 30% across the next two generations. Total compute design will improve specialized performance. Working on increasing frequency, bandwidth, and cache-size, and reducing memory latency. TODO : Want to read Total SoC Compute for Dummies, available at ARM website. TODO : There is more about SVE here. From xda-developers First major revision since October 2011 when v8 was launched. There have been some revisions since. Major additions: SVE2 Realm Management Extension (RME) BRBE Embedded Trace Extension (ETE) and Trace Buffer Extension (TRBE) TME Anandtech article has been referenced for everything so let me move there. From Anandtech The arm versioning is about Instruction Set Architecture (ISA). Announced as part of the Arm\u0026rsquo;s Vision Day event. v9 is not as big of a jump as v8 was. In v8 AArch64 was introduced, which was a new instruction set and execution mode. AArch64 is still the basis of V9. SVE2 is now replacing NEON. SVE based on NEON was used in Fujitsu\u0026rsquo;s A64FX CPU core. Focused on high performance computing (HPC) applications. SVE2 also includes variable vector size. Also software to scale easily between IoT devices and future high powered cores. Breaking the Cycle of Overthinking Hyper-vigilant : Really aware of the surroundings. Constantly looking for escapes. Always looking for reasons to not be there. Trying to predict how other people see me. How I am offending them. Industry S01E02 It has fairly negative representation of the finance industry. Shows work-pressure, stress, use of drugs, hostile workplace environment and sexual misconduct. Shows them in the real-life messy style. Hard to say if these things happen with the frequency displayed. Has the classical drama stuff. HR is all about PR. Added support for MathJax and Plotpy on this website The mathjax support Followed the instruction from https://geoffruddock.com/math-typesetting-in-hugo/ with minor additions. Create a file called mathjax_support.html in the folder ./layout/partials with the following content: \u0026lt;script\u0026gt; MathJax = { tex: { inlineMath: [[\u0026#39;$\u0026#39;, \u0026#39;$\u0026#39;], [\u0026#39;\\\\(\u0026#39;, \u0026#39;\\\\)\u0026#39;]], displayMath: [[\u0026#39;$$\u0026#39;,\u0026#39;$$\u0026#39;], [\u0026#39;\\\\[\u0026#39;, \u0026#39;\\\\]\u0026#39;]], processEscapes: true, processEnvironments: true }, options: { skipHtmlTags: [\u0026#39;script\u0026#39;, \u0026#39;noscript\u0026#39;, \u0026#39;style\u0026#39;, \u0026#39;textarea\u0026#39;, \u0026#39;pre\u0026#39;] } }; window.addEventListener(\u0026#39;load\u0026#39;, (event) =\u0026gt; { document.querySelectorAll(\u0026#34;mjx-container\u0026#34;).forEach(function(x){ x.parentElement.classList += \u0026#39;has-jax\u0026#39;}) }); \u0026lt;/script\u0026gt; \u0026lt;script src=\u0026#34;https://polyfill.io/v3/polyfill.min.js?features=es6\u0026#34;\u0026gt;\u0026lt;/script\u0026gt; \u0026lt;script type=\u0026#34;text/javascript\u0026#34; id=\u0026#34;MathJax-script\u0026#34; async src=\u0026#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\u0026#34;\u0026gt;\u0026lt;/script\u0026gt; I would not recommend creating it inside the theme folder, if you are ever planning on updating your theme.\nNext if your theme has header-extend.html use that, if not then use the header.html file. It should be in the ./themes/THEME_NAME/layouts/partials. Copy this file to your root directory keeping the same directory structure. So in my case my new file will be ./layouts/partials/header-extend.html To this I add {{ if .Params.mathjax }} {{ partial \u0026#34;mathjax_support.html\u0026#34; . }} {{ end }} If you are using the head file, ensure that this is added before the closing \u0026lt;/head\u0026gt; tag. 3. Now if you have the statement mathjax: true in the front matter of your markdown file, then you can use mathjax on your website. 4. (Optional) To your archetype file, add the mathjax: true Front Matter. 5. (Optional) To your css file add:\ncode.has-jax { -webkit-font-smoothing: antialiased; background: inherit !important; border: none !important; font-size: 100%; } Plotly Used for creating interactive diagrams. Export your plot as a json file using the write_image library as follows: from plotly.io import write_image #... Generate the fig here. fig.write_json(\u0026#34;plot_name.json\u0026#34;) Add the following Hugo shortcode to plotly.html at ./layouts/partials/ : {{ $json := .Get \u0026#34;json\u0026#34; }} {{ $height := .Get \u0026#34;height\u0026#34; | default \u0026#34;200px\u0026#34; }} \u0026lt;div id=\u0026#34;{{$json}}\u0026#34; class=\u0026#34;plotly\u0026#34; style=\u0026#34;height:{{$height}}\u0026#34;\u0026gt;\u0026lt;/div\u0026gt; \u0026lt;script\u0026gt; Plotly.d3.json({{$json}}, function(err, fig) { Plotly.plot(\u0026#39;{{$json}}\u0026#39;, fig.data, fig.layout, {responsive: true}); }); \u0026lt;/script\u0026gt; Add this to your header.html or header-extend.html (as used for mathjax above). {{ if .Params.plotly }} \u0026lt;script src=\u0026#34;https://cdn.plot.ly/plotly-latest.min.js\u0026#34;\u0026gt;\u0026lt;/script\u0026gt; {{ end }} Now if you have the statement plotly: true in the front matter of your markdown file, then you can use plotly on your website. by calling the shortcode as follows: {{/*\u0026lt; plotly json=\u0026#34;/plotly/plotly-hugo/scatter3d.json\u0026#34; height=\u0026#34;400px\u0026#34; \u0026gt;*/}} Back to using Anki Have used it in the past. But it didn\u0026rsquo;t have native MathJax support back then. Was overwhelmed the last time around. No app on the home screen. Won\u0026rsquo;t worry about the counter TODO: Add the python commands over there. Added MiKelTeX to the environment, by searching for the term environment variable in the start menu. That made LateX on Anki work for me. ","permalink":"https://harshcurious.com/posts/til2/","summary":"Awesome Browser Addons Learnt about some new and interesting Firefox addons (probably available for other browsers).\nViolent Monkey : Kinda like greasemonkey or tampermonkey. Open source. Let\u0026rsquo;s you run userscripts (basically Javascript assets) to change functionality on a website. It is getting updated regularly on github. LocalCDN : This could be rather interesting especially if I can do it on my pi hole. For now I have added it to Brave via the unofficial build for chromium browsers.","title":"Today I Learnt 2"},{"content":"The second wave of coronavirus is here in India I read this article from indian express in the morning. The daily cases yesterday were over 50000 for the first time since November. There are reported cases of multiple new variants (in a situation were DNA sequencing is extremely rare).\nThe situation is frightening, especially some of the new variants being able to evade the immune system much more efficiently. I have been wearing a mask in public spaces at all times, but nobody else seems to be interested in doing so. Still the vast majority of people I encounter on my daily walk don\u0026rsquo;t wear a mask.\nBullshitting the bullshitter From the horse\u0026rsquo;s mouth: talk with Shane Littrell on the Guardian science podcast. The research paper: ‘You can’t bullshit a bullshitter’ (or can you?):Bullshitting frequency predicts receptivity to various types of misleading information. Open access \u0026#x1f513; From the abstract: Research into both receptivity to falling for bullshit and the propensity to produce it. Truism: You can\u0026rsquo;t bullshit a bullshitter. But is it true? Both bullshit receptivity and bullshitting frequency are negatively related to cognitive ability and aspects of analytic thinking style (Littrell, Risko, \u0026amp; Fugelsang, 2021; Pennycook, Cheyne, Barr, Koehler, \u0026amp;Fugelsang, 2015). However, separate research suggests that individuals who frequently engage in deception are better at detecting it people who self-report engaging more frequent ly in lying (i.e., deliberately convincing someone of a falsehood)also self-report being significantly better than average at detecting lies from others (Zvi \u0026amp;Elaad, 2018). those who produce more convincing lies are also actually better at detecting lies (W right, Berry, \u0026amp; Bird, 2012, 2013) other more recent studies suggest this may not be the case (Hudson, Vrij,Akehurst, Hope, \u0026amp; Satchell, 2020). Found that frequency of persuasive bullshitting (i.e., bullshitting intended to impress or persuade others) positively predicts susceptibility to various types of misleading information and that this association is robust to individual differences in cognitive ability and analytic cognitive style. N=826; across three studies. Recent research has suggested that bullshitting and lying, while clearly related, are psychologically distinguishable constructs (Littrell, Risko, et al., 2021). Liars show a stronger negative association with self-regard and a stronger positive association with lie acceptability than bullshitters (Littrell, Risko, et al., 2021). Persuasive bullshitting (i.e., bullshitting motivated by a desire to impress or persuade others) has been found to be significantly, negatively related to cognitive ability while it\u0026rsquo;s not the case with lying (Littrell, Risko, et al., 2021; Michels, Molz, \u0026amp; Maas genannt Bermpohl, 2020). Bullshit: information designed to impress, persuade, and/or otherwise mislead that is often constructed with an indifference for the truth. Bullshit can range from coherent yet hyperbolic (any article headline from Atlantic) or suspiciously implausible (almost all conspiracy theories), to jargon-heavy yet obscure or non-sensible (a-la Deepak Chopra), to technically accurate yet misleadingly irrelevant (a lot of climate deniers; gun right advocates; mann-ki-baat). Bullshitting is intentional. The extent to which a person intentionally spreads bullshit (i.e.,engages in bullshitting) in everyday situations can be estimated using the Bullshitting Frequency Scale (BSF; Littrell, Risko, et al., 2021). BSF measures self-reported frequency with which people bullshit to: impress, persuade, or fit in with others (persuasive bullshitting) be evasive (evasive bullshitting) for example politicians. Persuasive bullshitting frequency is positively related to \u0026lsquo;bullshitting behavior\u0026rsquo; like claiming expertise in non-existent topics (Jerrim et al., 2019) and negatively related to intelligence and some aspects of analytical thinking. Basically evasive bullshitting is useful like lying to a partner about an awful haircut. It can definitely be useful in forming coalition. Eg: recent Sharad Pawar comments. I am more interested in bullshit receptivity. I kinda appreciate the ability to bullshit. I have a tough time doing that. I am a lot straightforward. It is socially useful to fit in, especially the evasive kind. Bullshit receptivity: the ease with which someone fall for bullshit. Bullshit receptivity scale (Pennycook et al. 2015): Setup for VSCodium I had an installation for VSCodium in my machine, but I hadn\u0026rsquo;t used it ever. I decided to use it. Took a while to set it up. Primarily, there are a few issues with using codium instead of code. I couldn\u0026rsquo;t figure out how to install some of the extension I wanted. They weren\u0026rsquo;t available on the default extension store. Apparently codium uses open-vsx.org as extension gallery. So only the extensions registered there are available on codium. There is a workaround to use the VS Code Marketplace, but it may not be legal. From the VSCodium Doc: Create a custom product.json at %USER%\\AppData\\Roaming\\VSCodium with the following content:\n{ \u0026#34;extensionsGallery\u0026#34;: { \u0026#34;serviceUrl\u0026#34;: \u0026#34;https://marketplace.visualstudio.com/_apis/public/gallery\u0026#34;, \u0026#34;cacheUrl\u0026#34;: \u0026#34;https://vscode.blob.core.windows.net/gallery/index\u0026#34;, \u0026#34;itemUrl\u0026#34;: \u0026#34;https://marketplace.visualstudio.com/items\u0026#34;, \u0026#34;controlUrl\u0026#34;: \u0026#34;\u0026#34;, \u0026#34;recommendationsUrl\u0026#34;: \u0026#34;\u0026#34; } } Use this at your own risk.\nAnother important aspect is the propriety debugging tools for C#/C++. This was especially concerning for me because I plan on using PlatfomIO IDE for Raspberry Pi Pico. And PlatformIO is built on the C++ extension. For now I have used the vsix installation for these two.\nI have still not managed to get the git Oauth working on codium. I just keeps failing to login. Update 27th Match: Finally managed to fix it. Here is what I did.\nJust click on the login option on codium. It should open a link in the browser which would look something like this: https://vscode-auth.github.com/authorize/?callbackUri=vscodium://vscode.github-authentication/did-authenticate%253FwindowId%253D1\u0026amp;scope=read:user%20repo%20user:email\u0026amp;state=16b13b86-dbca-4b0d-ac5e-d5c1def0f748\u0026amp;responseType=code\u0026amp;authServer=https://github.com\nDon\u0026rsquo;t click on the continue button. Instead edit the url just after callbackUri= from vscodium to vscode. So the new link should be: https://vscode-auth.github.com/authorize/?callbackUri=vscode://vscode.github-authentication/did-authenticate%253FwindowId%253D1\u0026amp;scope=read:user%20repo%20user:email\u0026amp;state=16b13b86-dbca-4b0d-ac5e-d5c1def0f748\u0026amp;responseType=code\u0026amp;authServer=https://github.com\nNow you are ready. Click on the continue button. You shouldn\u0026rsquo;t get an error. Instead you will get to the authorization page. Fill your details. Once you have authorized the extension, you should get to a page which gives you a token and a open in app link. The open in app link will not work. Instead copy the token. Go back to the codium window. At the bottom, in the status bar, you will see a github.com button. Click it. The command running utility opens. In it paste your token and press enter. If you press Esc, you will have to restart the authentication process. This worked for me, your milage may vary. I have added a bunch of extensions. I am syncing them using my github account via gists. There is an extension called Settings Sync. It can sync your settings using a secret gist.\nWatched a fair bit of the cricket match 🏏 I don\u0026rsquo;t know what is happening. Sometimes I think the sheer number of good players in the Indian team is too much and sometimes I feel like England has a more well rounded team than India. I don\u0026rsquo;t know if both can be true at the same time. England crushed India in a more difficult run chase than the 1st ODI. I don\u0026rsquo;t know what to think anymore. I was utterly surprized at how India won the the t20 series and the first ODI. Maybe it was a fluke. I have to look at some kind of data. The matches so far in the limited over games have been fun but confusing.\n","permalink":"https://harshcurious.com/posts/til1/","summary":"The second wave of coronavirus is here in India I read this article from indian express in the morning. The daily cases yesterday were over 50000 for the first time since November. There are reported cases of multiple new variants (in a situation were DNA sequencing is extremely rare).\nThe situation is frightening, especially some of the new variants being able to evade the immune system much more efficiently. I have been wearing a mask in public spaces at all times, but nobody else seems to be interested in doing so.","title":"Today I Learnt 1"},{"content":"Today I am going to run a 7 segment display off of raspberry pi 4.\nThe code I ran #!/usr/bin/env python import RPi.GPIO as GPIO import time pins = [11,12,13,15,16,18,22,7] dats = [0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x80] def setup(): GPIO.setmode(GPIO.BOARD) for pin in pins: GPIO.setup(pin, GPIO.OUT) # Set pin mode as output GPIO.output(pin, GPIO.LOW) def writeOneByte(val): GPIO.output(11, val \u0026amp; (0x01 \u0026lt;\u0026lt; 0)) GPIO.output(12, val \u0026amp; (0x01 \u0026lt;\u0026lt; 1)) GPIO.output(13, val \u0026amp; (0x01 \u0026lt;\u0026lt; 2)) GPIO.output(15, val \u0026amp; (0x01 \u0026lt;\u0026lt; 3)) GPIO.output(16, val \u0026amp; (0x01 \u0026lt;\u0026lt; 4)) GPIO.output(18, val \u0026amp; (0x01 \u0026lt;\u0026lt; 5)) GPIO.output(22, val \u0026amp; (0x01 \u0026lt;\u0026lt; 6)) GPIO.output(7, val \u0026amp; (0x01 \u0026lt;\u0026lt; 7)) def loop(): while True: for dat in dats: writeOneByte(dat) time.sleep(0.5) def destroy(): for pin in pins: GPIO.output(pin, GPIO.LOW) GPIO.cleanup() # Release resource if __name__ == \u0026#39;__main__\u0026#39;: # Program start from here setup() try: loop() except KeyboardInterrupt: # When \u0026#39;Ctrl+C\u0026#39; is pressed, the child program destroy() will be executed. destroy() Here is the thing, I just copied this code which was given to me. I don\u0026rsquo;t know what this means. Specifically, the dats stuff. So let me just run and see if this works. Here is the circuit I made.\nRemark: the 220 $ \\Omega $ resistor is connected to power in case that is not clear.\nIt works \u0026#x1f605; . Let\u0026rsquo;s carry on and celebrate with a few \u0026#x1f4f7; .\nNow that I have calmed down a little bit, let me look at the mysterious bit of code. From what\u0026rsquo;s happening I know that the code switches the leds in the 7-segment display so that we loop through 0 to 9 and A to F and then 0 again. The display changes every 0.5 seconds.\nTime for google \u0026#x1f50d; . Found it \u0026#x1f64c;. Let me rewrite the explanation in my own way.\nWhat Was that Code The parts that I didn\u0026rsquo;t understand were 0x3f-like objects and the operation \u0026lt;\u0026lt;.\nLet me first understand 0x3f. Upon googling I found this on the wikipedia page of 7-segment display. This is the hexadecimal code for 0b00111111 binary code.\nDisplay Hex binary 0 0x3f 0b 00111111 1 0x06 0b 00000110 2 0x5b 0b 01011011 3 0x4f 0b 01001111 4 0x66 0b 01100110 5 0x6d 0b 01101101 6 0x7d 0b 01111101 7 0x07 0b 00000111 8 0x7f 0b 01111111 9 0x6f 0b 01101111 A 0x77 0b 01110111 b 0x7c 0b 01111100 C 0x39 0b 00111001 d 0x5e 0b 01011110 E 0x79 0b 01111001 F 0x71 0b 01110001 . 0x80 0b 10000000 When I look at the python documentation x \u0026lt;\u0026lt; y is a bitwise operation. And what it does is it returns x with the bits shifted to the left by y units (and new bits on the right-hand-side are zeros). At the same link I saw that x \u0026amp; y is the bitwise and. Each bit of the output is 1 if the corresponding bit of x AND of y is 1, otherwise it\u0026rsquo;s 0. Let me look at a few examples.\n\u0026gt;\u0026gt;\u0026gt; bin(0x01) \u0026#39;0b1\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0x01 \u0026lt;\u0026lt; 0) \u0026#39;0b1\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0x01 \u0026lt;\u0026lt; 1) \u0026#39;0b10\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0x01 \u0026lt;\u0026lt; 2) \u0026#39;0b100\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0x06) \u0026#39;0b110\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0x06 \u0026lt;\u0026lt; 3) \u0026#39;0b110000\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0b00111111 \u0026amp; 0b00000001) \u0026#39;0b1\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0b00111111 \u0026amp; 0b00010001) \u0026#39;0b10001\u0026#39; \u0026gt;\u0026gt;\u0026gt; bin(0b10111111 \u0026amp; 0b10010001) \u0026#39;0b10010001\u0026#39; I think this makes these operations clear to me. In case of x\u0026lt;\u0026lt;y you add y number of zeros to the binary form of x. x \u0026amp; y looks at the binary form of x and y and performs the and operation on every bit. In case this isn\u0026rsquo;t clear yet let me write the case of 0b00111111 \u0026amp; 0b00000001 again:\n0b00111111 0b00000001 || 0b00000001 # which is the same as 0b1 To understand what is happening I have to look at the circuit I have made. I notice that pin 11 (using the raspberry pi board convention) is connected to the pin ?? on the 7-segment display. Now let\u0026rsquo;s look at this statement of the code.\ndef writeOneByte(val): GPIO.output(11, val \u0026amp; (0x01 \u0026lt;\u0026lt; 0)) GPIO.output(12, val \u0026amp; (0x01 \u0026lt;\u0026lt; 1)) GPIO.output(13, val \u0026amp; (0x01 \u0026lt;\u0026lt; 2)) GPIO.output(15, val \u0026amp; (0x01 \u0026lt;\u0026lt; 3)) GPIO.output(16, val \u0026amp; (0x01 \u0026lt;\u0026lt; 4)) GPIO.output(18, val \u0026amp; (0x01 \u0026lt;\u0026lt; 5)) GPIO.output(22, val \u0026amp; (0x01 \u0026lt;\u0026lt; 6)) GPIO.output(7, val \u0026amp; (0x01 \u0026lt;\u0026lt; 7)) If I also look at how the loop() function is running, at any moment, val is an element in the list dats. Let\u0026rsquo;s consider the first case of val = 0x3f. What will be the output of val \u0026amp; (0x01 \u0026lt;\u0026lt; 0)? This is the same as 0x3f \u0026amp; (0x01 \u0026lt;\u0026lt; 0). I am going to run it in python.\n\u0026gt;\u0026gt;\u0026gt; bin(0x3f \u0026amp; (0x01 \u0026lt;\u0026lt; 0)) \u0026#39;0b1\u0026#39; ","permalink":"https://harshcurious.com/posts/rpi20thmarch21/","summary":"Today I am going to run a 7 segment display off of raspberry pi 4.\nThe code I ran #!/usr/bin/env python import RPi.GPIO as GPIO import time pins = [11,12,13,15,16,18,22,7] dats = [0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x80] def setup(): GPIO.setmode(GPIO.BOARD) for pin in pins: GPIO.setup(pin, GPIO.OUT) # Set pin mode as output GPIO.output(pin, GPIO.LOW) def writeOneByte(val): GPIO.output(11, val \u0026amp; (0x01 \u0026lt;\u0026lt; 0)) GPIO.output(12, val \u0026amp; (0x01 \u0026lt;\u0026lt; 1)) GPIO.output(13, val \u0026amp; (0x01 \u0026lt;\u0026lt; 2)) GPIO.","title":"My Experiments with Raspberry Pi: Part 1"},{"content":"The most surprizing aspect of neural networks is their simplicity. I don\u0026rsquo;t mean that the whole of a neural network is simple. It is not. But at any given instant you are either adding numbers or applying a function on one number (a single variable function). Why these two kinds of operations will give you any old function of multiple variables is a mystry to me! Let me take a small step towards understanding this by reading this really old paper by Kolmogrov. This paper is in Russian, I found an English translation here. For more on the mathematical history of the problem look at the Wikiedia page on Kolmogorov-Arnold representation theorem (or superposition theorem). Essentially, this paper is important because it solves the Hilbert\u0026rsquo;s 13th problem for continous functions.\n","permalink":"https://harshcurious.com/posts/mathneuralnetwork/","summary":"The most surprizing aspect of neural networks is their simplicity. I don\u0026rsquo;t mean that the whole of a neural network is simple. It is not. But at any given instant you are either adding numbers or applying a function on one number (a single variable function). Why these two kinds of operations will give you any old function of multiple variables is a mystry to me! Let me take a small step towards understanding this by reading this really old paper by Kolmogrov.","title":"Kolmogorov Arnold Representation Theorem"},{"content":"Why Go? Computer evolution more cores programming languages based on one core programming Programming workflow evolution not written by single developer written at different times programmers write library or package to be used elsewhere open source code needs to be shared Go rethinks object-oriented development allows for code reuse let\u0026rsquo;s you use all cores no need to recompile evrytime. Learn concurrency model fast compiler syntax type system concurrency channels testing, etc How Modern programming challenges Go away Currently choice between rapid development : Ruby, python fast execution : C, C++. Go offers both simultaneously. Also, concise syntax : few keywords Compiler : less build time. Built-in concurrency: no special threading libraries. Type system: less overhead; more reusability How is the compiler Go-ing? Quick compiles by smart compiling simplified dependency resolution algorithm only looks at the libraries directly used not all dependencies of all libraries included in the dependency chain. Dynamic languages Static languages Types checked on the fly, during execution Types checked before run-time Less verbose Better code completion Easier to make change; no wait for recompilation Allows compiler optimization Less More searchable Difficult to work with other type based systems Easier to work with other systems (that rely on ststic type) like relational databases Fewer syntax and semantic errors Easier to catch type errors Eg: Perl, Python, JS C, C++, Java, Go, Rust Go is a static language compiler catches type differences easier to catch type errors Concurrency Difficult to be efficient in hardware utilization Others need thread synchronization code, prone to errors Strongest feature Gorutines like threads, use less memory and code Channels data structue lets you send typed messages between goroutines syncronization built-in Model where you send data between goroutines goroutines don\u0026rsquo;t fight for same data. goroutines functions that run simultaneously Many goroutines can run on a single thread For example, a web server that can handle multiple web requsts. In Go, the net/http library has concurrency built-in using goroutines. In C/Java, need extra code to use threading Use less memory than threads. Go runtime automatically schedules execution of goroutines An example of goroutine:\nfunc log(msg string){ ... some logging code here } // Elsewhere in our code after we\u0026#39;ve discovered an error. go log(\u0026#34;something dire happened\u0026#34;) Here the keyword go runs the log function as a goroutine. You can execute the rest of the program while the logging happened.\nNo overhead so there can be thousands of them. Channels Data structure that enable safe data communication between goroutines. Hardest aspect of concurrency: data isn\u0026rsquo;t unexpectedly modified by concurrently running threads, processes, or goroutines. Other languages make it hard to have syncronized changes. Channels ensure only one goroutine modifies data at any time. Exchange of data between goroutines is synchronized and both goroutines know that the exchange took place. Channels don\u0026rsquo;t provide data access protection between goroutines. If copies are exchanged through a channel, then it\u0026rsquo;s fine. If pointers to the data are exchanged, then each goroutine needs to be syncronized if different goroutines are performing read/write actions. Type System ####There are three layers here:\nTo define a new type, all you need to do is use existing types and add new methods. This is type composition. But these new methods, in terms of application, are no different from the inherited methods. This is called duck typing. \u0026ldquo;If it looks like a duck, and it quacks like a duck, it is a duck\u0026rdquo; (for all intent and purposes). The link that makes it click for me is this link. Essentially the idea is you can call len() on any Python object that defines a .__len__() method. So you don\u0026rsquo;t need to know if the object is str, list, dict, or a userdefined one, (or through inheretence in go). You model behaviour not model type. You don\u0026rsquo;t declare you are implementing an interface. Compiler does the work of checking if your type satify the interface you are using. This the simple interface feature in Go. ErGo Memory Management Has modern garbage collector. Don\u0026rsquo;t need to allocate and free memory like C or C++. Using this with threading and heavy concurrency is tedious. Go does this for you. Worst part of the book Avoids teaching you how to code on your device. How can you tell me to code entirely online. Come on!\n","permalink":"https://harshcurious.com/posts/gointro/","summary":"Why Go? Computer evolution more cores programming languages based on one core programming Programming workflow evolution not written by single developer written at different times programmers write library or package to be used elsewhere open source code needs to be shared Go rethinks object-oriented development allows for code reuse let\u0026rsquo;s you use all cores no need to recompile evrytime. Learn concurrency model fast compiler syntax type system concurrency channels testing, etc How Modern programming challenges Go away Currently choice between rapid development : Ruby, python fast execution : C, C++.","title":"Let's get Go-ing"},{"content":"Foreward Created by Rob Pike, Robert Griesmier, and Ken Thompson other contributions include UNIX, Java\u0026rsquo;s JVM Hotspot, Strontalk, UTF8 Open-sourse 2013: Gopher Academy; building community around Go. Go discussion board (slack) Gopher Academy blog GopherCon Go In Action Preface Began as GoingGo.net blog Member of founding team of Go reviewed suggested changes shared expertise Community effort ever scince About the Book Go is simple makes simple reliable and efficient software ides from existing languages unique and simple balances low-level language features, and high-level language features Book For intermediate level Requires experince with programming Goal intensive comprehensive idiomatic Focus on both specification, around implementation Topics include: syntax type system concurrency channel testing, etc Overview: Chapter 1 What is Go? Why created? What Go does Intro to concurrency theoretical intro Chapter 2 walkthrough one program practical intro Chapter 3 packaging How to set up Go workflow? tooling fetching building code Chapter 4 What are the built-in data types? their implementation and mechanics Chapter 5 What\u0026rsquo;s the type system? How to structure and write complex software? Chapter 6 What is scheduler concurrency channels Mechanics Chapter 7 How to use concurrency? implement gorutine pools pool reusable resources Chapter 8 What\u0026rsquo;s in the standard library? Deep into log json io Chapter 9 How to use testing, and benchmarking Specifically how to write unit and table tests and benchmarks add examples to documentation use examples as tests Code Available at github Overall, I like the style of the book. I am gonna give it a Go \u0026#x1f612;\n","permalink":"https://harshcurious.com/posts/gofirstlook/","summary":"Foreward Created by Rob Pike, Robert Griesmier, and Ken Thompson other contributions include UNIX, Java\u0026rsquo;s JVM Hotspot, Strontalk, UTF8 Open-sourse 2013: Gopher Academy; building community around Go. Go discussion board (slack) Gopher Academy blog GopherCon Go In Action Preface Began as GoingGo.net blog Member of founding team of Go reviewed suggested changes shared expertise Community effort ever scince About the Book Go is simple makes simple reliable and efficient software ides from existing languages unique and simple balances low-level language features, and high-level language features Book For intermediate level Requires experince with programming Goal intensive comprehensive idiomatic Focus on both specification, around implementation Topics include: syntax type system concurrency channel testing, etc Overview: Chapter 1 What is Go?","title":"First look at Go In Action"},{"content":"What is Microsoft Terminal? ","permalink":"https://harshcurious.com/posts/microsoftterminal/","summary":"What is Microsoft Terminal? ","title":"Microsoft Terminal: My Customizations"},{"content":"It\u0026rsquo;s a Sequence, a Sequence of Characters Can access the characters using the braket operator\n\u0026gt;\u0026gt;\u0026gt; fruit = \u0026#39;banana\u0026#39; \u0026gt;\u0026gt;\u0026gt; letter = fruit[1] \u0026gt;\u0026gt;\u0026gt; print(letter) a You get that fruit[1] is a, the second letter in the string. Remeber counting starts from 0 in Python.\nthe number inside the bracket is called the index. Indeces can be negative. But index $\\in [-length+1, length -1]$. len is the built-in function which gives the length of a string.\n\u0026gt;\u0026gt;\u0026gt; fruit = \u0026#39;banana\u0026#39; \u0026gt;\u0026gt;\u0026gt; len(fruit) 6 How to travese through a string: while loop:\nindex = 0 while index \u0026lt; len(fruit): letter = fruit[index] print(letter) index = index + 1 for loop:\nfor char in fruit: print(char) How to slice a string? \u0026gt;\u0026gt;\u0026gt; s = \u0026#39;Monty Python\u0026#39; \u0026gt;\u0026gt;\u0026gt; print(s[0:5]) Monty \u0026gt;\u0026gt;\u0026gt; print(s[6:12]) Python \u0026gt;\u0026gt;\u0026gt; print(s[:3]) Mon \u0026gt;\u0026gt;\u0026gt; print(s[3:]) ty Python \u0026gt;\u0026gt;\u0026gt; print(s[3:3]) \u0026#39;\u0026#39; \u0026gt;\u0026gt;\u0026gt; print(s[:]) Monty Python What\u0026rsquo;s imutable about \u0026rsquo;em'? try this: \u0026gt;\u0026gt;\u0026gt; greeting = \u0026#39;Hello, world!\u0026#39; \u0026gt;\u0026gt;\u0026gt; greeting[0] = \u0026#39;J\u0026#39; TypeError: \u0026#39;str\u0026#39; object does not support item assignment you get an error because strings are immutable, ie they can\u0026rsquo;t be changed. instead you need to create a new string: \u0026gt;\u0026gt;\u0026gt; new_greeting = \u0026#39;J\u0026#39; + greeting[1:] \u0026gt;\u0026gt;\u0026gt; print(new_greeting) Jello, world! Fighting for equality: if word == \u0026#39;banana\u0026#39;: print(\u0026#39;All right, bananas.\u0026#39;) this checks if the string word is exactly the string banana.\nif word \u0026lt; \u0026#39;banana\u0026#39;: print(\u0026#39;Your word,\u0026#39; + word + \u0026#39;, comes before banana.\u0026#39;) this checks the alphabetical order among strings.\nAll the uppercase letters come before all the lowercase letters\nAre strings Python objects? What\u0026rsquo;s an object? Strings are objects\nObject contains two things\ndata methods : functions built into objects and available to any instance The dir shows avilable methods associated with the object Methods have a different syntax: Some string methods : str.upper() : as shown above, return copy by turning all characters into uppercase.\nstr.capitalize() : returns copy with first character capitalized and the rest lowercased\nstr.casefold : removes all case distictions; umlauts, etc removed\nstr.count(sub[, start[, end]]) : Returns the number of non-overlapping occurrences of substring sub in the range $[start, end]$\nstr.find(sub[, start[, end]]) : Returns the lowest index in the string where substring sub is found within the slice $s[start:end]$. Returns -1 if sub is not found.\nin operator (not a method):\n\u0026gt;\u0026gt;\u0026gt; \u0026#39;Py\u0026#39; in \u0026#39;Python\u0026#39; True str.endswith(suffix[, start[, end]]) : Returns True if the string ends with the specified suffix, otherwise return False. suffix can also be a tuple of suffixes to look for.\nstr.format(*args, **kwargs) : replaces elements in {} with a string value. Eg\n\u0026gt;\u0026gt;\u0026gt; \u0026#34;The sum of 1 + 2 is {0}\u0026#34;.format(1+2) \u0026#39;The sum of 1 + 2 is 3\u0026#39; This is a relatively new inclusion to Python. More details later.\nstr.index(sub[, start[, end]]) : like find(), but returns ValueError when substring is not found.\nstr.isdigit() : returns True if all characters are digits and at least one character, False otherwise. Digits include decimals and special ones (like non-base 10 and superscript ones).\nstr.join(iterable) : Returns a string which is a concatenation of strings in iterable. Error TypeError if there is a non-string value in iterable.\nstr.partition(sep) : Splits the string at the first occurence of sep and returns a 3-tuple containing the part before separator, the seperator, and the part after separator.\nstr.replace(old,new[,count]) : Returns a copy of str with all occurances of old replaced by new. If count is provided then only the first count-number of replacements are held.\nstr.split(sep=None, maxsplit=-1) : Returns a list of words in the string, all of which are separated by sep. The defaults separates whitespace characters.\nstr.startswith : Like endswith(), but checks for prefix.\nstr.strip([chars]) : Returns a copy of the string with the leading and trailing characters removed. By default it removes the whitespaces at the begining and end of the string.\nParsing Strings Exercises My solutions:\nfruit = \u0026#39;banana\u0026#39; index = len(fruit) while index \u0026gt; 0: print(fruit[index -1]) index = index - 1 Here in the first statement of the while loop I combined two statement and it works.\n2.\ndef countletter(word, char): count = 0 for letter in word: if letter == char: count = count + 1 print(count) word = input(\u0026#39;Word: \u0026#39;) char = input(\u0026#39;Letter to count: \u0026#39;) countletter(word, char) 4.\n","permalink":"https://harshcurious.com/posts/pythonstrings/","summary":"It\u0026rsquo;s a Sequence, a Sequence of Characters Can access the characters using the braket operator\n\u0026gt;\u0026gt;\u0026gt; fruit = \u0026#39;banana\u0026#39; \u0026gt;\u0026gt;\u0026gt; letter = fruit[1] \u0026gt;\u0026gt;\u0026gt; print(letter) a You get that fruit[1] is a, the second letter in the string. Remeber counting starts from 0 in Python.\nthe number inside the bracket is called the index. Indeces can be negative. But index $\\in [-length+1, length -1]$. len is the built-in function which gives the length of a string.","title":"What are Strings in Python"},{"content":"The while loop It allows you to repeat a set of actions until a statement is true. Eg:\nn = 5 while n \u0026gt; 0: print(n) n = n - 1 print(\u0026#39;Blastoff!\u0026#39;) This is executed as follows\nCreates and sets n to 5. Goes to the while statement and checks if n is greater than 0. Right now it\u0026rsquo;s true, so we move inside the loop. Prints n, ie outputs 5. Reduces n by 1, ie n is now 4 Goes back to the while statement Checks if n is still greater than 0. It is, so we again move inside the while loop. Prints 4. Reduces n by 1. Goes back to the while statement \u0026hellip; \u0026hellip; This goes on until n = 0. When this happens, we exit the while loop and go to the statement after that which is print('Blastoff'). So the probram outputs Blastoff and ends. Infinite loops Don\u0026rsquo;t write infinite loops. Eg:\nLather, rinse, repeat or\nn = 10 while n \u0026lt; 20: print(n, end=\u0026#39; \u0026#39;) n = n - 1 print(\u0026#39;Done!\u0026#39;) break statement We still sometimes use infinite loops with the break statement for more complicated testing conditions. A simpler example is\nwhile True: line = input(\u0026#39;\u0026gt; \u0026#39;) if line == \u0026#39;done\u0026#39;: break print(line) print(\u0026#39;Done!\u0026#39;) # Code: http://www.py4e.com/code3/copytildone1.py Here the loop runs repeatedly until it hits the break statement when the user inputs done.\ncontinue statement This one ends the current iteration and makes it move onto the next iteration of the loop. The loop still goes on. Eg:\nwhile True: line = input(\u0026#39;\u0026gt; \u0026#39;) if line[0] == \u0026#39;#\u0026#39;: continue if line == \u0026#39;done\u0026#39;: break print(line) print(\u0026#39;Done!\u0026#39;) # Code: http://www.py4e.com/code3/copytildone2.py An iteration ends if the the first letter of the input is #. A sample output is :\nThe for Loop We use this when we want to loop inside a set. The set could be a list of words , lines in a file or a list of numbers. Eg:\nfriends = [\u0026#39;Joseph\u0026#39;, \u0026#39;Glenn\u0026#39;, \u0026#39;Sally\u0026#39;] for friend in friends: print(\u0026#39;Happy New Year:\u0026#39;, friend) print(\u0026#39;Done!\u0026#39;) Some looping examples \u0026#x27bf; Counting the number of items\ncount = 0 for itervar in [3, 41, 12, 9, 74, 15]: count = count + 1 print(\u0026#39;Count: \u0026#39;, count) Total of a set of numbers\ntotal = 0 for itervar in [3, 41, 12, 9, 74, 15]: total = total + itervar print(\u0026#39;Total: \u0026#39;, total) Finding the largest value in a sequence\nlargest = None for itervar in [3, 41, 12, 9, 74, 15]: if largest is None or itervar \u0026gt; largest : largest = itervar print(\u0026#39;Largest:\u0026#39;, largest) Function to find the minimum\ndef min(values): smallest = None for value in values: if smallest is None or value \u0026lt; smallest: smallest = value return smallest Debugging sugestion Debugging by bisection. Break a problem in half and add a print statement to check. If the mid-point check is incorrect, the problem must be in the first half of the program. If it is correct, the problem is in the second half. Bisect the selection. So on\u0026hellip; Exercises My solutions\nReads numbers until done; print total, count, and average:\ntotal = 0 count = 0 average = 0 while True: inp = input(\u0026#39;Enter a number: \u0026#39;) if inp == \u0026#39;done\u0026#39;: break else: try: num = float(inp) except: print(\u0026#39;Invalid input\u0026#39;) continue total = total + num count = count + 1 average = total / count print(\u0026#39;Total:\u0026#39;, total, \u0026#39;Count:\u0026#39;, count, \u0026#39;Average:\u0026#39;,average) Prints max and min as well:\nmax = None min = None while True: inp = input(\u0026#39;Enter a number: \u0026#39;) if inp == \u0026#39;done\u0026#39;: break else: try: num = float(inp) except: print(\u0026#39;Invalid input\u0026#39;) continue if max is None or num \u0026gt; max: max = num if min is None or num \u0026lt; min: min = num print(\u0026#39;Max:\u0026#39;, max, \u0026#39;Min:\u0026#39;, min) ","permalink":"https://harshcurious.com/posts/pythoniteration/","summary":"The while loop It allows you to repeat a set of actions until a statement is true. Eg:\nn = 5 while n \u0026gt; 0: print(n) n = n - 1 print(\u0026#39;Blastoff!\u0026#39;) This is executed as follows\nCreates and sets n to 5. Goes to the while statement and checks if n is greater than 0. Right now it\u0026rsquo;s true, so we move inside the loop. Prints n, ie outputs 5.","title":"How to Iterate in Python"},{"content":"What is a Function A function takes a set of inputs and produces an output. Eg:\n\u0026gt;\u0026gt;\u0026gt;type(32) \u0026lt;class \u0026#39;init\u0026#39;\u0026gt; Here type is a function that takes 32 as an input and produces its class.\nSome Built-in functions max : gives the “largest character” in the string\n\u0026gt;\u0026gt;\u0026gt;max(\u0026#39;Hello world\u0026#39;) \u0026#39;w\u0026#39; min : gives the “smallest character” in the string\n\u0026gt;\u0026gt;\u0026gt;min(\u0026#39;Hello world\u0026#39;) \u0026#39; \u0026#39; len : gives the number of characters in the string\n\u0026gt;\u0026gt;\u0026gt;len(\u0026#39;Hello world\u0026#39;) 11 Type conversion functions\nint : takes any value and converts it to an integer, if it can, or complains otherwise \u0026gt;\u0026gt;\u0026gt;int(\u0026#39;32\u0026#39;) 32 \u0026gt;\u0026gt;\u0026gt;int(\u0026#39;Hello\u0026#39;) ValueError: invalid literal for int() with base 10: \u0026#39;Hello\u0026#39; \u0026gt;\u0026gt;\u0026gt;int(3.99999) 3 \u0026gt;\u0026gt;\u0026gt; int(-2.3) -2 float : takes integers and strings, and converts them to floating-point numbers \u0026gt;\u0026gt;\u0026gt; float(32) 32.0 \u0026gt;\u0026gt;\u0026gt; float(\u0026#39;3.14159\u0026#39;) 3.14159 str : converts its argument to a string \u0026gt;\u0026gt;\u0026gt; str(32) \u0026#39;32\u0026#39; \u0026gt;\u0026gt;\u0026gt; str(3.14159) \u0026#39;3.14159\u0026#39; Math Functions\nNeed to import it with the import math command. log_10 : logarithm in base 10 \u0026gt;\u0026gt;\u0026gt; ratio = signal_power / noise_power \u0026gt;\u0026gt;\u0026gt; decibels = 10 * math.log10(ratio) pi \u0026gt;\u0026gt;\u0026gt; degrees = 45 \u0026gt;\u0026gt;\u0026gt; radians = degrees / 360.0 * 2 * math.pi sin \u0026gt;\u0026gt;\u0026gt; math.sin(radians) 0.7071067811865476 sqrt \u0026gt;\u0026gt;\u0026gt; math.sqrt(2) / 2.0 0.7071067811865476 Random numbers\nThe random module provides functions that generate pseudorandom numbers\nimport random for i in range(10): x = random.random() print(x) randint : takes two inputs and produces a random integer in the range\n\u0026gt;\u0026gt;\u0026gt; random.randint(5,10) 7 \u0026gt;\u0026gt;\u0026gt; random.randint(5,10) 10 choice : chooses an element from a sequence at random\n\u0026gt;\u0026gt;\u0026gt; t = [1, 2, 3] \u0026gt;\u0026gt;\u0026gt; random.choice(t) 2 \u0026gt;\u0026gt;\u0026gt; random.choice(t) 3 Defining functions The defining feature of programming languages is their ability to have user defined functions.\nIn python we define functions in the following way:\nTo call the above function you just type\n\u0026gt;\u0026gt;\u0026gt; print_lyrics() I\u0026#39;m a lumberjack, and I\u0026#39;m okay. I sleep all night and I work all day. If you have defined a function A already in your code, you can use it inside a function B as long as function B comes after function A in the flow of execution.\nTo return a result from a function, we use the return statement in our function\ndef addtwo(a, b): added = a + b return added x = addtwo(3, 5) print(x) # Code: http://www.py4e.com/code3/addtwo.py void function: A function that does not return a value.\n\u0026gt;\u0026gt;\u0026gt; print(print_lyrics()) None \u0026gt;\u0026gt;\u0026gt; print(type(None)) \u0026lt;class \u0026#39;NoneType\u0026#39;\u0026gt; Why functions name a group of statements; program easier to read, understand, and debug eliminates repetitive code; changes in one place debug the parts one at a time and then assemble them into a working whole well-designed functions are useful for many programs; write and debug once; reuse it Exercise Solutions\nExercise 4 inpHours = input(\u0026#39;Enter Hours: \u0026#39;) try: hour = float(inpHours) except: print(\u0026#39;Error, please enter numeric input\u0026#39;) exit(0) inpRate = input(\u0026#39;Enter Rate: \u0026#39;) try: rate = float(inpRate) except: print(\u0026#39;Error, please enter numeric input\u0026#39;) exit(0) def computepay(h, r): if h \u0026lt;= 40 : pay = r * h else: pay = (r * 40) + (1.5*r*(h-40)) print(\u0026#39;Pay:\u0026#39;, pay) computepay(hour, rate) Exercise 5 inp = input(\u0026#39;Enter score: \u0026#39; ) try: s = float(inp) except : print(\u0026#39;Bad Score\u0026#39;) quit() def computegrade(score): if score \u0026gt; 1: return \u0026#39;Bad score\u0026#39; elif score \u0026gt;= 0.9: return \u0026#39;A\u0026#39; elif score \u0026gt;= 0.8: return \u0026#39;B\u0026#39; elif score \u0026gt;= 0.7: return \u0026#39;C\u0026#39; elif score \u0026gt;= 0.6: return \u0026#39;D\u0026#39; elif score \u0026gt;= 0: return \u0026#39;F\u0026#39; else: return \u0026#39;Bad score\u0026#39; grade = computegrade(s) print(grade) ","permalink":"https://harshcurious.com/posts/pythonfunction/","summary":"What is a Function A function takes a set of inputs and produces an output. Eg:\n\u0026gt;\u0026gt;\u0026gt;type(32) \u0026lt;class \u0026#39;init\u0026#39;\u0026gt; Here type is a function that takes 32 as an input and produces its class.\nSome Built-in functions max : gives the “largest character” in the string\n\u0026gt;\u0026gt;\u0026gt;max(\u0026#39;Hello world\u0026#39;) \u0026#39;w\u0026#39; min : gives the “smallest character” in the string\n\u0026gt;\u0026gt;\u0026gt;min(\u0026#39;Hello world\u0026#39;) \u0026#39; \u0026#39; len : gives the number of characters in the string","title":"Learning Python: Functions"},{"content":"This post describes the creation process of this website. I have used the popular static site generator Hugo. Hugo is based on the language go. Disclaimer: this is the second time I am creating my website using Hugo. But the last time I created this was in 2015, so a lot has changed.\nInstalling Hugo on Windows 10 My recommendation is to use Chocolatey to install Hugo although there are binaries available at github for direct installation. If Chocolatey is installed on your system, open powershell by right clicking the start button. There type\nchococ install hugo to install Hugo. Now are ready to use Hugo commands from the powershell. To check if the installtion went well type hugo version. It will display the current version of Hugo.\nUsing Hugo One way to quickly learn how to use Hugo is to follow the quickstart guide over at the Hugo website. There is one problem, with the echo command, I encountered while applying it on Windows 10. For completeness I will describe all the steps involved.\nWe begin by creating a directory with the necessary structure for our website. I stated by creating a practice folder called quickstart using\nhugo new site quickstart Then type\ncd quickstart to move into the newly created directory.\nNext we add a theme to our website. We will add the Ananke theme using git.\ngit init\rgit submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke More themes are available at themes.hugo.io. If you don\u0026rsquo;t have git installed you can also download the themes from there, and extract the compressed folder into the themes folder in your site\u0026rsquo;s directory. Using git is higly recommended.\nTake a look in the themes folder in your site\u0026rsquo;s directory. There should be a folder named ananke inside. Go back to the quickstart directory and open the config.toml file in your faourite text editor. I am using Atom. Add\ntheme = \u0026#34;ananke\u0026#34; to the end of your config file.\nNow your website is essentially ready. Let\u0026rsquo;s add our first post. Type the following command on the powershell\nhugo new posts/my-first-post.md This will create a markdownfile named my-first-post.md in the content\u0026gt;posts. Open it in a text editor. You will notice that the file already contains the following:\n---\rtitle: \u0026#34;My First Post\u0026#34;\rdate: 2021-02-27T16:42:29+05:30\rdraft: true\r--- The title is going to be the title of your blog post, date is the time when your file was created, and \u0026lsquo;draft\u0026rsquo; represents whether or no your post is published. Change draft to false when you are happy with the content.\nEven when draft is set to true, you can see how it will look on you website by typing the folloing in the powershell.\nhugo server -D image\nClick on the link displayed to see the current status of your website. Make your changes. Once you are happy with your changes, build your site by typing the following in your powershell\nhugo Your website is published in the public folder in your website directory.\nCreating your Website ","permalink":"https://harshcurious.com/posts/hugocreation/","summary":"This post describes the creation process of this website. I have used the popular static site generator Hugo. Hugo is based on the language go. Disclaimer: this is the second time I am creating my website using Hugo. But the last time I created this was in 2015, so a lot has changed.\nInstalling Hugo on Windows 10 My recommendation is to use Chocolatey to install Hugo although there are binaries available at github for direct installation.","title":"Creating This Website Using Hugo on Windows 10"},{"content":"My Failed Attempt at Setting Up This Website Using Franklin (On Windows) I will be using Franklin based on Julia because\nI wanted to learn Julia I wanted to use markdown (or somethng similar) with LaTeX support automatically I wanted to see if the promises of KaTeX rendering hold water Code highlighting was another bonus Installing Julia on Windows 10 To do this I first installed Julia using Chocolatey with the command\nchoco install julia \u0026ndash;confirm\nIn reality I first used the official Julia insaller, but by default it installs Julia in a folder with the version number. This makes it really hard to add it to your PATH in the Powershell. Chocolatey on the other hand, handles it all for you and you can start using Julia by typing julia on the Powershell prompt. Also, updating Julia will be way easier, just run the command choco upgrade julia --confirm.\nSetting Up Atom to use as my markdown editor I have borrowed a lot of what I am sharing from these two wonderful resources 1 and 2.\nInstall (using the installer at Atom.io) and open Atom. Close all the welcome messages (after reading them if you feel like it). Click File \u0026raquo; Settings. Now go to the install option and search and install the following packages\nmarkdown-writer : improves the markdown editing process especially for static blogs markdown-preview-plus : provides real-time preview of markdown with LaTeX support language-markdown : Adds grammar support for Markdown, and smart context-aware behavior to lists autosave : protects your work by saving it periodically highlightselected : highlights occurance of the selected word linter-retextjs : gives feedback on your writing pandoc-convert : if you want to directly convert your markdown file into HTML auto-terminal-powershell : open powershell terminal in the current file\u0026rsquo;s directory wordcount : if you want to see the wordcount of your document If you have never written in markdown before, this is an excellent resourse. I am using this markdownguide page as my reference for markdown syntax.\nInstalling Franklin First type julia in the powershell to get to the Julia prompt julia\u0026gt;. Them press ] to get to pkg, julia\u0026rsquo;s package manager. You prompt will change to (@v1.5) pkg\u0026gt;. Now type\nadd Franklin and Franklin package will be installed. Once this package is intalled, (optionally) install the NodeJS package\nadd NodeJS Now the nest commands on the official website are clearly for linux\nusing NodeJS run(`sudo $(npm_cmd()) install highlight.js`) I wasn\u0026rsquo;t able to modify it to get it to work for me. This is the point where I gave up. My Node.js is in D directory whereas the julia directory is C. I will have to edit the NodeJS.jl file to make this work. I don\u0026rsquo;t wanna do that right now. Maybe someday I will get back to it. I did set up atom to use markdown which is great.\n","permalink":"https://harshcurious.com/posts/franklinfail/","summary":"My Failed Attempt at Setting Up This Website Using Franklin (On Windows) I will be using Franklin based on Julia because\nI wanted to learn Julia I wanted to use markdown (or somethng similar) with LaTeX support automatically I wanted to see if the promises of KaTeX rendering hold water Code highlighting was another bonus Installing Julia on Windows 10 To do this I first installed Julia using Chocolatey with the command","title":"FranklinFail"}]