text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
For which $k \in \mathbb{R}$ the vector $(1,k^2-k,k) \in Im(f)$ where $f$ is a linear map?. <p>Let $f:\mathbb{R^3}\to \mathbb{R^3} $ the map defined by $A_h$ $$ A_h= \begin{pmatrix} 2 &amp; 1 &amp; -1 \\ 1 &amp; 2 &amp; 1 \\ -1 &amp; 1 &amp; h \\ \end{pmatrix} $$ where $h \in \mathbb{R}$. $f(x,y,z)=(x-y-2z,x+2y+z,3y+3z)$</p> <p>I have found the value of $h$ for which $\dim(\ker(f))&gt;0$ which is $h=2$. Then a basis of $Im(f)$ is $\{(1,2,1),(-1,1,2)\}$.</p> <p>$$ A_2= \begin{pmatrix} 2 &amp; 1 &amp; -1 \\ 1 &amp; 2 &amp; 1 \\ -1 &amp; 1 &amp; 2 \\ \end{pmatrix} $$</p> <p>I have to determine for which $k \in \mathbb{R}$ the vector $v=(1,k^2-k,k) \in Im(f)$ (with $h=2$). </p> <p><strong>My attempt</strong> </p> <p>I tried to find $k$ such that $v$ is equal to the linear combination of the two vectors of $Im(f)$, but it does not work.</p> <p>I also tried to find $k$ such that $v$ is equal to $(x-y-2z,x+2y+z,3y+3z)$ and I got $k=1+\sqrt{2}$ or $k=1-\sqrt{2}$, but I think I am wrong.</p> <p>What is the right approach? </p>
0non-cybersec
Stackexchange
505
1,120
How to install gimp-GAP for gimp snap. <p>I have a fresh install of Ubuntu 20.04 and I've installed Gimp via Software Manager (so that it became a <strong>snap</strong>, located in <code>/snap/gimp/252/</code>). Now I want to install gimp-GAP. I see no other way than to use "gimp-gap-2.6.0.tar.bz2" from <a href="https://www.gimp.org/news/2009/06/05/gimp-animation-package-260-released/" rel="nofollow noreferrer">https://www.gimp.org/news/2009/06/05/gimp-animation-package-260-released/</a>. However, after unpacking, when running <code>./configure</code> it complains: </p> <pre> > No package 'gimp-2.0' found > No package 'gimpui-2.0' found > No package 'gimpthumb-2.0' found > > Consider adjusting the PKG_CONFIG_PATH environment variable if you > installed software in a non-standard prefix. </pre> <p>Apparently, this gimp-GAP package assumes Gimp has been installed the classical way (not as a snap). What should I do? <p> Edit:<br> <code>echo $PKG_CONFIG_PATH</code> gives the empty result and <code>PKG_CONFIG_PATH</code> (as one string) does not occur anywhere in the top-level files of the gimp-GAP installation files.<br> Searching for <code>gimp-2.0</code> and <code>gimpui-2.0</code> and <code>gimpthumb-2.0</code> gives these locations:</p> <pre> /snap/gimp/252/usr/lib/libgimp-2.0.so /snap/gimp/252/usr/lib/libgimp-2.0.so.0 /snap/gimp/252/usr/lib/libgimp-2.0.so.0.1000.18 /snap/gimp/252/usr/share/aclocal/gimp-2.0.m4 /snap/gimp/252/usr/lib/libgimpui-2.0.so /snap/gimp/252/usr/lib/libgimpui-2.0.so.0 /snap/gimp/252/usr/lib/libgimpui-2.0.so.0.1000.18 /snap/gimp/252/usr/lib/libgimpthumb-2.0.so /snap/gimp/252/usr/lib/libgimpthumb-2.0.so.0 /snap/gimp/252/usr/lib/libgimpthumb-2.0.so.0.1000.18 </pre> <p>Should I set <code>PKG_CONFIG_PATH</code> to <code>/snap/gimp/252/usr/lib/</code> and then again invoke <code>configure</code>?</p>
0non-cybersec
Stackexchange
747
1,855
How to fix an External 4TB HDD with HFSPlus Filesystem stuck on Read-Only. <p>I am running Ubuntu 19.10 with a 4TB External HDD attached with a HFSPlus Filesystem, non-journaled. At some point the HDD would become read-only despite all efforts to mount it at another location besides "/media", change permissions, or amend FSTAB. I used instructions found elsewhere on this very helpful askUbuntu forum.</p> <p>Finally, I came across some instructions to run DMESG to see the output. </p> <blockquote> <p>hfsplus: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.</p> </blockquote> <p>After further reading I believe the HDD was improperly mounted and this is a textbook case of not properly and safely disconnecting the drive from Ubuntu. I understand that the solution is to run "fsck.hfsplus". However, I quickly learned that I don't have that command available. I tried to install it with apt-get, but there's no package by that name. </p> <p>I am missing something, but I just need to know how to repair the situation. </p> <p>I am someone who has been tinkering with Linux on a superficial level since University with a background in Arts. I set up Piholes and I use Ubuntu mainly to entertain family as a media centre. Thank you very much for your patience.</p>
0non-cybersec
Stackexchange
354
1,332
Random walk, probability of not return to the origin. <p>A man stands one step away from a cliff. With <span class="math-container">$2 \over 3$</span> probability, he steps to the right (away from the cliff), and with <span class="math-container">$1 \over 3$</span> probability, he steps towards the cliff. What is the probability that he escapes the cliff?</p> <p>The solution for this problem is as follows:</p> <p>Say <span class="math-container">$P_1$</span> is the probability of falling off the cliff from 1 step away. <span class="math-container">$P_2$</span> is the probability of falling off the cliff from 2 steps away.</p> <p><span class="math-container">$P_1 = {1 \over 3} + {2 \over 3}P_2$</span></p> <p>The solution states that from <span class="math-container">$2$</span>, the paths leading to the cliff (point <span class="math-container">$0$</span>) are going from <span class="math-container">$x=2$</span> to <span class="math-container">$x=1$</span>, and <span class="math-container">$x=1$</span> to <span class="math-container">$x=0$</span>. The probability of both of these paths is effectively <span class="math-container">$P_1$</span> each, as we are simply translating a step to the right. Therefore, <span class="math-container">$P_2 = P_1 \cdot P_1$</span>, because <span class="math-container">$P_2 = P( \text{particle goes from} \;x=2\; \text{to} \;x=1) \cdot P(\text{particle goes from} \;x=1\; \text{to} \;x=0)$</span>. Thus,</p> <p><span class="math-container">$P_1 = {1\over 3} + {2\over 3} P_1\cdot P_1$</span>.</p> <p>Here's my question: Why do we not consider that <span class="math-container">$P_2$</span> can also go from <span class="math-container">$x=2$</span> to <span class="math-container">$x=3$</span>? (Then from <span class="math-container">$x=3$</span>, we would also have another chance to go from <span class="math-container">$x=2$</span>, and/or <span class="math-container">$x=1$</span>). Shouldn't <span class="math-container">$P_2 = P(\text{particle goes from} \;x=2\; \text{to} \;x=1)\cdot P(\text{particle goes from}\; x=1\; \text{to}\; x=2) + {2\over 3}P(3)$</span>, or something like that?</p>
0non-cybersec
Stackexchange
726
2,151
Dovecot (imap) not starting. <p>I'm running Ubuntu 14.10 installed postfix dovecot vimbadmin and roundcube.</p> <p>Everything works except dovecot.</p> <p>When I restart dovecot I get this:</p> <pre><code>stop: Unknown instance: dovecot start/running, proccess 6580 </code></pre> <p>In my <code>var/log/dovecot.log</code> file I get this:</p> <pre><code>Fatal: service(auth) Group doesn't exist: postifx (See service auth { unix_listener /var/run/dovecot/auth-userdb { group } } setting) </code></pre> <p>So i probably have some problems with the settings, i will post those two if its necessary, but i'm hoping maybe someone all ready had this problem and its a quick fix.</p>
0non-cybersec
Stackexchange
228
686
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
Is the special case of Abhyankar&#39;s lemma is also considered as such?. <p>Consider the following statement:</p> <blockquote> <p>Assume $E$ and $F$ are unramified (over some fixed prime) finite separable extensions of a field $K$. Then $EF$ is also unramified.</p> </blockquote> <p>I always thought that it is called Abhyankar's lemma (and indeed it is a special case of it, see <a href="https://en.wikipedia.org/wiki/Abhyankar%27s_lemma" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Abhyankar%27s_lemma</a>).</p> <p>My question is whether this statement is indeed named after Abhyankar. If so, a reference would be appreciated, if not, how is it called? </p>
0non-cybersec
Stackexchange
217
678
ar X iv :0 80 2. 36 65 v1 [ cs .C Y ] 2 5 F eb 2 00 8 Outward Accessibility in Urban Street Networks: Characterization and Improvements Bruno Augusto Nassif Travençolo and Luciano da Fontoura Costa Institute of Physics at São Carlos, University of São Paulo, PO Box 369, São Carlos, São Paulo, 13560-970 Brazil (Dated: October 23, 2018) The dynamics of transportation through towns and cities is strongly affected by the topology of the connections and routes. The current work describes an approach combining complex networks and self-avoiding random walk dynamics in order to quantify in objective and accurate manner, along a range of spatial scales, the accessibility of places in towns and cities. The transition probabilities are estimated for several lengths of the walks and used to calculate the outward accessibility of each node. The potential of the methodology is illustrated with respect to the characterization and improvements of the accessibility of the town of São Carlos. The intrinsic relationship between structure and dy- namics seems to scaffold many dynamical processes in nature, from the flight of birds to the binding of proteins. Because of its inherent ability to represent and model the most diverse types of discrete structures, complex net- works have received growing attention. Having initially focused attention on the characterization and modeling of the topology of interconnectivities (e.g. [1, 2, 3]), complex network research progressed steadily to encompass the re- lationship between structure and dynamics in the most diverse systems (e.g. [2, 4]). Though the connectivity does not completely define dynamics, it strongly affects it. This has become clear through investigations of rela- tionships between structure and several types of dynam- ics, including diffusion (e.g. [5]), synchronization (e.g. [6]) and neuronal networks [7, 8]. Particularly, when the dy- namics is modeled in terms of random walks (e.g. [5, 9]), the displacements of the respective moving agents are strongly influenced by several topological factors such as the number of connections at each node and the short- est path lengths between nodes. This type of stochastic dynamics presents an intrinsic potential for modeling the displacement of people within towns or cities. However, because traditional linear random walks allow a moving agent to visit edges and nodes more than once, implying null average displacement in the long term, it becomes important to consider more purposive types of displace- ments. Self-avoiding walks (e.g. [10, 11, 12, 13]) represent a natural simplified choice for modeling urban displace- ments, implying the agents to move away from their ini- tial position in a more effective way while not repeating edges or nodes. Complex networks have been used to characterize im- portant topological, dynamical and spatial properties of cities (e.g., [14, 15, 16, 17, 18]). One important prac- tical application of the structure-dynamics relationship concerns the characterization, modeling and planning of urban displacements. In a previous study, Rosvall et al. [14] considered shortest path lengths in order to quan- tify and compare the information needed to locate spe- cific addresses in different cities. The current work ap- plies the recently introduced concept of accessibility [19] in order to quantify in an objective and comprehensive way the outward accessibilities of each node of a town (i.e. intersection or beginning of routes). The methodol- ogy is illustrated with respect to the specific application to the Brazilian town of São Carlos. Image processing and analysis methods were used to transform the plan of the town into a respective geographical planar net- work, where the nodes represent the crossings and the beginning of routes, while the edges correspond to the streets. Figure 1 shows the network derived from the central part of the town. Then, by simulating a series of self-avoiding walks starting at all nodes, transition prob- abilities from one node to another were estimated with respect to varying lengths of the walks. The outward accessibility of each node — expressing the diversity of routes between those points as well as the potential of the moving agent to visit a set of nodes in the short- est time — is quantified in terms of the entropy of the obtained transition probabilities, so that values close to 1 indicate maximum outward accessibility. One impor- tant property of the outward accessibility measurement is that self-avoiding walks initiating from nodes charac- terized by high accessibility for a given path length tend to visit all reachable nodes at that length in the short- est period of time. In addition, the outward accessibility intrinsically considers the number of alternative routes from the initial node to the reachable nodes. Nodes with high outward accessibility therefore have more balanced number of routes leading to the reachable nodes [19, 20]. We start by presenting the basic concepts about net- work representation. An unweighted and undirected complex network can be represented by a matrix K, called adjacency matrix. The dimension of this matrix for a network with N nodes and E edges is NxN . If the nodes i and j are connected through an edge, the ele- ments K(i, j) and K(j, i) of the adjacency matrix are set to 1; otherwise K(i, j) = K(j, i) = 0. Two nodes of the network are said to be adjacent if they share one edge. Two edges of the network are said to be adjacent if one extremity of each edge share the same node. The degree of a node i is the number of its immediate neighbors. A walk over the network is composed by a sequence of adjacent nodes, starting from an initial node and pro- ceeding through successive steps h. A self-avoiding walk is a walk where the nodes and edges do not appear more than once. http://arxiv.org/abs/0802.3665v1 2 FIG. 1: Network of urban streets of São Carlos, Brazil. The gray level of the nodes indicates their respective averaged outward accessibility accordingly to the legend at the right-hand side. The dashed lines represent the hypothetical additional edges aimed at improving the accessibility. After a real-world structure has been properly repre- sented as a complex network, a diversity of measures can be obtained, ranging from simple features such as the node degree and clustering coefficient, to more sophisti- cated such as shortest path lengths and betweeness cen- trality. These measures have allowed the comprehensive description and characterization of several complex sys- tems [3, 4]. The transition probability that a moving agent node reaches a node j after departing from a node i, through a self-avoiding walk after h steps, is henceforth expressed as Ph(i, j). In order to estimate this probability, a total of M self-avoiding random walks, starting from the node i and proceeding S steps, are performed. Note that these walks stop when one of the following three conditions is met: (i) the walk reaches the maximum pre-defined value of steps (S+1 nodes); (ii) the walk reaches an extremity node, i.e., a node with degree one; or (iii) the walk cannot proceed further because all of immediate neighbors of the node at step h were already visited. The probability Ph(i, j) can then be estimated in terms of the number of times that the walks departing from a node i reach the node j after h steps, divided by the number of walks, M . Note that Ph(i, j) is typically different of Ph(j, i). After the probabilities are estimated for each node, it is possible to calculate the diversity entropy signature Eh(i) of a node i after h steps as [20]: Eh(i) = − N ∑ j=1 { 0 if Ph(i, j) = 0 Ph(i, j)ln(Ph(i, j)) if Ph(i, j) 6= 0 (1) Although the diversity entropy provides an interesting 3 quantification of the accessibility of the nodes, the out- ward accessibility has been proposed as a normalization of the diversity entropy, allowing direct comparison with other measures regarding non-linear transient dynamics of the network (e.g. inward accessibility [19]). The out- ward accessibility OAh(i) of a node i after h steps can be immediately calculated from the diversity entropy as OAh(i) = exp(Eh(i)) N − 1 (2) The outward accessibility was estimated for the central part of the urban streets of São Carlos, which is repre- sented by a network with N = 2812 nodes and E = 4713 edges (Fig. 1). The total length of the self-avoiding ran- dom walks performed for each node was S = 60, and 10.000 walks were performed so as to obtain accuracy in probability estimations. In Fig. 1 the gray levels of the nodes corresponds to their respective accessibility, aver- aged over all the steps. An interesting result which is evident in this figure is that most part of the highly ac- cessible nodes corresponds to the downtown São Carlos, located at the central region of the map. Another im- portant property is the high spatial discriminative power provided by the outward accessibility measurement: it can be clearly seen from Fig. 1 that the nodes situated at the border of the network have the smallest outward values, while the inner nodes have the highest outward values. Interestingly, nodes with low outward accessibil- ity can be found even downtown. It is interesting to recall that the ability of the accessibility approach to identify the most central (against the borders) parts of a network is not restricted to geographical networks, but can be im- mediately applied to any other type of complex network. In order gain more insights regarding the accessibility of the different parts of the town, we also considered hy- pothetical new edges (i.e., new streets) connecting some nodes of the periphery and internal regions of the town (represented as dashed lines in Fig. 1). This new ar- rangement allowed a study of the potential impact of the new edges in the accessibility of their neighborhood. The mean accessibility was computed considering the nodes located up to seven blocks away from the nodes that re- ceived the new connections. Figure 2 shows these val- ues for the original network and for the enhanced net- work. Note an increase of 21% in the accessibility after approximately h = 15 steps for the place where the new edges were added. This result shows that major improve- ments of accessibility can be achieved by adding just a few streets at strategic locations. The authors thank the São Carlos town hall for provid- ing and granting the permission for using the city plan and Matheus P. Viana for the design of the image pro- cessing routines. Bruno A. N. Travençolo is grateful to FAPESP for financial support (2007/02938-5) and Lu- ciano da Fontoura Costa thanks to CNPq (301303/06-1) and FAPESP (05/00587-5) for financial support. [1] R. Albert and A. Barabási, Rev. Mod. Phys. 74, 47 (2002). [2] M. E. J. Newman, SIAM Rev. 45, 167 (2003). [3] L. da F. Costa, F. A. Rodrigues, G. Travieso, and P. R. Villas Boas, Adv. Phys. 56, 167 (2007). [4] L. da F. Costa, O. N. Oliveira Jr, G. Travieso, F. A. Rodrigues, P. R. V. Boas, L. Antiqueira, M. P. Viana, and L. E. C. da Rocha, eprint arXiv.org:0711.3199. [5] L. da F. Costa, O. Sporns, L. Antiqueira, M. G. V. Nunes, and O. N. Oliveira Jr., Appl. Phys. Lett. 91, 054107 (2007). [6] S. Boccaletti, V. Latora, Y. Moreno, M. Chavez, and D. Hwang, Phys. Rep. 424, 175 (2006). [7] L. da F. Costa and D. Stauffer, Physica A 330, 37 (2003). [8] L. da F. Costa and O. Sporns, Int. J. Bifurcat. Chaos 17, 2387 (2007). [9] J. Gomez-Gardenes and V. Latora, eprint arXiv:0712.0278. [10] C. P. Herrero and M. Saboyá, Phys. Rev. E 68, 026106 (2003). [11] C. P. Herrero, Phys. Rev. E 71, 016103 (2005). [12] S.-J. Yang, Phys. Rev. E 71, 016107 (2005). [13] O. Kinouchi, A. Martinez, G. Lima, G. Lourenço, and S. Risau-Gusman, Physica A 315, 665 (2002). [14] M. Rosvall, A. Trusina, P. Minnhagen, and K. Sneppen, Phys. Rev. Lett. 94, 028701 (2005). [15] P. Crucitti, V. Latora, and S. Porta, Chaos 16, 015113 (2006). [16] A. Cardillo, S. Scellato, V. Latora, and S. Porta, Phys. Rev. E 73, 66107 (2006). [17] S. Lämmer, B. Gehlsen, and D. Helbing, Physica A 363, 89 (2006). [18] S. Porta, P. Crucitti, and V. Latora, Physica A 369, 853 (2006). [19] L. da F. Costa, eprint arXiv.org:0801.1982. [20] L. da F. Costa, eprint arXiv.org:0801.0380. http://arxiv.org/abs/0712.0278 4 FIG. 2: Mean accessibility of the original network and the enhanced network. In both cases, only the nodes with up to seven edges of distance from the nodes that received the new connections were taken into account. Note the substan- tial increase in the accessibility as a consequence of the new connections.
0non-cybersec
arXiv
3,397
12,785
A Question about the Intersection Multiplicity. <p>In a recent lecture the lecturer defined the <strong>local ring</strong> of an irreducible affine variety $V$ at $P\in V$ as $$ \mathcal{O}_{V,P}=\{\phi\in K(V)\mid\phi\text{ is defined at }P\}. $$ Then he defined the <strong>intersection multiplicity</strong> of two polynomials $f,g\in K[x,y]$ to be $$ I_P(f,g)=\dim\mathcal{O}_{\mathbb{A}^2,P}/\langle f,g\rangle, $$ where $\langle f,g\rangle$ is the ideal of $\mathcal{O}_{\mathbb{A}^2,P}$ generated by $f,g$. </p> <p>My question is that what the above definition means? It is a 'dimension', but of what object? A vector space or an affine space or something else? And if the definition is clear, what does the phrase 'intersection multiplicity' mean? I mean, how does this definition relate to the actual meaning of 'intersection'? This quite confuses me so could anyone help me with this? </p>
0non-cybersec
Stackexchange
275
904
Migrating existing Debinan installation to LVM on LUKS with encrypted /boot. <p>I have a VirtualBox with Debian Jessie. After some point I decided to create new virtual drive, encrypt it with LUKS, and copy old system to it without reinstalling. I've used several guides (<a href="http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/" rel="nofollow noreferrer" title="Pavel Kogan: Full disk encryption with LUKS (including /boot)">1</a>,<a href="http://ada.adrianlang.de/existing-debian-luks" rel="nofollow noreferrer">2</a>,<a href="http://www.finnie.org/2009/07/26/howto-encrypt-an-existing-debian-installation/" rel="nofollow noreferrer">3</a>,<a href="https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system" rel="nofollow noreferrer">4</a>) to do this, but something goes wrong - when I'm trying to boot from the second drive, I'm getting black screen with cursor (not even sure if it blinks). Looks like that is some kind of a grub related problem.</p> <p>What was before is just a system on a single partition:</p> <pre><code>Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 40136703 40134656 19,1G 83 Linux /dev/sda2 40138750 41940991 1802242 880M 5 Extended /dev/sda5 40138752 41940991 1802240 880M 82 Linux swap / Solaris </code></pre> <p>New disk is /dev/sdb 40Gb. I've prepared this drive as in <a href="http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/" rel="nofollow noreferrer" title="Pavel Kogan: Full disk encryption with LUKS (including /boot)">1</a>, then mounted this drive and copied everything from the old system:</p> <pre><code># mount /dev/mapper/vg-root /mnt/ # mount /dev/mapper/vg-home /mnt/home # cp -a /bin /boot /etc /home /lib /root /sbin /usr /var /mnt </code></pre> <p>Then chrooted into the new system:</p> <pre><code># mount -t proc none /mnt/proc # mount -t sysfs none /mnt/sys # mount --bind /dev /mnt/dev # chroot /mnt </code></pre> <p>Modified fstab:</p> <pre><code>/dev/mapper/vg-root / ext4 errors=remount-ro 0 1 /dev/mapper/vg-home /home ext4 errors=remount-ro 0 1 /dev/mapper/vg-swap none swap sw 0 0 </code></pre> <p>Added changes to crypttab, initramfs and grub:</p> <pre><code># echo 'lvm /dev/sda2 none luks' &gt;&gt; /etc/crypttab # echo 'lvm2 dmcrypt' &gt;&gt; /etc/initramfs-tools/modules # update-initramfs -k all -u </code></pre> <p>Added options to /et/default/grub:</p> <pre><code>GRUB_CMDLINE_LINUX="cryptdevice=UUID=3bd9c402-92aa-4bf8-9644-7c7a079e1cf6:lvm" GRUB_ENABLE_CRYPTODISK=y </code></pre> <p>then installed grub <code># dpkg-reconfigure grub-pc</code> and verified /boot/grub/grub.cfg (<a href="http://pastebin.com/Vgb7hpHH" rel="nofollow noreferrer">pastebin</a>)</p> <hr> <p>After trying to boot from this second drive I'm getting black screen with cursor. No errors, not texts of any kind. I think that even grub wasn't started...</p> <p>Any ideas except to reinstall?</p>
0non-cybersec
Stackexchange
1,112
3,102
SSH connection gets lost, but not when logged in to MySQL. <p>When I open an SSH connection to our database server and leave it open for a longer time, the connection gets lost at some point. I don't know why or how, but this happens a lot. I still see the prompt, but can't enter anything. I usually kill the terminal and open a new one. If I wait much longer, I get an error message. </p> <p>However, when I login to MySQL after logging in with SSH, this doesn't happen. The connection stays open. If this is possible, I guess it's a matter of keeping the connection alive. </p> <p><strong>How does this work and can I set SSH to do better?</strong></p>
0non-cybersec
Stackexchange
172
658
$\lvert c_n \rvert = \frac {\max_{\lvert z \rvert = r} \vert f(z) \rvert} {r^n} (0 \lt r \lt R)$ then, $f(z)$ is of this form $f(z) = c_n*z^n$.. <p>$f(z) = \sum_{n = 0}^\infty c_nz^n$, $ \lvert z \rvert \lt R$. If at least one $c_n$ satisfies the following equation: $$\lvert c_n \rvert = \frac {\max_{\lvert z \rvert = r} \vert f(z) \rvert} {r^n} (0 \lt r \lt R)$$</p> <p>then, $f(z)$ is of this form $f(z) = c_n*z^n$.</p> <p>From <a href="http://en.wikipedia.org/wiki/Cauchy%27s_integral_formula" rel="nofollow noreferrer">Cauchy's integral formula</a> we know $\lvert c_n \rvert \le \frac {\max_{\lvert z \rvert = r} \vert f(z) \rvert} {r^n}$, the only case in which the inequality becomes equality I think is when $\lvert f(z) \rvert$ is constant along $\lvert z \rvert = r$. Then I tried to <a href="https://math.stackexchange.com/questions/2455436/if-lvert-fz-rvert-remains-constant-along-a-circle-lvert-z-rvert-r-t">deduce the form from here</a>, but failed.</p>
0non-cybersec
Stackexchange
385
972
Proposition 3.10 from Conway&#39;s book. <blockquote> <p><strong>Definition:</strong> If <span class="math-container">$z_1\in \mathbb{C}_{\infty}$</span> then <span class="math-container">$(z_1,z_2,z_3,z_4)$</span> (the <em>cross ratio</em> of <span class="math-container">$z_1,z_2,z_3$</span> and <span class="math-container">$z_4$</span>) is the image of <span class="math-container">$z_1$</span> under the unique Mobius transformation which takes <span class="math-container">$z_2$</span> to <span class="math-container">$1$</span>, <span class="math-container">$z_3$</span> to <span class="math-container">$0$</span> and <span class="math-container">$z_4$</span> to <span class="math-container">$\infty$</span>.</p> <p><strong>Proposition:</strong> Let <span class="math-container">$z_1,z_2,z_3,z_4$</span> be four distinct points on <span class="math-container">$\mathbb{C}_{\infty}$</span>. Then <span class="math-container">$(z_1,z_2,z_3,z_4)$</span> is a real number <em>iff</em> all four points lie on a circle.</p> <p><em>Proof:</em> Let <span class="math-container">$S:\mathbb{C}_{\infty}\to \mathbb{C}_{\infty}$</span> be defined by <span class="math-container">$Sz=(z,z_2,z_3,z_4) $</span>; then <span class="math-container">$S^{-1}(\mathbb{R})=$</span>the set of <span class="math-container">$z$</span> such that <span class="math-container">$(z,z_2,z_3,z_4)$</span> is real. So it is enough to show that the image of <span class="math-container">$\mathbb{R}_{\infty}$</span> under a Mobius transformation is a circle.</p> </blockquote> <p>This is the excerpt from Conway's book on Complex Analysis of one variable.</p> <p>Can anyone please explain why it is enough to show that <span class="math-container">$S(\mathbb{R}_{\infty})=\Gamma$</span> - circle? I have spent about one hour trying to understand it and write down something but I failed to understand it.</p> <p>Would be very grateful for detailed help, please!</p>
0non-cybersec
Stackexchange
681
1,968
dexexception: not support version. <p>I was trying to convert apk to source code. When I entered below command </p> <pre><code>./d2j-dex2jar.sh classes.dex </code></pre> <p>I got this exception:</p> <pre><code>com.googlecode.d2j.DexException: not support version. at com.googlecode.d2j.reader.DexFileReader.&lt;init&gt;(DexFileReader.java:151) at com.googlecode.d2j.reader.DexFileReader.&lt;init&gt;(DexFileReader.java:211) at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:104) at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288) at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32) </code></pre> <p>Version of my apk is Oreo and dexcompiler is dex2jar-2.0. As much as I Know this dexcompiler supports upto N version (correct me if I am wrong). I have searched about this exception, but I didn't find any answers.</p> <p>Please help me to resolve this exception</p>
0non-cybersec
Stackexchange
337
924
java.lang.IllegalArgumentException: already added Lokio/AsyncTimeout. <p>I am trying to get the MapBox component working in my Xamarin app.</p> <p>At first I was just referencing a mapbox.dll in my references in my Android project. Using that method, the app would crash when trying to inflate a layout containing mapbox.</p> <p>I dereferenced the mapbox.dll and added the mapbox component to my Android project in hopes that it will fix my problem. However, at compile time I am now getting this error:</p> <pre><code>/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: java.lang.IllegalArgumentException: already added : Lokio/AsyncTimeout; (IM.Droid) </code></pre> <p>I have dereferenced the previous mapbox.dll, deleted it, cleaned, deleted all the obj and bin directories... still getting the same error.</p> <p>Any help would be appreciated.</p>
0non-cybersec
Stackexchange
253
912
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
Help with vegetarian meal planning! Please!. Hi all, I became vegetarian in October last year and have been living off mostly pre prepared vege burgers, pies and nuggets and inbred some help in getting some healthier options. I’m not a fan of quorn chicken or any meat substitutes as the texture isn’t appealing but I need some ideas for lower calorie meals to be able to prep 2-4 days in advance that can carry in a Tupperware for work as I’m wanting to lose weight. I’m working out but obviously you can’t out train a bad diet ☹️ Thanks in advance!
0non-cybersec
Reddit
143
555
Independence of order of insertion hashtable with open addressing. <p>I'm taking a data-structure class, and the lecturer made the following assertion:</p> <blockquote> <p>the number of attempts needed to insert n keys in a hash table with linear probing is independent of their order.</p> </blockquote> <p>No proof was given, so I tried to get one myself. However, I'm stuck.</p> <p>My approach at the moment: I try to show that if I swap two adjacent keys the number of attempts doesn't change. I get the idea behind it, and I think it's going in the right direction, but I can't manage to make it into a rigorous proof.</p> <p>Aside, does this fact also hold for other probing techniques such as quadratic or double hashing?</p>
0non-cybersec
Stackexchange
195
738
Why should ViewModel route actions to Controller when using the MVCVM pattern?. <p>When reading examples across the Internet (including the MSDN reference) I have found that code examples are all doing the following type of thing:</p> <pre><code>public class FooViewModel : BaseViewModel { public FooViewModel(FooController controller) { Controller = controller; } protected FooController Controller { get; private set; } public void PerformSuperAction() { // This just routes action to controller... Controller.SuperAction(); } ... } </code></pre> <p>and then for the view:</p> <pre><code>public class FooView : BaseView { ... private void OnSuperButtonClicked() { ViewModel.PerformSuperAction(); } } </code></pre> <p>Why do we not just do the following?</p> <pre><code>public class FooView : BaseView { ... private void OnSuperButtonClicked() { ViewModel.Controller.SuperAction(); // or, even just use a shortcut property: Controller.SuperAction(); } } </code></pre>
0non-cybersec
Stackexchange
288
1,083
Best practice to recover an CRUD statement to a linked server if connection is lost. <p>I am looking for the best practice for the following scenario.</p> <p>We have a CRM in our company. When an employee updates the record of a company, there is trigger that fires a stored procedure which has a CRUD statement to the linked server hosting the SQL DB of our website.</p> <hr> <p>Question:</p> <p>What happens when the connection is lost in the middle of the CRUD and the SQL DB of the website did not get updated? <strong>What would be the best way to have the SQL statement processed again when the connection is back?</strong></p> <p>I read about Service Broker or Transactional Replication. Is one of these more appropriate for that situation?</p> <hr> <p>The configuration:</p> <p>Local: SQL server 2008 R2</p> <p>Website: SQL server 2008</p>
0non-cybersec
Stackexchange
234
857
How can I get the sender email address using Outlook.MailItem in VB.NET?. <p>I have tried using <code>mailItem.SenderEmailAddress</code> and <code>mailItem.Sender.Address</code> but they both return a string that looks like this: </p> <p><code>/O=DOMAINNAME/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHI43SPCLT)/CN=RECIPIENTS/CN=JOE BLOGGS8C3</code></p> <p>Where in reality I want <code>[email protected]</code> to be retrurned.</p> <p>Anyone have any ideas?</p> <p>Thank you very much.</p> <p>Edit: I have done some digging; it works perfectly for email addresses of the 'SenderEmailType' SMTP, it just doesn't work for Exchange email addresses.</p> <p>Edit 2: I have tried the code specified <a href="http://forums.codeguru.com/showthread.php?441008-Extract-sender-s-email-address-from-an-Exchange-email" rel="noreferrer">here</a>, but I assume it is outdated because it throws a "Cannot create Active-X component" error.</p> <p><strong><em>EDIT 3:</em></strong> For anyone who ever has the same problem as me, I found the answer (in C#, converted to VB.NET, still works though):</p> <pre><code>Private Function GetSenderSMTPAddress(mail As Outlook.MailItem) As String Dim PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E" If mail Is Nothing Then Throw New ArgumentNullException() End If If mail.SenderEmailType = "EX" Then Dim sender As Outlook.AddressEntry = mail.Sender If sender IsNot Nothing Then 'Now we have an AddressEntry representing the Sender If sender.AddressEntryUserType = Outlook.OlAddressEntryUserType.olExchangeUserAddressEntry OrElse sender.AddressEntryUserType = Outlook.OlAddressEntryUserType.olExchangeRemoteUserAddressEntry Then 'Use the ExchangeUser object PrimarySMTPAddress Dim exchUser As Outlook.ExchangeUser = sender.GetExchangeUser() If exchUser IsNot Nothing Then Return exchUser.PrimarySmtpAddress Else Return Nothing End If Else Return TryCast(sender.PropertyAccessor.GetProperty(PR_SMTP_ADDRESS), String) End If Else Return Nothing End If Else Return mail.SenderEmailAddress End If End Function </code></pre>
0non-cybersec
Stackexchange
662
2,360
Local Computer drives are not visible when creating backup through wizard. <p>When I connect to a database on a remote server through SSMS running on my own computer and I follow the backup wizard for a database, none of my local computer drives are listed. All I can see are drives on the remote server and I can't get access to them since I do not have enough permissions.</p> <p>It seems weird, why I can't see my own computer drive volumes when creating a backup file?</p> <p>Here's what I do:</p> <p>On <code>Object Explorer</code>, right click on database then click on <code>Tasks &gt; Backup</code>, <code>Add &gt; ...</code></p> <p>Part of error message: <code>Can not access the specified path on server</code>.</p>
0non-cybersec
Stackexchange
197
730
Gauss formulas to decompose a prime in the sum of two squares. <p>I am looking for a demonstration of the formulas to decompose a prime $p\equiv 1$ $mod$ $4$ in the sum of two squares, cited in H. Davenport, The Higher Arithmetic. I have not found anything on the web. Thank you.</p> <p>If $p=4k+1$ , with $p$ prime,</p> <p>$p=x^2 + y^2$ , with</p> <p>$x\equiv\frac{(2k)!}{2(k!)^2}$ $mod$ $p$</p> <p>$y\equiv(2k)! x$ $mod$ $p$</p> <p>and</p> <p>$x &lt; \frac{p}{2},y &lt; \frac{p}{2}$</p>
0non-cybersec
Stackexchange
219
496
Which convergence test should be used for this series?. <p>The series is, $$\sum \limits_{n = 1}^\infty \frac{ \ln(1 + \frac{5}{n})}{\sqrt [3] {n+1}}.$$</p> <p>Using the asymptotic equivalence concept I came up with,</p> <p>$$\frac{ \ln(1 + \frac{5}{n})}{\sqrt [3] {n+1}} \sim \frac{ \ln(\frac{1}{n})}{\sqrt [3]{n}} (n \to \infty)$$</p> <p>But now, I can't figure out what test to use. I have tried the comparation test and the limit comparation test and I couldn't do it. Can you give me a hint? Thanks.</p>
0non-cybersec
Stackexchange
186
512
Best way to talk/not talk about miserable happenings over last few years to people?. Hi there, looking for some advice to this general issue. First a lot of background: In my life I started off very shy, not being vulnerable, mostly image oriented. Directly related to my upbringing where my parents meant well & wanted 'the best' for me, but this meant high pressure, some physical abuse but mainly emotional abuse and an unacceptance of me as I am, always expecting. Under this paradigm I wasn't the most social, but over time things open up, and one thing that gave me social confidence was that I was getting good grades & expected myself to do well for myself professionally. So this professional path changed when I was in graduate school & saw it wasn't actually for me after 2 years. I wasn't worried, I had good marks in undergrad, I could go in a different direction. There was stress behind the career confusion, as well as stress from an ending but lingering controlling relationship by my gf. Both factors weakened me, but I still felt strongly in my principles, still felt like myself, still felt like I could rationalize even though my thinking was a bit affected, and felt like I could survive the onslaught of moving back home & deciding my next schooling & how to apply & whatnot. It didn't really work like that when I moved home, even though I had some strength early on, the weakened state from the bad relationship, with no time to heal, and a home that pushed paranoia and fear, did eventually get to me & weaken me as a person. I was there for almost two years, working and 'trying to decide', but really being distracted by the abuse & having my mental state & confidence disintegrate. A lot of my life growing up was unlearning that process & learning a loving process that worked for someone sensitive like me. Moving back home brought back a lot of the negativity again, as well as actual abuse that accumulated stress that led to some mental weaknesses. I lost my ability to communicate my philosophical ideas with people, I would try but I would no longer have the same eloquance as before, the abuse changed my communications, life was no longer coherent like it once was. A lot of my beliefs were shifted, blah blah blah. Anyways I did eventually make myself move out to allow myself to recover, applied to a different grad school, and am there now. It's been a lot of processing emotions and building a new process, the old positive one is dead unfortunately, even after trying to revive those patterns, I just can't believe in the absolute goodness of all humans anymore. However I like my process, I think it's been refined & brings me some clarity & coherance again, and my mental incapacities have mostly been healed, and at some level i'm able to verbalize myself. So my concern is that now I'm 27, and when I am getting to know someone new, I don't really know how to deliver my life story ( if they're curious in it that is). I feel at 27, in the eyes of someone else, I 'should' be somewhere else with my life. I feel maybe some people can see me as a 'fuck up' , but I don't believe it knowing the lessons I learned, and the confusion of all that abuse at that time, and im proud that I got out of it, I feel good towards myself in general about it. But it's so hard to reach that understanding with people, and I don't even know if that's something I should aim for when I first meet them. Should I keep the misery aside? Should I continue to process it on my own & invest in more of the joys of my life, so that that's what I discuss with new people? I'm not looking necessarily for a one-size-fits-all approach, but I'd appreciate some perspectives of how I can approach this. There's the inner feeling of others seeing me as a mess-up for being 27 and still not officially starting my career since I'm in school, yet internally I know I've grown and now that I have hope for life again all the pain from the past may have some meaning in the learning I've done. I don't know, I guess I'm afraid of people judging me, I want to be honest with them, and I want to be understood, at the same time I don't want to be pushing people away with misery. I don't actually like to discuss miserable topics, but in this case it helps clear up why im in the position I am, I guess. What do you think?
0non-cybersec
Reddit
965
4,340
multi-part numbers and units in siunitx. <p>I'm trying to type set something like this "4 x 5 x 6 mm^2". the following command using <em>siunitx</em> package does not generate what I wanted. </p> <pre><code>\SI{4 x 5 x 6}{mm^3} </code></pre> <p>Instead, it produces “4 mm^3 x 5 mm^3 x 6 mm^3". How do we correct this? </p> <p>Thanks.</p>
0non-cybersec
Stackexchange
128
341
My brother [29M] wants me [20F] to pick him up from an airport 5 hours away. I don’t want to. Am I being unreasonable?. The dates for our family reunion has been set since February. My brother hasn’t even looked at flights until last week despite nagging from my parents and other relatives. The flights have obviously gone up significantly in price, but he was able to find one landing 5 hours away for $200 less than what he would pay just flying into our town. He now wants me to drive him to and from the airport both ways. I’m annoyed because I feel like he’s asking me to bear the burden of his negligence in booking his flights. Am I being unfair? How do I tell him I don’t want to do this without putting a strain on our relationship right before the reunion? **TL;DR my brother was late booking flights and wants me to pick him up and drop him off at an airport 5 hours away so he can save some money. What do?** EDIT: Thank you everyone, I didn’t even realize that would add up to 20 hours driving even without accounting for gas, mileage on my car and all that. I didn’t even consider what times his flight might land — probably times that are not so ideal since he’ll be choosing the cheapest options. He is being even more ridiculous than I initially thought. I will try to find a way to (nicely?) tell him to shove it.
0non-cybersec
Reddit
313
1,334
Spring Boot Rest Controller how to return different HTTP status codes?. <p>I am using Spring Boot for a simple REST API and would like to return a correct HTTP statuscode if something fails.</p> <pre><code>@RequestMapping(value="/rawdata/", method = RequestMethod.PUT) @ResponseBody @ResponseStatus( HttpStatus.OK ) public RestModel create(@RequestBody String data) { // code ommitted.. // how do i return a correct status code if something fails? } </code></pre> <p>Being new to Spring and Spring Boot, the basic question is how do i return different status codes when something is ok or fails?</p>
0non-cybersec
Stackexchange
159
610
Python dictionary comprehension very slow. <p>I have a dictionary <code>d1</code> and a list <code>l1</code>.</p> <p>The dictionary keys are strings, and the values are Objects I have defined myself. If it helps, I can describe the Object in more detail but for now, the objects have a list attribute <code>names</code>, and some of the elements of <code>name</code> may or may not appear in <code>l1</code>. </p> <p>What I wanted to do was to throw away any element of the dictionary <code>d1</code>, in which the <code>name</code> attribute of the object in said element does not contain any of the elements that appear in <code>l1</code>.</p> <p>As a trivial example:</p> <pre><code>l1 = ['cat', 'dog', 'mouse', 'horse', 'elephant', 'zebra', 'lion', 'snake', 'fly'] d1 = {'1':['dog', 'mouse', 'horse','orange', 'lemon'], '2':['apple', 'pear','cat', 'mouse', 'horse'], '3':['kiwi', 'lime','cat', 'dog', 'mouse'], '4':['carrot','potato','cat', 'dog', 'horse'], '5':['chair', 'table', 'knife']} </code></pre> <p>so the resulting dictionary will be more or less the same but the elements of each list will be the key-value pairs from <code>1</code> to <code>4</code> excluding the fruit and vegetables, and will not contain a 5th key-value par as none of the furniture values appear in <code>l1</code>.</p> <p>To do this I used a nested list/dictionary comprehension which looked like this:</p> <pre><code>d2 = {k: [a for a in l1 if a in d1[k]] for k in d1.keys()} print(d2) &gt;&gt;&gt;&gt;{'1': ['dog', 'mouse', 'horse'], '3': ['cat', 'dog', 'mouse'], '2': ['cat', 'mouse', 'horse'], '5': [], '4': ['cat', 'dog', 'horse']} d2 = {k: v for k,v in d2.iteritems() if len(v)&gt;0} print(d2) &gt;&gt;&gt;&gt;{'1': ['dog', 'mouse', 'horse'], '3': ['cat', 'dog', 'mouse'], '2': ['cat', 'mouse', 'horse'], '4': ['cat', 'dog', 'horse'],} </code></pre> <p>This seems to work, but for big dictionaries, 7000+ items, it takes around 20 seconds to work through. In and of itself, not horrible, but I need to do this inside a loop that will iterate 10,000 times, so currently it's not feasible. Any suggestions on how to do this quickly?</p>
0non-cybersec
Stackexchange
744
2,217
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
Compiling external C++ library for use with iOS project. <p>I'm completely new to using C++ libraries, so appreciate this might be a bit specific for my case (let me know and I can provide more details). </p> <p>I have an external C++ library that I'm trying to use with an iOS project. The library follows a configure, make, make build pattern to output a .a library file. When I try and add this library file to Xcode, I get the following error:</p> <blockquote> <p>ignoring file /Users/Developer/iOS/TestProj/libpresage.a, file was built for archive which is not the architecture being linked (i386):</p> <p>/Users/Developer/iOS/TestProj/libpresage.a</p> </blockquote> <p>Based on <a href="https://stackoverflow.com/questions/24669336/librestkit-a-file-was-built-for-archive-which-is-not-the-architecture-being-li">this question</a>, I've tried turning Build Active Architecture Only to NO, and I get the same error. This makes me suspect that I've compiled the library for the incorrect architecture. </p> <p>Running lipo -info on the .a file gives: </p> <blockquote> <p>input file libpresage.a is not a fat file Non-fat file: libpresage.a</p> <p>is architecture: x86_64</p> </blockquote> <p>Given that this isn't armv7s, armv7, or arm64, I try and compile the C++ library again with the following parameters:</p> <p><strong>1)</strong> Try </p> <pre><code>./configure CC="gcc -arch armv7s" \ CXX="g++ -arch armv7s" \ CPP="gcc -E" CXXCPP="g++ -E" </code></pre> <p>Error in compiling, I get:</p> <pre><code>ld: library not found for -lcrt1.3.1.o clang: error: linker command failed with exit code 1 (use -v to see invocation) </code></pre> <p><strong>2)</strong> Try </p> <pre><code>./configure CC="gcc -arch arm64" \ CXX="g++ -arch arm64" \ CPP="gcc -E" CXXCPP="g++ -E" </code></pre> <p>Error in compiling, I get:</p> <blockquote> <p>ld: warning: ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libSystem.dylib, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libSystem.dylib (2 slices)ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libstdc++.dylib, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libstdc++.dylib (2 slices)</p> <p>ld: dynamic main executables must link with libSystem.dylib for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)</p> </blockquote> <p>Is there something obvious that I'm missing?</p> <p><strong>EDIT:</strong></p> <p>Thanks for the replies, so I've managed to get the library into Xcode as a custom build target, pointing the 'make' command to the libraries MakeFile. This build fine.</p> <p>My steps from here:</p> <ul> <li>Add a dependency from my Objective C iOS app target to the custom build target.</li> <li>Reference the library and make an Objective C++ wrapper. </li> <li>This seems fine until I need to call the external C++ library, then I get the error when compiling:</li> </ul> <blockquote> <p>Undefined symbols for architecture armv7: "Presage::Presage(PresageCallback*)", referenced from: -[PresageBridge init] in PresageBridge.o "Presage::~Presage()", referenced from: -[PresageBridge init] in PresageBridge.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)</p> </blockquote> <ul> <li><p>My objective C++ wrapper (linking the external C++ library header presage.h):</p> <pre><code>#import "PresageBridge.h" #include "presage.h" @implementation PresageBridge - (instancetype)init { if(self = [super init]) { Presage hello(&amp;callback); } return self; } </code></pre></li> <li><p>Based on the code above it doesn't seem like I'm missing the header, and what's interesting is that I've also tried creating an instance of other classes in the external library and they seem to be working, which suggests that Xcode can't link presage.h properly for some reason. </p></li> </ul>
0non-cybersec
Stackexchange
1,416
4,415
I don't know if this is right place, I'm anxious about where I am in life socially and I really just want some honest responses.. Alright, basically I'm extremely depressed and have a lot on my mind and I just want somebody to tell me what they think about it. So my entire life has been a disaster. I am 23 and yet feel like I'm about 10 emotionally and I probably come off that way. I spent my entire school years an outcast and victim of terrible bullying, and I've been majorly depressed for basically me entire life. I've never had anyone in my life who I'd really describe as a friend, its more like I had some bullies who would bring me along to bully after school and I was too afraid of loneliness to refuse them. I played football to try to earn a little respect from people, but I was the worst on the team and they basically just used it as an excuse to beat me up. Even the coaches would mock me to my face in front of everyone. Even though I've always had top test scores and my teachers always seemed to think I was some kind of genius, I failed every class in high school because by that time I was unable to motivate myself to do even the simplest homework. I always ended up with zeroes on every assignment but A's on the tests but they kept promoting me anyway. I became a pothead and alcoholic when I was 17 and I've been smoking and drinking away the pain every day ever since. When I was about to graduate high school my "friends" got caught with paintball guns they'd been vandalizing the town with and they blamed it on me even though I wasn't with them, and so I got charged. My dad made a deal with the court that if I left the country for 6 months they would drop the charges, and sent me to work at one of his outsourcing centers in China. The highschool gave me a diploma even though I left 3 months early, but they didn't read my name at graduation. To all those people who I'd spent my whole life trying to impress, all those girls I'd always been desperate to like me, it was like I didn't exist. Everyone I knew went to college, some went to Ivy Leagues and some went to party schools where they had even more exciting lives I was jealous of, while I spent months at a time crying alone in my apartment drinking constantly. I never really went to work at the outsourcing center, they hardly spoke english and I had nothing to contribute. I kept begging to come home but my Dad would only let me if I had a job or got in to a college. I couldn't muster the will to fill out a college application for 2 entire years, which I spent with hardly any human contact and never sober. Then when I was 21 I started university, and failed out at the end of the year. The whole time I didn't make a single friend, the only people I ever interacted with were drug dealers. I drank alone every night, trying to get myself to do work or make friends or find a girl to talk to, convinced that if I drank more I'd have the confidence to, but I never did. After that I'd already missed all the deadlines to apply anywhere for the next semester so I applied for the one after that. The next 8 months I spent lying in bed at home alone, staying up all night drinking and smoking and sleeping all day. I got a job at a restaurant early on, but got fired after 2 weeks because "being a restaurant host is a girls job". I couldn't bring myself to get another job after that. Finally it came time to start college again, and I ended up doing even worse, I failed every class, made no friends, met no girls, and now I was 22 lying to everyone about my age. I was desperate to be one of the cool fraternity kids but they all laughed at me just like everyone in high school had. Now I've been kicked out of there to. So now I've just turned 23 and I have no degree and hardly any credits, no experience, no skills, no friends, I'm a virgin, I'm an alcoholic and a weed addict, I'm depressed and have such low self esteem I can't even look anyone in the eyes, I can hardly speak coherently anymore and I talk to myself constantly from being completely alone for the majority the last 4 years. I'm so weak I'm practically atrophied. I have no plans, no future, nothing to live for at all. I'm more pathetic than I've ever been. And I still long for a social life so desperately, I want to fit in, to be included, to be respected, to have friends who like me and are proud of me and a girlfriend who loves me. And I'm at the point where I've felt exactly the same way for 13 years and have come no closer to it, and I am completely hopeless. Obviously writing that has just been a huge act of self-pity, which I know is revolting. I have so little social experience to compare myself to so basically I just want you to tell me what you think of me, how you would feel if you were me, and what I should do. Thank you.
0non-cybersec
Reddit
1,108
4,835
Anal Beads. I am a heterosexual man interested in anal, and I was wondering the difference in feelings from anal beads. I have a plug, but I want to get some beads to try them out. There is the kind that is on a string, and there is the kind that is like a dildo almost, but is slender and has the balls on it, essentially like the other kind, but all of it is made of the same material. I assumed that the kind w/ the string would just bunch up inside you, and I was wondering if the other kind is better because it wouldn't bunch up together and go deeper inside of you. Are there pros/cons to both? Thanks for your help, long time reddit member, but made a new account because it is embarrassing for me.
0non-cybersec
Reddit
168
708
How to display french accent in a beamer table?. <p>I have a table in french, it is correctly displayed with latex, but when I put it in beamer it does not display the accent, for example république in the first line</p> <pre><code>\documentclass[12pt]{beamer} \usepackage[frenchb]{babel} \usepackage{pdfpages} \usepackage{polyglossia} \setmainlanguage{french} \begin{document} \begin{frame}\frametitle{Extraction de CF bilingues} \begin{itemize} \begin{table} \caption{Exemple de CF en Italien et en Français} \centering \scriptsize \begin{tabular}{|c|c|} \hline CF_{it} &amp;CF_{fr} \\ \hline \left\{repubblica\right\}, \left\{7, 22,..., 48972\right\}&amp; \left\{ r\'{e} publique\right\}, \left\{6 98,..., 42558\right\}\\ \left\{regina, londra\right\}, \left\{36, 180,..., 48762\right\}&amp; \left\{reine, londres\right\}, \left\{785, 1368,..., 42572\right\}\\ \left\{dibattito\_politico\right\}, \left\{554, 1299,..., 48764\right\}&amp; \left\{débat\_politique\right\}, \left\{222, 995,..., 37942\right\}\\ \hline \hline \end{tabular} \label{tab\string:CC} \end{table} \end{frame} \end{document} </code></pre> <p>How can I show the accentuated character, the problem is caused by the { character</p>
0non-cybersec
Stackexchange
448
1,225
Visual Studio 2015 JavaScript debugging doesn&#39;t catch unhandled exceptions when &#39;Just my code&#39; is enabled. <p>Since the entire team has upgraded to Visual Studio 2015, the debugger no longer breaks on unhandled exceptions in JavaScript. However 1 of the 4 machines works fine and we're guessing this is because it's on IE10 and the rest of us are on IE11. </p> <p>Anyway, to cover the obvious stuff:</p> <ul> <li><p>All settings are identical between all machines, including the mycode.default.wwa.json in the JavaScript > JustMyCode folder in the Visual Studio 2015 installation directory</p></li> <li><p>The default settings on the new Exception Settings window match the Exception settings in the old modal window from 2012</p></li> </ul> <p>So to reproduce the problem, we just write any old bit of dodgy code in an external JS file (note that script blocks on the page itself are caught correctly):</p> <p>ViewModel.js:</p> <pre><code>function something() { foo(); } something(); </code></pre> <p>When JustMyCode is enabled, foo() will not be caught as an unhandled exception by the debugger. As soon as JustMyCode is disabled, the exception will be caught fine. So yeah, we can workaround this problem, but as soon as that's disabled, we lose actual .Net debugging.</p> <p>Has anyone experienced this problem and/or found a solution? I've tried adding *.js to the MyCode section inside of the mycode.default.wwa.json file and I've also <a href="https://connect.microsoft.com/VisualStudio/feedback/details/1743347/javascript-debugger-not-catching-unhandled-exceptions-in-external-js-files-when-just-my-code-is-enabled" rel="nofollow">logged a bug on Connect</a>, but I don't expect a fast answer from Microsoft on the matter.</p> <p><strong>Edit</strong>: So this only seems to happen when there's a query string on the end of the JS file, e.g. site.js?V=1234. If you remove the query string then the debugger catches exceptions as it did in Visual Studio 2012. Submitted a new repro and demo project to Microsoft.</p>
0non-cybersec
Stackexchange
556
2,047
file /dev/adm taking too much space disk. <p>I'm the admin of a VPS, and I saw that 65GB over my 100GB are taken by a file in /dev/adm</p> <p>I used "df -h" to see my disk space left, and make "du -h" in / folder. I found that this file "/dev/adm" is taking all the space. What is this file? Can I safely remove it? or Purge it?</p> <p>I'm on Debian 7.</p> <p>Thank you for your answers.</p> <p><strong>EDIT</strong> : /dev/adm is not a folder, it's a file.</p>
0non-cybersec
Stackexchange
169
466
Hadoop (HDFS) - file versioning. <p>At the given time I have user file system in my application (apache CMIS). As it's growing bigger, I'm doubting to move to hadoop (HDFS) as we need to run some statistics on it as well. The problem: The current file system provides versioning of the files. When I read about hadoop - HDFS- and file versioning, I found most of the time that I have to write this (versioning) layer myself. Is there already something available to manage versioning of files in HDFS or do I really have to write it myself (don't want to reinvent the hot water, but don't find a proper solution either).</p> <p><strong>Answer</strong></p> <p><em>For full details: see comments on answer(s) below</em></p> <p>Hadoop (HDFS) doesn't support versioning of files. You can get this functionality when you combine hadoop with (amazon) S3: Hadoop will use S3 as the filesystem (without chuncks, but recovery will be provided by S3). This solution comes with the versioning of files that S3 provides. Hadoop will still use YARN for the distributed processing.</p>
0non-cybersec
Stackexchange
291
1,074
How to Install the app twice without interference in android?. <p>I have an Android app (let's called X), I want to create a second app X2 but based on the other app. So I changed the manifest application name property to X2 also I changed the package name...but still when I install X2, app X is erased!</p> <p>What properties should I change so I can install the two app independently on one devices. I'm working on eclispe.</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.app1" android:versionCode="1" android:versionName="1.0" &gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name1" android:theme="@style/AppTheme" &gt; </code></pre> <p>after change.</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.app2" android:versionCode="1" android:versionName="1.0" &gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name2" android:theme="@style/AppTheme" &gt; </code></pre>
0non-cybersec
Stackexchange
365
1,182
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
Declare acronyms and abbreviations to automatically correct spaces after periods?. <p>If I understand correctly, (La)TeX assumes that a period after a lower-case letter ends a sentence while a period after an upper-case letter does not. Unfortunately, my documents usually contain plenty of acronyms and abbreviations. Unless I remember to use <code>\@</code>, the spacing after periods is wrong:</p> <pre><code>\documentclass[convert={density=150},varwidth]{standalone} \begin{document} \noindent \makebox[0.7in][l]{Incorrect:}% Your computer needs more RAM. I can give you some.\\ \makebox[0.7in][l]{Correct:}% Your computer needs more RAM\@. I can give you some.\\ \makebox[0.7in][l]{Incorrect:}% Colors (red, blue, etc.) are nice.\\ \makebox[0.7in][l]{Correct:}% Colors (red, blue, etc.\@) are nice. \end{document} </code></pre> <p><img src="https://i.stack.imgur.com/pw1Bq.png" alt="rendering of the above document"></p> <p>Is it possible to declare certain strings to be acronyms or abbreviations to invert this assumption? If so, this would reduce the number of spacing errors in my documents.</p> <p>For example:</p> <pre><code>\documentclass[convert={density=150},varwidth]{standalone} \usepackage{magicalacronymhelper} \declareacronym{RAM} \declareabbr{etc} \begin{document} \noindent \makebox[0.7in][l]{Correct:}% Your computer needs more RAM. I can give you some.\\ \makebox[0.7in][l]{Correct:}% Your computer needs more RAM\@. I can give you some.\\ \makebox[0.7in][l]{Correct:}% Colors (red, blue, etc.) are nice.\\ \makebox[0.7in][l]{Correct:}% Colors (red, blue, etc.\@) are nice. \end{document} </code></pre> <p><img src="https://i.stack.imgur.com/oJpmT.png" alt="enter image description here"></p>
0non-cybersec
Stackexchange
575
1,729
Constructor overloading or allow null?. <p>Which is the preferred design to use, one constructor that allows null, or two constructors where one throws an <code>ArgumentNullException</code> on null?</p> <h1>Two constructors with exception throwing</h1> <pre><code>public class Foo { private IDictionary&lt;string, string&gt; _bar; public Foo() { _bar = new Dictionary&lt;string, string&gt;(); } public Foo(IDictionary&lt;string, string&gt; bar) { if (bar == null) { throw new ArgumentNullException(); } _bar = bar; } } </code></pre> <h1>One constructor that handles null</h1> <pre><code>public class Foo { private IDictionary&lt;string, string&gt; _bar; public Foo(IDictionary&lt;string, string&gt; bar = null) { if (bar == null) { _bar = new Dictionary&lt;string, string&gt;(); } else { _bar = bar; } } } </code></pre>
0non-cybersec
Stackexchange
297
943
Shadowland character customization wishlist. Before anything, I do want to say that english is not my native language so sorry if I make any mistakes. So, with all datamining and hype of character creation, I have seen many ideas of what we may get or not, I would admit I'm still VERY excited for what else it may come so as a way to vent out and make some discussion I decided to make this list. Mostly to see what others expect and make some conversation as we all wait twiddling with our thumbs. Now, a few notes to mention before I start the list. 1. Even thou I do try to follow some of the logic of what we may have seen I do not claim that my criteria is flawless. 2. While what I would want the most would be body variations, I would not mention it in the list as everything would be based on the options we have seen so far, so even I do wish for less buff males I would not add them as everything I would add would be based on stuff we have seen. 3. While is pretty much confirmed allied races will get something with the elf eyes post, I would assume blizz would focus on the main races first and either add less to the allied ones or add their options mid expansion, so I will focus on the non allied options. 4. Speaking of allied races, I will try to avoid giving options to classic races from the allied ones, I could refer similar stuff from one but I will try to add new ones. 5. Assume that even for the stuff we got I would always ask "more of it" as having more options is always nice. So no need to say "more hair options" in every section. Ok, lets go. &#x200B; **Human** Honestly, I wouldn't ask anything for humans, not because I think they don't need anything but because of what we have seen, is clear they're getting a lot of stuff. Humans are the most played race in alliance and with the idea of adding race diversity I do assume we will get a lot for humans. If there's anything specific I would ask for them but also for almost any race, it would be skin options to make your character be buff or soft, I do find eerie being a human mage and having biceps so big you can see the vein, same with women when they're suppose to be as strong as male characters but doesn't have abs or anything. &#x200B; **Orc** My mayor struggle in finding options for the orcs is trying to come up with options that don't apply on the mag'ar, of course stuff like jewelry and accessories could be used, I also considered the option of giving male orc mustaches but then I wonder, can they grow a mustache? Seriously, do orcs have the ability to grow hair over the upper lip? Well, blizz could decide they do and add that. A mayor idea that come up could be using the themes of other clans in their options, just like the mag'ar skin options are based on Draenor clans, maybe the orc could have options based in clans in Azeroth. Also maybe consider add options for those who look to play as a less fierce orc and more of a wise one, going for the soft skin options for those who go mage or shaman. In specific options, maybe we could go for fangs and teeth, or even jaws if they're willing to go there, making options to give you a bigger or smaller under bite to be more of a brute or less of one. Finally, while I liked the option of straight up orcs, maybe we could get a hunch version for females to make them look more scary. &#x200B; **Dwarf** Like humans, dwarf had been getting some nice options and most of my requests would go in "more please" section. If I had to add specific stuff, that would be maybe the addition of options like nose and eyebrows for more tweaks to the face, I want some bushy eyebrows for my dwarfs. Also, consider the option to give the females facial hair, no need to go as crazy as the males but still, anything that would make them more unique would add to it. &#x200B; **Forsaken** Same as human and dwarf, in fact I'm quite happy how they decided to experiment with stuff like the body horror and adding more options like stitches and bolts. If I had two mayor requests those would be add a bit from both extremes. Some people like the idea of their forsaken look more human, still dead but peaceful, the option to choose how rotten your body is does add a lot but we could play with it by adding some less creepy options, maybe even add some natural facial hair option. In the other side of the coin, there're those who love being a freak so we could add more stuff to look monstrous, maybe something they could do is give a two skins options, like your character has one large stitch cut through his body/head and like he was given the skin of two bodies. And lets not forger, straight up forsakens too, orcs ain't the only one who needed a chiropractor. &#x200B; **Night elf** Everything about soft and buff skin still apply here, but also we could add options thinking in two themes of the elfs, the sentinels and the druids. Currently, night elfs are either hippie nature buddies or angry forest killers getting angsty \*blatantly ignores the charred remains of Teldrassil\*. So maybe go with those option to add variety. For the druids, maybe go with more nature related ideas, earth color and maybe leafs in hair and beards, even going so far to add antlers to some extend. Also, give the male elf a more cheerful face option, most of them look either too serious, angry or constipated. For the sentinel side, take note of the WC3 military unit style, the black eyes of the night warriors and so for, maybe give some hints to the potential dark future of the night elfs. Maybe go for some twigs and leaves accessories for the first idea and some moon shape and angular one for the second. **Taurens** I'll admit I'm bias to taurens cause they're my favorite horde race, but if someone need more options they're the ones. The skin and tribal painting options are nice and we know we will get more horn options but I do think there's more to add. For starters, maybe taurens could get some hair options for the manes in top of their heads, the braids on the side do look cool but it limit the options, maybe add some mohawks or adornments with feathers, flower, stone and similar. Basically, give taurens some actual hair options on their actual head and not just the sides. Also their face options are laughable not only by the amount but by how little they change, if the idea of giving more jaw options to the orc is implemented something similar could be done to the taurens, if not, maybe think on better use of face texture to give more emphasis on nose, lips and/or eyes with the options. One final suggestion could be options to the tail, not only with length and type but also with accessories, some options being more thin, thick, bushy or even attach things like ornaments or a morning star (Saw that concept somewhere and I love it) &#x200B; **Gnome** Oof, ok this is a hard one. Partly because of the small size and also because of any outlandish idea I had it could be applied to the mechagnomes. I think they could add maybe nose and ears options seeing those elements are very prominent in the gnomes head. Maybe consider the idea of colorful tattoos on the face with magical symbols or mechanical themes, something I would find funny would be a tattoo option where is just their face burned with the outline of goggles around their eyes like something exploded in their faces. Still, gnomes due to their small size do need more prominent options that could be seen from afar, so maybe stick with those ideas. &#x200B; **Troll** Welp, another race that have been given a lot of options, so you do know the bulk of it. I have seen someone suggesting stuff like warpaint to match the one of trolls in WC2, I would add of course the jewelry and accessorize options to match the darkspear and the other new clans the race has added with the skin options. I don't know if I do want to ask for straight up males and hunch over females mostly because this troll model is REALLY tall when standing straight, so yeah, opinions here? &#x200B; **Draenei** Some people had sugested the idea of making red draenei but I do think that would be too much lore wise, but again, blizz could say fuck it and go for it. There was the panel where they say draeneis will get various tail options and so for, and to be honest I'm not really into this race so I would like to hear others suggestions. The one option I would add it would be the option to give female draenei the same kind of head crest and horns from the males. I know someone would claim that's a biological difference but hey, blizz make the rules here and I do think females don't get many crazy options with the horns. I guess if there's one request for me it would be go crazy with the alien heads. &#x200B; **Blood elf** Assuming everything we had seen in the datamining is going to be in the game, this race already seen to be getting some good options. The jewelry ideas while a bit much for my taste do fit the style, if I could ask for something extra maybe go for a more lets say corrupted option, like an option where they lose some of their control and had green veins around their eyes or something. Also, they could go even more crazy with the bling with this one too, maybe some golden chains dragging from the ears and some tiaras, heck go nuts. &#x200B; **Worgen** Let males walk straight and females walk hunch over, that one speak for itself. I would say that hairs do suffer similar issues as the taurens so maybe play around it to add something to their manes. Also even thou lore wise worgens don't have tails we could discuss the idea of giving the option. Also in the eye options we could give females more feral options without pupils and males option with pupils. We could also add the idea of unique options for the human form. Granted, that would be dead weight unless they give the option to worgen players to fight in human form, but still, maybe give options similar to what Genn looks in HotS, with prominent fangs, pointy ears and feral eyes. Finally, this is both a race option but also a transmog options, we could add options to the claws, giving them color and shape. But also give worgens to hide one handed weapons so they can claw their enemies to death. &#x200B; **Goblin** Mmmmh, well I guess I could say that most of the things in gnomes apply here due to the small size but also there's the fact we could go for a more clunky and unrefined version of it. I do imagine the idea of make up options being gaudy and too over the top or maybe some colorful tattoos in a trashy way, going for the kind of "classy" style of Gallywyx being that of goblins trying to look refine only to look more ugly. I also like the idea of adding stuff like pieces of jagged metal stuck in the skin or badly stitched scar to show how goblins while smart are not very safe even. Now the two mayor debates here would be gillygoblins and people who don't share my stand on goblins being as ugly as I portray them. In the first case, I'm on the fence, I do think that after the unshackles and all that gillygoblins are members of the horde, but I don't know if they're similar enough to regular goblins to just be a customization option, I mean, gillygoblins can literally breath underwater so maybe that's a deal breaker. As for the second point, well, not gonna claim I'm right but also not gonna claim I'm wrong, I do want to hear what others have to say so yeah, go for it. &#x200B; **Pandaren** Right out of the door, ears and tails are the easiest options to consider, everything else, more of it but also I do think pandaren could use some work to look more disting to each other. One idea is what I stated before for making bodies more soft or buff, granted, pandas do have fur but there could be a way to work around to make a pandaren actually look strong without having to make a massive change in their body. Also for both hair and facial hair we could consider the idea of using the fur rather than putting a wig on their head, maybe give them a mane in some options or some fluff around it, play with the resources to add more to it, even add fur to certain areas like the back of the head or around the limbs, would there be clipping? Sure but I think is better to have the option and let players choose. Also, I would love if there were some customization options exclusive to each side, as in, if you're a pandaren in the alliance or the horde, you get accessories representing either the tushui or the houjin. &#x200B; Oof, ok that was longer than I expected, not sure if everyone out there would take the time to read it but making it was fun, still, would love to read what you guys think, take care and thanks for your time.
0non-cybersec
Reddit
3,060
12,736
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
SQLAlchemy - Querying with DateTime columns to filter by month/day/year. <p>I'm building a Flask website that involves keeping track of payments, and I've run into an issue where I can't really seem to filter one of my db models by date.</p> <p>For instance, if this is what my table looks like:</p> <pre><code>payment_to, amount, due_date (a DateTime object) company A, 3000, 7-20-2018 comapny B, 3000, 7-21-2018 company C, 3000, 8-20-2018 </code></pre> <p>and I want to filter it so that I get all rows that's after July 20th, or all rows that are in August, etc.</p> <p>I can think of a crude, brute-force way to filter all payments and THEN iterate through the list to filter by month/year, but I'd rather stay away from those methods.</p> <p>This is my payment db model:</p> <pre><code>class Payment(db.Model, UserMixin): id = db.Column(db.Integer, unique = True, primary_key = True) payment_to = db.Column(db.String, nullable = False) amount = db.Column(db.Float, nullable = False) due_date = db.Column(db.DateTime, nullable = False, default = datetime.strftime(datetime.today(), "%b %d %Y")) week_of = db.Column(db.String, nullable = False) </code></pre> <p>And this is me attempting to filter <code>Payment</code> by date:</p> <pre><code>Payment.query.filter(Payment.due_date.month == today.month, Payment.due_date.year == today.year, Payment.due_date.day &gt;= today.day).all() </code></pre> <p>where <code>today</code> is simply <code>datetime.today()</code>.</p> <p>I assumed the <code>due_date</code> column would have all DateTime attributes when I call it (e.g. <code>.month</code>), but it seems I was wrong.</p> <p>What is the best way to filter the columns of <code>Payment</code> by date? Thank you for your help.</p>
0non-cybersec
Stackexchange
571
1,770
Restore backup to different filegroup. <p>Using Sql Server 2008R2.</p> <p>I have a backup of a filegroup. Is it possible to restore this to a different file group (possibly even on a different database)?</p> <p>I have tried</p> <pre><code>RESTORE DATABASE my_database FILEGROUP = 'newFileGroup' FROM DISK='C:\restore\backupOfFileGroup.bak' WITH RECOVERY </code></pre> <p>But get the following error:</p> <pre><code>Filegroup 'newFileGroup' cannot be restored because it does not exist in the backup set. </code></pre>
0non-cybersec
Stackexchange
171
533
Definite integral word problem with trig. Check setup?. <p>Find the volume of the solid obtained by rotating the region bounded by the given curves about the specified line. Sketch the region, the solid, and a typical disk or washer.</p> <p>$y = \sin x$, $y = \cos x$, $0 &lt; x &lt; \frac{\pi}{4}$; rotated about the line $y = -1$</p> <p>So...</p> <p>outer radius: $1 + \cos x$</p> <p>inner radius: $1 + \sin x$</p> <p>So here's my setup:</p> <p>$$\pi \int_0^\frac{\pi}{4} (1 + \cos x)^2 - (1 + \sin x)^2 \, dx$$</p> <p>$$\pi \int_0^\frac{\pi}{4} 1 + 2 \cos x + \cos^2x - ( 1 + 2 \sin x + \sin^2 x ) \, dx$$</p> <p>Is this setup right?</p> <p>But then I'm stuck here on the next step:</p> <p>$$\pi \int_0^{\frac{\pi}{4}} (2 \cos x - 2 \sin x + \cos^2 x + \sin^2 x \,) dx$$</p> <p>From here, I need to find the antiderivatives. but what are the antiderivatives of $\cos^2 x$? Also, how do I draw this graph using mathjax?</p>
0non-cybersec
Stackexchange
384
938
feeding time and diet question. My pit terrier can be a picky eater. I feed her raw chicken and vegan dry dog food, the brand slips my mind. I usually alternate days between the raw and dog food. But it's difficult to get her to eat the dog food. She will refuse to eat dog food for the whole day until I get creative with some toppings. This leads to irregular feeding times. It's all a matter of when she is hungry enough to give in and eat the dog food. Should I give her a window of opportunity to eat her dog food and if she refuses, take it away until the next set time for feeding? I usually just leave the food out for her to eat until it's been consumed. How important is having regular feeding times? What do you think of alternating between dry vegan dog food and raw meat as a diet plan? She loves raw chicken. I'm sure the raw food is a common topic on here.
0non-cybersec
Reddit
207
875
Serve static files from directory depending on http referrer inside of nginx. <p>My server hosts images, but the content of images have to be different for the same link and have to deepens on http referrer.</p> <pre><code>For example: Website 1 load image website1.jpg from www.example.com/123123/img.jpg Website 2 load image website2.jpg from www.example.com/123123/img.jpg </code></pre> <p>How can i manage do it using <code>NGINX</code> configuration?</p> <p>UPDATE: I give you guys more details about whole idea:</p> <p>Images loads on the pages:</p> <pre><code>www.not_my_website.com/123123/ www.not_my_website.com/456456/ www.not_my_website.com/686667/ </code></pre> <p>I can't access to this site, but there can be images from my site.</p> <pre><code>&lt;img src="www.example.com/123123/img.jpg"&gt;&lt;/img&gt; </code></pre> <p>I need serve others images with the same htlm code based on page ID www.not_my_website.com/ID/).</p> <p>Thanks for help.</p>
0non-cybersec
Stackexchange
339
984
Does the notion of graph with vertex multiplicity exist?. <p>I need to use graphs where each vertex gets a natural number, $b(v)$, its multiplicity. These numbers indicate how many 'replications' of the vertex we have.</p> <p>It is actually a way to write in a compact way a graph which has a lot of twin vertices: two vertices $u$ and $v$ are twin if $N(u)=N(v)$ (they are not adjacent).</p> <p>Since the twin relation is an equivalence relation, there is a unique way to write any graph in a reduced form as a graph with vertex multiplicities.</p> <p>Here is an example: <img src="https://i.stack.imgur.com/cCRt1.jpg" alt="Here is an example of the reduction"></p> <p>This representation is particularly useful when vertices represent some items with large quantity.</p> <p>Does someone know if such a concept already exists ? What's the usual name ? Do you have some references ?</p>
0non-cybersec
Stackexchange
242
892
How to rename a cocoapod. <p>I have a published Cocoapod, say it's named <code>abc-sdk</code>, I wish to fix its name (capitalization) to <code>Abc-SDK</code>. Is it possible? I tried changing the <code>s.name</code> in the podspec (and the podspec file name capitalization as well) but when I run <code>pod trunk push</code> I get: <code> [!] The following validation failed: - Name is already taken. </code> What's the right way to do it?</p>
0non-cybersec
Stackexchange
145
445
How do I configure WiFi to log in to WPA at boot time, regardless of user being logged in?. <p>How do I set a system wide wireless WPA password that starts at boot time, allowing me to SSH in to the machine from outside, for example?</p> <p>I'm running mythbuntu. Until I log in, WiFi doesn't connect, so I can't use SSH to log in from another computer, for example. When I have auto-login enabled, it asks me to enter my password to unlock my keyring before connecting. I've tried editing the connection and clicking "Available to all users", but then it just doesn't connect at all.</p> <p>How do I go about debugging this problem, or how can I configure it totally manually?</p>
0non-cybersec
Stackexchange
174
684
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
Tikz externalize error when using tikzducks. <p>I am using <code>tikzducks</code> for my footers, simply because I think they are brilliant. Because my document contains lots of other tikzpictures, I want to make use of <code>\tikzexternalize</code>. This works perfectly fine if I do not use the <code>tikzducks</code>. With the <code>tikzducks</code>, the <code>tikzexternalize</code> fails when generating the final duck. A simple solution would be to disable the <code>tikzducks</code>. But yeah... a report without a duck, that's a bridge too far. So could anyone help me out?</p> <p>My MWE (<code>document.tex</code>):</p> <pre><code>\documentclass{article} \usepackage{lipsum} %5 generate lorum ipsum text \usepackage{fancyhdr} %% page headers and footers \usepackage{tikzducks} %% ducks with tikz \pagestyle{fancy} %% set page style \renewcommand*{\headrulewidth}{0.0pt} %% header line width \fancyfoot[C]{\shuffleducks\tikz[scale=0.35]{\duck[signpost={\footnotesize\thepage},\randomhead]}} \usetikzlibrary{external} %% Create pdf figures from TikZ. Use PDFTeXify ... \tikzexternalize[prefix=tikz/] %% ... with --tex-option=--shell-escape switch. \begin{document} \lipsum[1-10] \end{document} </code></pre> <p>I use the following code for compilation:</p> <pre><code>pdflatex.exe -synctex=1 -interaction=nonstopmode -shell-escape "document".tex </code></pre> <p>I get the following error:</p> <pre><code>! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e rror -interaction=batchmode -jobname "tikz/document-figure1" "\def\tikzexternal realjob{document}\input{document}"' did NOT result in a usable output file 'tik z/document-figure1' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the com mand simply failed? Error messages can be found in 'tikz/document-figure1.log'. If you continue now, I'll try to typeset the picture. </code></pre> <p>This is what the log file says:</p> <pre><code>! Package tikz Error: Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize 'tikz/document-figure1', but it seems there i s no such image in the document!? You are currently using 'mode=convert with system call'. This problem can ha ppen if the image (or one of the images preceeding it) was declared inside of a \label{} (i.e. in the .aux file): 'convert with system call' has no access to the main aux file. Possible solutions in this case: (a) Try using 'mode=list and make', (b) Issue the externalization command 'pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "tikz/document-figure1" "\def\tikzexternalreal job{document}\input{document}"' *manually* (also check the preceeding externali zed images, perhaps the file name sequence is not correct). Repeat: the resulting image was EMPTY, your attention is required . </code></pre>
0non-cybersec
Stackexchange
929
3,160
Recurrence substitution method. <p>I just want to see if I did this right. I need to show that $T(n) = 3T(n/4) + n\log n$ shows that $T(n) = O(n\log n)$ using substitution method in recurrence.</p> <p>$$T(n) = 3c(n/4 \log n/4) + n\log n$$ $$c\log nn - cn + n\log n$$ $$n\log n$$ That does not seem right but I followed an example and thats how it turned out. Thanks for any help with this.</p>
0non-cybersec
Stackexchange
152
397
RDP Console / Admin Session. <p>When i connect to Windows 2003 machines i can use the /console switch and essentially get a third remote administration session on the server.</p> <p>This doesn't seem to work on Windows 2008 R2, only 2 sessions are allowed. Has this feature been removed ?</p> <hr> <p>Thanks, but my question isn't about the switch but about the behaviour of Windows 2008 v Windows 2003. Although, it's good to note the switch is releated to the client.</p> <p>Windows 2003 essentially allowed 3 simultaneous connections in remote administration mode if one of them used the console switch.</p> <p>Windows 2008 seems to have removed this as regardless of which switch we use we can only get two users on.</p>
0non-cybersec
Stackexchange
178
730
AdMob orientation problem in Android. <p>My application integrates with <a href="http://en.wikipedia.org/wiki/AdMob" rel="nofollow noreferrer">AdMob</a> ads. When I change the orientation it should fit the screen depending on orientation. In portrait mode it is working fine, but when I changed to landscape mode the ad size I am getting in portrait mode is the same size of the ad displayed in landscape mode.</p> <p>I am adding the following in layout page.</p> <pre><code>&lt;com.admob.android.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" myapp:secondaryTextColor="#CCCCCC" /&gt; </code></pre>
0non-cybersec
Stackexchange
222
742
[Discussion] Companies with lifetime warranties on their products (help make a list). Hey guys, I've been searching around for well made clothes and accessories and I know of a few companies with lifetime warranties, and I was wondering if you could add to my list of companies with great warranties. I feel better giving my money to companies when I know I'll get my money's worth out of the product. I think it's fair to buy a new product when the old one wears out, provided that you got your money's worth. I've done some googling, and here's the list so far (many added by you guys): **Clothing and outdoor gear** * [Costco](http://www.costco.com/) - will accept almost any return * [Darn Tough socks](http://darntough.com/) * [Duluth Pack](http://duluthpack.com/) - *thanks to /u/typographic* * [Dr Martens For Life shoes and boots](http://www.drmartens.com/us/search?text=dr+martins+for+life&x=0&y=0) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Eddie Bauer](http://www.eddiebauer.com/) * [Filson](http://www.filson.com/) - *thanks to /u/Tommyboy610* * ~~[Fjallraven](http://www.fjallraven.us/) - warranty to original owner in North America - *thanks /u/Angusdiet*~~ **Changed policy to two years :(** * [Lands' End](http://www.landsend.com/) * [LL Bean](http://www.llbean.com/) * [Marmot](http://marmot.com/) - *thanks to /u/always_creative* * [Nordstrom](http://shop.nordstrom.com/) - practically anything is refundable or exchangeable - *thanks to /u/wat_ah* * [The North Face](http://www.thenorthface.com/en_US/) * [Oliberté shoes and bags](http://www.oliberte.com/) - *thanks to /u/dat_bird* * [Outdoor Research](http://www.outdoorresearch.com/en/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Patagonia](http://www.patagonia.com/us/home) - *thanks /u/blankedinmyblank* * [Smartwool socks](http://www.smartwool.com/) - *thanks to /u/yurnotsoeviltwin* **Accessories and Bags** * [Briggs & Riley Luggage](http://www.briggs-riley.com/) - *thanks /u/Msteste* * [Chrome bags](http://www.chromeindustries.com/us/en/) - *thanks to /u/johnnytg23* * [Coach](http://www.coach.com/online/handbags/Home-10551-10051-en) (not free, but $20 to repair any item) * [Dakine bags](http://www.dakine.com/) * [Duluth Pack](http://duluthpack.com/) - *thanks to /u/typographic* * [Everki laptop bags and backpacks](http://www.everki.com/) - *thanks /u/whysochangry* * [Filson](http://www.filson.com/) - *thanks to /u/Tommyboy610* * [Friday & River](http://fridayandriver.com/) - *thanks /u/intentionalthreads* * [J.W. Hulme Co. Leather Goods](http://www.jwhulmeco.com/) - *thanks to /u/10minuteslate* * [Jansport](http://www.jansport.com/shop/en/jansport-us) * [Navali](http://www.navali.com/) - *thanks to /u/fashnewb* * [Oliberté shoes and bags](http://www.oliberte.com/) - *thanks to /u/dat_bird* * [Osprey packs](http://www.ospreypacks.com/) * [Red Oxx Bags](http://www.redoxx.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Saddleback Leather](http://www.saddlebackleather.com/) - 100 Year Warranty - *thanks /u/randolama* * [Skagen Watches](http://www.skagen.com/webapp/wcs/stores/servlet/HomeView?langId=-1&storeId=37082&catalogId=26505&N=0) * [Stormy Kromer caps](http://www.stormykromer.com/lifetime-warranty) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Tilley Hats](http://www.tilley.com/us_en/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* **Other** * [Alpinestars motobike gear](http://www.alpinestars.com/) - *thanks to /u/LordPancakes* * [Big Green Egg outdoor cooker](http://www.biggreenegg.com/eggs/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Craftsman Hand Tools](http://www.craftsman.com/) - *thanks /u/FlyingTheWire* * [Cutco Cutlery](http://www.cutco.com/home.jsp) * [ESEE Knives](http://www.eseeknives.com/index.html) (No Questions Asked warranty) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Fiskars Scissors](http://www3.fiskars.com/) - *from [this](http://www.reddit.com/r/AskReddit/comments/kiu5y/what_crazy_lifetime_guarantees_that_you_know/) thread* * [Kershaw Knives](http://kershaw.kaiusaltd.com/) - *thanks to /u/walzman* * [Koss Headphones](http://www.koss.com/en/products) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Kryptonite bike locks](https://www.kryptonitelock.com/Pages/Home.aspx) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Le Creuset cookware](http://www.lecreuset.com/) (most products) - *thanks to /u/lpguy2* * [Leatherman Tools](http://www.leatherman.com/) (25 Years) - *thanks /u/visionquest1* * [Lovesac Furniture](http://www.lovesac.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Lupine animal collars and leashes](http://www.lupinepet.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Magic Flight Launch Box vaporizer](http://www.magic-flight.com/launch-box.php) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * Manduka PRO Series Yoga Mats](http://www.manduka.com/us/customer-service/lifetime-guarantee/) * [Mitchell Gold + Bob Williams Furniture](http://www.mgbwhome.com/Default.aspx) - *thanks to /u/Msteste* * [OXO cookware](http://www.oxo.com/default.aspx) * [Pelican cases](http://www.pelican.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Snap-on hand tools](http://store.snapon.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Tervis Cups](http://www.tervis.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Tupperware containers](http://order.tupperware.com/coe/app/!tw$shop.p_category?pv_ic_code=20000) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Vortex Optics](http://www.vortexoptics.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* * [Zippo Lighters](http://www.zippo.com/) - *from [BIFL thread](http://www.reddit.com/r/BuyItForLife/comments/1tgx37/new_lifetime_warranty_thread_post_any_items_you/)* --- **Keep in mind that the lifetime warranties don't mean a thing if the company ceases to exist, so be wary when investing in products from new companies with seemingly great warranties.** --- **edit**: going to bed for the night, I'll update the list in the morning. Thanks everyone for your contributions. **edit 2**: I'm back, time to add everything to the list. Thanks everyone for your help! **edit 3**: made categories for clothes, accessories, and everything else **edit 4**: started searching through reddit to add more brands/products
0non-cybersec
Reddit
2,920
7,739
Angular datatables with filter column width. <p>I tried to set width for column in angular datatables with filters. But width of the column not changed.</p> <p>I try following</p> <pre><code> var columnsSpecification = [ { type: 'text', bRegex: true, bSmart: true }, { type: 'text', bRegex: true, sWidth:"90px"}]; $scope.dtOptions = DTOptionsBuilder.newOptions() .withBootstrap() .withOption('scrollX', '700%') .withOption('scrollY', height + 'px') .withOption('oLanguage', { "sEmptyTable": " " }) .withOption('lengthMenu', [[-1, 1000, 100, 50, 25, 10], ['All', 1000, 100, 50, 25, 10]]) .withOption('paging', false) .withOption('bInfo',false) .withColumnFilter({ aoColumns:columnsSpecification }) .withTableTools('/Content/DataTables/swf/copy_csv_xls.swf') .withTableToolsButtons(['xls']); </code></pre> <p>In html file I tried this:</p> <pre><code> &lt;table id="table-machines" datatable="ng" class="table table-striped" dt-options="dtOptions"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th style="width: 90px !important"&gt;Value&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr ng-repeat="m in records&gt; &lt;td&gt;{{m.name}}&lt;/td&gt; &lt;td style="width: 90px !important"&gt;{{m.Value}}&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; </code></pre> <p>But Value column another zise rather I setted.</p> <p>I'v found, that if there is not filter - all fine.</p> <p>How can I set table width and preserve filters?</p>
0non-cybersec
Stackexchange
602
1,728
Question to Stay at Home mum's from a concerned husband/dad. My wife is a stay at home mum to our 16 month old. He is a happy, healthy little guy and she is very caring mother. Anyway, I am not an all knowing dad who knows exactly what all kids need but just wanted to put my concerns out there and see if I'm overreacting. Basically my concerns are that most days the two of them just spend at home together. She engages him all day (she doesn't just sit him in front of TV). They have fun and laugh and are always sending me photos of the games and activties they are getting up to. Grandmother comes around usually once a week as well and my wife takes him out for walks or to the park usually a few times a week. On the weekends I try and socialise him with his cousin's, etc but being the first of our friends to have kids we don't know many others who have kids. I worry that he should be out playing with other kids at this age and for my wife's own sanity socialising with other mums. My wife gets anxiety about driving so does not have her license which can be limiting (she does ok with public transport but still it isn't perfect) and I think she has some social anxiety which might stop her from going to playgroup. Anyway, trying to work out if it is something I should push or if I'm just overreacting because I'm at work all day and can't control the situation (I have my own anxieties and not being in control is one of them.) EDIT: Thanks everyone, you've put my mind a little more at ease. Socialising is important and he does have playdates. Just I was worried that it wasn't an every day thing and though that he HAD to be in a playgroup. But from the comments things are going well. I think I just stress because I'm at work all day and its all out of my control. He is having a playdate today actually :)
0non-cybersec
Reddit
424
1,830
People who are still backing the Xbox One over PS4, what are your reasons?. Please remember to follow reddiquette and don't downvote this just because you disagree. I'm very interested in hearing the other side of the argument since E3 is now over. One thing I keep hearing: DRM will make each game become cheap very quickly. Because, like Steam, the devs/publishers are getting a cut from every copy sold. Also, that used games hurt the devs because of reselling and what not. I'm thinking that Microsoft would have already said this to defend their decision if it was true. Thoughts? Personally, I'm leaning on getting a PS4. I just want to hear the other side speak their mind before I drop that much money on a console. EDIT: Spelling is hard. EDIT 2: As a current Xbox-er, you guys really got me thinking again. I really don't care about DRM when it comes down to it. I rarely buy used games and I'm always connected :P. Shitttttttttt someone help me make up my mind. **EDIT 3: I would also like to hear your guys' input on the dedicated servers. Is this a big deal?**
0non-cybersec
Reddit
270
1,083
Git chmod problem: Checkout screws exec bit. <p>Under Ubuntu and Debian the last committed files are getting the execution bit set, when I try a checkout afterwards. It's quite strange and driving me nuts:</p> <pre><code>$ ls -l file -rw-r--r-- ... file # on branch master: $ git commit -m 'mode is 644' file [master 0123456] mode is 644 1 files changed, 1 insertions(+), 1 deletions(-) # All ok $ git checkout dev-branch Switched to branch 'dev-branch' # Seemingly all ok, but file now has the exec bit set $ git merge master Updating 6543210..0123456 error: Your local changes to 'file' would be overwritten by merge. Aborting. Please, commit your changes or stash them before you can merge. # Oops... $ ls -l file -rwxr-xr-x ... file </code></pre> <p>Has anyone an idea, when and why the execution bit slips in? <code>core.filemode</code> is set to <code>true</code>.</p> <p>I have the file open in vim during the branch switching, if that's important somehow.</p> <p><strong>Addendum 1:</strong> It's the checkout, where the permissions are screwed up. I can play the game on and on:</p> <pre><code>$ git br * master dev-branch $ git diff diff --git a/file b/file old mode 100644 new mode 100755 $ chmod 644 file $ git diff $ git checkout dev-branch $ git diff diff --git a/file b/file old mode 100644 new mode 100755 $ chmod 644 file $ git diff $ git checkout master $ git diff diff --git a/file b/file old mode 100644 new mode 100755 # ...and so on ad inf. </code></pre> <p><strong>Addendum 2:</strong> This happens, by the way, for every file in this repository, that I commit. After the successful commit I can't switch branches without the permission screw-up.</p>
0non-cybersec
Stackexchange
538
1,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
How can I detect exit intent on a mobile browser?. <p>I'm working on a solution to detect exit intent on safari mobile. (or any mobile browser for that matter)</p> <p>On desktop I can track curser movement and when the user breaks the plane of the webpage I can initiate a pop up. See <a href="http://www.quicksprout.com/about/" rel="noreferrer">http://www.quicksprout.com/about/</a> as an example. Move your curser up to the back button on the browser and as soon as your curser breaks the webpage a pop up will appear. How can I solve this in a mobile environment?</p> <p>Is there any way to detect when someone clicks the Safari address bar and before the favorites screen appears I can launch a pop up then?</p> <p>Thank you in advance for the help.</p>
0non-cybersec
Stackexchange
208
761
Bash profile commands with multiple &quot;&#39;` issues. <p>Good day!</p> <p>I'm currently trying to get the following alias to work. 'git_fetch' and 'git_tree' are custom alias so dont worry about them.</p> <pre><code>alias git_workspace='osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear &amp;&amp; git_fetch\" in selected tab of the front window" -e 'end tell' &amp;&gt; /dev/null &amp;&amp; osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear &amp;&amp; git_tree\" in selected tab of the front window" -e 'end tell' &amp;&gt; /dev/null' </code></pre> <p>(I added linebreaks to increase readability)</p> <pre><code>alias git_workspace='osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear &amp;&amp; git_fetch\" in selected tab of the front window" -e 'end tell' &amp;&gt; /dev/null &amp;&amp; osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear &amp;&amp; git_tree\" in selected tab of the front window" -e 'end tell' &amp;&gt; /dev/null' </code></pre> <p>However i cant get this to work. Reloading the ~/.profile results in:</p> <pre><code>-bash: alias: application: not found -bash: alias: Terminal -e tell: not found -bash: alias: application: not found -bash: alias: System Events: not found -bash: alias: to: not found -bash: alias: tell: not found -bash: alias: process: not found -bash: alias: Terminal: not found -bash: alias: to: not found -bash: alias: keystroke: not found -bash: alias: n: not found -bash: alias: using: not found -bash: alias: command: not found -bash: alias: down -e "do script with command \"cd `pwd`;clear &amp;&amp; git_fetch\" in selected tab of the front window" -e end: not found -bash: alias: tell &amp;&gt; /dev/null &amp;&amp; osascript -e tell: not found -bash: alias: application: not found -bash: alias: Terminal -e tell: not found -bash: alias: application: not found -bash: alias: System Events: not found -bash: alias: to: not found -bash: alias: tell: not found -bash: alias: process: not found -bash: alias: Terminal: not found -bash: alias: to: not found -bash: alias: keystroke: not found -bash: alias: n: not found -bash: alias: using: not found -bash: alias: command: not found -bash: alias: down -e "do script with command \"cd `pwd`;clear &amp;&amp; git_tree\" in selected tab of the front window" -e end: not found -bash: alias: tell &amp;&gt; /dev/null: not found </code></pre> <p>Can someone assist me? :)</p> <p><strong>EDIT</strong>: I found the solution!</p> <p><code> alias git_workspace='osascript -e "tell application \"Terminal\"" -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"n\" using command down" -e "do script with command \"cd `pwd`;clear &amp;&amp; git_fetch\" in selected tab of the front window" -e "end tell" &amp;&gt; /dev/null &amp;&amp; osascript -e "tell application \"Terminal\"" -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"n\" using command down" -e "do script with command \"cd `pwd`;clear &amp;&amp; git_tree\" in selected tab of the front window" -e "end tell" &amp;&gt; /dev/null' </code></p>
0non-cybersec
Stackexchange
1,164
3,618
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
sed returns the following error sed: -e expression #1, char 101: unknown option to `s&#39;. <p>I'm writing a script to replace a label <code>&lt;p&gt;</code> with a path in some text files (<code>*.prop</code>). However , when I run it I get the following error:</p> <pre><code>sed: -e expression #1, char 101: unknown option to `s' </code></pre> <p>My code is the following:</p> <pre><code>sed -i -- "s/&lt;q&gt;$(echo $destpath | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&amp;/\\\&amp;/g')/\ResultsTesting/\/g" *.prop </code></pre> <p>and if I print the echo of my code:</p> <pre><code>sed -i -- \ s/&lt;q&gt;\/home-students\/rmorales\/testAPK\/air.air.air.com.tabc.gsn-2014_5_11-dex2jar\/ResultsTesting\//g \ myFile.prop </code></pre> <p>Can someone help me please?</p>
0non-cybersec
Stackexchange
310
783
Is the category of mixed Hodge modules bi-filtered?. <p>Let $X$ be a smooth complex algebraic variety and let $MHM(X)$ be the category of mixed Hodge modules on $X$, as defined in <em>(Saito, "Mixed Hodge Modules", 1990)</em>, <em>(Peters-Steenbrink, "Mixed Hodge Structures", 2008)</em> or <em>(Saito, "Mixed Hodge Modules and Applications", 1990)</em>, among others.</p> <p>In all these references, it is said that a mixed Hodge module $M$ comes with an increasing filtration $W$, called the weight filtration, such that $Gr_W^p\,M$ is semi-simple for $p \in \mathbb{Z}$. However, no explicit mention is done to a <em>Hodge-type</em> filtration $F$ on $M$.</p> <p>Nevertheless, in Saito's Mixed Hodge Modules and Applications, it is said that $MHM(X)$ is a full subcategory of the category of $(M, F, K, W)$, where $(M, F)$ is a well filtered $D_X$-module, $K$ is a rational perverse sheaf and $W$ is a pair of filtrations in $K$ and $M$ that agree under the comparison isomorphism. Therefore, it seem like $F$ could define a filtration on the mixed Hodge module $M$, maybe copied into $K \otimes \mathbb{C}$ via the comparison isomorphism. Indeed, taking $X=\left\{\star\right\}$, this $F$ should gives us the Hodge filtration on the mixed Hodge structure defined by a mixed Hodge module over $\left\{\star\right\}$. Thus, my question is:</p> <p><strong><em>Is $MHM(X)$ naturally bi-filtered in the way that, for any $M \in Obj(MHM(X))$, there exists a weight filtration $W$ and a Hodge filtration $F$ of $M$ such that the "Hodge-like" pieces $$ M_{p,q}:= Gr_F^p Gr_W^{p+q} M $$ are (simple?) mixed Hodge modules on $X$?</em></strong></p> <p>If the main question is true (or some variation), I have other questions:</p> <ul> <li>There exists a bi-shifting of $W$ and $F$? That is, given a mixed Hodge module $M$ on $X$ and $\alpha, \beta \in \mathbb{Z}$, is there another mixed Hodge module $M(\alpha, \beta)$ such that $$ (M(\alpha, \beta))_{p,q} = M_{p+\alpha, q+\beta} $$ for all $p,q \in \mathbb{Z}$?</li> <li>If that bi-shifting exists, is it natural in the sense that $$ f_*(M(p,q))=(f_*M)(p,q) $$ for any morphism of algebraic varieties $f:X \to Y$?</li> </ul> <p>Thank you so much in advance!</p>
0non-cybersec
Stackexchange
723
2,215
Command or Shell task hangs when using ssh to create a tunnel. <p>I am using Ansible to push configuration. I have a task inside a playbook that I want to start an ssh tunnel in the background for MongoDB. The task command that i'm using is </p> <pre><code>- name: Start tunnel service shell: ssh -f -N -L 27018:localhost:27017 mongo@remote-server </code></pre> <p>But no matter what I do I cannot get ansible to continue. Instead it hangs or acts like it is waiting on something to return a response. If I run this command in the shell like normal it doesn't have any problems and I can connect to the remote mongo instance. </p> <p>At first I thought because I was setting up a new server that ssh's known_hosts were waiting for a user to respond yes/no before moving on. In this case I tried two options. First I tried adding the server's fingerprint to the known_hosts file. After running from the shell it didn't asked for a known_hosts entry, but ansible also is still hanging. I also tried the option of </p> <pre><code>ssh -o StrictHostKeyChecking=no -f -N -L 27018:localhost:27017 mongo@remote-server </code></pre> <p>But this option is also producing the same problem with ansible hanging.</p> <p>I have tried switching between ansible's command and shell module without any change to the problem. My most recent experiment was to try nohup before the command, but this isn't working either.</p> <pre><code>nohup ssh -f -N -L 27018:localhost:27017 mongo@remote-server </code></pre> <p>Also trying to get creative thinking that if a different process was able to run the command that afterwards it would send a response back to ansible, I tried wrapping it as an Upstart task. I placed the shell command inside a <code>/etc/tunnel.sh</code> file and also put the upstart script in <code>/etc/init/tunnel.conf</code>. But this also doesn't work and seems to have trouble actually starting the script. If I run <code>sudo service tunnel start</code> it will start but has trouble stopping. Though running this through ansible as a command doesn't do anything and just sits there and hangs like all the other experiments.</p> <pre><code>- name: Start tunnel service command service tunnel start </code></pre>
0non-cybersec
Stackexchange
597
2,242
Verifying Algebraic Formulas. <p>Say you are given an arbitrary Algebraic Formula:</p> <p>$$G(u_1,u_2,u_3...u_n) = 0$$</p> <p>Where the expression $G$ is allowed to utilize:</p> <ol> <li>$+, - , *, /$ however desired</li> <li>$()$ however desired</li> <li>The operator $P(a_1,a_2,a_3... a_r, U, V)$</li> </ol> <p>where $P$ specifies a polynomial over its inputs and $U$ denotes the polynomial itself, and V denotes whether polynomial is being applied or its inverse:</p> <p>An example:</p> <p>$P(x,G(x),1) = G(x)$ for any polynomial $G(x)$</p> <p>$P(x,G(x),0) = G^{-1}(x)$ for any polynomial $G(x)$</p> <p>Thus for example we can write the following:</p> <p>$$P(3,x^2-x+7,-1) - \frac{1 + 4i}{2} =0$$</p> <p>Verifying this basically involves solving the problem:</p> <p>$x^2 - x + 7 = 3$ for x and seeing if $\frac{1 + 4i}{2}$ is a valid solution.</p> <p>However as is well known (check this link if you want more <a href="http://www.math.uiuc.edu/~berndt/articles/radicals.pdf" rel="nofollow">http://www.math.uiuc.edu/~berndt/articles/radicals.pdf</a>) </p> <p>Some radical identities can become very complex and unwieldy to check yet are true. Additionally the P notation enables for identities between inverse functions that cannot be represented by radicals to exist. Brute force taking powers and polynomials could easily produce incomputable numbers of terms. </p> <p>Can this problem be solved in polynomial time with respect to input size?</p>
0non-cybersec
Stackexchange
516
1,465
Proof Verification: Show that $R = I + J$, where $R$ is a PID and $I,J$ are ideals. <p>The following question came up on a recent exam that I took.</p> <p>Let $R$ be a PID. Let $I$ and $J$ be ideals in $R$ such that $\operatorname {Hom}_{R}(R/I, R/J) = 0$; that is, there is only the zero map between the quotient rings. Prove that $R = I + J$.</p> <p><strong>Proposed Proof:</strong></p> <p>Consider the maps, \begin{eqnarray} \pi_{0} : R/I \longrightarrow R/J, \quad &amp; \pi_{0}(r + I) = 0 + J, \\ \pi_{1} : R \longrightarrow R/I, \quad &amp; \pi_{1}(r) = r + I. \end{eqnarray} Composing the maps, we have that,</p> <p>\begin{equation} \pi_{2} = \pi_{0} \circ \pi_{1} : R \longrightarrow R/J, \quad \pi_{2}(r) = 0 + J. \end{equation}</p> <p>But this means that the projection of element in $R$ is the ideal $J$ in $R$. By the Lattice Isomorphism Theorem, we must have that $R = J$. Since $J$ is contained in $I + J$, we then must have that $R = I + J$.</p> <p>I am not so sure about the proposed proof. For example, I have not used the fact the $R$ is a PID. Please comment if you think the proof is wrong. Also, please do share the correct proof to this question.</p> <p>This quesion was for 10 points, so I am trying to see if I have at least some parts correct.</p>
0non-cybersec
Stackexchange
462
1,282
Difference between $\vec{a} $ and $||\vec{a}||$. <p>What exactly is the difference between $\vec{a} $ and $\lVert\vec{a}\rVert$ ?</p> <p>I know $\lVert\vec{a}\rVert$ is the magnitude of a vector $\vec{a} $ , but what is $\vec{a} $ then exactly? I know it's a vector, but how can you represent it? Let's say $\vec{a} $ is a vector in $\mathbb{R}^2$, if you draw $\vec{a} $ in $\mathbb{R}^2$, don't you automatically draw $\lVert\vec{a}\rVert$ ?</p> <p>Also, what is the difference between $ \lVert\vec{a}\rVert \cdot \big\lVert\vec{b}\big\rVert $ and $\vec{a} \cdot \vec{b} $? To me it seems like multiplying the same, but I know it isn't. </p>
0non-cybersec
Stackexchange
235
652
Will application based on .NET FW 4.0 work on Windows Server 2012 R2?. <p>0 down vote favorite I'm a little bit confused about .NET framework versions and its compatibility with operating system. Please help.</p> <p>I plan to upgrade my application to .NET 4.x. My application must support a variety of operating systems: XP, Windows Server 2003, 2008 (and R2) , 2012 (and R2), Windows 7.x and Windows 8.x.</p> <p>I'd prefer to release one kit only - which means build the application with one specific .NET framework. The big question is which one?</p> <p>I know that .NET 4.0 supports from XP to Windows Server 2008 R2 but does not support WS 2012. I know that .NET 4.5.1 supports WS 2012 and R2.</p> <p>I'm wondering if what happens if I use my application with FW 4.0 and then try to install it on Windows Server 2012 R2: will it work (backward compatibility?) or not?</p> <p>Thank you</p>
0non-cybersec
Stackexchange
256
899
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
command limits when pasting into tcsh (mac OS X). <p>I encountered a 1024 character limit problem when pasting commands into the terminal application (max OS X 10.5.8) running the TC shell (/bin/tcsh).</p> <p>This can consistently be reproduced by pasting the following commands into the terminal app:</p> <pre> echo 0 0 0 0 0 echo 1 1 1 1 1 echo 2 2 2 2 2 echo 3 3 3 3 3 echo 4 4 4 4 4 echo 5 5 5 5 5 echo 6 6 6 6 6 echo 7 7 7 7 7 echo 8 8 8 8 8 echo 9 9 9 9 9 echo 10 10 10 10 10 echo 11 11 11 11 11 echo 12 12 12 12 12 echo 13 13 13 13 13 echo 14 14 14 14 14 echo 15 15 15 15 15 echo 16 16 16 16 16 echo 17 17 17 17 17 echo 18 18 18 18 18 echo 19 19 19 19 19 echo 20 20 20 20 20 echo 21 21 21 21 21 echo 22 22 22 22 22 echo 23 23 23 23 23 echo 24 24 24 24 24 echo 25 25 25 25 25 </pre> <p>At first, it works as expected, but at some point it fails:</p> <pre> myself@mymac|~> echo 1 1 1 1 1 1 1 1 1 1 myself@mymac|~> echo 2 2 2 2 2 2 2 2 2 2 etc. etc. (good) myself@mymac|~> echo 21 21 21 21 21 21 21 21 21 21 myself@mymac|~> echo 22 22 22 echo 22 22 22 echo 23 23 22 22 22 echo 22 22 22 echo 23 23 echo 24 24 24 24 24 echo 25 25 25 25 25 (bad - gibberish) </pre> <p>So it gets confused after a while. In fact, I have 44 characters per line plus one for line breaks, and the problems happen on line 23 at character 34. This means, the problems happens after 45*22+34=1024 characters. That is pretty obviously a limit that is set somewhere... anybody knows how to expand it so that it can accept more characters and lines?</p> <p>I tried the same on a Linux machine with tcsh but I had no troubles. So I am pretty sure this can be tweaked somewhere.</p>
0non-cybersec
Stackexchange
728
2,548
spreading range of IPs to a list. <p>I have the following code, what I am trying to do is create a small function so a when an IP range (contains : in it) is inputted all range is appended to the list.</p> <pre><code>collected_ips = [] while True: query = input("IP:\t") if not query: break elif len(query.split('.'))==4: temp = query.split('.') #result1 = all([i.isdigit() for i in t]) #must be True if query.find(":")==-1: try: result2 = all([0&lt;=int(i)&lt;=255 for i in temp]) if result2: collected_ips.append(query) except ValueError: print("Please Fix Input") elif len(x.split(":"))==2: #function here #append to collected_ips else: print("Please Fix Input") else: print("Please Fix Input") </code></pre> <p>example of input:</p> <pre><code>123.123.30.20:50 </code></pre> <p>output: </p> <pre><code>['123.123.30.20,'123.123.30.21'...'123.123.30.50'] </code></pre> <p>example of input:</p> <pre><code>123.123.20:50.30 </code></pre> <p>output:</p> <pre><code>['123.123.20.30','123.123.21.30',...'123.123.50.30'] </code></pre>
0non-cybersec
Stackexchange
435
1,241
Babel 7 doesn&#39;t change CONST to VAR. <p>I have problem with Safari version &lt;= 9. Babel doesn't seem to replace const with var.</p> <p>I get this error in console: </p> <p><strong>Unexpected keyword 'const'. Const declarations are not supported in strict mode.</strong></p> <p>I tried using @babel/preset-stage-0 but babel removed it.</p> <p>This is my app configuration:</p> <p>.babelrc</p> <pre><code>{ "presets": [ "@babel/preset-env", "@babel/preset-react" ], "plugins": [ "@babel/plugin-transform-object-assign" ] } </code></pre> <p>webpack.config.js</p> <pre><code>const path = require("path"); const webpack = require("webpack"); const componentName = "contact-captain"; const publicFolderRelativePath = "../../../../public/js"; const ignorePlugin = new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/); module.exports = { // devtool: "source-map", output: { path: path.resolve(__dirname, publicFolderRelativePath), filename: `${componentName}.js` }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } } ] }, plugins: [ ignorePlugin ] }; </code></pre>
0non-cybersec
Stackexchange
417
1,313
Relations between different types of compactness. <p>From various articles in Wikipedia, I have seen some relations between several types of compactness.</p> <blockquote> <p>In general topological spaces, </p> <p><a href="http://en.wikipedia.org/wiki/Compact_space#Other_forms_of_compactness" rel="nofollow">Compact $\Longrightarrow$ Sequentially compact $\Longrightarrow$ countably compact $\Longrightarrow$ pseudocompact and weakly countably compact.</a></p> </blockquote> <p>I also saw that</p> <ol> <li><blockquote> <p>In general topological spaces, </p> <p>Compact $\Longrightarrow$ <a href="http://en.wikipedia.org/wiki/Axiom_of_countability" rel="nofollow">σ-compact $\Longrightarrow$ Lindelöf</a>.</p> </blockquote> <p>So I was wondering if we can place σ-compact and Lindelöf in the first chain of relations? If yes, what are their positions?</p></li> <li><blockquote> <p>In metric spaces, </p> <p><a href="http://en.wikipedia.org/wiki/Compact_space#Other_forms_of_compactness" rel="nofollow">Compact $\Longleftrightarrow$ Sequentially compact $\Longleftrightarrow$ countably compact $\Longleftrightarrow$ pseudocompact $\Longleftrightarrow$ Limit point compact.</a></p> </blockquote> <p>So I was wondering if we can place Limit point compact in the first chain of relations? If yes, what is its position?</p></li> </ol> <p>Thanks and regards!</p>
0non-cybersec
Stackexchange
436
1,392
Easier way to solve a LES (only pen/paper, no calculator). <p>I want to solve the following Linear Equation System with <em>only</em> pen and paper;</p> <p><span class="math-container">$$ 470 = x_A - \frac{3}{10}x_B \tag{1} $$</span> <span class="math-container">$$ 940 = x_B - \frac{2}{10}x_A \tag{2} $$</span></p> <p>I attempt to solve for <span class="math-container">$x_A$</span> by inserting equation (2) into (1) and rewriting it, etc. I got something like;</p> <p><span class="math-container">$$ x_A=470 +\frac{3}{10}(940+\frac{2}{10}x_A) \Rightarrow \dots \Rightarrow x_A\frac{94}{100}=470+\frac{3}{10}940=470+\frac{2820}{10} $$</span></p> <p>Next I try to isolate <span class="math-container">$x_A$</span> and simplify the expression;</p> <p><span class="math-container">$$ \dots \Rightarrow x_A =\frac{100}{94}(470+\frac{2820}{10})=\frac{100}{94}(470+282)=\frac{100}{94}752 $$</span></p> <p>This is where I get stuck. Have I dug myself into a difficult hole when there is a better/more efficient approach to solving this LES? Or am I just missing a good method to solve <span class="math-container">$x_A=\frac{100}{94}\cdot752$</span> to get it to 800?</p> <p>Any insight into "how to think" here and how you solve it with just pen and paper is much appreciated.</p> <p>(Solution: <span class="math-container">$x_A=800$</span>, <span class="math-container">$x_B=1100$</span>)</p>
0non-cybersec
Stackexchange
505
1,398
Make hidden folders invisible sftp. <p>My client needed sftp server for sharing files, so I created sftp server on a amazon ec2 ubuntu machine and added different users.</p> <p>Now their need is when user login to sftp server either via winscp or some other client, they should be able to see only their own folders in home directory, the other folders should not be visible to them. Also in their home directories they should not see any files or folder which start with dot(.).</p> <p>Is this possible? e.g. see screenshot link below, I just want my client to see/access Transcript folder, nothing else.</p> <p><img src="https://i.stack.imgur.com/kEHfW.png" alt="http://i.stack.imgur.com/kEHfW.png"></p>
0non-cybersec
Stackexchange
196
709
16 Male Sexual Problem. So I'm having a problem that is becoming more and more embarrassing. So my problem has a few parts. One of which parts is often me and my Girlfriend will begin to heat up and I'll be erect and ready to go. Either I will get soft before we begin or I will as soon as we slow down or switch position. My other problem is I can't orgasm when she gives me head or a handjob. I feel it start to come and then it dies down as soon as I get close and repeats that cycle until she gets tired and gives up. Some Information: About 6 months ago before I met my current and serious girlfriend, I had a fling with a girl who ended up giving me Chlamydia. I was treated twice as the first time it didn't work fully. It was my bad for not using a condom and lessons were learned. Another note, I have orgasmed from blowjobs and handjobs before. I have always had a problem getting hard, but no where near as bad as I do now. One last thing. I have noticed the head of the epididimus that connects to my testicle is a hardish lump on one testicle. I've read places that this can be normal and have been to embarrassed to get it looked at.
0non-cybersec
Reddit
281
1,155
Finding limit if it exist. <p>I Have to find the following limits, if they exist</p> <p>$$\displaystyle \lim_{t \to \infty} Ne^{-k_1t}$$ $$\lim_{t \to \infty} - \frac{k_1N}{k_2-k_1} \ e^{-k_2t} + \frac{k_1N}{k_2-k_1} \ e^{-k_1t}$$ $$\displaystyle \lim_{t \to \infty} \frac{k_1N}{k_2-k_1} \ e^{-k_2t}-\frac{k_2N}{k_2-k_1} \ e^{-k_1t}-\displaystyle \frac{k_1N}{k_2-k_1}+\frac{k_2N}{k_2-k_1}$$</p> <p>Can anyone give a hint?</p>
0non-cybersec
Stackexchange
217
428
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 is the &quot;Owning Side&quot; of this many-to-many relationship determined?. <p>I'm trying to get a firm grasp on the concept of Owning-side. Couldn't really get a clear picture from any question i found here. Basically I'm going through the Java EE JPA tutorial. They have the following database schema, where <code>PLAYER</code> and <code>TEAM</code> have a many-to-many relationship</p> <p><img src="https://i.stack.imgur.com/boQu2.png" alt="enter image description here"></p> <hr> <p>Also stated</p> <blockquote> <ul> <li>A player can be on many teams.</li> <li>A team can have many players.</li> <li>There is a many-to-many relationship between <code>PLAYER</code> and <code>TEAM</code>.</li> </ul> </blockquote> <p>Pretty straight forward so far. But when is gets to the coding part, they make the <code>TEAM</code> the owning side of the relationship.</p> <pre><code>public class Team { private Collection&lt;Player&gt; players; @ManyToMany @JoinTable( name = "PERSITENCE_ROSTER_TEAM_PLAYER", joinColumns = @JoinColumn(name = "TEAM_ID", referencedColumnName = "ID"), inverseJoinColumns = @JoinColumn(name = "PLAYER_ID", referencedColumnName = "ID") ) public Collection&lt;Player&gt; getPlayers() { return players; } } public class Player { private Collection&lt;Team&gt; teams; @ManyToMany(mappedBy = "players") public Collection&lt;Team&gt; getTeams() { return teams; } } </code></pre> <hr> <h2>Question(s)</h2> <p>I have no problem understanding the code. What I can't get a handle on is:</p> <blockquote> <p><strong>1. How is it determined that <code>TEAM</code> is the owning side?</strong></p> <p><strong>2. Would it make any difference if <code>PLAYER</code> was made the owning side instead, in this scenario?</strong></p> </blockquote> <p>Also stated from the tutorial.</p> <blockquote> <p>"The entity that specifies the <code>@JoinTable</code> is the owner of the relationship, so the <code>TEAM</code> entity is the owner of the relationship with the <code>PLAYER</code> entity."</p> </blockquote> <p>That being said:</p> <blockquote> <p><strong>3. Would the above statement make my second question true? Meaning that there is no determining factor besides which one you <em>decide</em> to make the owning side, with the <code>@JoinTable</code> annotation?</strong></p> </blockquote>
0non-cybersec
Stackexchange
775
2,438
How to find out the corresponding rpm package names from this python build script output?. <p>I am attempting to compile python 2.6.8 in Redhat 5 linux box.</p> <p>At the end of the compilation, I got these messages;</p> <pre><code>Failed to find the necessary bits to build these modules: _bsddb _curses _curses_panel _hashlib _sqlite3 _ssl _tkinter bsddb185 bz2 dbm dl gdbm imageop readline sunaudiodev </code></pre> <p>Based on the names above, I used <code>yum search</code> and find some rpm packages to fulfill the dependencies</p> <p><strong>ncurses</strong></p> <p>ncurses-5.5-24.20060715.x86_64 ncurses-devel-5.5-24.20060715.i386</p> <p><strong>gdbm</strong> gdbm-1.8.0-26.2.1.x86_64</p> <p><strong>readline</strong> readline-5.1-3.el5.x86_64</p> <p><strong>b2</strong> bzip2-1.0.3-4.el5_2.x86_64 bzip2-devel-1.0.3-4.el5_2.x86_64</p> <p>However I cannot do not have luck with the rest them.</p> <p>Is there any technique in discovering the dependencies? Is there any web resource available to look up the rpm packages? </p>
0non-cybersec
Stackexchange
417
1,158
Does there always exist a sequence of handle moves between handle decompositions that does not increase index? (+ ref. request). <p><em>Reference request:</em> Firstly, I'm looking for a proof of the following well-known result about handle decompositions:</p> <blockquote> <p>($\ast$) Given two handle decompositions of a smooth $n$-manifold $M$, there exists a sequence of handle pair creations, cancellations, and handle slides (as well as isotopies) that takes one decomposition to the other.</p> </blockquote> <p>I think I broadly understand the conceptual idea behind the proof, namely that handle decompositions correspond to Morse functions on $M$, and homotopies of the Morse functions give such sequences of handle moves, but I'd like to be able to work through this more rigorously. So far the only lead I've been able to find is Gompf and Stipsicz's <em>4-Manifolds and Kirby Calculus</em> (Theorem 4.2.12), where they attribute the result to Cerf and simply reference his paper <em>La stratification naturelle des espaces de fonctions différentiables réelles et le théorème de la pseudo-isotopie</em>. Unfortunately my French is extremely rudimentary so I haven't been able to locate the relevant part(s) of the paper. Would anyone be able to point me in the right direction, or know where I can find a proof of this theorem?</p> <p><strong>Main question:</strong></p> <blockquote> <p>If an $n$-dimensional smooth manifold $M$ has handle decompositions $\mathscr{H}, \mathscr{H}^\prime$, both in terms of $0,1,\dots, k$-handles where $k &lt;n$, does there exist a sequence of handle moves taking $\mathscr{H}$ to $\mathscr{H}^\prime$ which only involves handles of index at most $k$?</p> </blockquote> <p>I expect the answer is "yes", and that it follows immediately from the proof of ($\ast$), but as I have not yet seen such a proof written down, I am not sure.</p>
0non-cybersec
Stackexchange
494
1,890
xRDP is not working on windows over openVPN. <p>I have created a Ubuntu 18.4 in the private subnet, centos 7 on the public subnet and installed OpenVPN server on CentOS. I am able to connect VPN server from my local windows 10 machine and able to login to Ubuntu Machine. Till this point, I don't have any issues. Now I have installed xRDP on Ubuntu, But I am unable to login ubuntu using RDP. Can anyone help me on this, how can I achieve this one?</p> <p>Thanks in Advance</p>
0non-cybersec
Stackexchange
134
482
How do you keep it together with all these mass shootings?. Do any of you limit activities for your children based on safety concerns due to the recent increases in shootings? I'm getting to the point where I get nervous dropping my kid off at school every day, even! I know the odds are small but it's just getting way too common and I feel so helpless. Our school is having a movie night next week and I can't bring myself to send my son. My only thought is that it's going to be an easy target of a bunch of kids crammed into a small space and we don't need a date night badly enough to justify the risk. How do you all maintain your sanity and address the increased fear and (real or imagined) dangers of mass shootings towards your children?
0non-cybersec
Reddit
167
750
Marginal density function understanding. <p>Given a plane with three points, $(0, -1)$, $(2,0)$, and $(0, 1)$ with $x$-axis and $y$-axis connecting three points to make a triangle. Suppose this triangle represents the support for a joint continuous probability density $$f(y) = \int f(x,y) \, dx.$$</p> <p>What can we say about the marginal density $f(y)$? Are they going to be increasing function, decreasing function, neither increasing nor decreasing function, or cannot be identified because of lack of information. </p>
0non-cybersec
Stackexchange
137
527
Probability is unique?. <p>In many problems of probability the requirement is : Find the probability of (something). But a probability is a positive numeric function s.t:</p> <p>Axiom 1. <span class="math-container">$P(E)=1$</span> ,where <span class="math-container">$E$</span> is sample space.</p> <p>Axiom 2. Let <span class="math-container">$A_1,A_2,\ldots$</span> be a countable (possibly countably infinite) sequence of pairwise disjoint events. then: <span class="math-container">$$ P\left(\bigcup_n A_n\right)= \sum_n P(A_n)$$</span></p> <p>But there are many functions, satisfying these axioms, so what does it mean to <em>find the probability</em> of some event? Or is the probability somehow unique?</p>
0non-cybersec
Stackexchange
224
718
SQL Server 2012 : get number of occurrences and calculate duration with Dynamic SQL. <p>I have a table of a Process Setpoint and Process Value (PV).</p> <p>Something like below table:</p> <pre><code> Timestamp Setpoint PV --------- --------- ------------- t1 100 125 t2 100 95 * t3 100 98 t4 100 88 t5 100 105 t6 100 59 * t7 100 90 t8 100 101 t9 100 70 * t10 100 101 </code></pre> <p>What I want to do, is a query to create one row as result to count number of times that PV went below the Setpoint and comes back above the setpoint. and also calculate the duration of time that it was below setpoint.</p> <p><strong>Result</strong> should be like this.</p> <pre><code> NumberofOccurance Duration ------------------ --------- 3 (t5-t2)+(t8-t6)+(t10-t9) </code></pre> <p><strong>Note:</strong> Correct number of occurrence is <strong>3</strong> in this case not <strong>6</strong> and I think the hardest part is doing the duration.</p> <p>Any ideas?</p> <p>Thanks in advance</p> <p>Edit: I kind of get couple of good answers below, but, what about if I have more than one PV( I actually have 10 different PV in separate columns and two Setpoints in two separate columns for each PV which is 20 columns for setpoint. all are in one table. Timestamp in 1 second intervals. Any idea how I can do the same query for every single PV ? I am thinking about Dynamic SQL with Cursor and CTE option below all combined together. but it is really difficult. </p>
0non-cybersec
Stackexchange
472
1,883
Which header file do I have to include to get printk() within a kernel source file?. <p>Let's say I want to use <code>printk()</code> within <code>arch/x86/boot/string.c</code> before compiling the kernel. Which header file do I have to include so that the linker knows where to find <code>printk()</code>? I tried <code>#include &lt;linux/kernel.h&gt;</code> and <code>#include &lt;linux/printk.h&gt;</code> but I always get errors during <code>make bzImage</code> telling me the linker does not find <code>printk</code>:</p> <pre><code>arch/x86/boot/compressed/string.o: In function `memcmp`: string.c:(.text+0x19): undefined reference to `printk` </code></pre>
0non-cybersec
Stackexchange
208
665
Anti-fitness on par with anti-intellectualism (rant). I am admittedly a giant nerd. I spend a good portion of my free time reading, writing,video gaming and watching films no one else has heard of. The problem is that every one of those activities can be done from the comfort of a chair leading many fellow nerds including myself at one time to become overweight and out of shape. After hitting rock bottom weight wise I decided to get in shape In a two year span I lost 80 lbs (from 255-175) and have kept it off since (shout out to /r/Paleo and /r/BJJ). During the process I noticed that many of my nerdy intellectual friends reacted by poking fun at dieting and fitness and some of whom are very overweight even downplay the effort that goes into weight loss and overall fitness. I just dont understand this "weight lifting is stupid" and "Were all gonna die some time" mentality that hear often even on reddit. If you dont wish to get in shape thats your choice but why act as if there are zero benefits to getting yourself into shape. Moderate exercise can and will make you feel better anyone who says otherwise never really tried or learned the proper way to go about it. Being so anti fitness and sedentary to me is just as ignorant as ignoring books and science. Why would anyone who claims to be a logical person not believe in the benefits of conditioning your body so as to allow it to perform at its absolute best? Edited for grammar*
0non-cybersec
Reddit
326
1,455
Using servant with ReaderT IO a. <p>I'm using the <code>servant</code> library for my JSON API. I need some help to get a <code>ServerT MyAPI (ReaderT a IO)</code> monad stack working. </p> <p>Here's an example using <code>ReaderT</code>, but without integrating it with servant:</p> <pre><code>-- this code works type TestAPI = "a" :&gt; Get '[JSON] String :&lt;|&gt; "b" :&gt; Get '[JSON] String test2 :: EitherT ServantErr IO String test2 = return "asdf" testServer :: Int -&gt; Server TestAPI testServer code = test :&lt;|&gt; test2 where test :: EitherT ServantErr IO String test = liftIO $ runReaderT (giveMeAMessage) code -- this is contrived. In my real application I want to use a Reader for the database connection. giveMeAMessage :: ReaderT Int IO String giveMeAMessage = do code &lt;- ask name &lt;- liftIO $ getProgName return $ show code &lt;&gt; name </code></pre> <p>So, now I would like to get it working with ServerT, following the example in <a href="https://haskell-servant.github.io/posts/2015-05-10-servant-0.4-released.html" rel="noreferrer">this article</a>.</p> <pre><code>-- this code doesn't compile testServerT :: ServerT TestAPI (ReaderT Int IO) testServerT = test :&lt;|&gt; test where test :: EitherT ServantErr (ReaderT Int IO) String test = lift $ giveMeAMessage testServer' :: Int -&gt; Server TestAPI testServer' code = enter (Nat $ liftIO . (`runReaderT` code)) testServerT </code></pre> <p>I get the following error:</p> <pre><code>server/Serials/Route/Test.hs:43:15: Couldn't match type ‘EitherT ServantErr (ReaderT Int IO) String’ with ‘ReaderT Int IO [Char]’ Expected type: ServerT TestAPI (ReaderT Int IO) Actual type: EitherT ServantErr (ReaderT Int IO) String :&lt;|&gt; EitherT ServantErr (ReaderT Int IO) String In the expression: test :&lt;|&gt; test In an equation for ‘testServerT’: testServerT = test :&lt;|&gt; test where test :: EitherT ServantErr (ReaderT Int IO) String test = lift $ giveMeAMessage Failed, modules loaded: none. </code></pre> <p>How can I get rid of the error?</p> <p>Followup question: I understand monad transformers generally, but I'm lost. What topics or links should I study to know enough to answer my own question? </p>
0non-cybersec
Stackexchange
755
2,373
On combining two different approximations of a function for two different limits together. <p>I have an infinite sum (a function of $x$, say $f(x)$) which I can approximate by two different functions, say by $f_1(x)$ and by $f_2(x)$ for small and large values of $x$, respectively. </p> <p>Is there a way to combine $f_1(x)$ and $f_2(x)$ together which could be a reasonably good approximation of $f(x)$ for the whole domain?</p> <p>Any help is appreciated. </p> <p>Thanks!</p>
0non-cybersec
Stackexchange
150
481
OSPP.VBS cmd prompt. <p>I am running into a problem with running the following command in cmd to retrieve the last 5 digits of my Office key. </p> <p>The command prompt is as follows: </p> <pre><code>cscript “C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS” /dstatus </code></pre> <p>Opening CMD, I changed the directory to the root of <code>C:\</code> and ran the command, but I get the following error: </p> <pre><code>"Input Error: There is no file extension in "C:\"C:\program"." </code></pre> <p>I verified the file is there in the program files x86 folder, so I am not sure where I am going wrong. Any help would be appreciated.</p>
0non-cybersec
Stackexchange
203
654
Convex cone of functions of the form $a\log(1+bx + ?)$. <p>Given the set of all functions \begin{align} f_{a,b}(x): [0, \infty) &amp;\to [0, \infty) \\ x &amp;\mapsto a\log(1+bx) \end{align}</p> <p>Is there a way of making the set of these functions $S =\{f_{a,b}: a,b \ge 0\}$ have the property that $\left[f_{a,b} + f_{a',b'}\right] \in S$? Can this be done by adding a fixed number of extra parameters to the definition?</p>
0non-cybersec
Stackexchange
165
430
Java: what information in error stack trace do we typically not wish to show users?. <p>I'm new to java and I'm not that familiar with the formatting rules used by an error stack trace when it is thrown and subsequently displayed to an end-user of my web application. </p> <p>My experience with Oracle database is that the error stack contains internal information, such as schema and procedure names and line number(s), which, while useful for debugging, I would like to prevent the user from seeing. Here's an example:</p> <pre><code>java.sql.SQLException : ORA-20011: Error description here ORA-07894: at "NAME_OF_SCHEMA.PROCEDURE_NAME", line 121 ORA-08932: at line 10 </code></pre> <p>The string I want to display to user is <code>Error description here</code>. I can extract this string using regex expressions because I know (1) this string is always on the first line, so I can extract the first line of the error stack trace, and (2) this string always begins with <code>Error</code> and ends with the end of the line. [Note for Oracle users (I don't want to mislead you): the above only applies when using RAISE_APPLICATION_ERROR with an error string starting with <code>Error</code>, otherwise the text <code>Error</code> is not there].</p> <p>My questions for Java are:</p> <p>(1) Is there anything potentially sensitive that you wouldn't want users to see in the error stack? If so, what? For example, file paths, server name/IP, etc.</p> <p>(2) Are there any formatting rules for the Java error stack trace that I can rely on to extract the non-sensitive information? Or, how to others address this concern?</p> <p>UPDATE 1: </p> <p>Thanks for all the replies so far, they've been very helpful. While many people comment to use a function such as <code>getUserFriendlyMessage()</code> to map errors to useful user messages, I wonder if someone could expand on this mapping. That is, for the common errors (SQL, I/O, etc.), what "reliable" identifier could be used to search this error stack for to identify the type of error that happened, and then what corresponding text string would you recommend to map to this error message to show to the user? @Adarshr's response below is a good start. For example,</p> <pre><code>Identified Expected If found in error stack, display this friendly msg to user ------------------- ---------------------------------------------------------- SQLException An error occurred accessing the database. Please contact support at [email protected]. IOException Connection error(?). Please check your internet connection. </code></pre> <p>Assume compile-related errors don't need to addressed, but rather focus those errors that end users might experience during normal use. For reference, here's a list of run-time error messages: <a href="http://mindprod.com/jgloss/runerrormessages.html#IOEXCEPTION" rel="nofollow">http://mindprod.com/jgloss/runerrormessages.html#IOEXCEPTION</a> </p> <p>Alternatively, is it possible to just use the FIRST LINE of the stack trace to display to user? This link is sort of what I was getting at in my original question above:</p> <p><a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/ErrorMessages.html" rel="nofollow">http://www3.ntu.edu.sg/home/ehchua/programming/howto/ErrorMessages.html</a></p> <p>For example, if the identifier <code>Exception</code> is always used, one could simply extract the text that comes between <code>Exception</code> and the end of the first line. I don't know if we can rely on <code>Exception</code> always being there.</p>
0non-cybersec
Stackexchange
931
3,587
Interaction of fno-exceptions and POSITION INDEPENDENT CODE. <p>I ran into a rather bizarre issue while building a dynamic library. Here are details with a small example:</p> <p>A simple file called <code>static.h</code> whose contents are:</p> <pre class="lang-cpp prettyprint-override"><code>#pragma once #include &lt;string&gt; std::string static_speak(); </code></pre> <p><code>static.cpp</code> looks like this:</p> <pre class="lang-cpp prettyprint-override"><code>#include &quot;static.h&quot; std::string static_speak() { return &quot;I am static&quot;; } </code></pre> <p>one can build a static library with these two files (using cmake) as:</p> <pre><code>add_library(static static.cpp ) </code></pre> <p>Now, consider another file called <code>shared.cpp</code> whose contents are:</p> <pre><code>#include &quot;static.h&quot; std::string dynamic_speak() { return static_speak() + &quot; I am dynamic&quot;; } </code></pre> <p>One can try to build a dynamic library (again using cmake) as:</p> <pre><code>add_library(shared SHARED shared.cpp ) target_link_libraries(shared PRIVATE static ) </code></pre> <p>When one tries to build the above, one will run into the following error:</p> <pre><code>[4/4] Linking CXX shared library libshared.so FAILED: libshared.so : &amp;&amp; /opt/vatic/bin/clang++ -fPIC -g -shared -Wl,-soname,libshared.so -o libshared.so CMakeFiles/shared.dir/shared.cpp.o libstatic.a &amp;&amp; : /usr/bin/ld: libstatic.a(static.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output clang-10: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. </code></pre> <p>This makes sense. We didn't compile <code>static</code> with <code>POSITION_INDEPENDENT_CODE</code>. That is easily fixable via:</p> <pre><code>add_library(static static.cpp ) set_target_properties(static PROPERTIES POSITION_INDEPENDENT_CODE ON ) </code></pre> <p>Everything works perfectly now when one compiles <code>shared</code> library.</p> <p>Now here is the problem. Let's say I didn't enable <code>POSITION_INDEPENDENT_CODE</code> but instead disabled exceptions (!) in my code as:</p> <pre><code>set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -fno-exceptions&quot;) </code></pre> <p>Now when I try to compile <code>shared</code>, everything still works!! How are exceptions and fPIC related to each other?</p> <p>Here is a repo to reproduce the issue: <a href="https://github.com/skgbanga/shared" rel="nofollow noreferrer">https://github.com/skgbanga/shared</a></p>
0non-cybersec
Stackexchange
912
2,738
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