text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
The Java Mouse-Deer is a species of Chevrotain native to Indonesia. They are the world's smallest ruminants.. | 0non-cybersec
| Reddit |
How to extend filecontents to append and count lines?. <p>Here are two questions about <code>filecontents</code> environment:</p>
<ol>
<li><p>is it possible to add content to a preexisting file or, at a minimum, to keep open the external file to append the content of several <code>filecontents</code> environments to the same external file?</p></li>
<li><p>is it possible to know how many lines have been written to the external file by a <code>filecontents</code> environment?</p></li>
</ol>
| 0non-cybersec
| Stackexchange |
Apache2.4 + Python 3.7 + mod_wsgi not executing script. <p>I have installed Apache 2.4 (vc15 apacheLounge) and Python 3.7. I installed the mod_wsgi using PIP and everything appears to be setup correct in the Apache server.</p>
<p>error.log from apache:</p>
<pre><code>[mpm_winnt:notice] [pid 9688:tid 780] AH00455:
Apache/2.4.37 (Win64) mod_wsgi/4.6.5 Python/3.7 configured -- resuming normal operations
[mpm_winnt:notice] [pid 9688:tid 780] AH00456: Apache Lounge VC15 Server built: Nov 21 2018 11:51:35
</code></pre>
<p>I followed the steps on "<a href="https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html" rel="nofollow noreferrer">https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html</a>" and when I try to load the test app all I get is a text view of the code. </p>
<p>My <code>httpd.conf</code> files details:</p>
<pre><code>WSGIScriptAlias /wsgi "C:/apache24/htdocs/wsgi_app/wsgi_app.wsgi"
<Directory /apache24/htdocs/wsgi_app>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</code></pre>
| 0non-cybersec
| Stackexchange |
Vyatta (Brocade) receives BGP routes, but doesn't show in routing table. <p>What would be the reason for Brocade vRouter to receive BGP routes, identify them as valid and best, but not use in the routing table?</p>
<p>*show ip bgp neighbors 169.254.5.1 received-routes
<em>> 10.2.0.0/16 169.254.5.1 0 65500 7224 i</em></p>
<p>but nothing for 10.2.0.0/16 in <em>show ip route</em></p>
<p>The router can reach 169.254.5.1</p>
<p>The same peer (Cisco CSR) advertises routes successfully to other neighbors, including some Vyatta flavors (Ubiquiti).</p>
<p>I saw this post with similar question, but it doesn't answer it:
<a href="https://serverfault.com/questions/570307/simple-vyatta-configuration-bgp-routes-not-injecting-into-routing-table">Simple Vyatta configuration / BGP routes not injecting into routing table</a></p>
| 0non-cybersec
| Stackexchange |
TIL of a woman who is literally fearless due to a rare genetic condition known as Urbach-Wiethe disease that hardened her amygdala - part of the brain responsible for fear response. Researchers exposed her to potentially terrifying experiences and none of them scared her.. | 0non-cybersec
| Reddit |
Korean SoloQ take its toll on Froggen. One of the rare Froggen outbursts:
[Froggen Rage!](https://clips.twitch.tv/SullenCrispyKittenSeemsGood)
| 0non-cybersec
| Reddit |
Adoption was the greatest gift for both of us.. | 0non-cybersec
| Reddit |
Spark: How to aggregate/reduce records based on time difference?. <p>I have time series data in CSV from vehicle with following information:</p>
<ul>
<li>trip-id</li>
<li>timestamp</li>
<li>speed</li>
</ul>
<p>The data looks like this:</p>
<pre><code>trip-id | timestamp | speed
001 | 1538204192 | 44.55
001 | 1538204193 | 47.20 <-- start of brake
001 | 1538204194 | 42.14
001 | 1538204195 | 39.20
001 | 1538204196 | 35.30
001 | 1538204197 | 32.22 <-- end of brake
001 | 1538204198 | 34.80
001 | 1538204199 | 37.10
...
001 | 1538204221 | 55.30
001 | 1538204222 | 57.20 <-- start of brake
001 | 1538204223 | 54.60
001 | 1538204224 | 52.15
001 | 1538204225 | 49.27
001 | 1538204226 | 47.89 <-- end of brake
001 | 1538204227 | 50.57
001 | 1538204228 | 53.72
...
</code></pre>
<p><em>A braking event occurs when there's a decrease in <code>speed</code> in 2 consecutive records based on <code>timestamp</code>.</em></p>
<p><strong>I want to extract the braking events from the data in terms of event <code>start timestamp</code>, <code>end timestamp</code>, <code>start speed</code> & <code>end speed</code>.</strong> </p>
<pre><code>+-------------+---------------+-------------+-----------+---------+
| breakID|start timestamp|end timestamp|start speed|end speed|
+-------------+---------------+-------------+-----------+---------+
|0011538204193| 1538204193| 1538204196| 47.2| 35.3|
|0011538204222| 1538204222| 1538204225| 57.2| 49.27|
+-------------+---------------+-------------+-----------+---------+
</code></pre>
<p>Here's my take:</p>
<ol>
<li>Defined a window spec with partition according to <code>trip-id</code>, ordered by <code>timestamp</code>.</li>
<li>Applied window <code>lag</code> to move over consecutive rows and calculate speed difference.</li>
<li>Filter out records which have positive speed difference, as i am interested in braking events only.</li>
<li>Now that I only have records belonging to braking events, I want to group records belonging to same event. I guess i can do this based on the timestamp difference. If the difference between 2 records is 1 second, those 2 records belong to same braking event.</li>
</ol>
<p>I am stuck here as i do not have a <code>key</code> belonging to same group so i can apply key based aggregation. </p>
<p>My question is:</p>
<ol>
<li><p>How can I <strong>map</strong> to add a <code>key</code> column based on the difference in timestamp? So if 2 records have a difference of 1 seconds, they should have a common key. That way, I can reduce a group based on the newly added key.</p></li>
<li><p>Is there any <strong>better & more optimized</strong> way to achieve this? My approach could be very inefficient as it relies on row by row comparisons. What are the other possible ways to detect these kind of "sub-events" (e.g braking events) in a data-stream belonging to a specific event (data from single vehicle trip)?</p></li>
</ol>
<p>Thanks in advance!</p>
<hr>
<p>Appendix:</p>
<ul>
<li>Example data file for a trip: <a href="https://www.dropbox.com/s/44a0ilogxp60wkk/ss_so_trip.zip?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/44a0ilogxp60w...</a></li>
</ul>
| 0non-cybersec
| Stackexchange |
Have you ever seen someone get rejected in front of you. And your reaction is like "o shit is he/she gud?" | 0non-cybersec
| Reddit |
Problems Concerning Hermite and Legendre Polynomials (Folland's Fourier Analysis). <p>I am extremely confused as to how to proceed with problems 6.2.7, 6.3.4, 6.3.5, and 6.3.6. from Folland's Fourier Analysis text. I have posted a link to an online pdf of the book. The problems are listed as below.</p>
<p>6.2.7 Let $ f(x)= 1 $ for $ 0 < x < 1 $ and $ f(x) = -1 $ for $ -1 < x < 0 $. Expand $ f $ as a series of Legendre polynomials.</p>
<p>6.3.4 Expand the function $ f(x) = x^{2m} $ as a series of Hermite polynomials where $ m $ is a positive integers.</p>
<p>6.3.5 Expand the function $ f(x) = e^{ax} $ as a series of Hermite polynimials.</p>
<p>6.3.6 Let $ f(x) = 1 $ for $ x>0 $, $ f(x) = 0 $ for $ x < 0 $. Expand $ f $ in a series of Hermite polynomials.</p>
<p><a href="http://www-elec.inaoep.mx/~rogerio/FourierAnalysisUno.pdf" rel="nofollow noreferrer">http://www-elec.inaoep.mx/~rogerio/FourierAnalysisUno.pdf</a></p>
<p>Thank you very much.</p>
| 0non-cybersec
| Stackexchange |
ITAP of a boat in the Great Barrier Reef. | 0non-cybersec
| Reddit |
Kernel of adjoint operator. <p>This problem is puzzling me, even though it should be really simple.</p>
<p>Let $L=-\partial_x^2 + \frac 1 2 x^{-2}$ be an operator defined on $D(L)=C^\infty_c(0,+\infty)\subset L^2(0,+\infty)$. Its adjoint operator on $L^2$, will then be $L^*=-\partial_x^2 + \frac 1 2 x^{-2}$ with domain $D(L^*)=\{u\in L^2\colon\: (-\partial_x^2 + \frac 1 2 x^{-2})u\in L^2 \text{ in the sense of distributions} \}$. </p>
<p>Now, I want to find the kernel of $L^*$, that I know to have dimension $1$. Hence, I solve $(-\partial_x^2 + \frac 1 2 x^{-2})u=0$, and find that it has two solutions: $x^{\frac{1\pm\sqrt 3} 2}$. The problem is that, while both of these functions are in $L^2$ near $0$, none of them is in $L^2$ at $+\infty$. </p>
<p>Which is the right way to reason here? I cannot just consider the functions near $0$, otherwise I would end up with two of them, nor I see any justification in taking their sum as the generator of the kernel.</p>
<p>Thank you for any answers! </p>
| 0non-cybersec
| Stackexchange |
Have girls these day lost all self-respect?. | 0non-cybersec
| Reddit |
IBM's Watson on Tolkien, Peter Jackson, and the fans. [OC]. | 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 |
How can I print a newline as \n in bash?. <p>Basically I want to achieve something like the inverse of <code>echo -e</code>.
I have a variable which stores a command output but I want to print newlines as \n.</p>
| 0non-cybersec
| Stackexchange |
Gamespot - Nintendo Switch Review. | 0non-cybersec
| Reddit |
Vim run command in background, but show output live in vsplit. <p>How can I run a terminal command (for instance build) in vim while working on a file, while simultaneously showing the output live in a vsplit? </p>
| 0non-cybersec
| Stackexchange |
Why is my img element always loading the biggest image from srcset. <p>So, I'm trying to make a responsive image component that will load an appropriate size of image depending on the screen resolution/pixel density. As I understand it, the srcset attribute was designed for exactly this, but I can't get it to do what I want. What Am I doing wrong? Here's the element as rendered to the DOM:</p>
<pre><code><img src="/static/media/image2_1x.20b2e636.png" srcset="/static/media/image2_05x.198c1f0f.png 590w, /static/media/image2_1x.20b2e636.png 1180w, /static/media/image2_2x.632d77c5.png 2360w" sizes="(max-width: 1180px) 90vw, 1180px">
</code></pre>
<p>What I expect this element to do is that when the screen size is wider than 1180px it loads an appropriate image for a 1180px width. If it's displaying on a high-density device, it might load the 2x image (2360w) here, but normally it would load the 1x image (1180w), when the size of the screen is lower, it should calculate what 90vw is in px and pick whichever of the three images is most apropriate factoring in pixel density and how many pixels 90vw is on screen.</p>
<p>What actually happens is that the element always loads the biggest picture (the 2360w one). Even when I turn on responsive mode in my chrome dev tools and shrink the width of the screen to 300px clear the cache and reload it STILL loads the 2x one.</p>
<p>I tried multiple sizes properties. If i set sizes to just 500px, it will display the image as 500px wide but it will still load the 2x image.</p>
<p>Why is this happening? Did I make a mistake? How can I make it load the 0.5px one when the image is going to be 300px wide and doesn't need the high res version?</p>
| 0non-cybersec
| Stackexchange |
Want to install Ubuntu 14.04 onto a secondary partition on a secondary drive. <p>I currently have two hard drives, a 240 SSD with Win7 on it and a 1 TB drive that I mainly use for storage. I would like to partition off about 50 GB of the 1 TB drive and install Ubuntu 14.04 on it. So right now, I went into Windows and there is about 50 GB of unallocated space for my Ubuntu install. Can this be done? I have tried installing Ubuntu on it, but it seems to take the entire 1 TB drive and use it all for Ubuntu. I manually create all the partitions when installing, using 500MB for /boot, 15 GB for /, 4 GB for swap area and the rest of the remaining 50 GB for /home. Once it installs though, the entire 1 TB drive is used for Ubuntu. Please help. Thank you.</p>
| 0non-cybersec
| Stackexchange |
How to prevent font substitution?. <p>Im trying to make tufte-book to use EB Garamond. It does, but sadly, i have quite a few overfull boxes because many packages/styles use bold fonts.</p>
<p>An MWE for the complaint would be this:</p>
<pre><code>\documentclass[a4paper,nobib,twoside,nofonts,nols]{tufte-book}
\usepackage{ebgaramond}
\ifxetex
\usepackage{fontspec}
\setmainfont{EB Garamond}
% some more renewals, as suggested in http://tex.stackexchange.com/a/202189/9293
% \renewcommand{\bfseries}[1]{\swshape}
\fi
\begin{document}
\part{Whine and cheese}
\end{document}
</code></pre>
<p>The above mwe compiles with the warnings:</p>
<pre><code>LaTeX Font Warning: Font shape `EU1/EBGaramond(0)/bx/n' undefined
(Font) using `EU1/EBGaramond(0)/m/n' instead on input line 32.
[1] [2] (index.aux)stdin -> index.pdf
[1][2]
4341 bytes written
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
</code></pre>
<p>If i use my full document, its getting worse, because quite a few line breaks are at the wrong places (i suspect the font substitution to be the culprit).</p>
<p>I already tried to renew the <code>\bfseries</code> command, as i suspect it to be responsible to be used in the <code>book.sty</code>, but if i do, the text for the part changes (first few chars are omitted, and "Part" is dropped, too), probably because redefining <code>\bfseries</code> does more than setting font weight :/</p>
<p>Therefore i ask you:
a) How to redefine the acutal font parameterization only for <code>\part</code>, and
b) How to redefine all bold for all usage of ebgaramond? (Because EB Garamond does not support <code>bx</code>)</p>
<p>or in general: How to fix such an problem?</p>
| 0non-cybersec
| Stackexchange |
This is the cutest cosplay in the world. | 0non-cybersec
| Reddit |
Depressing the cubic, substitution. <p>I have been reading about Cordano's solution, tschirnhaus transformation, etc, for the past few days and one thing that I cannot understand, if anything, is the substitution of y=x-3/a or x=y+3/a (if the coefficient in front of cubed x is 1) . I have found pretty good lectures with Professor William Dunham and other links here and in other places, but none go into any details regarding that substitution. I want to know if there is any general form for it, for it feels very specific and since I don't want to just memorize it I would love to have some material (or any explanation here) to read but my searching lead me nowhere, either it has another popular name I am unaware of or there is nothing, which is unlikely. What little I know is that it is used to remove n-1 degree term to ease calculation but I want to read how it was derived or something similar, a read that isn't too advanced. I want to depress a cubic that has a square term in it, but actually know what or how the substitution that I used came about. Thank you!</p>
| 0non-cybersec
| Stackexchange |
[Beginner] What did I find?. For starters, I should point out that I'm a beginner with little software engineering skills. While I'm learning, I mostly rely on network forencis and high level process/OS activity for dynamic analysis. I downloaded this sample from malwr.com (link) as something to practice with and found something that I'm not really sure where to start with.
**The make a quick summary of what I'm looking at:**
The file from the link is a dropped that performs and HTTP get request for gooogledownloadfree[.]net/config/bin.zip.
This file is extracted into %appdata%\Roaming\NetworkService and drops several executable files, DLLs, and a CA certificate. The CA is moved to the trusted certs folder and seems to be used later for SSL MITM. A "NetworkService" service is created and points to one of the dropped exe's. This service opens a port 0.0.0.0:6666 , seemingly to serve as a mitm proxy.
All traffic goes back to the same IP address the dropped grabbed its binaries from, under a different domain name: youtube4tr[.]com. There is a post to youtube4tr[.]com/api containing a sort of unique ID and some other info I havent figured out yet.
POST /api HTTP/1.1
Content-Type: application/json
REQUEST-ACTION: login
REQUEST-MODULE: command
Content-Length: 66
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: www.youtube4tr.com
{"clientID":"{e95fff76-f138-494e-b1d6-5e0f230bf188}", "ver":"2.3"}HTTP/1.1 200 OK
Date: Sat, 31 Oct 2015 18:47:09 GMT
Content-Length: 75
Content-Type: text/plain; charset=utf-8
{"rc":0,"payroll":null,"st":1446317229,"today":2015101031,"time_zone":3600}
**The interesting part(s):**
In poking around, I browsed to the c2 server and got a 404 error on the root directory. However, the /config directory is full of folders with date stamps. Each folder contains several .txt file with a name similar to the unique ID spotted in the aforementioned HTTP post. The text files look like they contain keystrokes or something, but nothing else. Most of the language seems either be Portuguese or Italian. Incidentally, I couldn't located any text files with my unique string.
In futher prodding, I found a list of domains registered by the registrant for original c2 domain (gooogledownloadfree[.]net). The registrant is Oasis Games and some of the other domains returned are:
85.195.110.142 account.uumessenger.com
85.195.110.142 api.uumessenger.com
85.195.110.142 gooogledownloadfree.net
85.195.110.142 ilolbox.com Link
85.195.110.142 lolmaster.com
85.195.110.142 www.lolmaster.com
85.195.110.144 gogledownload.net
85.195.110.144 uumessenger.com
85.195.110.166 lotr.oasgames.com
85.195.110.167 lotr.oasgames.com
Some are no longer active, others I haven't looked into yet. However, gogledownload[.]net has another file index listing. Of particular interest is http://gogledownload[.]net/download/ which lists an executable 'GoogleMgr.exe'.
I threw that one in the sandbox and this is where I'm totally lost.
An HTTP connection is made back to the domain on port 4013. The stream fist send a login of some sort (not sure of encoding), then the client queries ipinfo.io and sends the returned json string (base64 encoded) to the server.
An HTTP port 8787 is opened on the client, which I cannot connect to the life of me. Any attempt returns a 400 error with "CallID:" string appended as the error text.
The exe spawns a cmd window but it isnt interactive it all, simply displays some info about the connection back to the server. (will screenshot if there's any interest). When an HTTP request is made, it displays the HTTP packet in the console, but there is no response in the browser.
Has anyone seen anything like this before? Is anyone interested in looking a bit further into this? Any advice for moving forward?
| 1cybersec
| Reddit |
Why haven't i done this yet!?. Ok so i was rasied christain, and I've always lived in fear that if i did soemthing wrong i would go to Hell and be tortured for all eternity. But then 2 days ago, when i was worrying about that stupid shit, i found some vidoes that led to more videos and me doing some research, and THE BIBLE MAKES NO FUCKIN SINCE! I mean the story of Moses and Noah have both been disproved, and if God himself knows everything then why did he create Satan, in the first place? How come no matter how many people pray for starving kids, nothing changes? ... Ok look, i could go on, and on, and on about this but to make a lonh story short, i have been an Atheist for 2 days, and I've never been happier in my life! So i fully endorse atheism! May the non existent God (or God's) bless you. | 0non-cybersec
| Reddit |
There are many fossil finds documenting human evolution and hominin subspecies since our split from chimpanzees. What evidence do we have for chimpanzee evolution during this timeframe?. | 0non-cybersec
| Reddit |
Monkeys steal secret military documents. | 0non-cybersec
| Reddit |
My girlfriend (16/f) thinks me (17/m) liking her more than she likes me is a HUGE issue is she right?. Well this argument got started because of another argument we had, basically one of her friends was cheating on one of my friends I told him about it even though she told me not to tell anyone, she got REAL mad about that understandably. I gave her this really long apology text about how I might love her and that she means a lot to me, you know all that, the thing is I REALLY didn't mean to come across like I am legit in love with her, but she stopped being mad at me and I thought all was well until today.
I saw her at school shit seemed to be going fine, holding hands, until the end of the day it was almost like she was afraid to look at me. I thought she was mad or something so I texted her later and was like, "How could I be a better boyfriend, I feel like I've been pretty shitty lately." then she said, "You're not a shit boyfriend. I just feel like you like me a lot more than I like you. You keep telling me how much you care about me and I just wanna take things a lot slower. I guess I just take longer to like someone but it just makes me feel weird when you tell me how much you like me when I don't like you as much as that.". Then I basically said, something like ~ 'That's fine, just develop feelings at your own pace, you just need to let me know that you're still more interested" then I thought about what she said for like 30 seconds then said, "Fuck, I feel like you wanna break up with me" then she replied "It just makes me uncomfortable knowing that you like me so much and I don't share that same feeling." my next response was basically, ~'I don't see how this isn't an overcomeable issue'. After that she basically said she thought it was weird that I sent that message and that I'd cry if she broke up with me. Then I told her the truth I sent the message so she wouldn't be mad at me and I mentioned that after we've only been dating for a week.
This is the comment that got to me the most though, she said "I just don't put a lot of stock in high school relationships. For me this is about spending time with a guy I like because it's fun. I just feel like you are a lot more invested in this relationship than I am. I don't mean to say I don't like you it's just that I'm not overly attached." This honestly fucking BIT me, it hurt a lot, maybe because it's because I believe in high school relationships because my parents met in High School they were each other's first BF/GF's and now they're still together, married at 18, my dad makes six figures, and they have 5 kids. I'm not saying I want to marry this girl, but later she said she wouldn't say she loved me cause she doesn't believe you can love someone in high school, but I do believe you legit can.
I don't love her, at least not yet, and we agreed that I should just pump the brakes and we could continue dating. That sounds like a win, but I don't know if I want to, she's honestly not affectionate at all unless we're in my basement making out, and she's fine with our relatively fast sexual pace (I've got to second base, and I see us getting farther within weeks if we stay together, we've been together only a month and a half and I didn't see her in person for the first 2 weeks because of a snow storm), but emotionally she's just not on my level. While I did exaggerate the super gushy text to try to stop her from being mad at me, I meant about 20% of it. I'm scared to develop more feelings toward her if she might never be able to reciprocate them. All this being said I asked her if she's still coming over on Friday and she said, "I guess". We returned to casual conversation after that. Also she's my first girlfriend so I don't really feel confident with my ability to find someone else as good as her because she fits me so well 90% of the time, but the 10% is fucking killing me. How do I approach this whole situation? I see myself with a few options I can, A: Break up with her because she was right. B: Wade it out and try not to love her and see if she changes her mind. C: She breaks up with me.
TLDR: I like my girlfriend more than she likes me, I didn't think it was a super big issue, but maybe it is. Will she change her mind?
EDIT: I wasn't even the one who decided to write that gushy ass message, I was taking what I thought was good advice from a friend BTW. | 0non-cybersec
| Reddit |
IF function for currency exchange. <p>I need to use an IF function in excel that calculates how much an item would cost in a different country. Image 1 has the cost price of two different countries and also where the new cost needs to go. In image two (which is also in a different sheet) the first row in the third column says AD now that is the exchange rate that needs to go into image one where it says cost price (AU). Now if I change that AD to SV it is suppose to change the cost price (AU) in image 1. The IF function includes rounding to 2 decimal places into each calculation of the IF function and error checking.</p>
<p><a href="https://i.stack.imgur.com/UDs7c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UDs7c.png" alt="image 1"></a></p>
<p><a href="https://i.stack.imgur.com/9aI7D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9aI7D.png" alt="image 2"></a></p>
<p>I hope this makes sense and any help would be much appreciated! </p>
| 0non-cybersec
| Stackexchange |
How do I find the mouse button properties tab when Windows 8 defaults to the "Mouse and Keyboard Center"?. <p>I am trying to switch my primary and secondary buttons on my mouse. This used to not be a problem for me. I would go to "change mouse settings" and click the "button" tab.</p>
<p>Now, however, I see a new dialog window that doesn't make sense to me that asks for the "Mouse and Keyboard Center." Clicking on this opens to a new window that says that my mouse is not supported.</p>
<p>Does anyone know how to get to this old button tab to fix this problem?</p>
<p><img src="https://i.stack.imgur.com/3RJfJ.png" alt="Screenshot"></p>
| 0non-cybersec
| Stackexchange |
Problems getting VMware Server to work on Ubuntu 9.10. <p>I'm trying to get VMware Server 2.0.2 (64-bit version) to work on my Ubuntu workstation. </p>
<p>However, the install script (<code>$ sudo ./vmware-install.pl</code>) runs into problems with the kernel modules:</p>
<pre><code>[...]
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.31-14-generic/build/include]
Extracting the sources of the vmmon module.
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config4/vmmon-only'
make -C /lib/modules/2.6.31-14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'
CC [M] /tmp/vmware-config4/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config4/vmmon-only/linux/driver.c:31:
/tmp/vmware-config4/vmmon-only/./include/compat_wait.h:78: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:70: note: previous declaration of ‘poll_initwait’ was here
In file included from /tmp/vmware-config4/vmmon-only/./include/vmware.h:38,
from /tmp/vmware-config4/vmmon-only/linux/driver.c:99:
/tmp/vmware-config4/vmmon-only/./include/vm_basic_types.h:108:7: warning: "__FreeBSD__" is not defined
In file included from /tmp/vmware-config4/vmmon-only/./include/vcpuset.h:103,
from /tmp/vmware-config4/vmmon-only/./include/modulecall.h:37,
from /tmp/vmware-config4/vmmon-only/./common/vmx86.h:33,
from /tmp/vmware-config4/vmmon-only/linux/driver.h:29,
from /tmp/vmware-config4/vmmon-only/linux/driver.c:101:
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:329:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:333:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:401:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:407:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:460:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:506:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:551:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:595:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:640:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:684:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:729:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:945:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:947:7: warning: "_MSC_VER" is not defined
[...]
/tmp/vmware-config4/vmmon-only/./include/vm_asm_x86.h:922:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config4/vmmon-only/./include/vm_asm.h:41,
from /tmp/vmware-config4/vmmon-only/linux/driver.c:103:
/tmp/vmware-config4/vmmon-only/./include/vm_asm_x86_64.h:56:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config4/vmmon-only/linux/driver.c:119:
/tmp/vmware-config4/vmmon-only/./common/hostif.h:53:7: warning: "WINNT_DDK" is not defined
/tmp/vmware-config4/vmmon-only/linux/driver.c: In function ‘LinuxDriverSyncCallOnEachCPU’:
/tmp/vmware-config4/vmmon-only/linux/driver.c:1423: error: too many arguments to function ‘smp_call_function’
/tmp/vmware-config4/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config4/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘euid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘fsuid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘egid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:2007: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vmware-config4/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config4/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config4/vmmon-only'
Unable to build the vmmon module.
Execution aborted.
</code></pre>
<p>Am I missing some required packages? Any other ideas?</p>
<p>This is 64-bit Ubuntu 9.10 (Karmic Koala). <code>uname -a</code> returns <code>Linux hostname 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux</code>.</p>
<p><strong>Edit</strong>: <a href="https://superuser.com/questions/97276/problems-getting-vmware-server-2-0-to-work-on-ubuntu-9-10/97285#97285">Got VMware Server 2.0.2 working</a>. However, if you have some tips on getting <strong>VMware Server 1.0.x</strong> to work with latest Ubuntu <em>easily</em> (without having to compile the whole kernel, for instance), please share those too! My first impression is that I don't like 2.0 at all, and would much rather use 1.0.x if only I got it working.</p>
| 0non-cybersec
| Stackexchange |
This was a test. | 0non-cybersec
| Reddit |
QoS (quality of service) criteria in router for Ubuntu One. <p>I'm looking for QoS criteria in order to lower priority of traffic while synchronizing big files. Ubuntu One uses 443 port which cannot be good criteria because it is common for all https traffic. Destination IP is also does not seems to work because Ubuntu One uses range of IP's.
Any ideas will be appreciated,
Thanks,
yb.</p>
| 0non-cybersec
| Stackexchange |
Car Maintenance Cost 2008 A4 Quattro Manual [OC]. | 0non-cybersec
| Reddit |
Moving from android Nexus 4 to 5S. Anywhere I can check my apps to make sure they all exist on iOS?. | 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 |
Went to see "The Mousetrap" and felt something beneath my foot. | 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 |
Inter vlan routing not working. <p>Apologies if any details not clear as I'm not a network expert.</p>
<p>I have a Procurve 3500yl layer-3 switch. I am trying to make two VLANs and get a PC in one VLAN to connect to the other VLAN.</p>
<p>Below is the running configuration from the switch:</p>
<pre><code>Running configuration:
; J8692A Configuration Editor; Created on release #K.14.41
hostname "ProCurve Switch 3500yl-24G"
module 1 type J86xxA
ip routing
vlan 1
name "DEFAULT_VLAN"
untagged 9-24
no untagged 1-8
no ip address
exit
vlan 20
name "local"
untagged 5-8
ip address 192.168.1.1 255.255.255.0
exit
vlan 10
name "operator"
untagged 2-4
ip address 10.11.156.31 255.255.255.0
tagged 1
exit
ip route 10.11.156.0 255.255.255.0 vlan 10
ip route 192.168.1.0 255.255.255.0 vlan 20
snmp-server community "public" unrestricted
</code></pre>
<p>I am trying to get PC (IP address: <code>192.168.1.2</code>) to ping IP address <code>10.11.156.1</code> which is another router connected to VLAN 10.</p>
<p>I can ping <code>10.11.156.31</code> which is the VLAN address, but I can't ping <code>10.11.156.1</code>. Do you have any idea what is the problem here?</p>
| 0non-cybersec
| Stackexchange |
Clearing the Bar: The Philosophy of the High Jump. | 0non-cybersec
| Reddit |
Because cats like to push things off of ledges, When Scar pushed his brother off the cliff, it might’ve felt normal. | 0non-cybersec
| Reddit |
As an experienced OO developer, I'm trying to select a language for a web project that'll be fun, educational, but also enhance my resume. I have an idea for a website that I'd like to get started on, and I'd love some thoughts/advice! I'm in a predicament because the languages I think I'd enjoy the most have little demand in industry.
I have years of OO experience. I'm well versed in Ruby, Java, PHP, .NET, and Javascript. I have decent experience with Python and C, and dipped my toes in Haskell a few years ago (forgot most of it). I'd love to learn new language and more so, new development techniques and practices. Unfortunately, it seems most job posting around here request J2EE or .NET experience. I've narrowed my options to:
* **Ruby**: I can get something up and running quickly due to my experience, and I know several frameworks/libraries/APIs. I enjoy the language, but there's only so much more I can learn and I may get bored after a while.
* **C#**: I'd consider it because it's similar to Java, I have experience with VB.NET (current job), and potential employment opportunities. Cons are that I prefer *nix development and I'd have to spend $$$ to get started (Visual Studio, and setup a Windows box for development--I work on a Mac/Linux from home).
* **Java**: I know the language well, but haven't done web development on it yet. I'd likely go with Spring MVC and Hibernate. Pros are that a lot of corporations need experienced J2EE developers. There's also great community support, mature libraries, and great performance. Great IDE support, mature libraries, and static typing are also huge pluses.
* **Python**: Looks to be the favorite of the dynamic languages (excluding PHP) in industry. It's also a fun language. The learning curve won't be too high due to my experience with Ruby. Like Ruby, I'll miss good IDE support and compile-time checking.
* **Scala**: An OO language with a functional emphasis. I'm a big fan of the functional way of programming (immutability, no side effects). The fact is runs on the JVM is a huge plus. I hear there is decent IDE support for it as well. The con is the learning curve (I hear the type system is very complex, and some native Scala libraries do not implement Java interfaces). I know nothing about this language, and I don't know how easy is it to learn. The Lift framework looks very interesting as well, a change from MVC that I'm used to. I hear several people suggesting it will be the "new Java".
* **Haskell**: I briefly taught myself this language a few years back using a couple popular tutorials and loved it. However, I'll have to relearn the language and learn how to build a website using it. I don't know how mature the frameworks are for Haskell web-development. This is likely the least used language in industry that I've listed and it probably won't be a significant addition to my resume for potential employers. On the other side, I love the idea of a pure functional language and had a blast learning it a couple years back. Compile-time type checking was awesome as well.
* **Clojure**: I've read some documentation on this, and wrote a few trivial scripts. Like Haskell, I think I'll enjoy learning this language a lot. This would be my first LISP. Another plus is that it runs on the JVM. However, I've seen reports that performance can be as much as 10x slower than Java, and I think i'll miss compile-time checking that I'd get from Haskell, Java, and Scala (?).
Some criteria when selecting a language:
* Job opportunities: Java/J2EE or C# seem to be the best choices here.
* Education & enjoyment: Clojure, Haskell, or Scala seem to be the most enjoyable and ones I'd learn the most from. Although, I think I'd lean more toward Clojure or Haskell because they are real functional languages.
* PaaS: It'd be nice if the language/framework can be easily deployed to something like GAE, Heroku, etc.
* Web frameworks and libraries: Needs to be mature, well documented, and enjoyable to work with.
* Performance: Java seems to have the upper hand here. I hear GHC is getting really good too and can produce some fast Haskell binaries. Ruby/Python have the disadvantage here. I expect my webapp to use a lot of AJAX so I need response times to be fast.
Thanks guys, I look forward to hearing your thoughts and suggestions!
**TL;DR**: I'm trying to select a language for a new project. I want it to be fun and educational (Clojure, Haskell, Scala), but I also want it to be appealing to potential employers (Java, .NET). Having a hard time selecting one because the criteria seems to be mutually exclusive.
[Edit: formatting] | 0non-cybersec
| Reddit |
Member functions that are sometimes const. <p>I have a class design similar to the following:</p>
<pre><code>class MyClass {
public:
bool IsValid() const;
void MakeValid();
private:
bool CheckValidity(bool fix);
};
bool MyClass::IsValid() const {
// Check validity, but don't fix any problems found. Doesn't work.
return CheckValidity(false);
}
void MyClass::MakeValid() {
// Check validity and fix problems found.
CheckValidity(true);
}
</code></pre>
<p><code>IsValid</code> should be <code>const</code>, because it doesn't make changes. <code>MakeValid</code> should be non-const, because it does make changes. They share the same implementation, <code>CheckValidity</code>, but because <code>CheckValidity</code> may or may not make changes, it can't be marked <code>const</code>.</p>
<p>What's the best way to handle this? The simplest approach is to just use <code>const_cast</code>, but casting away const feels a bit dirty:</p>
<pre><code>bool MyClass::IsValid() const {
// Check validity, but don't fix any problems found.
return const_cast<MyClass*>(this)->CheckValidity(false);
}
</code></pre>
<p>Is this a legitimate use of <code>const_cast</code>? Is there a better approach?</p>
| 0non-cybersec
| Stackexchange |
ˢʷᶦᵐ Lick ˢʷᶦᵐ Lick ˢʷᶦᵐ Lick ˢʷᶦᵐ ˢʷᶦᵐ ˢʷᶦᵐ swim swim swim (x-post r/gifs). | 0non-cybersec
| Reddit |
Get last date from a column on a different sheet. <p>I'm looking for help on the following:</p>
<p>How do I get the last date from a column in sheet1 returned in a cell of sheet2</p>
<p>I tried it with:</p>
<pre><code>=FILTER(Sheet1!A:A ; ROW(A:A) =MAX( FILTER(ROW(A:A) ; NOT(ISBLANK(A:A)))))
</code></pre>
<p>but this results in an error</p>
<p>Any suggestions?</p>
| 0non-cybersec
| Stackexchange |
Tilt shift all the things. | 0non-cybersec
| Reddit |
Change Python Path from 2.5 to 2.7. <p>I was using Python 2.7 Happily but today I had to Install Python 2.5 for a different project and while trying to use virtualenv I Installed Python 2.5. Now the Python path Globally is set to Python 2.5. How can I change it back to Python 2.7.</p>
<p>I am on Ubuntu 12.04.</p>
| 0non-cybersec
| Stackexchange |
LDAP queries for local users. <p>Recently, in the company where I work, we have had a general system crash and we are figuring out the causes. Our machines are configured for LDAP authentication plus some local users in some of them. LDAP authentication works fine but we have found, from the log, that also <strong>for local users there are some LDAP queries</strong> and we think that this could be related to the crash.
I am working on this problem, changing nsswitch.conf, pam modules and so on, but I can't get rid of this LDAP call for local users.
Does anyone have any idea on how to stop LDAP queries for local users?</p>
<p>Thank you very much in advance.</p>
<p>In our machine is installed SuSE Linux 11 SP2 and OpenLDAP 2.4.
This is nsswitch.conf</p>
<pre><code>passwd: compat
group: files ldap
hosts: files dns
networks: files dns
passwd_compat: ldap
group_compat: ldap
</code></pre>
<p><strong>UPDATE</strong></p>
<p>This is the log taken <strong>from the LDAP server</strong> after a login attempt <strong>on another machine</strong> from a user called <strong>guest</strong> which is local to that machine</p>
<pre><code>Jul 29 11:00:45 vmtemplate slapd[2465]: conn=1627 op=1 SRCH base="dc=test,dc=com" scope=2 deref=0 filter="(&(objectClass=posixAccount)(uid=guest))"
Jul 29 11:00:45 vmtemplate slapd[2465]: conn=1627 op=2 SRCH base="dc=test,dc=com" scope=2 deref=0 filter="(&(objectClass=posixGroup)(memberUid=guest))"
Jul 29 11:00:47 vmtemplate slapd[2465]: conn=1008 op=407 SRCH base="dc=test,dc=com"
</code></pre>
| 0non-cybersec
| Stackexchange |
Determine which data a SQL login account has access to?. <p>I am a new DBA and am trying to do some documentation on the SQL estate that I am responsible for. Currently I have no documentation on anything so this is all from scratch. I am hoping to find out if there is a way I can map every SQL server login to the data that it has access to (database, table, etc). Is this possible?</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 |
Eventually they will learn, right?. | 0non-cybersec
| Reddit |
Hello darkness my old friend. | 0non-cybersec
| Reddit |
Complex numbers and proof. <p>I'm having trouble learning and understanding questions relating to complex numbers and was wondering if I can get any help. Thanks in advance for any help I can get! </p>
<p>Given $x$ is a complex number (not $0$), we also have a new complex number $x^{-1}$, called inverse of $x$, so we have the property that $x\cdot x^{-1} = 1$.</p>
<p>a) Prove that this inverse is unique.</p>
<p>b) $x^{-1} = \bar{x}/\lvert x\rvert^2$</p>
<p>c) Prove if $\lvert a\rvert = \lvert b\rvert = \lvert c\rvert = 1$, then $\bar{a} + \bar{b} + \bar{c} = 1/a + 1/b + 1/c$.</p>
| 0non-cybersec
| Stackexchange |
oop model Base class design : static and non-static data access. <p>I am trying to make a base class ... tiny framework if you will just for practice </p>
<p>So I start with example of child class because it has less code !! </p>
<pre><code>class User extends Base {
public $id ;
public $username ;
public $email ;
public $password ;
function __construct(){
$this->table_name = 'users';
$this->set_cols(get_class_vars('User'));
}
}
$u = new User;
$u->username = 'jason';
$u->email = '[email protected]';
$u->insert();
</code></pre>
<p>Here is my Base class</p>
<pre><code>class Base {
protected $table_name ;
protected $table_columns ;
protected function set_cols($cols){
unset($cols['table_name']);
unset($cols['table_columns']);
$this->table_columns = array_keys($cols);
}
public function insert(){
$colums = $values = array();
foreach($this->table_columns as $col )
{
if(!$this->$col) continue ;
$values[] = $this->$col ;
$colums[] = $col ;
}
$values = implode(',' , $values);
$colums = implode(',' , $colums);
echo $sql = "INSTER INTO ".$this->table_name ." ($colums)
VALUES ($values) ";
}
}
</code></pre>
<p>Here is the problem , I want to make <code>filter</code> or <code>get</code> method (basically reading from database) static and then return an array of objects from database data </p>
<pre><code> class Base{
static function filter($conditions =array()){
$query_condition = $conditions ; // some function to convert array to sql string
$query_result = "SELECT * FROM ".$this->table_name ." WHERE $query_condition ";
$export = array();
$class = get_called_class();
foreach($query_result as $q )
{
$obj = new $class;
foreach($this->table_columns as $col )
$obj->$col = $q[$col];
$export[] = $obj;
}
return $export;
}
}
$users = User::filter(['username'=>'jason' , 'email'=>'[email protected]']);
</code></pre>
<p>Here is the problem , with <code>filter</code> as static function <code>__construct</code> in <code>User</code> class will not get called and <code>table_columns</code>, <code>table_name</code> will be empty </p>
<p>also in the <code>filter</code> method I can't access them anyway because they are not static ... I can make a dummy <code>User</code> object in the <code>filter</code> method and solve this problems but somehow it doesn't feel right </p>
<p>Basically I have a design problem any suggestion is welcomed </p>
| 0non-cybersec
| Stackexchange |
The Art of Seed Bombing . | 0non-cybersec
| Reddit |
"I have a BF!". | 0non-cybersec
| Reddit |
How can I concatenate the values from multiple rows in Excel in a single row?. <p>I have an Excel table which displays 2 entities. Because <code>Entity A</code> contains multiple <code>Entity B</code>, I have one row for each combination of A and B, in a <strong>cartesian product</strong>.</p>
<p>What I need is to transform this table in such a way that the columns from <code>Entity A</code> will be distinct, and I need to concatenate the values of <code>Entity B</code>.</p>
<h2>Example</h2>
<p>Here we got 2 tables, the first one is <strong>my original</strong>. On the second one, the first few rows are grouped/concatenated exactly like I need it.</p>
<p><img src="https://i.imgur.com/j2iDGG3.png" alt="image"></p>
<p>What is the best way to achieve this grouping/concatenation?</p>
| 0non-cybersec
| Stackexchange |
biblatex: adding entries outside of main .bib file; possibly a 'multiple bibliographies' problem with filecontents package. <p>Is there a way to include additional entries outside of the <code>.bib</code> file in the a bibliography for <code>biblatex</code>? For instance, I have a few web references (http) which I don't want to add in my general <code>.bib</code> file, but only within a particular document (<code>.tex</code> file). Is this possible? I am imagining something which might use the filecontents package like <a href="https://tex.stackexchange.com/questions/60649/using-bibtex-entries-directly-in-tex-file">this</a>, but not sure how this can be done with <code>biblatex</code>.</p>
| 0non-cybersec
| Stackexchange |
Finished this little jewelry box today. First time working with fancy wood. It's not perfect, buy my mom's friend called me an artist. So, I got that going for me.. | 0non-cybersec
| Reddit |
Insert multiple values in a text field using a "delimiter"?. <p>Let's say I have a <strong>Text</strong> field called "description" inside "products" table.</p>
<p>Inside this field I will store 3 values. I will separate them with two pipes ( <strong>||</strong> ):</p>
<pre><code>requirements:
- bla bla.. (a text)
||
info:
- bla bla.. (a text)
||
specifications:
- bla bla.. (a text)
</code></pre>
<p>I am doing this because it looks better than having 3 <em>different</em> Text fields to do the job (which will increase the table's size).</p>
<p>Is this a bad idea? Should I use 3 different fields? Does 3 text fields really affect database performance?</p>
| 0non-cybersec
| Stackexchange |
Guys, all we need is jesus. | 0non-cybersec
| Reddit |
Automatically delete all files and data upon shutting down or reboot in Ubuntu. <p>Is there a way to configure a default user account to automatically delete all files/data upon shutting down or reboot? Thanks a lot!</p>
| 0non-cybersec
| Stackexchange |
Counting the number of days until your birthday and why it's a useful programming trick. | 0non-cybersec
| Reddit |
What is the internal working of an unordered set in C++? What algorithm does it use?. <p>The average case time complexity for search in an unordered set in C++ O(1) but for worst case it is O(n). The same goes for insertion and deletion.</p>
<p>How does that work? The worst case time complexity for search should be when the element is not present in the map. If that takes O(n) time, it means that it tranverses the whole unordered set once. But if that's the case, shouldn't the average case complexity be O(n) as follows:</p>
<pre><code>(1 + 2 + ... + n) / n = (n + 1) / 2
</code></pre>
<p>This means that there must be some other algorithm implemented to search. What's the algorithm?</p>
| 0non-cybersec
| Stackexchange |
On SSP/ProPolice canary randomization for hardened Linux applications. | 1cybersec
| Reddit |
My wife is normally a very rational and intelligent person, but today she was freaking out. She told me she read that "They use aborted babies in some vaccines." Is there any shred of truth to this at all? I would love a peer reviewreviewed article on the topic.. Oops. Slight spelling jumble in the title there. | 0non-cybersec
| Reddit |
Yahoo's the best search engine when looking for a midsized car. | 0non-cybersec
| Reddit |
Call Web API From Application. <p>I have called Web API from ASP.NET page on a button click as below.
This is perfectly working fine though I have read somewhere it will create deadlock as it is not <code>async</code> (due to use of <code>.Result</code> in line <code>client.PostAsJsonAsync(url, sd).Result;</code>)</p>
<p>Please suggest best way to update this code.</p>
<pre><code>private void CallApi(SurveyData sd)
{
using (var client = new HttpClient())
{
string url = ConfigurationManager.AppSettings.Get("url");
client.DefaultRequestHeaders.Accept.Clear();
var response = client.PostAsJsonAsync(url, sd).Result;
if (response.IsSuccessStatusCode)
{
Response.Write("Success");
}
else
{
Response.Write(response.StatusCode + " : Message - " + response.ReasonPhrase);
}
}
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Replace the SSN as a means of confidentially identifying a US citizen.. The SSN wasn't originally intended to be a confidential identification number for US citizens, it was just a normal identifier and records keeping mechanism. With so many data breaches at large firms like Target, Anthem, eBay, etc. I've likely had my SSN and personal information stolen multiple times. However unlike a password exploit I can't generate a new SSN and go on living.
**If you were asked as a security professional to design a system to replace the SSN as a means of national identity verification, what would that system look like?** Keep in mind it should be resettable like a password, secure on a national level, and relatively inexpensive to implement over the course of a decade or so. | 1cybersec
| Reddit |
This orange is shaped like a lemon. | 0non-cybersec
| Reddit |
Turn it off before you clean it. "Nah, I got this, fam! WCGW?". | 0non-cybersec
| Reddit |
For any elliptic curve $E/\mathbb{Q}$, there are infinitely many primes $p$ such that $E$ is ordinary.. <p>Let $E$ be an elliptic curve defined over $\mathbb{Q}$, and fix a Weierstrass equation for $E$ having coefficients in $\mathbb{Z}$. How do I see that there are infinitely many primes $p \in \mathbb{Z}$ such that the reduced curve $E/\mathbb{F}_p$ has Hasse invariant $1$?</p>
<p><a href="https://math.stackexchange.com/users/317822/joe-silverman">Joe Silverman</a> writes the following <a href="https://mathoverflow.net/a/254520/97565">here</a>.</p>
<blockquote>
<p>Elkies and Serre have independent proofs that for every $\epsilon>0$ there is a constant $C_\epsilon>0$ such that
$$
{\#\{p\le X : E/\mathbb{F}_p \text{ is ordinary}\}} \ge C_\epsilon
X^{3/4-\epsilon}.
$$</p>
</blockquote>
<p>However, I just want to know that there are infinitely many ordinary primes, which should be much easier to see.</p>
| 0non-cybersec
| Stackexchange |
Spivak or Apostol?. <p>Which one of those is the best for a person interested in pure mathematics and who wants to have a deep understanding of calculus? Apostol or Spivak? Could you guys tell me some differences between the approaches of them? What about the exercises? I would like to be challenged, but in a constructive way.</p>
| 0non-cybersec
| Stackexchange |
Just got a bath, first time no crying. | 0non-cybersec
| Reddit |
Awesome job kid. | 0non-cybersec
| Reddit |
Turning off other monitors on lock screen in Windows 8.1. <p>In Windows 7, when the PC got locked, the lock screen appeared on the primary monitor and all other monitors connected to the PC got turned off.</p>
<p>(With "turning off", I don't mean turning off per se, just the state when the monitor stops recieving any signal and goes to a sleep mode or something.)</p>
<p>Now, on Windows 8.1 (and possibly on Windows 8 too), when the PC gets locked, the lock screen appears on the primary monitor, but the other monitors are kept running too and they show the background from the lock screen (in my case a solid color). That is a bit annoying and consumes unnecessary power.</p>
<p>Is there a way to make Windows 8.1 turn the other (non-primary) monitors off when the lock screen appears?</p>
<p>Thank you.</p>
| 0non-cybersec
| Stackexchange |
Torn as to whether I should buy a preowned phone or wait. Hi everyone,
Apologies if this is in the wrong place, I did find an iPhone help subreddit however it seemed kinda dead :s I figured the guys on this sub should be able to help me though!
So at the moment I am a not-so-proud owner of a Samsung Galaxy Ace. To put it shortly, it's awful. Freezing as I'm currently writing this, no front camera, shuts down by itself 5+ times a day, I could go on. So I've decided I want a new phone. I was looking to buy Android (as it's regarded by most of my friends to be superior to Apple) however an offer came up that I'm now seriously considering. My friend recently bought a OnePlusOne and so is offering me his 64gb iPhone 4S for $250AUD, with box, headphones, charger, everything. Considering my budget for phones is around the $300 mark, and new 8gb 4S's are ~$450, this is a really good offer. He claims there's nothing wrong with it however after fidgeting with his old phone for a bit I found two major issues with the phone.
1. A small crack on the back of the phone. Hidden by a hard case, I fear this crack may either interfere with hardware in the phone or develop into a larger, uglier crack. Is there any possibility of these things happening?
2. A small amount of lag when the phone is woken up (about 1.5 seconds). I'm unsure if this is due to the copious amounts of files and games on the phone currently or if it's a hardware problem. My friend has owned the phone for about 1.5 years if that has anything to do with it.
So as of now, I have a few options. I could keep my crappy phone and save my dosh (ew), buy my friends iPhone, accepting it's flaws in exchange for a cheaper price, and finally, I could just save more money and buy a completely new phone. Any thoughts on what I should do?
| 0non-cybersec
| Reddit |
Numerical Stability of Halley's Recurrence for Integer $n^{\mathrm{th}}$-Root. <p>tl;dr? See last paragraph.</p>
<p>If I use the initial value $2^{\left(\big\lfloor\lfloor\log_2 x \rfloor/n\big\rfloor + 1\right)}$ with Halley's recurrence in the compact form</p>
<p>$ x_{k+1} = \frac{x_k\Big[A\left(n+1\right) + x_k^n\left(n-1\right) \Big] }{A\left(n-1\right) + x_k^n\left(n+1\right)} $</p>
<p>to evaluate $\lfloor x^{1/n}\rfloor$ with $x,n \in \mathbb{N}$, $x \gg 1$ and $n > 2$ it seems (empirical tests only!) to work. Slowly.</p>
<p>As is the case with all of these methods: the closer the initial value $x_0$ to the actual root, the smaller the amount of iterations needed. Many papers have been written about it, although not many for the integer versions, but a simple refinement can be implemented by observing that the root lies between $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor + 1}$ and $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor}$ so a simpel arithmetic average of these limits should give a significant decrease in the number of iterations needed and, lo! and behold, it does. Small problem: the algorithm is unstable with that seed. Visible in the following pretty picture with a highly abused y-axis (#iterations, bitsize of root, and absolute error) and the index along the x-axis. The radicand used was $5987^{797}$.</p>
<p><a href="https://i.stack.imgur.com/YEzxc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YEzxc.png" alt="Numebr of Iterations and Error"></a></p>
<p>The range of indices where the error occurs is outside the range where I would use Halley's recurrence and change to bisection. The cut-off point I have choosen is the intersection between the bisection which is linear $ax^{-1}$ and the approximately linear part of the Halley iterations at the beginning $bx$ which puts the intersection at $\sqrt{a/b}$. Some runs with up to $3\,321\,960$ bits (ca. one million decimal digits) showed $\Big\lfloor\sqrt{A_b\left(\left\lfloor\log_2\left(\left\lfloor\log_2 \left(A_b\right) \right\rfloor\right) \right\rfloor + 1\right)}\Big\rfloor$ with $A_b = \left\lfloor\log_2 \left(A\right) \right\rfloor$ to be a good estimate for the big-integer library in use.</p>
<p>Hence my question: is Halley's recurrence, implemented as described above, numerically stable in the range $(3,\Big\lfloor\sqrt{A_b\left(\left\lfloor\log_2\left(\left\lfloor\log_2 \left(A_b\right) \right\rfloor\right) \right\rfloor + 1\right)}\Big\rfloor)$ with the initial value the arithmetic average of $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor + 1}$ and $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor}$ or not and, much more interesting, why?</p>
| 0non-cybersec
| Stackexchange |
Is there a clean way to avoid calling a method on nil in a nested params hash?. <p>I'm interested in getting the nested 'name' parameter of a params hash. Calling something like</p>
<pre><code>params[:subject][:name]
</code></pre>
<p>throws an error when params[:subject] is empty. To avoid this error I usually write something like this:</p>
<pre><code>if params[:subject] && params[:subject][:name]
</code></pre>
<p>Is there a cleaner way to implement this?</p>
| 0non-cybersec
| Stackexchange |
PsBattle: Artist printing toy bear on to paper.. | 0non-cybersec
| Reddit |
How to generate a NOT random sample to be sure to preserve distribution properties. <p>Assuming a normal probability density function with mean = $\mu$ and standard deviation = $\sigma$, I know that if I generate randomly many times a number from this pdf, the sample that I will obtain will represent accurately the pdf. Consequently, the quantiles of my sample will describe accurately my true pdf distribution and I will be able to find back $\mu$ and $\sigma$. </p>
<p>However, if i decide to generate only few random numbers (let say $10$ or $20$ times), it is likely to be misleading. </p>
<p>Is there a way to generate NOT random numbers to be sure to create a sample that preserves the distribution specificities? How to sample the pdf to preserve the quantiles with a very small sample? </p>
<p>Thank you !</p>
<p>(I apologize, I'm far from being a mathematician, the vocabulary I use may not be appropriate)</p>
| 0non-cybersec
| Stackexchange |
Bigfoot changes hyphenchar for compound words. <p>Bigfoot changes the “hyphen” char for compound words:</p>
<pre><code>\documentclass{article}
\usepackage{bigfoot}
\listfiles
\DeclareNewFootnote[para]{foo}
\begin{document}
\footnotefoo{\rule{9.4cm}{1mm} xx compound-word}
\footnote{\rule{9.4cm}{1mm} xx compound-word}
\end{document}
</code></pre>
<p><img src="https://i.stack.imgur.com/OyMkX.png" alt="enter image description here"></p>
<p>The regular hyphen character (dash) is unchanged. How can I get my dash when using bigfoot/<code>\footnotefoo</code> with an explicit dash on compound words? What causes the problem?</p>
<pre><code>*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
bigfoot.sty 2006/07/15 1.25 makes footnotes work
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
manyfoot.sty 2005/09/11 v1.10 Many Footnote Levels Package (NCC)
nccfoots.sty 2005/02/03 v1.2 NCC Footnotes Package (NCC)
suffix.sty 2006/07/15 1.5 Variant command support
perpage.sty 2006/07/15 1.12 Reset/sort counters per page
***********
</code></pre>
| 0non-cybersec
| Stackexchange |
Comprehensive conditional probability question. <p>Bob owns a bakery. It is located on a busy road with a lots of individuals walking by the bakery each day. On average, $\lambda$ individuals go into the bakery per day, the number of individuals entering the bakery follow a Poisson distribution, $N\sim P(\lambda)$. Each person who enters the bakery has a probability $p$ of demanding a loaf of bread. The quantity of loaves demanded, given the number of customers, $N$, follows a Binomial distribution, $X|N \sim Bin(N;\pi)$. Bob sells loaves at a common price of $p$. At dawn, Bob bakes $k$ loaves at a marginal cost of $c$ per loaf and has overhead costs of $F$ per day. At the end of the day, all loaves not sold are thrown away.</p>
<p><strong>(a) Show that the marginal distribution of the demand for loaves, $X$, is a Poisson distribution, $X\sim P(\theta )$, where $\theta =\pi\lambda$.</strong></p>
<p>I was able to show this. I included this part for completeness, in case one requires it to solve subsequent parts.</p>
<p><strong>(b) Sales, $Y$ , are related to demand, $X$, and the daily supply of loaves, $k$, by the relationship $Y = \text{min{$X,k$}}$. Derive the p.m.f. for $Y$ .</strong></p>
<p>This implies that sales equal demand if demand is less than the quantity of loaves available, i.e. $Y=X$ when $X\le k-1$ (noting that $k$ is integer valued). But for demand greater than $k$, demand cannot be met, hence sales then equal the total supply of loaves, $k$, i.e. $Y = k$ for $X\ge k$.</p>
<p>I don't know how to use this to find a pmf for $Y$.</p>
<p><strong>(c) Obtain an expression for the profit random variable, $\Pi (Y|\theta,k)$, as a function of sales, $ Y$, when Bob bakes $k$ loaves, $k$ is a non-negative integer. Hence derive an expression for expected profit when Bob bakes k loaves.</strong></p>
<p>I believe having the answer to (b) is necessary for solving this part of the question, and all subsequent parts.</p>
<p><strong>(d) Bob hires you to figure out the number of loaves he should bake at dawn? Provide your answer to Bob's question, indicating what his expected profit will be, and write a short report explaining your answer.</strong></p>
<p><strong>To answer the question, assume that Bob is risk neutral and wishes to choose the quantity of loaves to bake to maximise his expected profit, and that $\lambda= 20; \pi= 0.7; p=5; c=2 \text{ and } F =10$.</strong></p>
<p><strong>(e) If Bob adopts your solution for the quantity of loaves to bake, $k$, what is the probability that Bob will sell all his loaves on any given day? What is the probability that Bob will suffer a loss on any given day?</strong></p>
| 0non-cybersec
| Stackexchange |
Algorithm to "de-rasterize" a voxel image of a polyhedron. <p>Rasterizing a polygon in this question consists of creating an array of binary pixels that "represent" the polygon. The reverse of this process is easy to approximate in linear time to the perimeter in pixels. It uses a "detail threshold" D to define how complex the polygon will be. As D decreases, the polygon becomes more detailed.</p>
<p>Keep in mind this is just for polygons and 2D images, not 3D, yet.</p>
<ol>
<li>Remove the inside of the image if there is one, so we have a 1-pixel thick perimeter</li>
<li>Assign an arbitrary "first" pixel as our active pixel, and the first point on our polygon</li>
<li>Iterate in one direction around the image, using each pixel as a "test pixel"</li>
<li>For each test pixel, keep track of the minimum and maximum angle between the active pixel and our test pixels</li>
<li>If the difference between these two angles becomes greater than D*2, create points on the polygon for these two minimum and maximum points</li>
<li>Set the active pixel to whichever of the min/max was second (that is, the furthest clockwise)</li>
<li>From now on, iterate around the image and add another vertex whenever |(angle of previous line segment) - (angle between active/test pixel)| > D. The active pixel becomes the most recently added vertex.</li>
</ol>
<p>This doesn't produce an optimal polygon, but it works. It's the best I could think of, anyway. If you rasterize the result, it would produce something similar to the original image. It could be potentially improved by setting a minimum distance between vertexes.</p>
<p>However, <strong>how could an algorithm like this be extended to 3D</strong>, where the rasterized "image" is 3D/has volume, and we are producing a polyhedron? I'm at a loss as to how to figure this out.</p>
<p>Thanks in advance for the help.</p>
| 0non-cybersec
| Stackexchange |
Adding pictures to a table. <p>I would like to add pictures to that table. How could I do that? </p>
<pre><code>\documentclass[a4paper, 12pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage [french]{babel}
\usepackage{mathptmx}
\begin{document}
\begin{tabular}{|c|c|c|c|c|}
\hline
Titre & Type & Composition & Dimensions & Prix \\
\hline
Title & Peinture & 80 x 120 cm & Acrylique, feutre, fusain & 80 \\
\hline
Title & Sculpture & 80 x 100 cm & 2.3 & 150 \\
\hline
Title & Sculpture & 80 x 100 cm & 2.3 & 150 \\
\hline
\end{tabular}
\end{document}
</code></pre>
| 0non-cybersec
| Stackexchange |
Just pulled a glass shard from my fiancée's toe. It has been in there for 2 mos.. | 0non-cybersec
| Reddit |
I was at Woodstock. AMA!. My son, a redditor, asked me to do this. I was at Woodstock. AMA!
Edit: it is late for an "old timer". I am going to sleep. I will answer more questions tomorrow. I am sure my son will make me do that. | 0non-cybersec
| Reddit |
Second monitor doesn't wake after kernel update in Fedora Core 20. <p>I have an odd problem with my dual monitor setup. The base system is a Dell 6005 desktop with an ATI Radeon card. My primary monitor is an HP 23", while the second monitor is an HP 20". The primary is connected via VGA, while the second is connected via a DisplayPort-to-VGA adaptor.</p>
<p>With kernel 3.14.9-200.fc20.x86_64, everything works fine.</p>
<p>After updating to kernel 3.15.8-200.fc20.x86_64, the second monitor is no longer taken out of standby (sleep) mode.</p>
<p>xrandr reports two monitors and the output is identical for both kernels.</p>
<p>The only difference I see is that I see the following errors in dmesg when running the 3.15 kernel...</p>
<pre><code>[ 1.914501] [drm:radeon_dp_link_train_cr] *ERROR* clock recovery reached max voltage
[ 1.914502] [drm:radeon_dp_link_train_cr] *ERROR* clock recovery failed
</code></pre>
<p>I found one other post that was similar to this, but there was no solution.</p>
<p>Has anyone else seen and solved this, or can anyone give me a place to look further as far as logs/configs are concerned?</p>
| 0non-cybersec
| Stackexchange |
A search path is not honored in macOS 10.14.6 (Mojave). <p>I am running macOS 10.14.6 (Mojave, 18G87)</p>
<p>My default shell is Zsh and $<code>PATH</code> is set in <code>.zshrc</code> as follows;</p>
<pre><code>/usr/local/Caskroom/miniconda/base/bin:/usr/local/Caskroom/miniconda/base/condabin:/usr/local/opt/gcc/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin
</code></pre>
<p>I use Homebrew to manage packages and as you can see brewed gcc and <code>llvm</code> is a front of <code>/usr/bin</code> where Apple's gcc is. However, for some reasons I don't understand, Mojave sees Appple's gcc in <code>/usr/bi</code>, </p>
<pre><code>which gcc
/usr/bin/gcc
</code></pre>
<p>I'd really appreciate any pointers to address this issue. </p>
| 0non-cybersec
| Stackexchange |
Echo GDI Object Count to Command Line or File. <p>I'm ultimately looking for a way to set up an automated alert that will warn me if a process's GDI Object count is approaching the default 10,000 limit. I have a known issue with some software our company uses that causes explorer.exe to have the count build up until it crashes without warning - there's apparently a fix for this in a later version of the software, but we cannot upgrade for reasons beyond my control. My idea is to create a background program/script that will pop up an alert when it sees a GDI count approaching the 10,000 limit. However, the only ways I can seem to view the GDI count is through a GUI either in task manager or Process Explorer - if I could somehow just dump that to a text file automatically I'd be set, but I don't know if that's possible. </p>
<p>I've tried the GDIView software, but our company Antivirus flags it and that is outside my control. </p>
<p>I've downloaded sysinterals, but I can't figure out any way to get one of the command line tools to echo the GDI count I can get in Process Explorer. I've also tried tasklist, but similarly can't find a way to get GDI count out of it. </p>
<p>For reference, I'm on a Windows 10 machine here. I also have the linux subsystem enabled and have the ability to run Ubuntu through that. I am open to doing something in batch or python if that's of any use - though it seems powershell is blocked from running scripts (I might be able to get around that though). </p>
| 0non-cybersec
| Stackexchange |
ZSH not sourcing zprofile. <p>I'm running zsh 5.1.1 on Ubuntu 16.04. It seems that <code>~/.zprofile</code> isn't sourced at login nor new terminal. <code>~/.zshrc</code> is sourced however.</p>
<p>I am running <code>oh-my-zsh</code>.</p>
<p>Any ideas on why this is or how I can fix it?</p>
| 0non-cybersec
| Stackexchange |
Which sections of $T^*M\odot T^*M$ have reproducing kernel "primitives"?. <p>Given a smooth reproducing kernel $\kappa:M\times M\rightarrow \mathbb{R}$ on a manifold $M$, we can construct a section, $\alpha_{\kappa}$, of the symmetric tensor product $T^*M\odot T^*M$ by taking the exterior derivative of $\kappa$ in each of its arguments and then restricting to the diagonal. More precisely, we first construct a section, $\alpha_{M\times M}$, of $T^*M\boxtimes T^*M$ using the formula
\begin{align}
\alpha_{M\times M}(v_1,v_2)=\frac{d}{d\epsilon_1}\bigg|_0\frac{d}{d\epsilon_2}\bigg|_0\kappa(c_1(\epsilon_1),c_2(\epsilon_2)),
\end{align}
where $v_j\in T_{m_j}M$ and $c_j$ is a smooth curve that passes through $m_j$ at $\epsilon_j=0$ with velocity $v_j$. $\alpha_{\kappa}$ is then given by
\begin{align}
\alpha_{\kappa}(v_m,w_m)=\alpha_{M\times M}(v_m,w_m),
\end{align}
where $v_m,w_m\in T_mM$. When a section of $T^*M\odot T^*M$ arises in this manner, I'd like to say that the section has a reproducing kernel primitive.</p>
<p>How can we chracterize the space of sections of $T^*M\odot T^*M$ with reproducing kernel primitives? That is, given an $\alpha\in \Gamma(T^*M\odot T^*M)$, how can we determine if there is some kernel $\kappa$ such that $\alpha=\alpha_{\kappa}$?</p>
<p>One straightforward consequence of the positive-semidefinite property of $\kappa$ is that $\alpha_{\kappa}|_m\in T_m^*M\odot T_m^*M$ must be a positive semi-definite bilinear form for each $m\in M$. Are there any other special properties $\alpha_{\kappa}$ must have? I want to somehow use the fact that $\mathbf{d}^2=0$, but I'm having trouble seeing where I can usefully apply it.</p>
<p>update 4/28: I think that when $M=\mathbb{R}$ every positive semi-definite $\alpha$ has a reproducing kernel primitive. The argument is based on the fact that each $\alpha$ must be of the form $\alpha=a\, dx\,dx$ for some non-negative smooth scalar function $a:M\rightarrow\mathbb{R}$. We can write $\sqrt{a}\,dx=d\phi$, where $\phi(x)=\int_0^x\sqrt{a}(s)\,ds$. A reproducing kernel primitive for $\alpha$ is therefore $\kappa(x,y)=\phi(x)\phi(y)$. Things are easy on $\mathbb{R}$ because, there, all $1$-forms are exact.</p>
| 0non-cybersec
| Stackexchange |
Laughing through the pain. | 0non-cybersec
| Reddit |
analysis sequence induction series. <p>Let $k$ be a positive real number with $k < 1$, and let $f$ be a $k$-contraction. Let
$c\in \mathbb{R}$ be given, and define a sequence $(x_n)n≥1$ by $x_1 = c$ and $x_{n+1} = f(x_n)$.
Set $C = |x_1-x_2 |$. By induction on $n$ prove that $|x_n-x_{n+1}|\leq k^{n-1}C$ for every $n\geq 1$.
Then use the comparison test to show that the series $\sum_{i=1}^∞(x_{i+1}-x_i)$
converges absolutely.</p>
<p>can someone give me a hint or a guide...</p>
| 0non-cybersec
| Stackexchange |
Let’s block a cross walk... and oh.. well then.... | 0non-cybersec
| Reddit |
Microsoft Word - ICQNM Submission Final.doc
Preprint, Proceedings of the Second International Conference on Quantum, Nano, and Micro Technologies (ICQNM 2008),
IEEE Computer Society, pp. 66-71, 2008.
Abstract— Quantum computer programming is emerging as a
new subject domain from multidisciplinary research in quantum
computing, computer science, mathematics (especially quantum
logic, lambda calculi, and linear logic), and engineering attempts
to build the first non-trivial quantum computer. This paper
briefly surveys the history, methods, and proposed tools for
programming quantum computers circa late 2007. It is intended
to provide an extensive but non-exhaustive look at work leading
up to the current state-of-the-art in quantum computer
programming. Further, it is an attempt to analyze the needed
programming tools for quantum programmers, to use this
analysis to predict the direction in which the field is moving, and
to make recommendations for further development of quantum
programming language tools.
Index Terms— quantum computing, functional programming,
imperative programming, linear logic, lambda calculus
I. INTRODUCTION
HE importance of quantum computing has increased
significantly in recent years due to the realization that we
are rapidly approaching fundamental limits in shrinking the
size of silicon-based integrated circuits (a trend over the past
several decades successfully described by Moore’s Law).
This means that as we attempt to make integrated circuit
components ever smaller (e.g. below 25nm in feature sizes),
we will increasingly encounter quantum mechanical effects
that interfere with the classical operation of the circuits.
Quantum computing offers a path forward that specifically
takes advantage of quantum mechanical properties, such as
superposition and entanglement, to achieve computational
solutions to certain problems in less time (fewer
computational cycles) than is possible using classical
computing paradigms. Certain problems have been shown to
be solvable exponentially faster on a quantum computer than
has been achieved on a classical computer [1]. Furthermore,
quantum parallelism allows certain functions that have thus far
proven to be computationally intractable using classical
computation to be executed in reasonable time (e.g. factoring
large numbers using Shor’s algorithm). Quantum algorithms
may contain both classical and quantum components (as does
Shor’s algorithm), and can thus leverage the benefits of each.
Manuscript received September 12, 2007. This work was supported by the
Naval Research Laboratory under NRL Work Order N0001406WX30002.
Donald A. Sofge is with the Navy Center for Applied Research in
Artificial Intelligence, Naval Research Laboratory, Washington D.C. (phone:
202-404-4944; fax: 202-767-2166; e-mail: [email protected]).
However, existing classical (non-quantum) programming
languages lack both the data structures and the operators
necessary to easily represent and manipulate quantum data.
Quantum computing possesses certain characteristics that
distinguish it from classical computing such as the
superposition of quantum bits, entanglement, destructive
measurement, and the no-cloning theorem. These differences
must be thoroughly understood and even exploited in the
context of quantum programming if we are to truly realize the
potential of quantum computing. We need native quantum
computer programming languages that embrace the
fundamental aspects of quantum computing, rather than
forcing us to adapt and use classical programming languages
and techniques as ill-fitting stand-ins to develop quantum
computer algorithms and simulations. Ultimately, a
successful quantum programming language will facilitate
easier coding of new quantum algorithms to perform useful
tasks, allow or provide a capability for simulation of quantum
algorithms, and facilitate the execution of quantum program
code on quantum computer hardware.
II. ORIGINS AND HISTORY OF QUANTUM COMPUTING
Prior surveys of quantum computing and quantum
programming [2], [3] trace the origins of quantum computing
and quantum programming to Feynman’s 1982 proposal for
constructing a quantum computer as a means of simulating
other quantum systems, noting that a quantum computer may
efficiently simulate a quantum system, whereas a classical
computer simulation of a quantum system would require
exponential resources both in memory space and
computational time [4]. Preskill credits Paul Benioff [5] with
making this proposal concomitantly with Feynman. However,
the roots of quantum programming go far deeper than this,
through the field of quantum information theory, in the work
of Birkhoff and von Neumann on quantum logic in 1936 [6].
This work also formed the basis for quantum mechanics as it
is currently practiced today.
Deutsch [7] investigated the computational power of
quantum computers and proposed a quantum version of the
Turing machine. He proposed one of the earliest quantum
algorithms as a means of demonstrating the solution of a
problem that would be difficult to solve using a classical
computer yet would be quite easy to solve using a quantum
algorithm.
A Survey of Quantum Programming Languages:
History, Methods, and Tools
Donald A. Sofge, Member, IEEE
T
Preprint, Proceedings of the Second International Conference on Quantum, Nano, and Micro Technologies (ICQNM 2008),
IEEE Computer Society, pp. 66-71, 2008.
The difficulty of solving certain problems using computers
is often characterized by analogy with hypothetical Turing
machine based solutions [8]. Alan Turing showed that the
capability of any general purpose computer could be simulated
with a Turing machine. By studying the time (#
computational cycles) and space (memory requirement)
complexity of problems, we can classify problems according
to their Turing complexity (e.g. deterministic polynomial (P),
non-deterministic polynomial (NP), exponential (EXP)). The
Deutsch-Jozsa algorithm [1] was designed in 1992 to
maximally illustrate the computational advantage of quantum
computing over classical computing. The algorithm
determines a property of a binary input string (either constant
or balanced) in a single step, whereas determining this
property on a classical computer grows exponentially in
computational complexity with the length of the bit string.
Unfortunately, this result has not yet resulted in the creation of
any particularly useful quantum algorithms for typical data
processing needs.
Since that time, substantial effort has been made to
characterize the complexity of problems using quantum
Turing machine models versus classical Turing machine
models. While there is still some question regarding certain
complexity equivalence classes (e.g. does BQP=NP?), there is
widespread agreement amongst researchers in this area that
quantum computing has not yet been proved to generally
move problems from one complexity class under classical
computing to a lower complexity class under quantum
computing [9]. However, this does not mean that nontrivial
quantum computers once built will not allow substantial
computational gains for solving certain problems over
currently known techniques using classical computers. An
important thread in quantum computing research is to define
problem classes and applications that result in significant
speed-ups using quantum instead of classical computers.
The invention of linear logic by Girard in 1987 [10] has also
played a significant role in the formulation of recent quantum
programming languages, specifically those based upon lambda
calculus (described in section III.b). Linear logic differs from
classical logic in that assumptions (states, or inputs) and
hypotheses are considered resources that may be consumed. It
provides a means for resource control. Linear logic differs
from usual logics such as classical or intuitionistic logic where
the governing judgement is of truth, which may be freely used
as many times as necessary.
For example, suppose A represents water, B represents cold
(or a freezing process), and C represents ice. Then A B
C. But after the process is applied, resource A is consumed
and is no longer available. Research in using linear logic is
still quite active, and linear logic is important element to many
current quantum programming language development efforts.
The first practical steps toward formulating a quantum
programming language were made by Knill in 1996 in his
proposal for conventions for a quantum pseudocode [11], and
his description of the quantum random access machine
(QRAM) model of a quantum computer. The QRAM model is
built upon the (probably accurate) assumption that any
practical quantum computer will in fact be a classical machine
with access to quantum computing components, such as qubit
registers. QRAM defines a set of specific operations to be
performed on computer hardware including preparation of
quantum states (from classical states), certain unitary
operations, and measurement. Knill’s quantum pseudocode
provides a syntax for describing qubits, qubit registers, and
operations involving both classical and quantum information.
While extremely useful, Knill’s proposal falls short of
possessing all of the needed characteristics of a real quantum
programming language due to its informal structure, lack of
strong typing, and representation of only some of the quantum
mechanical properties needed.
A variety of tools have been created for simulating quantum
circuits and modest quantum algorithms on classical
computers using well-known languages such as C, C++, Java,
and rapid prototyping languages such as Maple, Mathematica,
and Matlab. A good on-line reference for these simulators is
http://www.quantiki.org/wiki/index.php/List_of_QC_simulators
While simulators may provide an excellent means for
quickly learning some of the basics concepts of quantum
computing, they are not substitutes for actual quantum
programming languages since they are designed to run only on
classical computer architectures, and will not realize any of
the computational advantages of quantum computing.
III. A TAXONOMY OF QUANTUM PROGRAMMING LANGUAGES
Quantum programming languages may be taxonomically
divided into (A) imperative quantum programming languages,
(B) functional quantum programming languages, and (C)
others (may include mathematical formalisms not intended for
computer execution). In addition, Glendinning [12] maintains
an online catalog of quantum programming languages,
simulation systems, and other tools. Finally, a slightly more
dated but at the time quite comprehensive and still useful
survey of quantum computer simulators was provided by Julia
Wallace in 1999 [13].
Early quantum programming language development efforts
focused on exploring the Quantum Turing Machine (QTM)
model as proposed by Deutsch [7]. While interesting and
informative from the standpoint of understanding
computational complexity of problem classes with respect to
quantum computing, it did not result in practical tools for
programming quantum computers.
The quantum circuit model quickly became the driving
force in quantum programming. The Deutsch-Jozsa algorithm,
Quantum Fourier Transform, Shor’s factoring algorithm, and
Grover’s algorithm were all described using the quantum
circuit model [8]. In order to build this into a language
(instead of just designing circuits), Knill [11] proposed a
quantum programming pseudocode that, along with adapted
imperative programming languages such as C and C++,
resulted in the first imperative quantum programming
languages (e.g., QCL). These languages built upon the
QRAM model of quantum computation, assumed classical
flow control with both classical and quantum data, and
allowed interleaved measurements and quantum operations.
Preprint, Proceedings of the Second International Conference on Quantum, Nano, and Micro Technologies (ICQNM 2008),
IEEE Computer Society, pp. 66-71, 2008.
The use of imperative quantum programming languages
gave way to a multitude of functional quantum programming
languages such as QFC, QPL, and QML (described below),
mostly based upon the QRAM model, but also increasingly
utilizing the work in mathematical logic to define better
operational semantics for quantum computing, and also
including the tool of linear logic discussed previously.
A. Imperative Programming Languages
Imperative programming languages, also known as procedural
languages, are fundamentally built upon the use of statements
to change the global state of a program or system of variables.
Common classical imperative languages include FORTRAN,
Pascal, C, and Java. These may be contrasted with functional
(or declarative) languages such as Lisp, APL, Haskell, J, and
Scheme, in which computation is based upon the execution of
mathematical functions.
Imperative quantum programming languages today are
largely descendents of Knill’s proposed quantum pseudocode
and the QRAM model of quantum computing. Arguably the
first “real” quantum programming language [2] was QCL,
developed and refined from 1998-2003 by Bernhard Ömer
[14]-[18]. QCL (Quantum Computation Language) utilizes a
syntax derived from C, and also provides a full quantum
simulator for code development and testing on a classical
computing platform. In support of the classical+quantum
model of computation as envisioned with the QRAM virtual
hardware model, QCL also provides a full classical
programming sublanguage. High-level quantum programming
features include automatic memory management, user defined
operators and functions, and computation of the inverse of a
user defined operator. QCL may be downloaded from the web
at http://tph.tuwien.ac.at/~oemer/qcl.html
Betelli et al. [19] devised an imperative language based
upon C++. The language was created in the form of a C++
library, and thus can be compiled. It is also maintained as a
downloadable source code through http://sra.itc.it/people/
serafini/qlang/
Important features of this language include construction and
optimization of quantum operators at run-time, classes for
basic quantum operations like QHadamard, QFourier, QNot,
QSwap, and Qop. The language also supports user definition
and construction of new operators. Another important feature
offered by this language is simulation of the noise parameters
in the simulator.
This language is occasionally called Q Language by the
authors, but another perhaps more prominent functional
language exists with the same name, (for which the Q stands
for eQuation), thus use of this name should probably be
avoided in at least one of the two contexts.
Another imperative quantum programming language, called
qGCL (quantum Guarded Command Language), was proposed
by Sanders & Zuliani [20] as a derivative of Dijkstra’s
guarded command language, intended more for algorithm
derivation and verification rather than programming.
Most recently (October 2007) Mlnarik [21] introduced the
imperative quantum programming language LanQ which uses
C-like syntax and supports both classical and quantum process
operations, including process creation and interprocess
communication. Mlnarik provides full formalized syntax for
the language, operational semantics, proves type soundness
(eliminating type errors) for the non-communicating part of
the language, and can be used for proving correctness of
implemented quantum algorithms. The author also provides a
publicly accessible simulator for LanQ at
http://lanq.sorceforge.net/
B. Functional Quantum Programming Languages
Functional (or declarative) programming languages do not
rely upon the update of a global system state, but instead
perform mathematical transformations by executing mappings
from inputs to outputs. Most recent developments in quantum
programming have focused on the use of functional rather than
imperative languages. The languages in this category are
based upon the concept of a lambda calculus. Lambda calculi
are constructions from mathematical logic used to investigate
the properties of functions, such as computability, recursion,
and stopping.
Lambda calculi may be considered the smallest universal
programming languages. They consist of a single
transformation rule (variable substitution) and a single
function definition scheme. They are universal in the sense
that any computable function can be expressed and evaluated
using this formalism. It is thus equivalent to the Turing
machine formalism. However, lambda calculi emphasize the
use of transformation rules, and do not care about the actual
machine implementing them.
Lambda calculi were first proposed by Alonzo Church and
Stephen Cole Kleene in the 1930s, and used by Church in
1936 [22], [23] to address the decision problem
(entscheidungs-problem) challenge proposed by David
Hilbert. Lambda calculi can be used to define what a
computable function is. The question of whether two lambda
calculus expressions are equivalent cannot be solved by a
general algorithm. This was the first question, even before the
halting problem, for which undecidability could be proved.
Since their invention, lambda calculi have greatly influenced
classical functional programming languages such as Lisp, ML
and Haskell.
In 1996 Maymin [24] proposed a quantum lambda calculus
to investigate the Turing computability of quantum
algorithms. While Maymin’s lambda calculus was found to
efficiently solve NP-complete problems, it was unfortunately
found to be more expressive than any physically realizable
quantum computer [25].
In 2004 van Tonder [26] defined a quantum lambda
calculus for pure quantum computation (no measurements take
place), analyzed the non-duplicability of quantum states
through use of linear logic, and argued that the language has
the same equivalent computational capabilities as a quantum
Turing machine. Quantum algorithms are implemented in a
quantum simulator built upon the Scheme programming
language.
Also in 2004 Selinger [27] proposed a functional quantum
programming language called QFC (Quantum Flow Charts)
which represents programs via functional flow charts, and an
equivalent form which utilizes textual syntax called QPL
(Quantum Programming Language). These languages rely
Preprint, Proceedings of the Second International Conference on Quantum, Nano, and Micro Technologies (ICQNM 2008),
IEEE Computer Society, pp. 66-71, 2008.
upon the notion of using classical control and quantum data,
and build upon a lambda calculus model to handle both
classical and quantum data within the same formalism. These
languages may be compiled using the QRAM virtual quantum
computer model. However, they still lack many desirable
aspects including higher-order features and side-effects.
In 2004 Danos [28] studied a one-way (non-reversible)
model of quantum computation that included notation for
entanglement, measurement, and local corrections.
In 2005 Perdrix [29] defined a type system that reflects
entanglement of quantum states. This too was based upon a
lambda calculus. Altenkirch and Grattage [30], [31] developed
a functional quantum programming language called QML in
which control as well as data may be quantum. QML is based
upon a linear logic [10] (described previously in Section II),
but focuses on the elimination of weakening (discarding a
quantum state) instead of contraction (duplication of quantum
state). Several researchers have proposed domain-specific
functional quantum programming languages implemented in
Haskell, following in the style of Selinger’s QPL, using linear
logic and lambda calculi, and building upon the 2001 work of
Mu and Bird [32] in which quantum programming is modeled
in Haskell through definition of a data type for quantum
registers. Sabry [33] extended this model to include
representation of entangled states. Other related efforts in this
vein include the work of Vizzotta and da Rocha Costa [34],
Karczmarczuk [35], and Skibinski [36].
C. Other Quantum Programming Language Paradigms
A substantially different approach to quantum programming
was offered by Freedman, Kitaev, and Wong [37] based upon
the simulation of topological quantum field theories (TQFT’s)
by quantum computers. TQFT’s provide a more robust
model of quantum computation by representing quantum
states as physical systems resistant to perturbations. Quantum
operations are determined by global topological properties,
such as paths that particles follow. This radically different
approach to quantum computing may provide new insights
and lead to the creation of new types of quantum algorithms.
However, as currently formulated it only deals with evolution
of state and does not include a measurement process.
A number of efforts have been made in recent years to
define languages to support quantum cryptographic protocols,
and specifically focus on the inclusion of communication
between quantum processes. Such processes may be local or
nonlocal, thus giving rise to distributed quantum programming
specifications. A prime example of this is Mauerer’s [38]
specification of the cQPL language, based upon Selinger’s
QPL, but with extensions added to support communication
between distributed processes.
Another thread of development has focused on the use of
quantum process algebras, such as QPAlg (quantum process
algebra) by Jorrand and Lalire [39] to describe interactions
between classical and quantum processes. Gay and Nagarajan
[40] define the language CQP (communicating quantum
processes) for modeling systems combining classical and
quantum communication, with particular emphasis on
applications such as quantum cryptography. CQP is designed
specifically to provide complete protocol analysis, prove type
soundness, and lead to methods for formal verification of
systems modeled in the language. Both QPAlg and CQP
influenced the design of the imperative programming language
LanQ described previously.
Adão and Mateus [41] give a process calculus for security
protocols built upon the QRAM computational model with an
added cost model. Udrescu et al. [42] describe a hardware
description language for designing quantum circuits similar to
those used for VLSI design.
The use of Girard’s linear logic and lambda calculus has
spurred a considerable amount of recent work in the
formulation of mathematical formalisms for quantum
computing that include such semantic features as
entanglement, communication, teleportation, partial and mixed
quantum states, and destructive measurement. While exciting
and worthwhile, these formalisms generally fall short of
actually specifying specific programming languages with full
syntax, well defined operators, and simulators and compilers
needed to implement Shor’s or Grover’s algorithms or to
create and test new quantum algorithms. These efforts do help
to address shortcomings in quantum theory itself as discussed
in the next section.
IV. CHALLENGES IN QUANTUM PROGRAMMING LANGUAGE
DEVELOPMENT
The difficulties in formulating useful, effective, and in some
sense universally capable quantum programming languages
arise from several root causes. First, quantum mechanics itself
(and by extension quantum information theory) is incomplete.
Specifically missing is a theory of measurement. Quantum
theory is quite successful in describing the evolution of
quantum states, and even in predicting probabilistic outcomes
after measurements have been made, but the process of state
collapse is (with a few exceptional cases) not covered. So
issues such as decoherence, diffusion, entanglement between
particles (or entangled state, of whatever physical
instantiation), and communication (including teleportation) are
not well defined from a quantum information (and by
extension quantum computation) perspective. Work with
semantic formalisms and linear logic attempt to redress this by
providing a firmer basis in a more complete logic consistent
with quantum mechanics. These logic-based formalisms
(once validated) may then be combined with language syntax
and other programming language features to more accurately
and completely reflect the potential capabilities of quantum
computing.
A second key source of difficulty is the lack of quantum
computing hardware for running quantum algorithms. Given
no specific set of quantum operations (e.g. specific quantum
gates, ways that qubits are placed in superposition or
entangled), then no guidance is available to computer
scientists designing quantum programming languages as to
what data structures should be implemented, what types of
operations to allow, what features to disallow (such as abiding
Preprint, Proceedings of the Second International Conference on Quantum, Nano, and Micro Technologies (ICQNM 2008),
IEEE Computer Society, pp. 66-71, 2008.
by the no-cloning theorem), and how to best design the
language to do what quantum computing does best (e.g., is an
imperative language like C or Java a better place to start, or a
functional language like LISP or APL?). A third source of
difficulty is the paucity of practical applications for quantum
computing. Shor’s algorithm generated tremendous
excitement over the potential of quantum computing in large
part because most educated individuals could immediately
recognize the value of the contribution, at least in the context
of code breaking. Grover’s algorithm also provides a speed-
up over classical computation for a specific class of problems
(searching unsorted lists), from O(N) to O(N1/2), which is still
quite impressive, especially for large N. Shor’s algorithm is
capable of achieving its impressive speedup by exploiting the
structure of the problem in the quantum domain, recasting the
factoring problem as a period-finding problem which may
then be solved in parallel. Grover’s algorithm is arguably
more general, and variants of Grover’s algorithm have been
proposed for a variety of problems [43], [44].
Finally, there is much on-going research to understand the
quantum physics behind quantum information, and by
extension quantum computing. We have previously discussed
several quantum computing conceptual models including
QRAM, the quantum Turing machine, and the quantum circuit
model. However, recent work by in the area of adiabatic
quantum computing by Dorit Aharonov [45] and weak
measurements by Jeff Tollaksen [46] and Yakir Aharonov
[47] arguably falls under none of these categories, yet these
methods represent potentially exciting new directions for
realizing quantum computing. But this wealth of models also
serves to further complicate the process of establishing a set of
practical tools for writing quantum programs, namely quantum
programming languages.
V. A PATH FORWARD FOR QUANTUM PROGRAMMING
LANGUAGE DEVELOPMENT
Julia Wallace [13] in her quite thorough survey of quantum
simulators notes that most of the simulators and even some of
the languages developed could only really implement one
algorithm, usually Shor’s (some could do Grover’s as well,
and some could do more). Selinger [2] comments “each new
algorithm seems to rely on a unique set of ‘tricks’ to achieve
its goal”. The hope, of course, is that one can take a set of
known quantum algorithms, such as Shor’s, Grover’s,
Deutsch-Jozsa, and a few others, and from this set to grow a
methodology for quantum programming, or at least generate a
few new useful quantum algorithms. Unfortunately, this set of
examples is too small and specialized to grow a methodology
for quantum programming, and generating useful new
quantum algorithms has proven quite difficult.
The work in operational semantics, lambda calculi, and
linear logic (described above) and the inclusion of a complete
programming grammar and syntax will undoubtedly yield
multiple powerful languages for developing quantum
algorithms. These languages will probably be of the
functional class, but they may take other forms as well.
However, the question of what sorts of quantum programs will
be written and what applications they will address is still open,
and the answer to this question will serve as a major driving
factor in shaping the quantum programming languages to
come. This is supported analogically by comparison with the
numerous application domains for classical computing and the
even larger number of classical programming languages
created to develop products from them in the form of
application programs.
Perhaps the greatest potential for useful computational gains
of quantum computing over classical computing may be found
with the class of problems known hidden subgroup problems
[48], [49]. The factoring problem that Shor’s algorithm
addresses, as reformulated by Shor, falls within this class.
One strategy, then, would be to try to understand which
problems may be mapped into the hidden subgroup problem
class, and then investigate those problems for development of
quantum algorithms to address them.
Finally, the realization of quantum computing hardware will
significantly drive the design of quantum language operators
and data structures for quantum programs to be run on that
hardware. We can already make some guesses about early
hardware (e.g. superposition of a small number of locally
contiguous qubits, preparation of states using Hadamard gates,
rapid decoherence of quantum states). But if qubits are
represented by photons, such guesses may very well be wrong.
When considering the need for quantum algorithms, and
asking what kinds of quantum algorithms are needed, it is
useful to think of a (classical) programmer as possessing a
toolbox filled with a rich diversity of tools (algorithms) from
which he/she can construct solutions (new programs) to client
problems. From this basis we can proceed cautiously to
design small but interesting quantum algorithms, gradually
expanding the universe of basic quantum functions and
capabilities to put into our quantum programming toolbox.
REFERENCES
[1] D. Deutsch and R. Jozsa, “Rapid solutions of problems by quantum
computation,” in Proceedings of the Royal Society of London, Series A,
vol. 439, pp. 553-558, 1992.
[2] P. Selinger, “A brief survey of quantum programming languages,” in
Proceedings of the 7th International Symposium on Functional and
Logic Programming, volume 2998 of Lecture Notes in Computer
Science, Springer, 2004.
[3] S. Gay, “Quantum Programming Languages: Survey and Bibliography,”
in Mathematical Structures in Computer Science, 16(4), Cambridge
University Press, 2006.
[4] R. Feynman, “Simulating physics with computers,” in International
Journal of Theoretical Physics 21(6–7), pp. 467–488, 1982.
[5] J. Preskill, “Lecture notes for physics 219: Quantum information and
computation,” 1998. Available from http://www.theory.caltech.edu
/people/preskill/ph219
[6] G. Birkhoff and J. von Neumann, “The Logic of Quantum Mechanics,”
Annals of Mathematics, Vol. 37, pp. 823-843, 1936.
[7] D. Deutsch, “Quantum theory, the Church-Turing principle and the
universal quantum computer,” in Proceedings of the Royal Society of
London A 400, pp. 97–117, 1985.
Preprint, Proceedings of the Second International Conference on Quantum, Nano, and Micro Technologies (ICQNM 2008),
IEEE Computer Society, pp. 66-71, 2008.
[8] M. Nielsen and I. Chuang, Quantum Computation and Quantum
Information, Cambridge University Press, 2000.
[9] A. Kitaev, A. Shen, and M. Vyalyi, Classical and Quantum
Computation, Number 47 in Graduate Series in Mathematics, AMS,
Providence, RI, 2002.
[10] J. Girard, “Linear logic,” Theoretical Computer Science, 50:1-102,
Elsevier Science Publishers Ltd., 1987.
[11] E. Knill, “Conventions for quantum pseudocode,” Technical Report
LAUR-96-2724, Los Alamos National Laboratory, 1996.
[12] I. Glendinning, “Quantum programming languages and tools,”
http:// www.vcpc.univie.ac.at/ian/hotlist/qc/programming.shtml
[13] J. Wallace, “Quantum Computer Simulation - A Review; ver. 2.1,”
University of Exeter Technical Report, 1999. See also the web site
http://www.dcs.ex.ac.uk/~jwallace/simtable.html, 2002.
[14] B. Ömer, “A Procedural Formalism for Quantum Computing,” Master’s
Thesis, Department of Theoretical Physics, Tech. Univ. of Vienna, 1998.
[15] B. Ömer, “Quantum Programming in QCL,” Master’s Thesis, Institute
of Information Systems, Technical University of Vienna, 2000.
[16] B. Ömer, “Procedural quantum programming,” in Proceedings of the
AIP Conference on Computing Anticipatory Systems, American Institute
of Physics, 2001.
[17] B. Ömer, “Classical concepts in quantum programming,” arXiv:quant-
ph/0211100, 2002.
[18] B. Ömer, “Structured Quantum Programming,” Ph.D. thesis, Technical
University of Vienna, 2003.
[19] S. Bettelli, T. Calarco, and L. Serafini, “Toward an architecture for
quantum programming,” in The European Physical Journal D 25, pp.
181–200, EDP Sciences/Springer, 2003.
[20] J. Sanders P. and Zuliani, “Quantum programming,” in Mathematics of
Program Construction, volume 1837, LNCS, Springer, 2000.
[21] H. Mlnarik, “Operational Semantics and Type Soundness of Quantum
Programming Language LanQ,” arXiv:quant-ph/0708.0890v1, 2007.
[22] A. Church, “An unsolvable problem of elementary number theory,” in
American Journal of Mathematics, 58, pp. 345–363, 1936.
[23] A. Church, “A note on the Entscheidungsproblem,” in Journal of
Symbolic Logic, 1, pp. 40–41, 1936.
[24] P. Maymin, “Extending the lambda calculus to express randomized and
quantumized algorithms,” arXiv:quant-ph/9612052, 1996.
[25] P. Maymin, “The lambda-q calculus can efficiently simulate quantum
computers,” arXiv:quant-ph/9702057, 1997.
[26] A. van Tonder, “A lambda calculus for quantum computation, in SIAM
Journal on Computing 33(5), pp. 1109–1135, 2004. Also arXiv:quant-
ph/0307150.
[27] P. Selinger, “Towards a quantum programming language,” in
Mathematical Structures in Computer Science 14(4), pp. 527–586,
Cambridge University Press, 2004.
[28] V. Danos, E. Kashefi, and P. Panangaden, “Parsimonious and robust
realizations of unitary maps in the one-way model,” in Physical Review
A 72(064301), The American Physical Society, 2005. Also arXiv:quant-
ph/0411071.
[29] S. Perdrix, “Quantum patterns and types for entanglement and
separability,” in Proceedings of the 3rd International Workshop on
Quantum Programming Languages, Electronic Notes in Theoretical
Computer Science, Elsevier Science, 2005.
[30] T. Altenkirch and J. Grattage, “A functional quantum programming
language,” in Proceedings of the 20th Annual IEEE Symposium on
Logic in Computer Science, IEEE Computer Society, 2005.
[31] T. Altenkirch and J. Grattage, “QML: Quantum data and control,”
manuscript, 2005.
[32] S. Mu and R. Bird, “Functional quantum programming,” in Proceedings
of the 2nd Asian Workshop on Programming Languages and Systems,
Korea Advanced Institute of Science and Technology, 2001.
[33] A. Sabry, “Modelling quantum computing in Haskell,” in Proceedings
of the ACM SIGPLAN Workshop on Haskell, ACM Press, 2003.
[34] J. Vizzotto and A. da Rocha Costa, “Concurrent quantum programming
in Haskell,” in VII Congresso Brasileiro de Redes Neurais, Sessão de
Computação Quântica, 2005.
[35] J. Karczmarczuk, “Structure and interpretation of quantum mechanics —
a functional framework,” in Proceedings of the ACM SIGPLAN
Workshop on Haskell, ACM Press, 2003.
[36] J. Skibinski, “Haskell simulator of quantum computer,” 2001.
Available from http://web.archive.org/web/20010520121707/
www.numeric-quest.com/haskell.
[37] M. Freedman, A. Kitaev, and Z. Wong, “Simulation of topological field
theories by quantum computers,” arXiv:quant-ph/0001071/v3, 2000.
[38] W. Mauerer, “Semantics and Simulation of Communication in Quantum
Computing,” Master’s Thesis, University Erlangen-Nuremberg, 2005.
[39] P. Jorrand and M. Lalire, "From Quantum Physics to Programming
Languages: A Process Algebraic Approach," Unconventional
Programming Paradigms, LNCS Series, Vol. 3566, Springer, 2005.
[40] S. Gay and R. Nagarajan, "Communicating quantum processes," in
Proceedings of the 32nd ACM Annual Symposium on Principles of
Programming Languages, pp. 145-157, ACM Press, 2005.
[41] P. Adão and P. Mateus, “A process algebra for reasoning about quantum
security,” in Proceedings of the 3rd International Workshop on
Quantum Programming Languages, Electronic Notes in Theoretical
Computer Science, Elsevier Science, 2005.
[42] M. Udrescu, L. Prodan, and M. Vlâdutiu, “Using HDLs for describing
quantum circuits: a framework for efficient quantum algorithm
simulation,” in Proceedings of the 1st ACM Conference on Computing
Frontiers, ACM Press, 2004.
[43] M. Lanzagorta, R. Gomez, and J. Uhlmann, “Quantum Rendering,” in
Proceedings of SPIE Vol. 5105, Quantum Information and Computation,
E. Donkor, A. Pirich, H. Brandt (Eds.), SPIE Press, 2003.
[44] M. Lanzagorta and J. Uhlmann, “Quantum Computational Geometry,”
In Proceedings of SPIE Vol. 5436, Quantum Information and
Computation II, E. Donkor, A. Pirich, H. Brandt (Eds.), SPIE, 2004.
[45] D. Aharonov, W. van Dam, J. Kempe, Z. Landau, S. Lloyd, and O.
Regev, "Adiabatic Quantum Computation is Equivalent to Standard
Quantum Computation," arXiv:quant-ph/0405098, 2006.
[46] J. Tollaksen and D. Ghoshal, “NP Problems, Post-selection and Weak
Measurements,” in Proceedings SPIE, Defense and Security Conference,
Florida, SPIE Press, 2006.
[47] Y. Aharonov and D. Rohrlich, Quantum paradoxes: quantum theory for
the perplexed, Wiley-VCH, 2005.
[48] A. Kitaev, "Quantum measurements and the Abelian Stabilizer
Problem," quant-ph/9511026, 1995.
[49] S. Lomonaco (Jr.) and L. H. Kauffman, “Quantum Hidden Subgroup
Algorithms: A Mathematical Perspective,” AMS CONM/305, pp. 139-
202, 2002. Also arXiv:quant-ph/0201095.
| 0non-cybersec
| arXiv |
When Patrick even catches on, you know there's something wrong.. | 0non-cybersec
| Reddit |
When there is no pump lock. | 0non-cybersec
| Reddit |
mp3 quality bad when running on virtualbox. <p>Mp3 files do not sound good when I use mplayer in ubuntu 12.04. I am running ubuntu on a imac in virtualbox. The bigger mp3 files have a lower sound quality than the smaller mp3 files I listen to. I've noticed that it seems like the number of tabs in firefox that are open seems to have an affect but not all the time. The mp3 will sound fine for a while then for a couple of seconds it will sound scratchy and then a couple of seconds later it sounds fine.</p>
<p>Has anyone else had a problem like this or have any ideas how to stop the audio quality from dropping in and out.</p>
| 0non-cybersec
| Stackexchange |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.