text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
A May-December romance (nsfw).
0non-cybersec
Reddit
Betterment return is low, how do I improve it ?. I have been investing with betterment for almost a year I think ? So far my simple return is just 3.6%. I have 90% stock and 10% bond choosing betterment portfolio, it's not much from bank saving account not to mention I still need to pay the advisory fee. How can I improve my return ? The portfolio has roughly 50k in it.
0non-cybersec
Reddit
When you meet the random guy you saw ripping a bong on the highway 2 years ago.
0non-cybersec
Reddit
[Spotted] this during my birthday outing in SF (well, just north of the bridge). I had to pick up my jaw from the ground. I think he said it was a '67.
0non-cybersec
Reddit
[Fluff] Poop. So much poop.. Warning: this is a long one My dog was running a little high on energy this morning so I loaded her up and took her to the dog park. It's mid-day on a Monday so the place is pretty deserted and I'm happy that we should be able to get lots of running and ball chasing in to tire her butt out some before I have to run errands in the afternoon. Now, up until this point in the day, Luna hasn't pooped. Not unusual but not ideal either. I wasn't concerned because she *always* goes at the park. Sure enough, we'd been there less than five minutes and she starts circling and sniffing. I, being a moderately observant owner, grab a bag and make my way towards her while she's still circling. I get there in time to see her loose a monster poop, half solid half liquid, upon the long grass. *Great*, I think, *that's going to suck to clean up.* But she's not done. Oh, no. There is one long, poop covered blade of grass hanging from her butt. Any dog owner has had this situation. You basically have three possible courses of action: you let the dog scooch along, thus rubbing shit all over its ass; let the dog sit down and try to lick it off, watching it eat its own shit; or swoop in with a hopefully hole-free poop bag and remove the grass by hand. I opted for the third option. She opted for the first. So here I am trying to get at her butthole before she can sit down. Usually she'll calmly allow me to remove whatever hanger-on is bothering her but this time she wanted to look at me instead. She spun, swinging the shit grass around so that it manages to hit my hand AND her tail, dropping little shit droplets on both. Then, before I can prevent it, she goes for the scooch. She rubbed her ass all over that grass and got herself a big old shit stain. Fortunately, at this point the offensive grass has disappeared, who knows where, but a new problem emerges. My poor dog, now with shit all over her ass and her tail, is attracting flies at an alarming rate. She was spinning and snapping her teeth at them but there were too many to ignore. So we did the only thing we could. We bowed our heads in dejection, and walked back to the car where the evil bathtub erased all traces of our shit-venture. **tl;dr: Wanted to play at the park. Got attacked by poop. Went home without playing.** Now for your part: we all have shit stories. It comes with the territory. Lay 'em on me!
0non-cybersec
Reddit
SpaceX capsule opening in space.
0non-cybersec
Reddit
Nintendo calls for more Unreal devs to make games for Switch.
0non-cybersec
Reddit
Localizing/translating routes in ASP.NET MVC. <p>Anyone knows a nice solution to localize routes in ASP.NET MVC? What I'd like to achieve is that these two urls point to the same action/resource:</p> <ul> <li><a href="http://example.org/Products/Categories">http://example.org/Products/Categories</a> (en)</li> <li><a href="http://example.org/Produkte/Kategorien">http://example.org/Produkte/Kategorien</a> (de)</li> </ul> <p>Also there should be the possibility to generate the routes according to the current culture (or the default, if there are no translations available). Alternately, if I was able to specify just one culture so that only one of the two links above would work, that'd be also viable.</p> <p>I tried a <a href="http://blog.maartenballiauw.be/post/2010/01/26/Translating-routes-%28ASPNET-MVC-and-Webforms%29.aspx">very nice approach by Maarten Balliauw</a>, but his solution unfortunately doesn't work with <code>Html.RenderAction(...)</code>.</p> <p>Of course I could just add routes for all translations like</p> <pre><code>routes.MapRoute( "Products_Categories", "Produkte/Kategorien", new { controller = "Products", action = "Categories" } ); </code></pre> <p>but that would end up in an enormous amount of routes and it'd be very unflexible. Any better solution would be appreciated :-) The more flexible the better.</p>
0non-cybersec
Stackexchange
Embed all fonts by &quot;exporting as PDF&quot;, but cannot copy text any more?. <p>I am using <code>Fontin</code> as the font style and <code>XeLaTeX</code> my document. In order to ensure every computer can display the font style correctly, I decided to re-export the document as PDF with Mac Preview so that all the fonts are embedded in itself (this trick indeed works!).</p> <p>However, a new problem arises. In the re-exported PDF file, once I copy the text, many spaces are copied. But I can copy text in my original PDF file.</p> <p>How can I fix this? Being able to copy text from my document is as important as embedding all the fonts.</p>
0non-cybersec
Stackexchange
This persistent problem for iMac users is crying out to be fixed. My 2.4 GHz, Intel Core 2 Duo, iMac is rarely turned off. I don't know if it's an urban myth, but I've heard that booting up and shutting down is the most *stressful* part of a computer's life cycle. Not that this is the sole reason mine is almost permanently employed. If it's not waiting for a queue of files to upload to an FTP server, it's rendering Final Cut projects. Compared to some Macs out there, it's still just a kid. A friend of mine, who works at a commercial printers, recently [found this Power Mac 9600 350](http://i.min.us/ibeakW.jpg) tucked away in a corner managing a queue for a printing press which runs 24 hours a day. It still had files in the trash from 1997. Fingers crossed my beloved iMac will last as long as that, but unless I can get to the bottom of this persistent annoyance, I don't think the display will outlive the rest of the machine. Like many people, I have my iMac in my bedroom and it gets used as a general purpose computer during the day and as a TV at night. I usually fall asleep listening to podcasts or audiobooks in Front Row and the computer usually does the decent thing and turns the display off, according to the Energy Saver settings, after a fixed period. Unfortunately though, every now and then and without warning, it'll decide to ignore the Energy Saver settings and blaze away to itself all night long. Sometimes the light wakes me up and I crawl over to the keyboard and hit Control + Shift + Eject, to turn off the display manually—so to speak. But, invariably, 10 minutes later or in the morning when I wake up, there it is still burning away for no conceivable reason and despite that the display preferences are set to Sleep after 10 minutes of display inactivity. It also happens if I choose 'Sleep' from the Control + Eject 'Restart, Sleep, Shut Down' screen or choosing 'Sleep' from the Power Settings menu in [SofaControl](http://www.gravityapps.com/sofacontrol/). Now, we Mac users take a fair amount of flak for doing things *the Apple way* from our PC using inferiors. Most of the jibes are a mix of sour grapes and simple misunderstanding; that old perennial 'they only have one mouse button' and the ever popular 'they don't have any games' are set to stick around for a long time yet. But I'd say one criticism of the iMac in particular which is richly deserved, is the lack of a hardware on / off button for the display. It's a classic case of Apple's design for design's sake—all of which means for the sake of an extra button on the back of the case, in all likelihood, my computer's screen will fail long before the rest of the machine is ready to hang up its megahertz and call it a day. So, if someone knows why the Energy Saver settings are being ignored that would be a big help in the short term. But, in the long term, if there is anyone who can think of a permanent solution for this, I think a lot of iMac users out there would be most grateful of a software fix for this hardware issue. It would seem a fairly simply thing (to those clever enough to know how to write code) to bash together some kind of System Script which overrides all other commands to enable the display, unless a certain key combination is held down—so that some impertinent bouncing icon in the Dock, for example, can't insist the whole display lights up, when there are no humans around to shut it up and put it in it's place. So, just as Control + Shift + Eject turns the display off, so too would Control + Shift + Escape, for example, turn it back on again. Thanks in advance for your feedback on this and hopefully /r/Mac can put something out there to help all iMac users who have this problem.
0non-cybersec
Reddit
How long have you been watching anime, and how long do you think you will continue?. The title pretty much says it all but i have been watching anime for almost a year now and as of now, it's a huge part of my life. I'm 17 and as a kid who doesn't do very much i tend to just watch anime whenever i can. The reason i'm asking this question is because i'm literally scared to lose interest in anime. I have this odd feeling that as i grow up i will for somewhat reason stop liking anime. I really **love** anime as of now and it has helped me so much through my past year due to reasons..
0non-cybersec
Reddit
Passing template class as parameter. <p>How do I pass a templated class to the constructor of another class? I am trying to pass a templated hash table class to a menu class which will allow me to then allow the user to decide the type of the hash table.</p> <pre><code>template &lt;class T&gt; class OpenHash { private: vector &lt;T&gt; hashTab; vector &lt;int&gt; emptyCheck; int hashF(string); int hashF(int); int hashF(double); int hashF(float); int hashF(char); public: OpenHash(int); int getVectorCap(); int addRecord (T); int sizeHash(); int find(T); int printHash(); int deleteEntry(T); }; template &lt;class T&gt; OpenHash&lt;T&gt;::OpenHash(int vecSize) { hashTab.clear(); hashTab.resize(vecSize); emptyCheck.resize(vecSize); for (int i=0; i &lt; emptyCheck.capacity(); i++) { emptyCheck.at(i) = 0; } } </code></pre> <p>So I have this class Open hash that is templated, because it supposed to allow for any type to be added, I have this working if initiate a object of it in my main and change input types etc. </p> <pre><code>int main () { cout &lt;&lt; "Please input the size of your HashTable" &lt;&lt; endl; int vecSize = 0; cin &gt;&gt; vecSize; cout &lt;&lt; "Please select the type of you hash table integer, string, float, " "double or char." &lt;&lt; endl; bool typeChosen = false; string typeChoice; cin &gt;&gt; typeChoice; while (typeChosen == false) { if (typeChoice == "int" || "integer" || "i") { OpenHash&lt;int&gt; newTable(vecSize); typeChosen = true; } else if (typeChoice == "string" || "s") { OpenHash&lt;string&gt; newTable(vecSize); hashMenu&lt;OpenHash&gt; menu(newTable); typeChosen = true; } else if (typeChoice == "float" || "f") { OpenHash&lt;float&gt; newTable(vecSize); typeChosen = true; } else if (typeChoice == "double" || "d") { OpenHash&lt;double&gt; newTable(vecSize); typeChosen = true; } else if (typeChoice == "char" || "c" || "character") { OpenHash&lt;char&gt; newTable(vecSize); typeChosen = true; } else { cout &lt;&lt; "Incorrect type"; } } return 0; } </code></pre> <p>In my main I want to ask the user what type they which to make the hash table. depending what they enter it should create a instance of this class with the type they want and then pass this to another class called menu which should allow them to call functions from the hash class.</p>
0non-cybersec
Stackexchange
How can I retrieve the k highest values in a data frame in pandas?. <p>How can I retrieve the k highest values in a data frame in pandas?</p> <p>For example, given the DataFrame:</p> <pre><code> b d e Utah 1.624345 -0.611756 -0.528172 Ohio -1.072969 0.865408 -2.301539 Texas 1.744812 -0.761207 0.319039 Oregon -0.249370 1.462108 -2.060141 </code></pre> <p>Generated with:</p> <pre><code>import numpy as np import pandas as pd np.random.seed(1) frame = pd.DataFrame(np.random.randn(4, 3), columns=list('bde'), index=['Utah', 'Ohio', 'Texas', 'Oregon']) print(frame) </code></pre> <p>The 3 highest values in the data frame are:</p> <ol> <li>1.744812 </li> <li>1.624345 </li> <li>1.462108 </li> </ol>
0non-cybersec
Stackexchange
My kitten, Tucker.
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
Alternatives to ring tricep dips?. Happy New Year all. I've started Tom Merrick's bodyweight warrior program. On push day he suggests a tricep dominant exercise and gives tricep ring dips as an example. Unfortunately my gym doesn't have rings and the TRX straps are flush with the wall :/ What would be good alternatives to this? The session already includes dips and a tricep extension exercise. Would close grip pushups be suitable? Cheers
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
Can I remove the USB/DVD during the &quot;Installing Features&quot; phase of Windows 10 Installation. <p>Can I unplug the DVD/UBS during the "Installing Feature" phase of Windows 10 installation?</p> <p>I'm installing windows on a tablet that has just one usb port and I'm afraid that it will lose charge if I don't unplug the usb hub which has the keyboard, mice and the usb. <a href="https://i.stack.imgur.com/LCXVT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LCXVT.jpg" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
[US Insurance] Does ANYONE cover travel vaccinations/immunizations?. [just posted this in /r/travel too] So last time I traveled I was studying abroad in England and managed to get a whole heap of immunizations relatively cheaply before heading East. I thought it was pretty neat and appreciated having it covered and went on my merry way, the end. Now, five years later and back in the USofA, I'm headed out again, this time with my finaceé and we both need to get juiced up. Ho-lee shit you guys. This has now added like a THOUSAND USD to what was a shoestring trip. Each. Does ANY insurance plan (travel or otherwise) out there cover travel immunizations? Are there any other ways to get these for cheap while still in the States? [we're in WA state if that matters]
0non-cybersec
Reddit
How to install fonts for X?. <p>I would like to setup a Linux system with ScrotWM as the window manager, but I noticed that X is aware of only a few fonts. I would like to have UTF-8 fonts that support multiple languages, including Asian languages like Japanese and Traditional Chinese. How do I install fonts so that X can show them? What kind of fonts would they be? And will the fonts be universally available to other programs like Firefox or OpenOffice once I install them? Or will applications maintain separate groups of fonts for their own use? Thanks.</p>
0non-cybersec
Stackexchange
How to get mic sensitivity slider to show in volume menu?. <p>I have seen images where both the speaker volume and mic sensitivity have sliders for adjusting them in the drop-down menu from the speaker.</p> <p>However after upgrading form Ubuntu 15.10 to 16.04 I don't seem to have a mic option.</p> <p>How can I enable the mic slider to show?</p>
0non-cybersec
Stackexchange
Is it true that if $f\in W^{1,p}(\mathbb{T})$ then the difference quotient of $f$ converges in $L^p(\mathbb{T})$ to the weak derivative of $f$?. <p>Let <span class="math-container">$\mathbb{T}$</span> be the 1-torus and if <span class="math-container">$1\le p \le+\infty$</span> define the Sobolev space <span class="math-container">$$W^{1,p}(\mathbb{T}):=\left\{f\in L^p(\mathbb{T})\ |\ \exists g\in L^p(\mathbb{T}), \forall\varphi\in C^\infty(\mathbb{T}), \int_{-\pi}^\pi f(t)\varphi'(t)\operatorname{d}t=-\int_{-\pi}^\pi g(t)\varphi(t)\operatorname{d}t\right\}.$$</span> It is known that if <span class="math-container">$f\in W^{1,p}(\mathbb{T})$</span> then the function <span class="math-container">$g$</span> whose existence is stated in the previous definition is (a.e.) unique and we'll refer to this function with <span class="math-container">$D_w(f)$</span>.</p> <blockquote> <p>Is is true that <span class="math-container">$$\forall f\in W^{1,p}(\mathbb{T}), \left\| \frac{f(\cdot+h)-f}{h} -D_w(f)\right\|_p\rightarrow 0, h\rightarrow0?$$</span></p> </blockquote> <p>I proved that the claim is true for the value <span class="math-container">$p=2$</span> using the Fourier transform and that for <span class="math-container">$p=\infty$</span> the claim is false (see the comments) but it is true if <span class="math-container">$W^{1,\infty}(\mathbb{T})$</span> is replaced by <span class="math-container">$C^1(\mathbb{T})$</span>. Also, I know that <span class="math-container">$\frac{f(\cdot+h)-f}{h}$</span> weak converges in <span class="math-container">$L^p(\mathbb{T})$</span> to <span class="math-container">$D_w(f)$</span> if <span class="math-container">$1&lt;p&lt;\infty$</span>, weak* converges in <span class="math-container">$L^p(\mathbb{T})$</span> to <span class="math-container">$D_w(f)$</span> if <span class="math-container">$p=\infty$</span>, weak* converges in the complex measures to <span class="math-container">$D_w(f)$</span> if <span class="math-container">$p=1$</span> and, finally, I know that <span class="math-container">$\frac{f(\cdot+h)-f}{h}$</span> converges pointwise <span class="math-container">$\mu$</span>-a.e. to <span class="math-container">$D_w(f)$</span> if <span class="math-container">$p&gt;1$</span> (see Evans, Gariepy - Measure theory and fine properties of functions, chapters 4 and 6).</p> <p>However, I don't know if the claim is true for the other values of <span class="math-container">$p$</span> and if the cited results could help somehow to prove it.</p>
0non-cybersec
Stackexchange
Reno 911 Miami: Alligator Scene.
0non-cybersec
Reddit
Anytime we watch tv, we are watching other people work..
0non-cybersec
Reddit
Pgfplots ignoring domain. <p>I'm trying to use pgfplots to plot <code>-3ln(x-2)</code>:</p> <pre><code>\documentclass[border=10pt]{standalone} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amsthm,amssymb} \usepackage{pgfplots} \pgfplotsset{mystyle2/.style={ width=12cm, height=12cm, xmin=0,xmax=15, ymin=-10,ymax=10}} \begin{document} \begin{tikzpicture} \begin{axis}[mystyle2, xlabel=$x$, ylabel={$g(x) = -3ln(x-2)$} ] \addplot[ domain=2:15, y domain=-10:30 ] {(-3)*ln(x-2)}; \end{axis} \end{tikzpicture} \end{document} </code></pre> <p>I'd like to display the function up until y=10, however it seems to cut off at y=2. Why is this happening?</p> <p><a href="https://i.stack.imgur.com/QgbEw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QgbEw.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
It seems things are getting worse.. i recently posted a topic called "i am being followed" (http://www.reddit.com/r/nosleep/comments/hwxmg/i_am_being_followed/) another event that i believe is connected to the events mentioned in my recent post have occurred and i felt that i should share it with you. these 2 most recent incidents are somewhat more strange then my most recent ones, on of them has me to the point where i am considering moving back in with my parents, or with my girlfriend. My dog Harvey pissed in the bed recently, i was pretty ticked at the little guy so i haven't been letting him in my room to sleep with me. last night he was howling so i let him out to pee in the front yard (yes its fenced in). now i was a bit irresponsible and fell asleep before i let him back in. he had a food bowl outside so i didnt think much of it. when i woke up this morning and prepared to let him back in. he was gone, but that's not all, the gate was wide open, toys were all gone as well. I know for a fact that i locked that gate, and it looks as if it was opened by someone. i feel awful as i really loved the little guy, but i am fearing for my own safety more then ever. last night is when things really started to escalate. i heard a loud crash that woke me up in the middle of the night. i looked out back and saw that my sheds doors were wide open. i grabbed the gun my brother lent me and prepared for the worst, i grabbed a flash light and loaded up the gun. i approached the shed and aimed my flashlight through it. there was no one there. i have also come to a somewhat odd conclusion, the sightings and occurrences are somehow linked to the rain that we have been getting, on days directly after the rain has fallen the amount of activity i have witnessed dramatically increases. i will give pictures of some things if requested. including but not limited to, my dog, my shed, my basement, and the road i have been seeing him on. [Pics] Sorry the basement pics are bad quality (my camera sucks) the night pictures might not turn out to great either http://imgur.com/a/rTThK
0non-cybersec
Reddit
PDF of $z = \exp(j\varphi)$, where $\varphi \sim \mathcal{U}[-a, +a]$. <p>How can I find the PDF of <span class="math-container">$z = \exp(j\varphi)$</span>, where <span class="math-container">$\varphi \sim \mathcal{U}[-a, +a]$</span>, <span class="math-container">$i.e.$</span>, a uniformly distributed r.v.?</p> <p>My difficulty here is that it involves complex numbers and I don't know how to handle it.</p>
0non-cybersec
Stackexchange
Cubic spline between circles. <p>I would like to define a spline between some circles as shown in the figure below:</p> <p><a href="https://i.stack.imgur.com/SUpAim.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SUpAim.png" alt="enter image description here"></a></p> <p>I want to write the spline mathematically, so I have four coordinates that I can define, but I can't manage to find a good approximation. Can anyone help me to find the coordinates for such a spline, by using the radius (R) and the angle ($\alpha$=60$^\circ$). </p> <p>If I use the point of intersection between the circles I get a weird curve (please see figure below).</p> <p><a href="https://i.stack.imgur.com/46Iedm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/46Iedm.png" alt="enter image description here"></a></p> <p>Can anyone please help me with this?</p> <p>Thank you!</p> <p>EDIT:</p> <p>The coordinates that I have now are:</p> <pre><code>1.(0,R) 2.(0,2*R-(-(2*R)*sin(60)+2*R)/2) 3.(R-cos(60)),2*R-(-(2*R)*sin(60)+2*R)/2) 4.(R,3*R-(-(2*R)*sin(60)+2*R)) </code></pre> <p>They give a good approximation, but still not good enough! </p>
0non-cybersec
Stackexchange
Wamp Server Offline error. <p>Some of you might get the “Server Offline” error after you install WAMP on your windows 7 system. This happens if IIS server was installed in the system prior to the installation of WAMP thus creating the clash of the port address where both the servers are trying to access </p>
0non-cybersec
Stackexchange
Patagonia Early Access Sale (link from email).
0non-cybersec
Reddit
Anthony Weiner (D-NY) today on healthcare repeal: "For all of you sitting and watching at home, playing the drinking game where you take a shot every time a republican lies; you better get a designated driver.". Given on the House floor at around 2:15 p.m. EST I love this dude. Even though I've heard he's kind of an asshole, he's the Democrats' asshole, and we need more of them to stand up to the other side and tell it like it is. edit: I'll try to link to video of it when it becomes available. edit2: Here's the link. Thanks to Auram for finding it (~ 0:45): http://www.youtube.com/watch?v=ijmgZGtvkxg edit3: Also, in case you missed him yesterday: http://www.youtube.com/watch?v=qoNgq4SEulo edit4: 2:1 ratio of upvotes to downvotes. Didn't expect that many downvotes. Guess this is pretty controversial.
0non-cybersec
Reddit
Is there a way to add onClick event to a custom component. <p>i have 2 kind of buttons, normal html button and another custom button. i can use onClick only on the normal button but the other isn't working. The custom button i have:</p> <pre><code>import React from 'react' import './custom-button.styles.scss' function CustomButton({children,isGoogleSignIn,...buttonProps}) { return ( &lt;button className={`${isGoogleSignIn? 'google-sign-in':''} custom-button`}&gt; {children} &lt;/button&gt; ) } export default CustomButton </code></pre> <p>the code where i use it: </p> <pre><code>&lt;button onClick={() =&gt; alert("Normal button")}&gt;Click me&lt;/button&gt; &lt;CustomButton onClick={() =&gt; alert("Custom button")}&gt;Click me&lt;/CustomButton&gt; </code></pre>
0non-cybersec
Stackexchange
How do I delete files using the Gutmann Process?. <p>I've been trying to delete some files, large ones in particular, to help smoothen out my system, Is there any command or programm that deletes files via the Gutmann Process?</p>
0non-cybersec
Stackexchange
Emails sent via application on RDS server stuck in outbox - Outlook. <p>We currently generate and process documents via an application hosted on a RDS server. Users access the application via remote desktop applications and do not login to there desktop on the server.</p> <p>Some users email large amounts once or twice a week (~200-300) in a batch, which defaults to Outlook as the sender, and outlook runs in the background as the user does not utilise outlook on the server other than sending emails from the application.</p> <p>We are encountering an issue where all emails become stuck in the outbox, until you login to the users server profile, open outlook, and "send all" emails from the outbox. This has never been the case before and only recently over the past few months become an ongoing issue. </p> <p>I have tried, with no success;</p> <ol> <li>Change the outlook profile to store emails locally, instead of online. (This does not work, it causes an error which i cannot recall off the top of my head)</li> <li>Leaving outlook open on the users server profile. This also does not seem to be consistent and the user will show two seperate logins under task manager. (One for remote apps, one for server profile)</li> </ol> <p>Office is up to date, i'm unsure where to look from here. Any guidance would be greatly appreciated.</p>
0non-cybersec
Stackexchange
What does top, left, right and bottom mean in Android Rect object. <p>I have an Android project where I should make Apples fall. The apples are painted in a Rect. So I created a function that change the Rect position and repaint. Here's my function :</p> <pre><code>private void updateApplesPosition() { for(Rect rect:fallingDownFruitsList) rect.set(rect.left, rect.top +10, rect.right, rect.bottom +10); } </code></pre> <p>I have a problem : the Apples don't fall but go from right to left. To make the apples fall I changed the code by this :</p> <pre><code>private void updateApplesPosition() { for(Rect rect:fallingDownFruitsList) rect.set(rect.left+10, rect.top, rect.right+10, rect.bottom); } </code></pre>
0non-cybersec
Stackexchange
Caprese di mozzarella e pomodoro.
0non-cybersec
Reddit
The strength of a Women.
0non-cybersec
Reddit
When the vikings discovered North America, did they attempt to colonize somewhere? If they didn't, why not?. I hnow that the vikings were the first Europeans to discover North America (by a few hundred years if I remember right), but I don't remember ever hearing about any serious colonization attempt. Did it just not fit with thier way of life at the time?
0non-cybersec
Reddit
My Great Nan got her drivers license at 62, joined Facebook at 91, went her whole life without a cigarette or alcohol and over 72 years married! On The 24/12/2018 she gave us the best gift of all. She was not in anymore pain and left this world in peace. People like her are the real superhero’s❤️.
0non-cybersec
Reddit
Why can we see fire? Isn't it just heat?.
0non-cybersec
Reddit
My family inspired tattoo done on November 19th 2011 .
0non-cybersec
Reddit
looney tunes fake road.
0non-cybersec
Reddit
[REQUEST] Miniseries in which the episodes lengths are <50 mins?. I watch episodes when I eat dinner and I dont have a lot of time. So I was hoping for suggestions of mini series in which the episodes are short-ish. Even going to 50 mins might be pushing it. The last series I watched was Maniac (2018) and that was like at most 45 mins. I was recommended Sharp Objects but those episodes go on for over 60 mins. Same for True Detective Season 1. Which didnt make me want to watch it right away. Thank you
0non-cybersec
Reddit
Our sci-fi short film got optioned for Australian TV.
0non-cybersec
Reddit
Drunk girls playing Slender!.
0non-cybersec
Reddit
Pokemon! I Choose you! Ending [1920x1080].
0non-cybersec
Reddit
Can&#39;t run brew update. <p>When I run <code>brew update</code>, I'm getting the error:</p> <pre><code>mkdir: /usr/local/var/homebrew/locks: Permission denied Error: Can't create update lock in /usr/local/var/homebrew/locks! Fix permissions by running: sudo chown -R $(whoami) /usr/local/var/homebrew </code></pre> <p>And when I run <code>sudo chown -R $(whoami) /usr/local/var/homebrew</code> I get:</p> <pre><code>chown: /usr/local/var/homebrew: No such file or directory </code></pre> <p>Any suggestions?</p>
0non-cybersec
Stackexchange
Eclipse OSGI not dealing with provider selection in MANIFEST. <p>I have a few maven-artifacts that are not under my control and which I need to use in a Plugin project. These maven artifacts are packed into OSGI bundles with felix-bnd through the <a href="https://github.com/reficio/p2-maven-plugin" rel="nofollow noreferrer">org.reficio:p2-maven-plugin</a></p> <p>I have quite a few of these artifacts and they are partly interdependent. Now what I have are the two artifacts A and B. On the maven side of things, B depends on A and includes it in the artifact that is used as basis to generate the OSGi-Bundle.</p> <p>A exports (and actually contains) the package <code>a.foo</code>. B depends on A, packs the jar into the artifact and the Bundle-Generation incorrectly marks B as exporting <code>a.foo</code> as well.</p> <p>So as of now I have the following two MANIFEST.MF files, which are not under my control:</p> <p><strong>A/MANIFEST.MF</strong>:</p> <pre><code>Bundle-Symbolic-Name: com.acme.A Bundle-Version: 2.0.0.[...] Export-Package: a.foo </code></pre> <p><strong>B/MANIFEST.MF</strong>:</p> <pre><code>Bundle-Symbolic-Name: com.acme.B Bundle-Version: 2.0.0.[...] Export-Package: a.foo, b, b.bar, [...] </code></pre> <p>I'm rather confident that the problem would not appear if B were to <code>Import-Package: a.foo</code> and declare the export with a <code>uses="com.acme.A"</code>. The problem would also not appear, if B would correctly not export <code>a.foo</code> at all.</p> <p>So I have a bundle, which depends on things from both A and B. It's MANIFEST looks like this:</p> <pre><code>Bundle-Symbolic-Name: org.foo.product Bundle-Version: 2.0.0 Import-Package: a.foo, b, b.foo, [...] </code></pre> <p>This means I have both the bundles A and B in my target platform. When I now check the eclipse "Target Platform State" window for <code>a.foo</code>, I can see that eclipse considers it to be provided by <strong>B</strong>. Using a class from <code>a.foo</code> results in a compilation error:</p> <blockquote> <p>Access Restriction: The type 'ModuleException' is not API (restriction on required library '[..]/com.acme.A_2.0.0.jar'</p> </blockquote> <p>Ignoring that compilation error and executing the bundle results in a BundleException because the import <code>a.foo</code> can not be satisfied.</p> <p>To remediate this, I tried to nail down A as the provider for <code>a.foo</code> by changing the Import-Package statement to:</p> <pre><code>a.foo; bundle-symbolic-name="com.acme.A"; bundle-version="[2.0.0,3)", </code></pre> <p>According to the <a href="https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#i2480178" rel="nofollow noreferrer">OSGI 7.0 Specification 3.7.10</a> this is a perfectly fine specification. </p> <p>This does change the compilation error to an explicit missing requirement. Eclipse cannot locate the package <code>a.foo</code> with the restrictions imposed. It does also not fix the runtime error.<br> Eclipse suggests a quickfix to add an <code>Import-Package</code> statement for <code>a.foo</code>. When I let eclipse do that it simply drops the provider-matchers.</p> <p>When I explicitly put the <code>com.acme.A</code> bundle on the classpath (as suggested by @howlger), the compilation error goes away. The runtime error is unfortunately not affected.</p> <p>Why does the provider-selection restriction not work as per spec? How can I get eclipse and OSGI to select the correct provider bundle?</p>
0non-cybersec
Stackexchange
Install FoxitReader without using Wine. <p>Ubuntu 14.04 LTS 64bit</p> <p>I recently came to know that <strong>FoxitReader</strong> Ubuntu version has been released. But I am unable to install it using the instructions given in its manual(check this <a href="http://cdn01.foxitsoftware.com/pub/foxit/manual/enu/FoxitReader1.1ForLinux_Manual.pdf">link</a>). </p> <p>When I enter this command:<code>sudo dpkg -i FoxitReader_1.1.0_i386.deb</code>, I get the following:</p> <blockquote> <p>(Reading database ... 341123 files and directories currently installed.)<br> Preparing to unpack FoxitReader_1.1.0_i386.deb ...<br> Unpacking foxitreader (1.1-0) over (1.1-0) ...<br> Setting up foxitreader (1.1-0) ...<br> Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...<br> Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...<br> Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...<br> Rebuilding /usr/share/applications/bamf-2.index...<br> Processing triggers for mime-support (3.54ubuntu1.1) ...<br></p> </blockquote> <p>Please help me to install it if someone has done it successfully.</p>
0non-cybersec
Stackexchange
What does the &lt;&gt; operator do in python?. <p>I just came across this <a href="http://www.feedparser.org/feedparser.py" rel="noreferrer">here</a>, always used like this:</p> <pre><code>if string1.find(string2) &lt;&gt; -1: pass </code></pre> <p>What does the <code>&lt;&gt;</code> operator do, and why not use the usual <code>==</code> or <code>in</code>? </p> <p>Sorry if that has been answered before, search engines don't like punctuation.</p>
0non-cybersec
Stackexchange
Would anyone be interested in this hand drawn texture pack?.
0non-cybersec
Reddit
A multifractal approach towards inference in finance Ola Løvsletten, Martin Rypdal Department of Mathematics and Statistics, University of Tromsø, N-9037 Tromsø, Norway. Abstract We introduce tools for inference in the multifractal random walk introduced by Bacry et al. (2001). These tools include formulas for smoothing, filtering and volatility forecasting. In addition, we present methods for computing conditional densities for one- and multi-step returns. The inference techniques presented in this paper, including maximum likelihood estimation, are applied to data from the Oslo Stock Exchange, and it is observed that the volatility forecasts based on the multifractal random walk have a much richer structure than the forecasts obtained from a basic stochastic volatility model. Keywords: Multifractal, inference, volatility forecasting, Laplace approximation 1. Introduction Modeling financial time series by stochastic processes dates back to the work of Bachelier (1900). Bachelier pro- posed to model the price of a financial asset as a Brownian motion with drift. It was later realized, by e.g. Mitchell (1915), that the standard deviation of price changes are proportional to the price levels themselves. Therefore, Bachelier’s model should be modified so that it is the log- arithmic asset price, X(t) = log P(t), that is modeled as a Brownian motion with drift. As a modification of this model, Mandelbrot (1963) proposed to replace Brown- ian motion with α-stable Lévy processes with α < 2, so- called Lévy flights. Both Brownian motions and Lévy flights are selfsimi- lar and have independent increments. However, empirical analyses of asset prices have revealed that, even though logarithmic returns are uncorrelated, they are nevertheless strongly dependent. This stylized fact is called volatility clustering, and it is not well described by Brownian mo- tions nor Lévy flights. Other processes, such as stochas- tic volatility (SV) models, are specifically designed to in- clude this feature. The simplest example is the basic SV model of Taylor (1982). If we choose1 µ = 0, this model is defined by the stochastic differential equation dX(t) = σ(t) dB(t) , Email address: [email protected] (Ola Løvsletten) 1Since µ is easily estimated from data, this can be assumed without any loss of generality. where the logarithmic volatility varies according to an Ornstein-Uhlenbeck process, i.e. d logσ(t) = −a logσ(t)dt + νdB̃(t) , (1) where B̃(t) is a Brownian motion independent of B(t). Another class of SV models are the multifractal ran- dom processes. These models come from turbulence the- ory, and their origin can be traced back to works of Kol- mogorov (1962) and Obukhov (1962). The defining prop- erties of a multifractal process X(t) are stationary incre- ments and structure functions that are power-laws in time, i.e. E[|X(t)|q] ∼ tζ(q) . (2) The scaling functions ζ(q) are linear for selfsimilar pro- cesses, but usually the term “multifractal” refers to the cases where ζ(q) are strictly concave. For such processes, the absolute values of the increments of X(t) may have algebraically decaying auto-correlation functions (ACFs), even though the increments themselves are uncorrelated. In contrast, the ACFs for the absolute values of the incre- ments decay exponentially in the basic SV models. That multifractals represent a suitable framework for modeling financial time series was first discovered about fifteen years ago by Ghashghaie et al. (1996) and Man- delbrot et al. (1997). Shortly after this Calvet and Fisher (2001) showed how one can obtain a discrete-time SV model as a discretization of a continuous-time multifrac- tal. The model constructed by Calvet and Fisher is called the Markov-Switching Multifractal (MSM), and it is con- ar X iv :1 20 2. 53 76 v1 [ q- fi n. S T ] 2 4 F eb 2 01 2 structed by randomizing the so-called multiplicative cas- cade. The result is a model that describes log-returns as xt = σ √ Mt εt . (3) Here εt d ∼ N(0, 1) are independent variables and the volatility is a product on the form Mt = Mt,1Mt,2 · · ·Mt,K . The variables Mt,k are updated with different frequencies for different levels k. To be precise, at each time step t, Mt,k is given a new value (independently drawn from a dis- tribution M) with probability γk and left unchanged with probability 1 − γk. The approximate multifractality in the MSM model is achieved by choosing γk = 1− (1− γ1)b k−1 for some γ1 ∈ (0, 1) and some b > 0. By exploiting gen- eral techniques for Markov-Switching models, Calvet and Fisher have developed inference methods for the MSM model, including maximum likelihood (ML) estimation and volatility forecasting. Unfortunately, there are some limitations to the applicability of these methods. One problem is that the likelihood functions only are avail- able when M is discrete, something that leads to rather unnatural parameterizations. Also, in practice, it is only possible to compute the likelihood if the parameter K does not exceed ≈ 10 (Lux, 2008). In effect, this introduces an unwanted exponential cutoff in the volatility dependence, at the time scale bK . At the same time that Calvet and Fisher proposed the MSM model, Bacry et al. (2001) presented a different type of multifractal process, the so-called multifractal random walk (MRW). A popular discrete-time approximation to this process is given by equation (3), with Mt = ce ht , (4) where ht is a stationary and centered Gaussian process with co-variances Cov(ht, hs) = λ 2 log+ T (|t − s| + 1)∆t . (5) The constant c is chosen so that 1/c = E[eht ]. If the step-length ∆t is fixed2 it is convenient to denote R = T /∆t. The model then depends on three parameters: θ = (λ, σ,R). For the purpose of modeling financial time series, an important property of the MRW model is the slow decay of the volatility dependence. Since the innovations εt are 2The variable t is dimensionless and represents the number of time steps of length ∆t. independent, the auto-correlation function for the process |xt | becomes E[|xt xs|] ∝ e 1 2 E[(ht/2+hs/2) 2] ∝ e 1 4 Cov(ht ,hs) , (6) which for 1 � s � R gives the approximate scaling E[|xt xt+s|] ∼ s− 1 4 λ 2 . (7) The parameter λ is called the intermittency parameter, and it also determines the nonlinearity of the scaling func- tion. In fact, the scaling function of the (continuous-time) MRW model is ζ(q) = 1 2 ( 1 + λ2 2 ) q − λ2 8 q2 . In contrast to the MSM model, which is obtained by randomizing a discrete multiplicative cascade, the MRW model builds on a continuous cascade. In fact, the log- normal MRW model that we consider in this paper is just a special case of a more general class of processes known as infinitely divisible cascades (Muzy and Bacry, 2002). These processes have very desirable theoretical proper- ties, e.g. exact multifractal scaling. From this point of view, the MRW model is preferable over the MSM model, and it is therefore important to develop inference tech- niques for the MRW model. A step in this direction was taken in (Løvsletten and Rypdal, 2011), where we pre- sented methods for ML estimation. These results were obtained by observing that the processes defined by equa- tions (3) and (5) are very similar to discrete-time versions of the basic SV models. In fact, if we replace the process ht with an auto-regressive model of order one (an AR(1) process), ht = ψ ht−1 + σuut , (8) where ut is Gaussian white noise with unit variance, then the process defined by equations (3) and (4) is a basic SV model. Hence we can use existing techniques for basic SV models (Skaug and Yu, 2009; Martino et al., 2011) in combination with general ML methods for Gaussian processes (McLeod et al., 2007) to obtain likelihoods for the MRW model. While in (Løvsletten and Rypdal, 2011) we focused on parameter estimation, the focus of this paper is primarily conditional forecasts of returns and inference regarding the latent variables ht. To be more precise, we are inter- ested in estimating the conditional variables hs|{xt, t ≤ T }. For s < T this problem is known as smoothing, for s = T it is called filtering, and for s > T it is called forecast- ing. These techniques are of obvious importance for the applicability of the MRW model in finance. 2 The paper is structured as follows. In section 2 we re- view inference techniques for basic SV models, and in section 3 we generalize these results to the MRW model. In section 4 we apply some of these methods to data from the Oslo Stock Exchange, and in section 5 we give some concluding remarks. 2. Inference techniques in the basic SV model In general, many statistical problems in stochastic mod- eling, e.g. model selection, parameter estimation and assessment of uncertainty in estimates, can be solved by utilizing the likelihood of the model. Given data z = (z1, ..., zT ), the likelihood L of a random vector x = (x1, . . . , xT ), with probability density function px(·|θ), is defined as the function L(θ|z) = px(z|θ), (9) i.e. one views the the probability density as a function of the parameters θ, with z fixed. Remark 1. To simplify notations we will drop the sub- scripts on the densities throughout the rest of the paper. It will be clear from the arguments which densities are con- sidered. We also suppres the dependency of the parameter vector θ in the notation of the densities. In the basic SV model the likelihoods are difficult to compute directly. By conditioning on the latent field h = (h1, . . . , hT ), the probability density of x takes the form p(x) = ∫ RT p(x|h)p(h)dh , (10) where the joint density p(x, h) = p(x|h)p(h) is a product of the Gaussian marginals p(x|h) = T∏ i=1 p(xi|hi) (11) and p(h) = p(h1) T∏ i=2 p(hi|hi−1) . (12) The factors in equations (11) and (12) are densities cor- responding to the distributions xt |ht d ∼ N(0, σ2c exp(ht)), h1 d ∼ N(0, σ2u/(1 − ψ 2)) and ht |ht−1 d ∼ N(ψht−1, σ2u). In general the integral in equation (10) has no closed form, and it is typically very demanding to compute numeri- cally. As an approximation one may consider a second- order Taylor expansion of log p(x, h) around the maxi- mum h∗ = argmaxh log p(x, h). (13) The resulting integral is easily computed, giving the ex- pression px(x) ≈ (2π) T/2 | det Ω(x)|−1/2 p(x, h∗) , (14) where Ω(x) = ∂2 log p(x, h) ∂hT∂h ∣∣∣∣ h=h∗ (15) is the Hessian matrix of the map h 7→ log p(x, h), evalu- ated at h = h∗. This approximation is known as Laplace’s method, and it has been applied, by among others Martino et al. (2011), to compute likelihood functions in basic SV models. The reason for its efficiency in basic SV models is the Markov structure of the latent field h. The Markov property ensures that the gradient of h 7→ log p(x, h) is on the form ∂ log p(x, h) ∂hi = bi + ∑ j Ai j h j + gi(xi, hi) , (16) where A = ||Ai j|| is a tridiagonal matrix, bi are constants and gi are non-linear functions. By exploiting the sparse- ness of A, one can efficiently calculate h∗. In addition, the Hessian matrix Ω(x) is tridiagonal, making the computa- tion of the expression in equation (14) efficient. We are now in a position to make statistical inference based on the basic SV model. We start by looking at fil- tering of the volatilities. Overlooking model uncertainty and parameter uncertainty, the conditional density p(hT |x) contains all available information about the latent vari- able hT at time T . As a point estimate one may consider the Bayes estimator which is defined as the maximum of the posterior distribution p(hT |x). This density is approx- imated using Laplace’s method : p(hT |x) ∝ p(x, hT ) = ∫ RT−1 p(x, h)dh1 · · · dhT−1 ≈ b p ( x, h̃1, . . . h̃T−1, hT ) , (17) where the factor b does not depend on hT , and( h̃1, . . . h̃T−1 ) = argmaxh1,...,hT−1 log p(x, h). (18) Maximizing (17) gives the filtered estimate ĥT of hT . The filtering procedure can be written more compact as in (13) with ĥT = ĥ∗T . For smoothing we consider the posterior distribution p(hs|x), now with s < T . A similar argument as for the derivation of the filtering formula gives the approximated Bayes estimator ĥs = h∗s where h ∗ s is component s of the vector h∗ in equation (13). 3 We note that if we are already calculating the likelihood using the approach described above, then very little addi- tional effort is required to obtain these estimates, since the maxima in equation (13) is found as a part of the Laplace approximation. To forecast the volatility N steps into the future we fol- low the same procedure as for smoothing and filtering. We need to find the maximum of the expression log p(x, h, hT+N) = log p(x, h) + log p(hT+N |h) as a function of (h, hT+N). Iterating equation (8) back- wards yields hT+N = ψ NhT + N−1∑ k=0 ψkuT+N−k , and hence hT+N |h d ∼ N ψNhT , σ2u N−1∑ k=0 ψ2k  . Differentiation of log p(hT+N |h) gives ∂ log p(hT+N |h) ∂hT+N = − (hT+N − ψNhT ) σ2u ∑N−1 k=0 ψ 2k . (19) To find a maximum we require that the expressions in equation (19) equals zero, and also that ∇h log p(x, h) = 0. From this, the N-step volatility forecast becomes ĥT+N = ψ N ĥT , (20) where ĥT is the filtered estimate of hT . The formulas we have derived for smoothing, filtering and forecasting of the volatilities are the same as in Skaug and Yu (2009). To conclude this section we remark that, since p(xT+N |x) ∝ p(x, xT+N), the conditional densities p(xT+N |x) can be computed simply by using the Laplace approximation. For N > 1 one must take into account that the matrices A and Ω(x, xT+N) are modified due to the inclusion of the density p(hT+N |h). 3. Generalization to the MRW model In this section we extend the results of section 2 to the discrete-time MRW model. In this case ht is no longer a Markov process. While ht still is a centered Gaussian process, its covariance structure is now given by equation (5). Let us first review the approximation of the likelihood for the MRW model (Løvsletten and Rypdal, 2011). One starts with Laplace’s method, given in equation (14). The density p(x|h) is the same as for the basic SV model, but the density of p(h) needs to be handled differently. We denote by γ(k) = Cov(h0, hk) the auto-covariance function of the process ht, and let Γt be the variance-covariance matrices of the vectors (h1, . . . , ht). That is Γt(i, j) = γ(|i − j|) for i, j = 0, 1, . . . , t − 1. As usual when working with Gaussian vectors, it is conve- nient to introduce regression coefficients φ(t)i . The vectors φ(t) are defined via the equations Γtφ (t) = γ1:t , (21) where γ1:t = (γ(1), . . . , γ(t))T . From standard theory of multivariate normal distributions, the conditional distri- butions of ht |{hs : 1 ≤ s < t} are normal, ht |{hs : 1 ≤ s < t} d ∼ N(mt, Pt), (22) with means mt = (ht−1, ht−2, . . . , h1)φ(t−1) and variances Pt = γ(0) − γT1:t−1Γ −1 t−1γ1:t−1. Since the density of h can be decomposed into a product of one-dimensional marginals, equation (22) gives p(h). Remark 2. Solving the the equations in (21) for t = 1, . . . ,T − 1 can be done iteratively using the Durbin- Levinson algorithm, which requires only O(T 2) floating point operations. We refer to (McLeod et al., 2007) for details. A second difference between the basic SV model and the MRW model is the structure of the matrices Ω and A, which are defined by equations (15) and (16). For the MRW model these are no longer sparse. This makes the computation of the expression in equation (14) extremely demanding. The solution is to truncate the dependency in the process ht after a finite number of lags. This gives the approximation: p(ht |{hs : 1 ≤ s < t}) ≈ p(ht |{hs : t − τ ≤ s < t}) , (23) where τ ∈ N is a truncation parameter. We note that for t > τ, the regression coefficients and variances of ht |{hs : t − τ ≤ s < t} are φ(τ) and Pτ+1 respectively. After truncation, the matrices A and Ω become band-diagonal with bandwidths equal τ. Remark 3. The likelihood approximation for the MRW model is implemented in the R computer language. In our implementation we have used analytical expressions for the first and second order derivatives to construct the ma- trices Ω and A. The maxima h∗ are found by numerically 4 0 200 400 600 800 1000 -6 -4 -2 0 2 4 6 time t HdaysL x t HaL 0 200 400 600 800 1000 -6 -4 -2 0 2 4 6 time t HdaysL x t HbL 0 200 400 600 800 1000 -6 -4 -2 0 2 4 6 time t HdaysL x t HcL 0 200 400 600 800 -6 -4 -2 0 2 4 6 time t HdaysL x t HdL Figure 1: (a): Shows eĥt/2, where ĥt are the filtered estimates of ht from the daily log-returns in the OSEBX in the time period from February 20th 2008 to February 8th 2012. The lower curve is for the MRW model, and the top curve is for the basic SV model. The top curve has been shifted to make it visible. The filtered signals are plotted together with the log-returns xt of the OSEBX. (b): Shows the same as in (a), but now ĥt are the smoothed estimates of ht given all the observations of xt . (c): Shows eĥt/2, where ĥt is the forecast performed using data {xs : s ≤ t − N} with N = 10 days. (d): Shows the same as in (c), but now with N = 50 days. calculating the roots of the expressions in equation (16) using the algorithm ”DF-SANE” (La Cruz et al., 2006). This algorithm is implemented in the R package ”BB” (Varadhan and Gilbert, 2009). To find the determinant of the Ω we use the package ”Matrix” which efficiently stores and manipulates sparse matrices. With the likelihood approximation at hand, we can ex- tend the formulas for smoothing, filtering and forecasting to the MRW model. As for the basic SV model, we maxi- mize the posterior distribution according to equation (13), and the formulas for smoothing and filtering are exactly as for the basic SV model. To forecast the volatilities N steps ahead we need the conditional density of hT+N |h. Since this variable is nor- mal, the distribution is uniquely given by the mean mT+N |T and variance PT+N |T , i.e. hT+N |h d ∼ N(mT+N |T , PT+N |T ). (24) The mean is a linear combination the conditioning vari- ables, i.e. mT+N |T = (hT , hT−1, . . . , h1)φ (T,N) , where the coefficients φ(T,N) are solutions to the equations ΓTφ (T,N) = γN:T+N−1 , (25) with γN:T+N−1 = (γ(N), γ(N + 1), . . . , γ(N + T − 1)) T . The variance is given by PT+N |T = γ(0) − γ T N:T+N−1ΓTγN:T+N−1 . We note that in the special case N = 1 we have φ(T,N) = φ(T ), and we can again use the Durbin-Levinson algo- rithm. In the case N > 1, the explicit inverse of ΓT is needed, and one may use the algorithm of Trench (1964), which utilizes that the matrices are Toeplitz. Using the same procedure as in section 2, we get the forecasting for- mula ĥT+N = ( ĥT , ĥT−1, . . . , ĥ1 ) φ(T,N) , (26) where ( ĥ1, ĥ2, . . . , ĥT ) are the smoothed estimates of (h1, h2, . . . , hT ). 5 0 100 200 300 400 0.0 0.1 0.2 0.3 0.4 0.5 prediction length N HdaysL fo re ca st h` t+ N È8 x s : s< t< HaL 0 100 200 300 400 0.0 0.5 1.0 1.5 2.0 prediction length N HdaysL fo re ca st h` t+ N È8 x s : s< t< HbL Figure 2: (a): Examples of forecasts ĥt+N for the basic SV model (dotted curve) and the MRW model (solid curve). The forecasts are computed from the OSEBX data with the time t corresponding to the date February 17th 2010. (b): Same as in (a), but now the forecasts are preformed for the date March 5th 2009. Using the Laplace approximation for the MRW model, the N step conditional densities p(xT+N |x) are computed as in section 2. 4. Examples As an example we have applied the inference methods presented in sections 2 and 3 to a time series consisting of daily log-returns of the Oslo Stock Exchange Benchmark Index (OSEBX). The data used are closing prices for the time period May 25th 2001 to February 8th 2012, and the whole time series is used to obtain ML estimates for the basic SV model and the MRW model. The interesting estimates are ψ̂ = 0.98 for the basic SV model and λ̂ = 0.33 for the MRW model. In figure 1(a) we have plotted the filtered estimates of ht together with the log-returns for the time period from February 20th 2008 to February 8th 2012. The filtering for the basic SV model and the MRW model are similar, but not identical. The same is seen in figure 1(b), which shows the smoothed estimates. In figures 1(c) and 1(d) we have plotted the N-step forecast for N = 10 days and N = 50 days respectively. In the 50-day forecast there are some clear visible differences between the two models. These differences become even clearer in figure 2. In this figure we show two examples, where we (for a fixed time t) make future predictions ĥt+N , and plot these as a functions of N. It follows from equation (20) that these curves must be monotonic and exponentially decaying for the basic SV model. This is not the case for the MRW model, and we observe that the forecasts based on the this model have much richer behavior. We note that similar observations have been made for the MSM model (Calvet and Fisher, 2001). As explained in sections 2 and 3, it is possible to use the Laplace approximation to compute the full conditional densities for future returns. This gives forecasts contain- ing more information than the estimates presented in fig- ures 1 and 2. In figure 3 we show two examples where such densities have been computed. In these examples, the volatility is high, and the conditional densities are wider than the unconditioned density. In other situations, where the volatility is low, the conditional densities will be narrower than the unconditioned density. Remark 4. The computer code that is used for these ex- amples is available online at complexityandplasmas. net. 5. Conclusion The main results of this paper are methods for smooth- ing, filtering and forecasting using the MRW model. In addition, we have presented methods for computing con- ditional densities of future returns. These results improve on existing forecasting techniques for multifractal mod- els, and we therefore consider this work to be an important contribution to the field. The methods presented in this work open the way for several future studies of multifractal modeling in finance. Among the new possibilities that we consider most inter- esting, are model comparisons based on estimated future distributions. Acknowledgement This project is supported by Sparebank 1 Nord-Norge. 6 complexityandplasmas.net complexityandplasmas.net 0 100 200 300 400 500 600 700 -10 -5 0 5 10 time t HdaysL x t HaL 0 100 200 300 400 500 600 700 -10 -5 0 5 10 time t HdaysL x t HbL -10 -5 0 5 10 0.0 0.1 0.2 0.3 0.4 0.5 0.6 xt+N de ns it y of x t + N È8 x s : s< t< HcL -10 -5 0 5 10 0.0 0.1 0.2 0.3 0.4 0.5 0.6 xt+N de ns it y of x t + N È8 x s : s< t< HdL Figure 3: (a): An illustration of the use of conditional densities in forecasting. The figure shows the log-returns of the OSEBX up to December 12th 2008 and the conditional density of the log-return for the next day. (b): Shows the same as (a), but now the conditional density is a N-step forecast with N = 50 days. (c): Shows the same conditional density (solid curve) as is illustrated in (a). This density is compared with the unconditional density for the log-returns (dashed line). (d): Same as in (c), but now for the N-step forecast with N = 50 days References References Bachelier, L., 1900. Théorie de la spéculation. Annales scientifiques de l’É.N.S 17, 21–86. Bacry, E., Delour, J., Muzy, J. F., 2001. Multifractal ran- dom walk. Physical Review E 64, 026103. Calvet, L., Fisher, A., Nov. 2001. Forecasting multifractal volatility. Journal of Econometrics 105 (1), 27–58. Ghashghaie, S., Breymann, W., Peinke, J., Talkner, P., Dodge, Y., 1996. Turbulent Cascades in Foreign- Exchange Markets. NATURE 381, 767–770. Kolmogorov, A. N., 1962. A refinement of previous hy- potheses concerning the local structure of turbulence in a viscous incompressible fluid at high Reynolds num- ber. Journal of Fluid Mechanics 13, 82–85. La Cruz, W., Martı́nez, J. M., Raydan, M., 2006. Spectral residual method without gradient information for solv- ing large-scale nonlinear systems of equations. Mathe- matics of Computation 75, 1429–1448. Løvsletten, O., Rypdal, M., 2011. Approximated max- imum likelihood estimation in multifractal random walks. arXiv.org physics.data-an. Lux, T., 2008. The Markov-Switching Multifractal Model of Asset Returns: GMM Estimation and Linear Fore- casting of Volatility. Journal of Business & Economic Statistics 26, 194–210. Mandelbrot, B., 1963. The Variation of Certain Specula- tive Prices. The Journal of Business 36, 394. Mandelbrot, B., Fisher, A., Calvet, L., 1997. A Multifrac- tal Model of Asset Returns. Cowles Foundation Discus- sion Paper 1164. Martino, S., Aas, K., Lindqvist, O., Neef, L. R., Rue, H., 2011. Estimating stochastic volatility models using in- tegrated nested Laplace approximations. The European Journal of Finance 17 (7), 487–503. McLeod, I. A., Yu, H., Krougly, Z. L., 2007. Algorithms for Linear Time Series Analysis: With R Package . Journal of Statistical Software 23 (5). 7 Mitchell, W. C., 1915. The making and using of index numbers. Bulletin of the United States Bureau of Labor Statistics 173, 5–114. Muzy, J. F., Bacry, E., 2002. Multifractal stationary ran- dom measures and multifractal random walks with log infinitely divisible scaling laws. Physical Review E 66, 056121. Obukhov, A. M., 1962. Some Specific Features of Atmo- spheric Turbulence. Journal og Geophysical Research 67, 3011–3014. Skaug, H. J., Yu, J., 2009. Automated Likelihood Based Inference for Stochastic Volatility Models. Singapore Management University, School of Economics Work- ing Paper, 1–25. Taylor, S. J., 1982. Financial Returns Modelled by the Product of Two Stochastic Processes—A Study of Daily Sugar Prices, 1961–79. In: Time Series Analy- sis: Theory and Practice. North Holland, pp. 203–226. Trench, W. F., 1964. An Algorithm for the Inversion of Finite Toeplitz Matrices. Journal of the Society for In- dustrial and Applied Mathematics 12, 515–522. Varadhan, R., Gilbert, P., 2009. BB: An R Package for Solving a Large System of Nonlinear Equations and for Optimizing a High-Dimensional Nonlinear Objec- tive Function. Journal of Statistical Software 32, 1–26. 8 1 Introduction 2 Inference techniques in the basic SV model 3 Generalization to the MRW model 4 Examples 5 Conclusion
0non-cybersec
arXiv
Does target blank on internal links affect Google Analytics and search engines in any way?. <p>We have a news site where many articles have "Read more" links. These internal links are often set with the attribute <code>target="_blank"</code>, links opens in a new tab.</p> <p>Does it have any affect on Google Analytics and SEO? </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
How to tell NPM install was successful. <p>How can I make sure this package is completely successfully installed? </p> <p>Whenever I install a package in NPM I see no error, no successful message. </p> <p>Maybe I'm little hypochondriac :) </p> <p><img src="https://i.stack.imgur.com/hyC5V.jpg" alt="enter image description here"></p>
0non-cybersec
Stackexchange
Iterating through array - java. <p>I was wondering if it was better to have a method for this and pass the <code>Array</code> to that method or to write it out every time I want to check if a number is in the <code>array</code>. </p> <p>For example:</p> <pre><code>public static boolean inArray(int[] array, int check) { for (int i = 0; i &lt; array.length; i++) { if (array[i] == check) return true; } return false; } </code></pre> <p>Thanks for the help in advance!</p>
0non-cybersec
Stackexchange
Giving a bound to an integral. <p>$I_{n} = \int_{0}^{1} x^{n}e^{x-1}dx$</p> <p>Show:</p> <p>$0 &lt I_{n} &lt \frac{1}{n+1}$</p> <p>The lower bound is obvious but my attempts to get an upper bound have been unsuccessful.</p>
0non-cybersec
Stackexchange
The Method, Lab Coat Kid, & Eureka!-ism: How Science REALLY Rolls.
0non-cybersec
Reddit
(Yosemite) Is it possible to turn of translucency for windows but keep the effect for the dock and status bar?.
0non-cybersec
Reddit
Eclipse The deployment descriptor of the module &#39;xxx.war&#39; cannot be loaded or found. <p>There's been a number of similar questions raised on this error on Eclipse:</p> <blockquote> <p>The deployment descriptor of the module 'xxx.war' cannot be loaded or found.</p> </blockquote> <p>This is a very generic error, and after scouring the web I have multiple different causes and solutions. I'm going to attempt to list them all here, so others won't have to go through the same thing I did. </p> <p>If anyone experienced other causes and solutions, please list them here too. =)</p> <p>(Moderators, please wait for me to put the answer up before judging this question)</p>
0non-cybersec
Stackexchange
Branchless Binary Search. <p>I'm curious if anyone could explain a branchless binary search implementation to me. I saw it mentioned in a recent <a href="https://stackoverflow.com/questions/4930307/fastest-way-to-get-the-integer-part-of-sqrtn">question</a> but I can't imagine how it would be implemented. I assume it could be useful to avoid branches if the number of items is quite large.</p>
0non-cybersec
Stackexchange
Windows 10 doesnt display desktop. <p>After months i finally decided to install windows 10 on my laptop. After installing it looked like the whole laptop wouldnt work anymore but after restaring like ten times i heard the startup sound and my cursor appeared. </p> <p>Now to the problem, the only thing i see on my screen is the cursor. I do not see the desktop. After pressing some hotkeys i found out that the screens that apear using hotkeys like opening the task manager works. </p> <p>So my question is, is there a known fix to see my desktop again.</p>
0non-cybersec
Stackexchange
Just a casual day at the prison..
0non-cybersec
Reddit
A tough double integral. <p>I am looking at an ugly ratio of two random variables and am interested in the density of the the ratio. So what I did was to write down the joint characteristic function of the numerator and denominator and now try to invert it. But it sounds like a really hard task. </p> <p>Define $$g(u,v)=\Big(\cosh \beta + \frac{c+u}{\beta}\sinh \beta \Big)^{-\frac12}$$ where $$\beta=\sqrt{c^2+2cu+2v}$$ Now how should I approach $$\int_{-i\infty}^{i\infty}\int_{-i\infty}^{i\infty}e^{vs+u\alpha}g(u,v)dudv=?$$</p> <p>I will be happy with a sum, double sum or anything like that. I know that $\alpha,c&gt;0$. I appreciate your help. </p>
0non-cybersec
Stackexchange
How to determine number of write cycles or expected life for SSD under Linux?. <p>We've been running an SSD (Intel X25-M) in a Linux (RHEL 5) server for a while, but never made any effort to figure out how much write load it was under for the past year. Is there any tool under Linux to tell us approximately how much has been written to the disk over time or (even better) how much wear it has accumulated? Just looking for a hint to see if it's near death or not...</p>
0non-cybersec
Stackexchange
Help getting started with MEF. <p>I was reading somewhere that with MEF I can simply drop a dll into a directory and my application (with some MEF magic) will be able to read it and execute the code in it? Hopefully only classes that implement an interface that I define??</p> <p>Can someone help me to get going, with some links maybe for my problem.</p> <p>I've looked through some of the docs, but nothing seems to be what I'm after and its tricky when I don't know exactly what to search on...</p> <p>Thx S</p>
0non-cybersec
Stackexchange
Colonizing another planet.. I'm not looking for upvotes, just other peoples ideas and input. Maybe this is the wrong place to post, but this seems like the group who would know best. I've always wondered and debated in my head. When we successfully colonize the first planet. Will they form a Government separate from all the others here on earth? It seems like the countries of Earth will compete for who controls the colony. Will they try to separate themselves from Earth. Form a better new world. What do you guys think?
0non-cybersec
Reddit
DDD - view-only aggregate roots, building DTO and a lazy loading problem. <p>Suppose I am developing a RSS system (following DDD practises). Users have accounts. Accounts have feeds. Feeds have articles. <code>Account</code>, <code>Feed</code> and <code>Article</code> are my aggregate roots as well as <code>ArticleAccountMeta</code> (an aggregate that contains information whether an account has already read an article).</p> <p>I decided to go without separate repository model (Hibernate entities), so my aggregate roots are also my ORM entities (for several reasons, not important for the question). </p> <p>Now let's say a user (account) wants to see all his feeds with their articles. So the server needs to produce a list of feeds with their articles. Alongside each article, I need the <code>ArticleAccountMeta</code> object to indicate whether the user/account has already read the article. Naturally, I would create a few more "view" classes. These would be returned by a domain service (as the building process is more complicated and contains business logic) and they would directly reference the domain aggregate roots.</p> <p>My first question is - is it okay to have these view classes in the domain "layer" despite only being a different representation of the already created aggregate roots? Should I call them view models or are they true aggregate roots that are only used for reading?</p> <p>My second question is - when building DTOs without any additional business logic, is it okay to bypass creating a domain service and use a repository directly?</p> <p>My third question is - in the domain layer, I don't know how the view classes will be used, thus I should not instruct repositories to fetch specific references eagerly. However, I need to do that to prevent the N+1 problem. What is the correct solution here? </p>
0non-cybersec
Stackexchange
Tech Tuesday #19, everyone and anyone welcome!. Hello everyone and welcome to the 19th Tech Tuesday. Interested in having your build looked at? Have any lingering questions that you feel don't deserve separate posts? Well this is the thread for you, ask any question you mat have and hopefully myself or someone from the community will be able to answer your question. If you are posting a build, please post a link to it rather than posting the entire build in the thread just to reduce clutter. GL HF.
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
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
Request for examples: verifying vs understanding proofs. <p>My colleague and I are researchers in philosophy of mathematical practice and are working on developing an account of mathematical understanding. We have often seen it remarked that there is an important difference between merely verifying that a proof is correct and really understanding it. Bourbaki put it as follows:</p> <blockquote> <p>[E]very mathematician knows that a proof has not really been “understood” if one has done nothing more than verifying step by step the correctness of the deductions of which it is composed, and has not tried to gain a clear insight into the ideas which have led to the construction of this particular chain of deductions in preference to every other one.<br> <sub>[Bourbaki, ‘The Architecture of Mathematics’, 1950, p.223]</sub></p> </blockquote> <p>We are interested in examples which, from the perspective of a professional mathematician, illustrate this phenomenon. If you have ever experienced this difference between simply verifying a proof and understanding it, we would be interested to know which proof(s) and why you did not understand it (them) in the first place. We are especially interested in proofs that are no longer than a couple of pages in length. We would also be very grateful if you could provide some references to the proof(s) in question.</p> <p>We are sorry if this isn’t the appropriate place to post this, but we were hoping that professional mathematicians on MathOverflow could provide some examples that would help with our research.</p>
0non-cybersec
Stackexchange
Primitive log-divergent graphs and convergence of Feynman amplitudes. <p>To a connected graph $G$, quantum field theory attaches the integral $$ I_G=\int_{\sigma} \frac{\Omega_G}{\Psi_G^2} $$ where $N_G$ is the number of edges of the graph, $\sigma$ is the simplex of points $(x_1: \ldots : x_{N_G}) \in \mathbb{P}^{N_G-1}(\mathbb{R})$ such that $x_i \geq 0$ for all $i$, $\Omega_G$ is the volume form $$ \Omega_G=\sum (-1)^i x_i dx_1 \wedge \cdots \widehat{dx_i} \cdots \wedge x_{N_G} $$ and $\Psi_G$ is the first Symanzik polynomial, defined by $$ \Psi_G=\sum_{T \subseteq G} \prod_{e \notin T} x_e, $$ where the sum runs over spanning trees. </p> <p>The integral is in general divergent, but converges for a class of graphs called <em>primitive log-divergent</em>. These are those for which $N_G=2b_1(G)$ (first Betti number) and $N_\gamma&gt;2b_1(\gamma)$ for any proper subgraph $\gamma$. I have found this statement in several places but no proof. </p> <p>Does anybody know how to prove the convergence of $I_G$ in the primitive log-divergent case?</p> <p>Is it an if and only if?</p> <p>Any intuition about what the condition means? </p>
0non-cybersec
Stackexchange
Understanding how parent and child components handle an object. <p>I'm wondering how angular handle an object shared between a parent and child component.</p> <p>Let me show you a simple example: <strong>ParentComponent</strong></p> <pre><code>@Component({ selector: 'app-parent', template: `&lt;app-children [(data)]="message"&gt;&lt;/app-children&gt; &lt;div&gt;Parent: {{message}}&lt;/div&gt;`, }) export class ParentComponent implements OnInit { public message: string; ngOnInit() { this.message = 'Original message' } } </code></pre> <p><strong>Children Component</strong></p> <pre><code>@Component({ selector: 'app-children', template: `&lt;div&gt;Children: {{data}}&lt;/div&gt; &lt;a (click)="changeMessage('Children message')"&gt;Click me!&lt;/a&gt;` }) export class ChildrenComponent { @Input() public data: string; changeMessage(message: string) { this.data = message; } } </code></pre> <p>When I click on the "Click me!" link, i see only the Children message change, but not the parent one. Isn't it the same object? </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
OpenVPN Support Forum • Critical denial of service vulnerability in OpenVPN servers : Announcements.
1cybersec
Reddit
Paper Title (use style: paper title) A Reconfigurable FIR Filter with Memristor-Based Weights F. Merrikh-Bayat*, F. Alibart, L. Gao, and D.B. Strukov Electrical and Computer Engineering Department UC Santa Barbara, Santa Barbara, CA 93105, USA *[email protected] Abstract— We report on experimental demonstration of a mixed-signal 6-tap finite-impulse response (FIR) filter in which weights are implemented with titanium dioxide memristive devices. In the proposed design weight of a tap is stored with a relatively high precision in a memristive device that can be configured in field. Such approach enables efficient implementation of the most critical operation of an FIR filter, i.e. multiplication of the input signal with the tap weights and summation of the products from taps, in analog domain. As a result, the proposed design, when implemented with fully integrated hybrid CMOS/memristor circuit, is expected to be much more compact and energy efficient as compared to the state-of-the-art approaches. I. INTRODUCTION Resistive switching in thin films has many prospective applications in computing [1-7] with the majority of the proposed applications are in digital domain, e.g. in digital memories and reconfigurable digital logic [1, 6, 7]. A very exciting aspect of resistive switching is that very often it is a well-controlled continuous process, allowing for practical implementation of analog memory, which is useful for analog computing. There are already many proposals [2, 3, 4] and even experimental demonstrations of simple circuits taking advantage of analog properties of memristive devices, e.g. to implement tunable gain in operating amplifiers [8], analog memory [9], analog and mixed-signal dot-product operation [10, 11], which can be utilized to implement linear threshold gates [12], conversion circuits [13], and neuromorphic circuits [14, 15]. In this paper, we investigate another very promising analog application of memristive devices – filtering operation. In particular, we investigate several design options for discrete-time finite-impulse response (FIR) filter, present experimental results for a mixed-signal 6-tap FIR filter implemented with breadboard-mounted Pt/TiO2-x/Pt memristive devices and off-the-shelf CMOS integrated circuit (IC) components, and discuss performance of the proposed filter implementation. It should be noted that application of memristors in filtering has been proposed before in the context of adaptable RC circuits [16], which is different from what is proposed in this paper. The remainder of this section is devoted to the background information on memristive devices, which are utilized in the experimental demonstration, and FIR filter basics. A. Memristive Devices Figure 1 shows resistive switching curves for a metal- oxide Pt/TiO2-x/Pt memristive device, which belongs to the so- called valence-change memory devices according to Waser classification [17]. (The fabrication process for such devices has been described in detail in Ref. [14].) Because of the specific nature of switching, most importantly the presence of negative feedback which slows down the rate of switching for a fixed applied voltage, the reset switching is a fairly continuous and such memristive device can be switched to any Figure 1. Typical I-V switching curves of Pt/TiO2-x/Pt memristive device, which are obtained by a quasi-DC triangular voltage sweep followed by a quasi-DC triangular current sweep. The largest reset (set) switching, which is shown with the dashed lines, is obtained with a voltage (current) sweep from 0 to 1.5V (-1 mA), while switching to the intermediate states is implemented with lower stress sweeps with progressively increasing stress amplitude. The inset on the right is zoom-in on a specific voltage range utilized for FIR filter operation (also shown with yellow color on the main figure). The inset on the left shows schematically experimental setup for voltage controlled sweep. V S A This work is supported by AFOSR under MURI grant FA9550-12-1-0038 and NSF grant CCF-1028336. intermediate state in the full dynamic range. At the same time, due to highly nonlinear switching kinetics with respect to the applied voltage [18], the state of the device is switched very rapidly (potentially below 1 ns for titanium dioxide devices [19]) with relatively high voltage (e.g. during configuration stage), and retained for a long time (e.g. during operation stage) when smaller voltage biases are applied across the device. Moreover, due to ionic nature of the resistive switching, the aforementioned properties for the memristive devices, i.e. analog switching, high speed and high retention, can be combined with very high device density. Finally, low- temperature fabrication process for the considered devices enables monolithical integration with CMOS circuits [20], which would be necessary for many applications. For example, applying a simple feedback tuning algorithm [10] a similar Pt/TiO2-x/Pt memristive devices with < (20 nm) 3 active region have been programmed with ~5-bit and 8-bit precision for the crossbar-connected and stand- alone configurations, respectively, even despite large amount of cycle-to-cycle and device-to-device variations upon switching [10, 14]. It is also worth noting that large variations and poor yield, which are the main current challenges for the majority of metal-oxide memristive devices, have been shown to improve upon scaling due to filamentary nature of switching mechanism [7]. B. Discrete-Time Finite Impusle Response Filter The following equation describes the operation of discrete- time N-tap FIR filter [21]: . (1) Here, y[n] and x[n] are filter output and input, respectively, at sample time n and wi is a corresponding weight of i-th tap. Figure 2a shows typical digital FIR filter implementation. Assuming digital input to the filter with Kd bit resolution, the input is fed to N-stage-long shift register which preserves the last N samples. Each sample is multiplied by a weight tap w (stored with Kw bit resolution), which is typically fixed and does not change during filter operation. Finally, the intermediate products of each tap are added up together to create the value of the output signal at sample time tn. II. FIR FILTER IMPLEMENTATION WITH MEMRISTOR- BASED WEIGHTS From Equation 1, it is clear that the filter operation is just a weighted sum or a dot product between input signal and weight vectors. Such dot product operation can be very efficiently implemented with hybrid CMOS/memristor circuits [10, 11] provided that weights do not have to be changed frequently (which is typical for filter operations). This is because, for any reconfigurable circuits, like the one considered in this paper, configuration overhead should be negligible compared to operation time. Because high precision programming of memristive devices is relatively slow process, frequent weight updates may be not practical. Note that the idea of implementing (1) in analog domain has been around for a long time, e.g. with circuits in which weights are realized with floating gate transistors [22, 23]. Figure 2b shows schematic of experimentally implemented FIR filter circuit in which weights are realized with memristive devices, while summation and multiplication in (1) are performed with conventional operational amplifier (opamp). Because of analog input is used it is first digitized and sampled with frequency f with analog-to-digital (ADC). In particular, assuming that physical variables corresponding to x and y are analog voltages and that opamp is configured as an inverting adder, circuit in Figure 2b implement Equation 1 with wi = αRf / Mi , (2) where Mi is the memristance of the corresponding device. The analog gain α is used to force the maximum value of the DAC output to be well below the switching threshold of memristive devices in order to make sure that their configured states are not disturbed during filter operation. Note that static I-V characteristics for the considered Pt/TiO2-x/Pt devices are roughly linear in the operating range (right inset of Fig. 1) which makes possible analog-input analog-weight dot product operation implementation [11]. Figure 2. (a) Schematic for digital N-tap discrete-time FIR filter and (b) its mixed-signal implementation with hybrid CMOS/memristor circuits with N = 6. Here, Kd and Kw are bit resolution for input data samples and filter coefficients, respectively. For experimental demonstration, ADC, DAC, and shift registers are implemented with off-the-shelf IC components ADC0802LCN, DAC0802LCN, and 74LS164N, correspondingly. The value of Rf is 2.2 KΩ. The output of DAC circuits is connected to an opamp-based inverting gain amplifier which is configured to have 0.2V maximum output voltage swing. (b) Kd Kd Kd KwKwKw Kd Kd Kd M0 M1 M5 Rf xa(t) xa(t) (a) analog output y analog input x III. EXPERIMENTAL RESULTS The proposed FIR filter design shown on Figure 2b is experimentally verified with noisy sine-wave input signal and two configurations of weights. In particular, the input signal is formed by adding 0.75V 5Hz sine wave with 20KHz- bandwidth 0.5V-amplitude random noise (Fig. 3a), which is generated by the Agilent 81180A arbitrary waveform generator. In all experiments, f = 15KHz and Kd = 8 bits. Figure 3. Experimental data for 6-tap hybrid circuit FIR filter (shown on Fig. 2b) which is fed with (a) noisy sine wave input for the two cases: (b) when all weights are set to 2 KΩ  5%; and (c) with M0 = M1 = 2 KΩ  5%, M2 = 4 KΩ  5%, and M3, M4, M5 > 100 KΩ. Panel (d) shows corresponding frequency response for the two considered cases. In the first experiment, all 6 memristive devices are programmed to 2 KΩ  5%, which crudely corresponds to Kw = 5 bits of precision [14]. In this case, FIR filter acts as a simple averaging filter, so that each output sample is an average of the last 6 input samples. Figure 3b shows that amplitude of the noise at the output is dropped by almost factor of 3 as compared to that of input noise, while the amplitude of sine wave remains almost the same, so that signal to noise ratio is improved. In the next experiment, the weights are programmed to have M0 = M1 = 2 KΩ  5%, M3 = 4KΩ  5%, and M3  M4  M5 > 100KΩ. Note that since the values of weights of the last three taps are very high, their corresponding contribution to the sum in (2) is almost zero, and only the first three taps are effectively utilized for filtering task. In this case, the amplitude of the noise at the filter output is higher (Fig. 3c) as compared to the previous experiment. A quantitative comparison of the results for two weight configurations is shown in Figure 3d which shows magnitude of the frequency response. As expected, because half of the weights are effectively zero in one case and the other half is similar for the two considered cases, the cutoff frequency for the second configuration is roughly two times higher as compared to that of the first one. IV. DISCUSSION AND SUMMARY It is worth mentioning that the reason for having conversion from analog input to digital one and then back in demonstrated filter (Fig. 2b) is due to breadboard setup implementation, which limits the number of memristive devices which can be connected on the breadboard and their tuning accuracy and, in general, is not convenient for analog circuits due to large capacitive coupling noise. Such conversion can be implemented more efficiently or eliminated completely with fully integrated CMOS/memristor circuits. For example, fully analog implementation for the proposed filter design, without ADC and DAC circuits, can be achieved by utilizing analog shift register [24]. Another approach is to combine DAC circuits with dot-product operation of the filter (Fig. 4). In this case, implementation of N-tap FIR filter involves N ×Kd memristive devices with < (Kw + Kd) bit resolution. Note that this design relies on digital-input analog- weight computation and suitable for memristive devices with static nonlinear I-V characteristics, as long as the output voltage of digital shift register is lower than the threshold of memristive devices. Due to breadboard implementation the performance of demonstrated FIR filter is not representative of the potential performance for this approach. Instead, let us try to estimate performance for the case when such filter is implemented with fully integrated CMOS/memristor circuits [20]. In particular, due to very similar circuitry memristor-based design can be compared with that based on floating gate transistors , which is much more energy efficient and compact as compare to conventional approaches for the cases when required precision is not very high [22, 23]. In both approaches memory elements allow to store weights with ~ 1% accuracy [10, 23] when implemented with macroscale (>100 nm) devices. However, the bit resolution for ultimately scaled floating gate transistor is expected to be less due to limited number of electrons which can be stored on a floating gate, e.g. < 4-bit for sub 20- nm features. This is not the case at least for ionic-based (d) (a) (b) (c) output 1 output 2 input Output for case 1 Fitting for case 1 Output for case 2 Fitting for case 2 memristive devices with filamentary conduction, in which then active area is nanoscale even for macroscale devices. Moreover, memristive devices have smaller footprint and can be indirectly integrated on top of CMOS stack and thus memristor-based design should have better density, latency and energy performance. Note that both design share similar challenges, e.g. high sensitivity to temperature and random telegraph noise [11]. Figure 4. A proposal for (a) more efficient hybrid circuit implementation of mixed-signal FIR filter obtained by (b) combining binary-weighted DAC circuit in each tap with dot-product operation of the filter. In summary, we have experimentally demonstrated operation of mixed-signal 6-tap FIR filter in which weights are stored with high precision in Pt/TiO2-x/Pt memristive devices. Such approach enables efficient implementation of the most critical operation, i.e. multiplication of the tap weights with input signal and summation of resulting products, in analog domain. Due to unique properties of memristive devices FIR filter implemented with fully integrated CMOS/memristor hybrid circuits is expected to have superior performance as compared to state-of-the-art approaches. ACKNOWLEDGMENT Authors would like to acknowledge B. Hoskins for help with device fabrication and characterization and K.-T. Cheng and C. Teuscher for useful discussions. REFERENCES [1] K. K. Likharev, “Hybrid CMOS/nanoelectronic circuits: Opportunities and challenges”, J. Nanoelectronics and Optoelectronics, vol. 3, pp. 203-230, 2008. [2] Y. V. Pershin, and M. Di Ventra, “Practical approach to programmable analog circuits with memristors”, IEEE Transactions on Circuits and Systems I-Regular Papers, vol. 57(8), pp. 1857-1864, 2010. [3] G. S. Rose, J. Rajendran, H. Manem, R. Karri, and R. E. Pino, “Leveraging memristive systems in the construction of digital logic circuits”, Proceedings of the IEEE, vol. 99, pp. 1-17, 2011. [4] S. Shin, K. Kim, and S. M. Kang, “Memristor applications for programmable analog ICs”, IEEE Transactions on Nanotechnology, vol. 10(2), pp. 266-274, 2011. [5] K. Eshraghian, O. Kavehie, K.-R. Cho, J.M. Chappell, A. Iqbal, S.F. Al-Sarawi, and D. Abbott, “Memristive device fundamentals and modeling: Applications to circuits and systems simulation”, Proc. IEEE, vol. 100 (6), pp. 1991-2007, 2012. [6] D. B. Strukov, and H. Kohlstedt, “Resistive switching phenomena in thin films: Materials, devices and applications”, MRS Bulletin, vol. 37 (2), pp. 108-114, 2012. [7] J.J. Yang, D. B. Strukov, and D.S. Stewart, “Memristive devices for computing”, Nature Nanotechnology, vol. 8, pp. 13-24, 2013. [8] R. Berdan, T. Prodomakis, I. Slaoru, A. Khiat, “Memristive devices as parameter setting elements in programmable gain amplifiers”, Applied Physics Letters, vol. 101, art. 243502, 2012. [9] K.-H. Kim, S. Gaba, D. Wheeler, J. M. Cruz-Albrecht, T. Hussain, N. Srinivasa, and W. Lu, “A functional hybrid memristor crossbar- array/CMOS system for data storage and neuromorphic applications”, Nano Letters, vol. 12, 389–395, 2012. [10] F. Alibart, L. Gao, B. Hoskins, and D. B. Strukov, “High-precision tuning of state for memristive devices by adaptable variation-tolerant algorithm” Nanotechnology, vol. 23, art. 074201, 2012. [11] L. Gao, F. Alibart, and D.B. Strukov, “Analog-input analog-weight dot- product operation with Ag/a-Si/Pt memristive devices”, in: Proceedings of VLSI-SoC'12, Santa Cruz, CA, Oct. 2012. [12] L. Gao, F. Alibart, and D.B. Strukov, “Programmable CMOS/memristor threshold logic”, IEEE Trans. Nanotechnology, vol. 12 (2), pp. 115-119, 2013. [13] L. Gao, F. Merrikh-Bayat, F. Alibart, X. Guo, B.D. Hoskins, K.-T. Cheng, and D.B. Strukov, “Digital-to-analog and analog-to-digital conversion with metal oxide memristors for ultra-low power computing”, in: Proc. NanoArch'13, New York, NY, July 2013; Also in: F. Merrikh-Bayat, F. Alibart, L. Gao, X. Guo, B.D. Hoskins, B. Linares Barranco, C. Teuscher and D.B. Strukov, “Memristor-based Hopfield network”, 2013, in preparation. [14] F. Alibart, E. Zamanidoost, and D.B. Strukov, “Pattern classification by memristive crossbar circuits with ex-situ and in-situ training”, Nature Communications, vol. 4, 2013. [15] T. Ohno, T. Hasegawa, T. Tsuruoka, K. Terabe, J.K. Gimzewski, and M. Aono, “Short-term plasticity and long-term potentiation mimicked in single inorganic synapses”, Nature Materials, vol. 10, pp. 591-595, 2011. [16] T. Driscoll, J. Quinn, S. Klein, H.T. Kim, B.J. Kim, Yu.V. Pershin, M. Di Ventra, and D.N. Basov, “Memristive adaptive filters”, Applied Physics Letters, vol. 97, art. 093502, 2010. [17] R. Waser, R. Dittman, G. Staikov, and K. Szot, “Redox-based resistive switching memories – nanoionic mechanisms, prospects, and challenges”, Advanced Materials, vol. 21, pp. 2632-2663, 2009. [18] D.B. Strukov and R.S. Williams, “Exponential ionic drift: Fast switching and low volatility of thin film memristors”, Applied Physics A, vol. 94(3), pp. 515-519, 2009. [19] M. Pickett, D.B. Strukov, J. Borghetti, J. Yang, G. Snider, D. Stewart, and R.S. Williams, “Switching dynamics in a titanium dioxide memristive device”, Journal of Applied Physics, vol. 106, art. 074508, 2009. [20] Q. Xia, W. Robinett, M. Cumbie, N. Banerjee, T. Cardinali, J. Yang, W. Wu, X. Li, W. Tong, G. Snider, D.B. Strukov, G. Medeiros-Ribeiro and R.S. Williams, “Memristor-CMOS hybrid integrated circuits for configurable logic”, Nano Letters, vol. 9 (10), pp. 3640-3645, 2009. [21] L.R. Rabiner and B. Gold, Theory and application of digital singal processing, Prentice-Hall, Inc.: Englewood Cliffs, NJ, 1975. [22] M. Figueroa, S. Bridges, D. Hsu, and C. Diorio, “A 19.2 GOPS mixed signal filter with floating-gate adaptation”, IEEE Journal of Solid-State Circuits, vol. 39, no. 7, 1196-1201, 2004. [23] E. Ozalevli, W. Huang, P.E. Hasler, and D.V. Anderson, “A reconfigurable mixed-signal VLSI implementation of distributed arithmetic used for finite-impulse response filtering”, IEEE Trans. Circuits and Systems – I, vol. 55 (2), pp. 510-521, 2008. [24] S.L. Hurst, “VLSI testing: Digital and mixed analogue/digital techniques”, Short Run Press Ltd.: London, England, 1998. (a) (b) Hybrid circuit DAC Mi MDAC 2MDAC MDAC MiMDAC 2MiMDAC MiMDAC ya[n] Rf analog input x analog output y
0non-cybersec
arXiv
Zhen-Gongfu: The Ultimate Pleasure of Sex.
0non-cybersec
Reddit
How to Pattern Match an Empty Vector in Haskell?. <p>Say I want to implement the length function for lists using pattern matching, then I could do something like this:</p> <pre><code>length' :: (Num b) =&gt; [a] -&gt; b length' [] = 0 length' (_:xs) = 1 + length' xs </code></pre> <p>Can I do something similar with <code>Vector</code>s? </p>
0non-cybersec
Stackexchange
AITA getting kicked out of a grocery store just for being a teenager. So there is a grocery store near my school that a lot of kids go to. Today I was there with some friends like any other day and we were looking at chips to buy. After about 5 minutes of deliberation (we weren't being loud or rowdy or anything) one of the managers comes up and tells us to get out for taking to long. I try and reason and say that we were just about to go to the till but he says no and physically pushes me towards the door. I got mad and called him an asshole so he told me to never come back and I flipped him off as I left. Am I the asshole? TL:DR guy kicks us out for no reason I call him an asshole/flip him off
0non-cybersec
Reddit
Need help with short film - need a sound clip of a girl's voice!. So I've got a short film I'm doing for a summer school application, and I need to have it exported and put on a flash drive to for it to be in the mail before 8PM PST (It's 6:22 now). However, I'm stupid and didn't get the one voice clip I needed - a girl shouting/saying loudly "we are so OVER!" If anyone could record it on soundcloud/vocaroo and post, you would be my definite hero for the day.
0non-cybersec
Reddit
meaning of convergence at infinity. <p>What does the following mean?</p> <blockquote> <p>A sequence of functions $f_n(z)$ converges to function $f(z)$ uniformly in the neighborhood of $\infty$.</p> </blockquote> <p>This is from a complex analysis class.<br> Thank you so much for your help.</p>
0non-cybersec
Stackexchange
Question concerning Photosynthesis Practical. Okay so our class is carrying out a photosynthesis practical measuring the rate of reaction. We are using varied NaHCO3 solutions in each test tube. I'm aware that plants photosynthesise with CO2, and apparently the NaHCO3 supplies CO2 for the plants to carry out photosynthesis. My question is, how does NaHCO3 supply CO2 for the plants to carry out the reaction? Is it do to with the way it dissolves in water... cheers
0non-cybersec
Reddit
when the brits keep talking smack behind your back.
0non-cybersec
Reddit
unit / integration testing and restoring databases. <p>Busy with automated test cases in C#, and we need to restore a DB snapshot after every test. Problem is, when running multiple tests it fails because the "Database state cannot be changed while other users are using the database."</p> <p>We use <code>SqlConnection.ClearAllPools();</code> before the restore, but after the fourth test it won't restore again for the run, and it seems that the pools stop clearing. (Why four? See edit 2)</p> <p>How can I make this more reliable?</p> <p><strong>EDIT</strong></p> <p>Maybe I should give more information about the system. These are <strike>unit</strike> integration tests for a service. The tests reference the service dll (no service reference, we access the service methods directly). So, there are no SQL in the tests other than restoring the DB snapshot after every test block.</p> <p>This is a service, so we don't exactly manage the connections. We have a central point where we create the Database objects from which we get our DbCommands to execute stored procedures.</p> <p>Using <code>sp_who2</code> within SQL studio, I observe the following: There is one session to the DB for the first four test blocks (where each block is separated by a <code>ClearAllPools()</code> and a snapshot restore), but as of the fifth test block there are three sessions against it. (Why? This might be a clue to the problem.) (The snapshot restore opens an additional connection to the master DB.) All open connections have status sleeping, awaiting command, even the one blocking the snapshot restore connection.</p> <p><strong>EDIT 2</strong></p> <p>Why five? I thought the test cases would execute in random, but I was wrong. I found the culprit. More than one connection opens, the system only uses the last one, and the others are left hanging and won't clear until you exit.</p>
0non-cybersec
Stackexchange
Lovely day in the bushveld.
0non-cybersec
Reddit
Hey all, currently looking for a good quality 144+Hz / 1440p monitor, my budget is around $700-800 CAD, thanks in advance :). As the title suggests I'm looking for a good quality 144+Hz / 1440p monitor. I currently have my eyes on the ASUS ROG swift PG278QR, is anyone able to confirm if it'd be a good purchase ?? Or if not, does anyone have any other suggestions ? I'm also wondering about Gsync monitors, are they worth the extra money ? Because I am willing to pay the extra premium if it does warrant it! Thanks in advance for any suggestions / input :).
0non-cybersec
Reddit
How can I auto-number math equations in RMarkdown?. <pre><code>$$ r = \frac{1}{n-1} \sum_{i=1}^{n} \frac{(X_i - \bar{X})(Y_i - \bar{Y})}{S_xS_y} $$ </code></pre> <p><a href="https://i.stack.imgur.com/LEiLj.png" rel="noreferrer">The rendered equation is not numbered.</a> Using \begin{aligned} and \end{aligned} generates an error. </p> <p>I am also using knitr in RStudio, knitting to PDF using pandoc and xelatex engine. </p> <p>Thank you. </p>
0non-cybersec
Stackexchange
Kids These Days - Talk 2 You (Official Audio).
0non-cybersec
Reddit
requestLocationUpdates() in separate Thread. <p>I need <code>requestLocationUpdates()</code> to be in a separate Thread, in order to not have it blocking the rest of my application (it will run most of the time). What is the best way to do it?</p>
0non-cybersec
Stackexchange
How can I convert the first 100 million positive integers to strings?. <p>This is a bit of an diversion from the real problem. If providing context helps, generating this data could be useful for performance testing ways of processing strings, for generating strings which need to have some operation applied to them within a cursor, or for generating unique, anonymous name replacements for sensitive data. I'm just interested in efficient ways of generating the data within SQL Servers, please don't ask why I need to generate this data.</p> <p>I'll try to start with a somewhat formal definition. A string is included in the series if it only consists of capital letters from A - Z. The first term of the series is "A". The series consists of all valid strings sorted by length first and typical alphabetical order second. If the strings were in a table in a column called <code>STRING_COL</code>, the order could be defined in T-SQL as <code>ORDER BY LEN(STRING_COL) ASC, STRING_COL ASC</code>.</p> <p>To give a less formal definition take a look at alphabetical column headers in excel. The series is the same pattern. Consider how you might convert an integer to a base 26 number:</p> <blockquote> <p>1 -> A, 2 -> B, 3 -> C, ... , 25 -> Y, 26 -> Z, 27 -> AA, 28 -> AB, ...</p> </blockquote> <p>The analogy isn't quite perfect because "A" behaves differently than 0 in base ten. Below is a table of selected values that will hopefully make it more clear:</p> <pre><code>╔════════════╦════════╗ ║ ROW_NUMBER ║ STRING ║ ╠════════════╬════════╣ ║ 1 ║ A ║ ║ 2 ║ B ║ ║ 25 ║ Y ║ ║ 26 ║ Z ║ ║ 27 ║ AA ║ ║ 28 ║ AB ║ ║ 51 ║ AY ║ ║ 52 ║ AZ ║ ║ 53 ║ BA ║ ║ 54 ║ BB ║ ║ 18278 ║ ZZZ ║ ║ 18279 ║ AAAA ║ ║ 475253 ║ ZZZY ║ ║ 475254 ║ ZZZZ ║ ║ 475255 ║ AAAAA ║ ║ 100000000 ║ HJUNYV ║ ╚════════════╩════════╝ </code></pre> <p>The goal is to write a <code>SELECT</code> query that returns the first 100000000 strings in the order defined above. I did my testing by running queries in SSMS with the result set discarded as opposed to saving it to a table:</p> <p><a href="https://i.stack.imgur.com/oIQor.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oIQor.png" alt="discard result set"></a></p> <p>Ideally the query will be reasonably efficient. Here I'm defining efficient as cpu time for a serial query and elapsed time for a parallel query. You may use whatever undocumented tricks that you like. Relying on undefined or non-guaranteed behavior is okay as well but it would be appreciated if you call that out in your answer.</p> <p>What are some methods of efficiently generating the data set described above? <a href="https://dba.stackexchange.com/users/3690/martin-smith">Martin Smith</a> pointed out that a CLR stored procedure probably isn't a good approach due to the overhead of processing so many rows. </p>
0non-cybersec
Stackexchange
How do insert a pdf or excel spreadsheet neatly?. <p>I have a rather complicated excel-spreadsheet with calculations. I would like to insert this into my document so it looks quiet neat. It easily fits one page with title, caption, etc. I tried converting it to pdf and using:</p> <pre><code>\section{Calculations} \subsection{Preliminary Calculations} \includepdf[pages={1},fitpaper=true,picturecommand={!h}] {../NominalCalculations.pdf} </code></pre> <p>However this does not give me the desired result. It creates one page with the section title and subsection title, then leaves a massive amount of white space and creates a new page for the pdf file. The pdf file has enough space to fit title and sectiontitle above it. How do I get them on one page? How do I caption it as a table? How do I display the LaTeX document page number on the page?</p> <p>Thank you in advance!</p>
0non-cybersec
Stackexchange
Activity has leaked window/dialog (this again!). <p>Yes, I've read the countless questions regarding the <strong>very same</strong> problem.</p> <p>My code is simple: I just use <code>showDialog(int id)</code> on the <code>onCreate</code>, and then I rotate the device. <strong><em>The code is just that (test case)</em></strong>, and that's enough to cause the problem. It was my understanding that <code>showDialog</code>'s methods would take care of that... the dialog would disappear and then the <code>onCreate</code> would be called later after the change and show the dialog again, cleanly. But no. <strong>What's wrong with this reasoning?</strong></p> <p>I (think I) understand <a href="https://stackoverflow.com/a/2851833/489607">the cause</a>, but I don't know how to solve that. Even the iosched app has the same problem with their implementation of the EULA window (change orientation on the eula dialog and you get the leak). I've read about dismissing the dialog on onPause, but 1) I risk dismissing when it's not shown already, and 2) tracking the dialog seems too much work. There must be a more robust approach.</p> <p>So... what's the cleaner code that is needed to handle that?</p> <p>Thank you.</p> <hr> <p><strong>Log error output:</strong></p> <pre><code>01-30 00:27:18.615: E/WindowManager(20316): Activity com.test.PreSetupActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@418e0c28 that was originally added here 01-30 00:27:18.615: E/WindowManager(20316): android.view.WindowLeaked: Activity com.test.PreSetupActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@418e0c28 that was originally added here 01-30 00:27:18.615: E/WindowManager(20316): at android.view.ViewRootImpl.&lt;init&gt;(ViewRootImpl.java:343) 01-30 00:27:18.615: E/WindowManager(20316): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:245) 01-30 00:27:18.615: E/WindowManager(20316): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:193) 01-30 00:27:18.615: E/WindowManager(20316): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:118) 01-30 00:27:18.615: E/WindowManager(20316): at android.view.Window$LocalWindowManager.addView(Window.java:537) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.Dialog.show(Dialog.java:274) 01-30 00:27:18.615: E/WindowManager(20316): at com.test.PreSetupActivity.onCreate(PreSetupActivity.java:88) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.Activity.performCreate(Activity.java:4465) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3347) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.ActivityThread.access$700(ActivityThread.java:122) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1150) 01-30 00:27:18.615: E/WindowManager(20316): at android.os.Handler.dispatchMessage(Handler.java:99) 01-30 00:27:18.615: E/WindowManager(20316): at android.os.Looper.loop(Looper.java:137) 01-30 00:27:18.615: E/WindowManager(20316): at android.app.ActivityThread.main(ActivityThread.java:4340) 01-30 00:27:18.615: E/WindowManager(20316): at java.lang.reflect.Method.invokeNative(Native Method) 01-30 00:27:18.615: E/WindowManager(20316): at java.lang.reflect.Method.invoke(Method.java:511) 01-30 00:27:18.615: E/WindowManager(20316): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 01-30 00:27:18.615: E/WindowManager(20316): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 01-30 00:27:18.615: E/WindowManager(20316): at dalvik.system.NativeStart.main(Native Method) </code></pre>
0non-cybersec
Stackexchange
I returned to Minecraft after 3 years, I regret it.. So, as the title states, I haven't played minecraft for 3 years straight. I remember back in 2014-2016, I used to play multiplayer and go to miniplex and hypixel a whole lot and play the games on those servers. It was fun, I loved it and played it every day after school, sometimes I would even spend all night playing until it was 1 to 2 in the morning. After I'd say 2 months of playing on hypixel, I met my best friend, let's call him Nick, or NickthePlayer321 as his username. When Nick and I met, we hit it off faster than anything, we played with each other for the longest time on minecraft, we even exchanged numbers and started playing other games together, like warframe, Call of Duty: World at War zombies (with custom maps and mods and whatnot) etc. Two years later we were the best of friends, practically brothers, and all was great, I finally had a friend after living my whole life with no one wanting to hang out with me, but there he was, one person, one kid, who I could truly call, a friend. One day I went to invite Nick to play Minecraft with me, I installed a bunch of crazy mods for us to play, like the morph mod, pokémon mod, star wars mod, etc. After an hour of waiting for him to respond, I finally get a message, but it wasn't from Nick, but from his mom, (his mom knew me pretty well) and the message went on with, "Hey Jonas, Nick can't talk to you right now." Puzzled, I ask, "is there something wrong?" And she said something that destroyed my world and will leave me shattered for my whole life, "Jonas, Nick is gone." No, it couldn't be, my one and only friend I ever had couldn't be gone! Quickly, I respond "what do you mean!?" And she explained to me that Nick was diagnosed, with terminal lung cancer. My friend, the only person who ever cared about me, whom I could call a brother, was dead, his life taken away, I never got to say goodbye, and that is still my biggest regret to this day and will always be my biggest regret. After 6 months of severe depression, multiple suicide attempts and talking to no one, I finally decided to seek help from a local therapist. Nowadays, I'm doing a lot better, I have a beautiful girlfriend whom I love with all my heart, great-paying job with an adopted bernese mountain dog we call Alloyus, but the main story takes place just a week from today, and this feels like something I needed to type up to kind of get off my chest, I'm still a little shaken so forgive me if I'm jittery and phrase things weirdly. I was watching videos on youtube with my girlfriend on the couch when I saw a recommendation on skydoesminecraft (a YouTuber Nick and I watched back then) and started to blank out as if I was having some flashback. Take note that my girlfriend and I started our relationship when I was in therapy and helped me out through all of it, and she knew about me and Nick's friendship. She started to comfort me, but for some reason, I clicked on the video, and as soon as skydoesminecraft said, "hey guys, sky here..." (his intro) I started to choke up and closed out of youtube. After I drove my girlfriend home, I pulled up the video again and started to watch it more, and during it, I started to feel better and better, I guess taking a trip down memory lane was what I needed, I felt in a better mood, but then something clicked in my head. "Should I..." "Play again?" "Probably not." "Maybe?" "But why?" "Why not?" "Screw it, wouldn't hurt." "I guess?" After thinking to myself, I thought I should try to play minecraft again, for old times sake. I create a new world and call it, "in memory of my one and only friend, thank you" then, I start playing, I break down some trees, build a house, craft a sword, axe, and pick, you know the usual minecraft start up, but something felt... strange, I was having fun, more fun than doing any other thing I've ever done, I was happy. I couldn't help but notice how familiar the land looked, I had a weird flush of deja vu, but nothing to be worried about I guess. There, I finished building my house, my tools and weapons, and found a nice ravine with some good iron depositories, and after I'd say an hour of mining out the iron and coal, I was about to leave when I hear one of the cave sounds, angelic humming (cave2.ogg to be specific) and at first I thought nothing of it and brushed it off, until I got back the house, and then I heard the train whistle (cave1.ogg) and started to get really freaked out since everything around my house was lit with, I'd say around a hundred torches, so I decide to turn off the cave sounds for a more peaceful environment. I go to the settings, sounds, ambient noises only to see... they were turned off. "What? That's impossible!" I exclaimed. Puzzled, I decide to turn off the master volume so I shouldn't hear anything from the game, keyword, *shouldn't* after 10 minutes I hear another cave sound, but louder, and not one I've ever heard before, it had more rumble, more creepiness, far too disturbing, even for minecraft. I start to freak out even more and open up spotify and plug my headset to it and listen to music to calm me down. I continue to play minecraft whilst staying vigilant to see if anything else weird was gong to happen, but after a while, I see some mobs spawning come night time, so I grab my sword, shield and bow. After going outside, I see an almost overwhelming amount of mobs, *almost,* and just in the knick of time, thunderstruck starts to play in my spotify, and with the power of God, I raise hell and wreak havoc on all of these freaks. After massacring them all without mercy, I collect all the experience and go home to sleep, but the text says, "you may not rest now, there are monsters nearby..." ugh, let's see what other target practice there is... there's nothing, no mobs, not even animals, but why? What in the living hell is going on? Why is this world so screwed up? I check to see what difficulty my game is on and skip a heartbeat when it says, "peaceful." A cave sound plays again, but one completely different from the last one, even more disturbing, more distorted and so... wrong. How am I hearing this? I thought I disconnected my headset. Then I got light-headed from possible anxiety and completely blanked out. I wake up an hour later to see a new comment thing on my minecraft, after getting up I look closer at the comment thing to see it say something that will haunt me for the rest of my life. "NickthePlayer321 joined the game"
0non-cybersec
Reddit
Google Cloud Function: Could not load the default credentials. <p>I noticed error in my Cloud Function invocation via Pub/Sub. Every time it throws an Error :</p> <pre><code>Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information. at GoogleAuth.getApplicationDefaultAsync (/srv/functions/node_modules/google-auth-library/build/src/auth/googleauth.js:161:19) at process._tickCallback (internal/process/next_tick.js:68:7) </code></pre> <p>I already redeployed it with specific credentials for use. And refactored my code accordingly to that proposal <a href="https://stackoverflow.com/questions/58127896/error-could-not-load-the-default-credentials-firebase-function-to-firestore/58779000#58779000">Error: Could not load the default credentials (Firebase function to firestore)</a></p> <p>But nothing has been changed. It looks like Google released some updates and it was crashed. I think so because of our mobile app, wich does use Firebase SDK and invokes cloud functions directly. But it's wrote on Swift but my Cloud Functions is wrote on JS. So it means that we are using <em>DIFFERENT</em> libs, but have <em>THE SAME ISSUE</em>. Does somebody know something about that issue ? It would be super helpful for my team. Thanks in advance.</p>
0non-cybersec
Stackexchange
Does anyone know who this artest is?.
0non-cybersec
Reddit
Loading an HTTPS image url that may redirect to HTTP. <p>I am using a particular API, which has image url convention like:</p> <p><a href="https://us.battle.net/static-render/us/illidan/249/96749817-avatar.jpg?alt=wow/static/images/2d/avatar/6-0.jpg">https://us.battle.net/static-render/us/illidan/249/96749817-avatar.jpg?alt=wow/static/images/2d/avatar/6-0.jpg</a></p> <p>(How this url is obtained is not relevant to the question so I will not explain). But basically, the server will redirect to an alternate thumbnail if the exact image is not found. The problem is - the server, when redirecting, redirects to <code>http</code>, even if original call is made via <code>https</code>. My page that makes use of these urls is using <code>https</code>, hence I get warnings.</p> <p>Is there an easy way in javascript/html that I can use <code>https</code> urls even in case of server redirecting to <code>http</code>? Please visit above url to see what I mean. One option perhaps is to load via javascript and intercept the redirect, change the protocol to https, etc, but that looks a bit complex.</p> <p>As test code, just an html page with below code suffices (must be loaded over <code>https</code> to see the issue):</p> <pre><code>&lt;html&gt; &lt;head&gt;...&lt;/head&gt; &lt;body&gt; &lt;img src='https://us.battle.net/static-render/us/illidan/249/96749817-avatar.jpg?alt=wow/static/images/2d/avatar/6-0.jpg'&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
0non-cybersec
Stackexchange
Someone made super fun credit cards for famous film characters. Even though Halloween just ended, I still think the IT one is my fav..
0non-cybersec
Reddit
IIS welcome page not working from the local Machine. <p>i have an IIS web server installed on windows server 2012 R2, the problem is that when i try to open the <code>http://localhost</code> page from the windows server 2012 it fails and displays (explorer cannot display this page), while when i try to access the welcome page from a remote machine it works fine.</p> <p>Any ideas about the cause for this issue? Thanks</p>
0non-cybersec
Stackexchange
HP 4104gl IP Routing: worth my time? . I'm looking at turning on IP routing on a 4104 gl and using it as the gateway for 5 or 6 subnets. Having only had experience with Cisco and brocade l3 switches, I'm unsure how well the 4104 will handle the task. Don't need any routing protocols, just a few statics. Anyone had experience with them? Worth my time? Or should I just try an get a different switch to do the job.
1cybersec
Reddit