What did Dostoyevski mean with his character saying "Without God and the afterlife, all things are allowed"?

Question: Is Dostoyevski making a socially consequential statement--or warning--about a society that turns its back on God?  If so, did Russia, his homeland, pay any attention to him?
Answer: No Dostoevsky's character said that. Nor did they say "If there is no God, then everything is permitted", which is Sartre's surmise of Karamazov Brothers that became a meme, see Zizek and Cortesi. What Dmitri asks Rakitin in Brothers Karamazov is:"without God and immortal life? All things are permitted then, they can do what they like?" Arguably, the quip describes the sentiment  of Dmitry's "immoral" brother Ivan, who does utter:"If there is no immortality, there is no virtue". While attempting to live by the implication, Ivan admits to Alyosha that he does believe in God after all, and accepts the price of his transgressions.
The idea is that without a promise of ultimate reward, or fear of ultimate retribution, without God as the law-giver and sin-punisher, men are released from any motivation to observe their moral obligations, or even to justify those obligations in the first place. Such is Ivan's initial logic, anyway. The message, as interpreted by moral conservatives, like the Russian philosopher Berdyayev, was that Godlessness is inhumane and destructive, and they saw Dostoevsky as forewarning the atrocities of communism that eventually triumphed in Russia, see Kiskaddon, Dostoyevsky and the Problem of God. This is the message that continues to make the quip so popular among conservatives criticizing the moral corruption of modern societies.
However, as both Berdyaev and Zizek noted, Dostoevsky's message is far more nuanced than exposing Ivan's philosophy as self-destructive (although he is more definitive when depicting another all-permitter, Stavrogin, in Demons):

"Furthermore, when Dostoyevsky proposes a line of thought, along the lines of "If there is no God, then everything is permitted," he is in no way simply warning against limitless freedom - that is, evoking God as the agency of a transcendent prohibition which limits human freedom: in a society run by the Inquisition, everything is definitely not permitted, since God is here operative as a higher power constraining our freedom, not as the source of freedom. The whole point of the parable of the Great Inquisitor is precisely that such a society obliterates the very message of Christ: if Christ were to return to this society, he would have been burned as a deadly threat to public order and happiness, since he brought to the people the gift (which turns out to be a heavy burden) of freedom and responsibility."

For Sartre, his interpretation of Ivan's realization was the entry point to existentialism. Morality grounded in rewards or fear is a false morality unworthy of men (in this, existentialists agree with the "slave morality"'s nemesis, Nietzsche). The men must instead seize their freedom, forge their own morality and take the responsibility for it. Here is from Sartre's Existentialism Is a Humanism:

"The existentialist... finds it extremely embarrassing that God does not exist, for there disappears with Him all possibility of finding values in an intelligible heaven. There can no longer be any good a priori, since there is no infinite and perfect consciousness to think it. It is nowhere written that "the good" exists, that one must be honest or must not lie, since we are now upon the plane where there are only men.

Dostoevsky once wrote: 'If God did not exist, everything would be permitted'; and that, for existentialism, is the starting point. Everything is indeed permitted if God does not exist, and man is in consequence forlorn, for he cannot find anything to depend upon either within or outside himself. [...] Nor, on the other hand, if God does not exist, are we provided with any values or commands that could legitimise our behaviour. Thus we have neither behind us, nor before us in a luminous realm of values, any means of justification or excuse. – We are left alone, without excuse. That is what I mean when I say that man is condemned to be free."
Comment: "Condemned to be free" is a really deep expression. So much condensed in so few words.
Answer: "If God does not exist, anything is permissible" was uttered by Ivan in 'Brothers Karamazov'.
Dostoyevsky is a controversial author, and he saw western Europe as a civilization of nihilism, atheism and spiritual death (Oswald Spengler largely agreed with this, and he discusses Dostoyevsky quite a lot in his masterpiece 'Decline of the West'), and Ivan Karamazov is a typical European intellectual.
"did Russia, his homeland, pay any attention to him?". Yes they did, and as you know he is extremely influential in the west as well as in Russia. In 19th century Russia, there was a big philosophical argument between "zapadniki" (pro westerners, and Ivan Karamazov is also in this camp) and "slavophiles" (proponents of the idea that Russia is a unique civilization distinct from the west), and Dostoyevsky was in the latter camp.
Answer:
What did Dostoyevski mean with his character saying "Without God and the afterlife, all things are allowed"?

He is saying that the only reason people behave morally and follow the Ten Commandments is based on a simple reward/punishment system. Obey God and be rewarded. Disobey God and you will be punished. Without this incentive, people will do whatever they want.
Any system that provides this incentive can enforce moral behavior whether the incentive is supernatural or secular.
Answer: I don't think that all written here is relevant to Dostoevsky, it looks like no here one didn't read him. And all proofs are same. Zizek, Sartre, that woman... About the problem to live without faith in immortal "soul" and "God" Dostoevsky minding in several several works, atleast in "Подросток", "Братья Карамазовы", "Бесы". But to understand what did Dostoevsky you should to understand main distinction Between Orthodox and the West( Catholic, Protestant) ethic.
What happened in "BK"**, main question is: who killed old immoral father Feodor Karamazov, who is the murderer? Dmitriy have a motive to kill, he need money to realize his passion to Grushenka; Ivan was close to atheistic thoughts, he haven't any moral, he is ammoral and he is smart, he hate the father, because he was not fathering to sons, Feodor is just biological father to his sons, he didn't care about anyone, except maybe Alesha, and Ivan looks at his father as totally useless, harmful and bad human. Also Ivan said to Alesha, that he murdered FK; or a murderer is the bastard son Smerdyakov(the son from townie-mad woman, but "all" thought that his fathe is Feodor, his name translate the "stinky/stinkiest") - he is rasty and ugly character, which causes nothing but disgust, is any reader who saddened his suicides? nope, no one. he looked ugly and silly, but he is slippery, tricky. Nakamura said that Smerdyakov hasn't self mind. Smerdyakov told with Ivan,  imbibed  with his thoughts and he could to murder. But the result he killed-self. no one love him during life, all looks at him as on dirty Karamazov's pet. Why he killed self? because his master dead or because he got awareness of his ugly role? was his self-murdering unconscious or conscious action? He was nothing, he has nothing, can he killed for ..pleasure?.. Strange things...; or maybe it was Alesha? why not? he played the role of peacemaker, but maybe he had murdered? most postmodern detective stories can have this plot. Why no one thought(in the story) that Alesha wasn't?
Or no one of sons didn't?
Your brain try to find solid earth to thought. If you have a killed man, you want to find the killer, that make your mind troubled. You should to find it? why? for punish the man that will be proved/judged as a murderer? Or to make sense that you didn't it, that it is not you sin? Or You should to blamed the other, to not blame yourself?
Every one like to be owner of goods, but does any one wanted/wished/willed to be the owner of sin? So who is the sins owner? You can find the killer, but who is a murderer? Not You? Why? You don't believe in God, You don't believe at nothing except rational, except logic, except moral judge, except that punish the other is rightfully. Why you are judging the other, if only God can? But if no God, all is allowed. Not things, all thoughts, all theories, even autophagy of alive humans can be reasonable.
Who is the crime action author? When the sin is start? Action is the end only but infraction was before, in thoughts, whose thoughts? You are looking always at the result, always missing an infraction body...
Did Russia pay any attention to Dostoevsky? I donno, his story "Преступление и наказание"(wrong translation on wiki "Crime and punishment", because in Rus it is a wordplay means also "infraction and retaliation", this story not about "Crime". Any crime have a reason, motive, Rodya hadn't any motive, he had theory) read at school. Some others too, "BK" is more difficulty for teens, but many Rus people read Dostoevsky. But Dostoevsky is not for attention actions, it is not instruction how to do right/wrong, even how to think right or wrong. Nope. He didn't answered own questions, he only  present the problem, without any solving, and all solves(like Sartre did, or else) are not work. Still not work.
** BK main characters:
Feodor Karamazov - the father, surname Kara-mazov mean Sin-painted.
Dmitry - violently passion, Ivan - rational brain, Alesha - faith, and bastard Smerdyakov - are his sons and also Karamazovy - sin containing. FK character had all this "sins" - he was smart, he was violently passion, he was ugly for others, and he had no doubts = he had totally faith in self-right.
Answer: There is a higher essence than just asimple reward and punishment system (ala Steve Saban). It is the noble, essential virtue called accountability. With a laissez faire approach to moral conduct sans accountability, there is a void, not just of a sense of justice, but justice itself. This is perhaps what Dostoyevsky wanted to portray in his character, a character who is being held accountable for his actions.
Without the "after life" (and pending accountability) injustice reigns the universe.  And that is unthinkable, unbearable, unconscionable. Even Benjamin Franklin, an old fashioned Deist, acknowledged an afterlife wherein each man would be judged according to his deeds, and spent the later of his life doing as many "public works" as possible (See his autobiography and learn of his establishing a post office, hospital, sewer works, library, etc.)
Did the Russian people take full advantage of Dostoyevsky's warning? What has the history of modern Europe revealed?  What philosophies have dominated academia as far as this topic is concerned? What has been the result(s) of European society's response?


Debug Performance Issues

Question: I've had a WordPress blog I've hosted on Dream Host for several years now. Recently (the past year) my site is going down often. Via Dream Host I found that I'm using up my CPU limit and they are killing my process. This used to happen twice a day, but I was able to get it down to maybe once a week. I did that by swapping my caching plugin from W3 Total Cache to another and removed some plug-ins. I'm still sometime getting my issue. To be honest, I'm an ASP.NET developer, so I'm used to debugging tools in my IDE and CMS applications. How can I get to the bottom of what is causing the CPU issues? Are there any WordPress tools? Also, my site is configured for the URL pattern http://hostname.com/{article slug here} so you'll notice I don't sub-folder by year, month, or category. Could this be contributing to the problem?
Answer: There are essentially two very different cases how WP site typically bring server down with symptoms of CPU overload:
Your site is not fast enough for your traffic
Simply put if your server can serve page every tenth of a second and you get more than 10 pageviews in that second - your resources are bankrupt. If your site going down heavily correlates with traffic spikes then you need either to make it faster or give it more resources.
You have a bug and/or configuration issue
This is much sneakier since it's not really performance issue. It's issue that causes some kind of crazy loop in a way that really burns CPU. It might not even be in PHP code, for example that tends to happen on some configurations when site attempts HTTP request to itself.
Things to do

Install profiler, the lower level the deeper insight it will give you. NewRelic, munin, xdebug, xhprof, something WP level (P3 Profiler, Time Stack, Laps). Not at the same time! :) Depends on what is your hosting type, etc. Be careful not to crank it up too much from the start since any active debugger/profiler makes site slower to certain degree (ranging from unimportant to killer 300% slowdowns), which might instantly escalate the issue.
Crank up the logging. Turn on WP_DEBUG, disable showing errors, log them to file.
Drag site down to local install, apply the same (sans hiding errors), see how it behaves.

From there it's either having glaring performance issue light up like supernova (consider yourself lucky) or slow hunt for what goes wrong and under which circumstances it manifests.
Answer: To add to what @rarst said, some problems can be caused by Apache/mysql/php configuration options and they will be almost impossible to debug from wordpress or php and require OS level monitoring tools.
If your problem is typical one, then you will want to look at your apache config file and check what are the values of maxclient and maxservers are. Reducing those values may help your site avoid getting to peak memory and cpu, but will reduce the performance of your site.
Non efficient permalink structure can cause your site to respond slower but should not cause cpu overload.
Answer: If your CPU is bogged-down by PHP generating pages, you need to install a Profiler to see what is happening.
There could be a number of reasons why PHP is using so many CPU cycles. But you're blind unless you can figure out exactly how many microseconds each script & function is taking to run.
Once you get that data, you can begin to dig into the code to understand what its doing and then you can begin to optimize it.
xhprof
XHProf was originally developed by Facebook to profile (and optimize) their PHP web application (facebook.com). It was open-sourced in 2009.
Facebook no longer maintains XHProf, and as development continued past PHP7, the XHProf code rot lead to a number of XHProf forks.
One of the best maintained XHProf forks is maintained by Tideways; it is available in the Debian repos and therefore can be securely downloaded & installed without downloading & compiling code from the Internet if you're using a Debian-based Linux server.
For more information on installing tideways-xhprof and configuring Wordpress to use it, see:

https://tech.michaelaltfield.net/2022/06/07/wordpress-xhprof/

excimer
Excimer is an alternative to XHProf that's used by Wikipedia.
Unfortunately, I have been unable to find any guides on using Excimer with Wordpress.

Debug Performance Issues


How can I show characters dealing with rejection?

Question: From my own experience reaction to rejection is very internal. I'm having troubles with coming up with actions that rejected people do, that would be perfect description for what they feel. It would help me a lot if I could learn a couple of examples. And I know people on this board know about their stuff.
Comment: I would need to know more about the underlying character of the rejected person and their relationship with the person who rejected them. An awkward nerd rejected by a nice girl he barely ever talked to because he was too shy will be very different from a trusting, generous person rejected when his previously caring love interest realizes he has no money, or rejection of a serial-killing mad man who has finally fallen in love and released one of his victims as a first attempt at redemption.
Answer: I largely depends in what type of personality they have. If they're the go-getter person who's optimistic, try to have them act normal in front of everyone, but there's an internal sob-fest going on. Or make them act all sullen and dull in front of people, but nobody can seem to cheer them up. Make them grump and agitated all the time. Or dramatic. Or just completely silent all the time. Maybe even stunned and trying to wrap their heads around the rejection. it also depends in if they're a boy or girl or some other gender. Have their friends console them, or have their friends not care.
I'd have the character either act like they don't care in front of everyone and seem cool around the person that rejected them, or have them open up to everyone. Maybe right after the rejection, they go cry somewhere then 4 months later they're seen still trying to get over that person. Maybe even the attraction slowly turns into a hate for that person.
But IDK, I'm not an expert so IDK if this helps or not.
Answer: I'm assuming you're talking about someone other than the viewpoint character (where you would be able to show the internal reaction). How much other people would notice of someone hurting from a rejection depends both on the rejected person's personality and how close they are.
If the rejected person reacts by becoming unusually quiet, withdrawn, sullen, moody etc., even someone who doesn't know them very well might notice the change but probably not understand why. A friend, on the other hand, might pick up on how their mood changes when their crush enters the room, or how they're taking pains to avoid meeting them. Maybe the rejected person spends less time in the office kitchen than they used to, only staying to chat if their crush is nowhere to seen. Or they start going to a different super market than they used to so there's no risk of running into their crush by accident, but of course if anyone asks about it they'll come up with some kind of alternative explanation.
However, if the rejected person tries to pretend they're fine, someone who doesn't know them very well might not notice any difference at all. A friend might notice how their laughter seems a tad forced and how sometimes, when they think no one is watching, their smile slips and they gaze sadly at their crush talking to someone else. Of course, when they notice the friend looking at them, they'll put on a smile and wave it off as "being tired" or "lost in thought".
Answer: Just write about their facial expressions when faced with rejection. Do the characters show expression, even subtly, when dealing with it? If not, what do their minds say? Reacting to rejection is always nuanced, so use yourself as a reference and infer from there depending on the character concerned. It isn't so difficult, you as a human being deal with it often daily I imagine since it is so common to be rejected, so use experience and infer or deduct accordingly. You live life, you can write about this common experience.
Comment: Thanks for your reply. The thing is I don't see my face while being rejected. Also I can't really think of facial expressions of rejected people. Nothing describable comes to my mind. Hence the question.
Comment: @Rico use emotions that are felt in rejection and try to translate them into facial expressions.


Can I edit domain settings if I didn't create the site?

Question: A friend has created a WordPress site and added me as an administrator. I need to be able to add a sub-domain that points to a different website but all the instructions I can find require me to access settings in "My Site" but when I go there, I get the message "You don't have any WordPress sites yet.". I assume this is because I didn't create the site in the first place? Is there a way to grant me access to this or does the site creator have to do it?
Comment: Is this a WordPress multisite?
Comment: @MikeNGarrett I'll be honest, I don't know, I am a total WordPress novice. How do I find out whether it's a multisite or not?
Comment: Into and explanation: https://www.wpbeginner.com/glossary/multisite/ (it sounds like this is one).
Answer: Sounds like this is a Multisite installation, and if so -- he needs to add you as a Network Administrator not just a single site administrator.

I need to be able to add a sub-domain that points to a different website

What exactly do you mean by this?  You want to add a subdomain that points to a different server?  A different WordPress installation?  A different site on the same WordPress installation?
If you're just trying to setup a subdomain to point to a different site (different from the main WordPress one) -- that needs to be done through your friends web hosting control panel -- not through WordPress.
If it is a multisite and you're trying to add a new site (setup as subdomain), as mentioned, you need Network Administrator access not just standard Administrator


Is there any way to get my peer nodes' peer nodes?

Question: I can use bitcoin-cli getpeerinfo to get the peer nodes' information. Is there some way to further get the peer nodes' peer nodes, i.e. the 2-order neighbor node?
Answer: No, that is not possible. The P2P protocol offers no such feature, by design.
The topology of the network graph is considered secret, because someone who knows how nodes are connected could leverage it to do other attacks (e.g. partitioning attacks or eclipse attacks).
Despite that, the protection against revealing this information is however only best effort, as it is very hard to completely exclude the possibility for peers to infer something. For example, a paper from 2018 called TxProbe: Discovering Bitcoin's Network Topology
Using Orphan Transactions showed how to infer connections between attacker-connected nodes using conflicting transactions. Several techniques using (IP) address gossip messages on the network have also been described. These attacks do get fixed or partially mitigated when discovered, but many more probably exist.
Still, it does mean you'll effectively need to find an exploit to get this information. It's not exposed deliberately as a feature.

Is there any way to get my peer nodes‘ peer nodes？


Let's add the "status declined" tag, and let's use pink "status" tags more often

Question: Let's use the pink "status-etc." tags within Meta more often.  Let's also create a "status-declined" tag for Meta.
Answer: In Meta there is a series of default tags, as indicated in Add a selection of default tags to all metas. This includes tags, comments, bla bla.
Also, there is a series of tags that can just be used by moderators and exist by default, no matter if they have been used before, no matter if no other question uses it1. The list contains all the status-*, together with faq and featured and you can access it by typing "status..." in https://spanish.meta.stackexchange.com/tags.
Also, you should've already seen that two questions use it! Browse through status-declined.
So there is no need to create status-* tags, they are already in place for when we want to use them.
1 Normal tags are removed after 6 months if just one question uses it.
Comment: Somehow, when I looked at the pink tags containing the word "status," I didn't see this particular one.  But now I do see it.  I will fix my question now.


Can l2tp carry IGMP packet?

Question: If a client connects to one vpn server, can it join a video meeting which is based on IGMP?
Answer: RFC4045 describes extensions to support multicast over L2TP protocol. So, it seems possible, but it depends on the implementation you use.
Answer: In addition to what Khaled had written, there are other encapsulation protocols which would support Multicast encapsulation - GRE for example. Most "multicast tunneling" techniques allow multicast transmissions to cross unicast-only networks using GRE. The more advanced and flexible version of tunneling is AMT which is in the standardization process for about a decade now, but has working implementations and sees some use.

Can l2tp carry IGMP packet?


MacGDBp, but better?

Question: For debugging php code I use MacGDBp but it has its quirks: it shows only the top frame variables of the stack, it sometimes refuses to display any variable at all and last version has decorates the source text with non ascii characters.
Is there any alternative that is native OS X? (ie. not Eclipse, I can't stand it).
Answer: I have also used MacGDBp and became frustrated with the limitations you mentioned.  While it is not a native app per say, NetBeans 6.5 and higher is free and includes a decent PHP debugger that works with XDebug.
http://netbeans.org/kb/docs/php/debugging.html
It is not without it's own set of issues, but it does seem to be more reliable than MacGDBp.
If you are not opposed to paying, the Komodo IDE (My IDE of choice) also has a PHP debugger.
http://www.activestate.com/komodo-ide?src=AScom&type=bn&X=HP&campaign=KMD
Also, though slightly off topic, you may find the easy Xdebug FireFox extension useful:
https://addons.mozilla.org/en-US/firefox/addon/58688/
Lastly, the XDebug website has a list of additional clients, browser plugins and instructions on how to use them:
http://www.xdebug.org/docs/remote#browser_session
Comment: I tried netbeans, and I find the same problem, no variables on any frame context. This made me think the problem must be somewhere else, so I started digging, enable xdebug logging, and I could see from the messages between xdebug and the IDE that is an xdebug problem (all variables were 'unitialized'). Changed xdebug from 2.0.5 into 2.1.0 (latest stable) and now NetBeans *and* MacDBG both show the variables just fine.
Comment: Thanks for the pointers. I'll start by giving NetBeans a try for PHP, since I already use it for some small time Java dev work.
Comment: I forgot to mention, if your PHP script uses any time of URL rewriting, mod_rewrite, etc. you will want to make sure and read the section "Path Mapping, Debugger Proxy, and Starting a Debug Session on a Custom URL" of the Netbeans PHP docs linked to above.  For my Zend Framework and CodeIgniter sites it was crucial to prevent NetBeans from attempting to automatically launch a browser for me.  Instead, I manually launched FireFox and navigated to the appropriate URL, using the XDebug FireFox extension to trigger the Netbeans PHP Debugger.
Answer: For Linux users - http://protoeditor.sourceforge.net/ has a nice lightweight client for Xdebug which is also available as a plugin for Kate (this is not mentioned on the Xdebug site)
Xdebug also runs happily with XAMPP - if you figure out where to put the compiled .so file ;)
There also is an article describing on how to install Xdebug on Linux w/ XAMPP on the SaniSoft blog: http://www.sanisoft.com/blog/2007/06/23/how-to-install-xdebug-php-extension-for-xampp-on-linux/
Answer: http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb
That helped me a lot. Perhaps it helps you as well.
Edit: By the way, it is a PHP extension. It can be used in competent IDEs including Netbeans, Eclipse, AS Komodo... Oh, and you may use it manually as well by setting a special GET variable (or COOKIE) (see xdebug manual for more info).

MacGDBp, but better?


Virtualize the database server or the web server?

Question: In a web application architecture with 1 app server (IIS) and 1 database server (MSSQL), if you had to pick one server to virtualize in a VM, which would it be: web or db?
Generally speaking of course.
Answer: Web of course.
Databases require too much IO bandwidth + It's easier to add instances or databases to a single instance, whereas isolated web servers benefit more.
Similar question... "Run Sharepoint 2003 on VMWare?". Sharepoint is just an asp.net application with a SQL Server back end.
Answer: The shortcoming of most virtual environments is I/O, especially disk. SQL is very I/O intensive. I am using a shared virtual host and the slow I/O is killing me.
That said, Microsoft is pushing SQL on Hyper-V. It's a hypervisor, which means its a thinner layer between the VM and the hardware, and the drivers are quasi-native. Here's their whitepaper: http://download.microsoft.com/download/d/9/4/d948f981-926e-40fa-a026-5bfcf076d9b9/SQL2008inHyperV2008.docx
Looks like for SQL, you will lose ~10% performance overall. The upside is that you can move the whole instance to another box quickly, bump up the RAM, etc.
Another thing to consider is Intel's enterprise SSD drives (X25-E). I imagine that would help a lot in a virtual environment. Pricey, of course.
Answer: I would probably decide depending on the amount of computation required by the app server, versus the amount of computation/io done by the database.
With that said I would think most of the time the DB should NOT be virtualized. Virtualization isn't too hot for db's that have to ensure that data remains nice and safe on a disk, and adding another abstraction layer can't help with that.
Answer: If you have two physical servers there is no need to virtualise - use one server for IIS and one for the database.
If you have one physical server there is also no need to virtualise.
If I had to choose, it would be the web server.  The database would benefit in terms of performance by running on a physical server.  If the web server is virtualised, it makes it quick and easy to clone it to create a cluster of web servers.
Answer: With today's hypervisors and best practices you can virtualise both infrastructures. When you virtualise your DB infrastructure it is best to ensure that the DB is installed onto a SAN based system so that IO performance is not a bottleneck.
As with everything there are the right and wrong way of doing things but following vendor best practices and testing will enable you to squeeze the best performance out of your VM instances.
There are plenty of whitepapers and performance testing from the various vendors should you want to virtualise your entire infrastructure.
Even though virtualisation again is an industry hot topic with various vendors now giving away hypervisors for free, this does not mean that using virtualisation is the way forward. Server consolidation yes, performance enhancing maybe - YMMV
Comment: Whitepapers from vendors. Not users.


Mini Display Port to HDMI - no sound

Question: My Mac Book Pro was purchased in 2010.  Using a Mini Display Port to HDMI cable yields no sound. "System Preferences"  "Sound" "Sound Effects"  "Play Sound effects through" has no TV icon.  Can you help.
Answer: It's possible your Mac doesn't support audio over Mini Display Port:
These Apple computers supply multichannel audio (up to 8 channels) and video signals over Mini DisplayPort:
MacBook Pro (Retina, 13-inch, Late 2012 and later) 1
MacBook Pro (Retina, 15-inch, Early 2013)
MacBook Pro (Retina, Mid 2012)1
Mac mini (Mid 2010 and later)1
Mac Pro (Mid 2010)
MacBook (Mid 2010 and later)
MacBook Pro (Mid 2010 and later)
MacBook Air (Late 2010 and later)
iMac (Late 2009 and later)
Also, have a read of this question:
Does this Mini DisplayPort to HDMI connector output audio?

Mini Display Port to HDMI - no sound


Thermocouple with a built in safety overtemp disc verses a standard universal T/C?

Question: My water heater has a thermocouple with an in line overtemp disc stamped 190. The pilot will not stay on after holding the gas valve's pilot start button. So, i assumed like every other water heater i have repaired, that it must be the T/C. But i have never encountered before this, an in-line safety disc on a t/c. So i tried installing a standard universal type t/c and the pilot still will not remain on! is it possible my old t/c with the disc is creating a different mV value? the universal one screws right into the gas valve (same thread, diameter and depth). By the way the mfg of the heater is Kenmore.
Comment: What's the model number of the heater?
Answer: You're going to have to use the model number of the heater, to look up what the proper replacement part is. Replace the failed part with a proper replacement, not a generic part.
The temperature limit device is a safety device, and should not be bypassed or overridden.  Doing so will likely void the warranty, and could lead to personal and/or property damage.
Answer: By-pass the limit switch and see if the pilot light stays on. We've replaced so many of these limits, I can't count them anymore.
A few tanks have had a service bulletin issued to replace the entire gas valve / burner assembly. We've down about 8 of these so far. The parts are free at least and have solved the issue 100% of the time.
Sometimes poor venting is the issue. Check the air intake underneath the bottom of the tank if the screen wasn't installed around the base of the tank.
Answer: A while back a friend called me over for a similar problem. What I found was the over temp safety had a small reset between the electrical contacts. Pressing in on the button reset the safety and he was good to go. It is always a good idea to find the root cause in that case the burner was dirty on 1 side causing the other to be a flame thrower.


Can reading glasses improve one's eyesight of objects lying in the long range?

Question: Someone told me that reading glasses (a priori with a magnifying glass effect only) improve one's eyesight of objects lying in the long range distance. I am really sceptic about it since everything is blurry if I look at objects through those glasses! Is it possible (for this particular person at least)?
Comment: @CJB -- I think the key word here is *reading* glasses, which are converging lenses, unlike a nearsighted person's eyeglasses, which are diverging lenses. That's what wok means by the comment about "magnifying glass effect."
Comment: "Reading glasses" are those, when Granny says: My eyes are quite ok, but my arms are not long enough any more.
Comment: I'm not really sure what you are getting at here. I, for one, and near sighted, which means I cannot see things clearly in the distance. For me, this is at about 10 meters or so and I cant clearly read something as large as a scoreboard. So for me, glasses do vastly improve my eyesight for objects lying in the long range. Is the question can this be done in the general (normal 20/20) case? I know there is a limit to what you can clearly see based on the properties of light and the distance between your eyes, so that would be the limit, I'm willing to bet that is nearly reachable.
Comment: Ahhh, decent chance I read over that without even registering it. Then this question makes alot more sense, and is alot more clear
Answer: I don't think this is possible. Suppose that your unaided eye can focus on objects over some range of distanced from $d_1$ (closest) to $d_2$ (furthest). Putting a converging lens in front of your eye reduces both $d_1$ and $d_2$. That is, it shifts the range of distances over which you can focus closer to you, not further.
Here's the geometric-optics proof of this. Varying the distance at which you can focus is equivalent to varying the effective focal length of your eye. If $D$ is the diameter of your eye, and $d$ is the distance of the object you're focusing on, then the focal length is given by
$$
{1\over f}={1\over d}+{1\over D}.
$$
When you put on your reading glasses, the effective $f$ is decreased, or to put it another way, the effective power of the lens, $1/f$, is increased. (To be specific, $1/f_{\rm new}=1/f_{\rm old}+1/f_{\rm lens}$.) So the left side of the equation becomes larger. $D$ doesn't change, so $1/d$ must become larger. So $d$, the distance to which you focus, becomes less.
Comment: @Ted Bunn, there might be one exeption, when ones eyes are extremely far-sighted, that much, that the shortest focus is farther away than infinity. In such a case, the convex lens would help to get the focus down to infinity or less. I don't know, whether such extreme far-sightedness really occurs.
Comment: If you can already focus to $d=\infty$, then you may or may not still be able to focus to $d=\infty$ after you put on reading glasses. That is, they may not hurt your ability to focus to long distances, but they can't help -- because your distance vision is already perfect.
Comment: @Georg -- Certainly true in principle. Such a person would be someone who couldn't see *anything* in focus, at any distance, with the unaided eye. I don't know if such people exist. If @wok's interlocutor was such a person, that'd be important information!
Comment: This makes sense: I have looked at the benefits of a converging lens on [a random page about vision](http://en.wikipedia.org/wiki/Hyperopia) of Wikipedia, and reducing the focal distance makes objects more focused in some cases. However, does it still work if we consider $d=+\infty$ for long range distance?
Comment: True. Thanks! So it is a mystery, the mind is sometimes not rational!
Comment: So, just make a PS in Your answer, will You?
Comment: @Georg -- That might be it indeed. A few things need to be checked before I give any further detail.
Answer: Yes it can work. If you are long sighted or hyperopic. You may not know you have this refractive error and if you have not had a detailed eye examination this error could be missed. Generally, it is only corrected when there are symptoms....eyestrain and blurred vision as your eye muscles will self correct.
Answer: My husband wears readers all the time- for distance and reading- and he swears it makes his distance vision great! He told me that when he golfs he can follow the ball down the green and can see it very clearly. This doesn't make any sense!


Some measures have extra whole notes in them. What do they mean?

Question:
So i am practicing sight reading and i came across these exercises that have extra whole notes in a measure. What do they mean and how do i play them?
Comment: Hey, welcome to the site. Your question is pretty common! Here's a few other answers that might help: https://music.stackexchange.com/questions/15929/rest-above-a-note-in-a-piano-piece, https://music.stackexchange.com/questions/53041/too-many-notes-in-this-measure/53043
Answer: It's hard to tell in the measures with just whole notes, but you're being given two separate voices to play. You'd play them at the same time.
No. 74 is probably the best example to use to explain. Notice how the right hand has a series of quarter notes with the stems up and a whole note followed by two half notes with their stems down? The quarter notes are the upper voice, the whole and the half are the lower voice.
Also, do you notice how they line up vertically? The whole note has 4 quarters above it, while each half has two above it? That illustrates how they line up rhythmically and should be played at the same time.
Answer: These are exercises to teach you how to play passages with some of your fingers while holding a note down with another one. Looking at the first one (No. 72), second measure, you need to play the C while holding the G down (tied in from the previous measure), and then play the F# and G while holding the C down.
A little more involved example will give you an idea of where this is going, and why the exercises are there. Here's a snippet from one of Bach's fugues:

You will notice the first two bars have whole rests on top of notes. (How can this be? You're either playing or you aren't, right?)
This is a fugue with three voices. You can think of it as a mashup of three different parts written on three different pages. The top voice doesn't begin until the second half of bar 3 -- note the two whole rests and the half rest on the F line before the two quarter notes. (Some scores omit whole rests in voices that are silent for an entire bar, if there are other notes in the same clef.)
One of the voices is written in the bass clef, and the other two in the treble clef. In the treble clef, the top voice has stems pointing upwards, and the bottom has stems pointing downward.
To see just how complex Bach's counterpoint (multiple-voice music) can get, I'll include this performance of a six-voice fugue from A Musical Offering. (The story goes that a king gave Bach the theme and challenged him to write a fugue with six voices. Most of his fugues have three or four.) You'll notice that when all six voices are running, he adds a third staff to keep things from getting too cluttered. (This is also a fairly common practice. The goal in score writing is to make things as easy as possible to read.)

As Lao Tzu says, a journey of a thousand li begins with a single step. Enjoy!


Is there any Russification of the Simple MCQ Drupal 7 module?

Question: Is there any Russification of the Simple MCQ Drupal 7 module? How to translate it?
Answer: It looks like it is partially translated: Translate Simple MCQ to Russian.
To import the translation that exists into your own site, enable the core Locale module and add Localization update.  You can now use the standard Drupal translation site interface to translate the bits that are not translated.
Please help the community by adding your own translations to Localize.Drupal.org


How does photodiode works when use in reverse-biased photoconductive mode?

Question: I wanted to know the basic principal behind the working of a photodiode in reverse-biased photoconductive mode. What happens at the atomic level ?
Answer: Conceptually, it is very simple. Photodiodes are just exposed PN or PIN junctions. Reverse biasing means there is an electric field over the junction. When a photon of sufficient energy hits the junction and is absorbed, this creates a free electron-hole pair which is accelerated towards the anode/cathode by the electric field, thus creating current.
Visible light is coincidentally well-suited to this kind of operation, because the absorptivity of most semiconductors is fairly high in the visible region, while the required energy to excite an electron beyond the bandgap voltage is 0.6-1eV, which is exactly the amount of energy contained in a just-infrared photon (1200-1400nm). Higher energy photons (red, green, blue) get absorbed just as well, but the excess energy is converted into heat.
Comment: thanks for the answer, it will be very helpful to me if you can upload a image of the process if you can thanks


IISRESET corrects my icons - but why?

Question: I host a website that has an issue randomly, once in a blue moon the images on the buttons will change to red Xs. After a bit of playing with it I found that recycling iis corrects the issue but can someone explain to me why? I have the IIS pool set to recycle every night at 1 am automatically. It does not happen in the middle of the day and it only seems to happen after the pool recycles.
Answer: Check this issue with firebug. If your Situation occures, check the headers from your srver for the images. Then post the headers here again.
Additional have a look into the logs. What does the logs say? 404 (File not found) or what?
Without These information, it´s hard to solve ...

IISRESET corrects my icons - but why?


Creating data structure in Java

Question: I'm wondering if there is a good way to create a new data structure in Java that avoids creating new class file. According to this post, the Java's equivalence to struct in C is simply a class. However I find it redundant to create a whole new file for a class that simply have a couple of public fields, ex: x,y coordinates of a point. In C, the data structure can be defined within the .c file that uses it, which is a lot more simple. Is this actually the only way in Java?
Comment: Use inner classes or multiple classes within the same .java file (of course, with only one public class). But this will still create multiple class files.
Comment: You may even declare a class inside a method.
Answer: You could use inner/nested classes. You'll have only one .java file, but nested classes will all have their own .class file when compiling.
Answer: You have to create a class if you want a data structure. Just to avoid creating multiple .java files, you can put those classes in a single .java file. Assuming, Test.java-
<code>public class Test {

    class InnerOne {
    }

    void m() {
        class InnerMost {
        }
    }
}

class Dummy {
}

class OnMore {
}
</code>
Answer: You can create several small, auxiliary classes in one .java file, but they can not be public.
So for example you can create a public class, whose name corresponds to a file and a couple of helper classes that are not public.
As for class per data structure in java, java has only one way of creating abstract data types  - classes, if you're not satisfied with this - try using other JVM languages, like Scala, it is far more flexible in this regard.
Answer: Java is an Object Oriented Programming language, so everything works with classes and you should not try to program with Java as with C.
If you want to define a data structure within a class, you should use InnerClass, there is a good example on the official documentation.

Creating data structure in Java


Matlab installation on ubuntu 12.04

Question: How to install matlab in ubuntu 12.04 ? which version of matlab is best suited to ubuntu 12.04?
Answer: There is information about what Matlab versions compatible with Ubuntu 12.04 at the Platform Road Map for the MATLAB and Simulink Product Families. Look under the heading called Linux® 64-Bit MATLAB and Simulink Product Families.
In the Ubuntu Software Center for Ubuntu 12.04 there is a package called matlab-support. This package does not provide MATLAB. Instead it configures an existing MATLAB installation to integrate more comfortably in a Debian installation.
There are installation instructions for MATLAB in Ubuntu at the Ubuntu Documentation MATLAB wiki. Installation instructions for a specific version of MATLAB in Ubuntu can sometimes be found (depending on the version) by searching Ask Ubuntu for that MATLAB version.
Answer: run the installer with the -glnx86 argument,
sudo /media/MATHWORKS_R2012A/install -glnx86 -v

run MATLAB with the -glnx86 argument to force it to use 32-bit
matlab -glnx86

Installation

Run the MATLAB installer(Using following command in terminal).
sudo /media/MATHWORKS_R2012A/install -v
When prompted to 'Choose installation type' you should select custom.
When prompted to 'Specify installation folder' it is recommended that you use the default folder /usr/local/MATLAB/R2012a.
When given the option to Create symbolick links to MATLAB scripts in: it is recommended that you check the box and use the supplied path /usr/local/bin.
You can check by,
sudo matlab

To know more click here(source).

Matlab installation on ubuntu 12.04


Jurisdiction and Unauthorized Practice of Law

Question: Joe in state A asks a question online: "I did _____. Is it legal? What are the consequences? What should I do?" Jake in state B responds in a manner which, while entirely okay according to state B's UPL rules, clearly falls under state A's definition of UPL. Is Jake guilty of the unauthorized practice of law?
Answer: Joe does not have to exist or have asked a question: the issue can be reduced to the (dubious) premise that there is at least 1 state (A), not one (B) that Jake is in, where Jake's reply would constitute UPL. Jake is not guilty of UPL, because Jake is not in jurisdiction A. Analogously, if Jake in state B renounces his religion online, which is the crime of apostasy in country Z, Jake is not guilty of apostasy.
Comment: There are some laws that operate extraterritoriality but this probably isn't one of them. Apostasy probably is though.
Comment: If Jake makes a public statement about Joe online which is defamatory in Joe's jurisdiction but not in Jake's, he can in theory be held liable in the courts of Joe's jurisdiction (for, and correct me if I'm wrong, both criminal and civil defamation). Why doesn't the same principle apply to online UPL?
Comment: To be prosecuted for a crime defines in jurisdiction A, Jake has to be in jurisdiction A. A tort action between two citizens overcomes the main jurisdictional limit, though forum selection can lead to different outcomes.
Comment: Marijuana and its advertising marijuana is illegal in some states e.g. DE, GA, MT; it is legal in others e.g. WA, CO. A Washington online advertiser cannot be prosecuted for an act that would violate MT law because the advertisement is on the web.
Comment: On the other hand, consider that Jake is actively soliciting improper legal business in state A through a medium of remote communication (internet, telephone, mail, what have you).  Would state A really be unable to pursue Jake for UPL?
Comment: Then he is guilty in his own state. You need a scenario where state laws differ, given the OP.


How long before WWDC are old models usually put on sale?

Question: I used to work as a salesperson at an Apple retailer. I remember that prior to WWDC Apple usually changed the target price on old computers before the new computers were launched. (I guess they are easier to sell before the new models come out). Are there any statistics when this usually happens and how much those prices change?
Answer: I am not aware of public price cuts prior to WWDC. At least not with today's Apple.
The practice you mention may no longer be in place, it may be limited to some stores, or it could be country/region specific.
Apple's computer products tend to maintain the same price for their lifetime. iOS devices can attract discounts over time – their more predictable update cycle helps with this.


How to properly connect bluetooth to Rpi3

Question: I have tried many tutorials on how to attach bluetooth to the pi, but none seem to work, i dont know if the ones I am reading are outdated or depreciated but I have had no luck, I am trying to connect my bluetooth speaker/mic combo to the RPi3 Model B. I have succesfully been able to connect it and get sound from youtube but that is it. I am trying to TTS working on a website called runmyrobot.com, which allows users to type in chat, and then my robot speak the chat. I also have had no luck getting the microphone to work. Any help would be appreciated
Comment: How have you ruled out the possibility that this is not a problem with your bot?
Comment: @SteveRobillard nope others are using it just cant get ahold of them
Comment: In the GUI have you selected your speaker (right click) in the sound menu (blue speaker on the right side of the menu bar - neear the clock)
Comment: @SteveRobillard yes i did
Answer: Not all USB Bluetooth adapters compatible with Raspberry Pi. Make sure your USB adapter is compatible. I believes this article may help you to find out a compatible Bluetooth adapter.
To install the software needed to support Bluetooth, enter the following commands:
<code>$ sudo apt-get update
$ sudo apt-get install bluetooth bluez-utils blueman bluez
$ sudo usermod -G bluetooth -a pi
</code>
These commands should work for all Bluetooth adapters supported by the Raspberry
Pi.
Now you want to plug your Bluetooth adapter. You can check the Bluetooth adapter is connected or not using this command after hot plugging the Bluetooth adapter:
<code>$ lsusb
</code>
Its output looks like this if Bluetooth adapter is connected:
<code>Bus 001 Device 004: ID 0a5c:2198 Broadcom Corp. Bluetooth Device
</code>
If not found don't bother about it. Just reboot your Pi. You will now find a new entry on the Raspbian Start menu under the Preferences section called Bluetooth Manager. Open this utility and click Search to look for nearby
Bluetooth devices. Make sure that there are some Bluetooth devices set
to be discoverable. It is my first answer. I don't know is Stack exchange expecting these kind of answers...
Comment: It is the first good answer I have got. I think Stack Exchange expects you to berate and belittle the person first THEN answer the question.
Comment: @Chris Thank you. I believes now you successfully attached Bluetooth to the Pi. Is it really helpful for you? Since I am not a native English speaker and I faced some troubles to understand what you are saying. That is why I am asking this.


What exactly is color superconductivity?

Question: I'm having a hard time visualizing exactly what would happen. What similarities does it share with our usual superconductivity and what would be different?
Answer: Ordinary (electronic) superconductivity is characterized by 1) the Meissner efffect (screening of magnetic fields), 2) a gap in the excitation spectrum of single electrons, and 3) perfect conductivity (zero resistance),
Color superconductivity in dense quark matter is characterized by 1) the Meisner effect (screening of color magnetic fields), 2) a gap in the spectrum of non-Goldstone modes, and 3) (depending on the exact nature of the color superconducting order parameter) superfluidity (flow without viscosity). Note that there is no gauge invariant color charge, so it is not clear what one might mean by perfect color conductivity.


Is it good to buy Canon 18-135mm lens?

Question: I have Canon EOS 70d DSLR and I have two lenses as Canon 50mm f 1.8 and Sigma 70-300mm. I work with these lenses and it good. Now, I like to add some more lenses like some zoom lens like  Canon 18-135mm as its is quite cheap and have seen good reviews on ebay and amazon sites. But I am confused now should I have to buy this lens or not? as I have two lenses which I have mentioned above, Does the needs of canon 18-135mm lens would be fulfill by that lenses or not? As one of the main features that I like to buy this lens is due to image stabilizer feature on it. So can anyone recommend me what should be the best options for buying lens.
Comment: Necessary? No. Why would it be necessary? - Whether it is advisable will depend on what you want to photograph how.
Comment: In general, "what should I buy" questions aren't a good fit for this Site as they are both rapidly outdated and specific to your individual circumstances. If you could try and rephrase your question to explain what problem you're trying to solve, it would be a much better question.
Comment: In that case, the answer is definitely **no you should not buy this lens now**. There is no necessity to have this lens in the abstract. You should wait until you have an actual need to fill, and then buy the thing that fits your need.
Comment: This is something a subjective issue so I'll comment rather than answer. This seems a pointless purchase to me. What will you use it for that your current lenses don't cover? The image quality will probably be best in the middle of the zoom range, but it won't match up to your 50mm. And your 70-300 will probably give better IQ at 135mm than the 18-135mm. The only advantage you will have is that you won't need to swap lenses and you'll have the wider end to play with. So it depends what's more important, IQ or convenience. I know what I'd go for. Look at decent wide-angle zooms instead, I say.
Comment: I think there is a language issue here. The word "necessary" is very strong, especially when you don't qualify it. Do you mean that you feel it is necessary to have a wider angle lens, and are wondering if this would be a good way to fill that? Or do you wonder if it's necessary to have a wide angle lens at all?
Comment: I want to upgrade some lenses so I am asking the questions so that I could come to the solution that should I buy the 18-135mm lenses or not. Let it be..
Answer: It depends on what you are missing with your current lenses.
The 18-135mm is a nice lens that can do a lot but it isn't very good at anything - it's relatively slow at f/3.5-f/5.6, 18mm is wide but not very wide, 135mm is long but not very long, the lens has ok but not great image quality, the auto-focus is ok (much better than the 50 f/1.8) but not great, the IS is ok but not the best, you get the point.
I have the 18-135 and I love it because it does almost everything I need on a daily basis - it covers everything I need to take photos at acceptable parent-child distance in acceptable quality and without swapping lenses.
if you want something that covers everything from sort-of-wide to sort-of-tele with ok quality then the 18-135 is for you. if you want anything more specific (or faster, or higher quality) there are better option out there.

Is it good to buy Canon 18-135mm lens?


Streaming FPV over WiFi?

Question: I met a guy some time ago running a first person view (FPV) stream over Wifi. He said that the setup didn't use a complete Operations System Interconnect (OSI) network stack and this allowed them to stream video faster then one might over User Datagram Protocol (UDP). I don't recall the details but at the time he said it was a common trick used by Drone flyers, perhaps this was just the group he knew. I was wondering if anyone had any further information on this. I believe he was streaming 4K and was quite surprised. At the time I was messing around with a an early Raspberry PI and trying to stream video myself but I could only achieve a speed/quality that where far inferior by comparison.
Answer: This is done by placing streaming video data (RTP) directly into the Wi-Fi frames. Checkout https://github.com/svpcom/wifibroadcast/ project for more details.
Comment: Thank you ! It is interesting that the fork employs UDP. I have been wanting to try this out on a ESP8266 for some time now.

Streaming FPV over WiFi?


Is there a way to archive old entries

Question: We have a large site with 100k+ entries in exp_channel_data The admin section straggles when trying to edit entries and change or add channel fields. It takes almost 80 seconds to add or alter a field and more than 10 seconds to list or edit an entry. Is there a way to archive old entries to a different channel (add-on maybe) or something similar? How do we deal with such large sites? You can find more about this here http://ellislab.com/forums/viewthread/238313/
Is there anything we can do about this? - or this is it? EE has its limits.
Answer: First, just note that it's safe to assume that adding more memory / faster servers for both your EE/Apache and MySQL will make things work better. 100k+ entries is enough to require more horsepower than a smaller site, but that generally can be addressed through reasonable upgrades.
That said, I was just working on a site with 75k+ entries--and we were definitely seeing performance issues around adding fields (especially because there were hundreds of fields already, with a lot of data in most of them). EE sticks all of your entry data ("custom fields") in one MySQL table, and every field change and entry change has to compete for lock access (and new fields = new MySQL columns which lock the whole table while it's being restructured).
And, just to add: this is a kind-of tricky situation where there's no one solution that matches every site's content and archiving needs.
So, you have some options, depending on what you mean by "archived."
What worked for me:
For the site I was just working on with 75k "archivable" entries, we simply made a usable backup of the site and DB, and then deleted the 75k entries and corresponding channel fields from the live site. These entries already were not visible on the live site, but they do need to be stored indefinitely for business reasons.
Now, we are able to bring up this backup copy of the site on a development machine if we need to access those entries. And the live site is much happier.
Other options:
If you want to make the Edit list faster when you're using filter by channel, you can move the old entries to a different channel(s). You need to create a new channel that has the exact same field, category and status groups as your current channel. Then, you should be able to go into an entry, and select between the current and archive channel in the Channel drop down.
If this works, then you can use MySQL to mass update change the channel_id for the entries that you want to move to the archive channel. The channel_id field is used in these tables in EE MySQL:

exp_channel_data
exp_channel_entries_autosave
exp_channel_form_settings
exp_channel_member_groups
exp_channel_titles
exp_channels
exp_comments
exp_entry_versioning
exp_layout_publish

At a minimum, you'll need to update the channel_id for entries in exp_channel_titles and exp_channel_data. You'll need to update it in other tables if you're using the relevant featurs--e.g., if your entries have comments, you'll need to update in exp_comments, too. Also, some add-ons use channel_id, like Low Search stores the channel_id in exp_low_search_collections.
But, generally, you can handle the new channel configuration via the EE control panel, and then do a mass update via MySQL of the entry_id <-> channel_id relationships.
Or:
You could split your site into two EE installs, one with current entries, and one with the archived entries. These could live on two sets of Apache / DB servers. You could have these live at separate domains (e.g., example.com and archive.example.com), or use a reverse proxy to have one domain access both sites.
This would be easy to create from a MySQL backup. If your site continues to grow such that you eventually have to figure out how to move entries from the current to the archived copies of the site, that will be a little harder to deal with. But, again, developing queries in MySQL for selecting the relevant data, and then exporting it, will work.
Comment: Thank you for your reply. This is really helpful. I was wondering if there is a way to mass delete entries in EE. How do I remove 50k+ entries properly?
Comment: I always do mass deletion via queries in the database. Use SQL delete statements based on channel_id, or based on entry_id. If necessary, create a new table with a list of all of the entry_ids you want to delete, and then base your SQL delete statements on this, like: delete from exp_channel_title where entry_id in (select entry_id from my_entries_to_delete)

Is there a way to archive old entries


HGST hard drive SMART reporting drive failure in less than 24 hours from 1 reallocated sector

Question: It says the worst was 1 Reallocated Sector Count and the current is 1 with 5 as the threshold.  That's from smartmontools.  Ubuntu's gnome-disk-manager says almost the same thing but shows the current value at 0.
No other attributes show failing status.
When I noticed this a few days ago, i reformatted a few times as ext4 with read-write test and an area did show up with maybe 30 bad blocks.  However, retesting today, i find no bad blocks at all.
So anyway I'm confused.
Answer:
If you hear strange sounds like your Hard Disk Drive  ticks like a clock.
If your Hard Disk Drive motor spin-up slow or getting slower.

The S.M.A.R.T. report can behave like your question with the conditions above.
It's time to replace it, doesn't matter how old it is, it can be 3 weeks or 12 years.
Answer: The fact that you had around 30 bad blocks and the are gone, plus the reallocation may imply a faulty connection. Try replacing the SATA cable, then give the drive a check with any disk checking tool. Re-check SMART attributes.


How is the #_user_profiles table used

Question: I am trying to figure out how this table is used. More importantly I want to write to it in a simple way without having to build a special form or write to the db directly. Currently I have a site with a plugin called miniorange that manages sso logins and writes three user attributes to this table when a user first logs in. I can created users manually but am not able to populate the three attributes (First Name, Last Name, Staff ID) that are held in this table. Is there some existing joomla mechanism such as the user creation interface that can be used to write to this table or you have to build something that will write directly to this table?
I  using joomla  3.9.16.
Comment: Welcome to JSE.  Please take our [tour] when you have a moment.
Answer: There is no code for managing data in this table. You have to write your own plugin for this. You can take a look at User - Profile plugin for example.
Comment: see also https://docs.joomla.org/Creating_a_profile_plugin

How is the #_user_profiles table used


using panasonic ip phone kx-nt511abxb over vpn

Question: we are using panasonic pbx system kx-ns500bx. now we started new remote site and planned to use two extensions there through vpn. already we have cisco asa 5505 ipsec vpn for using accounting application.(using vpn client for remote site) . can i configure vpn tunnel in the same device with keeping existing settings or we need to by extra devices for both locations.existing routers dont have vpn.please guide me to the correct solution.
Answer: Don't know about that specific model, but I haven't ever seen a VoIP phone with a VPN tunnel support. You likely need a dedicated VPN gateways both side.
For a quick, temporary solution you can:
 1. use a software VoIP client on remote computers;
 2. open SIP ports from WAN, only allowing access from the remote site's public IP (if it's static).


Web Services, Memory Leaks and CRM

Question: I have a website that allows users to upload a csv file. This calls a service that reads the information from the csv, puts it into DynamicEntity objects and calls the CRM service to Create/Update entities in CRM. When this service creates/updates an entity this kicks off other plugins to apply certain business rules. These rules can also Create or Update entites in CRM.
The issue here is that the handle count of the w3wp.exe process that the website is calling increases every time the an entity is created or updated and it never comes back down.
I tried putting Garbage Collection code in the business rules and this reduces the handle count of the CRM w3wp process (run by the Network Service), but not the other w3wp process. Should I have Dispose methods on the Web Service that calls the CRM service?
I hope that makes sense. I'm not overly familiar with memory management issues so any help is appreciated. Can anybody give me some tips on how to stop this from occurring?
Thanks,
Neil
--> EDIT
Okay well the handle count goes up when I call the Service.Create(DynamicEntity) method. I don't think placing any code here would be beneficial. When I exit the method/class/service that contains this call the handle count stays as it is. What I need to know is whether this is something I should be managing or is it something CRM takes care of (or doesn't take care of but I can't do anything about it)
--> Another Edit
Right this is how it works.
1) We have CRM and its related services
2) We have another service independent of CRM that uses the CRM services (number 1 above) to create entities based on csv info passed into it
3) We have a website that allows a user to upload a csv, and calls service no 2 above to Create/Update entities in CRM
4) We have plugins fired by CRM which use Service 1 above to create/update entities
So the user uploads a csv to the website (3), this fires a service(2). When service 2 creates an entity using service 1, Service 4 fires. Service 4 calls also uses service 1 to Create entities, and when these services are called (using the Service.Create() method) the handle count of the process increases. When the method/class/services finish the handle count remains the same, and so when the whole process occurs again the handle count will increased again.
Comment: Show some code! Don't make us guess!
Answer: Check that your service references are wrapped in 'using' statements, both in your service, the consuming code and your plugins.  The handles will get torn down by garbage collection eventually, but only if the garbage collection rules are met.  Unless you're noticing a degradation in performance however, I wouldn't worry too much - the platform is pretty robust.
If you want to understand better the why's and wherefores of doing this, look up IDisposable in the .NET framework documentation, and look at the samples in the CRM SDK.

Web Services, Memory Leaks and CRM


Do individual qubits on IBM quantum processors share the same control unit?

Question: I want to investigate the maximum possible parallelism of quantum operations on a specific IBM device (such as the latest heavy-hex architecture), which requires a basic knowledge of their control electronics. I want to know whether individual qubits have their independent control units or share the same control unit, and how the related control constraints restrict the concurrency of quantum gates. I found some control related knowledges about flux-tuable transmon qubits. However, IBM devices are based on fixed-frequency qubits. Are there any relevant reference papers. Thanks a lot!
Answer: From Demonstration of quantum volume 64 on a superconducting quantum computing system chapter IV on dynamical decoupling, we read:

When quantum circuits are mapped to physical hardware, not all
physical gates can be performed simultaneously. Gate execution-times
can vary significantly, not only between single- and two-qubit gates,
but also between individual qubits and qubit-pairs. In addition,
architecture-specific gate schemes and connectivity determine which
and how many gates can be executed in parallel.

which suggests that the control units are not fully independent.
In Scalable quantum circuit and control for a superconducting surface code (though representing state as of 2016) we read:

Our eight-qubit unit cell uses three fixed frequencies for all
single-qubit control and eight detuning sequences for two qubit gates.
This approach to classical control allows significant control hardware
savings via spatial multiplexing.

which appears to further suggest that some shared control wave generators may be used.
These are still only guesses though. Ultimately for information like this you have to reach out to IBM, as their architectures are proprietary, but they may be willing to share some information for research purposes.
Alternatively an option to get some insight would be to thoroughly check documentation and/or examples for Qiskit Metal, which could tell you something about design principles used.


Find anomalies from records of categorical data

Question: I have a data-set with $m$ observations and $p$ categorical variables (nominal), each variable $X_1, X_2,\dots, X_p$ has several different possible values.
Ultimately, I am looking for a way to find anomalies i.e. to identify rows for which the combination of values seems incorrect with respect to the data I saw so far.
So far, I was thinking about building a model to predict the value for each column and then build some metric to evaluate how different the actual row is from the predicted row.
I would greatly appreciate any help!
Answer: First of all, you mention that you have categorical data. I don't see how you can define similarity so that you can also define the distance between the predicted value and the ground truth (error). You can do that only if the data are ordinal.
If you want to just classify between normal and anomalous points (binary classification), without caring about further classification of the anomaly types themselves, one of the most common algorithms is the One-Class Support Vector Machine (OC-SVM).
Anomalies are unpredictable in nature and sometimes hard to replicate and record. Therefore, there is usually lack of anomalous data and supervised learning approaches suffer because if you sacrifice some "precious" anomalous points to train the algorithm, you cannot use them to test it.
The main advantage of OC-SVM is that it is semi-supervised learning, meaning that you train it only with normal data and then it can detect samples that deviate from the trained behaviour during testing and classify them as anomalous. Thus, you "save" all the rare anomalous points for testing purposes!
Take a look at this short Python example, it has all you need :)


Gauss' Law not including all of the system

Question: Suppose we have a system of two parallel conducting plates charges $Q$ and $-Q$ and charge densities $\sigma$ and $-\sigma$. In this case, to find the electric field, Gauss' Law is used with a Gaussian Surface being a cylinder going from the interior of one plate to somewhere between the plates.
Why is this result valid if the other plate isn't being included in the Gaussian surface?
Comment: Gauss' law does not require the entire system to be inside the Gaussian surface, however see the answers [here](https://physics.stackexchange.com/q/110480/) for more about this problem.
Answer: It is simply because we have no need of the other surface to find the electric field.
Our basic need is to find the electric field between the plates, for which the inclusion of the second surface is not necessary.
You may have read in your reference material a list of things/rules/points that has to be taken care of before Gauss law is applied, they are listed below;

Gaussian surface should not pass through a discrete point charge.
Gauss theorem is mostly used to find the electric field of symmetric and extended
charge distribution.
While applying Gauss law directions of the electric field is to be known beforehand.
The electric field term 'E' appearing in Gauss law is the electric contributed by all
charges.

The above are listed to make the process of simplification much easier and to also showcase the fact wherein it is viable to apply Gauss law.
Reading the third point it is clear that as to why we do not need to include the second surface.

Also if we were to include the second surface in the cylinder the electric field lines would originate and terminate inside the cylinder itself and we would not get the necessary flux term in the Gaussian equation!
Comment: I think I got it, but suppose the negatively charged plate has a charge -2Q. Personally, I would find this with superposition, but wouldn't the result be the same as with a charge -Q using just one surface?
Comment: Remember I stated the rules to be followed, having -2Q disrupts symmetry of the system and using Gauss law here would lead to _complications_.
Comment: Alright, I think I got it, thanks!


How to emulate socket.socketpair on Windows

Question: The standard Python function socket.socketpair is unfortunately not available on Windows (as of Python 3.4.1), how can I write a replacement that works on both Unix and Windows?
Answer: Python 3.5 includes Windows support for socket.socketpair(). For Python 2.7+, you can use the backports.socketpair package (which I authored) on PyPi:
import socket
import backports.socketpair

s1, s2 = socket.socketpair()

Comment: Would +1 more than once if I could because both the knowledge that this problem went away starting with Python 3.5, and that there is a PyPi package to polyfill it on versions which didn't have it, answers the actual root problem that undoubtedly drives just about everyone to this question.
Comment: Please add full code, because links (even those to PyPi or GitHub) might break.  +1 anyway.
Answer: import socket
import errno

def create_sock_pair(port=0):
    """Create socket pair.

    If socket.socketpair isn't available, we emulate it.
    """
    # See if socketpair() is available.
    have_socketpair = hasattr(socket, 'socketpair')
    if have_socketpair:
        client_sock, srv_sock = socket.socketpair()
        return client_sock, srv_sock

    # Create a non-blocking temporary server socket
    temp_srv_sock = socket.socket()
    temp_srv_sock.setblocking(False)
    temp_srv_sock.bind(('', port))
    port = temp_srv_sock.getsockname()[1]
    temp_srv_sock.listen(1)

    # Create non-blocking client socket
    client_sock = socket.socket()
    client_sock.setblocking(False)
    try:
        client_sock.connect(('localhost', port))
    except socket.error as err:
        # EWOULDBLOCK is not an error, as the socket is non-blocking
        if err.errno != errno.EWOULDBLOCK:
            raise

    # Use select to wait for connect() to succeed.
    import select
    timeout = 1
    readable = select.select([temp_srv_sock], [], [], timeout)[0]
    if temp_srv_sock not in readable:
        raise Exception('Client socket not connected in {} second(s)'.format(timeout))
    srv_sock, _ = temp_srv_sock.accept()

    return client_sock, srv_sock

Comment: I'd use `errno.EWOULDBLOCK` rather than the number 10035.


How to set page cache expires to 7 days?

Question: I am using varnish with default magento 2.3.3 VCL and the default nginx configuration that comes with magento install. At present I see the expires is set to -1. How can I set expires to one week?
Answer:
At present I see the expires is set to -1

The Expires header you see is client-side. Browsers should not cache things like product pages, etc. which is why the default Magento VCL sets it to -1 in vcl_deliver procedure.
The vcl_deliver is what you use in Varnish for controlling the output to the clients (e.g. browsers).
How long Varnish will cache things from Magento depends on different things: the Expires and Cache-Control headers it sees from its backend (NGINX + PHP-FPM).
So while your client (curl) sees -1, Varnish uses/sees different Expires. You can confirm the same by issuing a curl request directly against NGINX backend port (e.g. 8080, if that's where it is listening) to literally see the same headers which Varnish will see.
curl -IL http://localhost:8080/foo.html -H "Host: www.example.com" -H "X-Forwarded-Proto: https"

This would yield (for default Magento 2 setting with the expiration of 1 day):
HTTP/1.1 200 OK
Date: Sun, 05 Jan 2020 19:36:08 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Set-Cookie: PHPSESSID=6ho2jvaeuiio58qb29cbnpmvaf; expires=Sun, 05-Jan-2020 20:36:08 GMT; Max-Age=3600; path=/; domain=www.example.com; secure; HttpOnly
Pragma: cache
Cache-Control: max-age=86400, public, s-maxage=86400
Expires: Mon, 06 Jan 2020 19:36:08 GMT
X-Magento-Tags: store,cms_b,cms_b_mpanel_default_sidebar_block,cat_c,store_group,cat_c_54,cat_c_p_54,cat_p_149,cat_p,cat_p_81,cat_p_42,cat_p_41,cat_p_118,cat_p_116,cat_p_105,cat_p_89,cms_b_header_1_social_block,cms_b_header_1_top_left_link,cms_b_header_1_top_middle_block

Take note of Cache-Control: max-age=86400, public, s-maxage=86400 indicating one day expiration. This is the TTL of a page defining for how long it will be cached in Varnish.
In this way everything works in harmony:

Browsers do not cache website's HTML and thus never get stale content
Varnish caches for as long as one day, and you can safely up this value to reasonably longer time, e.g. 1 week. Because Magento can "talk" to Varnish to clear cache as needed (when product price has changed, for example).

Now, of course you can adjust VCL to emit something other than -1 for client. In this way browsers can cache things as well. But this is simply highly discouraged. Because there is no similiar mechanism (Magento->Varnish cache purging), which you can leverage in order to clear browser caches when you update a product's price. You simply can't get into those computers to clear the cache :)

How can I set expires to one week?

This task is performed in Magento admin settings.
Stores -> Configuration -> Advanced -> System -> Full Page Cache -> TTL for public content.
For one week you would set this setting to value 604800.
Answer: @Danila I have some JS pages & for each page, I want to set a different cache. How can I achieve that? Is it feasible?
Comment: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://magento.stackexchange.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://magento.stackexchange.com/help/whats-reputation), you can also [add a bounty](https://magento.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/195093)


Export form with domain name association to new SharePoint site

Question: I have a form on SharePoint 2010 that I would like to transfer over to SP2016. In 2010 we currently have over 300 forms filled out. They all have a domain name associated with them. How do I go about transferring the current forms (2010) to SP2016? I have exported them before, but the domain name association was lost in the transfer.
Comment: what's the type of forms?
Comment: @M.Qassas It is a list
Comment: is there InfoPath form ? or default form?
Comment: @M.Qassas A default form
Comment: Do you have any Metadata columns or lookups columns?
Comment: I did not implement Metadata columns or lookup columns. It is a list that contains multiple single line and multiple line texts boxes. With one column being type `Person or Group`
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/63467/discussion-between-m-qassas-and-kevorski).
Answer: SharePoint generates a new ID for each user in each site collection and hence the user IDs are different  for the same user account across the site collection (across the different farms as well, even if the two farms uses the same Active Directory), as SharePoint creates the user profiles by importing information from Active Directory (by using the "User Profile Synchronization service") and stored it locally in SharePoint once the synchronization is done.
For your case, you are trying to save the entire library (that contains forms) along with contents as template and re-use it in another farm and hence the users associated with the forms were not preserved, as SharePoint uses user's ID as a metadata (as stated above, user IDs are different  for the same user account across the farms even if they uses the same domain). To preserve these users in the forms (across farms),either you have to write your own script to migrate each form, along with the user associated with it. You can also use a third party SharePoint migration tool such as Vyapin's Dockit Migrator for SharePoint which supports granular form migration.


The 2-sphere and $\mathbb{CP}^1$

Question: As is very well known, the algebraic variety $S^2$ is isomorphic to projective variety $\mathbb{CP}^1$ as a complex manifold. As is also well known, the coordinate ring of $S^2$ is given by $< x,y,z > / < x^2 + y^2 +z^2 - 1 >$ and the function field of $\mathbb{CP}^1$ is $\mathbb{C}(\mathbb{CP}^1)$ (its coordinate ring being $\mathbb{C}$). My question is how the coordinate ring of $S^2$ and the function field of $\mathbb{CP}^1$ are related? Presumably this relation is a special case of a general variety-complex manifold relationship.
Answer: Any projective variety is also a real affine variety, by using the real and imaginary parts of the coordinates $x_{jk} = z_j\overline{z_k}$.  You should first normalize the projective coordinates to have Hermitian-Euclidean length 1.  Ordinarily the projective coordinates are sections of a line bundle that is only defined up to a scalar.  But with the length normalization, the only ambiguity is the phase.  The phase cancels out in the definition of $x_{jk}$, so it is a well-defined function rather than just a section.
This realification of $\mathbb{CP}^n$ is a map to $(n+1) \times (n+1)$ Hermitian matrices.  It is important in quantum probability:  The image of the map is the set of pure states of a quantum system; its convex hull is the set of all states.  This convex region is the quantum analogue of the simplex of states (= measures = distributions) for classical probability on a finite set.  The matrices have unit trace, so the image lies in an $(n^2+2n)$-dimensional real subspace.  You can check that it is a sphere when $n=1$.
Another viewpoint that is important is that of toric varieties.  The phase part of the toric action on $\mathbb{CP}^1$ is rotation about the $z$ axis, and the moment map is the projection onto the $z$ coordinate.  This too generalizes to any projective toric variety.
Comment: Thanks for your answer, it seems to be what I'm looking for, but could you please explain the first part of your comment a little more (I'm very new to AG). For me a complex algebraic variety is the set of points in $\mathbb{C}^n$ that vanish for all elements of an ideal $I$, whereas a projective variety is the set of points in $\mathbb{CP}^n$ that vanish for all elements of an ideal $J$. I don't see why multiplying together coordinates (which as far as I understand are not even globally defined - hence  I think your line bundle comment) changes a projective variety into an algebraic one.
Comment: That's exactly the point:  The projective coordinate $z_j$ is not globally defined, but the product $x_{jk}$ is globally defined, provided that the vector of projective coordinates $\vec{z}$ is rescaled to have length 1.  If a variety is described by global coordinates, then it is an affine variety.
Comment: It's beginning to make sense, just two last concrete questions:
(1) What exactly do you mean by the normalisation of $z_i$?
(2) How, given global coordinates, can a projective variety be expressed as an affine variety?
Comment: ... or perhaps just a reference, I seem to be missing more background than is fair for you to explain.
Comment: 1. $\vec{z}$ is a vector in $\mathbb{C}^{n+1}$, and complex vectors have lengths (http://en.wikipedia.org/wiki/Inner_product).  Normalization means rescaling to unit length.

2. A list of $d$ global, real functions on a set $X$ can be viewed as a function from $X$ to $\mathbb{R}^d$.  That is how I am using real and imaginary parts of $x_{jk}$.  In this case the image of $X$ happens to be an affine variety.

3. Google finds some references, but they are too advanced to help here, or they don't fit.

The 2-sphere and $\mathbb{CP}^1$


How long did Job's tribulation last?

Question: Can someone tell me how long it was between when Job first started experiencing bad things until God turned things around for the better for Job?
Comment: The answer is a little more than 30 chapters :)
Answer: The events of Job 1 say "in that same hour", so that chapter appears to have occurred at the same time. Job 2 occurs at the next meeting between God and the Accuser, but there is no mention of the frequency with which those occurred. But, Job 2 says:

And they sat with him on the ground seven days and seven nights, and no one spoke a word to him, for they saw that his suffering was very great.

There is nothing in the text to indicate anything other than nine speeches one after the other, followed by God's intervention. While there is clearly a gap between Job 1 and 2, really, one can only say "a little more than a week" from the text.
That said, historically, Job has been lumped not with the historical books, but rather with the Ketuvim- the "writings." Unlike say, Judges, Job has no historical dating, and does not make any claim to be a record of things that actually occurred. (And please note: I read the Bible very literally!) And, given its position in the literary section of the Bible, it is thus under no compunction to be a record of actual events. Some scholars place Job very early in ancient history.
As there is no tie to any events, it is impossible to say anything beyond the events mentioned in the book. The series of speeches would indicate some time, but beyond that, it would be like asking how long Romeo had been asleep when Juliet had her little drinking problem.
Comment: Interesting - I've always heard Job as being undated, but an actual historical account
Comment: FWIW both options (history and allegory) are mentioned in the Talmud as possibilities. (CC: @warren)
Answer: In the the Zohar (Kabbalah) Pinchas page 231a the meetings between God and the accuser are said to have taken place on the Day of Judgement, which is the Jewish new year, which would mean the meetings were every year.

Rabbi Yehuda said to Rabbi Shimon, Let my master say some beautiful [secret] things about Rosh Hashanah. Rabbi Shimon opened by quoting: "there was (in Hebrew, 'vayehi') the day." (Job 1:6) Wherever it is written: 'vayehi', it refers to a situation of distress. "Now it was in the days of" also refers to distress. Certainly "Now there was the day" refers to a day on which there is distress and this is [referring to] Rosh Hashanah [the Day of Judgment], a day on which harsh judgment is on the world.

---EDIT AFTER FURTHER RESEARCH---
i found this on Wikipedia

According to the Targum Yerushalmi (Job i. 6, ii. 1) the two councils of heaven took place respectively on Rosh ha-Shanah and Yom Kippur

hence it could have been in as little as 10 days. (plus a bit).
and from testament of job chapter 5 verse 9 (link here):

Thus I endured for sever years, sitting on a dung-hill outside of the city while being plague-stricken.

i believe that is supposed to be "seven".
and from "Eduy. ii. 10" ( no clue what that is - link here )

Job's sufferings lasted twelve months
Answer: According to biblical scholars who include James Glentworth Butler, The Bible-Work: Old Testament, Vol. 4- Job suffered approximately 60-80 years- the equivalent of our contemporary lifespan. Susequently, that time, added to 140 yrs referenced in the scripture, excluding his tribulation yrs, would mean that Job lived to be about 200 yrs old.
Comment: Welcome to Biblical Hermeneutics SE, thanks for contributing! Be sure to take our [site tour](http://goo.gl/5U2gsX) to learn more about us. We're a [little different](http://goo.gl/wCxRAv) from other SEs. This is an excellent reference If you have a moment to [fully cite it](http://goo.gl/VRkT4c), this would be highly appreciated!
Comment: Please summarize the argument of the source. Here it is just as important that we understand the [process of finding the answer as the answer itself](http://meta.hermeneutics.stackexchange.com/a/846/). What does Butler base his assertion of 60-80 years off of? What are his key arguments?
Answer: It is unknown the only clue we have is in:

Job 7:3 So am I to possess months of vanity, and wearisome nights are appointed to me.

From that text we can only say two months at least, although it could be much more months than that. For the word months itself mean more than one.

How long did Job's tribulation last?


How do I reverse the order of the pages in a pdf file using pyPdf?

Question: I have a pdf file "myFile.pdf". I would like to reverse the order of its pages using pyPdf. How?
Comment: @Tom: What I've tried so far was kind of similar to nosklo's answer. We both had the same bug (I/O operation on closed file). The reason is of course that we both used `output_pdf` after closing it. I've just fixed his solution.
Answer: from pyPdf import PdfFileWriter, PdfFileReader
output_pdf = PdfFileWriter()

with open(r'input.pdf', 'rb') as readfile:
    input_pdf = PdfFileReader(readfile)
    total_pages = input_pdf.getNumPages()
    for page in xrange(total_pages - 1, -1, -1):
        output_pdf.addPage(input_pdf.getPage(page))
    with open(r'output.pdf', "wb") as writefile:
        output_pdf.write(writefile)

Comment: Thanks for this, it helped me to identify my error causing I/O Operation on a closed file: You have to keep the PdfFileReader open untill PdfFileWriter is done writing.  (Counter-intuitively, to me).  Presumably this is because the writer doesn't actually seek the data from the reader's pages until it needs to, for improved performance.
Comment: This obviously works, but wouldn't it make more sense to use `range(total_pages, 0, -1)` instead?
That way you'd eventually even be able access the pages by number at any time of the iteration without confusion.
Answer: Thanks for sharing suggestions. I used them and edited a bit to make the interface more graphical when selecting and saving a file. New to all of this and what I added might not be efficient or clean, but it worked for me and thought to share.
from PyPDF2 import PdfFileWriter, PdfFileReader
import tkinter as tk
from tkinter import filedialog
import ntpath
import os

output_pdf = PdfFileWriter()

# grab the location of the file path sent
def path_leaf(path):
    head, tail = ntpath.split(path)
    return head

# graphical file selection
def grab_file_path():
    # use dialog to select file
    file_dialog_window = tk.Tk()
    file_dialog_window.withdraw()  # hides the tk.TK() window
    # use dialog to select file
    grabbed_file_path = filedialog.askopenfilename()
    return grabbed_file_path

# file to be reversed
filePath = grab_file_path()

# open file and read
with open(filePath, 'rb') as readfile:
    input_pdf = PdfFileReader(readfile)

    # reverse order one page at time
    for page in reversed(input_pdf.pages):
        output_pdf.addPage(page)

    # graphical way to get where to select file starting at input file location
    dirOfFileToBeSaved = path_leaf(filePath)
    locationOfFileToBeSaved=filedialog.asksaveasfilename(initialdir=dirOfFileToBeSaved, initialfile='name of reversed file.pdf',title="Select or type file name and location", filetypes=[("pdf files", "*.pdf")])
    # write the file created
    with open(locationOfFileToBeSaved, "wb") as writefile:
        output_pdf.write(writefile)

# open the file when done
os.startfile(locationOfFileToBeSaved)

Answer: As of (long before) January 2019, pyPdf is no longer updated, and upon testing is not compatible with (at least) Python 3.6, and likely at all with Python 3:
In [1]: import pyPdf
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-bba5a42e9137> in <module>
----> 1 import pyPdf

c:\temp\envminecart\lib\site-packages\pyPdf\__init__.py in <module>
----> 1 from pdf import PdfFileReader, PdfFileWriter
      2 __all__ = ["pdf"]

ModuleNotFoundError: No module named 'pdf'

(Moving the __all__ assignment above the import fixes this specific problem, but other SyntaxErrors due to Python 2 syntax then pop up.)
Fortunately, its successor project, PyPDF2, works cleanly on Python 3.6 (at least). It appears the core user-facing API was intentionally maintained to be compatible with pyPdf, so nosklo's answer can be used in modern Python after a pip install PyPDF2 just by changing to PyPDF2 in the import statement, and switching xrange to range:
from PyPDF2 import PdfFileWriter, PdfFileReader
output_pdf = PdfFileWriter()

with open(r'input.pdf', 'rb') as readfile:
    input_pdf = PdfFileReader(readfile)
    total_pages = input_pdf.getNumPages()
    for page in range(total_pages - 1, -1, -1):
        output_pdf.addPage(input_pdf.getPage(page))
    with open(r'output.pdf', "wb") as writefile:
        output_pdf.write(writefile)

I would also recommend the more Pythonic approach of just iterating over the pages directly using reversed:
from PyPDF2 import PdfFileWriter, PdfFileReader

output_pdf = PdfFileWriter()

with open('input.pdf', 'rb') as readfile:
    input_pdf = PdfFileReader(readfile)

    for page in reversed(input_pdf.pages):
        output_pdf.addPage(page)

    with open('output.pdf', "wb") as writefile:
        output_pdf.write(writefile)

I don't know if this .pages collection was available in the original pyPdf, but arguably it doesn't really matter much at this point.
Answer: Works in 2023:
from pypdf import PdfWriter, PdfReader
output_pdf = PdfWriter()

with open(r'input.pdf', 'rb') as readfile:
    input_pdf = PdfReader(readfile)
    total_pages = len(input_pdf.pages)
    for page in range(total_pages - 1, -1, -1):
        output_pdf.add_page(input_pdf.pages[page])
    with open(r'output.pdf', "wb") as writefile:
        output_pdf.write(writefile)


Is it safe to drink the whey?

Question: If you make cheese with starter culture and rennet is the whey that is a byproduct of this process safe to drink? I have heard from some that there does exist some who are fond of drinking this but I'm not sure if the whey from rennet is safe?
Comment: If you don't want to use it as-is, you can make ricotta from it : https://www.fiascofarm.com/dairy/ricotta.html
Answer: Whey is an excellent source of protein and whey protein in particular is used in many body-building supplements.
Please see the excerpt below from  FARMcurious .

Drink Up! – The acidic tang of whey may be a bit of an acquired tasted but I actually find it refreshing.  Cultured whey has pro-biotics that can help balance the microflora in your gut as an extra bonus to the protein.

The web page gives a lot of information about whey and the many other uses for it as well as a great tip for storing.
Hope this helps!
Answer: Whey is an excellent element when making soup.  I generally use it with home made stock. It adds complexity in a good way.

Is it safe to drink the whey?