text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
New approach to weightloss: 1kg a month. Hey Reddit, I wanted to rant a bit about my new approach to weightloss, given my own personal cirumstances. I'm 22yo, 4'9 or 145cm (yes, I'm that small), and I weight 64kg or 141lbs. My lowest adult weight was 58kg, or 127lbs, and my highest was 72kg or 158lbs. Luckly, even doctors get surprised when they weight me, as I weight a whole lot more than what it looks like! I have a very complex history with my weight, and weightloss. I'm recovering from an ED. After having lost a good amount of weight 2y ago, slowly, but surely, I have put on 7kg. Must mention, I also have hypothyroidism. I mostly put on weight one week to another. Last time, on April, from a week to another I went from 63kg to 65kg. I was handling it well, until this last weight gain I had. It triggered my ED, after 7 months of no behavours or impulses. [RANT] I've been dealing with my weight the wrong way my whole life. I've always feel bad because I couldn't lose weight as fast as everyone else seems to, or as "easly". I felt bad because I never had terrible eating habits, and I was active growing up, but I was still the fat one. I felt bad because my cousin lost 15kg over a few months, and it took me 2 whole years to lose 14kg the first time I tried. I felt bad because I thought everyone else found me gross. I started hating myself and my body so fucking much after I started being bullied. By both my family and classmates. I've hated myself so much, I've just been punishing myself for existing. I was constantly punishing myself for being overweight. It was always like "why don't I just starve myself for a few months and get done with it? I dont have that much weight to lose". Until I got tired. I got so fucking fed up with this. This is just pain. It's constantly living in pain and hatred. [OFF RANT] So, I'm putting myself together after I relapsed. I want to not be obese. I want to stop feeling so bloated, and I want to feel better with my body. I want to enjoy swimming again, without counting every lap I do. So, a month ago, I decided to try something else. I tried losing 1kg. And I did it! I ate 4-5 meals a day (I used to just eat 3, pre-recovery). I've gone out, ate ice-cream, I had pizza twice, and I've been eating when I was hungry. I've been eating PLENTY of fresh vegetables and fruits, mostly for the past 2 weeks. I've been keeping active, walking an average on 10K steps a day, but I haven't forced myself to exercise if I really didn't feel like it, or if it was raining. And you know what? I DID IT. I lost 1kg. I feel a bit less bloated, too. I want to lose about 12kg. It might take me 1y, or a 1.5y, but that's okay. My weight might fluctuate on my way there, but that should be okay. I no longer want to feel like I'm starving myself, I don't want to live on a perpetual restrictive diet, where I have no energy for nothing. I want to live. I want to live a better, and healthier life. No deadlines, no failure. I want to enjoy life. For anyone else out there, who is going through something similar: you don't have to lose as much weight as you can, or eat as little as possible. Losing 2lbs/1kg a week is not substainable for everyone. Mental health should be a priority when it comes to weightloss.
0non-cybersec
Reddit
Halving a vector and halving an angle. <blockquote> <p>An object is subjected to two equal forces along two different directions. If the magnitude of one of them is halved, the angle which the new resultant makes with the other component force is also halved. What is the angle between the forces?</p> </blockquote> <p><img src="https://i.stack.imgur.com/mXwne.png" alt="How the problem figures may probably look."></p> <p>Well I'm not sure whether the vector notation in the second figure is right or not &ndash; if wrong please correct it (I'm learning vectors).</p>
0non-cybersec
Stackexchange
It takes some people a lifetime to learn what a 3 year old knows.
0non-cybersec
Reddit
My Siberian Stunner [x-post from r/siberianhusky].
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Scala Map from tuple iterable. <p>Constructing <code>scala.collection.Map</code> from other collections, I constantly find myself writing:</p> <pre><code>val map = Map(foo.map(x=&gt;(x, f(x))) </code></pre> <p>However, this doesn't really work since <code>Map.apply</code> takes variable arguments only - so I have to write:</p> <pre><code>val map = Map(foo.map(x=&gt;(x, f(x)) toSeq :_*) </code></pre> <p>to get what I want, but that seems painful. Is there a prettier way to construct a <code>Map</code> from an <code>Iterable</code> of tuples?</p>
0non-cybersec
Stackexchange
Math question related to three dimensional surfaces?. <p>So I have to determine and draw the surfaces $$z-2x^2-4y^2 ≥0,\qquad \mbox{and}\qquad 4y^2-x^2+4z^2-1 ≥0$$ so the first one in my opinion should be transformed like this $$z ≥2x^2+4y^2$$ then we multiply by two both sides and we have $$2z ≥x^2/(1/4) +y^2/(1/8)$$ Tadaa! This happens to be elliptic paraboloid ( the form) ...</p> <p>but how do I draw $$2z ≥x^2/(1/4) +y^2/(1/8) $$ </p> <p>I mean, the problem is how does ≥ affect the drawing? How about the second one? I thought it was an ellipsoid but I cant transform it..</p>
0non-cybersec
Stackexchange
Reposting (deleted due to lack of flair). Look at how they’re eating!.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
[Canada][Toronto][OC] Physical Altercation Between to Guys Starts in Front of My Car Out of Nowhere in the Canadian Tire Parking Lot. Possibly Robbery Attempt?.
0non-cybersec
Reddit
How to find the Minimum of the Function.. <p>Minimize $xy$ on the ellipse $b^2x^2+a^2y^2=a^2b^2$</p> <p>So what I did first was take the gradient of $f$ and $g$ </p> <p>$∇ f = (y,x)$ $\qquad$ $∇ g= (2x^2b^2,a^22y)$ </p> <p>Then we do the lagrange multiplier </p> <p>$y= 2x^2b^2λ$</p> <p>$x=2ya^2λ$</p> <p>Then we equate the functions. By multiplying.</p> <p>$(y= 2x^2b^2λ)y^2a^2$</p> <p>$(x=2ya^2λ )x^2b^2$</p> <hr> <p>$y^3=2x^2y^2a^2b^2λ$</p> <p>$x^3=2x^2ya^2b^2λ$</p> <p>But this is where I get stuck. Setting them equal to each other gets me this.</p> <p>$2x^2y^2a^2b^2= 2x^2ya^2b^2$</p> <p>$y=1$ </p> <p>I think there is another method to solve this problem than the one I specifed does anyone know what that method is?</p>
0non-cybersec
Stackexchange
UAC and old (XP) program called &quot;colsetup&quot;. <p>I'm having troubles running an XP program (Robcad 7.5.1) under Windows 7. The program calls an executable called colsetup.exe and fails: log shows it needs admin right, but it does not (I think it's because it has "setup" into its name). colsetup.exe icon is shown with the shield, and even removing the check from "Run This Program As An Administrator" does not work.</p> <p>If I start Robcad with admin privileges, it does not start because it cannot get the license from FlexLM (maybe the user name is different?).</p> <p>Can anyone help me solve one of the two problems?</p> <p>The problem can be solved by disabling installer detection in security policies, but I'd like to not have to touch them (current, temporary, computer is on its own, the next one should be in a domain and this setting could be locked by network administrators).</p> <p>Thank you,</p> <p>Ignazio</p>
0non-cybersec
Stackexchange
Hammond can use enemies to gain enough height for Piledriver..
0non-cybersec
Reddit
Has my phpBB been hacked?. <p>I have a phpBB 3.0.5 installed on a linux server: (oovium.com/forums/). I noticed two days ago someone using an autogenerated email address from China created a new account without having read a single message. The email address they used was listed on <a href="http://stopforumspam.com" rel="nofollow noreferrer">http://stopforumspam.com</a>. I deleted the account.</p> <p>Yesterday, the same (or similar) email address created another account, but this time they posted a message complaining about having trouble with registration and posted their registration link.</p> <p>I stupidly clicked the link and it took me back to my forum. I then deleted the account and its message.</p> <p>The message is deleted so I don't know exactly what the URL that I clicked was.</p> <p>So my questions: 1. Is there a way to hack a phpBB 3.0.5 by having an admin user click a link? 2. Is there a way to determine if the message board has been hacked? 3. Is there any way to retrieve that deleted message so I can determine precisely what the URL was?</p>
0non-cybersec
Stackexchange
Im not sure if this is real or not.....
0non-cybersec
Reddit
My new laptop can change gears.
0non-cybersec
Reddit
Diablo 3 - Defeat Death Itself Achievement Art. Can anyone who unlocked this upload it because I can't find it in google reverse image search and I've seen it in a youtube video and it looks pretty damn nice when set as background theme
0non-cybersec
Reddit
I managed to get an onboard ROM dump of the Pokewalker. Hoepfully this can help with creating an emulator of sorts.
1cybersec
Reddit
Resrtict MS Access creation. <p>Is it possible to restrict MS Access creation but still be able to view and execute Access files.</p>
0non-cybersec
Stackexchange
Have you ever printed a game key for a present? Any suggestion?. Hi reddit! I bought Life is Strange 2 for my girlfriend and I'm looking for a nice solution to give her the game's key. I know the retail version would have been a more elegant solution but I had no choice since it won't come out until all of the episodes are out. So! Have you any suggestion to print it and pack it? I would like something which is game related. I was thinking of taking a picture of the game key with a polaroid or writing it on a music cassette (and those would be references to the first game, not this one), but I really would like to hear your ideas :D
0non-cybersec
Reddit
Choihyobin, Shock's off-tank, places gold in tank placements.
0non-cybersec
Reddit
4chan detectives.
0non-cybersec
Reddit
Strange router&#39;s MAC address from ICMP Echo Reply?. <p>Using Wireshark to capture ICMP packets (Windows) using ping to <code>google.com</code>, I can see the <code>source-MACAddr</code> of the ICMP Echo replies is not the same as the MAC address of my direct router (which is the <code>dest-MACAddr</code> of the <code>icmpEchoRequest</code>).</p> <p>AFAIK, the MAC address of a packet sent to my PC should belong to my direct router, so I wonder where did that MAC address come from? </p> <hr> <p><strong>Update :</strong></p> <p>My router, named <code>All-HSRP-routers_06</code> (Wireshark), has its MACAddr as <code>00-00-0c-07-ac-06</code> (I got it from <code>arp -a</code> for the MAC address of the default gateway's IP address).</p> <p>The mentioned strange MAC address is <code>00-25-45-1d-14-21</code>, from a router named <code>CiscoInc_1d:14:21</code> (Wireshark).</p> <p>Another interesting fact is that whatever IP address I ping to, the source MAC address of <code>icmp-echo-reply</code> is always the strange one, but not my router's MAC address.</p>
0non-cybersec
Stackexchange
Does NLTK have any pre-trained classifiers for Sentiment Analysis. <p>I was comparing NLTK and Stanford CoreNLP and found out that the latter one had an RNTN (Recursive Tensor Neural Network) implementation provided for Sentiment Analysis. The examples available online show that we do not need to train it as it has already been trained using large datasets like the Penn TreeBank</p> <p>Does NLTK provide a similar kind of feature? The reason I am asking about it is because whatever implementations for NLTK I found online included training a particular classifer like Naive-Bayes or the MaxEnt.</p> <p>P.S.: Is it just because Python is easy to use that NLTK is more popular? I am more comfortable in Java so should I opt for Stanford CoreNLP or switch to NLTK + python</p>
0non-cybersec
Stackexchange
Does pressing ctrl-c several times make the running program close more quickly?. <p>I often start to read a huge file and then want to quit after a while, but there is a lag from pressing <br><kbd>Ctrl</kbd>+<kbd>C</kbd> to the program stops. Is there a chance of shortening the lag by pressing the <kbd>Ctrl</kbd>+<kbd>C</kbd> key several times? Or am I wasting my keypresses?</p>
0non-cybersec
Stackexchange
When memes hit too close home..
0non-cybersec
Reddit
What emotional insecurity's would you say all men share but don't speak about ?.
0non-cybersec
Reddit
[Book 1, Season 1] I did a photo shoot as book accurate Dany.
0non-cybersec
Reddit
Windows not booting off external disc drive. <p>I'm trying to install windows xp on Lion. This is a little bit complicated, but I was using <a href="http://danieltharp.com/weblog/2012/04/how-to-install-windows-xp-sp3-on-mac-osx-lion-and-get-drivers-too/" rel="nofollow noreferrer">this</a> tutorial. I got to step 6, which is booting from the Windows XP disc. But it says "no bootable medium found -- insert boot disc and press any key." I think the problem is occurring because I am using an external dvd drive, because my internal one is broken. Why is this occurring.</p> <p>Here is an image of the partitions from within disk utility: <img src="https://i.stack.imgur.com/7OQxF.png" alt="Partitions from within disk utility"></p> <p>Note: The image says the partition is formatted "Mas OS Extended (Journaled)" but it is actually "MS - DOS (FAT)" It is like this because I formatted it using the disk utility on the install media for Snow Leopard.</p>
0non-cybersec
Stackexchange
Cursed_phone.
0non-cybersec
Reddit
Intellij IDEA. Generate javadoc as jar archive. <p>How should I generate javadoc for my project (class library) as jar archive using Intellij IDEA 11?</p> <p>Is there any way to generate javadoc within generating artifact (jar archive) for my project?</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Extremum Problem. <p><a href="https://i.stack.imgur.com/a7hGV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a7hGV.png" alt="enter image description here"></a></p> <blockquote> <p>How big is the circle? </p> </blockquote> <p>My first steps: </p> <ol> <li>$ x^2 + y^2 =r^2$ </li> <li>$ f(x)=y=e^{-x^2}$ </li> </ol> <p>Substitute $y^2$ in $x^2 + y^2 =r^2.$<br> So, $x^2 + e^{-2x^2} =r^2$ </p> <p>Is this way correct? Because after calculating the first derivative $2x -4xe^{-2x^2}$ and so on my solution at the end is $x^2 = \dfrac {\ln(2)}{2}, $ and this is not correct.</p>
0non-cybersec
Stackexchange
How to obtain a specific table with a missing cell. <p>How should I proceed to obtain the following table: </p> <p><a href="https://i.stack.imgur.com/SdiT8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SdiT8.png" alt="table"></a></p> <p>What I've tried is: </p> <pre><code>\begin{tabular}{ | c | c | c | c | c | } \hline 7 &amp; 4 &amp; 7 &amp; 9 &amp; 27\\ \hline 10 &amp; 9 &amp; 9 &amp; 6 &amp; 34\\ \hline 17 &amp; 13 &amp; 16 &amp; 15 &amp; \multicolumn{1}{r}{ } \\ \hline \end{tabular} </code></pre> <p>but it does not work anymore.</p> <p>Thanks!</p>
0non-cybersec
Stackexchange
I was just trying to help my nephew ascend when my sister sends me this from his phone :(.
0non-cybersec
Reddit
What is the font for &quot;b&quot; letter?. <p><a href="https://i.stack.imgur.com/SYpRn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SYpRn.png" alt="enter image description here"></a></p> <p>What is the font for "b" letter?</p>
0non-cybersec
Stackexchange
Why do font files have to abide by CORS rules but images don&#39;t?. <p>When requesting font files cross-domain you have to ensure that the domain requesting is allowed to access the font file using CORS headers:</p> <ul> <li>Access-Control-Allow-Origin</li> <li>Access-Control-Allow-Credentials</li> </ul> <p>However this isn't required when requesting images, either for <code>img</code> elements or <code>background-image</code>.</p> <p>Why do these file types have different security?</p>
0non-cybersec
Stackexchange
Newbie One Hard Disk Two OS X How To?. <p>I am a long time Windows User, but newbie on OS X</p> <p>This is a wonderful OS I use.</p> <p>I have a macbook pro with 500GB HDD inside.</p> <p>I want to one HDD install both OS X 10.8.5 and OS X 10.10.2, plus one more partition for save data, so when as need, I format any two OS X partition will not data lose... (So Total 3 partition base on my case there).</p> <p>But I search APPLE official KB, not find any document as example like my case, just only see how to install the OS X on ext HDD only (Not the way I want to be).</p> <p>So .... anyone can tell me how to do above? OR can it?</p> <p>MacBook Pro, OS X Mountain Lion (10.8.5) </p>
0non-cybersec
Stackexchange
UK Parliament members concluded that the Internet plays a major role in the radicalization of terrorists and called on the government to pressure ISPs in Britain and abroad to censor online speech.
0non-cybersec
Reddit
Is there a site full of user-voted Dominion card combinations?. A friend of mine has all the expansions, and usually we just randomly pick the first (10 minus the number of people playing), then each player gets 3 chooser cards and gets to choose 1 to add. Another friend and I were bemoaning how this often leads to games for example, with only one potion card, which really devalues the potion, and how we'd like a more structured method of choosing our starting set, that extends beyond the suggested combinations included in the game. Is there already a site for voting up combinations, or is anyone interested in such a site, and should we make one?
0non-cybersec
Reddit
.NET Core Microservices – DShop project.
0non-cybersec
Reddit
Hat-Matching Problem, Probability of exactly 1. <p>A group of n professors attend a meeting, all wearing hats. At the beginning of the meeting, they put their hats away. At the end of the meeting, each picks a hat at random. The probability that <strong>none</strong> of them gets the right hat is:</p> <p>$\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!\:}-...+\frac{\left(-1\right)^n1}{n!}$</p> <p>The probability that <strong>at least</strong> one professor will get the right hat is:</p> <p>$1-\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!\:}-...+\frac{\left(-1\right)^n1}{n!}$</p> <p>What is the probability that <strong>exactly</strong> one of them gets the right hat?</p>
0non-cybersec
Stackexchange
Mate Panel extras. <p>I found out about the fish that tells you your fortune, but I also found out there was more then one type of them. <a href="https://i.stack.imgur.com/lHKJd.jpg" rel="nofollow noreferrer">Like this one</a> But I wanna know is there any thing that is like this? Maybe one that doesn't crack corny jokes and weird quotes.</p>
0non-cybersec
Stackexchange
Either a self-adjoint operator has $n$ eigenvector or not at all. <p>In the book of <em>Linear Algebra</em> by Greub, in chapter 8 Section 1, he argues that</p> <p>(In summary)</p> <blockquote> <p>$E$ is a real finite dimensional inner product space.</p> <p>If $\phi: E \to E$, is a normal transformation, i.e for $\bar \phi : E\to E$ $$(x, \phi(y)) = (\bar \phi (x), y)\quad \forall x,y \in E,$$ and $$\bar \phi \circ \phi = \phi \circ \bar \phi.$$ Then $\phi$ and $\bar \phi$ have the same eigenvectors, and any two eigenvector of $\phi$ whose eigenvalues are different are orthogonal.</p> </blockquote> <p>So from this <a href="https://math.stackexchange.com/questions/2641401/is-there-any-connection-between-the-fact-that-a-set-of-vectors-are-mutually-orth">question</a> we can argue that if $\phi:E \to E$ is a normal transformation and has $n$ eigenvectors whose eigenvalues are different, then those eigenvectors form a orthogonal basis for $E$.</p> <p>Then in the second section (Self-Adjoint mappings), he first states that</p> <p>(Direct quote)</p> <blockquote> <p>It is the aim of this paragraph to show that a selfadjoint transformation of an n-dimensional inner product space $E$ has $n$ eigenvectors which are mutually orthogonal.</p> </blockquote> <p><a href="https://i.stack.imgur.com/c862b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c862b.png" alt="enter image description here"></a></p> <p>And he shows that $e_1$ is an eigenvector of $\phi$.</p> <p><strong>However</strong>, he does not show the existence of such $e_1$, so is it true that either $\phi$ has $n$ eigenvectors which forms a orthogonal basis for $E$, or $\phi$ does not have any eigenvector at all, provided that $\phi$ is self-adjoint. <strong>Or</strong> the existence of $e_1$ is guaranteed in a way that I can't see ?</p> <p>I mean, as far as I understood, there can never be the case where $\phi$ has $k$ eigenvectors where $k \leq n$, is it the case ?</p> <p><strong>Correction:</strong></p> <p>Reading the next pages carefully, I have realised that after $e_1$, he constructs the remaining eigenvector in the orthogonal complement of $e_1$, and applies the same construction, so if the existence of $e_1$ is not guaranteed, none of the others are also not guaranteed, so $\phi$ can have $k \leq n$ eigenvectors. </p>
0non-cybersec
Stackexchange
Looking to improve macro photography. I only consider myself a hobbyist and barely that. My main focus has usually been landscapes but I have done a few shoots with models and such. Busy schedule has kept me from leaving the house much really so I started taking photos of my aquarium. I started getting really jealous of a lot of the awesome macro shots of corals and fish I was seeing popping up and wanted to give it a try. Shooting with a kit lens didn't work out so hot and I didn't really have any other lenses in the kit so I grabbed a 50mm macro. It does great for the upclose stuff but the stuff in the back of the tank I still need to crop way down to get any good detail out of it. Even the upfront stuff I find myself needing to crop way in. I seem to be overly sensitive to noise and this bugs me.... a lot. I made a post a few weeks ago about extension tubes and if they would work. I ordered a set and they seem to have done the opposite. Instead of being able to fill more of the picture with the objects in the back of the tank. I need to be right on top of the objects in the front of the tank. 13mm extension seems to have taken the working distance from 7in down to 3 or 4. So I guess my main question is, is cropping a major factor in macro photography? Or is there another way I need to approach this? I thought about picking up a 100mm macro but my concern is that my working distance and focal adjustment wouldn't add up. I know thats improper terminology, but say, my worry is that by the time I got the image filled with the object, I would be out of the range that the lens can focus. which starts to become an issue on the 50mm with objects at the front of the tank. I need to scoot back to get them back in focus, and then they are no longer filling the frame like I would like them to. Camera Sony A77 Here are a couple of albums. Shots with the Kit lens https://www.flickr.com/photos/titanphotog/sets/72157648190750554/ Shots with the 50mm macro. https://www.flickr.com/photos/titanphotog/sets/72157650446132127/ Any tips on improving macro photography are greatly appreciated
0non-cybersec
Reddit
How to make anonymous poll in a whatsapp group, facebook group, or google group?. <p>I am a member of mensa Indonesia. I was tasked to do an election to select the next Indonesian's mensa's fuhrer.</p> <p>Like all normal elections, the polls need to be secret to avoid bloodshed and civil wars. Also, each member can vote only once. Only members in good standing can vote.</p> <p>The plan is to put all such members in a group. Whatsapp group or facebook group.</p> <p>Then uses a third party app to get all members in the group to vote.</p> <p>Then tada, we got a new supreme leader for the next 2 years.</p> <p>Facebooks allow polls but it isn't anonymous. Whatsapp doesn't have poll.</p> <p>Are there any third party apps or robots that allow those things?</p> <p>It doesn't have to be whatsapp group, or facebook group, or google group. It can be telegram group or any group.</p> <ol> <li>We get people in a group.</li> <li>We vet that only the good guys are in the group.</li> <li>We get them to vote.</li> </ol> <p>That's the plan.</p> <p>Let me give you a sample solution that DOESN'T fit my criteria</p> <p><a href="https://i.stack.imgur.com/zFOcl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zFOcl.png" alt="enter image description here"></a></p> <p>I do not think whathash is suitable for his purpose</p> <ol> <li>Anyone that got the message can vote, even those that are not member of mensa</li> <li>People with different phones and whatsapp account can vote several times.</li> <li>Not ideal because someone, namely me, can see who vote for what. This one can be relaxed. Basically I want that info to be hidden from all people, if possible, even from those conducting the poll.</li> </ol> <p>I WANT DIFFERENT SOLUTIONS</p> <p>I want everyone go join my group. Then only people in that group can vote</p> <p>Facebook polls actually works almost perfectly. However, I need a way to prevent anyone from seeing who vote for who. We need to minimize bloodshed here. While there is no way voting for mensa leaders can lead to any kind of bloodshed, we want to generalize the system to more politically sensitive votings.</p>
0non-cybersec
Stackexchange
There exist $n$ different integers in the interval $\big(k^n,(k+1)^n\big)$ whose product is a perfect $n$-th power.. <blockquote> <p>Given a positive integer <span class="math-container">$ n&gt; 2 $</span>. Prove that there exists a natural number <span class="math-container">$ K $</span> such that for all integers <span class="math-container">$ k \ge K $</span> on the open interval <span class="math-container">$ \big({{k} ^{n}}, \ {{(k + 1)} ^{n}}\big) $</span> there are <span class="math-container">$n$</span> different integers, the product of which is the <span class="math-container">$n$</span>-th power of an integer. </p> </blockquote> <p><strong>Source</strong> Ukrainian TST 2011</p> <hr> <p><strong>Progress</strong>: Maybe one can choose the smallest prime divisor <span class="math-container">$q$</span> of <span class="math-container">$n$</span> and then one can choose all <span class="math-container">$\frac{n}{q}$</span> powers and among these powers, one can choose <span class="math-container">$n$</span> integers whose product is a <span class="math-container">$q$</span>-th power In this way, we would just have to prove that Between <span class="math-container">$k^q$</span> and <span class="math-container">$(k+1)^q$</span> we have <span class="math-container">$n$</span> integers with their product being a <span class="math-container">$q$</span>-th power.</p>
0non-cybersec
Stackexchange
ITAP of a street in Chicago after a storm.
0non-cybersec
Reddit
Macroscopic oil droplets mimicking quantum behavior: Implications for Bohmian mechanics. Summary in comments..
0non-cybersec
Reddit
error : NameError: name &#39;subprocess&#39; is not defined. <pre><code>#!/usr/bin/python3 username = 'joe' # generate passphrase pw_length = 6 phrase = subprocess.check_output(['pwgen', str(pw_length), '1']) phrase = phrase.decode('utf-8').strip() dev_null = open('/dev/null', 'w') passwd = subprocess.Popen(['sudo', 'passwd', user], stdin=subprocess.PIPE, stdout=dev_null.fileno(), stderr=subprocess.STDOUT) passwd.communicate( ((phrase + '\n')*2).encode('utf-8') ) if passwd.returncode != 0: raise OSError('password setting failed') </code></pre> <p>how do i fix this error :</p> <pre><code>bash-3.00# python ./pass2.py Traceback (most recent call last): File "./pass2.py", line 6, in ? phrase = subprocess.check_output(['pwgen', str(pw_length), '1']) NameError: name 'subprocess' is not defined </code></pre>
0non-cybersec
Stackexchange
Question from a console gamer thinking about switching to PC gaming.. I don't know if this is the appropriate subreddit for this and I apologize if it isn't, but I had a few questions. 1) How often do you need to update your hardware? I like the idea of playing with the superior graphics and processing power of a PC, but I really can't afford to upgrade my graphics card and CPU every 6 months. 2) How limited will I be on my selection of games? Back in the day, and maybe I'm misdrembering this, but it seemed like consoles had a much wider variety than PCs. Is this still the case? Or has a lot of that changed with the advent of websites like Steam? 3) This is the biggest deciding factor for me? I know that some games for PC are compatible with game controllers, but how prevelant is this compatibility. I simply cannot play on a keyboard. I'm not good at it and I do not enjoy it. I need to be able to use a controller. Again, sorry if this isn't the right subreddit and thank you in advance for all your answers. EDIT: Just wanted to add two very informative wiki pm'd to me by /u/Tizaki. I found them very informative and hopefully anyone who is in the same boat as I am right now will, as well. /r/pcmasterrace/wiki/guide and /r/pcmasterrace/wiki/builds
0non-cybersec
Reddit
How to Make Pizza Puff Pastry Twists.
0non-cybersec
Reddit
Can ReadWriteOnce PVC be rejected by AWS EBS/GCP PersistentDisk upon Pod Rescheduling?. <p>Assume currently I have 2 <code>PVC</code>s with <code>ReadWriteOnce</code>, claimed by <code>Pod #1</code> and <code>Pod #2</code> respectively. Both are running on <code>Node #1</code>.</p> <p>Next, <code>Pod #2</code> is updated with the newer Docker image. However, at the same time <code>Pod #3</code> is run and allocated to <code>Node #1</code>. Since <code>Node #1</code> is now full, <code>Pod #2</code> could only be allocated by Kubernetes to <code>Node #2</code>.</p> <p>Since AWS EBS and Google PersistentDisk could only be mounted on single Node, would <code>Pod #2</code> become unable to connect to the-previously-claimed <code>PVC</code>? </p> <p>If yes, how to avoid having this issue?</p>
0non-cybersec
Stackexchange
Malware Alert: Win32.Worm.Mabezat.J is Hiring! - Malware City Blogs.
1cybersec
Reddit
Reddit: Meet Cairo! He's 10 weeks old and curious about everything!.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
What are the best qualities that makes your best guy friend who he is and what's an example of how those qualities make your friendship what it is?.
0non-cybersec
Reddit
cross products in complex vectors. <p>What is cross product for complex vector in Cn ? and how to prove if u,v are complex: |u*v| = |u|. |v| if and only if u= av ? do I need here to define the cross product? </p>
0non-cybersec
Stackexchange
As long as we are posting pictures of book-themed buildings, here's a campus theatre I used to walk past every day (Portland, OR).
0non-cybersec
Reddit
Glossaries not printing to yet an other latex newb. <p>So let me begin by saying that I've seen that this is a very common issue, especially with texmaker on windows, and there are a lot of solutions out there, but I've tried all the ones that I found and they either didn't work or I couldn't understand them.</p> <p>My code looks something like this:</p> <pre><code>\documentclass[a4paper,10pt,twoside]{report} \usepackage[acronym,nonumberlist]{glossaries} \loadglsentries{acronyms} \makeglossaries \begin{document} \chapter*{Symbols and Abbreviations}\label{chapter:symbols and abbreviations} \setglossarystyle{long} \printglossary[title=Symbols] \setglossarystyle{long} \printglossary[type=\acronymtype, title=Abbreviations] A whole bunch of text from my thesis with the following abbreviations and symbols, \acrfull{nf}, \acrlong{efr}, \gls{z}. \end{document} </code></pre> <p>In my <code>acronyms.tex</code> file I have the following (plus a lot more)</p> <pre><code>\newacronym{nf}{NF}{Near Focus} \newacronym{efr}{EFR}{Extra Focal Radiation} \newglossaryentry{z} {name={\ensuremath{z}}, description={\tabto{1cm}[$mm$] \tabto{4cm} top surface of shutters and fs distance}} </code></pre> <p>As most people I've read about this runs without the glossaries being printed.</p> <p>I've tried changing some line in the Xindy file but I found it already changed. I tried changing the commands to <code>\makeglossaries</code> and <code>\printglossaries</code> or <code>\makenoidxglossaries</code> and <code>\printnoidxglossaries</code> but nope. I tried making the <code>makeglossaries %</code> user command in texmaker but I get the following error when running it: </p> <pre><code>Process started makeglossaries : The script engine could not be found. makeglossaries: Data: scriptEngine="perl.exe" Process exited with error(s) </code></pre> <p>I've read among other solution something about installing <code>Perl</code> and manually adding it to some path but I don't really know what to do specifically and I have no clue if it will actually solve the problem.</p> <p>If somebody could help clear out some of this and point me in the right direction it would be of great help, I've already spent a couple of hours on this stuff. Thank you all!</p>
0non-cybersec
Stackexchange
IAMA: Rome Ramirez & I sing for my favorite band Sublime. Here's a photo of me answering questions. http://instagr.am/p/OkMiMGDMnD/ I grew up listening to Sublime and learned all their songs. One day I met Eric Wilson and he eventually asked me to for Sublime and we called it Sublime with Rome. We're currently on tour with Cypress Hill, and Pepper for two more weeks. Tour dates and some videos are up on my website http://romemusica.com EDIT: Excuse my spelling, I'm answering your questions as quick as I can. I got a show to do! EDIT 7pm: I'm heading out to the show now, I'll be back to answer the rest of your questions after the show tonight. Thanks for posting up everybody this is fun!
0non-cybersec
Reddit
Complexity of Subset-Sum when the target sum is a constant. <p>The Subset-Sum decision problem is: </p> <p>Given a set of n non-negative integers S, is there a subset of S that sum to k? If S and k are inputs, the problem is known to be NP-Complete. </p> <p>What about the case when k is not an input but a constant?<br> Is the problem still NP-Complete?</p> <p>My thoughts are that if k is given, since the integers are all non-negative, we only need to consider subsets of at most k elements (ignoring elements that are zero). That means we only need to consider at most $n^k$ possibilities which is polynomial. So, the problem is not NP-Complete. Is my understanding correct?</p>
0non-cybersec
Stackexchange
Look at the pure love coming out of those eyes.
0non-cybersec
Reddit
How to quickly start Programs like &quot;regedit.exe&quot; from the Windows 7 search bar using substring matching?. <p>The search bar in Windows 7 is very convenient to quickly start applications by pressing the Win-key and then entering the name of the application.</p> <p>For applications with a Program Menu entry like <strong>Firefox</strong>, it is sufficient to type <strong>Fire</strong> and <strong>Firefox</strong> will be displayed in the <strong>Programs</strong> section of the search results.</p> <p>For other applications like <code>regedit.exe</code>, I have to type the full command <strong>regedit</strong> before the correct choice <strong>regedit.exe</strong> appears.</p> <p>Is there any way to have <strong>regedit.exe</strong> appear already when I have just entered a substring?</p> <p><strong>Please note</strong>: I have seen <a href="https://superuser.com/questions/39976/add-my-applications-to-vistas-start-search">Add my applications to Vista’s Start Search</a>, but I don't want to add anything to the Start Menu manually. This question is about if there is some configuration that can be tuned to make the results appear. I have also seen <a href="https://superuser.com/questions/70333/search-behavior-of-windows-7-start-menu">Search behavior of Windows 7 start menu</a>, but my problem is not that the exe appears under <strong>Files</strong>, <strong>regedit.exe</strong> correctly appears under <strong>Programs</strong>, but it should appear already for a substring match. </p>
0non-cybersec
Stackexchange
Suggest postgame challenges. I'm trying to squeeze out every inch in my X before ORAS. So can you guys suggest good challenges, other than Nuzlocke, to do after beating the elite four. The challenges I'm referring to ate self-imposed challenges not challenges in-game, i.e. The Looker Missions.
0non-cybersec
Reddit
Can&#39;t find the right gigabyte motherboard to update the bios. <p>My friend has a gigabyte GA-78LMT-S2 and we need to update the BIOS, but when we look it up there are three revisions of it, but non of them match in color of the motherboard, his is brown, but non of the revisions are. What is the right one?</p>
0non-cybersec
Stackexchange
How to store an auth token in an Angular app. <p>I have an Angular application (SPA) that communicates with a REST API server and I'm interested in finding out the best method to store an access token that is returned from an API server so that the Angular client can use it to authenticate future requests to the API. For security reasons, I would like to store it as a browser session variable so that the token is not persisted after the browser is closed.</p> <p>I'm implementing a slightly customized version of OAuth 2.0 using the Resource Owner Password grant. The Angular application provides a form for the user to enter their username and password. These credentials are then sent to the API in exchange for an access token which must then be sent as a header (Authorization: Bearer %Token%) for all outbound requests to the API so that it can authorize requests to other routes.</p> <p>I'm fairly new to the realm of Angular, but the workflow I would like to implement as far as handling these tokens is summarized as follows. </p> <p><strong>1)</strong> The client makes a request to the API providing it with user credentials.</p> <p><strong>2)</strong> If this request is successful, the token is stored <em>somewhere</em> (where is the question)</p> <p><strong>3)</strong> Intercept HTTP requests. If token is set, pass it along as a header to API</p> <p><strong>4)</strong> Token is destroyed when the browser/tab is closed.</p> <p>I know Angular offers <strong>$window.sessionStorage</strong>, which appears to be what I am looking for, but I am concerned by the potential for it not to work on all browsers according to various resources I've read. This is an enterprise grade application and must be compatible across a broad range of browsers (IE, Chrome, Firefox). Can I safely use this with the confidence that it will be stable? </p> <p>The alternatives, from what I understand, are either $window.localStorage or cookies ($cookies, $cookieStore). This would not be an ideal solution for me since I don't want this data to persist, but if this is more reliable I'll have to sacrifice efficiency for compatibility. I was also thinking it might be possible to simply set it as a value on the $rootScope and reference it this way, but I'm not sure if this is feasible.</p> <p>I hope that all made sense. Any help / suggestions would be greatly appreciated. Thanks!</p>
0non-cybersec
Stackexchange
NSV: I ran my first 10K!!. 2 months ago I couldn't run more than 2 minutes. Today, I ran my very first 10K (Cooper River Bridge Run) in 1hour 13minutes! My goal is do to it again next year in less than an hour. I also plan to do many more 10ks and even a half marathon in the time in between. Dang it feels good to accomplish a goal!
0non-cybersec
Reddit
If all Video Games had major cult/religious followings, which would be the craziest?. Edit:So this blew the fuck up. Thanks for the front page!
0non-cybersec
Reddit
How to create custom popup menu with pointer in android. <p>I want to create a popup menu with a pointer to show which record is showing in the popup.</p> <p>I've tried to custom Dialog from <a href="https://www.youtube.com/watch?v=0DH2tZjJtm0" rel="nofollow noreferrer">this link</a> but it doesn't show a pointer.</p> <p>What I want is something like the image below:</p> <p><a href="https://i.stack.imgur.com/aBVaQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aBVaQ.jpg" alt="Image example"></a></p>
0non-cybersec
Stackexchange
When and why would the C linker exclude unused symbols?. <p>I'm performing some tests with <code>gcc</code> to understand the rule(s) by which it intelligently excludes unused symbols.</p> <pre><code>// main.c #include &lt;stdio.h&gt; void foo() { } int main( int argc, char* argv[] ) { return 0; } </code></pre> <p>.</p> <pre><code>// bar.c int bar() { return 42; } </code></pre> <p>.</p> <pre><code>&gt; gcc --version gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &gt; &gt; gcc -c bar.c &gt; gcc -g main.c bar.o &gt; nm a.out | grep "foo\|bar" 000000000040111f T bar 0000000000401106 T foo </code></pre> <p>Above, I've compiled <code>bar.o</code>, and linked it with <code>a.out</code> while compiling <code>main.c</code>.<br> Listing <code>a.out</code>'s symbols show that both unused functions - <code>foo()</code> and <code>bar()</code> - are included in the executable.</p> <pre><code>&gt; ar -r libbar.a bar.o ar: creating libbar.a &gt; gcc -g main.c -L ./ -lbar &gt; nm a.out | grep "foo\|bar" 0000000000401106 T foo </code></pre> <p>Above, I've archived <code>bar.o</code> to <code>libbar.a</code>, and recreated <code>a.out</code>, this time linking with <code>libbar.a</code> instead of <code>bar.o</code>. This time around, unused function <code>foo()</code> is still present, but <code>bar()</code> is not.</p> <p>From this experiment, I might surmise the following "rules":</p> <ol> <li>Symbols linked from object files are always present in executables. (Perhaps this explains why <code>foo()</code> is always present: is there a temporary/anonymous <code>main.o</code> that's created? If so, it would include <code>foo()</code>)</li> <li>If an executable is linked with a <em>library</em>, <code>gcc</code> will intelligently figure out unnecessary symbols to exclude.</li> </ol> <p>The above are my hypotheses based on this experiment - but how correct is it? If someone is knowledgeable with the intricacies of how linking works, I'd be grateful for some background information explaining the whys and wherefores of what's going on.</p>
0non-cybersec
Stackexchange
Dealing with Git fatal: Invalid revision range. <p>I am having an issue with Crucible and Git commit. Crucible hangs on </p> <pre><code>&gt;git whatchanged --always --reverse --date-order -m --no-abbrev --no-renames 9e00d1317c4363f73b7deb5caf5096c69e646b81..641c20936dbec78308d1bfa06d14f174f9d7df1d --pretty=format:C:%H%nP:%P%nA:%aN%nE:%aE%nR:%cN%nF:%cE%nD:%at%nS:%s%nB:%b%n@@fe_body_end@@ </code></pre> <p>with the error: </p> <pre><code>fatal: Invalid revision range 9e00d1317c4363f73b7deb5caf5096c69e646b81..641c20936dbec78308d1bfa06d14f174f9d7df1d </code></pre> <p>Apparently there is an error in the </p> <pre><code>&gt;git show 641c20936dbec78308d1bfa06d14f174f9d7df1d fatal: bad object 641c20936dbec78308d1bfa06d14f174f9d7df1d </code></pre> <p>What is the best way to correct such problems? Git fsck leads to no errors... </p> <blockquote> <p>git fsck --full Checking object directories: 100% (256/256), done. Checking objects: 100% (21169/21169), done. dangling commit 50062154743dbc78837af62cc49388f9fabe5b58 dangling blob 4b82dcbd1bb49f865e5069f31d50cd9304e31c3e</p> </blockquote>
0non-cybersec
Stackexchange
Fix: The Global element &#39;configuration&#39; has already been declared. <p>I used the second solution of <a href="https://stackoverflow.com/questions/179927/how-to-resolve-could-not-find-schema-information-for-the-element-attribute-xxx">How to resolve &quot;Could not find schema information for the element/attribute &lt;xxx&gt;&quot;?</a></p> <p>I.e. created a XSD with the button to create a scheme. I changed the stylesheet in app.config to app.xsd but now I get the warning:</p> <p>The Global element 'configuration' has already been declared in app.xsd</p> <p>Even when changing the name the warning is shown. Does anybody have a solution for this?</p>
0non-cybersec
Stackexchange
Error accessing generated ivars when I override setters and getters in Modern Objective-C. <p>I know now the new Objective-C compiler lets you not need to synthesize your properties anymore. I have one file that has two classes in it. My .h for a simple helper class looks like this:</p> <pre><code>@interface ViewFrameModel : NSObject @property (nonatomic, strong) UIView *view; @property (nonatomic, assign) CGRect frame; - (id)initWithView:(UIView *)view frame:(CGRect)frame; @end </code></pre> <p>In the same .h file, for my other class (class 2), I have:</p> <pre><code>@property (nonatomic, strong) ViewFrameModel *viewFrameModel; </code></pre> <p>In class 2.m, I can do this:</p> <pre><code>- (void)setViewFrameModel:(ViewFrameModel *)viewFrameModel { _viewFrameModel = viewFrameModel; [self pushViewFrameModel:viewFrameModel]; } </code></pre> <p>This works fine with no complaints from the compiler, however, when I add this:</p> <pre><code>- (ViewFrameModel *)viewFrameModel { return _viewFrameModel; } </code></pre> <p>I get two complaints, one on the first method <code>setViewFrameModel</code>:</p> <blockquote> <p>"Use of undeclared identifier _viewFrameModel, did you mean viewFrameModel"</p> </blockquote> <p>And the other on return <code>_viewFrameModel</code>:</p> <blockquote> <p>"Use of undeclared identifier _viewFrameModel, did you mean viewFrameModel" "Reference to local variable viewFrameModel' declared in enclosing context"</p> </blockquote> <p>Why do I get these errors when I add in the </p> <pre><code>- (ViewFrameModel *)viewFrameModel { return _viewFrameModel; } </code></pre> <p>method? I want to override this method with some custom info, but it's complaining at me :-. Thoughts? TIA.</p>
0non-cybersec
Stackexchange
HIV virus [pic].
0non-cybersec
Reddit
How can I filter an array from a array of arrays where all the items in one array matches some of the items in another array?. <h3>TL/DR</h3> <p>How can I filter an array of arrays in go against an array of strings?</p> <p>Is there a <code>some</code> or <code>any</code> equivalent of JS/Py in go where I can filter an array of arrays if some or all the items in an array is present in another array? </p> <p>So for example, consider this as the source array:</p> <pre class="lang-golang prettyprint-override"><code>arrays := [][]string{ {"some", "value"}, {"some", "value", "another"}, {"value", "another", "test"}, {"value", "test"}, {"some", "test"}, } </code></pre> <p>And I want to filter <code>arrays</code> by <code>[]string{"some", "value"}</code> if all the items here are found in the array. </p> <p>The expected output is </p> <pre><code>[[some value] [some value another]] </code></pre> <p>Altervatively, if I change my filter to <code>[]string{"some", "test"}</code>, the expected value is <code>[[some test]]</code></p> <p>I can get the logic down quite right in my test code</p> <pre class="lang-golang prettyprint-override"><code>package main import "fmt" func inArray(s string, arr []string) bool { for _, a := range arr { if s == a { return true } } return false } func main() { arrays := [][]string{ {"some", "value"}, {"some", "value", "another"}, {"value", "another", "test"}, {"value", "test"}, {"some", "test"}, } filterBy := []string{"some", "value"} hold := make([][]string, 0) // Ignore this because it doesnt work as expected for _, arr := range arrays { for _, f := range filterBy { if ok := inArray(f, arr); ok { hold = append(hold, arr) } } } fmt.Println(hold) } </code></pre>
0non-cybersec
Stackexchange
Having trouble using the Chinese Remainder Theorem to solve a system of congruences. <p>I'm working on a difficult assignment involving cryptography, and am nearing the end (or so I think). Summed up, I need to solve a system of congruences using the Chinese Remainder theorem.</p> <p>Due to the system being modulo a non-prime (in my problem, I have p, a large prime, but in this particular part of the problem, this system is modulo p-1), obviously many numbers will not have modular inverses- so I turned to the Chinese Remainder Theorem, which is perfect for this issue.</p> <p>I proceeded in the manner described on page 20 and 21 of the following thesis (side note- the assignment I'm working on is similar to the one in this thesis- a discrete log problem): <a href="http://howelljs.people.cofc.edu/math/msthesis.pdf" rel="nofollow">http://howelljs.people.cofc.edu/math/msthesis.pdf</a>. What I'm doing is constructing a matrix, and an answer vector. I'm 99% sure that I've done this correctly- I've verified that the matrix satisfies all of my criteria.</p> <p>Once I have the system, which is mod p-1, I solve it modulo each of the factors of p-1, as described in the above link. In my case, the factors of p-1 are 2, 2, 2, 23, and 59407 (I think the multiple factors of 2 may be what's giving me trouble here).</p> <p>At this point, I have 3 result vectors- one for the system mod 2, one for the system mod 23, and one for the system mod 59407. Accoring to the Chinese Remainder Theorem, I should be able to take the $i^{th}$ element of each result vector, as well as a vector containing my bases (2, 23, 59407) and construct the $x = L_i$ that would satisfy each congruence. Here's what I mean:</p> <p>My original system looks like this:</p> <p>$\begin{matrix} 0 &amp; 5 &amp; 4 &amp; 1 \\ 1 &amp; 7 &amp; 0 &amp; 2\\ 8 &amp; 1 &amp; 0 &amp; 2\\ 10 &amp; 5 &amp; 1 &amp;0 \end{matrix}$*$\begin{matrix} L_1\\L_2\\L_3\\L_4 \end{matrix}$=$\begin{matrix} 2946321 \\ 5851213 \\ 2563617\\10670279 \end{matrix}$ $\pmod{10930888}$</p> <p>And when I solve it modulo each factor (2, 23, 59407) I get the following $L_i$ vectors:</p> <p>$\begin{matrix} 0\\1\\0\\0 \end{matrix}\pmod2$ and $\begin{matrix} 1\\1\\12\\14\end{matrix}\pmod{23}$ and $\begin{matrix} 14087\\1\\14365\\37320 \end{matrix}\pmod{59407}$</p> <p>So now, for example, I can construct $L_1$ by taking the 1st value from each result vector, and the bases, and construct a mini system of congruences:</p> <ul> <li>$0=x\pmod{2}$</li> <li>$1=x\pmod{23}$</li> <li>$14087=x\pmod{59407}$</li> </ul> <p>I found a Chinese Remainder Theorem function online, and used it to find the smallest $x$ that satisfies the 3 congruences above (I also verified the answers with a different CRT function, and a CRT command in an entirely different math program).</p> <p>The interesting part is that, for the answer to come back correctly, I had to use the command $CRT([0, 1, 14087],[6, 23, 59407])$. You probably noticed the 6- I think this is how to account for the 2 showing up 3 times in the factorization of p-1 (and no, for some reason 8 doesn't yield the correct answer, as I expected).</p> <p>So, I found that $L_1 = x = 5776566$, which is correct. This also works for $L_2$ However, using the above process for $L_3$ and $L_4$ doesn't work! </p> <p>Note: I know the result values $L_i$- I found them through an easy exhaustive search in an earlier part of the problem, but I need to be able to generate them procedurally. If I sub the known answers into the original system up above, the congruence holds true. However, the $L_3$ and $L_4$ that I get from the Chinese Remainder Theorem process I described above do not work in the original system.</p> <p>What am I doing wrong here? Is it how I handle the multiple factors of 2 in my original modulus? I can provide more detailed information if needed, I just wanted to keep this post as short as possible (which isn't short at all, it seems). Thanks for any advice- I feel like I'm really close to the solution here!</p> <p>EDIT: the first comment below is correct- when using the method, the system needs to be solved mod 8, 23, and 59407 instead of 2, 23, and 59407. At that point, using the Chinese Remainder Theorem with 8 as the base instead of 2 will allow correct reconstruction of the desired $L$ vector</p>
0non-cybersec
Stackexchange
I wanted to screen in my patio. A couple weeks and $500 later....
0non-cybersec
Reddit
I took this picture of fireflies in my backyard. Trying to decide if it looks any good, or just a photo with weird yellow streakies..
0non-cybersec
Reddit
Friend class in TypeScript. <p>In C++ there is something called a friend class. As far as I know, there's no such thing in TypeScript/JavaScript. Is there a way to simulate such behavior of friend class in TypeScript/JavaScript?</p> <p>To give better context (if needed) of why and what I try to do, I make some small game for fun (and to learn stuff) and try to do <a href="http://gameprogrammingpatterns.com/spatial-partition.html#a-grid-of-linked-units" rel="noreferrer">this</a>. At the moment I just use public methods and everything works, but I would like to limit accessibility of those methods to just one other class. I use TypeScript, if that helps.</p>
0non-cybersec
Stackexchange
How do I remove Ubuntu without losing any data from the HDD?. <p>I've installed the newest version of Ubuntu but now I want to get back to my windows but when I reach the screen with Windows Boot Manager, like this...</p> <p><img src="https://i.stack.imgur.com/IoBWR.jpg" alt="enter image description here"></p> <p>(This is a screenshot from the installation guide) ...I can't use the keyboard to highlight Windows so I can't access Windows to uninstall Ubuntu.</p> <p>If I use the Windows installation CD, it erases all the data on my hard disk? And if so, what other thing can I do to remove Ubuntu and without losing all my datas?</p> <p>Please answer as soon as possible, Thank you in advance!</p>
0non-cybersec
Stackexchange
recuperate USABLE space NEXUS 5. <p>the question how to restore the full capacity of the disk space on my Nexus 5. Mine default disk space is 32 GB, but after I installed ubuntu touch and then returned original ROM my disk space is no longer 32 gigabytes, and now is a 26.7 gigabytes. How to restore its 32 gigabytes? I tried all the recommendations described in the Instruction, but it does not work. Thanks in advance for your help!</p>
0non-cybersec
Stackexchange
How can I convert each Pandas Data Frame row into an object including the column values as the attributes?. <p>Suppose I have a DataFrame including following columns "NAME", "SURNAME", "AGE" and I like to create one object for each row, including those column values as its variables.</p> <pre><code>person = ConvertRow2Object(frame.iloc[0,:]) print person.NAME //outputs Gary </code></pre> <p>How can I do it with a generic solution to any DataFrame with any kind of column names and data types?</p> <p>Any suggestion is welcome :)</p>
0non-cybersec
Stackexchange
Unix vs Excel sort. <p>I have the following list of files sorted according to Excel:</p> <pre><code>a1.txt a10.txt a11.txt a12.txt a2.txt </code></pre> <p>If I use <code>sort</code> on Unix/Linux, I get the following order:</p> <pre><code>a10.txt a11.txt a12.txt a1.txt a2.txt </code></pre> <p>where you can see a different behavior for the character <code>.</code>. Is there an option to get the same order as Excel? I tried -b, -g, -n, ... without success.</p>
0non-cybersec
Stackexchange
I remember mail used to provide a quick link to responses to an email. Am I crazily misremembering?.
0non-cybersec
Reddit
One column keywords then two column text. <p>I will try to be as explicit as I can.</p> <p>I'm producing a document with a title <code>\maketitle</code> which is fine. Then, I have a Keyword line which is into the document and then my text.</p> <p>My problem is that my 2nd column starts on the same line as the Keywords while I would like it to start at the same place then the headline.</p> <p><a href="https://i.stack.imgur.com/7Z1Ia.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Z1Ia.png" alt="Column problem"></a></p> <pre><code>\maketitle \begin{article} \keywords{XX | XX | XX | XX} \section{Headline} \dropcap{B}la bla bla bla bla bla. \subsection{XXX} </code></pre> <p>Any solution?</p>
0non-cybersec
Stackexchange
Login in both Chrome extension and Webapp via Firebase. <p><strong>Chrome Extension part</strong></p> <p>I have implemented a chrome extension based on Firebase. We started the login flow by:</p> <pre><code>chrome.identity.launchWebAuthFlow </code></pre> <p>and then after the flow is done, it will trigger the auth change listener</p> <pre><code>firebase.auth().onAuthStateChanged(....); </code></pre> <p>and after that I can have the user's access token.</p> <p><strong>WebApp part</strong></p> <p>Now I am building a webapp using the same Firebase project. But the Firebase SDK in the webapp cannot auto login (need to login again). </p> <p><strong>My Question</strong></p> <p>How can I sync the auth status across both webapp and the Chrome extension</p>
0non-cybersec
Stackexchange
It's a mushroom I swear.
0non-cybersec
Reddit
Puffy Vanilla and Peanut Butter Chip Cookies.
0non-cybersec
Reddit
Miniature horses galloping through a barn.
0non-cybersec
Reddit
Choosing a distributed shared memory solution. <p>I have a task to build a prototype for a massively scalable distributed shared memory (DSM) app. The prototype would only serve as a proof-of-concept, but I want to spend my time most effectively by picking the components which would be used in the real solution later on.</p> <p>The aim of this solution is to take data input from an external source, churn it and make the result available for a number of frontends. Those "frontends" would just take the data from the cache and serve it without extra processing. The amount of frontend hits on this data can literally be millions per second.</p> <p>The data itself is very volatile; it can (and does) change quite rapidly. However the frontends should see "old" data until the newest has been processed and cached. The processing and writing is done by a single (redundant) node while other nodes only read the data. In other words: no read-through behaviour.</p> <p>I was looking into solutions like <a href="http://memcached.org" rel="noreferrer">memcached</a> however this particular one doesn't fulfil <strong>all</strong> our requirements which are listed below:</p> <ol> <li>The solution must at least have <strong>Java client API</strong> which is reasonably well maintained as the rest of app is written in Java and we are seasoned Java developers;</li> <li>The solution must be totally <strong>elastic</strong>: it should be possible to add new nodes without restarting other nodes in the cluster;</li> <li>The solution must be able to handle <strong>failover</strong>. Yes, I realize this means some overhead, but the overall served data size isn't big (1G max) so this shouldn't be a problem. By "failover" I mean seamless execution without hardcoding/changing server IP address(es) like in memcached clients when a node goes down;</li> <li>Ideally it should be possible to specify the degree of data overlapping (e.g. how many copies of the same data should be stored in the DSM cluster);</li> <li>There is no need to permanently store all the data but there might be a need of post-processing of some of the data (e.g. serialization to the DB).</li> <li><strong>Price</strong>. Obviously we prefer free/open source but we're happy to pay a reasonable amount if a solution is worth it. In any way, paid 24hr/day support contract is a must.</li> <li>The whole thing has to be hosted in <strong>our data centers</strong> so SaaS offerings like Amazon SimpleDB are out of scope. We would only consider this if no other options would be available.</li> <li>Ideally the solution would be <em>strictly consistent</em> (as in CAP); however, <em>eventual consistence</em> can be considered as an option.</li> </ol> <p>Thanks in advance for any ideas.</p>
0non-cybersec
Stackexchange
So that's how it's done....
0non-cybersec
Reddit
COMO NAO GOZAR RAPIDO NA CAMA COM GENGIBRE E MEL COMO NAO GOZA RAPIDO.
0non-cybersec
Reddit
I need your best brownie recipes. So my girlfriend has asked me to bake some brownies on Sunday. Her requirements are gooey and maybe chocolate orange flavour with big chunks of chocolate.
0non-cybersec
Reddit
Centreon/Nagios check_http: Use different domain name/url. <p>I configured Centreon CES as monitoring-system - now I'm facing the following problem:</p> <p>There is a host with domain <code>example.com</code> which resolves to <code>123.123.123.123</code>. This host is not configured by me and shows content if user visits <code>http://example.com</code> but <code>404</code> if user visits <code>http://123.123.123.123</code> .</p> <p>Well, now Centreon shows <code>WARNING</code> of course, because the given domain-name is resolved to the ip - and this returns <code>404</code>.</p> <p>Now I tried to modify the <code>check_http</code>-command as follows:</p> <pre><code>$USER1$/check_http -H $HOSTADDRESS$ $ARG1$ </code></pre> <p>as argument I tried to give </p> <pre><code>ARG1 =&gt; -u www.example.com </code></pre> <p>What I thought was that the system combines it to </p> <pre><code>$USER1$/check_http -H $HOSTADDRESS$ -u www.example.com </code></pre> <p>But it does not. What would be the correct way to get the result I want to get?</p>
0non-cybersec
Stackexchange
Just received my early access code! Anyone else receiving theirs?. Just your emails associated with your bnet account. Just received mine a few minutes ago.
0non-cybersec
Reddit
prime ideals occurring in the set of ideals $rad(a:x)$ is the same as the set of prime ideals occurring in the set of ideals $(a:x)$?. <p>I want to find a direct proof that for any Noethern ring $R$ with $a$ an ideal of $R$ the prime ideals occurring in the set of ideals $rad(a:x)$ is the same as the set of prime ideals occurring in the set of ideals $(a:x)$</p> <p>$(a:x)=\{ r \in R : rx \in a \}$, and $rad$ is the radical of an ideal.</p> <p>The reason for me believing this to be true is that for $ a = \bigcap_{i=1}^{n}q_i$ being a minimal primary decomposition of $a$ with $rad(q_i)=p_i$ we have that $ass(R/a)=\{p_1,p_2,...,p_n\}$ (1st uniqueness theorem of primary decomposition as stated in Reid undergraduate commutative algebra) And we also have that the prime ideals occuring in the set of ideals of $rad(a:x)$ $x\in R$ is the same set of primes. (1st uniqueness theorem as stated in McDonald, Atiyah) If we now note that $ass(R/a)=\{r \in R : rx = 0, x \in R/a \} = \{ r \in R : rx \in a \}= (a:x) $ we have to conclude that the set of prime ideals in $rad(a:x)$ has to be the same as the prime ideals of $(a:x)$ for any ideal $a$ of $R$ </p> <p>For any prime ideal of $(a:x)$ of course $rad(a:x)$ is prime so all prime ideals in $(a:x)$ is prime in $rad(a:x)$ but what about the other direction? Let p be prime in $rad(a:x) =rad(ann(x))$ $x\in R/a$ since the radical of $ann(x)$ is the intersection of all minimal prime ideals $w_i$ containing $ann(x)$ we may write $\bigcap_{i=1}^{n}w_i = rad(ann(x))$ Now assuming that this intersection is prime we must have that $rad(ann(x))=w_i$ for some $i$. ... But this doesn't show $ann(x)$ to be prime?</p> <p>If the stated proposition is false please adress how the two different versions of the 1st uniqueness theorem may both be true.</p>
0non-cybersec
Stackexchange
It's a bridge. That I made. Titles are hard..
0non-cybersec
Reddit
mdadm raid1, [1/2] disks failed, safe to reboot?. <p>I am seeing the following under /proc/mdstat</p> <pre><code>Personalities : [raid1] md1 : active raid1 sda2[0](F) sdb2[1] 976554876 blocks super 1.1 [2/1] [_U] bitmap: 4/8 pages [16KB], 65536KB chunk md0 : active raid1 sda1[0](F) sdb1[1] 204788 blocks super 1.0 [2/1] [_U] unused devices: &lt;none&gt; </code></pre> <p>It appears /dev/sda has failed. However, raid1 is redundant so my system should still be able to operate. This however, is not the case, my entire file system has been kicked into Read-only mode.</p> <pre><code>Running mdadm --detail gives me: sudo: Can't open /var/run/sudo/supertrader/18: Read-only file system /dev/md0: Version : 1.0 Creation Time : Tue Aug 16 18:04:44 2011 Raid Level : raid1 Array Size : 204788 (200.02 MiB 209.70 MB) Used Dev Size : 204788 (200.02 MiB 209.70 MB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Thu Mar 1 09:48:13 2012 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 1 Spare Devices : 0 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 17 1 active sync 0 8 1 - faulty spare </code></pre> <p>At this point, I would like to get the machine operating again (filesystem not locked in read-only mode) while I get somebody at the datacentre to replace the failed drive.</p> <p>When I tried removing the failed drive using:</p> <pre><code> mdadm --manage /dev/md0 --remove /dev/sda2 </code></pre> <p>I get an error message about /dev/sda2 not found.</p> <p>My question is the following: (1) What happens if I reboot the system now, will it automatically come up without the failed disk? Or do I need to find some way to actually remove the disk from the software array. I'm not local to the machine so if it gets stuck while booting, it is a real pain to fix.</p> <p>Thanks in advance.</p> <p>EDIT2: I went ahead with the reboot and the system came up again, this time with the filesystem mounted rw</p> <p>I am not sure what happened, but it looks like the 'failed' disk came back online? here is the /proc/mdstat</p> <pre><code>Personalities : [raid1] md1 : active raid1 sdb2[1] 976554876 blocks super 1.1 [2/1] [_U] bitmap: 5/8 pages [20KB], 65536KB chunk md0 : active raid1 sda1[0] sdb1[1] 204788 blocks super 1.0 [2/2] [UU] unused devices: &lt;none&gt; </code></pre> <p>Prior to this, I had run:</p> <pre><code>mdadm /dev/md0 -r --force detached </code></pre> <p>I did this on both md0 and md1. md0 now looks normal, any idea what is happening with md1?</p> <p>EDIT: Also, I noticed that under /dev/ both sda and sdb are missing, in fact, I only have sdc1 and sdc2. </p> <p>What is going on here, why are both of my raid disks missing?</p> <p>fdisk -l output:</p> <p>Disk /dev/md0: 209 MB, 209702912 bytes 2 heads, 4 sectors/track, 51197 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000</p> <pre><code>Device Boot Start End Blocks Id System </code></pre> <p>Disk /dev/md1: 1000.0 GB, 999992193024 bytes 2 heads, 4 sectors/track, 244138719 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000</p> <p>Disk /dev/md1 doesn't contain a valid partition table</p> <p>Disk /dev/dm-0: 27.9 GB, 27917287424 bytes 255 heads, 63 sectors/track, 3394 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000</p> <p>Disk /dev/dm-0 doesn't contain a valid partition table</p> <p>Disk /dev/dm-1: 972.1 GB, 972071895040 bytes 255 heads, 63 sectors/track, 118181 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000</p> <p>Disk /dev/dm-1 doesn't contain a valid partition table</p> <p>Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0009984e</p> <p>Device Boot Start End Blocks Id System /dev/sdc1 * 1 26 204800 fd Linux raid autodetect Partition 1 does not end on cylinder boundary. /dev/sdc2 26 121602 976556032 fd Linux raid autodetect</p> <p>Is there a sure way to find out which is my surviving disk hardware wise?</p>
0non-cybersec
Stackexchange
Consensus/ranked ordering algorithm. <p>Say I have a set of numbers, for example <code>{1, 2, 3, 4, 5}</code>. Is there an algorithm that allows these numbers to be put into a consensus ordering based on a ranked vote? For example, if 3 people vote and their votes are <code>[1, 2, 3, 4, 5]</code>, <code>[2, 1, 3, 4, 5]</code>, and <code>[1, 2, 3, 5, 4]</code>, then the consensus ordering would be <code>[1, 2, 3, 4, 5]</code>. Ideally the algorithm would support votes of partial orderings as well, such as <code>[2, 5, 4]</code>.</p> <p>I'm pretty sure I can extend the <a href="https://en.wikipedia.org/wiki/Ranked_voting" rel="nofollow noreferrer">ranked voting</a> system to produce a complete ordering of the "candidates," but I'm wondering if there's already an algorithm to do this.</p>
0non-cybersec
Stackexchange