Why can temperature changes have units of either degrees Celsius or kelvin?

Question: One equation to calculate a heat change is $q = c_p \cdot m \cdot\Delta T$. I know that $\Delta T$ can be in either degrees Celsius ($^\circ{}\mathrm{C}$) or kelvin ($\mathrm{K}$). However, one thing that confuses me is how the units cancel if $\Delta T$ is in degrees Celsius, since $c_p$ has units of $\mathrm{J\ g^{-1}\ K^{-1}}$. How does this work?
Comment: Welcome to Chemistry.SE! While in this case it is easy to grasp what you're asking, please include the definitions of all the quantities you are using in formulas in your future questions since this makes it easier for other people to understand your question and answer it.
Answer: The temperature in kelvin is equal to the temperature in degrees Celsius plus 273.
So, $\Delta T$ will be the same whether the temperature was reported in $\mathrm{K}$ or $^\circ\mathrm{C}$.  As an example if $T_\mathrm{initial} = 0\ ^\circ\mathrm{C}\ (273\ \mathrm{K})$ and $T_\mathrm{final} = 100\ ^\circ\mathrm{C}\ (373\ \mathrm{K})$, $\Delta T$ is 100 degrees no matter whether you used $^\circ\mathrm{C}$ or $\mathrm{K}$ in your computation.
Comment: Alright now I would want the person who flagged this as VLQ enlighten me of the issue this answer has. This answer is what the OP looked for!
Answer: Elaborating Ron's answer through a concrete example, we start by looking at the Celsius scale
$$ T_\text{C1} = 25\ \mathrm{^\circ C} ,~ T_\text{C2} = 100\ \mathrm{^\circ C}$$
Thus, we obtain
$$ \Delta T_\text{C} = T_\text{C2} - T_\text{C1} = 100\ \mathrm{^\circ C} - 25\ \mathrm{^\circ C} = 75\ \mathrm{^\circ C} $$
In a similar fashion, using the Kelvin scale
$$ T_\text{K1} = 298.15\ \mathrm K = (273.15 + 25)\ \mathrm{K},~ T_\text{K2} = 373.15 = (273.15 + 100)\ \mathrm{K}$$
Thus, we obtain
$$ \Delta T_\text{K} = T_\text{K2} - T_\text{K1} = (273.15 + 100)\ \mathrm{K} - (273.15 + 25)\ \mathrm{K} = 75\ \mathrm{K} $$
As you can see, the constant offset of 273.15 between the Celsius scale and the Kelvin scale cancels, and the difference is exactly the same. The units remain, but the numerical value of the difference is the same.
Comment: Or, to put it another way - when using temperature differences $\Delta T$, the degree Celsius and the kelvin are equivalent units since $1\ ^\circ \text{C}$ and $1\ \text{K}$ represent the same temperature interval. $1\ ^\circ \text{C} \equiv 1\ \text{K}$
Comment: Good clearification!
Answer: If your specific heat has units of degrees Celsius in it then use the temperatures in degrees Celsius to find $\Delta T$. Although, the difference would be exactly the same as if you used kelvin as 1 degree difference is the same on both scales. Nevertheless, I would discourage using degrees Celsius as the SI unit is kelvin and is the one that's normally used.
Comment: Note that both the kelvin and the degree Celsius are SI units.


Membership Report Issues

Question: I have a discrepancy of 15 contacts between reports and need help figuring out where the error is. The Membership Summary is showing 1,108 members and yet the Membership Detail Report is showing only 1,093 records. Can someone please tell me why there is a discrepancy and how to fix it. Thank you!
Comment: Welcome!  Unfortunately, this isn't enough information to answer your question.  Could you edit your question to show some screenshots of your filters and especially your grouping on the summary report?  Are you perhaps grouping by member, and 15 members have 2 memberships?
Answer: Agree with Jon. I would also guess that there are contacts in your database who have more than one membership. Membership reports are based on the object membership, so they count these rather than only the contacts attached to them. But screenshots would be helpful.

Membership Report Issues


Can antiviruses scan /var

Question: I was wondering if antiviruses could scan /var or if it was off limits i am trying to understand how antiviruses work and there impact on the file system and any limitations imposed on scanning ability
Comment: What makes you think they can't?
Comment: @MechMK1 As he mentioned, he's trying to understand how antivirus scanners work ;)
Answer: First, you must understand what /var is. It's not a different kind of file system, but a location in the Filesystem Hierarchy Standard (FHS) for storing...

Variable files—files whose content is expected to continually change
  during normal operation of the system—such as logs, spool files, and
  temporary e-mail files.
/var
    |- log/ - System log files
    |- mail ->spool/mail/
    |- run/
    +- spool/ - for programs in which data files are stored
        |- at/
        |- cron/
        |- mail/
    |- tmp/

There's no limitations preventing an antivirus from scanning in /var, but it would not be wise to scan log files etc. On the other hand there might be several locations that could be meaningful to scan, e.g.

If the mail spool is Maildir based, it's possible to scan mail for viruses on filesystem level and take immediate action. On the other hand removing viruses from mbox based system might break something.
If there are public web sites stored in /var/www, scanning that location might prevent a web server from distributing malware.
Comment: @Giles So /var is just another directory in the file system and can be used to store anything ranging from a file with hello in it to a C program but why does it require you to have root privileges in order to copy whatever? I figured this was for all directories however i tested it with /tmp and it copies over without root why is this? Sorry for being such a bother just trying to get my head wrapped around this
Comment: Can someone store a text file or C program in /var ? i have tested this out by creating a Python script and copying it over to /var however it required root to copy so my guess is you can however wanting to verify
Comment: @Joe Yes, of course. `echo "This is a text file." >/var/tmp/hello.txt`
Answer:
I was wondering if antiviruses could scan /var

As antivirus programs either run as a kernel mode driver or as a privileged file system filter driver, it is be able to scan the /var directory on the file system.

I am trying to understand how antiviruses work and their impact on the file system

Most antivirus software will scan upon file write operations. Performance depends on the file size that is being written to disk.
It also depends on the configuration of the antivirus software itself, such as heuristic scanning, compressed file scanning and file type exclusions as these functionalities might consume more or less processing power and memory, depending on their settings.
Comment: If i am understanding you correctly as long as the antivirus has the proper permissions it can scan /var or any other directory/file? does this apply to system directories and files as well? also what do you mean by "upon file write operations"  ?
Comment: That's correct. What mean by "upon file write operations" is when a file gets written to disk, it will first be scanned  by the antivirus software.
Answer: I suspect the key piece of understanding you're missing here is the general concept of file permissions.
In the simplest case, imagine a PC, whether it's running Windows or Linux or any other OS, with a single hard disk (or, these days, SSD). That disk contains a hierarchy of directories and files, including those critical to the running of the system, user-installed programs, configuration files, log files, and whatever else the user creates.
To make it harder to accidentally or maliciously damage the system, or affect other user's files on a multi-user system, the OS will enforce different permissions on different parts of that hierarchy. For instance, each user may have a "home directory" which they "own", and have the ability to write to at will, but which is "off limits" for other users. Core files needed to operate the system will only be accessible by privileged users (e.g. "Administrator" or "root"), or in special security contexts (e.g. "UAC" or "sudo").
These different sets of files won't generally be hard-coded in the OS, they will just be permissions stored against every directory and file in the system. There is generally no single definition of "system files", there are just files with restrictive permissions because changes to them could have serious consequences.
The next thing to understand is that as far as the OS is concerned, every program is being run by a particular user, or in a particular security context, but that is not necessarily a context you can run things in manually.
So to get to your specific example:

/var is a directory which, by convention, is used for various log files and temporary system state on Unix-like systems. Like any other directory, it has permissions specifying who can list its contents, read from, and write to it. The files and sub-directories within it likewise have permissions. Other than that, there is nothing inherently different about it.
/tmp is a different directory, used by convention for disposable temporary files, which has different permissions. Specifically, it has unusual permissions which allow users to create files there, but not read each other's files. It's not technically "special", though, as any directory could have those same permissions.
It happens to be useful for most systems to set the permissions such that "ordinary users" can write new files in /tmp, but not in /var.
An antivirus program, by the nature of its purpose, needs access to anywhere in the system that a malicious program might be, or where malicious activity might happen. It is therefore likely that it will run in a security context which allows it access to all parts of the file system. This doesn't generally require changes to how the file system or security system normally operate, but does mean that the antivirus program will be more "trusted" than other programs on the system.

Can antiviruses scan /var


keyboard wont work!

Question: I have recently installed elementaryOS on to my sisters HP streampad as the dreaded windows killed the system with updates.
Everything seems to work fine however the keyboard does not work and im at a loss with it.
It works fine in the bios which is UEFI but not once the OS is loaded?
I have looked around online but nothing seems to work. Any help would be greatly appreciated.
Answer: You might want to check this site
It says:

The Secure Boot option needs to be disabled within the UEFI setup menu.
  A OTG adapter and powered USB hub with an external mouse and keyboard are required to do the installation.  An un-powered hub may work but it will read the USB drive slowly and may fail reading it since the Stream's USB port provides very little power from the internal battery.

This might do the trick for you and maybe trying after the installation ends to see if it detects the KB.

keyboard wont work!


Ramban - Every sin deserves more suffering than Iyov received

Question: Where does the Ramban say that in reality we deserve more suffering than Iyov received for every sin we do and it is only because of Hashem's incredible mercy that we don't get anywhere near what we deserve?
Comment: After you're satisfied with the answer, it seems that you should change the question as it misinterprets the citation. Rambam only says that suffering in this world is better in his view than suffering in Hell, **he doesn't say every one of us deserves the suffering of Job**.
Answer: You might be looking for this from the Ramban's introduction to Job:

ולכן הצדיק הגמור שיארע לו החטא הקל ועבר בזדון על מצות בוראו ית' עכ"פ ראוי ליענש עליו, והנה אם יאבד האל מגופו בעה"ז כל הטובה אשר נהיתה בעולם ויהי' נידון בייסוריו של איוב כל ימיו, טוב לו משיענש בנפשו להיות נידון בעול' הנשמות בייסורי גיהנם
A totally righteous person who happened to intentionally transgress his creator's command is still worthy of punishment. If God took from his body all the good that ever existed and judged him with Job's suffering, it's still better than being punished in the world of souls with the suffering of hell.

(The world of souls is a spiritual existence separate from the resurrection, according to the Ramban in Sha'ar Hagemul.)
He doesn't say that it's only because of God's mercy that we don't get what we deserve. On the contrary, we do get all that we deserve after death. His point is that a totally righteous person, such as Job, shouldn't be punished at all in this world. If he had sinned, his suffering wouldn't be such a problem, since it could be attributed to his sins.
There are parallel passages on Job's suffering in the Ramban's Sha'ar Hagemul and sermon on Ecclesiastes.


Documentation second opinion?

Question: Is https://blender.meta.stackexchange.com/questions/ask a good place to get second opinions on changes being made to documentation?
Comment: But that is if you are new and submit patches. I have access to push the .diff files myself without external permission. Besides, I have a feeling that the developers have better stuff to worry about than grammer/ minor documentation edits.
Comment: Also note that part of the reason patches go through a "review" process on phabricator (developer.blender.org) is for exactly this purpose. You'll likely receive some feedback there as well.
Comment: Even with push rights, it can be a good idea to put large/potentially controversial changes through review anyway. Anyone can pitch in with the review process, and there is a special "documentation team" (with a number of non-developers) who look at submitted patches. For smaller stuff of course, a quick question in `#blenderwiki` on IRC or in B.SE chat can't go amiss..
There's also the bf-docboard mailing list, which is useful for calling attention to something or to get an authoritative opinion, e.g. if you have a proposal for drastically changing the structure of the docs or something.
Answer: No.
BSE and our meta has no connection (aside from whatever users contribute to both) to blender's official docs. Posting a change to blender's doc on the meta here will never make it into a change.
Instead if you found something that needs fixing, just edit it yourself.
Gandalf wrote up a great post on how to get started
Improving the Blender manual.
Even if you don't want to go through the whole process to edit the manual yourself you still should not post your changes on the meta here. You can report problems here: https://developer.blender.org/project/board/53/

If you just want a quick second opinion to a change (not too large) I would recommend you head over to our site's main chat room or more appropriately the Manual Project room (the reason I say the renderfarm first is because there is always somebody there); and post your change in there.
Comment: im looking for a place to get feedback for things im changing in the manual. I know how to make the changes, but im not always sure that they are good changes.
Comment: @eromod take a look at my edit
Comment: just what I was looking for, ty
Comment: I would say one of the main places to contact those in charge of documentation is via the [bf-docboard mailing list](https://lists.blender.org/mailman/listinfo/bf-docboard)

Documentation second opinion?


Plone / Zope / ZEO on SSD - Recommendations

Question: I'm evaluating a new server for our Plone / Zope Installation (3.2GB Data.fs and 7.4GB blobstorage). The installation serves mostly authenticated requests and has lots of edits (Intranet and eLearning environment). I'm thinking about running the ZODB (with ZEO) on a RAID1 with two SSD disks to speed up the site and the edits. But the informations I could find on the Internet about SSDs in servers are still quite sparse.
I have a few related questions:

Is it recommended run ZODB on SSD disks?
Does anyone have approximate estimations on the performance difference of running on SLC SSD disks compared to a RAID5 array with 5 15k SAS disks?
Is RAID1 on SSD disks advisable? I'm a bit concerned about the possibility that both disks might fail at the same time.
Does anyone already run a similar setup in production? What are your experiences with it?
Answer: Perhaps this post will help.
I'd say go with spinning disks in RAID for now for production. I'd recommend only using SSDs for sacrificial things, or maybe for read/write cache drives for ZFS.


Penetration Testing of IaaS/PaaS environment - CVSS Score

Question: How can I measure the effectiveness of a Penetration Testing carried out in a Cloud Environment (IaaS/PaaS) by a third Party Vendor ? Should I ask for a CVSS score or something else ?
Any advise will be highly appreciated.
Answer: TL;DR - You should receive a report from the penetration-tester which will evaluate the security of the systems you're running, usually they will use a CVSS score to judge how vulnerable something is.

If you've had a professional pen-test they ideally will produce a report on the issues they found, how they exploited the issues and of course how critical those issues are. This is typically done with a CVSS score as it's a good way of measuring how bad the vulnerabilities are.

The Common Vulnerability Scoring System (CVSS) is a free and open industry standard for assessing the severity of computer system security vulnerabilities. CVSS attempts to assign severity scores to vulnerabilities, allowing responders to prioritize responses and resources according to the threat. - Wikipedia

So in short, yes ideally they should be giving you CVSS scores, you should also receive their report which will detail their findings from that you will be able to work out how to fix it. Obviously some common-sense is required, the pen-tester can only evaluate what they know; like every human they can be wrong, so when reading through their report just make sure it all makes sense & you can evaluate the security yourself (to some extent) obviously the pen-tester is more qualified than yourself in identifying vulnerabilities so don't second guess everything they've told you, just make sure it makes sense.
Like everything, a lot of this depends on your threat-model if you're a small company and assume that you won't be getting hit by nation-states and he points out a flaw in a crypto suite you're running which only a nation-state could attack (and you know it will cost too much to fix) then maybe it's best you carry out an internal risk assessment on that. Just because they've produced a report doesn't mean you cannot produce your own and identify risks yourself - in-fact I'd encourage it. It makes no sense for a company to patch everything (if they cannot afford it) just be aware of the pen-testers level of expertise.
In essence, it all comes down to Risk Analysis


100A sub panel from 150A Service at Body shop

Question: I'm running 100' away from 150A main Service panel to 100A sub panel, my question is: what wire gage shoul I use? Thanks
Answer: First, don't be pennywise about the size of the panel.  You want a lot of spaces.  Spaces go a lot faster than you think, especially with 240V equipment.  I like to finish an installation with more than 50% of the breaker spaces unused.   I mention that because 100A panels are usually quite small.
#1 aluminum will suffice, 100' is just shy of the 115' where you start thinking about a size bump for distance.  But if you're considering that...
One option is to go clear up to 150A, or 3/0 aluminum.  Why would you do that?  It makes the subpanel feed breaker in the main panel unnecessary.  The existing 150A breaker protects the wire and the 150A+ rated subpanel.  So you can just use thru-lugs or a subfeed lug kit  (a breaker that's just lugs).
Generally commercial work requires conduit - if you use metal conduit, that serves as a ground wire, and you don't need one.


Blank String Default Value in Entity Framework Designer

Question: Is it possible to assign a blank string (i.e. "") as a Default Value in the Entity Framework's EDMX designer? The only technique I've found is to edit the edmx file manually using a text editor
Answer: I realize that this is an extremely old question, but for posterity's sake, in the EF4 designer you can type a space in the properties window field, then hit backspace, leaving the field empty instead of the default value of (None).  For strings, this seems to default to String.Empty.
Answer: What I did was to create a default constructor in a partial class where I set
<code>_privateFieldName = string.Empty;
</code>
The partial class obviously would be in a different file and won't get regenerated by the designer.  The only downside to this method is that now any changes to the default value  in the designer will not apply
Answer: Yes, the only way that I've found to set an empty string as the default value is to edit the EDMX.  Editing the designer file doesn't work as the code is regenerated.
This is really a bug in the entity framework that needs to be addressed.
EDIT:  Actually, setting an empty string in XML is quite painful so it might be easier to just set the value to string.Empty in the application when creating a new entity.


How did Guilford survive the FLEIJA?

Question: In the Second Battle for Tokyo, Suzaku fires a FLEIJA which destroys a vast amount of the settlement. Guilford pushes the Shinkiro out of the blast radius and is absorbed. How could he  have survived? My only thought is last minute ejection, but I would like a solid answer or other theories that seem plausible.
Answer: I recently re-watched the episode in question and I noticed that it does not show Guilford actually being consumed by the FLEIJA. Upon close examination the blast actually stops just short of were he would have been floating. This could have easily allowed for a quick ejection or a use of the thrusters, attached to the back of the float system, which he could have used to escape. After that, if Guilfordhad used the thrusters, he would have been caught in the minor vacuum which would most likely have destroyed his Vincent and it would have prevented him from returning.
Comment: And he is shown SEVERELY injuried MONTHS after that.
Answer: If he had been hit by the FLEIJA Guilford and his mech would have been annihilated. Since we later see him again, we can only conclude that he must have been close to the explosion but didn't get hit.
Most likely the communication system of his knightmare frame malfunctioned after being so close to the explosion which is why the video feed to Lelouch's mech suddenly stopped.
Presumably his mech then crashed and caused the injuries which we later see.

How did Guilford survive the FLEIJA?


Raspberry Pi Camera Taking Takes Blurry Pictures

Question: I just got a camera for my raspberry pi 3, more specifically the Arducam 5 Megapixels 1080p Sensor (https://www.amazon.com/gp/product/B012V1HEP4/ref=ppx_yo_dt_b_asin_title_o01__o00_s00?ie=UTF8&psc=1) link for clarification. After having some issue getting the camera to detect, I was finally able to take a picture and they came out blurry. I don't believe it is a focus issue are everything seems blurry regardless of distance from the camera.
Images for reference:

When I open the image through the pi's gui it says that the image is 2592x1944. I'm not very familiar with cameras either so if its something related to the camera itself please explain in detail. Thanks in advance!
Answer: While it's impossible to rule out all other possibilities, I suspect the issue is simply that your camera is out of focus. It was the issue in my case, and it's a well-known problem - or fact, if you prefer: the cameras are shipped with an odd focus plane setting. Re-focusing is what you should try first. Here's a how-to-do-it link, and there are many others available for the cost of a Google search.
If re-focusing doesn't cure the issue, let us know.
Comment: I tried using the method described in your link but could not get the lens to budge even an inch. I found myself starting to scrap up the lens so I decided to stop that method. I've found this tool on Thingiverse that I will try out. https://www.thingiverse.com/thing:1574661
Comment: Yes, it can be incredibly stubborn. And since it's plastic, you have to be careful about applying too much force, or in the wrong place. If you can inspect the lens under a magnifying glass, it may help you see the tabs that rotate the lens.   It does rotate, unless your lens was defective, so be persistent.
Comment: @S.Landerkin: It's just occurred to me that you may not have received the comment I posted a couple of days ago as I didn't put your handle in it.
Comment: thanks for the comments! I ended up getting it to work with your help, a shame that it takes so much effort to get it right though, it's so fragile it had me nervous the whole time. Again, much thanks!


Martial Arts Technique Against Knife Attack

Question: Are there any specific Martial Arts technique (taekwondo, kung fu , judo etc) that an individual can use to save himself from knife attack, especially if there are 2-3 individuals armed with a knife.
Comment: Give them the wallet. It is unlikely that 3 people will attack with knives with the sole purpose of killing you, more likely that they want your money. Give it to them.
Comment: In such a situation, assuming that Gun Fu is not an option, I recommend a judicious retreat. 2-3 people is bad odds to start with. Add weapons and you would have to be lightyears ahead of them to come out unscathed.
Comment: Check out the Filipino martial arts.
Comment: An exercise that has has been repeated by many people over the years is for one party to put on a cheap white tshirt, and another to "attack" them with some kind of felt tip pen used like a knife. Once the attacker is defeated the tshirt is examined to see how many times the defender was maimed/killed. the almost universal answer was "bloody loads". (Very occasionally the defender might manage a fluke "instant" victory.) There is no reliable anti-knife syllabus that doesn't involve being at least equally well armed.
Answer: There's no one "technique" here, there's a lot of techniques and principles and all of them are absolutely dependent on the situation and specific.
Run
Being outnumbered, and against knives, escape is the best option.  If you cannot leave the vicinity, the next best option is to get something between you and your attackers - preferably walls and a locked door, though, obviously that may not be possible - in which case even a fence, a light pole, a mail box, a parked car can buy you precious seconds towards your next action.
Other Principles
Get a weapon of your own as soon as you can.  Disarm the threats as soon as possible ("Disarm" may mean getting the weapon away from them, breaking their hand, knocking them out, cutting muscles they need to attack you, etc.).  Maneuver the opponents into each other so you're not facing attacks from every direction at once.
Everything else?  Dependent on your situation of the moment.  Some martial arts do focus on blade fighting and against multiple opponents - penjak silat, escrima, kali, a lot of the more combative modern schools also include useful training - Systema, Krav Maga, etc.
There's no one technique, there's entire sets of training towards dealing with that situation.
Comment: +1 for "Run". There are very few ways to get out of a knife fight without at least a few nasty cuts, and this is your absolute best bet...
Answer: Yes. Dozens. Probably hundreds.
Tomiki Aikido regularly practices defense against knife attack; students are required to defend against knife attack at every test.  Students are also required to defend against multiple attackers at every test.  There are several kata that focus on defense against knife (Koryu dai san no kata in particular includes at least 8 defenses against knife attack).   I personally am very fond of either shomen ate, or Kote Gaeshi.
I should however point out several things.

Tomiki aikido trains against knife attacks that were common during the period when Professor Tomiki was normalizing the curriculum.  There was a problem with gangs using knives at the time, and it was incorporated into the curriculum.  There are other issues here that are probably worth an entire essay, but I'll stop now and merely note that every knife attack carries with it a host of assumptions about motivation, environment, etc.
Possibly the largest class of knife attacks are thrusts. Thrusts are thrusts whether they are done with fist or knife. Anything you do to divert the blow and seize control of the attacker is a defense against a thrust whether that thrust involves a knife or a fist.  (almost) everything I do in Tai Chi to defend against a strike will work against a knife.  I'm sure this is largely true for other forms.
Knife attack is a diverse group.  Some attackers use a knife to kill. Others use the knife to wound and weaken.  Knife attack is different from knife fighting.  In my personal experience, I've found that I have reasonably good success against people who are trying to kill me with a knife, significantly less success against people who are trying to score a point (in a tournament) and almost no success against a clever knife fighter who is using the knife to draw blood, demonstrate dominance or bleed to weaken.
"save himself" (or herself) is a loaded term.   My assumption is that if my opponent has a knife and is at all competent, I'm going to get wounded.  The only thing I can control is who is standing at the end of the fight, and who controls the knife and the opponent.
Comment: Tomiki's system of teaching Aikido is called Shodokan not Tomiki Aikido.
Comment: That is a subject of debate. Tomiki called it "Aikido"; I believe all of the Menkyo's simply state "Aikido". My teacher called it "Tomiki Aikido", and I'm following his example.
Comment: Tomiki called it [Shodokan Aikido](http://en.shodokanaikido.com/about-shodokan/). I am not sure which menkyo you refer to.
Comment: Then I fall back to "I am using the term my teacher used". OTOH, I'm not sure that this distinction is important.
Comment: [Duty calls](http://xkcd.com/386/). ^_~
Answer: I strongly recomend you to see "the human weapon" and its chapter about krav maga because they talk about it.
Comment: I'd advise that you expound a little bit about what the querent is likely to learn from the book.
Comment: {nods} Even mentioning in your answer that the episode in question (even better if you can link which episode it is) talks about how bodyguards are taught Krav Maga to defend against knife attacks is a step in the right direction.
Comment: Well, it's not a book but a TV show and they spend some time dealing with knive attacks and how do they train some people who is going to become bodyguard against it. I guess it's way easier to see it, because some information will be lost if I have to explain it myself


Day/swing trading: Making 30 USD per day with 10000 USD capital possible?

Question: Is it possible to make 30 USD per day starting with 10000  USD? How much risk would I have to take to get this return? What knowledge/skills do I need to get this return?
Comment: yes it is possible, if you pick winners 100% of the time. But if you were get $30 today (which is a 0.3% daily return), what is stopping you from losing $200 (a -2% return daily return which happens with a number of stocks every single day)
Comment: Yes, in FOREX with proper risk-management,~1-2% daily is easily achievable. However, you **have to put your time into proper education** in order to be able to reach this level of proficiency. See [my answer here](https://money.stackexchange.com/a/118085/66803) for calculation details.
Answer: Making even just $30 a day on a $10,000 investment would be 0.3% daily return, or 198% annualized (compounded daily), or 109% annual return without compounding.
You'd have to take some massive risk to get even such a seemingly small daily return, which would basically be doubling (or tripling if you could reinvest) your money every year.
$30 a week is a little more realistic, which would be a 17% (compounded weekly) or 15% uncompounded return.
Comment: Since he's asking for daily returns, and you can't trade on the weekend or on holidays, when computing `198% annualized (compounded daily`, should you only use the 251 working days in the year?  (Not that it'll change the ultimate answer.)
Comment: 198%  represents earning 0.3% daily, compounded for 365 days.  The OP asked about making a flat amount of $30 a day which would mean a return of 75% (251 trading days per year).  One would not have to take massive risk to make .3% per day.  One would only need to deploy a small amount of the $10k to do so.
Answer: Averaging a $30 per day gain on $10k generates a 75% annual return. If  you are referring to investing, that's rarely going to happen unless you happen to pick a lottery ticket winner.  For example, KRTX was up 750% in two days this week ($17.68 to a high of $152) due to the results of a clinical trial).  For normal people, expect 8% a year.
My take on your question is that you are implying a $30 return per day from trading.  Such a small amount seems like it's a no brainer.  A measly $30 per day!  Buy 1,000 shares of a $10 stock and all your need is a 3 cent gain on the stock (all done at a no commission broker). That should be easy peasy to achieve.  But it's not.
There are going to be days when the stock drops.  Many days.  For argument's sake, if you assume that your stock is going to rise when the market rises and it's going to drop when the market drops then you had more than 40% of down days in the past year.  At 60/40, assuming equal distribution, that means that you now need $150 per winning trade to average $30 a day.  So even though the risk target has increased, even $150 per day on a capital base of $10k seems reasonable.  That's only 15 cents per share on that 1,000 share trade.
But here's where reality sets in.  There are going to be some days when your stock drops more than the market does.  Infrequently, there's going to be some really bad news that takes a lot more away from you.  Will you be capable of cutting your loss and moving on?  Or will you suffer from 'breakevenitis' and become a Buy & Hope investor?  How many trading days will you lose, attempting to recover these larger loss?
It seems like a maddeningly simple premise to be able to make only $30 a day but it's far from it.  If you want something more tangible than my word, open a paper trading account at a major broker that accurately simulates the market (buying at the ask, selling at the bid and only getting fills when the stock trades actually at those prices).  Don't waste your time will a web site simulator which is no more than a game.  See if you have that magical ability to pick only winning stocks.  If you do, sign me up for your market picks new$letter.
Answer:
Is it possible to make 30 USD per day starting with 10000 USD? How much risk would I have to take to get this return?

The optimal stock market portfolio yields 8%. The risk-free interest rate is at 0% where I live (Eurozone). But let's say 3% because US conditions are different from Eurozone.
As the other answer calculated, 30 USD daily return is 198% annualized return, compounded daily.
A portfolio of risk-free investment at 3% and stocks at 8% yields (1-p)*0.03 + p*0.08 or in other words 0.03 + 0.05*p.
A portfolio that yields 198% annually or in other words 1.98 gives 0.03 + 0.05*p = 1.98 so p = 39. So, you have all of your money and then some at stocks. The risk-free investments would be shorted. Shorting the risk-free rate is equivalent to borrowing money. In this case, you need to borrow 380 000 USD at a rate of 3%.

What knowledge/skills do I need to get this return?

Neither. You need to find someone willing to lend you 380 000 USD at a rate of 3%. Then you invest the 10 000 USD and the borrowed 380 000 USD into stocks, yielding 31200 USD per year. You pay the interest of 11400 USD per year, leaving you with 19800 USD per year  which is 198% annual return.
Now, do I recommend this? Of course not, for most people! Borrowing 380 000 USD to invest into stocks is foolish because if the stock portfolio is down a mere 2.6% you will lose all of your money, until the stock portfolio returns to the level before the 2.6% drop.
Hint: stocks can drop by more than 50% and it may take 30 years for the stock portfolio to return to the level before the drop.
For someone who is very young, has a huge future income potential and a high current salary, borrowing just a little to invest into stocks might make sense. I have done so. Nevertheless, all of my loans are a mere fraction of the 380 000 USD, and about half of the loans are for housing and not for stock investments.
I would never ever borrow 380 000 USD myself.
Hint: if you explain you want to invest 390 000 USD into stocks and borrow 380 000 USD and invest the 10 000 USD of your own, you will find no willing lenders.
Comment: For starters, the other answer's calculation of 198% is incorrect.  My take is that the question implies trading not an investment portfolio.  Speaking of which, your calculation  is predicated on  borrowing $380k with $10k toward margin but then you say that there would be no willing lenders.  So what's the point of your explanation, doing what can't be done?


Failed DEM via Natural Neighbor in QGIS 2.14.2-Essen

Question: Following the indications of Monde Geospatial (https://www.youtube.com/watch?v=bLbY3iMBW-A) I created a CSV file with the altitudinal data (Google Earth) for 2182 total points and imported it into QGIS 2.14.2-Essen. I am stalled at the next step: DEM generation. The message "The following layers were not correctly generated. Grid" appears on the Natural Neighbour log console. Before the failed output and as the process is underway, I observed a "Can´t load requested DLL" appearing in the same console. I need help identifying the cause and, if necessary, seeking alternatives to Monde Geospatial´s method.

Answer: I get an error meassage that MrSID.dll can not be found, but it is not needed for Geotiff output, and I get the expected raster result:

Your project CRS is EPSG:4326, so the grid cell size should be in degrees. The default of 100 might be nonsense.
Comment: I noticed that some algorithms don't work properly if the units are degrees. Maybe because some internal values don't like small cellsizes. Try the same in a UTM CRS.
Comment: I followed Monde Geospatial´s instructions and replaced the default of 100 with 0.0005. Is this a reasonable cell size?


When should you use "despite" over "inspite", and vice versa?

Question: Most dictionaries suggest that inspite and despite are synonymous, but are there any specific instances when their usage is not interchangeable?
Comment: Related: [is it "despite" or "despite of"?](http://english.stackexchange.com/questions/5634/) (Scroll down to the second graph.)
Comment: @Reg: (+1)Nice post there, but I am still curious if there is any sentence or phrase where inspite cannot be replaced by despite or vice-versa.
Comment: "Despite" strikes me as a little bit more formal, but I can't think of any contexts in which they are not interchangeable. In older English, you could render "in spite of him" as "in his spite", but that would get you strange looks if you said it now.
Comment: Related ["Despite vs in spite of"](http://english.stackexchange.com/questions/122649/despite-vs-in-spite-of)
Answer: I would suggest that inspite — as written in your question — is not in fact a word.
I think you must mean in spite of, which is directly interchangeable with despite.

He went for a walk in spite of the rain.
He went for a walk despite the rain.

I am not aware of any real difference between the two options, though I tend to use despite purely for efficiency of words.
Comment: I agree - especially with "in spite" vs "inspite" - see here: http://www.wsu.edu/~brians/errors/inspite.html
Comment: Thanks for your link, @MikeGoatly; it's brilliantly concise.
Comment: Ya I have always been confused about space between 'in' and 'spite'. So what you mean to suggest is that in-spite cannot be without an immediate 'of'?
Comment: That's right. And without your hyphen, too. Three words: 'in spite of'.
Comment: On another note, spite means "to intentionally annoy, hurt, or upset." Any idea how does it connect to 'in-spite'.
Comment: Well, if you do something to spite someone, as you said it means you do that thing knowing that the person would wish you not to. Consider that person a situation - a rainy day, for example. The expectation on a rainy day is that you will stay in. If you go out in spite of the rain - it is like you are acting without paying appropriate respect/attention to the situation. It's crude, but I hope it helps.
Answer: It is true that "inspite" is not a word.  The difference between "in spite of" and "despite" is more in connotation than in efficiency:
"In spite of" usually connotes a degree of contempt or rebellion.  For example, one could say, "In spite of the supervisor's mandate, Pauline went out for lunch."  This suggests that Pauline does not think highly of the supervisor's mandate.
"Despite" is usually more of a neutral contradiction.  "Despite the supervisor's mandate, Pauline went out for lunch."  This shows that the supervisor has not affected Pauline's plan for lunch either way; she just doesn't care.
These ought not be confused with the infinitive verb "to spite", which is meant as a direct rebellion:  "I punched him in the face to spite him."
Answer: If you find a pair such as "despite sth" and the variant "in spite of sth" you may assume that the shorter one is in current use and the longer one on the wane. There is no difference between the two, according to Longman DCE.
Comment: _In spite of_ and _despite_ are in fact more or less equally common. Neither is on the wane.
Comment: @JanusBahsJacquet  I did not check it before, I said it from general observation. But now I checked Ngram viewer and it confirms my view.


No food deliveries in my prison

Question: I have a huge prison with a working canteen and kitchen but I'm getting no food deliveries. Is it a bug or am I being stupid.
Comment: Could be either, for all we know right now. Can you take a screenshot of the whole thing, so we can see what the problem is? (You can upload it to imgur or something, and post it in the comments here, and someone, probably me, will add it to your question)
Comment: Do you definitely have a delivery area that can be accessed from the road and kitchen and isn't full?
Comment: @Nelson868 When you don't require an answer anymore, then please either self-answer the question by posting an answer yourself or delete it.
Comment: I have a delivery area and all is well but looking at other solution I figured out that it is a reset bug that can be resolved with getting more prisoners, but thanks for the help anyway.
Answer: I have had the same problem
You need to go into logistics and click on food distribution then there should be a yellow line between the kitchen and the canteen
If there is no line then click on the kitchen and the  canteen
Comment: Also make sure there are cell blocks assigned to use that canteen (red lines in the logistics screen). If no prisoners are assigned to a canteen the kitchen will not cook food for it even if the kitchen and canteen are linked properly.

No food deliveries in my prison


How can I create woodcut illustration in Illustrator and/or Photoshop?

Question: Are these illustrations done manually by hand or in Illustrator?
Is there a easier way to reproduce these kind of illustrations?

More examples here.
Comment: Given that the collection is called "Scratchboard art", I'd guess those examples are done by hand.
Answer: I think those are like comic book drawings, whether on paper or on Illustrator both cases they are manually drawn.
However there's an easy way to create something close to that on Photoshop using filters, here's how:
Open the desired image in Photoshop:

From Filter menu go to Filter Gallery --> Sketch --> Graphic Pen:

Play with the numbers (Stroke Length - Light/Dark Balance - Stroke Direction) until you get the best result:

Hope you find that useful :)
Answer: While I think your examples are hand crafted scratchboard illustrations. If you are looking for something automated and quick, Alpha Plug Ins has the Engraver II plug in which is designed to generate some scratchboard-like appearance.
Comment: [![Engraver III](http://i.stack.imgur.com/VQ9rG.jpg)](http://i.stack.imgur.com/VQ9rG.jpg) Engraver plug-in indeed are powerful. But Engraver II is obsoleted as I can see. Now [Engraver III](http://www.alphaplugins.com/products/products.php?menu=get_prod_id∏_id=2) is available
Answer: All the drawing techniques you have described are all hand-created. Although one could argue they are all graveur- engraved- they all have different media and methods of accomplishing the art. The archetypal "engraved" image as you might see in 19th-century books and high-quality prints is called scratchboard, sometimes called "scrapeboard". You would be well advised to read up a little on what scratchboard is, how it is done and why (to replicate near-photo-quality for cheap in mass production prints). So- one hint right there- scratch-board has a basis in B & W photography.
Now- how can this be automated somehow? IMHO Engraver and actions are a simplistic mimicry of real "graveur"- it's not my cup of tea. But- the picture illustrates how it works. Engraver appears to render darker tonal areas using different crosshatch. There are plenty of hand-engraving  cross-hatch explanations and examples on the internet tutorials and explanations on the web about the common half-toning & crosshatch techniques.
Returning to the Engraver treated image given in the Answers- it first seems overwhelming. But no- it is a black and white image then tinted. If you desaturate it- you get a black/grey & white photo with what I'd argue as white, 50% grey, and black. In negative space about the hand- the extreme background- is a horizontal set of wavy parallel lines in mid-grey with some randomized defects and discontinuities applied to give the appearance of hand-drawn. the hand is a photo on top of this. with its hand covered in a layer of wavy parallel lines approx 30 degrees parallel- we'll call this background hatch 1- BH1. BUT- where the white; 25%; & 50% grey occurs- BH1 is not present. In areas of 75% grey to black- BH1 is cross-hatched via perpendicular series of parallel lines (foreground hatch 1: FH1) in black. Yet- where black occurs a rule is displayed: BH1 is inverted (turns white). So- from this analysis we can see that: 1- the hatching follows strict rules and can be accomplished easily in PS or Illustrator via replicated parallel lines with some randomness. These hatchings can then be hidden or brought to prominence, say via masks or (my old-school brain way would be use "Eraser"). If an action- a set of predefined algorithms and commands can do it- then the greatest computer on the planet- that between our ears can do it too. It might not be done at the flick of a switch (little bit cheating IMHO) - but a comparable effect can be accomplished in PS or Illustrator.
I am a designer, very much old-school in my approach to Illustrator and drawing, I got very interested in Duerer and silverpoint and other old masters and now trying my hand to scratchboard. I suggest Youtube search on scratchboard a great start for resources on scratchboard and engraving- it will demystify it and you can see how it's not as overwhelming as it first appears. And it's far from a dead or lost art
Michael Halbert draws Ben Franklin .


Place 28 dominoes in a loop

Question: A standard set of double-six dominoes has 28 tiles with 2 numbers on each side from 0 to 6. Tiles can be placed next to each other if the numbers at each end match. Can you place all the 28 tiles such that they form a loop? Note that the end number must also match the front number to complete the loop.
Answer: Note that

 the numbers, $0-6$, are elements of the finite field $\mathbb{F}_7$.

So there are

 circles like this: $(0)(d)|(d)(2d)|\cdots|(6d)(0)$ for every $d\in\mathbb{F}_7^\times$.

Now just

 connect all the circles, and insert the remaining $7$ tiles of the form $(d)(d)$ anywhere you like.

The final answer:

 00 01 11 12 22 23 33 34 44 45 55 56 66 60 02 24 46 61 13 35 50 03 36 62 25 51 14 40
Comment: You don't need the finite field, as any set of cycles will do. It is essentially an Eulerian circuit through a complete graph (with a loop on each vertex), and the method you describe is a general algorithm for any graph that admits a Eulerian circuit.
Comment: That is correct! Great answer.
Comment: @JaapScherphuis Of course I understand the interpretation of eulerian circuit on the complete graph, but the question is exactly to describe such a circuit, right? And I found it most convenient to interpret it as finite field elements... So I don't quite get your point.
Comment: @JaapScherphuis Well... upon carefully reading the question, it does say "Can you place ...". So perhaps you mean a better answer should be "yes I can, because $7$ is an odd number"?
Comment: I just meant that you can just start laying out a line of dominoes until you can't extend it any further. At that point it will be a circle (yes, because 7 is odd). It just seemed to be so oddly specific to construct the circles the way you did, making it seem as if there was a reason for it, as if only those circles will do.
Comment: @JaapScherphuis From my point of view, I produced all needed circles by writing down only one, which is a quite compact way of expressing. A solution is a solution, there is nothing "oddly specific" about it, and nobody says "only those circles will do".

Place 28 dominoes in a loop


Make a video look like it was taken from further away

Question: I have a telephone video recording I would like to edit to make it appear it was taken from further away than it was?
Comment: Can you be more specific? You can always scale the video down, though you'll need to fill in around the edges in some manner. Is that what you mean?
Answer: When you shoot from further away you use a "longer" lens, in other words a lens with a longer focal length. This has a few effects, that you'll have to fake to make it look real.
First, the perspective tends to get flattened with long lenses. You've probably seen this in the classic cinema trope of a long shot of a crowd walking along a footpath, where everyone seems to be about to step on the heels of the person in front. This is because the angle of view is very shallow, so someone in the foreground is not going to be much bigger than someone in the background. Conversely a wide angle shot has exaggerated perspective. See just about any Public Enemy video where Chuck D and Flavour Flav pop their heads into the camera and get massively bigger than the people in the background, just by moving a few feet.
This perspective  compression is going to be very difficult to fake after the fact, unless you're really good at rotoscoping and compositing.
If you look at the long lens shot you'll also see that there's often a pretty shallow depth of field. This is often used by film makers, like Scorsese in this clip from Taxi Driver to highlight the central character, by racking the focus to follow them.
Now a wide angle lens and a phone lens (for different reasons) have very deep depth of field. So you'll have to selectively blur the foreground and background. However if you do this without matching the geometry of a telephoto lens (the compressed perspective discussed earlier) it's going to look like it's actually teeny-tiny, because it will look like another kind of lens with a shallow depth of field, a macro lens.
Another thing that telephoto lenses do is magnify any camera movement, where small movements are magnified by the narrow field of view. You could fake this by reframing, using a wiggle expression to drive the movement, however it might not necessarily achieve the look you want: If you're shooting telephoto you're unlikely to hand-hold the camera because it would look awful, so you'd lock it down on a tripod - see the shutterstock and Scorsese examples.
So depending on what the subject of your video is, this could be quite a challenge. Of course if your phone has a 4K sensor, you could actually make a telephoto shot out of a wide by just cropping. Of course this reduces your resolution, so it will look pretty ugly on most phones, and obviously you have to compose the shot with all the action in the center.
Answer: Practically you can't do this.  The best you can probably do is make it more shaky and grainy.  You could also drop the resolution to make it look like it had been digitally zoomed in.
The reason you can't practically do it is because of perspective.  When you shoot video from close up, the angle of view is much closer.  A small difference in distance to the camera results in a much larger change in size.  People's noses look bigger, their ears look further back, cheeks look puffier and shadows fall differently because you see different angles of the person's face than you would see from further away.  You can't really fake this, you can try by photoshoping every frame extensively, but this would be massively time consuming and the result would still be substantially lower quality than actually using a long lens to shoot from a distance.
The reason the alternative suggestions work is that they bring to mind other triggers people have for language in video that suggests something was taken from far away.  Adding noise or dropping resolution additionally makes it harder to see the perspective issues that say it was shot from up close.  Shaking makes it feel like it was a long lens since smaller movements are noticeable when shooting from further away.  Noise and drop in resolution are typical of digital zooms, which people are also used to seeing.  It won't fool someone who knows what they are looking for, but it will communicate it as a plot device pretty clearly still.


SQL Server 2000\2005 compatibility with Active Directory 2016

Question: We are currently using Active Directory 2008R2 and will be upgrading to AD 2016. I'm trying to determine if there is any known compatibility issues when running older versions of SQL Server (2000 and 2005) when upgrading to AD 2016. Has anyone been through this process? Most of our db servers are using SQL 2008 > 2016, but a few still runs with 2000/2005. Thanks
Comment: This is more of a Windows question, as SQL Server doesn't really interact directly with the domain controllers.
Comment: ...unless you database has a function that access the Active Directory directly, in which case we would require additional clarification/information. As it stands this question doesn't contain enough (database) information and should be closed. Please consider reading [ask] from the help centre.
Comment: those are seriously old databases. Even 2008 R2 is no longer supported. May I suggest upgrade AD, and then fix any compatibility issues with an upgrade of those databases?
Answer: I have not gone through this process directly, but have worked with querying AD in a modern environment and a less modern environment.  I believe that the OLE DB Provider remains compatible between the older and newer versions of AD. Also I would not expect the loss of any commonly used (at least in my experience) properties, which would be the other risk.
If you do run into trouble, however, I would be prepared to migrate the databases to a newer instance of SQL Server running those DBs at a lower db compatibility level.  This will still be challenging, as I think you can only go back to 100 (2008). However, from a mitigation standpoint I would suggest trying to go this route regardless.  This would also allow you to retire the older instances (and likely old servers they are running on).  Why not make a bigger project even bigger (though you can do it ahead of time, so it doesn't all fail at once).
I will qualify this with my of querying AD had been generally focused on getting basic user properties and group membership, and do it so infrequently I have to go look everything back up.  And it's been a few years since I have to do much Windows Admin work.


Structural artifacts in ray jitter

Question: I recently set up temporal super-sampling in my path-tracer, and now I'm trying to improve early samples by adding random offsets between -[PIXEL_WIDTH] and +[PIXEL_WIDTH] to each initial ray position. The jitter works well enough and hides obvious aliasing artifacts, but it creates tattered edges (e.g: https://i.stack.imgur.com/gHwaS.jpg is my test shape after one sample/pixel) instead of regular grain. Is there any way to change that?
Comment: have you tried jittering by +- half a pixel width? this should prevent the 'sample zone' belonging to a given pixel intersecting with that of its neighbors
Comment: It appears to be working as designed. If you want smooth edges in that situation, you have to use supersampling.
Comment: @Sebastian Mmmm...the [image](https://imgur.com/a/mL9vh) still ends up tattered, just with marginally smoother edges. I'm hoping for actual visual noise around the sphere's border.
Comment: @Dan I'm not looking for smoothness anymore; my supersampler does that after enough samples already. I was more thinking about some sort of edge fuzziness (rather than the raggedness I have at the moment) that'd gradually fade out as I caught more samples. It sounds like that isn't possible, though?
Answer: Jitter is supposed to make edges more irregular; that's how it masks aliasing in the first place. I didn't realise this when I made the question, but the noise in path tracers comes from undersampled global illumination; because each sample travels in a random direction, it's possible for a visually-significant number of samples to reach unrepresentative areas (e.g. for rays at the bottom of a curve to mostly hit the walls of the curve rather than travel upward towards), and the dissonance between these and the actual image function creates the fuzzy variance you get in path-tracing renderers.
That sort of noise is completely different to the pseudo-one-dimensional edge variance you expect to get from ray jitter at one sample/pixel. Single-sample ray jitter essentially means pulling edges randomly closer to or further away from their actual tendency in order to hide the high-frequency patterns introduced by aliasing; it looks nothing like "fuzzy" GI noise because (at least at the single-sample scale I was thinking about when I made this question) it's one-dimensional (variance about an edge) rather than two-dimensional (variance over a surface).
So, this question is invalid. It assumes that jittered edges are supposed to be fuzzy (as in GI noise), but forgets that edges are one-dimensional and that the jitter can't magically expand them to two dimensions and spread them over some domain (at least, not without spreading the aliasing as well (multi-pixel jitter)). Jitter doesn't produce fuzzy noise because it isn't supposed to; it's only supposed to vary the relative distance of points "on" an edge from the actual edge positions given by the image signal.

Structural artifacts in ray jitter


Prime Numbers in Discrete Log

Question: I am implementing a security protocol based on discrete log. I came across the equation $p = kq + 1$. Understand that based on number theories that both $p$ and $q$ should be large enough to be "safe". However, how does it justifies safe? Say I chose $p = 7$, $k = 2$ and $q = 3$, will my implementation be screwed up?
Comment: You have chosen the tag "dsa", but there is no mention of digital signatures in your question. Do you need primes for Diffie-Hellman or for a signature scheme?
Answer: There already exist standard primes that might be used for Finite Field Discrete Logarithm based schemes. One set is found in RFC 3526. Another set is currently in the process of being standardized as part of TLS and can be found in the current Negotiated FF DHE draft (this link will expire no later than June 15 2015).
The smallest prime in the former set is 1536 bits, which means that it is greater than $2^{1535}$. It is recommended to be used with a 180 bit exponent, which corresponds to an integer greater than $2^{179}$.
The smallest prime in the latter set (TLS) is currently fixed at 2048 bits, although an even greater number was originally proposed.
By comparison, 7 is only 3 bits and 3 is only 2 bits, so, yes, your implementation would be kind of inadequate, should you try to use these primes.
Comment: Hi @Henrick Hellström, Thanks for giving such detailed explanation and also providing relevant resource for my learning. Yes, what i am implementing is Chameleon Hashing, which is based on discrete log, like DSA, which I will be using to generate the prime numbers, hence the tag.

Prime Numbers in Discrete Log


If I use a mobile app that fetches data from a website under GPLv2+ is the app also under GPL?

Question: I am currently programming a mobile app that is not under the GPL.
However, the mobile app correspond with a website that is under GPL Version 2 or higher. In my case the mobiel app send request via POST-method and then fetches data that is displayed as json on the website.(Would the license be AGPL, I'm pretty sure that the mobile app also would be under the AGPL.)
How is it in my case?
Comment: It's prudent to note that facts are not subject to copyright, open source, or otherwise.
Comment: If this was the case, that would mean that everybody (you, me, ...) who may happen to browse random GPL-licensed websites, would need to use GPL-licensed browsers. That would make the FSF very busy right now...
Answer: The license of an application and the license of data that application produces can be independent, and are only interrelated if the data includes executable code from the executable itself:

Is there some way that I can GPL the output people get from use of my program? For example, if my program is used to develop hardware designs, can I require that these designs must be free?

In general this is legally impossible; copyright law does not give you any say in the use of the output people make from their data using your program. If the user uses your program to enter or convert her own data, the copyright on the output belongs to her, not you. More generally, when a program translates its input into some other form, the copyright status of the output inherits that of the input it was generated from.

So the only way you have a say in the use of the output is if substantial parts of the output are copied (more or less) from text in your program. For instance, part of the output of Bison ... would be covered by the GNU GPL, if we had not made an exception in this specific case.

However, if the data served by the application is pre-existing (i.e., it was not directly created by the application) it may happen to be under a copyright license itself (e.g., consider an application that serves the text of user-submitted copyrighted stories).
In your case, a requesting application that receives some data from a web app is almost certainly not a derivative of the serving web app, not a derivative of the served data, either.
Even if the web app were AGPL-licensed, that would only impose requirements for code that is part of the server-side application, not clients that interact with it; generally, clients under any license may interact with an AGPL-licensed service, because they are separate works.
Comment: As an additonal observation: Presume for a moment that accessing data from a web-site WOULD automatically transfer the license status of the data to the retrieving application. What license status would any web-browser then have? And applications like curl, wget and download-managers? After all: They all retrieve data from web-sites with all sorts of (and possibly conflicting) license status all the time. It would be an impossible mess.
Comment: So even if I edit, manipulate or otherwise use the data in the web app and make it available again to the mobile app, this edition is not subject to the GPL. I also get data from the web app such as the time or other content and images created via the web app that were uploaded and processed via the web app. In this case, too, the GPL does not apply to the mobile app. Only if the web app would actually send snippets of code from the GPL application to the mobile app and this would be executed in the mobile app, the mobile app be under GPL.
Comment: @Vincent And even then, it would matter more how your application's code relies on the downloaded code. On one extreme, if the downloaded data is a Python script and your app is is Python interpreter, the act of accessing input from the Web does not make your interpreter derivative of that input. It is difficult to imagine a situation in which downloading and executing code from the Web makes your app derivative of that code.
Comment: @apsillers If users of the web app upload images to this, the images are also not under the GPL, right? Because they have nothing to do with the GPL code.


Extension of visa during UK visit for Indian Passport holder having US green card, residing in US

Question: i am US green card holder and I have a  6 month visa for UK issued in India for 6 months from 15th Oct,2018 to 14th April, 2019.   1. I visited UK from 15th Oct to 16th Nov, 2018. Now I am residing in US,  I need to visit UK again during April 1st to June 10th 2019. Can I apply for extension of my visa before April 15th in UK?
Answer: Leaving aside the question of whether you can extend your visa, the fee for doing so is an exorbitant £993.  Even if you could, you wouldn't want to.
Instead, you should apply for a new visa before you leave the US.


Driver's License loss

Question: My bank kept my TX driver's license by accident. Before I had a chance to pick it up, they threw it away. Their excuse was that they didn't think I was coming back to pick it up.
I am a customer of this bank, and I believe that they knowingly threw it away.
Can I make a fuss and call the police, or am I just out of luck? What would the police do if I filed a report?
Comment: Does this answer your question? https://law.stackexchange.com/questions/54796/is-it-illegal-to-throw-away-someones-license-id
Comment: Does this answer your question? [is it illegal to throw away someone's license/ID?](https://law.stackexchange.com/questions/54796/is-it-illegal-to-throw-away-someones-license-id)
Answer: Texas law does not impose any obligation on a person who finds a lost driver's license. You can call the police and complain, but under the circumstances there is nothing they can do (since the bank threw it away). Instead, they will probably remind you of your obligation to notify the police, so they will take a report and you can use that report to get a replacement license. It was not stolen (which would be a crime that the police might investigate), and a police report is not required to get a replacement, you can just get a replacement at a local driver's license office (see here). Theoretically you could sue the bank, if you can prove that they were negligent, although you were negligent in not keeping track of your license. You might recover half of the replacement cost, $5.50, but the filing fees for the lawsuit are vastly higher than the loss that you suffered.
Answer: Dana - it might help if you rephrase this in a way that is clear enough for us to know exactly what you want to do, so that we can answer you most helpfully.
I will interpret your 3-4 questions here as if you have two goals: 1) getting your license re-issued, and 2) holding the bank staff accountable.
To directly answer what you are first asking:
Yes, of course you can make a fuss and call the police... but that will likely get you nowhere. When the police arrive, the one making a fuss tends to be the one who gets told to leave, or even forcibly removed from the premises, perhaps in cuffs. I would not recommend that route.
I would recommend that you instead go physically and professionally sit down with the bank manager... if he or she is certain that the trash is gone and there is no chance of recovering the ID, then simply ask for a little notarized written statement saying that on such-and-such day, the bank staff disposed of the [state] ID for [your full name] (without including any ugly language or blame like "knowingly")... and then you might also politely ask the bank manager to please cover the state's re-issuance fee (find out first what it will be so that you can be specific with the bank manager by saying $22 or $16 or whatever), since the bank staff has already admitted to you that they knowingly threw it in the trash.
Then go to the state agency that issued your license and do their "lost or stolen" standard procedure, to get that ball rolling, with or without the notarized statement from the bank manager. You will have your new ID soon.
And if you need to show an ID before you can get the temporary replacement, the written statement from the bank manager may help.
As for holding the wrongdoer accountable, I suggest you consider cooling off before you decide whether you intend to pursue civil and/or criminal charges. Perhaps you will feel like it is good enough to have the bank manager bring the offender over with an apology and a few bucks to cover the license re-issuance.
To answer your question about what the police would do:
Well, if you file a police report, and your intent is to report crime, then your end goal (whether you realize it or not) is for a sworn criminal complaint to end up in the hands of a magistrate who could make a determination as to probable cause to commence a criminal case. And the police officer who takes your report will only swear out a criminal complaint if he or she believes you and if you provide enough ultimate facts to support every single one of the essential elements of some criminal offense.
Hopefully my interpretation of your two goals was correct, and hopefully this helps you with both.

Driver’s License loss


How to configure Xbee S2C module(end device) in order to avoid merging of data at another Xbee S2C(coordinator)?

Question: from India. I am working on a project where multiple xbee s2c devices form a star network, i.e., 1 coordinator and 3 end devices. Each end device attached to the Arduino Uno, coordinator to the NodeMCU.
I am collecting data from all 3 end devices and upload it into my website. But there is a small problem, sometimes the data from 2 or more end devices concatenates.

So 1 way to solve this issue might be write a code in NodeMCU to seperate data before posting it to website.
But (I am an electronics student), I want to know if it is possible to avoid the merging of data at xbee coordinator device itself (maybe, by configuring it with a set of AT commands).
I think a few times, the coordinator receives data from end devices consecutively which is making the serial buffer to perceive the incoming data as single large value. I provided sufficient delays between all 3 end devices, but still sometimes the data is merging.
I read in the datasheet(https://www.digi.com/resources/documentation/digidocs/pdfs/90002002.pdf) that CSMA-CA is implemented in the MAC layer, which means end device wont transmit data till it finds the channel free.
Should I allocate a seperate channel for each end device or should I try increasing baud rates? Your help is greatly appreciated.
Comment: Byte stuffing might be the answer.
Comment: @Andy, yes, it sounds right. I will try it.
Comment: Please report back if u get some results.
Answer: Looks like you might be running in Transparent mode.  To avoid conflicts entirely you might need to use API mode.


D&D 3.5 ranger combat styles -- forbid other sources of same feats?

Question: In my Dungeons and Dragons campaign, my co-players and I are having a little bit of a struggle with my character's feats. My character is a fighter(2)/ranger(2) dual class. For my fighter feat I chose Two Weapon Fighting, then I hit ranger level 2 which now grants me Combat Style. My DM says that I cannot choose Archer, and still perform the two weapon fighting feat, and that it is against my ranger code... But then he says I can select the two weapon fighting and still use a bow and choose bow feats, but the two weapon fighting feat i chose as a fighter cannot be changed. Can my ranger pick Combat Style Archer and still choose two weapon fighting feats?
Comment: Can you provide the house rules that detail this "Ranger Code"?
Answer: Yes, your Ranger can select one Combat Style and still select feats that mimic the other.
In fact, I did similar things in the one time I played a Ranger to prove to others in my party you can have fun despite what class you are. In that particular case, I chose Two-Weapon Fighting Combat Style, and selected all the Archery feats. I used an Elvencraft Longbow, which allowed me to use my bow as a Quarterstaff.
Where did this idea probably come from? Probably from Legolas and Drizzt. Legolas was legendary with the Lothlorien Bow. Drizzt is legendary with the two scimitars:  Twinkle and Icingdeath.
There is absolutely no such "Ranger Code" in D&D 3.0 or 3.5 for that matter. If there is an in-game organization, such as the Rangers of the North in Middle-Earth, then that would be specific to your campaign/dungeonmaster. In other words, there is no Ranger Code outside of your DM saying there is one.
And any code that prohibits one form of combat when utilizing another is pretty strange. We all know of Bushido - the Code for the Samurai, but Samurai utilized a Yumi (bow) and Yari (spear), as well as their Katana (bastard sword) and Wakizashi (short sword).
I would ask, in detail, what this Ranger Code is, and why using a bow in addition to two weapons is such blasphemy. The Ranger class is weak enough as it is and gimping them on weapon choice only makes them that much weaker.
Answer: Assuming this "Ranger Code" is not a house rule set by your DM, there is nothing in the rules preventing you from picking the TWF feats with your normal feat slots as long as you qualify for them (Eg, Dex 15 for Two Weapon fighting). The actual feat is more powerful than the Ranger Combat Style, since it do not requires you to stay on light armor.
If your DM wants to ensue the "Ranger Code" in his table, there is still one option for you. You can retrain your Fighter feat into a ranged feat, and then use TWF from the Ranger Combat Style. Retraining rules are on the Player's Handbook 2, pg 192.
Answer: There is no such restriction, other than in house rules. Rangers get a combat style that permits them to make use of certain feats; there is no fluff that suggests a given ranger has some sort of conviction against fighting in other ways. It's merely a specialization that rangers can pick from.
Similarly, just because a wizard picks Spell Focus: Evocation with their wizard 5 feat slot doesn't mean they are suddenly unable to cast spells from all other schools.


From an Orthodox perspective...how do we know the saints specifically hear an individuals prayers?

Question: I know the saints see our prayers ascending as incense (Rev 8:4), that they observe the glory of God and are close to his holy presence.  Where does the belief come from that they hear us? Or that they can make individual intersession for us? How do we know they do not do this collectively on behalf of all believers rather than on a case by case basis.
Answer: A good deal of the Orthodox theology of saints is expressed during the services for the first Sunday of Great Lent - called the Sunday of the Triumph Orthodoxy (it commemorates the anathemas declared in the Ecumenical Councils against the Iconoclasts).  The Epistle reading for that particular day comes from Hebrews (11:24-26,32-12:2), which goes toward answering your question, "Where does the belief come from that they hear us?"

And all these, having obtained a good testimony through faith, did not receive the promise, God having provided something better for us, that they should not be made perfect apart from us. Therefore we also, since we are surrounded by so great a cloud of witnesses, let us lay aside every weight, and the sin which so easily ensnares us, and let us run with endurance the race that is set before us

I am not sure there is a belief within Eastern Orthodoxy that the saints "make individual intersession for us" in the sense you might be thinking.  As Romanian Elder Cleopa wrote:

No one except Christ is able to intercede before the Father since only He presents Himself as a sacrifice for the salvation of the world.  Accordingly, no one except for Christ is able to save man from sin.1

This does not mean, however, that the saints - as well as people we know on earth - cannot pray for our salvation.  This is the only  sense in which saints are understood to "intercede" for us.  Again, from Elder Cleopa:

In honoring the saints we don't put them in the place of Christ, or even adjacent to Him.  When the saints pray for us, it is precisely our salvation that they seek from Christ.  They intercede with Him for our salvation.  From Christ they entreat our salvation.  This is what we mean when we say they intercede for us.

Regarding how we know that saints are not acting on our personal behalf at times and not on behalf of all "believers" in general, I don't think there is a very rigorous theological answer here.
First, when saints pray for people collectively, we believe that they are praying for all men, and not just "believers" - since God desires that all men be saved and not just believers (1 Tim 2:4), and since saints are saints by virtue of their wills being aligned with God's.
As far as how we know that saints often act on behalf of specific persons, the witness here is two millennia of synaxaria describing the lives of the saints - the Church's documentation of some of the greater things that have been done (John 14:12) since the time of the Apostles.  For some modern accounts, you might pick up a copy of Everyday Saints, a best-seller in Russia (in general, not just in religious books), recently translated into English.  Another good sampling can be found in the account of the life of Arseny Streltzof, a Communist intellectual who became an Orthodox priest.  A good book here would be Father Arseny: Priest, Prisoner, Spiritual Father.

1. The Truth of Our Faith (3rd ed.), Vol. I (Uncut Mountain Press, 2007), p.68
2. Ibid.


Using pwauth for authentication with SVN on RHEL6

Question: We have recently installed SVN 1.6.11 and are attempting to run it using the Apache server (2.2.15) after finding svnserve to come up short of our needs.  Our system is RHEL 6, and we would like to use the ADS user accounts since creating a new batch of accounts separately for SVN usage seems like overkill.  We are attempting to use pwauth for external authorization using the system accounts.
Thus far, despite following several online tutorials on this, we have had no success getting pwauth to work after setting up Apache, PAM and an authz file for using mod_dav as part of the authentication.  To give an idea of what we have used, we have followed the general outline of a few sites on this but have not yet had success.
Here is more information on the Apache server we are running:
[svn]# httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Apr 29 2013 04:13:12
Server's Module Magic Number: 20051115:25
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

In httpd.conf, we have set up port 80 to listen, a NameVirtualHost at *:80, and we have this VirtualHost setup:
<VirtualHost *:80>
    DocumentRoot "/"

    ServerName usfrk-sw-p1.thermo.com

    AddExternalAuth         pwauth   /usr/local/bin/pwauth

    SetExternalAuthMethod   pwauth   pipe

    <Location /repos >
        DAV                    svn
        SVNParentPath          /home/svnroot
        AuthType               Basic
        AuthName               "Thermo EPM SVN repository"
        AuthzSVNAccessFile     /home/svnroot/conf/authzapache
        AuthBasicProvider      external
        AuthExternal           pwauth
        Satisfy                Any

        <limitexcept GET PROPFIND OPTIONS REPORT>
                Require valid-user
        </limitexcept>
    </Location>
</VirtualHost>

Earlier, we loaded the DAV modules in this order:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule authnz_external_module /usr/lib64/httpd/modules/mod_authnz_external.so

The book "Version Control with Subversion" notes that mod_dav.so should be loaded before any other SVN modules.  As far as we can tell, these are the only modules we need for this.
For the authzapache file, we have set up two distinct groups of users.  The only thing that would seem to be a stalling point is that the names include backslashes, and we haven't fully picked up on whether one or two backslashes are needed since some things strip one (names are of the form DOMAIN\firstname.lastname).
With pwauth, one possible trouble point is the SERVER_UIDS define in the config.h file.  Currently, we have it set to the group ID of our local users.  However, some documentation seems to suggest it should be the user id of the apache user.  We're not sure what we should do here, and for all we know this may be what's stopping us.
Ultimately, we run the command 'net ads info' and get what looks like good feedback.  We then set a group of users (AllowUsers) in /etc/ssh/sshd_config.h.  The next test is to test out pwauth as an external authenticator, and here's what that looks like:
[svn]$ pwauth && echo 'yay' || echo 'nay'
nay

In attempting to get more info on this, we then run and get the following:
[svn]$ pwauth; echo $?
50

According to the site that had this info, a return of 50 suggests that pwauth is being run as an invalid user.  We have not figured out how to rectify this as of yet, or if this is even the root of the problem using pwauth.
Somewhere in here is a missing link.  SVN is set up and functions fine on the server, but we need to allow access to remote users and also limit some of that access.  Any insights would be greatly appreciated.
Answer: If you want to use the EPEL package for pwauth, it has the SERVER_UIDS commented out, and relies on the process being in the apache group. It installs as executable by the apache group by default.


Identification of two leaders in Hungarian revolution

Question: Who are these two figures involved in the revolution in Hungary after the first world war?
Answer: Google search revealed that the one on the left is Sándor Garbai.
(from https://upload.wikimedia.org/wikipedia/commons/4/46/Garbai_S%C3%A1ndor_%281919%29_%28cropped%29.jpg)
The one to his right seems kind of similar to an individual named Béla Kun, but I am not fully sure.
[EDIT]: This Wiki page on Béla Kun has same image (from different angle I suppose), and its caption says "Sandor Garbai and Bela Kun, leaders of the Hungarian Soviet Republic, 1919". So I believe he is Béla Kun.
Comment: Oh, wow, you can actually see the movie camera from which my frame came in that still shot. That is pretty cool.
Comment: @TylerDurden Oh, yes. I hadn't noticed that!


New MacBook Pro 13" (late 2016) with three external 4K monitors

Question: Considering getting the new MacBook Pro 13" with four USB-C ports.  It is capable of supporting two 4K monitors out of the box, but can anyone help me figure out how to add a third 4K monitor?  Would this require something like a DisplayLink 4K adapter?  Thanks for any help.
Comment: FWIW - The LG 4k display works marvelously with my MacBook (not even Pro and not even the latest version) - very snappy refresh rates, gorgeous colors. I could see two of those and a 13 MBP as an amazing setup.
Answer: Apple says that the 13 inch MacBook Pro will only support two thunderbolt displays so you should plan to rent or be able to return any hardware purchases you make if you can't get three displays to work.

https://support.apple.com/en-us/HT204154

I'm not saying it won't work even though not "officially supported" - just that it might not work even if you have cables and ports to connect all three devices due to driver or software issues and not cable/connection issues. You'd want a Mac Pro if you need up to 6 displays as they have the graphics horsepower to run those pixels in an officially supported configuration.
Answer: Unfortunately the Microsoft Display Dock that Allan mentions doesn't help here.
I purchased one specifically for use with the MacBook Pro and after testing: whilst the USB ports do work, neither the HDMI nor the DisplayPort are functional.
It's not clear if a driver update on either the adapter or Mac end of things could remedy this failure, but as of January 2017 there isn't a product to get 3 4k displays working once you have them connected physically.
Comment: Thank you for reporting your results. I've edited the post a bit and linked to the other answer. Having a proper answer here is better than commenting on the other post unless it gets a major revision.


Can low battery voltage cause brake noises? - 2006 Civic

Question: Driving a 2006 Honda Civic, right rear brake makes a clunking noise under medium to high braking.  It sounds like the ABS but doesn't have the pedal pushing back like ABS does.  Went to my usual mechanic, they checked everything over and said it was fine.  No mechanical issues.  They didn't take the car for a drive, acted like my imagination.  Went to a 2nd mechanic who said it is low battery voltage. No posts about low voltage causing a noise. No brake or ABS lights are on.  I dislike the idea of buying a new $200 battery to fix a brake knock.  Unsure this is the real issue.  Advice welcome. Anyone have this happen?
Comment: Did you ask the 2nd mechanic to explain to you how low voltage could cause noise in the braking system ?
Comment: He said it was the ABS modulator
Comment: if your car starts the voltage is okay,get a second opinion from an other mechanic.
Answer: If low voltage was the cause of any problems with the ABS then you would have active and/or stored DTC's in the abs module. It would likely trigger the ABS light and might also disable the abs completely while the code is active. Even then Im not sure how this could create any kind of "clunking" noise. Sounds just as likely as me telling you your tail light fluid is leaking on the caliper, causing the pads to rub.
I am also not sure, is it a 2006 or 2016?
Comment: They said there was a low voltage ABS code but would not tell me what it was.  Suggested they replace the battery and gave me an estimate of $275 plus tax to install it.  Neither shop giving me a good feeling.  I prefer to use my own wrench when possible, not hard to swap a battery.  I just question whether this is the issue.  Maybe I need to see a third garage and get the codes.
Comment: Sry, typo.  2006.  The clunking is the ABS...maybe the modulator or just the system engaging in some way.  But it doesn't feel like ABS in the pedal and sounds differently than when it engages in snow.  I looked for leaks, nothing readily apparent.
Comment: Issue's here should store codes in abs module. Did either mechanic scan the vehicle and retrieve any codes?


Door Opening No trim

Question: If I measure a closet door opening, to be 35.5" x 80" and the door opening does not have any trim,  what size bi-fold closet door would I need to purchase.
Comment: Is this opening wrapped in drywall and corner bead? The size you mention is not a standard door size for wood jambs, unless a hack got in there and tossed something in the rough opening. Can you get a picture posted? The opening should be something closer to 36"X 81" tall for a bifold door to fit without cutting it to a new size
Answer: Beth,
If your referring to an opening not intended to ever have trim, consult the rough opening (RO) parameters of the bi-fold door manufacturer, as the type and placement of the hinge pins and the thickness of the door will determine the space needed between the outer edge of the closed door and the frame of opening.
Most bi-fold doors are about 3/4"-1-1/4" thick (depending on if they're made of PVC or wood and solid or slatted...older, reclaimed doors are thicker).  If the hinge pins are set half a thickness in from the outer side edge of the door, the clearance will need to be about 75% of the door thickness...especially if the door frame isn't perfectly square or hinge pins aren't set perfectly perpendicular to each other.
I'm working on a set of bi-folds that are 1-1/8" thick and require a min. 1/2" clearance between door and door frame (which doesn't give much leeway for error); where the doors meet there isn't supposed to be any space...they're meant to be flush to each other...but I'm adding an astragal, to one of the doors, to make installation easier and look more finished.
If you the doorway opening will, eventually, have trim decrease the RO width by 1-1/2" (assuming trim will be 3/4" thick each side).
If you know the floor is level; with no rug in the way, I'd give 3/4" for a space in top and bottom...some like it 1/2" but in adjusting the doors, after installation, sometimes that extra 1/4" is useful.

Door Opening No trim