# Introduction

> "A journey of a thousand miles begins with a single step"
>
> * Tao Te Ching"

This is my personal wiki in the form of an [online GitBook](https://wiki.dewaka.com) hosted on [GitHub](https://github.com/dewaka/wiki).

## License

Content is licensed by [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/legalcode) license.


# Books

* [Technical books](/books/technical)
* [Psychology books](/books/psychology)


# Technical books

* [Elements of Programming](/books/technical/elements-of-programming)


# Elements of Programming

## Chapter 1 - Foundations

* Lemmas
  * 1.1 - If a value type is uniquely represented, equality implies representational equality.
  * 1.2 - If a value type is not ambiguous, representational equality implies equality.


# Psychology books

* [Mindset](/books/psychology/mindset)


# Mindset

Book - [Mindset: The New Psychology of Success](https://www.goodreads.com/book/show/40745.Mindset)

## The Mindsets

* Alfred Binet invented IQ tests to improve education system in France at the time.
* Gene expression requires input from the environment to work properly.
* How people achieve expertise *is not some fixed prior ability, but purposeful engagement* - Robert Sternberg.
* There two broad categories to which people fall under,
  * Fixed mindset - thinks one's intelligence is something very basic about

    onself and is thus fixed which one cannot change very much.
  * Growth mindset - thinks that one can change and grow and get smarter along

    the process.

## Inside the Mindsets

* Fixed mindset
  * Dislikes change
  * Needs validation and thinks&#x20;
* Growth mindset
  * Relishes challenges which can stretch them
  * Not afraid to fail and learn from mistakes
* Quote from 1960s

  > Becoming is better than being
* Coping with failure without thinking that it is a fixed state one's fated to is one of the hallmarks of a growth mindset
* Growth mindset allows people to value what they are doing *\_regardless of the outcome*.

## The truth about ability and accomplishment

* Thomas Edison, Mozart, Darwin and countless others spent a great deal of time labouring and perfecting their works which we recognise today as productions of genius.
* Growth mindset is about studying to learn and not just to ace tests.
* Major part of gifted people with growth mindset is that their endless curiosity and challenge seeking.
* Even art and artists when examined closely reveals how much training and effort goes into producing the masterworks. A great example would be Jackson Pollock.
* Praise can be a harbinger of fixed mindset if it is directed at the results or talent and *not* the efforts.

## Sports: The mindset of a champion

* Character in sports

  > Character is the ability to dig down and find the strength even when things are going against you
* Mark of a champion is the ability to win when things are not quite right
* Growth mindset people found success in doing their best, in learning and improving
* Growth mindset people found setbacks motivating
* Growth mindset people took charge of the processes that bring success and that which maintain it
* Sports greatness,&#x20;

  > Even though the finest athletes are wildly competitive and want to be the best, greatness does not come from the ego of the fixed mindset, with its somebody–nobody syndrome.

## Business: Mindset and Leadership

* A company that cannot self-correct cannot thrive - example from Enron
* The type of the leader at the helm of a company matters a lot.&#x20;
* Leaders who have the growth mindset, who are *self-effacing, who constantly asked questions and had the ability to confront the most brutal answered* had the most impact on their companies successes.
* It is not about proving themselves but constantly trying to improve themselves.
* Growth-minded leaders, have a belief in human potential and development - both their own and other people’s.
* True self-confidence is "the courage to be open - to welcome change and new ideas regardless of their source"
* Growth minded managers believe that skills are learnable, including negotiation skills.

## Relationships: Mindsets in Love (or not)

* When people had fixed mindset, they felt judged and labeled by rejection
* Fixed mindset people are set on hurting
* To understand all is to forgive all

  > Tout comprendre c'est tout pardonner
* Growth mindset people care more about understanding, forgiving and moving on
* [Emotional Intelligence: Why It Can Matter More Than IQ](https://www.goodreads.com/book/show/26329.Emotional_Intelligence) - book is recommneded
* Growth mindset can be applied to yourself, your partner and the relationships themselves
* Thinking following is a destructive in a relationship,

  > “If we need to work at it, there’s something seriously wrong with our relationship.”
* Daniel Wile, a relationship expert,

  > choosing a partner is choosing a set of problems The trick is to acknowledge each other's limitations, and build from there

## Parents, teachers, and coaches: Where do mindsets come from?

* Praising efforts rather than *innate* ability is a better way to go about giving recognition for kids.
* Offering constructive criticism is the best course of action.
* Teachers should not be judgemental.
* Great teachers love to learn and teaching is a way of learning. Feynmann believed in the same concept.
* Coach John Wooden,

  > “You have to apply yourself each day to becoming a little better. By applying yourself to the task of becoming a little better each and every day over a period of time, you will become a lot better.”

## Changing mindsets

* Keeping track of the internal monologue is pretty important.
* Thinking differently has to be inculcated for a growth mindset.
* A growht mindset approach can be applied for learning growth mindset as well!
* All of us both mindsets. So it is important to understand what triggers each type.
* Things to always keep in mind,

  > What are the opportunities for learning and growth today? For myself? For the people around me?
  >
  > When, where, and how will I embark on my plan?
  >
  > When, where, and how will I act on my new plan?
  >
  > What do I have to do to maintain and continue the growth?


# Computer Science


# Data Structures


# Skip Lists

* Succint introduction to Skip Lists - [Skip List | Set 1 (Introduction) | GeeksforGeeks](https://www.youtube.com/watch?v=ypod5jeYzAU).
* [Skip Lists: A Probabilistic Alternative to Balanced Trees](https://epaperpress.com/sortsearch/download/skiplist.pdf) - original paper by William Pugh.


# Algorithms

* [Hashing](/computer-science/algorithms/hashing)


# Hashing

## Open address hashing

* [Hashing | Set 3 (Open Addressing) - GeeksforGeeks](https://www.geeksforgeeks.org/hashing-set-3-open-addressing/)

## Cryptographically secure hashing

* [Cryptographic hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function)

## Hash functions

### [FNV Hash](http://www.isthe.com/chongo/tech/comp/fnv/index.html)

The core of the FVN-1 hash algorithm is,

```
hash = offset_basis
for each octet_of_data to be hashed
 hash = hash * FNV_prime
 hash = hash xor octet_of_data
return hash
```


# Eller's Algorithm

* <http://weblog.jamisbuck.org/2010/12/29/maze-generation-eller-s-algorithm>


# Formal verification

* [Coq](/computer-science/formal-verification/coq)
* [Lean](/computer-science/formal-verification/lean)
* [TLA+](/computer-science/formal-verification/tla)


# Coq


# Lean

## Tutorials

* [Programming in Lean](https://leanprover.github.io/programming_in_lean/#01_Introduction.html)

## Papers

* [The Lean Theorem Prover (system description)](https://leanprover.github.io/papers/system.pdf)


# TLA+

## Books

* [Practical TLA+: Planning Driven Development by Hillel Wayne](https://www.goodreads.com/book/show/42389860-practical-tla)

## Links

* [Using formal methods at Amazon](https://lamport.azurewebsites.net/tla/formal-methods-amazon.pdf)


# Garbage Collection

## Posts

* [Modern garbage collection](https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e)
* [Modern garbage collection - Part 2](https://blog.plan99.net/modern-garbage-collection-part-2-1c88847abcfd)
* [JVM Garbage Collectors Benchmarks Report 19.12](https://ionutbalosin.com/2019/12/jvm-garbage-collectors-benchmarks-report-19-12/)


# Programming

* [Functional programming](/programming/functional-programming)
  * [Functional data structures](/programming/functional-programming/data-structures)
  * [Algebraic Effects](/programming/functional-programming/algebraic-effects)
  * [Dependent Types](/programming/functional-programming/dependent-types)
    * [Agda](/programming/functional-programming/dependent-types/agda)
    * [Idris](/programming/functional-programming/dependent-types/idris)
  * [Continuations](/programming/functional-programming/continuations)
* [Concurrent Programming](/programming/concurrency)
  * [Mutex](/programming/concurrency/mutex)
  * [Semaphores](/programming/concurrency/semaphores)
* [Parallel Programming](/programming/parallelism)
* [Unicode](/programming/unicode)


# Functional programming

## Topics

* [Functional data structures](/programming/functional-programming/data-structures)
* [Algebraic Effects](/programming/functional-programming/algebraic-effects)
* [Continuations](/programming/functional-programming/continuations)
* [Dependent Types](/programming/functional-programming/dependent-types)
* [Category Theory](/programming/functional-programming/category-theory)
* [Total Functional Programming](/programming/functional-programming/total)
* [Uniqueness Typing](/programming/functional-programming/uniqueness-typing)
* [GADT](/programming/functional-programming/gadt)
* [Tagless Final](/programming/functional-programming/tagless-final)

## Posts

* [Why Why Functional Programming Matters Matters](http://weblog.raganwald.com/2007/03/why-why-functional-programming-matters.html)


# Functional data structures

## References

* [Chris Okasaki - Purely Functional Data Structures](https://www.goodreads.com/book/show/594288.Purely_Functional_Data_Structures) -

  This is the bible of purely functional programming languages.


# Algebraic Effects

## Papers

* [Algebraic Effects for Functional Programming](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/08/algeff-tr-2016-v2.pdf)


# Dependent Types

## Topics

* [Agda](/programming/functional-programming/dependent-types/agda)
* [Idris](/programming/functional-programming/dependent-types/idris)


# Agda

## Tutorials

* [Programming Language Foundations in Agda](https://plfa.github.io/)

## Papers

* [Dependently Typed Programming in Agda](http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf)


# Idris

## Papers

* [Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation](https://pdfs.semanticscholar.org/1407/220ca09070233dca256433430d29e5321dc2.pdf)


# Continuations

## Configuration Passing Style

* [Configuration passing style in JavaScript](http://matt.might.net/articles/by-example-continuation-passing-style/)


# Category Theory

## Links

* [Seven Sketches in Compositionality: An Invitation to Applied Category Theory](http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf)
* [Category Theory for Programmers (2014)](https://github.com/hmemcpy/milewski-ctfp-pdf/)


# Total functional programming

## Papers

* [Total Functional Programming](http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf) by David Turner (of \[Miranda]\(<https://en.wikipedia.org/wiki/Miranda_(programming_language>)) fame)&#x20;
* [Totality versus Turing-Completeness?](https://personal.cis.strath.ac.uk/conor.mcbride/pub/Totality.pdf) by Conor McBride


# Uniqueness Typing

* [Uniqueness Typing Redefined](http://www.edsko.net/pubs/ifl06-paper.pdf)

## Posts

* [Tradeoffs between Unique Types and Monads](http://lambda-the-ultimate.org/node/1180)


# GADT


# Tagless Final


# Concurrent Programming

* [Concurrency is not Parallelism](https://talks.golang.org/2012/waza.slide#1) -

  this is the famous talk by Rob Pike making the case for Go programming

  language's first class support for concurrency


# Mutex

[Solution of a problem in concurrent programming control](https://dl.acm.org/citation.cfm?doid=365559.365617) is the paper, by Dijkstra, which introduced the concept of Mutexes.


# Semaphores

Semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system.


# Parallel Programming


# Systems Programming

* [Tagged pointers](/programming/systems/tagged)


# Tagged pointers

* Tagged pointers - <https://en.wikipedia.org/wiki/Tagged_pointer>&#x20;
* [mikeash.com: Friday Q\&A 2012-07-27: Let's Build Tagged Pointers](https://www.mikeash.com/pyblog/friday-qa-2012-07-27-lets-build-tagged-pointers.html)
* What is pointer alignment? Most computer architectures have a concept of *pointer alignment* where a pointer to a data type should be a multiple of some power of two. This fact is what enables pointer tagging which makes use of "unused" bits in pointer values.


# Unicode

## Articles

* [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets](https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/)

## Languages are not uniform on how they handle Unicode

* Unicode handling differences between Python and JavaScript -

  <https://medium.com/better-programming/slicing-strings-containing-emoji-differences-between-python-and-javascript-4716c419718f>


# Competitive Programming

## Resources

* [Competitive Programming Algorithms](https://cp-algorithms.com) - this is an English translation of [original Russian](http://e-maxx.ru/algo/) competitive programming algorithms resources.


# Source control

* [Git](/source-control/git)


# Git

## Tools

* [Magit - A Git Porcelain inside Emacs](https://magit.vc) - this is probably

  the best git tool to quickly get work done if you are already married to the

  Emacs ecosystem.

## Tips

* Undoing a `git add` before commit -

  <https://stackoverflow.com/questions/348170/how-do-i-undo-git-add-before-commit>.
* Removing untracked files - <https://koukia.ca/how-to-remove-local-untracked-files-from-the-current-git-branch-571c6ce9b6b1>
  * `git clean -n` - to check which files will be deleted.
  * `git clean -f` - to delete untracked files.
* Rebase remote master - <https://stackoverflow.com/questions/7929369/how-to-rebase-local-branch-with-remote-master/18442755>,

  ```bash
  git fetch origin            # Updates origin/master
  git rebase origin/master    # Rebases current branch onto origin/master
  ```

  This can be done in one step - `git pull --rebase origin master`
* Undoing a git rebase - <https://stackoverflow.com/questions/134882/undoing-a-git-rebase>.


# Programming languages


# Java

## Topics

* [Libraries](/programming-languages/java/libraries)
* [Performance](/programming-languages/java/performance)
* [Garbage Collection](/programming-languages/java/garbage-collection)
* [Modules](/programming-languages/java/modules)
* [Graal](/programming-languages/java/graal)

## Specifications

* [The Java Language Specification, Java SE 9 Edition](http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jls-diffs.pdf)
* [The Java Language Specification, Java SE 13 Edition](https://docs.oracle.com/javase/specs/jls/se13/jls13.pdf)

## Resources

* [Psychosomatic, Lobotomy, Saw](http://psy-lob-saw.blogspot.com/)
* [Aleksey Shipilëv](https://shipilev.net/)


# Java Garbage Collection

## Low latency focused collectors

* [Shenandoah](https://wiki.openjdk.java.net/display/shenandoah/Main)
* [ZGC](https://wiki.openjdk.java.net/display/zgc/Main)


# Java Performance

## Tips

* When to use final?&#x20;

  [Java theory and practice: Is that your final answer?](https://www.ibm.com/developerworks/java/library/j-jtp1029/index.html)

## JMH Benchmarking

* [Microbenchmarking with Java | Baeldung](https://www.baeldung.com/java-microbenchmark-harness)


# Java Modules

* Java modules add a higher level of aggregation above packages
* Defined in [Java Platform Module System (JSR 376)](https://openjdk.java.net/projects/jigsaw/spec/)
* Related - [JEP 200: The Modular JDK](https://openjdk.java.net/jeps/200)
* Availble modules can be listed using - `java --list-modules`
* With modules there are new restricted keywords: open, module, requires, transitive, exports, opens, to, uses, provides, and with (<https://stackoverflow.com/questions/36322223/new-keywords-in-java-9>)

## Resources

* <https://www.oracle.com/corporate/features/understanding-java-9-modules.html>
* <https://www.baeldung.com/java-9-modularity>
* <http://tutorials.jenkov.com/java/modules.html>


# Graal

## Research

* <https://www.graalvm.org/community/publications/>

## Blog posts

* <https://www.javaadvent.com/2018/12/comparing-kotlin-performance-with-graal-and-c2.html>


# Java libraries

* [Spring](/programming-languages/java/libraries/spring)
  * [Spring Cloud](/programming-languages/java/libraries/spring/spring-cloud)
* [Guava](/programming-languages/java/libraries/guava)
* [JUnit 5](/programming-languages/java/libraries/junit5)
* [Hamcrest](/programming-languages/java/libraries/hamcrest)
* [Logging](/programming-languages/java/libraries/logging)

## Utility libraries

* [Google Auto](/programming-languages/java/libraries/auto)
* [Lombok](/programming-languages/java/libraries/lombok)
* [args4j](/programming-languages/java/libraries/args4j)
* [duct-tape](/programming-languages/java/libraries/duct-tape)

## Database and ORMs

* [JOOQ](/programming-languages/java/libraries/jooq)

## Servers

* [Netty](/programming-languages/java/libraries/netty)


# Spring


# Spring Cloud

* [Introduction to Spring Cloud Netflix - Eureka | Baeldung](https://www.baeldung.com/spring-cloud-netflix-eureka)


# Guava

* [Google Guava User Guide](https://github.com/google/guava/wiki)


# JUnit 5

## Parameterised Tests

* A tutorial - <https://blog.codefx.org/libraries/junit-5-parameterized-tests/>.
* Some examples from Excel library,

  ```java
  static List<ExcelWriter> getTestWorkbookWriters() {
      val streaming = testWriter().isStreaming(true).build();
      val nonStreaming = testWriter().isStreaming(false).build();

      return Arrays.asList(streaming, nonStreaming);
  }

  @ParameterizedTest
  @MethodSource("getTestWorkbookWriters")
  void testSimpleWritesOfOscars(ExcelWriter writer) {
      val sheetWriter = writer.getRowDataWriter("Oscars");

      sheetWriter.writeRow(Arrays.asList("Name", "Year", "Movie"));
      sheetWriter.writeRow(Arrays.asList("Warner Baxter", 1929, "In Old Arizona"));

      ExcelSheetWriter sw = (ExcelSheetWriter) sheetWriter;
      val sheet = sw.getSheet();
      assertEquals(5, sheet.getLastRowNum() + 1); // number of rows = last row num (zero based) + 1
  }
  ```

> - TODO: To test exceptions

JUnit parameterised tests still feel quite constrained compared to flexible ScalaTest etc. Thus for a big Java project, it might be worth looking at Groovy based [Spock framework](http://spockframework.org/) for testing.


# Hamcrest

## Cookbook

* Matches pattern - <http://hamcrest.org/JavaHamcrest/javadoc/2.0.0.0/org/hamcrest/text/MatchesPattern.html>.

  ```
    assertThat("FooBarBaz", matchesPattern("^Foo"));
  ```


# Logging

## Log4j2

* Follows the LMAX disruptor architecture.&#x20;

## SLF4j


# Google Auto

## Links

* <https://mincong-h.github.io/2018/06/19/auto-value-and-jackson/>

## Code snippets

* Using AutoValue with JSON serde

  ```java
    @AutoValue
    @JsonSerialize(as = Member.class)
    @JsonDeserialize(builder = Member.Builder.class)
    public abstract class Member {

            @JsonProperty("id")
            public abstract Integer memberId();

            @JsonProperty("bidder_id")
            public abstract Integer bidderId();

            @JsonProperty("active")
            public abstract Boolean active();

            @AutoValue.Builder
            @JsonIgnoreProperties(ignoreUnknown = true)
            public static abstract class Builder {

                    @JsonCreator
                    public static Member.Builder builder() {
                            return new AutoValue_Member.Builder();
                    }

                    public abstract Member build();

                    @JsonProperty("id")
                    public abstract Member.Builder memberId(final Integer memberId);

                    @JsonProperty("bidder_id")
                    public abstract Member.Builder bidderId(final Integer bidderId);

                    @JsonProperty("active")
                    public abstract Member.Builder active(final Boolean active);
            }

    }
  ```


# Lombok


# JOOQ

## JOOQ Usage

* `fetchOne` - this is a pretty useful method to get a single result also making sure that there is only one result from the constructed query.
  * Difference between `fetchOne` and `fetchMany` - <https://stackoverflow.com/questions/30307448/jooq-difference-between-fetchany-and-fetchone>
* Ignore duplicates on inserts - <https://www.jooq.org/doc/3.12/manual/sql-building/sql-statements/insert-statement/insert-on-duplicate-key/#N5454E>
* Update on duplicates - <https://www.jooq.org/doc/3.12/manual/sql-building/sql-statements/insert-statement/insert-on-duplicate-key/>


# duct-tape

Provides,

* [Circuit breakers](http://rnorth.viewdocs.io/duct-tape/circuitbreaker/)
* [Retry functions](http://rnorth.viewdocs.io/duct-tape/retry/)
* [Timeout functions](http://rnorth.viewdocs.io/duct-tape/timeout/)
* [Rate limiters](http://rnorth.viewdocs.io/duct-tape/ratelimiter/)


# args4j

## Usage examples

* Required single argument,

  ```java
  @Option(name="-name",usage="Sets a name")
  public String name;
  ```
* Comma seperated arguments,

  ```java
  @Option(name = "--files", required = true, handler = CSVStringOptionHandler.class)
  private List<String> files;
  ```
* Boolean or flag arguments,

  ```java
  @Option(name = "--dryrun", handler = ExplicitBooleanOptionHandler.class)
  private boolean dryRun;
  ```


# Netty

## Articles on Netty

* [Introduction to Netty](https://www.baeldung.com/netty)
* [The structure of Netty](http://edmundkirwan.com/general/netty.html)


# Scala

Scala is a general purpose multi-paradigmn programming language.

## Language topics

* [Specialization](/programming-languages/scala/specialization)

## Future directions

* [Dotty](/programming-languages/scala/dotty) - next generation compiler for /Scala 3/

## Perforamance

* [Benchmarking Scala](/programming-languages/scala/benchmarking)

## Libraries

* [Scala libraries](/programming-languages/scala/libraries)


# Dotty

[Dotty](https://dotty.epfl.ch/) is the next generation compiler for Scala. Some of the exciting up coming features are,

* [Union types](http://dotty.epfl.ch/docs/reference/new-types/union-types.html)
* [Extension methods](https://dotty.epfl.ch/docs/reference/contextual/extension-methods.html)


# Specialization

* <http://aleksandar-prokopec.com/2013/11/03/specialization-quirks.html>
* <https://scalac.io/specialized-generics-object-instantiation/>


# Benchmarking Scala

## ScalaMeter

ScalaMeter library can be used to benchmark Scala code.


# Scala libraries

* [ZIO](/programming-languages/scala/libraries/zio)


# ZIO

## Tutorials

* [Beautiful, Simple, Testable Functional Effects for Scala – John A De Goes](http://degoes.net/articles/zio-environment)
* [Exploring Tagless Final pattern for extensive and readable Scala code](https://scalac.io/tagless-final-pattern-for-scala-code/)


# Haskell


# Haskell tools

* [Stack](/programming-languages/haskell/tools/stack)


# Haskell tools

Commercial Haskell stack tool.


# Lisp


# Lisp books

* [On Lisp](https://www.goodreads.com/book/show/41803.On_Lisp)


# Rust

## Topics

* [Asynchronous Programming](/programming-languages/rust/async)

## Tips

* Formatting on save in Vim - set, `let g:rustfmt_autosave = 1` in `vimrc` after

  installing [rust.vim](https://github.com/rust-lang/rust.vim) plugin.

## Performance

* This is a really nice post by Bryan Cantrill -&#x20;

  [The Observation Deck » The relative performance of C and Rust](http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performance-of-c-and-rust/).

## Papers

* [Papers Rust is borrows heavily from](https://doc.rust-lang.org/1.2.0/book/academic-research.html)

## Live Coders

* [Jon Gjengset](https://www.youtube.com/channel/UC_iD0xppBwwsrM9DegC5cQQ)
* [Yoshua Wuyts](https://www.youtube.com/user/yoshomg)


# Rust Async

## [Tokio](https://docs.rs/tokio)

## [async-std](https://docs.rs/async-std)

## [Bastion](https://docs.rs/bastion)


# C++


# C++ libraries

## Immutable data structures

* [Immer is a library of persistent and immutable data structures written in C++](https://github.com/arximboldi/immer)


# Boost

## Use cases

* [Flyweight pattern](https://theboostcpplibraries.com/boost.flyweight)


# Poco

## Use cases

* [WebSockets](https://pocoproject.org/docs/Poco.Net.WebSocket.html)


# Abseil

## Use cases

* [Swiss table](https://abseil.io/blog/20180927-swisstables) - one of the fastest hashmap implementations out there for C++. Rust's [hashbrown](https://github.com/rust-lang/hashbrown) is a port of this technique to Rust, which is faster than the hashmap in Rust's standard library.


# facebook folly

* TODO: what are the use cases folly is good for?


# Intell TBB

[Intel TBB](https://software.intel.com/en-us/tbb) is a widely used C++ library for shared memory [parallel programming](/programming/parallelism) and hetrogenous computing.


# C++ tools


# Valgrind

Valgrind is super useful for debugging native programs. Valgrind can be used to uncover memory leaks, concurrency issues and a lot more.

## How valgrind works

* [The design and implementation of Valgrind](https://courses.cs.washington.edu/courses/cse326/05wi/valgrind-doc/mc_techdocs.html)

## Usage

* Checking for memory leaks of a program (`hello`),

  ```bash
  valgrind --leak-check=full ./hello
  ```

  If you see a message like, *All heap blocks were freed -- no leaks are possible*, then your program is probably leak free!


# CMake


# Bazel


# C++ books

* [The C++ Programming Language by Bjarne Stroustrup](https://www.goodreads.com/book/show/112251.The_C_Programming_Language)


# C

## Books

* [C Books](/programming-languages/c/books)

## Compilers

* [gcc](https://gcc.gnu.org/)
* [clang](https://clang.llvm.org/)
* [Compcert C Compiler](http://compcert.inria.fr/compcert-C.html) - CompCert C is a compiler intended to be used is the compilation of life-critical and mission-critical software written in C and meeting high levels of assurance.


# C libraries


# C books

* [The Definitive C Book Guide and List - Stack Overflow](https://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list)


# Python

## Flavours

* [Cython](/programming-languages/python/cython)

## Libraries and Tools

* [Python libraries](/programming-languages/python/libraries)
  * [requests](/programming-languages/python/libraries/requests)
* [Python tools](/programming-languages/python/tools)
  * [Pipenv](/programming-languages/python/tools/pipenv)
  * [mypy](/programming-languages/python/tools/mypy)
* [Testing](/programming-languages/python/testing)

## Misc

* [Python Cookbook](/programming-languages/python/cookbook)
* [Python performance](/programming-languages/python/performance)


# Testing

## Unit testing

* Python project structure for tests - [Typical Directory structure for python tests](https://gist.github.com/tasdikrahman/2bdb3fb31136a3768fac).
* Reference - [unittest — Unit testing framework — Python](https://docs.python.org/3/library/unittest.html)


# Cython

* Jupyter Cython -

  <https://ipython-books.github.io/55-accelerating-python-code-with-cython/>


# Python performance

* [Loop optimisation](https://www.python.org/doc/essays/list2str/)
* Avoid manual looping - use generators or list comprehensions and high level functions like map where possible.
* Generators are lazy and if it fits the use case generally prefer them over list comprehensions. This choice might depend on Python version as well.
* Use [Cython](/programming-languages/python/cython)


# Python libraries

* [requests](/programming-languages/python/libraries/requests)
* [boto3](/programming-languages/python/libraries/boto3)


# requests

* [https://2.python-requests.org/en/master/user/advanced/#session-objects](https://github.com/dewaka/wiki/tree/93bcb0effef27e2f2c3db903011d209a4f957d81/programming-languages/python/libraries/Session%20objects/README.md) - Creating a session allows setting common headers, such as Authorization headers, for a set of requests,

  ```python
  s = requests.Session()
  s.headers.update({'Authorization': 'auth_data'})
  s.get(...) # Will contain Authorization details provided earlier
  ```


# httpx

* Discussion on hackernews - [Httpx: A next-generation HTTP client for Python](https://news.ycombinator.com/item?id=22000507)
* What are the benefits of `httpx` comared to `requests`?
  * Type annotationsa
  * Async support


# boto3

* Filtering AMIs based on tags,

  ```python
  ec2 = boto3.resource('ec2', region_name='us-east-1')
  filters = [{'Name': 'tag:Service', 'Values': ['your-tag']}]
  my_images = ec2.images.filter(Filters=filters)
  ```


# Python tools

* [pyenv](/programming-languages/python/tools/pyenv)
* [Pipenv](/programming-languages/python/tools/pipenv)
* [mypy](/programming-languages/python/tools/mypy)


# pyenv

## Create an pyenv virtualenv

```
pyenv virtualenv 3.7.4 iam-cleaner
```

## List virtualenv

```
pyenv virtualenvs
```

## Activate new environment

```
pyenv activate iam-cleaner
```

## Removing/Uninstalling virtual environment

```
pyenv uninstall iam-cleaner
```


# Pipenv

* Installing packages based on from `requirements.txt`

  ```bash
  pipenv install -r requirements.txt
  ```


# mypy

* <http://mypy-lang.org/>


# Python Cookbook

* Unescape Python URL - <https://stackoverflow.com/questions/8136788/decode-escaped-characters-in-url>

  ```python
  # Python 2
  urllib.unquote(url)

  # Python 3
  urllib.parse.unquote(url)
  ```




---

[Next Page](/llms-full.txt/1)

