text:
# Course Info

Deep learning is a powerful and relatively-new branch of machine learning. In recent years it has been successfully applied to some of the most challenging problems in the broad field of AI, such as recognizing objects in an image, converting speech to text or playing games. In many such tasks, the state of the art performance today is attained by deep-learning algorithms, in some cases surpassing human-level performance.

This course will focus on the theory and algorithms behind deep learning, as well as on hardware and software interfaces that allow efficient training of deep learning algorithms. It will provide both the necessary theoretical background and the hands-on experience required to be an effective deep learning practitioner, or to start on the path towards deep learning research.

## Learning Outcomes

At the end of the course, the student will:

1. Understand the key notions of deep learning, such as learning regimes, model types, optimization and training methodologies.
2. Be able to apply deep learning algorithms to real-world data and problems.
3. Know how to effectively use python and deep-learning frameworks to implement models and algorithms from the recent literature.
4. Know how to leverage GPUs and write custom computational kernels to accelerate both training and inference.
5. Perform a small research project using the studied notions and techniques.

Evaluation: 40% Homework assignments, 60% final project.

Language: The course will be taught in English.

Credits: 3.0.

### Prerequisites

• A good background of linear algebra, probability and calculus. See the supplemental material page if you need a refresher on one of these.
• Programming competency. The course will be very hands-on; much programming will be required. We will use Python exclusively, so it’s recommended to have experience with it.
• An introductory course about machine learning and/or signal/image processing.

### Collaboration Policy and Honor Code

By enrolling in this course, you agree that you will strictly follow our collaboration policy as specified below. Any violation of this policy will result in an immediate failure in the course, and treatment by the Technion regulations committee.

1. Submission of assignments is in singles or pairs. You are free to form study groups and discuss homeworks with other students. However, you must implement all required code independently of other groups (only with your submission partner).
2. Submitted work must only be your own. You must do your own thinking, coding, debugging and write all answers yourself. We will run automatic plagiarism-detection software on your submissions to enforce this policy.
3. You may not use any solutions from previous semesters’ homeworks.
4. You may not share your solutions with other students.
5. You may not upload your homework solutions to any public website, such as github. Private repos are OK, but they must remain so even after course completion. As an exception, for the course final project only, you may use a public github repo.

Lecturer

Lecturer

Lecturer

TA

Homework Checker

Homework Checker

## Literature

The course does not follow any specific book. For your own reference, the following material may be useful.

• ### Deep Learning

Ian Goodfellow, Yoshua Bengio, Aaron Courville

MIT Press, 2016

• ### Deep Learning with PyTorch

Vishnu Subramanian

Packt, 2018

## Detailed Syllabus

Due to the COVID-19 pandemic, this semester the course will be given using a remote-learning approach.

We provide lecture videos, notes, and slides to facilitate self-learning of the core topics. The tutorials are based on detailed and self-contained Jupyter notebooks, which guide you through a full implementation of one or more models and techniques for solving a specific task. They are meant to teach you the technical aspects of implementing deep learning systems. The course also includes hands-on homework assignments where you will implement working real-world models and run them on GPUs in the course servers. Finally, you will be required to perform a small research project instead of a final exam.

Students are expected to watch and read course material, available from the course Lectures and Tutorials pages. Viewing and/or reading the lecture and tutorial material is mandatory and crucial for success in the homework and project.

# Date Lecture materials Tutorial materials Homework
1 19/03/2020 Lecture 1: Course Introduction (Zoom, video lecture) Tutorial 1: Python, numpy, env setup (Zoom, jupyter notebook)
2 26/03/2020 Lecture 2: Supervised learning (motivation and main lecture videos) Tutorial 2: Supervised learning, PyTorch basics I (video and notebook) HW1
3 02/04/2020 Lecture 3: Neural networks and CNNs (video) Tutorial 3: MLP, PyTorch basics II (video and notebook)
4 09/04/2020 NO CLASS
5 16/04/2020 NO CLASS   HW2
6 23/04/2020 Lecture 4: Training (motivation and main lecture videos) Tutorial 4: CNNs, ResNets (video and notebook)
7 Monday
27/04/2020
8 07/05/2020 Lecture 5: Sequence models (part 1 and 2 videos) Tutorial 5: Sequence modeling, RNNs, TCNs (video and notebook) HW3
9 14/05/2020 NO CLASS
10 21/05/2020 Lecture 5: Attention and Transformers (slides) Tutorial 7: Attention (video and notebook)
24/05/2020
12 04/06/2020 Lecture 7: Deep Reinforcement learning (video) Tutorial 8: Deep reinforcement learning (video and notebook) HW4
13 11/06/2020 Lecture 11: Non-euclidean domains (video) Tutorial 9: Geometric deep learning (video and notebook)
14 18/06/2020 Lecture 8: Intro to parallel architectures (video) Tutorial 10: CUDA
15 25/06/2020 Assorted theoretical topics

format: plain


text:
# Drawing stacking of layers or plates

I would like to get the following image.

Is it possible to draw using tikz or pstricks in latex? Please note the text labelling as well.

I got a link in a similar spirit, but could not utilize it to get what I exactly want. :(

Any help?

\documentclass[tikz, border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}

\begin{scope}[shift={(-2,0,0)}]
\draw[->] (0,0,0)--(1,0,0) node[right]{$x$};
\draw[->] (0,0,0)--(0,1,0) node[above]{$z$};
\draw[->] (0,0,0)--(0,0,1) node[below left]{$y$};
\end{scope}
\foreach \i in {1,...,5}{
\draw[fill=yellow!80!black] (0,\i,0) -- (4,\i,0)--(4,\i,2)--(0,\i,2)--cycle;
\node[right] at (4,\i,0) {$Z_\i$};
}
\end{tikzpicture}
\end{document}

Update:

\documentclass[tikz, border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=2]

\begin{scope}[shift={(-2,0,0)}]
\draw[->] (0,0,0)--(1,0,0) node[right]{$x$};
\draw[->] (0,0,0)--(0,1,0) node[above]{$z$};
\draw[->] (0,0,0)--(0,0,1) node[below left]{$y$};
\end{scope}
\foreach \i in {1,...,5}{
\draw[fill=yellow!80!black] (0,\i,0) -- (4,\i,0)--(4,\i,2)--(0,\i,2)--cycle;
\node[right] at (4,\i,0) {$Z_\i$};
}
\draw[<->] (0,3,2) -- (0,4,2) node[midway,left]{$d$};
\end{tikzpicture}
\end{document}

• thanks a lot. What if I want to draw a double-headed arrow between the plates marked by Z_3 and Z_4 and write d beside it to denote the distance between two plates? Also how can I increase the size of the whole image in my tex? – hbaromega May 1 '15 at 10:38
• @hbaromega I've updated the answer. I don't want to be rude, but this kind of question denotes too little effort from you. If you try to understand the code I gave you, reading some of first tutorials in pgfmanual or diving a little bit through TeX.SX, you won't have to ask such simple things. – Ignasi May 1 '15 at 13:00


text:
I normally don’t write about videogames, but I thought it would be fun to take some time to write about the armor and resistance system in Diablo III, as well as to throw some math at it to see how best to improve one’s character.

In Diablo III, the key to surviving Inferno is getting appropriate gear. However, aside from the obvious improvements of increasing the stats on an item, it can be difficult to intuitively judge the tradeoffs between dissimilar stats. Is it worth it to give up 40 vitality points in order to gain 20 points of resistance to all? How about trading 100 points of strength for 100 points of intelligence? In trying to answer these questions, we will temporarily ignore the question of damage, because, if you can’t survive an attack from an Inferno-level elite, unless you do over a million DPS, you won’t have a chance to kill it anyway. There are two basic concepts to understanding survivability when absorbing damage (we will ignore dodge because it further complicates things): damage reduction and effective hit points, which are really two ways of looking at the same stats.

## Damage Reduction

The combat system is pretty straightforward: when a monster attacks, a random number is generated between its min and max attack values, that number is reduced by armor, resistance, and extra modifiers, and then the resulting value is subtracted from your health. The consensus (which can be experimentally verified) is that the resistance and armor reductions can be found with the following formulas:

$r_{resist}=\frac{R_{all}}{5m+R_{all}}$, $r_{armor}=\frac{A}{50m+A}$

Where $R$ represents resistance total, $A$ represents armor total, $m$ represents the monster level (60 for all of inferno, as far as I can tell), and $r$ is the reduction, which is expressed on the UI as a percentage. Therefore $1-r$ is used to calculate how much damage is done by an attack. The two resistances multiply, so the total damage done by a single attack is given as $(1-r_{resist})(1-r_{armor})$ multiplied by the initial attack damage. Note that if you find a shrine of protection or use a skill such as the wizard’s blur ability, it is counted in a third category that we will ignore from here out. This category is multiplied in exactly the same way, so total damage becomes $(1-r_{resist})(1-r_{armor})(1-r_{other})$ in that case.

The reduction is the remainder after the damage amount is subtracted from the total damage. If we normalize by the monster’s damage, we find that the damage reduction for any attack becomes:

$DR=1-(1-r_{resist})(1-r_{armor})$

To increase one’s survivability, it is necessary to increase the value of damage reduction, but because stats are limited on items, there is always a tradeoff. Because there is a direct, unchanging relationship between strength an armor (1 strength adds 1 armor) and between intelligence and resistance to all (10 intelligence adds 1 to all resistance), we will first look at the tradeoff between armor and resistance alone. A quick look at the two equations tells us that if we multiply $r_{resist}$ by 10/10, we will get the same expression that is used to find the reduction by armor, which suggests that 1 resistance to all is equal to 10 armor because they increase their respective reductions at the same rate. This is only accurate in certain cases, because the total damage reduction depends on the product of all resistance and armor, rather than a linear combination of the two.

Instead, it is much more useful to examine the partial derivatives of damage reduction with respect to all resistance and armor, respectively :

$\frac{\partial {DR}}{\partial A}=(1-r_{resist})(\frac{\partial }{\partial A}\frac{A}{50m+A})$

$=(1-r_{resist})(\frac{1}{50m+A}-\frac{A}{(50m+A)^2})=(1-r_{resist})(\frac{50m}{(50m+A)^2})$

The partial derivative of damage reduction due to all resistance can be found analogously to be:

$\frac{\partial {DR}}{\partial R_{all}}=(1-r_{armor})(\frac{5m}{(5m+R_{all})^2})$

The relationship between all resistance and armor is, therefore, dependent on what the two values are, and we can see that increasing the smaller value will have a larger impact on total damage reduction than further increasing the larger value will, which means that 1 all resistance is not always worth the same as 10 armor, when it comes to changing damage reduction—sometimes all resistance is more valuable, and sometimes less, with the 1:10 ratio being equal when $r_{resist}$ and $r_{armor}$ are equal. This is kind of hard to visualize, so it’s much more useful to simply create a contour plot of damage reduction as a function of both armor and all resistance, which serves as a guide for the relationship between the two stats.

Moving to a darker red area represents an increase in total damage reduction, and so we see that along the diagonal, both contribute equally, but when one variable is significantly larger than the other, further increases are not as effective as bumping the lower stat would be.

## Effective HP

With a good understanding of how damage resistance is calculated, it is time to extend the concept to allow us to include other tradeoffs when determining which gear to use. The next component of survivability is how many hit points your character has. However, all characters with 30,000 HP are not created equal—the character with better damage reduction will do better in combat, so our goal is to quantify the relationship between hit points and damage reduction.

In order to compare characters with different resistances and HP, it is necessary to eliminate the armor and resistance entirely and focus on only a single point of comparison that summarizes the effects of all of the attributes, which is known as ‘Effective HP.’ If a character with 90% damage reduction is hit and suffers 10,000 HP worth of damage, by inverting the equation we can find that the attack must have done 100,000 HP of damage originally, and so, an equivalent character with zero armor and zero resist would have an effective 100k HP for each 10k HP that our character has. The direct formula for effective HP from actual HP and damage reduction is:

$HP_e=\frac{HP}{1-DR}$

At this point, more derivatives could be calculated to find the effects of changing vitality, armor, or resistance on effective HP, but it is much simpler to create a spreadsheet that computes the effective HP for a given triple of vitality (plus your character’s base hit points, which is not zero), armor, and all resistance, and then using that to compare different gear setups. Intuitively, more effective HP is better, as it means you will survive longer against elites and champions, regardless of whether your actual HP increased or decreased. The same is true for your damage reduction; your effective HP can increase despite damage reduction decreasing, if your base HP is sufficiently increased at the same time. It is also worth noting that all HP regeneration becomes more effective as damage reduction goes up—the effective HP regeneration can be calculated in exactly the same way as effective HP is calculated.

Hopefully it is clear that selecting Diablo III gear is a constrained optimization problem. Maybe one day I’ll take a stab at writing a program to optimize stats or provide some kind of discussion on the actual tradeoffs between DPS and HP as they relate to killing monsters, but that sounds like a very painful exercise when approximate solutions can be found just by thinking +effective HP and +damage are good.


text:
dimanche 25 novembre 2018

Next journal clubs in 2018

The next journal clubs before the end of the year are:
• on Friday, Nov 16th, Kenta Suzuki will present  A semiclassical ramp in SYK and in gravity'' by Phil Saad, Stephen H. Shenker and Douglas Stanford arXiv: 1806.06840
•  on Tuesday, Nov 6th, Severin Lüst will present the paper "Towards a proof of the Weak Gravity Conjecture" by Alfredo Urbano, arXiv: 1810.05621
• on Friday, Oct 19th, Fidel Schaposnik will present  "Eternal traversable wormhole'' by Juan Maldacena and Xiao-Liang Qi arXiv: 1804.00491

lundi 17 septembre 2018

New time for the journal club!

In order to better organise our Fridays, the journal club has been moved to Friday afternoons at 2:15 p.m. The location will be Salle de Conférence Louis Michel (Bât.6 CPHT), unless specified otherwise. Coffee will be served in the CPhT coffee area at 2 p.m.

The next journal club will be given on Friday, Sept. 21st by Emilio Trevisani on Light-ray operators in conformal field theory''

mardi 28 août 2018

The journal club comes back!

Dear all, this academic year's journal club will kick off on September 7th, as follows

Other papers that are up for discussion are:

You are welcome to propose other papers by clicking the comments button below. Also, since the ideal is to have a discussion about these papers,  it would be great if as many people as possible read the papers ahead of time.

Here is some practical information for this year's newcomers

where : CPHT, Ecole Polytechnique, Salle de Conférence Jean Lascoux (Aile0)

when:   every other Friday at 10:15 a.m., starting Oct. 13th

topics:  recent papers on the quantum structure of black holes, bulk effective field theory, bulk reconstruction (via bootstrap/entanglement), SYK, asymptotic symmetries (BMS)

how it works: one person prepares a presentation, and everyone else reads the paper and prepares for a discussion. Papers can either be chosen from the suggested readings on this website, or the speaker can suggest a paper to read, which should fit with the general topic of the journal club.

practical:
•  directions to the CPHT can be found at https://www.cpht.polytechnique.fr/?q=fr/node/4
•  we are planning to provide free coffee and croissants at the start of the journal club
•  internet is provided via eduroam
•  after the journal club, we can all have lunch at the canteen of the Ecole Polytechnique. The seminar room will be reserved all day for those people who want to spend the rest of the afternoon at the CPHT.

jeudi 1 mars 2018

Journal club suspended until September

Due to extensive travel of the two organisers, the Journal club will be suspended until September 2018.

For those interested in discussing recent papers, there will be instead an "arXiv" meeting at Saclay, every Monday at 14:30

You are always welcome to propose papers to discuss next (academic) year, by clicking the "comments" button below.

We would like to warmly thank all who attended for their participation, and look forward for more exciting discussions next year!

vendredi 22 décembre 2017

First four journal clubs 2018

The first four journal clubs of 2018 will take place on:
• Friday, Jan 12th, presented by Giuseppe Policastro on: "Non-local Geometry inside Lifshitz Horizon" by Qi Hu, Sung-Sik Lee, https://arxiv.org/abs/1703.07522
• Thursday, Jan 18th, presented by Stefanos Katmadas on asymptotic symmetries and soft theorems  https://arxiv.org/abs/1703.05448
• Friday, Feb 9th, presented by Andrea Puhm on "Conformal Basis, Optical Theorem, and the Bulk Point Singularity" by Ho Tat Lam, Shu-Heng Shao https://arxiv.org/abs/1711.06138 . Useful reading includes the
• Friday, Feb 23rd , presented by Emilian Dudas on :"Proof of the Weak Gravity Conjecture from Black Hole Entropy" by Clifford Cheung, Junyu Liu and Grant Remmen with a review of the Weak Gravity Conjecture based on the original work https://arxiv.org/abs/hep-th/0601001

mercredi 29 novembre 2017

Next two journal clubs before Christmas

The next two journal clubs will take place on:

mardi 10 octobre 2017

First four journal clubs

The first four journal clubs will take place on:
• Thursday, Oct 12th (note unusual day!), presented by Monica Guica on: S. Giombi and E. Perlmutter, Double-Trace Flows and the Swampland,''  https://arxiv.org/abs/1709.09159
• Friday, Oct 27th, presented by Adam Bzowski on:   S. Dubovsky, V. Gorbenko and M. Mirbabayi, Asymptotic Fragility, Near AdS_2 Holography and T\bar{T},'' https://arxiv.org/abs/1706.06604
•  Friday, Nov 17th, presented by Miguel Paulos on: N. Anand, H. Chen, A. L. Fitzpatrick, J. Kaplan and D. Li, An Exact Operator That Knows Its Place,'' https://arxiv.org/abs/1708.04246
• Friday, Nov 24th, presented by Brando Bellazzini on: Beyond amplitudes' positivity and the space of consistent EFTs'', based on: Softness and Amplitudes' Positivity for Spinning Particles'' https://arxiv.org/abs/1605.06111 and Beyond Amplitudes' Positivity and the Fate of Massive Gravity''
Note this is going to be a discussion, so ideally you should read the paper ahead of time!


text:
Error! submit again

# Machine Learning on Git: introducing Hercules v4

This post follows up the first one from January 2017. Please read it if you wonder why Hercules was named Hercules, what is a line burndown plot and how everything started. In short: Hercules is an open source Go command line application and a framework to mine and analyze Git repositories. It is based on go-git, the implementation of Git client and server in pure Go. Hercules outputs it’s results in YAML and protobuf formats which can be further visualized or aggregated by custom user scripts or applications. The standard distribution includes the labours.py Python script which plots cool pics. See also: code-maat and git-of-theseus.

# v4 features

The main features of the recent release:

1. Hercules is now aware of forks and merges and thus visits all the commits in the history, not just the main linear sequence as before.
2. External plugins.
3. Merging results from multiple repositories together.
4. More “batteries” included: ownership, files, people, structure embeddings, comment sentiment.

### Forks and merges

The new version is able to process the full history of revisions, while the previous versions ignored everything but git log --first-parent. And since an image is worth a thousand words:

This feature yields an improvement of the analysis accuracy. However, nothing is free, unfortunately: processing all the commits can considerably slow down the analysis. github.com/git/git repository used to be analyzed in less than 4 minutes - now it is 2 hours 45 minutes. Of course, git/git is clearly an outlier since it uses branching a lot, yet still it can be reasonable to follow the old behavior sometimes. Therefore hercules --first-parent flag exists.

Here is the before/after animation of git/git’s burndown:

### Plugins

A Go plugin is a separate binary file - a shared library - which allows to extend the functions of the main program. Hercules plugins specifically allow to plug a custom analysis without having to rebuild hercules. Go plugins are supported only on Linux and macOS. This is how to load and run a plugin:

hercules --plugin /path/to/plugin.so --whatever-analysis-it-defines https://github.com/git/git > result.yml

--plugin can be written several times. Plugins are loaded before generating the help message, so it is possible to inspect a plugin:

hercules --plugin /path/to/plugin.so --help

There is a sample plugin to collect the code churn statistics in contrib/_plugin_example. If you want to build and run that plugin, execute on Linux:

cd contrib/_plugin_example
make
hercules --plugin churn_analysis.so --churn https://github.com/your/project > churn.yml

It is also possible to generate the skeleton code of a new plugin:

hercules generate-plugin -n TestAnalysis -o test_analysis

That command writes 4 files: Makefile, test_analysis.go, test_analysis.pb.go, test_analysis.proto. The last two are related to the optimized binary result serialization using Protocol Buffers.

### Merging results

This feature is useful for those who want to join the analyses of several Git repositories together. It works only with the binary result format (Protocol Buffers).

hercules combine one.pb two.pb three.pb > joined.pb

### Batteries

Hercules provides a nice and compact Go framework to analyze single Git repositories. Besides, it ships several ready to run built-in analyses. Line burndown is one example; descriptions of the others follow.

#### Code ownership

Code ownership plots how many lines are last edited by each developer through time. How to reproduce the image:

hercules --burndown --burndown-people --pb https://github.com/tensorflow/tensorflow | tee tensorflow.pb | labours.py -m ownership

The overall lines count in Tensorflow is around 3 million as can be plotted with --project. It can be seen that roughly ⅓ of the Tensorflow codebase belongs to the Gardener bot. That’s because much of the real development does not happen on GitHub but rather internally at Google and the cumulative merges are performed from time to time. It can also be seen that all the top 20 contributors are from Google.

#### Developers interaction

This analysis shows what are the proportions of lines added by a developer (rows) and overwritten by other developers (columns). E.g. the image above shows that the Gardener bot overwrote nearly everybody. It also shows that François Chollet worked on the same code as Yifei Feng and Hanna Revinskaya. How to reproduce the image:

hercules --burndown --burndown-people --pb https://github.com/tensorflow/tensorflow | tee tensorflow.pb | labours.py -m churn_matrix

#### Files, developers, functions and classes in 3D

If you haven’t read Your Code as a Crime Scene by Adam Tornhill, stop reading this post, allocate a few hours and look it through - the book is awesome. One of the ideas from the book is to investigate which files are coupled - often appear together. The corresponding analysis in Hercules goes a bit further and puts all the files into the 3D space with the property that the distance between coupled files is small.

Reproduce:

hercules --couples --pb https://github.com/tensorflow/tensorflow | labours.py -m couples -o tensorflow

We can repeat the same trick with the developers: they are couples if they commit to the same files. Interactive example on Tensorflow developers.

Finally, the trick works once again with structural units in the source code. We parse each file with Babelfish and extract anything we wish: functions, classes, etc. Then we apply the same coupling analysis to them: we know which are changed in each commit.

By default, the functions are extracted.

hercules --shotness --pb https://github.com/tensorflow/tensorflow | labours.py -m shotness -o tensorflow

#### Comment sentiment

This is a proof-of-concept for running a Tensorflow model over the source code. We take BiDiSentiment and apply it to comments. That model is general-purpose and the result is often weird, but it works. We wrote about it in the other blog post.

Your binary must be compiled with Tensorflow support (the released one is not).

hercules --sentiment --pb https://github.com/tensorflow/tensorflow | labours.py -m sentiment

# v4 architecture

Hercules is built on top of the concept of a Pipeline, a Directed Acyclic Graph (DAG) of PipelineItems. Each pipeline item has a name and specifies its dependencies and what it provides in return. For example, a RenameAnalysis item detects the renamed and slightly changed files between two commits. It consumes the list of changes and the list of corresponding blobs. It calculates a better list of changes with some of the “delete + create” pairs replaced with single “edit under new name” elements. Yep, Git packfiles do not store this kind of information (intentionally) and git detects renames using heuristics every time you execute it.

Each item on a pipeline transforms the result of its dependencies to generate its own result, as RenameAnalysis mentioned above. Hercules understands these dependencies and automatically sets up the corresponding computation graph. Here is an example of the built pipeline to calculate the burndown chart:

Once the pipeline is built, each item changes its state in certain ways - like a finite automata. Here is a complete example of the “leaf” item which does not provide any intermediate results but rather a final result:

Each item is configured - its parameters are adjusted as needed. Returning to RenameAnalysis, we can set the file similarity threshold from 0 to 100 which influences the aggressiveness of the matching algorithm. Then each item is initialized. At this stage it validates the configured parameters and resets the internal state structures. The next stage is the main one: consuming commits one after another. Git history is usually not linear - instead, it contains forks and merges with numerous branches. Thus items are forked and merged as needed. A “fork” of an item clones it the required number of times, and the states of the clones are combined together during “merges”. The internal state of an item is normally shared and no special arrangements are performed during forks and merges, but sometimes there appear serious problems and nontrivial solutions (see the next section). Some branches are no longer used after merges and the corresponding cloned items are garbage collected.

When the whole history is processed Hercules asks “leaf” pipeline items to generate the result. Those results are serialized and written to the output stream. It is also possible to load several serialized results from disk and combine them together - for example, to obtain the grand view across the company’s repositories.

This versatile architecture allows Hercules to efficiently analyze small and big Git repositories while minimizing the complexity and boilerplate code to add new analysis types.

# v4 challenges

There were three most difficult technical challenges which had to be solved in v3 and v4:

1. Merging results together.
2. Forks and merges behavior of PipelineItems.
3. Determine the order in which to process commits, forks, merges and perform garbage collection on the branches.

The first two were especially hard to solve for the line burndown analysis. Regarding (1), the results can be sampled and band-split with different frequencies, so it was required to resample and interpolate the matrices by day, sum them and then sample and split into bands again. One of the scariest functions Vadim has ever written.. Regarding (2), it was needed to write the code to merge multiple line interval-marked files together and organize the work with a partially shared, partially copied state. Git merge does not necessarily contain two branches: it can be three, four, etc.

We did not come up with a better solution than marking the changed line intervals in files while consuming a merge commit with a special outlier value, then annotate each line of the each merged file, and copy the only real last edit date over those marked as outliers. We avoid conflicting edits by choosing the one with the latest date. We should not compare the files which are not involved in the merge, so we keep track of their hashes, we maintain them. We also had to rewrite the statistics storage logic which used to be too “sequential”. Overall, fulfilling (2) was a technical nightmare.

Surprisingly, however, most of the efforts went to (3). The first problem was related to minimizing the number of forks and merges, in particular removing the no-op fast-forward-like back edges of the DAG.

We topologically sort the nodes of our DAG and traverse it starting from the root. Each time we suspect that an edge can be removed we traverse backwards from the children until we reach the node we have already visited. If that node is the same as the parent then indeed we can remove the edge.

The second problem was that the Git history may have more than one root commit so we need to find the main root and take into account the side effects. Don’t believe me? Here is how gitk was merged inside git/git:

The third problem was related to how Hercules works: it is able to analyze any set of commits, not just the whole master. There is no guarantee that the commits are connected at all, so we have to run the connected components analysis first to throw away everything but the main component (which has the biggest number of nodes).

The fourth problem was to schedule the garbage collection - remove the clones which are no longer needed. We do a DAG traversal and mark the places where branches were last used, then we insert branch disposals after the resulting marks.

It was very helpful to debug with git bisect. Normally people bisect to find regressions; we bisected to find offending commits which broke Hercules.

Hercules can do so many things better! Here is a list of cool features you can work on:

• Counting lines with enry and plot charts by language.
• Applying PageRank to the structural edits and find the most impactful developers (aka Sourcecred).
• Detecting minor, not important commits using machine learning.
• Plotting with Go, not with Python.
• Integration into GitBase as a set of User Defined Functions.
• Improving the look of the generated plots. My colleague Maxim has attempted already.

The most exciting time is still ahead.


text:
# What can we say about $n\times n$ invertible matrices, all elements of which are $+1$, $-1$, or $0$?

Basically, the title says it all, except for why I am asking. I'm studying a paper that I can't do justice to in a few words here. (It is not freely available on the Web, as far as I know, but I can email a transcription to anyone interested. For anyone with access to a library that carries IEEE Transactions on Power Apparatus and Systems, the reference is PAS-87:815-824(1968). This was the last paper the author published before he died in 1968.) Suffice it here to say that the author makes up such square matrices out of two rectangular matrices by pasting them together along their conformable edges. He calls this operation a "direct sum", but this is not like any direct sum I ever saw defined in mathematics. The only place I have ever seen such an operation is in the programming language, APL, where it is called "lamination".

After inverting the square matrix, he splits it up again into rectangular matrices of the same shapes as those he started with... and he gives a geometric interpretaion of all four rectangular matrices in terms of the topology of fiber bundles, which I don't understand. Nevertheless, I find this all very fascinating, especially since he applies it to electrical circuits and electromagnetic theory. I suspect that such matrices may be $3$-matroids, but that is another subject that I don't understand.

So, basically, I am on a fishing mission for whatever clues I can come up with here! Does anyone know of a recognized matrix operation like "lamination"? If so, what is it called and in what sort of applications is it used?

I'd really like to communicate more directly with someone knowledgeable in these areas.

-
It will be very helpful if you mentioned which paper. Some people may be able to access it even though it's not freely available, and other people may go to the library. Yet other people would be able to tell a lot from the name of the paper and from its author. –  Yuval Filmus Sep 2 '11 at 22:01
@Yuval: The title is "Four Abstract Reference Frames of an Electric Network". Through a supporting institution, this link worked for me. –  robjohn Sep 2 '11 at 22:42
Sorry, but I see that someone already found it. –  Koilon Sep 3 '11 at 2:29


text:
# Addition of Integers Exercises – Set 1

Below are exercises on addition of signed numbers. Part I and II are exercises for addition of integers, while part III is an extension to fractions and decimals. Solutions and answers will be can be found here.

Part I

1. -7 + 13

2. (-8) + (-9)

3. 5 + (-18)

4. 34 + (-38)

5. (-34) + 34

6. 0 + (-25)

7. 5 + (18)

8. -14 + (-12)

9. 13 + (-13)

10. 16 + 18

Part II

1. 13 + 12 + (-15)

2. -18 + (-2) + 14

3. 14 + 8 + (-14)

4. 21 + 7 + (-28)

5. -23 + 0 + 14

6. -19 + 22 + (-6)

7. 32 + (-11) + (-27)

8. 12 + (-11) + 10

9. 11 + (-22) + 21 + (-10)

10. 16 + (-16) + 8 + 3

Part III

1. $\frac {1}{2} + (- \frac {3}{2})$

2. $\frac {1}{4} + (- \frac {2}{4})$

3. $\frac {3}{7} + (-\frac {3}{7})$

4. $- \frac {1}{2} + \frac {3}{4}$

5. $-\frac {4}{11} + (-\frac {3}{11})$

6. 0.7 + (-0.3)

7. 4.8 + (-1.2)

8. -3.7 + 2.2

9. 12.6 + (-11.1)

10. 13.75 + (-15.2)

You might also want to practice subtraction of integers.


text:
# Ramp Problem, Friction, Find Theta

1. Sep 16, 2012

### maryhem

Challenging Ramp and Pulley Problem

1. The problem statement, all variables and given/known data

Two blocks of masses 2m and m are connected by a weightless string over a frictionless, massless pulley, as shown in the figure. The coefficient of kinetic friction between the block and the incline is $\mu$. The system is in a uniform gravitational field directed downward of strength $g$. Find the incline angle $\theta$ such that the blocks move at a constant speed. Distinguish between the cases of upward and downward motion. Rationalize your solutions using a simple physical picture.

2. Relevant equations
$$\mathbf{F} = m\mathbf{a}$$
3. The attempt at a solution

So we start by looking at the forces acting on each block. In this case, we will be looking at downward motion. For the $2m$ mass:
$$2mg\sin\theta - \mu mg\cos\theta - T = 0$$
And for the second block:
$$T - mg = 0 \implies T = mg$$
Using the second equation and plugging into the first equation, we find:
$$2\sin\theta - 2\mu\cos\theta = 1$$
I can't figure out how to solve for $\theta$. Wolfram's answer is pretty ugly.

#### Attached Files:

• ###### fuckingProblem.png
File size:
22.5 KB
Views:
80
Last edited: Sep 16, 2012
2. Sep 16, 2012

### Simon Bridge

You need trig identities and a bit of manipulation:

Divide through by $\cos(\theta)$
$1/\cos(\theta)=\sec(\theta)$

Square both sides and expand the RHS
$\sec^2(\theta)=1+\tan^2(\theta)$

Change variables: $x=\tan(\theta)$
Look familiar?

Note - you have misplaced a minus sign in the first equation.
gravity and friction both point in the opposite direction to tension.


text:
## Wednesday, May 12, 2010

### Barefoot running: The transition and Vibram Five Fingers

Economic instinct initially held back my enthusiasm for Vibram Five Finger (VFF) shoes.  At first glance getting less shoe for your money is bizarre.  At next glance it feels like a step backwards - expensive well-cushioned running shoes, the result of countless hours or research and design, should be the pinnacle of human endeavour toward running excellence.  There are so many people running in this world, both amateur and professional, that you just expect the current technology to be supreme.

But there are a few reasons I became convinced that making the transition away from traditional running shoes (and shoes in general) to VFFs or barefoot was not a step backwards, but a simplifying step forwards.

- I generally prefer to be barefoot where possible
- The book Born to Run by Christopher McDougall was very persuasive
- Harvard researchers have been analysing the difference in running techniques between barefoot and shod and now running with shoes just looks wrong
- I saw a guy wearing VFFs at an adventure race (about 4hours running, kayaking and mountain biking) and thought he must have got the wrong information about how much time is spent in the water and worn his scuba shoes.

I also tried running barefoot in the park a few times a week for a month before buying VFFs (the KSO model).  Apart from getting sore calves for a little while, the toe strike technique felt comfortable.  I considered forgoing VFFs and simply running barefoot.  Nowadays it’s either barefoot or VFFs depending on the distance, my mood, or the weather.

Let me share the experience and comment on the bizarre barefoot running culture that is developing.

It has been six months since I have stopped wearing traditional running shoes. I now run about 30kms a week in VFFs or barefoot.  During the first weeks of transitioning to a barefoot running style, runs were about one kilometre.  It takes time to build up strength in you calves and I recommend taking it easy at first.   Now, my longest single run in VFFs is 24kms while completely barefoot its 10kms, and I plan to run a full marathon in June.  I live close to the city centre and run on concrete, bitumen, grass, gravel, and have had no major problems (although small pebbles occasionally get stuck in your bare soles at first).   Two weeks ago I went for a quick run in my old running shoes and realised that I had crossed over to the dark side and couldn’t go back – they felt bulky, heavy, clumsy, and unnatural.

Two important questions remain.  How have the VFFs held up, and at a more social level, why hasn’t anyone thought of this barefoot running idea before?

VFFs are not perfect.  The durability of the soles has impressed me.  There are no pockmarks or signs of wear on the sole after more than 500kms of running.  The soles are even tough enough to allow you to ride a mountain bike with platform or cage pedals.

However, the abrasion-resistant stretch polyamide fabric of the upper part of the shoe, while light, thin and breathable, has not really stood up to its name.  I have stubbed my big toe on the bitumen at night a couple of times, and while the wrapped over sole at the front of the toes protects them, it results in the less durable fabric on top of your toe scraping the ground.  A hole above my big toe nail became large quite quickly and I decided to stitch it up before it spread (see photo above).

Curiously, there has been no toe stubbing since the first month - maybe I watch where I’m going now, or maybe my running style has become more graceful.

The second problem I have is that the internal stitching beside the knuckle of my right big toe (right next to the V in the yellow Vibram label but on the other shoe) is not sitting flat.  All the other seams are unnoticeable, yet the peculiar angle of this one makes it rub.  It is not a problem for short runs or when walking, but runs above 5kms generally need some Micropore tape on the skin to stop a blister developing.  This works a treat and 24kms later they still feel good.

It takes time for your feet to adjust and you may get hotspots from rubbing here and there both in the VFFs or barefoot (I have had blisters under my toes a couple of times) but the skin on your feet toughens up eventually.

In all, VFFs are very good at allowing you to run with a more natural barefoot style without having to condition your feet to the sometimes hot and unyielding urban surfaces (Brisbane roads in summer will destroy bare feet).

If barefoot running is superior to shod running in the latest $200 shoes, why didn’t we collectively realise that this whole industry was taking us for a ride?$200 seems absurd when free is a better alternative (although I appreciate the irony that this post reviews shoes that cost almost that much).

The reason conventional padded running shoes dominated without competition can be explained by theories of path dependence.  Once society has been conditioned to accept a particular behaviour, custom, or object as 'normal' and as the best solution to a problem - we find it very difficult to break from the crowd and question it.

Think about a knife and fork.  These tools solve a problem of getting otherwise very messy foods into our mouths without much waste.  Does anyone ever think about improving the fundamental design of the utensils?  Maybe there is a better way, and maybe that way is to eat with our fingers as some middle eastern cultures might suggest.  Some Chinese might add that chopsticks are superior.  But inherent social conditioning makes thinking outside the square extremely difficult.  It is very difficult to eat with your hands at a restaurant if the norm is to use a knife an fork, even if there is a strong reason for it being the superior technique.

Interestingly, as far as I understand, the idea for a thin-soled separate-toe lightweight shoe did not arise out of a quest for a better running shoe, but was marketed as a shoe for boaties who wanted good grip and feeling of the deck.  It was not until Barefoot Ted found them and used them to give his bare feet a break that running in these odd things was even considered.  Once he became a lead character in McDougall’s book, the running world changed.

But to change the world there must be an underlying theory that demonstrates why a barefoot running style is superior to shod style.  If you use your hands to eat at a restaurant your friends might expect an explanation before they adopt your custom.

McDougall explains that it took some time before researchers who first proposed that long distance running is an evolutionary advantage for hunting to find strong evidence.  Apparently, a few years after first publishing the idea, they received a phone call from a guy who had been living with an African tribe for a few years and said that they regularly used a technique now called persistence hunting, which uses a combination of running and tracking to pursue prey to exhaustion.

Hence the title of McDougall’s book and the strong evidence that our bodies evolved to specialize in barefoot running.

I will leave you with a little anecdote .  I was wearing my VFFs to teach a university class last week and on the footpath a fellow walked up to me and commented on my shoes.  “Nice Vibrams.  You run?” He wears them, except when he’s headed to the chemistry lab where more serious protective footwear is encouraged, loves them, and is happy to chat to anyone else who does.  It appears we have a secret society emerging.  Should we have a secret handshake?


text: 2 added 103 characters in body edited Apr 13 '16 at 6:05 Filek 2,22099 silver badges1313 bronze badges It can be done with proper batteries, but the ones your looking at are for toy cars and planes etc and just don't have the capacity etc that you require. I replaced the lead acid batteries in my lawn mower with used lithium batteries from a Nissan Leaf electric car. I had to disassemble the battery and rebuild it to a 24 volt, 30 Ah battery. It is actually more like a 22.2 volts nominal and 25.2 fully charged, but it works to replace the former 24 volt, 18Ah battery. The lithium battery can supply 120 amps sustained so easily meets your needs. MY motor is 24volt, 1200 watt. So you would just need two of what I built, Which is a 6S1P battery. With that battery you could tow a trailer full of rocks behind your scooter! By the way, the battery cost $150.00 US and weigh 1/3 the old lead acid battery. It can be done with proper batteries, but the ones your looking at are for toy cars and planes etc and just don't have the capacity etc that you require. I replaced the lead acid batteries in my lawn mower with used lithium batteries from a Nissan Leaf electric car. I had to disassemble the battery and rebuild it to a 24 volt, 30 Ah battery. It is actually more like a 22.2 volts nominal and 25.2 fully charged, but it works to replace the former 24 volt, 18Ah battery. The motor is 24volt, 1200 watt. So you would just need two of what I built. With that battery you could tow a trailer full of rocks behind your scooter! By the way, the battery cost$150.00 US and weigh 1/3 the old lead acid battery. It can be done with proper batteries, but the ones your looking at are for toy cars and planes etc and just don't have the capacity etc that you require. I replaced the lead acid batteries in my lawn mower with used lithium batteries from a Nissan Leaf electric car. I had to disassemble the battery and rebuild it to a 24 volt, 30 Ah battery. It is actually more like a 22.2 volts nominal and 25.2 fully charged, but it works to replace the former 24 volt, 18Ah battery. The lithium battery can supply 120 amps sustained so easily meets your needs. MY motor is 24volt, 1200 watt. So you would just need two of what I built, Which is a 6S1P battery. With that battery you could tow a trailer full of rocks behind your scooter! By the way, the battery cost $150.00 US and weigh 1/3 the old lead acid battery. 1 answered Apr 13 '16 at 5:46 Filek 2,22099 silver badges1313 bronze badges It can be done with proper batteries, but the ones your looking at are for toy cars and planes etc and just don't have the capacity etc that you require. I replaced the lead acid batteries in my lawn mower with used lithium batteries from a Nissan Leaf electric car. I had to disassemble the battery and rebuild it to a 24 volt, 30 Ah battery. It is actually more like a 22.2 volts nominal and 25.2 fully charged, but it works to replace the former 24 volt, 18Ah battery. The motor is 24volt, 1200 watt. So you would just need two of what I built. With that battery you could tow a trailer full of rocks behind your scooter! By the way, the battery cost$150.00 US and weigh 1/3 the old lead acid battery.


text:
Unable to Create New User Due to InsufficientPrivilegeException

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

Not able to create new user. The following appears in the stacktrace:

com.atlassian.confluence.core.InsufficientPrivilegeException: User [user.name] does not have the required privileges.

原因

There are 2 known causes for this issue.

CAUSE 1

confluence-users is a default group that every new user created will be added to. Somehow confluence-users does not exist, hence the error is thrown.

This error is misleading, and we are investigating that issue here:  CONF-22778 - Getting issue details... STATUS

CAUSE 2

In case the instance was migrated from Cloud, the default group is not Confluence-users, so even adding the Confluence-users group, the issue might persist.

In this case we must locate the default group in the database and change it to be Confluence-users.

ソリューション

CAUSE 1

Create the confluence-users group manually through the UI (Confluence Admin >> Manage Groups).

CAUSE 2

ALWAYS PERFORM A FULL BACKUP OF THE DATABASE BEFORE MAKING ANY CHANGE TO IT.

1) Identify the current default group of Confluence:

select bandanavalue from bandana where bandanakey='atlassian.confluence.settings';

2) Locate the <defaultUsersGroup> tag and check which is the default group for Confluence.

3) Copy the entire result of the query above and replace the default users group value inside the tag with the "confluence-users" value

4) Run a update query with the entire result from above plus the modified group. (Note that if you do this update incorrectly and remove information from the results, Confluence will crash. Make sure to have a backup of Confluence)

5) Restart Confluence and you should now be able to create new users in the default group "confluence-users"

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する


text:
# On computing $\nabla^2 (1/4 \pi |x|)$ in three dimensions using mollifiers.

I am going through some notes about how to compute that $$\nabla^2 G = \nabla^2 (1/4 \pi |x|) = - \delta(x)$$ in a sense of distributions, where $$x \in \mathbb{R}^3$$. Notes are not expected to be completely rigorous, however, I was not able to figure out all of the details to make the arguments precise.

The approach starts by defining function $$K : \mathbb{R}^3 \to \mathbb{R}$$ such that $$K(x) = G(x) = 1/4\pi|x|$$ for all $$|x| > 1/2$$ in a sense of ordinary functions, and continued smoothly on the rest of $$\mathbb{R}^3$$. I believe the motivation is that the point of singularity of $$G(x)$$ is $$x = 0$$, and so we would like to define a function that is the same outside of the singularity, but is smoothly continued near singularity so we can treat it using usual real analysis theorems.

Question 1: How do I know that such function $$K$$ can be indeed found? Is there a constructive formula for such function? I was thinking about defining $$K(x) = G(x)\Theta(|x|-1/2)$$, where $$\Theta$$ is a step function, and then to take smooth approximations $$\{ f_n \}_{n \in \mathbb{N}}$$ for step function, but I believe for all $$n \in \mathbb{N}$$, I would get that $$K(x) \neq G(x)$$ for $$|x| > 1/2$$.

If such function $$K$$ indeed exists, then as it is a smooth extension, all derivatives exist in a pointwise real analysis sense. Then, for example, one might compute that for all $$|x| > 1/2$$, $$\nabla^2 K (x) = 0$$ pointwise. Also, one might apply divergence theorem to compute the following, where $$B_{1/2}(0)$$ is an open ball of radius $$1/2$$ around $$0 \in \mathbb{R}^3$$.

$$\int_{\mathbb{R}^3} \nabla^2K (x) \mathrm{d}x = \int_{B_{1/2}(0)} \nabla^2K (x) \mathrm{d}x = -1$$

Now, one defines one-parameter family of functions (which will create a mollifiers). For each $$\varepsilon > 0$$, define $$K_{\varepsilon} : \mathbb{R}^3 \to \mathbb{R}$$ as follows.

$$K_{\varepsilon}(x) = \frac{1}{\varepsilon} K\left(\frac{x}{\varepsilon}\right)$$

I think I understand the intuition, as for each $$\varepsilon > 0$$, $$K_{\varepsilon}(x)$$ is again smooth, and this leads to the following scaling on Laplacian, which later can be used to change variables under the integrals.

$$\nabla^2 K_{\varepsilon}(x) = \frac{1}{\varepsilon^3} \nabla^2 K \left( \frac{x}{\varepsilon} \right)$$

Question 2: Notes motivate choice of definition of $$K_{\varepsilon}$$ with the claim that $$K_{\varepsilon} * \phi \to G * \phi$$, as $$\varepsilon \to 0^+$$, where $$*$$ is convolution operator and $$\phi$$ is suitable test function, say, smooth with a compact support. However, I don't understand in what sense is this true, as I thought that the whole point not working with $$G$$ is because it is singular at the origin. For example, naively, I would understand $$G * \phi$$ is the following.

$$(G * \phi)(x) = \int_{\mathbb{R}^3} G(x-y) \phi(y) \mathrm{d}y$$

However, as $$G(x) = 1/4 \pi |x|$$ defined on $$\mathbb{R}^3 - \{0\}$$ is not bounded, I believe (Darboux) integral does not exist. One maybe might define it as follows, but I am not sure if this is the convention here.

$$(G * \phi)(x) = \lim \limits_{\delta \to 0} \int_{\mathbb{R}^3 - B_{\delta}(0)} G(x-y) \phi(y) \mathrm{d}y$$

Question 3: Fixing interpretation of $$G * \phi$$, how to prove it is well defined (as an integral or as a limit)?

Question 4: I tried performing the argument on $$K_{\varepsilon}$$ as the one that is used to show that $$\nabla^2 (K_{\varepsilon} * \phi) \to - \phi(x)$$ as $$\varepsilon \to 0^+$$. However, I do not understand what goes wrong. I provide (intuitive and, I think, wrong) argument below.

$$\lim \limits_{\varepsilon \to 0^+} (K_{\varepsilon} * \phi)(x) = \lim \limits_{\varepsilon \to 0^+} \int \limits_{\mathbb{R}^3} K_{\varepsilon}(x-y)\phi(y)\mathrm{d}y = \lim \limits_{\varepsilon \to 0^+} \int \limits_{\mathbb{R}^3} K_{\varepsilon}(y)\phi(x-y)\mathrm{d}y = \lim \limits_{\varepsilon \to 0^+} \int \limits_{\mathbb{R}^3} \frac{1}{\varepsilon} K\left( \frac{y}{\varepsilon} \right)\phi(x-y)\mathrm{d}y$$ $$= \lim \limits_{\varepsilon \to 0^+} \int \limits_{\mathbb{R}^3} \varepsilon^2 K\left( y \right)\phi(x-\varepsilon y)\mathrm{d}y$$

So, I would think that the following happens.

$$\lim \limits_{\varepsilon \to 0^+} \int \limits_{\mathbb{R}^3} K\left( y \right)\phi(x-\varepsilon y)\mathrm{d}y = \phi(x) \int \limits_{\mathbb{R}^3} K\left( y \right) \mathrm{d}y$$

Here, I think the latter integral does not exist, but I feel that there might a different choice of $$K(x)$$ such that that integral exists (for example, by also taking large $$|x|$$ cutoff). In that case, I feel that this limit would be finite but because of the $$\varepsilon^2$$ factor, $$K_{\varepsilon} * \phi \to 0$$ as $$\varepsilon \to 0^+$$.

I suggest you first take a look at Dirac's $$\delta$$ smooth approximation, (the answer I provide there will be helpful for your Question 4.) We can actually deal with the $$n$$-dimensional case directly, assuming $$n\geq 3$$. Let $$G:\Bbb{R}^n\setminus\{0\}\to\Bbb{R}$$, $$G(x)=\frac{\gamma}{|x|^{n-2}}$$, where $$\gamma$$ is some constant (in fact by choosing $$\gamma:=\frac{1}{(n-2)A_{n-1}}$$, where $$A_{n-1}$$ is the surface area of $$S^{n-1}$$, it will follow that $$\nabla^2G=-\delta$$. In the case $$n=3$$, $$\gamma=\frac{1}{4\pi}$$).

Question 1.

You should take a look at the existence of bump functions. This means we can find a smooth function $$\psi:\Bbb{R}^n\to\Bbb{R}$$, such that $$\psi=1$$ on $$B_{1/4}(0)$$ and $$\psi=0$$ outside say $$B_{1/3}(0)$$. Now, set $$K:= (1-\psi)\cdot G$$; then $$K=0$$ on $$B_{1/4}(0)$$, and outside $$B_{1/3}(0)$$, we have $$K=G$$, and this will be smooth.

I hope you don't mind, but in order to stay consistent with the notation in my linked answer above, let me define with a superscript $$K^{\epsilon}(x):=\frac{1}{\epsilon^{n-2}}K\left(\frac{x}{\epsilon}\right)$$. Then, $$\nabla^2(K^{\epsilon})(x)=\frac{1}{\epsilon^n}(\nabla^2K)\left(\frac{x}{\epsilon}\right)\equiv (\nabla^2K)_{\epsilon}(x)$$, where the subscript $$\epsilon$$ has the same meaning as in the linked answer. Now, for $$|x|\geq 1$$, $$\nabla^2K(x)=\nabla^2G(x)=0$$, while for $$|x|\leq 1$$, $$K$$ is smooth, so $$\nabla^2K$$ is also smooth, and thus $$\nabla^2K$$ is in $$C^{\infty}_c$$ (and thus is Lebesgue integrable), with \begin{align} \int_{\Bbb{R}^n}\nabla^2K(x)\,dx&=\int_{B_1(0)}\nabla^2K(x)\,dx\\ &=\int_{S^{n-1}} \frac{\partial G}{\partial r}\,d\sigma\\ &=\int_{S^{n-1}}(2-n)\gamma\,d\sigma\\ &=-1, \end{align} where we have used the divergence theorem in the middle and that $$K=G$$ in an open neighborhood of $$S^{n-1}$$. The reason I wrote all of this out is because now, following the notation of the linked answer with $$\zeta:=\nabla^2K$$ and $$c=-1$$, we have as $$\epsilon\to 0^+$$, that

\begin{align} (\nabla^2K)_{\epsilon}:=\zeta_{\epsilon}\to c\delta=-\delta, \end{align} where the convergence is in the space of distributions $$\mathcal{D}'(\Bbb{R}^n)$$.

Question 2.

First let me remark (as I've already mentioned in the comments), that yes, although $$G$$ is unbounded near the origin, it is still integrable there, i.e the singularity of $$G$$ is not so bad for integration. To see why, note that \begin{align} \int_{B_1(0)}|G(x)|\,dx&=\int_{0}^1\int_{S^{n-1}}|G(r\xi)|\,r^{n-1}\,d\sigma(\xi)\,dr\\ &=\int_0^1\int_{S^{n-1}}\frac{\gamma}{r^{n-2}}\cdot r^{n-1}\,d\sigma\,dr\\ &=\int_0^1\gamma A_{n-1}r\,dr\\ &<\infty \end{align} Note that the finiteness of this integral is not a surprising thing, because for example in one dimension, $$\int_0^1\frac{dt}{\sqrt{t}}=2$$ is finite even though $$\frac{1}{\sqrt{t}}\to \infty$$ as $$t\to 0^+$$. So, this just goes to show unboundedness alone says nothing about finiteness of integrals.

Because of this, all integrals over $$\Bbb{R}^n$$ involving $$G$$ and a compactly supported function will exist in the proper sense as a Lebesgue integral (near the singularity of $$G$$, it is integrable, and for very large arguments, the compact support of the function makes it zero, so there's no issues at $$\infty$$ nor at the singularity of $$G$$).

Having said this, I can't speak for in what sense they intended the convergence. Though I do not see why convergence of the convolutions would be useful. More useful would be to show that $$K^{\epsilon}\to G$$ in the topology of distributions $$\mathcal{D}'(\Bbb{R}^n)$$. What this means is we have to show for every $$\phi\in\mathcal{D}(\Bbb{R}^n)$$ (i.e smooth compactly supported function) $$\langle K^{\epsilon},\phi\rangle\to\langle G,\phi \rangle$$. This is easily verified: \begin{align} \langle K^{\epsilon},\phi\rangle&:=\int_{\Bbb{R}^n}K^{\epsilon}(x)\,\phi(x)\,dx\\ &=\int_{|x|\leq \epsilon}\frac{1}{\epsilon^{n-2}}K\left(\frac{x}{\epsilon}\right)\phi(x)\,dx+\int_{\epsilon<|x|}\frac{1}{\epsilon^{n-2}}K\left(\frac{x}{\epsilon}\right)\phi(x)\,dx\\ &=\int_{|y|\leq 1}\epsilon^2K(y)\phi(\epsilon y)\,dy +\int_{\epsilon<|x|}\frac{1}{\epsilon^{n-2}}G\left(\frac{x}{\epsilon}\right)\phi(x)\,dx\tag{*}\\ &=\int_{|y|\leq 1}\epsilon^2K(y)\phi(\epsilon y)\,dy +\int_{\epsilon<|x|}G(x)\phi(x)\,dx \end{align} In $$(*)$$, for the first term, we used the change of variables $$x=\epsilon y$$ (note that this makes $$dx=\epsilon^n\,dy$$ which cancels with $$\frac{1}{\epsilon^{n-2}}$$ to give $$\epsilon^2$$), and in the second term, we note that $$\epsilon<|x|$$ means $$1<\frac{|x|}{\epsilon}$$, which means the arugments are large enough for $$K$$ to equal $$G$$. Now, the first integral is bounded by $$\epsilon^2 \|\phi\|_{\infty}\cdot \int_{|y|\leq 1}|K(y)|\,dy$$, which clearly vanishes as $$\epsilon\to 0^+$$. For the second integral, note that $$G\cdot \phi\in L^1(\Bbb{R}^n)$$ (because as I mentioned above, the singularity of $$G$$ is integrable and because $$\phi$$ has compact support). Thus as $$\epsilon\to 0^+$$, the second term becomes $$\int_{\Bbb{R}^n}G(x)\phi(x)\,dx$$. Thus, we have shown \begin{align} \lim_{\epsilon\to 0^+}\langle K^{\epsilon},\phi \rangle&=\langle G,\phi\rangle, \end{align} and since $$\phi$$ was arbitrary, this proves convergence $$K^{\epsilon}\to G$$, as $$\epsilon\to 0^+$$, in the space of distributions $$\mathcal{D}'(\Bbb{R}^n)$$.

Question 3.

I think it is unnecessary to address this question at this point.

Question 4.

Again, it is not clear to me why we're considering the convolution. Here's how I'd finish the argument. We have shown in step 2 that $$K^{\epsilon}\to G$$ in the space of distributions. Thus, any distributional derivative of $$K^{\epsilon}$$ (which is the same as the ordinary derivative) also converges to those of $$G$$. In particular, for the Laplacian. So we have (all derivatives are in distributional sense, and all limits are in the space of distributions $$\mathcal{D}'(\Bbb{R}^n)$$) \begin{align} \nabla^2G&=\lim_{\epsilon\to 0^+}\nabla^2(K^{\epsilon}) =\lim_{\epsilon \to 0^+}(\nabla^2K)_{\epsilon} =-\delta. \end{align} As I just mentioned, the first equality is because $$K^{\epsilon}\to G$$, and the second and third equalities have been explained in step 1.

Alternative Approaches.

There are of course several other approaches to proving this fact. The classical approach is as I mentioned in the comments.

Classic Approach.

Remove a small ball around the origin, integrate by parts and take limits to conclude. I leave it to you to fill in the details of this argument: let $$\phi\in\mathcal{D}(\Bbb{R}^n)$$, and say it has support lying inside a ball of radius $$R>0$$. Then, \begin{align} \langle \nabla^2G, \phi\rangle&:=\langle G,\nabla^2\phi\rangle\tag{since G\in L^1_{loc}(\Bbb{R}^n)}\\ &=\int_{\Bbb{R}^n}G(x) \nabla^2\phi(x)\,dx\\ &=\int_{|x|\leq R}G(x)\nabla^2\phi(x)\,dx\\ &=\lim\limits_{\epsilon\to 0^+}\int_{\epsilon\leq |x|\leq R}G(x)\nabla^2\phi(x)\,dx\tag{DCT}\\ &=\lim_{\epsilon \to 0^+}\left[-\int_{|x|=\epsilon}\phi\frac{\partial G}{\partial r}\,d\sigma+\int_{|x|=\epsilon}G\frac{\partial \phi}{\partial r}\,d\sigma\right]\tag{\ddot{\smile}}\\ &=-\phi(0)+0\\ &=\langle -\delta, \phi\rangle \end{align} Thus, $$\nabla^2G=-\delta$$. In $$(\ddot{\smile})$$ we used Greens identity (really an integration by parts using the divergence theorem), I leave the details to you, and in the next step, I leave it to you to estimate the integrals to see why they converge respectively to $$-\phi(0)$$ and $$0$$ (the second integral is actually $$\mathcal{O}(\epsilon)$$).

Yet another approach is outlined in Folland's Real Analysis book Chapter 9, Exercise 14. The proof of this exercise can be found in his other book Introduction to Partial Differential Equations, page 75, Theorem 2.17. Of course, if you're interested, you should try to follow the problem outline first and attempt it yourself before looking at the proof (btw the above classical approach was left as an exercise in Folland's PDE book).

Edit in response to comment.

So, obviously the second term in the integral for question 2 doesn't converge to $$0$$ (because I've already provided a correct proof that it converges to $$\int G\phi$$). But let us see what would actually happen if we made the substitution: \begin{align} \int_{\epsilon<|x|}\frac{1}{\epsilon^{n-2}}G\left(\frac{x}{\epsilon}\right)\phi(x)\,dx &=\int_{1<|y|}\epsilon^2G(y)\phi(\epsilon y)\,dy \end{align} Note that here, if I made an analogous estimate as for the first integral then \begin{align} \left|\int_{1<|y|}\epsilon^2G(y)\phi(\epsilon y)\,dy\right| \leq \epsilon^2\|\phi\|_{\infty}\int_{1<|y|}|G(y)|\,dy = \infty, \end{align} because the integral is infinity (since $$G$$ doesn't decay rapidly enough... in fact if you change to polar coordinates, you'll see that it is $$\epsilon^2\|\phi\|_{\infty}\int_1^{\infty}\frac{1}{r^{n-2}}\,A_{n-1}r^{n-1}\,dr =\epsilon^2\|\phi\|_{\infty}A_{n-1} \int_1^{\infty}r\,dr=\infty$$). Therefore, we have bounded our original integral by $$\infty$$, which is a completely true, but useless estimate.

So, ok we can't be so crude with our approximation. What else might we try? Well, the integrand is $$\epsilon^2G(y)\phi(\epsilon y)$$. For each $$y\in\Bbb{R}^n$$, this goes to $$0$$ as $$\epsilon\to 0^+$$; i.e the integrand converges to $$0$$ pointwise. Does it then follow that \begin{align} \lim_{\epsilon\to 0^+}\int_{1<|y|}\epsilon^2G(y)\phi(\epsilon y)\,dy=\int_{1<|y|}\lim_{\epsilon \to 0^+}\epsilon^2G(y)\phi(\epsilon y)\,dy = 0 ? \end{align} So, the question is whether that interchange of limits and integrals is valid. If you've only been studying Riemann integrals then MAJOR GIGANTIC alarm bells should be going off in your brain. If you're dealing with Lebesgue integrals, smaller alarm bells should be going off; we could try to invoke dominated convergence, but then there is no obvious dominating function (in fact there isn't because as I've shown in Q2, the limit is not necessarily $$0$$). Therefore, the interchange of limits with the integral is not valid. By making the substitution, there is just no way to conclude the limit is $$0$$, nor can we readily observe what the limit is. In Q2, I didn't make the substitution precisely because $$G$$ was homogeneous of degree $$2-n$$, which nicely cancels out the powers of $$\epsilon$$. Note that while $$G\notin L^1$$, the product $$G\phi\in L^1$$, which is why I was able to use dominated convergence to say $$\int_{\epsilon<|x|}G\phi\to \int_{\Bbb{R}^n}G\phi$$.

• and I think the classical approach is the classic approach for a reason. It's the most intuitive thing to try to do (remove a small $\epsilon$ ball around the singularity, and then let $\epsilon\to 0^+$), and requires the least amount of technical real analysis lemmas (only Greens identity, which is simply an integration by parts/divergence theorem, followed by a simple limit evaluation at the end). Aug 13, 2021 at 22:52
• Thanks so much for your time and effort! I really appreciate it! I'll need some time to digest everything in your answer. I have a few quick questions, though. On question 1, you are using integral in the Lebesgue sense, but I know (generalized) Stokes' theorem only for Darboux/Riemann integrals. Is your use of divergence theorem justified? Can you give me some references? On question 2, you split up your integral into two parts, and use substitution $x = \varepsilon y$ for only one of them. I have trouble understanding why can't you use the same substitution for the other integral. (...) Aug 15, 2021 at 1:16
• (...) By the same line of reasoning, the second term seems to tend to $0$ as $\varepsilon \to 0^+$. I guess that can't be right as that would mean that $K^{\varepsilon} \to 0$ in a sense of distributions. Can you please explain why the analogous argument fails for the second integral? Again, thanks for your time! Aug 15, 2021 at 1:16
• @DanielsKrimans yes, I'm using the Lebesgue integral (as one should when doing any serious analysis stuff, eg involving distributions since Lebesgue integral behaves nicely with limits due to monotone and dominated convergence theorems). The Lebesgue integral is a strict generalization of the Riemann integral, so anything you can do with Riemann, you can do with Lebesgue (divergence, Stokes etc). Anyway, if you want a book which treats the generalized stokes theorem (and much more) from a Lebesgue perspective, see Amann and Eschers Analysis III. Aug 15, 2021 at 2:22


text:
## Algebra: A Combined Approach (4th Edition)

$x=y$
If two exponential phrases have the same base, e.g. $a^b$ and $a^c$, then the exponents are equal, e.g. $b = c$