Xcode: hide / protect resource files in final iOS app?

Question: I plan to develop an app for iOS and want to use HTML5, CSS and Javascript. The final app should be implemented as a native app using Xcode and UIWebView.
Can I hide or protect my html files in the final app? I have to put the files in the folder called "Supporting Files" in Xcode. Therefore, everyone can view the plain files after purchasing the app by extracting the .ipa file, right?
Answer: There's many ways to protect your data, depending on how good you want the protection to be.  For very minimal protection against only casual hackers, you could use a string obfuscation algorithm to obfuscate and de-obfuscate the HTML content as NSStrings.  Here's an example of doing that.  I haven't used that particular code, but I'm also not really recommending obfuscation as a technique, unless the data really isn't very sensitive.
The better solution is to encrypt the HTML content, although that's more work, and may involve some export control issues, depending on where you are, and where you're distributing your app.
For encryption, you have lots of options.
1) Here is an open source implementation that provides a secure version of something like NSUserDefaults.  I don't see an equivalent to registerDefaults: in that code, though, so it's possible that the first time your app runs, you may have to download the content from the web.  But, then you could encrypt and store it in PDKeychainBindings as a string value.  On subsequent runs, you could then extract stored HTML "files" like this:
NSString* webPageContent =
    [[PDKeychainBindings sharedKeychainBindings] valueForKey: @"index.html"];

2) Here's another open source project that provides AES encryption wrappers.  You would write some non-production code before releasing your app to encrypt the HTML content into encrypted data files that would be bundle resources.  When your app runs, it opens the files and decrypts them into NSString objects which can be given to your UIWebView via loadHTMLString: baseURL:.
3) Finally, here's another example of using the underlying CommonCrypto APIs to protect bundle resources.  This example uses a custom build step to automatically encrypt resources in a particular folder, which would save you some time if your protected HTML content is going to change reasonably often.
Answer: You can encrypt the files and decrypt them at runtime or you can not include them in your bundle and have a compile time script that reads them and converts them into encoded data in your app that you can just load into your UIWebView with:
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL

Comment: I'm assuming you mean "encrypt" and "decrypt" in the first sentence, right?
Answer: You could create all your HTML and so on also within your code and then use UIWebView's
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL

to manually load every HTML string as plain text. I advice you, however, not to do so. If somebody really wants to isolate every string from your compiled source code, this is possible for him (unless you really do demanding stuff).
Most of the users simply don't care about what's inside the ipa file. If you can live with < 1% who inspects it, don't worry too much about this topic.
Another aspect would be possible as well (even if this is not a fantastic idea): You could point your UIWebView to a secret website only you and your app know. This is absolutely not advisable.


Are there non-interactive login shells?

Question: I know what the difference between interactive/non-interactive and login/non-login shells are, but it seems like in practice there's never going to be a non-interactive login shell unless you have something like /bin/bash --login some-script.sh in a script (and even that seems a little odd). Is this correct or are they more common?
Comment: `telnet towel.blinkenlights.nl` for a login shell that is non-interactive ;-)
Comment: This question is answered briefly within [this longer answer](http://unix.stackexchange.com/a/46856/135943).
Comment: @CaptainMan: Looking at the answers, we have two that are focused on quite different meanings of "interactive." In light of this can you expand your answer a bit to explain which meaning you were using when you asked the question?
Comment: Somewhat related question, for the curious: [How to make sense of non-interactive login shell?](https://unix.stackexchange.com/q/394293/73256)
Comment: And this question I think is a duplicate of [Is it possible for there to be a login shell that's not interactive?](https://unix.stackexchange.com/q/304447/73256)
Answer: I assume you're talking about Bash's concept of login vs. non-login and interactive vs. non-interactive Bash shells as described in the Invocation section of the manpage. (This is different from the interpretation in James Youngman's answer of any arbitrary command used as the "shell" (or user command interpreter) in the passwd(5) file and whether or not that program accepts user input; some, such as /usr/sbin/nologin, obviously don't.)
You are correct that /bin/bash --login some-script.sh will produce a non-interactive login Bash invocation, and this is perhaps a pathological example. There is one case, perhaps uncommon but not truly weird, that produces a non-interactive login shell: ssh somehost < some-file. Here sshd will start Bash with argv[0] set to -bash because it's not been given a command to run, causing Bash to consider itself a login shell, but, because stdin is not connected to a terminal, Bash will not set itself to interactive mode ($- will not contain i).
(Personally, that case seems far more reasonable than the converse, ssh somehost somecommand, which is not considered a "login shell" even though it's a fresh login to somehost just as the above is.)
I have recently done what I should have done long ago and put together a table of Bash's modes and what init files are run. If you're finding it confusing, take heart in that at least I do as well. It mystifies me what their original aim was with the rules about when .bashrc is executed.
Answer: Most login shells by count on a newly installed system are non-interactive, actually:
$ awk -F:  '{print $7}' <  /etc/passwd | sort | uniq -c
  5 /bin/bash
 23 /bin/false
  1 /bin/sh
  1 /bin/sync
 17 /usr/sbin/nologin

Clearly /bin/bash and /bin/sh are traditional shells and they're interactive.  But all the other items in that list are non-interactive.  If you're reading the list and don't know what one of them does, you can just look up its manual page (with for example man nologin or man sync).
What the command actually does
Looking at the Captain Man's posting history I see that they're quite inexperienced with Unix.  So maybe the question in the comment about not following related to the command line at the top of the answer, not simply the output.   So I'll explain the command-line too, even though it's really off-topic for this question.
The command is a Unix pipeline.  A pipeline is a chain of commands - you read it left-to-right - in which the output of the first command becomes the input of the second, the output of the second becomes the input of the third, and so on, until the end of the pipeline.  The output of the last process is shown on the terminal (unless it's been redirected).   See the Wikipedia entry on shell pipelines for more information.
If you don't understand what a pipeline is doing, you can simply run it in segments to see what's happening.   You can also read the manual page for the commands which are being used (here, awk, sort and uniq).  In fact, you should do that now.   I'll wait.
Let's run the stages of the pipeline incrementally (you can safely do this on your own Unix system):
~$ awk -F:  '{print $7}' <  /etc/passwd | sed -e 's/^/    /'
/bin/bash
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/bin/sync
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/usr/sbin/nologin
/bin/false
/bin/false
/bin/false
/bin/false
/bin/false
/bin/false
/bin/false
/bin/false
/bin/false
/usr/sbin/nologin
[ ... and so on, I've left the rest out ... ]

The output above is simply the contents of the seventh field from the /etc/passwd file.  That's the (flat-text-file) database which tells the system what everybody's login shell is.  If you want to find out more about /etc/passwd just go read it (it's world-readable) and look at the manual page for it (man 5 passwd).
So reading the whole list there you can get an idea what the popular items are, but that's not a good format for an answer to this question, because the question was really about how common non-interactive shells are.   Let's count them up.    The simplest way to do that is to sort the items first:
~$ awk -F:  '{print $7}' <  /etc/passwd | sort
/bin/bash
/bin/bash
/bin/bash
/bin/bash
/bin/bash
/bin/false
/bin/false
/bin/false
/bin/false
/bin/false
[ ... and so on, I've left the rest out ... ]

We can use the program uniq to show us only the unique items:
~$ awk -F:  '{print $7}' <  /etc/passwd | sort | uniq | sed -e 's/^/    /'
    /bin/bash
    /bin/false
    /bin/sh
    /bin/sync
    /usr/sbin/nologin
But wait, that's no use, how many of each were there?   Let's ask uniq (read the man page!):
~$ awk -F:  '{print $7}' <  /etc/passwd | sort | uniq -c
      5 /bin/bash
     23 /bin/false
      1 /bin/sh
      1 /bin/sync
     17 /usr/sbin/nologin

That's the output we saw at the top of the answer, of course.   Let's sort it again to see the entries in order:
~$ awk -F:  '{print $7}' <  /etc/passwd | sort | uniq -c | sort
     17 /usr/sbin/nologin
      1 /bin/sh
      1 /bin/sync
     23 /bin/false
      5 /bin/bash

Wait, that can't be right, 17 comes before 1 and 5 after 23.  The problem is that the items are being sorted lexicographically.  Let's ask sort to sort them numerically, and in reverse order:
~$ awk -F:  '{print $7}' <  /etc/passwd | sort | uniq -c | sort -n -r
     23 /bin/false
     17 /usr/sbin/nologin
      5 /bin/bash
      1 /bin/sync
      1 /bin/sh

I think that explains everything in the original answer.  If you're still unclear on the details of what those commands do, you can read the manual pages.   If you're still unclear on the principles of what's going on, it might be better to start by reading a book (online or on paper) explaining Unix and Linux.
Comment: You seem to be answering a different question. You're just listing the available shells and pointing out that some will never be interactive. I believe the OP is asking whether a non-interactive login shell is ever encountered in the wild. So whether shells that *can* be interactive, bash for example, ever launch non-interactive *login* shells. In other words, a "login shell" here, doesn't mean "a user's default login shell", it means a shell which has been launched *as a login shell*. See http://unix.stackexchange.com/a/46856/22222
Comment: Or perhaps, given that the poster explicitly writes `bash --login` in the question, he's asking specifically about `bash` processes that do not have the `i` option set. (These arise from commands such as `ssh somehost < script.sh`; this will be a "login, non-interactive" shell in the senses specified in the [INVOCATION](http://man7.org/linux/man-pages/man1/bash.1.html#INVOCATION) section of the Bash manpage.)
Comment: Can you explain a little more please? I'm not sure I follow what I'm reading.
Comment: is `/bin/sync` a shell? so any utility is a shell?
Comment: @eloone there are two (maybe three) meanings for "shell".  One is, programs configured as a login shell in the password database.  This is the meaning of the word intended by the phrase "non-interactive login shell".  The other meaning is "a REPL suitable for day-to-day interactive work on a Unix system".  Those are interactive.  However, most of the programs usable in the REPL context also support non-interactive use as interpreters for some kind of scripting language (though "shell script" almost universally means "Bourne-family-shell script").
Comment: @JamesYoungman thanks, this is why I don't understand why `/bin/sync` would be a shell. It's just a non-interactive utility, like a script or daemon that runs. "Shell" has always the notion of interpreted command in it, no? or is it because it interacts with the system os that it could be considered a shell?
Comment: @eloone No, not always.  Which is why I explained the several meanings in the comment you replied to.

Are there non-interactive login shells?


Why is the only off-topic option CS.meta?

Question: In voting to close, why is the only off-topic option the CS.meta?  That forces "off-topic" to mean the much more specific and less useful "on-topic in meta"!
Comment: Before getting to the option of CS.meta, you first encounter a custom close reason 'self-help' and 'other'. Only when choosing it belongs on another site CS.meta is listed, along with the option to provide your own. Don't know whether we can add other defaults, but if, which ones would you suggest?
Comment: Why should there be a limited set of defaults?  For example, there's a question on the CS main page right now that should be migrated to chem.SE--but I can't put that in the off-topic vote.  Is there another way to point out a question which should be migrated, and where it might be migrated to? (Besides leaving a comment, of course.  I've done that, and the questioner doesn't seem to notice that biochem and cognitive are not the same domain.)
Comment: Hmm, possibly only mods can specify other sites in the close reason. I only see this box on CogSci, not on Stack Overflow. I am interested to follow up on [the specific question](http://cogsci.stackexchange.com/q/6443/21). My first impression is indeed that it would be better of on chemistry, but I'll give it some time.
Answer: @StevenJeuris: I think the method might be to write a feature request here on meta, and maybe poke any SE employees you have access to. I've been thinking we should have a couple more sites on the migration short list for a while too, but I'm not sure which, and we're limited to 5. Here are a few prime candidates, judging from the list of migrations in the mod tools (won't be visible below 2000 rep AFAIK):

Biology: three migrated since mid-January
Personal Productivity: three migrated
Cross Validated: two
Philosophy: one
Skeptics: one
Linguistics: one

There were also two migrated to Academia, and one each to Stack Overflow, Open Data, and Movies & TV, but I don't see a substantive link with any of these.
I would prefer to keep Meta.CogSci on the list, and add the top two or three for starters.
Comment: As far as I remember, beta sites are not allowed as default migration targets.
Comment: OIC...that would just leave Cross Validated and Skeptics. :\  Maybe Academia would make more sense to add too in that case, at least until one of these more closely related sites graduates?


HTML merge/overide rules

Question: I am writing an app in which I generate HTML. However some of my HTML comes from an underlying app I cannot control (Flask-Bootstrap). Consequently I find myself wanting to modify some of the HTML that is handed to my app.
Specifically I need to know how HTML combines attributes. Here are two examples.
With metas, is
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="shrink-to-fit=no">

the same as
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

With classes, is

the same as

Thanks
Answer: In the case of class:

Here only first class abc will be applied to the element and rest all will be discarded. It is different from :

which would apply all abc, efg and hij classes on the element.

For meta tag, Both of them means the same.

HTML merge/overide rules


What if a non Muslim dies without saying the Shahada but believes in Islam

Question: So let's say there's a non Muslim brother or sister who has been interested in Islam, learning and planning to revert soon, but they never got the chance to say the Shahada and fully convert because they died before learning more and saying the Shahada, What would happen to them as in would they be considered Muslim of Kaffir?
Answer: In the name of Allah, and all praises be to Allah the almighty.
In the permission of Allah, I will try my best to answer your question using fatawa.
According to Islamqa [Fatwa Link]
"If a person does not pronounce the Shahaadatayn and enter Islaam, we cannot say that he is a Muslim, even if he admired Islaam and recognized that it the best religion, a great religion, and so on. Abu Taalib, the uncle of the Prophet (peace and blessings of Allaah be upon him) died a kaafir, and Allaah forbade His Prophet to pray for forgiveness for him, even though he used to defend the Prophet (peace and blessings of Allaah be upon him) and said in his poems:
"I do know that the religion of Muhammad is better than all other religions of mankind;
were it not for fear of blame or slander, you would find me accepting it completely."
If a person accepts Islaam out of conviction, and begins to practise it, then he is a Muslim, even if he does not register his Islaam officially, or go to a court or Islaamic centre to obtain documentation, or announce it to others. If such a person dies, then we hope for Paradise for him and pray for mercy for him."
End Quote
I apologize, but this is all I could find on the matter. I hope this befits your needs.
May Allah guide you, and those around you.
In the end, Allah knows best.
Answer: Allah knows the secrets and hidden thoughts in our mind. Shahadha is actually witnessing to the truth that there is Allah worthy of worship and prophet(s.a) is his messenger. So if one believes that but do not utter the Shahadha, he is still muslim because Allah know what he believe. Actually in Quran, there is Surah named Mu'min - sura 40 (believer), the person referred to in the title of surah is a person who hid his belief from people.


Suppress the u'prefix indicating unicode' in python strings

Question: Is there a way to globally suppress the unicode string indicator in python?  I'm working exclusively with unicode in an application, and do a lot of interactive stuff.  Having the u'prefix' show up in all of my debug output is unnecessary and obnoxious.  Can it be turned off?
Answer: You could use Python 3.0.. The default string type is unicode, so the u'' prefix is no longer required..
In short, no. You cannot turn this off.
The u comes from the unicode.__repr__ method, which is used to display stuff in REPL:
>>> print repr(unicode('a'))
u'a'
>>> unicode('a')
u'a'

If I'm not mistaken, you cannot override this without recompiling Python.
The simplest way around this is to simply print the string..
>>> print unicode('a')
a

If you use the unicode() builtin to construct all your strings, you could do something like..
>>> class unicode(unicode):
...     def __repr__(self):
...             return __builtins__.unicode.__repr__(self).lstrip("u")
...
>>> unicode('a')
a

..but don't do that, it's horrible
Answer: I had a case where I needed drop the u prefix because I was setting up some javascript with python as part of an html template. A simple output left the u prefix in for the dict keys e.g.
var turns = [{u'armies':2...];

which breaks javascript.
In order to get the output javascript needed, I used the json python module to encode the string for me:
turns = json.dumps(turns)

This does the trick in my particular case and as the keys are all ascii there is no worry about the encoding. You could probably use this trick for your debug output.
Comment: Brilliant, json.dumps() is **recursive** like repr(). One caveat, **dictionary keys** are converted from int to str. `assert '{"3": 5}' == json.dumps({3:5})` (Because JavaScript object property [identifiers](http://stackoverflow.com/a/3633685/673991) are all strings.)
Answer: from __future__ import unicode_literals

is available since Python 2.6 (released on October 1, 2008). It is default in Python 3.
It allows to omit u'' prefix in the source code though it does not change repr(unicode_string) that would be misleading.
You could override sys.displayhook() in a Python REPL, to display objects however your like. You could also override __repr__ for your own custom objects.
Comment: @AlexLuya it does work (yes, I did try it, to make sure). Try `type("")` in a fresh Python REPL, you should see ``. Then run: `from __future__ import unicode_literals` and repeat `type("")`. Now you should see ``. What is your environment (OS, python version)?
Comment: from __future__ import unicode_literals,doesn't work in python 2.7 inpython console
Comment: Ubuntu+ipython+python 2.7
Comment: type("") got "unicode",but "from nltk.corpus import stopwords",then "print stopwords.words("english")",'u'' is till prefixed
Comment: @AlexLuya it works for me and the docs say explicitly that it should work: *"A future statement typed at an interactive interpreter prompt will take effect for the rest of the interpreter session."*
Comment: @AlexLuya as I said explicitly in the answer: *"it does not change `repr(unicode_string)`"*
Comment: Do you mean "'u'" will be removed in running process but not in console output?
Comment: @AlexLuya `from __future__ import unicode_literals` works in the console too (`type("") == unicode`) and it doesn't change the repr anywhere (`repr(u'') == "u''"`).
Comment: ,question has been asked here:http://stackoverflow.com/questions/35913346/how-to-override-ipython-displayhook,but no answers
Answer: What seems to be working for me:
import ast
import json
j = json.loads('{"one" : "two"}')
j
dd = {u'one': u'two'}
dd
# to get double quotes
json.dumps(j,  encoding='ascii')
json.dumps(dd, encoding='ascii')
# to get single quotes
str(ast.literal_eval(json.dumps(j,  encoding='ascii')))
str(ast.literal_eval(json.dumps(dd, encoding='ascii')))

Output:
>>> {u'one': u'two'}
>>> {u'one': u'two'}
>>> '{"one": "two"}'
>>> '{"one": "two"}'
>>> "{'one': 'two'}"
>>> "{'one': 'two'}"

Above works for dictionaries and JSON objects, as self-evident.
For just a string, wrapping in str() seems to work for me.
s=u'test string'
s
str(s)

Output:
>>> u'test string'
>>> 'test string'

Python version: 2.7.12
Answer: using str( text ) is a somewhat bad idea in fact whenever you cannot be 100% sure about both your python's default encoding and the exact content of the string---the latter would be typical for a text fetched from the internet. also, depending on what you want to do, using print text.encode( 'utf-8' ) or print repr( text.encode( 'utf-8' ) ) may yield disappointing results, as you might get a rendering full of unreadable codepoints like \x3a.
i think the optimum is really to avail yourself of a unicode-capable command line (difficult under windows, easy under linux) and switch from python 2.x to python 3.x. the ease and clarity of text vs bytes handling afforded by the new python 3 series is really one of the big gains you can expect. it does mean you'll have to spend a little time learning the distinction between 'bytes' and 'text' and grasp the concept of character encodings, but then that time is much better spent in a python 3 environment as python's new approch to these vexing problems is much clearer and much less error-prone than what python 2 had to offer. i'd go so far as to call python 2's approach to unicode problematic in retrospect, although i used to think of it as superior---when i compared it to the way this issue is handled in php.
edit i just stopped by a related discussion here on SO and found this comment on the way that php these days appears to tackle unicode / encoding issues:

It's like a mouse trying to eat an
  elephant. By framing Unicode as an
  extension of ASCII (we have normal
  strings and we have mb_strings) it
  gets things the wrong way around, and
  gets hung up on what special cases are
  required to deal with characters with
  funny squiggles that need more than
  one byte. If you treat Unicode as
  providing an abstract space for any
  character you need, ASCII is
  accommodated in that without any need
  to treat it as a special case.

i quote this here because in my experience 90% of all SO python+unicode topics seem to come from people who used to be fine with ascii or maybe latin-1, got bitten by the occasional character that was not supported in their usual settings, and then basically just want to get rid of it. what you do when switching to python 3 is exactly what the commenter above suggests to do: instead of viewing unicode as a vexing extension of ascii, you start to view ascii (and almost any other encoding you'll ever meet) as subset(s) of unicode.
to be true, unicode v6 is certainly not the last word in encodings, but it is as close to being universal as you can get in 2011. get used to it.
Answer: I know this isn't a global option, but you can also suppress the Unicode u by placing the string in a str() function.
So a Unicode derived list that would look like:
>>> myList=[unicode('a'),unicode('b'),unicode('c')]
>>> myList
[u'a', u'b', u'c']

would become this:
>>> myList=[str(unicode('a')),str(unicode('b')),str(unicode('c'))]
>>> myList
['a', 'b', 'c']

It's a bit cumbersome, but might be useful to some one
Comment: uh, absolutely **do not do this**—it will crash with non-ASCII data and defeats the entire purpose of using unicode in the first place.  if you're relying on not having the `u` somewhere, you are doing something terrible wrong.  @itsricky, you probably want to be encoding to JSON, not trying to parse Python reprs in PHP!
Comment: Oh Man!  Thanks very much for this 'in-array' string creation.
Comment: I am trying to handball this data over to PHP for parsing, and it was soooo confusing trying to handle this conversion in PHP. I lost 2 years of my life im sure.  I had been using 'stories.append(word)', but I changed this to your magical 'stories.append(str(unicode(word)))' and its all sorted.  Brilliant @electrice!
Answer: Just in case you are getting something like this u['hello'] then you must be printing an array. print str(arr[0]) and you are good to go.
Answer: Not sure with unicode, but generally you can call str.encode() to convert it to a more suitable form. For instance, subprocess output captured in Python 3.0+ captures it as a byte stream (prefix 'b'), and encode() fixes to a regular string form.
Answer: You have to use print str(your_Variable)
Answer: Try the following

print str(result.url)

It could be that your default encoding has been changed.
You can check your default encoding with the following:-
> import sys
> print sys.getdefaultencoding()
> ascii

The default should be ascii which means u'string' should be printed as 'string' but yours may have been modified.
Comment: @Nik: If this answered your question, please mark it as the right answer.
Answer: In the case that you do not want to update to Python 3, you could make use of substrings.
For example, say the original output was (u'mystring',). Let us assume for the sake of the example that the variable row contains the "mystring" string without the unicode prefix. Then you would want to do something like this:
temp = str(row); #str is not necessary, but probably good practice
temp = temp[:-3];
print = temp[3:];


OSX Photos Events and Albums Have same photos

Question: I have migrated from iPhoto to OSX Photos. All my Events are there with all their photos. Back in iPhoto I had Albums and Events with Events always the master. I could delete a photo from Albums and it would stay in Events. That was fine. What are the rules for Photos pls? I can see the same photos in both Events and Albums but when I search for a photo (that I know is in both places) it shows up only in Events. I delete a photo from Events and it stays in Albums. Any clues pls?
Comment: [How iPhoto content and metadata migrate to Photos](https://support.apple.com/en-us/HT204478)
Answer: Events are now just albums. So, you can remove specific photos from Albums or "Events" without deleting the photo. Only if you delete a photo from the main Photos view is it actually deleted (and then, under File: Show Recently Deleted, you can recover it for 30 days).
I recommend deleting events that are no longer useful, as the Photos view now nicely converts into years and locations as you zoom out, which you might previously have manually set up as events.


Polar integrals of a function that does not surround the pole

Question: I am in Calculus II and am learning of the integration of polar functions. I understand the basic concept, that you are taking sectors of a circle from the pole to the function. However, I don't understand how that works for a function that does not contain the pole. If you were to try to take the area of such function (for example, r=cosθ), wouldn't the sectors of the pole take the area outside the circle and not inside the circle? Thanks
Answer: No because a line drawn from the origin at an angle $-\frac{\pi}2\le\theta\le\frac{\pi}2$ from the initial line would always be in contact with the inside of the circle mentioned. This means that any sector created would be formed within the drawn circle and hence the area found is within the circle.


Locate City: where's the origin point?

Question: What point within the nearby metropolis/town/... are the distances and bearings given by locate city referenced to?  Is it the center of the town square, perhaps?  A geometric center-of-population-mass?  Some other sort of computed centroid?
Comment: Shalvenay, what exactly do you want, where will it be, what is the primary function, etc.? There are a lot of questions coming up over similar things. Are you running an Ebberon Campaign?
Answer: Whatever the DM says it is
For some inconceivable reason, the spell's authors didn't rely on the spell being used as a non-narrative navigational aide. Absolutely no mention is made to it's capabilities as a nuke nor to how "population" or "town" is assessed.
This problem, therefore, falls squarely in the DM's prerogative, and the specific details of the spell's instantiation are a function of the game's narrative.
Comment: Fun.  Makes me wonder if I really am the first person to go "hey, this looks like what a VOR/DME gives me..."

Locate City: where's the origin point?


Unable to login to El Capitan Macbook Pro after booting, works after waking from sleep

Question: I've got a macbook pro running El Capitan and when I wake it up from sleep, the password works fine.  However, when I power it on from being shutdown or restart it, the password no longer works.  I have another admin account I can use to reset the password but I've done this twice now and it keeps happening.  I'm doublechecking that the caps lock is off and that I'm not mistyping the password or accidentally pushing the shift key or something.
Answer: This link https://support.apple.com/en-au/HT202842
Talks about how to force people to enter their passwords twice in order to login. It doesn't say so, but I read into this that it's possible to have a different password for unlocking the machine and for logging on.
I also remember once having a problem where the machine was asking for both passwords even though I had autologin enabled and the passwords where the same. I think I had to reset the PRAM or something like that. Sorry, was a while ago and haven't had the problem since.
Some other links that may give you clues:
https://discussions.apple.com/thread/6626285?tstart=0
https://support.apple.com/en-us/HT204837
Comment: I'm not too familiar with macs yet...does it make a difference that I can login to the other admin account with one password and it never fails?  or is this because the other admin account is the one that locked the drive with filevault?
Comment: Nevermind, I figured it out.  My user account wasn't setup to be allowed to unlock the hard drive so I have to login with the other admin account first then login with mine.


Travel Recommendations allowed on this stack?

Question: I do apologise for potentially asking two questions here, but I am looking for some travel advice for my upcoming trip to Norway (what to see on my specific route of travel). Is this allowed on this site? -- or is it more about Visa's and that kind of 'travel' stuff?
Comment: https://travel.stackexchange.com/help/on-topic
Comment: what to see - subjective and off-topic. Too many possible answers.  How to get from A to B? Yes. What visa? Yes. What ticket options with a particular discount card - sure.  Basically anything objectively answerable that matches the [help] is fine.  If it's subjective/after recommendations or you just want to chat - join the [chat] and we'll be happy to help :)
Answer: The best way to learn what Travel.SE is about is to read our help centre. On the on-topic page it says:

Travel Stack Exchange is for road warriors and seasoned travelers.. If you have a question about …

customs & border crossing, visas and other travel documents such as permits
accommodation: camping, hostels & backpackers, guesthouses, B&B's, hotels, renting a villa on a trip
loyalty programmes: frequent flyer points and hotel advantages
health and safety issues related to travel
modes of travelling: international, domestic, and public transport
finances: budgets, costs, foreign exchange
working while on the go (WWOOFing, volunteer travel etc) - not immigration or work visas, see below

and it's not about …

asking for the 'best' thing to do (or similarly subjective questioning). Everyone is different. Detail what stuff you like to do/see if you're going down that route, so that we can better help you. Subjective questions are VERY likely to get closed.
asking to have your travel itinerary constructed, including flight scheduling, budgeting and finding accommodation. Such questions cannot be answered as there are too many variables and personal preferences to account for, and are unlikely to be of use to others. An actual travel agent may be of assistance.
things that are overly broad or related to an overly big geographical region
cheapest [things, places] in [country, town, ...]
eliciting list-style answers, suggestions or recommendations on a topic or place (unless VERY specific criteria is listed)
a question where every answer is going to be equally valid (eg 'What country in Europe should I visit?' (which would also be overly vague and broad))
issues related to immigration / expatriates (see Expatriates Stack Exchange instead)
shopping suggestions

Unfortunately the question you are asking yourself now -- what to see on my specific route of travel? -- is both a travel-related question and is also off-topic on Travel.SE. The reason being that what to do is a subjective matter. What i like doing and seeing whilst travelling might not be what you like doing and seeing. Hence it would make no sense for us to answer such questions here since they would be of limited use for the next Traveller reading them looking for advice.
What I always suggest to new users is to look around the web for ideas, and them come on Travel to get top-notch advice by asking the on-topic questions they have. Also, I'd suggest you come to chat to discuss with fellow travellers. In chat we do not have off-topic rules per se so you are free to ask the passers-by if they've been to Norway and what they have done/seen.


Changing scrollbar size in Internet explorer 6 by using Windows CE 6.0

Question: I need to change the scroll bar's size of Internet Explorer 6 in Windows CE application. by referring to http://msdn.microsoft.com/en-us/library/aa452005.aspx , I'm only able to change the scroll bar slider's size(by changing SBSizeV and SBSizeH value) but not the arrow button's size. Is there any way that I could change the size? Thank you.
Answer: Basically, there is no reasonable way to do this.
You can change the size of a the scroll bars in a div.  See this question:
Can you change the width of a scroll bar (scrolling DIV) in IE7
That will ONLY work in IE and will make any other browser render the page very poorly.
Really, that's about as close as you can get.  The scroll bar is what the user agent (browser) uses to control overflowed content.  It's not something that is meant to be controlled by a web page at all.
IE lets you change the style of the scroll bar, its colors and such.  That's more control than other browsers will give you.
Sorry, but it's true.
Comment: Maybe not... http://www.bing.com/maps/ has no scroll bars by default.  I have no idea how.


how to write software description for patent request

Question: OK i finally finished my software, now i want to write a patent request,
my software is like a big network that contains many internal softwares.
the problem is that the internal   software is made for specific company, but  the big software which is the network it can be used in every company,i just need to edit the internal software and make other depend what the other company needs..
the question is, when i write my software description do i describe the software
that its for specific company, or i describe it as a global one?
and do i talk about the conceptual model as well? or maybe i should just find
someone else to do this in my place? im not sure. any advice would be a big help! ty
Comment: @EricShain The ultimate purpose of this site is to help future users who may run into this issue. Responses such as *"what you are asking is not possible"* or *"doing this yourself is not appropriate; you need a lawyer "* are perfectly appropriate if that is the correct response to the question... assuming you can so authoritatively.
Comment: @RobertCartaino I really do believe I understand the purpose of this site. Recently I've been the most active user answering questions.
Comment: @EricShain Please stop answering questions in comments. Your initial comments elicited replies in kind and the entire issue was resolved... in comments — and yet the question remains unanswered. Please stop using this site in this manner. This is not a discussion forum. thank you.
Comment: @RobertCartaino My "answer" was essentially saying there is no way to answer the question. My response to the questioner's comments was to iterate that we can't answer this question. I don't believe answering questions with "we can't answer the question" is appropriate. That should be part of your response to guide searcher who come after.
Comment: @EricShain Fair enough; I am also talking over your shoulder to anyone else looking on who might less familiar with the system.
Answer: Considering recent court cases (most prominently Alice), it is difficult to draft an application to get a patent on software innovations. A more narrow and specific question on the topic might get a good answer here, but this very general question is not really answerable. I recommend you get professional help.


How do I calculate the thrust output of a high bypass turbofan engine? (7th grade)

Question: I am trying to create a small version of a high bypass turbofan engine but I can't seem to find any materials that show how to calculate thrust but on a 7th grade level. If anyone here can help me I would appreciate it immensely. Also I know that engineering and physics are pretty complicated subjects usually taught at a higher grade but I just really do need the help at this moment for what I am doing.
Comment: That's going to be a stretch (unless you can assume knowledge of air flow). You can find online course notes from universities, https://duckduckgo.com/?q=jet+propulsion+university+course+notes&ia=web ... It would be a 3rd or more likely 4th year class in aerospace specialty, and would build heavily on fluid mechanics and engineering thermodynamics.
Answer: Forces have the units of mass times distance divided by time squared. So kg meter/sec^2 is standard in the metric system. 1 kg meter/second^2 is called a Newton. If you are talking about solid objects like rocks, this gets factored as Force = Mass x Acceleration. Here Mass is in kg and Acceleration is in meters/sec^2. This is the way it is usually taught first is school.
But there are other ways to factor kg meter/sec^2. If you are talking about a fluid process like a jet engine, we can say Force is equal to the Mass Flux X the change in Velocity (kg/sec X meter/sec). You get the same kg meter/sec^2 that way as you did with F = Mass X Acceleration.
So you can calculate the Thrust force of the turbofan by calculating the mass flux of air that goes into the jet core, and the mass flux of fuel that goes into the jet core and adding these together. Take the sum of the mass fluxes and multiply by the jet core exhaust velocity in meters per second. That gets you core thrust. Bypass thrust is similar, but there isn't any fuel mass. Just multiply the mass flux of bypass air times the velocity of the fan exhaust.
The internals of the fanjet extract energy from the core to drive the fan. The core usually ends up producing little thrust directly since most of the energy is taken to drive the fan.


Help designing a serial adder

Question: I need to build a circuit that adds two n-bit 2's complement numbers. the two numbers have to be stored in shift registers. The circuit should start with the least significant bits of each number and add each pair of bits using an adder. The sum bit from the adder will then be stored into one of the registers. WE need to use 2 shift registers, an adder and one dflipflop.
Comment: Homework questions with no attempt at a solution are closed.
Comment: You must show some effort, you can't expect us to solve your homework.
Answer: As it seems to be a homework in which you don't show that you tried anything before posting I will just lead you to the answer, although you could have found it with a simple Google search.
Everything you need can be found in those two links:
Registers and Counters
4-Bit Binary Adder / EE 584 – Introduction to VLSI

Help designing a serial adder


Why is the Oedipus complex named after Oedipus?

Question: What is the relationship between the Oedipus complex and the character Oedipus? Is there any? It is a big jump between someone who answered a riddle to a psychological complex.
Answer: The full story (in short) of Oedipus is that his father heard a prophecy that his son will kill him. So he threw him away (basically ordered him to be killed but the killers spared him). After growing up he came back (solved the riddle on his way back) and then rebelled against his dad (without knowing that he was his father), killed him, and married his mother having children with her. After he found out that he in fact married his mother and killed his father he took his eyes out.
Basically the prophecy that Oedipus' father heard was in fact a self fulfilling prophecy. If he never had ordered his son to be killed, he would never return to kill him.
So since Oedipus killed his father, fell in love with and married his own mother, the Oedipus syndrome was named after him. To simplify things enormously, the complex refers to a subconscious love for one's mother, and thus jealousy towards one's father (as the father has a legitimate relationship with the mother).
Comment: In a very provocative study (*Sophocles' Oedipus: Evidence and Self Conviction* [1991]), Frederick Ahl argues that Oedipus was not at all unwitting when he killed his father and married his mother.  The Freudian implications of this thesis suggest that Oedipal desires are not as subconscious as we've always assumed.  Indeed, much clinical literature establishes that there's frequently no latency with regard to Oedipal impulses.


TeXcount and biblatex

Question: I have recently switched from BibTeX to the biblatex package (using the Biber back-end) and I can only subscribe what others have already said about its many virtues. This question is not so much about biblatex itself as about its interaction with the TeXcount scripting facilities for word counting in TeX-based documents. How can the settings of the latter script be tuned in order for it to work with biblatex (meaning, for TeXcount to be able to proceed as it does with BibTeX)?
Comment: I am planning on adding a biber feature to add a word count directly to the .bbl as it's much easier and more reliable for biber to calculate this from internal data than to guess it from the .bbl. It will either be in a comment or a macro like `\wordcount{num}`
Answer: This is a tricky topic because with pure bibtex, the .bbl you see is what is included in the document. With biblatex, the .bbl is essentially a database and not necessarily everything in there appears in the document. It depends on the biblatex style and which fields it chooses to use. In general, a wordcount of a biblatex .bbl will overestimate the number you want for the document. Even if biber makes this easier by calculating the .bbl wordcount for you (which it doesn't yet), it will nearly always be an overestimate as there is no way of knowing from the .bbl what happens to the fields in the style.
Having thought about this some more, I think it's not really possible to wordcount biblatex bibliographies in any decent way. The problem is that there are many biblatex options like minnames, uniquename, uniquelist, useprefix etc. which reduce/increase the number of "words" used from the .bbl at compile time. This means that you are never really going to have an accurate word count of the bibliography or citations by looking at the .bbl. You'd have to take account of the style, the biblatex options, any user-code which copies/removes/changes .bbl data. Plus it's very hard even for biber to "count" things like related entries (which may or may not have data used in the output), data based in inheritance rules (CROSSREF and XDATA), XREF (completely impossible as it's all done in arbitrary biblatex code at compile time), "data-only" entries for sets etc. Basically, you'll get an approximation at best.
It is probably more reliable to count the finished PDF using pdftotext | wc or whatever. This can have problems with maths but it'll probably be better than trying to count biblatex .bbls, especially if you are using any of the biber features like related entries, XDATA etc.
Comment: It's a bit easier with `bibtex` because the .bbl is essentially the final form which is spliced in at the `\bibliography` command position. The whole point of `biblatex` is precisely that this has a lot of limitations which is why it treats the .bbl more like a TeX database of sorts ...
Comment: And with a verbose style it may underestimate, perhaps, instead, since the same citation data may get typeset several times.
Comment: Yes, good point. In general, word counting the pre-compiled source doesn't work conceptually with `biblatex` at all I'm afraid.
Comment: Thanks for the detailed explanation on the issues. Although it doesn't provide a solution, I am awarding you the bounty. I guess the discussion should probably go into a package that would calculate the word count at compile time, since as you mention it, counting at the pre-compiled source level is not accurate (this is also the case I think with bibtex depending on the bibliography style (numbered or author-year). The problem I can foresee with the package solution is that it would be very easy to run out of memory with large document.
Comment: What I meant was that the appearance in the text of the reference changes with the style, which I think is not in the bbl or the source and only generated at compile time. I am not sure how texcount takes that into account if at all, but would assume it does not.
Answer: Digging in the documentation of TeXcount, I can propose the following workaround. Please note that it is far from perfect:

it will throw out a lot of (non critical) errors due to the way TeXcount parses \verb
it will be imprecise (count some things which aren't words, not count others... I deem it as acceptable because there is the same problem with bibtex)

So, you need to add rules for TeXcount. In the following, the rules are in the "document" format, as you would include them in the document you want to parse, but you can easily transform them into global TeXcount rules.
The first thing is to get it to parse the filename.bbl file with -incbib. We are quite lucky that biber uses the same .bbl extension as bibtex, so all we have to do is convince TeXcount that we are using a bibliography:
%TC:subst \printbibliography \bibliography

Now, for the counting, we have to add rules for biblatex's macros. They are more or less approximate, especially the \name one, which will count one word for an internal hash, but I don't see any easy workaround. Anyway, as previously stated, given the unaccuracy of the overall count in the bibliography, I consider this one more mistake as acceptable.
%TC:macro \field [0,1]
%TC:macro \name [0,0,0,1]
%TC:macro \list [0,0,1]

This may miss some macros, but adding some more isn't really difficult: just look at the .bbl file to see what is expected to be in the macro arguments, and select the arguments in which you want to count the words (0: don't count, 1: do count).

TeXcount and biblatex


Is there any way to run blender 2.80 add-ons on Blender 2.79

Question: I tried to run a Blender 2.80 addon script on blender 2.79. But it is not working. Is there any way to run it?
Comment: Blender 2.80 has brought many changes to the python API, so many commands or functions of Blender 2.79 will not work on Blender 2.80.

To make a 2.79 addon work on 2.80 it needs to be modified to reflect those changes by the creator or by any other people of the community who is willing to spend the time on it. I suggest you to search for the update version on the internet, and if it's not there, ask on this or other forums for the updated version. Many other people will probably benefit from it as well
Answer: No there isn't. The Python API has changed between the two versions and therefore add-ons for Blender 2.79 won't run in Blender 2.80 and the other way around.
You would have to modify the code of the add-on to let it run in Blender 2.79.


How can I securely identify mobile devices on a network without a lot of overhead?

Question: I am thinking there must be some alternative better than passwords, but not so complex and difficult to administer as a full PKI infrastructure with client certificates on every device.  My primary concern is to prevent malicious users from spoofing a device that belongs to someone else and then guessing the password.  We want to prevent identity theft in the mobile application, which is processing financial transactions.  Implementing too much security would negate the convenience of mobile access, and the users would not adopt a mobile centric workflow.  Is there an alternative, a middle way?
Comment: Please add more detail about the situation. Is this for internal users or for external customers? Is this an app, website? Are you talking about guessing the WPA/2 password? Without something like 802.1x you are going to have a hard time preventing spoofing of MAC addresses at the network level.
Answer: It sounds like your real concern is at the application level. You could secure your connection via VPN; In this scenario you block access to the app from the network that is just the WiFi and require it only come from the VPN's network or other approved network. You may also consider, possibly in addition, using some type of HTTPS, TLS, etc at the transport or application layer to encrypt the connection. If you are doing financial stuff, this should have already been a requirement.
Just because you are on the network, one should not be able to just get to the app. If you were talking about getting the WPA2 password, requiring encryption at layer 3 or above can help that. If you were talking about breaking a user's application password, there should be controls in place to limit brute force attempts and to ensure complexity rules are sufficient.
If you provide more detail in your question, I will update this response.


Eternal Return as palliative care for the weak

Question: Long ago in a forum I found an opinion that Nietzsche concocted the idea of Eternal Return as palliative care for the weak — that it is a soothing notion that there could be endless opportunities to relive your life in different circumstances and with different choices — which would effectively help clear the path for those individuals exhibiting a more masterful morality. Is there anything in Nietzsche's texts that would corroborate or refute this opinion?
Comment: I'd need to dig through my copies of the man, but at first glance this seems a thoroughly un-Nietzschean thing to say. Nietzsche did not deal in the business of making people feel better about themselves. At all.
Comment: Maybe not feel better but at least get out of the way. TSZ - "Gentle is Zarathustra to the sickly. Verily, he is not indignant of their modes of consolation and ingratitude. May they become convalescents and overcomers, and create higher bodies for themselves!"
Comment: But it is *recurrence*, there is no major change in circumstances.  It is almost the exact opposite pole from reincarnation (which can be seen as such a palliative).  You do not get another chance, in some variant form.  As the universe converges toward exact repetition, you are forced to relive something almost exactly like your current choice over and over in a more and more definite convergence to exact repetitions.  It encourages you to get it right early on, not to evade decisions.
Answer: This extract from the Gay Science appears to refute it:

What, if some day or night, some demon were to steal after you into your loneliest loneliness and say to you: 'this life as you live it, and as you have lived it, you will have to live it once more and innumerable times more ...'
Would you not throw yourself down and gnash your teeth and curse the demon who spoke thus?
Or have you once experienced a tremendous moment when you would have answered him: 'you are a god, and I have never heard anything more divine'.

Quite what N means by this has lead to a mini-industry of exegesis through his notebooks and other writings, but nothing really conclusive...
Comment: Seems like N is tipping the scales there when he says the demon is visiting in your "loneliest loneliness". Why not visit you while you're drinking with your friends or something?
Comment: More effective that way, unless your drinking pals turn out out to be demons in disguise - waiting for the penny to drop...


Do bag liners add the same warmth value to all sleeping bags?

Question: I have a bag liner that claims to add 15 degrees to the "range" of a sleeping bag.  Is it reasonable to assume that it would work the same for all bags?  For instance, would it extend a 40 degree bag to 25, and a 0 degree bag to -15?
Comment: What's its weight? Unless it's several hundred grams I doubt the insulation value. 15 degrees of difference is a lot.
Comment: On non-backpacking trips I have taken to filling my sleeping bag with all the clothes I brought, coats, hats, socks, you name it. We found filling the sleeping bag with cloth is more effective than liners. (Of course, if you Are backpacking, all you'll have is a coat and some extra socks.)
Comment: I second everyone that questions the magic warming power of liners (especially the thin silk-type ones).  Waterproof liners (aka vapour barriers) have a place in winter camping, but beyond that, *insulated* liners would be the only sure-fire way I can see to increase warmth!
Answer: It's not reasonable to assume that it would add 15 degrees to all bags. Every bag is different, and the ground (snow? type of pad insulation?) and amount of air flow makes a difference.
Incidentally, some bag liners are waterproof and not breathable. This can cause condensation and make it feel colder inside than it would without the liner.
Comment: You can probably add more than 15 degrees by wearing a bunch of fleece to bed (as long as it's dry), in case the liner doesn't work well.
Comment: I don't think it's reasonable to trust that a liner would actually add the claimed 15° (or other number) to any sleeping bag no matter the bag's temperature rating, even though I know they do add some insulation. I'd maybe count on getting about half of what is put on the label. Liners to me are more about preserving the insulation in the bag itself so that it stays cleaner longer and thus maintains its insulating capacity longer.
Comment: I was afraid of this, which then leaves the question of how to test it without putting myself at risk ;)
Answer: I'd say yes, it would add roughly the same temperature boost to all bags.  This is of course assuming other conditions are the same, like the surface you are on, stillness of the air, etc.
Short of the material actually changing physically (like down getting more fluffy), one piece of insulating material will have the same temperture drop accross it for the same heat power going thru it, regardless of the absolute temperature.  Put another way, if something exhibits a 10° drop when you put 50 watts thru it, it will exhibit that same 10° drop whether that is from 10 to 20 degrees or 50 to 60 degrees.  Again, this is assuming the material is not changed by the temperature difference, like it melts, clumps, gets more fluffy, etc.
Of course things will vary, but as a first rough approximation I'd say the degrees added "warmth" will be about the same accross different bags inside.
Comment: I think this makes sense. Thermodynamics is the same backpacking or not. However I wish we had a way to confirm this by testing. The real question to me though is does it _truly_ provide the indicated 15° boost. My guess is that figure is more marketing than real R-value.
Comment: It seems like it would depend on some other factors. For example, if the liner is porous and the sleeping bag is porous, then the liner will have less insulation in the wind. If the line is thin, then it will have less insulation on the snow (on the bottom), at least in the case of no or little insulating pad, than it would on dry ground because of the greater temperature differential and, as you mentioned, it changes physically under body weight.


Where are the RowEnter and RowLeave events of a kendo-grid for Angular 2?

Question: In an ODATA bound Kendo UI Angular 2 table, I have to meet the requirements to save the data the user changes through inline edit per row, not per cell.
I could do so, if there were RowEnter and RowLeave events.
Where are these?
Answer: There are sadly no such events, there is however a selectionChange-event which triggers, when the grid's selectable property is set to true, and as long as you do not place any ng-template-elements within the kendo-grid-column-elements as such
<ng-template kendoGridCellTemplate let-dataItem>
    <input type="checkbox" [checked]="dataItem.Dropped?true:false" (click)="DroppedClicked($event, dataItem)" />
</ng-template>

Such a template is not integrated within the edit mode, and user interaction will not be respected, until you explicitly write the values back into the model and manually take care of whether that cell was in a different row than before! In other cases, you can rely on the selectionChange event, which will trigger as the user activates a control of a different row.
To identify the row change from the above template's input element, the click event passes both event variable and the dataItem into DroppedClicked-eventhandler, and that handler does this:
public DroppedClicked(event, dataItem): void
{
    let rowIndex = event.currentTarget.parentNode.parentNode.rowIndex;
    let arg = { crtlKey: null, deselectedRows: [this.currentRow], index: rowIndex, selected: true, selectedRows: [dataItem] };
    if (rowIndex != this.currentRowIndex) // row has changed
      this.onRowChange(arg);
    dataItem.Dropped = event.target.checked ? 1 : 0;
}

where onRowChange(...) is the event handler for the selectionChange-event, registered in the grid's html template:
<kendo-grid projectAssignmentBinding [pageSize]="30"
            [pageable]="true" [filterable]="true" [selectable]="true" (selectionChange)="onRowChange($event)"
            [sortable]="true" [height]="500" editable="true"
            (cellClick)="onEditCell($event)" (cellClose)="onCellClose($event)" >
    ...
</kendo-grid>

and that handler does this:
  public onRowChange({ crtlKey, deselectedRows, index, selected, selectedRows }) : void
  {
    //alert("Row is changing!");
    if ( this.isDirtyRow )
        this.SaveRow();
    this.currentRow = selectedRows[0];
    this.currentRowIndex = index;
  }

with SaveRow() saving this.currentRow and resetting this.IsDirtyRow to false.
What cost me the most effort, was to accept that the edit mode relies on cellwise starting and ending the formGroup in the cellClick and cellClose events: regardless of the column, cellClick must start a new formGroup, because cellClose does not publish the columnIndex in its $event, and it closes the whole formGroup altogether.


Why are tail rotors in helicopters vertical?

Question: I guess spinning in perpendicular direction to main rotor is better in counteracting the torque but what's the mechanism at work?
Answer: the thrust force developed by a rotating propeller points along the direction perpendicular to its plane of rotation. Since the objective of the tail rotor is to counteract the torque reaction imposed by the main rotor on the engine which turns it, geometry dictates that the tail rotor has to be perpendicular to the plane of rotation of the main rotor.
Some helos have tail rotors which are canted at a slight angle off perpendicularity, which is a way of accomodating the fact that at cruise conditions (maximum forward airspeed), the airflow over the fuselage and main rotor is slightly asymmetric.
Answer: Tail rotors are the obvious solution when you don't want the helicopter's body to start spinning while the rotors remain almost stationary.
Let's imagine that you don't have the tail rotor. According to Newton's third law, there'll be an opposing force when the main rotor spins, and hence the helicopter itself rotates. The tail rotor is positioned a reasonable distance from the helicopter's center of mass, so it provides a torque to allow the helicopter to remain straight. Clearly, this won't be very effective if you had a horizontal tail rotor: the horizontal component of the force exerted by the tail rotor (which is what you need to counter the rotation caused by the main rotor) is directly proportional to the cosine of the angle between the vertical axis and the force exerted by the tail rotor.
Frequently, rotation of the helicopter can be achieved by slowing down or speeding up the tail rotor, though there are better ways (like tilting the main rotor).

More interestingly, the same effect of making sure that the helicopter doesn't start spinning can be achieved with a rotor that's in the same orientation as the main rotor: look at co-axial rotors. Essentially, a coaxial rotor is of the same size as the main one, but it spins in the opposite direction. So it provides lift, but it tries to rotate the helicopter in the opposite direction, which results in no net rotation.
Wikipedia has a great gif to descripe what coaxial rotors are:
Comment: The two counter-rotating rotors of a tail-less helicopter do not have to be coaxial. It is sufficient for the axes to be parallel.  https://en.wikipedia.org/wiki/Boeing_CH-47_Chinook


ie 11 keeps asking for my credentials

Question: I am trying to log in to sharepoint site http://portal.......ca/sites/HR/en-ca  in ie 11, however, I get the windows security screen asking for my credentials,  I already added portal......ca to my trusted sites in ie 11, Is there any other setting in ie 11 that i am missing?
Comment: Do you have any checked out files those are being used in master page? meaning scripts or styles etc. If so then check in them all
Comment: Is this a new issue (e.g. recent upgrade to IE 11)?  Was the portal recently built and/or upgraded (e.g. authentication was configured at the web application and IIS levels)?
Answer: Go to Internet Options -> Security Tab -> Trusted Sites -> Click Custom level.. button -> Scroll all the way down and set Logon = "Automatic logon with current user name and password"
That should do the trick.
Answer: After making sure all the IE and Windows settings were correct, I fixed my user's issue by uninstalling and then reinstalling IE 11. Before, the user had to login to SharePoint every time he rebooted, even though he selected the option to remember his login and to not prompt again. After reinstalling, SharePoint remembered his login perfectly, even after rebooting. This was a very hard problem to figure out and the solution is maddening, but at least it works now!

ie 11 keeps asking for my credentials


Unconfimed transaction

Question: I have sent BTC to cryptopay wallet. It is still showing pending. It has been 8 hours up to now. Can you please tell me what could be the error or the problem and how I can solve the issue
Thank you
Answer: The fee specified by your send transaction could be too small for any miner to include it in a block of transactions.
Some -- possibly too much -- information about fees is here: https://en.bitcoin.it/wiki/Transaction_fees
Answer: First check a block explorer like blockchain.info to see if the transaction was even broadcast.  If it was not, then look into resetting your wallet.
If you see the tx on a public block explorer, then you probably underpaid fees - See this answer.  Here are some options:

If BTC was sent from Electrum (or another wallet that supports RBF), then add a larger fee.
If you own the destination wallet, you can try using Child-Pays-For-Parent -- just send the unconfirmed amount to yourself with a very high fee.
If neither of the above are true and you didn't use Bitcoin Core, you may have to just wait or find some other way to double spend your tx...

More info on ways to modify fees after tx is sent: Replace-by-Fee vs Child-pays-for-Parent?

Unconfimed transaction


Did Hegel provide any example of history repeating itself?

Question: Did Hegel or Marx give any examples? Can anyone give a couple of instances?
I can find no event repeating itself twice, just one drive, lust of power
Comment: Depending on what you believe, some people would say the American Republican party is repeating the lead-up to Nazi-ism, and other people would say the American Democrat party is repeating the lead-up to the fall of the Roman Empire...
Comment: And some of us non-Americans can see *both* happening.
Comment: History in Hegel and Marx does not exactly repeat itself, for it undergoes a progressive development and cannot be precisely predicted in the manner of scientific laws. However, similar patterns can be discerned.  Marx famously remarked that history repeats itself "The first time as tragedy, the second time as farce." He refers in this case to the French Revolution and rise of Napoleon and the subsequent "bourgeois" revolution and the rise of the insipid Napoleon III.
Comment: "Once identified--such as small pox or typhoid--then science could step in to advise how to limit the spread by changing human behavior--wearing a mask for example--or by developing vaccines to cure an individual"? Vacines don't have therapeutic functions. Try preventive instead!
Answer: Are you referring only to the well-know Marx's quote into The Eighteenth Brumaire of Louis Napoleon (1851-52) regarding Hegel, or are you considering Hegel's philosophy of history in general ?

Hegel's philosophy of history is perhaps the most fully developed philosophical theory of history that attempts to discover meaning or direction in history. [...] He constructs specific moments as "world-historical" events that were in the process of bringing about the final, full stage of history and human freedom. For example, Napoleon's conquest of much of Europe is portrayed as a world-historical event doing history's work by establishing the terms of the rational bureaucratic state.

Thus, Hegel's view of history has no "recurrence".
Marx comment is about Hegel's Lectures on the Philosophy of History (1837), Part III : The Roman World, Section II: Rome from the Second Punic War to the Emperors, regarding Caesar :

But it became immediately manifest that only a single will could guide the Roman State, and now the Romans were compelled to adopt that opinion; since in all periods of the
  world a political revolution is sanctioned in men's opinions, when it repeats itself. Thus Napoleon was twice defeated, and the Bourbons twice expelled. By repetition that which at first appeared merely a matter of chance and contingency becomes a real and ratified existence [emphasis added].
Answer: Really? You couldn't come up with any historic events that have repeated more than once.
The most obvious would be the pandemic. In the 1660's the 'known world' faced the Black Plague, then there were outbreaks of cholera and yellow fever, in the 1910's Spanish Flu epidemic, in the 80's HIV/AIDS, we've seen SARS, West Nile Fever and today we are dealing with Covid-19.
How about this for history repeating itself... during the Spanish Flu epidemic face masks were REQUIRED by law. From Spring to fall Americans leaving their homes without a face mask were jailed. In October 1918, elected officials in San Francisco determined that citizens had been locked down and masked long enough and against protests from medical professionals held a big unmasking party in downtown SF. Thousands of SF residents gathered to celebrate the end of Spanish Flu- following a countdown all attendees dropped their masks in the street. Predictably, two weeks later San Francisco faced a huge surge in cases of Spanish Flu and were again required to lock down and mask up.
Does THAT sound familiar? Look at racial tensions in the US, protests against police brutality, the worldwide rise of fascism. These are all repeats from humanity's 'greatest hits'.
No matter where you fall in the political spectrum, you must see the parallels. It shouldn't take much effort.
History repeats itself. If you doubt it, I will only say "Enjoy your youth!" With years and life experience, the repetition of history will unfortunately be undeniable.
Comment: I am downvoting, because the question is specifically with reference to *Hegel or Marx*.
Comment: We encourage users to use references like [Wikipedia](https://en.wikipedia.org/wiki/Main_Page), [Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/), the [Internet Encyclopedia of Philosophy](https://iep.utm.edu/), and [PhilPapers](https://philpapers.org/) to strengthen the quality of responses.
Comment: I did upvote, though.


What can I do if celery forgets about tasks on a (apparently) random basis?

Question: I have a flask app with sqlalchemy and a celery worker up and running. I use redis as my broker. Every time someone submits a new message in a conversation, a worker is started and is supposed to send notification mails to all people participating in the conversation. Thus it connects to the database and gets all relevant email addresses.
Unfortunately there seems to be a random factor deciding, whether celery knows the task that sends mail or not. After some starts it works perfectly (sometimes), after some starts it does not work at all. The error I get, when it does not work is:
<code>[2012-11-28 21:42:58,751: ERROR/MainProcess] Received unregistered task of type 'messages.sendnotifies'.
 The message has been ignored and discarded.

 Did you remember to import the module containing this task?
 Or maybe you are using relative imports?
 Please see http://bit.ly/gLye1c for more information.

 The full contents of the message body was:
 {'retries': 0, 'task': 'messages.sendnotifies', 'eta': None, 'args': [41L], 'expires': None, 'callbacks': None, 'errbacks': None, 'kwargs': {}, 'id': '47da3ba7-ec91-4056-bb4f-a6afec2f960f', 'utc': True} (183b)
 Traceback (most recent call last):
   File "/var/www/virtual/venv/lib/python2.7/site-packages/celery/worker/consumer.py", line 410, in on_task_received
     connection = self.connection
 KeyError: 'messages.sendnotifies'
</code>
When i run celery with <code>--loglevel=DEBUG</code> it lists the task in the tasklist though:
<code>[Tasks]
   . celery.backend_cleanup
   . celery.chain
   . celery.chord
   . celery.chord_unlock
   . celery.chunks
   . celery.group
   . celery.map
   . celery.starmap
   . event.notfiy
   . messages.sendnotifies
   . money.checktransaction
   . money.deploypayment
   . money.invoicepromotion
   . protocols.plotweight
   . questionnaire.deploy
   . questionnaire.suitability
   . registration.notify
   . tracking.track
   . user.checkaccount
   . user.checkaccounts
   . user.fixpermissions
   . user.genpassreset
</code>
I could not determine a system yet, when it works and when not. But I have upgraded all relevant packages to the latest version available today and it still does not work.
I am hoping for any ideas on why this might not work and how I might be able to fix it. Every feedback is very much appreciated, as I am kind of desperate!
Answer: This could be a bug fixed in the current 3.0 development, you could help test it by
installing:
pip install https://github.com/celery/celery/zipball/3.0


Catchphrases; Is it similar with colloquial expressions?

Question: Are Catchphrases only made by a certain group in a certain area? Do people live in Southern America have different catchphrases with those live in Northern America?
May I count dunno and wazz up as catchphrases?
Comment: "dunno" and "wazz up" and even "wazaaaaaaaaaaaaaa" are hardly catchphrases. They are colloquial usages of "don't know" and "what is up?" respectively.
Answer: A catchphrase is usually created when a line said/written by someone is used very commonly by a group in their everyday conversations. Catchphrases are phrases that catch on from one group of people to another. They are found in most languages and not just in English.
So a question asked by the Joker in The Dark Knight movie, "Why so serious?", might not have originally intended to be a catchphrase although you might have noticed people around you use it during conversations in light humour.
"Dunno" and "Wazz up" on the other hand are not catchphrases. They are a part of the English slang word group and are used informally in different places.


Best practice for displaying modal view above UISplitViewController

Question: Creating  a new app based on the SplitViewController template and it works fine in Split View.
My main screen is to be a non-splitview 'menu'.  I'm trying to figure out the best practice for
adding this 'mainMenu' modally above the splitViewController.  (Then either push other non-split views above the mainMenu or
remove it to reveal and use the UISplitViewController.)
I have tried:
<code>[self.navigationController presentModalViewController:mainMenu animated:NO];
</code>
And
<code>[self presentModalViewController:mainMenu animated:NO];
</code>
In the viewWillAppear and viewWillLoad methods for rootViewController & detailViewController.  In both cases, the code executes without error, but the mainMenu doesn't appear, the regular detailViewController and rootViewControllers appear.
(I did create an outlet from the navigationController in the main.xib file to the detailView navigationController, but that didn't change anything.)
I was able to make this work by using, which works, but seems like it is incorrect.
<code>iPad_Prototype_SplitAppDelegate *delegate = (iPad_Prototype_SplitAppDelegate *) [   [UIApplication sharedApplication] delegate];

[delegate.splitViewController.view addSubview:mainMenu.view];
[delegate.splitViewController.view bringSubviewToFront:mainMenu.view];
</code>
I've seen many responses saying to present such a covering view modally, but I can't seem to find the right place or configuration in the splitViewController setup.  Thanks for any help or insight.
Finally, is this approach wrong, should I just be swapping out the detailViewController and having it take full screen in portrait mode and not add the menu item for the root controller?
Comment: I did (as I noted in the description.)  I'm sure I'm missing something...
it also works after loading.  i.e. if I add a method call to be performed 0.01 seconds after viewWillAppear then it works (but you do see the transition.)
Answer: Is your splitViewController in the AppDelegate like the example and will this help?
<code>//AppDelegate.m
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

MyController *myCont = [[MyController alloc] initMainMenu];
// mess around with myCont.view.modalPresentationStyle;

[myCont setModalDelegate:self];
// Create a delegate (<ModalControllerDelegate>) to dismiss view when done

[self.splitViewController presentModalViewController:myCont animated:NO];
[myCont release];
}

// for completion sake
-(void)modalViewDismiss:(MyController *)modalView {
    [self.splitViewController dismissModalViewController:YES];
}
</code>
Comment: In an application using storyboards, presentModalViewController doesn't seem to work when called from the AppDelegate.


iframe zoom issue

Question: I am attempting to get a cross-browser css zoom to work, but everything I have found here isn't working for me.
Here is what I have:
HTML

CSS
#themeframe{
position:relative;
width:520px;
height:400px;
margin-top: 20px;
border: none;
overflow: hidden;
}

#themeframe .themeframe-overlay{
position:absolute;
z-index:95;
left:0;top:0;
height:100%;width:100%;
background:#fff;
opacity:0;
filter: alpha(opacity = 0);
}

#themeframe iframe {
width:1040px;
min-height: 800px;
overflow: hidden;
-moz-transform: scale(0.5);
-moz-transform-origin: 0 0;
-o-transform: scale(0.5);
-o-transform-origin: 0 0;
-webkit-transform: scale(0.5);
-webkit-transform-origin: 0 0;
-ms-transform: scale(0.5);
-ms-transform-origin: 0 0;
margin: 0;
padding:0;
border: none;
}

What am I trying to achieve?
I have a 520 x 400 div that I want filled with a 50% scaled version of a webpage. As shown above, I have issues in IE, where the div/iframe is the correct size, but the webpage inside is 100%, NOT 50%. This is working in every other browser. If I add zoom:0.5; to the iframe css, it fixes it in IE, but breaks it in chrome.
I am having trouble getting this to work in IE, Chrome, Safari, and Firefox all at the same time.
Any thoughts?
Answer: Found the answer, which at least worked for me. Part of this answer was used following the steps found here.
First, arrange your HTML like this (I'm bad at arranging code on this site):

Then CSS looks like this:
#themeframe {
    overflow: hidden;
    position: relative;
    width:800px;
    height:850px;
    -ms-zoom: 0.75;
}

#frame {
    position: absolute;
    overflow-x: hidden;
    top: -300px;
    -moz-transform: scale(0.75);
    -moz-transform-origin: 0 0;
    -o-transform: scale(0.75);
    -o-transform-origin: 0 0;
    -webkit-transform: scale(0.75);
    -webkit-transform-origin: 0 0;

The changes I'll point out are:

I wrapped the iframe in a div called themeframe
I gave the iframe an id so we could style it in CSS.
I used the -ms-zoom on the wrapping div of themeframe not within the iframe. This is because IE will scale the whole iframe to your set zoom size, not the content within it (which is what Chrome and Firefox do). It is also important to use -ms-zoom in the CSS and not simply zoom since Chrome will go crazy and pay attention to both zoom and -webkit if you don't make the ms distinction.

Hope this helps. It works for me in Chrome, FF and IE8.

iframe zoom issue


SharePoint 2013 - import into a Promoted Links list

Question: I have a site owner with a list of over 100 links to bring into a Promoted Links list. Is there a simple way to do this? The combined URL and description for the background image and the link itself are giving us trouble.
Answer: You should be able to export the list with links to Excel, and reformat it + add links to your description and background image for each field, and then use quick edit in a promoted links list to copy paste the content from the Excel directly to the list in SharePoint.
The limit is 100 for each copy paste. If you are below 200 links, it should be quick.
If you are unsure how to format the excel to match the promoted links column, just create one tile in the promoted links list and then export it to excel. This should give you the idea what information you need to provide to be able to bulk-upload the tiles.


Index was outside the bounds of the array

Question: Very simple problem.but still unable to solve it.
I pass a message to array
 feet nimantha 1 2 3 4 5 6 7 8 120827
Already i declared the array like this,
string[] arr1 = new string[10];

And after that, I tried it to
string[] arr1 = new string[11];

But both shows me this exception- Index was outside the bounds of the array
Code is here.
protected void Page_Load(object sender, EventArgs e) {
  try {
    string mobileNo = Request.QueryString["msisdn"];
    int  dest = int.Parse(Request.QueryString["shortcode"].ToString());
    string messageIn = Request.QueryString["msg"];
    string operatorNew = Request.QueryString["operator"];

    // Label1.Text = "ok";
    WriteToFile(mobileNo, dest, messageIn, operatorNew);
    if (messageIn != null) {
      string[] arr1 = new string[11];
      arr1 = messageIn.Split(' ');
      int size = arr1.Length;
      string arrmsg = "";
      foreach (string _element in arr1) {
        if (arrmsg == "")
          arrmsg = _element;
        else {
          arrmsg = arrmsg + "/" + _element;
        }
      }
    }
  } catch {}
}

Comment: What do you mean by "I pass a message to array"? Please show your code - you haven't shown anything *accessing* an array yet, which makes it impossible to help you really...
Comment: Code Added.Please dont down vote.It's end of my life in stack overflow
Comment: The edit helps, but: which line throws this error? because none that I can see would actually cause an index-out-of-range: `foreach` knows about ranges. BTW, the `new string[11]` is redundant, because that array is **replaced** with the one from `messageIn.Split(' ')`. Is there some more code just under this that accesses something by index? perhaps in a string or the array? Also: is it possible that `WriteToFile` is throwing the exception?
Comment: What line in your code above is triggering the error you mention?
Comment: @NimanthaPrasad to re-prompt: the error is not coming from the current code posted. So: either we need to see a bit more, or you need to look at the `.StackTrace` of the exception. Preferably both.
Comment: You have only declared the array! Where do you assign a value to it?
Comment: `string[] arr = "feet nimantha 1 2 3 4 5 6 7 8 120827".Split(' ');` give you an array of 11 elements, how are you passing it to the array, post some code
Comment: Could you show code where your exception is thrown?
Comment: Can you show the code when the exception is fired>
Comment: @NimanthaPrasad: Yeah, but where is the exception thrown? Wherever you're seeing it, it's probably providing a stack trace that should tell you the line number. Or you could even identify the line by stepping through the code with a debugger. (In fact, chances are if you do that it'll answer your question for you.)
Comment: @NimanthaPrasad In one of the comments you stated that the message comes with "feetnimantha123456789120827"; there will be 12 elements when this string is splitted; but in the question the string you have provided is different. Please check the question again.
Answer: (Edited as more code was added to the question):
Try replacing this:
string[] arr1 = new string[11];
arr1 = messageIn.Split(' ');

With the following:
string[] arr1 = messageIn.Split(new char[]{' '});

This may well result in an array longer than 11, but that does not matter - you don't need to specify length before you populate the array here.
Comment: The OP is already using string.Split. Making this change will not prevent the error. It removes an unnecessary and redundant array allocation, but nothing else (also, the OP's usage of `.Split` / `params` is more idiomatic)
Comment: the array of length 11 is discarded; it is redundant. Sure, it isn't great to init and discard an array, but it **has no relation** on the error. From the next line, the only array that matters is the one that comes from `.Split()`
Comment: @MarcGravell I think the error is occurring because an attempt is being made to populate an array specified to be of length 11, with more items than that. By avoiding the initial allocation, this should prevent the error. Or am I missing something else?
Comment: Ah, yes. Quite right. `arr1` in the OP is actually _replaced_, not just populated. I actually tested this to make sure. Apparently I was wrong... (Maybe this is different i Java?)
Answer: I think you are confusing this with a character array.
In your case i would simply do:
arr1[0] = "feet nimantha 1 2 3 4 5 6 7 8 120827";

If that is not what you want see Kjartan.
Sry, what I wrote is wrong, the code came after I wrote this. :(
Comment: No.i wanted to add my message element by element.Message comes with feetnimantha123456789120827
Answer: If the result you need is
arrmsg = "feet/nimantha/1/2/3/4/5/6/7/8/120827"

and you have exception because your string array arr1 having unmatched length with result of string Split with whitespace
then you may declare and assign your string array to store the string Split result
//string[] arr1 = new string[11];
string[] arr1 = messageIn.Split(' ');

Then the arr1 can have different array size based on the string Split result. For example,
string messageIn ="feet nimantha 1 3 4 5 6 7 8 120827";
//arr1 is string[10] here
string[] arr1 = messageIn.Split(' ');

messageIn = "feet nimantha 1 3 4 5 6 7 8 120827 2132144";
//arr1 is string[11] here
arr1 = messageIn.Split(' ');

Therefore you don't need to worry about size of string array arr1 is not match the result of string Split.


Are software like NTRconnect and LogMeIn safe enough for businesses with sensitive data?

Question: I am thinking about creating a VPN using NTRconnect or LogMeIn. Are these softwares safe? We spent money erecting firewalls, but are those software going to undo the protections? Are there known vulnerabilities?
Comment: Is there any additional information I can provide to get this question marked answered?
Comment: I was more concerned about security. Can it be exploited by hackers to get past the firewall etc.
Comment: I updated the information regarding security. Hopefully it will be sufficient to close this question.
Answer: I have about 30 offices connected through LogMeIn Central (which is about 200 computers). When I log into their site, an email is dispatched to my phone with an 8 digit/character randomly generated value. I have to enter that value before I can access my account. I find this to be extremely secure.
Also, LogMeIn is a very reputable company and is used by companies such as SonicWall for their technical support team. I was surprised when I had a technical problem with SonicWall and their tech connected to me via LogMeIn. I expect that a lot of companies will be migrating from WebEx to LogMeIn over the next couple years.
I use the paid version of LogMeIn (LogMeIn123 and LogMeIn Central). However, I still use the FREE version of the daemon on the client computers. Annual fee for LogMeIn Central is about $250, while LogMeIn123 has a monthly fee of about $110.
Update: Their website states, "All communications by LogMeIn products use industry-standard algorithms and protocols for encryption and authentication. Nobody will be able to see or access the data transmitted between your computers - not even us." More information about their security and encryption is available at https://secure.logmein.com/products/central/security.aspx
Comment: But is the connection easy to "hack" into? I mean what if the data is really sensitive and contains private customer information?
Comment: Like anything, there is a key for every lock.... someone out there may be brilliant enough to hack it. I tried googling for "LogMeIn" hacks, but did not find anything out there that is publicly known. If you are extremely paranoid, you could activate Remote Desktop on your customers computers and run them through a Remote Desktop Gateway Server... I'd be more than happy to provide you with more information on that if you are interested.


How to fix broken plug

Question: My neighbors landscaper has totally mutilated the cleanout plug between our yards that connect to each other. Can I use a brass plug in the ABS pipe, or should I use ABS to ABS. (4" pipe) whatever I use will be a flush plug.
Answer: I think a brass plug is an excellent choice. It is all the same threads.
Answer: Not being sure how the landscaper damaged the plug I would go with plastic again. My reason being, that what ever he did could happen again. If it was hit by a lawnmower, tractor or some other powered device the next time hit could result in damage to the pipe. You could be repairing the pipe along with any damage from the shrapnel of the damaged brass plug.

How to fix broken plug


He insisted he saw the accident vs he insisted he had seen the accident

Question: Is there any difference? As a non-native speaker, I sometimes have difficulty understanding the tenses. It seems to me that both are right.
Comment: Welcome to EL&U. If you search "[past perfect past simple](http://english.stackexchange.com/search?q=past+perfect+past+simple)" in the search box, you can see a lot of excellent answers. Please try to search it before posting any question and visit our [help center](http://english.stackexchange.com/help). You need to capitalize ***i***.
Comment: @Rathony ~ this is more about indirect reported speech than simple versus perfect. I corrected the 'i' for him.
Answer: Probably both are possible.
The sentences are indirect quotations, which are easiest to understand if you relate them to what was originally spoken.  If what he said was "I see the accident" (he sees it as it is happening), the indirect quote corresponding is "He insisted he saw the accident", where the change from "see" to "saw", called time-shifting, is to make the verb agree in tense with the tense of "insisted".
If what he said was "I saw the accident", then there is some choice about the report of this in indirect speech.  In a relatively conservative dialect like mine, the report would be "He insisted he had seen the accident", where the perfect "have" of "had seen" corresponds to the past tense of "saw" in his earlier speech, and the past tense of the "had" corresponds to the past tense of "insisted".  This is sometimes called a past within a past, since the past time at which he did the seeing was previous to the past time at which the insisting took place.
In a less conservative dialect, or less formally, you get a simple past tense in the indirect quotation.
There are other cases where a logical past tense is realized as perfect "have" when the past is in a grammatical position that does not permit an ordinary morphological past tense.  For instance, "He may have left" means that it is possible he left.  But you can't say *"He may left" with a simple past tense, because that is not allowed after a modal auxiliary, like "may".
Answer: Both of these sentences are made up of two clauses. Formally there should be a "that" separating the clauses, although it is sometimes left out when people speak. Thus, they should look like this:

He insisted that he saw the accident.
  He insisted that he had seen the accident.

Both of these sentences are correct. Although, they don't say exacty the same thing.
The verb "saw" is simple past tense.
The verb "had seen" is in the past perfect tense.
Comment: Could you be more specific, and explain in what way they don't say exactly the same thing?
Answer: It depends what 'he' said in the first place.
If he said "Hey! I see the accident! I really do!" this would be reported as "He insisted that he saw the accident" on the principle of back-shifting the tense.
If he said "Really...I saw the accident yesterday" this would be reported as "He insisted he had seen the accident".
Back-shifting the tenses, in very simple terms, means that a present simple statement is reported in past simple (because the original statement is now in the past), and a past simple statement, and pretty much everything else, gets reported in past perfect because that is basically 'the past of the past'.
Find more info on indirect reported speech here, and detail on how tenses change here.


Managing alerts across multiple sites-sub-sites

Question: I'm wondering if MS has figured out a way for a user to manage ALL of their Alerts across all sites/sub-sites without having to go into each site to do so.
I don't understand why in 'almost' 2019 this can't be done easily yet.
If there's something within the system that I just can't find, please let me know.  Thank you so much.
Answer: I am afraid there is no way to manage all alerts across all sites by OOB method in SharePoint online.
Then we can manage the alerts by PowerShell in SharePoint online.
More references:
Creating SharePoint alerts via CSOM.
SharePoint Online: Delete Alerts using PowerShell.
How to Disable/Enable User Alerts in SharePoint Office 365 using CSOM PowerShell.
SharePoint Online: Using PowerShell to delete alerts in site/sub sites using CSOM.


Arbitrary union definition in set theory

Question: I am reading Enderton's "Elements of Set Theory". He defines the union operation as
$$\cup A = \{ x \;|\; x \text{ belongs to some member of } A\} = \{x \;|\; (\exists b \in A) x \in b\}$$
Maybe I am missing a subtle point from earlier on in the text, but what if the set in question is not a "set of sets"? For example, if $A = \{1,2,3\}$, then is $\cup A = \emptyset$?
Comment: In systems of set theory such as ZF, every set is "a set of sets".
Comment: See Enderton's chapter on "Natural Numbers" to see the usual way of representing positive integers as sets.
Comment: No, it's really $\{1,2,3\}$.
Comment: Even without the "everything-is-a-set" context, we can still make sense of this by carefully writing down the definition: see [this earlier question](https://math.stackexchange.com/questions/3150959/about-the-unionset-axiom/3150997#3150997).
Comment: So then is my $A$ really $\{\{1\},\{2\},\{3\}\}$?
Comment: Then what are sets inside my set $A$?
Answer: When you're working in a system built out of the set theory, everything is a set. I assume the book will cover this later on, but one way of "building natural numbers" out of sets is called Von Neumann ordinals and the construction is as follows:
Let $0 \equiv \emptyset$. Let the number $n \equiv n - 1 \cup \{ n - 1\}$. That is, under this system:
\begin{align*}
&1 \equiv 0 \cup \{ 0 \} = \emptyset \cup \{\emptyset\} = \{\emptyset\} \\
&2 \equiv 1 \cup \{1 \} = \{\emptyset\} \cup \{\{\emptyset\}\} = \{\emptyset, \{\emptyset\}\} \\
&3 \equiv 2 \cup \{2\} =  \dots = \{\emptyset, \{\emptyset\}, \{\emptyset, \{\emptyset\}\}\}
\end{align*}
The point of the representation is that 0 is a set with zero elements, 1 is a set with 1 element, 2 is a set with 2 elements and so on. So we can define the "size of a set" as "the natural number it is in bijection with".
This goes down a rabbit hole, and we can then ask "well, now that I have the natural numbers, how do I define addition? Multiplication? What about the integers? rationals? reals?"
We can construct all of these things, and a set theory book usually describes these encodings in one of the later chapters.
But the point is that at this level, all the "stuff of math" is sets, and you can always write expressions such as $1 \ \cup 2 \cup 3 = \{\emptyset\} \cup
\{ \emptyset, \{\emptyset\}\} \cup
 \{ \emptyset, \{\emptyset\},\{ \emptyset, \{\emptyset\}\} \} = \{ \emptyset, \{\emptyset\},\{ \emptyset, \{\emptyset\}\}\} = 3 $!
Comment: +1.... In the  most-favored system of set theory, not only is everything  (that can be said to exist) a set, but in the formal language there is no word or definition of  "set". Things ( with various properties that $can$ be stated in the language ) are merely asserted to exist or not exist.
Comment: Indeed, thanks! much appreciated
Answer: As Lord Shark the Unknown indicates, in nearly all systems of set theory, every object under the sun is a set.  In particular, the elements of any set are, in turn, sets themselves.  For the specific example you give, i.e.
$$ \cup \{ 1,2,3 \}, $$
we need to be able to describe the natural numbers as sets.  On page 67 of Enderton's text, the construction is outlined.  He defines
\begin{align}
0 &= \varnothing \\
1 &= \{0\} = \{ \varnothing \} \\
2 &= \{0,1\} = \{ \varnothing, \{\varnothing\} \} \\
3 &= \{0,1,2\} = \{ \varnothing, \{\varnothing\}, \{ \varnothing, \{\varnothing\} \}\},
\end{align}
and so on.  The "and so on" is explained in somewhat more detail in chapter 4 of the text (starting on page 66).  Note that we could write $2 = \{\varnothing, \{\varnothing\} \}$ over and over again, but it is likely easier to see what is going on if we work one level of abstraction higher.  That is, $2 = \{0,1\}$.  Once we accept this abstraction, we have
$$
\cup\{1,2,3\}
= 1 \cup 2 \cup 3
= \{0\} \cup \{0,1\} \cup \{0,1,2\}
= \{0,1,2\}
= 3.
$$
Comment: I see. Maybe I am getting ahead of myself since I am only in chapter 2. But I guess the construction you provided is pretty natural since at this point the only set that we can use as a building block is $\emptyset$ (Empty Set Axiom)? Then we can use "pairing" to form the singleton $\{\emptyset\}$, which is defined to be $\{\emptyset, \emptyset\}$?