Is it possible to view another shell's history?

Question: I am running something in a bash window that I don't want to interrupt or even suspend momentarily. Is it possible to view command history of that particular window's session? I have multiple windows open, so viewing .bash_history won't help much.
Answer: Here is how with gdb (you'll need to run it with administrative permissions), via https://stackoverflow.com/questions/7272558/can-we-define-a-new-data-type-in-a-gdb-session :
preparation:
echo 'typedef void * histdata_t;
typedef struct _hist_entry {
  char *line;
  char *timestamp;
  histdata_t data;
} HIST_ENTRY;
typedef struct _hist_state {
  HIST_ENTRY **entries;
  int offset;
  int length;
  int size;
  int flags;
} HISTORY_STATE;
HIST_ENTRY _sampleentry;
HISTORY_STATE _samplestate;
' | tee sample.c
# get sample.o
gcc -g -c sample.c

# get bash pid, maybe via `pgrep bash`, or `pidof bash`, etc
# say in this example, it is 16573

Run test command:
$ sudo gdb -p 16573 -ex "set confirm off" -ex "add-symbol-file sample.o 0" -ex 'printf "ptype HIST_ENTRY\n"' -ex "ptype HIST_ENTRY" -ex 'printf "p *(HISTORY_STATE*)history_get_history_state()\n"' -ex 'p *(HISTORY_STATE*)history_get_history_state()' -ex 'set $myoffs = (*(HISTORY_STATE*)history_get_history_state())->offset' -ex 'printf "myoffs %d\n", $myoffs' -ex 'printf "p *(HIST_ENTRY *)history_get($myoffs)\n"' -ex 'p *(HIST_ENTRY *)history_get($myoffs)'
....
0x00007fb053abb0e9 in __pselect (nfds=1, readfds=0x7ffe81a009b0, writefds=0x0, exceptfds=0x0,
    timeout=<optimized out>, sigmask=0x7ffe81a00930) at ../sysdeps/unix/sysv/linux/pselect.c:69
69  ../sysdeps/unix/sysv/linux/pselect.c: No such file or directory.
add symbol table from file "sample.o" at
    .text_addr = 0x0
Reading symbols from sample.o...done.
ptype HIST_ENTRY
type = struct _hist_entry {
    char *line;
    char *timestamp;
    histdata_t data;
}
p *(HISTORY_STATE*)history_get_history_state()
$1 = {entries = 0x55ed117f4ab0, offset = 155, length = 155, size = 502, flags = 1}
myoffs 155
p *(HIST_ENTRY *)history_get($myoffs)
$2 = {line = 0x55ed119684d0 "kill -STOP $$", timestamp = 0x55ed119709a0 "#1545016332", data = 0x0}

prepare gdb "capture last history entry" command:
echo '
set verbose off
set complaints 0
set trace-commands off
add-symbol-file sample.o 0
set $myoffs = ((HISTORY_STATE*)history_get_history_state())->offset
set $line = ((HIST_ENTRY *)history_get($myoffs))->line
printf "%s\n", $line
' | tee gdbscript

run gdb "capture last history entry" command:
sudo gdb -p 16573 -batch -x gdbscript 2>/dev/null | tail -1
kill -STOP $$

Comment: I had to merge the last two lines of `gdbscript` down to `printf "%s\n", ((HIST_ENTRY *)history_get($myoffs))->line` and change `tail -1` to `tail -2 | head -1`
Comment: I'm not sure why but `history_get` is always returning `NULL` regardless of what argument is passed to it and I have to use `set $line = ((HISTORY_STATE*)history_get_history_state())->entries[$myoffs-1]->line` instead.
Answer: No, bash doesn't support that. The history is kept in memory and not available for other processes until it is saved to .bash_history in the same session using history -a or history -w. But the moment it's written to the file system, the information from which session the command originated is lost.
The closest you can get is using some lines in .bashrc to let bash append every command directly after execution: https://unix.stackexchange.com/a/1292/147970
Then you can see the commands from all shells in near real-time in .bash_history.
To access the history for a specific session you need to interrupt the foreground process in that session using e.g. Ctrl+Z.
Answer: You can press Ctrl-Z to put task in background. After that you can work in your shell and see command history. To look tasks in background you can use job command. To back to your task run fg command.


Why is Boneh-Franklin IBE scheme secure? What should an adversary do to break it?

Question: Even after reading their paper I am still not able to understand why the scheme is secure and what an adversary should do to break it. This question might look stupid to most of you but I don't have mathematics background to delve this deep into cryptography.
Answer: The proposed scheme is IND-ID-CPA secure and is semantically secure in a random-oracle model.
From the paper:

The proof of security for our IBE system makes
use of a weaker notion of security known as semantic security (also known as semantic security against
a chosen plaintext attack). Semantic security is similar to chosen ciphertext security (IND-IDCCA) except that the adversary is more limited;

And detailing IND-ID-CPA:

We say that an identity-based encryption scheme $E$ is semantically
secure (IND-ID-CPA) if no polynomially bounded adversary $A$ has a non-negligible advantage against
the Challenger in the following IND-ID-CPA game:

The paper then goes into detail (which I suppose you've read).  But basically the game involves the adversary not being able to better than guess the value of an encrypted bit for a chosen public key.  The adversary has access as to as many other public/private keys as it wants.
The scheme is not IND-CCA secure.  As per this answer here one way to attack the scheme would be to gain access to a "decryption oracle".


What are well-defined functions?

Question: What exactly makes a function well-defined? I have seen some proofs but they are too hand-wavy and I couldn't understand exactly what a well-defined function is.
Comment: Useful: [Why aren't all functions well-defined?](http://gowers.wordpress.com/2009/06/08/why-arent-all-functions-well-defined/) by Tim Gowers.
Comment: Technically, "well-defined function" is a redundant phrase. If the rule you set up isn't well-defined, it's saying that your rule doesn't make a function at all. So there isn't really such a thing as a "not well defined function" unless you are using a very relaxed definition of what a function is.
Comment: Usually we say that a function defined on a set of equivalence classes is well-defined if the value of the function is independent of the choice of an element in the class.
Comment: I am not sure if I understand. If the value is independent of the element, by which the image is independent of the pre-image, then wouldn't it counter the definition of a function? Or do you mean value as in the codomain?
Comment: @rschwieb ah yes I think that is what tripped me up in the first place.
Answer: Let's consider the rational numbers, which I expect you are familiar with.   A rational number is usually represented as a pair of integers, written in the form $$\frac ab$$ where $b$ is not zero.  But this is only a representation, and it's not unique, because many such pairs represent the same rational number.  For example, $\frac12, \frac24, $ and $\frac{10}{20}$ all represent the same rational number.  The general rule is that $\frac ab$ and $\frac cd$ represent the same rational number if $ad = bc$; you can check this condition with the examples I just gave and see that it does hold for those examples.
Now let's say we would like to define a function on rational numbers. How can we do that?  All we have to work with is the representation $\frac ab$, so we have to define $f$ in terms of $a$ and $b$.
Consider the definition that says $f\left(\frac ab\right) = a+b$.  There is a serious problem with this definition: it is not a well-defined function of rational numbers, because it says at once that $f\left(\frac 12\right) = 3, $ that $f\left(\frac 24\right)=6$, and that $f\left(\frac {10}{20}\right) = 30$ But $\frac12, \frac24, $ and $\frac{10}{20}$ are the same rational number, and so we seem to have said that $f$ has several different values at this one rational number. This is not a well-defined function because it depends not on the argument itself, but on how we happened to choose to write it.
In contrast, if we define $g\left(\frac ab\right) $ to be $${a+\gcd(a,b)\over b+\gcd(a,b)},$$ we find that $g\left(\frac 12\right) = \frac23, g\left(\frac 24\right) = \frac46=\frac23,$ and $g\left(\frac{10}{20}\right)=\frac{20}{30}=\frac23$, and indeed, one can show that for any $a$ and $b$ with $\frac ab=\frac 12$, we always have $g\left(\frac ab\right) = \frac23$.  And we can also show that $g\left(\frac ab\right)$ depends only on the rational value of $\frac ab$, not not the particular $a$ and $b$ that are chosen to represent it.  This is a well-defined function of rational numbers.
The issue here is that we don't have a direct definition of rational numbers; instead, we define them as classes of pairs of integers $a$ and $b$.  If we want to define a function of a rational number, in terms of the pair of integers that represents it, our definition must give the same value for any equivalent pair of integers $a$ and $b$—for any pair in the same class of pairs. Otherwise it may be a perfectly good function of pairs of integers, but it is not a function of rational numbers.
The same issue arises whenever we define anything in terms of equivalence classes.  Your question is tagged abstract-algebra, so I'll give the most important example from abstract algebra.  If $\langle G, \ast \rangle$ is a group and $H$ a subgroup of $G$, we can construct the classes $gH$ of left cosets of $H$.  Then we would like to define an operation $h(aH, bH)$ on these cosets; typically that $h(aH, bH) = (a\ast b)H$.
But notice that this depends on choosing representatives $a$ and $b$ from the cosets $aH$ and $bH$.  For we might have $aH = a'H$ and $bH=b'H$ even when $a\ne a'$ and $b\ne b'$.  In such a case, we had better have $(a\ast b)H = (a'\ast b')H$, or else our definition of $h(aH, bH)$ won't make sense, in the same way that $f$ doesn't make sense: it gives us more than one possible value for a particular choice of arguments.
It transpires that such definitions make sense exactly when $H$ is a normal subgroup of $G$, and this is the reason for the importance of normal subgroups.
Comment: This is a fantastic answer. Thank you so much :)
Comment: What happens "exactly when $H$ is normal"? Normality isn't required to be able to define functions of cosets! Normality is only required when you want to define the group operation on cosets, and you weren't talking about that particular function in your answer.
Comment: To be somewhat nitpicky, $g(-1/-2)=?$
Comment: I'm glad I could help.
Comment: Thanks! I was just coming back to correct that.
Comment: Great to read an answer on math.SE that I can understand :)
Comment: @ronno I found a better example that doesn't have this problem. Thanks for pointing it out.
Comment: @MJD what if we consider element of $\mathbb Q$ as just symbol. i mean in set  $\mathbb Q$ consider   $\frac{1}{3}$ and $\frac{2}{6}$ are both as a element. then $\frac{a}{b} \rightarrow a$ should be function right?
Comment: You can do that, but but what you get is not like the rational numbers, because you have just said $\frac 13\ne\frac 26$.
Answer: A function $f:A\to B$ is, by (the ordinary) definition, a relation $f\subseteq A\times B$ with two properties:

For all $a\in A$, there exists a $b\in B$ such that $f(a)=b$
For all $a,a'\in A$, if $a=a'$, then $f(a)=f(a')$.

The second axiom is what makes a function "well-defined." There is no proof needed to show that "functions are well-defined," (they are well-defined by definition!) BUT quite often we have a rule we invented making a relation, and we need to prove "this relation has properties 1 and 2, so it is a well-defined function."
When defining a function on the set of equivalence classes $E$ from an equivalence relation on a set $X$, it is natural to define functions only in terms of elements of $X$ and then ask if they are still functions on $E$. This isn't automatic, however, and my favorite example showing why it's not automatic has already been given by MJD above.
Quite simply, one can't just assume every relation we come up with in terms of $X$ makes a function on equivalence classes of an equivalence on $X$.
Comment: @Artemisia Several times I've had a student try to reason "suppose $a=a'$. Then $f(a)=f(a')$, right? it's the same input! How could it be different?" For students like this, who have a very strong sense of what a function is and essentially have forgotten that they haven't checked $f$ yet, they sometimes don't realize this isn't always true, depending on the rule you set up :) the "fraction" example MJD gave usually cures the problem.
Comment: Oh ok I understand now. The proofs I saw made me feel like it is too trivial but now I understand :) Thank you so much :)
Comment: Haha yeah I understood that now :) I had that sort of idea about functions which is what tripped me up in the first place :) Thank you :)
Answer: Given an equivalence relation on a set $A$ and function $f:A \rightarrow B$, saying that $f$ is well-defined, means that $f^{\sim} : A/ \sim \rightarrow B$,  $f^{\sim}([x])=f(x)$, define a function.This happen if,  $ x\sim y$ imply $f(x)=f(y)$ ($f$ pass to the quotient).
Condsider this situation:
Let $f:A \rightarrow B$, where $A=\{1,2,3,4\}$ and $B=\{1,2\}$,with $f(1)=2$,$f(2)=1$,$f(3)=1$, $f(4)=1$.Now, consider the partition of $A$, given by: $A_{1}=\{1,2\}$, $A_{2}=\{3,4\}$. Define an equivalence relation as: $x\sim y$ iff they belong to the same $A_{i}$, with $i=1,2$. Consider the quotient set $A/ \sim$; now, in this situation, we can say that $f$ is not well-defined (On the quotient set), because $f(1)\neq f(2)$, so putting $f^{\sim}([x])=f(x)$ does not define a function. Otherwise, if i consider the partition $A_{1}=\{1\}$, $A_{2}=\{2,3,4\}$,them putting $f^{\sim}([x])=f(x)$ define a function.
I hope it is clear!
Comment: Yes it is. Finally haha. Thank you so much :)
Answer: In mathematics many time we define functions by giving the properties that these functions should satisfy (you can think of it as a sort of axiomatic definition).
For such kind of definition to be good does mean that these definition does actually define a function: defining an object as the function such that $P(f)$ holds doesn't actually define $f$ unless we prove that such $f$ exists and it's unique.
Examples of definition of this sort are the following:

the determinant is function $\det \colon \mathcal M_n(\mathbb K) \to \mathbb K$ which is multilinear and alternating in the columns and with $\det I_n = 1$;
for every pair $a,b \in \mathbb Z$ the sum of the residue classes $[a]$ and $[b]$ in $\mathbb Z/n \mathbb Z$ is given by $[a]+[b]=[a+b]$;
...

In all these example we have defined these functions by saying which properties they should satisfy, but if there wasn't any function satisfying such properties these definition wouldn't be good, because they would be defining nothing.
Hope this helps clarifying.
Comment: Thank you so much :) I wish I could accept all answers haha since each one has its own merits.

What are well-defined functions?


How to open Mac documents .page, on LibreOffice

Question: I need to open text documents. "page" and
keynote presentations also keep in osx, how do I open or install
this extension in libreoffice?
Comment: you can try [CloudConvert](https://cloudconvert.com/pages-to-docx)
Answer: If you don't have access to an Apple operating system, use Apple's no-cost 'in-browser' version of Pages to export it in a format that you can open with LibreOffice. Unfortunately, Pages doesn't have OpenDocument (ODT) export, (as of 2015), but it does have DOCX (Microsoft Word) and PDF (Portable Document Format) exports.

With a recent version of Firefox, or Chrome, visit Apple's iCloud website: https://www.icloud.com .
If you don't have an Apple ID, register for one at no cost.
Log in with an Apple ID.
Open Pages. https://www.icloud.com/#pages
The site asks you to upgrade to a supported browser to use all the features. Unfortunately, no Linux browsers are supported (as of 2015) so ignore this message: export still works.  (It also may ask you to upgrade to iCloud Drive. I am not sure what this means, but you probably need to accept this to be able to open Pages.)
Drag your Pages document onto your browser. It shows you an editable version of your document in a kind of file manager view
Double-click the icon for your uploaded document.
In a new browser tab, it shows you a word processor interface to your document.
Select the tools menu (a spanner/wrench icon in the top right of the screen).
Choose 'Download a Copy'.
Export as PDF or as Microsoft Word (.DOCX).
With LibreOffice, navigate to your downloads folder and open the document.

I tried with a short sample Pages document and LibreOffice 4.4. I found that DOCX format gave a more faithful copy than PDF.
Reference: https://help.apple.com/icloud/#/mm6f8c20082b

Update
I just found that as a shortcut, you don't have to open the document in Pages. You can use the option menu in Pages desktop view to 'Download a Copy ...'.  Use the option(menu) key on your keyboard, or click your secondary mouse button (usually the right button on a right-handed mouse). See screenshot.
Comment: This is also exactly why I hate apple. (+1)
Comment: This should be the accepted answer!
Comment: This is is the a simple, clean and supported Solution to this problem. Thanks @dcorking +1
Comment: @Snowcrash yes. Although I regret using the word "hate." I wish to replace that with "do not prefer."
Comment: @Taylor you mean because they use a proprietary format like Microsoft but allow you to extract some useful information from the file by converting to a zip (unlike Microsoft)?
Comment: Note: Icloud no longer appears to be working correctly on Firefox on Windows 11. Fails to connect to iCloud server.
Comment: The answers here are intended for Ubuntu Linux. That said, as of May 2023, www.icloud.com works for me on Windows 11 in Firefox 113.
Comment: At least Micro$oft, when they duped ISO, made their format somewhat interoperable. Apple should be nailed for being anticompetitive.
Answer: As of 2015, LibreOffice (version 5) is capable of opening this format.
https://www.phoronix.com/scan.php?page=news_item&px=LibreOffice-Apple-Pages-Numbers
Comment: There is basic support, but sadly buggy (as of version 5.4.2), often messing up the layout. But still worth trying first.
Answer: If you are stuck and just need some of the content of the file, you can rename it to .zip (e.g. example.pages to example.zip) and unzip it.
The unzipped files will include some PDFs and PNGs which is some of the text and image content of the document.
This worked for what I needed just now, but of course it is not as good as getting the file  converted properly on a Mac.
Comment: +1 this works (though sometimes there is no PDF in the archive) and it can be done entirely offline with free software.
Answer: There are many free online conversion tools for this.
cloudconvert.com can convert to doc, docx or PDF. Just upload your documents, and it converts in the cloud.
Comment: Took me five seconds, thanks.
Answer: I got this working on Linux Mint (Ubuntu) by upgrading the libetonyek library. From my answer in Ask Libreoffice:

I've read high and low about this issue and finally got it working.
I'm running

Linux Mint 20.1 (based on Ubuntu 20.04)
LibreOffice 22.214.171.124
libetonyek 0.1.9

This issue seems to have been fixed in libetonyek 0.1.10, but that
wasn't included in the LibreOffice I installed by default.
I found the .deb package for the latest version here:
https://launchpad.net/ubuntu/impish/amd64/libetonyek-0.1-1/0.1.10-1
After installing this I can now see the content of .pages files
Comment: Installing the deb file worked like a charm, and you don't have to upload your document to some 3rd party website, this really should be the accepted answer
Answer: As an alternative:
In Pages, you can open Preferences, and under the General tab, select Save New Documents as Packages. This saves the file as a package (folder) which includes a PDF file, and you can open the folder, navigate to the PDF and open it. You won't be able to edit.
Answer: If, like on my system, your .pages file appears as a folder, go inside that folder, select all files and sub-folders and compress everything into a .zip file. Then rename that file to .pages and you should be able to open it with the method described above.


Slang words for person who is bad at language

Question: I'm searching for slang or informal words that describe person who is bad at language, especially English. Is there anything like this in British English or American? I think about people who had moved to - for example - UK, have lived there for years, but their language skills are still low and full of grammar mistakes.
I would be really thankful if you could answer.
Comment: There are lots of (IMHO, quite strong and can be considered offensive) words, not for the person, but for his or her language itself. The most obvious one is Engrish. Then there is Chinglish, Hinglish, Spanglish, and such. Oh, well, I think I may speak Tinglish at times.
Comment: A slang word for someone who is at bad language would be ironic.
Answer: There is the rather sarcastic…

He speaks accent with a trace of English

.. a wordplay joke on

He speaks English with a trace of an accent

which would be complimentary.
Answer: It used to be common for someone to refer to a person who speaks a little bit of English as someone who used or spoke "pidgin or broken English". I have also heard referred to newcomers who are obviously not from the country they are in as F.O.B, "fresh off the boat"
Comment: I'm basically just saying that you need to properly scope where this is valid, since otherwise it's confusing. Often, slang is in use not merely in a particular narrow geography, but across a wide slice of the population in multiple areas: that is, it's often differentiated by social class or the like.
Comment: Pidgin English is a bit different; it's the language mixture that develops when a group of people uses little bits of English along with bits of their native language in a highly simplified form, usually for trade. (And pidgins and creoles are not limited to English, either.)
Comment: That is the correct definition from a dictionary but real world use by Americans is a little different.
Comment: As an American, I'm not convinced of that. Real world use by *some* Americans, sure, I can accept that.
Comment: So, your comment is not that what I have stated is not valid but is only valid for a portion of the population. Slang is usually used by a portion of the population, and if understood, may mean different things to different people.
Answer: Sadly, in English we lack anything as colourful as "parler français comme une vache espagnole" (to speak French like a Spanish cow) although a similar phrase "He speaks English like a native" can be used either with obvious sarcasm or with a delayed or implied "...of Outer Mongolia" or other faraway place.
The other one you may hear is that someone is 'mangling' the language - from the OED:

To make (words) almost unrecognizable by mispronunciation; to spoil, corrupt, misrepresent, or do violence to (a text or extract, or the meaning or essence of something); to distort (music) in a similar fashion.


Why do I doubt my instincts and instead take a wrong decision for that task or situation though the answer or solution or strategy is within my reach?

Question: I choose my instincts when doing something, but I doubt it and then do something else or something opposite. When reflecting back on it, I realize that my instincts were true. In short, why do I doubt my instincts and instead take a wrong decision for that task or situation? The answer or solution or strategy is within my reach yet I choose to deny it and later regret it. This happens nearly 8 to 9 out of 10 times. Why is it so?
Comment: You describe a situation where instincts are contrary to reason. And that is just how it should be in many cases. There's no manual for life, so we learn by trial and error. Even in the absence of doubt (when reason and instincts agree), you will fail, and suffer. That's just how we learn. One day, we become mature and tend to take the right decisions. But there's a long and tough road to get there.
Comment: @RodolfoAP -- I have to disagree with the premise that we automatically reach a point of assonance in our actions. Many older people still appear to have great unresolved dissonance and its related struggles. No doubt, a general trend of coming to terms with ourselves seems present; but finding inner peace and cognitive consistency looks to take concerted effort, which many neglect to prioritise.
Comment: This type of question belongs on a psychology forum, not philosophy.
Answer: This is a great concern for Taoism, and for Zen Buddhism. These can be described as Philosophers or philosophical traditions that reject symbolic reasoning There is great emphasis on acting with simplicity and naturalism in these schools.
In sports science it has emerged that peak performance involves immersion in the activity, without intervention by the verbal mind, and this has been called 'the flow state'. A lot of research has focused on how meditative absorption is also a flow state. Some tasks suit verbal conceptual reasoning, but in many tasks our body 'knows better', and intuition often means muscle-memory, or subconscious processing. Meditation, and other kinds of willed absorption, can help us gain skills at listening to our whole mind, instead of only the verbal conceptual parts.
The Global-Workspace interpretation of conscious awareness, is that we have many parts of the mind operating out of awareness, and only sending things into conscious awareness when they contradict expectations, or in response to seeking things. 30-50% of the brain is involved in visual processing (depending how you define it), and there is huge sophistication to what is happening there. More on that here: What is the best theory about how a person models reality?
It should be noted there is a potential dark side to trusting uncritically to brain processes from out of awareness: cognitive bias, and the human tendency towards post-hoc reasoning, where we jump to unreasoned choices and conclusions then use reasoning to justify those, so that they feel like reasoned choices. Hume dealt with this in his Is-Ought problem. It is interesting to look at how we are nearly the only species to almost always have sex in private, and that while we can explain this as serving our ability to cooperate, we struggle to account for it in terms of reasoning: How do ethicists tackle the question "Is it immoral to have sex in public places?" Is it possible to use rational and empirical ideas to answer? Jonathan Haidt has very interesting work in this area, eg The emotional dog and its rational tail: a social intuitionist approach to moral judgment
As well as subconscious and non-conscious processing feeding intuitions, we can also look at instinct. I suspect very little of what you are describing is actually from this area though, because it means reactions shaped by selection processes over multiple generations. Discussed here: What are the current theories about instinct in philosophy of the mind?
I make the case we can understand wisdom as acting from the integrated centre of our concerns, here: Wisdom and John Vervaeke's awakening from the meaning crises? A mix of tools, like practice, reflection on habits, meditation, and other investigations of our own mind, can help us arrive at deeper self-knowledge. I suggest that your issues are above all over-reliance on your verbal-conceptual mind. Seek out activities that use that less, art, music, craft, sports (I find climbing is great for this, because the body feels total attention us necessary to not fall & die, whatever the reasoning part says - and at the end of a climb you realise you've had a break from the minds churning words). And consider meditation, there are many online guides, things on Youtube, apps, or you can visit groups. There are many different styles, so I recommend trying more than one before going deeper with the style that speaks to you.


fresh installed ubuntu 17.10 on VMware and there is no swap partition

Question: I have recently installed Ubuntu 17.10 Desktop on VMWare workstation with all defaults (including updates and third party software), after installation i checked and there is no swap space/partition, it is required to install Oracle Database 11g. there is only 1 partition of all 60GB, how i can create it and reduce the size of existing / partition? please help. i used sudo lsblk -o NAME,LABEL to check. EDIT: sorry i found it with command sudo swapon --show but it has 2GB only, how i can increase the size?
Comment: This is the new default. The swap is now a file.
Answer: i have found link below to create a file to increase swap space as per my need.
Link to solution
regards to all, love to all.


POST versus Ajax call

Question: Now that most modern browsers support AJAX and client-side requests without performing a POST, what is the role of POST (form post)?
Are there situations or general rules when a POST will always be preferred to a XmlHttpRequest?
All that POST is doing is placing variable key value pairs inside the server head. The advantages of POST I can think of are large amounts of data and mobile browsers. Are there many others I'm missing?
N.B. I know you can perform POSTs with AJAX calls, I'm talking primarily about with a <form> tag
Answer: This question is a little tricky because it conflates two concepts.  The first is POSTing and the second is Ajax.  POSTing, as compared to GETting, is a different HTTP method with different implementation and semantics.  Ajax, or XmlHttpRequest, has its counterpart in normal requesting/navigation.  You can use POST or GET for both XmlHttpRequest and normal navigation and form submission (well, POST is always a "form submission").  The difference between XmlHttpRequest and normal requests is that a normal request replaces the page with a new page.
You could write just about any website using only Ajax to get data and change the DOM; that's mainly how Gmail works.  There are no "form submissions" in the traditional sense.  But there are still GETs and POSTs because the server and browsers interpret the results differently.  GET is supposed to be idempotent; POST is meant for operations that change the state on the server.  For example, an ecom transaction should be a POST.  This doesn't change when using Ajax because you want proxy servers to also understand that this is a POST and that they shouldn't try to cache the response.
There are also advantages and disadvantages to using GET vs POST.  You can't bookmark the results of a POST because the parameters are hidden.  You can't GET something with parameter values of unlimited length because IE only supports about 2000 chars.
Also there are disadvantages to using Ajax vs normal submissions; you can't bookmark the resulting page (because the page hasn't changed); the back button won't work as expected. But with Ajax you could minimize the data transfered and also provide convenient updates to a page (such as monitoring the status of a long process) without annoying flickering or refreshing.
In summary the two request types, Ajax and traditional form submission, can both be used with GETs and POSTs, and there are pros and cons for each.  Neither type can do everything the other can and so you can expect to see a mix for the foreseeable future.
Answer: Some actions can't be carried out using AJAX requests due to security restrictions. For example, uploading files can't be done with AJAX.
Comment: jQuery will automatically internally create an iframe, and a form in the iframe, and POST that form, if it detects an file upload within the Ajax request.
Answer: If you need to refresh the entire page, a post would probably be easier.
Answer: The key differentiator is that the POST of a form sends data and can navigate to a new URL in a single round trip to the server.  Ajax can send data but can't navigate to new page.
Comment: Couldn't you use window.location.href=xx after the call was successful?
Comment: @Chris, that trigers a GET, which would be a second round-trip to the server.
Comment: @James Usually, a good practice is that any non-ajax POST should end with a redirect. This is done to avoid re-submitting the form when reloading the page. If following this good practice, the redirect is second round-trip to the server anyway.
Answer: Er .. posting forms?
Post is really good for big forms as the values are hidden in the html headers and not tacked onto the url string?
Comment: You can use SOAP for Ajax though
Answer: If theory, an HTTP GET should be an idempotent request for information: Two identical GETs should return the exact same information.
HTTP POSTs, on the other hand, are intended to hold state and perform actions: Two identical POSTs maybe perform different action depending on who doing it, what was done before, and when it is being done.

POST versus Ajax call


How can I know what software is provided by Ubuntu Mate's Boutique without downloading Ubuntu Mate itself?

Question: I want to know what software is offered in Ubuntu Mate's Boutique without downloading Ubuntu Mate 18.04.
How can I do so?
The reason is to settle a doubt about the availability of the gcolor2 package.
As the image below shows, it is absent from the regular Bionic repositories:

Image sourced from here.
Furthermore Debian removed gcolor2 according to
RM: gcolor2 -- ROM; RoM, RoQA, dead-upstream, unmaintained, better alternatives available dated Fri, 21 Jul 2017 05:12:02 UTC well before Bionic was released (26 April 2018).
Could it perhaps somehow be offered via Ubuntu Mate's Software Boutique? The Software Boutique is described here as

An easy-to-use software distribution program for Ubuntu MATE. The team
  curates a selection of tried & tested applications that integrate well
  with the Ubuntu MATE desktop.
Answer: One can get an idea of the software offered by Ubuntu Mate's Software Boutique by downloading the contents of this link as sb.html and then running
<code>grep -n name sb.html
</code>
The list has 5782 entries currently. gcolor2 isn't one of them.

However, in gcolor2 package missing in Ubuntu 18.04?, there's an answer describing how gcolor2 can be installed in any 18.04 flavor by using the package from the xenial repository.
Comment: Just as side note - you can install Software Boutique [as a Snap](https://snapcraft.io/software-boutique) on any Ubuntu with `sudo snap install software-boutique --classic` to get its user-friendly interface.


Area51 questions

Question: There were a lot of good questions proposed on the Area51 site. I thought ones with a score of 10 or more automatically appeared in the beta. Have I misunderstood? I was looking for several of those 'good questions' but I don't see them in the beta.
Comment: Thank you for reminding me. I'm going to go look at mine now.
Answer: The top example questions from Area 51 (Definition phase) are used to help set the expectations and scope of what this site is about. But these are example questions and they do not automatically get posted to the site.
There is more to a good question than a simple title. The folks using this site should only ask about actual problems they are trying to solve. The questions are fill with details and specifics showing how we can best help them. In contrast, the "example questions" in Area 51 are little more than a vague title to help define the scope of the proposed site.
Comment: For genuine questions, folks should ask them. The system will not post them for you. For a better context about asking questions you actually care about, read my meta post about seeding the site with questions — http://meta.genealogy.stackexchange.com/questions/43/is-it-ok-to-ask-questions-to-which-you-already-know-an-answer/47#47
Comment: The proposed questions were genuine ones, and several were obviously non-trivial and worth soliciting an answer to. I still maintain that I saw some reference to the top ones being carried over, either to the beta or later. With regard to "The folks using this site should only ask about actual problems they are trying to solve", I have to disagree. This is a Q&A site but that is not a definition of a "Q". Wanting to know the answer to something isn't the same as a problem, or anything you're trying solve.
Comment: @ACProctor, I agree -- wanting to know something isn't the same as trying to solve a problem. I've just asked a question about definition of terms -- I don't need the answer, but I would like to understand it, so I use the terms in future in a way most people use them.
Comment: @ColeValleyGirl and ACProctor, no one can force you not to ask a too-trivial question (although the community/mods can close/downvote them) but please do consider waiting until we're further along in the beta. Right now it's really critical that we focus on questions about *real problems* as those are the questions that will draw in experts. Wait awhile before asking the trivial ones so that we're a bit more established and have an audience. :)
Comment: @jmort253, we weren't talking about trivial questions; we were talking about questions in which we have an interest in the answer without having an immediate application for it. Or is that your definition of trivial?
Comment: Hi @ColeValleyGirl, I don't think those are bad questions, but I do think those are tough questions to ask without them drifting into trivial areas or sounding trivial, especially if they aren't *your* questions. With questions that are about actual problems, it's easier to dive into details and make them sound more serious, and those are what a beta site needs. That's not to say you don't have a good question up your sleeve, but keep in mind  that the questions we write on this site today will influence what the masses of people do on the public beta, so we should use care. Hope this helps!

Area51 questions


Where is the easiest place to farm falling chandelier kills for "Light Entertainment"?

Question: I need 666 falling chandelier kills. I imagine normal will be the best place to farm this, but what zone has the most successive falling chandeliers (and is easiest to restart, for the "farming" part)? What items, buffs, or skills will help with racking environmental kills? Also, how is environmental damage calculated for these chandeliers?
Answer: The Cathedral is the best place - I'm not even sure I've seen that many chandeliers outside of that zone.  Additionally, the zombies in the Cathedral seem to want to linger under the chandeliers for extended periods of time.  In some cases people have helpfully died/been murdered under the chandelier drop zone, which means the zombies will just pig out and watch you pull the chain.
The easiest way to get there is to change your current quest Act 1, Quest 4: Reign of the Black King.  Travel to the Cathedral Garden waypoint, and enter Leoric's Passage.
Alternatively, you could go to  "The Legacy of Cain," quest stage "Explore Cellar" - play the quest until you get to the checkpoint at the Cathedral.  Every time I've been to this level, there's been a chandelier with 4 zombies (2 that die when you drop it, and two who have a sliver of life left) right by the entrance:

The checkpoint means that you can just leave and reenter the game to respawn this group and the chandelier.

Strategy wise, you'll probably want to work alone, and leave any followers/pets/etc out of the equation.
Damage wise I haven't done calculations, but typically on Normal I can kill or do 90+% damage to most enemies with a chandelier hit.  On Nightmare, they take more like 50%, if that.
Skill wise, I'd suggest:

A weak, preferably ranged, AoE spell to soften them up but not kill them, and so you can be standing by the chain once you aggro them
Movement abilities of some description, as you're going to be doing quite a bit of running (if you're not using the Cathedral checkpoint method)

There's not a whole lot else you could need - you want the chandelier to do most of the work, and these enemies are so weak there's really little to no threat to you, regardless of level.
Answer: Is it possible to lure more undead under the chandelier in Tristram Cathedral?
Based on this related question, I suggest maybe consider teaming up with a monk who can then gather all the mobs around, train them under a chandelier and use cyclone strike right before lights out :)
As for location, as @agent86 said go to cathedral - are they even found elsewhere? With an ally to gather the mobs, you can take advantage of those multi level layouts where you stand on a balcony and drop it down on a lower level (which normally has no one under it).


magento Shopping Cart is Empty on safari & explorer browsers when i add products on these browsers

Question: My store Shopping Cart is Empty is always empty when I use safari browser and internet explorer to view my store and add to cart from this browser.
Please, can anyone help me regarding this? What can be the cause and how to solve the issue?
Comment: I'm new in Magento but facing the similar problem (configurable products can't be added to cart). The page will hang for about a minute and it will give a time-out, varien object error message. Can I check with you what are the differences between the original and commented codes? What do I need to fill in exactly at the commented codes? Thanks.
Answer: This issue causes due to session cookie management.
For resolving this issue go to System->Configuration->Web->Session cookie management section, and set

cookie lifetime: 0
cookie path:
cookie domain:
Use Http only: yes
cookie restriction mode: no

and comment the following path file content
file path: /public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
Orignal code:-
<code> //session cookie params
      $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
           'domain'   => $cookie->getConfigDomain(),
           'secure'   => $cookie->isSecure(),
          'httponly' => $cookie->getHttponly()
        );
</code>
Commented code:-
<code>//session cookie params
      $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
          //  'domain'   => $cookie->getConfigDomain(),
          //  'secure'   => $cookie->isSecure(),
          //  'httponly' => $cookie->getHttponly()
        );
</code>
Also, clear the safari browser cache, then shopping cart empty problem get resolved.
Comment: These three values are configurable in "web > session cookie management". Fix your configuration instead of hacking the core like this.


How to prevent altitude loss or keep flight path angle constant while doing aileron maneuver?

Question: I am trying to perform an aileron roll maneuver for an un-manned aircraft in a simulation. The lateral control architecture is that I am controlling roll rate (stability) with aileron stick and side-slip angle with rudder stick, in which there is also a yaw damper in the inner loop. The longitudinal controllers are speed, and pitch rate is being controlled by the elevator stick. While doing the aileron roll maneuver, my pitch attitude gets affected significantly and the aircraft losses a lot of altitude. I need to perform this maneuver while maintaining the almost same altitude and heading? Can anyone advise me what am I missing in my lateral and longitudinal controller architectures?
Comment: Probably a better fit on Drones.SE.
Comment: Its related to the fighter aircrafts, so I posted here.
Answer: An aileron roll is done semi-ballistically, that is, the roll is done while the aircraft is pitched up slightly, the rolled at the maximum rate with elevators neutral, and being completed as the airplane has completed a very shallow ballistic arc.
Therefore, it has to start with ample speed and an initial pitch up, then the pitch is mostly unloaded as full aileron is applied. During the time the airplane is rolling, the nose will fall through in a more or less ballistic arc, returning to wings level by the time the nose has gone from 10-20 deg nose up to 10-20 deg nose down. Try this:

Lateral control should be maximum roll rate.

After adequate speed is attained, pitch control should be mild pitch up until the nose is 10+ deg above
the horizon, then pitch neutral as maximum aileron is applied. Just
let the nose fall through. At this point your are a spinning ballistic object, like an arrow. Rolling at maximum roll rate should
complete the roll before the nose has fallen though too far. If the roll is completed with the nose pointing down 45 deg, the entry speed was too low, the pitch attitude at entry was too low, or the roll rate is too slow.

Yaw control should just be counteract adverse yaw, to the extent
there is any.

An aileron roll is not the same as a slow roll, which transfers lift from the wings, to the fuselage, to the wings upside down, to the other side of the fuselage and back to the wings, and which requires complex elevator and rudder control inputs to achieve those conditions.
Comment: It doesn't have to change altitude like a spinning arrow. Constant altitude may be maintained. The pitch input should be nose up as the roll begins and then shifts all the way to pitch down while inverted and back to neutral by the completion.
Comment: You are arcing a bit. You aren't making more than minor inputs to hold the nose up while knife edge or upside down. If you are applying rudder to hold alt while sideways, and pushing forward to hold it while upside down, technically you are doing a slow roll.
Comment: why would that be considered a slow roll when the rate of roll is quite fast? The inputs for wings inverted would be maintaining -1G. That would be transitory, obviously, but it would keep the nose at a 0 fpm attitude.
Comment: Those are slow roll inputs even if you are speeding up the roll rate.  You don't go 1 G negative doing an aileron roll; you'll be slightly positive, 0 or slightly negative. And you don't feed in rudder to make the fuselage make lift while knife edge. You don't need to when the maneuver is completed in 1-3 seconds. Nose up, crank it around, and a slight ballistic arc results as you finish with the nose slightly down.
Answer:
pitch attitude is affected and the aircraft loses altitude

Losing altitude in a roll maneuver will happen unless enough lift can be generated with the fuselage angle of attack and the vertical component of the thrust vector.  Highly overpowered and lightweight models are capable of this.  Rudder input is required in the quarter roll.
Change of pitch is the result of the aircraft being rolled sideways. Natural (longitudinal) stability will cause the nose to dip as it descends.  Again, rudder input is required.  When the plane is sideways, the rudder becomes the "elevator" (of the nose).
To do all this, it might be better not to have a yaw damper function.
Also, the drone design should be as simple as possible.  Work on the inputs for smooth rolling manually first.  Then it might be possible to program them.
One approach can be to avoid excessive static stability.  Move the weight back, if you can, to nuetral.  This will help keep the nose up in the roll.  In my early days, I built a sport model that was actually a bit tail heavy.  Very difficult to control, but one time, with full aileron, it rolled 2x before I even knew what I saw.
Comment: You are describing a slow or 4 point roll, not an aileron roll.
Comment: Well, ailerons could be made more up than down to minimize adverse yaw, and roll rate will depend on scale to some degree.  Rudder is still helpful. What amazed me about the sport plane was it rolled perfectly with no change in pitch at approach speed.  I was dumbstruck.
Comment: If you apply rudder in sympathy with the aileron, that is more than needed for adverse yaw, in other words help the roll with skid, you will certainly increase the roll rate. All you have to do then is yank the stick back as you do so and you are in a snap roll. On the other hand, if you're using rudder to keep the nose from dropping, you'll be feeding in opposite rudder, peaking the input at knife edge, then taking it out and feeding it forward elevator as you go inverted, and so on.


iMac can't unzip password protected PC zipped file

Question: I sent a .zip file to a friend with an iMac but he can't open it. It was created using PKZip on a Windows 7 PC, and it's Password protected. He's pretty technically inept so is there anything he needs to do to be able to access this file please?
Comment: There is no need for a third-party utility, just double-click the file and when it prompts for the password, type it in and click OK.
Comment: He's saying it doesn't, but he's not giving me any error messages or anything. I've got ZIP set to AES256 bit encryption and Strong Passphrase. I'm going to try "watering it down" to see if that's what is causing the problem. The password also had a $ in it so I'll try removing that too.
Answer: macOS has built-in support for password protected Zip files, but if he encounters problems have him get The Unarchiver. It also does other kinds of file types.


ntrights equivalent/replacement for Server 2008

Question: Does anyone know what or if there exists a replacement utility for the Server 2000/Server 2003 command line tool ntrights on Server 2008? More info on this utility (for those that don't know what it is) is in MSDN KB 315276.
Comment: If you're developing commercial software, please don't use tools like NTRIGHTS in conjunction with deployment of your software. Oftentimes I prefer to use GPOs to assign user rights because its easy to move servers around in AD when computer roles change, and the right user rights assignments "just happen" when I use GPOs. When software uses NTRIGHTS to modify the local security policy on my servers I end up just having to undo the changes it makes and put those changes into a GPO.
Comment: @Evan - it's two pronged: [1] when I'm admin'ing servers, the more I can do from the command line, the better. And [2] Yes, deployment is part of it, but it's not a step we'd run automatically: it's a script that would be provided as a convienence for those that find it, erm, convienient, rather than clicking through local security policy. Agree that a lot of stuff can be pushed down through GPO, and folk do have the option of not running the script and applying them through other means. Instructions provided with the software give enough detail for either option.
Comment: I'm all for command-line. I've grown less comfortable w/ *anything* config'd locally on Windows Server machines. In the way configuration management systems like Puppet or Chef work in the *nix world, I see Active Directory and GPOs as being the method to insure many aspects of server configuration are "pushed out". Further, I consider all machines to be temporary, and I like to plan for how I'm going to deploy a replacement. Forcing out config thru GPOs helps me have a consistent replacement machine, down the road. At least your script lets an admin like me have an option.
Answer: Powershell Community Extensions has a Set-Privilege cmdlet that can be used to set user rights. (And a Get-Privilege to get user rights.)
Answer: NTRights seems to function properly on my 2k8 systems. You should be able to continue to use the utility.
Comment: I'll go with this then :-) Was wondering if MS now supplied it (or something similar) as standard. If not, this'll do :-)
Comment: +1 - I'm seeing the same behaviour here.
Answer: If you're OK with an open-source command-line tool, I wrote one that might work for you:
https://github.com/Bill-Stewart/PrivMan


Why an old material can certified as a patent?

Question: Many companies such as Climator "http://www.climator.com/files/products/climsel-c58.pdf" resolve the supper cooling, conductivity, separation and other problems of sodium acetate trihydrate within passed 20 years. Why this patent "Publication number   CN103666378 A" can certified?
Answer: That document CN103666378 A is patent application submitted to China's patent office. The A at the end, by international convention, means it is a publication of an application. That document is not a granted patent. From its page at google/patents (reachable by the link on the right) it looks like it is the only publication so far.


Creating a shortcut for Zooming (maximizing) windows that actually works on every app?

Question: As of MacOS 10.6.6, there's no keyboard shortcut that I know of for zooming (maximizing) the window.
There's ⌘M to minimize, though.
I made a custom shortcut, defined it on the keyboard preferences pane, but as it identifies the menu command by name ("zoom"), it clashes with other commands in some applications, for example this one I'm using right now, Firefox. It briefly highlights the view menu, giving me a hint that the command matched by "zoom" is inside that menu, but in this case, zoom is just a submenu that has the options zoom in and zoom out, but it's obviously not related to zooming the window.
Is there any other way of setting this shortcut to work in such cases?
Answer: The following Applescript will trigger the zoom button (that´s button 2) in the frontmost application´s window.
You could make this a service and define a global shortcut for it or use an application like quicksilver to call it.
tell application "System Events"
set frontApplication to (get name of every process whose frontmost is true) as string
tell process frontApplication
    click button 2 of window 1
end tell
end tell

Answer: I have assigned this script to ⌘M with FastScripts:
try
    tell application "Finder" to bounds of window of desktop
    tell application (path to frontmost application as text)
        set bounds of window 1 to result
    end tell
on error
    try
        tell application "System Events" to tell (process 1 where it is frontmost)
            click (button 1 of window 1 where subrole is "AXZoomButton")
        end tell
    end try
end try

It doesn't work if you have multiple displays though.
Applications that support maximizing windows to fill the screen:

BetterSnapTool
BetterTouchTool
Breeze
Divvy
Flexiglass
iKey
Keyboard Maestro
Moom
NuKit
OptimalLayout
QuicKeys
RightZoom
SecondBar
ShiftIt
SizeUp
SizeWell
Slate
WrongZoom


Soap API and email templates

Question: I'm cancelling order via Magento Soap API, for some reason emails sent are using default/default templates/skin etc. Is it possible to select which template/skin is used for emails?
Answer: I guess you're using the salesOrderCancel SOAP-Method.
As I can see from the Magento SOAP API Documentation, there are no attributes for setting an option to send e-mails or not or specifiying the scope.
So out of the box, this seems not possible.

Soap API and email templates


How can I retain geotagging information on my iPhone pictures?

Question: Most of my phone's memory (almost 11 GB's of it) resides in my pictures and videos. I want to clear most of it but not even my completely empty iCloud storage can handle all of it. Anyways, when you're looking at your photos and you zoom out into "years" and you click one of those years, a big map will pop out and you'll literally see every single place you've taken these pictures at. I think that's really cool since I went to a lot of places last summer and in general think it's a cool feature. Back to the point, is there any way I could save that location information when I export these pictures to my laptop? Would a copy/paste just be sufficient? I don't have a Mac either, so I don't know if it will be harder or impossible. And if it is possible, is there some sort of app that you can use on your laptop to pull up that same view you have on your iPhone and see everywhere you took your pictures?
Answer: You can just copy those images. Those location information is coded into EXIF data. It will not be deleted upon transfer.
Comment: If you use iPhoto, then upon adding the images, you can see them on a map.
Comment: Sweet! Now is there any way you know of that I can pull up that EXIF data on a map on my laptop or an app that allows you to do so?
Comment: Yeah, but my OS isn't Mac... Any other app that works the exact same way that works on Windows?
Comment: Nevermind! I actually looked that up myself and found this thing called Picasa by Google, it isn't as cool looking as the default one on my iPhone, but it'll do! If you have any better suggestions let me know! Thanks for your help!


Flat universe and accelerating expansion

Question: As current data suggests that the universe is flat, a flat universe would imply a slowing expansion rather than an accelerating one which we observe. Neither in an open nor a closed universe there is such a thing as accelerating expansion. Dark energy is thought to be responsible for that, but wouldn't that drive $\Omega$ away from 1, although we still measure it to be 1?
Answer: No. It is perfectly possible to have a flat universe that expands forever and is accelerating. Dark energy is what makes this possible. Whilst the curvature of the universe is defined by the sum of all the energy densities in it, the effects of matter (baryonic or dark) and dark energy are quite different on its dynamics.
It is in fact quite possible to have a closed universe with an accelerating expansion.
Open and closed are not synonymous with acceleration and deceleration.
Comment: This happens because the geometry is defined by the total mass/energy density, but the time evolution of the scale factor is defined by the equation of state of the stuff making up that density. Dark energy has a different equation of state to matter. Specifically the matter density scales as $1/a^3$ while the dark energy density is constant. You might be interested to read [How does the Hubble parameter change with the age of the universe?](http://physics.stackexchange.com/questions/136056/how-does-the-hubble-parameter-change-with-the-age-of-the-universe) and the links within it.
Answer: Einstein made an error in concluding from the universe being static that it has a cosmological constant. Being static is perfectly well explained by matter being more disperse at larger distances. It turns out he was right anyway. Observations have shown that the expansion of the universe is accelerating.
The only way for the cosmological constant to be observed as the same from any point in space-time going at any velocity and have the tendency for any object in free fall to follow a geodesic of space-time is if space-time has the same geometry as a set of point equidistant from a given point in a flat Mikowski space with 1 time like dimension. Our universe can be described as having spherical geometry with its size varying with time as c(sqrt(t^2 + 1/Λ^2) where Λ is the cosmological constant. I think that in reality only the regions space time in the future light cone of the big bang exist but for simplicity, I will describe it as though regions outside of it exist. Because simultaneity is relative, for any frame of reference accelerating only by the acceleration of the universe and not by gravity at any time going at any velocity, which I will call an inertal frame of reference, there is a coordinate system where the universe behaves in that way where the object is considered to be at time t=0 with zero velocity at that time. All inertial frames of reference have an antihorizon very far away where once an object enters comes in through it, it can never leave back through it and an event horizon where once an object leaves through it, it can never reenter through it. Once two objects get close enough that there exists an interital frame of reference whose antihorizon contains both of them, there can never stop being one and once they get far enough away from each other that there's no interial frame of reference whose event horizon contains both of them, there can never start being one again. The region of space-time outside of the event horizon of any inertial frame of reference appears to be an infinitely big black hole that that surrounds all of space except for a finite spherical region we're in. If someone goes beyond that event horizon, they'll observe themself pass it in a finite amount of time but you'll never observe them reach the event horizon and will see them keep getting more redshifted without bound unless you cross it yourself. Unlike a real black hole where space-time beyond its antihorizon doesn't exist, matter has sometimes entered through its antihorizon and you can see it from a time before it entered. Different interial frames of reference have a different event horizon and what's beyond the event horizon of one inertial frame of reference might not be beyond the event horizon of another inertial frame of reference. For instance, if someone has passed the event horizon of one intertial frame of reference and you're another inertial frame of reference that has not yet passed the event horizon, they might not be beyond your event horizon because it's not too late for them to make it back to you because you're going to fall past the event horizon.


About the integral $\oint \frac{z+\bar{z}}{\left | z \right |}dz$

Question: Suppose we wanted to integrate this around a semicircular  path above above the for $\Im \left ( z \right )\geq 0$ and $\left | z \right |\leq e$. The integrand has an essential singularity at $z=0$, and so we have to make a little indent inwards(or outwards) at that point on the contour as to avoid crossing the singularity. Let the indent be of radius $\epsilon $, we then have  $\oint \frac{z+\bar{z}}{\left | z \right |}dz=0$, according to the Cauchy-Goursat theorem. Now, since we can make the radius of the indent arbitrarily small, this looks all too similar to a principal value we assign to real integrals. Is this indeed the fact? Even stranger is the fact that if we split this integral up into the integral along the x-axis, and one along the arc(ignoring the indent at $z=0$), we somehow overcome the singularity at that point: $$\oint \frac{z+\bar{z}}{\left | z \right |}dz=\int_{-e}^{e}2dx +\int_{arc}^{ } f\left ( z \right )dz\neq 0$$
The fact that this last computation yields a non zero value is a telltale sign that we are dealing with v.p. values here?
Comment: Your integral isn't holomorphic anywhere, and you can't say that it has an essential singularity, and you definitely cannot use Cauchy's theorem. Is this **really** the integral you want to compute? (For example where does the restriction $|z| \le e$ come from?) But if that really is the question: if you want to integrate over a semi-circle of radius $r$, use that $|z| = r$ and $\bar z = r^2/z$ along the curve. That will help with the computation.
Comment: @mrf Another option might be to use Cauchy's theorem for non analytic functions. This was just an exercise in my Complex analysis book.
Comment: $z=re^{i\phi}$, $\frac{z+\bar z}{|z|}=2\cos\phi$
Answer: The integral has the value $\pi r i$ if the radius of the semi-circle is $r$.
The reason: the integral along the real axis from $-r$ to $r$ is $0$.
Note that the integrand is ${2x \over |x|}$ on the real axis. The function
to be integrated is thus $2$ for $x > 0$ and $-2$ for $x<0$. Hence it is bounded and integrable with the value of the integral $0$.
The integral along the semi-circle is easily done as follows:
Put $z = re^{i\theta}$. Then $dz = rie^{i\theta} d\theta$.
One gets two terms, one of which gives $0$ and one gives $\pi ir$.


Inherit or set permissions for all new files under a specific path

Question: I would like the Linux filing system to set a specific group when new files and directories are created by different users under a specific directory.  I know I can use chown to change existing files and directories but I want it to happen automatically.  Does anyone know how?
Answer: The standard user/group/other security model in Unix doesn't support this.  The closest you can get are the "sticky" bits to assign ownership and group to newly created files.
However, you tagged this acl, and that might open the door: you can set a default ACL that will be inherited down the tree; see the -d switch to setfacl(1), and the details under "automatically created entries" in the same manual page to understand how that works.
http://www.vanemery.com/Linux/ACL/linux-acl.html#default has further examples of how to use these tools.
If all you needed to do was make sure new things got created with a specific directory, though, that is much easier:
chgrp some-group /path/to/directory
chmod g+s /path/to/directory

That has no influence over file mode, just file ownership.
Comment: @jjmontes - I don't believe so, since he talks about *chmod* rather than chown.  Rereading, though, it could be that was a typo for chown, and the sticky bit would solve the problem.  That would be `chmod g+s /path/to/directory`
Comment: Wouldn't the sticky bit for the group solve his needs?
Comment: @Daniel Pitteman:Sorry I did mean chown not chmod :)
Comment: Then @jjmontes was on the money.  Use the sticky bit on the directory to get the behaviour you want.
Comment: Yes the ACL stuff worked.  I used this specific command: setfacl -R -m d:u::rwx,d:g:homework:rwx,o::- /home/Homework
Comment: @Daniel, just reviewing old questions, yes I see it is chown not chmod not sure why I put the wrong one...  Anyway I will change the question.


Clean up employee profile in Active Directory

Question: In my company, we have several ex-employees.  On my Windows Server 2003 machine, there is a "profile" folder which contains the following folders for different employees: "Application Data", "Contacts", "UserData", "WINDOWS" and so on (e.g. profile\employee_A\UserData).  If I copy the folders to a local machine and back them up, do I need leave the data in the "Profile" folder?  Or to put it differently, will removing the files and folders from a previous employee's "profile" folder cause any problems with Active Directory or some other software?  Thanks, in advance, for your help!
Answer: You can safely delete the profile. It contains only user private data. No AD will be affected.
Answer: AD won't have a problem with this in the slightest. It stores all its information on users in a database on the domain controllers, along with its information on everything else.
As for the "some other software", that rather depends on the "some other software" and whether or not you're likely to use these accounts again (I'm assuming that if you were 100% positive that these were dead accounts that would never be touched again you'd just be deleting them...).
You're unlikely to break other "server level" software by doing this but clearly if someone's desktop software (for example, office) is storing a lot of custom settings in their profile and you delete the profile then the desktop software clearly won't be able to find its settings if anyone logs into that account again. Only you can say for sure if that's a problem or not... it shouldn't be a problem for most things but none of us here know if you're running "Crazy Joe's accountancy software" under the ex employee's ID (crazy joe is known for being the home of both crazy things like storing important data in profiles and for being the patsy whenever i need a company name for my contrived examples).
Comment: What is the name of the database on the domain controller where the users information is stored?  The 'profile' folder to which I refer is on the domain controller.  You're right about their return - we've had some employees return over the years.  If I delete the files in the 'profile' folder of the domain controller, will they be created from scratch when the employee logs in again (my preference) as opposed to the employee having login issues?  The two software whose performance I'm concerned about is Windows and MS Office.  Thanks for your help!
Comment: One additional consideration is the local computer. In Windows XP or Server 2003 you can 'reset' a user profile by deleting the folder for that user under `C:\Documents and Settings`. The next time that user logs in a new folder will be created. In Windows Vista/7/2008/R2, simply deleting the folder is not enough. You also need to clear out an entries for that user in the system registry at `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList`.
Comment: @Michael Steele: The correct way to delete a user profile is from the Advanced System properties, which will clean up the file system and the registry as part of the removal.
Comment: @Charles - AD information is stored in a JET database. The file it uses is called NTDS.DIT. As for Windows account settings and MS Office, they're both fine in this kind of scenario, I was only suggesting you need to worry if you were using some weird obscure software, mainstream stuff from mainstream companies will understand how to behave perfectly ok in the scenario you describe. You can delete the profile (and the AD account if you like) and re-create them from scratch if you need the account again, without any worries.


I have a question about Arabic and Persian language?

Question: Let me take the consonant ب for example      1. بَ بِ بُ, these three combinations in Persian pronounciaiton are ba(a in apple), be (e in bed), bo ( o in spott).But in arabic pronounciation they are pronounced like ba ( a in apple),bi ( like i in 'it'), bu ( u in put).       2 .Their long vowel combinations are almost same. با بی بو ,they are pronounced baa, bii,buu both in arabic and persian       3. iinna, if written in arabic system is َیینَ ,but in persian system is َاین,  am i right?
Comment: Welcome to Linguistics SE. Can you rephrase the title of your question to display the actual problem? "I have a question" is very vague.
Comment: @sumelic: It seems that the main question is in the title...
Comment: This question requires edit of formatting; otherwise it would distract those who could potentially answer.
Answer: Both in Arabic and Persian the sequence /īna/ is written اينـ initially and ـينـ non-initially.
Answer: Edit: I'm sorry but apparently I misunderstood your question. I will leave my answer, however, in case someone finds it useful.
In Classical Arabic, The short vowels are /a/, /u/, and /i/, and the long vowels are their long counterparts (basically just a vowel length distinction).
So in Classical Arabic (marked with diacritics that are usually omitted):

بَ : /ba/
بُ : /bu/
بِ : /bi/

While the long vowels are (marked with letters that also represent semi-vowels, Mater lectionis):

بَا : /ba:/
بُو : /bu:/
بِي : /bi:/

However, I believe in most modern Arabic varieties nowadays, short vowels became their lax counterparts in some varieties of Arabic (essentially like the words you provided; the u in put (/ʊ/), the i in it /ɪ/, except the a, which I believe depends on the dialect. I believe some varieties have the a in apple (/æ/) as /a/ from CA, while others have /ɐ/ or perhaps something similar like the schwa or /ʌ/)
Modern Farsi Persian short vowels are:

بَ : /bæ/
بُ : /bo/
بِ : /be/

Note that your example words don't reflect the IPA pronunciation. The a in apple is /æ/, the o in IPA is heard in words like "coal" and "code" without the following /ʊ/. I never saw the word "spott" in English but I would assume the vowel there is actually /ɑ/ or /ɒ/ just like in the word "spot". The vowel in the word "bed" is actually "ɛ", while in Persian it's a really short /e/ (as in words like the e in words like "ballet", "buffet", and "café", but without the following /ɪ/
And the long vowels are similar to Arabic, except for the ـا, which is more back and round /ɒ/.
So to conclude, Arabic short vowels are in some modern Arabic varieties /æ/-/ɐ/, /ʊ/, /ɪ/. While the long vowels are /a:/, /u:/, and /i:/
Farsi Persian short vowels are /æ/, /o/, and /e/, while the long vowels are /ɒ:/, /u:/, and /i:/.


Is it a Bid'ah to say certain adhkar everyday?

Question: Would it be Bid'ah to do Salawat,say la ilaha illallah, say Subhanallahi wa bihamdih, say subhanallahi al-'adhim and to say Astaghfirullah a few hundred times every day and in that fixed order?
Answer: Any religious practice that cannot be traced back to Muhammad (p.b.u.h), supported by the Quran, Hadith (where weak ahadith may be included) or assumed to be continuous tradition from the time of the prophet, is bid'ah.
Only Salafi reject bid'ah categorically.
According to Hanafi, Maliki and Shafi'i madhab, it is forbidden to alter any practice that goes back to the Quran or reliable traditions (in particular, jurisdiction and anything concerning congregational prayer and Salat), whereas an additional practice that is based on Islamic faith and not contradicting known rules is considered halal as long as it is a voluntary choice of the believer.
Hanafi and - even more - 12er Shia accept also consent of scholars per analogy or extrapolation to be declared compulsory.
Perpetual prayer practice as you asked, is allowed according to the majority of Hanafi, Maliki and Shafi'i scholars. It's common practice in Sufism and Alevite Shia; I don't know how it is handled by 12er or 5er Shia. Most modern Hanbali scholars follow Salafiya to larger or lesser extent and reject such practice.

Is it a Bid’ah to say certain adhkar everyday?


Facing CPU time limit error

Question: Weekly about 10,000 records are inserted and there is a Trigger that calls a class to process these records. All this process is synchronous, but for some cases it's taking too long to process and getting CPU time limit error. In that case I have to change the class for a future method or batch? I don't know how to handle that in a asynchronous way since I have to get just the records that are inserted.
Comment: Please [edit] your question to include some snippet of your apex trigger/class.
Comment: If you have any Process Builders related to those records, be aware that they eat up cpu time.
Answer: Batchable is not appropriate for use in triggers because of the maximum queue size. Use either future or Queueable.
Answer:
Find out what consumes the most CPU Time

In Developer Console ==> Select Debug on the top menu -> Switch Perspective -> Analysis (Predefined)
Choose Timeline ==> Scale (Choose the one fits you).
On this timeline view above, we can now see that Apex, Workflow, and Database actions are executed in sequence and how much time each of them consumes.

One of the common reasons we hit the CPU limit is that the trigger logic enters unexpectedly multiple times. Trigger logic finishes first, workflow follows to update the record which then causes the trigger logic to re-enter.

Another reason is the trigger custom code logic itself. Is your Apex code performant? For example, nested loops can be very slow when processing a large volume of records.

You Can also check the API REQUESTS, LAST 24 HOURS under System Overview
Setup --> Environments --> System Overview
We can see the API Usages for last 24 Hours.

Facing CPU time limit error


How to deploy django web application on Microsoft Azure cloud services

Question: I have a existing django web application currently deployed on aws. I want to deploy it on Microsoft Azure by using cloud services. How to create config files for deploying web app on Azure? How to access environment variables on Azure? I am not using Visual Studio. I am developing web app in linux env and using git for code management. Please help
Answer: It sounds like you want to know which way is the best choice for deploying a django app via Git for code management on Linux, using Cloud Services or App Services on Azure.
Per my experience, I think deploying a pure web app into App Service on Azure via Git on Linux is the simplest way for you. You can refer to the offical docuemnts below to know how to do it via Azure CLI or only Git.

Deploy your first Python web app to Azure in five minutes
Local Git Deployment to Azure App Service

And there is a code sample of Django on App Service as reference that you can know how to configure it for running on Azure.
However, if your app need more powerful features & performance, using Cloud Services for your django app is also a better way than using VM directly. Also as references, please view the document Python web and worker roles with Python Tools for Visual Studio to know how to let Azure support Python & Django on Cloud Services, and you can create & deploy it via Azure portal in the browser on Linux. Meanwhile, thanks for the third party GitHub sample of Django WebRole for Cloud Service which you can refer to know how to create a cloud service project structure without PTVS for VS on Linux.
Hope it helps.
Comment: Thanks Peter! This information is very useful for me.
Answer: I read this post, decided the how-to guides Peter Pan posted looked good, and set off on my own. With my one business day's worth of experience if you are looking to deploy your app to Azure, start with the Marketplace Django app and go from there. Reason being the virtual environment comes with it along with the activate script needed to run the virtual environment and the web.config is setup for you. If you follow the start from scratch how-to guides, these are the hardest parts to setup correctly. Once you create the app service from the template, do a git clone of the repo to your local machine. Make a small change and push it back up by running the command below in bash.
az webapp deployment source config-local-git --name <app name> --resource-group <group name> --query url --output tsv

Use the result of the command to add the git repo as a remote source.
git remote add azure https://<ftp_credential>@<app_name>.scm.azurewebsites.net/<app_name>.git

Finally, commit your changes and deploy
git add -A
git commit -m "Test change"
git push azure remote

A couple of side notes
If you do not have your bash environment setup, you'll need to do so to use the az commands. The marketplace app does run error-free locally. I have not dug into this yet.
Good luck!


Allowing user to edit only certain pages

Question: I would want to allow certain user to edit only one page and it's subpages. How would this be possible? I tried the old Role Scoper, but it seems to have a lot of problems and bugs.
Comment: I removed your request for a plugin recommendation as that made the question off-topic. Yes, this should be possible with a plugin but when I see attempts to do things that require this kind of hacking of basic functionality I can't help but think that you are taking the wrong approach. Can you explain the project in more detail?
Answer: The first thing to do to implements such task is to be able to recognise which page an user can edit.
There are different ways to do it. It could be a user meta, some configuration value... For the sake of this answer, I will assume that a function lile this exists:
function wpse_user_can_edit( $user_id, $page_id ) {

   $page = get_post( $page_id );

   // let's find the topmost page in the hierarchy
   while( $page && (int) $page->parent ) {
     $page = get_post( $page->parent );
   }

   if ( ! $page ) {
     return false;
   }

   // now $page is the top page in the hierarchy
   // how to know if an user can edit it, it's up to you...

}

Now that we have a way to determine if an user can edit a page we just need to tell WordPress to use this function to check useer capability to edit a page.
That can be done via 'map_meta_cap' filter.
Something like:
add_filter( 'map_meta_cap', function ( $caps, $cap, $user_id, $args ) {

    $to_filter = [ 'edit_post', 'delete_post', 'edit_page', 'delete_page' ];

    // If the capability being filtered isn't of our interest, just return current value
    if ( ! in_array( $cap, $to_filter, true ) ) {
        return $caps;
    }

    // First item in $args array should be page ID
    if ( ! $args || empty( $args[0] ) || ! wpse_user_can_edit( $user_id, $args[0] ) ) {
        // User is not allowed, let's tell that to WP
        return [ 'do_not_allow' ];
    }
    // Otherwise just return current value
    return $caps;

}, 10, 4 );

At this point, we need only a way to connect an user to one or more pages.
There might be different solutions depending on use case.
A flexible solution could be to add a dropdown of "root" pages (see wp_dropdown_pages) to the edit user admin screen, and save selected page(s) as user meta.
We could leverage 'edit_user_profile' to add the pages dropdown field and 'edit_user_profile_update' to store the selected value as user meta.
I am sure that in this website there's enough guidance on how to that in detail.
When page(s) are stored as user meta, the wpse_user_can_edit() function from above can be finished by checking if the page id is part of the user meta value.
Removing capability to edit the page, WordPress will do the rest: will remove any edit link from backend and frontend, will prevent direct access... and so on.
Comment: This much better than my answer. Why limit edit links when you can just modify the user's capability, and let WordPress handle the rest?
Comment: you should use "a" before the word "user" not "an" because a long "u" sounds like "yu" which starts with a consonant.
Answer: It does take a small amount of code to implement this feature, even if you use a PHP class to avoid global variables. I also didn't want to hide the prohibited pages for the user in the Dashboard. What if they added content that was already on the site?
$user_edit_limit = new NS_User_Edit_Limit(
    15,       // User ID we want to limit
    [2, 17]   // Array of parent page IDs user is allowed to edit
                 (also accepts sub-page IDs)
);

class NS_User_Edit_Limit {

    /**
     * Store the ID of the user we want to control, and the
     * posts we will let the user edit.
     */
    private $user_id = 0;
    private $allowed = array();

    public function __construct( $user_id, $allowed ) {

        // Save the ID of the user we want to limit.
        $this->user_id = $user_id;

        // Expand the list of allowed pages to include sub pages
        $all_pages = new WP_Query( array(
            'post_type' => 'page',
            'posts_per_page' => -1,
        ) );
        foreach ( $allowed as $page ) {
            $this->allowed[] = $page;
            $sub_pages = get_page_children( $page, $all_pages );
            foreach ( $sub_pages as $sub_page ) {
                $this->allowed[] = $sub_page->ID;
            }
        }

        // For the prohibited user...
        // Remove the edit link from the front-end as needed
        add_filter( 'get_edit_post_link', array( $this, 'remove_edit_link' ), 10, 3 );
        add_action( 'admin_bar_menu', array( $this, 'remove_wp_admin_edit_link' ), 10, 1 );
        // Remove the edit link from wp-admin as needed
        add_action( 'page_row_actions', array( $this, 'remove_page_list_edit_link' ), 10, 2 );
    }

    /**
     * Helper functions that check if the current user is the one
     * we want to limit, and check if a specific post is in our
     * list of posts that we allow the user to edit.
     */
    private function is_user_limited() {
        $current_user = wp_get_current_user();
        return ( $current_user->ID == $this->user_id );
    }
    private function is_page_allowed( $post_id ) {
        return in_array( $post_id, $this->allowed );
    }

    /**
     * Removes the edit link from the front-end as needed.
     */
    public function remove_edit_link( $link, $post_id, $test ) {
        /**
         * If...
         * - The limited user is logged in
         * - The page the edit link is being created for is not in the allowed list
         * ...return an empty $link. This also causes edit_post_link() to show nothing.
         *
         * Otherwise, return link as normal.
         */
        if ( $this->is_user_limited() && !$this->is_page_allowed( $post_id ) ) {
            return '';
        }
        return $link;
    }

    /**
     * Removes the edit link from WP Admin Bar
     */
    public function remove_wp_admin_edit_link( $wp_admin_bar ) {
        /**
         *  If:
         *  - We're on a single page
         *  - The limited user is logged in
         *  - The page is not in the allowed list
         *  ...Remove the edit link from the WP Admin Bar
         */
        if (
            is_page() &&
            $this->is_user_limited() &&
            !$this->is_page_allowed( get_post()->ID )
        ) {
            $wp_admin_bar->remove_node( 'edit' );
        }
    }

    /**
     * Removes the edit link from WP Admin's edit.php
     */
    public function remove_page_list_edit_link( $actions, $post ) {
        /**
         * If:
         * -The limited user is logged in
         * -The page is not in the allowed list
         * ...Remove the "Edit", "Quick Edit", and "Trash" quick links.
         */
        if (
            $this->is_user_limited() &&
            !$this->is_page_allowed( $post->ID )
        ) {
            unset( $actions['edit'] );
            unset( $actions['inline hide-if-no-js']);
            unset( $actions['trash'] );
        }
        return $actions;
    }
}

What the code above does is prevent the following from working or appearing as needed:

get_edit_post_link
Edit Page link on the WP Admin Bar that appears for the Pages
Edit, Quick Edit, and Trash quick links that appear underneath the Pages in /wp-admin/edit.php?post_type=page

This worked on my local WordPress 4.7 install. Assuming that the pages on the site won't change often, it might be better to hardcode the IDs of the page and its sub-pages, and remove the WP_Query inside the __construct method. This will save a lot on database calls.
Comment: +1 for the more complete answer than @Ben's but the right way to handle the links is by manipulating the capabilities,
Comment: Yeah, when I saw gmazzap's answer I ended up thinking "Now why didn't I think of that?"
Answer: If you wanted to keep away from plugins, you could a variation of the code below in a functions.php file or a custom plugin.
There are 2 seperate parts to this code, You would only need to use 1 of them, but which one depends on the complexity of the requirements.
Part 1 is specifying a single user and restricting them to a specific post.
Part 2 allows you to create a map of users and post ID's and allows multiple posts
The code below is for a page only, but if you wanted to change that to a post, or a custom post type, you would need to change the string in $screen->id == 'page' to something else.
You can find a reference to the screen ID's around wp-admin here
function my_pre_get_posts( $query ){

    $screen = get_current_screen();
    $current_user = wp_get_current_user();

    /**
     * Specify a single user and restrict to a single page
     */
    $restricted_user_id = 10; //User ID of the restricted user
    $allowed_post_id = 1234; //Post ID of the allowed post

    $current_post_id = isset( $_GET['post'] ) ? (int)$_GET['post'] : false ;

    //Only affecting a specific user
    if( $current_user->ID !== $restricted_user_id ){
        return;
    }

    //Only Affecting EDIT page.
    if( ! $current_post_id ){
        return;
    }

    if( $screen->id == 'page' && $current_post_id !== $allowed_post_id ){
        wp_redirect( admin_url( ) );
        exit;
    }

    /**
     * Specify a map of user_id => $allowed_posts
     */
    $restrictions_map = [
        10 => [ 123 ], //Allow user ID to edit Page ID 123
        11 => [ 152, 186 ] //Allow user ID to edit Page ID 123 and 186
    ];

    if( array_key_exists( $current_user->ID, $restrictions_map ) ){

        $allowed_posts = $restrictions_map[$current_user->ID];

        if( $screen->id == 'page' && ! in_array( $current_user->ID, $allowed_posts ) ){
            wp_redirect( admin_url( ) );
            exit;
        }

    }

}
add_action( 'pre_get_posts', 'my_pre_get_posts' );

Comment: +1 as it can work to do the core functionality, but this still leaves the links to edit the pages being output even to users that can not edit them which makes a bad UI
Answer: I used User Role Editor a couple of times and is pretty good.
Maybe it could help you too.
Here is the link User Role Editor
Comment: Thanks, that works to an extent. At some point I might have to have multiple users restricted to modify a specific page, so there would need to be a way to set multiple authors to a page.
Comment: while that specific plugin is a solid thing right now, it is probably easier to write code to do it than wade in all the options the plugin offers. (if it even lets you do what the OP asks)
Comment: Seems to be a solid plugin, but I cannot find a way how to restrict a user to edit specific pages.
Comment: Make the users you want to limit this way author-level users
Add the capability "edit_pages" to the author user level (using User Role Editor)
Set the author of a page to the user you want to grant privilege of editing it.
An author level user given the capability of edit_pages can see the list of pages in the dashboard, but does not have the option to edit except for pages they are the author of.
Comment: To restrict users to specific pages you will need to purchase the Pro versoin. I am looking for the same thing and found that out. http://wordpress.stackexchange.com/questions/191658/allowing-user-to-edit-only-certain-pages/191661#191661?s=f87626a8cf184588bca7c4e397c972a4


What do the 47k resistors and 10k resistors do in this circuit?

Question: I found this here: Multiple buttons connected to reset pin which is what I want to do but it doesn't really explain how it works. I copied it to a simulator to try and understand it but even after removing/changing some resistors I'm failing to see why they are there and why it works the same without them. I understand the top right of the circuit and how that resets but the diodes and 47k resistors don't fully make sense. I was also able to remove the middle 10k and the circuit worked so is that needed too?
Comment: If the TP3.3 has no internal pullup then 47k is needed to ensure ESD safe. CMOS , should never be floating.  Otherwise stray E field may induce false noise with logic 0
Comment: Check what happens with the voltage supply rail.  Without those resistors, you would be shorting it to ground.
Answer: The diodes perform an OR function.
The middle 10K is there to charge the capacitor back to 3.3V. If you leave it out the charge has to come from the 47K pullups and the current has to come from the reverse current of the diodes. That would not be a great idea.
I forgot the 47K resistors: as mentioned by Oskar: without you short the power rail. They also make sure the outputs at the RHS are high if no button is pushed.
You mentioned you want to do the same thing. If it is just multiple reset buttons you can do it with several buttons in parallel. in the circuit above the RHS signals are used.
Comment: Multiple reset buttons while being able to tell which button was pressed once the microcontroller starts up. The idea I guess is the cap takes long enough to recharge that you can read the io line to see what button was pressed.
Comment: @Ryan Detzal. I used **just**.  The post already says: "This is not the ideal circuit."


Can I change cell padding in Google Spreadsheets?

Question: I don't want to stretch all rows and columns to make them more readable than they are by default...
Comment: By "stretching" do you mean increasing the width of the column based on its content? Increasing the height of a row based on its content? Something else?
Comment: I had to vote down, because the body is just a statement of what you don't want to do.
Comment: @ctrl-alt-delor no OP is trying to ask how to apply a minimum padding to cells separately from manually resizing the rows or columns, which is possible in other programs like Excel
Comment: https://webapps.stackexchange.com/a/151416/154040
Answer: I found a solution, which was actually quite obvious - select all cells and then stretch. It is not exactly cell padding though...
Comment: @MonoThreaded, you select all cells by CTRL/CMD+A or select specific rows and cols via clicking on its numbers or letters while holding CTRL/CMD key. If you've selected at least two rows and/or two columns then you can drag a single border between them - all widths/heights will change.
Comment: What do you mean by stretch all cells?
Comment: This must be from an old version; if I do this, it sets the size of all cells to be equal - to the size of the cell that I dragged
Answer: It would appear that at this time (April 2014) there is no way to add horizontal cell spacing.
Comment: Actually you can add a very small amount of padding if you add thick borders (3px) and make them white.
Comment: Hmm, this is good! You can actually add the thick borders, select all and double click to auto-size, and then reduce the borders again, for a tiny bit of padding!
Answer: As there is currently no way to add either vertical or horizontal padding, you need to use a workaround to be able to add cell padding. Since these are workarounds, I will add the cons to using them below.
For horizontal padding:
Thanks to Pitter Pat (source) for this method. Essentially you need to change the format of the cell and add spaces to the format. This will ensure the content of the cell is not changed, but the way it looks (in terms of padding) is changed.

Go to Format > Number > More formats > Custom number format...
Type in the following and apply:

"     $"#,##0.00_     ;"     -$"#,##0.00_     ;"     $"0.00_     ;     @     ;
This should give you five spaces of padding to the left and right of positive and negative numbers, zeros, and text.
Cons:

This could likely mess with custom formats you are using, if you are using anything other then positive or negative numbers, zeros, or text
This does not add true padding to the right side of a cell. In order to achieve "true" padding, the only way I see is to make a new column to the right of the cell you want to pad and try to make it blend in.

For vertical padding:
This is mostly manual.

You need to select all the cells (click the top left box, on top of "1" and on the left of "A", or control/command + A). Select the vertical align and set it to center. Then, change the height of all the rows. NOTE: this will get rid any custom vertical align/height settings you had for any cells or rows).
Ensure that the text wrap setting is set to anything other than "wrap text" (i.e. "clip" or "overflow").
If necessary, manually wrap text in cells and change their heights.

As you can see from these steps, this mainly has to do with playing around with the rows and heights and whatnot. The cons with this is that it isn't a good, "definite" way of adding vertical padding—if your content changes, you will manually need to change the padding again. It also is quite cumbersome if you rows aren't similar to each other.
Comment: The above number format gives an error in the latest Google Sheets.
Answer:
select the rows right click on the row header 'Resize row...'
find 'align' icon in tool bar and center the text vertically.
Answer: My Workaround:  Add a skinny column to the side you want padding on, and then make the border between the skinny column and the column you are working with white.  Then when you print it looks like everything is moved in however much you want.  Honestly, cell padding is such a standard feature in spreadsheets.  It's pretty ridiculous that Google Sheets doesn't have this function.
Answer: You might want to try copying the entire spreadsheet and pasting it into a new file.  The padding will be recovered, then you can resize the column width to fit the data.
Answer: This solution works:

Mark the cells you want the padding (horizontally left).

Go to "Custom Number Format":

Enter "   "@ where the whitespace represents the distance you want to have. The more whitespaces the more distance to the left. The @ sign is a placeholder for the cell's text.

See also Format numbers in a spreadsheet
Comment: which should be the right answer !!!
Answer: Working solution as of 2023.
Select all headers before resizing

One common mistake is that people select all cells, and not the actual headers. You can tell if the headers are selected if they become inverted.
To select all headers – select the cell one column (or row) away from your existing data, and press CTRL/CMD + A.

Example of all headers being selected

Example of no headers being selected

Stretch the headers
Stretch the headers of the columns or rows. Stretching a single header cell, will make the rest of the column/rows stretched also.
Answer: The padding of individual cells can be set in pixels via the Sheets API to produce results like any of:

For example, using a batchUpdate request to set the padding to 0 pixels for cell A1 on the first sheet would use a request like:
{
  "requests": [
    {
      "updateCells": {
        "rows": [
          {
            "values": [
              {
                "userEnteredFormat": {
                  "padding": {
                    "bottom": 0,
                    "left": 0,
                    "right": 0,
                    "top": 0
                  }
                }
              }
            ]
          }
        ],
        "start": {
          "columnIndex": 0,
          "rowIndex": 0,
          "sheetId": 0
        },
        "fields": "userEnteredFormat.padding"
      }
    }
  ]
}

As a one-off, you can execute this with the "Try It!" functionality of the Google API Explorer to set the padding in an arbitrary cell, then copy the format of that cell elsewhere as needed.
Answer: You can put extra space at the top and bottom of cells using soft returns; either by Option+Enter on a Mac or Alt+Enter on a PC.
Answer: User Skeleton Bow's formula is outdated for the current version of Google Sheets. In my case, I only need to add one space of padding to text, in which case you can use "@ " to do just that. Adding more spaces before/after the @ will add them around your text.
Answer: This isn't perfect and as others say, shouldn't be required, but if you add a space or - character in an unused column (usually far right, off-screen) and set the font size to be larger than your biggest font in the cells you are using, you'll get some padding. Note this only works on single line height content; if you have content wrapping over multiple lines, these will display with normal padding.
Answer: Work around for non-numeric cells:

Select the cells or column that the non-numeric data is in
On the home ribbon, click the More Formats dropdown
Select the "Accounting" numeric format

This will insert a small amount of padding on the left side of each cell.
Note: Does not work for numeric data (for obvious reasons).
Answer: Try changing the font size in all the cells to a smaller font, then bumping the font size back up again.
Answer: There is an add-on that is called Text Adder. I used that to solve my problem. It allows adding text in front or after the words. I typed spaces and it worked giving me the horizontal padding I was looking for since last year. Thank you to the author of that add-on.
Answer: Right click on column. Select row height and custom.