text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
Animation does not work when passing function argument to child view. <p>I have a parent view that can show one of two views:</p>
<pre><code>struct LoginSubView: View {
@State private var loginSubView: LoginSubViews = .login
func setLoginSubView(_ view: LoginSubViews) {
withAnimation {
self.loginSubView = view
}
}
var body: some View {
VStack {
if self.loginSubView == .signup {
SignupView(setLoginSubView: self.setLoginSubView)
.transition(AnyTransition.asymmetric(insertion: .move(edge: .trailing), removal: .move(edge: .leading)).animation(.default))
} else {
LoginView(setLoginSubView: self.setLoginSubView)
.transition(AnyTransition.asymmetric(insertion: .move(edge: .leading), removal: .move(edge: .trailing)).animation(.default))
}
}
.padding(.horizontal, 16)
.keyboardObserving()
}
}
</code></pre>
<p>The <code>setLoginSubView()</code> is called by those child views to switch views.</p>
<p>Unfortunately, it no longer animates when I pass the function and call it from the child. It switches instantly. However, it does work if I do this:</p>
<pre><code>struct LoginSubView: View {
@State private var loginSubView: LoginSubViews = .login
// removed setLoginSubview()
var body: some View {
VStack {
if self.loginSubView == .signup {
SignupView(setLoginSubView: self.setLoginSubView)
.transition(AnyTransition.asymmetric(insertion: .move(edge: .trailing), removal: .move(edge: .leading)).animation(.default))
// Added it here
Button(action: {
withAnimation {
self.loginSubView = .login
}
}) {
Text("Already have an account? Sign in").animation(nil)
}
} else {
LoginView(setLoginSubView: self.setLoginSubView)
.transition(AnyTransition.asymmetric(insertion: .move(edge: .leading), removal: .move(edge: .trailing)).animation(.default))
// And added this here
Button(action: {
withAnimation {
self.loginSubView = .signup
}
}) {
Text("Don't have an account? Sign up").animation(nil)
}
}
}
.padding(.horizontal, 16)
.keyboardObserving()
}
}
</code></pre>
<p>How can I have the animation work when passing this function to the child?</p>
| 0non-cybersec
| Stackexchange |
Make LLVM inline a function from a library. <p>I am trying to make <code>LLVM</code> inline a function from a library. </p>
<p>I have LLVM bitcode files (manually generated) that I linked together with <code>llvm-link</code>, and I also have a library (written in C) compiled into bitcode by <code>clang</code> and archived with <code>llvm-ar</code>. I manage to link everything together and to execute but I can't manage to get <code>LLVM</code> to inline a function from the library. Any clue about how this should be done?</p>
| 0non-cybersec
| Stackexchange |
Brightness indicator in the panel icon missing. <p><a href="https://i.stack.imgur.com/ksgV7.png" rel="nofollow noreferrer">As you can see the box icon with stop</a>
After a normal update I met with this. During updates I saw something related to brightness indicator, but I don't know about the update.</p>
| 0non-cybersec
| Stackexchange |
lunch money. | 0non-cybersec
| Reddit |
What is 3D volume of three vectors in $n$ Dimensional Space. <p>We have three linearly independent vectors <span class="math-container">$v_1=(v_{11} , ... , v_{1n})$</span> , <span class="math-container">$v_2=(v_{21} , ... , v_{2n})$</span> , <span class="math-container">$v_3=(v_{31} , ... , v_{3n})$</span>. We want to calculate the 3D volume of the Parallelepiped made by these three vectors.</p>
<p>I know if we had <span class="math-container">$n$</span> vectors, then the <span class="math-container">$n$</span>-d volume of these vectors is <span class="math-container">$|det[v_1,...,v_n]|$</span>.</p>
<p>But we don't have <span class="math-container">$det$</span> of a <span class="math-container">$3 \times n$</span> matrix.</p>
<p>In general how to calculate <span class="math-container">$m$</span>-d volume of <span class="math-container">$m$</span> linearly independent vectors in <span class="math-container">$n$</span>-d space where <span class="math-container">$(m <n)$</span> ?</p>
| 0non-cybersec
| Stackexchange |
Is it possible to reprogram wireless mouse receiver to receive signals from different mouse?. <p>I have a Tecknet wireless Mouse which has a USB receiver. The exact make and model is: TeckNet M002 2.4G Classic Wireless Mouse - 4800 DPI -6 Adjustment Levels - Nano USB wireless receiver.</p>
<p>In fact I have two of these, but I have lost the mouse for one and the receiver for the other. So my question, is there a way to reprogram the mouse receiver to receive signals from the other mouse? </p>
| 0non-cybersec
| Stackexchange |
I cry when I pee, AMA.. | 0non-cybersec
| Reddit |
How to compile Swift from command line for distribution. <p>I have a single file Swift command line script (it dumps the contents of the menu bar given a process id).</p>
<p>To give an idea of the APIs I am using, here's a few relevant lines:</p>
<pre><code>import Foundation
import Cocoa
// ...
func getAttribute(element: AXUIElement, name: String) -> CFTypeRef? {
var value: CFTypeRef? = nil
AXUIElementCopyAttributeValue(element, name as CFString, &value)
return value
}
// ...
var app: NSRunningApplication? = nil
if pid == -1 {
app = NSWorkspace.shared().menuBarOwningApplication
}
else {
app = NSRunningApplication(processIdentifier: pid)
}
// ...
let axApp = AXUIElementCreateApplication(app.processIdentifier)
</code></pre>
<p>The whole file is available <a href="https://raw.githubusercontent.com/BenziAhamed/Menu-Bar-Search/master/menu.swift" rel="nofollow noreferrer">here</a>.</p>
<p>When I compile this using <code>swiftc menu.swift</code>, I can run it just fine in my system which has Swift installed.</p>
<p>When I share the <code>menu</code> executable to somebody who does not have Swift, they get the following error when running it via Terminal:</p>
<pre><code>Code 6: dyld: Library not loaded: @rpath/libswiftAppKit.dylib
Referenced from: ./menu
Reason: image not found
</code></pre>
<p>I figure I need to statically link something, but I am not sure. I cannot test this easily since I do not have access to a macOS build without Swift.</p>
<p>How would I use <code>swiftc</code> so that I can compile my script such that it can be run on any macOS system? </p>
| 0non-cybersec
| Stackexchange |
If any object of the java abstract class "Number" is equal to zero. <p>I'm trying to make a generic function that takes any type of <code>Number</code> and conditionally does something if that number is equal to zero. I want anyone to be able to pass it any of the classes that extend <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Number.html" rel="nofollow">Number</a> (BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, or Short)</p>
<p>So far, I've attempted to use <code>instanceof</code> to find out what type the number is, then compare it to an equivalent type</p>
<pre><code>public static boolean isZero(Number number) {
if (number instanceof BigDecimal) {
return BigDecimal.ZERO.equals(number);
} else if (number instanceof BigInteger) {
return BigInteger.ZERO.equals(number);
} else if (number instanceof Byte) {
return new Byte((byte) 0).equals(number);
} else if (number instanceof Double) {
return new Double(0).equals(number);
} else if (number instanceof Float) {
return new Float(0).equals(number);
} else if (number instanceof Integer) {
return new Integer(0).equals(number);
} else if (number instanceof Long) {
return new Long(0).equals(number);
} else if (number instanceof Short) {
return new Short((short) 0).equals(number);
}
return false;
}
</code></pre>
<p>This works, but it is quite long and cumbersome. Is there any way to simplify this?</p>
| 0non-cybersec
| Stackexchange |
The Stoned Ages: A documentary exploring the history of drugs. | 0non-cybersec
| Reddit |
Checkout branch with libgit2. <p>I'm trying to implement a simple checkout operation between 2 branches. The code executes without errors.</p>
<pre><code>git_libgit2_init();
git_object *treeish = NULL;
git_checkout_options opts;
opts.checkout_strategy = GIT_CHECKOUT_SAFE;
/* branchName in this case is "master" */
handleError(git_revparse_single(&treeish, repo, branchName));
handleError(git_checkout_tree(repo, treeish, &opts));
git_object_free(treeish);
git_libgit2_shutdown();
</code></pre>
<p>However, the branch does not change when I check it using <code>git status</code>.
I've checked the <a href="https://libgit2.github.com/docs/guides/101-samples/" rel="nofollow noreferrer">101 examples of libgit2</a> and it says:</p>
<blockquote>
<p><code>git_checkout_options</code> isn’t actually very optional. The defaults won’t
be useful outside of a small number of cases. The best example of this
is checkout_strategy; the default value does nothing to the work tree.
So if you want your checkout to check files out, choose an appropriate
strategy.</p>
<p><code>NONE</code> is the equivalent of a dry run; no files will be checked out.</p>
<p><code>SAFE</code> is similar to <code>git checkout</code>; unmodified files are updated, and modified files are left alone. If a file was present in the old HEAD
but is missing, it’s considered deleted, and won’t be created.</p>
<p><code>RECREATE_MISSING</code> is similar to <code>git checkout-index</code>, or what happens after a clone. Unmodified files are updated, and missing files are
created, but files with modifications are left alone.</p>
<p><code>FORCE</code> is similar to <code>git checkout --force</code>; all modifications are overwritten, and all missing files are created.</p>
</blockquote>
<p>In my case I'm testing it with a very small repo without uncommited changes and without any conflicts between these 2 branches.</p>
<p><a href="https://i.stack.imgur.com/6Iggl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Iggl.png" alt="git log"></a></p>
<p>What am I doing wrong? I expected this code to do something like <code>git checkout master</code></p>
| 0non-cybersec
| Stackexchange |
Actor Jack Gleeson, who plays the Game of Thrones' Joffrey, is like the anti-Joffrey in real life: Trinity College scholar who plans to quit acting, thinks celebrity culture is ridiculous, wants to study ancient Hebrew, and made a humanitarian visit to Haiti. | 0non-cybersec
| Reddit |
Gymnast strengthening themselves on the rings. | 0non-cybersec
| Reddit |
Nuns tortured 60 children by burning their skin, shoving faces in toilets, authorities say - Two nuns have been arrested in Colombia for allegedly torturing upward of 60 children under their care at a home dubbed a hell house by neighbors and local media.. | 0non-cybersec
| Reddit |
I went to an Indian restaurant and ordered a Pelican curry... . ...it wasn't a bad meal, but the bill was enormous. | 0non-cybersec
| Reddit |
Valkyrie! Done by Matt Oates at Hellcat Tattoo in West Palm Beach, Florida.. | 0non-cybersec
| Reddit |
How to initialize all elements in an array to the same number in C++. <p>I'm trying to initialize an int array with everything set at -1.</p>
<p>I tried the following, but it doesn't work. It only sets the first value at -1.</p>
<pre><code>int directory[100] = {-1};
</code></pre>
<p>Why doesn't it work right?</p>
| 0non-cybersec
| Stackexchange |
So fake it hurts.. | 0non-cybersec
| Reddit |
[vent] my dog is getting old, just a little rant I guess :/. I need to get it off my chest. Don't wanna bother my gf with more of my worry about my dog since I have her worrying enough. This anxiety came out of nowhere today ;-;
My dog is getting to be around that old age... He's 15? 16 I think. One of the two, and the more I think about it, more and more it dawns on me he wont be around for forever. Which is the most terrible thought I could even think of.. I've had him most of my life and I love him to bits and spend mostly every day with him all day. It's so depressing seeing him grow old, but I'm happy he's been able to grow this old too. He's a long hair wiener dog and hes my favorite person :/. He's more than a pet he's my brother at this point.. I lost his sister 3 and a half years ago, ever since then he's always been by my side despite the fact growing up he liked my dad more.
A big thing is, is that I'm getting paranoid that he's becoming senile, he's always been a pain in the ass but he constantly enters and exits my room over and over again. I can't tell if he's being a pain in the ass or if he's forgetting what he's doing. He's done this for a while now, but it's getting excessive. Like I open the door for him, 10 seconds later after I sit down he wants out. Repeat a few times.. This really scares me.
So, That's been giving me alot of stress too. I keep coming up with all these things that could possibly be wrong, yet hes 16 and still jumping up and down stuff. I know it's bad that I let him jump on and off stuff since hes old. I'm worried about his back but he's never had much problems with it other than occasionally but it hasn't happened in probably two years. So it makes me feel he is quite healthy for an old dog. Another thing that sucks, is that I wish I had money for all the things I want to get him (no I'm not asking for hand outs), like a trip to the vet just to make sure he's okay, or if something is wrong then what can I do to help etc you know? But I just can't due to lack of money. It sucks that I can't because I feel like I'm letting him down, like I'm a bad friend and family member. Maybe I'm over thinking it all. But, I wouldn't be letting him down if theres nothing wrong though I guess?
Again, I just feel like I had to get this all out, I'm sure some of you have experienced this or are experiencing it, if you are or have in the past, I'm sorry. Because this is one of the worst feelings ever. Losing his sister was hard enough, but losing this guy after losing his sister a few years ago.. this is just gonna leave a big hole in my heart that I'm afraid will never heal :S
ps here's some pictures of him. Not sure if you can see it well but he's a "dapple". One eye is half blue, half brown, the other is fully brown. Pretty badass eh?
https://imgur.com/a/2DXKN
Well thanks for reading this little rant thing, doggo fam. I really needed to get this off my chest. It feels good having all of this written out. Kind of makes my thought process feel like less of a mess.
Hope you guys all have a great night, give your doggo a biscuit. I just gave my doggo one.
Edit: jeez I didn't think this would get so many replies, I've never had a thread with so many replies lol. That being said I'm sorry if I don't reply back to everybody. Your comments are appreciated but some are just hard for me to answer too. But every bit of it has helped so far. Thanks everyone. | 0non-cybersec
| Reddit |
Desktop Publishing Instructions for Authors of Papers
WEDT005
FRONT-END ELECTRONICS CONFIGURATION
SYSTEM FOR CMS
P. Gras,CERN, Switzerland, University of Karlsruhe/IEKP, Germany
W. Funk,CERN, Geneva, Switzerland
L. Gross, D. Vintache, IReS, Strasbourg, France
F. Drouhin, UHA, Mulhouse, France
Abstract
The four LHC experiments at CERN have decided to
use a commercial SCADA (Supervisory Control And
Data Acquisition) product for the supervision of their
DCS (Detector Control System). The selected SCADA,
which is therefore used for the CMS DCS, is PVSS II
from the company ETM. This SCADA has its own
database, which is suitable for storing conventional
controls data such as voltages, temperatures and
pressures. In addition, calibration data and FE (Front-
End) electronics configuration need to be stored. The
amount of these data is too large to be stored in the
SCADA database [1]. Therefore an external database
will be used for managing such data. However, this
database should be completely integrated into the
SCADA framework, it should be accessible from the
SCADA and the SCADA features, e.g. alarming,
logging should be benefited from. For prototyping,
Oracle 8i was selected as the external database
manager. The development of the control system for
calibration constants and FE electronics configuration
has been done in close collaboration with the CMS
tracker group and JCOP (Joint COntrols Project)1.
1 INTRODUCTION
The supervision of the CMS detector control system
(DCS) has to control classical "slow control" items
such as power supplies, gas systems, etc. as well as FE
(Front End) configuration, which comprises a lot of
different parameters.
The supervision level has to provide hardware
access, alarming, archiving, scripting, graphical user
interface and logging features. In the following the
prototype system developed for the tracker of CMS will
be described.
1 The four LHC experiments and the CERN IT/CO group has
merged their efforts to build the experiments controls systems
and set up the JCOP at the end of December, 1997 for this
purpose.
2 DESCRIPTION OF THE FRONT-
END CONFIGURATION CONTROL
SYSTEM
PVSS II, a commercial SCADA product from the
Austrian company ETM was used for the supervision
level. Because the amount of data for the FE
configuration is quite big, an external database
Figure 1: FE configuration mechanism.
(Oracle 8i) was used for the storage of the FE
configuration data itself.
2.1. Configuration mechanism
The FE configuration system is comprised of 3
actors as illustrated in Figure 1: the database, the
SCADA and FE supervisor(s). The database stores the
parameters, the SCADA controls the operation and
provides the user interface, the FE supervisor(s)
Figure 2: Access control registration mechanism.
accesses the FE. The SCADA system as well as the
database can be distributed over many PCs on different
platforms. In order to transfer the data in parallel to the
electronics, the system can have several FE supervisors.
On user request or during an automatic procedure
(e.g. start of run, error recovery…) the SCADA sends a
download command to the FE supervisors. Then the FE
supervisors fetch the data from the database and
download them into the FE electronics. It is possible to
ask each FE supervisor to read back the configuration
from the electronics and send it back to the database.
Then, if some values are outside limits, an alarm
summarizing the differences will be sent to the
SCADA.
2.2. SCADA library and user interface
For the user interface, PVSS II panels have been
developed: for version creation, for version
registration, for database browsing, etc. These panels
can be used as complex widgets.
The database-browsing panel called DBNav is a
generic user interface for Oracle 8i databases. It is able
to discover itself the structure of the database and
display it in a tree.
These panels are based on two underlying PVSS II
script libraries, which can be used directly to develop
custom scripts or panels.
2.3. Access control
In order to keep the history of the data used for a
configuration, versioning of the stored parameters and a
registration mechanism have been developed. FE
parameters, and also calibration constants, may be
calculated by some process, which is independent of
the SCADA. Before a configuration set may be used
for a run, it should be registered using the SCADA. At
registration time, the SCADA logs the description of
the new configuration, and revokes the write
permission on the registered configuration set. This
write permission revocation is done using the database
access control. In this way, all versions used once for
configuration will be kept unchanged for later analysis.
Figure 2 describes this registration mechanism.
2.4. Database model
Each electronic device type is represented by a table.
This table contains the device parameters. In the
example of the CMS Tracker described in section 3.2,
the database table named APV contains all the
parameters of the APV readout chips. A device can be
part of a higher-level device (e.g. a chip is part of a
board). Such membership relation is specified in the
database by a standard relational database "references
constraint"2 between the device and the subsystem. A
"controlled by" relationship or any N-to-1 relationship
is represented by such a constraint.
The parameter versioning is taken care of by a
specific table, typically called "version", which
contains the list of all available versions. A version is
identified by two numbers: the major and the minor
version ids. The version table is composed of at least
five columns: one for the major id, one for the minor
id, one for the version creation date, one for the
description and one which specifies if the version has
been registered. Each row of device type tables
contains the values of one device for a specific
parameter version. The row includes the version ids,
which refer ("references constraint") to the version
table. Actually if a device contains versioned
parameters and version-independent parameters, the
device type table can be split into two tables: one for
the versioned parameters and one for the version-
independent parameters.
Finally, in order to use the alarm mechanism, the
device type table must have a "device_type" column
which specifies if the row contains the set value, the
minimum allowed value or the maximum allowed
value.
The "value_type" column and the version table are
optional and are not needed if alarming or versioning is
not required.
3 FE CONFIGURATION SYSTEM
USAGE
3.1. Electronics-specific part
Two parts are specific to the front-end. The first part
is the database content: typically each device will have
a table, which will contain its parameters. A general
database scheme is given as a template.
The other specific part is the "driver". The "driver"
is the part that fetches the data from the database and
downloads it to the front-end electronics. It receives
commands from the SCADA3. This part needs to know
how to access the specific front-electronics hardware. It
can get the data from the database using a standard
interface like JDBC, as it has been done for the Tracker
(see next part) or with more Oracle-specific interface
like OCI or Pro*C or in XML format (provided as
standard by Oracle 8i).
2 In relational database jargon the constraints are the rules
that are defined in order to keep the database consistent. Each
time the database is altered, the database manager checks that
these rules are not violated.
3 A simple interface to receive this command is provided in
C/C++ and in Java.
3.2. Use of the FE configuration system for
the CMS tracker readout electronics
The Tracker FE has in its final design about 80,000
APV readout chips of which each has about 20
parameters. Therefore each version of parameters will
contain several Mbytes. With the expected number of
versions we arrive at the order of GBytes.
The Tracker is organized in modules. Each module
has 2 to 6 APVs, 1 PLL4 chip and 1 channel
multiplexer, called an APVMUX.
Chips, called CCUs, control the APVs. CCUs5
communicate through a Token Ring controlled by a
FEC6[4] board. In current prototypes the FECs are PCI
cards hosted by a PC. The hierarchy of all FE
electronics is shown in figure 3.
This hierarchy is reflected in the database through
the "references constraints" as described in Section 2.4.
For each item in Figure 3 one table is defined in the
database.
The setup has been used successfully in the tracker
beam test, which took place at CERN in October 2001.
Figure 4 shows the FE configuration in the beam test
DCS context. During this beam test, PVSS II was also
controlling a HV power supply and was monitoring
humidity and temperatures on the detector. A PLC was
interlocking the high voltage depending on the detector
temperature. On interlock the PLC was notifying
PVSS II in order to generate an alarm. An electronics
logbook using Oracle database with a user interface in
PVSS II and a web interface has also been developed
for this beam test. Finally a communication between the
DAQ and SCADA has been implemented in order to
synchronize them.
4 Phase Locked Loop
5 Communication and Control Unit.
6 Front-End Controller
4 CONCLUSIONS
The FE electronics configuration system, which has
been developed and applied to the CMS Tracker, has
been designed in a sufficiently generic manner to be
used in other detectors. A prototype using this system
for the CMS ECAL detector is under development.
During a beam test it has been proven that this system
fulfills the principal requirements. In the future some
more effort will be needed to measure the performance
and to tune it. Tests will also be undertaken to verify
the scalability of the system.
ACKNOWLEDGEMENTS
We are deeply indebted towards the CERN Oracle
support group for their competent assistance in setting
up and running our database.
REFERENCES
[1] F. Drouhin et al., The Control system for the CMS
Tracker Front-end, IEEE No. TNS-00028-2000
[2] J. Dirnberger et al., A Prototype of the Control
System for the CMS Tracker Front-End, Icaleps'01
TUCT004
[3] Specifications for the Control and Read-out
Electronics for the CMS Inner Tracker, A. Machioro,
http://www.cern.ch/CMSTrackerControlxx
[4] The Tracker Project Technical Design Report
CERN/LHCC 98-6, CMS TDR 5, 15 April 1998
…
FEC
supervisor
Ring
CCU
APV PLL APVMUX
Module
Figure 3: FEC electronics control hierarchy.
SCADA
controls/GUI
DB
FE
supervisor
Modules
(x 6)
CAEN
HV PS
Humidity
readout
Temperature
readout
Web
I/F
Interlock
Access
Control
Electronic
Log Book alarm
FE
C
FED DAQ
Figure 4: Tracker DCS setup. The FE electronics
configuration system is represented in bold. The
SCADA communicates with the DAQ, which receives
data from the FEDs (Front End Drivers). For
simplification the CCU ring between the FEC and the
modules is not shown.
| 0non-cybersec
| arXiv |
Chuwi Hi10 Dualboot Randomly Powers Off after 60%ish??? Only in Windows/ Linux not in Android. <p>I've had my Chuwi Hi10 for well over a year now and for a couple of months, I've had this annoying issue where the tablet powers off randomly without any warning or message. It does not occur when I am charging the device!</p>
<p>It occured first in Windows 10 and it wasn't before long that I realized the issue didn't occur in Android.</p>
<p>My next step was to install Linux in order to see if this was a driver issue? It wasn't, because by the time the install had finished I was at about 50% and the tablet would shut down almost instantleously after boot up.</p>
<p>One thing I did realize was that the issue didn't really occur in Windows Server 2016 (I have a student license from Microsoft Imagine). It only occured once and that may have been from overheating?</p>
<p>Yes, it's a very weird issue. It might be to do with voltage within the BIOS considering that dualboot support comes out of the box and perhaps I could solve it with a setting. Or it may be to do with the battery.
Any help would be appreciated.</p>
<p><em>System Specs: Chuwi Hi10 Intel Atom x5-Z8300 4gb ram 64gb SSD Integrated Graphics</em></p>
| 0non-cybersec
| Stackexchange |
How to use selenium 2 PageFactory init Elements with Wait.until()?. <p>The code snippet below works fine, but I'm having a little trouble with the <code>wait.until()</code> line:</p>
<pre><code>wait.until(new ElementPresent(By.xpath("//a[@title='Go to Google Home']")));
</code></pre>
<p>It works but I want to send my <code>PageFactory</code> <code>WebElement</code> <code>homePageLink</code> instead:</p>
<pre><code>wait.until(new ElementPresent(homePageLink));
</code></pre>
<p>Is there any way to do that?</p>
<p>These new fangled Selenium 2 features have got my head in a bit of a spin and I can't find much documentation.</p>
<p>Thanks.</p>
<pre><code>public class GoogleResultsPage extends TestBase {
@FindBy(xpath = "//a[@title='Go to Google Home']")
@CacheLookup
private WebElement homePageLink;
public GoogleResultsPage() {
wait.until(new ElementPresent(By.xpath("//a[@title='Go to Google Home']")));
assertThat(driver.getTitle(), containsString("Google Search"));
}
}
public class ElementPresent implements ExpectedCondition<WebElement> {
private final By locator;
public ElementPresent(By locator) {
this.locator = locator;
}
public WebElement apply(WebDriver driver) {
return driver.findElement(locator);
}
}
</code></pre>
| 0non-cybersec
| Stackexchange |
The Notorious B.I.G. - Niggas Bleed (Karen Small Remix) / Crenshaw Mafia.... | 0non-cybersec
| Reddit |
Oddly Satisfying - Sights & Sounds of Leather. | 0non-cybersec
| Reddit |
Wait... So is it free?. | 0non-cybersec
| Reddit |
Idk how this happened but here I am. | 0non-cybersec
| Reddit |
Which computer needs SeRemoteShutdownPrivilege to shut down a remote system?. <p>Say, if I want to shut down a remote computer 2 from my computer 1 using a tool like <code>shutdown.exe</code>. I keep reading that this requires <a href="https://docs.microsoft.com/en-us/windows/desktop/secauthz/privilege-constants" rel="nofollow noreferrer"><code>SeRemoteShutdownPrivilege</code></a>. What I am not clear about is which computer needs it, local computer 1 or remote computer 2 that is being shut down?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
[SPOILER] - Images from the Force Awakens Exhibit (x-post from /r/starwars). | 0non-cybersec
| Reddit |
Node.js Promises: Push to array asynchronously & save. <p>I am currently trying to push to an array (attribute within a Mongo Model), from a list of items I receive through a request. From those items, I loop through them to see which one is currently in the db and if that is not the case, then I create a new Item and try to save it. I am using promises to accomplish this task but I am unable to figure out why the array is empty after all the promises have fulfilled. </p>
<pre><code>var q = require('q');
var items_to_get = ['1', '2', '3']; // example array
var trans = new Transaction({
items : []
});
var promises = [];
for (var i = 0; i < items_to_get.length; i++) {
var ith = i; //save current i, kinda hacky
var deferred = q.defer(); //init promise
//find an existing item
Item.findOne({simcode: items_to_get[ith]}, function(err, item) {
trans.items.push(item); // push item to transaction
deferred.resolve(item); // resolve the promise
});
promises.push(deferred); // add promise to array, can be rejected or fulfilled
};
q.allSettled(promises).then(function(result) {
console.log(trans.items); //is empty
trans.save();
}
</code></pre>
<p><strong>EDIT</strong> Resolved: Code bellow, based on <a href="http://jsbin.com/bufecilame/1/edit?html,js,output" rel="nofollow">http://jsbin.com/bufecilame/1/edit?html,js,output</a> .. credits go to @macqm</p>
<pre><code>var items_to_get = ['1', '2', '3'];
var promises = []; //I made this global
items_to_get.forEach(item) {
upsertItem(item);
}
q.allSettled(promises).then(function(result) {
//loop through array of promises, add items
result.forEach(function(res) {
if (res.state === "fulfilled") {
trans.items.push(res.value);
}
});
trans.save();
promises = []; //empty array, since it's global.
}
//moved main code inside here
function upsertItem(item) {
var deferred = q.defer(); //init promise
//find an existing item
Item.findOne({simcode: item}, function(err, item) {
deferred.resolve(item); // resolve the promise
// don't forget to handle error cases
// use deffered.reject(item) for those
});
promises.push(deferred); // add promise to array
}
</code></pre>
| 0non-cybersec
| Stackexchange |
ZFS mirrored new drives added not reporting correct size. <p>I am running Ubuntu 16.04 on ZFS.</p>
<p>I have my OS on rpool and my data in /tank</p>
<p>Problem: I have added 2 6TB drives to my zvol using the following command:</p>
<blockquote>
<p># zpool add -f tank mirror ${DISK1} ${DISK2}</p>
</blockquote>
<p>The drives added. I was expecting to gain something near 6TB, but I got an additional 2TB. Here is the output of <code>df -h /tank</code></p>
<pre><code>Filesystem Size Used Avail Use% Mounted on
tank 2.1T 0 2.1T 0% /tank
</code></pre>
<p>and here is the output of <code># zpool list tank</code></p>
<pre><code>NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
tank 2.57T 460G 2.12T - 7% 17% 1.00x ONLINE -
</code></pre>
<p>Here is the output of <code># zpool status</code> </p>
<pre><code>pool: rpool
state: ONLINE
scan: scrub repaired 0 in 0h0m with 0 errors on Sun Feb 12 00:24:58 2017
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ata-Samsung_SSD_850_EVO_250GB_S2R5NB0HA87070Z-part1 ONLINE 0 0 0
ata-Samsung_SSD_850_EVO_250GB_S2R5NB0HB09374D-part1 ONLINE 0 0 0
errors: No known data errors
pool: tank
state: ONLINE
scan: scrub repaired 0 in 1h8m with 0 errors on Sun Feb 12 01:32:07 2017
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
wwn-0x50014ee0561bff3f-part1 ONLINE 0 0 0
wwn-0x50014ee1011a7ad7-part1 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
ata-ST6000NE0021-2EN11C_ZA14Q289 ONLINE 0 0 0
ata-ST6000NE0021-2EN11C_ZA13YT32 ONLINE 0 0 0
cache
ata-Samsung_SSD_850_PRO_512GB_S39FNX0J102027A ONLINE 0 0 0
errors: No known data errors
</code></pre>
<p>I tried <code># zpool set autoexpand=on tank</code> but no joy. Still reporting 2.5TB.</p>
<p>Here is the output of <code># lsblk</code></p>
<pre><code>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 477G 0 part
└─sda9 8:9 0 8M 0 part
sdb 8:16 0 2T 0 disk
├─sdb1 8:17 0 2T 0 part
└─sdb9 8:25 0 8M 0 part
sdc 8:32 0 2T 0 disk
├─sdc1 8:33 0 2T 0 part
└─sdc9 8:41 0 8M 0 part
sdd 8:48 0 596.2G 0 disk
└─sdd1 8:49 0 596.2G 0 part
sde 8:64 0 596.2G 0 disk
└─sde1 8:65 0 596.2G 0 part
sdf 8:80 0 232.9G 0 disk
├─sdf1 8:81 0 232.9G 0 part
├─sdf2 8:82 0 1007K 0 part
└─sdf9 8:89 0 8M 0 part
sdg 8:96 0 232.9G 0 disk
├─sdg1 8:97 0 232.9G 0 part
├─sdg2 8:98 0 1007K 0 part
└─sdg9 8:105 0 8M 0 part
sr0 11:0 1 1024M 0 rom
zd0 230:0 0 4G 0 disk [SWAP]
</code></pre>
<p>Key: </p>
<p>sda = L2ARC for tank (samsung pro)</p>
<p>sdb & sdc = Seagate Ironwolf 6TB drive (new mirror in tank)</p>
<p>sdd & sde = WD 596G drive in tank mirror</p>
<p>sdf & sdg = rpool mirror</p>
<p>Do you know why my machine is only seeing these new drives as 2TB?</p>
<p>Is there anything I can do about it?</p>
<p>Will I need to destroy my tank to fix the issue (if there is a fix)?</p>
| 0non-cybersec
| Stackexchange |
How can I find the fixed points of a function?. <p>Using calculus, I want to determine all the fixed points of the function <span class="math-container">$f^3$</span> where <span class="math-container">$f$</span> is given by:
<span class="math-container">$$
f:[0,1]\rightarrow[0,1];\;f(x)=4x(1-x)
$$</span>
and such that those fixed points are not fixed points of the functions <span class="math-container">$f^2$</span> and <span class="math-container">$f$</span>.
If we can not determine them explicitly, are there any argument to justify that such points exist? Thanks in advance. </p>
| 0non-cybersec
| Stackexchange |
Reddit, what is the best memory you have ever had with a friend?. (Friend, girl/boy friend, sibling, etc...) | 0non-cybersec
| Reddit |
Suspending function can only be called within coroutine body. <p>I'm trying to deliver realtime updates to my view with Kotlin Flows and Firebase.</p>
<p>This is how I collect my realtime data from my <code>ViewModel</code>:</p>
<pre><code>class MainViewModel(repo: IRepo): ViewModel() {
val fetchVersionCode = liveData(Dispatchers.IO) {
emit(Resource.Loading())
try {
repo.getVersionCode().collect {
emit(it)
}
} catch (e: Exception){
emit(Resource.Failure(e))
Log.e("ERROR:", e.message)
}
}
}
</code></pre>
<p>And this is how I emit each flow of data from my repo whenever a value changes in Firebase:</p>
<pre><code>class RepoImpl: IRepo {
override suspend fun getVersionCodeRepo(): Flow<Resource<Int>> = flow {
FirebaseFirestore.getInstance()
.collection("params").document("app").addSnapshotListener { documentSnapshot, firebaseFirestoreException ->
val versionCode = documentSnapshot!!.getLong("version")
emit(Resource.Success(versionCode!!.toInt()))
}
}
</code></pre>
<p>The problem is that when I use:</p>
<pre><code> emit(Resource.Success(versionCode!!.toInt()))
</code></pre>
<p>Android Studio highlights the emit invocation with:</p>
<blockquote>
<p>Suspend function 'emit' should be called only from a coroutine or another suspend function</p>
</blockquote>
<p>But I'm calling this code from a <code>CoroutineScope</code> in my <code>ViewModel</code>.</p>
<p>What's the problem here?</p>
<p>thanks</p>
| 0non-cybersec
| Stackexchange |
Javascript wait for condition to be true using promises. <p>I am struggling to make a simple waiting function in my program. I want to use promises and async await if possible. What I have so far:</p>
<pre><code> function waitForCondition(conditionObj) {
var start_time = new Date().getTime()
function checkFlag() {
if (conditionObj.arg == conditionObj.test) {
console.log('met');
return new Promise(resolve => setTimeout(resolve, 1));
} else if (new Date() > start_time + 3000) {
console.log('not met, time out');
return new Promise(resolve => setTimeout(resolve, 1));
} else {
window.setTimeout(checkFlag, 1000);
}
}
checkFlag();
}
async function run() {
console.log('before');
await waitForCondition({arg: '1', test: '1'})
console.log('after');
}
run();
</code></pre>
<p>It should check every 1 second for a maximum time of 3 seconds. The console should look like this:</p>
<pre><code>'before'
'met'
'after'
</code></pre>
| 0non-cybersec
| Stackexchange |
Largest prime number $p$ that cannot be written as the sum of three composite numbers?. <p>This question is obvious in the sense that prime gaps on average are larger as the numbers go towards infinity.</p>
<p>However, I don't have any idea on how to begin tackling this question apart from very basic trial and error.</p>
<p>Any ideas will be useful. Thanks.</p>
| 0non-cybersec
| Stackexchange |
Exercise may help people with Parkinson's disease improve their balance, ability to move around and quality of life.. | 0non-cybersec
| Reddit |
help with vending machine. I am playing on a multiplayer server on ps3 and would like to make a vending machine that can dispense pumpkin pies or cakes depending on user choice. They would both cost a diamond but I don't know how to make it to where they both wouldn't dispense at the same time. I want to make it to where they pay the one diamond, then they can choose their selection. Any help? | 0non-cybersec
| Reddit |
Official 10 Disc Marvel Cinematic Universe "Phase One" set designed to look like the suitcase with the tesseract. | 0non-cybersec
| Reddit |
WAYWT _ March 04. WAYWT = What Are You Wearing Today (or a different day, whatever).
Think of this as your chance to share your personal taste in fashion with the community by posting your outfit pictures. Most users enjoy knowing where you bought your pieces, so please consider including those in your post.
Want to know how to take better WAYWT pictures? Read the guide [here](http://www.reddit.com/r/malefashionadvice/comments/16rwft/how_to_take_better_self_pics_for_mfa/).
If you're looking for feedback on an outfit instead of just looking to share, consider using the [Daily Question thread](https://www.reddit.com/r/malefashionadvice/search?q=author%3AAutoModerator+Daily+Questions&restrict_sr=on&sort=new&t=all) instead.
**Important: Downvotes are strongly discouraged in this thread. Sorting by new is strongly encouraged.**
*Wednesday WAYWT is sorted by new as a way to encourage new WAYWT posters/easier for beginners.* | 0non-cybersec
| Reddit |
How to store the printout of the last command in a shell variable in urxvt/zsh?. <p>I'd like to have the printout (stdout and stderr) of the last command run within zsh available in a variable ready to use <code>grep</code>, etc on it.</p>
| 0non-cybersec
| Stackexchange |
[Chris Brown] It took until mid season, but @TreWhite16 has overtaken Stephon Gilmore for lowest passer rating allowed in NFL to opposing QBs w/microscopic 20.3 rating.. | 0non-cybersec
| Reddit |
Aligning and zero filling problem in pgfplotstable. <p>Im experiencing problems using pgfplotstable. The following code does not produce exactly what I want:</p>
<pre><code>\documentclass[a4paper,11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX, Numbers={OldStyle,Proportional}]{Libertinus Serif}
\setsansfont[Numbers={OldStyle,Proportional}]{Libertinus Sans}
%\setmonofont{FreeMono}
\setmonofont[Scale=0.8]{DejaVu Sans Mono}
\usepackage{unicode-math}
\setmathfont{Libertinus Math}
\usepackage{polyglossia}
\setdefaultlanguage{catalan}
\usepackage{microtype}
\usepackage[svgnames]{xcolor}
\usepackage{siunitx}
\sisetup{
output-decimal-marker = {,},
per-mode = symbol,
group-separator = {.},
output-complex-root = \ensuremath{\mathrm{j}},
binary-units,
retain-unity-mantissa = false,
retain-explicit-plus = true,
}
\usepackage{pgfplots}
\pgfplotsset{
compat=1.11,
/pgf/number format/use comma,
}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{colortbl}
\usepackage{subcaption}
\captionsetup{font=sf}
\begin{document}
% NOTE: The data file contains:
% 0.01 13.649 88.982 20.373 22.89564181519858
% 0.02 13.649 150.51 76.303 50.69629924921932
% 0.04 13.649 361.35 239.26 66.21281306212813
% 0.08 13.929 816.86 433.06 53.01520456381754
% 0.16 14.81 1011.7 464.49 45.9118315706237
% 0.32 16.752 955.98 459.7 48.08678005816021
% 0.64 24.119 521.1400000000001 346.69 66.52530989753232
\begin{table}[ht]
\centering
\caption{Resultats de les simulacions del Cas 2}\label{tbl:Cas2_resultats}
\pgfplotstabletypeset[
every head row/.style={before row=\toprule,after row=\midrule},
every even row/.style={before row={\rowcolor[gray]{0.7}}},
every last row/.style={after row=\bottomrule},
every column/.style={fixed zerofill={1},precision=2},
columns/0/.style={
column name={Acoblament $k_{23}$},
fixed,
},
columns/1/.style={
column name={$f_\text{max}$ [\si{\mega\Hz}]},
},
columns/2/.style={
column name={$P_g$ [\si{\milli\watt}]},
dec sep align,
},
columns/3/.style={
column name={$P_{_L}$ [\si{\milli\watt}]},
dec sep align,
},
columns/4/.style={
column name={$\eta_t$ [\si{\percent}]},
dec sep align,
},
]{Càlculs/Cas2_Taula.dat}
\end{table}
\end{document}
</code></pre>
<p>The result is:</p>
<p><a href="https://i.stack.imgur.com/qoKBr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qoKBr.png" alt="enter image description here"></a></p>
<p>There are two problems:</p>
<ol>
<li>Although I've indicated "precision=2 and "fixed zerofill" options, some numbers are not filled with zeroes at decimal places. I would like read 76,30 and not 76,3.</li>
<li>The fourth column (and perhaps the last too) of numbers is too displaced to the left, although the definition is the same as the previous one. I've tried the option "column type=c," to center the contents, but that completely destroys the layout.</li>
</ol>
<p>Can anyone please help me with these two issues?</p>
| 0non-cybersec
| Stackexchange |
My boyfriend says he isn’t a cat person.... | 0non-cybersec
| Reddit |
db2 express c mac osx. <p>I'm experiencing some troubles with the execution of DB2 express c on Mac OSX 10.6 Snow Leopard. </p>
<p>I have installed the db system, creating two users, db2 and db2-user. The latter is the instance owner. I have sourced db2profile and the env variables seem to be set correctly. </p>
<p>Db2 starts successfully, but I'm not able to run db2sampl, the error is: </p>
<pre><code>Attempt to start DB2 instance failed.
SQL1019N The node name "db2-user" specified in the command is not valid.
</code></pre>
<p>I have googled the error and it looks like I have to change the DB2INSTANCE variable, but I do not know what value should be. </p>
| 0non-cybersec
| Stackexchange |
One of the greatest guitarists of all time. | 0non-cybersec
| Reddit |
Anybody know story behind pgFoundry (PostgreSQL project site) downtime?. <p>pgFoundry site's been unreachable 2 days and counting....</p>
<p>I have googled up some ominous messages from the Spring about it eventually closing, but I had never seen any notice on the site to say that was imminent.</p>
<p>Any inside scoop?</p>
| 0non-cybersec
| Stackexchange |
Day 1? Starting your weight loss journey on Sunday, 17 February 2019? Start here!. **Today is your Day 1?**
**Welcome to r/Loseit!**
So you aren’t sure of how to start? Don’t worry! “How do I get started?” is our most asked question. r/Loseit has helped our users lose over 1,000,000 recorded pounds and these are the steps that we’ve found most useful for getting started.
#Why you’re overweight
Our bodies are amazing (yes, yours too!). In order to survive before supermarkets, we had to be able to store energy to get us through lean times, we store this energy as adipose fat tissue. If you put more energy into your body than it needs, it stores it, for (potential) later use. When you put in less than it needs, it uses the stored energy. The more energy you have stored, the more overweight you are. The trick is to get your body to use the stored energy, which can only be done if you give it less energy than it needs, consistently.
#Before You Start
The very first step is calculating your calorie needs. You can do that [HERE](https://tdeecalculator.net). This will give you an approximation of your calorie needs for the day. The next step is to figure how quickly you want to lose the fat. One pound of fat is equal to 3500 calories. So to lose 1 pound of fat per week you will need to consume 500 calories less than your TDEE (daily calorie needs from the link above). 750 calories less will result in 1.5 pounds and 1000 calories is an aggressive 2 pounds per week.
#Tracking
Here is where it begins to resemble work. The most efficient way to lose the weight you desire is to track your calorie intake. This has gotten much simpler over the years and today it can be done right from your smartphone or computer. r/loseit recommends an app like [MyFitnessPal](https://www.myfitnesspal.com/), [Loseit!](http://loseit.com/) (unaffiliated), or [Cronometer](https://cronometer.com/). Create an account and be honest with it about your current stats, activities, and goals. This is your tracker and no one else needs to see it so don’t cheat the numbers. You’ll find large user created databases that make logging and tracking your food and drinks easy with just the tap of the screen or the push of a button. We also highly recommend the use of a digital kitchen scale for accuracy. Knowing how much of what you're eating is more important than what you're eating. Why? [This may explain it.](https://youtu.be/vjKPIcI51lU)
#Creating Your Deficit
How do you create a deficit? This is up to you. r/loseit has a few recommendations but ultimately that decision is yours. There is no perfect diet for everyone. There is a perfect diet for you and you can create it. You can eat less of exactly what you eat now. If you like pizza you can have pizza. Have 2 slices instead of 4. You can try lower calorie replacements for calorie dense foods. Some of the communities favorites are cauliflower rice, zucchini noodles, spaghetti squash in place of their more calorie rich cousins. If it appeals to you an entire dietary change like Keto, Paleo, Vegetarian.
The most important thing to remember is that this selection of foods works for you. Sustainability is the key to long term weight management success. If you hate what you’re eating you won’t stick to it.
#Exercise
Is **NOT** mandatory. You can lose fat and create a deficit through diet alone. There is no requirement of exercise to lose weight.
It has it’s own benefits though. You will burn extra calories. Exercise is shown to be beneficial to mental health and creates an endorphin rush as well. It makes people feel *awesome* and has been linked to higher rates of long term success when physical activity is included in lifestyle changes.
#Crawl, Walk, Run
It can seem like one needs to make a 180 degree course correction to find success. That isn’t necessarily true. Many of our users find that creating small initial changes that build a foundation allows them to progress forward in even, sustained, increments.
#Acceptance
You will *struggle*. We have all struggled. This is natural. There is no tip or trick to get through this though. We encourage you to recognize why you are struggling and forgive yourself for whatever reason that may be. If you overindulged at your last meal that is ok. You can resolve to make the next meal better.
Do not let the pursuit of perfect get in the way of progress. We don’t need perfect. We just want better.
#Additional resources
Now you’re ready to do this. Here are more details, that may help you refine your plan.
* [Quick Start Guide](https://www.reddit.com/r/loseit/wiki/index#wiki_quick_start_guide) - Build your foundation!
* [Loseit Compendium](https://www.reddit.com/r/loseit/wiki/index) - Frame it out!
* [FAQ](https://www.reddit.com/r/loseit/wiki/faq) - Answers to our most Frequently Asked Questions!
| 0non-cybersec
| Reddit |
Why are restaurant websites all crap?. | 0non-cybersec
| Reddit |
xpost from CampingAndHiking: My friends have started making outdoor tutorials! Let them know what you think! (about backpacks). | 0non-cybersec
| Reddit |
My 78 Word story. Don't let your kid write it about you.. “I’m done. I’m leaving first thing tomorrow. I have found a new boyfriend in Miami”
“But where will I go?” I asked, already knowing the answer.
“I don’t know, and I don’t care. Go down the street. We know how much you like it down there” she snapped.
“But I love you. I need you. I’m not ready for this.”
“It’s about time you grow up Christian. Figure it out.”
Then my mom walked out the door.
| 0non-cybersec
| Reddit |
If unicorns throw up rainbows, and rainbows have pots of gold at the ends, and leprechauns are after the gold... Then leprechauns must be unicorn hunters.. | 0non-cybersec
| Reddit |
Finding a power I should raising probabilities so that the sum equals something. <p>Given a list of probabilities <span class="math-container">$p_1, ..., p_n,\ (p_1 +\cdots + p_n = 1),$</span> is there an analytical solution to find a power <span class="math-container">$x$</span> such that</p>
<p><span class="math-container">$p_1^x + ... + p_n^x = q,$</span> where <span class="math-container">$q$</span> is some arbitrary real number?</p>
<p>I am able to find numerical solutions to this using optimisation in Python (Nelder-Mead) but I'm wondering if there's a faster analytical solution.</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Remove by date in Shell Script. <p>I have a shell script that creates a backup of a database. I would like to keep the last 7 days for files.</p>
<p>What is the syntax I need to remove files in a directory by date or can I keep the newest 7 files in a directory?</p>
<p>Script runs via cron</p>
<p>EDIT: something like this?</p>
<pre><code>find -type f -mtime +7 -maxdepth 1 -exec rm -f {} \;
</code></pre>
| 0non-cybersec
| Stackexchange |
Long time coming. 1st legal grow in 25 years.. | 0non-cybersec
| Reddit |
ImportError: No module named 'config.settings'; 'config' is not a package. <p>I'm trying to get my cookiecutter-django app running under Apache with mod_wsgi installed via pip.</p>
<p><code>python3 manager.py runserver</code> works.</p>
<p>But after running it in Apache, I got an error saying Module config not found. So I <code>pip install config</code>. (It is not installed on my development system.)</p>
<p>That put a config.py file in my /usr/local/pulseenv/lib/python3.5/site-packages.</p>
<p>That file had various syntax errors which I fixed. The errors were due to changes between python 2.7 and 3.5 as far as I can tell.</p>
<p>But now I get this error and I'm stuck where to go from here:</p>
<pre><code>ImportError: No module named 'config.settings'; 'config' is not a package
</code></pre>
<p>I don't see any clues in the error.log on how to further trace the error. So what is this module? Why do I need it? And how to figure out my problem is?</p>
<p>EDIT: </p>
<p>Here's my vhost file (/etc/apache2/sites-available/000-default.conf):</p>
<pre><code><VirtualHost *:80>
ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html
DocumentRoot /var/www/pulsemanager/pulsemanager
Alias /static /var/www/pulsemanager/pulsemanager/static
<Directory /var/www/pulsemanager/pulsemanager/static>
Require all granted
</Directory>
<Directory /var/www/pulsemanager/config>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /var/www/pulsemanager/config/wsgi.py
WSGIDaemonProcess pulsemanager
WSGIProcessGroup pulsemanager
WSGIApplicationGroup %{GLOBAL}
</VirtualHost>
</code></pre>
<p>My project is layed out as:</p>
<pre><code>ubuntu@ip-172-31-84-213:/var/www/pulsemanager$ ls
conf docs instantdudiobook.ipynb package.json pytest.ini reqs.txt setup.cfg
config env.example LICENSE pulsemanager README.md reqs.txt.sav survey2.txt
CONTRIBUTORS.txt gulpfile.js manage.py pulsenotebook.ipynb README.rst requirements utility
ubuntu@ip-172-31-84-213:/var/www/pulsemanager$ cd pulsemanager/
ubuntu@ip-172-31-84-213:/var/www/pulsemanager/pulsemanager$ ls
contrib locale lsrc3 static surveys templates users
ubuntu@ip-172-31-84-213:/var/www/pulsemanager/pulsemanager$
</code></pre>
<p>and here's my virutal environment:</p>
<pre><code>ubuntu@ip-172-31-84-213:/usr/local/pulseenv$ ls
bin include lib lib64 pip-selfcheck.json pyvenv.cfg share
ubuntu@ip-172-31-84-213:/usr/local/pulseenv$ cd lib
ubuntu@ip-172-31-84-213:/usr/local/pulseenv/lib$ pip3 list
Package Version
----------------------------- ----------------------
apturl 0.5.2
argon2 0.1.10
argon2-cffi 18.1.0
arrow 0.12.1
beautifulsoup4 4.4.1
binaryornot 0.4.4
blinker 1.3
Brlapi 0.6.4
cairocffi 0.8.0
certifi 2018.1.18
cffi 1.11.5
chardet 3.0.4
checkbox-support 0.22
click 6.7
config 0.3.9
cloud-init 18.2
command-not-found 0.3
configobj 5.0.6
cookiecutter 1.6.0
cryptography 1.2.3
cssselect2 0.2.1
cycler 0.10.0
defer 1.0.6
defusedxml 0.5.0
Django 2.0.3
django-admin-tools 0.8.1
django-allauth 0.35.0
django-autoslug 1.9.3
django-crispy-forms 1.7.2
django-debug-toolbar 1.9.1
django-environ 0.4.4
django-extensions 2.0.6
django-language-field 0.0.3
django-model-utils 3.1.1
feedparser 5.1.3
future 0.16.0
guacamole 0.9.2
hibagent 1.0.1
httplib2 0.9.1
idna 2.6
Jinja2 2.8
jinja2-time 0.2.0
jsonpatch 1.10
jsonpointer 1.9
language-selector 0.1
louis 2.6.4
lxml 3.5.0
Mako 1.0.3
MarkupSafe 0.23
oauthlib 1.0.3
onboard 1.2.0
padme 1.1.1
pdfrw 0.4
pexpect 4.0.1
pip 10.0.1
plainbox 0.25
poyo 0.4.1
prettytable 0.7.2
ptyprocess 0.5
pyasn1 0.1.9
pycparser 2.18
pycups 1.9.73
pycurl 7.43.0
pygobject 3.20.0
PyJWT 1.3.0
pyparsing 2.0.3
Pyphen 0.9.4
pyserial 3.0.1
python-apt 1.1.0b1+ubuntu0.16.4.1
python-dateutil 2.7.0
python-debian 0.1.27
python-systemd 231
python3-openid 3.1.0
pytz 2018.3
pyxdg 0.25
PyYAML 3.11
reportlab 3.3.0
requests 2.18.4
requests-oauthlib 0.8.0
sessioninstaller 0.0.0
setuptools 39.1.0
six 1.10.0
sqlparse 0.2.4
ssh-import-id 5.5
system-service 0.3
tinycss2 0.6.1
ubuntu-drivers-common 0.0.0
ufw 0.35
unattended-upgrades 0.1
unity-scope-calculator 0.1
unity-scope-chromiumbookmarks 0.1
unity-scope-colourlovers 0.1
unity-scope-devhelp 0.1
unity-scope-firefoxbookmarks 0.1
unity-scope-gdrive 0.7
unity-scope-manpages 0.1
unity-scope-openclipart 0.1
unity-scope-texdoc 0.1
unity-scope-tomboy 0.1
unity-scope-virtualbox 0.1
unity-scope-yelp 0.1
unity-scope-zotero 0.1
urllib3 1.22
usb-creator 0.3.0
webencodings 0.5.1
wheel 0.29.0
whichcraft 0.4.1
xdiagnose 3.8.4.1
xkit 0.0.0
XlsxWriter 0.7.3
</code></pre>
<p>EDIT 2:</p>
<p>I do have a config directory:</p>
<pre><code>ubuntu@ip-172-31-84-213:~$ cd /var/www/pulsemanager/config/
ubuntu@ip-172-31-84-213:/var/www/pulsemanager/config$ ls
__init__.py __pycache__ settings urls.py wsgi.py
ubuntu@ip-172-31-84-213:/var/www/pulsemanager/config$ cd settings
ubuntu@ip-172-31-84-213:/var/www/pulsemanager/config/settings$ ls
base.py __init__.py local.py production.py __pycache__ test.py
ubuntu@ip-172-31-84-213:/var/www/pulsemanager/config/settings$
</code></pre>
<p>And here's my wsgi.py. Seems like DJANGO_SETTINGS_MODULE should be defaulting to config.settings.production (/var/pulsemanager/config/settings/production.py):</p>
<pre><code>"""
WSGI config for pulsemanager project.
"""
import os
import sys
from django.core.wsgi import get_wsgi_application
# This allows easy placement of apps within the interior
# pulsemanager directory.
app_path = os.path.dirname(os.path.abspath(__file__)).replace('/config', '')
sys.path.append(os.path.join(app_path, 'pulsemanager'))
if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
application = get_wsgi_application()
if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
application = Sentry(application)
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
</code></pre>
<p>EDIT 3:</p>
<p>I removed the config package. I'm pretty sure that was a red herring. I see several references to 'config', e.g <code>os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")</code> and <code>app_path = os.path.dirname(os.path.abspath(__file__)).replace('/config', '')</code> in wsgi.py. Is one of these things where my problem is? </p>
<p>I added <code>export DJANGO_SETTINGS_MODULE=config.settings.production</code> to <code>config/__init__.py</code> and even tried putting <code>os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production"</code> near the top of wsgi.py.</p>
<p>I updated WSGIDaemonProcess to:</p>
<pre><code>WSGIDaemonProcess pulsemanager python-home=/usr/local/pulseenv/ python-path=/var/www/pulsemanager/pulsemanager:/usr/local/pulseenv/lib/python3.5/site-packages
</code></pre>
<p>but I'm still getting:</p>
<pre><code>ImportError: No module named 'config'
</code></pre>
<p>Here's the more of the error.log</p>
<pre><code> [Tue May 08 16:58:33.360155 2018] [mpm_event:notice] [pid 7420:tid 139690171062144] AH00489: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g mod_wsgi/4.6.4 Python/3.5 configured -- resuming normal operations
[Tue May 08 16:58:33.360248 2018] [core:notice] [pid 7420:tid 139690171062144] AH00094: Command line: '/usr/sbin/apache2'
[Tue May 08 16:58:33.414142 2018] [wsgi:info] [pid 7423:tid 139690171062144] mod_wsgi (pid=7423): Attach interpreter ''.
[Tue May 08 16:58:33.437248 2018] [wsgi:info] [pid 7423:tid 139690171062144] mod_wsgi (pid=7423): Adding '/var/www/pulsemanager/pulsemanager' to path.
[Tue May 08 16:58:33.441845 2018] [wsgi:info] [pid 7423:tid 139690171062144] mod_wsgi (pid=7423): Adding '/usr/local/pulseenv/lib/python3.5/site-packages' to path.
[Tue May 08 16:58:33.449915 2018] [wsgi:info] [pid 7423:tid 139690171062144] mod_wsgi (pid=7423): Imported 'mod_wsgi'.
[Tue May 08 16:58:33.454029 2018] [wsgi:info] [pid 7423:tid 139690021156608] [remote 172.31.6.98:39831] mod_wsgi (pid=7423, process='pulsemanager', application=''): Loading Python script file '/var/www/pulsemanager/config/wsgi.py'.
[Tue May 08 16:58:33.683108 2018] [wsgi:error] [pid 7423:tid 139690021156608] [remote 172.31.6.98:39831] mod_wsgi (pid=7423): Failed to exec Python script file '/var/www/pulsemanager/config/wsgi.py'.
[Tue May 08 16:58:33.683161 2018] [wsgi:error] [pid 7423:tid 139690021156608] [remote 172.31.6.98:39831] mod_wsgi (pid=7423): Exception occurred processing WSGI script '/var/www/pulsemanager/config/wsgi.py'.
...
[Tue May 08 16:59:13.003234 2018] [wsgi:error] [pid 7423:tid 139689928836864] [remote 172.31.93.15:41324] ImportError: No module named 'config'
</code></pre>
| 0non-cybersec
| Stackexchange |
systemd - how to power on USB drive?. <p>With udisksctl I'm able to power-off device:
<code>udisksctl power-off --block-device /dev/sdd</code></p>
<p>But how can I power it back ON from commandline?</p>
| 0non-cybersec
| Stackexchange |
Shuttle Discovery: Weird standing next to it knowing where it's been.... | 0non-cybersec
| Reddit |
How do I find the disc of convergence?. <p>I truly do not understand how to find the disc of convergence in power series. I know that it involves the idea that a series is convergent on <span class="math-container">$|z|<1$</span>, but to my understanding this can move around based on the representation of z in the problem? If someone could explain this to me or maybe explain a method to finding it that would be appreciated.</p>
<p>I have 3 problems in particular that I need to find the disc on, and they're all a little bit different...
There's <span class="math-container">$\frac{3}{1+z}$</span> centered at <span class="math-container">$z_0=1$</span>, <span class="math-container">$e^z$</span> at <span class="math-container">$z_0=1+i$</span>, and <span class="math-container">$\frac{i}{(z-i)(z-2i)}$</span> at <span class="math-container">$z_0=0$</span>.</p>
<p>Those are just for background so you know what kind of functions I need to find the disc for. Any guidance or hints will be appreciated.</p>
<p>Also if it helps, the 1st step to each of those problems was to find the Taylor Series of them.</p>
| 0non-cybersec
| Stackexchange |
Domain of holomorphy and upper bound for a certain function defined by integral. <p>I have few questions about a certain function. Let<br>
$$ g(\alpha) = \int_{\frac{1}{2}}^{\infty} \frac{\arcsin(\cos(\pi x)^2)^2}{x^{\alpha+2}} dx$$ Then </p>
<ol>
<li>Is $g(\alpha)$ holomorphic? If so, then what is it's domain of holomorphy? </li>
<li>Can some one provide a sharp upper bound for $|g(\alpha)|$? </li>
</ol>
<p>Here are my thoughts so far:</p>
<ol>
<li>Should I use Cauchy-Riemann conditions ?!</li>
<li>$\arcsin(\cos(\pi x)^2)^2 < \frac{\pi^2}{4}$ hence $$|g(\alpha)| \leq \frac{\pi^2}{4} \int_{\frac{1}{2}}^{\infty} \frac{1}{|x^{\alpha+2}|} = \frac{\pi^2}{4} \frac{2^{\Re{\alpha}+1}}{\Re{\alpha} + 1}$$</li>
</ol>
| 0non-cybersec
| Stackexchange |
How to match lines of text that start and end with specific characters?. <p>I have a text file which contains a list of items like below.</p>
<pre><code>leptop
pencil
group
leptop
book
gruop
buk
grop
laftop
pensil
laptop
pancil
laptop bag
bok
</code></pre>
<p>From this, I want to design a regex pattern which will match lines that start with the letter "l" and end with "op".</p>
<p>This is what I tried:</p>
<pre><code>a = re.search("^l.*op",line).group(0)
</code></pre>
<p>but I am getting:</p>
<pre><code>leptop
leptop
laftop
laptop
laptop # this one I don't want because it's coming from the word "laptop bag"
</code></pre>
<p>Is there any way to get like below?</p>
<pre><code>[leptop,leptop,laftop,laptop]
[pencil,pensil,pancil]
[group,gruop,grop]
[book,buk,bok]
[laptop bag]
</code></pre>
| 0non-cybersec
| Stackexchange |
John is painting his house when a homeless fellow comes along.... and offers some help. John agrees and tells the man to go around the back and paint the porch. After a couple hours, the homeless man finishes up. "Done already?" John asks. "Yeah," the homeless man replies, "but that's a BMW, not a porch." | 0non-cybersec
| Reddit |
How to send consecutive requests with HTTP keep-alive in node.js?. <p>I'm using node.js 0.6.18, and the following code makes node.js close the TCP connection between every two requests (verified with <code>strace</code> on Linux). How do I make node.js reuse the same TCP connection for multiple HTTP requests (i.e. keep-alive)? Please note that the webserver is capable of keep-alive, it works with other clients. The webserver returns a chunked HTTP response.</p>
<pre><code>var http = require('http');
var cookie = 'FOO=bar';
function work() {
var options = {
host: '127.0.0.1',
port: 3333,
path: '/',
method: 'GET',
headers: {Cookie: cookie},
};
process.stderr.write('.')
var req = http.request(options, function(res) {
if (res.statusCode != 200) {
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
process.exit(1)
}
res.setEncoding('utf8');
res.on('data', function (chunk) {});
res.on('end', function () { work(); });
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
process.exit(1);
});
req.end();
}
work()
</code></pre>
| 0non-cybersec
| Stackexchange |
How to get a total number of literature references and save it to a user defined counter?. <p>During my last experience with Cross-referencing on total counts between different files, which can be read <a href="https://tex.stackexchange.com/q/337263/44348">here</a>, a problem of saving the total number of literature references in a user defined counter appears. </p>
<p>There are at least two ways to save this value in auxiliary file using: </p>
<ol>
<li><code>zref</code> package given by Heiko Oberdiek, see, please, <a href="https://tex.stackexchange.com/a/337344/44348">here</a> </li>
<li><code>xr</code> and <code>refcount</code> packages given by Werner, see, please, <a href="https://tex.stackexchange.com/a/129317/44348">here</a> </li>
</ol>
<p>There are at least two ways of forming total count of literature references using:</p>
<ol>
<li><code>totcount</code> package given by Mike Renfro and also by Ian Thompson, see, please, <a href="https://tex.stackexchange.com/a/55585/44348">here</a> and <a href="https://tex.stackexchange.com/a/163455/44348">here</a>, respectively.</li>
<li><code>\printbibliography</code>makro given by Maieul, see, please, <a href="https://tex.stackexchange.com/a/66851/44348">here</a>. However in this case we produce also bibliographies of difference types.</li>
</ol>
<p>I try to get a total count of literature references by <code>totcount</code> and save it by <code>zref</code>. The problem is that command <code>\total{citenum}</code> returns a dirty code, e.g. <code>\def \c@citenum@totc {\c@citenum@totc }2}</code> for MWE, so I can not export this value to another .tex file. Note, that the last value <code>2</code> is a true value of references mentioned in a source code.</p>
<p>The question is how get a total number of literature references and save it to a user defined counter in a correct way? A given value should be compatible with one of the approaches to export the value to another .tex file. </p>
<p>The simplest way to solve the problem is to parse the following line <code>\def \c@citenum@totc {\c@citenum@totc }2}</code> and save symbols between last <code>}</code> and <code>}</code> in a separate counter. There can be also approaches to hack <code>totcount</code> or use another packages to form a total count of literature references.</p>
<p>MWE is a combination of <a href="https://tex.stackexchange.com/a/337344/44348">this</a> and <a href="https://tex.stackexchange.com/a/163455/44348">this</a> MWEs. </p>
<pre><code> \documentclass{report}
% http://texblog.org/2012/04/16/counting-the-total-number-of/
\usepackage{totcount}
\newtotcounter{citenum}
\def\oldcite{}
\let\oldcite=\bibcite
\def\bibcite{\stepcounter{citenum}\oldcite}
\usepackage{zref-abspage, zref-lastpage}
\makeatletter
\zref@newprop{myreferences}[0]{\total{citenum}}
\zref@addprops{LastPage}{myreferences}
\makeatother
\begin{filecontents}{\jobname.bib}
@article {First,
author = "FA"
}
@article {Second,
author = "SA"
}
\end{filecontents}
\begin{document}
Some citations: \cite{First}, \cite{First}, \cite{Second}.
This document contains \total{citenum} references (possibly with multiple citations).
\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}
</code></pre>
<p>A screenshot from an auxiliary file with highlighted part of text, which should be correct, i.e. there should be only value <code>2</code>. </p>
<p><a href="https://i.stack.imgur.com/1j6sH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1j6sH.png" alt="wrong format of total count of literature references"></a></p>
<p>UPT: I've tried to modify Werner's <a href="https://tex.stackexchange.com/a/129317/44348">solution</a>, i.e. put <code>\total{citenum}</code> in the following code <code>\setcounter{mycntr}{\total{citenum}}</code> and got the error: <code>Missing number, treated as zero. \setcounter{mycntr}{\total{citenum}}</code>.</p>
| 0non-cybersec
| Stackexchange |
Ionic - How to remove sidemenu on login page only?. <p>I need to remove sidemenu only on my login page. Otherwise remain. How it can be done? I'm using command ionic <code>ionic start myApp sidemenu</code> to create the project.</p>
<p>app.js</p>
<pre><code>.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {
url: "/login",
templateUrl: "templates/login.html",
controller: 'LoginCtrl'
})
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('app.search', {
url: "/search",
views: {
'menuContent' :{
templateUrl: "templates/search.html"
}
}
})
</code></pre>
<p>login page</p>
<pre><code><ion-view title="Login">
<ion-content>
<div class="list">
<label class="item">
<button class="button button-block button-positive" type="submit" ng-click="login()">Log in</button>
</label>
</div>
</ion-content>
</div>
</code></pre>
| 0non-cybersec
| Stackexchange |
Does $\mathbb{F}_2$ have a finite free resolution as an $\mathbb{F}_2[\mathbb{Q}]$-module?. <p>If <span class="math-container">$k$</span> is a field with 2 elements and <span class="math-container">$\mathbb{Q}$</span> is the additive group of rational numbers, is there a finite resolution of <span class="math-container">$k$</span> as <span class="math-container">$R=k[\mathbb{Q}]$</span> module?</p>
<p>By "finite" I mean a chain complex <span class="math-container">$$X= R^{n_1}\rightarrow R^{n_{2}}\rightarrow \dots \rightarrow R^{n_{j}}\rightarrow k $$</span> </p>
<p>where <span class="math-container">$R^{n}$</span> is a free generated R-module of dimension <span class="math-container">$n$</span>. </p>
<blockquote>
<p>Edit: It will be fine if one can find a finite resolution of finitely generated projective <span class="math-container">$R$</span>-module. </p>
</blockquote>
| 0non-cybersec
| Stackexchange |
Run as Administrator command installs app to admin user instead of current user. <p>I wrote an app for my client which is an electron app.</p>
<p>In order to capture the screen, I'm using a .dll library since installation can't copy DLL to system32 folder, after installation I create a batch file to copy DLL to system32 folder.</p>
<p>Installation, installs app to C:\Users\user\AppData\Local\Programs\</p>
<p>If I run this batch as an administrator, it copies DLL to the System32 folder but the app cannot access it.</p>
<p>If I run the installation as an Administrator instead of C:\Users\user it installs in C:\Users\admin which is same result I can not access to DLL and now app installed to the admin user.</p>
<p>If I run the app as an admin result still the same. Can access DLL but this time trying to access the admin's temp folder which app not working again.</p>
<p>Why run as admin not just installing with privileges but instead installs to that user's folder?</p>
<p>Side note: there is a user called "admin" not administrator, I tried to enable Administrator user which had no password. I tried to install there everything is working. I switched back to the regular user it is not working there.
I tried to change ownership of the System32 folder, didn't work either.
What is the problem here?</p>
| 0non-cybersec
| Stackexchange |
A proof about approximations in L1. <p>I'm getting a little confused about the next exercise:</p>
<blockquote>
<p>Suppose that <span class="math-container">$f_{k}\in L^1[-\pi,\pi]$</span> and <span class="math-container">$f\in L^1[-\pi,\pi]$</span> are such that <span class="math-container">$f_k \to f$</span> when <span class="math-container">$k\to \infty $</span>.</p>
<p>Prove that <span class="math-container">$\hat{f_k} \to \hat{f}$</span> uniformly, where <span class="math-container">$\hat{f_k}$</span> and <span class="math-container">$\hat{f}$</span> are the Fourier coefficents of <span class="math-container">$f_k$</span> and <span class="math-container">$f$</span> respectively.</p>
</blockquote>
<p>Mi attempt was:</p>
<p>For an <span class="math-container">$\varepsilon>0$</span> we know that <span class="math-container">$\exists N \in \mathbb{N}$</span> such that <span class="math-container">$|f_k(\theta)-f(\theta)|<\varepsilon$</span> for every <span class="math-container">$k>N$</span> and <span class="math-container">$\theta\in[-\pi,\pi]$</span>. Then, notice the following:</p>
<p><span class="math-container">$\hat{f_k}-\hat{f}=\frac{1}{2\pi}\int_{-\pi}^{\pi} f_k(\theta) e^{-in\theta}dx-\frac{1}{2\pi}\int_{-\pi}^{\pi} f(\theta) e^{-in\theta}dx=\frac{1}{2\pi}\int_{-\pi}^{\pi} [f_k(\theta)-f(\theta)] e^{-in\theta}dx\frac{1}{2\pi}\leq\frac{1}{2\pi}|\int_{-\pi}^{\pi} [f_k(\theta)-f(\theta)] e^{-in\theta}dx|\leq\frac{1}{2\pi}\int_{-\pi}^{\pi} |f_k(\theta)-f(\theta)| e^{-in\theta}dx\leq\frac{1}{2\pi}\int_{-\pi}^{\pi} \varepsilon e^{-in\theta}dx=\frac{\varepsilon}{2\pi}\int_{-\pi}^{\pi} e^{-in\theta}dx$</span></p>
<p>My problem is that the final integral is equal to <span class="math-container">$\frac{2sin(n\pi)}{n}=0$</span> since <span class="math-container">$n\in\mathbb{N}$</span>, and I don't like that. Do you see any mistake? or Can you see another way to prove this?</p>
<p>Any help is appreciated, thank you.</p>
| 0non-cybersec
| Stackexchange |
Update on the Jabuticaba tree. In just a few weeks time the fruit are ripening!. | 0non-cybersec
| Reddit |
IE jquery async file upload request pending. <p>I have created a new multiple drag drop file upload control with progress bar. It works great with all browsers, except an issue with IE 10 and above.</p>
<p>When I upload files in IE, most of times jquery async request will not complete. It shows pending. I can see it is pending in IE network debugger window. But in all other browsers it work well. I am clueless what is wrong here. Initally I thought it might be something related to caching. But after adding below parameters on server response. It still goes in pending state</p>
<pre><code>context.Response.AppendHeader("Cache-Control", "no-cache"); // HTTP 1.1
context.Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1
</code></pre>
<p><img src="https://i.stack.imgur.com/BiUNM.png" alt="enter image description here">
<img src="https://i.stack.imgur.com/yRipT.png" alt="enter image description here">
<img src="https://i.stack.imgur.com/UcP7z.png" alt="enter image description here"></p>
<pre><code>for (var i = 0; i < files.length; i++) {
var data = new FormData();
data.append(files[i].name, files[i]);
uploadFile(handlerurl, data);
}
function uploadFile(handlerurl, formData) {
var jqXHR = $.ajax({
type: 'POST',
url: handlerurl,
contentType: false,
processData: false,
async: true,
cache: false,
data: formData,
xhr: function () { },
success: function (result, status, xhr) { },
error: function (xhr, status, error) { }
});
}
</code></pre>
<p>I am calling this function per file. I am not sure what is wrong with IE.</p>
<p>Edit : After debugging, found out that server breakpoint will hit. but there is no files in <strong>context.Request.Files</strong>. No files send from jquery/AJAX.
You can reproduce this issue by keep upload same file again and again.</p>
| 0non-cybersec
| Stackexchange |
Which do you think is more likely American Civil War II or World War III?. | 0non-cybersec
| Reddit |
We'll all float on okay. | 0non-cybersec
| Reddit |
Keyboard shortcut to a sudo-script. <p>How do I create a keyboard shortcut to a script that needs sudo privileges?
I tried to create shortcuts via Ubuntu Keyboard Settings GUI to scripts </p>
<blockquote>
<p>"sh script.sh"
"sudo sh script.sh"</p>
</blockquote>
<p>They don't work.</p>
| 0non-cybersec
| Stackexchange |
tikz-decoration: How do I use "is input segment is closepath=< options>"?. <p>In the answer to this question <a href="https://tex.stackexchange.com/a/445941/138900">TikZ decorations: How to draw a closed path little by little?</a> @marmot uses this option of the decoration automaton in a way that I don't understand very well but that works perfectly thanks to <code>pgf keys</code>. </p>
<pre><code>\pgfkeys{pgf/.cd,
close/.code={\pgfpathclose}}
\pgfdeclaremetadecoration{draw part of a path}{initial}{
\state{initial}[width={\pgfmetadecoratedpathlength*\pgfdecorationsegmentlength},next state=final]{
\decoration{lineto}
}
\state{final}{\ifdim\pgfdecorationsegmentlength>0.999pt
\pgfkeys{/pgf/decoration automaton/if input segment is closepath=/pgf/close}
\fi
}
}
%
\tikzset{start segment/.style={decoration={draw part of a path,raise=2mm,segment length=#1},decorate}}
</code></pre>
<p>Indeed, according to the manual it is an option of the decoration automaton and as such it should be used as follows: <code>\state{final}[if input segment is closepath=\closepath]{}</code> but then the path is no longer closed. </p>
<p>The manual says: </p>
<blockquote>
<p><code>/pgf/decoration automaton/if input segment is closepath= < options > (no default)</code></p>
<p>This key checks whether the current input segment is a
closepath operation. If so, the <code><options></code> get executed; otherwise
nothing happens. You can use this option to handle a closepath in some
special way, for instance, switching to a new state in which
<code>\pgfpathclose</code> is executed.</p>
</blockquote>
<h2>First question:</h2>
<p>Why does writing <code>state{final}[if input segment is closepath=\pgfpathclose]{}</code> not work?</p>
<h2>Question 2:</h2>
<ul>
<li>How to use this option to change the <code>state</code> of the <code>decoration automaton</code> as indicated by the manual?</li>
<li>How do I use “is input segment is closepath=< options>”?</li>
</ul>
<p>Translated with www.DeepL.com/Translator</p>
| 0non-cybersec
| Stackexchange |
Animated Breakdancing. | 0non-cybersec
| Reddit |
TokuDB fails to load in MariaDB, even when transparent hugepages are disabled. <p>Earlier, I upgraded my website server to Ubuntu 14.04 LTS. I had a very nice setup with MariaDB and the TokuDB engine. However, the setup was kind of messed up when TokuDB refused to load properly, causing WordPress to display the install page because it could not read the database tables! Agh! (Hopefully they are still there...)</p>
<p>I <a href="https://unix.stackexchange.com/questions/99154/disable-transparent-hugepages">disabled transparent hugepages</a> (because they were enabled after the upgrade), but TokuDB still refuses to load, even when I followed the <a href="https://mariadb.com/kb/en/how-to-enable-tokudb-in-mariadb/" rel="nofollow noreferrer">directions on the MariaDB website</a>:</p>
<pre><code>MariaDB [(none)]> install soname 'ha_tokudb';
ERROR 1123 (HY000): Can't initialize function 'TokuDB'; Plugin initialization function failed.
</code></pre>
<p>What else could be causing TokuDB to not load?</p>
<p><strong>UPDATE:</strong> I have fixed the issue. You can read about it here: <a href="https://mariadb.atlassian.net/browse/MDEV-6165" rel="nofollow noreferrer">https://mariadb.atlassian.net/browse/MDEV-6165</a></p>
| 0non-cybersec
| Stackexchange |
HAProxy frontend managing both layer 4 and layer 7. <p>I am using HAProxy as a reverse-proxy to route all my domain names into various servers in a private computer cluster. Most of the times, the traffic represents web apps or APIs and it makes sense to use HTTPS to serve them. So I've create a frontend in that fashion for this:</p>
<p><strong>frontend layer7-http-listener</strong></p>
<pre><code>bind *:443 ssl crt /etc/httpd/certs/haproxy.pem
mode http
[...]
</code></pre>
<p>I also have one server that's expecting to receive TLS encrypted traffic and has its own certs. That means I have to revert to TCP to let data pass through without being decrypted in HAProxy. Also, HAProxy doesn't have to manage any certs in that situation. Something more like this:</p>
<p><strong>frontend layer4-listener</strong></p>
<pre><code>bind *:443 ssl
mode tcp
[...]
</code></pre>
<p>As a noob, what I understand is that HAProxy can't have 2 fontends with similar binds, namely *:443 here.</p>
<p>What's the best way to handle this knowing that both situations come from different domain names. Ex: <em>httpapp.mydomain.com</em> for layer 7 and <em>tcpserver.mydomain.com</em> for layer 4</p>
| 0non-cybersec
| Stackexchange |
Grub installation failed. <p>I had a good running installation of Debian Jessie, but then I ran <code>apt-get update && apt-get upgrade && apt-get dist-upgrade</code>.</p>
<p>And then after rebooting, it came directly to the BIOS. I realized that Grub was missing, so I ran a live cd and entered <code>Rescue mode</code>, mounted my root partition, + the boot partition and ran these commands:</p>
<p>Grub finds the linux image:</p>
<pre><code>root@debian:~# update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-3-amd64
Found initrd image: /boot/initrd.img-4.9.0-3-amd64
Found linux image: /boot/vmlinuz-4.9.0-0.bpo.3-amd64
Found initrd image: /boot/initrd.img-4.9.0-0.bpo.3-amd64
Found linux image: /boot/vmlinuz-3.16.0-4-amd64
Found initrd image: /boot/initrd.img-3.16.0-4-amd64
Found Ubuntu 16.10 (16.10) on /dev/sdb2
Adding boot menu entry for EFI firmware configuration
done
</code></pre>
<p>And then <code>grub-install</code> :</p>
<pre><code>root@debian:~# grub-install /dev/sda
Installing for x86_64-efi platform.
Could not prepare Boot variable: No such file or directory
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
</code></pre>
<p><code>lsblk</code> :</p>
<pre><code>root@debian:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 92.6G 0 part /
├─sda2 8:2 0 130.4G 0 part
└─sda3 8:3 0 573M 0 part /boot/efi
</code></pre>
<p>Did I do something wrong? Is there too little space on my <code>/boot/efi</code> partition?</p>
<pre><code>root@debian:~# ls -l /boot/efi/EFI/debian/
total 120
-rwx------ 1 root root 121856 Jul 20 20:29 grubx64.efi
</code></pre>
<p><code>efibootmgr</code> doesn't show a Debian installation:</p>
<pre><code>root@debian:~# efibootmgr --verbose | grep debian
</code></pre>
<p>Edit :</p>
<p>I keep getting this error every time I try and create a boot loader using <code>efibootmgr</code> :</p>
<pre><code>grub-install: info: executing efibootmgr -c -d /dev/sda -p 3 -w -L grub -l \EFI\grub\grubx64.efi.
Could not prepare Boot variable: No such file or directory
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
</code></pre>
| 0non-cybersec
| Stackexchange |
Recents not updating with new files in High Sierra. <p>There has been a lot of wingeing over the loss of "All My Files" in favor of "Recents" in High Sierra, and I am beginning to understand why. For one, it seems to be an opaque tool and I have yet to locate any means of adjusting how it behaves or even learn what criteria make files appear there.</p>
<p>One thing I am sure of is that files which I have created in the last 24 hours (specifically, screen shots) do not appear there. These are not esoteric files like .plist files, but .jpg files that I have saved within my Google Drive folder. I have no idea why this file is being excluded from "Recents" but it does infer why screen videocaps created by Monosnap and saving them to some mysterious location with a mysterious name, which would seem to be a perfect opportunity for "Recents" to be useful except that it doesn't seem to work.</p>
<p>Is there any way to adjust how "Recents" works or learn what the criteria are for files to appear there</p>
| 0non-cybersec
| Stackexchange |
Noticeable Differences? Increasing RAM?. I bought my computer in 2011 with 6GB of RAM. The computer also has an i7-2920XM with an NVidia Quadro 2000M (2GB VRAM) and a 500GB solid state drive. I just purchased 8GB of RAM for this computer, so the total amount of RAM when installed will be 14GB (32GB max for this pc). Will I notice any differences with the 14GB when compared with the 6GB? Will I notice any differences upgrading the 14GB to 32GB? Thanks, I've never upgraded RAM before and am unsure if it was worth it. | 0non-cybersec
| Reddit |
This chip wall. | 0non-cybersec
| Reddit |
This artist creates portraits using one continuous line. Here are some of my favorites.. | 0non-cybersec
| Reddit |
Is Onboard graphics enough for running Ubuntu 12.04?. <p>I have</p>
<ul>
<li><p>a laptop with core i3 processor and onboard graphics, 4gb RAM,</p></li>
<li><p>desktop with core2duo processor, onboard graphics, 2gb RAM.</p></li>
</ul>
<p>I want to install ubuntu 12.04 on my desktop currently running windows xp on it. Is configuration enough to run Ubuntu 12.04 on desktop?</p>
<p>Though i can install it on my laptop too but i would prefer to do it on desktop. </p>
| 0non-cybersec
| Stackexchange |
How to know when the contents of a PDF in Google Drive are indexed for searching. <p>I wrote a nice routine that allows me to get file Ids of 200 PDF files (uploaded some minutes ago onto my Google Drive) and <code>setValue</code> of a Google Sheet with those Ids.</p>
<p>In order to get the correct file Ids, it searches the content of the PDF.</p>
<p>The issue is that some days the content is searchable 5 minutes after uploading the 200 PDFs, and other days it takes up to 7 hours.</p>
<p>Is there a way to track the indexing status?</p>
<p>Is there a way to force a specific folder on Drive to be indexed with priority?</p>
| 0non-cybersec
| Stackexchange |
Restart sound indicator in ubuntu. <p>When the sound crashes, I can restart it with:</p>
<pre><code>sudo alsa force-reload
</code></pre>
<p>However, that doesn't bring the sound indicator (system tray indicator) back. </p>
<p>I am running Ubuntu 13.10 with LightDm.</p>
| 0non-cybersec
| Stackexchange |
How to calculate basic log expansion. <p>Without a calculator, so I cannot use the simple expansion of log(1+x)
Using wolfram we can see that </p>
<p><span class="math-container">$\log(\frac{\sqrt{n}}{2t}[\exp(\frac{2t}{\sqrt{n}})-1)])$</span></p>
<p><span class="math-container">$=\frac{t}{\sqrt{n}}+\frac{t^{2}}{6n}+...$</span></p>
<p>But by hand,</p>
<p><span class="math-container">$\exp(\frac{2t}{\sqrt{n}})=1+\frac{2t}{\sqrt{n}}+\frac{4t^{2}}{2!n}+...$</span></p>
<p><span class="math-container">$\exp(\frac{2t}{\sqrt{n}})-1=\frac{2t}{\sqrt{n}}+\frac{4t^{2}}{2!n}+...$</span></p>
<p>and so plugging in and using the log taylor directly doesnt give the simplified result. so how can it be seen?</p>
| 0non-cybersec
| Stackexchange |
Can a linear transformation $\mathbb{R}^n \rightarrow \mathbb{R}^n$ have a complex eigenvector?. <p>Can a transformation $\mathbb{R}^n \rightarrow \mathbb{R}^n$ have a complex eigenvector? </p>
<p>Similarly, can a transformation $\mathbb{C}^n \rightarrow \mathbb{C}^n$ have a real eigenvector? </p>
| 0non-cybersec
| Stackexchange |
Artificial intelligence is now trying to make sense out of the mess that is Congress. | 0non-cybersec
| Reddit |
Is there a by-hand prove that $\Gamma(\mathbb{C}P^n,E)$ is finite dimensional for a holomorphic vector bundle $E$?. <p>Please let me know whether this question is suitable for Mathoverflow.</p>
<p>Let <span class="math-container">$E$</span> be a finite holomorphic vector bundle (or more generally a coherent analytic sheaf) on a compact complex manifold <span class="math-container">$X$</span>. By the Cartan-Serre finiteness theorem, the cohomology <span class="math-container">$H^q(X,E)$</span> is a finite dimensional vector space for any <span class="math-container">$q$</span>, and in particular the space of global sections <span class="math-container">$\Gamma(X,E)=H^0(X,E)$</span> is finite dimensional.</p>
<p>The proof is based on Hodge theory or properties of Frechet spaces.</p>
<blockquote>
<blockquote>
<p>My question is, if we only consider <span class="math-container">$X=\mathbb{C}P^n$</span>, could we prove that <span class="math-container">$\Gamma(\mathbb{C}P^n,E)$</span> is finite dimensional by a direct, elementary computation?</p>
</blockquote>
</blockquote>
| 0non-cybersec
| Stackexchange |
Is it possible to decode an encoded PEM SSL certificate without OpenSSL in CLI?. <p>It is said that PEM certificates are encoded with ASCII (Base64), excluding labels.
Let's take this certificate as an example.</p>
<pre><code>-----BEGIN CERTIFICATE-----
MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
-----END CERTIFICATE-----
</code></pre>
<p>I tried to decode this data with ASCII (Base64) decoders but to no avail:</p>
<pre><code>MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
</code></pre>
<p>How can I decode it without OpenSSL? How to prove that this code is ASCII (Base64) ?
Could you help?</p>
| 0non-cybersec
| Stackexchange |
Is Rsyncing git repo good enough backup solution?. <p>I often backup my laptop to an external hard drive. Is rsyncing git repos over good enough backup solution or are there any problems with this method?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
so whatever.... | 0non-cybersec
| Reddit |
Abbreviations in mixed cases in small caps. <p>Some guidelines suggest the use of use small caps for abbreviations. I have an issue with the following one: iTRAQ. <a href="https://tex.stackexchange.com/questions/9534/using-small-caps-for-abbreviations">Here</a>
are some guidelines on mixed small-upper case abbreviations. I do want to keep the small-caps version visually as close as possible to the standard one.</p>
<p><code>iTRAQ</code>, <code>i\textsc{traq}</code>, and <code>i\kern.07em\textsc{traq}</code> look like this with the font charter:</p>
<p><img src="https://i.stack.imgur.com/WQUsD.png" alt="enter image description here"></p>
<p>The <em>i</em> in the two capitalized versions is larger than the small-caps afterwards and also <em>TRAQ</em> is lighter than the other text. Is there a good general solution for mixed-case abbreviations?</p>
<hr>
<p><strong>Update 1</strong>. Charter does not use real small caps, but scales the font, that's why <em>TRAQ</em> is so light. With <code>kpfonts</code>, which has true small caps, it looks slightly better, but still strange as the <code>i</code> is larger than the caps:</p>
<p><img src="https://i.stack.imgur.com/oc5aY.png" alt="enter image description here"></p>
<hr>
<p><strong>Update 2</strong>. Using Barbara Beeton's/tugboat's solution, I am happy with the result (second variant in the image):</p>
<p><img src="https://i.stack.imgur.com/lNnXB.png" alt="enter image description here"></p>
<p>Using <code>small</code> in <code>normalsize</code> environment, etc., to have fake (or true?) small-caps produces an results which is, for my eyes, visually appealing. The abbreviations are slightly lighter than true small-caps, but I can life with that for the benefit of having an universal solution.</p>
| 0non-cybersec
| Stackexchange |
The miracle of the United States Postal Service and how it became the most popular government agency in America. | 0non-cybersec
| Reddit |
Triple deckbox for magic the gathering. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
pip install customized include path. <p>I'm trying to install a library <code>pyleargist</code>. It requires another lib <code>libfftw3</code> to be manually installed which I've installed. Since I don't have the root privilege, I have to install <code>libfftw3</code> under my home directory: <code>~/usr/include</code> and <code>~/usr/lib</code>. Then I follow this post: <a href="https://superuser.com/questions/242190/how-to-install-matplotlib-on-os-x">https://superuser.com/questions/242190/how-to-install-matplotlib-on-os-x</a>, added:</p>
<pre><code>export LDFLAGS="-L~/usr/lib"
export CFLAGS="-I~/usr/include
</code></pre>
<p>So that <code>pip</code> knows it have to consult <code>/usr</code> to get the include (<em>.h files) and lib (</em>.a, *.so files). However, while running <code>pip install --user pyleargist</code>, it complains about:</p>
<pre><code>gcc-4.4.real: src/leargist.c: No such file or directory
gcc-4.4.real: no input files
error: command 'gcc' failed with exit status 1
</code></pre>
<p>I guess what happened is that the path is incorrect so that it can't find the <code>*.c</code> files (I think <code>pip</code> should have downloaded the file somewhere but not sure where it is).</p>
<p>So my questions are the following: 1) in this particular case, how can I install <code>pyleargist</code> with <code>include</code> and <code>lib</code> path under <code>~/usr</code>? 2) more generally, how can one provide additional path for <code>pip</code> so that it knows where to get the additional include files or libs if not found in the default path?</p>
<p>p.s I am on an <code>ubuntu</code> machine without <code>sudo</code> privilege.</p>
<p>ref: <br/>
<a href="https://pypi.python.org/pypi/pyleargist/1.0.1" rel="noreferrer">https://pypi.python.org/pypi/pyleargist/1.0.1</a> <br/>
<a href="http://www.fftw.org/" rel="noreferrer">http://www.fftw.org/</a></p>
| 0non-cybersec
| Stackexchange |
My friends and I built an Igloo!. | 0non-cybersec
| Reddit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.