text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
What is the most correct way to generate random numbers in C with pthread. <p>I have several threads running concurrently and each of them must generate random numbers. I want to understand if there is a pattern to follow, to understand if it is correct to initialize the random generator with srand in the main thread or if every thread must initialize its own random generator. It seems that rand/srand have not been designed to be used with threads and I'm wondering how I can deal with threads and random numbers together.
Thanks</p>
<p>EDIT: I need pure random numbers, but I'm also interested in generating a deterministic sequence for testing purposes. I'm on linux, but I prefer to write code as portable as possible.</p>
| 0non-cybersec
| Stackexchange |
This rhubarb Pie. | 0non-cybersec
| Reddit |
Is there a purpose or benefit in prohibiting sigilless variables from rebinding?. <p>In trying to better understand sigilless variables and how they differ from <code>$</code> sigiled variables, I discovered that, unlike <code>$</code> sigiled variables, sigilless variables cannot be rebound after they've been initialized:</p>
<pre><code>my $a = 42;
my $b := $a;
$b := 42; # No exception generated
my \c := $a;
c := 42; # OUTPUT: «Cannot use bind operator with this left-hand side»
</code></pre>
<p>Is this by design? If so, is there a purpose or benefit to prohibiting sigilless variables from rebinding when <code>$</code> sigiled variables are not prohibited from doing so? </p>
| 0non-cybersec
| Stackexchange |
Bean:liquid ratio?. Is there a rule of thumb ratio when cooking beans in a slow-cooker? How much liquid to how much beans? | 0non-cybersec
| Reddit |
In honor of classic memes and her official retirement. | 0non-cybersec
| Reddit |
/u/GoblinsStoleMyHouse plays chess under the influence of different drugs and goes into detail about his experience.. | 0non-cybersec
| Reddit |
The Last of Us enemies stumble into Tristram. | 0non-cybersec
| Reddit |
Adding trusted root certificates to the server cent os. <p>I m trying to install a root certificate in my cent OS box. I did the following</p>
<ol>
<li><p>Enable the dynamic CA configuration feature:
update-ca-trust force-enable</p></li>
<li><p>Add it as a new file to /etc/pki/ca-trust/source/anchors/ cp foo.crt /etc/pki/ca-trust/source/anchors/</p></li>
<li><p>Use command: update-ca-trust extract
Then I m running below command to verify the certificate.</p></li>
</ol>
<p>openssl s_client -connect my_AD_server_IP:636 -CApath /etc/ssl/certs</p>
<p>Bur getting below error(This is part of the error)</p>
<p>Verify return code: 20 (unable to get local issuer certificate)</p>
| 0non-cybersec
| Stackexchange |
PDF video Embedding Problem. <p>I have embed an mp4 video in the PDF file as given below:</p>
<pre><code>\documentclass{beamer}
\usetheme{Singapore}
\usepackage{media9}
\usepackage{hyperref}
\begin{document}
\begin{frame}\frametitle{Title}
\includemedia[
width=\paperwidth,height=0.7\linewidth,
activate=pageopen,
flashvars={aaa.mp4 &autoPlay=true}
]{}{C:/Users/name/Desktop/aaa.mp4}
\end{frame}
\end{document}
</code></pre>
<p>There is no compile time error in the code but after running it this massage comes along a blank pd f file....</p>
<p>"To view the Flash @R Technology content in this pd f file, please install the required version of Flash Player"</p>
<p>I would like to add here that I already have installed the latest version of Flash Player(Adobe Flash Player 12 ActiveX).
So,Can anyone tell what version is required to be installed to obtain Video in pd f file. </p>
| 0non-cybersec
| Stackexchange |
Tips to uninstall 1-866-985-5978 Pop-up virus from your system easily. | 1cybersec
| Reddit |
Tony hawk's 10 year challenge. | 0non-cybersec
| Reddit |
Super Bomberman R is currently 40% off from the Switch e-shop!. | 0non-cybersec
| Reddit |
How to return from Kotlin function type. <p>I'm using function type to store code to be invoked on button click.<br>
How to return from this function type<br>
Code given below : </p>
<pre><code>var SearchClickEvent: ((searchString: String) -> Unit)? = null
inputDialog!!.SearchClickEvent = Search_Click
private val Search_Click = { searchString: String ->
if(searchString.isEmpty()){
return//Error msg : return is not allowed here
//How to return from here
}
}
</code></pre>
<p><strong>NOTE:</strong> I'm storing a piece of code in a variable not calling or writing any function</p>
| 0non-cybersec
| Stackexchange |
First Miami now a student in Maryland eats a persons heart and brain? Zombie Apocalypse has begun.. | 0non-cybersec
| Reddit |
Flatbush Zombies releasing “Vacation in Hell” On April 6th. | 0non-cybersec
| Reddit |
What's causing this error when running Google sheets script?. <blockquote>
<p>Exception: The parameters (String,String,String,(class)) don't match the method signature for <strong>CalendarApp.Calendar.createEvent.</strong> (line 31, file "Copy of Code")</p>
</blockquote>
<pre><code> 29 if (eventID != complete){
30 var currentCell = sheet.getRange (startRow + i, numColumns);
31 calendar.createEvent(primary,start,end,{
32 description: phone, email, adults, kids, notes
33 });
</code></pre>
<p>Google form updates Google sheet which updates Google Calendar when script is run. It worked correctly until I added a form trigger (which I since deleted). Can't get it to work now </p>
| 0non-cybersec
| Stackexchange |
Princess Cake [840 x 1024]. | 0non-cybersec
| Reddit |
Extremely Low Random Read/Write Performance on (4096 Aligned) Advanced Format Disks. <p>On a SATA 3.0, 6.0 Gb/s</p>
<pre><code>*-disk:0
description: ATA Disk
product: WDC WD20EFRX-68E
vendor: Western Digital
physical id: 0
bus info: scsi@1:0.0.0
hw_sector_size: 512
logical_block_size: 512
physical_block_size: 4096
# parted /dev/sda print
Model: ATA WDC WD20EFRX-68E (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
</code></pre>
<p>I have the following <a href="https://thesanguy.com/2018/01/24/storage-performance-benchmarking-with-fio" rel="nofollow noreferrer">fio results</a> on an <strong>empty</strong> /dev/sda3 (ext4):</p>
<pre><code>fio --name=seqread --rw=read --direct=1 --ioengine=libaio --bs=8k --numjobs=8 --size=1G --runtime=600 --group_reporting
seqread IOPS=8960, BW=70.0MiB/s (73.4MB/s)(8192MiB/117028msec)
fio --name=seqwrite --rw=write --direct=1 --ioengine=libaio --bs=32k --numjobs=4 --size=2G --runtime=600 --group_reporting
seqwrite IOPS=1538, BW=48.1MiB/s (50.4MB/s)(8192MiB/170345msec); 0 zone resets
fio --name=randread --rw=randread --direct=1 --ioengine=libaio --bs=8k --numjobs=16 --size=1G --runtime=600 --group_reporting
randread IOPS=163, BW=1305KiB/s (1337kB/s)(765MiB/600078msec)
fio --name=randwrite --rw=randwrite --direct=1 --ioengine=libaio --bs=64k --numjobs=8 --size=512m --runtime=600 --group_reporting
randwrite IOPS=165, BW=10.3MiB/s (10.8MB/s)(4096MiB/395912msec); 0 zone resets
fio --name=randrw --rw=randrw --direct=1 --ioengine=libaio --bs=16k --numjobs=8 --rwmixread=90 --size=1G --runtime=600 --group_reporting
randrw read IOPS=141, BW=2258KiB/s (2313kB/s)(1324MiB/600086msec)
randrw write IOPS=15, BW=253KiB/s (259kB/s)(148MiB/600086msec); 0 zone resets
</code></pre>
<p>At first I thought I had incorrect sector alignment,</p>
<pre><code>Number Start End Size File system Name Flags
1 1048576B 511705087B 510656512B fat32 boot, esp
2 511705088B 54198796287B 53687091200B raid
3 54198796288B 215260069887B 161061273600B ext4 Linux filesystem
4 215260069888B 2000398917119B 1785138847232B Linux RAID raid
</code></pre>
<p>but all start sectors are divisible by 4096, and parted tells me that </p>
<pre><code>(parted) align-check opt 1
1 aligned
(parted) align-check opt 2
2 aligned
(parted) align-check opt 3
3 aligned
(parted) align-check opt 4
4 aligned
</code></pre>
<p>SMART looks good:
<a href="https://i.stack.imgur.com/wtfrB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wtfrB.png" alt="enter image description here"></a></p>
<p>These fio results are similar with the system running on Debian 10 and an <a href="http://system-rescue-cd.org/" rel="nofollow noreferrer">Arch Linux Live cd</a>. These are not the fastest spinners, so I can live with the sequential results (though they should be higher) but <strong>the random R, W and RW results are unacceptable.</strong></p>
<p>Kernel is 5.0.x (5.2.x in the live CD), and the scheduler is the default (and <a href="https://wiki.ubuntu.com/Kernel/Reference/IOSchedulers" rel="nofollow noreferrer">recommended</a>)</p>
<pre><code># cat /sys/block/sda/queue/scheduler
[mq-deadline] none
</code></pre>
<p>Changing the scheduler to <a href="https://algo.ing.unimo.it/people/paolo/disk_sched/" rel="nofollow noreferrer">BFQ</a> did not help.</p>
<p>AFAIK the <a href="https://askubuntu.com/a/1002204/111533">sector alignment is fine</a>, but either I am missing something or I have some defective drives (which are brand new and under warranty). <200 IOPS and <2.5MB/s renders the system unusable at times.</p>
<p>I am at loss here. <strong>How do I fix this? Or do I have defective drives (unlikely, since these are two identical drives with similar results) ?</strong></p>
| 0non-cybersec
| Stackexchange |
Does Qt support OpenMP?. <p>I am using OpenMP in my Visual Studio projects and currently thinking very seriously in changing to QT creator. (Doesn't Visual Studio suck?,I expect much more from Microsoft)</p>
<p>But anyway... Does QT creator support OpenMP?
In case of that, what should I do to enable it? Or maybe is enabled by default? Do I need to do something special?</p>
<p>Thanks for your advices.
Ignacio.</p>
| 0non-cybersec
| Stackexchange |
Bought a new vehicle and this is below the steering wheel, lights up green. Definitely after market.. | 0non-cybersec
| Reddit |
Jacobi-Zariski exact sequence question. <p>Denote by $HC(A,M)$ the Hochschild homological complex of an algebra $A$ with coefficients in an $A$-bimodule $M$, and let $B\rightarrow A$ be an $R$-flat extension of $R$-algebras, for some $CRing$ $R$.</p>
<p>On page 11 of this article:
<a href="http://arxiv.org/pdf/1103.4377v2.pdf" rel="nofollow">http://arxiv.org/pdf/1103.4377v2.pdf</a>
the author defines a filtration $G_n^p$ of the Hochschild complex, and makes the claim that $\underset{p \in \mathbb{N}}{\varinjlim} G_n^p$ is exactly the $n^{th}$ entry in the Hochschild complex $HC(A,M)$.</p>
<p>My question is short and simple.. why is this true?</p>
| 0non-cybersec
| Stackexchange |
Morning in Norway.. | 0non-cybersec
| Reddit |
Change NSTabViewController NSSegmentedControl. <p>In 10.10 Apple introduced some updates on AppKit with Storyboards and a few classes. One of those is NSTabViewController.</p>
<p>In the WWDC Session 212 the presenter showed some properties of the class.
<img src="https://i.stack.imgur.com/P7d32.png" alt="wwdc"></p>
<p>Supposedly, the default <code>NSSegmentedControl</code> could be modified, or, setting <code>tabStyle</code> to <code>NSTabViewControllerTabStyleUnspecified</code> could enable us to modify the tabs style. The problem is that segmentedControl doesn't appear to be an available property on the SDK.
Maybe it didn't made it to release? How can we change the style without it?
My goal was to implement something like the Xcode 6 left tab.</p>
<p><img src="https://i.stack.imgur.com/tKNWA.png" alt="enter image description here"></p>
| 0non-cybersec
| Stackexchange |
Undocumented immigrants pay more taxes than Trump. | 0non-cybersec
| Reddit |
Subgroup of functions: Show that H is a subgroup of G.. <h1>Question: In each of the following, show that H is a subgroup of G.</h1>
<p><span class="math-container">$G=\langle F(\mathbb{R}),+\rangle$</span>, H={ f <span class="math-container">$\in$</span> F(<span class="math-container">$\mathbb{R}$</span>): f(x)=0 <span class="math-container">$\text{ for every }$</span> x <span class="math-container">$\in$</span> [0,1]}</p>
<p>I would like someone to just make sure I'm on the right track or if I did it right.</p>
<p>So it the set is not empty.</p>
<p>(i) closure under addition: <span class="math-container">$f,g \in H$</span> where <span class="math-container">$f(x)=0$</span> and <span class="math-container">$g(y)=0$</span>. Therefore, <span class="math-container">$$[f+g](x)=f(x)+g(y)=0+0=0$$</span>
Which means <span class="math-container">$f+g \in H$</span>.</p>
<p>(ii) inverse: let <span class="math-container">$f \in H$</span> then <span class="math-container">$f(x)=0$</span> which means <span class="math-container">$$(-f)(x)=-f(x)=-0=0$$</span> so <span class="math-container">$-f \in H$</span>.</p>
| 0non-cybersec
| Stackexchange |
ERROR 1114 (HY000): The table is full. <p>I am trying create a table using a cross join or Cartesian Product subquery that creates a table with a large number of rows, like at least 148 million rows. I get this</p>
<blockquote>
<p>ERROR 1114 (HY000): The table is full.</p>
</blockquote>
<p>I plan on filtering and querying the table later on, but how can I create this table?</p>
| 0non-cybersec
| Stackexchange |
$\int \sqrt{a^2+x^2} \,dx$ when $\int \sqrt{1+x^2} \, dx$ is known. <p>I messed up calculating $\int\sqrt{a^2+x^2} \, dx$ when $\int \sqrt{1+x^2} \, dx$ is known.
What I did</p>
<p>$$\int \sqrt{a^2+x^2} \,dx = \int \sqrt{a^2(1+(x/a)^2)} \, dx = a \int \sqrt{1+(x/a)^2} \,dx$$</p>
<p>now set $u=(x/a)$ and $a\,du=dx$ and use the known formula for $\int \sqrt{1+u^2} \, du$</p>
<p>$$\int \sqrt{a^2+x^2} \,dx= a^2 · (1/2) \left( u \sqrt{1+u^2} + \log(u+\sqrt{1+u^2})\right)$$</p>
<p>now switch back $u=(x/a)$</p>
<p>$$
\begin{align}
& a^2 \cdot (1/2) \left( u \sqrt{1+u^2} + \log(u+\sqrt{1+u^2})\right) \\[8pt]
& = a^2 \cdot (1/2) \left( (x/a) \sqrt{1+(x/a)^2} + \log((x/a)+\sqrt{1+(x/a)^2})\right) \\[8pt]
& = (ax/2) \sqrt{(1/a^2)(a^2+x^2)} + (a^2/2)\cdot\log((x/a)+\sqrt{(1/a^2)(a^2+x^2)} \\
& = (x/2) \sqrt{a^2+x^2} + (a^2/2)\cdot\log\left(1/a(x+\sqrt{a^2+x^2})
\right)\end{align}
$$</p>
<p>$$= (x/2) \sqrt{a^2+x^2}+a^2/2·\log(x+\sqrt{a^2+x^2}) -a$$</p>
<p>Can someone help where's the mistake? I can't find it..</p>
| 0non-cybersec
| Stackexchange |
Happy 46th birthday to Jón Gnarr, badass mayor of Reykjavík . | 0non-cybersec
| Reddit |
Hiding finder preview panel... forever. <p>I'm not sure why but quite recently Finder likes to show me the Preview panel on new Finder windows. </p>
<p>I've tried every method I could find:</p>
<ul>
<li>Hiding the preview. Close the finder and open a new window. Will show the same preview again.</li>
<li>Go to <code>/Users/$username$/Library/Preferences/com.apple.finder.plist</code> and edit the <code>ShowPreviewPane</code> setting it to <code>NO</code>. This will magically revert to <code>YES</code> after I relaunch the Finder.</li>
</ul>
<p>I'm out of ideas. What could I do?</p>
| 0non-cybersec
| Stackexchange |
Dettman's Applied Complex Variables Theorem 4.2.5 Correction (Normal Families). <p>I need someone to decide whether I'm going crazy. Dettman states the following theorem without proof:</p>
<p><a href="https://books.google.com/books?id=FsnCAgAAQBAJ&pg=PA137&lpg=PA137&dq=dettman%20theorem%204.2.5&source=bl&ots=O0x9ufpulb&sig=tf8b5SSOItVzx9DjRJJu2uvOmys&hl=en&sa=X&ved=0CCYQ6AEwAWoVChMI3MPsm8e8xwIVVFmICh1pQgk0#v=onepage&q=dettman%20theorem%204.2.5&f=false" rel="nofollow" title="Context">Theorem 4.2.5</a>
Let $F$ be a family of functions analytic in a domain $D$, where it is uniformly bounded. Then every sequence of functions in $F$ contains a subsequence which converges to a function in the family.</p>
<p>Now, as stated, I think the theorem is incorrect. As a counter-example, take $F = (z^n)_{n\in \mathbb{N}}$ on the open unit disk. As a sequence, these functions converge to 0, which isn't in the family.</p>
<p>So here's my question: Is this theorem unsalvageable, or can it be perturbed to a true statement about normal families? The theorem of course becomes true if we omit 'in the family,' or if we replace it with 'which is also analytic and bounded in $D$.' But is there a similar (true!) theorem which guarantees membership in the family?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
MAL Score Progression - Summer Season. | 0non-cybersec
| Reddit |
HAND GESTURE RECOGNITION USING ULTRASONIC WAVES
Mohammed H. AlSharif Mohamed Saad Advisor: Tareq Y. Al-Naffouri
EE Department, King Abdullah University of Science & Technology, Thuwal, Saudi Arabia
{mohammed.alsharif, mohamed.saadeldin, tareq.alnaffouri}@kaust.edu.sa
ABSTRACT
This paper presents a new method for detecting and classifying a
predefined set of hand gestures using a single transmitter and a single
receiver utilizing a linearly frequency modulated ultrasonic signal.
Gestures are identified based on estimated range and received signal
strength (RSS) of reflected signal from the hand. Support Vector
Machine (SVM) was used for gesture detection and classification.
The system was tested using experimental setup and achieved an
average accuracy of 88%.
1. INTRODUCTION
With nowadays spread usage of electronic devices and the advances
in human-computer interface technology, gesture control is be-
coming an active research area. This technology has applications
in consumer electronics, medical care, advertisement and many
other applications[1]. There are two main approaches for touchless
gesture recognition systems; active and passive. Active approach
requires the user to wear or hold a device such as data gloves or
infrared sensor. Passive appraoch doesn’t require user physical con-
tact [2]. A popular passive gesture recognition approach is based
on cameras. An alternative attractive approach is based on utiliz-
ing reflected ultrasonic waves from the user’s hand. Compared to
camera-based approach, ultrasonic insures user privacy, insensitive
to illumination changes, and has lower power consumption and
computational complexity.
In [3] Gupta et al. developed an algorithm to track Doppler shift
caused by the moving hand using laptops in different environments.
Kalgaonkar et al. in [4] developed a simple device based on Doppler
effect to recognize one-handed gesture using low-cost ultrasonic
transmitter and receivers.
In this paper we presents a novel hand gesture recognition system
based on ultrasonic ranging. The system is of low complexity and
can detect five types of gestures using a single ultrasonic transmitter
and a single ultrasonic receiver.
In the second section of this paper, system parameters and signal
design are presented. In the third section, signal processing tech-
niques used are explained. Fourth section presents gesture detection
and classification using Support Vector Machine (SVM). The fifth
section describes experimental setup and shows the experimental
results. Final section concludes the paper.
2. SYSTEM PARAMETERS AND SIGNAL DESIGN
The system aims to detect five types of gestures, shown in Figure 1,
performed by a single hand moving in a range of 10-50 cm in depth
and 40 cm horizontally with a speed not exceeding 1 m/s. The trans-
mitted signal is a train of pulses designed to satisfy the requirements
of the system. Figure 2 shows the transmitted signal and highlights
Fig. 1. The predefined set of hand gestures
the parameters T1, T2 and T3. The transmitter and receiver are sep-
arated by a distance of 1.1 cm. In addition to the reflected signals,
a self-interference signal is received directly from the transmitter.
It’s a signal design objective to reduce the overlap between the re-
flected and the self-interference signals. The nearest reflected sig-
nal from the hand arrives in 0.6 ms. Therefor, the value of T1 was
sat to 0.5 ms. The farthest reflected signal from the hand arrives in
2.9 ms. However, to help with reducing the effect of multi-path re-
verberations, the value of T2 was sat to 5 ms. To increase SNR, a
…..
T1
T2
T3 = N * T2
Pulse 1 Pulse 2 Pulse 3 Pulse N
One Hop
One Snapshot
Fig. 2. Transmitted train of pulses for one block
block of N pulses is processed for each estimation. The value of N
should be small enough to assume static hand over the time period
T3 = N × T2. Therefore, the value of N was sat to 4.
Odd indexed pulses are up-Chirps and even indexed pulses are down-
Chirps. This provides orthogonality between consecutive pulses.
Each pulse has a central frequency at 38.8 KHz and bandwidth of
(38.8 ± 3.5) KHz.
3. SIGNAL PROCESSING TECHNIQUES
Processing the reflected signals aim is to estimate the range and RSS.
The reflected signal from hand can be modeled as:
y[n] = αx[n− d] + w[n] (1)
ar
X
iv
:1
71
0.
08
62
3v
1
[
ee
ss
.S
P
]
2
4
O
ct
2
01
7
Where α is attenuation factor, x[n] is the transmitted signal, d is
TOF from the transmitter to the hand then back to receiver, and w[n]
is AWGN. Cross-correlation is applied between the transmitted and
received signal to estimate TOF (d) and RSS (α). De-cluttering is
used to remove the self-interference and other unwanted reflections
from static and slowly moving objects. Peaks associated with static
or slowly moving objects will always appear at the same delay (TOF)
over all cross-correlation frames. Subtracting the previous cross-
correlation frames from the current one will remove them. If we
denote the cross correlation vector vi where i refers to the index of
the processed block, and let the cluttering factor be c, then the output
of the de-clutter is given by:
vî = vi −
(
c
i
v1 + c
i−1
(1− c)v2 + ...+ c0(1− c)vi−1
)
(2)
Where c ∈ [0, 1]. Cross correlating and de-cluttering produce Mo-
tion Frames in which peaks positions relates to the current range of
gesturing hand and their amplitude indicates RSS.
4. GESTURE DETECTION AND CLASSIFICATION
Support Vector Machine (SVM) classifier was chosen to detect and
classify a predefined set of five gestures. SVM algorithm is proven
to achieve a good performance for real world applications and with
mathematical models that are based on simple ideas and are easy to
analyze. Motion Frames obtained from consecutive blocks over time
form a Motion Profile. On average a gesture occupies 2 seconds in
time, generating a Motion Profile of 100 frames. Each gesture type
has its unique Motion Profile. Two main features sets were engi-
neered from the Motion Profile (100 frames length) to be used for
detection and classification. The first set is RSS Vector, formed by
summing the values of the highest 20 peaks over the profile length in
each frame. The second set is Range Matrix, consisting of positions
and values of the highest 20 peaks in each frame. Figure 3 shows
the generation of the two feature sets. Detection and classification is
Cross Correlation Profile
Block number
390 400 410 420 430 440 450 460 470
R
a
n
g
e
(
in
s
a
m
p
le
s)
100
200
300
400
500
600
700
800
900 0
0.2
0.4
0.6
0.8
1
Sum highest
20 values
over each
column (RSS
feature)
Width = 100 Blocks
Find the highest 20 values and their
indexes over each column (Range feature) Gesture
Pattern
Height =
520
Samples
Fig. 3. RSS and Range vectors generation
done in a hierarchy way as show in figure 4. The first two levels in
the hierarchy are classified using RSS vector, and the last two levels
are classified using Range Matrix.
5. EXPERIMENTAL EVALUATION
This section presents the experimental setup used for testing the sys-
tem. A customized board with a mic and MEMS ultrasonic transmit-
ter is connected to a PC through a sound-card. During experiments,
data is recorded and saved to be processed off-line using MATLAB.
A set of around 120 repetitions of each type of the five gestures was
Gesture Detection
Gesture Classification
Pushes
FWD FWD-BWD
Swipes or Hold Hand
Swipes
LTR RTL
Hold Hand
No Gesture
Fig. 4. Detection Classification Hierarchy
recorded. Test was done using cross validation where 8% of the data
was taken as a test set and the rest was taken as a training set. The
following confusion matrix shows the performance of the system.
Gesture Right-Left Left-Right Hold Hand Fwd-Bwd Fwd
Right-Left 0.9423 0.0385 0 0 0
Left-Right 0.0088 0.9381 0.0885 0 0
Hold Hand 0.0309 0.2165 0.8247 0 0.0103
Fwd-Bwd 0.0085 0.0169 0.1356 0.8136 0.1017
Fwd 0 0.0545 0.0545 0.0273 0.9182
Table 1. Confusion matrix for classification results
6. CONCLUSION
In this paper we showed that a single ultrasonic transmitter and a
single receiver can be used to detect and classify five different types
of hand gestures with high accuracy. The design of the transmitted
signal uses LFM utilizing a small bandwidth. Least squares SVM
classifier with a polynomial kernel function was used to detect and
classify gestures. System evaluation shows an average accuracy
of 88.7%. Since the proposed system is using a single ultrasonic
transmitter and a single receiver, it can be suitable for devices like
laptops and mobile phones.
7. REFERENCES
[1] marketsandmarkets.com, “Gesture recognition & touchless
sensing market by technology (touch-based & touchless), ap-
plication (consumer electronics, automotive, & others), product
(biometric & sanitary equipment) & by geography - global fore-
cast to 2020,” 2015.
[2] Siddharth S Rautaray and Anupam Agrawal, “Vision based hand
gesture recognition for human computer interaction: a survey,”
Artificial Intelligence Review, vol. 43, no. 1, pp. 1–54, 2015.
[3] Sidhant Gupta, Daniel Morris, Shwetak Patel, and Desney Tan,
“Soundwave: using the doppler effect to sense gestures,” in
Proceedings of the SIGCHI Conference on Human Factors in
Computing Systems. ACM, 2012, pp. 1911–1914.
[4] Kaustubh Kalgaonkar and Bhiksha Raj, “One-handed ges-
ture recognition using ultrasonic doppler sonar,” in Acoustics,
Speech and Signal Processing, 2009. ICASSP 2009. IEEE Inter-
national Conference on. IEEE, 2009, pp. 1889–1892.
1 Introduction
2 System Parameters and Signal Design
3 Signal Processing Techniques
4 Gesture Detection and Classification
5 Experimental Evaluation
6 Conclusion
7 References
| 0non-cybersec
| arXiv |
Use of Virtual Reality to Train People to be more Empathetic: Study findings suggest the use of VR-technology to remodel brain functioning to make people more conscientious of other's suffering. | 0non-cybersec
| Reddit |
Guy fixes a stranger's car. | 0non-cybersec
| Reddit |
Volume of solid lies under $z=x^2+y^2$. <p>Find the volume of solid lies under $z=x^2+y^2$ above $x$-$y$ plane and inside the cylinder $x^2+y^2=2x$. I know, for volume we have to us $V=\iiint { \mathrm dx\mathrm dy\mathrm dz}$ but i was not able to proceed further.</p>
<p>Any hint would be sufficient ! </p>
| 0non-cybersec
| Stackexchange |
word-wrap break-word does not work in this example. <p>I cannot get word-wrap to work with this example...</p>
<pre><code><html>
<head></head>
<body>
<table style="table-layout:fixed;">
<tr>
<td style="word-wrap: break-word; width:100px;">ThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrapThisStringWillNotWrap</td>
</tr>
</table>
</body></html>
</code></pre>
<p>I remembered reading that a layout had to be specified (which I did), but beyond that I'm not sure what I have to do to get this to work. I really would like this to work in Firefox. Thanks.</p>
<p>EDIT:
Failed in Chrome 19 and Firefox 12, it works in IE8.
I tried doctype strict and transitional, neither worked.</p>
| 0non-cybersec
| Stackexchange |
YSK that it's Random Acts Of Kindness Day. Keep in mind that even a little courtesy improves your health and the health of others!. "According to Dr. Paul J. Zak, when we respect one another, we release oxytocin into the brain and expand our social network, which in effect allows us to lead healthier, happier, and more productive lives."
[https://brainworldmagazine.com/little-courtesy-makes-big-difference-brain-people/](https://brainworldmagazine.com/little-courtesy-makes-big-difference-brain-people/) | 0non-cybersec
| Reddit |
How can I integrate rational functions with denominator with just quadratics as factors?. <p>I am told about integration by partial fraction method.I usually guess to decompose a fraction into partial fractions and then I solve the constants.In this problem: $$\int\frac{x^2+2x+6}{(x^2+5x+7)(x^2+6x+7)}$$ I tried to form its partial fraction but I wasn't able to. </p>
<p>Also note that this is an imaginary problem to satisfy my concepts by giving counterpositive statements as equation.My book says: </p>
<blockquote>
<p>The rational functions which we shall consider here for integration purposes will be those whose denominators can be factorised into <strong>linear and quadratic factors</strong>.It is <strong>always possible</strong> to write the integrand as a sum of simpler rational functions by a method called partial fraction decomposition method.After this, the integration can be carried out easily using the already known methods.</p>
</blockquote>
| 0non-cybersec
| Stackexchange |
Why did the emoji and predictive input stop showing up on Touch Bar while typing in WhatsApp desktop Mac app on MacBook Pro?. <p>When I first began using WhatsApp Mac app on a new MacBook Pro, the emoji and predictive text were working normally whenever I was typing in the WhatsApp desktop Mac app. I could quickly access the emoji on the Touch Bar and predictive texts show up too on the Touch Bar.</p>
<p>But suddenly it stopped working. The emoji and predictive text stopped appearing on the Touch Bar whenever I open WhatsApp app.</p>
<p>What is causing this problem? Is there any way to fix it?</p>
<p>The issue still persists when logging in to other user accounts. And the emoji and predictive text show up on the Touch Bar normally when I use iMessage app. I tried uninstalling & installing WhatsApp app to no avail.</p>
| 0non-cybersec
| Stackexchange |
ALL GIFS MUST BE BEYONCE THEMED FROM THIS POINT FORWARD, IGNORE /U/HERO0FWAR. | 0non-cybersec
| Reddit |
Someone can’t read. | 0non-cybersec
| Reddit |
Building my first PC, trying to keep a 700$ budget. [PCPartPicker Part List](https://pcpartpicker.com/list/HJ2Pf9)
|Type|Item|Price|
|:-|:-|:-|
|**CPU**|[AMD Ryzen 5 2600 3.4 GHz 6-Core Processor](https://pcpartpicker.com/product/jLF48d/amd-ryzen-5-2600-34ghz-6-core-processor-yd2600bbafbox)|$120.98 @ Newegg|
|**Motherboard**|[ASRock B450M/AC Micro ATX AM4 Motherboard](https://pcpartpicker.com/product/kcCFf7/asrock-b450mac-micro-atx-am4-motherboard-b450mac)|$88.98 @ Newegg|
|**Memory**|[Team T-FORCE VULCAN Z 16 GB (2 x 8 GB) DDR4-3200 Memory](https://pcpartpicker.com/product/z3VD4D/team-t-force-vulcan-z-16-gb-2-x-8-gb-ddr4-3200-memory-tlzgd416g3200hc16cdc01)|$69.99 @ Newegg|
|**Storage**|[Crucial P1 500 GB M.2-2280 NVME Solid State Drive](https://pcpartpicker.com/product/xpYLrH/crucial-p1-500gb-m2-2280-solid-state-drive-ct500p1ssd8)|$66.95 @ Adorama|
|**Video Card**|[Asus Radeon RX 580 8 GB ROG STRIX Video Card](https://pcpartpicker.com/product/9ZmxFT/asus-radeon-rx-580-8gb-rog-strix-video-card-rog-strix-rx580-o8g-gaming)|$193.98 @ Newegg|
|**Case**|[Thermaltake Versa H17 MicroATX Mini Tower Case](https://pcpartpicker.com/product/JtWfrH/thermaltake-versa-h17-microatx-mini-tower-case-ca-1j1-00s1nn-00)|$39.98 @ Newegg|
|**Power Supply**|[EVGA BQ 600 W 80+ Bronze Certified Semi-modular ATX Power Supply](https://pcpartpicker.com/product/DmWrxr/evga-bq-600w-80-bronze-certified-semi-modular-atx-power-supply-110-bq-0600-k1)|$56.98 @ Newegg|
|*Prices include shipping, taxes, rebates, and discounts*|||
|Total (before mail-in rebates)|$662.84||
|Mail-in rebates|\-$25.00||
|**Total**|**$637.84**||
|Generated by [PCPartPicker](https://pcpartpicker.com) 2019-12-31 22:01 EST-0500|||
I'm just looking for advice to see if there are better parts for a similar price. And if y'all think this is a decent build
I'm also getting two 1TB HHDs from a friend for 50 | 0non-cybersec
| Reddit |
$PWD and $WORKSPACE are different in Jenkins. <p>My job has a build step <strong>Build - Execute shell</strong>, I only put these two command in:</p>
<pre><code>echo $WORKSPACE
echo $PWD
</code></pre>
<p>And the output really confused me:</p>
<pre><code>+ echo /home/jenkins/workspace/tradefed/test_deployment
/home/jenkins/workspace/tradefed/test_deployment
+ echo /media/d/workspace/tradefed/test_deployment
/media/d/workspace/tradefed/test_deployment
</code></pre>
<p>Why the value of <code>$WORKSPACE</code> and <code>$PWD</code> are different ?</p>
<p><strong>Update 2019/03/18:</strong></p>
<p>As @PavelAnikhouski mentioned, <code>$WORKSPACE</code> is set relatively to your <code>$JENKINS_HOME</code>, <code>$PWD</code> is OS environment variable, refers to current working directory in file system, so <strong>they should not be the same</strong>.</p>
<p>But I am still confused about <code>$WORKSPACE</code>, why Jenkins has <code>$WORKSPACE</code>, but execute shell in another working directory ?</p>
| 0non-cybersec
| Stackexchange |
TIL that many of my friends' whose marriages have
collapsed, experienced "Walkaway Wife Syndrome." . | 0non-cybersec
| Reddit |
[NO SPOILERS] Direterrier. | 0non-cybersec
| Reddit |
Some confusion in the bathroom of Macaroni Grill. | 0non-cybersec
| Reddit |
Show that $x\otimes x+2\otimes2$ is not an elementary tensor in $I\otimes_{A}I$. <blockquote>
<p>Let $A=\mathbb{Z}[x]$ and $I=(2,x)\lhd A.$ Show that $x\otimes x+2\otimes2$ is not an elementary tensor in $I\otimes_{A}I$.</p>
</blockquote>
<p>I have
$$I\otimes_A I = \frac{L_A(I\times I)}{T}$$</p>
<p>where $T$ is the submodule generated by the elementary tensors $$\{(am,n)-a(m,n);(m,an)-a(m,n);(m,n)+(m,n')-(m,n+n');(m,n)+(m',n)-(m+m',n)\}$$</p>
<p>I haven't been able to to much work here. I have a couple of ideas: showing that $x\otimes x+2\otimes2$ can't be written in one of the form above to prove is not elementary. A possible alternative would show that the tensor given is can be written as a linaer combination of elementary tensors (and is this always true? question arise because not every tensor consists only of elementary tensors).</p>
| 0non-cybersec
| Stackexchange |
One man's application for the soon-to-probably-not-be-vacant England manager's job (and the FA's reply).. | 0non-cybersec
| Reddit |
Is it possible to install Windows Debugging Tools via Powershell?. <p>I've installed LeanSentry on one of my web servers to try and diagnose some performance issues I've been having. I need to install Windows Debugging Tools (from the Windows SDK) to get some memory diagnostics back from my app hosted in IIS.</p>
<p>The main issue is that I don't have remote desktop access to the server, I just have remote Powershell access, so I'm looking a way to do it via command line. I can't seem to find any instructions online, not sure if I'm looking in the wrong places?</p>
| 0non-cybersec
| Stackexchange |
Every night. | 0non-cybersec
| Reddit |
How can I use `git diff --color-words` outside a Git repository?. <p>How can I get output like in <code>git diff --color-words</code>, but outside Git?</p>
<p>Closest thing is <code>wdiff -t</code>, but it underlines/inverts things instead of using green/red colours and does not allow specifying my whitespace regex.</p>
| 0non-cybersec
| Stackexchange |
Using a pub analogy, user describes how subreddits change when they get defaulted. | 0non-cybersec
| Reddit |
Question about sum of chi-squared distribution. <p>I want to prove that the sum of two independent chi-squared random variables is a chi-squared random variable.</p>
<p>I am supposed to only use the fact that if $Q$ has a chi-squared distribution with parameter k then Q = $Z_1^2$ + $Z_2^2$ + ... + $Z_k^2$ where each $Z_i$ is a standard normally distributed random variable and {$Z_1$,...,$Z_k$} is independent.</p>
<p>My attempt at a proof:</p>
<p>Let $Q_1$ and $Q_2$ be independent random variables with chi-squared distributions, with parameters a and b, respectively.
Let {$X_1$,...,$X_a$,$Y_1$,...,$Y_b$} be a set of independent random variables with standard normal distributions. Then we can write</p>
<p>$Q_1$ = $X_1^2$ + $X_2^2$ + ... + $X_a^2$</p>
<p>$Q_2$ = $Y_1^2$ + $Y_2^2$ + ... + $Y_b^2$ , and $Q_1$ and $Q_2$ are independent because {$X_1$,...,$X_a$,$Y_1$,...,$Y_b$} is independent.</p>
<p>so $Q_2$ + $Q_2$ = $X_1^2$ + $X_2^2$ + ... + $X_a^2$ + $Y_1^2$ + $Y_2^2$ + ... + $Y_b^2$.</p>
<p>Since {$X_1$,...,$X_a$,$Y_1$,...,$Y_b$} is independent, $Q_2$ + $Q_2$ is a chi-squared random variable with parameter a+b.</p>
<p>I don't think my proof is correct. I think the problem is that if we are given $Q_1$ and $Q_2$ that are independent, we can't just write them in terms of {$X_1$,...,$X_a$,$Y_1$,...,$Y_b$}. But I am not really sure. Please tell me why my proof is incorrect (or maybe it is correct). Any help is appreciated.</p>
| 0non-cybersec
| Stackexchange |
LuaJIT and C++ - call to Table.Method() does not work in loadstring/pcall. <p>I got 2 functions that register Lua table and method in C++:</p>
<pre><code>void LuaScriptInterface::registerTable(const std::string& tableName)
{
// _G[tableName] = {}
lua_newtable(luaState);
lua_setglobal(luaState, tableName.c_str());
}
void LuaScriptInterface::registerMethod(const std::string& globalName, const std::string& methodName, lua_CFunction func)
{
// globalName.methodName = func
lua_getglobal(luaState, globalName.c_str());
lua_pushcfunction(luaState, func);
lua_setfield(luaState, -2, methodName.c_str());
// pop globalName
lua_pop(luaState, 1);
}
</code></pre>
<p>It registers some methods:</p>
<pre><code>registerTable("Game");
// Game.getHouses()
registerMethod("Game", "getHouses", LuaScriptInterface::luaGameGetHouses);
</code></pre>
<p>Then I call in Lua:</p>
<pre><code>local param = "print( Game.getHouses() )"
pcall(loadstring(param))
</code></pre>
<p>I got problem with <strong>param</strong>. Calls and results:</p>
<pre><code>1. print(Game.getHouses())
2. print(Game['getHouses']())
3. print( Game.getHouses() ) -- added spaces
4. print( Game['getHouses']() ) -- added spaces
5. local var = Game.getHouses() print(#var)
6. local var = Game['getHouses']() print(#var)
7. local var = #Game.getHouses() print(var)
8. local var = #Game['getHouses']() print(var)
9. local var = # Game.getHouses() print(var) -- added space
</code></pre>
<p>Results:</p>
<pre><code>1. attempt to call a nil value
2. table: 0x4351fdd0
3. table: 0x42ce6b88
4. table: 0x426513c0
5. 1010
6. 1010
7. attempt to call a nil value
8. 1010
9. 1010
</code></pre>
<p>Can anyone tell me a reason, why it does not work in <em>loadstring/pcall</em>?</p>
<p>Can I make it work in <em>loadstring/pcall</em> somehow?</p>
<p><strong>EDIT:</strong></p>
<p><strong>After 2 hours of debugging. I found out, that client that I use to communicate with server - that executes LUA - does some regex on string that I send (I still don't know why, but it's not LUA related)</strong> :)</p>
| 0non-cybersec
| Stackexchange |
Like a cat's, the fox's thick tail aids its balance, but it has other uses as well. A fox uses its tail (or "brush") as a warm cover in cold weather and as a signal flag to communicate with other foxes. | 0non-cybersec
| Reddit |
Servers cannot see internet gateway though their configuration is the same to another which can. <p>I have 2 switches at the Data Centre - one is connected to the internet, and one for the internal private network. </p>
<p>All servers have one NIC into the internet switch and one to the private one. All servers are ok, except three: Those three servers are visible just fine in the internal network
but are unable to ping the internet gateway or be visible from the internet. They have what seems to be the exact same setup in the interfaces and resolve.conf files (with of course different public IP addresses to them but the rest are the same).
'route' shows the same output on those 3 as in another server which works perfectly, yet they cannot access the internet and when I ping the configured gateay from those 3 ping responds that the host is unreachable. When route runs on these 3 machines it pauses a few secons before it displays the gateway (probably as its unreachable).</p>
<p>The servers are all Debian 6. Iptables has no chains/rules.</p>
<p>I've been standing in the Data Centre for the past few hours trying to figure this out.
Any help highly appreciated</p>
| 0non-cybersec
| Stackexchange |
Distance between $u$ and $v$ is the same as distance between $v$ and $u$ in a transposed graph?. <p>My question is what the title says. Given an weighted directed graph $G=(V,E)$ and the minimum distance between two vertexes $u$ and $v$, I want to know if the distance between $v$ and $u$ is always the same in $G^{T}$ (the graph with all edges inverted).</p>
<p>I did some tests and couldn't find a graph where this is false, but this proves nothing. What is the intuition behind proving this true (or false)?</p>
<p><strong>Edit:</strong> Distance is just the sum of all weights in the path from $u$ to $v$. </p>
| 0non-cybersec
| Stackexchange |
How can I type with Chinese characters in Windows 7?. <p>I have a standard US version of Windows 7. I would like to input Chinese characters in Adobe Premier Pro. How can I do this?</p>
| 0non-cybersec
| Stackexchange |
LIDS Technical Report 2805 1
Correlated Equilibria in Continuous Games:
Characterization and Computation
Noah D. Stein, Pablo A. Parrilo, and Asuman Ozdaglar∗†
October 31, 2018
Abstract
We present several new characterizations of correlated equilibria in games with
continuous utility functions. These have the advantage of being more computationally
and analytically tractable than the standard definition in terms of departure functions.
We use these characterizations to construct effective algorithms for approximating a
single correlated equilibrium or the entire set of correlated equilibria of a game with
polynomial utility functions.
1 Introduction
In finite games correlated equilibria are simpler than Nash equilibria in several senses –
mathematically at least, if not conceptually. The set of correlated equilibria is a convex
polytope, described by finitely many explicit linear inequalities, while the set of (mixed)
Nash equilibria need not be convex or connected and can contain components which look
like essentially any real algebraic variety (set described by polynomial equations on real
variables) [7]. The existence of correlated equilibria can be proven by elementary means
(linear programming or game theoretic duality [15]), whereas the existence of Nash equilibria
seems to require nonconstructive methods (e.g., fixed point theorems as in [22, 14]) or the
analysis of complicated algorithms [19, 10, 12]. Computing a sample correlated equilibrium
or a correlated equilibrium optimizing some quantity such as social welfare can be done
efficiently [13, 23]; strong evidence in complexity theory suggests that the corresponding
problems for Nash equilibria are hard [6, 4, 13].
There are several exceptional classes of games for which the above problems about Nash
equilibria become easy. The most important here are the zero-sum games. Broadly speaking,
Nash equilibria of these games have complexity similar to correlated equilibria of general
∗Department of Electrical Engineering, Massachusetts Institute of Technology: Cambridge, MA 02139.
[email protected], [email protected], and [email protected].
†This research was funded in part by National Science Foundation grants DMI-0545910 and ECCS-
0621922 and AFOSR MURI subaward 2003-07688-1.
ar
X
iv
:0
81
2.
42
79
v2
[
cs
.G
T
]
2
3
A
pr
2
01
0
Nash equilibria Nash equilibria correlated equilibria
(non-zero sum) (zero sum)
Finite games Semialgebraic set [20] LP LP [2]
Polynomial games Semialgebraic set [31] SDP [25] ?
Table 1: Comparison of the simplest known description of different classes of equilibrium
sets in finite and polynomial games.
games. In particular, the set of Nash equilibria is an easily described convex polytope,
existence can be proven by duality, and a sample equilibrium can be computed efficiently.
The situation in games with infinite strategy sets is not nearly so clear. For the compu-
tational sections of this paper we restrict attention to the simplest such class of games, those
with finitely many players, strategy sets equal to [−1, 1], and polynomial utility functions.
We make this restriction for several reasons.
The first is conceptual and notational simplicity. Results similar to ours will hold when
the strategy sets are general compact semialgebraic (described by finitely many polynomial
equations and inequalities) subsets of Rn. However, dealing with this additional level of
generality requires machinery from computational real algebraic geometry and does little to
illuminate our basic methods.
The second is generality. Much of the study of games with infinite strategy sets is fraught
with assumptions of concavity or quasiconcavity which appear to be motivated not by natural
game theoretic premises, but rather by the inadequacy of available tools for games without
these properties. While polynomiality assumptions and concavity assumptions are both rigid
in their own ways, polynomials have the benefit of being dense in the space of all continuous
functions, and thus suitable for approximating a much wider class of games.
The third reason is convenience. The algebraic structure we gain by restricting atten-
tion to polynomials allows us to use recent advances in semidefinite programming and real
algebraic geometry to construct efficient algorithms and gain conceptual insights.
Little is known about correlated equilibria of these polynomial games, but much is known
about Nash equilibria. Most importantly, the set of mixed Nash equilibria is nonempty
and admits a finite-dimensional description in terms of the moments of the players’ mixed
strategies [31].
This set of moments can be described explicitly in terms of polynomial equations and
inequalities [31]. The Nash equilibrium conditions are expressible via first order statements,
so the set of all moments of Nash equilibria is a real algebraic variety and can be computed
in theory, albeit not efficiently in general. In the two-player zero-sum case, the set of Nash
equilibria can be described by a semidefinite program (an SDP is a generalization of a linear
program which can be efficiently solved; see the appendix), hence we can compute a sample
Nash equilibrium or one which optimizes some linear functional in polynomial time [25]. A
summary of the results described so far is shown in Table 1.
2
Contributions The impetus for this paper was to address the bottom right cell of Table
1, the one with the question mark. The table seems to suggest that the set of correlated
equilibria of a polynomial game should be describable by a semidefinite program. We will see
that this is approximately true, but not exactly. The contribution of this paper is twofold.
• First, we present several new characterizations of correlated equilibria in games with
continuous utility functions (polynomiality is not needed here). In particular we show
that the standard definition of correlated equilibria in terms of measurable departure
functions is equivalent to other definitions in which the utilities are integrated against
all test functions in some class (Theorem 2.10). This characterization does not have
any obvious game theoretic significance, but it is extremely useful analytically and it
forms the base for our other contributions.
• Second, we present several algorithms for approximating correlated equilibria within
an arbitrary degree of accuracy. We present one inefficient linear programming based
method as a benchmark, followed by two semidefinite programming based algorithms
which perform much better in practice. The first SDP algorithm, called adaptive
discretization, iteratively computes a sequence of approximate correlated equilibria
supported on finite sets (Section 3.2). We enlarge the support sets at each iteration
using a heuristic which guarantees convergence in general and yields fast convergence
in practice. The second SDP algorithm, called moment relaxation, does not discretize
the strategy spaces but instead works in terms of joint moments. It produces a nested
sequence of outer approximations to the set of joint moments of correlated equilibrium
distributions, and these approximate equilibrium sets are described by semidefinite
programs (Section 3.3). These relaxations depend crucially on one of the correlated
equilibrium characterizations we have developed.
Related literature The questions we address and the techniques we use are inspired by
existing literature in two main areas. First, our work is related to a number of papers in the
game theory literature.
• Aumann defines correlated equilibria in his famous paper [1], focusing on finite games
to establish the basic properties and important examples. He obtains existence as a
consequence of Nash’s theorem on the existence of Nash equilibria in finite games [22].
• Hart and Schmeidler show that existence of correlated equilibria in finite games can be
proven directly by a duality argument [15]. They then use a careful limiting argument
to prove existence of correlated equilibria in continuous games with compact Hausdorff
strategy spaces (Theorem 3 of that paper). The germs of ideas in this limiting argument
are developed further in Section 2 of the present paper to yield various characterizations
of correlated equilibria. It is worth noting that in [15] the authors also consider part
(1) of Corollary 2.14 as a candidate definition of correlated equilibria. They discard it
is as not obviously capturing the game theoretic idea of correlated equilibrium, but we
prove that it is nonetheless an equivalent definition in games with continuous utilities.
3
• Stoltz and Lugosi study learning algorithms which converge to correlated equilibria
in continuous games [33]. These algorithms have a game theoretic interpretation as
avoiding “regret” in a repeated game setting. Each player can carry out these proce-
dures separately without knowledge of his opponents’ utilities. These are conceptual
advantages over our methods, which merely aim for efficient computation.
However, these advantages come at a cost. The learning procedures require each player
to solve a fixed point equation at each iteration. In general finding fixed points is as
hard as finding Nash equilibria [6, 4], so these procedures do not seem to lead directly
to efficient methods for computing correlated equilibria of continuous games.
There exist classes of fixed point equations which can be solved efficiently (i.e., the
steady-state distribution of a Markov chain, which is defined by a linear program). To
our knowledge there has been no work on whether the equations of [33] fall into such
a class.
Furthermore, each of these learning algorithms either makes concavity-type assump-
tions about the utility functions, which we seek to avoid for modeling flexibility, or
discretizes the players’ strategy spaces a priori. We will see in Section 3.1 that such
discretization without regard to the structure of the game can result in slow conver-
gence.
However, we will make use of some of the tools which Stoltz and Lugosi have created.
In particular, they consider replacing the class of all measurable departure functions
with a smaller class, such as simple or continuous departure functions, and study when
this yields an equivalent equilibrium notion. One result of this type is stated as Lemma
2.11 below and used to prove our characterization theorems.
• Germano and Lugosi prove the existence of correlated equilibria with small support
in finite games [11]. To prove this they analyze the extreme points of the set of
correlated equilibria. Such an analysis cannot carry over directly to polynomial games
because the set of correlated equilibria of polynomial games may have extreme points
with arbitrarily large finite support or with infinite support [32]. Support bounds
for correlated equilibria of polynomial games are proven in [30] using similar tools,
but assuming a finitely supported Nash equilibrium is on hand as a starting point.
Since Nash equilibria are generally assumed to be harder to compute than correlated
equilibria, these results do not apply in the present setting where the goal is efficient
computation.
• Separately from the literature on correlated equilibria, Dresher, Karlin, and Shapley
study the structure of Nash equilibria in zero-sum games with polynomial or sepa-
rable (polynomial-like) utility functions. They show how to cast separable games as
finite-dimensional “convex games” by replacing the infinite-dimensional mixed strategy
spaces with finite-dimensional spaces of moments [9] and prove existence of equilibria
via fixed point arguments [8]. There always exist finitely supported equilibria in sep-
arable games as can be shown using the finite-dimensonality of the moment spaces.
4
The rich geometry of these spaces is studied in [17]. Most of these results as well as ad
hoc methods for computing equilibria in simple cases are summarized in Karlin’s book
[16]. The authors of the present paper study generalizations and extensions of these
results to nonzero-sum separable games in [31].
Second, our work is related to results from the optimization and computer science liter-
ature.
• Aumann showed that the set of correlated equilibria of a finite game is defined by
polynomially many (in the size of the payoff tables) linear inequalities [2]. However, it
was not clear whether this meant they could be computed in polynomial time. This
question was settled in the affirmative when Khachian proved that linear programs
could be solved in polynomial time; for an overview of this and other more efficient
algorithms, see [3]. Papadimitriou extends this result in [23], showing that correlated
equilibria can be computed efficiently in many classes of games for which the payoffs
can be written succinctly, even if the explicit payoff tables would be exponential in
size.
• The breakthrough in optimization most directly related to the work in this paper is
the development of semidefinite programming, a far-reaching generalization of linear
programming which is still polynomial-time solvable (for an overview, see the appendix
and [35]). More specifically, the development of sum of squares methods has allowed
many optimization problems involving polynomials or moments of measures to be
solved efficiently [24]. Parrilo applies these techniques to efficiently compute Nash
equilibria of two-player zero-sum polynomial games in [25].
The remainder of this paper is organized as follows. In Section 2 we define the classes
of games we study and correlated equilibria thereof, then prove several characterization
theorems. We present algorithms for approximating sample correlated equilibria and the set
of correlated equilibria of polynomial games in Section 3. Finally, we close with conclusions
and directions for future work.
2 Characterizations of Correlated Equilibria
In this section we will define finite and continuous games along with correlated equilibria
thereof. We will present several known characterizations of correlated equilibria in finite
games and show how these naturally extend to continuous games.
Some notational conventions used throughout are that subscripts refer to players, while
superscripts are frequently used for other indices (it will be clear from the context when they
represent exponents). If Sj are sets for j = 1, . . . , n then S = Π
n
j=1Sj and S−i = Πj 6=iSj.
The n-tuple s and the (n− 1)-tuple s−i are formed from the points sj similarly. The set of
regular Borel probability measures π over a compact Hausdorff space S is denoted by ∆(S).
For simplicity we will write π(s) in place of π({s}) for the measure of a singleton {s} ⊆ S.
All polynomials will be assumed to have real coefficients.
5
2.1 Finite Games
We start with the definition of a finite game.
Definition 2.1. A finite game consists of players i = 1, . . . , n, each of whom has a finite
pure strategy set Ci and a utility or payoff function ui : C → R, where C = Πnj=1Cj.
Each player’s objective is to maximize his (expected) utility. We now consider what it
would mean for the players to maximize their utility if their strategy choices were correlated.
Let R be a random variable taking values in C distributed according to some measure
π ∈ ∆(C). A realization of R is a pure strategy profile (a choice of pure strategy for
each player) and the ith component of the realization Ri will be called the recommendation
to player i. Given such a recommendation, player i can use conditional probability to form
a posteriori beliefs about the recommendations given to the other players. A distribution
π is defined to be a correlated equilibrium if no player can ever expect to unilaterally gain
by deviating from his recommendation, assuming the other players play according to their
recommendations.
Definition 2.2. A correlated equilibrium of a finite game is a joint probability measure
π ∈ ∆(C) such that if R is a random variable distributed according to π then
E [ui(ti, R−i)− ui(R)|Ri = si] ≡
∑
s−i∈C−i
Prob(R = s|Ri = si) [ui(ti, s−i)− ui(s)] ≤ 0
for all players i, all si ∈ Ci such that Prob(Ri = si) > 0, and all ti ∈ Ci.
While this definition captures the idea we have described above, the following character-
ization is easier to apply and visualize.
Proposition 2.3. A joint probability measure π ∈ ∆(C) is a correlated equilibrium of a
finite game if and only if ∑
s−i∈C−i
π(s) [ui(ti, s−i)− ui(s)] ≤ 0 (1)
for all players i and all si, ti ∈ Ci.
This proposition shows that the set of correlated equilibria is defined by a finite number
of linear equations and inequalities (those in (1) along with π(s) ≥ 0 for all s ∈ C and∑
s∈C π(s) = 1) and is therefore convex and even polyhedral. It can be shown via linear
programming duality that this set is nonempty [15]. This can be shown alternatively by
appealing to the fact that Nash equilibria exist and are the same as correlated equilibria
which are product distributions.
We can think of correlated equilibria as joint distributions corresponding to recommen-
dations which will be given to the players as part of an extended game. The players are then
free to play any function of their recommendation as their strategy in the game.
6
Definition 2.4. A function ζi : Ci → Ci is called a departure function.
If it is a Nash equilibrium of this extended game for each player to play his recommended
strategy (i.e. if no player has an incentive to unilaterally deviate from using the identity
departure function), then the distribution is a correlated equilibrium. This interpretation is
due to Aumann [2] and is justified by the following alternative characterization of correlated
equilibria.
Proposition 2.5. A joint probability measure π ∈ ∆(C) is a correlated equilibrium of a
finite game if and only if ∑
s∈C
π(s) [ui(ζi(si), s−i)− ui(s)] ≤ 0 (2)
for all players i and all departure functions ζi.
For examples and more discussion of the basics of correlated equilibria, including the
ideas behind the equivalence of these characterizations, see [1, 2].
2.2 Continuous Games
Again we begin with the definition of this class of games.
Definition 2.6. A continuous game consists of an arbitrary (possibly infinite) set I of
players i, each of whom has a pure strategy set Ci which is a compact Hausdorff space and
a utility function ui : C → R which is continuous.
Note that any finite set forms a compact Hausdorff space under the discrete topology
and any function out of such a set is continuous, so the class of continuous games includes
the finite games. Another class of continuous games are the polynomial games, which are
our primary focus when we study computation of correlated equilibria in the sections which
follow. The theorems and proofs below can safely be read with polynomial games in mind,
ignoring such topological subtleties as regularity of measures. However the extra generality of
arbitrary continuous games requires little additional work in the proofs of the characterization
theorems, so we will not formally restrict our attention to polynomial games here.
Definition 2.7. A polynomial game is a continuous game with n <∞ players in which the
pure strategy spaces are Ci = [−1, 1] for all players and the utility functions are polynomials.
Defining correlated equilibria in continuous games requires somewhat more care than in
finite games. Because of the technical difficulties of dealing with conditional distributions
on continuous spaces, it is preferable not to formulate our new definition by generalizing
Definition 2.2 directly. An obvious thing to try would be to replace the sum in Proposition
2.3 with an integral and to choose that as the definition of correlated equilibria in continuous
games. That would be simple enough, but this leads to a notion which is very weak and
uninformative. Since we would be integrating over “slices” our candidate definition would be
7
met, for example, by any continuous probability distribution regardless of the game chosen.
Thus we have to use a different approach.
The standard definition of correlated equilibria in continuous games (as used in [15])
instead follows Proposition 2.5. In this case we must add the additional assumption that the
departure functions be Borel1 measurable to ensure that the integrals are defined. For finite
games this assumption is vacuous so this definition is equivalent to Definition 2.2.
Definition 2.8. A correlated equilibrium of a continuous game is a joint probability
measure π ∈ ∆(C) such that∫
[ui(ζi(si), s−i)− ui(s)] dπ(s) ≤ 0
for all i and all Borel measurable departure functions ζi.
Before stating and proving alternative characterization theorems, we will discuss some of
the difficulties of working with correlated equilibria in continuous games and this definition
in particular. The goal here is to motivate the need for alternative characterizations.
The problem of computing Nash equilibria of polynomial games can be formulated ex-
actly as a finite-dimensional nonlinear program or as a system of polynomial equations and
inequalities [31]. The key feature of the problem which makes this possible is the fact that it
has an explicit finite-dimensional formulation in terms of the moments of the players’ mixed
strategies.
To see this, suppose that player 1 chooses his action x ∈ [−1, 1] according to a mixed
strategy σ (a probability distribution over [−1, 1]). Each player’s utility function is a mul-
tivariate polynomial which only contains terms whose degree in x is at most some constant
integer d. Then regardless of how everyone chooses their strategies, their expected utility
will only depend on σ through the moments
∫
x dσ(x),
∫
x2 dσ(x), . . . ,
∫
xd dσ(x). Therefore
player 1 can switch from σ to any other mixed strategy with the same first d moments with-
out affecting game play, and we can think of the Nash equilibrium problem as one in which
each player seeks to choose moments which correspond to an actual probability distribution
and form a Nash equilibrium.
On the other hand there is no exact finite-dimensional characterization of the set of
correlated equilibria in polynomial games; for a counterexample see [32]. Given the char-
acterization of Nash equilibria in terms of moments, a natural attempt would be to try to
characterize correlated equilibria in terms of the joint moments, i.e. the values
∫
sk11 · · · sknn dπ
for nonnegative integers ki and joint measures π. In fact we will be able to obtain such a
characterization below, albeit in terms of infinitely many joint moments. The reason this
attempt fails to yield a finite dimensional formulation is that the definition of a correlated
equilibrium implicitly imposes constraints on the conditional distributions of the equilibrium
measure. A finite set of moments does not contain enough information about these condi-
tional distributions to check the required constraints exactly. Therefore we also consider
approximate correlated equilibria.
1The Borel σ-algebra is the σ-algebra generated by the topology on Ci, which was assumed given in the
definition of a continuous game.
8
Definition 2.9. An �-correlated equilibrium of a continuous game is a joint probability
measure π ∈ ∆(C) such that∫
[ui(ζi(si), s−i)− ui(s)] dπ(s) ≤ �
for all i and all Borel measurable departure functions ζi. This definition reduces to that of
a correlated equilibrium when � = 0.
That is to say, �-correlated equilibria are distributions of recommendations in which
no player can improve his expected payoff by more than � by deviating from his recom-
mendation unilaterally. Compare this definition to the main characterization theorem for
�-correlated equilibria below (Theorem 2.10). This theorem shows that �-correlated equilib-
ria can equivalently be defined by integrating the utilities against any sufficiently rich class
of test functions, instead of by using measurable departure functions. Intuitively, the advan-
tage of this characterization is that the product fi(si)ui(ti, s−i) is a “simpler” mathematical
object than the composition ui(ζi(si), s−i), especially when fi, ti, and ζi are allowed to vary.
While this characterization does not have an obvious game theoretic interpretation, it allows
us to compute correlated equilibria both algorithmically (Section 3) and analytically [32].
There also exist a variety of characterizations in which the departure functions are re-
stricted to lie in a particular class (e.g., Lemma 2.11 below and similar results in [33]) and no
test functions are used. These characterizations have the advantages of conceptual simplic-
ity and ease of interpretation. However, any characterization involving departure functions
suffers from the difficulty that compositions of the utilities and the departure functions must
be computed and these will likely be complex even if the departure functions are restricted
to a simple class. The difficulty is magnified by the fact that even these restricted classes of
departure functions are large and often difficult to parametrize in a way which is amenable
to computation. Therefore it seems that departure function characterizations of correlated
equilibria cannot be applied directly to yield effective computational procedures.
Theorem 2.10. A probability measure π ∈ ∆(C) is an �-correlated equilibrium of a contin-
uous game if and only if for all players i, positive integers k, strategies t1i , . . . , t
k
i ∈ Ci, and
functions f 1i , . . . , f
k
i : Ci → [0, 1] in one of the classes
1. Weighted measurable characteristic functions,
2. Measurable simple functions (i.e., functions with finite range),
3. Measurable functions,
4. Continuous functions,
5. Squares of polynomials (if Ci ⊂ Rki for some ki for all i).
such that
∑k
j=1 f
j
i (si) ≤ 1 for all si ∈ Ci, the inequality
k∑
j=1
∫
f
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ ≤ � (3)
9
holds.
To prove this, we need several approximation lemmas.
Lemma 2.11 (A special case of Lemma 20 in [33]). Simple departure functions (those with
finite range) suffice to define �-correlated equilibria in continuous games. That is to say, a
joint measure π is an �-correlated equilibrium if and only if∫
[ui(ξi(si), s−i)− ui(s)] dπ(s) ≤ �
for all players i and all Borel measurable simple departure functions ξi.
Proof. The forward direction is trivial. To prove the reverse, first fix i. Then choose any
measurable departure function ζi and let δ > 0 be arbitrary. By the continuity of ui and
compactness of the strategy spaces there exists a finite open cover U1, . . . , Uk of Ci such
that si, s
′
i ∈ U j implies |ui(si, s−i) − ui(s′i, s−i)| < δ for all s−i ∈ C−i and j = 1, . . . , k. Fix
any s
j
i ∈ U
j for all j. Define a simple measurable departure function ξi by ξi(si) = s
j
i where
j = min{l : ζi(si) ∈ U l}. Then |ui(ζi(si), s−i)− ui(ξi(si), s−i)| < δ for all s ∈ C, so∫
[ui(ζi(si), s−i)− ui(s)] dπ(s) ≤
∫
[ui(ξi(si), s−i) + δ − ui(s)] dπ(s) ≤ �+ δ.
Letting δ go to zero completes the proof.
Lemma 2.12. If C is a compact Hausdorff space, µ is a finite regular Borel measure on C,
f 1, . . . , fk : C → [0, 1] are measurable functions such that
∑k
j=1 f
j ≤ 1, and δ > 0, then there
exist continuous functions g1, . . . , gk : C → [0, 1] such that µ({x ∈ C : f j(x) 6= gj(x)}) < δ
for all j and
∑k
j=1 g
j ≤ 1.
Proof. We can apply Lusin’s theorem which states exactly this result in the case k = 1 [28].
If k > 1, then we can apply the k = 1 case with δ
k
in place of δ to each of the f j. Call
the resulting continuous functions g̃j. Then µ({x ∈ C : f j(x) 6= g̃j(x) for some j}) < δ.
But
∑k
j=1 f
j ≤ 1, so µ({x ∈ C :
∑k
j=1 g̃
j(x) > 1}) < δ. Let h(x) = max{1,
∑k
j=1 g̃
j(x)} so
h : C → [1,∞) is a continuous map. Define gj(x) = g̃
j(x)
h(x)
. Then the gj are continuous, sum
to at most unity, and are equal to the f j wherever all of the g̃j equal the f j, i.e. except on
a set of measure at most δ.
Lemma 2.13. If C ⊂ Rd is compact, f 1, . . . , fk : C → [0, 1] are continuous functions such
that
∑k
j=1 f
j ≤ 1, and δ > 0, then there exist polynomials p1, . . . , pk : C → [0, 1] which are
squares such that |f j(x)− pj(x)| ≤ δ for all x ∈ C and
∑k
j=1 p
j ≤ 1.
Proof. By the Stone-Weierstrass theorem, any continuous function on a compact subset of
Rd can be approximated by a polynomial arbitrarily well with respect to the sup norm.
Approximating the square root of a nonnegative function f using this theorem and squaring
the resulting polynomial shows that a nonnegative continuous function on a compact subset
10
of Rd can be approximated arbitrarily well by a square of a polynomial with respect to the
sup norm.
Let p̃j be a square of a polynomial which approximates f j within δ
2k
in the sup norm.
Since f j takes values in [0, 1], p̃j takes values in
[
0, 1 + δ
2k
]
. Let pj = p̃
j
1+ δ
2
. Then for all
x ∈ C we have pj(x) ≤ p̃j(x) and
p̃j(x)− pj(x) = p̃j(x)−
p̃j(x)
1 + δ
2
= p̃j(x)
(
δ
2
1 + δ
2
)
≤
(
1 +
δ
2k
)( δ
2
1 + δ
2
)
≤
δ
2
,
so pj(x) is within δ
2
of p̃j(x) for all x ∈ C. By the triangle inequality pj approximates f j
within δ in the sup norm. Furthermore for all x ∈ C we have
k∑
j=1
pj(x) =
1
1 + δ
2
k∑
j=1
p̃j(x) ≤
1
1 + δ
2
k∑
j=1
(
f j(x) +
δ
2k
)
≤
1
1 + δ
2
(
1 +
δ
2
)
= 1.
Proof of Theorem 2.10. First we prove that if π is an �-correlated equilibrium then (3) holds
in the case where the f
j
i are simple. We can choose a partition B
1
i , . . . , B
l
i of Ci into disjoint
measurable sets such that f
j
i =
∑l
m=1 cjmχBmi where cjm ∈ [0, 1] and χBmi denotes the
indicator function which is unity on Bmi and zero elsewhere. Define a departure function
ζi : Ci → Ci piecewise on the Bmi as follows. If∫
Bmi ×C−i
[
ui(t
j
i , s−i)− ui(s)
]
dπ
is nonnegative for some j define ζi(si) = t
j
i for all si ∈ B
m
i where j is chosen to maximize
the above integral. If the integral is negative for all j define ζi(si) = si for all si ∈ Bmi . Then
we have
k∑
j=1
cjm
∫
Bmi ×C−i
[
ui(t
j
i , s−i)− ui(s)
]
dπ ≤
∫
Bmi ×C−i
[ui(ζi(si), s−i)− ui(s)] dπ
for all m. Summing over m and using the definition of an �-correlated equilibrium yields (3)
in the case where the f
j
i are simple.
Conversely suppose that (3) holds for all measurable simple functions. Let ζi : Ci → Ci
be any simple departure function. Let t1i , . . . , t
k
i be the range of ζi and B
j
i = ζ
−1
i ({t
j
i}).
Defining f
j
i = χBji
, (3) says exactly that π satisfies the �-correlated equilibrium condition for
the departure function ζi. By Lemma 2.11, π is an �-correlated equilibrium.
Any simple function can be written as a sum of weighted characteristic functions, so by
making several of the t
j
i the same, we see that (3) for weighted characteristic functions is
the same as (3) for simple measurable functions. If the inequality (3) holds for all simple
measurable functions, a standard limiting argument proves that it holds for all measurable
f
j
i , hence for all continuous f
j
i .
11
Suppose conversely that (3) holds for all continuous f
j
i . Fix any measurable f
j
i sat-
isfying the assumptions of the theorem. Define a signed measure π
j
i on Ci by π
j
i (Bi) =∫
Bi×C−i
[
ui(t
j
i , s−i)− ui(s)
]
dπ. Let µi =
∑k
j=1|π
j
i | and fix any δ > 0. Then by the Lemma
2.12 there exist continuous functions g
j
i : Ci → [0, 1] which sum to at most unity and equal
the f
j
i except on a set of µi measure at most δ. Therefore∣∣∣∣∣
k∑
j=1
∫
f
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ −
k∑
j=1
∫
g
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ
∣∣∣∣∣
≤
k∑
j=1
∫
|f ji (si)− g
j
i (si)| dπ
j
i ≤ 2kδ,
so
k∑
j=1
∫
f
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ ≤ �+ 2kδ.
But δ was arbitrary, so (3) holds for all measurable f
j
i .
Finally assume Ci ⊂ Rki for some ki. If (3) holds for all continuous f
j
i , then it holds for
all squares of polynomials. Suppose conversely that it holds for all squares of polynomials.
Let f
j
i be any continuous functions satisfying the assumptions of the theorem and δ > 0. Let
p
j
i be polynomials squares which approximate the f
j
i within δ in the sup norm and satisfy
the assumptions of the theorem, as provided by Lemma 2.13. Then∣∣∣∣∣
k∑
j=1
∫
f
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ −
k∑
j=1
∫
p
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ
∣∣∣∣∣
≤
k∑
j=1
∫
|f ji (si)− p
j
i (si)| dπ
j
i ≤ δ
k∑
j=1
∫
dπ
j
i ,
so
k∑
j=1
∫
f
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
dπ ≤ �+ δ
k∑
j=1
∫
dπ
j
i .
But δ was arbitrary and the integrals on the right are finite, so (3) holds for all continuous
f
j
i .
Several simplifications occur when specializing Theorem 2.10 to the � = 0 case, yielding
the following characterization. We will use the polynomial condition of this corollary in
Section 3.3 to develop algorithms for computing (approximate) correlated equilibria. The
characteristic function condition is used to compute extreme correlated equilibria of an ex-
ample game in [32].
12
Corollary 2.14. A joint measure π is a correlated equilibrium of a continuous game if and
only if ∫
fi(si) [ui(ti, s−i)− ui(s)] dπ(s) ≤ 0 (4)
for all i and ti ∈ Ci as fi ranges over any of the following sets of functions from Ci to [0,∞):
1. Characteristic functions of measurable sets,
2. Measurable simple functions,
3. Bounded measurable functions,
4. Continuous functions,
5. Squares of polynomials (if Ci ⊂ Rki for some ki for all i).
Proof. When � = 0 the k = 1 case of equation (3) implies the k > 1 cases. Furthermore
� = 0 makes (3) homogeneous, so it is unaffected by positive scaling of the f
j
i , which allows
us to drop the assumption fi ≤ 1.
Theorem 2.10 also has important topological implications for the structure of �-correlated
equilibria. Recall that the weak* topology on the set of probability distributions ∆(C) over
a compact Hausdorff space is the weakest topology which makes π 7→
∫
f dπ a continuous
functional whenever f : C → R is a continuous function.
Corollary 2.15. The set of �-correlated equilibria of a continuous game is weak* compact.
Proof. By the continuous test function condition in Theorem 2.10, the set of �-correlated
equilibria is defined by conditions of the form
∫
f dπ ≤ � where f ranges over continuous
functions of the form
∑k
j=1 f
j
i (si)
[
ui(t
j
i , s−i)− ui(s)
]
. By definition this presents the set of
�-correlated equilibria as the intersection of a family of weak* closed sets. Hence the set of �-
correlated equilibria is a closed subset of ∆(C). But ∆(C) is compact by the Banach-Alaoglu
theorem [29], so the set of �-correlated equilibria is compact.
Corollary 2.16. If πk is a sequence of �k-correlated equilibria and �k → 0, then the sequence
πk has a weak* limit point2 and any such limit point is a correlated equilibrium.
2It is important to note that here we use the term limit point to refer to a limit point of a sequence,
which is slightly different from a limit point of the underlying set of values which appear in the sequence.
The difference is essentially that the singleton set {π} has no limit points (in the sense of, say, [21]), but we
would like to say that π is a limit point of the constant sequence π, π, π, . . .. Rigorously, we say that π is a
limit point of the sequence π1, π2, π3, . . . if for any neighborhood U of π, there are infinitely many indices i
such that πi ∈ U . Equivalently (at least in a Hausdorff space) π is a limit point of the sequence if and only
if π appears infinitely often or π is a limit point of the underlying set {πk|k ∈ N}.
13
Proof. If there is some π such that πk = π for infinitely many k, then π is a limit point of the
sequence. Also π is an �k-correlated equilibrium for arbitrarily small �k, so it is a correlated
equilibrium and we are done. Otherwise, the sequence πk contains infinitely many points.
The space ∆(C) with the weak* topology is compact by the Banach-Alaoglu theorem [29],
hence any infinite set has a limit point. Let π ∈ ∆(C) be a limit point of the sequence πk.
For any � > 0 there exists k0 such that for all k ≥ k0, πk is an �-correlated equilibrium. The
set ∆(C) is Hausdorff [29], so π is also a limit point of the set {πk}k≥k0 . Since the set of
�-correlated equilibria is compact by Corollary 2.15, the limit point π must be an �-correlated
equilibrium for all � > 0, i.e. a correlated equilibrium.
Finally, we consider �-correlated equilibria which are supported on some finite subset.
In this case, we obtain another generalization of Proposition 2.3 which we will use in the
algorithms presented in Section 3.2.
Proposition 2.17. A probability measure π ∈ ∆(C̃), where C̃ = Πj∈IC̃j is a finite subset
of C, is an �-correlated equilibrium of a continuous game if and only if there exist �i,si such
that ∑
s−i∈C̃−i
π(s) [ui(ti, s−i)− ui(s)] ≤ �i,si
for all players i, all si ∈ C̃i, and all ti ∈ Ci, and∑
si∈C̃i
�i,si ≤ �
for all players i.
Proof. If we replace ti with ζi(si) in the first inequality then sum over all si ∈ C̃i and combine
with the second inequality, we get that∑
s∈C̃
π(s) [ui(ζi(si), s−i)− ui(s)] ≤ � (5)
holds for all i and any function ζi : C̃i → Ci. This is exactly the definition of an �-correlated
equilibrium in the case when π is supported on the finite set C̃.
Conversely if π satisfies (5) for all ζi : C̃i → Ci then let
�i,si = max
ti∈Ci
∑
s−i∈C̃−i
π(s) [ui(ti, s−i)− ui(s)] .
For each si ∈ C̃i, let ζi(si) be any ti ∈ Ci which achieves this maximum; such a ti exists
by compactness and continuity. Substituting this ζi into (5) shows that π satisfies the
assumptions of the theorem.
14
3 Computing Correlated Equilibria
We focus in this section on developing algorithms that can compute approximate correlated
equilibria with arbitrary accuracy. We consider three types of algorithms, which we will
illustrate in turn using the example below.
Example 3.1. Consider the polynomial game with two players, x and y, each choosing their
strategies from the interval Cx = Cy = [−1, 1]. Their utilities are given by
ux(x, y) = 0.596x
2 + 2.072xy − 0.394y2 + 1.360x− 1.200y + 0.554 and
uy(x, y) = −0.108x2 + 1.918xy − 1.044y2 − 1.232x+ 0.842y − 1.886.
The coefficients have been selected at random. This example is convenient, because as Figure
3 shows, the game has a unique correlated equilibrium (the players choose x = y = 1 with
probability one). For the purposes of visualization and comparison, we will project the
computed equilibria and approximations thereof into expected utility space, i.e. we will plot
pairs
(∫
ux dπ,
∫
uy dπ
)
.
3.1 Static Discretization Methods
The static discretization methods we present here are slow in practice and should be taken
as a benchmark against which to compare the methods of later sections. The techniques in
this section are general enough to apply to arbitrary continuous games with finitely many
players, so we will not restrict our attention to polynomial games here.
The basic idea of static discretization methods is to select some finite subset C̃i ⊂ Ci of
strategies for each player and limit his strategy choice to that set. Restricting the utility
functions to the product set C̃ = Πni=1C̃i produces a finite game, called a sampled game or
sampled version of the original continuous game. The simplest computational approach is
then to consider the set of correlated equilibria of this sampled game. This set is defined by
the linear inequalities in Proposition 2.3 along with the conditions that π be a probability
measure on C̃. The complexity of this approach in practice depends on the number of points
in the discretization.
The question is then: what kind of approximation does this technique yield? In general
the correlated equilibria of the sampled game may not have any relation to the set of corre-
lated equilibria of the original game. The sampled game could, for example, be constructed
by selecting a single point from each strategy set, in which case the unique probability mea-
sure over C̃ is automatically a correlated equilibrium of the sampled game but is a correlated
equilibrium of the original game if and only if the points chosen form a pure strategy Nash
equilibrium. Nonetheless, it seems intuitively plausible that if a large number of points were
chosen such that any point of Ci were near a point of C̃i then the set of correlated equilibria
of the finite game would be “close to” the set of correlated equilibria of the original game in
some sense, despite the fact that each set might contain points not contained in the other.
To make this precise, we will show how to choose a discretization so that the correlated
equilibria of the finite game are �-correlated equilibria of the original game.
15
Proposition 3.2. Consider a continuous game with finitely many players, strategy sets Ci,
and payoffs ui. For any � > 0, there exists a finite open cover U
1
i , . . . , U
li
i of Ci such that if
C̃i ⊆ Ci is a finite set chosen to contain at least one point from each U li , then all correlated
equilibria of the finite game with strategy spaces C̃i and utilities ui|C̃ will be �-correlated
equilibria of the original game.
Proof. Note that the utilities are continuous functions on a compact set, so for any � > 0
we can choose a finite open cover U1i , . . . , U
li
i such that if si varies within one of the U
l
i and
s−i ∈ C−i is held fixed, the value of ui changes by no more than �. Let C̃ satisfy the stated
assumption and let π be any correlated equilibrium of the corresponding finite game. Then
by Proposition 2.3, ∑
s−i∈C̃−i
π(s) [ui(ti, s−i)− ui(s)] ≤ 0
for all i and all si, ti ∈ C̃i. Any ti ∈ Ci belongs to the same U li as some t̃i ∈ C̃i, so∑
s−i∈C̃−i
π(s) [ui(ti, s−i)− ui(s)] ≤
∑
s−i∈C̃−i
π(s)
[
ui
(
t̃i, s−i
)
− ui(s) + �
]
≤ �
∑
s−i∈C̃−i
π(s) = �.
Therefore the assumptions of Proposition 2.17 are satisfied with �i,si = �
∑
s−i∈C̃−i π(s).
Though our primary goal here is to compute correlated equilibria, not prove existence, it is
worth noting that Proposition 3.2, Corollary 2.16, and the existence of correlated equilibria
in finite games [15] combine to prove the existence of correlated equilibria in continuous
games with finitely many players. Indeed, this is proven in [15] (along with the extension to
an arbitrary set of players) with an argument along similar lines. One can view much of the
contents of the present paper up to this point as expanding on this argument from [15].
The proof of Proposition 3.2 shows that if the utilities are Lipschitz functions, such as
polynomials, then the U li can in fact be chosen to be balls with radius proportional to �. If
the strategy spaces are Ci = [−1, 1] as in a polynomial game, then C̃i can be chosen to be
uniformly spaced within [−1, 1]. In this case � = O
(
1
d
)
where d = maxi
∣∣∣C̃i∣∣∣.
Example 3.1 (continued). Figure 1 is a sequence of static discretizations for this game for
increasing values of d, where d is the number of points in C̃x and C̃y. These points are
selected by dividing [−1, 1] into d subintervals of equal length and letting C̃x = C̃y be the
set of midpoints of these subintervals. For this game it is possible to show that the rate of
convergence is in fact Θ
(
1
d
)
so the worst case bound on convergence rate is achieved in this
example.
In fact we can improve this convergence rate to � = O
(
1
d2
)
if we include the endpoints
±1 in C̃i as well and assume that the utilities have bounded second derivatives. We omit
the proof for brevity.
16
2.5 2.6 2.7 2.8 2.9 3
−1.62
−1.6
−1.58
−1.56
−1.54
−1.52
−1.5
−1.48
u
x
u
y
Static Discretization Correlated Equilibrium Payoffs for d = 10 to 50 (d = strategies / player)
d = 10
d = 15
d = 20
d = 25
d = 30
d = 35
d = 40
d = 50
d = 45
Exact correlated
equilibrium payoff
Figure 1: Computing a sequence of �-correlated equilibria of the game in Example 3.1 by
static discretization. Each point represents the (unique) correlated equilibrium of the finite
game where players are restricted to strategies chosen from a finite set of d strategies equally
spaced in [−1, 1]. The axes represent the utilities received by players x and y. It can be
shown that the convergence in this example happens at a rate � = Θ
(
1
d
)
. This is slow
enough that it is not obvious visually that the sequence of points is converging to the exact
correlated equilibrium payoff, though we can prove that it is (e.g., by combining Proposition
3.2 with Figure 3, which shows that the equilibrium payoff is unique).
17
3.2 Adaptive Discretization Methods
3.2.1 A family of convergent adaptive discretization algorithms
In this section we consider continuous games with finitely many players and provide two
algorithms (the second is in fact a parametrized family of algorithms which generalizes
the first) to compute a sequence of �k-correlated equilibria such that limk→∞ �
k = 0. By
Corollary 2.16 any limit point of this sequence is a correlated equilibrium. We will show that
for polynomial games these algorithms can be implemented efficiently using semidefinite
programming.
Informally, these algorithms work as follows. Each iteration k begins with a finite set
C̃ki ⊆ Ci of strategies which each player i is allowed to play with positive probability in that
iteration; the initial choice of this set at iteration k = 0 is arbitrary. We then compute the
“best” �-correlated equilibrium in which players are restricted to use only these strategies,
i.e., the one which minimizes � (subject to some extra technical conditions needed to ensure
convergence).
Given the optimal objective value �k and optimal probability distribution πk, there is some
player i who can improve his payoff by �k if he switches from his recommended strategies to
certain other strategies. We interpret these other strategies as good choices for that player
to use to help make �k smaller in later iterations k. Therefore we add these strategies to C̃ki
to get C̃k+1i and repeat this process for iteration k + 1.
Algorithm 3.3. Fix a continuous game with finitely many players. Let k = 0 and for each
player fix a finite subset C̃0i ⊆ Ci.
• Let πk be an �k-correlated equilibrium of the game having minimal �k subject to two
extra conditions. First, πk must be supported on C̃k. Second, we require that πk be
an exact correlated equilibrium of the finite game induced when deviations from the
recommended strategies are restricted to the set C̃k, i.e. when we replace the condition
ti ∈ Ci in Proposition 2.17 with ti ∈ C̃ki .
That is to say, let �k be the optimal value of the following optimization problem, and
πk be an optimal assignment to the decision variables.
minimize �
subject to∑
s−i∈C̃k−i
π(s) [ui(ti, s−i)− ui(s)] ≤ 0 for all i and si, ti ∈ C̃ki∑
s−i∈C̃k−i
π(s) [ui(ti, s−i)− ui(s)] ≤ �i,si for all i, si ∈ C̃ki and ti ∈ Ci∑
si∈C̃ki
�i,si ≤ � for all i
π(s) ≥ 0 for all s ∈ C̃∑
s∈C̃k
π(s) = 1
18
• If �k = 0, terminate.
• For each player i for whom
∑
si∈C̃ki
�i,si = �, form C̃
k+1
i from C̃
k
i by adding in, for each
si ∈ C̃ki such that �i,si > 0, at least one strategy ti which makes∑
s−i∈C̃k−i
π(s) [ui(ti, s−i)− ui(s)] = �i,si .
• For all other players i, let C̃k+1i = C̃
k
i .
• Let k = k + 1 and repeat.
Note that all steps of this algorithm are well-defined. First, the optimization problem
is feasible. To see this let πk be any exact correlated equilibrium of the finite game with
strategy spaces C̃ki and utilities ui restricted to C̃
k; such an equilibrium exists because all
finite games have correlated equilibria [15]. The ui are bounded on C (being continuous
functions on a compact set), so by making � and the �i,si large, we see that π
k is a feasible
solution of the problem.
Second, the optimal objective value is achieved by some πk because the space of prob-
ability measures on C̃k is compact, the constraints are closed, and � is bounded below by
zero.
Third, the set of new strategies added in the third bullet is nonempty. Suppose for a
contradiction that this set were empty for each i such that
∑
si∈C̃ki
�i,si = � and each si ∈ C̃ki
such that �i,si > 0. By continuity of ui and compactness of Ci, the left-hand side of the
�-correlated equilibrium constraint achieves its maximum as a function of ti ∈ Ci. If this
maximum value were less than �i,si , then the value of �i,si could be decreased. If this could
be done for all i such that
∑
si∈C̃ki
�i,si = � then � itself could be decreased, contradicting
optimality of πk.
Fourth, this set of new strategies added in the third bullet consists only of strategies which
are not in C̃ki because we have the constraint that the deviations in utility be nonpositive
for ti ∈ C̃ki .
To show that Algorithm 3.3 converges, we will view it as a member of the following
family of algorithms with the parameters set to α = 0 and β = 1. Varying these parameters
corresponds to adding some slack in the exact correlated equilibrium constraints and allowing
some degree of suboptimality in the choice of strategies added to C̃ki to form C̃
k+1
i . Such
changes make little conceptual difference, but could be helpful in practice by making the
optimization problem strictly feasible and allowing it to be solved to within a known fraction
of the optimal objective value rather than all the way to optimality. We will prove that all
algorithms in this family converge, that is, with these algorithms �k converges to zero in the
limit.
Algorithm 3.4. Fix a continuous game with finitely many players and parameters 0 ≤ α <
β ≤ 1. Let k = 0 and for each player fix a finite subset C̃0i ⊆ Ci.
19
• Choose �k to be the smallest number for which there exists πk such that:
– πk is a probability distribution supported on C̃k,
– πk is an �k-correlated equilibrium of the game,
– πk is not an �-correlated equilibrium for any � < �k,
– πk is an α�k-correlated equilibrium of the game when strategy deviations are re-
stricted to C̃k (i.e., when the condition ti ∈ Ci is changed to ti ∈ C̃ki in Proposition
2.17).
• If �k = 0, terminate.
• For at least one value of i, form C̃k+1i from C̃
k
i by adding strategies ti,si ∈ Ci such that∑
s∈C̃k
πk(s) [ui(ti,si , s−i)− ui(s)] ≥ β�
k.
• For all other values of i, let C̃k+1i = C̃
k
i .
• Let k = k + 1 and repeat.
Proposition 3.5. The steps of Algorithm 3.4 are well-defined.
Proof. It is not immediately obvious that the first step of the algorithm is well-defined, i.e.,
that a minimal �k (or any �k for that matter) satisfying these conditions exists. To see this let
πk,1 be an exact correlated equilibrium of the finite game induced when strategy deviations
are restricted to C̃k, and let �k,1 ≥ 0 be the smallest value such that πk,1 is an �k,1-correlated
equilibrium. Then the pair (πk,1, �k,1) satisfies the four conditions under the first bullet
above. This shows that the set of �k values satisfying these conditions is nonempty.
Choose some sequence (πk,l, �k,l), l = 1, 2, . . ., of pairs satisfying these conditions such
that the limit �k = liml→∞ �
k,l is the infimum over all �k values of pairs satisfying these
conditions. Passing to a subsequence if necessary we can assume without loss of generality
that the πk,l converge to some πk. It is clear from the proof of Corollary 2.16 that πk is
an �k-correlated equilibrium supported on C̃k which is an α�k-correlated equilibrium when
deviations are restricted to C̃k.
From Proposition 2.17 we see that for a fixed support C̃k, the minimal value of � for which
a probability measure π on C̃k is a correlated equilibrium of the game varies continuously
with the probabilities π(s) for s ∈ C̃k. Therefore πk is not an �-correlated equilibrium for
any � < �k. Note that this final step depends crucially on the fact that C̃k is finite and
fixed while l varies. Also note that this subtlety disappears if α = 0 because in that case
it wouldn’t matter if the limiting distribution had a smaller � value. It is clear that the
remaining steps of the algorithm are well-defined.
Theorem 3.6. Fix a continuous game with finitely many players. Algorithms 3.3 and 3.4
converge to the set of correlated equilibria, i.e., they converge in the sense that �k → 0.
20
Proof. Suppose not, so there exists � > 0 and infinitely many values of k such that �k ≥ �. For
each i let B1i , . . . , B
li
i be a finite open cover of Ci such that ui(si, s−i)−ui(ti, s−i) ≤
1
2
(β−α)�
when si and ti belong to the same set B
l
i and s−i ∈ C−i. Such a cover exists by the
compactness of the Ci and the continuity of the ui. There are finitely many sets B
l
i so there
is some iteration k, which we can take to satisfy �k ≥ �, such that for all i all of the sets Bli
which will ever contain an element of C̃ki at some iteration k already do.
Note that πk is an α�k-correlated equilibrium when strategy choices are restricted to C̃ki ,
and �k > 0 so we have β�k > α�k. By the minimality of �k, the set C̃k+1i \ C̃
k
i is nonempty for
some player i (that is to say, it is always possible to perform the third step of the algorithm).
Choose such an i and ti,si ∈ C̃
k+1
i which satisfy∑
s∈C̃k
πk(s) [ui(ti,si , s−i)− ui(s)] ≥ β�
k.
By assumption, for any choice of ri,si ∈ C̃ki we have∑
s∈C̃k
πk(s) [ui(ri,si , s−i)− ui(s)] ≤ α�
k,
so ∑
s∈C̃k
πk(s) [ui(ti,si , s−i)− ui(ri,si , s−i)] ≥ (β − α)�
k.
By construction of k, we can choose ri,si ∈ C̃ki to lie in the same set Bli as ti,si for each
si ∈ C̃ki . Thus
(β − α)� ≤ (β − α)�k
≤
∣∣∣∣∣∣
∑
s∈C̃k
πk(s) [ui(ti,si , s−i)− ui(ri,si , s−i)]
∣∣∣∣∣∣
≤
∑
s∈C̃k
πk(s) |ui(ti,si , s−i)− ui(ri,si , s−i)|
≤
∑
s∈C̃k
πk(s)
(β − α)�
2
=
(β − α)�
2
,
a contradiction.
Now we will illustrate Algorithm 3.3 on two examples.
Example 3.1 (continued). In Figure 2 we illustrate Algorithm 3.3 initialized with C̃0x = C̃
0
y =
{0}. In this case convergence is obtained in three iterations, significantly faster than the
static discretization method. The resulting strategy sets were C̃2x = C̃
2
y = {0, 1}.
21
0.5 1 1.5 2 2.5 3
!3.5
!3
!2.5
!2
!1.5
!1
u
x
u y
Adaptive Discretization !!Correlated Equilibrium Payoffs
2nd iteration
! = 1.716
1st iteration
! = 1.956
3rd iteration
! = 4.163× 10!9
(exact correlated equilibrium)
Figure 2: Convergence of Algorithm 3.3 (note the change in scale from Figure 1). At each
iteration, the expected utility pair is plotted along with the computed value of � for which
that iterate is an �-correlated equilibrium of the game. In this case convergence to � = 0 (to
within numerical error) occurred in three iterations.
22
k �k C̃kx \ C̃k−1x C̃ky \ C̃k−1y C̃kz \ C̃k−1z
0 0.99 {0} {0} {0}
1 4.16 {0.89}
2 5.76 {−1}
3 0.57 {1}
4 0.28 {0.53} {0.50, 0.63}
5 0.16 {0.49, 0.70}
6 10−7 {−1, 0.60} {−0.60, 0.47}
Table 2: Output of Algorithm 3.3 on a three player polynomial game with utilities of degree
4 and randomly chosen coefficients.
Example 3.7. For a more complex illustration, we consider a polynomial game with three
players, choosing strategies x, y, and z ∈ [−1, 1]. The utilities were chosen to be polynomials
with terms up to degree 4 in all the variables and the coefficients were chosen independently
according to a normal distribution with zero mean and unit variance (their actual values are
omitted). Algorithm 3.3 proceeds as in Table 2, which shows the value of �k and the new
strategies added on each iteration. The terminal probability distribution π6 does not display
any obvious structure; in particular it is not a Nash equilibrium (product distribution).
3.2.2 Implementing these algorithms with semidefinite programs
To implement these algorithms for polynomial games, we must be able to do two things.
First, we need to solve optimization problems with finitely many decision variables, linear
objective functions and two types of constraints: nonnegativity constraints on linear func-
tionals of the decision variables, and nonnegativity constraints on univariate polynomials
whose coefficients are linear functionals of the decision variables. That is to say, we must be
able to handle constraints of the form p(t) ≥ 0 for all t ∈ [−1, 1], where the coefficients of
the polynomial p are linear in the decision variables. Second, we need to extract values of t
for which such polynomial inequalities are tight at the optimum.
Both of these tasks can be done simultaneously by casting the problem as a semidefinite
program (SDP). For an overview of semidefinite programs and a summary of the necessary
results (both of which are classical), see the appendix.
In the optimization problem in Algorithm 3.3 we have a finite number of univariate
polynomials in ti whose coefficients are linear in the decision variables π(s) and �i,si . We
wish to constrain these coefficients to allow only polynomials which are nonnegative for all
ti ∈ [−1, 1]. By Propositions A.3 and A.4 in the appendix this is the same as asking that
these coefficients equal certain linear functions of matrices (i.e., sums along antidiagonals)
which are constrained to be symmetric and positive semidefinite. Therefore we can write
this optimization problem as a semidefinite program.
As a special case of convex programs, semidefinite programs have a rich duality theory
which is useful for theoretical and computational purposes. In particular, SDP solvers keep
23
a b c
a 0 1 0
b 1 5 7
c 0 7 0
Table 3: A finite symmetric game with identical utilities for which Algorithm 3.4 with
α = β = 1 does not converge when started with strategy sets C̃01 = C̃
0
2 = {a}.
track of feasible primal and dual solutions in order to determine when optimality is reached.
It can be shown that the dual data obtained by an SDP solver run on this optimization
problem will encode the values of ti making the polynomial inequalities tight at the optimum
[24].
The process of generating an SDP from the optimization problem in the algorithms above,
solving it, and extracting an optimal solution along with ti values from the dual can all be
automated. We have done so using the SOSTOOLS MATLAB toolbox for the pre- and
post-processing and SeDuMi for solving the semidefinite programs efficiently [26, 34].
3.2.3 A nonconvergent limiting case
Note that in the algorithms above the convergence of the sequence �k is not necessarily
monotone. If we were to let α = β (a case we did not allow above), the sequence would
become monotone nonincreasing. If we were to furthermore fix α = β = 1, then the condition
that π be an exact (or α�k-) correlated equilibrium when deviations are restricted to C̃ki would
become redundant and could be removed.
These changes would simplify the behavior of Algorithm 3.4 conceptually as well as
reducing the size of the SDP solved at each iteration, so we would like to adopt them if
possible. However, the resulting algorithm may not converge, in the sense that �k may
remain bounded away from zero.
Example 3.8. Consider the game shown in Table 3, which is symmetric and has identical
utilities for both players. Let C̃01 = C̃
0
2 = {a} and apply Algorithm 3.3, but remove the
condition that πk be an exact correlated equilibrium when deviations are restricted to C̃ki .
The only probability distribution supported on C̃0 is δ(a,a) which has an objective value of
�0 = 1. It is easy to see that C̃1i is formed by simply adding each player’s best response to
a, so that C̃11 = C̃
1
2 = {a, b}. We will argue that the unique solution to the optimization
problem in iteration k = 1 is also δ(a,a), hence C̃
2
i = C̃
1
i and the algorithm gets “stuck”, so
that �k = �0 = 1 for all k.
For a probability distribution π, let πT denote π with the players interchanged. By
symmetry and convexity, if π is an optimal solution then so is π+π
T
2
, which is a symmetric
probability distribution with respect to the two players. Hence an optimal solution which
is symmetric always exists. We will parametrize such distributions by π = pδ(a,a) + qδ(a,b) +
qδ(b,a) + rδ(b,b), where p, q, r ≥ 0 and p+ 2q+ r = 1. Define a departure function ζ : C1 → C1
by ζ(a) = b, ζ(b) = ζ(c) = c. Then for π to be an �-correlated equilibrium it must satisfy
24
k �k C̃kx \ C̃k−1x C̃ky \ C̃k−1y
0 2 {−1} {−1}
1 4 {0} {0}
2 0 {1} {1}
Table 4: Output of Algorithm 3.3 for a polynomial game on which Algorithm 3.4 with
α = β = 1 does not converge to a correlated equilibrium.
the following condition:
� ≥
∑
s1∈C̃11
�1,s1 ≥
∑
s∈C̃1
π(s) [u1(ζ(s1), s2)− u1(s1, s2)]
= p+ 4q − q + 2r = 1 + q + r.
We know we can achieve � = 1 with p = 1 (i.e. π = π0 = δ(a,a)), and this inequality
shows that if p < 1 then � > 1. Therefore the minimal � value in iteration k = 1 is
unity and is achieved by π = δ(a,a). Furthermore we have shown that this is the unique
symmetric probability distribution which achieves the minimal value of �. Hence any other
(not necessarily symmetric) optimal solution π̂ satisfies π̂+π̂
T
2
= δ(a,a). But δ(a,a) is an extreme
point of the convex set of probability distributions on C̃1, so we must in fact have π̂ = δ(a,a).
Therefore π1 = π0 = δ(a,a) is the unique optimal solution on iteration k = 1, so the procedure
must get stuck as claimed. That is, C̃ki = {a, b} and �k = 1 for all k ≥ 1.
The same behavior can occur in polynomial games, as can be shown by “embedding” the
above finite game in a polynomial game. For example, we can take Cx = Cy = [−1, 1] and
ux(x, y) = uy(x, y) = (1− x2)(3y2 + 6y + 5)
+ (1− y2)(3x2 + 6x+ 5).
Then if C̃0x = C̃
0
y = {−1} the same analysis as above shows that C̃kx = C̃ky = {−1, 0} and
�k = 2 for all k ≥ 1.
Example 3.9. If we run Algorithm 3.3 on this polynomial game, the iterations proceed as in
Table 4. The correlated equilibrium obtained in iteration 2 is
π2 = 0.4922δ(x = 0, y = 1) + 0.4922δ(x = 1, y = 0)
+ 0.0156δ(x = 1, y = 1),
i.e., a probability of 0.4922 is assigned to each of the outcomes (x, y) = (0, 1) and (x, y) =
(1, 0) and a probability of 0.0156 is assigned to (x, y) = (1, 1).
3.3 Moment Relaxation Methods
In this section we again consider only polynomial games. The moment relaxation meth-
ods for computing correlated equilibria have a different flavor from the discretization meth-
25
ods discussed above. Instead of using tractable finite approximations of the correlated equi-
librium problem derived via discretizations, we begin with the alternative exact characteri-
zation given in condition 5 of Corollary 2.14. In particular, a measure π on C is a correlated
equilibrium if and only if ∫
p2(si) [ui(ti, s−i)− ui(s)] dπ(s) ≤ 0 (6)
for all i, ti ∈ Ci, and polynomials p. If we wish to check all these conditions for polynomials
p of degree less than or equal to d, we can form the matrices
Sdi =
1 si s
2
i · · · sdi
si s
2
i s
3
i · · · s
d+1
i
s2i s
3
i s
4
i · · · s
d+2
i
...
...
...
. . .
...
sdi s
d+1
i s
d+2
i · · · s
2d
i
.
Let c be a column vector of length d + 1 whose entries are the coefficients of p, so p2(si) =
c′Sdi c. If we define
Mdi (ti) =
∫
Sdi [ui(ti, s−i)− ui(s)] dπ(s),
then (6) is satisfied for all p of degree at most d if and only if c′Mdi (ti)c ≤ 0 for all c ∈ Rd+1
and ti ∈ Ci, i.e. if and only if Mdi (ti) is negative semidefinite for all ti ∈ Ci.
The matrix Mdi (ti) has entries which are polynomials in ti with coefficients which are
linear in the joint moments of π. By Proposition A.5 in the appendix, Mdi (ti) is negative
semidefinite for all ti ∈ [−1, 1] for a given d and a fixed π if and only if there exists a
certificate of a certain form proving this condition holds. We can write a semidefinite program
(again, see Proposition A.5 in the appendix) in which the decision variables represent such a
certificate, so we can check this condition by solving the semidefinite program. As d increases
we obtain a sequence of semidefinite relaxations of the correlated equilibrium problem and
these converge to the exact condition for a correlated equilibrium. That is to say, for a
measure to be a correlated equilibrium it is necessary and sufficient that its moments be
feasible for all of these semidefinite programs.
We can also let the measure π vary by replacing the moments of π with variables and
constraining these variables to satisfy some necessary conditions for the moments of a joint
measure on C (see appendix). These conditions can be expressed in terms of semidefinite
constraints and there is a sequence of these conditions which converges to a description
of the exact set of moments of a joint measure π. Thus we obtain a nested sequence of
semidefinite relaxations of the set of moments of measures which are correlated equilibria,
and this sequence converges to the set of correlated equilibria.
Example 3.1 (continued). Figure 3 shows moment relaxations of orders d = 0, 1, and 2. Since
moment relaxations are outer approximations to the set of correlated equilibria (having been
defined by necessary conditions which correlated equilibria must satisfy) and the 2nd order
26
0.5 1 1.5 2 2.5 3
−2.6
−2.4
−2.2
−2
−1.8
−1.6
−1.4
−1.2
−1
−0.8
−0.6
u
x
u
y
Moment Relaxation Correlated Equilibrium Payoffs of Order d = 0, 1, and 2
0th order
1st order
2nd order
(unique payoffs)
Figure 3: Semidefinite relaxations approximating the set of correlated equilibrium payoffs.
The second order relaxation is a singleton, so this game has a unique correlated equilibrium
payoff (and in fact a unique correlated equilibrium).
moment relaxation corresponds to a unique point in expected utility space, all correlated
equilibria of the example game have exactly this expected utility. In fact, the set of points in
this relaxation is a singleton (even before being projected into utility space), so this proves
that this example game has a unique correlated equilibrium.
4 Future Work
These results leave several open questions. For any continuous game, the set of correlated
equilibria is nonempty, and this can be proven constructively as in [15]. Under the same as-
sumptions we can prove the existence of a Nash equilibrium, but the proof is nonconstructive,
or at least does not seem to give an efficient algorithm for constructing an equilibrium [31]. In
the case of polynomial games, existence of a Nash equilibrium immediately gives existence of
a finitely supported Nash equilibrium by Carathéodory’s theorem, which is constructive [31].
Therefore there exists a finitely supported correlated equilibrium of any polynomial game. Is
there a constructive way to prove this fact directly, without going through Nash equilibria?
Such a proof could potentially lead to a provably efficient algorithm for computing a sample
correlated equilibrium of a polynomial game.
While the adaptive discretization and moment relaxation algorithms converge in general
and work well in practice, we do not know of any results regarding rate of convergence. If
27
we regard the probability distributions produced by these algorithms at the kth iteration as
�k-correlated equilibria, how fast does �k converge to zero?
Finally, we note that we have merely shown that the adaptive discretization algorithm
converges to the set of correlated equilibria, not to a particular correlated equilibrium (of
course it will do so along some subsequence by compactness). Could the algorithm be
modified to converge to a single correlated equilbrium? Or even better, could one assure
convergence to a correlated equilibrium with some desirable properties, such as one which
maximizes the social welfare or (in the polynomial case) is finitely supported? This seems
plausible given that the algorithm is itself optimization-based, but these problems remain
open.
Acknowledgements
The authors would like to thank Professor Muhamet Yildiz for a productive discussion which
led to an early formulation of the characterization theorems in Section 2 as well as the
moment relaxation methods presented in Section 3.3. Figures were produced using the
SeDuMi package for MATLAB [34].
A Semidefinite programming, sums of squares, and
moments of measures
Definition A.1. A semidefinite program is an optimization problem of the form:
minimize L(S)
subject to T (S) = v
S is a symmetric matrix
S � 0 (positive semidefinite),
where L is a given linear functional, T is a given linear transformation, v is a given vector,
and S is a square matrix of decision variables.
Semidefinite programs are convex optimization problems and generalize linear programs
(T and v can be designed to make S diagonal, in which case the condition S � 0 is the same
as the condition that S ≥ 0 elementwise). The solution set of a semidefinite program need
not be polyhedral, allowing for much more flexibility in modeling than can be achieved with
linear programs. Many problems can be expressed exactly or approximately as semidefinite
programs, and this is important because semidefinite programs can be solved efficiently by
interior point methods. For details and a variety of examples see [35] and [24].
The square of a real-valued function is nonnegative on its entire domain, as is a sum of
squares of real-valued functions. In particular, any polynomial of the form p(x) =
∑
p2k(x),
where pk are polynomials, is guaranteed to be nonnegative for all x. This gives a sufficient
condition for a polynomial to be nonnegative. It is a classical result that this condition is
also necessary if p is univariate [27].
28
Proposition A.2. A univariate polynomial p is nonnegative on R if and only if it is a sum
of squares.
Proof. A simpler version of the proof of the following proposition.
Proposition A.3 (Markov-Lukács [18]). A univariate polynomial p(x) is nonnegative on
the interval [−1, 1] if and only if p(x) = s(x) + (1− x2)t(x) where s and t are both sums of
squares of polynomials.
Proof. Direct algebraic manipulations show that the set of polynomials of the form s(x)+(1−
x2)t(x) where s and t are sums of squares of polynomials in x is closed under multiplication
and contains all polynomials of the following forms: a for a ≥ 0, (x − a)2 + b2 for a, b ∈ R,
x− a for a ≤ −1, and a− x for a ≥ 1. By assumption p(x) factors as a product of terms of
these types, because any real root of p in the interval (−1, 1) must have even multiplicity.
These sum of squares conditions are easy to express using linear equations and semidefi-
nite constraints.
Proposition A.4. A univariate polynomial p(x) =
∑2d
k=0 pkx
k of degree at most 2d is a sum
of squares of polynomials if and only if there exists a symmetric positive semidefinite matrix
Q ∈ R(d+1)×(d+1) such that pk =
∑
i+j=kQij (numbering the rows and columns of Q from 0
to d).
Proof. Relating the coefficients of p(x) to the entries of Q in this way is the same as writing
p(x) = xTQx where x =
[
1 x x2 · · · xd
]T
. Thought of in this way, saying that p(x) is
a sum of squares is the same as saying that Q =
∑
i qiq
T
i for some column vectors qi and
in this case Q is clearly positive semidefinite. Conversely, if Q is positive semidefinite then
there exists a matrix F such that Q = F TF , so p(x) = xTQx =
∑
i [Fx]
2
i .
Similar semidefinite characterizations exist for multivariate polynomials to be sums of
squares. While the condition of being a sum of squares does not characterize general non-
negative multivariate polynomials exactly, there exist sequences of sum of squares relaxations
which can approximate the set of nonnegative polynomials (on e.g. Rk, [−1, 1]k, or a more
general semialgebraic set) arbitrarily tightly [27]. Furthermore, for some special classes of
multivariate polynomials, the sum of squares condition is exact.
Proposition A.5. A matrix M(t) whose entries are univariate polynomials in t is positive
semidefinite on [−1, 1] if and only if x′M(t)x = S(x, t) + (1− t2)T (x, t) where S and T are
polynomials which are sums of squares.
Proof. Follows from Theorem 5.6 of [5].
Now suppose we wish to answer the question of whether a finite sequence (µ0, . . . , µk) of
reals correspond to the moments of a measure on [−1, 1], i.e. whether there exists a positive
measure µ on [−1, 1] such that µi =
∫
xi dµ(x). Clearly if such a measure exists then we
must have
∫
p(x) dµ(x) ≥ 0 for any polynomial p of degree at most k which is nonnegative
on [−1, 1]. This necessary condition for moments to correspond to a measure turns out to
be sufficient [17] and can be written in terms of semidefinite constraints.
29
Proposition A.6. The condition that a finite sequence of numbers (µ0, . . . , µk) be the mo-
ments of a positive measure on [−1, 1] can be written in terms of linear equations and semidef-
inite matrix constraints.
One can formulate similar questions about whether a finite sequence of numbers cor-
responds to the joint moments
∫
xi11 · · ·x
ik
k dµ(x) of a positive measure µ on [−1, 1]
k (or a
more general semialgebraic set). Using a sequence of semidefinite relaxations of the set of
nonnegative polynomials on [−1, 1]k, a sequence of necessary conditions for joint moments
is obtained. These conditions approximate the set of joint moments arbitrarily closely.
References
[1] R. J. Aumann. Subjectivity and correlation in randomized strategies. Journal of Math-
ematical Economics, 1(1):67 – 96, 1974.
[2] R. J. Aumann. Correlated equilibrium as an expression of Bayesian rationality. Econo-
metrica, 55(1):1 – 18, January 1987.
[3] D. Bertsimas and J. N. Tsitsiklis. Introduction to Linear Optimization. Athena Scien-
tific, Belmont, MA, 1997.
[4] X. Chen and X. Deng. Settling the complexity of two-player Nash equilibrium. In
Proceedings of the 47th annual IEEE Symposium on Foundations of Computer Science
(FOCS), 2006.
[5] M. D. Choi, T. Y. Lam, and B. Reznick. Real zeroes of positive semidefinite forms i.
Mathematische Zeitschrift, 171:1 – 26, 1980.
[6] C. Daskalakis, P. W. Goldberg, and C. H. Papadimitriou. The complexity of computing
a Nash equilibrium. In Proceedings of the 38th annual ACM Symposium on Theory of
Computing (STOC), pages 71 – 78, New York, NY, 2006. ACM Press.
[7] R. Datta. Universality of Nash equilibrium. Mathematics of Operations Research,
28(3):424 – 432, August 2003.
[8] M. Dresher and S. Karlin. Solutions of convex games as fixed points. In H. W. Kuhn
and A. W. Tucker, editors, Contributions to the Theory of Games II, number 28 in
Annals of Mathematics Studies, pages 75 – 86. Princeton University Press, Princeton,
NJ, 1953.
[9] M. Dresher, S. Karlin, and L. S. Shapley. Polynomial games. In H. W. Kuhn and
A. W. Tucker, editors, Contributions to the Theory of Games I, number 24 in Annals
of Mathematics Studies, pages 161 – 180. Princeton University Press, Princeton, NJ,
1950.
30
[10] Dean P. Foster and H. Peyton Young. Regret testing: learning to play Nash equilibrium
without knowing you have an opponent. Theoretical Economics 1, 1(3):341 – 367,
September 2006.
[11] F. Germano and G. Lugosi. Existence of sparsely supported correlated equilibria. Eco-
nomic Theory, 32(3):575 – 578, September 2007.
[12] F. Germano and G. Lugosi. Global Nash convergence of Foster and Young’s regret
testing. Games and Economic Behavior, 60:135 – 154, 2007.
[13] I. Gilboa and E. Zemel. Nash and correlated equilibria: Some complexity considerations.
Games and Economic Behavior, 1:80 – 93, 1989.
[14] I. L. Glicksberg. A further generalization of the Kakutani fixed point theorem, with
application to Nash equilibrium points. Proceedings of the American Mathematical
Society, 3(1):170 – 174, February 1952.
[15] S. Hart and D. Schmeidler. Existence of correlated equilibria. Mathematics of Operations
Research, 14(1), February 1989.
[16] S. Karlin. Mathematical Methods and Theory in Games, Programming, and Economics,
volume 2: Theory of Infinite Games. Addison-Wesley, Reading, MA, 1959.
[17] S. Karlin and L. S. Shapley. Geometry of Moment Spaces. American Mathematical
Society, Providence, RI, 1953.
[18] M. G. Krěın and A. A. Nudel’man. The Markov Moment Problem and Extremal Prob-
lems, volume 50 of Translations of Mathematical Monographs. American Mathematical
Society, 1977.
[19] C. E. Lemke and J. T. Howson, Jr. Equilibrium points in bimatrix games. SIAM
Journal on Applied Math, 12:413 – 423, 1964.
[20] R. J. Lipton and E. Markakis. Nash equilibria via polynomial equations. In Proceedings
of LATIN, 2004.
[21] James R. Munkres. Topology. Prentice Hall, Upper Saddle River, NJ, second edition,
2000.
[22] J. F. Nash. Non-cooperative games. Annals of Mathematics, 54(2):286 – 295, September
1951.
[23] C. H. Papadimitriou. Computing correlated equilibria in multi-player games. In Pro-
ceedings of the 37th Annual ACM Symposium on Theory of Computing (STOC), New
York, NY, 2005. ACM Press.
31
[24] P. A. Parrilo. Structured Semidefinite Programs and Semialgebraic Geometry Methods
in Robustness and Optimization. PhD thesis, California Institute of Technology, May
2000.
[25] P. A. Parrilo. Polynomial games and sum of squares optimization. In Proceedings of the
45th IEEE Conference on Decision and Control (CDC), 2006.
[26] S. Prajna, A. Papachristodoulou, P. Seiler, and P. A. Parrilo. SOSTOOLS: Sum of
squares optimization toolbox for MATLAB, 2004.
[27] B. Reznick. Some concrete aspects of Hilbert’s 17th problem. In C. N. Delzell and J. J.
Madden, editors, Real Algebraic Geometry and Ordered Structures, pages 251 – 272.
American Mathematical Society, 2000.
[28] W. Rudin. Real & Complex Analysis. WCB / McGraw-Hill, New York, 1987.
[29] W. Rudin. Functional Analysis. McGraw-Hill, New York, 1991.
[30] N. D. Stein. Characterization and computation of equilibria in infinite games. Master’s
thesis, Massachusetts Institute of Technology, May 2007.
[31] N. D. Stein, A. Ozdaglar, and P. A. Parrilo. Separable and low-rank continuous games.
International Journal of Game Theory, 37(4):475 – 504, December 2008.
[32] N. D. Stein, A. Ozdaglar, and P. A. Parrilo. Structure of extreme correlated equilibria.
In preparation.
[33] G. Stoltz and G. Lugosi. Learning correlated equilibria in games with compact sets of
strategies. Games and Economic Behavior, 59(1):187 – 208, April 2007.
[34] Jos F. Sturm. Using SeDuMi 1.02, a MATLAB toolbox for optimization over symmetric
cones. Optim. Methods Softw., 11/12(1-4):625–653, 1999. Interior point methods.
[35] L. Vandenberghe and S. Boyd. Semidefinite programming. SIAM Review, 38(1):49 –
95, 1996.
32
1 Introduction
2 Characterizations of Correlated Equilibria
2.1 Finite Games
2.2 Continuous Games
3 Computing Correlated Equilibria
3.1 Static Discretization Methods
3.2 Adaptive Discretization Methods
3.2.1 A family of convergent adaptive discretization algorithms
3.2.2 Implementing these algorithms with semidefinite programs
3.2.3 A nonconvergent limiting case
3.3 Moment Relaxation Methods
4 Future Work
A Semidefinite programming, sums of squares, and moments of measures
| 0non-cybersec
| arXiv |
Why can't I use product rule to derive x ln(3)?. <p>The product rule is defined as $$(f \cdot g)' = f' \cdot g + g' \cdot f.$$</p>
<p>I have the following function $u(x) = x\cdot \ln(3)$. I understand that you can derive it by implicit differentiation and have $\ln(3)$ as the result.</p>
<p>I, however, do not understand why I get the wrong result by applying the product rule:</p>
<p>$$
f(x) = x\\
g(x) = \ln(3)\\
f'(x) = 1\\
g'(x) = 1/3\\
D(f(x) * g(x))=\\
= 1 * \ln(3) + 1/3 * x \\
= \ln(3) + 1/3x \neq ln(3)$$</p>
| 0non-cybersec
| Stackexchange |
Irate #angrymom catches pervert messing with her daughter chases him down. | 0non-cybersec
| Reddit |
Just gonna throw it out. | 0non-cybersec
| Reddit |
Just another day on Abbey Road [DEATH]. | 0non-cybersec
| Reddit |
Teslic war crimes: Bosnian Serbs detained. | 0non-cybersec
| Reddit |
Enable zookeeper on google app engine. <p>I am new to Google Cloud Platform.
I have created two microservices and deployed into app engine. It works in GCP.
Now I want to enable microservices communications using ZooKeeper on app engine.
Could you please help me on achieve service discovery using Zookeeper</p>
<p>Thanks in advance</p>
| 0non-cybersec
| Stackexchange |
GPU crash in long running THREE.js application with clean JavaScript Heap profile. <p>Our long running THREE.js application (24/7) is crashing after a few days of use. I've put together stress tests that simulate user interaction, which are in a <code>while(true)</code> loop and these appear to take anywhere from 3 - 4 days to crash with a <code>WebGL_Context_Lost</code> event, which typically indicates a GPU process crash.</p>
<p>I am well versed in Chrome Dev Tools Heap profiler and have run numerous tests which all came back with no objects left between each simulation (same simulations described above).</p>
<p>Here's one of the screenshots showing only system objects left behind (ignore the size of the first Snapshot):
<a href="https://i.stack.imgur.com/R5HOS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5HOS.png" alt="enter image description here"></a></p>
<p>Both JavaScript memory and GPU memory climb in Chrome task manager, but stabilize (I feel GC is being deferred because of how frequent these operations are). There isn't a continuous climb towards a crash, indicative of a leak.</p>
<p>Versions: Chrome 65-66, Windows 10, THREE.js r91</p>
<p><strong>Questions:</strong></p>
<ol>
<li><p>Is it possible for JavaScript heap to be leak-free, yet something to leak in the GPU?</p></li>
<li><p>What tools can I use to look for GPU memory leaks?</p></li>
<li><p>Is it possible to know what exactly caused a WebGL_context_lost? (Chrome logs?)</p></li>
<li><p>Has anyone dealt with this before? </p></li>
<li><p>Any ideas?</p></li>
</ol>
<p>Thanks in advance</p>
<hr>
<p><strong>UPDATE:</strong></p>
<p>The simulation was run for 30 minute intervals, with me capturing a heap snapshot followed by a screenshot of Chrome task manager (AFAIK Capturing Heap Snapshots also runs GC).</p>
<p><strong>5:00 - Initial Snapshot from Home Screen</strong></p>
<p><a href="https://i.stack.imgur.com/STPcK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/STPcK.png" alt="enter image description here"></a></p>
<p><strong>5:30</strong></p>
<p><a href="https://i.stack.imgur.com/sFJYC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sFJYC.png" alt="enter image description here"></a></p>
<p><strong>6:00</strong></p>
<p><a href="https://i.stack.imgur.com/p1wxe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p1wxe.png" alt="enter image description here"></a></p>
<p><strong>6:30</strong></p>
<p><a href="https://i.stack.imgur.com/YePFO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YePFO.png" alt="enter image description here"></a></p>
<p><strong>7ish</strong></p>
<p><a href="https://i.stack.imgur.com/C8od5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C8od5.png" alt="enter image description here"></a></p>
<p><strong>8PM</strong></p>
<p><a href="https://i.stack.imgur.com/1bknO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1bknO.png" alt="enter image description here"></a></p>
<p><strong>Here's the confusing part: even after performing a manual GC, GPU memory stayed at ~490MB, until, I switched tabs and then it was back down to initial</strong></p>
<p><a href="https://i.stack.imgur.com/Qhaia.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qhaia.png" alt="enter image description here"></a></p>
<p>If switching the tabs cleared the GPU memory back to initial, maybe the issue is that Chrome is trying to be too smart and not disposing of GPU objects, which puts a pressure on the machine and eventually runs out of memory?</p>
<p>Note: these tests are run on an Intel i5 with an Intel Iris Graphics 540 on the latest drivers (23.20.16.4973 - 2018-02-28)</p>
<p>We have also seen this on the Iris 640 running the latest drivers.</p>
<p>For those interested, here's a comparison of heap snapshots at 7:30 and 5:30:</p>
<p><a href="https://i.stack.imgur.com/aM0Wz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aM0Wz.png" alt="enter image description here"></a> </p>
<hr>
<p><strong>UPDATE 2 - looking like a driver issue</strong></p>
<p>After reloading the page, 2 minutes into the simulation, GPU crashed with "Rats, WebGL hit a Snag". Memory hasn't had a chance to come up, so I doubt there is a leak. </p>
<p>Windows System logs have warnings that the graphics driver stopped working, which happen at the same exact time.</p>
<p><a href="https://i.stack.imgur.com/AAy76.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AAy76.png" alt="GPU crash and corresponding Windows logs"></a></p>
<p>Timestamp of WebGL Context lost error in Chrome: <code>10:07:52.938PM</code></p>
<p>Timestamp of Windows System log driver issue (I am guessing it is rounded up): <code>10:07:53PM</code> </p>
<p><strong>1. Is it safe to say this is a driver issue?</strong></p>
<p><strong>2. Did Chrome kill the GPU process and in the process log to Windows Logs OR did the driver misbehave which in return caused Chrome to kill the GPU process?</strong></p>
<p>This machine is running the latest driver via Windows Update, I am going to uninstall and update using Intel's driver and re-run tests.</p>
| 0non-cybersec
| Stackexchange |
Trying a flaming beverage. | 0non-cybersec
| Reddit |
Why isn't the complex logarithm $\log z$ holomorphic on $\mathbb C -\{0\}$?. <p>Why isn't the complex logarithm $\log z$ holomorphic on $\mathbb C -\{0\}$? Why can't you just say take the $\arg z$ to be in $[0,2\pi)$ and then you don't have to worry about it being a multivalued function.</p>
| 0non-cybersec
| Stackexchange |
NGINX + PHP7 + FastCGI Not Executing PHP Files and Downloading PHP file to client. <p>The title says it all... follows are my config files.</p>
<p>There have to be many others looking for an updated solution to the FastCGI configuration woes.</p>
<p>Merci!</p>
<p>I enabled log_level debug for php-fpm and follows is the output.</p>
<pre><code>[29-Mar-2017 09:29:45.978844] DEBUG: pid 18992, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:46.979937] DEBUG: pid 18992, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:47.981031] DEBUG: pid 18992, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:48.443352] DEBUG: pid 18992, fpm_got_signal(), line 85: received SIGTERM
[29-Mar-2017 09:29:48.443381] NOTICE: pid 18992, fpm_got_signal(), line 86: Terminating ...
[29-Mar-2017 09:29:48.443404] DEBUG: pid 18992, fpm_pctl(), line 231: switching to 'terminating' state
[29-Mar-2017 09:29:48.443414] DEBUG: pid 18992, fpm_pctl_kill_all(), line 159: [pool www] sending signal 15 SIGTERM to child 18994
[29-Mar-2017 09:29:48.443421] DEBUG: pid 18992, fpm_pctl_kill_all(), line 159: [pool www] sending signal 15 SIGTERM to child 18993
[29-Mar-2017 09:29:48.443425] DEBUG: pid 18992, fpm_pctl_kill_all(), line 168: 2 child(ren) still alive
[29-Mar-2017 09:29:48.443433] DEBUG: pid 18992, fpm_event_loop(), line 419: event module triggered 1 events
[29-Mar-2017 09:29:48.443440] DEBUG: pid 18992, fpm_pctl_kill_all(), line 159: [pool www] sending signal 9 SIGKILL to child 18994
[29-Mar-2017 09:29:48.443445] DEBUG: pid 18992, fpm_pctl_kill_all(), line 159: [pool www] sending signal 9 SIGKILL to child 18993
[29-Mar-2017 09:29:48.443450] DEBUG: pid 18992, fpm_pctl_kill_all(), line 168: 2 child(ren) still alive
[29-Mar-2017 09:29:48.444010] DEBUG: pid 18992, fpm_got_signal(), line 76: received SIGCHLD
[29-Mar-2017 09:29:48.444034] DEBUG: pid 18992, fpm_children_bury(), line 252: [pool www] child 18993 exited on signal 15 (SIGTERM) after 198.667599 seconds from start
[29-Mar-2017 09:29:48.444051] DEBUG: pid 18992, fpm_children_bury(), line 252: [pool www] child 18994 exited on signal 15 (SIGTERM) after 198.667194 seconds from start
[29-Mar-2017 09:29:48.444058] NOTICE: pid 18992, fpm_pctl_exit(), line 70: exiting, bye-bye!
[29-Mar-2017 09:29:48.501376] DEBUG: pid 19048, fpm_scoreboard_init_main(), line 40: got clock tick '100'
[29-Mar-2017 09:29:48.501543] DEBUG: pid 19048, fpm_event_init_main(), line 337: event module is epoll and 1 fds have been reserved
[29-Mar-2017 09:29:48.501597] NOTICE: pid 19048, fpm_init(), line 85: fpm is running, pid 19048
[29-Mar-2017 09:29:48.502089] DEBUG: pid 19048, fpm_children_make(), line 421: [pool www] child 19049 started
[29-Mar-2017 09:29:48.502530] DEBUG: pid 19048, fpm_children_make(), line 421: [pool www] child 19050 started
[29-Mar-2017 09:29:48.502556] DEBUG: pid 19048, fpm_event_loop(), line 366: 6000 bytes have been reserved in SHM
[29-Mar-2017 09:29:48.502562] NOTICE: pid 19048, fpm_event_loop(), line 367: ready to handle connections
[29-Mar-2017 09:29:48.502614] DEBUG: pid 19048, fpm_systemd_heartbeat(), line 68: have notify start to systemd
[29-Mar-2017 09:29:48.502631] NOTICE: pid 19048, fpm_systemd_heartbeat(), line 75: systemd monitor interval set to 10000ms
[29-Mar-2017 09:29:49.503709] DEBUG: pid 19048, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:50.504808] DEBUG: pid 19048, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:51.505900] DEBUG: pid 19048, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:52.506994] DEBUG: pid 19048, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:53.508089] DEBUG: pid 19048, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[29-Mar-2017 09:29:54.509183] DEBUG: pid 19048, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
</code></pre>
<p>curl -i <a href="http://ipaddress" rel="nofollow noreferrer">http://ipaddress</a></p>
<pre><code>HTTP/1.1 200 OK
Server: nginx/1.10.2
Date: Tue, 28 Mar 2017 21:18:20 GMT
Content-Type: application/octet-stream
Content-Length: 1780
Last-Modified: Thu, 15 Dec 2016 15:20:08 GMT
Connection: keep-alive
ETag: "5852b4a8-6f4"
Accept-Ranges: bytes
</code></pre>
<p>nginx/php-fpm generated no errors in logs</p>
<p>nginx access log generated the following.</p>
<pre><code>192.88.135.5 - - [28/Mar/2017:13:18:38 -0400] "GET / HTTP/1.1" 200 1780 "-""Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.1144"
</code></pre>
<p>The files that show in the .sock path are:</p>
<pre><code>-rw-r--r--. 1 root root 5 Mar 28 18:45 php-fpm.pid
srw-rw-rw-. 1 nginx nginx 0 Mar 28 18:45 website.com.sock
</code></pre>
<p>nginx version: nginx/1.10.2
PHP 7.0.16 (fpm-fcgi) (built: Feb 18 2017 10:26:54)</p>
<p>nginx.conf</p>
<pre><code>user nginx nginx;
worker_processes 4;
error_log /var/log/nginx/error.log;
error_log /var/log/nginx/error.log notice;
error_log /var/log/nginx/error.log info;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
upstream php {
server unix:/var/run/php-fpm/website.com.sock;
}
server {
include /etc/nginx/conf.d/default.conf;
include /etc/nginx/sites-available/*.conf;
}
}
</code></pre>
<p>default.conf</p>
<pre><code>include /etc/nginx/security;
#expires max;
#Uploads configuration
client_max_body_size 32m;
</code></pre>
<p>site-available/site.conf</p>
<pre><code>listen [::]:80;
server_name *.website.com;
root /some/directory/website/;
access_log /var/log/nginx/www.access.log;
error_log /var/log/nginx/www.error.log notice;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
#Index targets
index index.php index.html index.htm;
location / {
# redirect admin/auth
#rewrite ^/(admin|auth)(.*) https://$host$request_uri?;
# try_files $uri =404;
# #fastcgi_split_path_info ^(.+\.php)(/.+)$;
try_files $uri $uri/ /index.php$is_args$args;
}
# if the file being requested ends in ".php", it's something
# that PHP-FPM should process, so hand it to upstream server
location ~ \.php$ {
fastcgi_pass php;
}
</code></pre>
<p>php-fpm/www.conf</p>
<pre><code>; Start a new pool named 'www'.
[www]
ping./var/run/php-fpm/website.com.sock = /ping
listen = /var/run/php-fpm/website.com.sock;
pm = dynamic
pm.status_/var/run/php-fpm/website.com.sock = /status
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx
listen.mode = 0666
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
</code></pre>
<p>fastcgi.conf</p>
<pre><code>fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
# To use NGINX + Virtual Host + PHP you should ommit the SCRIPT_NAME variable in order for
# PHP to choose the correct DOCUMENT_ROOT.
#fastcgi_param SCRIPT_NAME $fastcgi_script_name;
#
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
</code></pre>
| 0non-cybersec
| Stackexchange |
Netflix announced Tuesday that it’s allowing employees to take unlimited maternity or paternity leave during the first year after their child’s birth or adoption.. | 0non-cybersec
| Reddit |
A bikini is an outfit where 90% of a woman's body is exposed.. The amazing fact is that men are so decent, they only look at the 10% that isn't.
| 0non-cybersec
| Reddit |
ActivityManager kills running process of system app. <p>We are currently facing the problem that the ActivityManager kills our system app:</p>
<p><strong>"I/ActivityManager( 831): Killing 3267:de.oursystemapp.tsc/u0a199 (adj 15): empty #31"</strong></p>
<p>Why could this happen? We don't have any UI parts for this system app, it just lives in the background. After boot of the device IntentServices are triggered by the app to download data from the backend. I don't understand why my process could be considered as empty?</p>
<p>I don't really have an explanation right now, so any ideas would help.</p>
| 0non-cybersec
| Stackexchange |
External hard disk erased?. <p>everyone! I'm an Ubuntu and tech rookie, so here's my question! I had my PC made double-boot (Windows and Ubuntu). However, my external hard disk could not be read by Ubuntu. Given this, I emptied it on Windows. Then, I switched to Ubuntu and formatted my disk into FAT, which is supposed to support both systems. After that, I switched back to Windows where I cut and pasted everything back to my disk. Everything appeared ok. I booted Ubuntu and I realized that, on Ubuntu, my disk appeared empty. Consequently, I switched once again to Windows and "puff!" the hard disk is empty on Windows too! All my important files were supposed to be there! As you can tell, this is a massive disaster. What could I do? Is there any way to get them back? I'd be grateful for your help!</p>
<p>Update: here's the output L. D. James asked for.</p>
<pre><code>NAME MOUNTPOINT LABEL SIZE FSTYPE UUID
sda 119,2G
├─sda1 /boot/efi 260M vfat A6E2-A9DA
├─sda2 16M
├─sda3 Windows 86,6G ntfs C412539A12538FF2
├─sda4 Windows RE tools 980M ntfs F8D01F28D01EEC9E
└─sda5 / 31,4G ext4 3c15dab6-7c57-4602-a80b-57ccbeaa6117
sdb 465,8G
└─sdb1 /media/user/500GBTurboX 500GBTurboX 465,8G vfat DD6A-FD92
sr0 1024M
sr1 /media/user/My CDROM My CDROM 5,9M iso9660 2016-08-03-12-01-27-00
</code></pre>
<p>New update:</p>
<pre><code>Filesystem 1K-blocks Used Available Use% Mounted on
udev 3975276 0 3975276 0% /dev
tmpfs 800936 1608 799328 1% /run
/dev/sda5 32292640 7370472 23258732 25% /
tmpfs 4004672 19696 3984976 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 4004672 0 4004672 0% /sys/fs/cgroup
/dev/loop0 14848 14848 0 100% /snap/gnome-logs/34
/dev/loop1 3840 3840 0 100% /snap/gnome-system-monitor/41
/dev/loop2 13312 13312 0 100% /snap/gnome-characters/96
/dev/loop3 142848 142848 0 100% /snap/gnome-3-26-1604/64
/dev/loop4 3456 3456 0 100% /snap/gnome-system-monitor/36
/dev/loop6 88704 88704 0 100% /snap/core/4650
/dev/loop5 21504 21504 0 100% /snap/gnome-logs/25
/dev/loop7 12544 12544 0 100% /snap/gnome-characters/69
/dev/loop8 143488 143488 0 100% /snap/gnome-3-26-1604/59
/dev/loop9 88704 88704 0 100% /snap/core/4486
/dev/loop10 2432 2432 0 100% /snap/gnome-calculator/170
/dev/loop11 1664 1664 0 100% /snap/gnome-calculator/154
/dev/sda1 262144 92476 169668 36% /boot/efi
tmpfs 800932 32 800900 1% /run/user/1000
/dev/sdb1 488264224 53952 488210272 1% /media/user/500GBTurboX
/dev/sr1 6002 6002 0 100% /media/user/My CDROM
</code></pre>
| 0non-cybersec
| Stackexchange |
I'm proud!. | 0non-cybersec
| Reddit |
Routine critique and a few questions. Moving off of CC and starting with the information provided by eshlow, so I wanted a routine critique (and, probably soon, a form critique).
[Routine!](https://docs.google.com/spreadsheet/ccc?key=0AuKtUnbkEa6tdEdiVFMzYnlEVGprOGdWYlplckxoNWc&usp=sharing)
Goals (In order of importance):
* Increased jumping/acrobatic abilities
* Increased Flexibility
* OAC / Free HSPU / 1-arm row / 1-arm pushup / 1-arm dip
* Strength / a little hypertrophy
Questions:
* MM / SS: I know I saw it a while ago, but I can't find it now - how to know when to progress in the stretches in Phrakture's stretching programs?
* Full squat: Either my toes turn out or my heels turn in, do I care? How to prevent?
* Do HSPU/Dips train the same muscles? (It sure seems so - can I drop one?)
* Should I be doing the L-sit pullups and L-sit as separate exercises, or can I drop one? | 0non-cybersec
| Reddit |
Intuition/Simple Proofs required about $kernel$, $rank$, $co-rank$. <p>This question might be so elementary , but I love to see some geometric/algebraic approach for these facts concerning transpose matrix. I know some basic thing about DUAL space but those are not satisfying in the way I know.</p>
<p>$1. \: rank (A)=rank(A^t)$ </p>
<p>$2. \: ker (A) = co-image(A^t)$</p>
<p>$3. \: co-ker(A)= image(A^t)$</p>
<hr>
<p>P.S. One may re-state the third fact as</p>
<p>$$Ax=0 , x^ty=0 \implies \exists z: A^tz=y$$</p>
<p>Is there any simple way just using basic algebra to prove the fact?</p>
<p>Thanks community </p>
| 0non-cybersec
| Stackexchange |
If you've missed any Destiny info from July, I've recapped everything in a couple of short videos.. | 0non-cybersec
| Reddit |
Probability of picking a random natural number. <p>I randomly pick a natural number <em>n</em>. Assuming that I would have picked each number with the same probability, what was the probability for me to pick <em>n</em> before I did it?</p>
| 0non-cybersec
| Stackexchange |
ITAP of the Three Sisters (Monument Valley). | 0non-cybersec
| Reddit |
48 years ago today the Northern Ireland Troubles began when a civil rights protest in Derry was attacked by the British colonial police.. | 0non-cybersec
| Reddit |
How to mark some file in debian package as config?. <p>I want to make my own Debian package, which contains some default config file. I don't want this file to be rewritten after update with <code>dpkg -i</code>.</p>
<p>What are the ways to solve my problem?</p>
| 0non-cybersec
| Stackexchange |
Tail for the integral of a diffusion process. <p>I would like to compute the following tail,
$$
\mathbb{P}\left(\int_{0}^{T} f(X_t)\mathrm{dt}>x\right),
$$
assuming
$$
\mathbb{P}[f(X_t)>x] = x^{-\alpha} \log(x),
$$
and $X$ is a diffusion process, meaning that
$
\mathrm{dX_t}= b(X_t) \mathrm{dW_t}+ c(X_t)\mathrm{dt}
$
where $W$ is a Brownian motion, and $b$ and $c$ are given functions.
Thanks in advance.</p>
| 0non-cybersec
| Stackexchange |
Getting Failure of Compactness from the Failure of Upward Lowenheim-Skolem in Omega logic.. <p>(1)Given Omega-completeness, and assuming compactness implies upward Lowenheim-Skolem, can one get the failure of compactness by showing failure of upward l.s.? I ask because it would seem to take care of "two birds with one stone". (2) <em>if</em> one can proceed in this way, is my proof sketch below correct? </p>
<p>My proof sketch would be as follows: </p>
<p>Claim: Compactness and upward l.s. fails in Omega logic. </p>
<p>Proof: Suppose Omega-logic is complete. We show that upward l.s. fails by constructing a sentence which characterizes Omega logic and which has only countable models. Then for a given T characterizing Omega logic, T has a model. So by the Omega rule we can construct a countably infinite conjunction PHI s.t. T|- PHI. By completeness PHI must have a model, so |= PHI. Now since there are only Omega-many constants in the model, PHI can only have a countable model. Now compactness implies upward l.s.; upward fails, so compactness fails as well. </p>
| 0non-cybersec
| Stackexchange |
matplotlib: update position of patches (or: set_xy for circles). <p>Inspired by <a href="http://matplotlib.org/users/event_handling.html#draggable-rectangle-exercise" rel="noreferrer">this example</a> I'm trying to write a little matplotlib program that allows the user to drag and drop datapoints in a scatter plot dynamically. In contrast to the example which uses a bar plot (and thus allows dragging of rectangles) my goal was to achieve the same with other patches, like for instance a circle (any patch that is more scatter-plot-compatible than a rectangle would do). However I'm stuck at the point of updating the position of my patch. While a <code>Rectangle</code> provides a function <code>set_xy</code> I cannot find a direct analog for <code>Cirlce</code> or <code>Ellipse</code>. Obtaining the position of a circle is also less straightforward that for a rectangle, but is possible via obtaining the bounding box. The missing piece now is to find a way to update the position of my patch. Any hint on how to achieve this would be great! The current minimal working example would look like this:</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
class DraggablePatch:
def __init__(self, patch):
self.patch = patch
self.storedPosition = None
self.connect()
def getPosOfPatch(self, marker):
ext = marker.get_extents().get_points()
x0 = ext[0,0]
y0 = ext[0,1]
x1 = ext[1,0]
y1 = ext[1,1]
return 0.5*(x0+x1), 0.5*(y0+y1)
def connect(self):
'connect to all the events we need'
self.cidpress = self.patch.figure.canvas.mpl_connect('button_press_event', self.onPress)
self.cidmotion = self.patch.figure.canvas.mpl_connect('motion_notify_event', self.onMove)
def onPress(self, event):
'on button press we will see if the mouse is over us and store some data'
contains, attrd = self.patch.contains(event)
if contains:
self.storedPosition = self.getPosOfPatch(self.patch), event.xdata, event.ydata
def onMove(self, event):
'how to update an circle?!'
contains, attrd = self.patch.contains(event)
if contains and self.storedPosition is not None:
oldPos, oldEventXData, oldEventYData = self.storedPosition
dx = event.xdata - oldEventXData
dy = event.ydata - oldEventYData
newX = oldPos[0] + dx
newY = oldPos[1] + dy
print "now I would like to move my patch to", newX, newY
def myPatch(x,y):
return patches.Circle((x,y), radius=.05, alpha=0.5)
N = 10
x = np.random.random(N)
y = np.random.random(N)
patches = [myPatch(x[i], y[i]) for i in range(N)]
fig = plt.figure()
ax = fig.add_subplot(111)
drs = []
for patch in patches:
ax.add_patch(patch)
dr = DraggablePatch(patch)
drs.append(dr)
plt.show()
</code></pre>
| 0non-cybersec
| Stackexchange |
Google Wants To Wirelessly Charge Their Self-Driving Cars. | 0non-cybersec
| Reddit |
How to submit sitemap when your website has partial https? - Error: "Not in Domain". <p>My website is an eCommerce that is set up to do HTTP for the item browsing portion, but HTTPS for things like shopping cart, contact us, etc.. (anything that has forms on it).</p>
<p>I've submitted my website a long time ago to Google webmaster tools as <code>http://example.com</code>. I also submitted a sitemap with about 40 links - 8 of them are HTTPS.</p>
<p>I've noticed that for the longest time, Google webmaster tools was reporting that 32 out of the 40 links have been crawled. I tested all the links against my robots.txt and realized that my robots text was blocking the HTTPS links. Google says those links are "Not In Domain".</p>
<p>Is there a way I'm supposed to get around this so that I can have a hybrid-ssl site? I understand the concept that one site is mywebsite.com:80 and the other is mywebsite.com:443, but I'd like to avoid submitting and maintaining 2 separate websites on Google webmaster tools.</p>
| 0non-cybersec
| Stackexchange |
How to find the number of roots for a constant in a quadratic equation when the independent term is unknown?. <p>I'm going in circles with this question. As I don't know how to deal with the fact that the independent term is unknown. Typically when solving a quadratic equation you know the terms or they can be expressed as letters. But here I don't know how to find the number requested. Can somebody help me?</p>
<p>The problem is as follows:</p>
<blockquote>
<p>If <span class="math-container">$n$</span> is a positive integer less than <span class="math-container">$100$</span>, how many values can <span class="math-container">$n$</span>
have so that the equation <span class="math-container">$x^2+x-n=0$</span> has two roots which are integers
and different?</p>
</blockquote>
<p>The alternatives found in my book are as follows:</p>
<p><span class="math-container">$\begin{array}{ll}
1.&8\\
2.&10\\
3.&12\\
4.&6\\
5.&9\\
\end{array}$</span></p>
<p>In my attempt to solve the problem I tried what it was obvious and was calling the solution of the quadratic equation using the discriminant as follows:</p>
<p>Given the function:</p>
<p><span class="math-container">$F(x)=x^2+x-n=0$</span></p>
<p><span class="math-container">$x_{1,2}=\frac{-1\pm\sqrt{1^2+4n}}{2}$</span></p>
<p>However I'm stuck at the part where it mentions an integer less than <span class="math-container">$100$</span>.</p>
<p>For this to happen the value on the numerator must be divisible by <span class="math-container">$2$</span>. So the sum has to end in either <span class="math-container">$2,4,6,8,0$</span>.</p>
<p>Since it is -1 when summed the square root result must end with those numbers and when subtracted from the square root must also end with those numbers.</p>
<p>It just happens that positive uneven numbers when summed to <span class="math-container">$-1$</span> will return an even number hence becoming divisible by <span class="math-container">$2$</span> and when subtracted to <span class="math-container">$-1$</span> will increase to an even number.</p>
<p>Therefore the result of the square root must be an uneven number. After I found this fact, I had to consider what values less than <span class="math-container">$100$</span> would also yield the same. <span class="math-container">$99\times 4 +1 = 397$</span> which is a number with no integer as square root, but gives us the idea that the number I'm looking for is of three digits and less than the square root of <span class="math-container">$397$</span>.</p>
<p>The greatest uneven number which can happen before that number could be <span class="math-container">$19$</span> as <span class="math-container">$19^{2}=367$</span> but I found that there is no way to attain that number as <span class="math-container">$18$</span> is not divisible by <span class="math-container">$4$</span>. So I kept searching. The next one <span class="math-container">$17$</span> yields <span class="math-container">$16$</span> so this can be a number, the next one <span class="math-container">$15$</span> doesn't, <span class="math-container">$13$</span> checks, <span class="math-container">$9$</span> also checks, <span class="math-container">$5$</span> is the final choice.</p>
<p>So from this I've found that the possible numbers would be:</p>
<p><span class="math-container">$17^{2}=1+4n$</span></p>
<p><span class="math-container">$n_{1}=\frac{288}{4}=68$</span></p>
<p><span class="math-container">$13^{2}=1+4n$</span>
<span class="math-container">$n_{2}=\frac{168}{4}=42$</span></p>
<p><span class="math-container">$9^{2}=1+4n$</span>
<span class="math-container">$n_{3}=\frac{80}{4}=20$</span></p>
<p><span class="math-container">$5^{2}=1+4n$</span>
<span class="math-container">$n_{4}=\frac{24}{4}=6$</span></p>
<p>So there are only four possibilities. These produces different roots and integers.</p>
<p><span class="math-container">$x_{1}=\frac{-1\pm \sqrt{289}}{2}=\frac{-1+17}{2}=8$</span></p>
<p><span class="math-container">$x_{2}=\frac{-1-17}{2}=-9$</span></p>
<p>This would also happen with the rest. However this answer is not within the alternatives. Could it be that I overlooked any possible solutions?. Can somebody help me with this problem?.</p>
| 0non-cybersec
| Stackexchange |
Connect Ubuntu Server 16.04 to Windows 10 using Ethernet cable. <h2>EDIT:</h2>
<p><code>ipconfig</code> on Windows:</p>
<pre><code>Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::49d7:ec19:199f:b968%13
Autoconfiguration IPv4 Address. . : 169.254.185.104
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
</code></pre>
<h2>SITUATION:</h2>
<p>I was using Ubuntu Desktop 16.04 as my PC's OS for a long time. And there were no problems with Ethernet connection with my server that is running on Ubuntu Server 16.04.</p>
<p>But now I have to use Windows 10 as my OS. I didn't change settings on my server:</p>
<p><code>sudo nano /etc/natwork/intrfaces</code>:</p>
<pre><code># The loopback network interfaces
auto lo
iface lo inet loopback
# The primary network interfaces
auto enp4s0f0
iface enp4s0f0 inet static
address 192.168.10.2
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
</code></pre>
<h2>PROBLEM:</h2>
<p>When I run <code>ping 192.168.10.2 -t</code> in CMD on my PC I get:</p>
<pre><code>Pinging 192.168.10.2 with 32 bytes of data:
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
Ping statistics for 192.168.10.2:
Packets: Sent = 5, Received = 0, Lost = 5 (100% loss),
</code></pre>
<p>So there is no connection, hovewer the Ethernet cable is working:</p>
<p><a href="https://i.stack.imgur.com/4WIiS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4WIiS.png" alt="enter image description here"></a></p>
<h2>QUESTION:</h2>
<p>How to solve this ploblem and why I'm getting this error?</p>
<p>Thanks for helping</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Ionization option on our A/C turned on or off in a server room?. <p>Our server room is a converted closet, and we have a pair of wall-mounted air conditioning units to cool the room. These are both pointed towards the front of the server racks, and there are a couple small vents for hot air. We definitely don't have an ideal environment, but it's what I'm working with.</p>
<p>My question is related to an ionization feature of the A/C units. I know that this <a href="http://en.wikipedia.org/wiki/Air_ioniser" rel="nofollow noreferrer">feature</a> will basically spit out negative ions that attach to dust and other particles, and make them heavy enough to drop to the ground. With this basic understanding, I am trying to figure out if it is better for a server room to have this turned on or off.</p>
<p>I would imagine turning it on would mean purer air, which would mean the intake of air to the servers would have less dust (ie, good to turn it on). </p>
<p>However, I could also imagine that the ionized air would contain bigger, heavier dust particles that would normally drop to the ground, but could get sucked up into the servers because of the air flow. This would lead to bigger dust particles in the servers, which would be more likely to cause issues (ie, good to turn it off).</p>
<p>I haven't found much looking around online, so I'm hoping that someone out there might have done some deeper research into this already. Or, hopefully someone can factually show me that I'm considering something that is so minor it won't make a difference.</p>
| 0non-cybersec
| Stackexchange |
SQL Server Transactional Replication over Internet. <p>I have 2 instances with SQL Server 2008R2. I would like to build Transactional replication between those servers. One is in the Local Network (Local_Instance) and the second server is over Internet (Internet_Instance). The Internet Server is running an FTP service. I have read something that I can use replication using FTP but I don't have any idea how to make this. I have built the publication but I need help to configure the suscription. The distribution database is in the Local Network.</p>
| 0non-cybersec
| Stackexchange |
How can I finance a Master's degree in the UK?. I've been hoping to do a Masters in Management in the UK, as it is my best chance at realistically getting into strategy consulting other than an MBA. However, they all cost \~£30,000 in fees, without mentioning the cost of living in London for LSE and ICL. I can get the £10k loan for a masters, but that would just about cover my cost of living in London for 1 year, and I'm just about to start my undergraduate, so how can I spent the next 3 years trying to get funding for this Msc. My parents don't want to chip in as they dislike my chosen undergraduate degree choice, so I can't ask them for anything. I would be really grateful for any advice. | 0non-cybersec
| Reddit |
I had the most profound experience of my life and finally felt like a woman. I am a 21 year old trans woman who is currently a man, if you met me you would never know I was trans. I am not especially masculine but I am definitely not feminine. I have spent alot of my life repressing any femininity I felt because I never saw any other option. To be completely honest I probably will never come out, because I want to be a woman, not a trans woman. I know that lots of women out there can feel beautiful as a trans woman but I am 6'2 and built like a hockey player that is 30 pounds overweight. I just didn't see being attractive or beautiful even in my own eyes as a possibility, then 2 tabs of LSD happened.
I was tripping alone which was bad idea, but it let me do what ever I wanted. Which just so happened to be dressing how I wanted so I took the few women's clothes that fit me and put them on. I have worn women's clothes before but as soon I looked in the mirror I felt dirty like I was just another gross guy, a punch line in some comedy. While I was tripping though I was able to look in the mirror and feel beautiful. I was able to walk around my house as a woman and actually feel like a woman for 4 hours. At one point I started dancing to the music, which I could never do without feeling a ton of anxiety. As I was dancing I closed my eyes and the drugs really hit me, I felt as if some goddess looked down on me and approved of me being a woman. That joy the approval gave me the feeling like I fit in, like I was in some secret club of womanhood even if it was all in my head. It was so overwhelming I felt like I was on another planet, it felt so backwards to feel comfortable like that.
After that I feel genuinely happier with my life, even though I may never feel that way again. I also want to thank everyone for being so supportive of the trans community, even if some of us may never feel comfortable with the transition bit.
--------
Sorry if this was all over the place it is hard to articulate psychedelic experience, I also have not told anyone about this so I feel pretty nervous putting it up on the internet.
**Disclaimer: This isn't a glory story about drugs they can be very dangerous.** If you decide to do psychedelics make sure to have a trip buddy no matter what, you brain goes to weird places and makes dangerous things seem normal.
**TL;DR** I took drugs dressed as a woman and finally was able to feel beautiful, comfortable and myself despite being a big 21 year old man.
EDIT: Thanks for all the support I didn't think people would take notice to the post it is extremely nice to feel apart of the community. It really improved my day ladies! | 0non-cybersec
| Reddit |
Hellas Verona appoint Gigi Delneri as manager. | 0non-cybersec
| Reddit |
Evangeline Lilly. Have at it reddit!. | 0non-cybersec
| Reddit |
Google reportedly building a completely stand-alone virtual reality headset. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Resources for Unix users trying to learn DOS?. <p>I am an experienced UNIX user that knows my way around the UNIX terminal. However, whenever I use a Windows computer and try and use the Command Prompt, I cannot do much more than list the contents of a directory with <code>dir</code> and change directory with <code>cd</code>. I want to learn how to do things with DOS. Can you guys please recommend some stuff that will help a UNIX guy learn how to use DOS? Thanks!</p>
| 0non-cybersec
| Stackexchange |
Determine if string input could be a valid directory in Python. <p>I am writing boilerplate that handles command line arguments that will later be passed to another function. This other function will handle all of the directory creation (if necessary). Therefore my bp only needs to check if an input string <strong>could be</strong> a valid directory, OR a valid file, OR (some other thing). <em>i.e.</em> it needs to differentiate between something like "c:/users/username/" and "c:/users/username/img.jpg"</p>
<pre class="lang-py prettyprint-override"><code>def check_names(infile):
#this will not work, because infile might not exist yet
import os
if os.path.isdir(infile):
<do stuff>
elif os.path.isfile(infile):
<do stuff>
...
</code></pre>
<p>The standard library does not appear to offer any solutions, but the ideal would be:</p>
<pre class="lang-py prettyprint-override"><code>def check_names(infile):
if os.path.has_valid_dir_syntax(infile):
<do stuff>
elif os.path.has_valid_file_syntax(infile):
<do stuff>
...
</code></pre>
<p>After thinking about the question while typing it up, I can't fathom a way to check (only based on syntax) whether a string contains a file or directory other than the file extension and trailing slash (both of which may not be there). May have just answered my own question, but if anyone has thoughts about my ramblings please post. Thank you! </p>
| 0non-cybersec
| Stackexchange |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.