text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
Quasisimple group with cyclic Sylow p-subgroup and weakly real p-elements?. <p>Does there exist a quasisimple group $G$ and an odd prime $p$ such that $G$ has cyclic Sylow $p$-subgroups and a weakly real element of $p$-power order?</p> <p>From <a href="https://mathoverflow.net/questions/224519/strongly-real-elements-of-odd-order-in-sporadic-finite-simple-groups">Strongly real elements of odd order in sporadic finite simple groups</a> the only sporadic finite simple group which has weakly real $2$-regular elements is McL. But McL does not have cyclic Sylow $p$-subgroups for the prime orders $3$ and $5$ of the weakly real elements.</p>
0non-cybersec
Stackexchange
184
643
ASP.NET MVC3 add a HtmlFieldPrefix when calling Controller.PartialView. <p>I am rendering a partial view as part of an Ajax request. </p> <p>When I call the partial view from a view:</p> <pre class="lang-c# prettyprint-override"><code>int i=0; foreach(var rule in Model.Rules) { @Html.Partial("ValidationRuleRow", rule, new ViewDataDictionary { TemplateInfo = new System.Web.Mvc.TemplateInfo { HtmlFieldPrefix = string.Format("Rules[{0}]", i) } }) i++; } </code></pre> <p>I am able to set the HtmlFieldPrefix to allow for proper Model binding.</p> <p>I want the user to be able to add a new ValidationRuleRow on the fly via ajax, like:</p> <pre class="lang-javascript prettyprint-override"><code>$.ajax({ type: "GET", url: "/Monitors/NewMonitorValidationRule", success: function (data, textStatus, jqXHR) { var element = $(data); $("#ValidationRuleContainer").append(element); } }); </code></pre> <p>So I have an action in my controller to get the HTML:</p> <pre class="lang-c# prettyprint-override"><code>public ActionResult NewMonitorValidationRule() { ValidationRule rule = new ValidationRule{Id = TempSurrogateKey.Next}; var view = PartialView("ValidationRuleRow", rule); // CODE TO SET PartialView field prefix return view; } </code></pre> <p>The returned HTML doesn't have a prefix. Is there anyway to set a prefix when calling a PartialView from an Action in a Controller?</p>
0non-cybersec
Stackexchange
434
1,460
Going to Montreal, Canada from the US next weekend. How much money should we bring?. So my fiancée and I are traveling via train from Windsor to Montreal. We are from Michigan and taking out cash from our respective banks to take with us. She budgeted $700 for herself on this trip and that’s all she plans to use, even though she’ll have a debit/credit card with her. I’d like to share a basic version of our itinerary that is mainly going to include the places and things we plan to see and prices of those things. If someone could tell me if her $700 is enough or not enough, that would be great. She said to me that she’s not sure if $700 will be enough or too little and I said I’ll check on Reddit because this place is a treasure trove of knowledge! Basic Itinerary: Saturday, August 12, 2017 This will be travel day via train. Or maybe I could’ve said via rail... Arrive and Check into Hotel Dinner at II Focolaio Explore Montreal or Go back to Hotel and chill. Sunday Mont-Royal Park Montreal Museum of Fine Arts (10-5) Admission: $15 per person Mile End Monday Old Town Montreal - St. Paul Street - Notre Dame Basilique Tuesday Underground City Mall (10-9) Biodome (9-6) Admission: $20.25 Wednesday We leave early morning to get back to Michigan. So essentially, we’ll need spending money for food/snacks (plus any restaurant tips), any souvenirs, shopping in general, and anything else we come across that we want to do that’s not planned on this list. Also, we’ll be getting a metro pass to come and go on the metro as we please so that I think might be $20? With all that in mind, should we take more than $700 each or is that too much? Thank you to all who answer!
0non-cybersec
Reddit
453
1,706
Beamer - unable to move image + caption downwards. <pre><code>%!TEX program = xelatex \documentclass[10pt, aspectratio=1610]{beamer} \usetheme[titleformat=allcaps, progressbar=frametitle]{metropolis} \usepackage{booktabs} \usepackage[scale=2]{ccicons} \usepackage{caption} \usepackage{pgfplots} \usepackage{mhchem} \usepgfplotslibrary{dateplot} \usepackage{xspace} \newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace} \title{Apoptosis facilitates antigen presentation to T lymphocytes through MHC-I and CD1 in tuberculosis} \subtitle{ \small Schaible \emph{et al.} (2003)} \date{February 18, 2016} \author{Demo} \institute{Demo} % \titlegraphic{\hfill\includegraphics[height=1.5cm]{logo/logo}} \begin{document} \maketitle \begin{frame}{\emph{M. tuberculosis} antigens and particulates are confined within the phagosome} \begin{columns} \column{0.7\textwidth}% \vspace*{-1cm}\includegraphics[width=1.0\textwidth]{mycobacteriumvstubcerolosis.png} \vspace*{1cm}\captionof{figure}{\footnotesize Left quadrant: dyes from labeled- \emph{M. tuberculosis} remain confined within phagosomes. Right quadrant: dyes from labeled-\emph{L. monocytogenes} were released into the cell &lt;10 mins after infection. Arrows indicate bacteria-containing phagosomes.} \column{0.4\textwidth} \begin{itemize} \itemsep1em \item The mycobacterial phagosome appears to be impermeable to macromolecules \item Membrane-impermeable fluorescent molecules were \alert{retained} in phagosomes across all maturation stages \end{itemize} \end{columns} \pause \metroset{block=fill} \begin{alertblock}{Seclusion from the classical MHC-I pathway is apparent.} There must be another alternative pathway for antigen delivery. \end{alertblock} \end{frame} \end{document} </code></pre> <p>I'm trying to move the image here downwards, but it won't move. Even with vspace, the image moves down, but the caption moves upwards. It's covering the progress bar and doesn't quite look that good.</p> <p>Thanks for the help guys.</p> <p><a href="https://i.stack.imgur.com/w0onS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w0onS.jpg" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
689
2,219
18M 6'0" SW:180 CW:180 GW:165 Student with occasional exercise. Having trouble!. Hey guys, I am brand new to this sub. So please forgive any mistakes I may make. I am a student who is attempting to lose some poundage before the summer. I am not unrealistic. I understand that I am a little late and that I won't have a six pack by July. However, that is my goal. I am having trouble staying motivated as well as finding alternative food choices when I am hungry, and lastly, identifying a "bored" hungry or a "hungry" hungry! Any help would be greatly appreciated!
0non-cybersec
Reddit
137
564
Rank and Range space of Powers of a Matrix. <p>Consider $A$ is some singular $N \times N$ real matrix. I learned that range space of $A$ (denote as $R(A)$) shrinks as one takes its powers (I learned a proof based on vector spaces for that also). So $R(A) \supseteq R(A^2) \supseteq R(A^3)\dots $ and so on. This should imply that $rank(A) \geq rank(A^2) \geq rank(A^3)\dots$. since the dimension is decreasing (non-increasing). I have also learned that rank of a matrix is also same as the number of non-zero eigen values. But then, eigen-values of powers of $A$ are the powers of eigen-values of $A$. So doesn't it imply that $rank(A)=rank(A^2)$. If it is so, then how can range space shrink, for after all, rank is the dimension of range space. I believe I am missing some thing in this chain of arguments I made. </p>
0non-cybersec
Stackexchange
243
828
Add a image to React Bootstrap dropdown. <p>I'm using React Bootstrap and React Router Bootstrap for my Navbar, and I am making a user profile dropdown menu list.</p> <p>I'd like to be able to have an user's avatar show up in place of the 'title' property. (The same idea as the user profile dropdown on Github)</p> <p>Is this possible? I don't see any options to use an image instead of title for NavDropdown</p> <pre><code>&lt;Navbar inverse&gt; &lt;Navbar.Header&gt; &lt;Navbar.Toggle /&gt; &lt;/Navbar.Header&gt; &lt;Navbar.Collapse&gt; &lt;Nav pullRight&gt; &lt;NavDropdown eventKey={ 3 } id="profile-dropdown" &gt; &lt;LinkContainer to="/profile/edit" &gt; &lt;NavItem eventKey={ 3.4 } &gt; Edit &lt;/NavItem&gt; &lt;/LinkContainer&gt; &lt;LinkContainer to="/logout"&gt; &lt;Logout eventKey={ 3.5 } /&gt; &lt;/LinkContainer&gt; &lt;/NavDropdown&gt; &lt;/Nav&gt; &lt;/Navbar.Collapse&gt; &lt;/Navbar&gt; </code></pre> <p>Would a SplitButton or straight Dropdown be a better option? I don't really see much that the "NavDropdown" is adding to the HTML.</p>
0non-cybersec
Stackexchange
396
1,152
Caching a data frame in joblib. <p>Joblib has functionality for sharing Numpy arrays across processes by automatically memmapping the array. However this makes use of Numpy specific facilities. Pandas does use Numpy under the hood, but unless your columns all have the same data type, you can't really serialize a DataFrame to a single Numpy array.</p> <p>What would be the "right" way to cache a DataFrame for reuse in Joblib?</p> <p>My best guess would be to memmap each column separately, then reconstruct the dataframe inside the loop (and pray that Pandas doesn't copy the data). But that seems like a pretty intensive process.</p> <p>I am aware of the standalone Memory class, but it's not clear if that can help.</p>
0non-cybersec
Stackexchange
183
727
Counter for table labelling is wrong. <p>I have a table and am trying to include a caption and label. The caption is printed but with the wrong number. It is my first table in the document, but latex uses the number of my Chapter (3.1) for the table. I tried fixing it by manipulating the counter, but it will only change between 3.1 and 3.2. </p> <p>This is my code:</p> <pre><code>\setcounter{table}{0} \begin{table}[h!] \begin{tabu}to 0.8\textwidth { | X[c] || X[c] | X[c] | } \hline Measure &amp; Min &amp; Max \\ \hline \hline One &amp; 1 &amp; 26 \\ \hline Two &amp; 6.353 &amp; 2.2 \\ \hline Three &amp; 0 &amp; 8.46 \\ \hline Four &amp; -16.86 &amp; -2.94 \\ \hline \end{tabu} \caption{Statistics of indices} \label{table:1} \end{table} </code></pre> <p>Can somebody help? I've been fighting with this table for hours and would really appreciate tips!</p>
0non-cybersec
Stackexchange
312
873
Welcome everyone!. #Hello all! Welcome to /r/youseeingthisshit! There has been an increase in posts again lately, which is great! Please be sure to check out the sidebar before posting! Is there anything you would like to see on this subreddit in terms of improvements, changes etc? If so, put a comment in this thread! If you have any questions, feel free to ask them here or [message the moderators](https://www.reddit.com/message/compose?to=%2Fr%2Fyouseeingthisshit) We would like to remind you all that the report button is the best weapon against posts breaking the [rules](https://www.reddit.com/r/youseeingthisshit/about/rules/). --- ##Here are some classics to get you started: * [The one which started it all](http://i.imgur.com/ObolcBf.gifv) (one of my favourites!) * [A snotty surprise](http://gfycat.com/WickedSociableDiplodocus) * [And an otter that just couldn't handle this shit](http://i.imgur.com/AveStx1.gifv) --- Regards, The moderators of /r/youseeingthisshit
0non-cybersec
Reddit
311
991
Should the aggregate root have a property that it cannot validate. <p>I ran into the situation where I have to decide whether a property belongs to my aggregate or not. My domain logic is the following. A User has a group in his organization ex: IT, SALES, MARKETING. Depending on which group this user belongs to, he will have a set of Permissions. The logic of which group has which permissions is defined in the Website Policies. A Policy is a mapping between a group and a set of permissions. ex: group IT has permissions to view post, edit post and delete posts.</p> <p>I have 2 aggregates: User and Website(we are managing multiple websites)</p> <p>The question is: Should the permissions be part of the user aggregate?</p> <p>It is easy and somehow makes sense to have the permissions in the user aggregates so it can be requested any time. But the problem I see with this is that the user aggregate root will not be able to satisfy this invariant:"A user should have the permissions that are defined for the groups that he/she belongs to" and since the permissions are transient data and they are not being persisted I think it should not be part of the User AR.</p> <p>The other option would be to have a domain service or a method in the website AR that returns the permissions for a specific user. And then use this method whenever the permissions are needed.</p>
0non-cybersec
Stackexchange
314
1,379
why opening a port is so difficult in ubuntu?. <p>I have searched around and I have run these commands</p> <pre><code>iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 5432 -j ACCEPT iptables-save &gt; /etc/iptables.rules </code></pre> <p>And I rebooted the box. I had no luck.</p> <p>What am I missing? IS there a universal way to do this thing in ubuntu? I remember in fedora I just need to edit a text file and make it happen.</p> <p>Thanks</p> <p><strong>UPDATE</strong></p> <p>I have run </p> <pre><code>ufw allow 5432 </code></pre> <p>and I ran</p> <pre><code> ufw status </code></pre> <p>I got this result</p> <pre><code>Status: active To Action From -- ------ ---- 5432/tcp ALLOW Anywhere 80 ALLOW Anywhere 22 ALLOW Anywhere 5432 ALLOW Anywhere 5432/tcp ALLOW Anywhere (v6) 80 ALLOW Anywhere (v6) 22 ALLOW Anywhere (v6) 5432 ALLOW Anywhere (v6) </code></pre> <p>I still cannot access 5432!</p>
0non-cybersec
Stackexchange
371
1,196
Blank Screen/Command prompt on Ubuntu/Window 8.1 daul boot toshiba laptop. <p>For the last few days I have been trying to configure a laptop to dual boot. The laptop works works very well booting into both ubuntu 12.04 LTS and Widows 81. without any issue until I install item 1 (I need these updates for Android Development work). The same issue can be duplicated by installing item 2. The blank screen / command line appears after the GRUB menu.</p> <ol> <li><pre>sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 minicom tftpd uboot-mkimage expect libgl1-mesa-dri sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so</pre></li> <li><pre>sudo apt-get install xserver-xorg-video-intel</pre> <p>Per the follwing post <a href="https://askubuntu.com/questions/166224/how-do-i-install-the-intel-graphics-driver-in-my-system?answertab=oldest#tab-top">"how do I install intel graphic drivers"</a> It is my understanding that the Intel Graphic drivers are part of the xserver-xorg-video-intel driver package.</p></li> </ol> <p>Note: I have reviewed other posts but doesn't seem to find a solution. Thus this post.</p> <p><strong>Main Hardware</strong></p> <ol> <li>Toshiba Satellite C55-A5310</li> <li>Intel i3-3120M processor</li> <li>Intel® HD Graphics 4000 (Ivy Bridge GPU)</li> </ol> <p><strong>Software</strong></p> <ol> <li>Window 8.1</li> <li>Ubuntu 12.04.3 LTS (uname -r > 3.8.0-35-generic)</li> </ol> <p>Summary of what I have tried so far:</p> <ol> <li>change quiet Splash to nomodeset.</li> <li>sudo apt-get install mesa-utils</li> <li>edit grub -> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset", GRUB_GFXMODE=1366x768, update-grub -> stuck at ubuntu splash, (starting CUPS printing spooler/server OK)</li> </ol> <p><strong>References</strong></p> <ol> <li><p><a href="http://www.linuxbsdos.com/2013/03/12/dual-boot-windows-8-and-ubuntu-12-04-in-uefi-mode/" rel="nofollow noreferrer">Dual-boot Windows 8 and Ubuntu 12.10 in UEFI mode</a></p></li> <li><p><a href="http://www.everydaylinuxuser.com/2013/09/install-ubuntu-linux-alongside-windows.html" rel="nofollow noreferrer">Installing ubuntu along side windows 8</a> </p></li> </ol>
0non-cybersec
Stackexchange
886
2,438
Maven failing to download jar dependencies. <p>I have a very simple default application that I've created to test my Eclipse Indigo/Maven v3.0.1 setup on my Windows 7 machine. The Hello World app runs fine from Eclipse.</p> <p>Now from the command line I'm trying to test with <code>mvn install</code>.</p> <p>At which point I see Maven download a large series of dependencies. For some reason though it will get stuck downloading one and will just stop part way through. It's not at the same point each time, but it's currently consistently the same jar file, eg...</p> <blockquote> <p><a href="http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-booter/2.5/surefire-booter-2.5.jar" rel="noreferrer">http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-booter/2.5/surefire-booter-2.5.jar</a></p> </blockquote> <p>If I download this file from a browser it works perfectly. Quite fast in fact. Now if I manually copy that downloaded file to the appropriate directory in my <code>.m2</code> repository directory, the install continues to download dependencies until it hits another one at random which it stops at.</p> <p>Here's my POM, although I'm not sure it'll help as it's so basic and seems to work fine with a <code>mvn compile</code>.</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.kyeema&lt;/groupId&gt; &lt;artifactId&gt;QServer&lt;/artifactId&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;name&gt;QServer&lt;/name&gt; &lt;url&gt;http://maven.apache.org&lt;/url&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;/properties&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;version&gt;3.8.1&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>Here's some debug output referencing some dummy jar file?</p> <pre><code>[INFO] Surefire report directory: C:\workspace\QServer\target\surefire-reports [DEBUG] Setting system property [user.dir]=[C:\workspace\QServer] [DEBUG] Setting system property [localRepository]=[C:\Users\Andre\.m2\repository] [DEBUG] Setting system property [basedir]=[C:\workspace\QServer] [DEBUG] Using JVM: C:\Program Files\Java\jdk1.7.0\jre\bin\java [DEBUG] dummy:dummy:jar:1.0 (selected for null) [DEBUG] org.apache.maven.surefire:surefire-booter:jar:2.7.2:compile (selected for compile) [DEBUG] org.apache.maven.surefire:surefire-api:jar:2.7.2:compile (selected for compile) [DEBUG] Adding to surefire booter test classpath: C:\Users\Andre\.m2\repository\org\apache\maven\surefire\surefire-booter\2.7.2\surefire-booter-2.7.2.jar Scope: compile [DEBUG] Adding to surefire booter test classpath: C:\Users\Andre\.m2\repository\org\apache\maven\surefire\surefire-api\2.7.2\surefire-api-2.7.2.jar Scope: compile [DEBUG] dummy:dummy:jar:1.0 (selected for null) [WARNING] Missing POM for org.apache.maven.surefire:surefire-junit3:jar:2.7.2: Error resolving project artifact: Failure to find org.apache.maven.surefire:surefire-junit3:pom:2.7.2 in http://mirrors.ibiblio.org/pub/mirrors/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of ibiblio.org has elapsed or updates are forced for project org.apache.maven.surefire:surefire-junit3:pom:2.7.2 [DEBUG] org.apache.maven.surefire:surefire-junit3:jar:2.7.2:test (selected for test) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.626s [INFO] Finished at: Tue Aug 16 13:18:42 PDT 2011 [INFO] Final Memory: 8M/154M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project QServer: Error to resolving surefire provider dependency: Missing: [ERROR] ---------- [ERROR] 1) org.apache.maven.surefire:surefire-junit3:jar:2.7.2 [ERROR] [ERROR] Try downloading the file manually from the project website. [ERROR] [ERROR] Then, install it using the command: [ERROR] mvn install:install-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit3 -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/to/file [ERROR] [ERROR] Alternatively, if you host your own repository you can deploy the file there: [ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit3 -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] [ERROR] [ERROR] Path to dependency: [ERROR] 1) dummy:dummy:jar:1.0 [ERROR] 2) org.apache.maven.surefire:surefire-junit3:jar:2.7.2 [ERROR] [ERROR] ---------- [ERROR] 1 required artifact is missing. [ERROR] [ERROR] for artifact: [ERROR] dummy:dummy:jar:1.0 [ERROR] [ERROR] from the specified remote repositories: [ERROR] ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2, releases=true, snapshots=false) </code></pre>
0non-cybersec
Stackexchange
1,830
5,435
3 monitors with asus zenbook ux410uq. <p>I have Asus Zenbook ux410uq, and i would want to work with 3 external monitors, but i have only one HDMI port, and one usb c-type. I am wondering, can i plug one monitor with usb c-type to hdmi adapter, and other monitors with hdmi splitter? Will it works correctly? Or maybe one HDMI splitter which would split my hdmi to 3 or 4? If not, is there any solutions to plug 3 monitors to this laptop?</p>
0non-cybersec
Stackexchange
131
442
Integrating $\int_0^{\frac{\pi}{2}} \frac{x}{\cos(x)+\sin(x)} \mathrm dx$ using complex analysis. <p>I am struggling with the integration of <span class="math-container">$$ \text{I} = \int_0^{\frac{\pi}{2}} \frac{x}{\cos(x)+\sin(x)} \mathrm dx$$</span> using complex analysis. I used the substitution <span class="math-container">$z=e^{ix} \rightarrow \mathrm dx = \frac{1}{iz}\mathrm dz$</span> and hence <span class="math-container">$\cos(x)+\sin(x)= ((z+\frac{1}{z})-i (z-\frac{1}{z}))$</span> because we have <span class="math-container">$ \cos(x)=\frac{1}{2}(e^{ix}+ e^{-ix})$</span>, and <span class="math-container">$ \sin(x)=\frac{1}{2i}(e^{ix} -e^{-ix})$</span>, and <span class="math-container">$x= -i \ln(z)$</span>. However I am not successful to obtain the correct result when using real analysis, which gives <span class="math-container">$$\text{I}= \displaystyle\int_{0}^{\frac{\pi}{2}}\dfrac{x}{\sin\,x + \cos\,x}\,dx = 0.978959918 $$</span></p> <p>Any idea how to calculate this integral using complex analysis and Cauchy integral theorem?</p>
0non-cybersec
Stackexchange
360
1,062
Hash : How does it work internally?. <p>This might sound as an very vague question upfront but it is not. I have gone through <a href="http://en.wikipedia.org/wiki/Hash_function" rel="noreferrer">Hash Function</a> description on wiki but it is not very helpful to understand. </p> <p>I am looking simple answers for rather complex topics like Hashing. Here are my questions:</p> <ol> <li>What do we mean by hashing? How does it work internally?</li> <li>What algorithm does it follow ?</li> <li>What is the difference between <code>HashMap</code>, <code>HashTable</code> and <code>HashList</code> ?</li> <li>What do we mean by 'Constant Time Complexity' and why does different implementation of the hash gives constant time operation ?</li> <li>Lastly, why in most interview questions <code>Hash</code> and <code>LinkedList</code> are asked, is there any specific logic for it from testing interviewee's knowledge?</li> </ol> <p>I know my question list is big but I would really appreciate if I can get some clear answers to these questions as I really want to understand the topic.</p>
0non-cybersec
Stackexchange
301
1,090
$(a+b)^\beta \leq a^\beta +b^\beta$ for $a,b\geq0$ and $0\leq\beta\leq1$. <p>It seems that $(a+b)^\beta \leq a^\beta +b^\beta$ for $a,b\geq0$ and $0\leq\beta\leq1$. However, I could not prove this nor the same result for a general concave and increasing function (for which it might not hold). If the inequality is true, does it follow from some general inequality or is there some other simple proof? </p>
0non-cybersec
Stackexchange
131
407
Subsets of $[n]$ of size $k$ with exactly one couple of consecutive integers.. <p>I hope I'm not asking a question that has previously been asked (and answered).</p> <p>I have to determine how many subsets of $[n]:=\{1,\dots,n\}$ of size $k$ contain exactly one couple $(i,i+1)$ of subsequent integers. I have used the following approach: let $T=(t_1,\dots,t_n)\subset\{0,1\}^n$ be a binary string of length $n$, identifying a subset of size $k$ drawn from $[n]$, i.e. $\sum_i t_i=k$. For $T$ to meet the conditions stated above, it must be the case that $T$ contains $k-2$ non consecutive ones and a couple of consecutive ones.</p> <p>To build such sequence, I used the method of stars and bars: first find a sequence of length $k-1$ with no consecutive numbers and then obtain a sequence of length $k$ with one consecutive couple.</p> <ol> <li>Place $n-k$ consecutive zeros in a string.</li> <li>There are $n-k+1$ places where $k-1$ ones can be placed so that they are non consecutive, hence there are $\binom{n-k+1}{k-1}$ sequences of length $n-1$ with $k-1$ ones that are non consecutive.</li> <li>Add an extra one close to the previous one. For any sequence in $(2.)$ there are $(k-1)$ possibilities.</li> </ol> <p>Overall, that would give $(k-1)\times\binom{n-k+1}{k-1}$ possibilities.</p> <p>Does this make sense? Thanks!</p>
0non-cybersec
Stackexchange
421
1,338
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
Printing with SP-213w. <p>I have a Ricoh SP 213w printer, connected to my machine with a cable. I am on Ubuntu 16.04.3 LTS 64-bit</p> <p>When I print PDF, sometimes it works. Sometimes it prints out garbage.</p> <p>How could I make it consistently print a PDF correctly, rather than garbage (attached)</p> <p>Example of Garbage</p> <p><a href="https://i.stack.imgur.com/XYxNu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XYxNu.jpg" alt="Example of printed garbage"></a></p> <p>Printer Settings</p> <p><a href="https://i.stack.imgur.com/FPDPJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FPDPJ.png" alt="Printer Settings"></a></p>
0non-cybersec
Stackexchange
248
680
Knapsack variant. <p>In my line of work, I have encountered the following variant of discrete knapsack and I was wondering if it has already been studied. E.g. We are given a set of 3 items (A,B,C). The goal is to maximize the value carried for a given weight constraint. The variant has the following additional constraints:</p> <ul> <li><p>Step 1: The first item choice is always A.</p> <p>If the finite set with A's weights is $W_A = \{ 3.4 ,10, 12.5 \}$, we pick e.g the value $w=12.5$ <em>once</em>.</p></li> <li>The choice $w$ of A's weight affects (deterministically) the weights and values of B and C. I.e. the weigt set $W_B = f(w)$ and the value set $V_B = g(w) $. Same for $W_C, V_C$.</li> <li>Step 2: We want to maximize the value (for a given total weight) by adding items B and C in the knapsack.</li> </ul> <p>Has this been studied before? Is solving it equivalent to performing knapsack once per weight choice in set $W_A$ ? (i.e. 3 times in the example above) </p> <p><strong>UPDATED with more formal definition:</strong></p> <p>Assume $n$ finite sets $A_1,A_2,...,A_n$</p> <p>Assume you are allowed a single choice $a_i$ from each set, i.e. $a_1 \in A_1, ... , a_n \in A_n$</p> <p>Assume the weight $w$ to be a function of all choices i.e. $w=f(a_1,...,a_n)$</p> <p>Assume the value $v$ to be a function of all choices i.e. $v=g(a_1,...,a_n)$ </p> <p>Assume a maximum weight capacity $W_c$</p> <p><strong>Goal:</strong></p> <p>Find choices $(a_1,...,a_n)$ that maximize value $v=g(a_1,...,a_n)$, while $w=f(a_1,...,a_n) \le W_c$ </p>
0non-cybersec
Stackexchange
586
1,570
PHP File Download using POST data via jQuery AJAX. <p>So I know there have been a number of <a href="https://stackoverflow.com/questions/3499597/javascript-jquery-to-download-file-via-post-with-json-data">similar</a> posts, but I think this is enough of a variation to warrant its own question:</p> <p>I am building an XLS exporter in PHP and jQuery. I am trying to POST an array with jQuery (which I believe is going to be too long as a GET querystring), and use it to generate an XLS file on my server, which the user can then download.</p> <p>I have used hidden iframes in the past to accomplish this, but since they just redirect to a url, this requires me to use GET, which makes me nervous. </p> <p>My question is then: how do I store those files on my server and link to them if they're being generated dynamically, potentially by multiple users? Would a hidden iframe link to a separate PHP script that locates THEIR file based on a session ID or something like that?</p> <p>Thanks in advance for any guidance here on what I'm sure gets asked all the time :)</p>
0non-cybersec
Stackexchange
288
1,078
If $AB + BA = 0$, what is $\operatorname{tr}(B)$?. <p>If $A$ is a regular square matrix with the dimension $n$ and $B$ is a square matrix with the dimension of $n$ and $AB + BA = 0$, find the trace of $B$.</p> <p>From here, I can get this: </p> <p>$AB = -BA$</p> <p>$ABA^{-1} = -B$</p> <p>But I just don't see how I should proceed, or if I am even on the right track. Any help with the solution is appreciated..</p>
0non-cybersec
Stackexchange
154
420
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
Ports for NAT&#39;ed Windows share. <p>Simple question: I have a NATed Linux at home that hosts a couple of samba shares. What Ports should I forward from the router to the Linux box so as to be able to access those shares from the internet with windows explorer (a la "\my.dyndns.org\shares\xxx" style)? I want the <strong>minimum</strong> number of port openings that I should do in the router config to have read/write functionality.</p> <p>EDIT: Client machine is a Vista one</p>
0non-cybersec
Stackexchange
134
486
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Pulling Data From One Data Frame Into Another. <p>I am wondering how to pull data from one data frame into another when there are two different filtering critera.</p> <p>my dataframe A is </p> <pre><code> TransactionNo Date AccountNo TransactionType Amount Currency 1 1000001 2019-07-01 10001 Spend -12.44 SGD 2 1000002 2019-07-01 10001 Spend -31.92 CNY 3 1000003 2019-07-03 10001 Spend -8.08 USD 4 1000004 2019-07-04 10001 Spend -6.02 SGD 5 1000005 2019-07-05 10001 Spend -5.04 USD 6 1000006 2019-07-06 10001 Spend -8.43 SGD </code></pre> <p>my dataframe B is</p> <pre><code> Date USD CNY SGD &lt;dttm&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; 1 2019-07-01 00:00:00 1.35 0.198 1 2 2019-07-02 00:00:00 1.40 0.198 1 3 2019-07-03 00:00:00 1.36 0.197 1 4 2019-07-04 00:00:00 1.37 0.197 1 5 2019-07-05 00:00:00 1.38 0.197 1 6 2019-07-06 00:00:00 1.39 0.197 1 </code></pre> <p>I want to create a new column in dataframe A called Exchange. The entries in this new column can be taken from dataframe B. The entries taken would depend on the matching of Currency and matching of Date within both dataframes. For example, the first row in dataframe A would be 1. Second row is 0.198. Third row is 1.36.</p> <p>The end code would look something like</p> <pre><code>A &lt;- mutate(A, Exchange = XXXXXXXXXXX) </code></pre> <p>I understand that everyone has their own responsibilities to fulfil in life, and as such your time is precious. I really appreciate all of you sacrificing your valuable time and energy in helping new programmers like me to learn basic programming. Thank you all so much.</p>
0non-cybersec
Stackexchange
603
1,823
Backing up Mac OSX to Windows/Samba share. <p>This should not be this hard ... is there an easy way to back up a mac to a windows share?</p> <p>so far, I've tried the suggestions here, but am getting error:<br> <a href="http://hupio.wordpress.com/2008/04/27/osx-timemachine-and-sambawindows-share/" rel="nofollow noreferrer">http://hupio.wordpress.com/2008/04/27/osx-timemachine-and-sambawindows-share/</a></p> <p>Surely this isn't the only way. I'm currently trying to use time machine, but really I'd appreciate any other (free) backup solutions that you can suggest.</p>
0non-cybersec
Stackexchange
193
576
What is wrong with Lubuntu 17.04 64-bit version?. <p>I have installed Lubuntu 16.10 32 bits on my computer but some softwares I have to use is 64 bits only, so I have to know if my system is 32 or 64 bit. After some searches on the web I have found the <code>lscpu</code> command but I'm confused how to read the information outputted by this command.</p> <p>They said to me if the output of lscpu contains lm flag it means I have a 64 bit computer. They also said to me to look at CPU op-mode(s) if contains 64-bit. I did it and flags contains lm and CPU op-mode(s) contains 64-bit. So I assumed my computer is 64-bit.</p> <p>I have downloaded lubuntu-17.04-desktop-amd64.iso and tried to install but when it is installing Lubuntu the monitor turns off and I need to restart computer. The installation fails.</p> <p>I can't install Lubuntu but I'm able to Try Lubuntu without installing. In this version I executed lscpu command and the output is shown below:</p> <pre><code>Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 15 Model name: Intel(R) Pentium(R) Dual CPU E2140 @ 1.60GHz Stepping: 13 CPU MHz: 1200.000 CPU max MHz: 1600,0000 CPU min MHz: 1200,0000 BogoMIPS: 3199.68 L1d cache: 32K L1i cache: 32K L2 cache: 1024K NUMA node0 CPU(s): 0,1 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm </code></pre> <p>lscpu command was executed in try version of Lubuntu. It seems I'm already running the 64-bit Lubuntu, I just cannot install it. Do I have a 64-bit computer? Should I try to install other version of Lubuntu?</p>
0non-cybersec
Stackexchange
681
2,177
something like cron (timer) in gevent. <p>How can I make classical timer in gevent?</p> <p>I'm currently using gevent.spawn_later but is there a way to use core.timer like saying "do callback on interval" just like cron does?</p> <pre><code>def callback(): # do something print '!' timer = core.timer(10, callback) timer.start() outpout: 0s 10s ! 20s ! 30s ! </code></pre>
0non-cybersec
Stackexchange
138
388
Load and using a font, but just in a single paragraph in an entire document. <p>I have a book document with a lot of formatting, and I would like my dedication paragraph to appear in a font, that will just be used here, in the entire document. Let's say I want to use Tex Gyre Chorus (<a href="http://www.tug.dk/FontCatalogue/texgyrechorus/" rel="nofollow noreferrer">here</a>) to be used in that paragraph.</p> <p>How to do this, without breaking everything, and inadvertently affecting the fonts I use for the rest of my document?</p> <p>Here is a toy example:</p> <pre><code>\documentclass[12pt]{book} \usepackage{lipsum} \usepackage{lmodern} \usepackage[sf=false]{libertine} \begin{document} \lipsum Hello World! I would like this text to appear in Tex Gyre Chorus. \lipsum \end{document} </code></pre>
0non-cybersec
Stackexchange
246
811
sed substitute one line into a part of the next line. <p>I have input like this:</p> <pre><code>*123456789 This is a &lt;secret&gt; Other stuff here. *987654321 This is a &lt;secret&gt; Other stuff here. </code></pre> <p>where "Other stuff here." could be one more lines, but the number prefixed by * is variable but will always take up the whole line, and will always appear on the line immediately before the "&lt;secret&gt;", which is a literal, fixed string that can be matched against.</p> <p>I'd like to be able to pipe this into a one-line command in a shell script such that the "*123456789" string will substitute the &lt;secret&gt; that appears on the next line, so that the output would be:</p> <pre><code>This is a *123456789 Other stuff here. This is a *987654321 Other stuff here. </code></pre> <p>I'm struggling to understand multi-line processing in sed and am open to using another tool if it's cleaner.</p>
0non-cybersec
Stackexchange
273
930
Authorization required error when accessing bitcoin using json RPC. <p>I'm trying to make a simple request to bitcoind using perl I followed the example from the <a href="https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29#Perl" rel="nofollow">API reference</a>, but it fails saying "401 Authorization Required"</p> <pre> #!/usr/bin/perl -w use JSON::RPC::Client; use Data::Dumper; my $client = new JSON::RPC::Client; $client->ua->credentials( 'localhost:8332', 'jsonrpc', 'bitcoinrpc' => 'mybitcoinrpcpassword' # REPLACE WITH YOUR bitcoin.conf rpcuser/rpcpassword ); my $uri = 'http://localhost:8332/'; my $obj = { method => 'getinfo', params => [], }; my $res = $client->call( $uri, $obj ); if ($res){ if ($res->is_error) { print "Error : ", $res->error_message; } else { print Dumper($res->result); } } else { print $client->status_line; } </pre> <p>Am I missing something obvious? Thanks for any help!</p>
0non-cybersec
Stackexchange
327
954
Ubuntu server has no internet connection after upgrade from 14.04 to 16.04. <p>I'm a bit new to linux and ubuntu specially command line stuff. So I currently have a VPS which was running on a 14.04 ubuntu LTS, and as I needed a 16.04 version, I searched and found the way to upgrade it. I SSHed into the server and started upgrading, everything went well and it asked for a restart and I let it. After that I'm not able to to ssh into it. I had a KVM thingy with a VNC to connect and see what is going on. I don't know if an ubuntu server should boot on default (log in a user) or not, but it wasn't booting and there was a message :</p> <p><code>/dev/vda1: clean, xxxx/xxxx files, xxxx/xxxx blocks</code> </p> <p>so I went to manually login using ctrl + alt + f2 and it is upgraded to 16.04 and the SSH service is running with no problem, but I noticed I couldn't do <code>apt-get update</code> or anything similar because I have no internet connection and after 24 hours searching I've come here asking for help.</p> <p>I don't if it may help but these are the results of the commands I've ran</p> <p><code>sudo lshw -C network</code> gives: <a href="https://i.stack.imgur.com/7EtWE.png" rel="nofollow noreferrer">lshw -C network</a></p> <p>and <code>systemctl status networking.service</code> gives : <a href="https://i.stack.imgur.com/VLMVN.png" rel="nofollow noreferrer">systemctl status networking.service</a></p>
0non-cybersec
Stackexchange
430
1,425
How many compatible linear orders exist on the classical Laver tables?. <p>Let <span class="math-container">$A_{n}$</span> be the unique algebra <span class="math-container">$(\{1,\dots,2^{n}\},*_{n})$</span> such that <span class="math-container">$x*_{n}1=x+1\mod 2^{n}$</span> and <span class="math-container">$x*_{n}(y*_{n}z)=(x*_{n}y)*_{n}(x*_{n}z)$</span> for all <span class="math-container">$x,y,z$</span>. We say that a linear ordering <span class="math-container">$\preceq$</span> on <span class="math-container">$\{1,\dots,2^{n}\}$</span> is compatible with <span class="math-container">$A_{n}$</span> if <span class="math-container">$y\preceq z\Rightarrow x*_{n}y\preceq x*_{n}z$</span>.</p> <p>What are some lower bounds and upper bounds of the value <span class="math-container">$t_{n}$</span>? I am more interested in lower bounds than in upper bounds. Since large cardinals may be used to produce compatible linear orderings on the classical Laver tables, it seems like large cardinals may be used to produce lower bounds on the number of linear orderings on the classical Laver tables.</p> <p><strong>Unverified statement:</strong> <span class="math-container">$(t_{0},\dots,t_{5})=(1, 2, 4, 8, 64, 128)$</span>.</p> <p>So from a compatible linear ordering <span class="math-container">$\preceq$</span> on <span class="math-container">$A_{n}$</span>, one obtains a compatible linear ordering <span class="math-container">$\preceq'$</span> on <span class="math-container">$A_{n-1}$</span> defined by <span class="math-container">$x\preceq'y$</span> iff <span class="math-container">$x+2^{n-1}\preceq y+2^{n-1}$</span>. Furthermore, the mapping <span class="math-container">$\preceq\mapsto\preceq'$</span> seems to satisfy a sort of Lagrange's theorem (this observation is also unverified): if <span class="math-container">$\preceq_{1},\preceq_{2}$</span> are compatible linear orderings on <span class="math-container">$A_{n-1}$</span> then there seems to be an equal number of compatible linear orderings <span class="math-container">$\preceq$</span> on <span class="math-container">$A_{n}$</span> with <span class="math-container">$\preceq'=\preceq_{1}$</span> as there are linear orderings <span class="math-container">$\preceq$</span> with <span class="math-container">$\preceq'=\preceq_{2}.$</span> Furthermore, it seems like <span class="math-container">$t_{n}$</span> is always a power of <span class="math-container">$2$</span>. However, when studying Laver tables one should be cautious since many patterns that appear in the Laver tables are only temporary.</p> <p><strong>Computation:</strong> Producing compatible linear orderings <span class="math-container">$\preceq$</span> on <span class="math-container">$A_{n}$</span> requires surprisingly little brute force search since to produce a linear ordering <span class="math-container">$\preceq$</span>, we start off with a compatible linear ordering <span class="math-container">$\preceq^{-}$</span> on <span class="math-container">$A_{n-1}$</span> and then use evolutionary computation to slowly produce a compatible linear ordering <span class="math-container">$\preceq$</span> on <span class="math-container">$A_{n}$</span> with <span class="math-container">$\preceq^{'}=\preceq^{-}$</span>.</p>
0non-cybersec
Stackexchange
1,000
3,281
Google Charts / visualisations column width. <p>I am using the Google Chart API, and converted a line chart (see below) into a column chart, however the column widths change depending on the quantity of data columns. If I hover over, it tells me the correct date, however because of the changing width of the column you cannot actually accurately see the date the column should represent. A point would work, so I could revert to a line chart however, a column does look better for the data set I am using. Any idea how to solve this issue? </p> <p>Date is dynamic, so the X axis has to be variable.</p> <p>Thanks</p> <pre><code>// Create a line chart, passing some options var LineChart = new google.visualization.ChartWrapper({ 'chartType': 'ColumnChart', 'containerId': 'chart_div', 'options': { 'vAxis': {'title': 'Species Abundance', 'minValue': 0, 'maxValue': 32}, 'width': 300, 'height': 300, 'legend': 'top', 'title': 'Selected Site and Species abundance over time' }, 'view': {'columns': [0, 1]}, }); </code></pre> <p><img src="https://i.stack.imgur.com/TL9Ze.gif" alt="Example Graphs"></p>
0non-cybersec
Stackexchange
332
1,367
jQuery - How do I bind events to hidden elements that will be shown later?. <p>I am trying to attach 'click' events to all elements of a particular class. The problem is some of the elements are on a tab that is hidden (display: none) at the time that the event is bound. (.bind()). It seems that when these elements are shown the events are no longer bound.</p> <pre><code>$('a.someClass').bind('click', function(){ alert("test"); }); </code></pre> <p>The hidden elements do not appear to have a click event bound. If I select the hidden elements:</p> <pre><code>$('a.someClass:hidden').bind('click', function(){ alert("test"); }); </code></pre> <p>It seems the click event is not bound when these elements are no longer hidden. Has anyone experienced this? Is there a way to bind and event to elements irregardless of their display property?</p> <p>Thanks</p>
0non-cybersec
Stackexchange
238
871
How to find out which dependency caused a particular library to be downloaded?. <p>When runing my SBT project, there is a line in console output:</p> <pre><code>[info] downloading http://repository/nexus/content/groups/public/org/jboss/netty/netty/3.2.3.Final/netty-3.2.3.Final.jar ... [info] [SUCCESSFUL ] org.jboss.netty#netty;3.2.3.Final!netty.jar(bundle) (651ms) </code></pre> <p>How to find out which project dependency caused the netty.jar to be downloaded?</p>
0non-cybersec
Stackexchange
164
471
Question on the Mandelbrot set.. I was just watching a documentary on the Mandelbrot set narrated by Arthur C. Clark and in it he says that "...And no matter how much we magnified it, a million times, a billion times, until the original set was bigger than the entire universe. We would still see new patterns, new images emerging because the frontier of the inset is Infinately complex." Here's my question: If the patterns and images are INFINITELY complex does that mean deep down somewhere there's parts that coincidentally look like random real world objects? I mean we're talking infinity. Somewhere in the infinite combinations there should be a glob that looks exactly like me riding a chariot fighting off other gladiators in ancient Rome right? (just an example of something random)
0non-cybersec
Reddit
177
798
YSK that if taking multiple medications, you can get them all refilled on the same cycle with just a little bit of effort.. The term is 'refill synchronization' and it is a tool to improve adherence and to simplify your life. Step 1: consolidate to as few pharmacies as possible. One local store and one mail order should be the goal, but it will work with any number. This will help you in other ways too, since one pharmacist can see and identify combinations of things that can be troublesome. Step 2: Contact the pharmacy and request refill synchronization. If your 90 day mailorder scripts are far apart, you may have to ask for an early refill. Step 3: Followup. If things are still off, call again and ask. Step 4: Ask each time you submit a new script, and stick with it. With a bit of effort and followup you could theoretically get any number of medications refilled/delivered together. There are some special exceptions that make this difficult, but if you ask your pharmacist to advocate for you, it can be done with most everything.
0non-cybersec
Reddit
244
1,056
What are my options for sending email from my VPS with a Blacklisted IP. <p>I have postfix and dovecot running on debian 7, I can send mail fine, but it keeps going to my spam folder when sent to google accounts. Another user who doesn't use gmail said it was delivered to his inbox. When I send a test message to myself I get the following headers:</p> <pre><code>Delivered-To: [email protected] Received: by 10.170.37.203 with SMTP id 194csp288892ykf; Fri, 29 Aug 2014 21:45:25 -0700 (PDT) X-Received: by 10.236.70.105 with SMTP id o69mr20864964yhd.25.1409373925239; Fri, 29 Aug 2014 21:45:25 -0700 (PDT) Return-Path: &lt;[email protected]&gt; Received: from fluidvector.com ([2605:f700:100:400::875a:4b61]) by mx.google.com with ESMTPS id s36si567167yhp.30.2014.08.29.21.45.24 for &lt;[email protected]&gt; (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Aug 2014 21:45:24 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning [email protected] does not designate 2605:f700:100:400::875a:4b61 as permitted sender) client-ip=2605:f700:100:400::875a:4b61; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning [email protected] does not designate 2605:f700:100:400::875a:4b61 as permitted sender) [email protected] Received: from localhost (localhost.localdomain [127.0.0.1]) by fluidvector.com (Postfix) with ESMTP id 725E7123A0C9F for &lt;[email protected]&gt;; Sat, 30 Aug 2014 00:45:23 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at fluidvector.com Received: from fluidvector.com ([127.0.0.1]) by localhost (fluidvector.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oI9bUVMx6Thv for &lt;[email protected]&gt;; Sat, 30 Aug 2014 00:45:19 -0400 (EDT) Received: by fluidvector.com (Postfix, from userid 33) id 17DA0123A0CA1; Sat, 30 Aug 2014 00:45:19 -0400 (EDT) To: =?UTF-8?B?dGVzdA==?= &lt;[email protected]&gt; Subject: =?UTF-8?B?V2VsY29tZSB0byAiQmVhbnNXb3J0aHki?= X-PHP-Originating-Script: 1000:messenger.php From: &lt;[email protected]&gt; Reply-To: [email protected] </code></pre> <p>I notice the lines </p> <pre><code>Received-SPF: softfail (google.com: domain of transitioning [email protected] does not designate 2605:f700:100:400::875a:4b61 as permitted sender) client-ip=2605:f700:100:400::875a:4b61; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning [email protected] does not designate 2605:f700:100:400::875a:4b61 as permitted sender) [email protected] </code></pre> <p>which I assume means there's an issue with my SPF TXT DNS record: <code>v=spf1 a:fluidvector.com ~all</code>, even though pySPF says it's good.</p> <p>I've looked up on mxtoolbox.com and found that for some reason, my IP (which I obtained from my VPS provider) is apparently blacklisted on Barracuda and spamcannibal. I've contacted my VPS provider, but they didn't seem to be able to do anything for me. So, at this point I assume I'm limited to just contacting the black lists and pleading to have my IPs removed? What are my options here? Can I get gmail to let mail from my servers be delivered to inbox instead of the spam folder without the headache of trying to get unlisted?</p>
0non-cybersec
Stackexchange
1,230
3,504
tifu by biting my nails during class. I had a big test today, probably make or break in terms of whether or not I pass this class. Having arrived to class about 10 minutes early, I proceeded to twiddle my thumbs for a bit. I slightly regretted leaving my phone in my car, otherwise I would've been on reddit. One particularly long fingernail caught my attention and I decided to bite it. I hate biting my fingernails, BTW. Satisfied with my work, I went back to staring at the wall, but deep down I knew I would end up biting more nails during this test. Sure enough, staring blankly at the test, I began to bite at more of them. My left thumbnail proved especially tough, so I bit harder. It abruptly gave way and my front teeth hit one of my bottom teeth (Lower right incisor) it was a little startling, but nothing too dramatic. Fast forward a few hours. I notice that when I breathe I have a searing pain on one of my teeth, the kind you get when you're eating something cold. I proceed to check the mirror and find a tiny, almost completely imperceptible chip in the tooth, and a 3 or 4 mm hairline fracture (for lack of a better word) on the tooth in question. I'll be setting up a dentist appointment first thing tomorrow, hopefully it won't be too big of a deal to fix. Aesthetically, it doesn't even matter, but it's surprisingly frustrating needing to consciously avoid breathing out of one side of your mouth. TL;DR: bit a tough fingernail, chipped a tooth and now have frustrating sensitivity. Don't bite your nails kids, it kills.
0non-cybersec
Reddit
402
1,587
Solving $|x-1|+|2-x|&gt;3+x$. <p>So I've tried separating this problem into three cases</p> <p><strong>First Case</strong></p> <p><span class="math-container">$$\begin{cases}(x-1)+(2-x)&gt;3+x...(a) \\x\geq2...(b) \end{cases}$$</span> from (a)</p> <p><span class="math-container">$\Rightarrow x&lt;-2 $</span></p> <p>From <span class="math-container">$(a)\cap(b)$</span></p> <p><span class="math-container">$x\in \emptyset $</span></p> <p><strong>Second case</strong></p> <p><span class="math-container">$$\begin{cases}(x-1)-(2-x)&gt;3+x...(c) \\ x \in [1,2)...(d) \end{cases}$$</span></p> <p>From (c)</p> <p><span class="math-container">$\Rightarrow x&gt;6$</span></p> <p>From <span class="math-container">$(c)\cap(d)$</span></p> <p><span class="math-container">$x \in \emptyset$</span></p> <p><strong>Third and final case</strong></p> <p><span class="math-container">$$\begin{cases} -(x-1)-(2-x)&gt;3+x...(e) \\ x&lt;1...(f) \end{cases}$$</span></p> <p>From (e)</p> <p><span class="math-container">$\Rightarrow x&lt;-4 $</span></p> <p>From <span class="math-container">$(e)\cap(f)$</span></p> <p><span class="math-container">$\Rightarrow x&lt;-4$</span></p> <p>So my final solution should be the union of all these cases</p> <p><span class="math-container">$\Rightarrow x&lt;-4$</span></p> <p>But wolfram says solutions are <span class="math-container">$x&lt;0 \cup x&gt;6$</span></p> <p>I can't seem to find where I made a mistake please help.</p>
0non-cybersec
Stackexchange
609
1,472
Find all embeddings $\mathbb Q(\alpha)$ to $\mathbb C$. <p>Here <span class="math-container">$\alpha$</span> is a root of <span class="math-container">$x^6+x^3+1$</span>.</p> <p>What I figured out:</p> <p>let <span class="math-container">$\beta = e^{\frac{2\pi i}{9}}$</span>. <span class="math-container">$\mathbb Q(\alpha)$</span> is the splitting field of <span class="math-container">$x^6+x^3+1$</span>. Such an embedding must fix <span class="math-container">$\mathbb Q$</span>, and send a root of <span class="math-container">$x^6+x^3+1$</span> to another root. So there are in total <span class="math-container">$6$</span> of them. How should I write them down explicitly?</p>
0non-cybersec
Stackexchange
235
686
Error: The newtxmath and tensor packages with subscriptcorrection. <p>Compiling the following Minimal Broken Example</p> <pre><code>\documentclass{article} \usepackage{newtxtext} \usepackage[subscriptcorrection]{newtxmath} %\usepackage[lite,subscriptcorrection]{mtpro2} \usepackage{tensor} \begin{document} Consider the following: \[ A_f = R\indices{_\mu^{\sigma\nu}} \] \end{document} </code></pre> <p>leads to the following error messages:</p> <pre><code>! Package tensor Error: Sub/Superscript items out of order on input line 9, (tensor) some index tokens may now have been lost. See the tensor package documentation for explanation. Type H &lt;return&gt; for immediate help. ... l.9 A_f = R\indices{_\mu^{\sigma\nu}} ? </code></pre> <p>However, the code compiles perfectly fine if</p> <ul> <li>one uses <code>\usepackage{newtxmath}</code>, i.e., without&nbsp;<code>subscriptcorrection</code>; OR</li> <li>one uses <code>\usepackage[lite]{mtpro2}</code>; OR</li> <li>one uses <code>\usepackage[lite,subscriptcorrection]{mtpro2}</code>.</li> </ul> <p>What is going on here? Is there a fix to this problem?</p> <p><strong>Added</strong>: I have noticed that both&nbsp;<code>newtxmath</code> and&nbsp;<code>mtpro2</code> implement <code>subscriptcorrection</code> by making the underscore&nbsp;<code>_</code> active (although it is more likely that <code>newtxmath</code> is inspired by&nbsp;<code>mtpro2</code>).</p> <hr> <p>P.S. The working output if one uses <code>\usepackage[lite,subscriptcorrection]{mtpro2}</code>:</p> <p><a href="https://i.stack.imgur.com/Hpcyd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hpcyd.png" alt="MWE with mtpro2"></a></p>
0non-cybersec
Stackexchange
588
1,759
Disc image Windows 8. <p>I've tried to download a disc image via torrent and now I can't delete it.</p> <p>Every time I click delete I can tell from my task manager that it opens the file which appears to be why I can not delete it.</p> <p>How can I force delete this file? Since it is a disc image will I have to eject it somehow? Etc.</p> <p>It worries me to have such a file on my computer.</p> <p>(it's an ISO-file)</p>
0non-cybersec
Stackexchange
131
428
Warning message: in rbindlist(allargs) : NAs introduced by coercion: possible bug in data.table?. <p>While analysing some data, I came across the warning message, which I suspect to be a bug as it is a pretty straightforward command that I have worked with many times.</p> <pre><code>Warning message: In rbindlist(allargs) : NAs introduced by coercion </code></pre> <p>I was able to reproduce the error. Here's a code with which you should be able to reproduce the error.</p> <pre><code># unique random names for column V1 set.seed(45) n &lt;- sapply(1:500, function(x) { paste(sample(c(letters[1:26]), 10), collapse="") }) # generate some values for V2 and V3 dt &lt;- data.table(V1 = sample(n, 30*500, replace = TRUE), V2 = sample(1:10, 30*500, replace = TRUE), V3 = sample(50:100, 30*500, replace = TRUE)) setkey(dt, "V1") # No warning when providing column names (and right results) dt[, list(s = sum(V2), m = mean(V3)),by=V1] # V1 s m # 1: acgmqyuwpe 238 74.97778 # 2: adcltygwsq 204 79.94118 # 3: adftozibnh 165 75.51515 # 4: aeuowtlskr 164 75.70968 # 5: ahfoqclkpg 192 73.20000 # --- # 496: zuqegoxkpi 93 77.95000 # 497: zwpserimgf 178 72.62963 # 498: zxkpdrlcsf 154 78.04167 # 499: zxvoaeflhq 121 75.34615 # 500: zyiwcsanlm 180 76.61290 # Warning message and results with NA dt[, list(sum(V2), mean(V3)),by=V1] # V1 V1 V2 # 1: acgmqyuwpe 238 74.97778 # 2: adcltygwsq 204 79.94118 # 3: adftozibnh 165 75.51515 # 4: aeuowtlskr 164 75.70968 # 5: ahfoqclkpg 192 73.20000 # --- # 496: zuqegoxkpi NA 77.95000 # 497: zwpserimgf NA 72.62963 # 498: zxkpdrlcsf NA 78.04167 # 499: zxvoaeflhq NA 75.34615 # 500: zyiwcsanlm NA 76.61290 Warning message: In rbindlist(allargs) : NAs introduced by coercion </code></pre> <ul> <li><p>1) It seems that this happens if you don't provide the column names.</p></li> <li><p>2) Even then, in particular, when <code>V1</code> (or the column you use in <code>by=</code>) has a lot of <code>unique</code> entries (500 here) and you don't specify column names, then this seems to happen. That is, this <strong>DOES NOT</strong> happen when the <code>by=</code> column <code>V1</code> has <em>fewer</em> unique entries. For example, try changing the code for <code>n</code> from <code>sapply(1:500, ...</code> to <code>sapply(1:50, ...</code> and you'll get no warning.</p></li> </ul> <p>What's going on here? Its R version 2.15 on Macbook pro with OS X 10.8.2 (although I tested it on another macbook pro with 2.15.2). Here's the <code>sessionInfo()</code>.</p> <pre><code>&gt; sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] data.table_1.8.6 reshape2_1.2.2 loaded via a namespace (and not attached): [1] plyr_1.8 stringr_0.6.2 tools_2.15.0 </code></pre> <p>Just reproduced with <code>2.15.2</code>:</p> <pre><code>&gt; sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] data.table_1.8.6 </code></pre>
0non-cybersec
Stackexchange
1,364
3,512
Flow along hyperbolas. <p>Let’s say there are some hyperbolas:</p> <p><a href="https://i.stack.imgur.com/zWuHn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zWuHn.png" alt="enter image description here"></a></p> <p>and points are told to flow along the hyperbolic curves. I’ve read about horocyclic flow on the space of unit lattices. </p> <p>I think it would make sense to use matrices to apply a linear transformation acting on the space of unit lattices to achieve a flow of constant speed.</p> <blockquote> <p>Q: Is it possible to use matrices to describe the dynamics of points that flow at different speeds along the curves? Are matrices equipped to deal with such flows?</p> </blockquote> <p>Context: </p> <p><a href="http://www.stevejtrettel.com/the-space-of-lattices.html" rel="nofollow noreferrer">The Space of Lattices</a></p> <p><a href="http://www.josleys.com/articles/ams_article/Lorenz3.htm" rel="nofollow noreferrer">Lorenz and Modular Flows</a></p>
0non-cybersec
Stackexchange
325
996
Show that space is not metrizable. <p>Let <span class="math-container">$X=C([0,1], \mathbb{R})$</span>, <span class="math-container">$f \in X$</span>, <span class="math-container">$\epsilon &gt;0$</span> and <span class="math-container">$x_1,...,x_n$</span> in [0,1]. Consider:</p> <p><span class="math-container">$V_{f,x_1,...,x_n,\epsilon}= \{ g \in X : |f(x_i)-g(x_i)| &lt; \epsilon, i=1,...,n \}$</span> and <span class="math-container">$\tau= \{ U \subset X: \forall f \in U, \exists \epsilon&gt;0, \exists x_1, ..., x_n \in [0,1] \ such \ that \ V_{f,x_1,...,x_n,\epsilon} \subset U \}$</span></p> <p>I have already shown that <span class="math-container">$\tau$</span> is topology and that any sequence in <span class="math-container">$X$</span> converges with respect to <span class="math-container">$\tau$</span> if and only if it converges pointwise.How do I show that <span class="math-container">$\tau$</span> is not metrizable?</p>
0non-cybersec
Stackexchange
353
952
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
I hate a person that no one can hate. Asking for advice.. I feel uncontrollably selfish, at times jealous, and full of rage whenever I hear the name of the one kid in my class that cannot be hated. He is the valedictorian, captain of every team we play on, head of every club and student board. He has received every possible award for academics. Every award possible for character. He always is respectful. And he never does wrong. One of the staff even made the claim that the teacher must have made an error when this kid did not get a 100 on a test. I know that I shouldn’t, that this kid doesn’t deserve the cold shoulder and what’s worse is that he is my friend. We go to parties, together play on the same sports teams, we share our views on politics, and he has even opened up to me about certain events that have caused him concern. Being in every class together and being around him often, I have always been put down as lesser, as second to him. I am always present when he is acknowledged as never being able to do wrong. And I have always been there to see him excel. Coincidence has even shown we have some of the same hobbies. Ping pong, solving rubix cubes etc. and he has bested me in almost every discipline. I was naturally a little jealous that he could better me this way. But I have mainly been humble and supporting. However, I think it has almost gone too far. I mean to say that there seems to be some higher power that can read my thoughts. This is the extent of the craziness that has occurred. A recent example has shown this to be true as a great injustice has befallen him. Because of his character, known throughout our community, everyone has been supporting him verbally and on social networks. A similar injustice was done to me, yet not a word by anyone was spoken about it. Unfortunately, due to the personal and true example I can not disclose the injustice. I just don’t know how to deal with this. In a year we will be gone for college and I will likely not talk to him for a time. Yet there will still be those around me who do. He comes from a very loving and supportive family, with money and time. I do not say this to pity myself, but I think that there could be correlation between environment and social perception. I am part of a broken (divorced) family. Mother dealing with Alcoholism and father rarely spending quality time anymore. With siblings with separate lives as they are older. I am not hated by those around me. I am of good character and have great academic standing. But I am never credited as such. I feel like I am living in the shadow of this kid and cannot get away from him and the dialogue when his name is brought up. I remain nice to him, we are friendly together. Am I just selfish and full of self pity? Has anyone had a similar experience? How can I overcome these feelings of longing for his position and hatred of him? Edit: This has been true since the 7th grade.
0non-cybersec
Reddit
684
2,964
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to access an element of a set using an equivalent object?. <p>If I have an object that compares equal to an element of a Python set, but is not the same object, is there a reasonable way to get a reference to the object in the set? The use case would be using the set to identify and share duplicated data.</p> <p>Example (Python 2.7):</p> <pre><code>&gt;&gt;&gt; a = "This is a string" &gt;&gt;&gt; b = "This is a string" &gt;&gt;&gt; a is b False &gt;&gt;&gt; a == b True &gt;&gt;&gt; s = set((a,)) &gt;&gt;&gt; b in s True </code></pre> <p>How to get a reference to <code>a</code> using <code>b</code> and <code>s</code>? I can think of one way, but I'm not sure if it is not implementation-dependent whether you get <code>a</code> or <code>b</code>. <strong>EDIT:</strong> This does not work when s has more than one element; intersection is quite naturally implemented something like <code>[x for x in smaller_set if x in larger_set]</code></p> <pre><code>&gt;&gt;&gt; for x in set((b,)).intersection(s): c = x ... &gt;&gt;&gt; c is a True </code></pre> <p>Perhaps a good workaround would be to use a dict that maps each key to itself, instead of the set.</p>
0non-cybersec
Stackexchange
386
1,174
How do I view the signature of an iOS application?. <p>OSX <a href="http://techcrunch.com/2015/11/12/all-mac-store-apps-stopped-working-due-to-expired-security-certificate" rel="nofollow noreferrer">had an issue where the certificate was expired</a> and several apps could not be opened after that date.</p> <p><a href="https://i.stack.imgur.com/z2Dbi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z2Dbi.png" alt="enter image description here"></a></p> <p>The command above illustrates how this could have been detected.</p> <p>Does iOS have a similar expiration? How can I inspect or view it?</p>
1cybersec
Stackexchange
204
623
addition theorems for hypersine. <p>I learned from Wolfram MathWorld about <a href="http://mathworld.wolfram.com/Hypersine.html" rel="nofollow noreferrer">hypersine</a>, as being a dimensional analog trig function for hypersolid angles. There it is being defined by</p> <blockquote> <p>The hypersine (<span class="math-container">$n$</span>-dimensional sine function) is a function of a vertex angle of an <span class="math-container">$n$</span>-dimensional parallelotope or simplex. If the content of the parallelotope is <span class="math-container">$P$</span> and the contents of the <span class="math-container">$n$</span> facets of the parallelotope that meet at vertex <span class="math-container">$v_0$</span> are <span class="math-container">$P_k$</span>, then the value of the <span class="math-container">$n$</span>-dimensional sine of that vertex is <span class="math-container">$$\sin(v_0)=\frac {P^{n-1}}{\prod^n_{k=1}P_k}$$</span> […] The vertex simplex of a vertex of an <span class="math-container">$n$</span>-dimensional parallelotope is the simplex that has as its vertices that vertex and the <span class="math-container">$n$</span> adjacent vertices of the parallelotope. Its content (and the content of all the other vertex simplices) is the content of the parallelotope divided by <span class="math-container">$n!$</span>. If the content of an <span class="math-container">$n$</span>-dimensional simplex is <span class="math-container">$S$</span>, and the contents of the <span class="math-container">$n$</span> facets that meet at vertex <span class="math-container">$v_0$</span> are <span class="math-container">$S_1, S_2,..., S_n$</span>, the simplex can be considered a vertex simplex of a parallelotope, and the facets also vertex simplices of the facets of the parallelotope with respect to the same vertex. Substituting in [the above] equation gives <span class="math-container">$$\sin(v_0)=\frac {(n!\ S)^{n-1}}{\prod^n_{k=1}(n-1)!\ S_k}$$</span></p> </blockquote> <p>Confering the first defining equation to the area formula of a parallelogram, it becomes obvious that this definition is nothing but the usual sine function for <span class="math-container">$n=2$</span>.</p> <p>This article moreover continues on how to calculate the latter formula when knowing the respective dihedral angles <span class="math-container">$\alpha_{jk}$</span> between <span class="math-container">$S_j$</span> and <span class="math-container">$S_k$</span>.</p> <p>Applying this makes it easy to get the hypersine of the corner angle of any <em>hypercube</em> generally: <span class="math-container">$$\sin(v_0)=1$$</span></p> <p>Even the hypersine of the corner angle of any <em>regular simplex</em> could be calculated to: <span class="math-container">$$\sin^2(v_0)=\frac{(n+1)^{n-1}}{n^n}=\frac1{n+1}\ \left(1+\frac1n\right)^n$$</span></p> <p>But in order to calculate correspondingly the hypersine of the corner angle of the <em>orthoplex</em> one needs to extrapolate this function to non-simplicial corners as well. One clearly could easily subdivide the orthoplex corner symmetrically into <span class="math-container">$2^{n-1}$</span> equal (mostly right-angled) simplices, but then again one needs to know about addition theorems for this hypersine function.</p> <p>Is there anything being known in this direction or could anything be derived for that purpose? - I would be very grateful to learn about it.</p> <p>--- rk</p>
0non-cybersec
Stackexchange
1,013
3,459
Prove for all sets A, B and C, if (B ∩ C) ⊆ A, then (A-B) ∩ (A-C) ≠ ∅. <p>This question was previously asked here: <a href="https://math.stackexchange.com/questions/2860480/for-all-sets-a-b-and-c-if-b-%E2%88%A9-c-%E2%8A%86-a-then-a-b-%E2%88%A9-a-c-%E2%89%A0%E2%88%85">For all sets A,B, and C, If B ∩ C ⊆ A, then (A-B) ∩ (A-C) ≠∅</a></p> <p>However, it didn't help me much so I wanted if someone could verify my working and correct me where I am wrong.</p> <p><strong>My initial question is:</strong> For all sets <span class="math-container">$A$</span>, <span class="math-container">$B$</span> and <span class="math-container">$C$</span>, if <span class="math-container">$(B ∩ C) ⊆ A$</span>, then <span class="math-container">$(A-B) ∩ (A-C) ≠ ∅$</span></p> <p>I know this is true by drawing a Venn Diagram.</p> <p><strong><em>Proof:</em></strong> <span class="math-container">$(B ∩ C) ⊆ A$</span></p> <p><span class="math-container">$x∈(B∩C)⇒x∈A$</span></p> <p><span class="math-container">$x∈(B∩C)^c ∩ A$</span></p> <p><span class="math-container">$x∈A∩(B^c∩C^c)$</span></p> <p><span class="math-container">$x∈(A∩B^c)∩(A∩C^c)$</span></p> <p>Which is <span class="math-container">$(A-B)∩(A−C)≠∅$</span></p> <p>Thank you for any help.</p>
0non-cybersec
Stackexchange
586
1,249
How to detect values changed in Data class Kotlin?. <p>I want to detect any values changed of a property of my class so then I could do another operation after that. In other word, if one of a specific data of a property is changed, then a specific event will fire by then. Actually, if it is a normal class in another programming languages such as Java, then I think I could use setter to do this job after data have modified or use delegate in C#. But since Kotlin is very new, I could not find any solution out there at all. I have tried to overload property but was not successful by any chance. I wanted to use interface to to this too, but again since it is data class, I got no idea how should it be done. </p> <p>Below is the sample class. In such situation, how to detect when Age or name is changed?</p> <pre><code>data class Person(var Name: String, var Age: Int) </code></pre> <p>So please if anyone have any ideas about this, please help.</p> <p><em>Note: in my situation, data class must be used.</em></p>
0non-cybersec
Stackexchange
268
1,026
What do we actually mean when we say Finite (Union/Intersection) or Arbitrary(Union/Intersection)?. <p>These two things - <strong>Finite(Union/Intersection)</strong> and <strong>Arbitrary(Union/Intersection)</strong>- we use so much in Topology - in fact the defining criteria are dependent upon these but after such long time spent with Topology I'm starting to feel I do not understand the difference at all. </p> <p>$1.$ In a topology , <strong>open</strong> sets are closed under <strong>arbitrary union</strong> and <strong>finite intersection</strong>.</p> <p>$2.$ <strong>Colsed</strong> sets are closed under <strong>finite union</strong> and <strong>arbitrary intersection.</strong></p> <p>$3.$`<strong>Ideal</strong> of sets are closed under <strong>finite union.</strong></p> <p>$4.$ Finite union of finite sets are finite.</p> <p>Well when we say <em>finite union</em> of open sets , exactly at which point before $\infty$ do we stop intersecting$?$ For example,this set $\Omega =\left\{\left(0,{1\over n}\right)\right\}_{n=1}^{\infty}$ is a collection of open sets from $\mathbb R$ and I know intersection of a <strong>finite</strong> number of elements is again of the form $\{(0,{1\over m})\}$ and their <strong>arbitrary</strong> intersection is $\Phi$.</p> <p>Now let us intersect only $k$ members of $\Omega.$ Now with that I intersect the $(k+1)$th element-again an open set ,intersect the $(k+2)$nd element and again get another,possibly smaller, open set. Now we continue this way , where do we stop to make sure we are not touching $\infty ?$</p> <p>Same goes for the <strong>closed sets</strong>.</p> <p>An <strong>admissible ideal</strong> $I$ contains all the singletons. Now take,say, $k$ of them ($k\lt \infty$) and get a $k$-ton member of $I$. Take union of $2$ such $k$-tons and get a $2k$-ton.Since the whole set in not contained in $I$,so the union cannot be <strong>arbitrary.</strong> It has to be finite.So,we have to stop somewhere.If we stop at the $p$th step,well that does not make sense 'cause the $(p+1)$th step is also valid.So, what's happening here? </p> <p>I know my way of thinking must have some very stupid flaw in it.But I've been trying and failing to explain this to myself or say,put it into meaningful words. So please help me get this right and clear and understand the distinction clearly.</p> <p>Thank you.</p>
0non-cybersec
Stackexchange
687
2,377
Conditional Expectation of dice rolls. <p>A 6-sided die is rolled for 10 times. The die rolls are mutually independent. Each die uniformly likely to result in a digit from 1,2, 3, 4, 5, and 6. Let X denote the sum of the first 6 rolls and Y denote the sum of the last six rolls.</p> <p>Find E(X|Y).</p> <p>I have found E(X), E(Y), Var(X), Var(Y), Cov(X,Y), and Corr(X,Y).</p> <p>I wish I had input, but am relatively new to statistics and don't know where to start on this problem. Thanks in advance. </p>
0non-cybersec
Stackexchange
172
512
Is there any downside to commit messages containing the ticket number. <p>I was wondering if it would be good practice for commit messages to contain the ticket number they were apart of. It would be like </p> <pre><code> 2568 Fix heating issue Summary of the issue with a bunch of detailed comments </code></pre> <p>It would be a bit of a pain to get the ticket or isse # in each commit and I am wondering if people think it would be worth it in the long run. Also if my branch has the ticket number is this redundant? The main issue is that I use source tree and that in the log / history view it can get a little complicated to see what commit corresponds with what ticket. I just would like a better way to see how everything works.</p>
0non-cybersec
Stackexchange
178
751
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
Deriving $\frac{\partial{v}}{\partial{z}}$ using chain rule. <p>A problem from one of past exams at my uni reads: </p> <blockquote> <p>Suppose <span class="math-container">$xy^2 + yz^2 = 2$</span> and <span class="math-container">$v = xy^3$</span> where <span class="math-container">$x, y, z$</span> and <span class="math-container">$v$</span> are all variables. Using a chain rule, express <span class="math-container">$\partial{v}/\partial{z}$</span> as a function of <span class="math-container">$x, y, z$</span>. </p> </blockquote> <p>I just don't think I really get multivariable calculus... I know (?) I can write <span class="math-container">$$\frac{\partial v}{\partial z}= \frac{\partial v}{\partial x}\frac{\partial x}{\partial z}+\frac{\partial v}{\partial y}\frac{\partial y}{\partial z}$$</span>, and clearly <span class="math-container">$\frac{\partial v}{\partial x}=y^3$</span> and <span class="math-container">$\frac{\partial v}{\partial y}=3xy^2$</span>, so that <span class="math-container">$$\frac{\partial v}{\partial z}= y^3\frac{\partial x}{\partial z}+3xy^2\frac{\partial y}{\partial z}.$$</span> Now, <span class="math-container">$xy^2+yz^2=2$</span>, so <span class="math-container">$x=\frac{2}{y^2}-\frac{z^2}{y}$</span>, and I probably can write <span class="math-container">$$\frac{\partial x}{\partial z} = -2\frac{z}{y}, $$</span> but how do I go about deriving <span class="math-container">$\frac{\partial y}{\partial z}$</span>? Or does all of it make no sense and I should proceed in a completely different way?</p>
0non-cybersec
Stackexchange
503
1,554
Why is DbContext per-request?. <p>There are other similar SO questions out there, but none that really answer my specific question:</p> <p>If an MVC controller is created for every request then what is the advantage of DbContext being per-request (assuming I’m injecting it into the controller)? Wouldn’t transient achieve the same result?</p> <p>For example, say I have a data entry/edit form - the controller would have a ‘get’ method to retrieve the entity to be edited from the db, and a ‘post’ method to save back to the db (this would involve retrieving the entity again, update the changed values, then SaveChanges). Get and Post are separate requests, so I don’t see how a per-request DbContext helps here.</p> <p>What am I missing? In what scenarios is a per-request DbContext useful?</p>
0non-cybersec
Stackexchange
202
801
2 tips you can use to have better, more interesting, less awkward conversations, and 1 tip you can use to start conversations quickly. **Preface:** *I've been seeing a lot of questions lately about how to start and have more interesting conversations. This post was adapted from [this comment.](https://www.reddit.com/r/socialskills/comments/bkc5tr/26_year_old_virginincel_need_help/emfxudb/)* *Here are 3 things you can start testing next week to have better, more interesting, less awkward conversations:* **#1. The 30 Second Win: Starting Conversations Quickly** When we’re entering into a social situation, it’s really important to get a quick win. Let's say you're at a party. What most people do: walk in, grab a drink, and then they check their phone and don't start conversations. A better approach: The next time you're in a situation where you know you'll want to be social, as soon as you walk into a party, work, or wherever, start a 30 second timer in your head. You have 30 seconds to start walking up to someone to introduce yourself and start a conversation. The reason this is so crucial is because 30 seconds doesn’t give you enough time to overthink the situation, or start feeling nervous. What should you say? Here, it’s really useful to have a couple of word-for-word scripts to pull out in almost any situation. No need to overcomplicate this. Simple beats complex every time. Here are a few of my favorites scripts to get you started: *“Hi, my name’s Jeff”* *“I don’t think we’ve met before, I’m Jeff”* *“Hey, I wanted to come over and introduce myself, my name’s Jeff”* Notice how they aren’t fancy, but they get the job done. **Action step: Think about the next event, party, or situation you might be able to test out the 30-second win.** **#2 The Iceberg Effect: Develop A Wide Range Of Interests So That You Can Connect With People** Icebergs have a tip that sits above the water, and much more that hides below the surface. Iceberg tip: People who seem to seamlessly slide into any conversation and offer an opinion or comment? Below the surface: They likely listen to a wide variety of audiobooks, podcasts, and read a few interesting articles per day. Real talk. If you spend 99% of your free time learning about Power Rangers, you won't be very balanced when it comes to interests. You'll be at a disadvantage during those pesky conversations outside of Comic-Con. What we want is interest diversification. Off the top of my head, here are 5 interests that I could speak to right now: -Swing Dancing -Podcasting -Video production -Iceland geology -Theodore Roosevelt's early years Here's the deal... You don't have to know a TON about any given topic, just have a well-rounded set of interests. This helps you relate to a wide variety of people. (This is also the secret sauce that makes people seem "interesting") **Action step: Learn about one new thing today. (Use podcasts, audiobooks, Youtube, Wikipedia, some graffiti under a bridge somewhere)** Note: If you don't know much about the current topic, be curious! Let the other person teach you something new! **#3 Think around the current topic so you'll have something to say** Something I teach called "The Spokes Method" will help you connect with anyone on almost any topic. Even if you don’t know a lot about the current topic. Imagine a bike wheel. In the middle, you have a hub, and radiating out from the hub are several spokes. Now, imagine the hub as the conversational topic. The spokes are different, related topics that can be introduced. *Example: Your conversational partner brings up painting, something you don't know much about.* Should you just stonewall them and say "I don't want to talk about painting." or just nod as say "Uh-huh. Coool." NO! Dale Carnegie, author of How To Win Friends And Influence People once spent an entire dinner party talking (and mostly listening) about botany. His conversational partner told the host that Dale was the best conversationalist he'd ever met. **Lesson: You don't have to carry the conversation.** Do this instead: Use the Spokes Method to "think around the topic" and mention other things that are related to painting: *-"How do you choose what to paint?"* *-"What kind of painting do you do?* *-"I'd love to see an example of your work."* You can go deeper into who the person is by bringing up: *-"You must be very creative."* *-"As a kid, did you do anything else artistic?"* *-"If you could paint anything in the world, what would it be?"* You can play the role of the beginner with a question like: *-"I don't know much about painting, what's your favorite thing about it?"* (Note how Spokes can be used to form questions and observations, it's important to balance both so that you don't fall into interview mode) **Wrap up:** It's easy to overthink social situations. The more small, rapid actions you take (start a conversation, speak up in a group, etc) the faster shift you'll have from a mental self-image of "I can't do this" to a mental self-image of "I CAN do this". As you have small win and successes, write them down! That way you can more easily remember the good social experiences you have. (Over time these will crowd out the less positive experiences) **Bonus: Group conversations.** I get asked about having better group conversations a lot. How to approach groups, what to say, how to contribute, etc. [I created this audio guide to join & enjoy group conversations you might check out if you want to have smoother group conversations](https://www.becomemorecompelling.com/uggc-audio.html) In the audio guide you'll learn: -How to systematically destroy the fear of approaching people and starting conversations. -The +10% energy rule: How to be accepted into a new group and never accidentally kill the vibe. (I got this one wrong for years) -How to jump into a conversation that has no opening. -And more (word-for-word scripts, body language while joining a group, etc) [Enjoy!](https://www.becomemorecompelling.com/uggc-audio.html) **Edit: Thanks for the silver! High-ho!**
0non-cybersec
Reddit
1,579
6,128
Public Service Announcement: tomorrow is Valentines Day. Also, as someone who hates the holiday, can I get up on my soap box and give all you young lovers some quick advice? Valentines Day is a completely manufactured holiday. And I hate it. And I think most of us agree, that's a fair way to feel about it. But that does't mean you shouldn't do *something* for your significant-other. For many of your significant others... Valentines Day has been marked for years by being alone, single, dating someone who didn't care enough to do something special... just not a good day in general. Perhaps it's more about making the holiday a good experience for once? Do you need to do the flowers and chocolates and dinner out thing? Hell no. But do *something*. Make a card. Cook dinner (/r/food and /r/fffffffuuuuuuuuuuuud are great resources). Bake a cake. Make a mix tape (or CD, or thumb drive I guess - is that what you kids do these days?). Go for a walk. Flowers aren't that expensive *if you go to the grocery store*, the day before, and don't get roses (don't get carnations either dumbass). Watch a movie in your dorm room - The Notebook is actually pretty good, and reliably on basic cable every Valentines Day. I think you see where I'm going with this. It's a shit corporate holiday, but that doesn't mean that your significant other wouldn't really appreciate a simply gesture.
0non-cybersec
Reddit
347
1,401
Problem from &quot;Differential topology&quot; by Guillemin. <p>I am strugling one of the problems of "Differential Topology" by Guillemin: <br/> Suppose that $Z$ is an $l$-dimensional submanifold of $X$ and that $z\in Z$. Show that there exsists a local coordinate system $\left \{ x_{1},...,x_{k} \right \}$ defined in a neighbourhood $U$ of $z$ such that $Z \cap U$ is defined by the equations $x_{l+1}=0,...,x_{k}=0$. <br/> I assume that the solution should be based on the Local Immersion theorem, which states that "If $f:X\rightarrow Y $ is an immersion at $x$, then there exist a local coordinates around $x$ and $y=f(x)$ such that $f(x_{1},...,x_{k})=(x_{1},...,x_{k},0,...,0)$".<br/> I would really appreciate any pointers on how to attack this problem.</p>
0non-cybersec
Stackexchange
244
771
libc6 error, can&#39;t install anything. <p>I wanted to install <code>python-pip</code> so i ran <code>sudo apt install python-pip</code> and got this error</p> <pre><code>Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: libgcc1:i386 : Depends: libc6:i386 (&gt;= 2.2.4) but it is not going to be installed libgcrypt20:i386 : Depends: libc6:i386 (&gt;= 2.28) but it is not going to be installed libgpg-error0:i386 : Depends: libc6:i386 (&gt;= 2.28) but it is not going to be installed Recommends: libgpg-error-l10n:i386 libidn2-0:i386 : Depends: libc6:i386 (&gt;= 2.4) but it is not going to be installed liblz4-1:i386 : Depends: libc6:i386 (&gt;= 2.4) but it is not going to be installed liblzma5:i386 : Depends: libc6:i386 (&gt;= 2.17) but it is not going to be installed libunistring2:i386 : Depends: libc6:i386 (&gt;= 2.7) but it is not going to be installed python-pip : Depends: python-pip-whl (= 18.1-5) but it is not going to be installed Recommends: python-all-dev (&gt;= 2.6) but it is not going to be installed Recommends: python-setuptools but it is not going to be installed Recommends: python-wheel but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). </code></pre> <p>it says <code>Try "apt --fix-broken install"</code> so I did that and got this</p> <pre><code>Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: libc6:i386 Suggested packages: glibc-doc:i386 locales:i386 The following NEW packages will be installed: libc6:i386 0 upgraded, 1 newly installed, 0 to remove and 42 not upgraded. 88 not fully installed or removed. Need to get 0 B/2578 kB of archives. After this operation, 12.7 MB of additional disk space will be used. Do you want to continue? [Y/n] y debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable (Reading database ... 269716 files and directories currently installed.) Preparing to unpack .../libc6_2.30-0ubuntu2.1_i386.deb ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing archive /var/cache/apt/archives/libc6_2.30-0ubuntu2.1_i386.deb (--unpack): new libc6:i386 package pre-installation script subprocess returned error exit status 1 Errors were encountered while processing: /var/cache/apt/archives/libc6_2.30-0ubuntu2.1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) </code></pre> <p>I tryied also running <code>sudo apt-get install -f</code> didn't work</p> <p>So what shall I do? Ubuntu 19.10</p>
0non-cybersec
Stackexchange
929
2,982
My dog refuses to eat...please help!!. I have a yorkie that is about 3 years old. She's just a little thing, weighing no more than 6 pounds. I got a new puppy (German Shorthaired Pointer) about a week ago. Molly, the yorkie, has always had food available and ate whenever (probably shouldn't have done that....I realize that now). Since we have the new puppy, I'm trying to feed them both on a regular schedule. At first, she showed little interest in her food, but kept trying to eat the puppy's food. I gave her a few cans of wet food because that was the only way I could get her to eat. On Thursday morning, I awoke to find that she had vomited twice during the night. Since then, she won't go anywhere near her food, nor any other kind of food. I should mention that a couple days after I got the puppy, I took him to the vet because he refused to eat and was sleeping all the time. Turns out, he had a parasite. He was treated (still receiving the medication) and he's back to his happy, boisterous self. I thought maybe Molly contracted the parasite from him, but she doesn't have anything like that (although, it does have an incubation period of 13ish days...). The vet said she's just not adapting right away to the changes in our household. If she doesn't start eating in the next day or two, I'm supposed to take her in and she will be force fed. I'm hoping to avoid that, because it sounds so unpleasant for her. I'm so concerned about her and I'm feeling awful because I caused it. I've tried everything I can think of. Any suggestions? Or has anyone dealt with this sort of thing before?
0non-cybersec
Reddit
381
1,606
Environment Variable is not going to container from docker-compose. <p>I was trying to pass <code>ENV_VAR</code> to a container, but it was not working.</p> <pre><code>version: '3.7' services: ubuntu: image: ubuntu:latest environment: - ENV_VAR=teste command: "echo ${ENV_VAR}" </code></pre> <p>The problem was solved using <code>$$</code> instead of <code>$</code>:</p> <pre><code>version: '3.7' services: ubuntu: image: ubuntu:latest environment: - ENV_VAR=teste command: '/bin/sh -c "echo $$ENV_VAR"' </code></pre> <p>But, I dont understand why I had to call <code>sh</code> and I dont belive that a running app inside my image will be able to read this value.</p>
0non-cybersec
Stackexchange
243
756
How to start ubuntu-touch on Nexus 7 3G Tilapia (nakasig)?. <p>I am trying run Ubuntu Touch on my Nexus 7 3G Tilapia, but I only see the "Google" splash screen. I have read many forums and found that the <code>/data</code> partition is different on Tilapia and Grouper (<code>mmcblk0p10</code> and <code>mmcblk0p9</code>).</p> <p>How I can modify the cmdline and attach <code>datapart=/dev/mmcblk0p10</code> on it?</p> <p>OK I solve it </p> <pre><code> 1.erase all on nexus ( optionally. I do it but not sure in my memory :)) 2.$abootimg -x saucy-preinstalled-system-armel+grouper.img 3. edit bootimg.cfg cmdline = console=tty1 datapart=/dev/mmcblk0p10 4. $abootimg --create saucy-preinstalled-system-armel+grouper.img -f bootimg.cfg -k zImage -r initrd.img 5. do fastboot flash all by official manual 6. go to recovery mode and format data, cache and SDcard partitions 7. reboot into recovery mode 8. $adb push /path/to/your/downloaded/saucy-preinstalled-touch-armel+grouper.zip /sdcard/autodeploy.zip 9. reboot into recovery mode and wait when install is finish 10. reboot into recovery mode second time 11. $adb push /path/to/your/downloaded/saucy-preinstalled-touch-armhf.zip /sdcard/autodeploy.zip 12. reboot into recovery mode and wait when install is finish. After install you got system. </code></pre> <p>Screen responds on power button (lighter/darker). After some time it darkens.</p> <p>I try install vncserver, but it say: vncserver: The HOME environment variable is not set.</p>
0non-cybersec
Stackexchange
501
1,527
nginx configuring uwsgi and gzip buffers for different usage scenarios. <p>I'm trying to configure two URL path groups for relatively different usage scenarios and resource consumption in nginx. Both are served by same uwsgi application.</p> <ul> <li>Group 1: Regular HTML pages up to cca 128k in size, default</li> <li>Group 2: Large XML "files" up to many MB in size (created by the app on the fly)</li> </ul> <p>The requirement is for both to be gzipped, and the XMLs should be cached 1hr as well.</p> <p>What I don't quite understand is the meaning of the number of buffers and how to optimally set their number and sizes according to expected traffic and content size, both for uwsgi and gzip.</p> <p>Also, for the below configuration I get error from nginx:</p> <pre><code>"uwsgi_busy_buffers_size" must be less than the size of all "uwsgi_buffers" minus one buffer in /etc/nginx/nginx.conf:113 </code></pre> <p>uwsgi_busy_buffers_size appears to be undocumented.</p> <pre><code>location ~ /path/to/(.+)\.xml { uwsgi_hide_header "Set-Cookie"; uwsgi_ignore_headers "Set-Cookie"; uwsgi_buffers 2 8M; uwsgi_cache xmlfiles; uwsgi_cache_key $request_uri; uwsgi_cache_valid 200 1h; uwsgi_cache_valid 04 5m; uwsgi_cache_use_stale error; expires +1h; gzip on; gzip_types application/xml; gzip_buffers 2 8M; try_files $uri @backend; } location / { try_files $uri @backend; gzip on; gzip_buffers 8 256k; uwsgi_buffers 8 256k; try_files $uri @backend; } location @backend { include uwsgi_params; uwsgi_pass unix:///tmp/uwsgi-app.sock; } </code></pre> <p>Please help. nginx 1.0.14</p>
0non-cybersec
Stackexchange
602
1,833
Assign a value to character string. <p>I have responses to a survey in my <code>data.frame(Analysis)</code> that include:<br><br> <code>Q1 &lt;- c("Agree", "Strongly Agree", "Disagree", "Neither", "Agree", "Neither")</code><br><br> I wish to assign a value to each response, based upon their level. For example, <code>"Strongly Agree"</code> receives a 2 whilst <code>"Agree"</code> receives a score of 1. My desired output would be:<br><br> <code>Q1 &lt;- c("Agree", "Strongly Agree", "Disagree", "Neither", "Agree", "Neither")</code><br> <code>Q1_Score &lt;- c(1, 2, -1, 0, 1, 0)</code><br><br> This seems like an simple question but I am having difficulty in finding an answer!<br><br> Thank you.</p>
0non-cybersec
Stackexchange
241
704
[Help] how can i get my dog to drink more water?. So my doggo is a rescue and his urine is super yellow and he doesnt drink much. I think he may have been deprived of water as a pup so he tries to make it last despite him having access to unlimited water (there is someone home 99% of the time to give him water as needed). I am usually not home (i work 7 days a week) so i rarely take him out. Ive been taking him out more lately and thats when i really noticed his urine and paid attention to his drinking habits when im home. The old saying "you can lead a horse to water but you cant make it drink" really comes to mind. I want my boy to be healthy but he doesnt drink much. Any advice?
0non-cybersec
Reddit
166
691
On the definition of the Hausdorff distance. <p>$\newcommand{\dist}{\mathrm{dist}\,}$ Let $M$ be a metric space and $\emptyset\neq A,B\subset M$ bounded closed subsets. The <a href="http://en.wikipedia.org/wiki/Hausdorff_distance">Hausdorff distance</a> is defined as $$h(A,B)=\max\{\dist(A,B),\dist(B,A)\},$$ where $$\dist(A,B)=\sup_{x\in A}\inf_{y\in B}d(x,y).$$</p> <p>Why do we define $\dist(A,B)$ in this way? Is't it possible to replace the supremum by the infimum in the definition of $\dist\!$, that is, define $$\dist_{\mathrm{new}}(A,B)=\inf_{x\in A}\inf_{y\in B}d(x,y).$$</p> <p>What is the impact of this 'new' definition on the 'Hausdorff distance' given by $$h_{\mathrm{new}}(A,B)=\max\{\dist_{\mathrm{new}}(A,B),\dist_{\mathrm{new}}(B,A)\}?$$</p>
0non-cybersec
Stackexchange
276
764
SQL Server 2005: Rename DB Server Instance Name?. <p>Can somebody tell me how to rename the DB server instance name and a DB name in SQL Server 2005?</p> <p>Right Now I Have </p> <pre><code>SERVER/OLDNAME -- oldnameDB </code></pre> <p>I want to change the server instance and also change the db name.</p> <p>I have tried: </p> <p>EXEC sp_renamedb 'oldName', 'newName' </p> <p>and that has changed the dbname as it appers in the tree directory. But, when I do "select @@servername" it is the old name. Also, the MDF and LDF files are still the old name. </p> <p>How do change instance and db names as a clean sweep across the server?</p> <p>Thanks.</p>
0non-cybersec
Stackexchange
226
663
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
Reversing lists of numbers in python. <p>So I have been trying to do this for a while now and am constantly coming up with differing failures. I need to take numerical input from the user and put it into a list and output it in decreasing value:</p> <pre><code>bids = [] bid = input('Bid: ') while bid != '': bids.append(bid) bid = input('Bid: ') print('The auction has finished! The bids were:') for bid in bids: bid = int(bid) for bid in reversed(bids): print(bid) </code></pre> <p>So this worked well most of the time, (I have been using the numbers 2,3,4 &amp; 10 as input as I have been having problems where it shows the numbers in decreasing order for the first numeral) but when I type in 16, 30, 24 it displays the numbers as:</p> <pre><code>The auction has finished! The bids were: 24 30 16 </code></pre> <p>Here is another version I have attempted: </p> <pre><code>bids = [] bid = input('Bid: ') while bid != '': bids.append(bid) bid = input('Bid: ') print('The auction has finished! The bids were:') for bid in bids: bid = int(bid) bids.sort([::-1]) #Here is where the problem is at, I don't know #what the correct syntax is for something like that for bid in bids: print(bid) </code></pre> <p>Any help will be much appreciated as I am fairly new to python and am struggling with my course.</p> <p>-Callum</p>
0non-cybersec
Stackexchange
433
1,367
OS X 10.8 can&#39;t resize partitions on MBR disk. <p>I have an external HD with a mix of Mac, NTFS and Linux partitions. I wanted to use it to backup some partitions from my MacBook HD, and partially succeeded, copying a 100MB partition into an empty 300MB partition. Unfortunately Disk Utility won't let me resize partitions, or create any new partitions, giving the following message.</p> <pre><code>You can't resize partitions on this disk because it uses the Master Boot Record partition scheme. </code></pre> <p>Is there any way around this? None of my Windows partition programs can do anything with the Mac OS Extended partition. Can I convert to GUID Partition Table and still use with Windows XP?</p> <p>I don't want to lose the content of the NTFS partition, which contains years worth of backups.</p> <p>PS Is this a new issue with Mountain Lion? I thought I had done these on Snow Leopard.</p>
0non-cybersec
Stackexchange
234
912
Immunity Debugger - !mona suggest. <p>Potentially simple question. I have been going through some tutorials for exploit development that use !pvefindaddr for help with creating unique patterns and discovering the offset.</p> <p>I know that mona has replaced pvefindaddr - but from what I can see in the examples I am following the:</p> <pre><code>!pvefindaddr suggest </code></pre> <p>Command gives you an exploit suggestion in perl, while:</p> <pre><code>!mona suggest </code></pre> <p>Basically writes you a metasploit module. </p> <p>I looked at the options with:</p> <pre><code>!mona help suggest </code></pre> <p>And there don't seem to be many options available. Is it possible to get suggest to offer you exploits written in any format other than a metasploit module? I couldn't seem to get pvefindaddr working in immunity - I'm assuming it doesn't really work anymore as mona has replaced it, so I wondered if mona had any flexibility?</p>
1cybersec
Stackexchange
272
956
Tomcat 7 GZIP compression not working. <p>I have added the following lines in tomcat's conf/server.xml file to enable gzip compression but its not working. Pages are still uncompressesd.</p> <pre><code> &lt;Connector port="8080" compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,text/plain,text/css, text/javascript,text/json,application/x-javascript, application/javascript,application/json"/&gt; </code></pre> <p>Any idea?</p>
0non-cybersec
Stackexchange
170
563
scalacheck, scalatest, specs - which one has the lower barrier to entry?. <p>Between the following test frameworks which one is the easiest to use and learn?</p> <ul> <li><a href="http://code.google.com/p/scalacheck/" rel="noreferrer">scalacheck</a></li> <li><a href="http://www.scalatest.org/" rel="noreferrer">ScalaTest</a></li> <li><a href="http://code.google.com/p/specs/" rel="noreferrer">specs</a></li> </ul> <p>I'm using 2.8.0 and <a href="http://code.google.com/p/simple-build-tool/" rel="noreferrer">sbt</a> for building, so working nicely with it is a factor. I'm not necessarily looking at the most full featured. As best I can tell my criteria are in order:</p> <ul> <li>allow unit testing for Scala code</li> <li>painless set-up</li> <li>working with sbt</li> <li>tutorials</li> <li>rich documentation</li> </ul>
0non-cybersec
Stackexchange
297
829
Win8.1 Someone logged into my PC by adding a new Account. <p>I have just started using win8.1. Yesterday I locked my PC and went to a lecture. Then when I came back, I saw that my lockscreen was changed. I navigated to log-in screen, and saw a different username: XIT (XIT is the abbreviation for my university's IT service. But there should not be any user on my PC named XIT!) Then I switched user, logged into mine, checked user account settings and saw that XIT had admin rights. How can that be possible?</p> <p>On my PC, there is only one user and that is me. XIT did not install win8.1, I installed it. They control our network, but I do not think that someone from our university's IT, would just crack into my PC for fun. Maybe someone else did it and named the user account after XIT.</p> <p>What I am wondering is, is there a way to add a new account without logging into my account? Is there a hotkey or something?</p>
0non-cybersec
Stackexchange
247
933
Configure Evince to open maximized with 100% zoom level?. <p>I have Ubuntu 12.04.5 LTS installed on my computer.</p> <p>If I open PDF in Evince for the first time, the window is always un-maximized and zoom level is 70%. I want Evince to be maximized and the zoom level set to 100% every time I open a PDF.</p> <p>I have tried to adjust the settings and clicked "Save Current Settings as Default" but when I open a new PDF, Evince is un-maximized and zoom level is 70%.</p> <p>How can I get Evince to open maximized and with zoom level 100%?</p>
0non-cybersec
Stackexchange
165
549
Adding/Enabling windows feature using chef. <p>I am writing chef cookbook to add/enable some of the windows feature. For enabling I am using <code>powershell_script</code> resource and below is the powershell script.</p> <pre><code>Import-Module Servermanager Add-WindowsFeature Print-LPD-Service </code></pre> <p>For some reason, during chef-client run windows feature is not enabled. But the recipe ran successfully.</p> <p>When I manually executed the command in powershell shell it works fine.</p> <p>I am not aware of any security settings to be enabled to achieve this requirement. So, how we can enable windows feature using chef. Any pointers will be helpful. </p>
0non-cybersec
Stackexchange
177
678
Reset messed up certificate data in Firefox and Thunderbird?. <p>I am running Firefox 7.0.1 and Thunderbird 7.0.1 on Mac OS X 10.6.8.</p> <p>I was exploring/nosing around their Preferences, and deleted many Authorities in the Certificate Manager.</p> <p>Afterwards I started to get lots of messages from Firefox and Thunderbird that looks like this:</p> <blockquote> <p>[domain ...:443] uses and invalid security certificate.</p> <p>The certificate is not trusted because the issuer certificate is not trusted.</p> <p>(Error code: sec_error_untrusted_issuer)</p> </blockquote> <p>There are only two buttons I could click on: "View Certificate" and "Cancel". Regardless of which one I choose, the messages repeatedly pop up whenever I load a webpage.</p> <p>Interestingly, I even have trouble logging onto websites (Gmail, superuser, etc.) even on other browsers on <em>other</em> computers. For instance, when browse to superuser.com, I am logged in. But when I ask a question, I am asked to log in, yet I can't log in with my Google Account (which I always use for stackexchange sites).</p> <p>I don't even know how to troubleshoot this problem, or if there is some way to reset my system's certificate information?</p> <p>This is really weird, and impedes my normal web browsing. </p>
0non-cybersec
Stackexchange
370
1,308
migrating DNS while retaining email hosting from Microsoft 365. <p>The title might be a bit misleading but I don't know how else to describe my situation.</p> <p>Situation: Client have registered a domain through company A, which from the record it is currently pointing to company A DNS. Client also purchase a Microsoft 365 subscription with the email hosting service through company A and they have set it up for him. From what I see from the DNS MX/A record, it has the root domain pointing to outlook.com for the microsoft 365 email hosting. </p> <p>Now he wants a website from us, and since he does not have a web hosting service, naturally the new website will be hosted with us, which will be a shared hosting account we have with a hosting provider. He would like to retain his current email hosting so he can keep all the email and continue using the Microsoft 365.</p> <p>I have setup new domain for web hosting as well as migrating the whole web hosting and e-mail hosting from another hosting provider before. While I think it should not be any difference, I have never have case where e-mail and web hosting need to be in different server, and to dealt with Microsoft 365 before.</p> <p>I believe all I need to do is point the domain to my hosting DNS, and copy the current DNS setting in company A including the MX/A record to my web hosting DNS. Is that what should be done? Will the SPF record of Microsoft 365 need to reset and what else do I need to do to ensure smooth transition?</p> <p>I do not want to do anything for my client before I know what to do.</p>
0non-cybersec
Stackexchange
370
1,586
Derivation of the Euler spiral (clothoid). <p>The Euler spiral is a planar curve, whose curvature increases linearly with arc length from the origin. This <a href="http://en.wikipedia.org/wiki/Euler_spiral#Formulation" rel="nofollow noreferrer">Wikipedia</a> article features a derivation of its equation based on the fact, that the curvature is in fact the rate of change of the angle of the tangent vector. I was wondering what an alternative derivation would look like, that would start with an unknown parametrization:</p> <p><span class="math-container">$$\binom{x(t)}{y(t)}$$</span></p> <p>and based on the formulas for curvature:</p> <p><span class="math-container">$$k(t) = \frac{x'(t)y''(t) - y'(t)x''(t)}{(x'(t)^2+y'(t)^2)^{3/2}}$$</span></p> <p>and arc length:</p> <p><span class="math-container">$$L(t) = \int _0 ^t \sqrt{x'(\tau)^2+y'(\tau)^2} \ d\tau$$</span></p> <p>would get to something like:</p> <p><span class="math-container">$$const. = \frac{(x'(t)^2+y'(t)^2)^{3/2}}{x'y'' - y'x''} \cdot \int _0 ^t \sqrt{x'(\tau)^2+y'(\tau)^2} \ d\tau$$</span></p> <p>Here I am stuck, one should probably simplify this by using a parametrization by the arc length..? And where do the sine and cosine in the resulting parametric equations come from?</p>
0non-cybersec
Stackexchange
417
1,258
Soon to be first time parent - looking for advice on all the "best" things?. What has been a product that you would never want to parent without? (obviously focused on newborns) &#x200B; we are planning on having multiple kids, excited to start our family. Our first will be a boy! Started looking at strollers and cribs and this and that. The market is beyond flooded. Looking for some concise advise on must-have things. Something that is totally worth the money! Also - what product would you definitely not recommend? &#x200B; As far as basics I am not really concerned, know we need diapers and wipes and binky etc. etc. I do have other new parents in my life to ask as well but figured instead of reading reviews on amazon I would ask here! &#x200B; thanks so much :)
0non-cybersec
Reddit
196
780
Competitive gaming is ruining my favorite past time. So like many here, I grew up on pc gaming back in the dial up days when online gaming was at best playing with a friend in a private match (think warcraft 2/ AOE). But it was mainly playing solo. So many developed their own strategies and found what play style they particularly enjoyed. Some were great and some inferior. But who cares, it was just fun and a release from the stressors of the real world. However, there has been a shift. Now with the ease of access to the internet, optimal strategies are at everyones fingertips. And this is great for people who want to win all the time, they have all the data you can imagine. But the cost of this is that you can not rock a strat that is rewarding to an individual player if it isn't competitive. You have to adhere to the meta game. This has permiated almost every major multiplayer game and at all skill levels (think about the bitching on a silver game in CSGO). You no longer can just have fun doing what you like without getting yelled at in chat. I do not know when this shift happened but somehow gaming, which was a relief from the daily world, has become something similar to actual work. Maybe we can blame everyone wanting to be a famous twitch streamer or maybe its just that this is a culture that has developed over time and new players just assume it is the norm. I do not know what is happening but it kindof sucks. Nothing more. Sorry for the rant. Edit: Thanks for the feedback. This has validated a bunch of assumptions about peoples motivations. This seems to be a dividing issue but its nice to see input explaining why people act as they do in most online games. Transparency on things you do not agree with is always a good thing.
0non-cybersec
Reddit
402
1,787
Combining share decryption on Paillier threshold scheme. <p>I am trying to implement the <a href="https://pdfs.semanticscholar.org/964e/280c7c050a8689d0c8f70acc0796a5bc1000.pdf" rel="nofollow noreferrer">Paillier threshold scheme described by Fouque, et al</a>, but I am having an issue when combining share decryptions.</p> <p>The scheme calculates the plaintext <span class="math-container">$M$</span> with the formula:</p> <p><span class="math-container">$M = L\left(\prod\limits_{j \in S} c_{j}^{2\mu_{0,j}^{S}} \mod n^{2}\right) \times \frac{1}{4\mu^{2}\theta} \mod n$</span></p> <p>Where <span class="math-container">$\mu_{0,j}^{S} = \Delta \times \prod_{j' \in S \setminus \{j\}} \frac{j'}{j' - j} \in \mathbb{Z}$</span></p> <p>For a list of shares <span class="math-container">$S$</span>, where on code it is represented by a list of objects <span class="math-container">$(id: i, value: c_i)$</span> where <span class="math-container">$i$</span> is the share ID and <span class="math-container">$c_i$</span> the value, I am trying calculate <span class="math-container">$\mu_{0,j}^{S}$</span> with the following <strike>pseudocode</strike> Python code:</p> <pre><code>def combine(shares: Set[Decryption], key, params) -&gt; int: n = key.n n_squared = n * n threshold, Δ = params.threshold, params.Δ c = 1 shares = shares[:threshold] for i in shares: µ = Δ for j in shares: print(i.id, j.id) if i is j: continue µ *= j.id // (j.id - i.id) c *= pow(i.value, 2 * µ, n_squared) L = 4 * Δ * Δ c //= L * key.θ return ((c - 1) // n * modular_inverse(L, n)) % n </code></pre> <p>The problem is when I get to the second iteration, where <code>i.id</code> is 2, and the inner for starts with <code>j.id</code> as 1. Thus, <span class="math-container">$\mu$</span> is negative when I calculate <span class="math-container">$\frac{j'}{j' - j}$</span> because <span class="math-container">$j'$</span> (<code>j.id</code>) is smaller than <span class="math-container">$j$</span> (<code>i.id</code>), then <span class="math-container">$j' - j$</span> becomes negative.</p> <p>The effect is that <span class="math-container">$\mu$</span> is negative (every other iteration yields positive factors to multiply), so <span class="math-container">$c_{j}^{2\mu_{0,j}^{S}}$</span> elevates <span class="math-container">$c_j$</span> to a negative exponent.</p> <p>Did I miss something from the paper, or is it working as expected and I have to handle this negative exponent some other way?</p>
0non-cybersec
Stackexchange
895
2,603
Cookit, I'm in over my head.. I can't browse r/cooking without seeing an article about pork shoulder and the deliciousness contained therein. So when I saw a deal on it at the grocery store yesterday, I said, "Hey, why the hell not? I can cook things. I'm pretty sure we have a slow cooker at home, too. I can figure it out." Well I was wrong, my friends. I have 8 pounds of pig in my fridge, and it's taunting me. "Aren't you going to cook me?" it says. "Sure, I just barely fit in your six quart slow cooker. And yeah, all of the recipes you're finding are for two or three pound pieces of meat. No big deal. You can do it... *pussy*." Help me.
0non-cybersec
Reddit
179
651
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
Windows 10 - Perl vs. dsadd/dsquery. <p>I created a perl script for adding users to Active Directory a few months ago. On Windows 7 it runs fine. On Windows 10 perl is not able to run "dsquery" or "dsadd" but I can really not understand this.</p> <p>When I run "dsquery" from the same command line, it works. Trying with the perl script... It won't!</p> <pre><code>Der Befehl "C:\Windows\System32\dsquery.exe" ist entweder falsch geschrieben oder konnte nicht gefunden werden. </code></pre> <p>(= Command dsquery could not be found...)</p> <p>Some code snippets from the perl script:</p> <pre><code>$datetime = strftime("%d.%m.%Y %H:%M:%S", localtime); &amp;GetOptions ("-v=s" =&gt; \$fname, "-n=s" =&gt; \$sname, "-u=s" =&gt; \$uname, "-p=s" =&gt; \$pwd, "-noshare" =&gt;\$noshare, "-test" =&gt;\$test, "-noquota" =&gt;\$noquota, "-sshpw=s" =&gt;\$sshpw ); unless ($fname) { print "Vorname: "; $fname = &lt;STDIN&gt;; chomp $fname;} unless ($sname) { print "Nachname: "; $sname = &lt;STDIN&gt;; chomp $sname;} unless ($uname) { $uname = substr($fname, 0, 1); $uname = "$uname.$sname";} $uname = lc($uname); if (`C:\\Windows\\System32\\dsquery.exe user -samid $uname`){ print "Benutzer $uname existiert bereits!"; exit;} </code></pre> <p>At this point it already stops. But, when I run:</p> <pre><code>c:\windows\system32\dsquery.exe user -samid ANYUSER </code></pre> <p>it works.</p> <p>What is happening right here? Can anyone undestand this??</p> <p>Cheers, Lukas</p>
0non-cybersec
Stackexchange
611
1,616
windows 10 creator how to start pinned visual studio 2017 solution in admin mode always. <p>Is there a way to ensure that all pinned solutions from Visual Studio 2017 always start visual studio 2017 in admin mode?</p> <p>I have checked the other related answers to this question and all relate to either earlier versions of Windows 10 (registry entries missing now, etc.) or earlier versions of Windows itself. I have yet to see this addressed in the Creator version (v 1703) of Windows 10.</p> <p>If there is, will you please share it as I am used to having that feature "just work" and now it fails. </p> <p>What is of particular annoyance is that Visual Studio 2017 (v15.3) <em>will</em> start in admin mode every time! Just the pinned solutions fail to do so.</p> <p>In particular, is there a group policy setting that I am not aware of that needs tweaking? I should clarify and say that this <em>does</em> work on the old home box (which is NOT part of a domain) but does not work on the work machine, which IS part of a domain. &lt;== This is the part that makes this different from the standard answers.</p> <p>At the time I posted this, I did not have access to the standard methods (attempting to change the status of devenv flat failed due to a lack of the "run as administrator" option and trying to change vslauncher gave me a security violation. I spoke with the DevOps guys, found out they were "fiddling" with things (we just moved to Win10 not too long ago) which caused my original problem. The follow up of being able to launch VS as admin just fine but not a pinned solution from the start bar had them going for awhile, just as one of their mods prevented one of my colleagues from starting multiple copies of VS, admin or not - made no difference, he got one copy and that was it. They have relaxed the rules quite a bit now, thus the supplied solution worked for my environment.</p>
0non-cybersec
Stackexchange
461
1,910
condition number. <p>Hi I have the following matrix</p> <p>A=[a_11 a_12 a_13 1; a_21 a_22 a_23 1; . . . a_n1 a_n2 a_n3 1]</p> <p>I have seen that when some of a_ij are big for instance in the order of 200 , then condition number is also big.</p> <p>I would like to know is it possible to show it theoretically. </p> <p>Is it possible to find a lower bound for this problem?</p> <p>Regards,</p> <p>Reza</p>
0non-cybersec
Stackexchange
184
450
Call to a member function count() on a non-object (Laravel 5). <p>I have a list of projects, where I can click on and it (needs to) show the project name, and the list of the projects' tasks (ToDo application)</p> <p>But when I click on a certain project I get this error.</p> <p>(The "H2" project name will show up)</p> <pre><code>h2&gt;{{{ $project-&gt;name }}}&lt;/h2&gt; @if ( !$project-&gt;tasks-&gt;count()) There are no tasks for this project. @else &lt;ul&gt; @foreach( $project-&gt;tasks as $task) &lt;li&gt;&lt;a href="{{ route('projects.tasks.show', [$project-&gt;slug, $task-&gt;slug]) }}"&gt;{{ $task-&gt;name }}&lt;/a&gt;&lt;/li&gt; @endforeach &lt;/ul&gt; @endif </code></pre>
0non-cybersec
Stackexchange
277
736
How to read non-ASCII characters from CLI standard input. <p>If I type <code>å</code> in CMD, fgets stop waiting for more input and the loop runs until I press <code>ctrl-c</code>. If I type a "normal" characters like a-z0-9!?() it works as expected.</p> <p>I run the code in CMD under Windows 7 with UTF-8 as charset (<code>chcp 65001</code>), the file is saved as UTF-8 without bom. I use PHP 5.3.5 (cli).</p> <pre><code>&lt;?php echo "ÅÄÖåäö work here.\n"; while(1) { echo '&gt; '. fgets(STDIN); } ?&gt; </code></pre> <p>If I change charset to <code>chcp 1252</code> the loop doesn't break when I type <code>å</code> and it print "> å" but the "ÅÄÖåäö work here" become "ÅÄÖåäö work here!". And I know that I can change the file to ANSI, but then I can't use special characters like ╠╦╗.</p> <p><strong>So why does fgets stop waiting for userinput after I have typed åäö?</strong></p> <p><strong>And how can I fix this?</strong></p> <p>EDIT:</p> <p>Also found a strange bug. <code>echo "öäåÅÄÖåäö work here! Or?".chr(10);</code> -> <code>��äåÅÄÖåäö work here! Or? re! Or?</code>. If the first char in echo is <code>å/ä/ö</code> it print strange chars AND the end output duplicate's with <code>n - 1</code> char.. (n = number of åäö in the begining of the string).</p> <p>Eg: <code>echo "åäö 1234" -&gt; ??äö 123434</code> and <code>echo åäöåäö 1234</code> -> <code>??äöåäö 1234 1234</code>. </p> <p><strong>EDIT2 (solved):</strong></p> <p>The problem was <code>chcp 65001</code>, now I use <code>chcp 437</code> (<a href="http://msdn.microsoft.com/en-us/goglobal/cc305156" rel="nofollow">chcp 437</a>). Big thanks to Timothy Martens!</p>
0non-cybersec
Stackexchange
648
1,664