text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
---|---|---|---|---|
JAX-RS and EJB exception handling. <p>I'm having trouble handling exceptions in my RESTful service:</p>
<pre><code>@Path("/blah")
@Stateless
public class BlahResource {
@EJB BlahService blahService;
@GET
public Response getBlah() {
try {
Blah blah = blahService.getBlah();
SomeUtil.doSomething();
return blah;
} catch (Exception e) {
throw new RestException(e.getMessage(), "unknown reason", Response.Status.INTERNAL_SERVER_ERROR);
}
}
}
</code></pre>
<p>RestException is a mapped exception:</p>
<pre><code>public class RestException extends RuntimeException {
private static final long serialVersionUID = 1L;
private String reason;
private Status status;
public RestException(String message, String reason, Status status) {
super(message);
this.reason = reason;
this.status = status;
}
}
</code></pre>
<p>And here is the exception mapper for RestException:</p>
<pre><code>@Provider
public class RestExceptionMapper implements ExceptionMapper<RestException> {
public Response toResponse(RestException e) {
return Response.status(e.getStatus())
.entity(getExceptionString(e.getMessage(), e.getReason()))
.type("application/json")
.build();
}
public String getExceptionString(String message, String reason) {
JSONObject json = new JSONObject();
try {
json.put("error", message);
json.put("reason", reason);
} catch (JSONException je) {}
return json.toString();
}
}
</code></pre>
<p>Now, it is important for me to provide both a response code AND some response text to the end user. However, when a RestException is thrown, this causes an EJBException (with message "EJB threw an unexpected (non-declared) exception...") to be thrown as well, and the servlet only returns the response code to the client (and not the response text that I set in RestException).</p>
<p>This works flawlessly when my RESTful resource isn't an EJB... any ideas? I've been working on this for hours and I'm all out of ideas.</p>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange | 591 | 2,189 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
IDA PRO + Windows 10 + WinDbg. <p>I didn't know That we've got a Reverse Engineering community around here :D
I am very glad on that....</p>
<p>anyway...
I haven't used IDA Pro for quite some time, upgraded to win 10 in the mean time.</p>
<p>I am unable to launch debugging directly from IDA Pro. WinDbg is setup correctly, windbg attaches a process just fine on itself. WinDbg has been added to the PATH variable.</p>
<p>When i try to launch debugging from ida PRO,or attach I get the error:</p>
<p>"Could not initialize WinDgbEngine (..) %1 is not a valid Win32 application"</p>
<p>ideas? seems like something is wrong with parameters passing?</p>
| 0non-cybersec
| Stackexchange | 195 | 655 |
Second Derivative of log. <p>Let: $\log(s)=z$ </p>
<p>I understand that </p>
<p>$$\frac{\partial}{\partial s}=\frac{\partial}{\partial z} \frac{\partial z}{\partial s} = e^{-z}\frac{\partial}{\partial z}$$</p>
<p>What is the second derivative, ie $\frac{\partial^2}{\partial s^2}$</p>
<p>Applying the Product rule I reach the following: </p>
<p>$$\frac{\partial^2}{\partial s^2} = \frac{\partial^2}{\partial z^2} \frac{\partial z}{\partial s} + \frac{\partial^2}{\partial z^2} \frac{\partial z}{\partial s} = e^{-z}\left(\frac{\partial^2}{\partial z^2} - \frac{\partial}{\partial z} \right ) $$</p>
<p>Is this correct or should we reach to: </p>
<p>$$\frac{\partial^2}{\partial s^2} =e^{-2z}\left(\frac{\partial^2}{\partial z^2} - \frac{\partial}{\partial z} \right )$$</p>
| 0non-cybersec
| Stackexchange | 292 | 784 |
Using [self method] or @selector(method)?. <p>Can anyone enlighten me as to the differences between the two statements below. </p>
<pre><code>[self playButtonSound];
</code></pre>
<p>AND:</p>
<pre><code>[self performSelector:@selector(playButtonSound)];
</code></pre>
<p>I am just asking as I had some old code that used <code>@selector</code>, now with a little more knowledge I can't think why I did not use <code>[self playButtonSound]</code> instead, they both seem to do the same as written here.</p>
<p>gary</p>
| 0non-cybersec
| Stackexchange | 162 | 523 |
Negative look ahead python regex. <p>I would like to regex match a sequence of bytes when the string '02 d0' does not occur at a specific position in the string. The position where this string of two bytes cannot occur are byte positions 6 and 7 starting with the 0th byte on the right hand side. </p>
<p>This is what I have been using for testing:</p>
<pre><code>#!/usr/bin/python
import re
p0 = re.compile('^24 [\da-f]{2} 03 (01|03) [\da-f]{2} [\da-f]{2} [\da-f]{2} (([^0])| (0[^2])|(02 [^d])|(02 d[^0])) 01 c2 [\da-f]{2} [\da-f]{2} [\da-f]{2} 23')
p1 = re.compile('^24 [\da-f]{2} 03 (01|03) [\da-f]{2} [\da-f]{2} [\da-f]{2} (([^0])|(0[^2])|(02 [^d])|(02 d[^0])) 01')
p2 = re.compile('^24 [\da-f]{2} 03 (01|03) [\da-f]{2} [\da-f]{2} [\da-f]{2} (([^0])|(0[^2])|(02 [^d])|(02 d[^0]))')
p3 = re.compile('^24 [\da-f]{2} 03 (01|03) [\da-f]{2} [\da-f]{2} [\da-f]{2} (?!02 d0) 01')
p4 = re.compile('^24 [\da-f]{2} 03 (01|03) [\da-f]{2} [\da-f]{2} [\da-f]{2} (?!02 d0)')
yes = '24 0f 03 01 42 ff 00 04 a2 01 c2 00 c5 e5 23'
no = '24 0f 03 01 42 ff 00 02 d0 01 c2 00 c5 e5 23'
print p0.match(yes) # fail
print p0.match(no) # fail
print '\n'
print p1.match(yes) # fail
print p1.match(no) # fail
print '\n'
print p2.match(yes) # PASS
print p2.match(no) # fail
print '\n'
print p3.match(yes) # fail
print p3.match(no) # fail
print '\n'
print p4.match(yes) # PASS
print p4.match(no) # fail
</code></pre>
<p>I looked at <a href="https://stackoverflow.com/questions/9843338/regex-negative-look-ahead-between-two-matches">this example</a>, but that method is less restrictive than I need. Could someone explain why I can only match properly when the negative look ahead is at the end of the string? What do I need to do to match when '02 d0' does not occur in this specific bit position?</p>
| 0non-cybersec
| Stackexchange | 747 | 1,805 |
Extending another TypeScript function with additional arguments. <p>Is it possible in TypeScript to define a function type and extend its argument list in another type (overloading function type?)?</p>
<p>Let's say I have this type:
<code>
type BaseFunc = (a: string) => Promise<string>
</code></p>
<p>I want to define another type with one additional argument (b: number) and the same return value.</p>
<p>If at some point in the future <code>BaseType</code> adds or changes arguments this should also be reflected in my overloaded function type.</p>
<p>Is this possible?</p>
| 0non-cybersec
| Stackexchange | 167 | 590 |
jQuery .serializeObject is not a function - only in Firefox. <p>I'm using jQuery, and specifically this function</p>
<p><code>$("#postStatus").serializeObject();</code></p>
<p>It works absolutely fine in Chrome and Safari, but when I do it in Firefox it doesn't work. I used Firebug to see what error it was giving, and i'm getting this</p>
<p><code>$("#postStatus").serializeObject is not a function</code> </p>
<p>Why doesn't this function work in Firefox?</p>
<p>UPDATE...</p>
<p>Oh yes, I completely forgot that it's not a core function. I remember that I searched a way to serialize a form and found this solution;</p>
<pre><code>$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
};
</code></pre>
<p>I've managed to fix this issue by placing the function above at the top of the JS file. Thanks for your help guys.</p>
| 0non-cybersec
| Stackexchange | 357 | 1,153 |
UWSGI can't import module 'mysite' with nginx and flask. <p>I'm new to using uwsgi and nginx and I haven't been able to figure out why I am getting this error from uwsgi: </p>
<pre><code>ImportError: No module named mysite
unable to load app 0 (mountpoint='my_ipaddr|') (callable not found or import error)
</code></pre>
<p>Here is my nginx config file:</p>
<pre><code>server {
listen 80;
server_name my_ipaddr;
location /static {
alias /var/www/mysite/static;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/mysite.sock;
uwsgi_param UWSGI_PYHOME /var/www/mysite/venv;
uwsgi_param UWSGI_CHDIR /var/www/mysite;
uwsgi_param UWSGI_MODULE app;
uwsgi_param UWSGI_CALLABLE app;
}
</code></pre>
<p>Here is my mysite.ini for uwsgi:</p>
<pre><code>[uwsgi]
vhost=true
socket=/tmp/mysite.sock
venv = /var/www/mysite/venv
</code></pre>
<p>Here is my app.py:</p>
<pre><code>from flaskext.markdown import Markdown
from views import app
Markdown(app)
def main():
app.run()
if __name__ == '__main__':
main()
</code></pre>
<p>I am able to run the app with uwsgi when launching it from the command line but I haven't been able to get it working with nginx using the above setup.</p>
| 0non-cybersec
| Stackexchange | 477 | 1,312 |
Exit terminal after running a bash script. <p>I am trying to write a <code>bash</code> script to open certain files (mostly pdf files) using the <code>gnome-open</code> command. I also want the terminal to exit once it opens the pdf file.</p>
<p>I have tried adding <code>exit</code> to the end of my script however that does not close the terminal. I did try to search online for an answer to my question but I couldn't find any proper one, I would really appreciate it if you guys could help.</p>
<p>I need an answer that only kills the terminal from which I run the command not all the terminals would this be possible? The previous answer which I accepted kills all the terminal windows that are open. I did not realize this was the case until today.</p>
| 0non-cybersec
| Stackexchange | 187 | 761 |
Tabular with overbrackets connecting elements. <p>I want to make a vertical tree with brackets like the one bellow.</p>
<p><a href="https://i.stack.imgur.com/kvRJ1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kvRJ1.png" alt="enter image description here"></a></p>
<p>I tried <code>\overbrace</code> but I can't connect the 2nd row nodes (<code>\Omega_{r}</code> and <code>\Omega_{m}</code>) with the first.</p>
<pre><code>\begin{tabular}{l|c c c}
Total matter&& $\Omega$ &\\
Different equations of state &$\Omega_{m}$&$\Omega_{r}$&$\Omega_{\Lambda}$\\
Difefrent species &$\overbrace{\Omega_{b}\quad\Omega_{c}}^{}$&
$\overbrace{\Omega_{\gamma}\quad\Omega_{\nu}}^{}$&
\end{tabular}
</code></pre>
<p>I get</p>
<p><a href="https://i.stack.imgur.com/EAVF2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EAVF2.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange | 345 | 937 |
I have a contract at a well known computer company. I do about two hours work per week and bill for 40 hours. [Remorse]: I've been there over a year and up to now they've paid me $228,000. I don't have to go into the office. Nobody emails me unless I email them. Nobody sets up a meeting with me unless I set it up. Sometimes, I go into the office just to see what's happening. This morning I was there at 9:15, got a coffee, read the company website, added two pictures to a Sharepoint site. By 10 am I was bored. I hung out until 11:00, then picked up a sandwich from the cafeteria and went to the golf driving range. I was home around 1pm, where I've been on Reddit. I'm just waiting for happy hour so I can start drinking. On other days I might do my own side business, but still charge for my main contract as well. I feel terrible about it, but I can't turn down the money. I keep getting praise from the client and they keep extending my contract, even though nobody seems to know or care what I do. Managers are just happy if I keep out of their way. | 0non-cybersec
| Reddit | 260 | 1,059 |
Any good way to calculate $\frac {\alpha ^ n - 1 } {\alpha - 1} \pmod{c}$. <p>I tried by multiplying modular inverse of denominator to the numerator and then taking modulo <span class="math-container">$c$</span>, but there are problems when the inverse does not exist. </p>
<p>So is there a good way to solve this problem.</p>
<p>Constraints
<span class="math-container">$$ 1 \le \alpha \le 1e9 $$</span>
<span class="math-container">$c$</span> is a prime
<span class="math-container">$$ 1 \le n \le 1e9 $$</span></p>
| 0non-cybersec
| Stackexchange | 165 | 520 |
Bounds for associated Legendre polynomials. <p>I am trying to analyze the behaviour of the Associated Legendre polynomials <span class="math-container">$P_{n}^{m}$</span> on <span class="math-container">$[0,1]$</span>. More specifically, I am trying to get upper bounds for <span class="math-container">$P_{n}^{m}$</span> on <span class="math-container">$[0,1]$</span>. Bernstein's inequality for the Legendre polynomial is a classical result which states the following
<span class="math-container">\begin{align*}
|P_{n}(x)| \leq \sqrt{\frac{2}{\pi n}}\frac{1}{(1-x^2)^{1/4}}.
\end{align*}</span>
I am interested in bounds of the above type for <span class="math-container">$P_{n}^{m}$</span>'s. For a fixed <span class="math-container">$n\in \mathbb{N}$</span>, normalizing <span class="math-container">$P_{n}^{m}$</span> appropriately as below, for every <span class="math-container">$|m|\leq n$</span> we have
<span class="math-container">\begin{align*}
\frac{(n-m)!}{(n+m)!} \int_{0}^{1} P_{n}^{m}(x)^2 dx = \frac{C}{2n+1}.
\end{align*}</span><br />
So specifically, I am interested in upper bounds on <span class="math-container">$[0,1]$</span> for the following functions, for a fixed <span class="math-container">$n$</span>, as <span class="math-container">$m \in \mathbb{Z}$</span> varies in <span class="math-container">$[-n,n]$</span>.
<span class="math-container">\begin{align*}
L_{n}^{m}(x) := \sqrt{\frac{(n-m)!}{(n+m)!}} ~P_{n}^{m}
\end{align*}</span></p>
<p>I did a bit of searching and found that bounds for the above collection of normalized Associated Legendre functions are available in <a href="https://www.sciencedirect.com/science/article/pii/S0021904598932075" rel="nofollow noreferrer">this</a> and <a href="https://www.sciencedirect.com/science/article/pii/002190459190077N" rel="nofollow noreferrer">this</a> and I state them below.</p>
<p><span class="math-container">\begin{align}
\sqrt{\frac{(n-m)!}{(n+m)!}}~ |P_{n}^{m} (x)| & \leq \frac{1}{2^m m!} \sqrt{\frac{(n+m)!}{(n-m)!}} (1-x^2)^{m/2} := A_{n}^{m}(x) , \tag{1}\label{1}\\
\sqrt{\frac{(n-m)!}{(n+m)!}}~ |P_{n}^{m} (x)| & \leq \frac{1}{n^{1/4}} \frac{1}{(1-x^2)^{1/8}} =: f_{n}(x).\tag{2} \label{2}
\end{align}</span></p>
<p>I tried to see how good these bounds are. It seemed that <span class="math-container">$A_{n}^{m}$</span> is a good approximate for <span class="math-container">$L_{n}^{m}$</span> near 1 (which is expected as it captures the vanishing of <span class="math-container">$L_{n}^{m}$</span> at 1), but elsewhere it is not good.</p>
<p>And the bound <span class="math-container">$f_n$</span> appears to be just an upper bound which does not necessarily capture any feature of <span class="math-container">$L_{n}^{m}$</span>.</p>
<p>Hence my question is: Are some other better bounds (than the ones in \ref{1} and \ref{2}) known for <span class="math-container">$L_{n}^{m}$</span>'s?</p>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange | 1,032 | 2,919 |
No 'Access-Control-Allow-Origin' - Node / Apache Port Issue. <p>i've created a small API using Node/Express and trying to pull data using Angularjs but as my html page is running under apache on localhost:8888 and node API is listen on port 3000, i am getting the No 'Access-Control-Allow-Origin'. I tried using <code>node-http-proxy</code> and Vhosts Apache but not having much succes, please see full error and code below. </p>
<blockquote>
<p>XMLHttpRequest cannot load localhost:3000. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8888' is therefore not allowed access." </p>
</blockquote>
<pre><code>// Api Using Node/Express
var express = require('express');
var app = express();
var contractors = [
{
"id": "1",
"name": "Joe Blogg",
"Weeks": 3,
"Photo": "1.png"
}
];
app.use(express.bodyParser());
app.get('/', function(req, res) {
res.json(contractors);
});
app.listen(process.env.PORT || 3000);
console.log('Server is running on Port 3000')
</code></pre>
<h2>Angular code</h2>
<pre><code>angular.module('contractorsApp', [])
.controller('ContractorsCtrl', function($scope, $http,$routeParams) {
$http.get('localhost:3000').then(function(response) {
var data = response.data;
$scope.contractors = data;
})
</code></pre>
<h2>HTML</h2>
<pre><code><body ng-app="contractorsApp">
<div ng-controller="ContractorsCtrl">
<ul>
<li ng-repeat="person in contractors">{{person.name}}</li>
</ul>
</div>
</body>
</code></pre>
| 0non-cybersec
| Stackexchange | 539 | 1,646 |
Is sending plain passwords over SSL as part of a password update process bad?. <p>The Web application I'm working on is 100% SSL secured (or rather TLS as it is called today...). The application recently has been audited by a security company. I mostly agree with their results but there was one thing that led to great debates:</p>
<p>As part of the password change process for users, the user has to provide the old password as well as the new one two times—nothing unusual. In addition to that the new password has to conform to a password policy (minimum length, yadda yadda).</p>
<p>The application is realized with Vaadin which uses small AJAX messages to update the UI. The whole logic of the application lives on the server. This means that all validation of the password change form happens on the server. <strong>In order to validate the form, both the old password as well as the two new passwords (which should match of course) have to be sent to the server. If there is anything wrong (old password is wrong, new passwords don't match, new password doesn't conform to the password policy), the user gets an error. Unfortunately as part of the syncing process Vaadin sends all form data back to the client again—including old and new passwords.</strong></p>
<p>Since all this happens over SSL I never thought twice about it but the security company saw this as a security risk of the highest severity. Note that the issue in the eyes of the security company was not that the data is sent to the server but <strong>that the server included the data in its response in case validation failed</strong>. So our current solution is to empty all fields if validation fails. This leads to poor user experience as the user has to fill in three text fields again and again if for example the passwords repeatedly don't match the password policy.</p>
<p>Am I being naïve in thinking this is way over the top? I mean, if an attacker breaks the encryption, they have access to the whole traffic anyway.</p>
<hr>
<p><em>edit</em>: Regarding shoulder surfing I want to make clear that <strong>no password is ever echoed back to the user</strong>. All input fields are proper password fields that only show placeholders but no actual characters.</p>
| 0non-cybersec
| Stackexchange | 504 | 2,253 |
c++11 std::unique_ptr error cmake 3.11.3 bootstrap. <p>I am trying to bootstrap cmake 3.11.3 on Ubuntu 16.04.4 LTS xenial.</p>
<p>I have upgrade my gnu g++ compiler as follows:</p>
<pre><code>> $ g++ --version
g++ (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0 Copyright (C) 2018 Free
Software Foundation, Inc. This is free software; see the source for
copying conditions. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
</code></pre>
<p>And manually re-pointed the symbolic links:</p>
<pre><code>$ ll /usr/bin/*g++*
lrwxrwxrwx 1 root root 5 Jun 8 16:57 /usr/bin/g++ -> g++-8*
-rwxr-xr-x 1 root root 919832 Apr 24 15:02 /usr/bin/g++-5*
lrwxrwxrwx 1 root root 22 Jun 6 04:26 /usr/bin/g++-8 -> x86_64-linux-gnu-g++-8*
lrwxrwxrwx 1 root root 22 Jun 8 16:58 /usr/bin/x86_64-linux-gnu-g++ -> x86_64-linux-gnu-g++-8*
lrwxrwxrwx 1 root root 5 Apr 24 15:02 /usr/bin/x86_64-linux-gnu-g++-5 -> g++-5*
-rwxr-xr-x 1 root root 1071984 Jun 6 04:26 /usr/bin/x86_64-linux-gnu-g++-8*
</code></pre>
<p>However, I get the following error in the configuration of cmake:</p>
<pre><code>$ sudo ./bootstrap
---------------------------------------------
CMake 3.11.3, Copyright 2000-2018 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: make
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
make: Warning: File 'Makefile' has modification time 2.3 s in the future
make: 'cmake' is up to date.
make: warning: Clock skew detected. Your build may be incomplete.
loading initial cache file /mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at CMakeLists.txt:92 (message):
The C++ compiler does not support C++11 (e.g. std::unique_ptr).
-- Configuring incomplete, errors occurred!
See also "/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeOutput.log".
See also "/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
</code></pre>
<p>Any idea why I get a c++11 <code>std::unique_ptr</code> non-compliant error?</p>
| 0non-cybersec
| Stackexchange | 885 | 2,506 |
How can I "cache" a mongoDB/Mongoose result to be used in my Express.js views and routes. <p>What I'm trying to achieve is some sort of way to <strong>cache results</strong> of a <strong>mongoDB/Mongoose</strong> query that I can use in my views and routes. I'd need to be able to update this cache whenever a new document is added to the collection. I'm not sure if this is possible and if it is then how to do it, due to how the functions are asynchronous</p>
<p>This is currently what I have for storing the galleries, however this is executed with every request.</p>
<pre><code>app.use(function(req, res, next) {
Gallery.find(function(err, galleries) {
if (err) throw err;
res.locals.navGalleries = galleries;
next();
});
});
</code></pre>
<p>This is used to get gallery names, which are then displayed in the navigation bar from a dynamically generated gallery. The gallery model is setup with just a <strong>name</strong> of the gallery and a <strong>slug</strong></p>
<p>and this is part of my <strong>EJS</strong> view inside of my navigation which stores the values in a dropdown menu.</p>
<pre><code><% navGalleries.forEach(function(gallery) { %>
<li>
<a href='/media/<%= gallery.slug %>'><%= gallery.name %></a>
</li>
<% }) %>
</code></pre>
<p>The website I'm working on is expected to get hundreds of thousands of concurrent users, so I don't want to have to query the database for every single request if not needed, and just update it whenever a new gallery is created.</p>
| 0non-cybersec
| Stackexchange | 477 | 1,582 |
How to cover holes with disks of a fixed radius?. <p>So you have a sheet / area of a given dimension, and within this area are holes (their center point(x,y) and radius are given). The problem is you need to cover these holes with patches. These circular patches have a fixed radius (ie: radius of 5) and are not allowed to overlap with each other (but can touch). You're allowed to use as many as you like, the goal is not to find the most optimal number, but to see if it's possible to cover every single hole.</p>
<p>I've solved a similar problem with a KD tree, but due to the 3D dimensional nature of the holes in this problem, I'm unsure on how to approach it. Just looking for a pointer in the right direction, not the coded solution :) </p>
| 0non-cybersec
| Stackexchange | 184 | 750 |
Regarding booting Ubuntu 16.04 onto Windows 10. <p>I've run into multiple issues in trying to dual boot Ubuntu 16.04 onto Windows 10. My laptop is an Acer Aspire E15. I've tried manually partitioning space and installing Ubuntu as well as doing the easier method of just choosing "Install alongside Windows." I've had Windows on my laptop before installing Ubuntu. But after installation, no boot loader comes up that asks if I want either Windows or Ubuntu. </p>
<p>I'm posting this because I've read multiple articles and forums about this same issue but none of what I've read have fixed the issue. One such fix is by going to cmd and typing in the command "bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi" But this didn't work.
I notice that "Ubuntu" doesn't even show up as a bootable option after installing ubuntu. Is there any recommendations for this? i.e. should I try an older version of Ubuntu? Would that even work? </p>
<p>Thanks!
-Jacob Hempel</p>
| 0non-cybersec
| Stackexchange | 248 | 970 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Connection Reset when port forwarding with Vagrant. <p>I have Vagrant/VirtualBox running an Ubuntu 12.04 LTS OS. I have configured Vagrant to forward the guest port 8000 to my host port 8888.</p>
<pre><code>[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 8000 => 8888 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
</code></pre>
<p>When the virtual machine starts up, I start a Django dev server on port 8000.</p>
<pre><code>Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
</code></pre>
<p>Okay great, I can put it in the background and I can even <code>curl localhost:8000</code> and get some output from the server </p>
<pre><code><div id="explanation">
<p>
You're seeing this message because you have <code>DEBUG = True</code> in your
Django settings file and you haven't configured any URLs. Get to work!
</p>
</div>
</code></pre>
<p>But when I try to hit the server from my host machine with a Firefox/Chrome/Telnet I'm getting Connection Reset/Connection Lost/ERR_CONNECTION_RESET etc.</p>
<p>First I thought it may be some iptables thing, but it turns out Ubuntu has default allow everything. I also turned off the firewall on my host machine. How can I get to the bottom of this?</p>
| 0non-cybersec
| Stackexchange | 453 | 1,482 |
Status on Naoki Katoh's "Rectangle Wiring Problem" (minimum length tree to cover a partitioned rectangle)?. <p>I have found this interesting problem in graph theory and geometry which is allegedly an open problem but latest status seems to be from 01/25/02. I can't seem to find any more information about it, not even other papers describing it.</p>
<p><a href="https://i.stack.imgur.com/jT7Ub.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jT7Ub.png" alt="Problem"></a></p>
| 0non-cybersec
| Stackexchange | 155 | 511 |
How can I replace a window's URL hash with another response?. <p>I am trying to change a hashed URL (document.location.hash) with the replace method, but it doesn't work.</p>
<pre><code>$(function(){
var anchor = document.location.hash;
//this returns me a string value like '#categories'
$('span').click(function(){
$(window).attr('url').replace(anchor,'#food');
//try to change current url.hash '#categories'
//with another string, I stucked here.
});
});
</code></pre>
<p>I dont want to change/refresh page, I just want to replace URL without any responses.</p>
<p>Note: I don't want to solve this with a href="#food" solution.</p>
| 0non-cybersec
| Stackexchange | 196 | 666 |
ggplot2 + aes_string inside a function via formula interface. <p>Interactively, this example works fine:</p>
<pre><code>p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p + facet_grid(. ~ vs)
</code></pre>
<p>Now, make a function with a formula interface and use <code>aes_string</code> to do this same thing, and it doesn't work (error is: <code>Error in layout_base(data, cols, drop = drop) : At least one layer must contain all variables used for facetting</code>):</p>
<pre><code>tf <- function(formula, data) {
res <- as.character(formula[[2]])
fac2 <- as.character(formula[[3]][3])
fac1 <- as.character(formula[[3]][2])
# p <- ggplot(aes_string(x = fac1, y = res), data = data)
# p <- p + geom_point() # original attempt
p <- ggplot() # This is Joran's trick, but it doesn't work here
p <- p + geom_point(aes_string(x = fac1, y = res), data = data)
p <- p + facet_grid(.~fac2) # comment this out, and it works but
# of course is not faceted
}
p <- tf(formula = wt ~ am*vs, data = mtcars)
</code></pre>
<p>By Joran's trick I refer to <a href="https://stackoverflow.com/questions/14348781/ggplot2-inside-function-with-a-2nd-aesthetic-scoping-issue">here</a>, which is a similar question I posted recently. In this case <code>ggplot2</code>doesn't see my faceting request. Making it <code>facet_grid(".~fac2")</code> had no effect. Suggestions? I'm continually out-witted by these things. Thanks!</p>
| 0non-cybersec
| Stackexchange | 523 | 1,447 |
Security challenges of administrative share in windows 7. <p>I am going to the network+ class, and today my teacher said that every time you want to configure a network, disable the hidden share of hard drives in windows. He said that if this is enabled, you will be hacked very easily. Is that correct while anyone who want to access shared drives must has the administrator permission?</p>
<p>And also as I searched, to disable this configuration permanently I have to disable the administrative share completely. What problems may happen if this feature is disabled?</p>
<p>Thanks.</p>
| 0non-cybersec
| Stackexchange | 131 | 591 |
Extract text and put into table. <p>As result of the checkresiduals() function from the forecast package and rbind() function I got this matrix (ETS_RESIDUALS):</p>
<pre><code>#Result of checkresiduals() function
[,1]
[1,] "Q* = 161.83, df = 18.8, p-value < 2.2e-16"
[2,] "Q* = 125.46, df = 18.8, p-value < 2.2e-16"
[3,] "Q* = 263.65, df = 18.8, p-value < 2.2e-16"
[4,] "Q* = 81.503, df = 18.8, p-value = 8.763e-10"
[5,] "Q* = 36.616, df = 18.8, p-value = 0.008178"
str(ETS_RESIDUALS)
#chr [1:5, 1] "Q* = 161.83, df = 18.8, p-value < 2.2e-16" "Q* = 125.46, df = 18.8, p-value < 2.2e-16" "Q* = 263.65, df = 18.8, p-value < 2.2e-16" ...
class(ETS_RESIDUALS)
#[1] "matrix"
</code></pre>
<p>Now, my intention is to split this lines of text with grep() or other functions into a data.frame (with four columns TEST, Q*, df, p-value), like in the example below:</p>
<pre><code>TEST Q* df p-value
--------------------------------------------
TEST_1 161.83 18.8 2.2e-16
TEST_2 125.46 18.8 2.2e-16
TEST_3 263.65 18.8 2.2e-16
TEST_4 81.503 18.8 8.763e-10
TEST_5 36.616 18.8 0.008178
</code></pre>
<p>I try with this lines of code but results are not good.</p>
<pre><code>ETS_RESIDUALS %>%
stringr::str_replace_all("(\\S+) =", "`\\1` =") %>%
paste0("data.frame(", ., ", check.names = FALSE)")
</code></pre>
<p>Can anyone help me with this code?</p>
| 0non-cybersec
| Stackexchange | 637 | 1,519 |
MySQL Access Denied, tried a few things, pulling hair. <p>I'm trying to get to know Django (my first attempts at a framework, or any backend work for that matter), and I'm seriously stumped by MySQL, and SQL in general.</p>
<p>I'm trying to create a new database and I get:</p>
<pre><code>ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'dbname'
</code></pre>
<p>So I've tried the advice here: <a href="https://stackoverflow.com/questions/8838777/error-1044-42000-access-denied-for-user-localhost-to-database-db">Access denied for user localhost</a></p>
<p>Which might work, but using: <code>mysql -uroot -p</code> I can't seem to remember my password. I don't recall setting one, but leaving it blank doesn't work either.</p>
<p>Also, I have to run mysql using:</p>
<pre><code>/Applications/MAMP/Library/bin/mysql
</code></pre>
<p>Because:</p>
<pre><code>mysql
</code></pre>
<p>results in:</p>
<pre><code>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
</code></pre>
<p>I'm guessing that's related to the error above, right?</p>
<p>I'm in a right mess here, SQL and the command line intimidate the heck out of me and it seems so easy to break stuff. If anyone could offer some pointers that would be great. </p>
| 0non-cybersec
| Stackexchange | 410 | 1,293 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Disable Months On Month/DatePicker. <p>Please look at my <a href="http://jsfiddle.net/RWY2X/31/" rel="noreferrer">fiddle</a>.</p>
<p>I have a monthpicker which only allows users to select a year in advance but what I want is for past months to be disabled and also any months after a year in advance to be disabled but I cant figure out how to get this to work.</p>
<p>Example Scenario
Current month is 'October' so for 'Year 2015' months 'Jan to Sept' will be disabled and months 'Nov to Dec' will be disabled for 'Year 2016'</p>
<p>I have tried using minDate: "0" and maxDate: "1y" but they don't work.</p>
<p><strong>HTML</strong></p>
<pre><code><div class="input-group date" style="width: 200px">
<input type="text" id="example1" class="form-control" style="cursor: pointer"/>
<span class="input-group-addon">
<i class="glyphicon glyphicon-calendar"></i>
</span>
</div>
</code></pre>
<p><strong>JQuery</strong></p>
<pre><code>$('#example1').datepicker
({
format: "MM yyyy",
minViewMode: 1,
autoclose: true,
startDate: new Date(new Date().getFullYear(), '0', '01'),
endDate: new Date(new Date().getFullYear()+1, '11', '31')
});
</code></pre>
| 0non-cybersec
| Stackexchange | 427 | 1,246 |
If $X$ is an affine variety, is $X$ one component of a complete intersection with two?. <p>This is an idle question, but I give the example that motivated me below.</p>
<p>Say $X \subseteq {\mathbb A}^n_k$ is irreducible and $k$ is infinite. Then by picking a regular point of $X$ and picking equations from $X$'s ideal that cut out $T_x X$, we get a scheme containing $X$ as a component.</p>
<blockquote>
<p>If we pick those equations generically, can we ensure that that scheme is a complete intersection with at most one extra component beyond $X$?</p>
</blockquote>
<p>The example that got me wondering this is where $X = ${$(A,B) : AB = BA$} is the space of pairs of commuting matrices. Then one case of the above construction is $Y = ${$(A,B) : AB-BA$ is diagonal}, which is a reduced complete intersection with two components. I thought this was interesting but now I'm guessing it's the expected behavior.</p>
| 0non-cybersec
| Stackexchange | 254 | 923 |
C++ return value without return statement. <p>When I ran this program:</p>
<pre><code>#include <iostream>
int sqr(int&);
int main()
{
int a=5;
std::cout<<"Square of (5) is: "<< sqr(a) <<std::endl;
std::cout<<"After pass, (a) is: "<< a <<std::endl;
return 0;
}
int sqr(int &x)
{
x= x*x;
}
</code></pre>
<p>I got the following output:</p>
<pre><code>Square of (5) is: 2280716
After pass, (a) is: 25
</code></pre>
<p>What is <code>2280716</code>? And, how can I get a value returned to <code>sqr(a)</code> while there is no <code>return</code> statement in the function <code>int sqr(int &x)</code>?</p>
<p>Thanks.</p>
| 0non-cybersec
| Stackexchange | 300 | 698 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
GCC 4.8 with GNU STL produces bad code for std::string constructor?. <p>So a bit of C++ code:</p>
<pre><code>void func( const std::string& theString )
{
std::string theString( theString );
theString += " more string";
std::cout << theString;
}
</code></pre>
<p>which compiles fine with <code>GCC 4.8</code> and <code>VS 2013</code>. From my C++ knowledge, the code is okay with a local variable <code>theString</code> being brought into scope which then hides <code>theString</code> from the function argument. At the point of <code>theString</code> construction, the only <code>theString</code> in scope is the function argument which is passed to the <code>std::string</code> constructor. The constructed <code>std::string</code> is then named <code>theString</code> which comes into scope and is <code>theString</code> used later in the code. Phew!</p>
<p>However, <code>GCC</code> seems to act like <code>theString</code> passed to the <code>std::string</code> constructor is the local <code>theString</code> (which hasn't been constructed yet) causing the compiled program to crash. With VS 2013 the code compiles and runs fine.</p>
<p>So,</p>
<ol>
<li>Is my code correct? Or am I doing something outside spec which means the GCC behaviour is undefined.</li>
<li>Is this a bug in GCC?</li>
</ol>
| 0non-cybersec
| Stackexchange | 398 | 1,328 |
How can I format my Google calendar like the "Days of the Year" calendar?. <p>Is there any way to format my calendar entries like the "Days of the Year" calendar does? (Shown here, the "40" in the top corner.)</p>
<p><img src="https://i.stack.imgur.com/GhY9p.png" alt="enter image description here"></p>
<p>I am adding events to the calendar using the Calendar API using <code>myCalendar.createAllDayEvent('Title', myDate)</code>.</p>
<p>I can't find any information in the API documentation that seems to relate to this.</p>
| 0non-cybersec
| Stackexchange | 160 | 539 |
A silly question about $C_0$. <p>Let $X = \mathbb{R}^n$ and let $Z$ be a closed subspace of $X$. The inclusion map $i: Z \hookrightarrow X$ induces a map $C_0(X) \to C_0(Z)$ (via pullback). My question is simple: what is the kernel? The answer should either be $C_0(X - Z)$ or $C(X - Z)$ and I think I know which one is correct. But I need a sanity check, so I thought I would post the question here.</p>
| 0non-cybersec
| Stackexchange | 138 | 409 |
Post-Match Thread: FC Barcelona 2 - 2 Celta Vigo [La Liga]. [Aspas min 20](https://imgtc.com/uploads/dgfnmr0lDTB.mp4)
[Messi min 22](https://imgtc.com/uploads/PTd4anOsxP2.mp4)
[Suarez min 62](https://imgtc.com/uploads/Rg8XgTeuJ6v.mp4)
[Gomez min 70](https://imgtc.com/uploads/C40Tobioa0W.mp4) | 0non-cybersec
| Reddit | 140 | 295 |
Fedora 32 / dir has 73.4 gb but my disk it 1TB my home has ~700 gb. <p>my fedora system is attached to a 1TB disk but the / only has 73.4 gb and my home directory has ~700 gb why?
df -h</p>
<pre><code> Filesystem Size Used Avail Use% Mounted on
devtmpfs 5.8G 0 5.8G 0% /dev
tmpfs 5.8G 149M 5.7G 3% /dev/shm
tmpfs 5.8G 2.3M 5.8G 1% /run
/dev/mapper/fedora_localhost--live-root 69G 66G 0 100% /
tmpfs 5.8G 24K 5.8G 1% /tmp
/dev/loop5 128K 128K 0 100% /var/lib/snapd/snap/hello-world/29
/dev/loop4 63M 63M 0 100% /var/lib/snapd/snap/gtk-common-themes/1506
/dev/sda1 976M 315M 595M 35% /boot
/dev/loop3 162M 162M 0 100% /var/lib/snapd/snap/gnome-3-28-1804/128
/dev/loop2 98M 98M 0 100% /var/lib/snapd/snap/core/9289
/dev/loop0 58M 58M 0 100% /var/lib/snapd/snap/discord/109
/dev/loop1 55M 55M 0 100% /var/lib/snapd/snap/core18/1754
/dev/mapper/fedora_localhost--live-home 841G 109G 689G 14% /home
tmpfs 1.2G 16K 1.2G 1% /run/user/42
tmpfs 1.2G 196K 1.2G 1% /run/user/1000
/dev/sdb1 1.7T 125G 1.5T 8% /run/media/juliefilm/Dev_Large
/dev/sdb2 221G 18G 203G 9% /run/media/juliefilm/Dev_Small
</code></pre>
<p>mount</p>
<pre><code>sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=6036936k,nr_inodes=1509234,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/fedora_localhost--live-root on / type ext4 (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=17257)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/var/lib/snapd/snaps/hello-world_29.snap on /var/lib/snapd/snap/hello-world/29 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/gtk-common-themes_1506.snap on /var/lib/snapd/snap/gtk-common-themes/1506 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/sda1 on /boot type ext4 (rw,relatime)
/var/lib/snapd/snaps/gnome-3-28-1804_128.snap on /var/lib/snapd/snap/gnome-3-28-1804/128 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_9289.snap on /var/lib/snapd/snap/core/9289 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/discord_109.snap on /var/lib/snapd/snap/discord/109 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_1754.snap on /var/lib/snapd/snap/core18/1754 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/mapper/fedora_localhost--live-home on /home type ext4 (rw,relatime)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/42 type tmpfs (rw,nosuid,nodev,relatime,size=1212744k,mode=700,uid=42,gid=42)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1212744k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdb1 on /run/media/juliefilm/Dev_Large type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb2 on /run/media/juliefilm/Dev_Small type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
[juliefilm@localhost /]$ df -h
df: /run/user/1000/doc: Operation not permitted
Filesystem Size Used Avail Use% Mounted on
devtmpfs 5.8G 0 5.8G 0% /dev
tmpfs 5.8G 149M 5.7G 3% /dev/shm
tmpfs 5.8G 2.3M 5.8G 1% /run
/dev/mapper/fedora_localhost--live-root 69G 66G 0 100% /
tmpfs 5.8G 24K 5.8G 1% /tmp
/dev/loop5 128K 128K 0 100% /var/lib/snapd/snap/hello-world/29
/dev/loop4 63M 63M 0 100% /var/lib/snapd/snap/gtk-common-themes/1506
/dev/sda1 976M 315M 595M 35% /boot
/dev/loop3 162M 162M 0 100% /var/lib/snapd/snap/gnome-3-28-1804/128
/dev/loop2 98M 98M 0 100% /var/lib/snapd/snap/core/9289
/dev/loop0 58M 58M 0 100% /var/lib/snapd/snap/discord/109
/dev/loop1 55M 55M 0 100% /var/lib/snapd/snap/core18/1754
/dev/mapper/fedora_localhost--live-home 841G 109G 689G 14% /home
tmpfs 1.2G 16K 1.2G 1% /run/user/42
tmpfs 1.2G 196K 1.2G 1% /run/user/1000
/dev/sdb1 1.7T 125G 1.5T 8% /run/media/juliefilm/Dev_Large
/dev/sdb2 221G 18G 203G 9% /run/media/juliefilm/Dev_Small
[juliefilm@localhost /]$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=6036936k,nr_inodes=1509234,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/fedora_localhost--live-root on / type ext4 (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=17257)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/var/lib/snapd/snaps/hello-world_29.snap on /var/lib/snapd/snap/hello-world/29 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/gtk-common-themes_1506.snap on /var/lib/snapd/snap/gtk-common-themes/1506 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/sda1 on /boot type ext4 (rw,relatime)
/var/lib/snapd/snaps/gnome-3-28-1804_128.snap on /var/lib/snapd/snap/gnome-3-28-1804/128 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_9289.snap on /var/lib/snapd/snap/core/9289 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/discord_109.snap on /var/lib/snapd/snap/discord/109 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_1754.snap on /var/lib/snapd/snap/core18/1754 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/mapper/fedora_localhost--live-home on /home type ext4 (rw,relatime)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/42 type tmpfs (rw,nosuid,nodev,relatime,size=1212744k,mode=700,uid=42,gid=42)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1212744k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdb1 on /run/media/juliefilm/Dev_Large type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb2 on /run/media/juliefilm/Dev_Small type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
</code></pre>
<p>gparted <a href="https://i.stack.imgur.com/HR1RS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HR1RS.jpg" alt="my 1TB disk in gparted" /></a></p>
<p><strong>solved: /usr wasnt writable odd but ok WORNG (still need answers)</strong></p>
| 0non-cybersec
| Stackexchange | 3,925 | 9,725 |
How can i meet more women by myself? and how can i form more intimate relations? (Crosspost from r/socialskills). I am a 22 year old male, i am reasonably attractive, kinda athletic, of average height, and have no crazy opinions or personality traits (as far as i know). People tend to regard me as a pretty calm person. I have friends, both male and female. I feel like i am quite socially adept, though i am (and always have been) quite introverted, but i have no problem talking to people (regardless of my relationship with them). No religious upbringing. But during my teens (and even today) i never really liked drinking or partying. So somewhere along the way, i did not get the memo on how to hook up, and how to make intimate connections.
My problem is that i've never been in a relationship, nor have i been intimate with anyone, never been on a date or anything of that nature. This is something i keep to myself, but when asked, i tell the truth, which always seem to somewhat baffle people.
Its not something i let define me as a person, or something that affects my selfworth (not anymore, at least), but i view it as a personal problem (which gets bigger as i age). And i am so tired of being alone/lonely, and never having anything "going on".
Most of my friends are in relationships of their own, so whenever we go out its never with the intentions of "meeting people", which does not help my case. And just going out by my self seems like quite the crash and burn strategy, so how/where am i to meet women? People seem to get into this kind of things all the time, but i never do, and i don't know what to do about it. I've read a endless of threads suggesting that the most important/effective thing is to work on yourself and it will happen, but i seem to do nothing but. I do understand why i am single, but i honestly don't know how to solve the problem.
So fellow redditors, do you have any advice/insight on how i can fix this? I want to have sex, flings, and girlfriends, but i am at a loss on how to approach this problem. How can i meet more women by myself? and how can i live a more hedonistic life?
Edit: Sorry for the wall of text. For the lazy: just read second and last paragraph.
| 0non-cybersec
| Reddit | 531 | 2,219 |
Whose Line Is It Thursday: /r/electronicmusic - June 04, 2015. Welcome to **Whose Line Is It Thursday: /r/electronicmusic,** where everything's made up and the points don't matter.
Guidelines:
- Post a skit
- Keep skits in the form of a statement, not a question.
- Any skits longer than two lines should be in quotations.
- If you add any additional commentary, put the skit in quotations.
- If you don't understand the concept, a skit looks like this:
"Song titles that would change the message of the song completely if one letter was removed."
"The next fad to take over big room."
"Things more elusive than the identity of UZ."
Been having a lot of fun with this game over at /r/hiphopheads, /r/hockey, /r/baseball & /r/squaredcircle. Crack some jokes and enjoy yourselves rather than getting tied up trying to talk about music here.
| 0non-cybersec
| Reddit | 231 | 850 |
How to set up TightVNC Java viewer index.html on web server?. <p>I've got the Java TightVNC viewer applet set up with the provided index.html on my Mac OS X 10.6.3 with web sharing enabled.</p>
<p>Using a remote computer I was able to get to the webpage but I only see a white box with an X (for error?) that represents where the viewer is supposed to be. Any ideas on how to get this to work?</p>
<p>I've tried to set the port (in index.html) to 5900 and 5901, none worked. Are any of these the default VNC port for Mac OS X 10.6.3?</p>
<p>Also, I've activated Screen Sharing and Remote Login in System Preferences, allowing VNC viewers to connect.</p>
<p>Here is the code for my index.html:</p>
<pre><code><HTML>
<TITLE>
TightVNC desktop
</TITLE>
<APPLET CODE="classes/VncViewer.class" ARCHIVE="classes/VncViewer.jar"
WIDTH="1440" HEIGHT="900">
<PARAM NAME="PORT" VALUE="5900">
<PARAM NAME="Scaling factor" VALUE="50">
</APPLET>
<BR>
<A href="http://www.tightvnc.com/">TightVNC site</A>
</HTML>
</code></pre>
<p>Again I can get to this page, but the applet doesn't seem to work, the Java console also doesn't say anything.</p>
<p>Thanks in advance for your help!</p>
| 0non-cybersec
| Stackexchange | 442 | 1,250 |
Unable to get django declared app routes working as pages. <p>I am creating an Django app and am facing issues with routes not being identified. It is the same DJango poll app I am trying to create but the documentation code does not work. Here is my code below:</p>
<p><code>djangoproject/urls.py</code></p>
<pre><code>from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^simpleapp/', include('simpleapp.urls')),
url(r'^admin/', admin.site.urls),
]
</code></pre>
<p><code>simpleapp/views.py</code></p>
<pre><code>from django.shortcuts import render
from django.http import HttpResponse, request
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
def detail(request, question_id):
return HttpResponse("You're looking at question %s." % question_id)
def results(request, question_id):
response = "You're looking at the results of question %s."
return HttpResponse(response % question_id)
def vote(request, question_id):
return HttpResponse("You're voting on question %s." % question_id)
</code></pre>
<p><code>simpleapp/urls.py</code></p>
<pre><code>from django.conf.urls import url
from . import views
urlpatterns = [
# ex: /simpleapp/
# url('', views.index, name='index'),
# ex: /simpleapp/5/
url('<int:question_id>/', views.detail, name='detail'),
# ex: /simpleapp/5/results/
url('<int:question_id>/results/', views.results, name='results'),
# ex: /simpleapp/5/vote/
url('<int:question_id>/vote/', views.vote, name='vote'),
]
</code></pre>
<p>If I un-comment the first url of '' path of <code>simpleapp/urls.py</code> code, all the pages shown are '' path. However, if I keep the url '' path commented, then the routes give me the following error:</p>
<pre><code>Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/simpleapp/34/
Using the URLconf defined in simple_django.urls, Django tried these URL patterns, in this order:
^simpleapp/ <int:question_id>/ [name='detail']
^simpleapp/ <int:question_id>/results/ [name='results']
^simpleapp/ <int:question_id>/vote/ [name='vote']
^admin/
The current path, simpleapp/34/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
</code></pre>
<p>I was unable to get the <code>path()</code> imported using <code>django.conf.urls</code> or <code>django.urls</code>. <code>url()</code> was successful. I am using python version 3.6.7 and Django version 2.1.5. What am I missing?</p>
<p><a href="https://i.stack.imgur.com/PSL46.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PSL46.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/fDskW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fDskW.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/8Oy8F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Oy8F.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/GUi7j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GUi7j.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange | 1,117 | 3,339 |
issue with endnotes and macros. <p>I have the following issue with endnotes and macros. Here is the code:</p>
<pre class="lang-latex prettyprint-override"><code>\documentclass{article}
\usepackage{endnotes}
\begin{document}
\def\tmp{yellow}
yellow\endnote{\tmp}
\def\tmp{blue}
blue\endnote{\tmp}
\theendnotes
\end{document}
</code></pre>
<p>Output is:<a href="https://i.stack.imgur.com/oomN7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oomN7.png" alt="enter image description here"></a></p>
<p>In other words the second definition of /tmp kills the content of the first endnote. This is caused by the way endnotes handles macros and generates the .ent file:</p>
<pre class="lang-latex prettyprint-override"><code>\@doanenote {1}
macro:->\tmp
\@endanenote
\@doanenote {2}
macro:->\tmp
\@endanenote
</code></pre>
<p>Is there a way around it? I have a fairly complex tex application where endnote content is assembled at runtime from a database (using package datatool) and I can't avoid the use of macros. Content is however fairly simple and made of simple text, nothing fancy. I'd like to pass to \endnote{} this simple text and not the macro used to generate it, but I'm at a loss. Sorry if the answer is kinda trivial.</p>
| 0non-cybersec
| Stackexchange | 400 | 1,269 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Convergence of Fourier integral. <p>I have noticed that the Fourier integral $\int_{-\infty}^\infty \mathscr{F}f(\omega) e^{i\omega t} d\omega $ of $f(t) = \mu(t) e^{-t}$, where $\mathscr{F}f(\omega) = \frac{1}{2\pi} \int_{-\infty}^\infty f(t) e^{-i\omega t} dt$ and $\mu(t)$ is the step function diverges at $t = 0$. Is there a beautiful notation using the Riemann-integral that fixes the problem? Here I mean the improper Riemann-integral of the first kind. I have considered the operator pair
\begin{eqnarray}
\mathscr{F}f(\omega) & = & \frac{1}{2\pi} \int_0^\infty (f(t) e^{-i\omega t} + f(-t) e^{i\omega t}) dt \\
\mathscr{F}'F(t) & = & \int_0^\infty (F(\omega) e^{i\omega t} + F(-\omega) e^{-i\omega t}) d\omega \ ,
\end{eqnarray}
that is defined for functions $f$ that satisfy i) $\mathscr{F}f$ exists everywhere, ii) $\mathscr{F}' \mathscr{F}f$ exists everywhere, iii) $\mathscr{F}' \mathscr{F} f = f$. The Cauchy principal value would be ideal, but I don't quite like the notation P.V. in front of the integral and it might allow functions to satisfy all conditions without being locally bounded. The limit form $\lim_{M \rightarrow \infty} \int_{-M}^M f(x) dx$ isn't good either because it isn't notationally optimal for applications. I mean that for example the formula $De^x = e^x$ is simple but $D \lim_{n \rightarrow \infty} \big(1+\frac{x}{n}\big)^n = \lim_{n \rightarrow \infty} \big(1+\frac{x}{n}\big)^n$ is a little more complicated. I would want to find good expressions for Fourier and inverse Fourier transform that exist everywhere for some important functions familiar from signal processing including $\chi_{[-1,1]}(x)$ and $\textrm{sinc}(x)$.</p>
| 0non-cybersec
| Stackexchange | 532 | 1,688 |
Who uses keywords (and how)?. <p>Almost all journals ask for keywords and most authors comply.</p>
<p>Does any math researcher out there actually use them to search? Are there mechanisms to do that?</p>
<p>I just wrote to someone that I assumed no one uses them because I never do. It then occurred to me that my assumption might be wrong.</p>
<p>Educate me.</p>
<p>(BTW, the MO auto-criticism mechanism is giving me this message: "That's not a very good title. Can you add some more unique words to it?" The implicit self references in the situation make it too difficult for me to even try.)</p>
<p>(Second BTW, this question either has never been asked here, or it was deemed worthy of being expunged.)</p>
| 0non-cybersec
| Stackexchange | 197 | 718 |
Convert a list of objects to an array of one of the object's properties. <p>Say I have the following class:</p>
<pre><code>public class ConfigItemType
{
public string Name { get; set; }
public double SomeOtherThing { get; set; }
}
</code></pre>
<p>and then I make a list of the following classes (<code>List<ConfigItemType> MyList</code>)</p>
<p>Now I have a method with the following signature:</p>
<pre><code>void AggregateValues(string someUnrelatedValue, params string[] listGoesHere)
</code></pre>
<p>How can I fit <code>MyList</code> in to the <code>listGoesHere</code> using the value in <code>ConfigItemType.Name</code> as the params string array?</p>
<p>I am fairly sure that Linq can do this.... but <code>MyList</code> does not have a <code>select</code> method on it (which is what I would have used).</p>
| 0non-cybersec
| Stackexchange | 272 | 842 |
Deterministic RSA blinding. <p>I have an implementation of the RSA private key operation in a context where I don't have access to an entropy source. I'd like to add blinding to it (both message and exponent), to make it resist some side channel attacks.</p>
<p>(The subsequent padding operation does have access to an entropy source. It's only the exponentiation operation that can't use an RNG.)</p>
<p>I can run a PRNG inside the RSA private operation if I want. My constraint is that <code>rsa_private</code> has to be deterministic: its operation can only depend on its inputs (message and private key).</p>
<p>Is it sensible to do blinding deterministically, i.e. use a PRNG that is seeded by the message and the key? And if so should it be seeded by message+key or key alone? Or does the blinding need to be unpredictable?</p>
<p>I'm interested in the answer for both CRT and straight $m^d$ implementations.</p>
| 1cybersec
| Stackexchange | 236 | 923 |
On the evaluation of $\int_0^\infty e^{-x^2} \sin \left (\frac{1}{4x^2} \right ) \, dx$. <p>When attempting to find an alternative solution to this question <a href="https://math.stackexchange.com/questions/2580285/is-it-possible-to-compute-int-infty-infty-x-sin-x-over-x41dx-withou">here</a>, which called for the evaluation of the integral
$$\int_0^\infty \frac{x \sin x}{1 + x^4} \, dx$$
using real methods, I ran up against the following improper integral
$$\int_0^\infty e^{-x^2} \sin \left (\frac{1}{4 x^2} \right ) \, dx. \tag1$$
A value for this improper integral can be found. It is
$$\frac{\sqrt{\pi}}{2} \exp \left (-\frac{1}{\sqrt{2}} \right ) \sin \left (\frac{1}{\sqrt{2}} \right ),$$
and is what I am having trouble in finding.</p>
<p>I have tried a number of the various tricks one typically employs when attempting to find such integrals such as Feynman trick of differentiating under the integral sign, series solution, and so on, all to no avail (perhaps I missed something here).</p>
<p>One method that looked promising was to use <a href="https://en.wikipedia.org/wiki/Laplace_transform#Evaluating_integrals_over_the_positive_real_axis" rel="noreferrer">properties for the (inverse) Laplace transform</a>, namely
$$\int_0^\infty f(x) g(x) \, dx = \int_0^\infty (\mathcal{L} f)(s) \cdot (\mathcal{L}^{-1} g)(s) \, ds.$$</p>
<p>After enforcing a change of variable $x \mapsto \dfrac{1}{2 \sqrt{x}}$ we have
\begin{align*}
\int_0^\infty e^{-x^2} \sin \left (\frac{1}{4 x^2} \right ) \, dx &= \frac{1}{4} \int_0^\infty \frac{e^{-1/(4x)}}{x^{3/2}} \cdot \sin x \, dx\\
&= \int_0^\infty \mathcal{L} \{\sin x\} \cdot \mathcal{L}^{-1} \left \{\frac{e^{-1/(4x)}}{x^{3/2}} \right \} \, ds\\
&= \frac{1}{4} \int_0^\infty \frac{1}{s^2 + 1} \cdot \frac{2 \sin (\sqrt{s})}{\sqrt{\pi}} \, ds\\
&= \frac{1}{\sqrt{\pi}} \int_0^\infty \frac{s \sin s}{1 + s^4} \, ds, \tag2
\end{align*}
where in the last line a substitution of $s \mapsto s^2$ has been made.</p>
<p>While this is a perfectly valid approach the only problem is the integral one ends up with in (2) is exactly the integral one started out with.</p>
<p>So my question is</p>
<blockquote>
<p>Is it possible to evaluate the integral given in (1) using real methods that does not depend on evaluating the integral given in (2)?</p>
</blockquote>
| 0non-cybersec
| Stackexchange | 810 | 2,333 |
Sub-Query or Join with embedded/nested document using C# LINQ with MongoDB. <p>I am trying to do something like bellow example but getting exception as -
System.ArgumentException: Expression of type 'System.Collections.Generic.IEnumerable<code>1 ' cannot be used for parameter of type 'System.Linq.IQueryable</code>1' of method.
Here is my code and related classes . how can i resolve this issue, is there any way except which a trying to do.</p>
<pre><code> var channels = _channelService.Collection;
var tracks = _trackService.Collection;
var query = from b in tracks.AsQueryable()
select b;
var data = (from q in channels.AsQueryable()
from p in q.Episodes
//from x in trackcoll.AsQueryable()
select new
{
p,
Tracks = query.Where(w => p.Tracks.Contains(w.Id))
}).ToList();
// Related classes
public class ContentBase : IAuditable
{
public string Id { get; set ; }
public string CreatedBy { get ; set ; }
public string CreatedOn { get ; set ; }
public string UpdatedBy { get ; set ; }
public string UpdatedOn { get; set; }
}
public class Channel: ContentBase
{
public List<Episode> Episodes { get; set; }
}
public class Episode: ContentBase
{
// List of track Id
public List<string> Tracks { get; set; }
}
public class Track: ContentBase
{
public string TrackUrl { get; set; }
public string Duration { get; set; }
public string Size { get; set; }
public string ContentType { get; set;
}
</code></pre>
| 0non-cybersec
| Stackexchange | 462 | 1,715 |
iOS Playground doesn't show UI preview. <p>I've created a simple playground with XCode 7.1 and I've typed this simple code:</p>
<pre><code>import UIKit
import XCPlayground
var str = "Hello, playground"
let color = UIColor (red: 1 , green: 1 , blue: 0 , alpha: 0 )
let view = UIView()
view.backgroundColor = UIColo (colorLiteralRed: 1 , green: 0 , blue: 0 , alpha: 0 )
view.frame = CGRect (x: 0 ,y: 0 ,width: 100 ,height: 100 )
let label = UILabel (frame: CGRect (x: 5 , y: 5 , width: 50 , height: 20 ))
label.text = str
view.addSubview(label)
</code></pre>
<p>When the playground runs, it doesn't show UIKit object preview, but only debug information:</p>
<p><a href="https://i.stack.imgur.com/1EHL7.png"><img src="https://i.stack.imgur.com/1EHL7.png" alt="playground"></a></p>
<p>What am I doing wrong?</p>
| 0non-cybersec
| Stackexchange | 302 | 833 |
How to access local site from other computer on windows PC. <p>On my linux pc i access webisite by going <a href="http://site1.local" rel="nofollow noreferrer">http://site1.local</a></p>
<p>I have setup virtual host in httpd.conf</p>
<p>I want that when i should be able to access that address from windows PC.</p>
<p>In the windows hosts file i have written</p>
<pre><code>192.168.1.81 site1.local
</code></pre>
<p>But still i can't access the page.</p>
<p>i can ping that adress but not get the webpage to work</p>
| 0non-cybersec
| Stackexchange | 179 | 524 |
A tangent, a few doubts. <p>I have a question: A tangent, I am told is a line through a specified point (a, f(a)) which touches no other point in atleast one neighbourhood of 'a'. How do I prove from here that a tangent is also a line of best approximation of the function in that neighbourhood? Thanking all in anticipation :) Edit: Another question that comes to my mind is: Why can't there be more than one such lines which suffice to be the "best approximation" of the unique function ?
i got this question while reading arturo's pleasant <a href="https://math.stackexchange.com/a/12290/46124">answer</a>.</p>
| 0non-cybersec
| Stackexchange | 158 | 614 |
Proof a quantified predicate logic statement. <p>I am having trouble really understanding how to prove this </p>
<p>$$(S(y) \to T(y)) \land S(x) \to (∃x)T(x).$$</p>
<p>My solution so far is:</p>
<ol>
<li><p>$S(y) \to T(y)$ --- Hypothesis</p></li>
<li><p>$S(x)$ --- Hypothesis</p></li>
<li><p>$T(y)$ --- Modus Ponens of 1 and 2</p></li>
<li><p>$(∃x)T(x)$ --- Existential Generalization of 3</p></li>
</ol>
<p>It seems incorrect to me due to the usage of x and y. Can anyone help with this?</p>
| 0non-cybersec
| Stackexchange | 212 | 503 |
ASA 5505 blocks users. <p>I have recently installed an ASA 5505. But now i have users that are being blocked/kicked from the internet. </p>
<p>What can i do to prevent this?</p>
<p>Here is the running config:</p>
<p>Result of the command: "sh run"</p>
<pre><code>: Saved
:ASA Version 9.0(1)
!
hostname ciscoasa
enable password ------------- encrypted
passwd ------------ encrypted
names
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.1.1 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address xxx.xxx.xxx.xxx 255.255.255.248
!
ftp mode passive
object network obj_any
subnet 0.0.0.0 0.0.0.0
pager lines 24
logging enable
logging asdm informational
mtu inside 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
no arp permit-nonconnected
!
object network obj_any
nat (inside,outside) dynamic interface
route outside 0.0.0.0 0.0.0.0 xxx.xxx.xxx.xxx 1
timeout xlate 3:00:00
timeout pat-xlate 0:00:30
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
http server enable
http 192.168.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
crypto ipsec security-association pmtu-aging infinite
crypto ca trustpool policy
telnet timeout 5
ssh timeout 5
console timeout 0
dhcpd dns xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
dhcpd auto_config outside
!
dhcpd address 192.168.1.5-192.168.1.30 inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics host
threat-detection statistics port
threat-detection statistics protocol
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
inspect ip-options
!
service-policy global_policy global
prompt hostname context
no call-home reporting anonymous
Cryptochecksum:dac8da9f3df0438bed0b9b1b714a1e67
: end
</code></pre>
| 0non-cybersec
| Stackexchange | 1,002 | 3,015 |
$\sum_{p|q_n} (\log p)^\alpha\sim n(\log n)^\alpha, n\to\infty $, where $q_n:=\prod_{j\leq n}p_j$. <p>Let $\alpha \in (0,1)$ and let $p_j$ be the sequence of primes and let $q_n:=\prod_{j\leq n}p_j$. Prove that
$$
\sum_{p|q_n} (\log p)^\alpha
\sim n(\log n)^\alpha
\qquad n\to\infty
$$</p>
<p>I am stuck here. Most what I proved is that $\sum_{p|q} (\log p)^\alpha \leq (\omega(q))^{1-\alpha} (\log q)^\alpha$, and then $\omega(q_n) = n$, but I am not sure if I can use this somehow ($\omega(n) = $ no. of distinct prime divisors of n). Any help?</p>
| 0non-cybersec
| Stackexchange | 230 | 571 |
What is your current mentality on life? What do you believe is a good mentality to have?. I've been putting a lot of thought on my mindset and how I should operate on a day to day basis. I'm 22 and have trouble with motivation, anxiety, and depression but it is something I have slowly been working on. However in the mornings and at night before I go to bed my mindset is awful which doesn't help my sleep at all, essentially I don't look forward to the day ahead. How do you get the energy to not have that mindset and take care of task that come to you. Sometimes I feel like I've done "enough" for the day, like after a day of work I don't want to go workout or do this extra task but it would benefit me.
Curious of what your mentality is? Would like to learn from others and start working even harder on fixing my perception.
| 0non-cybersec
| Reddit | 190 | 835 |
What are the integer coeffcients of a cubic polynomial having two particular properties?. <p>Let <span class="math-container">$f(x) = x^3 + a x^2 + b x + c$</span> and <span class="math-container">$g(x) = x^3 + b x^2 + c x + a\,$</span> where <span class="math-container">$a, b, c$</span> are integers and <span class="math-container">$c\neq 0\,$</span>. Suppose that the following conditions hold:</p>
<ol>
<li><span class="math-container">$f(1)=0$</span> </li>
<li>The roots of <span class="math-container">$g(x)$</span> are squares of the roots of <span class="math-container">$f(x)$</span>.</li>
</ol>
<p>I'd like to find <span class="math-container">$a, b$</span> and <span class="math-container">$c$</span>.</p>
<p>I tried solving equations made using condition 1. and relation between the roots, but couldn't solve.
The equation which I got in <span class="math-container">$c$</span> is <span class="math-container">$c^4 + c^2 +3 c-1=0$</span> (edit: eqn is wrong).
Also I was able to express <span class="math-container">$a$</span> and <span class="math-container">$b$</span> in terms of <span class="math-container">$c$</span>. But the equation isn't solvable by hand. </p>
| 0non-cybersec
| Stackexchange | 411 | 1,189 |
How do I uninstall Internet Explorer 9 so I can install Internet Explorer 6?. <p>I've tried uninstalling Internet Explorer 9 in Windows 7 from Control Panel, it always produces an error and fails.
From Command Prompt, it didn't do anything. The file can not be deleted. I can move it, and then delete it through Linux (dual-boot), on booting back into Windows, Internet Explorer 9 is there. </p>
<p>I want to install Internet Explorer 6 for my father for an exam he wants to take, but am unable to install it, because Internet Explorer 9 cannot be removed. I even tried to delete the relevant registry entries with regedit, but that doesn't help either. </p>
<p>Is there some way to accomplish this? If not, are there other solutions I should be considering?</p>
| 0non-cybersec
| Stackexchange | 191 | 771 |
Relative strength and propositional indistinguishability of non-distributive lattices. <p>Consider the class of bounded non-distributive lattices <span class="math-container">$\mathbf{Mn}$</span> (<span class="math-container">$n\geqslant 3$</span>).
<a href="https://i.stack.imgur.com/1W6QF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1W6QF.png" alt=""></a>
From left to right: <strong>M3</strong>, <strong>M4</strong>, <strong>Mn</strong></p>
<p>Now consider a propositional language over <span class="math-container">$\{\wedge,\vee,\neg\}$</span> with the following semantics: <span class="math-container">$\wedge$</span> and <span class="math-container">$\vee$</span> correspond to the meet and join of a lattice while <span class="math-container">$\neg$</span> works as follows: <span class="math-container">$\neg\top=\bot$</span>, <span class="math-container">$\neg\bot=\top$</span>, <span class="math-container">$\neg\mathbf{k}=\mathbf{k}$</span> (<span class="math-container">$\mathbf{k}\leqslant\mathbf{n}$</span>). A valuation <span class="math-container">$v$</span> maps propositional variables to the underlying set of some fixed lattice.</p>
<p>For formulas <span class="math-container">$\phi$</span> and <span class="math-container">$\chi$</span> in our language say that <span class="math-container">$\phi\vDash_{\mathbf{Mn}}\chi$</span> iff <span class="math-container">$$\forall v:v(\phi)\leqslant_{\mathbf{Mn}}v(\phi)$$</span></p>
<p>Now we call two lattices <span class="math-container">$\mathfrak{L}$</span> and <span class="math-container">$\mathfrak{L}'$</span> <em>propositionally indistinguishable</em> iff for any two formulas over <span class="math-container">$\{\wedge,\vee,\neg\}$</span> <span class="math-container">$\phi$</span> and <span class="math-container">$\chi$</span> <span class="math-container">$$\phi\vDash_{\mathfrak{L}}\chi\Leftrightarrow\phi\vDash_{\mathfrak{L}'}\chi$$</span></p>
<p>We say that <span class="math-container">$\mathfrak{L}$</span> is <em>stronger</em> that <span class="math-container">$\mathfrak{L}'$</span> iff for any <span class="math-container">$\phi$</span> and <span class="math-container">$\chi$</span> <span class="math-container">$$\phi\nvDash_{\mathfrak{L}'}\chi\Rightarrow\phi\nvDash_{\mathfrak{L}}\chi$$</span></p>
<p>The question is, thus, as follows.</p>
<p><strong>Is it true that all <span class="math-container">$\mathbf{Mn}$</span> lattices are indistinguishable? If yes, how can we prove it (or where it has been proved)?</strong></p>
| 0non-cybersec
| Stackexchange | 800 | 2,543 |
I Want To Create Programming Videos (Tutorials) For My Fellow Redditors!. Dear r/learnprogramming,
I love to teach and would be happy to create programming tutorials for my fellow programmers at r/learnprogramming on topics that you want to learn more about, focusing on general programming knowledge and machine learning.
Hope that I can help some of you to become better programmers!
- Post your request in the comments section.
- Topics will be chosen out of comment upvotes.
- I will publish the video in r/learnprogramming and ping you when it’s uploaded.
Happy coding :) <3
**EDIT:**
Video length will vary per tutorial, everything from 5 minutes to 1.5 hours. I'm very open to suggestions!
**EDIT 2:**
Got asked to put these on a YouTube. I do already have an existing YouTube channel on machine learning / programming, and the videos will be uploaded there. You can find it here: https://www.youtube.com/channel/UCskG7xk7hK7n8wSZsblz2vQ
I will also, as earlier mentioned, upload any tutorial requested here on r/learnprogramming as well, linking to that video and mentioning the person who requested it.
**EDIT 3:**
Wow! Happy to see so many people interested. FYI, I've also set up a community on Slack a while ago about programming/AI/blockchain, and there are some people in there that are learning programming (#programming) right now, that you could engage with to learn from each other. I go there quite often to answer people's questions in person as well. See the following invite link.
Slack Community: https://join.slack.com/t/oscaralsingcommunity/shared_invite/enQtMjkwNjc5NDY4NTYxLWQxNWE5MWRiNjY2MDU2YjVhZjU3NDk2ZmU0ZDI4YzM2ZTllMjQ3OWMyNTI3OTQ1YThmYTNjMDQwNGMzZWFkOGY
**Thanks for all the great requests so far! Super keen to start doing the tutorials :)** | 0non-cybersec
| Reddit | 498 | 1,789 |
Dreamweaver not recognizing symbolic link as directory. <p>I have this directory</p>
<pre><code>drwxrwxr-x 6 awdfiles pasgroup 4096 Jan 31 17:20 awdfiles
</code></pre>
<p>Which I want to access via another FTP connection. The user is part of the <code>pasgroup</code></p>
<p>I traverse to the root html directory of my desired user and create the symlink</p>
<pre><code>$ cd rayhawkpas/dev
$ ln -s ../../awdfiles awdfiles
lrwxrwxrwx 1 rayhawkpas rayhawkpas 14 Feb 6 13:06 awdfiles -> ../../awdfiles
</code></pre>
<p>However, when I try to download the directory in dreamweaver it looks like this</p>
<p><img src="https://i.stack.imgur.com/vkYio.png" alt="enter image description here"></p>
<p>It seems to not recognize that it's a directory.</p>
<p>I tried symlinking to a specific file to make sure my permissions were right</p>
<pre><code>ln -s ../../awdfiles/themes/1/includes/header.php test.php
</code></pre>
<p>This worked fine. It showed up in dreamweaver and I was able to download and upload the file.</p>
| 0non-cybersec
| Stackexchange | 351 | 1,064 |
Strong mixing property for endomorphisms of a finite set. <p>Let's consider $X = \{1, 2, \ldots, n \}$. I would like to establish, how many of the maps $f: X \to X$ have the following strong mixing property:</p>
<blockquote>
<p>For a given triple $(X, \mathcal{B}, \mu)$, $T: X \to X$ is strong mixing, if it preserves measure and the shares the following property $\mu(T^{-n}(A) \cap B) \rightarrow \mu(A) \mu(B)$, as $n \to \infty$</p>
</blockquote>
<p>Then, after several attempts i've found it quite challenging to find a general approach to the problem that might work. (after considering some cases in particular)</p>
<p>Are there any hints that might help?</p>
| 0non-cybersec
| Stackexchange | 205 | 673 |
Reference request: A collection of topologies on $\mathbb{N}$ formed via series. <p>First, some quick notation: for any series $\sum_{n=1}^\infty a_n$ whose terms are positive real numbers, and for any subset $M = \{m_1, m_2,...\} \subseteq \mathbb{N}$, we write $\sum_M a_n$ to mean $a_{m_1} + a_{m_2} + ....$.</p>
<p>Then, for each series, one can associate a topology on $\mathbb{N}$ by declaring a proper subset $M\subsetneq \mathbb{N}$ to be closed iff $\sum_M a_n < \infty$.
So, e.g., in the $\sum \frac{1}{n}$-topology, the set of even numbers is neither open nor closed (both $\sum \frac{1}{2n+1}$ and $\sum \frac{1}{2n}$ diverge), but the set of squares is closed ($\sum \frac{1}{n^2}$ converges).</p>
<p>There is, of course, an interplay between the topological properties $\mathbb{N}$ inherits and the analytic properties of $\sum a_n$. For instance, $\mathbb{N}$ gets the cofinite topology iff $\liminf a_n > 0$.</p>
<p>Much less trivially, <a href="https://math.stackexchange.com/questions/2429389/is-there-a-bijection-of-the-natural-numbers-which-swaps-frac1n-summable-s">one can show</a> that this association generates precisely $|\mathbb{R}|$ many topologies on $\mathbb{N}$ (distinct up to homeomorphism). In fact, for $0\leq p < q \leq 1$, the spaces obtained from $\sum \frac{1}{x^p}$ and $\sum \frac{1}{x^q}$ are not homeomorphic.</p>
<p>I am not a general topologist by training so my question is probably very simple.
Has anything like this appeared in the literature before? MathSciNet doesn't seem to turn up anything, but maybe there is some terminology I need to know. Maybe these form a subclass in some well studied class of topological spaces?</p>
<p>In case it helps, here are some curious data points about these topological spaces.</p>
<ol>
<li>They are homogeneous. More generally, the homeomorphism group acts transitively on the set of $k$-element subsets for any fixed $k$.</li>
<li>Every subset is closed or dense. (This is equivalent to the topology being downward-closed: every subset of a proper closed set is closed.)</li>
<li>If $\lim_{n\rightarrow \infty} a_n = 0$ but $\sum a_n$ diverges, then any non-empty open set is homeomorphic to $\mathbb{N}$. </li>
</ol>
| 0non-cybersec
| Stackexchange | 689 | 2,233 |
Share a Wi-Fi connection. <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://superuser.com/questions/446186/share-a-wi-fi-connection">Share a Wi-Fi connection</a> </p>
</blockquote>
<p>I have a wifi connection [wifi000] and I want to share it. When I use adhoc connection to do this, I have to disconnect from my wifi000. So how can I share my current wifi connection providing another wifi connection or using a cable? I'm using windows7.</p>
<p>Thank you!</p>
| 0non-cybersec
| Stackexchange | 154 | 494 |
Having a homogenous system of linear equations with real coefficients with a non-trivial complex solution than there is a real solution too.. <p>I'm struggeling a bit with this proof.</p>
<blockquote>
<p>Suppose we have a homogenous system of linear equations with real coefficients with a non-trivial complex solution than there is a real solution too. </p>
</blockquote>
<p>This looks really simple and my first thought was...</p>
<p>In our course we proved that, if <span class="math-container">$\alpha,\beta \in L(A,0) \implies \alpha + \beta \in L(A,0)$</span>. </p>
<p>So let <span class="math-container">$z_1 = a+ib, z_2 = \bar{z_1} = a-ib$</span> both <span class="math-container">$\in L(A,0)$</span>.</p>
<p>Than the sum of them <span class="math-container">$z_1+z_2 = a+ib + a-ib = 2a \in L(A,0)$</span>. Since <span class="math-container">$a\in\mathbb{R}$</span> there is a real solution too. </p>
<p>Additionally i figured out, that the complex conjugation is a field homorphism. </p>
<p>My questions are:</p>
<ol>
<li>Can somebody show me an example for a homogenous system of linear equations with real coefficients with a non-trivial complex solution?</li>
<li>if my idea is correct, why can I assume that <span class="math-container">$\bar{z_1}$</span> is a solution too?</li>
<li>if my idea is not correct, where is my mistake?</li>
</ol>
<p>Many thanks in advance</p>
| 0non-cybersec
| Stackexchange | 456 | 1,397 |
F# check if a string contains only number. <p>I am trying to figure out a nice way to check if a string contains only number. This is the result of my effort but it seems really verbose:</p>
<pre><code>let isDigit c = Char.IsDigit c
let rec strContainsOnlyNumber (s:string)=
let charList = List.ofSeq s
match charList with
| x :: xs ->
if isDigit x then
strContainsOnlyNumber ( String.Concat (Array.ofList xs))
else
false
| [] -> true
</code></pre>
<p>for example it seems really ugly that I have to convert a string to char list and then back to a string.
Can you figure out a better solution?</p>
| 0non-cybersec
| Stackexchange | 195 | 690 |
jQuery not define in bootstrap module. <p>I want to use bootstrap for my website (with node.js). But I have the following error :</p>
<blockquote>
<p>/var/www/node_modules/bootstrap/js/transition.js:59
}(jQuery);
^
ReferenceError: jQuery is not defined
at Object. (/var/www/node_modules/bootstrap/js/transition.js:59:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/var/www/node_modules/bootstrap/dist/js/npm.js:2:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)</p>
</blockquote>
<p>I tried to do a</p>
<pre><code>var bootstrap = require('bootstrap');
</code></pre>
<p>in my main node.</p>
<p>I installed bootstrap with npm (<code>npm install bootstrap</code> from my folder). I also tried to instal jquery with the same way and to add a <code>var jQuery= require('jquery');</code> but it does not work. Do you have any idea what could be wrong ? I am starting node.js, i may miss something</p>
<p>Then I use <code><link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"></code> in my HTML webpage to refer to bootstrap
`</p>
| 0non-cybersec
| Stackexchange | 451 | 1,382 |
is pfSense suited for my setup?. <p>I have a fairly large home network that consists of:</p>
<ul>
<li>2 wired PCs,</li>
<li>3 Smartphones,</li>
<li>1 Tablet,</li>
<li>2 wireless PCs</li>
<li>2 wired gaming consoles</li>
<li>2 wireless gaming consoles</li>
</ul>
<p>The problem is that I think that my router has problems handling all the traffic that this generates, since it crashes (reboots, no more WAN, etc.) every once in a while. I have an old machine here, a couple NICs, and a switch. Would it make sense to get that box to run pfSense and distribute traffic across different NICs (1 to switch for wired, 1 to router (as AP) for wireless)?</p>
| 0non-cybersec
| Stackexchange | 205 | 654 |
Does Signal Application use Eliptic Curve cryptography for encryption as well?. <p>I am studying how Signal application works and as I was reading the <a href="https://www.signal.org/docs/specifications/xeddsa/" rel="nofollow noreferrer">documentation</a> on how is applied the XEdDSA and VXEdDSA Signature Schemes.</p>
<p>But I kept wondering: if Signal uses elliptic curve for signing a message (as far as I understood), then how does it apply cryptography for encrypting the actual voice and instant messages. Does it use an eliptic curve cryptography scheme with a different key besides the other one?</p>
| 0non-cybersec
| Stackexchange | 158 | 611 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Integral $ \int_{-\infty}^{+\infty} \frac{ \sin^2(\sqrt{(x-a)^2 + b^2}\,\,t)}{(x-a)^2 + b^2} dx$. <p>I am trying to solve the following definite integral:</p>
<p><span class="math-container">$$ \int_{-\infty}^{+\infty} \frac{ \sin^2(\sqrt{(x-a)^2 + b^2}\,\,t)}{(x-a)^2 + b^2} dx$$</span>
with <span class="math-container">$a$</span> and <span class="math-container">$b$</span> being real constants. Notice that the integrand is non-negative for all x , with a peak around <span class="math-container">$x=a$</span> for small values of <span class="math-container">$b/a$</span>. So the integration does give a finite value. </p>
<p>To go about this, I tried substituting <span class="math-container">$(x-a)^2 + b^2 = y^2$</span></p>
<p>This gives me <span class="math-container">$dx \,(x - a) = y \, dy$</span> whence:</p>
<p><span class="math-container">$$ \int_{?}^{+\infty} \frac{ \sin^2(|y|\,\,t)}{y} \frac{1}{\sqrt{y^2 - b^2}} dy$$</span></p>
<p>While the upper limit of y transforms to <span class="math-container">$+\infty$</span>, clearly the lower limit is not <span class="math-container">$-\infty$</span> (even if it is <span class="math-container">$-\infty$</span> the integrand is odd so it evaluates to zero which cannot be true).</p>
<p>This suggests its a case of bad substitution. The only better alternative I can think of is to substitute <span class="math-container">$x-a = y$</span>, this gives me:</p>
<p><span class="math-container">$$ \int_{-\infty}^{+\infty} \frac{ \sin^2(\sqrt{y^2 + b^2}\,\,t)}{y^2 + b^2} dy $$</span></p>
<p>Any thoughts on how I can get an expression for this integral ?</p>
<p>Thanks for your time!</p>
| 0non-cybersec
| Stackexchange | 593 | 1,662 |
Change entry file path of android and ios in react-native project. <p>After starting a new project with <strong>react-native init awesomeProject</strong>, i try to restructure my project, putting <strong>index.ios.js</strong> and <strong>index.android.ios</strong> inside a common folder named <strong>src</strong>.</p>
<p>When i execute <strong>react-native run-android</strong>, i get the following error:</p>
<p><img src="https://i.stack.imgur.com/j5dKr.jpg" alt="Error on android device"></p>
<p>Where i have to change to react-native search for entry files in the right path?</p>
| 0non-cybersec
| Stackexchange | 175 | 588 |
A Study of Continuity of a given Function. <p>I am trying to figure out if the following function is in fact continuous:
given
$$f(x,y) = \left\{\begin{array}{cc} \frac{|y|-|x|}{y^2} & |x| < |y| \\
0 & |x| \geq |y| \end{array}\right.$$
I am studying the continuity of the function
$$g(y) = \int_{-1}^1 f(x,y) dx, y \in [-1,1].$$
$x$ and $y$ take on the domain $[-1,1].$ I am wondering what is the most
reasonable way to begin exploring the continuity of this function, since it
seems to me that the many absolute values that make up this particular function
makes the splitting of the integral rather hectic. Any recommendations on how
one goes about dealing with integrals of absolute value functions?</p>
| 0non-cybersec
| Stackexchange | 223 | 758 |
How to eat Fruity Pebbles and other similar cereal the right way so every bite stays crispy. Step 1: This step is optional but it helps with the process and that is to get really stoned.
Step 2: Pour the Fruity Pebbles into the middle your bowl until a little mountain forms. This should happen naturally and require little effort. DO NOT EVEN YOUR PEBBLES OUT! Keep it in mountain form
Step 3: Pour a small but steady river of cow juice slightly against the side of the bowl. Doing this will let the milk flow underneath your Pebbles without damaging the mountain structure of said Pebbles. DO NOT UNDER ANY CIRCUMSTANCE POUR THE MILK ALL OVER YOUR PEBBLES! That will ruin the whole experience and prove that you're not ready for a cereal like Fruity Pebbles and quite frankly can't be trusted.
Step 4: Now you're ready to eat. This step needs to happen very quickly because if not the Pebbles will get soggy and this will have all been for nothing. Take your spoon and eat from the bottom...NOT THE TOP. Doing this will allow you to get a cruncy bite of Pebbles and milk with every spoonful until your ration gets to such a low point that your Pebbles fall back into the sea of now flavored milk.
Step 5: Now it's time to drink the milk. IF YOU DON'T DRINK THE MILK, SORRY, BUT YOU ARE A SUB-HUMAN AND I CANT TRUST YOU. This step is pretty easy but nuanced. Put the bowl up to your mouth and start drinking it as a blue whale would eat plankton and such. Let the milk flow freely but use your teeth, like a whale using it's baleen, to filter the remaining Fruity Pebbles to the sides of your mouth for later consumption after the milk has gone down your gullet.
Step 6: This step is optional but important. As soon as you're done drinking your flavored milk wash the bowl off in the sink. Dried on Fruity Pebbles stuck to your bowl is nothing you wanna deal with when you start washing dishes. You'll spend too much time using a butter knife scraping that shit off the sides because who has time to let the dishes soak. | 0non-cybersec
| Reddit | 503 | 2,029 |
Accomplishing Ctrl-z + bg in one step?. <p>We can use Ctrl-z to stop the current job followed by</p>
<pre><code>bg
</code></pre>
<p>to send it to the background, but can we do this in one action that doesn't briefly pause the execution of the program?</p>
<p>Is there a combined </p>
<pre><code>Ctrl-z + bg
</code></pre>
<p>type command that we can use?</p>
| 0non-cybersec
| Stackexchange | 128 | 363 |
Symfony3: Construct FormType. <p>I have a form in Symfony3, which I initialize - following the docs - as followed:</p>
<pre><code>$form=$this->createForm(BookingType::class,$booking);
</code></pre>
<p>$booking is an already existing entity, which I want to modify - but I want to modify the form depending on the entity - like:</p>
<pre><code>public function buildForm(FormBuilderInterface $builder,$options) {
$builder->add('name');
if(!$this->booking->getLocation()) {
$builder->add('location');
}
}
</code></pre>
<p>Prior Symfony 2.8 it was possible to construct the FormType like:</p>
<pre><code>$form=$this->createForm(new BookingType($booking),$booking);
</code></pre>
<p>Which is exactly what I want :) But in Symfony3 this method throws an exception.
How can I pass an entity to my formtype?</p>
| 0non-cybersec
| Stackexchange | 274 | 848 |
What is "dist-upgrade" and why does it upgrade more than "upgrade"?. <p>I was wondering why <code>upgrade</code> sometimes doesn't want to upgrade certain parts of the system, while <code>dist-upgrade</code> does. Here's an example after running <code>apt-get upgrade</code>:</p>
<p><code>apt-get upgrade</code>:</p>
<pre><code>rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
</code></pre>
<p>versus <code>apt-get dist-upgrade</code>:</p>
<pre><code>rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.0.0-13 linux-headers-3.0.0-13-generic
linux-image-3.0.0-13-generic
The following packages will be upgraded:
linux-generic linux-headers-generic linux-image-generic
3 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 215 MB of additional disk space will be used.
Do you want to continue [Y/n]?
</code></pre>
<p>In other words, why can't this be performed by <code>upgrade</code>?</p>
| 0non-cybersec
| Stackexchange | 436 | 1,452 |
How to deal with Program Files (x86) as user input?. <p>I have written this little backup script that accepts user input for the source/destination for the files. It can deal just fine with spaces and <code>C:\Program Files\</code> but can't seem to be able to deal with <code>C:\Program Files (x86)\</code>.
This is the snippet of my code that I'm using to test and resolve my issue.</p>
<pre><code>@echo off
set sourcedef=%USERPROFILE%\Desktop\Source
set /P sourceinp= Location of the source [Default=%sourcedef%] :
if "%sourceinp%" == "" ( set source=%sourcedef% )
if not "%sourceinp%" == "" ( set source=%sourceinp% )
echo Source folder set as : %source%
pause
</code></pre>
<p>If i try to give it any Program Files (x86) directory, the cmd.exe just closes down shop. Any tips?</p>
| 0non-cybersec
| Stackexchange | 260 | 831 |
Asynchronous multiprocessing with a worker pool in Python: how to keep going after timeout?. <p>I would like to run a number of jobs using a pool of processes and apply a given timeout after which a job should be killed and replaced by another working on the next task. </p>
<p>I have tried to use the <code>multiprocessing</code> module which offers a method to run of pool of workers asynchronously (e.g. using <code>map_async</code>), but there I can only set a "global" timeout after which all processes would be killed. </p>
<p>Is it possible to have an individual timeout after which <strong>only a single process that takes too long is killed and a new worker is added</strong> to the pool again instead (<strong>processing the next task and skipping the one that timed out</strong>)?</p>
<p>Here's a simple example to illustrate my problem:</p>
<pre><code>def Check(n):
import time
if n % 2 == 0: # select some (arbitrary) subset of processes
print "%d timeout" % n
while 1:
# loop forever to simulate some process getting stuck
pass
print "%d done" % n
return 0
from multiprocessing import Pool
pool = Pool(processes=4)
result = pool.map_async(Check, range(10))
print result.get(timeout=1)
</code></pre>
<p>After the timeout all workers are killed and the program exits. I would like instead that it continues with the next subtask. Do I have to implement this behavior myself or are there existing solutions?</p>
<h2>Update</h2>
<p>It is possible to kill the hanging workers and they are automatically replaced. So I came up with this code:</p>
<pre><code>jobs = pool.map_async(Check, range(10))
while 1:
try:
print "Waiting for result"
result = jobs.get(timeout=1)
break # all clear
except multiprocessing.TimeoutError:
# kill all processes
for c in multiprocessing.active_children():
c.terminate()
print result
</code></pre>
<p>The problem now is that the loop never exits; even after all tasks have been processed, calling <code>get</code> yields a timeout exception. </p>
| 0non-cybersec
| Stackexchange | 574 | 2,059 |
NotificationListenerService not working - even after giving permission. <p>Below is my code to capture notifications. I dont understand why the <strong>onNotificationPosted</strong> is not getting fired.</p>
<p>I am giving my app Notifications access from Settings > Security and the <strong>onCreate</strong> from MyNotifService is also getting fired, but <strong>onNotificationPosted</strong> is not getting fired.</p>
<p>What am I missing or doing wrong?</p>
<p>From my <strong>MainActivity's onCreate()</strong> function:</p>
<pre><code>Intent intent = new Intent(this, MyNotifService.class);
this.startService(intent);
</code></pre>
<p>My Service code that extends <strong>NotificationListenerService</strong>:</p>
<pre><code>@SuppressLint("NewApi")
public class MyNotifService extends NotificationListenerService {
@Override
public void onNotificationPosted(StatusBarNotification sbn) {
super.onNotificationPosted(sbn);
Log.v("focus", "in onNotificationPosted() of MyNotifService");
}
@Override
public void onCreate() {
super.onCreate();
Log.v("focus", "in onCreate() of MyNotifService");
}
}
</code></pre>
<p>In the <strong>manifest file</strong>, I have this:</p>
<pre><code><service android:name="com.mavdev.focusoutfacebook.notifications.MyNotifService"
android:label="@string/app_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" >
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
</code></pre>
| 0non-cybersec
| Stackexchange | 478 | 1,662 |
Conversion journaled to APFS under Mojave. <p>I would like to update from Mojave to Catalina.</p>
<p>MAC is late 2012 and OS is Mojave 10.14.2</p>
<p>Update fails because SSD is not APFS.</p>
<p>I have read disk can be converted, using Disk Utility in recovery mode.
Function to convert disk should be either in the edit menu or under a conversion button.</p>
<p>Unfortunately, I Can find neither edit menu nor conversion button.</p>
<p>The system is in recovery mode. There is a convert button which gets enabled selecting disk1, but the effect is different from what I expected, as shown</p>
<p><a href="https://i.stack.imgur.com/RCIVH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RCIVH.jpg" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/p1H0W.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p1H0W.jpg" alt="enter image description here"></a><a href="https://i.stack.imgur.com/bzPqJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bzPqJ.png" alt="mac os"></a><a href="https://i.stack.imgur.com/W8VTM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W8VTM.png" alt="ssd"></a></p>
| 0non-cybersec
| Stackexchange | 416 | 1,202 |
Another proof for how many n-digit numbers are even. <p>For n is greater than or equal to 2, how many n-digit numbers are even. Give at least 2 proofs.</p>
<p>I did this proof:
The first digit cannot be zero (9 choices) and the last digit has to be even (5 choices). This leaves n-2 places in the number, each of which has 10 choices. Therefore, $9*10^{(n-2)}*5$ is the required number.</p>
<p>Can someone help me work a second proof? I considered complementary counting, but that would be the exact same thing basically and probably is not viable for a second proof.</p>
| 0non-cybersec
| Stackexchange | 156 | 574 |
Set Keystroke for Service from Terminal. <p>I created some services to be used in Finder. Now I wanted to create some keystrokes to call these services. That would be easy in the System Settings, however, I would like to add them from the command line in order to automate this setup.</p>
<p>I tried the following which did allow me not trigger the services by a keystroke:</p>
<pre><code>defaults write com.apple.Finder NSUserKeyEquivalents '{ "label-red" = "$@1"; "label-green" = "$@2"; "label-none" = "$@0"; }'
</code></pre>
<p>Any ideas to make this work? Instead of <code>com.apple.Finder</code> I might have to use another identifier, but which?</p>
| 0non-cybersec
| Stackexchange | 194 | 659 |
[Help] Possible muscle spasms?. I have a 16 lb, 7 year old, Jack Russell Terrier mix who I think is having muscle spasms or cramps?
His behavior, appetite, and poops are normal so I'm not worried that its something serious but you can tell he's very uncomfortable during the spasm/cramp. When it hits he walks in a circle and stretches (head down, butt up) while whining, he also tries to bite my hand but it's not hard just like "make it stop".
He's done this before but it's been a while since. He also has a vet appointment later this afternoon. Does it sound like muscle spasms or cramps? | 0non-cybersec
| Reddit | 152 | 598 |
Experiences with advanced CORBA services
THAP005
EXPERIENCES WITH ADVANCED CORBA SERVICES
G. Milcinski, M. Plesko, M. Sekoranja, Josef Stefan Institute, Ljubljana, Slovenia
Abstract
The Common Object Request Broker Architecture
(CORBA) is successfully used in many control systems
(CS) for data transfer and device modeling.
Communication rates below 1 millisecond, high
reliability, scalability, language independence and other
features make it very attractive. For common types of
applications like error logging, alarm messaging or slow
monitoring, one can benefit from standard CORBA
services that are implemented by third parties and save
tremendous amount of developing time. We have started
using few CORBA services on our previous CORBA-
based control system for the light source ANKA [1] and
use now several CORBA services for the ALMA
Common Software (ACS) [2], the core of the control
system of the Atacama Large Millimeter Array. Our
experiences with the interface repository (IFR), the
implementation repository, the naming service, the
property service, telecom log service and the notify
service from different vendors are presented.
Performance and scalability benchmarks have been
performed.
1 INTRODUCTION
Our team has over the last five years developed a
control system framework that uses and extends modern
component-based, distributed computing and object-
oriented concepts. The basic entities of the system are
accelerator devices that are represented as CORBA
(Common Object Request Broker Architecture) objects
– objects that are remotely accessible from any
computer through the established client-server
paradigm. We chose CORBA among other environment
for distributed systems (CDEV, J2EE, DCOM...)
because of its platform and language independence. A
successful implementation, based on Borland’s
Visibroker [6] is running the CS at the light source
ANKA. It uses Visibroker’s proprietary smart agent,
location service and interface repository. Then we
decided also to use other standard CORBA services. At
first we had some doubts – we were not sure if we could
accommodate to programs that were not written by us,
we were afraid of the high prices of some of these
programs, etc. But starting fears have vanished quickly.
We have completely rewritten the framework, making it
more general and useful for other control systems [2].
We used mostly TAO [4] and ORBacus [5]
implementations (both are free for non-commercial use),
both for ORB and services.
2 USED SERVICES
2.1 Event Service
This service coordinates the communication between
two kinds of objects – supplier (it produces event data)
and consumer (it processes event data). That is exactly
what a control system is doing – for example: user sets
current to a power supply and vice versa – a machine
sends readback to the user. When we started to develop
ANKA control system, there was a major disadvantage
of this service – it supported just generic events of type
Any. But, to discover all typing errors at compile time,
we wanted typed events [1]. That is why we defined our
own callback classes, one for each data type.
Nowadays both ORBacus and TAO Event Service
already support typed events (but TAO’s solution for
typed events support is non-standard).
2.2 Notify service
It extends Event Service and has added some further
functionality. These are filtering events (by type and
data), subscription to only some kinds of events, the
ability to configure various qualities of service
properties (per-channel, per-proxy or even per-event).
This is in our opinion the most useful service. It is just
perfect for controlling a few devices. The main problem
is, that queuing, filtering and processing events demand
time, memory and CPU and it could not process all data
used in a large control system It is a potential bottleneck
and a single point of failure. It is best used for system
wide services such as alarm and logging, where one
central process collects all messages from anywhere in
the control system.
ORBacus and TAO Notify Service are not supporting
typed events. One can use structured events, which are
actually Anys, but you can set a type property of an
event.
We performed benchmark and scalability tests on this
service, which will be discussed later.
2.3 Telecom Log Service
It is some kind of event consumer, which stores data
in persistent store. In some cases it must also supply an
event (to inform user that something in its state has
changed – like when a threshold is being crossed).
ORBacus did actually implement notify logging service
which has all notification functionality and a persistent
store. User can also query log entries, using some kind
of filter.
ORBacus T-Log has already implemented storing
data in its own database, which is not suited for large
amounts of data. TAO’s Telecom Log Service stores
records in memory and it is actually just a skeleton for a
serious implementation. We had to add features
ourselves (like persistent store, sending events to notify
channel, etc).
2.4 Naming Service
A useful tool - just like the telephone directory. It is
used to give names to objects. To work properly there
are two requirements – all objects have to be named and
each name is used only once. An object can have two
names, but vice versa is not possible. It is much like file
structure on hard disk – the equivalent name can only be
used for a file in different directory. Other services are
easer to manage when connected to naming service (for
example: notify supplier and consumer can exchange
IOR-s of the event channel; in ORBacus demos you can
find an approach without NS – saving and reading IOR
to/from a file – a little clumsy idea - just think about
sending a file by every channel creation).
2.5 Property Service
Property Service introduces a Property Set, which is a
collection property. Every property has a name (unique
within the property set) and a value, which can be of any
type (the CORBA *any* type). Property Sets are very
useful for storing object's data. For example, an object
representing a device in our control system is storing all
its characteristics in a property set, so that they are all
read in a single CORBA call during initialization. On
Windows systems, a key in the registry is equivalent to a
property set.
2.6 Interface Repository
A service that exposes the interfaces of CORBA objects
(the IDL file) in form of an object model, which is
available at run-time. Through the IFR, a program is
able to determine what operations are valid on an object
and make an invocation on it, even though its interface
was not known at compile-time In that way we have
developed Object Explorer (OE) – a program, which
can control the whole system without knowing almost
anything about the structure of the controlled devices.
The OE finds all CORBA objects on the network and
asks IFR for their operations. Using dynamic invocation
interface (DII) it executes chosen method via its name
and queries the user for all parameters in the parameter
list.
Another interesting usage of the IFR was in our
JavaBeans generator: the generator queries the running
IFR and creates Java source code that wraps the
CORBA objects into Java Beans – one Bean per
CORBA object interface. This is much more convenient
that writing our own IDL parser. We use ORBacus
implementation of this service and have found it very
stable – it has been running continuously for three
months now.
2.7 Implementation Repository
The Implementation Repository contains information
that allows the ORB to locate and activate
implementations of objects. Ordinarily, installation of
implementations and control of policies related to the
activation and execution of object implementations is
done through operations on this service.
We did not actually use this service, but took its features
and interfaces into account when writing our main
management program. It starts objects, loads their
shared libraries and other CORBA services, needed for
logging, archiving, etc.
3 PERFORMANCE AND SCALABILITY
BENCHMARKS
Tests were made with 1 GHz Athlon PC with 512 Mb of
RAM. All processes were running on the same machine,
so network latencies were excluded. The downside of
this is that processes switching might have affected the
results. We can safely assume that the real performance
is only better. All test were made with notify service’s
default settings.
We concentrated on testing a Notify Service for three
reasons. It is the easiest to test, results represent also
event service performance and it is the only one whose
performance directly influences the performance of the
CS Already on the beginning we found a minor
advantage of TAO notify service – when it starts, it
writes an IOR of an event channel factory to the name
service. ORBacus notify does not, so user must do it
manually or use resolve_initial_reference instead.
3.1 Time needed for processing an event
First test is very simple. We have one supplier and one
consumer. The supplier sends events and the consumer
receives them, both doing it as quickly as they can.
Trying to overload the service, supplier was sending
events in separate threads. First observation in the figure
1 is that time, needed for one event, is increasing with
number of threads (except from one thread to ten
threads – this is expected because of better exploiting of
CPU). A big jump from 30 threads to 100 threads is
presumably consequence of overloading the CPU.
0
1
2
3
4
5
1 10 30 100 threads
tim
e
pe
r e
ve
nt
[m
s]
TAO
ORBacus
Figure 1 - chart shows average time, needed for
processing an event (processes for sending events
were running on separate threads)
We can also see that TAO is quite faster than ORBacus.
In this test we have also noticed TAO’s immunity to
increasing number of events. This cannot be said for
ORBacus, which had quite a few problems dealing with
this. It actually lost a bit of them, which can be very
critical in some conditions.
3.2 Increasing number of suppliers
0
1
2
3
10 30 50 suppliers
tim
e
pe
r
ev
en
t [
m
s] TAO
ORBacus
Figure 2 - average time for processing an event from
many suppliers
From 10 to 50 suppliers were connected to the same
event channel and doing their job. The result is quite
expected. Time needed for one event is slowly
increasing (from 0.5 ms, 10 suppliers, to 0.6 ms, 50
suppliers at TAO and 2.3 to 2.6 ms, ORBacus). We can
again see that TAO is faster.
3.3 Increasing number of consumers
We used one supplier, to which 10 to 50 consumers
were connected.
The time per event increases with the number of
consumers, because the service must create one event
for each consumer. Although ORBacus is slower again it
has one advantage. If we divide time needed for one
event with number of consumers, we get the result,
which can be seen in figure 2.
With ORBacus, the needed time is decreasing (just the
opposite from TAO). This means that ORBacus is better
dealing with big number of consumers. This can be
probably explained with better logic for multiplying
events.
0
1
2
3
10 30 50 consumers
tim
e
pe
r e
ve
nt
[m
s]
TAO
ORBacus
Figure 3 - chart shows average time needed for
multiplying an event - one supplier sends event,
many consumers are receiving it
3.4 Other observations
First thing you notice dealing with these two services is
much more professional appearance of ORBacus. Web
pages are clearer, documentation is extensive, replies to
messages, send to mail list, are quicker. ORBacus
service is also more thoroughly implemented (more
possibilities for quality of service settings, etc). It is also
easier to destroy TAO service with a bad client. These
advantages are probably at the same time the reasons,
which make ORBacus service slower.
4 CONCLUSIONS
Most of the services, described in this paper, are
successfully running at ALMA [2] (for now just for
testing and development purposes), ANKA [1] and other
systems. Many others and ourselves have found them
very useful – so it is a waste of time and money not to
use them. But they are just not so perfect to use them
without fundamental consideration of possible
bottlenecks and other points of failure. And we still hat
to implement a few extra features of our own, so it is
unlikely to get away without programming..
REFERENCES
[1] M. Plesko et al: A Control System Based on Web,
Java, CORBA and Fieldbus Technologies, PCaPAC99
workshop, KEK, Tsukuba, January 1999
[2] G. Chiozzi, B. Gustafsson, B. Jeram, M. Plesko, M.
Sekoranja, G. Tkacik, Common Software for the ALMA
project, this conference
[3] Object Management Group: http://www.omg.org
[4] TAO home page:
http://www.cs.wustl.edu/~schmidt/TAO.html
[5] ORBacus home page: http://www.orbacus.com
[6] Borland – Visibroker’s CORBA:
http://www.borland.com/visibroker/
http://www.omg.org/
http://www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO
http://www.orbacus.com/
http://www.borland.com/visibroker/
| 0non-cybersec
| arXiv | 3,498 | 13,284 |
Cygwin uses relative and absolute path for environment variables. <p>When I use the below command in Cygwin:</p>
<pre><code>$ go get github.com/gorilla/mux
</code></pre>
<p>I receive the below error:</p>
<pre><code># cd .; git clone https://github.com/gorilla/mux C:\cygwin64\home\USER\Go\src\github.com\gorilla\mux
Cloning into 'C:\cygwin64\home\USER\Go\src\github.com\gorilla\mux'...
fatal: Invalid path '/home/USER/C:\cygwin64\home\USER\Go\src\github.com\gorilla\mux': No such file or directory
package github.com/gorilla/mux: exit status 128
</code></pre>
<p>When I use the command:</p>
<pre><code>cd $GOPATH
</code></pre>
<p>The correct folder opens.</p>
<p>Does anyone how I can solve this?</p>
| 0non-cybersec
| Stackexchange | 261 | 708 |
Well, that escalated quickly.. Spent some time playing my 3 year old today in Flower Fairy (aka Blumenfee). We wrap up after an edgy win building flowers before the arrival of Rosalina, the flower fairy.
**Me** - Good game, baby!
**Her** - Yes!
**Me** - Can you help me put the pieces back in the box?
**Her** - *<Sweetly obliges my request>*
**Me** - Okay, it's nap time now.
**Her** - Uhhhh, I wanna play....*<Looking around desperately now>*
**Her** - This one! *<Strolls back over to me holding nothing other than Food Chain Magnate>*
**Me** - *<Seriously contemplates the value of a 3 year old's knowledge of fast food and how that might affect gameplay>*
Compromise? Nap time and story time with page 1 of the FCM rules. Now she wants burgers. | 0non-cybersec
| Reddit | 236 | 786 |
Is the compiler allowed to interlace the evaluation of subexpressions within different function arguments?. <p>I am wondering about the following situation:</p>
<pre><code>void f(int a, int b) { }
int a(int x) { std::cout << "func a" << std::endl; return 1; }
int b(int x) { std::cout << "func b" << std::endl; return 2; }
int x() { std::cout << "func x" << std::endl; return 3; }
int y() { std::cout << "func y" << std::endl; return 4; }
f(a(x()), b(y()));
</code></pre>
<p>After reading <a href="http://en.cppreference.com/w/cpp/language/eval_order">http://en.cppreference.com/w/cpp/language/eval_order</a> I am still having difficulty to understand whether the following evaluation order is possible:</p>
<p><code>x()</code> -> <code>y()</code> -> <code>a()</code> -> <code>b()</code></p>
<p>or that the standard guarantees that <code>a(x())</code> and <code>b(y())</code> will be evaluated as units, so to speak.</p>
<p>In other words, is there any possibility this will print</p>
<pre><code>func x
func y
func a
func b
</code></pre>
<p>Running this test on GCC 5.4.0 gives the to my mind more logical</p>
<pre><code>func y
func b
func x
func a
</code></pre>
<p>but this of course does not tell me anything about what the standard requires. It would be nice to get a reference to the standard.</p>
| 0non-cybersec
| Stackexchange | 473 | 1,362 |
Working around unset "length" property on partial functions created with lodash's partialRight. <p>I'm working with <a href="https://momentjs.com/timezone/docs/" rel="noreferrer">MomentTimezone</a> for time manipulation in the browser.</p>
<p>I am using TypeScript and <a href="https://lodash.com/docs/4.17.15" rel="noreferrer">Lodash</a> too.</p>
<p>I have some <code>accountTimezone</code> set on the <code>window</code> containing the authenticated user's preferred timezone. I am trying to create a helper method <code>localMoment()</code> that will accept any of <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a3528daaf0b06c5ed3864bf4c28a0c438fd374a3/types/moment-timezone/moment-timezone.d.ts#L21-L32" rel="noreferrer">the many signatures of <code>moment.tz()</code></a>, appending this <code>window.accountTimezone</code> as the final <code>timezone: string</code> argument.</p>
<p>It seems <a href="https://lodash.com/docs/4.17.15#partialRight" rel="noreferrer"><code>partialRight</code></a> may be what I'm looking for.</p>
<pre><code>const localMoment = partialRight(moment.tz, window.accountTimezone);
</code></pre>
<p>The problem I'm having has to do with this note from the lodash docs:</p>
<blockquote>
<p><strong>Note:</strong> This method doesn't set the "length" property of partially applied functions.</p>
</blockquote>
<p>Specifically, for a call like <code>localMoment('2019-08-01 12:00:00')</code>, TypeScript complains that <code>localMoment()</code> was provided 1 argument, but expects zero.</p>
<p><strong>How can I keep TypeScript happily understanding a call to <code>localMoment()</code> should look like a call to <code>moment.tz()</code> via the <code>MomentTimzone</code> interface, while avoiding this arity confusion from the use of <code>partialRight()</code>?</strong></p>
<hr>
<p>I considered something like this as an alternative, but don't know how to type <code>...args</code> to keep TypeScript happy.</p>
<pre><code>const localMoment = (...args): Moment => moment.tz(...args, window.accountTimezone);
</code></pre>
| 0non-cybersec
| Stackexchange | 667 | 2,105 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Webpages loading slowly at start. <p>I'm having an issue in my organization where webpages are slow to load when first requested. In a Chrome browser we typically see the "waiting for <em>site</em>" or "establishing secure connection" messages in the lower corner. This typically lasts for 5-10 seconds and then the page loads quickly like normal.</p>
<p>A few observations on this:</p>
<ul>
<li>Have been noticing it off and on for a couple of weeks now.</li>
<li>Happened out of the blue.</li>
<li>Happens with all browsers.</li>
<li>Happens with both HTTP and HTTPS requests.</li>
</ul>
<p>One more thing that I find to be very odd is that it seems to only be affecting our Mac devices running OSX. We have several that are bootcamped with Windows 7 and have no problem at all on these.</p>
<p>Any ideas?</p>
<p>Thanks for your time!</p>
<p><strong><em>EDIT</em></strong></p>
<p>Results from Chrome Connectivity Diagnostics:
<a href="https://i.stack.imgur.com/GSKN5.png" rel="nofollow noreferrer">Diagnostic Report Screen Shot</a></p>
<pre><code>> SUMMARY Test Name: Google Websites HTTP Latency Test Test ID: 9
> Test result: Problem detected
>
> Tue May 16 2017 11:02:50 GMT-0500 (CDT) - HTTP response # / time received (microtimestamp) / elapsed time(ms): 2 / 1494950570671 / 7422
> Tue May 16 2017 11:02:50 GMT-0500 (CDT) - Total HTTP response time (ms): 22414
> Tue May 16 2017 11:02:50 GMT-0500 (CDT) - Total number of HTTP requests: 3
> Tue May 16 2017 11:02:50 GMT-0500 (CDT) - Average HTTP response time (ms): 7471.33
</code></pre>
| 0non-cybersec
| Stackexchange | 508 | 1,580 |
Single vs multiple MemoryCache instances. <p>MemoryCache comes with a Default cache by default and additional named caches can be created.</p>
<p>It seems like there might be advantages to isolating the caching of results of different processes in different instances For example, results of queries against an index could be cached in an "IndexQueryResult" cache and result of database queries in a "DatabaseQueryResult" cache. That's rather contrived but explains the principle.</p>
<p>Does the memory pressure on one cache that results in evictions affect the other caches at all? Are there any differences in the way .Net manages multiple caches compared to how it manages one?</p>
<p>Am I wasting my time considering the idea of multiple caches, or is there real value in doing so?</p>
| 0non-cybersec
| Stackexchange | 182 | 794 |
Pyspark equivalent for df.groupby('id').resample('D').last() in pandas. <p>I have a large table like </p>
<p><a href="https://i.stack.imgur.com/zOZUF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zOZUF.png" alt=""></a> </p>
<p>I want to change it to a new table : id, date, last_state . </p>
<p>It is very easy by pandas :</p>
<pre><code>df['time_create'] = pd.to_datetime(df['time_create'])
df = df.set_index('time_create')
df = df.sort_index()
df = df.groupby('id').resample('D').last().reset_index()
</code></pre>
<p>But it is very hard to implement by pyspark. </p>
<p>I knew: </p>
<ol>
<li><p>Resample equivalent in pysaprk is groupby + window :</p>
<pre><code>grouped = df.groupBy('store_product_id', window("time_create", "1 day")).agg(sum("Production").alias('Sum Production'))
</code></pre>
<p>here groupby store_product_id , resample in day and calculate sum</p></li>
<li><p>Group by and find first or last:</p>
<p>refer to <a href="https://stackoverflow.com/a/35226857/1637673">https://stackoverflow.com/a/35226857/1637673</a></p>
<pre><code>w = Window().partitionBy("store_product_id").orderBy(col("time_create").desc())
(df
.withColumn("rn", row_number().over(w))
.where(col("rn") == 1)
.select("store_product_id", "time_create", "state"))
</code></pre>
<p>This groupby id and get the last row order by time_create .</p></li>
</ol>
<p>However what I need is groupby id, resample by day,then get last row order by time_create .</p>
<p>I know this problem may could be solved if I use pandas udf , <a href="https://stackoverflow.com/questions/40006395/applying-udfs-on-groupeddata-in-pyspark-with-functioning-python-example">Applying UDFs on GroupedData in PySpark (with functioning python example)</a> </p>
<p>But is there any way to do this just by pyspark ? </p>
| 0non-cybersec
| Stackexchange | 689 | 1,836 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Ubuntu 13.04 locks up in VLC. <p>Since I installed 13.04, I've had occasional lockups that sometimes relate to VLC player (could be something else). I can sometimes <kbd>Ctrl</kbd><kbd>Alt</kbd><kbd>F1</kbd> to a different terminal to <code>sigkill</code> VLC, but sometimes it looks up to a point where I can't click buttons and can't execute any keyboard commands and I need to power cycle. </p>
<p>Does anyone have any recommendations for how I should troubleshoot this issue? Should I hunt through <code>/var/log</code> after it happens etc?</p>
| 0non-cybersec
| Stackexchange | 159 | 551 |
How to give the new files rising numeric names in bash?. <p>i have a script </p>
<pre><code>file=$(ls `pwd`/ | grep .mp4)
i=$(($i+1))
while read -r start end; do
ffmpeg -i $file -ss "$start" -to "$end" -c copy "$i".mp4
done < cuts.txt
</code></pre>
<p>So $i do not work, script stop whit "File '1.mp4' already exists. Overwrite ? [y/N] Not overwriting - exiting"</p>
| 0non-cybersec
| Stackexchange | 149 | 380 |
Difference between --rbind and --bind in mounting. <p>I am confused. Linux filesystem is a tree structure, with the root node(starting node) as the root directory.
Now let's suppose I have a folder <code>abc</code> at location <code>/home/abc</code> and another folder <code>xyz</code> at location <code>/home/xyz</code> </p>
<p>Folder <code>xyz</code> consists of some other folders and files inside it. (ex <code>def</code> and <code>mno</code> are folders inside it)</p>
<pre><code>/
├── home/
│ ├── abc
│ └── xyz
│ ├── def
│ └── mno
</code></pre>
<p>When I run the command </p>
<pre><code>mount --rbind /home/xyz /home/abc
</code></pre>
<p>(rbind is recursively bind)
I see all the contents of the folder <code>xyz</code> in <code>abc</code>.
Now, when I just run the command </p>
<pre><code>mount --bind /home/xyz /home/abc
</code></pre>
<p>I still see all the contents of <code>xyz</code> in <code>abc</code>. </p>
<p>Why is that? </p>
<p><code>--bind</code> to work just as similarly to <code>--rbind</code>.</p>
| 0non-cybersec
| Stackexchange | 380 | 1,048 |
div width 100 percent not working in mobile browser. <p>I am trying to do something that, I thought, was very simple. The header of a website I am building is a solid color that needs to span the entire width of the screen regardless of which browser it is veiwed in. What I have created so far works wonderful on desktops and laptops, but when I test it on a tablet or a mobile phone, the header does not span all the way to the right. The content inside of the header does span all the way however, which is really confusing to me. The only way I can get the header bar to span the entire width is by setting the position property to static, which is not what I need for this site, so that doesn't do me any good. Below is the CSS and HTML I am using. Could someone take a look at it and let me know what I am missing.</p>
<p>HTML:</p>
<pre><code><div class="header">
<div class="container">
<div class="header-content">
....Some Content goes in here....
</div> <!-- /.header-container -->
</div> <!-- /.container -->
</div> <!-- /.header -->
</code></pre>
<p>CSS:</p>
<pre><code>html, body {
background-color: #949494;
width: 100%;
margin: 0px;
padding: 0px;
}
.header {
width: 100%;
min-width: 100%;
height: 200px;
background-color: #ffffff;
padding-top: 8px;
}
.container {
width: 1200px;
margin: 0 auto;
text-align: center;
}
</code></pre>
| 0non-cybersec
| Stackexchange | 441 | 1,406 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.