text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
---|---|---|---|---|
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 | 349 | 1,234 |
Me [28 M] with my wife [27 F] of 4 years, called the cops and accused me of assaulting her.. This is a bit long but there is a lot going on.
My wife and I have been having problems for the last two years.
It all started when her sisters/brother in law moved into a one million dollar home. They're roughly the same age as us and married for slightly longer. Between them they make close to $140,000.00 year and live a great life. Birthdays at there house are always well catered, always have new cars and go on a vacation to another country once a year.
My wife and I haven't been that fortunate. While we make a good living and own a home it is no where near my brother and sister in law. My wife began resenting me for not earning as good a wage as my brother in law. I had a decent factory job that paid me a good wage. Unfortunately the company went under and similar jobs pay much less than I was used to making. Therefore, I got a job as an electrical apprentice where I started at nearly minimum wage but in five years I should be making close to $70,000.00 a year. My wife blames me for all our financial struggles with my new wage. She constantly belittles me saying "I'm not a real man", "Who goes back to school in their 30's". To become a electrician I'm required to do roughly half a year of school (not consecutive) which I get unemployment during and guaranteed raises upon completion of each level (there are three). Every time I get the letter to go to school we get in a fight about not being able to afford me being out of work for six weeks (length of first level). But I will never get a raise if I don't go to school. She calls me a loser and pathetic...among other not so flattering statements.
Soon after that her criticism of me expanded to everything I do. She says no one likes me and everybody mocks me behind my back. Calls me a loser in front of my daughter. She texts me at work saying I can't provide. She goes nuts on me when I go out. For example, one night I went to a baseball pool, literally the first time I been out alone for just me in 2014. She proceeds to text me, I hope your having fun while I am at home alone, what kind of man joins a baseball pool when he can't provide?
To help out our financial situation I started working on weekends. I'd come home after working eight hours on a Saturday doing intense physical labour and she yell at me for not making groceries. I said "you were home all day, why couldn't you make the groceries?" which than led to another fight. Now every time I work weekends I get texts insulting me that I have to work on weekends to provide.
The thing is we're in this financial situation in part because my decline in wage and because she racked up a $60,00.00 line of credit. She controlled all the finances and would always get the mail. Our mortgage was just taken out automatically of a joint account. Our trash was opened by raccoons one night and as I was cleaning it up I found a bank statement indicating our line a credit was used. I knew we had a line of credit but it was for emergencies and I had no idea it had been nearly maxed out. I confronted her about this, again many fights occurred and to this day she will not tell me where the money went. She doesn't go out, just goes to work. I have no clue where it could have gone.
Just before that she had been yelling at me daily for having a drinking problem. During an average week I'd have about 12 tall boys. She would call me a drunk (I never drank more than two a day) and said I should go to AA. That my daughter will grow up to be ashamed of me and that I am a loser. Prior to learning about the line of credit I decided to stop drinking for the sake of marriage. After talking about it with friends they said while I wasn't an alcoholic, it was a bit excessive and if we have financial woes I should slow it down. I agreed. I quit drinking completely.
So a two weeks after the fights started about the line of credit being maxed out I had to stay 30 minutes extra at work. When I got home my wife confronted me at the car, "YOU WERE AT THE BAR! WEREN'T YOU!?!?!?!"....I responded no I just had to stay late at work. She said she smelled beer on me and stormed in the house. I followed her in the house saying "You are crazy, I didn't drink a thing and I had to work late you stupid bitch..". At this point she went off completely you're a loser, you can't provide, you're a drunk, you're not a man, you have no friends...it went on and on. I called her a b.... again and she slapped me, in a rage I aggressively pushed her out of the way striking her should and bruising her. It was assault, it was aggressive, I didn't think about what I was doing ...at the that moment I hated her so much I wanted to punch her, so I removed myself from the situation but some dumb instinct said I had should push her...
She called the cops and I was arrested/charged. Through mediation, she wanted to work on our marriage (through mutual friends I learned this was because she learned I'd get half her pension in a divorce and she'd pay alimony). She wasn't charging me, the police do automatically in domestic disputes. But she agreed to speak on my behalf to help get the charges to go away. For me to see my daughter more than just weekends and get the charges dropped from the prosecution I would have to attend anger management classes, marriage counselling and classes for alcoholics. My wife also wants me to sign documents from her lawyer relinquishing my rights to any of her money. She doesn't want to divorce me and said I can move back home but must sleep on the couch. If I agree to the above the charges will be dropped and I will have my daughter again. If I refuse to sign those I will have begin fighting for my daughter on a minimum wage while fighting assault charges.
I don't know what to do. I'm a mess. I think the smartest thing is do agree to everything and divorce her when all the charges drop. I don't care about the money just don't want my daughter with her five days a week. She will make my daughter hate me I know it.
How do I proceed? What is the smartest next move for me to get out from this situation with most of my life still intact?
---
**tl;dr**: In a terrible marriage and assaulted my wife after a heated argument. Don't know how to proceed.
**EDIT: Corrected the bolded part it was an accident from censoring a curse word. | 0non-cybersec
| Reddit | 1,494 | 6,422 |
Can I write a pdf with exercises taken from other sources, solving them myself and not cite them, or do I have to ask for permission?. <p>I want to create some PDFs that will help future university mathematics students to learn the material. I just started, literally 1 hour ago. I do not want to sell these PDFs but just make them available.</p>
<p>I make them with overleaf.com , and I write down all everything on my own. However these pdfs will contain only exercises (no theory), so clearly I can make some exercises up, but if I want to be exhaustive, I have to take exercises from books or lecture notes. </p>
<p>I take the text of the exercises, so for example $\textit{Use the definition of a field to prove that if F is a field then $\forall$ a $\in F$, $\, a\cdot 0 = 0 \cdot a = 0$.}$</p>
<p>However I do solve these exercises myself and write down my solutions. Of course for some exercises I'll look at the solutions and take inspiration from them, but always writing them down myself.</p>
<blockquote>
<p>Do I have to quote (and ask permission!) to any source I take the exercises from? I.e. is there something like a copyright on exercises?</p>
</blockquote>
<p>What I want to know is, if I do these pdfs with exercises, can I just avoid citing every source and put them available in my website? </p>
<p>Thank you</p>
<p>Here's the style:
<a href="https://i.stack.imgur.com/UYYZp.jpg"><img src="https://i.stack.imgur.com/UYYZp.jpg" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange | 414 | 1,501 |
arXiv:physics/0008042v1 [physics.acc-ph] 12 Aug 2000
ar
X
iv
:p
hy
si
cs
/0
00
80
42
v1
[
ph
ys
ic
s.
ac
c-
ph
]
1
2
A
ug
2
00
0
THE FLAT BEAM EXPERIMENT AT THE FNAL PHOTOINJECTOR
D. Edwards, H. Edwards, N. Holtkamp, S. Nagaitsev, J. Santucci, FNAL∗
R. Brinkmann, K. Desler, K. Flöttmann, DESY-Hamburg
I. Bohnet, DESY-Zeuthen, M. Ferrario, INFN-Frascati
Abstract
A technique for production of an electron beam with a high
transverse emittance ratio, a “flat” beam, has been proposed
by Brinkmann, Derbenev, and Flöttmann.[1] The cathode
of an RF-laser gun is immersed in a solenoidal magnetic
field; as a result the beam emitted from a round laser spot
has a net angular momentum. Subsequent passage through
a matched quadrupole channel that has a 90 degree differ-
ence in phase advance between the transverse degrees of
freedom results in a flat beam. Experimental study is un-
derway at the Fermilab Photoinjector. Thus far, transverse
emittance ratios as high as 50 have been observed, and the
results are in substantial agreement with simulation.
1 INTRODUCTION
Two years ago, Ya. Derbenev invented an optics maneu-
ver for transforming a beam with a high ratio of horizontal
to vertical emittance—a “flat beam” —to one with equal
emittances in the transverse degrees-of-freedom—a “round
beam”.[2] High energy electron cooling at the TeV energy
scale was the motivation.
Last year, R. Brinkmann and K. Flöttmann of DESY
joined with Derbenev in a paper that reverses the process—
obtain a flat beam from a round beam produced from the
cathode of an electron gun.[1] This could be a significant
step toward the elimination or simplification of the electron
damping ring in a linear collider design. The other major
step in that process is the delivery of polarized electrons
in the flat beam, and this is an R&D challenge beyond the
scope of the work reported here.
The intent of the present experiment was to demonstrate
the round-to-flat transformation, compare the results with
simulation, and verify that the demonstration was not ob-
scured by other processes. In the following sections, we
present a simplified version of the transformation, describe
the experimental setup, present the results, and comment
on future plans.
2 PRINCIPLE
Suppose that the cathode of an electron gun is immersed in
a uniform solenoidal field of magnitudeBz . For the sake of
this argument, assume that the thermal emittance is negli-
gible and ignore RF focusing in the gun. Then the particles
just stream along the field lines until the end of the solenoid
∗The Fermi National Accelerator Laboratory is operated under con-
tract with the US Department of Energy
is reached, at which point the beam acquires an angular mo-
mentum. A particle with initial transverse coordinates x0,
y0 acquires angular deflections. With momentum p0 at the
solenoid end, the state of the particle becomes
x
x′
y
y′
0
=
x0
−ky0
y0
kx0
where
k ≡
1
2
Bz
(p0/e)
.
Next pass the beam through an alternating gradient
quadrupole channel. Assume that the channel is repre-
sented by an identity matrix in the x-direction and has an
additional 900 phase advance in y.
We get the output state
x
x′
y
y′
=
1 0 0 0
0 1 0 0
0 0 0 β
0 0 − 1
β
0
x0
−ky0
y0
kx0
=
x0
−ky0
kβx0
− 1
β
y0
β=1/k→
x0
−ky0
x0
−ky0
.
In the last step above, with β = 1/k, the particles end up
with equal displacements in x and y and travelling at equal
angles in x and y. This describes a flat beam inclined at
an angle of 450 to the coordinate axes. Change to a skew-
quadrupole channel, and the flat beam can be aligned along
either the horizontal or vertical axis.
This idealized example is only meant to illustrate the
principle. The essential points about the quadrupole chan-
nel are the π/2 difference in phase advance between
the transverse degrees-of-freedom, and the match of the
Courant-Snyder parameters.[3] This may be accomplished
with as few as three quadrupoles. Of course, in practice,
RF focusing fields in the gun and in a booster cavity, space
charge, and so on cannot be ignored.
With the inclusion of thermal emittance, Brinkmann,
Derbenev, and Flöttmann[1] speak of an achievable emit-
tance ratio of order 102 or more for a beam with normal-
ized emittance
√
ǫx · ǫy ≈ 1µm per nC of bunch charge.
The expression for the emittance ratio is
ǫx
ǫy
≈ 4k
2σ2c
σ′2c
http://arxiv.org/abs/physics/0008042v1
RF Gun w Solenoids
cathode
Skew Quad Triplet Transformer
Flat BeamRound Beam
OTR Screens & SlitsSC Tesla Cavity
Figure 1: Very schematic rendition of the layout at Fermilab related to this experiment.
where now in the definition of k, Bz remains the field
on the cathode, but p0 is the momentum at entry to the
quadrupole channel, and σc, σ
′
c are the standard deviations
of the distribution in displacement and angle at the cath-
ode. The resulting vertical emittance would be 0.1 µm,
in the range of interest for a linear collider. Liouville’s
Theorem remains in effect for the 4-dimensional transverse
emittance, but the angular momentum provides the lever
by which emittance may be moved from one degree-of-
freedom to another.
3 THE FERMILAB PHOTOINJECTOR
ENVIRONMENT
The photoinjector at Fermilab is well suited to this sort
of experiment. The RF gun delivers electrons with a ki-
netic energy of (typically) 3.8 MeV. The superconducting
booster cavity raises the electron energy to 17 MeV.
The solenoid is composed of three separately excited
coils permitting fields at the cathode in the range 0 to
2.7 kG. The coil immediately upstream of the cathode, the
“bucker”, is normally excited with current opposite to that
of the next coil, the “primary” to produce zero field at the
cathode. Downstream, the combination yields solenoidal
focusing, which can be adjusted with the third coil, the
“secondary”. The secondary has little effect on the field
on the cathode.
Following the booster cavity, about 8 meters of beamline
are available for experiments. There are 11 quadrupoles
that are easily moved about or rotated into the skew orien-
tation. A dozen view screens are situated on the line, and
there are three locations where slits are installed for emit-
tance measurement. The laser can operate at a variety of
pulse lengths up to 12 ps, the setting that we used. Bunch
charge as high as 10 nC is available. We operated at no
higher than 1 nC in order to reduce space charge effects as
much as possible. The layout as related to this experiment
is sketched in Fig. 1.
4 PROCEDURE
The solenoid coils were set to produce a field at the cathode
in the expected range, about 0.75 kG. Using the language of
the preceding section, this meant setting the bucker to zero
current and controlling the cathode field with the primary.
The beam was observed at the location of the two screens
immediately downstream of the booster cavity, and by ad-
justment of the secondary coil, the beam spot was made the
same size at these two places. In other words, a beam waist
was produced. At this stage, the beam has a round shape
on the screens.
The simple argument of Sec. 2 is no longer valid for de-
termination of the β for the match, because the solenoid
field is not uniform and the RF focusing and acceleration
must be taken into account. Making use of linearity, axial
symmetry, and the conservation of canonical angular mo-
mentum between the cathode and the waist yields for the
value of β at entry to the quadrupole channel
β =
σ2w
σ2c
2(pw/e)
Bc
where the subscripts c and w refer to the cathode and waist
respectively and the σ’s characterize the radii of the beam
spots. The other Courant-Snyder parameter involved in the
match, α, is zero due to the choice of a waist as the match
point.
Given preliminary values for the matching parameters,
an (asymmetric) skew triplet was set up. Flat beam pro-
files were rather easily achieved by adjustment of available
tuning parameters, including the launch phase from the RF
gun. The latter proved to be particularly important, a cir-
cumstance that is yet to be explained.
5 RESULTS
The transformation should work — it’s linear dynamics —
and it does. The match and phase difference were achieved
with three skew quadrupoles. The beam image on an OTR
screen 1.2 m downstream of the third quadrupole is shown
in Fig. 2; the beam width is an order of magnitude larger
than the height. A critical observation is that the beam re-
main flat as it drifts farther downstream. That it does is
demonstrated in Fig. 3 near the end of the beamline at 3.6 m
from the third quadrupole.
In Fig. 2 there is a hint of an s-shape, which likely in-
dicates that spherical aberrations (e.g. space charge) are
at work. If the solenoid field on the cathode is varied up
or down from the matched condition the beam apparently
rotates clockwise or counterclockwise as it drifts, indicat-
ing that the angular momentum is no longer completely
cancelled. Of course, it isn’t a real rotation — there’s no
torque— it’s a shear.
Figure 2: Beam profile on OTR screen 1.2 m downstream
of the third skew quadrupole.
Figure 3: Beam profile on OTR screen 3.6 m downstream
of the third skew quadrupole. Dark current is visible to the
right of the main beam image.
In these figures, the beam is flat in the horizontal plane.
The OTR screens are viewed from the side, and so a beam
that is flat horizontally presents a depth of field problem
for best emittance analysis. So in later stages of the ex-
periment, the beam was made flat in the vertical plane.
From slit data in this orientation, the measured ratio of
emittances is about 50: ǫx ≈ 0.9µm, ǫy ≈ 45µm, with
the one degree-of-freedom normalized emittance defined
by ǫ2 = γ2(v/c)2(〈x2〉〈x′2〉 − 〈xx′〉2). We feel that this
is a good result for an initial experiment. The horizontal
emittance measurement is resolution limited, as illustrated
in Fig. 4 wherein a sequence of slit images is superimposed
in order to form a distribution. The standard deviation of
the narrow distribution is comparable to a single pixel of
the CCD camera viewing the screen.
The product of the emittances is higher than that usual
in operation with round beams; typically, the emittance
in each transverse degree-of-freedom is about 3 to 4 µm.
However, there is no reason to believe that the emittance
compensation normally in use would be effective under the
conditions of this experiment.
The simulations[4],[5] carried out prior to the measure-
ments provided useful guidance, but were not perfect. The
prediction of spot size just downstream of the gun worked
fine. But to achieve the match to the quadrupoles, the
solenoid required adjustment.
In order to obtain agreement between the location of the
beam waist downstream of the booster cavity, a modifica-
0
2 0
4 0
6 0
8 0
100
120
0
1 0
2 0
3 0
4 0
5 0
6 0
140 150 160 170 180 190 200 210 220
L6, L8slit X
063000-1840, ~50mic/pic
l6-dc,rot-5 l8 Slit X proj
l6
-d
c,
ro
t-
5
,
X
p
ro
j
l8
S
lit X
p
ro
j
pic
sigma= 7.7pic
sigma=1.2 pic
Figure 4: Projection of images used in emittance measure-
ment at slit location and downstream of slit system.
tion of the focusing characteristics of this device was re-
quired. In the Chambers approximation[6], its demagni-
fication is a factor of 5, so its treatment is sensitive to a
number of factors, e.g. the exact field profile. It will be
worthwhile to measure the transfer matrix through the cav-
ity experimentally.
6 CONCLUSIONS
The round-to-flat transformation has been verified, with a
demonstrated emittance ratio of a factor of 50 between the
two transverse degrees-of-freedom. Further work will be
needed to restore the emittance compensation necessary to
the delivery of low transverse emittance, and that is the sub-
ject of a follow-on experiment, in the direction suggested
by Brinkmann, Debenev and Flöttmann in their EPAC2000
paper.[7] The predictive capability of the simulations is en-
couraging thus far, and the results reported here indicate
directions for improvement.
7 ACKNOWLEGEMENTS
Support of the Fermilab and DESY managements is grate-
fully acknowledged. Thanks to Jean-Paul Carneiro, Mark
Champion, Michael Fitch, Joel Fuerst and Walter Hartung
for their invaluable help in the operation.
8 REFERENCES
[1] R. Brinkmann, Ya. Derbenev, K. Flöttmann, “A Flat Beam
Electron Source for Linear Colliders”, TESLA Note 99-09,
April 1999.
[2] Ya. Derbenev, “Adapting Optics for High Energy Electron
Cooling”, University of Michigan, UM-HE-98-04, Feb. 1998.
[3] A. Burov and S. Nagaitsev, “Courant-Snyder Parameters of
Beam Adapters”, Fermilab TM-2114, June 2000.
[4] K. Flöttmann, ASTRA user manual,
www.desy.de/∼mpyflo/Astra dokumentation.
[5] S. Nagaitsev, private communication.
[6] E. Chambers, Stanford HEPL note, 1965.
[7] R. Brinkmann, Y. Derbenev, K. Flöttmann, EPAC2000,
Vienna, June 2000.
| 0non-cybersec
| arXiv | 3,999 | 13,095 |
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 | 349 | 1,234 |
It's not much, but its mine, and its finally done! [M113]. [First off, here's me and the gang giving it a test drive!](https://upload.wikimedia.org/wikipedia/commons/a/aa/Allied_Spirit_I_150126-A-LO967-001.jpg)
[Interior](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/M113_Interior.jpg/1024px-M113_Interior.jpg)
We knew we didn't have enough to spring for a brand new one, so we managed to get a hold of a used system from WWII and update some of the internals.
Current Specs:
* Detroit 6V53 V6 two-stroke diesel engine
* Allison TX-100-1 three-speed automatic transmission
* all-around 7.62mm armor-piercing protection
* additional 14.5 mm protection on the front, sides, and rear
Next up would be RGB and replacing the acrylic windows with bulletproof ballistics glass. Thoughts on other upgrades?
| 0non-cybersec
| Reddit | 249 | 817 |
The recursion $T(n) = T(n/2)+T(n/3)+n$. <p>I'm looking at the reccurrence
<span class="math-container">$$T(n) = T(n/2) + T(n/3) + n,$$</span>
which describes the running time of some unspecified algorithm (base cases are not supplied).</p>
<p>Using induction, I found that <span class="math-container">$T(n) = O(n\log n)$</span>, but have been told that this is not tight. Indeed, assume inductively that <span class="math-container">$T(k) \leq Ck\log k$</span> for all <span class="math-container">$k<n$</span> (and sufficiently large values of <span class="math-container">$k$</span>), then</p>
<p><span class="math-container">\begin{align*}
T(n)&\leq C\frac{n}{2}\log\frac{n}{2} + C\frac{n}{3}\log \frac{n}{3} + n\\
&= C\frac{5}{6}n\log n - n(C/2+C\log3/3 - 1).
\end{align*}</span></p>
<p>Now I choose <span class="math-container">$C$</span> large enough for <span class="math-container">$(C/2+C\log3/3 - 1) > 0$</span>, and so the last expression is dominated by <span class="math-container">$C\frac{5}{6}n\log n\leq Cn\log n$</span>.</p>
<p>My first question is, what is a tighter bound that this?</p>
<p>Second, I tried to use the Akra-Bazzi method to solve this, so let <span class="math-container">$p$</span> solve
<span class="math-container">$$\left(\frac{1}{2}\right)^p + \left(\frac{1}{3}\right)^p = 1.$$</span>
Then approximately <span class="math-container">$p=0.79$</span>, and (with <span class="math-container">$g(n) = n$</span>) I get
<span class="math-container">$$\int_1^n \frac{g(u)}{u^{p+1}} du = \int_1^n \frac{1}{u^{p}} du = \frac{1}{1-p}(n^{1-p}-1),$$</span>
and so</p>
<p><span class="math-container">$$T(n) = \Theta\left(n^p\left(1+\frac{1}{1-p}(n^{1-p}-1)\right)\right).$$</span></p>
<p>This equals <span class="math-container">$\Theta(n^p + \frac{1}{1-p}n-\frac{1}{1-p}n^p)$</span>, so overall <span class="math-container">$\Theta(n)$</span>, since <span class="math-container">$p<1$</span>. My second question is that I don't really believe that <span class="math-container">$T$</span> is linear, so what went wrong in my application of Akra-Bazzi?</p>
<p>Best regards.</p>
| 0non-cybersec
| Stackexchange | 830 | 2,129 |
Can R help manuals have latex math in them?. <p>I am working on an <code>R</code> package and I am using the package <code>Roxygen2</code> to write the help manuals for my <code>R</code> functions. What I would like to know is if it is possible to use latex for math equations in the manual pages?</p>
<p>For example, if I had a function called <code>add2</code> that did the following:</p>
<pre><code>add2 = function(x,y){
z = x+y
return(z)
}
</code></pre>
<p>And using <code>Roxygen2</code> documentation I had the following:</p>
<pre><code>##' @include add2.R
{}
##' Compute the sum of x_1 and x_2
##'
##' Computes the sum of x_1 and x_2
##'
##' @param x_1 number of guys
##' @param x_2 number of girls
##' @return The sum of the two values x_1 and x_2
##'
##' @example examples/adding.R
##' @export
##' @author Name
</code></pre>
<p>And this works for me, but this displays x1 and x2 as x_1 and x_2 in the help manual whereas I would like for it to look like latex math and actually have the subscripts on x, i.e., $x_1$ and $x_2$ in latex. </p>
<p>Is there any way to do this or does <code>R</code> not accomodate this?</p>
| 0non-cybersec
| Stackexchange | 403 | 1,151 |
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 | 349 | 1,234 |
Are there always harmonic forms locally?. <p>Let $M$ be a smooth $d$-dimensional oriented Riemannian manifold, and let $p \in M$.
Let $0 \le k \le d$ be fixed.</p>
<blockquote>
<p>Does there exist an open neighbourhood $U$ of $p$, which admit a non-zero harmonic $k$-form? i.e $\omega \in \Omega^k(U)$ satisfying $d\omega=\delta \omega=0$?</p>
</blockquote>
<p>Since a form $\omega$ is harmonic if and only if $\star \omega$ is harmoinc ($\star$ is the Hodge dual operator), the answers for a given $k,d-k$ are the same.</p>
<p>For $k=d$, one can take $\omega$ to be the Riemannian volume form.</p>
<p>For $k=1$, we can take $\omega=df$ where $f$ is a harmonic function. Then $\delta \omega=\delta df=0$. Locally, there are always harmonic functions- we can solve the Dirichlet problem on a small ball with boundary, that is finding a harmonic function which is zero on the boundary. </p>
<p>This solves the cases $k=0,1,d-1,d$.</p>
<p>So, we are left with the cases $2 \le k \le d-2$.</p>
| 0non-cybersec
| Stackexchange | 332 | 999 |
Equivalent forms of pullback. <p>Let $\Lambda$ be an artin algebra. Here is a proposition<a href="https://i.stack.imgur.com/jR6in.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jR6in.png" alt="enter image description here"></a></p>
<p>Now I want to prove $(b)(iii) \Rightarrow (b)(ii)$:
The only problem is to show that $ker(g,g') \subseteq Im
\binom{f}{-f'}$</p>
<p>Suppose $(b,b') \in ker (g,g')$, then $g(b)+g'(b')=0$. Then for any $a \in A$, $g(b+f(a))+g'(b'-f'(a))=0$. If $b \in Imf$, then I can get $b' \in Im f'$ and there is a $a \in A$ such that $f(a)=b$ and $f'(a)=b'$.</p>
<p>But I can't get $f$ is surjective, I don't know what to do next. Thank you for any help or hint.</p>
| 0non-cybersec
| Stackexchange | 289 | 712 |
If $a \in \mathbb{I}$ , how is $\overline{\mathbb{Z}+ a\mathbb{Z}}=\mathbb{R}$. <p>If $a \in \mathbb{I}$ , how is $$\overline{\mathbb{Z}+ a\mathbb{Z}}=\mathbb{R}$$</p>
<p>It says in my notebook that this set in dense in $\mathbb{R}.$ How do I prove this density? With say $\mathbb{Q}$ and $\mathbb{I}$ being dense in $\mathbb{R}$ I thought it was dense because every point in $\mathbb{R}$ was either in $\mathbb{Q}(\mathbb{I})$ or a limit point of $\mathbb{Q}\text{ -being } \mathbb{I}(\mathbb{I}\text{ -being }\mathbb{Q}).$</p>
<p>Now here say $a\to \frac{1}{2}\in \mathbb{I}$, take example $b=\frac{1}{4}\in \mathbb{R}$ which I don't see as being a limit point of $\mathbb{Z}+ a\mathbb{Z}...$ </p>
| 0non-cybersec
| Stackexchange | 250 | 702 |
How to start PhantomJS with commandline options in Selenium?. <p>I can't find how to start phantomjs with command-line options like <code>--cookies-file=/path/to/cookies.txt</code> and other...</p>
<p>Tried <code>driver = webdriver.PhantomJS('--cookies-file=/tmp/ph_cook.txt')</code> but nothing.</p>
<p>For unknown reason <code>add_cookie</code> don't work to keep logged.</p>
<p>I tried to start phantomjs like this:</p>
<pre><code>driver = webdriver.PhantomJS(executable_path = "phantomjs --cookies-file=/tmp/ph_cook.txt --webdriver")
</code></pre>
<p>but getting error:</p>
<pre><code>raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
selenium.common.exceptions.WebDriverException: Message: Unable to start phantomjs with ghost driver.
</code></pre>
| 0non-cybersec
| Stackexchange | 255 | 785 |
What am I missing here?. <p>That's an idiot question, but I'm missing something here. If $x'= Ax$ and $A$ is linear operator in $\mathbb{R}^n$, then $x'_i = \sum_j a_{ij} x_j$ such that $[A]_{ij} =a_{ij} = \frac{\partial x'_i}{\partial x_j}$, therefore $\frac{\partial}{\partial x_i'} = \sum_j \frac{\partial x_j}{\partial x'_i} \frac{\partial}{\partial x_j}$. However $\frac{\partial}{\partial x_i'} = \frac{\partial}{\partial \sum_j a_{ij} x_j} = \sum_j a_{ij} \frac{\partial}{\partial x_j} = \sum_j \frac{\partial x'_i}{\partial x_j} \frac{\partial}{\partial x_j}$ !!! What's wrong here?</p>
<p>Thanks in advance.</p>
| 0non-cybersec
| Stackexchange | 228 | 623 |
TIFU by not paying attention to my e-mail inbox. For a little background, I graduated with a master's in school counseling last June, but couldn't find work in the field, so I took a desk jockey job in the mean time.
So, anyway, last night I was cleaning out the old inbox and notice a unread e-mail from November 26th. Turns out it was the supervisor from my internship saying that they were finally going to fill an open counseling position. I'm still unsure of how I missed it- I was out of town for Thanksgiving so I wasn't paying as close attention to my incoming e-mail notices, but either way, I definitely feel like a moron right now. | 0non-cybersec
| Reddit | 154 | 645 |
Show that the order of an element g is well-defined. <p>Suppose <span class="math-container">$G$</span> is a group and let <span class="math-container">$g∈G$</span>, explain why the order of <span class="math-container">$g$</span> is well-defined, while the definition of the order is the following:</p>
<p>The smallest positive r such that <span class="math-container">$g^r=e$</span>, if no such r is found then we say g has infinite order.</p>
<p><strong>My Question</strong>:
What strategy should I adopt to check the well-definedness? I know we are essentially checking if the output is unique or not.</p>
<p><strong>My Attempt</strong>: Suppose the order of g is finite then consider the set <span class="math-container">$\{r>0:g^r=e\}$</span>. We know this set is non-empty since <span class="math-container">$g^k=e$</span> for some <span class="math-container">$k$</span>. Then by Well-Ordering Principle there exists smallest such <span class="math-container">$r$</span> and hence the order is well-defined.</p>
| 0non-cybersec
| Stackexchange | 307 | 1,026 |
Get values from table if this or that applies, but not when both apply. <p>I'm currently struggling with a seemingly simple task.</p>
<p>The goal is to get the corresponding prices according to the customer number - OR - the customer price group if the customer number does not exist in the table. I think my problem here is that those values are saved in the same table.
The table looks like this (shortened):</p>
<pre><code>Sales Code | Item No | Unit price
----------------------------------
SC1 | 711111 | 345.12
SC2 | 711111 | 501.24
SC3 | 711111 | 242.70
CustomerNo1 | 711111 | 242.70
CustomerNo2 | 711111 | 250.00
SC1 | 711112 | 345.12
SC2 | 711112 | 501.24
SC3 | 711112 | 242.70
CustomerNo2 | 711112 | 250.00
</code></pre>
<p>I am using a parameter for the customer number and I already got the customer price group of the customer, for the case if the customer number is not available in the table for the sales prices.</p>
<p>A short snipped of my code so far:</p>
<pre><code>-- Get the customer price group
SET @query =
'SELECT @CustomerPriceGroup = (CASE [Customer Price Group] WHEN '''' THEN ''SC1'' ELSE [Customer Price Group] END)
FROM [customers]
WHERE [No] = ''' + @CustomerNo + ''''
EXEC sp_executesql @query, N'@CustomerPriceGroup NVARCHAR(3) OUTPUT', @CustomerPriceGroup = @CustomerPriceGroup OUTPUT
-- Get the item data
SET @query = 'SELECT sp.[Sales Code] AS [SalesCode],
i.[No] AS [ItemNo],
i.[Name] AS [ItemName],
sp.[Unit Price] AS [UnitPrice]
FROM [items] i
INNER JOIN [salesprices] sp ON i.[No] = sp.[ItemNo]
WHERE (sp.[Sales Code] = ''' + @CustomerNo + ''' OR sp.[Sales Code] = ''' + @CustomerPriceGroup + ''')'
EXEC (@query)
</code></pre>
<p>I already tried to use EXIST or a window function (example from here <a href="https://stackoverflow.com/questions/15723326/if-exists-in-where-clause">https://stackoverflow.com/questions/15723326/if-exists-in-where-clause</a>), but I was not successful. I got the prices for the customer itself without the customer price group, but not the customer price group if no customer number is available (always nothing, both or only the customer price).</p>
<p>I need to get the following fields:</p>
<ul>
<li>Sales Code</li>
<li>Item number</li>
<li>Item name</li>
<li>Unit price (according to the sales code, either CustomerNo or sales code)</li>
<li>Grouped by the item number</li>
</ul>
<p>I am using Microsoft SQL Server 2016.</p>
<p>Any idea how I can solve that?</p>
<p>BR Raphi</p>
| 0non-cybersec
| Stackexchange | 783 | 2,584 |
Can't start the Subversion server. <p>Recently I had configured subversion edge in my Linux machine. Installation was keen (installed as such described in this link <a href="http://www.collab.net/lightbox/download_info/61/34" rel="nofollow noreferrer">[http://www.collab.net/lightbox/download_info/61/34])</a> and I was able to log in to the csvn console, access and create subversion repositories.</p>
<p>After restarting the machine I was able to log in to csvn console only and in the status page it was saying subversion server is down. When I clicked the start button an error was displayed saying "There was a problem starting the Subversion server!" . When I checked the server error logs I got console.log as :</p>
<pre><code>2013-01-01 08:01:45.011:INFO::jetty-7.0.2.v20100331
2013-01-01 08:01:45.076:INFO::Deployment monitor /opt/csvn/appserver/contexts at interval 300
2013-01-01 08:01:45.095:INFO::Deployable added: /opt/csvn/appserver/contexts/redirect.xml
2013-01-01 08:01:45.171:INFO::Deployable added: /opt/csvn/appserver/contexts/integration.xml
2013-01-01 08:01:47,335 INFO [WrapperJarAppMain] com.vasoftware.sf.externalintegration.BootstrapServlet: Bootstrapping the Integration service for Subversion Edge at /opt/csvn
2013-01-01 08:01:47,756 WARN [WrapperJarAppMain] org.apache.axis.utils.JavaUtils: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
2013-01-01 08:01:48.000:INFO::Deployable added: /opt/csvn/appserver/contexts/csvn.xml
2013-01-01 08:02:00.473:INFO:/csvn:Initializing Spring root WebApplicationContext
loading security config ...
2013-01-01 08:02:28,388 [quartzScheduler_Worker-1] WARN console.OperatingSystemService - Testing for process '22276' failed with message: The SIGAR library was not loaded.
2013-01-01 08:02:28,391 [quartzScheduler_Worker-1] WARN console.OperatingSystemService - SIGAR loading issue, the pid cannot be tested. Assuming the process is alive
2013-01-01 08:02:28.829:INFO:/csvn:newClient: com.collabnet.svnedge.admin.PackagesUpdateService_f4dc86al9etm
2013-01-01 08:02:28.830:INFO:/csvn:newChannel: /csvn-updates
2013-01-01 08:02:28.831:INFO:/csvn:newChannel: /csvn-updates/status
2013-01-01 08:02:28.831:INFO:/csvn:newChannel: /csvn-updates/percentages
2013-01-01 08:02:29,502 [quartzScheduler_Worker-1] ERROR console.CommandLineService - Exit status=1 Process err output: httpd: bad user name null
2013-01-01 08:02:29,504 [quartzScheduler_Worker-1] WARN console.LifecycleService - Server graceful attempt failed with code=1
2013-01-01 08:02:29,504 [quartzScheduler_Worker-1] WARN console.LifecycleService - Output:
2013-01-01 08:02:41.954:INFO:/csvn:Initializing Spring FrameworkServlet 'grails'
2013-01-01 08:02:41.980:INFO::Deployment monitor /opt/csvn/appserver/webapps at interval 300
2013-01-01 08:02:42.036:INFO::Opened /opt/csvn/data/logs/jetty_2013_01_01.log
2013-01-01 08:02:42.081:INFO::Started [email protected]:3343
2013-01-01 08:02:42.285:INFO::Started [email protected]:4434
2013-01-01 08:02:43.572:INFO:/csvn:Initializing Spring FrameworkServlet 'gsp'
2013-01-01 08:02:43.572:INFO:/csvn:GSP servlet initialized
2013-01-01 10:20:27,461 [qtp4612306-92] WARN console.OperatingSystemService - Testing for process '22276' failed with message: No such process
2013-01-01 10:20:31,513 [qtp4612306-95] ERROR console.CommandLineService - Exit status=1 Process err output: Syntax error on line 16 of /opt/csvn/data/conf/csvn_main_httpd.conf:
Error:\tApache has not been designed to serve pages while\n\trunning as root. There are known race conditions that\n\twill allow any local user to read any file on the system.\n\tIf you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then rebuild the server.\n\tIt is strongly suggested that you instead modify the User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n
2013-01-01 10:20:31,514 [qtp4612306-95] WARN console.LifecycleService - Server start attempt failed with code=1
2013-01-01 10:20:31,514 [qtp4612306-95] WARN console.LifecycleService - Output:
2013-01-01 10:24:10.587:INFO::Graceful shutdown [email protected]:4434
2013-01-01 10:24:10.615:INFO::Graceful shutdown [email protected]:3343
2013-01-01 10:24:10.711:INFO::Graceful shutdown MovedContextHandler@17296ee@17296ee/,null
2013-01-01 10:24:10.711:INFO::Graceful shutdown WebAppContext@12fc9e@12fc9e/integration,file:/opt/csvn/appserver/work/Jetty_0_0_0_0_3343_integration.war__integration__gzh5bq/webapp/,/opt/csvn/appserver/webapps/integration.war
2013-01-01 10:24:10.711:INFO::Graceful shutdown WebAppContext@871745@871745/csvn,file:/opt/csvn/appserver/work/Jetty_0_0_0_0_3343_csvn.war__csvn__.1xntxq/webapp/,/opt/csvn/appserver/webapps/csvn.war
2013-01-01 10:24:11.767:INFO:/csvn:Destroying Spring FrameworkServlet 'gsp'
2013-01-01 10:24:13,849 [Thread-3] WARN executor.SessionBoundExecutorService - ExecutorService did not shutdown in 2 seconds. Forcing shutdown of any scheduled tasks
2013-01-01 10:24:23.063:INFO:/csvn:Destroying Spring FrameworkServlet 'grails'
2013-01-01 10:24:23.261:INFO:/csvn:Closing Spring root WebApplicationContext
2013-01-01 10:24:25.843:INFO::jetty-7.0.2.v20100331
2013-01-01 10:24:25.866:INFO::Deployment monitor /opt/csvn/appserver/contexts at interval 300
2013-01-01 10:24:25.869:INFO::Deployable added: /opt/csvn/appserver/contexts/redirect.xml
2013-01-01 10:24:25.959:INFO::Deployable added: /opt/csvn/appserver/contexts/integration.xml
2013-01-01 10:24:27,596 INFO [WrapperJarAppMain] com.vasoftware.sf.externalintegration.BootstrapServlet: Bootstrapping the Integration service for Subversion Edge at /opt/csvn
2013-01-01 10:24:27,958 WARN [WrapperJarAppMain] org.apache.axis.utils.JavaUtils: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
2013-01-01 10:24:28.117:INFO::Deployable added: /opt/csvn/appserver/contexts/csvn.xml
2013-01-01 10:24:39.028:INFO:/csvn:Initializing Spring root WebApplicationContext
loading security config ...
2013-01-01 10:25:00.931:INFO:/csvn:newClient: com.collabnet.svnedge.admin.PackagesUpdateService_gcr1y7g1qlo0
2013-01-01 10:25:00.932:INFO:/csvn:newChannel: /csvn-updates
2013-01-01 10:25:00.932:INFO:/csvn:newChannel: /csvn-updates/status
2013-01-01 10:25:00.932:INFO:/csvn:newChannel: /csvn-updates/percentages
2013-01-01 10:25:13.695:INFO:/csvn:Initializing Spring FrameworkServlet 'grails'
2013-01-01 10:25:13.992:INFO::Deployment monitor /opt/csvn/appserver/webapps at interval 300
2013-01-01 10:25:14.072:INFO::Opened /opt/csvn/data/logs/jetty_2013_01_01.log
2013-01-01 10:25:14.115:INFO::Started [email protected]:3343
2013-01-01 10:25:14.569:INFO::Started [email protected]:4434
2013-01-01 10:25:16.549:INFO:/csvn:Initializing Spring FrameworkServlet 'gsp'
2013-01-01 10:25:16.550:INFO:/csvn:GSP servlet initialized
2013-01-01 10:25:27,513 [qtp922883-80] ERROR statistics.NetworkStatisticsService - Byte values are decreasing instead of increasing. Cannot calculate rate.
2013-01-01 10:25:27,520 [qtp922883-80] ERROR statistics.NetworkStatisticsService - Byte values are decreasing instead of increasing. Cannot calculate rate.
2013-01-01 10:25:30,564 [qtp922883-87] ERROR console.CommandLineService - Exit status=1 Process err output: Syntax error on line 16 of /opt/csvn/data/conf/csvn_main_httpd.conf:
Error:\tApache has not been designed to serve pages while\n\trunning as root. There are known race conditions that\n\twill allow any local user to read any file on the system.\n\tIf you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then rebuild the server.\n\tIt is strongly suggested that you instead modify the User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n
2013-01-01 10:25:30,568 [qtp922883-87] WARN console.LifecycleService - Server start attempt failed with code=1
2013-01-01 10:25:30,568 [qtp922883-87] WARN console.LifecycleService - Output:
2013-01-01 10:25:30,653 [qtp922883-86] ERROR statistics.NetworkStatisticsService - Byte values are decreasing instead of increasing. Cannot calculate rate.
2013-01-01 10:25:30,659 [qtp922883-86] ERROR statistics.NetworkStatisticsService - Byte values are decreasing instead of increasing. Cannot calculate rate.
2013-01-01 10:25:43,741 [qtp922883-81] ERROR console.CommandLineService - Exit status=1 Process err output: Syntax error on line 16 of /opt/csvn/data/conf/csvn_main_httpd.conf:
Error:\tApache has not been designed to serve pages while\n\trunning as root. There are known race conditions that\n\twill allow any local user to read any file on the system.\n\tIf you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then rebuild the server.\n\tIt is strongly suggested that you instead modify the User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n
2013-01-01 10:25:43,742 [qtp922883-81] WARN console.LifecycleService - Server start attempt failed with code=1
2013-01-01 10:25:43,742 [qtp922883-81] WARN console.LifecycleService - Output:
2013-01-01 10:25:43,818 [qtp922883-85] ERROR statistics.NetworkStatisticsService - Byte values are decreasing instead of increasing. Cannot calculate rate.
2013-01-01 10:25:43,822 [qtp922883-85] ERROR statistics.NetworkStatisticsService - Byte values are decreasing instead of increasing. Cannot calculate rate.
</code></pre>
<p>I googled and found many of them say it's because of user permission, ownership etc. I had gone through all of the steps and it wasn't a successful attempt. Here I expect a reliable solution. please provide me a solution for this.</p>
| 0non-cybersec
| Stackexchange | 3,377 | 9,869 |
Swift 3 access of private properties in a struct from a extension. <p>I've been looking through the swift docs and working through some examples around encapsulation, and am unsure about the behaviour that I'm seeing. I've looked for similar questions on stack, looked through the doc and looked through some tutorials (see the link below) and although this is a trivial question can't find an answer (possibly as Swift has changed?)</p>
<p>Creating a simple Struct representing a queue:</p>
<pre><code>struct Queue<Element> {
private var elements = [Element]()
mutating func enqueue(newElement: Element) {
elements.append(newElement)
}
mutating func dequeue() -> Element? {
guard !elements.isEmpty else {
return nil
}
return elements.remove(at: 0)
}
}
</code></pre>
<p>Is later extended by:</p>
<pre><code>extension Queue {
func peek() -> Element? {
return elements.first
}
}
</code></pre>
<p>But of course elements is inaccessible due to the private protection level.
It works by changing the access of elements to fileprivate - but why?</p>
<p>My understanding was that extensions were part of the enclosing type, and looking around the web it seems that is <em>used</em> to work this way <a href="https://www.andrewcbancroft.com/2015/04/22/3-nuances-of-swift-extensions/" rel="noreferrer">https://www.andrewcbancroft.com/2015/04/22/3-nuances-of-swift-extensions/</a></p>
<p>So is my understanding of visibility wrong, or has Swift changed?</p>
| 0non-cybersec
| Stackexchange | 432 | 1,496 |
Pyautogui screenshot. Where does it go? How to save and find later?. <p>I am learning from Al Sweigart's you tube video for automating the boring stuff. I got to the part of taking screenshots. He didn't really explain in his video so I tested things out. I found that it takes screenshots of the whole desktop but I don't know where they go. I can only find it when do a whole computer search and I don't know how to put it into a folder from there. </p>
<p>Basically I am asking how I can store the images and find those images taken by the <code>pyautogui.screenshot()</code> function. I am not planning on using this for anything at the moment I just want to know how to do it. I went to the pyautogui website and I didn't find anything on where to find and how to save the screenshots. Thank you in advance for your time! </p>
| 0non-cybersec
| Stackexchange | 214 | 833 |
Retrofit 2 not sending data when ProGuard is enabled. <p>I try to login my users using Retrofit 2. (Basically a GET to the login URL with a basic header) It works well but once I ProGuard it, the Header Authorization is not sent anymore. (See log outputs)</p>
<p>Sample code :</p>
<p>User Model :</p>
<pre class="lang-java prettyprint-override"><code>public interface UserService {
@GET(GET_LOGIN)
Observable<User> login(@Header("Authorization") String basic);
}
</code></pre>
<p>Login Activity :</p>
<pre class="lang-java prettyprint-override"><code>public void onClick(View v) {
mRetrofit.create(UserService.class)
.login(Credentials.basic(email, password))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(user -> {
UserHelper.save(LoginActivity.this, user);
}, throwable -> Dog.d);
}
</code></pre>
<p>Proguard File :</p>
<pre class="lang-none prettyprint-override"><code># Retrofit
-dontwarn retrofit2.**
-dontwarn org.codehaus.mojo.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*
-keepclasseswithmembers class * {
@retrofit.* <methods>;
}
-keepclasseswithmembers interface * {
@retrofit.* <methods>;
}
</code></pre>
<p>Logs (proguard) :</p>
<pre class="lang-none prettyprint-override"><code>D/OkHttp: --> GET http://passport-supercairos.rhcloud.com/users/login HTTP/1.1
D/OkHttp: User-Agent: VirtualPassport-Client {Android-23} {Aquaris_E5}
D/OkHttp: Cache-Control: max-stale=10800
D/OkHttp: --> END GET
D/OkHttp: <-- HTTP/1.1 401 Unauthorized (258ms)
D/OkHttp: Date: Fri, 19 Feb 2016 12:57:19 GMT
D/OkHttp: X-Powered-By: Express
D/OkHttp: WWW-Authenticate: Basic realm="Users"
D/OkHttp: Keep-Alive: timeout=15, max=100
D/OkHttp: Connection: Keep-Alive
D/OkHttp: Transfer-Encoding: chunked
D/OkHttp: Content-Type: text/plain
D/OkHttp: OkHttp-Sent-Millis: 1455886639681
D/OkHttp: OkHttp-Received-Millis: 1455886639787
D/OkHttp: Unauthorized
D/OkHttp: <-- END HTTP (12-byte body)
</code></pre>
<p>Logs (non-proguard) :</p>
<pre class="lang-none prettyprint-override"><code>D/OkHttp: --> GET http://passport-supercairos.rhcloud.com/users/login HTTP/1.1
D/OkHttp: User-Agent: VirtualPassport-Client {Android-23} {Aquaris_E5}
D/OkHttp: Cache-Control: max-stale=10800
D/OkHttp: Authorization: Basic ZG9yb2ZyanVAZ21haWwuY29tOmN2dnZ2dnY=
D/OkHttp: --> END GET
D/OkHttp: <-- HTTP/1.1 401 Unauthorized (258ms)
D/OkHttp: Date: Fri, 19 Feb 2016 12:57:19 GMT
D/OkHttp: X-Powered-By: Express
D/OkHttp: WWW-Authenticate: Basic realm="Users"
D/OkHttp: Keep-Alive: timeout=15, max=100
D/OkHttp: Connection: Keep-Alive
D/OkHttp: Transfer-Encoding: chunked
D/OkHttp: Content-Type: text/plain
D/OkHttp: OkHttp-Sent-Millis: 1455886639681
D/OkHttp: OkHttp-Received-Millis: 1455886639787
D/OkHttp: Unauthorized
D/OkHttp: <-- END HTTP (12-byte body)
</code></pre>
<p>Full code can be found here : <a href="https://github.com/supercairos/virtual-passport">https://github.com/supercairos/virtual-passport</a></p>
| 0non-cybersec
| Stackexchange | 1,162 | 3,160 |
How can i get animation of matrix transformations like this. <p>I found these transformations in Khan Academy and I don't know how they created the transformation example videos! I want to create transformations in this way. </p>
<p><a href="https://www.khanacademy.org/math/linear-algebra/matrix-transformations/linear-transformations/a/visualizing-linear-transformations" rel="nofollow noreferrer">https://www.khanacademy.org/math/linear-algebra/matrix-transformations/linear-transformations/a/visualizing-linear-transformations</a></p>
| 0non-cybersec
| Stackexchange | 147 | 540 |
How do I cancel the effect of "ESC-F" in "less" without canceling the running process?. <p>When I use <code>less</code>, at times I like to have things go on for a while so I use the <kbd>ESC-F</kbd> sequence key which, up to here, does what I want.</p>
<p>The only way I've found to go back to the normal <code>less</code> command is to use <kbd>Ctrl-C</kbd>. However, when I do that, it stops (Cancels) the running process.</p>
<p>What I'm looking for is a way to return to the normal <code>less</code> functionality without stopping the running process so I can look at a few things, then see the following output without having to restart my process.</p>
<p>Is there such a capability?</p>
| 0non-cybersec
| Stackexchange | 218 | 717 |
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 | 349 | 1,234 |
Ubuntu 12.10 wireless reports it is working, but actually doesnt. <p>I have Ubuntu 12.10 installed with windows 7 on a partitioned hard drive in a new gateway tower. My wireless card is made by realtek. The install went fine, I was able to connect to wireless to install updates and whatnot. However, at some point both wired and wireless internet began working poorly/not at all in Ubuntu. The aggravating part is: Ubuntu claims both are working just fine and both work great in windows. At the moment I am online with an ethernet cable which the network manager says is running at 1000mbs and also have available a wireless network at 130mbs. However the connection continually goes in and out (which is not registered in the network center, i just cant open webpages, install packages or even ping external websites). At this very moment I can chat in gchat, but cannot load new pages in ask ubuntu forums or download updates. I have spent several hours in forums trying to fix this, but am otherwise a novice with linux. I tried installing a new driver for the wireless card, but am not sure it worked, as in the install report one error message: Module 8192cu does not exist in /proc/modules. No drivers appear in software sources. Any help would be tremendously appreciated. </p>
| 0non-cybersec
| Stackexchange | 279 | 1,286 |
Simple idea to align paragraphs to a baseline grid. <p><strong>The idea</strong> was to save the vertical position right after beginning the multi columns and then count from that position the next suitable position whenever there is need to align a text paragraph to a baseline grid row.</p>
<p><strong>Problem</strong> is that after playing with the values (pt and sp) I somehow couldn't accomplish what I wanted. It doesn't seem to be enough to just adjust the <em>gridrowheight</em> length and other values (font size, linespacing and parskip) so that paragraphs on both sides would be fully aligned to the baseline grid; vertical spaces get added to certain positions, but their height is not precisely what they should be.</p>
<p>I think the problem has something to do with the position values. I feel like I'm missing something here, but at the moment I'm not sure what it is.</p>
<pre><code>\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{parskip}
\usepackage{setspace}
\usepackage{intcalc}
\usepackage{zref-savepos}
\usepackage[colaction]{multicol}
\geometry{a4paper}
\geometry{portrait}
\geometry{top=2cm,right=2cm,bottom=2cm,left=2cm}
\setlength{\parindent}{1cm}
\setlength{\parskip}{0pt}
\newlength\textstartypos
\newlength\vspacedistance
%\newlength\tempval
\newcommand{\settextstartypos}[1]{
\zsavepos{#1}
\setlength\textstartypos{\the\dimexpr\zposy{#1}sp}
%\the\dimexpr\zposy{#1}sp
}
\newlength\gridrowheight
%\addtolength\gridrowheight{40pt}
\addtolength\gridrowheight{1706432sp}
\newcommand{\skiptonextypos}[1] {
\zsavepos{#1}
\setlength\vspacedistance{\textstartypos}
\addtolength\vspacedistance{-\the\dimexpr\zposy{#1}sp}
\setlength\vspacedistance{\intcalcMod{\vspacedistance}{\gridrowheight}sp}
%\setlength\tempval{\intcalcMod{\vspacedistance}{\gridrowheight}sp}
\setlength\vspacedistance{\intcalcSub{\gridrowheight}{\vspacedistance}sp}
\vspace{\vspacedistance}
}
\begin{document}
\begin{spacing}{1.0}
\begin{multicols}{2}
\settextstartypos{textstartypos}
\lipsum[2]
\skiptonextypos{someposition1}
\lipsum[3]
\lipsum[4]
\skiptonextypos{someposition2}
\lipsum[5]
\skiptonextypos{someposition3}
\lipsum[6]
\end{multicols}
\end{spacing}
\end{document}
</code></pre>
<p><a href="https://i.stack.imgur.com/23mKC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/23mKC.png" alt="not quite aligned"></a></p>
| 0non-cybersec
| Stackexchange | 811 | 2,369 |
How to measure network bandwidth over time?. <p>I have been struggling with my internet provider for a month now. Our bandwidth is too low for the price we are paying for our internet contract.</p>
<p><strong>Is there any method/tool/program to monitor my internet bandwidth (download speed) constantly for like a day or at least for 6-8 hours?</strong> </p>
<p>I would like to <strong>make an excel or pdf from the result log</strong> so I can show them to proof that they service is too low.</p>
<p>The one-time measurements not good enough because sadly all the time when I contact their support our connection works well.</p>
<p>Thanks in advance.</p>
| 0non-cybersec
| Stackexchange | 170 | 660 |
heartbeat timeout error in tsunami deamon. <p>I am trying to transfer a large file from server A to server B using tsunami.</p>
<p>I am getting following error:</p>
<pre><code>Heartbeat timeout of 15 seconds reached, terminating transfer.
</code></pre>
<p>And here are details:</p>
<p>Receiving server:</p>
<pre><code>tsunami> get master_bkup.csv.gz
Receiving data on UDP port 46224
last_interval transfer_total buffers transfer_remaining OS UDP
time blk data rate rexmit blk data rate rexmit queue ring blk rt_len err
00:00:00.625 50 0.00M 0.6Mbps 1.9% 50 0.0G 0.6Mbps 0.0% 1 0 14140749 1 0 --
</code></pre>
<hr>
<p>Sending Server:</p>
<pre><code> n/a n/a n/a 285839 2.02 1 -- no heartbeat since 12.74s
100000 83.24us 12us 294039 2.08 1
n/a n/a n/a 294039 2.08 1 -- no heartbeat since 13.39s
100000 86.71us 12us 300189 2.12 1
n/a n/a n/a 300189 2.12 1 -- no heartbeat since 13.91s
100000 90.32us 12us 306339 2.17 1
n/a n/a n/a 306339 2.17 1 -- no heartbeat since 14.44s
100000 94.09us 12us 312489 2.21 1
n/a n/a n/a 312489 2.21 1 -- no heartbeat since 14.99s
100000 98.01us 12us 318639 2.25 1
n/a n/a n/a 318639 2.25 1 -- no heartbeat since 15.57s
Heartbeat timeout of 15 seconds reached, terminating transfer.
Server 1 transferred 14480178012 bytes in 16.20 seconds (6820.4 Mbps)
</code></pre>
| 0non-cybersec
| Stackexchange | 579 | 1,584 |
On the expectation of a path integral involving Brownian motion up to a random time. <p>Let $W$ be a one-dimensional standard Brownian motion and denote $$X_t=-\mu t + \sigma W_t, \quad t\ge 0,$$ where $\mu$ and $\sigma$ are positive constants. For $b<0$ denote the first passage time of level $b$ by $\tau$: $$ \tau:=\inf\{t\ge 0: X_t=b\}.$$ My question is: how can one find $${\mathbb E}\left[\int_0^\tau X_t dt \right]?$$ Or slightly more general, $${\mathbb E}\left[\int_0^\tau f(X_t) dt \right]$$ for some measurable function $f$? </p>
| 0non-cybersec
| Stackexchange | 173 | 544 |
How to compute the norm of the linear map $\phi:\mathcal C^0([0,1],\mathbb R) \to \mathcal C^1([0,1],\mathbb R)$?. <p>I'm doing this exercise in a lecture about linear maps between Banach spaces.</p>
<blockquote>
<p><strong>Exercise 16.</strong><sup><a href="https://i.stack.imgur.com/1uIvz.png" rel="nofollow noreferrer">(src)</a></sup> Let <span class="math-container">$E=C([0,1],\mathbb{R})$</span> with <span class="math-container">$\|f\|_{\infty}$</span>. Let <span class="math-container">$\phi$</span> defined as
<span class="math-container">$$\phi(f)(x) = \int_{0}^{x} tf(t) \, \mathrm{d}t. $$</span></p>
<ol>
<li>Show that <span class="math-container">$\phi$</span> is continuous.</li>
<li>Compute the norm of <span class="math-container">$\phi$</span>.</li>
</ol>
</blockquote>
<p>While I'm able to do (1), I unable to compute the norm of <span class="math-container">$\phi$</span>, which is <span class="math-container">$\|\phi\|$</span>.</p>
<p><strong>My questions:</strong></p>
<ol>
<li><p>Could you please verify if my proof on (1) looks fine or contains logical gaps/errors?</p>
</li>
<li><p>Please shed me some light so compute <span class="math-container">$\|\phi\|$</span>!</p>
</li>
</ol>
<p>Thank you so much for your help!</p>
<hr />
<p><strong>My attempt:</strong></p>
<ol>
<li>By <em>Fundamental Theorem of Calculus</em>, <span class="math-container">$(\phi(f))'(x) = xf(x)$</span> for all <span class="math-container">$x\in [0,1]$</span> and thus <span class="math-container">$\phi(f) \in \mathcal C^1([0,1],\mathbb R)$</span>. It is easy to verify that <span class="math-container">$\phi:\mathcal C^0([0,1],\mathbb R) \to \mathcal C^1([0,1],\mathbb R)$</span> is a linear map.</li>
</ol>
<p>We have <span class="math-container">$$\begin{aligned} \|\phi(f)\|_\infty &= \sup_{x \in [0,1]} \left| \int_0^x t f(t) \, \mathrm{d}t \right| &&\le \sup_{x \in [0,1]} \int_0^x |t f(t)| \, \mathrm{d}t \\ &\le \sup_{x \in [0,1]} \int_0^x |f(t)| \, \mathrm{d}t && \le \sup_{x \in [0,1]} \left (x \sup_{z \in [0,1]}|f(z)| \right) \\ &= \left (\sup_{z \in [0,1]}|f(z)|\right) \sup_{x \in [0,1]} \left (x \right) &&=\sup_{x \in [0,1]}|f(x)| \\ &= \|f\|_\infty\end{aligned}$$</span></p>
<p>As such, <span class="math-container">$$\|\phi\| = \sup_{f \in \mathcal C^0([0,1],\mathbb R)} \dfrac{\|\phi(f)\|_\infty}{\|f\|_\infty} \le \sup_{f \in \mathcal C^0([0,1],\mathbb R)} (1) =1$$</span></p>
<p>Since <span class="math-container">$\phi$</span> is a linear map and <span class="math-container">$\|\phi\| < \infty$</span>, <span class="math-container">$\phi$</span> is continuous.</p>
<ol start="2">
<li>We have <span class="math-container">$$\|\phi(f)\|_\infty = \sup_{x \in [0,1]} \left| \int_0^x t f(t) \, \mathrm{d}t \right| \quad \text{and} \quad \|f\|_\infty = \sup_{x \in [0,1]}|f(x)|$$</span></li>
</ol>
<p>As such, <span class="math-container">$$\|\phi\| = \sup_{f \in \mathcal C^0([0,1],\mathbb R)} \dfrac{\|\phi(f)\|_\infty}{\|f\|_\infty} = \sup_{f \in \mathcal C^0([0,1],\mathbb R)} \dfrac{\sup_{x \in [0,1]} \left| \int_0^x t f(t) \, \mathrm{d}t \right|}{\sup_{x \in [0,1]}|f(x)|}$$</span></p>
| 0non-cybersec
| Stackexchange | 1,286 | 3,162 |
is there a post render callback for Angular JS directive?. <p>I 've just gotten my directive to pull in a template to append to its element like this:</p>
<pre><code># CoffeeScript
.directive 'dashboardTable', ->
controller: lineItemIndexCtrl
templateUrl: "<%= asset_path('angular/templates/line_items/dashboard_rows.html') %>"
(scope, element, attrs) ->
element.parent('table#line_items').dataTable()
console.log 'Just to make sure this is run'
# HTML
<table id="line_items">
<tbody dashboard-table>
</tbody>
</table>
</code></pre>
<p>I am also using a jQuery Plugin called DataTables. The general usage of it is like this: $('table#some_id').dataTable(). You can pass in the JSON data into the dataTable() call to supply the table data OR you can have the data already on the page and it will do the rest.. I am doing the latter, having the rows already on the HTML page.</p>
<p>But the problem is that I have to call the dataTable() on the table#line_items AFTER DOM ready. My directive above calls the dataTable() method BEFORE the template is appended to the directive's element. Is there a way that I can call functions AFTER the append?</p>
<p>Thank you for your help!</p>
<p>UPDATE 1 after Andy's answer:</p>
<p>I want to make sure that the link method does only get called AFTER everything is on the page so I altered the directive for a little test:</p>
<pre><code># CoffeeScript
#angular.module(...)
.directive 'dashboardTable', ->
{
link: (scope,element,attrs) ->
console.log 'Just to make sure this gets run'
element.find('#sayboo').html('boo')
controller: lineItemIndexCtrl
template: "<div id='sayboo'></div>"
}
</code></pre>
<p>And I do indeed see "boo" in the div#sayboo. </p>
<p>Then I try my jquery datatable call</p>
<pre><code>.directive 'dashboardTable', ->
{
link: (scope,element,attrs) ->
console.log 'Just to make sure this gets run'
element.parent('table').dataTable() # NEW LINE
controller: lineItemIndexCtrl
templateUrl: "<%= asset_path('angular/templates/line_items/dashboard_rows.html') %>"
}
</code></pre>
<p>No luck there</p>
<p>Then I try adding a time out :</p>
<pre><code>.directive 'dashboardTable', ($timeout) ->
{
link: (scope,element,attrs) ->
console.log 'Just to make sure this gets run'
$timeout -> # NEW LINE
element.parent('table').dataTable()
,5000
controller: lineItemIndexCtrl
templateUrl: "<%= asset_path('angular/templates/line_items/dashboard_rows.html') %>"
}
</code></pre>
<p>And that works. So I wonder what goes wrong in the non-timer version of the code? </p>
| 0non-cybersec
| Stackexchange | 874 | 2,783 |
ktpass.exe failing with ldap_open failed for default server: 0x3a. <p>I am trying to generate a keytab file <a href="https://blogs.technet.microsoft.com/pie/2018/01/03/all-you-need-to-know-about-keytab-files/" rel="nofollow noreferrer">using the instructions online here</a>. No matter what I do, whether I run this on a domain controller, a member server, in PowerShell as administrator, in cmd as administrator, I get the same error:</p>
<pre><code>ktpass /out app1.keytab /princ http/[email protected] /mapuser mlservice /crypto AES256-SHA1 /ptype KRB5_NT_PRINCIPAL /pass myP@ssword477 /target adtrml0.ml.test
Using legacy password setting method
FAIL: ldap_open failed for default server: 0x3a.
</code></pre>
<p>I cannot seem to find any information online about this error.</p>
<p>I even tried creating a fresh domain with a single DC and running this on the new DC right after promoting it, and I still get this error.</p>
<p>Any idea what this is all about and how I can address it?</p>
| 0non-cybersec
| Stackexchange | 319 | 1,005 |
Getting my first tattoo this weekend. . In a couple days I'm getting my first tat. Its the word **Change**, under my left peck. I want it in a script, not sure what the name of the specific script is called, but its something like [this](http://rukru.com/wordpress/wp-content/uploads/2010/05/rukru-los-angeles-script.jpg) or [this](http://c3.ac-images.myspacecdn.com/images01/49/l_9823a5123d5865a6460b233c7ed0b8aa.jpg), only the words though. I just call it Los Angeles script. Because I see it in a lot of LA stuff. I dont want to be too flashy, with the swirls and whatnot. I just want the word, nice and clean looking. I already asked for a price estimate, which came out to be around 100, since its a simple piece.
I just wanted to know, since it's my first one and I don't know much out tattoo etiquette, **how much would a reasonable tip be?** I know they'll do a good job. Their portfolio is amazing. And they know how to do the script style I want.
Any feedback is appreciated. | 0non-cybersec
| Reddit | 285 | 989 |
How do I avoid "Argument list too long" errors when compressing thousands of files?. <p>I have 200,000 XML files in the folder on a RHEL7 Linux server. I need to zip all 200,000 XML files. I am using the Tar command but getting the error "Argument list too long" is there any other way in this 200,000 need zip only 10,000</p>
<pre><code>tar -cvf xml.tar *.xml
</code></pre>
<p>All xml files need to be archived separately as individual archive that has original file name in the archive name. </p>
<p>Original files:</p>
<pre><code>1.xml
2.xml
...
n.xml
</code></pre>
<p>Result of archiving OP wants:</p>
<pre><code>1.xml.tgz
2.xml.tgz
...
n.xml.tgz
</code></pre>
| 0non-cybersec
| Stackexchange | 228 | 683 |
What did the system call "tuxcall" do?. <p>In <code>include/x86_64-linux-gnu/asm/unistd_64.h</code>, I see a system call named <code>tuxcall</code>,</p>
<pre><code>#define __NR_tuxcall 184
</code></pre>
<p>There is nothing about it in <code>man tuxcall</code> except to say that it's an <em>unimplemented system calls</em>. What did it do? Was it never implemented, or did it do something in antiquity?</p>
| 0non-cybersec
| Stackexchange | 150 | 419 |
How can I get the relative position of a cell in a range?. <p>I have a range of cells in a workbook, and I want to dynamically replicate them in another workbook. I don't want to use explicit cell references in case the range is moved, I always try to use named ranges for cross-workbook references. So I want to enter a formula in the replicated workbook that uses the named range to get the value that is in the same position. I need to calculate what values to use in the parameters to the OFFSET() function.</p>
<p>What I want is something like this:</p>
<pre><code>=OFFSET('Book1'!NamedRange,x,y)
</code></pre>
<p>What can I put into x and y to calculate the current cell's relative position within a same-sized area in Workbook 2?</p>
<p>Or, is there another way to replicate a named range from one workbook into another?</p>
| 0non-cybersec
| Stackexchange | 223 | 836 |
Let $p$ be a prime number. Prove that in the field $\mathbb Z_p$ the following is true $(x+y)^p= x^p + y^p$. <blockquote>
<p>Let $p$ be a prime number. Prove that in the field $\mathbb Z_p$ the following is true $(x+y)^p= x^p + y^p$</p>
</blockquote>
<p>My idea to do this is to apply the binomial theorem, namely: <br>
$$(x+y)^p = x^p + px^{p-1}y+ {p \choose 2}x^{p-2}y^2+ \dots+ {p \choose {p-2}}x^2y^{p-2}+ pxy^{p-1} + y^p$$
Now, I have made an observation (I do not know if this is true): <br>
$$(\forall n)((n \in \mathbb Z_5 \land n \ne 0 \land n \ne p) \Rightarrow (\exists q\in \mathbb Z_p)({p\choose n}= pq) $$
And so all of these elements corresponding to $n \in \{1,2, \dots, p-2, p-1 \}$ will turn into zeros, and the only remaining elements will be $x^p$ and $y^p$. Is my reasoning good? If so, should I have used induction here?</p>
| 0non-cybersec
| Stackexchange | 336 | 851 |
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 | 349 | 1,234 |
Silver Screen Shower Scene. Imagine, if you will, you coming out of your bedroom to go to the bathroom in the middle of the night fresh out of rubbing one out. Your hand is still in your underwear, your face is flushed and you're missing a sock. It's darker than the devil's asshole in the hallway so you reach out for the switch with your cleaner hand and flick it on and you see at the end of the hall, staring right back at you, the very living example of all those aliens you saw on the discovery channel. Big fucking huge black eyes in a bigger head and a slender, slate gray body and spindly spider fingers at the end of its skinny arms. Your body stops and your heart goes supersonic as you feel the contents of your bladder empty into the tissue in your hand. It runs from your sight and you scream. Or at least try to. The only sound leaving your mouth is a dry gasp like some retarded fish out of water. And here you are, dick in hand, half-undressed and making your first impression on the one thing you hoped never to meet. That's when the white lights come on from every where with a noise not unlike the sound of God telling you to go fuck yourself and your second attempt at a scream results in your projectile vomiting all over the hallway floor before you faint and it all goes black.
This was Tuesday. | 0non-cybersec
| Reddit | 291 | 1,320 |
Spark 2.1: Out of Memory when Writing DataFrame to parquet file?. <p>I am trying to write a DataFrame (approx 14 million rows) to a local parquet file, but I keep running out of memory doing so. I have a big map <code>val myMap : Map[String,Seq[Double]]</code> and use this map in a <code>udf</code> for a very large DataFrame via <code>val newDF = df.withColumn("stuff",udfWithMap)</code>. I have 128G of RAM available and after persisting the DataFrame to DISK_ONLY and performing <code>df.show</code>, I still have around 100G of RAM left. However, when I try <code>df.write.parquet</code>, the amount of memory Spark needs skyrockets and I run out of memory. I have also tried broadcasting <code>myMap</code>, but doing so doesn't seem to have any effect on memory. What is the problem?</p>
<p>This is a sample of my code:</p>
<pre><code>scala> type LookupMapSeq = (String, Seq[Double])
scala> val myMap = sc.objectFile[LookupMapSeq]("file:///data/dir/myMap").collectAsMap()
/* myMap.size is about 150,000 and each Seq[String] is of size 200 */
scala> val combineudf = functions.udf[Seq[Double], Seq[String]] { v1 =>
val wordVec = v1.map(y => myMap.getOrElse(y, Seq.fill(200)(0.0)))
wordVec.foldLeft(Seq.fill(200)(0.0)) { case (acc, list) =>
acc.zipWithIndex.map { case (value, i) => value + list(i) }
}
}
scala> import org.apache.spark.storage.StorageLevel
scala> val df6 = df3.withColumn("sum", combineudf(df3("filtered"))).persist(StorageLevel.DISK_ONLY)
scala> df6.show
+--------+--------------------+--------------------+-------------------
-+
| pmid| filtered| TFIDFvec| sum|
+--------+--------------------+--------------------+--------------------+
|25393341|[retreatment, rec...|[0.0, 26.21009534...|[4.34963607663623...|
|25394466|[lactate, dehydro...|[21.3762879413052...|[-17.550128685500...|
|25394717|[aim, study, inve...|[3.11641169932197...|[-54.981726214632...|
scala> df6.write.parquet("file:///data/dir/df6")
/* This results in out of memory */
</code></pre>
| 0non-cybersec
| Stackexchange | 707 | 2,080 |
subprocess gets killed even with nohup. <p>I'm using <code>subprocess.Popen</code> to launch several processes.</p>
<p>The code is something like this:</p>
<pre><code>while flag > 0:
flag = check_flag()
c = MyClass(num_process=10)
c.launch()
</code></pre>
<p><code>MyClass</code> if something like the following:</p>
<pre><code>MyClass(object)
def __init__(self, num_process):
self.num_process = num_process
def launch(self):
if self.check_something() < 10:
for i in range(self.num_process):
self.launch_subprocess()
def launch_subprocess(self):
subprocess.Popen(["nohup",
"python",
"/home/mypythonfile.py"],
stdout=open('/dev/null', 'w'),
stderr=open('logfile.log', 'w'),
shell=False)
</code></pre>
<p>In most of the cases, the launched subprocess dies, sometimes in the middle of the run. In some cases, it completes.</p>
<p>However, if I use <code>subprocess.Popen</code> directly in the while loop, the process continues and finished timely.</p>
<p>Could someone tell me how can I get the processes to run in the background by using subprocess in the way as I described above?</p>
| 0non-cybersec
| Stackexchange | 379 | 1,273 |
Difficulty understanding Javascript composing in this function. <p>Im following this course and came across this problem</p>
<pre><code>const compose = (f, g) => (a) => f(g(a));
const add1 = (num) => num + 1;
const add5 = (num) => num + 5;
compose(add1, add5)(10)
</code></pre>
<p>As i understand it <code>g(a)</code> gets run first so <code>num = 1</code> makes <code>1</code> for <code>g</code> and <code>10</code> for <code>a</code>, that makes it <code>f(1(10))</code>.
But how does the <code>1</code> and the <code>10</code> know to add, why doesn't it multiply or minus ?</p>
| 0non-cybersec
| Stackexchange | 220 | 596 |
Stabilizer of a 4 by 4 skew symmetric matrix by orthogonal matrix. <p>Matrices are over the field of complex numbers, and $X^t$ means transpose of a matrix $X$.</p>
<p>Consider the group action of $O(4)=\{P\mid PP^t=I\}$ on $SK(4)=\{M\mid M^t=-M\}$ by $(P,M) \rightarrow PMP^t$. Does anyone know what is the stabilizer of a general $M$?</p>
<p>Thank you!</p>
| 0non-cybersec
| Stackexchange | 132 | 361 |
How blockchain.info calculate the value transacted. <p>Having this address: <a href="https://blockchain.info/address/19tqZYnP9youKtbene2FZiZtZyJYaLeBDw" rel="nofollow noreferrer">https://blockchain.info/address/19tqZYnP9youKtbene2FZiZtZyJYaLeBDw</a></p>
<p>The last transaction says that this address received <code>0.0236 BTC</code></p>
<p>But even knowing the value in and the value out I am not able to calculate that value:
<a href="https://blockchain.info/tx/831c976cb54f27e5a496db749fc9e865c8e077006225d1dfaf61d998fe5a3186" rel="nofollow noreferrer">https://blockchain.info/tx/831c976cb54f27e5a496db749fc9e865c8e077006225d1dfaf61d998fe5a3186</a></p>
<pre><code>In:
---
15Rhv2dsEjFaHzMhPsjGmFxgqCRhCmggjj (0.04583825 BTC - Output)
13LwYeB93Bmo2aWqGyK1ybtF9JiupPFVey (0.029625 BTC - Output)
1BxdV34eTe1YJBJpScGx6jRRVDQBeRf5qj (0.00696224 BTC - Output)
Out:
----
1BTvKHzbfm3RjPMxDZSsG2YYuaEHgfdJNP - (Spent) 0.00045884 BTC
1NCLWFw6F2nJ2pgBWy96K37rbx7VSLZs66 - (Unspent) 0.00239111 BTC
1D7BNbWBPuL22TW6WuoSq5sRrbPAxeJw8g - (Spent) 0.0156 BTC
19tqZYnP9youKtbene2FZiZtZyJYaLeBDw - (Unspent) 0.0236 BTC
1wLbaePtYhh2t5Cgd5NF59LX6Pooe1yLH - (Spent) 0.00920259 BTC
3HXAkXTYvtLzYuudDfNZBMSoueUtvdwXAz - (Unspent) 0.03036754 BTC
</code></pre>
<p>What I tried is sum all the In's and then substract the Out that has been spent and the fees.</p>
<p>What I am doing wrong? How I can calculate 0.0236 BTC</p>
| 0non-cybersec
| Stackexchange | 684 | 1,405 |
Using xargs to generate links. <p>I have a <code>file</code> that looks like this:</p>
<pre><code>abc,123,x
xabc,345,xy
cabc,6234,ab
abgc,12,yo
jabc,9991,to
</code></pre>
<p>I need to generate a list of links:</p>
<pre><code>http://www.mywebsite.com?param1=abc&param2=123&param3=x
http://www.mywebsite.com?param1=xabc&param2=345&param3=xy
</code></pre>
<p>...and so on.</p>
<p>How do I do this with <code>xargs</code>/<code>sed</code> or whatever?</p>
| 0non-cybersec
| Stackexchange | 207 | 473 |
UTF - 8 with JPA and Glassfish 4.0. <p>I am having difficulties with UTF-8 characters. This is a simple JSF project. I use JSF 2.2 and Glassfish 4.0</p>
<p>I have a method where I go:</p>
<pre><code>em.persist(user);
</code></pre>
<p>When I debug</p>
<pre><code>user.getName()
</code></pre>
<p>in this point, I can see the utf-8 characters in my IDE. Also I keep the string in a session - bean and I can see them on the browser fine as well. </p>
<p>Only when they are persisted to DB, they are persisted as: ?????</p>
<p>I can also edit the DB myself and save utf-8 characters. What I mean is, my SQL configuration is good for UTF-8.</p>
<p>The problem is somewhere in JPA. </p>
<p>This is what I have tried: ( all together: )</p>
<p>persistence.xml</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="Persistence" transaction-type="JTA">
<jta-data-source>fus</jta-data-source>
<class>com.tugay.fup.core.model.User</class>
<properties>
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost:3306/fus?useUnicode=yes&amp;characterEncoding=UTF-8"/>
</properties>
</persistence-unit>
</persistence>
</code></pre>
<p>This is glassfish-web.xml:</p>
<pre><code><glassfish-web-app>
<parameter-encoding default-charset="UTF-8"/>
</glassfish-web-app>
</code></pre>
<p>And I am using EntityManager managed by container (transaction type = JTA)</p>
<p>So in JDBC connection pools in Glassfish I have:</p>
<pre><code>jdbc:mysql://localhost:3306/fus?useUnicode=true&connectionCollation=utf8_general_ci&characterSetResults=utf8
</code></pre>
<p>for: property: URL...</p>
<p>However none of these help.</p>
<p>Still characters not persisted correctly.</p>
| 0non-cybersec
| Stackexchange | 723 | 1,994 |
AITA for sleeping with my best friends ex gf?. So my bestfriend/roomate was dating this girl that he met from our job (we both work at the same UPS hub). He works the evening shift, while I work the graveyard shift and there's this girl I saw that I was really attracted to. I was reluctant to approach her because I am her indirect supervisor ( She wasn't my dedicated employee but I would frequently cover for her supervisor or relay directions to her group for operational purposes)
Fast forward they have been dating for a year or more. One day he ends the relationship and they go their separate ways. He didn't feel the same way about her that she did towards him. I made no effort to talk to her whatsoever.
Fast forward again about a year and a half later he has a new gf that he's really serious about. One day his ex reaches out to me to buy some weed from me (I was growing at the time and would post pictures om my snapchat). I met up with her to sell her some bud and she asked me to hangout for a little bit and I agreed. I had absolutely no intention of hooking up with her, because of her history with my roommate, but one thing led to another and we ended up sleeping together. It happened several more times after this mainly because I felt very comfortable around her and enjoyed her company.
One day I decided to tell him what was going on, because I don't like to keep secrets from my close friends. Initially he just brushed it off, but the next day he told me he felt like I betrayed him and it was fucked up that I had hooked up with her on several different occasions.
For me I feel like I did nothing wrong because i didn't initiate or seek her out, but also because he was the one who broke up with her and on top of that it has been well over a year AND he has a new gf who he is in love with. He said he still has strong feelings for her and if that's true than why did you end the relationship? He told me to promise him that I would never see her again and I agreed.
Am I wrong for wanting to be around someone that makes me feel like I am cared about eventhough they have history with a very close friend of mine? I didn't want to get inimate with her, she initiated it and I didn't stop her because it felt right and I was very lonely. Is it more important that I keep him happy or pursue my own happiness?
TLDR; my roommate broke up with his gf a year and a half ago and currently has a new gf. His ex contacted me and we ended up getting intimate with eachother unintentionally (at least on my behalf I can't speak for her intentions). I felt the need to confess this to him and he feels like I betrayed our friendship and wants me to promise never to talk to her again. He feels like he can't trust me anymore.
| 0non-cybersec
| Reddit | 631 | 2,759 |
Creating several precompiled header files using GNU make. <p>I use gcc (running as <code>g++</code>) and GNU make.
I use gcc to precompile a header file <code>precompiled.h</code>, creating <code>precompiled.h.gch</code>; the following line in a Makefile does it:</p>
<pre><code># MYCCFLAGS is a list of command-line parameters, e.g. -g -O2 -DNDEBUG
precompiled.h.gch: precompiled.h
g++ $(MYCCFLAGS) -c $< -o $@
</code></pre>
<p>All was well until i had to run <code>g++</code> with different command-line parameters.
In this case, even though <code>precompiled.h.gch</code> exists, it cannot be used, and the compilation will be much slower.
In the gcc documentation i have read that to handle this situation,
i have to make a directory called <code>precompiled.h.gch</code> and put
the precompiled header files there,
one file for each set of <code>g++</code> command-line parameters.</p>
<p>So now i wonder how i should change my Makefile to tell <code>g++</code> to create
the gch-files this way.
Maybe i can run <code>g++</code> just to test whether it can use any existing file
in the <code>precompiled.h.gch</code> directory,
and if not, generate a new precompiled header with a unique file name.</p>
<p>Does gcc have support for doing such a test?</p>
<p>Maybe i can implement what i want in another way?</p>
| 0non-cybersec
| Stackexchange | 413 | 1,329 |
Why can't I use a list as a dict key in python?. <p>I'm a bit confused about what can/can't be used as a key for a python dict. </p>
<pre><code>dicked = {}
dicked[None] = 'foo' # None ok
dicked[(1,3)] = 'baz' # tuple ok
import sys
dicked[sys] = 'bar' # wow, even a module is ok !
dicked[(1,[3])] = 'qux' # oops, not allowed
</code></pre>
<p>So a tuple is an immutable type but if I hide a list inside of it, then it can't be a key.. couldn't I just as easily hide a list inside a module?</p>
<p>I had some vague idea that that the key has to be "hashable" but I'm just going to admit my own ignorance about the technical details; I don't know what's really going on here. What would go wrong if you tried to use lists as keys, with the hash as, say, their memory location?</p>
| 0non-cybersec
| Stackexchange | 261 | 799 |
Python: Summing x elements in a list. <p>i wasn't able to find the answer using the search function so i am starting this thread.</p>
<p>Consider having a list that is divideable by x.
For example:</p>
<pre><code>onetonine = [1,2,3,4,5,6,7,8,9]
</code></pre>
<p>The example x would be 3 in this case.</p>
<p>Now i want to create a new list with </p>
<pre><code>len(onetonine)/x
</code></pre>
<p>elements, which would mean 3 elements.</p>
<p>The important part is, that i want the elements of the new list to be the sum of every x elements of the old list.
This means:</p>
<pre><code>newlist = [6, 15, 24]
</code></pre>
<p>So basically take x=3 elements of my old list and add them. Repeat until done.</p>
<p>I wasn't able to get a working solution for this so i am asking for help.</p>
<p>Thank you.</p>
| 0non-cybersec
| Stackexchange | 286 | 815 |
graphviz: record node with a bold title. <p>I'm trying to use graphviz to do something similar to UML class diagrams.</p>
<p>I wonder whether there is a way to make a node of style 'register' have its first field in a bold font, to make it different from the other fields.</p>
<p>My node looks like this:</p>
<pre><code>digraph i {
"node" [
label = "<f0> title | <f1> index | ... | <f2> field1 | <f3> field2"
shape = "record"
];
}
</code></pre>
<p>I tried this but it doesn't work: (embedding html)</p>
<pre><code>digraph i {
"node" [
label = "<f0> <B>title</B> | <f1> index | ... | <f2> field1 | <f3> field2"
shape = "record"
];
}
</code></pre>
| 0non-cybersec
| Stackexchange | 296 | 741 |
How small must $x$ be to have $\frac{1}{2} \cdot 10^{-8}$ accuracy?. <blockquote>
<p>For small values of $x$, how good is the approximation $cos(x)\approx 1$? How small must $x$ be to have $\frac{1}{2} \cdot 10^{-8}$ accuracy?</p>
</blockquote>
<p>My teacher told me, it would be easier to do the second part of the question first, so I need to find out how small $x$ be to have $\frac{1}{2} \cdot 10^{-8}$ accuracy</p>
<p>So as far as I understand, I need to solve for $x$ in the following equation </p>
<p>$|cos(x)-1|<\frac{1}{2} \cdot 10^{-8} \Rightarrow \\
|x| < \ arccos(1-\frac{1}{2} \cdot 10^{-8}) \Rightarrow \\
x \in \ (-arccos(1-\frac{1}{2} \cdot 10^{-8}),arccos(1-\frac{1}{2} \cdot 10^{-8}))$</p>
<p>but that just seems like a messy answer. Any ideas?</p>
| 0non-cybersec
| Stackexchange | 297 | 780 |
Holder Continuous Functions on $[0,1]$ are complete + Banach space. <p>I am studying for an Analysis prelim and I am stuck on how to show that the following space of Holder continuous functions is complete:</p>
<p>$$\Lambda_{\alpha}([0,1]) = \{f: [0,1] \rightarrow \mathbb{R} \mid \sup_{x,y \in [0,1], x\neq y} \frac{|f(x) - f(y)|}{|x-y|^{\alpha}} < \infty \text{ and } 0< \alpha \leq 1\}$$
with the norm $\| \cdot \|_{\Lambda_{\alpha}}$ defined by
$$\|f\|_{\Lambda_{\alpha}} = |f(0)| + \sup_{x,y \in [0,1], x\neq y} \frac{|f(x) - f(y)|}{|x-y|^{\alpha}}$$
I think its easy to see that $\Lambda_{\alpha}([0,1]) \subset B([0,1])$, i.e., it is a subset of bounded functions on $[0,1]$ which is complete. My thought is that if I let $\{f_n\}$ be a Cauchy sequence in $\Lambda_{\alpha}([0,1])$ and let $f \in B([0,1])$, such that $f_n \rightarrow f$ in the uniform norm, then we can show $f \in \Lambda_{\alpha}([0,1])$ and that $f_n \rightarrow f$ in the Holder norm defined above. Not sure how to show this though. Perhaps I could also somehow show that any absolutely convergent series converges in $\Lambda_\alpha$, but I'm not sure how to do this either. Any help would be appreciated.</p>
| 0non-cybersec
| Stackexchange | 400 | 1,202 |
Nested objects have not been saved by Spring JpaRepository. <p>I have a Spring Roo application with GWT. On server-side I´ve got simple JpaRepository interfaces for all entities like:</p>
<pre><code>@Repository
public interface MyEntityRepository extends JpaSpecificationExecutor<MyEntity>, JpaRepository<MyEntity, Long> {
}
</code></pre>
<p>There is a MyEntity class that has a One-To-One relationship to a MyOtherEntity class.
When I call my entity-service persist method</p>
<pre><code>public void saveMyEntity (MyEntity myEntity) {
myEntityRepository.save(myEntity);
}
</code></pre>
<p>only the myEntity object will be saved. All sub objects of MyEntity are ignored. The only way to save the myEntity object along with the myOtherEntity object is calling </p>
<pre><code> myOtherEntityRepository.save(myOtherEntity);
</code></pre>
<p>before the above code. So is there a more elegant way to automatically save sub objects with JpaRepository interface?</p>
| 0non-cybersec
| Stackexchange | 279 | 985 |
Lagrange's identity in the complex form. <p>I am trying to show Lagrange's identity in the complex form; that is,
$$
\Bigl\lvert\sum_{i = 1}^na_ib_i\Bigr\rvert^2 = \sum_{i = 1}^n\lvert a_i\rvert^2\sum_{i = 1}^n\lvert b_i\rvert^2 - \sum_{1\leq i\lt j\leq n}
\lvert a_i\bar{b}_j - a_j\bar{b}_i\rvert^2
$$
Then
\begin{align}
\Bigl\lvert\sum_{i = 1}^na_ib_i\Bigr\rvert^2 &=
\Bigl(\sum_{i = 1}^na_ib_i\Bigr)\Bigl(\sum_{j = 1}^n\bar{a}_j\bar{b}_j\Bigr)\\
&= \sum_{i,j=1}^na_i\bar{a}_jb_i\bar{b}_j\\
&= \begin{aligned}
a_1\bar{a}_1b_1\bar{b}_1 &+ \cdots + a_n\bar{a}_1b_n\bar{b}_1+\\
\vdots\phantom{....} & \phantom{...}\ddots\phantom{......}\vdots\phantom{.....}+\\
a_1\bar{a}_nb_1\bar{b}_n &+ \cdots + a_n\bar{a}_nb_n\bar{b}_n
\end{aligned}
\end{align}
I see that down the diagonals I will have $\sum_{i=1}^n\lvert a_i\rvert^2\sum_{i=1}^n\lvert b_i\rvert^2$ which leaves me with
$$
\sum_{1\leq i\leq j\leq n}a_i\bar{a}_jb_i\bar{b}_j+a_j\bar{a}_ib_j\bar{b}_i\tag{1}
$$
but I don't see how equation $(1)$ is equal to
$$
\lvert a_i\bar{b}_j - a_j\bar{b}_i\rvert^2 = \lvert a_i\rvert^2\lvert b_j\rvert^2 + \lvert a_j\rvert^2\lvert b_i\rvert^2 - a_i\bar{a}_jb_i\bar{b}_j - a_j\bar{a}_ib_j\bar{b}_i.
$$</p>
| 0non-cybersec
| Stackexchange | 622 | 1,227 |
Simple method of detecting and reporting server outage?. <p>I'm looking for a super simple way to monitor one server from another, in case the other goes down (e.g. based on ping), and then send an email if it does. Is there anything out there like this installable via the standard package manager (debian)? I'm aware of things like nagios and monit, but these are much more complex than I need.</p>
<p>(The servers are on a private network, so I can't use third party web services)</p>
<p>Thanks</p>
| 0non-cybersec
| Stackexchange | 133 | 506 |
How To Make Ubuntu 13.04 Work With DisplayLink Monitor?. <p>I recently purchased an <a href="http://rads.stackoverflow.com/amzn/click/B0073BOCNU">AOC E2251FWU DisplayLink</a> monitor. When I plug this into my <a href="https://www.system76.com/laptops/model/gazp9">System76 Gazelle Professional</a> running Ubuntu 13.04 Raring Ringtail, nothing happens. Under 'displays', no additional display is detected. On Mac and Windows, this monitor is plug-and-play after installing DisplayLink's drivers.</p>
<p>Having read that previous versions of Ubuntu had plug and play support for DisplayLink monitors, I'm surprised that Ubuntu 13.04 does not! The 'xserver-xorg-displaylink' driver is not available in the 13.04 repositories. I read that it has become baked into the Linux kernel.</p>
<p>Does anybody know how to get a DisplayLink device to actually work on Ubuntu 13.04? I'm looking to get a simple extended display. I've done my due dilligence and Googled around, but no solution I can find works for me.</p>
<pre><code>> uname -a
Linux tyrion 3.8.0-26-generic #38-Ubuntu SMP Mon Jun 17 21:43:33 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
> lsmod
Module Size Used by
joydev 17377 0
pci_stub 12622 1
vboxpci 23194 0
vboxnetadp 25670 0
vboxnetflt 23479 0
vboxdrv 320372 3 vboxnetadp,vboxnetflt,vboxpci
parport_pc 28152 0
ppdev 17073 0
rfcomm 42641 0
bnep 18036 2
bluetooth 228619 10 bnep,rfcomm
ip6t_REJECT 12545 1
snd_hda_codec_hdmi 36913 1
xt_hl 12521 6
ip6t_rt 12529 3
snd_hda_codec_via 51018 1
coretemp 13355 0
kvm_intel 132891 0
nf_conntrack_ipv6 18335 7
nf_defrag_ipv6 13201 1 nf_conntrack_ipv6
snd_hda_intel 39619 3
kvm 443165 1 kvm_intel
ipt_REJECT 12541 1
xt_comment 12504 4
arc4 12615 2
xt_LOG 17400 10
snd_hda_codec 136453 3 snd_hda_codec_hdmi,snd_hda_codec_via,snd_hda_intel
xt_multiport 12597 4
snd_hwdep 13602 1 snd_hda_codec
xt_limit 12711 13
xt_tcpudp 12603 22
snd_pcm 97451 3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
xt_addrtype 12635 4
iwldvm 241872 0
uvcvideo 80847 0
nf_conntrack_ipv4 14487 7
snd_page_alloc 18710 2 snd_pcm,snd_hda_intel
nf_defrag_ipv4 12729 1 nf_conntrack_ipv4
snd_seq_midi 13324 0
xt_state 12578 14
snd_seq_midi_event 14899 1 snd_seq_midi
mac80211 606457 1 iwldvm
videobuf2_vmalloc 13056 1 uvcvideo
videobuf2_memops 13202 1 videobuf2_vmalloc
snd_rawmidi 30180 1 snd_seq_midi
videobuf2_core 40513 1 uvcvideo
videodev 129260 2 uvcvideo,videobuf2_core
ip6table_filter 12815 1
ip6_tables 27025 1 ip6table_filter
snd_seq 61554 2 snd_seq_midi_event,snd_seq_midi
nf_conntrack_netbios_ns 12665 0
nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns
snd_seq_device 14497 3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer 29425 2 snd_pcm,snd_seq
nf_nat_ftp 12620 0
nf_nat 25867 1 nf_nat_ftp
iwlwifi 173477 1 iwldvm
nf_conntrack_ftp 13342 1 nf_nat_ftp
nf_conntrack 83275 8 nf_nat_ftp,nf_conntrack_netbios_ns,nf_nat,xt_state,nf_conntrack_broadcast,nf_conntrack_ftp,nf_conntrack_ipv4,nf_conntrack_ipv6
microcode 22881 0
snd 68876 16 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_via,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
iptable_filter 12810 1
ip_tables 26995 1 iptable_filter
psmouse 95870 0
rtsx_pci_ms 13011 0
cfg80211 510937 3 iwlwifi,mac80211,iwldvm
lp 17759 0
soundcore 12680 1 snd
mei 41158 0
lpc_ich 17061 0
memstick 16554 1 rtsx_pci_ms
serio_raw 13215 0
mac_hid 13205 0
x_tables 29803 15 ip6table_filter,xt_hl,xt_comment,ip_tables,xt_tcpudp,xt_limit,xt_state,xt_LOG,xt_multiport,iptable_filter,ip6t_rt,ipt_REJECT,ip6_tables,xt_addrtype,ip6t_REJECT
parport 46345 3 lp,ppdev,parport_pc
dm_crypt 22820 1
udl 24771 0
drm_usb 13134 1 udl
syscopyarea 12529 1 udl
sysfillrect 12701 1 udl
sysimgblt 12674 1 udl
rtsx_pci_sdmmc 17475 0
ghash_clmulni_intel 13259 0
aesni_intel 55399 4
aes_x86_64 17255 1 aesni_intel
xts 12885 1 aesni_intel
lrw 13257 1 aesni_intel
gf128mul 14951 2 lrw,xts
ablk_helper 13597 1 aesni_intel
cryptd 20373 4 ghash_clmulni_intel,aesni_intel,ablk_helper
i915 600396 4
i2c_algo_bit 13413 1 i915
wmi 19070 0
drm_kms_helper 49394 2 udl,i915
video 19390 1 i915
ahci 25731 2
drm 286028 7 udl,i915,drm_usb,drm_kms_helper
libahci 31364 1 ahci
r8169 67446 0
rtsx_pci 33355 2 rtsx_pci_ms,rtsx_pci_sdmmc
</code></pre>
| 0non-cybersec
| Stackexchange | 1,952 | 5,618 |
Confused about Linux "route add" commands for this diagram. <p>I am confused about this <a href="https://www.cs.umb.edu/~gghinita/it443/network-diagram.pdf" rel="nofollow noreferrer">network diagram</a>. </p>
<p>In class the router R1 was assigned to me and other students were given various routers/workstations on the diagram. Our task was to set the network up with ifconfig and route commands. Since the main router only really had one physical interface, we used an alias as well (eth0 and eth0:1).</p>
<p>I used the following commands to set up R1 (initially I had the gateways wrong) but my professor corrected me:</p>
<pre><code># set interfaces (1 physical/1 virtual)
ifconfig eth0 10.0.0.4/24
ifconfig eth0:1 10.0.14.252/24
# Add routes for remaining 4 LANs:
route add -net 10.0.12.0 netmask 255.255.255.0 gw 10.0.14.27
route add -net 10.0.17.0 netmask 255.255.255.0 gw 10.0.14.34
route add -net 10.0.7.0 netmask 255.255.255.0 gw 10.0.14.27
route add -net 10.0.28.0 netmask 255.255.255.0 gw 10.0.14.34
# once everyone can ping eachother successfully
# connect the entire 10.0.0.0/24 network to the
# outside 192.168.104.0/22 network
route add default gw 10.0.0.1
# set up forwarding to outside gateway
sysctl -w net.ipv4.ip_forward=1
</code></pre>
<p>I am most confused about why the gw's for the route commands are 10.0.14.34 and 10.0.14.27.</p>
<p>What would the route commands and gateways be for R3 or R5? Or R2 and R4? I can see that a router's two adjacent networks get added with the two ifconfig commands; there is no need to set their routes. But I am really getting confused on what each side of each router is using for a gateway. </p>
<p>Any help is very much appreciated! Thank you. </p>
| 0non-cybersec
| Stackexchange | 590 | 1,749 |
Hilbert-Schmidt operator defined by non-orthogonal basis. <p>I have the following operator on $L^2(0,1)$</p>
<p>$$ Tf = \sum_{n \geq 0} 2^{-n}\langle f,v_n\rangle v_n$$</p>
<p>Where $v_n(t) = t^n$.</p>
<p>I was able to prove that it is Hilbert-Schmidt, but now I need to calculate its Hilbert-Schmidt norm, and its integral kernel. The problem is that it is defined through an indipendent system of vectors (the polynomials) which are dense but not orthogonal (if it had been $v_n(t) = \exp(2\pi i nt)$ it would have been much easier. How do I identify the eigenvectors?</p>
<p>I was thinking about setting $t = \exp(2\pi i x)$ and reduce to the orthogonal case somehow but I reach incorrect results, I am not sure of where I am doing wrong.</p>
<p>Can anybody help me?</p>
| 0non-cybersec
| Stackexchange | 257 | 779 |
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 | 349 | 1,234 |
Same program, same JVM, but vastly different memory requirements and execution time on different machines - why?. <p>I'm trying to run a <a href="http://ccl.northwestern.edu/netlogo/" rel="nofollow noreferrer">NetLogo</a> (a java simulation framework) simulation on a cluster as part of a large experiment. I was surprised at the seemingly massive memory requirement of a (relatively) simple simulation. On the cluster it throws "java.lang.OutOfMemoryError: Java heap space" exceptions for anything less than "-Xmx2500M" heapsizes. A single execution takes 5 hours to run. I ran the same experiment on both my Macs (iMac and MacBook Pro), and they executed in less than one hour, with "-Xmx1024" giving no errors. The cluster jobs require "-XX:MaxPermSize=250M" whereas on my Macs no increase above default is required. I ran the same code, the same inputs, using the exact same jars in all cases. </p>
<p>64 bit JVMs are used in each case (and as far as I know these are pretty similar):</p>
<pre><code><on the cluster>
$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
<on my macs>
$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04-415-10M3646)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01-415, mixed mode)
</code></pre>
<p>And I am running Client JVM in all cases (was initially using Server on cluster, switching to client made no difference). I have tried executing on the cluster with java 7, same huge memory and execution time issues. </p>
<p>I am completely perplexed, no one I have spoken to can explain this. Has anyone out there come across this before? Any help greatly appreciated!</p>
| 0non-cybersec
| Stackexchange | 515 | 1,770 |
Wifi Problem with dual booting Ubuntu 14.04 and Windows 8.1. <p>So I've installed both Windows 8.1 and Ubuntu (dual-booting), and the for the most part, I have followed instructions. However, right now I can't figure out why my wifi on my Ubuntu does not work. When I click on the Network icon, the "Enable Wifi" does not even appear. </p>
<p>My machine is the Lenovo Flex 2, 15 inch.</p>
<pre><code>$ lspci -knn | grep Net -A2 && rfkill list
02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n[14e4:4365] (rev 01)
Subsystem: Lenovo Device [17aa:0621]
Kernel driver in use: bcma-pci-bridge
0: ideapad_wlan: Wireless LAN
Soft blocked: no
Hard blocked: no
1: ideapad_bluetooth: Bluetooth
Soft blocked: no
Hard blocked: no
</code></pre>
| 0non-cybersec
| Stackexchange | 261 | 818 |
Dual booting: 0xc000000e Windows Error when installing GRUB. <p><strong>Hi everyone!</strong><br>
This is my first question so correct me please if I´m asking something wrong. </p>
<p>So my Problem is:<br>
I´ve got a Lenovo E31-70 with pre-installed Windows 10 home 64bit and I tried to dual-boot Kali Linux on it.<br>
First I´ve created an Partition with 100GB. Than I installed Kali Linux and the GRUB loader from an .iso image from an USB. The Installation was working fine and finally I had all installed.Then I tried to boot Windows and I got a boot error, but Linux was working well.<br>
For some reason i cannot upload an photo of the error, but: </p>
<pre><code>File: \Boot\BCD
Status: 0xc000000e
Info: The Boot Configurations Data for your PC is missing or contains errors.
</code></pre>
<p>After a bit searching I found that: <a href="http://answers.microsoft.com/en-us/windows/forum/all/0xc000000e-boot-error/ef08ab00-e130-4301-bc80-79d5b414a81f?auth=1" rel="nofollow noreferrer">http://answers.microsoft.com/en-us/windows/forum/all/0xc000000e-boot-error/ef08ab00-e130-4301-bc80-79d5b414a81f?auth=1</a><br>
<strong>THE SECOND ANSWER</strong></p>
<p>So I downloaden an Windows 10 .iso on my USB, started Windows repair, and wrote<br>
<code>bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd</code></p>
<p>All worked fine, Windows was completly restored,
but when I restarted the PC, GRUB doesn´t appear!
I´ve tried restarting the Notebook several times, with the same result.</p>
<p>Than I found this solution: <a href="https://forums.kali.org/showthread.php?20559-How-To-Repair-Kali-Linux-Grub-With-Kali-Linux-Live-Cd-Dual-Boot-With-Windows-7" rel="nofollow noreferrer">https://forums.kali.org/showthread.php?20559-How-To-Repair-Kali-Linux-Grub-With-Kali-Linux-Live-Cd-Dual-Boot-With-Windows-7</a></p>
<p>Again all worked fine. When I rebooted the Notebook, GRUB appeared. I thought it was the end... It wasn´t.<br>
Because when I´ve tried to start Windows, I got the same 0xc000000e Error again. </p>
<p><strong>NOTE:</strong><br>
Fast boot is turned off<br>
Boot Mode is legacy(can switch to UEFI) </p>
<p><strong>Conclusion:</strong>
When repairing Windows, GRUB doesn´t appear.
When repairing GRUB, Windows boot error.</p>
<p>I guess that GRUB is overriding Windows boot data...</p>
<p><strong>[EDIT]</strong><br>
I can boot windows if i switch to UEFI. The problem is: I don´t want to switch in BIOS from UEFI to Legacy every time i need to boot another OS. Is there any way to boot Windows 10 in legacy or start GRUB in UEFI?</p>
| 0non-cybersec
| Stackexchange | 862 | 2,566 |
Security controls around data in motion?. <p>I am an Information Security Analyst, trying to understand the difference between data in transit and data in motion. I found the listed below definitions:</p>
<p>Data In Transit is defined as data moving outside of the server such as between client and server, server to server, web app server to DB server and vice/versa.</p>
<p>Data In Motion is defined as being in preparation of transmission, moving around or place to place on or within the server itself but not transiting off of the server, or sometimes between servers when the connection between servers is a direct private connection such as data moving from server to SAN/NAS, not over a traditional LAN.</p>
<p>Reference - <a href="http://commonsensesecurity.net/difference-data-transit-data-motion" rel="nofollow noreferrer">http://commonsensesecurity.net/difference-data-transit-data-motion</a></p>
<p>What security controls need to be in place to protect data in motion which are different than data in transit?</p>
| 1cybersec
| Stackexchange | 253 | 1,031 |
Ubuntu Server: Apache2 seems to attach .php to URI. <p>I'm using the php library tonic for web services. My resource is as example at </p>
<pre><code>base-uri/myResource
</code></pre>
<p>Now if a file myResource.php exists in that directory, the url mod_rewrite gets to see is</p>
<pre><code>base-uri/myResource.php
</code></pre>
<p>which then fails the rewrite conditions and my application breaks (app works on apache on windows)</p>
<p>If I rename myResource.php to my myResourceClass.php (or anything else), it works.</p>
<p>So it seem that apache or one if its modules assumes that with base-uri/myResource I want to call base-uri/myResource.php but only if myResource.php exists.</p>
<p>Is this a general issue or can I somewhere configure this to not happen?</p>
<p>thanks!</p>
<p>EDIT:</p>
<p>see</p>
<p><a href="https://serverfault.com/questions/359290/how-to-set-up-a-basic-mod-rewrite">How to set up a basic mod_rewrite?</a></p>
<p>The answer contains the same observation!</p>
<p>ANSWER:</p>
<p>The issue is the default Apache configuration on Ubuntu:</p>
<pre><code>Options Indexes FollowSymLinks MultiViews
</code></pre>
<p>MultiViews is changing request_uri from myResource to myResource.php.</p>
<p>Solutions:</p>
<ul>
<li>disable MultiViews in .htaccess: Options -MultiViews</li>
<li>remove MultiViews from default config</li>
<li>rename the file as example to myResourceClass</li>
</ul>
<p>I chose last option because that should work regardless of configuration and I only have 3 such files so the change took about 30 secs...</p>
| 0non-cybersec
| Stackexchange | 506 | 1,569 |
System won't boot up properly - screens turning off and on. Only when second monitor is plugged in. <p>So I have a very strange problem.</p>
<p>My Ubuntu system refuses to boot up. It shows the boot screen, but after that, the monitors go black and they are going off and on every time. Hitting ctrl alt f2 doesn't work. I think it's some graphical issue. </p>
<p>The login screen just doesn't come up. Both monitors go on and off and that's just going forever.</p>
<p>System specs:</p>
<p>i3 4130
8 GB of RAM
GTX 750 Ti
GA-H81M-HD3</p>
<p><strong><em>Update</em></strong></p>
<p>I̶ ̶c̶a̶m̶e̶ ̶t̶o̶ ̶a̶ ̶c̶o̶n̶c̶l̶u̶s̶i̶o̶n̶ ̶t̶h̶a̶t̶ ̶t̶h̶e̶r̶e̶ ̶i̶s̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶w̶r̶o̶n̶g̶ ̶w̶i̶t̶h̶ ̶m̶y̶ ̶N̶v̶i̶d̶i̶a̶ ̶d̶r̶i̶v̶e̶r̶s̶ ̶f̶o̶r̶ ̶m̶y̶ ̶G̶T̶X̶ ̶c̶a̶r̶d̶.̶ ̶I̶ ̶d̶i̶s̶a̶b̶l̶e̶d̶ ̶t̶h̶e̶ ̶G̶P̶U̶ ̶i̶n̶ ̶t̶h̶e̶ ̶B̶I̶O̶S̶ ̶a̶n̶d̶ ̶t̶u̶r̶n̶e̶d̶ ̶t̶h̶e̶ ̶I̶n̶t̶e̶l̶ ̶H̶D̶ ̶o̶n̶.̶ ̶I̶ ̶p̶l̶u̶g̶g̶e̶d̶ ̶m̶y̶ ̶m̶o̶n̶i̶t̶o̶r̶ ̶i̶n̶t̶o̶ ̶t̶h̶e̶ ̶m̶o̶t̶h̶e̶r̶b̶o̶a̶r̶d̶ ̶a̶n̶d̶ ̶t̶h̶e̶ ̶P̶C̶ ̶b̶o̶o̶t̶e̶d̶ ̶u̶p̶ ̶w̶i̶t̶h̶o̶u̶t̶ ̶a̶n̶y̶ ̶p̶r̶o̶b̶l̶e̶m̶s̶.̶ ̶I̶ ̶n̶o̶w̶ ̶h̶a̶v̶e̶ ̶t̶o̶ ̶f̶i̶n̶d̶ ̶a̶ ̶w̶a̶y̶ ̶t̶o̶ ̶r̶e̶i̶n̶s̶t̶a̶l̶l̶ ̶t̶h̶e̶ ̶d̶r̶i̶v̶e̶r̶s̶ ̶s̶o̶ ̶I̶ ̶c̶a̶n̶ ̶u̶s̶e̶ ̶t̶h̶e̶ ̶G̶T̶X̶ ̶c̶a̶r̶
d̶ ̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶t̶h̶e̶ ̶I̶n̶t̶e̶l̶ ̶H̶D̶ ̶g̶r̶a̶p̶h̶i̶c̶s̶.̶</p>
<p><strong><em>Update 2</em></strong></p>
<p>Nvidia driver isnt the issue here. It has something to do with 2 monitors being plugged in. I booted the machine with only ONE monitor plugged in the GTX card and it booted up fine. But when I plug two monitors on the GTX card, Ubuntu will simply not boot up.</p>
| 0non-cybersec
| Stackexchange | 1,321 | 1,601 |
Closed form of :$\int_{0}^{\pi}(\frac{\sin n x}{\sin x})^m$, with $n,m$ are integers?. <p>let $n, m$ be integers such that $m$ is odd integer , My simple Guess about evaluation of this :$\int_{0}^{\pi}(\frac{\sin n x}{\sin x})^m$ is to get the following , for $n$ is even integer the integrand is $0$ and for $n$ is odd the integrand is give something like : $k\pi$ with k is such form which i can't get it . My question here is What is the closed form of this:$$\int_{0}^{\pi}\left(\frac{\sin n x}{\sin x}\right)^m$$ for $m$ is odd ?</p>
| 0non-cybersec
| Stackexchange | 177 | 540 |
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 | 349 | 1,234 |
What is the purpose of ValidationContext when implementing IValidatableObject. <p>I have implemented <code>IValidatableObject</code> several times and have never found out what the purpose of parsing <code>ValidationContext</code> to the Validate method is - my typical <code>IValidatableObject</code> implementation looks something like this:</p>
<pre><code> public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (Prop1 == Prop2)
{
yield return new ValidationResult(
"Prop1 and Prop2 must be different.",
new[] {"Prop1", "Prop2"});
}
}
</code></pre>
<p>Is there anything that I have missed that I could have used <code>validationContext</code> for?</p>
<p>EDIT: I'm using ASP.NET MVC and this is implemented in the class - not in the controller.</p>
| 0non-cybersec
| Stackexchange | 223 | 844 |
Unity "Sidebar" - is it configurable/repositionable?. <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://askubuntu.com/questions/33605/can-i-move-the-unity-launcher-to-the-bottom-of-the-screen-like-windows-7">Can I move the Unity launcher to the bottom of the screen like Windows 7?</a> </p>
</blockquote>
<p>I was reading the introduction to Unity and it says the launcher was made into a sidebar for convenience on widescreen monitors. Is it configurable, say to move it along the bottom of the screen, for people like me who use a "widescreen" monitor in "Portrait" mode?</p>
<p>If not, this is a dealbreaker for me, I'm afraid.</p>
| 0non-cybersec
| Stackexchange | 213 | 679 |
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 | 349 | 1,234 |
How to import the class within the same directory or sub directory?. <p>I have a directory that stores all the <strong>.py</strong> files.</p>
<pre><code>bin/
main.py
user.py # where class User resides
dir.py # where class Dir resides
</code></pre>
<p>I want to use classes from <strong>user.py</strong> and <strong>dir.py</strong> in <strong>main.py</strong>.<br>
How can I import these Python classes into <strong>main.py</strong>?<br>
Furthermore, how can I import class <code>User</code> if <strong>user.py</strong> is in a sub directory?</p>
<pre><code>bin/
dir.py
main.py
usr/
user.py
</code></pre>
| 0non-cybersec
| Stackexchange | 211 | 637 |
Can't install usermin or virtualmin: "Expecting form-data encoding, but got normal encoding". <p>This is a fresh server, with webmin freshly installed-- in fact, installing usermin is the first action I'm (trying to) take with it. I'm logged in with a user that has sudo privileges, however I've also tried it as root.</p>
<p>I select Usermin from the list of unused modules, then "Install Usermin tar.gz package". This brings me to an error screen that says "<strong>Expecting form-data encoding, but got normal encoding</strong>".</p>
<p>The lack of help I've been able to find for this is disheartening. Either no one uses Usermin, or no one has ever had this error. In fact, "usermin" isn't even an existing tag here.</p>
<hr>
<p>Trying to install virtualmin gives a different error: <strong>Failed to install module from <a href="http://download.webmin.com/download/virtualmin/webmin-virtual-server_5.04.gpl_all.deb" rel="nofollow">http://download.webmin.com/download/virtualmin/webmin-virtual-server_5.04.gpl_all.deb</a> : Not a valid module file : tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors</strong>. </p>
<p>To arrive at that I followed the <a href="http://www.webmin.com/vdownload.html" rel="nofollow">install instructions</a>: Go to Webmin Configuration-> Webmin Modules-> Install from ftp or http URL.</p>
<hr>
<p>Neither usermin or virtualmin are critical for me. I've never used them before, but I'm setting up a new server today, and thought a graphical UI might make my life a little easier. Webmin itself installed just fine.</p>
| 0non-cybersec
| Stackexchange | 478 | 1,652 |
Metric ($f$-divergence) on space of probability measures that satisfies pythagorean theorem. <p>Let <span class="math-container">$E$</span> be a polish space, <span class="math-container">$\mathcal{P}(E)$</span> the Borel probability measures on <span class="math-container">$E$</span> with the topology of weak convergence and <span class="math-container">$\mathcal{Q} \subset \mathcal{P}(E)$</span> a convex and compact set.</p>
<p>First, the motivation for my question:</p>
<p>The Kullback Leibler divergence (or relative entropy) <span class="math-container">$R : \mathcal{P}(E)\times \mathcal{P}(E) \rightarrow [0, \infty]$</span> is defined by <span class="math-container">$R(\nu, \mu) = \int \frac{d\nu}{d\mu} \log(\frac{d\nu}{d\mu}) d\mu$</span> if <span class="math-container">$\nu$</span> is absolutely continuous with respect to <span class="math-container">$\mu$</span> and <span class="math-container">$R(\nu, \mu) = \infty$</span>, else.</p>
<p>Let <span class="math-container">$\theta \in \mathcal{P}(E)$</span> and <span class="math-container">$\theta^{\ast}_R := \arg\min_{\mu \in \mathcal{Q}} R(\mu, \theta)$</span> be the information projection of <span class="math-container">$\theta$</span> onto <span class="math-container">$\mathcal{Q}$</span>. As a consequence of the pythagorean like theorem for relative entropy (c.f. <a href="https://www.jstor.org/stable/2959270?seq=1#metadata_info_tab_contents" rel="nofollow noreferrer">Csiszár (1975)</a>, Theorem 2.2) it holds
<span class="math-container">\begin{equation}
\label{eq1}
\forall \mu \in \mathcal{Q} : R(\theta^{\ast}_R, \theta) + R(\mu, \theta^{\ast}_R) \leq R(\mu, \theta)
\end{equation}</span></p>
<p>My question is whether there exists a <strong>metric</strong> <span class="math-container">$d$</span> on <span class="math-container">$\mathcal{P}(E)$</span> which satisfies the same kind of result.
So if <span class="math-container">$\theta^{\ast}_d := \arg\min_{\mu\in\mathcal{Q}} d(\mu, \theta)$</span>, it should hold
<span class="math-container">$$
\forall \mu \in \mathcal{Q}: d(\theta^{\ast}_d, \theta)^2 + d(\mu, \theta^{\ast}_d)^2 \leq d(\mu, \theta)^2
$$</span></p>
<p>Ideally, the metric <span class="math-container">$d$</span> should metrize weak convergence, but I am thankful for any approaches or pointers.</p>
| 0non-cybersec
| Stackexchange | 776 | 2,313 |
ui grid save updated cell data to database. <p>I am working on ui grid edit cell feature. I need to update the edited cell value to the database using rest api. Also how can i get the list of rows selected in controller.</p>
<p>My working code</p>
<pre><code>var app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.edit']);
app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.gridOptions = { };
$scope.gridOptions.columnDefs = [
{ name: 'id', enableCellEdit: false},
{ name: 'name' },
{ name: 'age', displayName: 'Age' , type: 'number', width: '10%' }
];
$http.get('https://cdn.rawgit.com/angular-ui/ui-grid.info/gh-pages/data/500_complex.json')
.success(function(data) {
$scope.gridOptions.data = data;
});
}])
</code></pre>
<p><a href="http://plnkr.co/edit/kAQnXGTn12Z7v8w16RL9?p=preview" rel="nofollow noreferrer">Plunker</a> </p>
| 0non-cybersec
| Stackexchange | 329 | 961 |
Problem with dual wifi. <p>I installed kubuntu 16.04.1 on my notebook ASUS R510VX-DM004D with dual wifi.
I can connect without problems to the 2'4Ghz network and it works properly, but when i try to connect at the 5Ghz network connects correctly but I can not navigate. If i try to do a ping (to google dns for example) does not respond.</p>
<p>I've been reading but can not find solution. Anyone with the same problem?</p>
<p>Thanks.</p>
| 0non-cybersec
| Stackexchange | 130 | 441 |
Randomized Polynomial Hierarchy?. <p>I wonder, what would happen, if in the definition of $PH$ (Polynomial Hierarchy, see, e.g., <a href="https://en.wikipedia.org/wiki/Polynomial_hierarchy">here</a>), the role of $NP$ would be replaced by $RP$? </p>
<p>It seems, we could still build a hierarchy, the same way as $PH$ is built, just using $RP$ everywhere instead of $NP$, and $coRP$ instead of $coNP$. Let us call it Randomized Polynomial Hierarchy ($RPH$). </p>
<p>My first guess is that $RPH\subseteq BPP$, or maybe $RPH=BPP$. It is based on the known fact that $NP=RP$ implies $PH=BPP$. Nevertheless, if $P\neq RP$, then $RPH$ could still be a proper, infinite hierarchy within $BPP$. </p>
<p>Of course, the edge of the issue is blunted by the fact that $P=RP$ is conjectured (even $P=BPP$), which would flatten $RPH$ into $P$. However, $P=RP$ is not known at this time, and it has resisted all proof attempts so far. Therefore, $RPH$ still has at least some chance to be a proper hierarchy.</p>
<p>While $RPH$, admittedly, has a good chance to be "flat," could the concept still be useful for something nontrivial? Here is an example: if one can prove $RPH=BPP$, then it would yield that $P=RP$ implies $P=BPP$, which, I think, would be an interesting result.</p>
<p>Is anything known about this?</p>
| 0non-cybersec
| Stackexchange | 416 | 1,315 |
CLT for Martingales. <p>I posted this question originally in math stack exchange, but I got no answer.
(<a href="https://math.stackexchange.com/questions/2604591/clt-for-martingales">https://math.stackexchange.com/questions/2604591/clt-for-martingales</a>)</p>
<p>In wikipedia, there is a version of a CLT for Martingales, which I cannot find any reference to. ( <a href="https://en.wikipedia.org/wiki/Martingale_central_limit_theorem" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Martingale_central_limit_theorem</a>)</p>
<p>The theorem claims the following:</p>
<blockquote>
<p>Let $X_1,X_2,...$ be a martingale with bounded increments, i.e.
$ \mathbb{E} [ X_{t+1}-X_t | X_1,...,X_t]=0$ and $|X_{t+1}-X_t|\le k$ almost surely for some $k$ and all $t$.</p>
<p>Define $\sigma_{t}^2=\mathbb{E}[(X_{t+1}-X_t)^2|X_1,...,X_t]$, and let $\tau_\nu=\min\left\{t\ :\ \sum_{i=1}^{t} \sigma_i^2 \ge \nu\right\}$.</p>
<p>Then $\frac{X_{\tau_{\nu}}}{\sqrt{\nu}}$ converges to $N(0,1)$ in distribution as $\nu \longrightarrow \infty$.</p>
</blockquote>
<p>I would like to know how to prove this or if there is any reference on the web.</p>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange | 452 | 1,173 |
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 | 349 | 1,234 |
Does @media with no arguments do anything?. <p>I've inherited some code from a ... questionable ... web developer. There are hundreds of style sheets referenced from each page of the site and each of them is riddled with extra @media tags that appear to be malformed. They are just:</p>
<pre><code>@media {
/* A bunch of CSS rules */
}
@media {
/* A bunch more CSS rules */
}
</code></pre>
<p>I'm trying to simplify the code base so that it will be easier for me to maintain. My question is: Is there any possible purpose at all in having @media by itself like that with no media type or media function arguments?</p>
| 0non-cybersec
| Stackexchange | 168 | 632 |
Caught NSInternalInconsistencyException request for rect at invalid indexPath. <p>The following line crashes the program:</p>
<pre><code>let cell = tableView.dequeueReusableCellWithIdentifier("ItemCell", forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! ItemCell
</code></pre>
<p>The console log shows the following error: </p>
<pre><code>"caught "NSInternalInconsistencyException", "request for rect at invalid index path (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0})"
</code></pre>
<p>Here is a bullet point list of things I've checked:</p>
<ul>
<li>Correct Storyboard ID is listed in the identity inspector</li>
<li>Correct custom class is listed in the identity inspector</li>
<li>Attributes inspector has "ItemCell" in the Table View Cell identifier field</li>
</ul>
<p>Here is the full code:</p>
<pre><code>import XCTest
@testable import ToDo
class ItemCellTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testSUT_HasNameLabel(){
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("ItemListViewController") as! ItemListViewController
_=controller.view
let tableView = controller.tableView
tableView.dataSource = FakeDataSource()
let cell = tableView.dequeueReusableCellWithIdentifier("ItemCell", forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! ItemCell
XCTAssertNotNil(cell.titleLabel)
}
}
extension ItemCellTests{
class FakeDataSource: NSObject, UITableViewDataSource {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return UITableViewCell()
}
}
}
</code></pre>
<p>Here is the ItemCell.swift code:</p>
<pre><code>import UIKit
class ItemCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
func configCellWithItem(item: ToDoItem){
}
}
</code></pre>
<p>All properties that are tied to the storyboard are connected. What is being overlooked?</p>
| 0non-cybersec
| Stackexchange | 718 | 2,517 |
Run the interactive F# in 32 bit mode on Mac. <p>When I'm inside <code>fsharpi</code> on Mac Os and I do</p>
<pre><code>open System.Windows.Forms;;
let f = new Form();;
</code></pre>
<p>I get the following warning</p>
<blockquote>
<p><strong>WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all</strong></p>
<p>Fontconfig warning: ignoring UTF-8: not a valid region tag</p>
<p>Fontconfig warning: ignoring UTF-8: not a valid region tag</p>
<p>Fontconfig warning: ignoring UTF-8: not a valid region tag</p>
<p>Fontconfig warning: ignoring UTF-8: not a valid region tag</p>
<p>val f : Form = System.Windows.Forms.Form</p>
</blockquote>
<p>And in fact nothing works.
Is there a way of using the 32bits Carbon driver? Or another way of running an F# app that uses windows forms on Mac?</p>
| 0non-cybersec
| Stackexchange | 275 | 857 |
Compiler optimization ignores non-ineffective function call in loop. <p>I'm benchmarking some code, but when I set an optimization flag the compiler ignores my function call(<code>bh_b = bh_b + bh_a + bh_a + bh_a + bh_a;</code>) in a loop.
When I remove an optimization flag, the code works fine.</p>
<p>I wrote my Matrix class using <a href="https://en.wikipedia.org/wiki/Expression_templates" rel="nofollow noreferrer">Expression Template</a></p>
<p>Sorry for the last article that is not-reproducible.</p>
<h3>Code</h3>
<ul>
<li>main.cpp</li>
</ul>
<pre><code>#include <iostream>
#include <chrono>
#include "matrix.h"
int main(){
int calc_num = 100000;
Matx<double, 3, 3> bh_a(1, 0, 0,
0, 1, 0,
0, 0, 1);
Matx<double, 3, 3> bh_b(0, 0, 0, 0, 0, 0, 0, 0, 0);
auto t_begin = std::chrono::high_resolution_clock::now();
for(int i=0; i<calc_num; ++i)
bh_b = bh_b + bh_a + bh_a + bh_a + bh_a; // this part
auto t_end = std::chrono::high_resolution_clock::now();
std::cout << "Elapsed: " << std::chrono::duration_cast<std::chrono::microseconds>(t_end - t_begin).count() << "us" << std::endl;
for(int i=0; i<bh_b.cols; ++i) {
for (int j = 0; j < bh_b.cols; ++j)
std::cout << bh_b(i * bh_b.cols + j) << ' ';
std::cout << std::endl;
}
return 0;
}
</code></pre>
<ul>
<li>matrix.h</li>
</ul>
<pre><code>#ifndef UNTITLED3_MATRIX_H
#define UNTITLED3_MATRIX_H
template <typename T, typename E>
class MatExpr{
public:
const T& operator () (int i) const { return static_cast<E const&>(*this)(i); }
};
template<typename T, int m, int n>
class Matx : public MatExpr<T, Matx<T, m, n>> {
public:
enum {
rows = m,
cols = n,
channels = rows*cols,
shortdim = (m < n ? m : n)
};
Matx(T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8) : val{v0, v1, v2, v3, v4, v5, v6, v7, v8} {}
template <typename E>
Matx(MatExpr<T, E> const& expr){
for(int i=0; i<channels; ++i) val[i] = expr(i);
}
const T& operator () (int i) const { return val[i]; }
T val[m*n];
};
template <typename T, typename E1, typename E2>
class MatOp : public MatExpr<T, MatOp<T, E1, E2>> {
private:
E1 const& u;
E2 const& v;
public:
MatOp(E1 const& u, E2 const& v) : u(u), v(v) {}
const T& operator () (int i) const { return u(i) + v(i); }
};
template <typename T, typename E1, typename E2>
MatOp<T, E1, E2>
operator + (MatExpr<T, E1> const& u, MatExpr<T, E2> const& v){
return MatOp<T, E1, E2>(*static_cast<const E1*>(&u), *static_cast<const E2*>(&v));
}
#endif //UNTITLED3_MATRIX_H
</code></pre>
<ul>
<li>CMakeLists.txt</li>
</ul>
<pre><code>cmake_minimum_required(VERSION 3.15)
project(untitled3)
set(CMAKE_CXX_STANDARD 14)
add_executable(untitled3 main.cpp)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" ) // Compiler optimization flag
</code></pre>
<h3>Output</h3>
<ul>
<li>No optimization (Correct output)</li>
</ul>
<pre><code>Elapsed: 32308us
400000 0 0
0 400000 0
0 0 400000
</code></pre>
<ul>
<li><code>-O1</code></li>
</ul>
<pre><code>Elapsed: 16268us
0 0 0
0 0 0
0 0 0
</code></pre>
<ul>
<li><code>-O2</code>, <code>-O3</code></li>
</ul>
<pre><code>Elapsed: 1us
0 0 0
0 0 0
0 0 0
</code></pre>
<h3>Compiler</h3>
<ul>
<li>using CLion on Mac OS</li>
</ul>
<pre><code>➜ ~ clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
</code></pre>
| 0non-cybersec
| Stackexchange | 1,690 | 3,905 |
Am I making the right choice fighting my mother for custody of my brother?. I am 18 and going to be fighting my mother for custody of my 7 year old brother.
My mother had terrible postpartum depression when he was born. So at 11 I raised him. I was up with him all night, I took him to doctors appointments and hospital appointments. I fed him. He said his first word to me and took his first steps. I have never missed a birthday, Christmas, sports day or school play. This isn't why I am claiming for custody but It's relevant because I am so close to him.
The reason I am fighting my mother for custody is because she is an awful mother. I raised him but my step dad moved and bullied me out of the house because my mother never disciplined him never made any effort with him the constant figure in his life (me) gone so he is running wild and regressing to toddler style tantrums. My mother is consistently sending him to school late or not at all and this is effecting his education and his attitude to it. All she does is scream abuse at him and lock him in his room. My step dad is a horrible man and a bully he often hits my brother when he misbehaves or forces him to hold phone books till he cries. my step dads son has special needs (who is treated as a house slave and also hit and locked in his room) and often violently attacks my brother. My mother allows this to happen. Her house is so disgusting and unclean that the microwave and the oven caught fire last week due to the amount of grime in the house hold. My brother is served unhealthy crap food and because of the state in the house he is often sick. Social services are involved and he is on the at risk register. I have spoken to social services and they have agreed to support me. As long as I do the following: Prove I have a job (done), Prove I have a house that has space for him (done) Prove that because of my age my lifestyle wont affect raising a child. (statements taken from employers, teachers and friends as well as other steps to prove I wont go out drinking all night) and I have to take a six week young careers course. (doing) as soon as I meet all these steps the custody arrangements can begin. I just hope I am making the right decision. In doing this I will effectively burn the relationship between my mother and I and stand up in front of a court telling them what a bad mother I think she is. It seems like the highest form of betrayal.
Do you think I am doing the right thing? | 0non-cybersec
| Reddit | 552 | 2,483 |
"system reserved" windows partition showed on ubuntu 12.04. Not installed using wubi. <p>
windows "system reserved" can be mounted on ubuntu
</p>
<pre>"system reserved" windows partition showed on nauilus ubuntu 12.04. No any other problems.
I've
sda1 system reserved
sda2 windows partition
sda3 ubuntu partition
sda4 extended partition
sda5 ntfs part
sda6 ntfs part
This is my fstab.
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda3 during installation
UUID=917d1cad-a914-47ee-a9e2-4e3d2025285a / ext2 errors=remount-ro 0 1
/dev/sda2 /media/sda2 ntfs nls=iso8859-1,ro,umask=000 0 0
/dev/sda5 /media/sda5 ntfs nls=iso8859-1,ro,umask=000 0 0
/dev/sda6 /media/sda6 ntfs nls=iso8859-1,ro,umask=000 0 0
pls hlp...
The output when df -h used is
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 30G 3.6G 25G 13% /
udev 983M 4.0K 983M 1% /dev
tmpfs 396M 904K 395M 1% /run
none 5.0M 4.0K 5.0M 1% /run/lock
none 990M 684K 989M 1% /run/shm
/dev/sda2 30G 8.5G 22G 29% /media/sda2
/dev/sda5 100G 89M 100G 1% /media/sda5
/dev/sda6 139G 91M 138G 1% /media/sda6
</pre>
<p>
</p>
| 0non-cybersec
| Stackexchange | 623 | 1,719 |
How can I filter a Pandas GroupBy object and obtain a GroupBy object back?. <p>When performing filter on the result of a Pandas groupby operation, it returns a dataframe. But supposing that I want to perform further group computations, I have to call groupby again, which seems sort of round about. Is there a more idiomatic way of doing this? </p>
<p><strong>EDIT:</strong></p>
<p>To illustrate what I'm talking about:</p>
<p>We shamelessly steal a toy dataframe from the Pandas docs, and group:</p>
<pre><code>>>> dff = pd.DataFrame({'A': np.arange(8), 'B': list('aabbbbcc')})
>>> grouped = dff.groupby('B')
>>> type(grouped)
<class 'pandas.core.groupby.DataFrameGroupBy'>
</code></pre>
<p>This returns a groupby object over which we can iterate, perform group-wise operations, etc. But if we filter:</p>
<pre><code>>>> filtered = grouped.filter(lambda x: len(x) > 2)
>>> type(filtered)
<class 'pandas.core.frame.DataFrame'>
</code></pre>
<p>We get back a dataframe. Is there a nice idiomatic way of obtaining the filtered groups back, instead of just the original rows which belonged to the filtered groups?</p>
| 0non-cybersec
| Stackexchange | 389 | 1,187 |
iOS application update failed after app transfer with 'rejecting upgrade' error. <p>I have my iOS app transferred from one apple account to another which causes team id change. Clean re-install works fine but every time I install an update I get the following error:</p>
<blockquote>
<p>[MIInstallableBundle performVerificationWithError:]: 517: Upgrade's
application-identifier entitlement string (new_teamid.bundle.id) does
not match installed application's application-identifier string
(old_teamid.bundle.id); rejecting upgrade.</p>
</blockquote>
<p>I found <a href="https://developer.apple.com/library/ios/technotes/tn2319/_index.html" rel="noreferrer">the solution</a> to update Entitlements with the 'previous-application-identifiers' key and request new provisioning profile from Apple to be able to sign the app:</p>
<pre><code><key>previous-application-identifiers</key>
<array>
<string>{Your Old App ID Prefix}.YourApp.Bundle.ID</string>
</array>
</code></pre>
<p>Without that provisioning profile I get the following error during installation process:</p>
<blockquote>
<p>Failed to verify code signature of MIExecutableBundle path = path.app identifier = bundle_id type = 4 0xe8008016 (Entitlements found that are not permitted by provisioning profile)}</p>
</blockquote>
<p>So I contacted Apple and requested the magical provision profile.</p>
<ul>
<li>Did I found the right solution to be able to update the app? </li>
<li>Will Apple be able to help me and provide provision profile?</li>
<li>How long could it take Apple to generate and provide the profile?</li>
</ul>
| 0non-cybersec
| Stackexchange | 468 | 1,648 |
Increase TCP server listen backlog size on Windows. <p>I'm developing TCP server in Go which should be able to accept up to 500 simultaneous client connections.</p>
<p>I'm using <code>net.Listen("tcp4", listenerAddress)</code> to create my TCP listener.</p>
<p>I had a problem on Linux when all the 500 clients connect at the same time - TCP accept queue gets filled up. On my Linux system it was 128. So I solved this by increasing queue size through kernel parameter: <code>sysctl -w net.core.somaxconn=512</code>.</p>
<p>But how to achieve this in Windows? Looks like on my Windows Server OS queue size is fixed at 200. I don't see any parameters which I could pass to listener by using Go language features and also I'm not very familiar with Windows systems so also didn't find any fix through OS. Currently whenever I try about ~300-400 simultaneous clients queue gets filled up and clients get rejected. Improving listener thread performance or priority (how fast it accepts clients) is also not an option here as all the clients can basically connect at the same time. Don't get me wrong, server is able to handle 500 connections when they are not bursty, opening them at the same time.</p>
| 0non-cybersec
| Stackexchange | 286 | 1,202 |
(CAN) Should I switch insurance companies for approximately $800.00 in savings per year? Downside is, it will void my accident repair warranty.. Hi all!
So as the title says, I am looking to switch insurance companies from TD Insurance back to Belair Direct. Belair was unavailable in Alberta when I moved here 2 years ago, but they are here now!! I had them back in Ontario and they were absolutely fantastic.
My monthly insurance payments are currently $177 and the quick quote I got online from Belair was $114 for similar coverage. This would effectively be $756.00 in savings over the year. My insurance will come up for renewal in April as well from TD.
The only reason I am holding back is because last March, my boyfriend got badly rear-ended in my car. It was $10,000 in body work (all covered by the at-fault drivers' insurance). TD told me the repairs on the vehicle have a lifetime warranty, so long as I remain with them. I am really unsure of which way to go.
What are the chances of me switching insurance companies for a cheaper rate but then getting slammed with repairs from the accident later on because the warranty is void? What should I do?
EDIT: I should also mention that my current deductible is $3000.00 and with Belair it would be $500.00
Final edit: I switched companies!! Thanks for the advice. It turned out to be slightly more expensive than the online quote because I had a speeding ticket from 1.5 years ago and also got a bit more coverage than I was getting at TD. Going from $177.00/month insurance with a $3000 deductible to $131.00/month with a $1000 deductible. TD will charge me $75.00 to cancel, but I still come out on top. Wahoo!!! | 0non-cybersec
| Reddit | 395 | 1,693 |
Would a 2 TB USB 3.0 WD My Passport HD overpower a powered USB 2.0 hub?. <p>I asked a question a few months ago about what I thought was possibly a failing external USB HDD. I have disconnected that HDD and the powered USB 2.0 hub has worked better. But I noticed that the USB thumb drives would sometimes fail to be recognized by the computer and the hub. So my reasoning is that the hub cannot handle 3 external USB drives. It just dawned on me that the My Passport is powered through the USB interface not an external wall wart. </p>
<p>My hub now is only in the 10 watt range(5v@2A). Could I solve this by getting a powered USB 3.0 hub that has a higher wattage capacity, e.g., 36 W range? </p>
| 0non-cybersec
| Stackexchange | 187 | 702 |
intersection of closed sets. <p>Let $(X,d)$ a metric space, and $(D_n)_{n\geq 0}\subset X$ bounded closed sets such that $D_{n+1}\subset D_n$. we put $D=\displaystyle\bigcap_{n\geq 0}D_n$.
Can we proof that $diam(D_n) \longrightarrow diam(D)$ without compactness ? </p>
<p>($diam(K)=\displaystyle\sup_{x,y\in K}d(x,y)$)</p>
| 0non-cybersec
| Stackexchange | 131 | 327 |
If in a semigroup $S$, $\forall x \exists ! y:xyx=x$, then $S$ is a group. <p>If for all $x$ in a semigroup $S$, there exists a <strong>unique</strong> $y$ such that $x y x=x$, then $S$ is a group. (Not to be confused with <a href="http://en.wikipedia.org/wiki/Inverse_semigroup" rel="nofollow">inverse semigroup</a>, where only $y$ satisfying <strong>both</strong> $xyx=x$ and $yxy=y$ is unique)</p>
<p>After tring with no result, I used Prover9 to find a proof. I did get one but it was very hard to understand (possible to go through once but really hard to remember what the point is).</p>
<p>Is there any somewhat comprehensible or conceptual proof to this? Is there a theory underlying this?</p>
| 0non-cybersec
| Stackexchange | 226 | 704 |
Why does an injective resolution give a complex?. <p>The following is the definition of the right-derived functor from Lang's <em>Algebra</em> -</p>
<blockquote>
<p>Let <span class="math-container">$\mathcal A$</span> and <span class="math-container">$\mathcal B$</span> be abelian categories with enough injectives. Consider a covariant functor <span class="math-container">$F:\mathcal A\to\mathcal B$</span> that is left exact and additive. Let <span class="math-container">$M$</span> be an object in <span class="math-container">$\mathcal A$</span>, let <span class="math-container">$$0\to M\to I^0\to I^1\to I^2\to$$</span> be an injective resolution, which we abbreviate by, <span class="math-container">$0\to M\to I_M$</span>, where <span class="math-container">$I_M$</span> is the complex <span class="math-container">$I^0\to I^1\to I^2\to$</span>. We let <span class="math-container">$I$</span> be the complex, <span class="math-container">$$0\to I^0\to I^1\to I^2\to$$</span></p>
<p>Then we define the <strong>right-derived functor</strong> <span class="math-container">$R^nF$</span> by <span class="math-container">$$R^nF(M)=H^n(F(I)),$$</span> in other words, the <span class="math-container">$n$</span>-th homology of the complex, <span class="math-container">$$0\to F(I^0)\to F(I^1)\to F(I^2)\to$$</span></p>
</blockquote>
<p><strong>My question :</strong></p>
<p>There is probably something very silly that I am missing but what I don't get is why are <span class="math-container">$I_M$</span> and <span class="math-container">$I$</span> complexes? Isn't <span class="math-container">$I_M$</span> exact and except at the <span class="math-container">$I^0$</span> stage <span class="math-container">$I$</span> is also exact? If so then <span class="math-container">$0\to F(I^0)\to F(I^1)\to F(I^2)\to\cdots$</span> is also exact except at the <span class="math-container">$F(I^0)$</span> stage. So then all the homologies for <span class="math-container">$n>0$</span> will be trivial. But that isn't true. So what am I missing?</p>
<p>Thank you.</p>
| 0non-cybersec
| Stackexchange | 708 | 2,066 |
Clarification needed about futures and promises in Scala. <p>I am trying to get my head around Scala's promise and future constructs.</p>
<p>I've been reading <a href="http://docs.scala-lang.org/overviews/core/futures.html">Futures and Promises</a> in Scala Documentation and am a bit confused as I've got a feeling that the concepts of promises and futures are mixed up.</p>
<blockquote>
<p>In my understanding a promise is a container that we could populate
value in a later point. And future is some sort of an asynchronous
operation that would complete in a different execution path.</p>
</blockquote>
<p>In Scala we can obtain a result using the attached callbacks to future. </p>
<p>Where I'm lost is how promise has a future?</p>
<p>I have read about these concepts in Clojure too, assuming that promise and future have some generic common concept, but it seems like I was wrong.</p>
<blockquote>
<p>A promise p completes the future returned by p.future. This future is
specific to the promise p. Depending on the implementation, it may be
the case that p.future eq p.</p>
</blockquote>
<pre><code>val p = promise[T]
val f = p.future
</code></pre>
| 0non-cybersec
| Stackexchange | 334 | 1,174 |
[Help] Inconsistency vs what feels like cruelty in trying to teach a dog to be less demanding?. Hi, I’ll start by saying I’m no dog trainer.
I have a senior but spry dog who has been acting demanding and I’m trying to curb that. I’ve started having her sit before she gets anything, and she’s been pretty responsive to it but there’s one thing that I’m not sure how I should handle.
I have a fenced yard and when she’s outside, she barks at the door to be let in. That wouldn’t necessarily be a problem but if I don’t open it fast enough she gets really demanding in her barking. I’m trying to wait out the barking and open the door when she’s quiet, have her sit, and then let her in. But it’s winter and I feel like making her wait in the rain or cold is pretty awful. Her unhappiness at being rained on encourages her to bark even more demandingly.
We’ve only been working on this a week or so, and she’s been doing pretty well besides this. I just don’t know if I shouldn’t even bother trying to break her of the demanding door barking when I can’t be consistent with it because of bad weather. I do feel like the way she barks at the door is a part of the set of behaviors that I’m trying to train her out of.
Should I feel like a terrible person and leave her in the rain while probably annoying the neighbors? Or scrap the training with the door? Something else?
Thanks! | 0non-cybersec
| Reddit | 353 | 1,382 |
14 years.. [Remorse]:
Feeling sad lately.
I met a guy online when I was 13. So, it's been 14 years. This isn't a Catfish-esque story, as we've videochatted and sent each other videos and pictures throughout the many years.
While we have an intense connection and feel like we love one another, our lives never seem to have a moment where pursuing a real and non-long distance relationship would be possible. In other words, neither of us were willing to give up our education or anything like that to make a commitment, which I do not regret.
We're both in committed relationships right now and have therefore decided not to talk to one another at all because of the problems it would cause emotionally and in each of our relationships. It's been like this for over a year, with a very occasional text once in a blue moon. I also deleted him off of Facebook to ensure we didn't revert back to being emotional crutches for one another.
I'm really sad lately because I think things are finally done. Really, really done, and we've missed our chance. I think pulling away from each other while we pursued relationships with people was the moral and right thing to do, so I don't have regret for that.
I guess I'm really mourning the loss of the entire relationship now instead of having mourned it a year ago. I wish I could just never think about him again since I have moved on in other ways with my life, but I can't get over it. I'm still in love with him, and I can't quite figure out what the hell is wrong with me. I'm an otherwise very rational person, truly. I'm pursuing a doctorate degree and have a happy life. I wish I could just give myself completely to the person who I'm with now and stop spending time thinking about this other person, who may not even be thinking about me anymore.
| 0non-cybersec
| Reddit | 409 | 1,805 |
Getting an error to find directory is empty. <p>I have a requirement that create a script name say ./123.sh when given a path to directory it should print the file or files with minimum, maximum and average file size . eg</p>
<pre><code>$> ./123.sh /usr/share
Minimum file size: 1024
/usr/share/lala.txt
/usr/share/koko.txt
Maximum file size: 100234
/usr/share/somewhere/else/test.tar.gz
Average file size: 5034
</code></pre>
<p>My code :</p>
<pre><code>dir="$1"
if [ $# -ne 1 ]
then
echo "please pass arguments"
exit 0
fi
if [ -e $dir ]
then
printf "minimum file size: %s\n\t%s\n" \
$(du $dir -hab | sort -n -r | tail )
printf "maximum file size: %s\n\t%s\n" \
$(du $dir -ab | sort -n | tail -1)
printf "average file size: %s"
du $dir -sk | awk '{s+=$1}END{print s/NR}'
else
echo " directory doesn't exits"
fi
if [ -d "ls -1A -- $dir" ]
then
echo " directory is empty "
fi
</code></pre>
<p>If I execute my script with <code>./123.sh</code>
the output should be: </p>
<p>"please pass arguments".</p>
<p>similar to script with arguments <code>./123.sh hdkjflkjds</code></p>
<p>"please pass correct arguments".</p>
<p>Similar to script with arguemnts <code>./123.sh /usr/share</code>
The output should display.</p>
<pre><code>$> ./123.sh /usr/share
Minimum file size: 1024
/usr/share/lala.txt
/usr/share/koko.txt
Maximum file size: 100234
/usr/share/somewhere/else/test.tar.gz
Average file size: 5034
</code></pre>
<p>Finally If I execute the script with arguments(i.e empty directory path) say <code>/usr/bin</code>
$<code>./123.sh /usr/bin</code></p>
<p>It should display:</p>
<p>"Directory is empty".</p>
<p>Rather its showing for me an error like this.</p>
<pre><code>$> ./123.sh /usr/bin
Minimum file size: 1024
/usr/bin/lala.txt
/usr/bin/koko.txt
Maximum file size: 100234
/usr/bin/somewhere/else/test.tar.gz
Average file size: 5034
</code></pre>
<p>can anyone check my code fidn out the mistake what I have done.</p>
| 0non-cybersec
| Stackexchange | 747 | 2,068 |
How to use the barcode scanner on a custom POS popup?. <p>I'm trying to create form which would simplify adding of the products which are not yet registered to nomenclatures for my small shop. For this I've created module with following form:</p>
<pre class="lang-xml prettyprint-override"><code><t t-extend="ConfirmPopupWidget">
<t t-jquery="p.body" t-operation="replace">
<div class="product-container">
<div id="search_row" style="padding-bottom: 12px;padding-top: 11px;border-bottom: 1px solid gray;">
<label>Barcode </label>
<input style="height: 18px;" type="text" id="is_ean13" class="search" placeholder="EAN13 Barcode"/>
</div>
<div class="form-group">
<label for="is_name" class="col-sm-2 control-label">Product Name </label>
<div class="col-sm-10">
<input type="text" id="is_name" class="form-control" placeholder="Product name" style="height: 32px;background-color:#D2D2FF"/>
</div>
</div>
<div class="form-group">
<label for="is_sale_price" class="col-sm-2 control-label">Sale price</label>
<div class="col-sm-10">
<input type="text" id="is_sale_price" class="form-control" placeholder="Sale Price"/>
</div>
</div>
<div class="form-group">
<label for="is_internal_reference" class="col-sm-2 control-label">Internal Reference</label>
<div class="col-sm-10">
<input type="text" id="is_internal_reference" class="form-control" placeholder="Internal Reference"/>
</div>
</div>
</div>
</t>
</t>
</code></pre>
<p>I want to fill up ean13 barcode field "is_ean13" from barcode scanner, which is already used by POS interface, but could not make it working. </p>
<pre><code>odoo.define('instant_sale.add_product', function (require) {
"use strict";
var bus = core.bus;
// bind event handler
bus.on('barcode_scanned', this, function(barcode) {
this.scan(barcode);
})
});
</code></pre>
<p>As it is written in <a href="https://media.readthedocs.org/pdf/odoo-development/latest/odoo-development.pdf" rel="nofollow noreferrer">https://media.readthedocs.org/pdf/odoo-development/latest/odoo-development.pdf</a> page 38, but it seems I'm missing something, because I can't catch any event. </p>
<p>How can I catch barcode events in POS interface. Any help is highly appreciated. Thank you! </p>
| 0non-cybersec
| Stackexchange | 900 | 2,773 |
Determinant equation.. <p>let
A = [[x,-1],
[3,(1-x)]]
and
B = [[1,0,-3],
[2,x,-6],
[1,3,(x-5)]]</p>
<p>solve for x;</p>
<p>det(A) = det(B)</p>
<p>on expanding both the determinants and equating them, i obtain;</p>
<p>$-2x^2+3x+3 = 0$</p>
<p>completeing the square</p>
<p>$2[x^2-\frac{3x}{2}] -3 = 0$</p>
<p>$2[(x-\frac{3}{4})^2 - \frac{9}{16}] -3 = 0$</p>
<p>$2(x-\frac{3}{4})^2 - \frac{18}{16} -3 = 0$</p>
<p>$(x-\frac{3}{4}) = \pm \sqrt{\frac{33}{16}}$</p>
<p>$x = \frac{3}{4} \pm \sqrt{\frac{33}{16}}$</p>
<p>The answer in the back of the book is not this, could someone shed some light please.</p>
| 0non-cybersec
| Stackexchange | 321 | 628 |
Replicating into a Percona XtraDB Cluster. <p>We have a 2 node (plus an arbiter) Percona XtraDB cluster. It is used for data indexing/archiving. It has it's own database called <code>archive</code> but it is also the replication slave for a database called <code>primary</code>. This comes from a standard master->slave Percona Server pair.</p>
<p>One of the clustered servers segfaulted (reason still being investigated...). This node was, specifically, the one that was doing replication. On restarting it, it deleted the contents of the MySQL data directory (<code>/var/lib/mysql/</code>) and did an SST from the other node. This went fine, but it now has a partially incomplete dataset on the <code>primary</code> database and no master binlog position information.</p>
<p>How should replication be restored?</p>
<ul>
<li>It is not feasible to export the <code>primary</code> database as a mysql dump since it is circa 1TB in size when looking at the raw innodb files</li>
<li>If we export the <code>primary</code> DB with xtrabackup and prepare it as a whole on the clustered node, it is assumed it will get deleted as soon as the node starts SST</li>
<li>It is difficult but not infeasible to allow the node to do SST and then restore an xtrabackup of <code>primary</code> DB table by table... but it will take a while given 500+ tables</li>
</ul>
<p>So, the question is... What is the correct way to set up replication into a multi-master cluster?</p>
| 0non-cybersec
| Stackexchange | 399 | 1,463 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.