What is a null-terminated string?

Question: How does it differ from std::string?
Comment: What is a "usual" string?
Comment: std::string
Anyway, I already got an answer, thx.
Answer: A "string" is really just an array of chars; a null-terminated string is one where a null character '\0' marks the end of the string (not necessarily the end of the array). All strings in code (delimited by double quotes "") are automatically null-terminated by the compiler.
So for example, "hi" is the same as {'h', 'i', '\0'}.
Comment: Way better to understand than the accepted answer. +1
Comment: It might be worth mentioning that compilers look for the null character to determine the length of the string.
Comment: I have a string temp, and i stored a,b,c as temp[0], temp[1] and temp[2]. Now, when I do "cout << temp", it doesn't give - "abc". What should I do?
I got to know that '\0' also doesn't work as string terminator here.
Comment: @BhavukMathur open a new question and provide a test sample of code, someone will help you out then. Comments are for comments.
Comment: Did you find answer for this ?
Answer: A null-terminated string is a contiguous sequence of characters, the last one of which has the binary bit pattern all zeros. I'm not sure what you mean by a "usual string", but if you mean std::string, then a std::string is not required (until C++11) to be contiguous, and is not required to have a terminator. Also, a std::string's string data is always allocated and managed by the std::string object that contains it; for a null-terminated string, there is no such container, and you typically refer to and manage such strings using bare pointers.
All of this should really be covered in any decent C++ text book - I recommend getting hold of Accelerated C++, one of the best of them.
Comment: Basically, the zeroed byte determines the length of a character string in C.
Comment: I'm not aware of any platform where there is this distinction. Note the use of null (or perhaps more properly NUL) as a string terminator is different from the NULL pointer.
Comment: Both are implied by 3.9.1:7, "the representation of integral types shall define values by use of a pure binary numeration system", further defined in a footnote. So actually I shouldn't have stated them separately. I also found in 3.9.1:1. "For character types, all bits in the object representation participate in the value representation", which slams the door. I wrongly thought that was only required of unsigned char, hence "less wide", but it's required of signed char too.
Comment: Steve, thank you, I stand corrected, I missed 3.9.1/7. I don't think that 3.9.1/1 is relevant though, the fact that "all bits in the object representation participate in the value representation" simply means that there are no padding bits, it says nothing about the actual bit patterns. In any case, the answer is absolutely correct now and I'm up-voting. :) Sorry for the prolonged discussion.
Comment: The last character need not have the bit pattern of all zeros, it merely has to have the *value* of 0.
Comment: Neither am I. However, the standard says very little about bit-patterns of integral values.
Comment: You say that std::string is not required to have a terminator. Does that mean that mystring.c_str() is not guaranteed to be null-terminated?
Comment: No. If the null-terminator doesn't exist, c_str() is guaranteed to append it. See http://www.cplusplus.com/reference/string/string/c_str/
Comment: Steve, "signed char must have the same representation as unsigned for non-negative values", could find the relevant quote?
Comment: Also, `unsigned char` must behave according the modulo 2^k arithmetic. I don't think the actual bit pattern is mentioned in the standard (can you please quote or reference, if I'm wrong?).
Answer: There are two main ways to represent a string:
1) A sequence of characters with an ASCII null (nul) character, 0, at the end. You can tell how long it is by searching for the terminator. This is called a null-terminated string, or sometimes nul-terminated.
2) A sequence of characters, plus a separate field (either an integer length, or a pointer to the end of the string), to tell you how long it is.
I'm not sure about "usual string", but what quite often happens is that when talking about a particular language, the word "string" is used to mean the standard representation for that language. So in Java, java.lang.String is a type 2 string, so that's what "string" means. In C, "string" probably means a type 1 string. The standard is quite verbose in order to be precise, but people always want to leave out what's "obvious".
In C++, unfortunately, both types are standard. std::string is a type 2 string[*], but standard library functions inherited from C operate on type 1 strings.
[*] Actually, std::string is often implemented as an array of characters, with a separate length field and a nul terminator. That's so that the c_str() function can be implemented without ever needing to copy or re-allocate the string data. I can't remember off-hand whether it's legal to implement std::string without storing a length field: the question is what complexity guarantees are required by the standard. For containers in general size() is recommended to be O(1), but isn't actually required to be. So even if it is legal, an implementation of std::string that just uses nul-terminators would be surprising.
Answer: '\0'

is an ASCII character with code 0, null terminator, null character, NUL. In C language it serves as a reserved character used to signify the end of a string. Many standard functions such as strcpy, strlen, strcmp among others rely on this. Otherwise, if there was no NUL, another way to signal end of string must have been used:

This allows the string to be any length with only the overhead of one
  byte; the alternative of storing a count requires either a string
  length limit of 255 or an overhead of more than one byte.
from wikipedia

C++ std::string follows this other convention and its data is represented by a structure called _Rep:
// _Rep: string representation
      //   Invariants:
      //   1. String really contains _M_length + 1 characters: due to 21.3.4
      //      must be kept null-terminated.
      //   2. _M_capacity >= _M_length
      //      Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
      //   3. _M_refcount has three states:
      //      -1: leaked, one reference, no ref-copies allowed, non-const.
      //       0: one reference, non-const.
      //     n>0: n + 1 references, operations require a lock, const.
      //   4. All fields==0 is an empty string, given the extra storage
      //      beyond-the-end for a null terminator; thus, the shared
      //      empty string representation needs no constructor.

      struct _Rep_base
      {
    size_type       _M_length;
    size_type       _M_capacity;
    _Atomic_word        _M_refcount;
      };

struct _Rep : _Rep_base
      {
    // Types:
    typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;

    // (Public) Data members:

    // The maximum number of individual char_type elements of an
    // individual string is determined by _S_max_size. This is the
    // value that will be returned by max_size().  (Whereas npos
    // is the maximum number of bytes the allocator can allocate.)
    // If one was to divvy up the theoretical largest size string,
    // with a terminating character and m _CharT elements, it'd
    // look like this:
    // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
    // Solving for m:
    // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
    // In addition, this implementation quarters this amount.
    static const size_type  _S_max_size;
    static const _CharT _S_terminal;

    // The following storage is init'd to 0 by the linker, resulting
        // (carefully) in an empty string with one reference.
        static size_type _S_empty_rep_storage[];

        static _Rep&
        _S_empty_rep()
        {
      // NB: Mild hack to avoid strict-aliasing warnings.  Note that
      // _S_empty_rep_storage is never modified and the punning should
      // be reasonably safe in this case.
      void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
      return *reinterpret_cast<_Rep*>(__p);
    }

        bool
    _M_is_leaked() const
        { return this->_M_refcount < 0; }

        bool
    _M_is_shared() const
        { return this->_M_refcount > 0; }

        void
    _M_set_leaked()
        { this->_M_refcount = -1; }

        void
    _M_set_sharable()
        { this->_M_refcount = 0; }

    void
    _M_set_length_and_sharable(size_type __n)
    {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
      if (__builtin_expect(this != &_S_empty_rep(), false))
#endif
        {
          this->_M_set_sharable();  // One reference.
          this->_M_length = __n;
          traits_type::assign(this->_M_refdata()[__n], _S_terminal);
          // grrr. (per 21.3.4)
          // You cannot leave those LWG people alone for a second.
        }
    }

    _CharT*
    _M_refdata() throw()
    { return reinterpret_cast<_CharT*>(this + 1); }

    _CharT*
    _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
    {
      return (!_M_is_leaked() && __alloc1 == __alloc2)
              ? _M_refcopy() : _M_clone(__alloc1);
    }

    // Create & Destroy
    static _Rep*
    _S_create(size_type, size_type, const _Alloc&);

    void
    _M_dispose(const _Alloc& __a)
    {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
      if (__builtin_expect(this != &_S_empty_rep(), false))
#endif
        if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
                               -1) <= 0)
          _M_destroy(__a);
    }  // XXX MT

    void
    _M_destroy(const _Alloc&) throw();

    _CharT*
    _M_refcopy() throw()
    {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
      if (__builtin_expect(this != &_S_empty_rep(), false))
#endif
            __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
      return _M_refdata();
    }  // XXX MT

    _CharT*
    _M_clone(const _Alloc&, size_type __res = 0);
      };

the actual data might be obtained with:
_Rep* _M_rep() const
      { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }

this code snippet comes from file basic_string.h which on my machine is located in usr/include/c++/4.4/bits/basic_string.h
So as you can see, the difference is significant.
Answer: A null-terminated string means that the end of your string is defined through the occurrence of a null-char (all bits are zero).
"Other strings" e.g. have to store their own lenght.
Answer: A null-terminated string is a native string format in C. String literals, for example, are implemented as null-terminated. As a result, a whole lot of code (C run-time library to begin with) assumes that strings are null-terminated.
Answer: A null terminated string (c-string) is an array of char's, and the last element of the array being a 0x0 value. The std::string is essentially a vector, in that it is an auto-resizing container for values. It does not need a null terminator since it must keep track of size to know when a resize is needed.
Honestly, I prefer c-strings over std ones, they just have more applications in the basic libraries, the ones with minimal code and allocations, and the harder to use because of that.

What is a null-terminated string?


Actual sequence of refrigeration cycle

Question: Whenever i have studied refrigeration cycle on books, i have found that the diagrams are always explained starting from the compressor*, then condenser then throttle and finally evaporator. I find it strange to start from the compressor, since the heat from the food items inside the refrigerator compartment must be absorbed first, then the compressor does work on it, which increases its pressure and temperature(which makes the refrigerant temp greater than the ambient, and thus we are able to reject the heat). Am i right to think this way? What is the actual sequence of operations in a refrigerator.
Comment: It's a cycle so it goes in a loop. What you choose as the starting point is an arbitrary decision since with a loop you can start anywhere.
Comment: Yes that is true, but say when the refrigerator is operated for the very first time, where would the cycle start from. Is this decision arbitrary or does the refrigerant in actual operation always start from the compressor.
Answer: It is correct that all the refrigeration cycle diagrams begin with the compression process. I'm no refrigeration/AC expert but let me take a stab at the reason. Let's use the example of a room A/C. Let's say the A/C has not been running for a while. As such the refrigerant sitting in the condenser is essentially at the same temperature as the outdoor air temperature and the refrigerant in the evaporator is essentially the same as the air temperature of the room.  Given these conditions you cannot have heat transfer to the evaporator or from the condenser when the A/C first turns on. That leaves it necessary to start the cycle with the compression process to create the necessary temperature and pressure differentials for heat transfers to take place.  If someone has other thoughts I'd like to hear them.
Comment: Quite a good explanation, it may well be the reason.

Actual sequence of refrigeration cycle


Proof that $\sum\limits_{k=1}^\infty\frac{2k}{(k^2+c^2)^2}\gt\frac{2}{2c^2+1}$

Question: I tried to prove the following inequality which gives a lower bound to the Mathieu sum:
$$S=\sum_{k=1}^\infty\dfrac{2k}{(k^2+c^2)^2}$$
where $c\neq0$.
The Mathieu inequality states: $S\lt\dfrac{1}{c^2}$
The following inequality holds:
$$S\gt\dfrac{1}{c^2+\dfrac{1}{2}}$$
I tried to expand $S$ and I found an expression for $S$ very difficult to manage, so it seems very hard to follow this way to prove it. Is there a better method to prove it? Thanks.
Comment: No `\dfrac` in titles please, unless this is absolutely necessary (it was not in the present case).
Answer: You may observe that $$\frac{2k}{\left(k^{2}+c^{2}\right)^{2}+\frac{1}{4}+c^{2}}<\frac{2k}{\left(k^{2}+c^{2}\right)^{2}}\tag{1}
 $$ and $$\frac{2k}{\left(k^{2}+c^{2}\right)^{2}+\frac{1}{4}+c^{2}}=\frac{1}{\left(k-\frac{1}{2}\right)^{2}+\frac{1}{4}+c^{2}}-\frac{1}{\left(k+\frac{1}{2}\right)^{2}+\frac{1}{4}+c^{2}}
 $$ hence, if we take the sum in $(1)$ we get

$$\frac{1}{c^{2}+\frac{1}{2}}<\sum_{k\geq1}\frac{2k}{\left(k^{2}+c^{2}\right)^{2}}.$$

A similar trick works for the other inequality.
Comment: nice one marco (+1) didn't saw that...
Answer: It is a bit an overkill, but since for any $a,b>0$ we have:
$$ \int_{0}^{+\infty}x\sin(ax)e^{-bx}\,dx = \frac{2ab}{(a^2+b^2)^2} \tag{1}$$
it happens that:
$$ \sum_{k\geq 1}\frac{2k}{(k^2+c^2)^2}=\int_{0}^{+\infty}\sum_{k=1}^{+\infty}\frac{x\sin(cx)}{c}e^{-kx}\,dx = \frac{1}{c}\int_{0}^{+\infty}\frac{x\sin(cx)}{e^x-1}\,dx\tag{2} $$
and if $|c|\leq 1$ we have:
$$ \sum_{k\geq 1}\frac{2k}{(k^2+c^2)^2}= 2\zeta(3)-4c^2\zeta(5)+6c^4\zeta(7)-8c^6\zeta(9)+\ldots\tag{3}$$
On the other hand, by partial fraction decomposition and the identity $\sum_{n\geq 0}\frac{1}{(n+a)^2}=\psi'(a)$  we have:
$$ \sum_{k\geq 1}\frac{2k}{(k^2+c^2)^2}=\frac{\text{Im}\left(\psi'(1-ic)\right)}{c}\tag{4}$$
so for large values of $c$ we may use Stirling's approximation for $\log\Gamma$ or the Euler-Maclaurin summation formula: notice that
$$ \int_{1}^{+\infty}\frac{2x\,dx}{(x^2+c)^2}=\frac{2}{2c^2+2}.\tag{5}$$
The connection between my approach and Marco's one is very nice: Stirling's inequality is a consequence of creative telescoping.


How to make a check-box field into read-only accessibility once the record is created?

Question: I have an 'X' check-box field on 'Y' custom object which cannot be edited once the record is created. How to achieve this requirement. Thanks in advance
Comment: Do you mean that someone can edit the value on the intial creation screen, but then can never edit the field after that?
Comment: with standard layout you can't make that read only though you can write a validation rule which can prevent edit.
Comment: @NickCook Yes, once the record is created no one should be able to edit it so, I would like to show the field as read-only/output value.
Comment: Thanks @Himanshu for your reply is there any other possible way other than validation rule like hiding field from layout after creation of record.
Comment: besides Himanshu's answer, you would need to use a VF page that overrode the standard Edit page and another VF page using apex:detail and jQuery that overrode the standard detail (View) page
Answer: There are two option to complete this requirement.

Write a validation rule/Trigger which will prevent for value change in that field
Standard layout doesn't give that flexibility where you can make field read only after it's creation so in that case you can follow below approach if you want to show field as read only.

Create two record types and make first record type as default
Create two different page layout per record type one with checkbox without read only and second page layout with checkbox read only.
Once you save the record change the record type of record from first to second. it will change the page layout of the record and you will see field as read only.


photo recovery after iPhone "Erase Data"

Question: Is there any way to recover the photos from an iPhone which has been "erased" after several consecutive failed passcode attempts?
Unfortunately, these photos were not backed up.  Apple techs grudgingly suggested that the data was still there...
Answer: Which iPhone OS and model do you have? The newer ones encrypt the data and the erase deletes the key. The chances of DIY recovery are slim. If you pull it off, you probably can get hired for iPhone forensics and make some serious salary doing that professionally.
Older devices are more amenable to typical recovery efforts. Either way you will need a forensic tool like PhoneView to access the filesystem. Once mounted you could try something like Data Rescue. Neither tool was designed for this, so you should try the free versions first before spending money on them.
The professional data recovery houses will likely charge an arm and a leg to get your data back - but at least you can get a quote if you really need them back at all cost.
Be sure to double check your camera roll isn't backed up to iTunes or on Time Machine. It would be far simpler to restore the device to an old backup and get the photos off intact. You would lose any photos taken after the backup time, though.
If you have enabled data security (iOS 4.3 and iPhone 4 are one combination that enables this security), you're likely deep in the hurt locker. See iOS 4: Understanding data protection to tell if you enabled data protection. In a nutshell, that means the filesystem was encrypted and the erase destroyed the key to the encrypted files. You will need industrial grade forensics to get things back if the phone was powered off immediately after the erase. Using it after the erase will rapidly overwrite the scrambled data irreversably.
Comment: Sadly, you're in the hurt locker with iPhone 4 and iOS 4.3 or higher. See http://support.apple.com/kb/HT4175 - you enabled data protection which means the filesystem was encrypted and the erase destroyed the key. You will need industrial grade forensics to get things back if the phone was powered off immediately after the erase. Using it will rapidly overwrite the scrambled data irreversably.
Comment: iPhone 4, iOS 4.3.something
Comment: move that comment into your answer and you win.
Answer: If you sync your iPhone with iTunes and do routine backups of it, you can restore it with just a single click (using iTunes). Connect your iPhone to iTunes, and right click it from the devices list and select "Restore from backup". Your photos should then, be recovered from the backup onto your iPhone, up to the date of the backup.
However, if you did not sync and backup, it would pretty much be very very difficult to recover.
Comment: Sadly I do not sync after every photo. :) My question is in the "difficult" category.
Answer: You can try an application like iExplorer, which should give you access to your photos. If that doesn't work, pull out the heavy artilary and jailbreak the iPhone to gain root level access to the file system. The full path to the Camera Roll directory on iOS is:
<code>/private/var/mobile/Media/DCIM/
</code>
Once you are jailbroken, enable your Mac's sshd server

ssh into the iPhone and copy the entire directory back to your (hopefully you have a) Mac, and can use the Terminal:
<code>pilcrow@mac:~$ ipconfig getifaddr en1
192.168.1.76
pilcrow@mac:~$  arp -a
? (169.254.255.255) at (incomplete) on en1 [ethernet]
? (192.168.1.66) at 63:22:a:5b:50:dc on en1 ifscope [ethernet]
pilcrow@mac:~$ ssh firstname.lastname@example.com
root's password:                          # note: pw is alpine
iPhone:~ root# scp -r /private/var/mobile/Media/DCIM firstname.lastname@example.com:~
pilcrow's password:                       # note: pw is passw0rd123 (jk LOL!)
DCIM          0%       0KB          1.2KB/s        00:00
...
DCIM          100%      12242KB       60.8KB/s     25:42
iPhone:~ root# exit
pilcrow@mac:~$ exit
</code>
Answer: If you are using a mac, you could use this program that lifehacker suggested. http://lifehacker.com/5806189/picturescue-recovers-iphone-photos-from-itunes-backup-files
Comment: I'm afraid I do not have a backup of these photos.
Answer: If you backed up the iPhone on your computer, Access the backup file with a program that allows such filetype.
Here is an example of a program that does such. http://www.iphonebackupextractor.com/
If you dig a little deeper than I did to answer your question, I am sure you will find a free solution to your problem here. Goodluck mate.


Remove transparent when rotate 3D ps6

Question: I have 3D image and this is several 3D layers merged in one. But when I try to rotate it layers become transparent

What I should do if I want to remove this "transparent effect"?
Answer: It looks like your 3D Layer has transparency (used when creating the 3D layer in Photoshop), as seen in the Layers panel.  You'll need to go into the 3D object, select the material, and A) remove the Opacity texture if one exists, B) edit the Diffuse texture and if there is no "background" layer in the texture then the Diffuse Color is shown (pass-through from the transparent texture).
If you want to use the blue radial gradient in the background of the Diffuse texture, copy it from (in your example) "Layer 1" and then open the Diffuse texture, paste in the layer and move it to the back.  If there is no transparency in the diffuse texture and there is no Opacity texture for the material then there should be no transparency.
Note:  You can create a Diffuse, Specular and Illumination texture that has transparency and whatever part of the texture is transparent will use the color in it's associated color picker (in the Material properties).  You can effectively stencil out your "decals" and then change the main texture color using the color well.  Also, your "decal" can have varying degrees of transparency and will "blend" with the color in the color picker, providing a way of creating tints.  This is very effective if you're working with a client and they want to change the color(s).
In Addition: As Derek pointed (above) out layers are set in 3D space, which is true, however, all entities in the 3D layer are actually 3D, it's just that 3D Postcards are infinitely thin (an extrusion value of 0) so when they are turned to their side you see, well, nothing.
If you want to have some thickness to your shape (so it's visible from all angles) convert your layers to a 3D Extrusion as opposed to a 3D Postcard and set the extrusion depth to 1, 5, or whatever you'd like, just not 0, unless you adjust the Bevel or Inflation values to give the front and/or back surfaces some geometry. Cheers!
Answer: The layers are set in a 3D space, but the layers themselves are not actually 3D. So when you turn the layers completely sideways, they disappear because they dont have any thickness.

Remove transparent when rotate 3D ps6


Why aren't questions deleted that were closed as duplicates?

Question: What is the need to keep questions which were closed because they were duplicates? Why aren't these questions deleted? Do these questions provide some useful information even if the question is a copy of another question?
Comment: I think the case would be stronger if it was aimed at deleting close as off-topic, not a real question or subjective/argumentative.
Answer: Because the closed question...

may have better wording
may be a frequently-searched term
may have a better description
may produce more answers (before it is closed) that can be merged with the original question.

and thus acts like a bookmark to the first question.  This way, we have less duplicates, in theory anyway.
Comment: What about questions like this which has no comments or answers http://meta.stackexchange.com/questions/46406/option-to-increase-bounty
Comment: @subanki: the closed question acts as a 'synonym' title for the original question.  As you can see, the original question has a lot of discussion that would sufficiently answer that duplicate's question...
Comment: @subanki: see this question on SU: http://superuser.com/questions/220288/when-a-pc-is-slow-what-do-you-check-for - I asked this question, it turns out that it was a dupe, but it was a better written title, and attracted some good answers.  Thus, I requested that the answers be *merged* with the original.
Comment: You have a point there. But what if there are more than four to five dupes. (I am unable to find a question like that but I am sure I have seen it somewhere in SU or SO)
Comment: @subanki: then perhaps they should be deleted...
Answer: Jeff wrote about this exact issue at length in his blog post Dr. Strangedupe: Or, How I Learned to Stop Worrying And Love Duplication:

One thing I want to be clear about, though, is that duplication is not necessarily bad. Quite the contrary — some duplication is desirable. There's often benefit to having multiple subtle variants of a question around, as people tend to ask and search using completely different words, and the better our coverage, the better odds people can find the answer they're looking for. And isn't that, really, the whole point of this exercise?
Answer: There are no incentives coming from the Stack Overflow system to do janitorial tasks like deleting questions. It can even be argued that they are made artificially hard and unrewarding through all kinds of restrictions. Naturally this causes people to stop doing these tasks.
In the case of deleting of questions, the process has been made tedious and ineffective, so nobody is doing it anymore.
Comment: @subanki: Server space isn't very valuable and you can store millions of questions in a few gigabyte. Also "deleting" really only means "set some flag in the database so that the question normally isn't displayed".
Comment: @subanki: If it's later decided that deleting was a mistake, the question can be undeleted. For that, users with >10k reputation can see deleted question and vote to undelete if they disagree with the deletion. Also for moderators it might be useful to see everything a user posted, even if it got deleted.
Comment: @subanki: For example [this questions](http://stackoverflow.com/questions/4638839/removing-entire-element-based-on-text-value-php-xml) has recently been undeleted (see revision history). There are probably only very few questions that get undeleted after years, if any.
Comment: If duplicate's are not deleted, wouldn't they be losing their valuable server space.
Comment: @sth What is the use of keeping them flagged if they are not to be displayed in any website?
Comment: @sth Is there any question which has been un-deleted. And what about those old un-deleted questions (questions like 4 or 5 years old). What useful information would they get by tracking a user ?


Is Gsm antenna effect on microcontroller working?

Question: in my embedded system I used patch antenna and Atmega 328 microcontroller,but somehow it causes the abrupt function of a microcontroller or reset. how can it be solved?
Comment: It's a common problem with GSM. A GSM can have a sudden current spike. The supply might not be able to deliver this and thus one or more devices will reset (power down and up). (http://www.tek.com/sites/tek.com/files/media/document/resources/2032%20Power%20Supply%20WP.pdf)
Answer: There are 3 possible causes that I can think of (it's difficult to say more without further details):

SW bug: this is hard to confirm without actually finding the bug, but it might cause a lock-up and trigger a watchdog reset (do you have a watchdog running?) or a pointer error cause a jump to some memory location along the boot path (not so likely, I suspect)
Too tight power envelope: when your system tries to transmit, it draws more power than the power supply/battery can provide. This cause a temporary voltage drop, to the point that the system kinda power cycles. You can try to use a power supply with higher maximum current.
Electromagnetic interference: somehow the transmission interferes with the AVR. You can try to direct the antenna further away from the AVR and to increase the distance in between.

But you should really add more information to your question.


Can I script checking for password date changes from ARD?

Question: Basically, I would like to know if the root password as been changed on several machines. Can I have Apple Remote Desktop script this for me and automate this check?
Answer: I found the info, but the data format is unnecessarily complex. At least in Mavericks (and I suspect several previous versions), it's in a property list, which is wrapped up inside another property list (the passwordpolicyoptions property in /var/db/dslocal/nodes/Default/users/root.plist). Theoretically, you should extract that property to a file, then use something like /usr/libexec/PlistBuddy to get the passwordLastSetTime property from it... but hacking it with sed is much easier:
dscl . -read /Users/root PasswordPolicyOptions | sed -n '/passwordLastSetTime/{n;s@.*<date>\(.*\)</date>@\1@p;}'

This command must be run as root; interactively you'd use sudo, but if you're running it with ARD, just use "Send UNIX Command", and set "Run command as: User: root".


view shows as database overriding code

Question: I've created a simple feature to export my custom views. I've downloaded the view and enabled it on the manage features screen. When I look at the view in views it tells me that the database is overriding code. I don't know why as I haven't touched the view since creating the feature. Surely the view should be 'in code'?
Answer: Even if you don't change anything, it's enough to click the 'Save' button on the views configuration page to make it override the code. You can simply revert the view if you are sure that you didn't change anything.

view shows as database overriding code


Outlook Web Access, Exchange 2013, Malware

Question: we have an exchange 2013 server and most users are all use OWA. The other day a user openend an email with an .doc attachment using OWA and the local antivirus automatically quarantined it and stopped any activity.  My concern is whenerver or not the opening of this email in OWA may have infected the exchange database..?  Thanks
Answer: No, opening the message through OWA wouldn't have any impact on your Exchange database.
Are you using any sort of spam filtering solution in your environment? If not, you should be... Basically, you want to filter out this type of thing before it can even be opened by your users.
Comment: ewwhite - Thanks, we are controlling entry points[Harware DPI] and border level[Software Spam Filtering] but not within Exchange Servers / Mailboxes. So I assume this exploit only applies to 'local users disclosure of information' whilst sending to other exchange servers within the organisation or to another exchange based organisation using OWA and has no impact to the DB directly:   https://support.microsoft.com/en-us/kb/3150501

@Sembee - +1
Comment: @serverimeco I think you're well-protected then.
Answer: https://technet.microsoft.com/en-us/library/security/ms15-026.aspx

The most severe of the vulnerabilities could allow elevation of
  privilege if a user clicks a specially crafted URL that takes them
  to a targeted Outlook Web App site. An attacker would have no way
  to force users to visit a specially crafted website. Instead, an
  attacker would have to convince them to visit the website, typically
  by getting them to click a link in an instant messenger or email
  message that takes them to the attacker's website and then
  convince them to click the specially crafted URL.

Last I heard .doc files can contain VBA. VBA such as this:
<code>Option Explicit
Private Declare Function ShellExecute _
  Lib "shell32.dll" Alias "ShellExecuteA" ( _
  ByVal hWnd As Long, _
  ByVal Operation As String, _
  ByVal Filename As String, _
  Optional ByVal Parameters As String, _
  Optional ByVal Directory As String, _
  Optional ByVal WindowStyle As Long = vbMinimizedFocus _
  ) As Long

Public Sub OpenUrl()

    Dim lSuccess As Long
    lSuccess = ShellExecute(0, "Open", "www.goodbyedatabase.com")

End Sub
</code>
Comment: This would require being directed to OWA site in which the .doc that was opened did not do.


What is "missing" in the Visual Studio 2008 Express Editions?

Question: What is "missing" in the Visual Studio 2008 Express Editions?
In particular,

what functionality is not available?
what restrictions are there on its use?
Comment: Disagree with the closure - it is a straight factual question requiring a factual answer.
Answer: The major areas where Visual Studio Express lacks features compared to Visual Studio Professional:

No add-ins/macros
Some Win32 tools missing
No Team Explorer support
Limited refactoring support
Debugging is much more limited (particularly problematic for server development is no remote debugging)
Lack of support for setup projects
No report creation tools
No Office development support
No mobile platform support
Limited set of designers
Limited set of database tools
No code profiling or test framework support
No MFC/ATL support
No support for compiling C++ to 64-bit images (workaround is to install Windows SDK which is free)

NOTE: it is often said that the Express EULA does not permit commercial development - that is not true (Visual Studio Express FAQ Item 7)
Comment: There is support for 64 bit execs!
Comment: @Michael: Yes. I installed the Windows SDK - but that's a free download too.
Comment: @George: interesting - my C++ Express installations (including VC++ 2010 Express) don't get any x64 compilers - are you getting x64 support by installing the Windows SDK?
Answer: There's a handy set of comparison charts on microsoft.com.
It depends on the particular express edition, of course (since there are several and they have different features). The limitations you're most likely to run into are source control integration (and TFS client license), debugging limitations, limited refactorings, no unit testing support, and limited designer support.
For completeness sake, here's a list of features that are in Visual Studio 2008 Standard Edition but are in none of the express editions:

Add-Ins
Macros and Macros IDE
Visual Studio Add-in project template
VSPackages
Wizards
ATL/MFC Trace Tool
Create GUID
Dotfuscator Community Edition
Error Lookup
Source Control Integration
Spy++
Team Explorer Integration
Team Foundation Server Client Access License
Visual Studio 2008 Image Library
Add-Ins/Macro Security options
Visual Studio Settings
Class Designer
Encapsulate Field Refactoring
Extract Interface Refactoring
Promote Local Variable to Parameter Refactoring
Remove Parameters Refactoring
Reorder Parameters Refactoring
Debugging Dumps
JIT Debugging
Mini-dumps
Multithreaded/Multiprocess Debugging
NTSD Command Support
Step-Into Web Services Debugging
CAB Project Project Template
Merge Module Project Template
Publish Web Site Utility
Setup Project Template
Setup Wizard Project Template
Smart Device CAB Project Template
Web Setup Project Template
Windows Installer Deployment
64-bit Visual C++ Tools
Create XSD Schema from an XML Document
Reports Application Project Template
Visual Studio Report Designer
Visual Studio Report Wizard
Shared Add-in Project Template
ASP.NET AJAX Server Control Extender Project Template
ASP.NET AJAX Server Control Project Template
ASP.NET Reports Web Site project template
ASP.NET Server Control Project Template
ASP.NET Web Application Project Template
Generate Local Resources
WCF Service Host
WCF Service Library Project Template
WF Activity Designer
Custom Wizard Project Template
WF Empty Workflow Project Template
MFC ActiveX Control Project Template
MFC Application Project Template
MFC DLL Project Template
WF Sequential Workflow Console Application Project Template
WF Sequential Workflow Library Project Template
WF Sequential Workflow Service Library Project Template
WF State Machine Workflow Library Project Template
WF State Machine Workflow Designer
WF State Machine Workflow Service Library Project Template
WCF Syndication Service Library Project Template
Visual Studio Extensions for Windows Workflow Foundation Designer
Windows Forms Control Library Project Template
Windows Service Project Template
WF Workflow Activity Library Project Template
WPF Custom Control Library Project Template
WPF User Control Library Project Template
ASP.NET Server Control Item Template
COM Class Item Template
Configuration File Item Template
Frameset Item Template
Interface Item Template
CLR Installer Class Item Template
Local Database Cache Item Template
Module-Definition File Item Template
Nested Master Page Item Template
ATL Registration Script Item Template
MS Report Item Template
Report Wizard Item Template
.NET Resources File Item Template
Win32 Resource File Item Template
Static Discovery File (Web Services) Item Template
Transactional Component Item Template
Web Content Form Item Template
Windows Script Host Item Template
Windows Services Item Template
XML Schema Item Template
Answer: Here's comparison chart of editions
Edit: didn't realize this was for 2005, not 2008
Comment: That is a nice overview for VS2005, shame the VS2008 comparison isn't so useful.
Answer: Visual Studio 2008 Product Comparison
As far as I know there are no restrictions on its use, but I'm not a lawyer.
AviewAnew pointed out you can use Express Editions for commercial use: there are no licensing restrictions for applications built using Visual Studio Express Editions. See FAQ #7.
Comment: @Tobi It seems like the link you gave (http://msdn.microsoft.com/en-us/vstudio/products/cc149003.aspx) is not valid any more. Do you have a working one?
Comment: Can I use Express Editions for commercial use?
Yes, there are no licensing restrictions for applications built using Visual Studio Express Editions.
http://www.microsoft.com/express/support/faq/
Comment: @Piotr, a quick search turned up this download, seems it contains the comparison chart I originally linked to: http://www.microsoft.com/downloads/details.aspx?FamilyId=727BCFB0-B575-47AB-9FD8-4EE067BB3A37&displaylang=en
Answer: These are the most significant for me:

You cannot set breakpoints with a condition
Add-in support
Refactoring is very limited (rename, extract method)
Answer: MFC is the most important missing thing in my opinion.
Comment: I would have thought that was a bonus!
Answer: No add-ins allowed
Answer: Other people have posted huge lists, but as a practical matter, speaking as someone who does mostly systems programming, the features I miss most when using the express edition are

the thread-aware parts of the debugger,and
the ability to open files with the built-in binary viewer.

If I did MFC programming more often I would probably miss the dialog designer as well.
Answer: One that is missing (which is nice to have) is:

Source Control Integration
  enables two
  options: source control solution based
  on the Source Control Plug-in API
  (formerly known as the MSSCCI API), or
  a source control VSPackage

This is particularly important especially if you're working with systems like Perforce where you must check out files before changing with them, particularly changing project settings for all team members.
Comment: I think if I were expected to work with Perforce, I might investigate using local Mercurial repositories and the Perfarce extension to push/pull to the Perforce repos. That would also mean being able to use TortoiseHg in Windows Explorer rather than relying on a VS plug in for VCS.
Answer: This MSDN document should get you everything you need!
Comment: @Mitchel Sellers It seems like the link you gave (http://msdn.microsoft.com/en-us/vstudio/products/cc149003.aspx) is not valid any more. Do you have a working one?
Comment: Argh...darn MS and moving links.  I'll try to dig up a new one!
Answer: For Visual Studio 2008, the Express editions do not have the built-in testing features for one.
Answer: You can build MFC applications if you download the libraries in the Platform SDK. But there is no built in support for designing dialogs.
Answer: Add-ins are allowed in Visual Studio Express. The most notable one is straight from Microsoft: XNA Game Studio works as a Visual Studio Express add-in.
There's even a project type (maybe only available in the full Visual Studio) that lets you build your own Visual Studio Express add-ins!
Answer: Note that currently, you can't get F# in an Express edition, though I imagine that this is likely to change at some point in time.
There is a workaround - you install the Visual Studio Shell and F# CTP separately and they work together.
Answer: I had trouble with Visual Studio Express (C++) 2008 (with service pack 1) on Windows Vista, with debugging.  Any time I did anything such as (a) break the program, (b) set focus from the app back to the IDE, (c) resume execution, the program hung for about 30 seconds.  Task Manager showed "VSExpress.exe" consuming an entire CPU for the duration.   Vista showed "Not responding" in the IDE's title bar during this time.
This was driving me bonkers so I bought a commercial copy of Visual Studio Professional 2008 ($150 from SoftwareSurplus) and this solved the problem.
Answer: You can't create Windows services for one.
Comment: I've created Windows services using Express. It's a little more difficult than the paid-for editions because the Express IDE will not create all the code to install and run the services for you, but it is possible.


ICloud and Quality Password

Question: How many 'random' characters should my iCloud password be if it were going up against the BEST hackers and the best hacking software?
Comment: This is not a duplicate question because my question asks what is best for iCould. Password creation requirements may be different for each host, or other conditions may apply.
Comment: Then, the answer to your question is "maximum". The suggested duplicate is the best answer for the issues that your questions raises.
Answer: I think this question can't be answered by just typing a number. There are things to consider:

How are the passwords stored in the database? E.g. what hashing algorithm or encryption is used.
Does iCloud use salt? If so, is this salt static for each user or random?
How well are the support people trained in order to detect a social engineering attack? (as we've seen before at Apple: http://www.wired.com/2012/08/apple-amazon-mat-honan-hacking/all/)
How much data is available on social network sites about you? This because of the questions asked in order to get access to an account: http://www.washingtonpost.com/news/the-intersect/wp/2014/09/03/this-is-how-easy-it-is-to-hack-someones-icloud-with-their-security-questions/.

Having said that, I believe the iCould (I am not a user there) can be configured with two factor authentication (something you have and something you know) which you should consider enabling.
Having two factor authentication enabled and a password of 15+ characters can be considered safe. However it's also a matter of how much effort one wants to put in to hacking your account (e.g. whether you're a celebrity or not)
Hope this helps, as you can see there's more to it than just a number of random characters.

ICloud and Quality Password


Clearing System Storage & Ram

Question: Is there any other way to clear System Storage and Ram on my phone? I have a Samsung Galaxy Pocket. I can clear some Ram thru Task Manager, and all apps (that will allow it) have been moved to the sd card. Any music, photos or videos are on my External SD Card.
I dont run and widgets either.
Please help!
Comment: RAM is main memory, do you mean internal storage?
Comment: @MatthewRead I guess the OP really means RAM – taking the context (task manager). Tried to cover it all with my answer nevertheless :)
Answer: First, there's no need to "clear RAM" (see our ram tag-wiki for details).
Second, task-killers are rather to be avoided for all but very specific cases: they are useful when an app goes bonkers, but their purpose is not to clear/clean anything. For this topic, please see:

Is it advisable to run a task killer app on Android
Do task killers actually work?

Third, "clear System Storage" is certainly not what you have in mind literally (<code>/system</code> storage is mounted read-only, and basically is where "the OS" resides). Clearing storage is a different thing when it comes to the parts writeable: cache, apps you've installed (including their data), files you've downloaded (eBooks, music, videos). Now that's something which can be pretty useful. There are several apps available for Storage Analysis, helping you to find the "big chunks" to delete selectively. And there are even more apps helping you with System Cleanup directly.
Not to forget what you could do even without those helpers: Walk the list of the apps you've installed (in Settings › Apps), and uninstall those you no longer need. What's not there cannot use up precious storage, and cannot waste resources like CPU, RAM, or network bandwidth.

Clearing System Storage & Ram


CMake Error: The source directory ".../code/mongo-cxx-driver" does not appear to contain CMakeLists.txt

Question: I'm following the MongoDB C++ Driver Quickstart Guide: https://github.com/mongodb/mongo-cxx-driver/wiki/Quickstart-Guide-(New-Driver)
I'm in the mongo-cxx-driver directory and
when I run:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..

I get the following error:

CMake Error: The source directory "/Users/Waley/code/mongo-cxx-driver" does not appear to contain CMakeLists.txt."

Is this something I can fix?
Answer: When you are in mongo-cxx-driver you should enter the folder build and execute your CMake command from there. That's exactly what is stated in the webpage you are referring to.


Cash Transaction For Real Estate or Otherwise

Question: When a seller of property of significant value or even an expensive exotic car requires a "cash purchase", possibly amounting to millions, is that actual cash -  meaning buyers are hauling around suitcases of stacks of $100 bills, or is it just a euphemism for a bank/cashiers check? One of the reasons I ask this is because even a bank/cashier check is not really cash - it's near-cash - it still has to clear, which is 1-2 days depending on the time of day it's deposited, and if it's a genuine check at that.
Answer: It depends heavily on the context and on the actual seller. However, in common usage such as for real estate, the term cash is used in contrast to finance/credit.
The following quote and the parallel concepts in the article's title illustrate this (emphasis, mine):

But there's a lot to consider when contemplating purchasing a home outright versus financing it.
  - Buying a home: Cash versus mortgage

In Australia, bank cheques are commonly used to settle cash offers for real estate. Although legal tender is as its name says, it would be very unusual to find a real estate buyer ponying up with suitcases full of money.
Comment: In the United States, either a bank check brought to the closing or a wire transfer into the escrow account that cleared prior to the closing are common ways to perform a cash real estate transaction.
Answer: The phrase cash transaction is all about perspective. At least in the United Sates.
For a home seller, a cash transaction means that the buyer isn't getting a mortgage. That means that the timeline between signing the contract and the settlement date can be very quick. It might still take a week or two, but there is no fear that a lender will slowdown the process. On the actual day of settlement it doesn't matter to the seller if there is a mortgage or not. The money is being sent to payoff the old mortgage using a check or wire transfer. The seller will still need representation so that they can make sure the buyers check is still good. The buyer doesn't show up with a suitcase full of cash.
For the seller of a car a cash transaction is again one in which there is no lender involved. But in the case of an auto dealership they also view a transaction as a cash transaction if the buyer is using an outside lender. If the buyer has already obtained the loan from their bank, the dealer knows  that they will get all their money in the next few days, instead of it being spread over a few years. The transaction becomes so much easier. The buyer usually brings the cashiers check in a business day.
If a buyer showed up with a pile of actual money, then there is additional paperwork that needs to be filled out. The US government wants to know where all this cash came from.


Is it possible to split VirtualBox Hard Drive to multiple volumes?

Question: VirtualBox hard drive usually has one  or a few files when you create a drive. I think it is good because you manage only a few files. However, I have out of space of my drive. Is it possible to span over other volume like in VM player?
Comment: Useful for transferring files between windows and linux using a standard (FAT32) USB stick
Answer: Yes it is possible, though you need to use the VMDK disk format.
VBoxManage clonehd disk.vdi disk.vmdk --format VMDK --variant Split2G

This will create disk.vmdk (text file) along with a number of disk-sXXX.vmdk (data files). You should point your virtual machine to use the disk.vmdk file.
Answer: Just an idea, what if you used the command:

vboxmanage clonehd hd1.vdi hd2.vmdk --format VMDK --variant Split2G --type normal --remember
Comment: Nice one. But the options "--type normal --remember" aren't recognized.
Comment: According to https://forums.virtualbox.org/viewtopic.php?f=6&t=77767 , this works but you need to relink the newly created disk because it changed UUID. Not tested yet
Answer: VirtualBox supports .vmdk files since 2.1. So you can convert your .vdi to 2GB-parts .vmdk and open it in VirtualBox. I don't know however how about spanning the files into different disks.


Putting out on every hole in a bogey competition

Question: Do you have to putt out on every hole in a bogey competition even when you are over par on a hole ?
Answer: No, it is played on a hole-by-hole basis so once you have lost the hole you can pick up. The rules even encourage you to pick up when you are out of a hole.
From the R&A Rules 21.3b
Scoring in Par/Bogey
If the player's score is higher than the fixed score, or no score is returned, the player loses the hole.
A player who does not hole out under the Rules for any reason loses the hole.
To help pace of play, players are encouraged to stop playing a hole when their score exceeds the fixed score (as they have lost the hole).


Where can I find a good blog on Averroes

Question: I enjoy learning about the philosophy of Averroes. Averroes was a contemporary of Maimonides (Jewish philosopher), Musa ibn Maymun in Arabic. Both were rationalists and great thinkers. Both lived in Spain. I know much about Maimonides but I am ignorant about Averroes, other than he was a great rationalist. Where can I find a good, helpful English blog which deals with the topic of Averroes and his views?
Many thanks.
Comment: I'd say that this question is rather a bad fit on this site. Maybe the history of science SE or a philosophy site if available could be a better match. In Arabic I would know a website of a researcher who mainly analysed ibn Rushds work and could be regarded as a specialist.
Comment: https://medievalphilosophywithrhodi.wordpress.com/ may be a site
Answer: On this website (http://www.muslimphilosophy.com/ir/index.html) you can find all his books in English and Arabic. Books and articles and even movies. It is everything Ibn Rush related.
Generally speaking this website muslimphilosophy.com is a very good site for Islamic philosophy in general where you find other philosophers of the Islamic tradition like Sina, Ghazali and Ibn Taymiyah. And since you enjoy Maimonides you would probably enjoy this too: https://plato.stanford.edu/entries/maimonides-islamic/
May Allah increase both of our intellects and guide us on the right path.
Comment: Thank you for your answer and for sharing the links about Averroes. I will look at the essays. Thaks again!


Former boss refusing to pay me and is ignoring. Is there anyone i could turn to?

Question: Australia, Victoria. I worked there for 2 and a half weeks. On our interview he offered me to be there off books, so i could save as much money as possible and it didn't seem like the worst idea so i took it. We agreed on hourly rate of $17. After a week i asked for my pay and was informed that he pays his employees two weeks after they've started ( like you start on 1st of Jan so the pay for the first week you get at 14th Jan, very confusing) He said it had something to do with bank transfers and taxes but i was getting cash, that was the first red flag of wtf. Anyway fast forward - that whole thing was 2 months ago. When i left he owed me 2 weeks worth of pay and promised to get me that 2 weeks after my last workday. THAT was a month ago. I've texted with him back and forth, me saying exactly what i'm expecting and him mostly ignoring me. BUT he has texted once in full what he has paid me and what is still missing and promised to transfer the missing part the same day. It never came. So can i use those texts against him to get my damn money? And who should i contact? I tried to be reasonable but this is bullshit.
Comment: Lets get this straight - you agreed to cheat the state out of taxes, and now are upset that you yourself got cheated.  Who can you contact about this?  Not many people really, if you yourself don't want to get into trouble as well, because those taxes you agreed to cheat the state out of go toward protecting workers rights in the first place...
Comment: No contract, and not on the books. You are most likely out of luck.
Comment: I would suggest talking to your local community law center (a free service), and take it from there. They will be able to give you suggestions.
Comment: My partner ended up in a horrible situation concerning under the table work in NZ .I advised her to not allow the debt to rack up too much .I think such debts are uncollectable unless you are really prepared to standover.
Comment: Just be sure to save all the emails and text you got.
Comment: Please be mindful of the language you use here. VTC as a legal question.
Comment: @Magisch Not necessarily - the boss has far more to lose over a few dollars.
Comment: @TheMathemagician Unless he can prove he worked, no.
Answer: This will be messy to try and resolve. You were working under the table, which is basically a trust situation. You should have seen the writing on the wall when you didn't get paid the first week.
You have two pragmatic choices from my point of view in addition to Janes suggestion.
Firstly put it down to experience and take the loss.
Secondly, go in and confront the boss and demand your money, I had to do this once and I did it at his workplace and in front of his workers. It wasn't something I was happy doing, but it got me my money.
Unfortunately texts are easy to ignore. When someone texts they've already paid you, that muddies the waters even more in terms of you using the texts. Perhaps you can get him in trouble if that makes you happier. In my case I just wanted my money.
In future bear in mind that under the table jobs can be difficult to collect on, you're dealing with someone who is willing to bend the law and honesty in the first place. Most of my work like this has been fine (I did a lot of casual labour in my younger days). But it doesn't always work out so well and there's often a sort of standoff when it comes to paying even in a good situation.
Answer: Given you have no written contract, then it's your word against your boss's.  However, you should take it up with the Fair Work Australia Ombudsman if you feel you have been dealt with unfairly by your employer.
Note that your intention of "staying off the books" may be something that will get both you and your employer in trouble once this gets aired to the government and the ATO.
(Note I'm Australian)


Amazon Video download location

Question: Amazon Video now allows you to download certain titles from their library but you have to use their video player.  Does anyone know where those files get downloaded to on your phone?
Comment: Kevin, if you haven't found those files on your SD card (have you checked?), they most likely end up in the app's "private space" – which nobody but the app itself (and Mr. `root`) can access. They don't want you to copy them, they want you to use *their* products and nothing else.
Comment: Hi! Please read [How do I ask a good question?](http://android.stackexchange.com/help/how-to-ask) Did you thoroughly search/research for an answer before asking your question?  Tell us [what have you tried](http://whathaveyoutried.com/) so far and why it didn't meet your needs? This demonstrates that you've taken the time to try to help yourself and it saves us from suggesting non-working answers.
Answer: Actually the videos are stored in /data/data/com.amazon.avod.thirdpartyclient, but they are stored in small parts as a different file format so you cannot play it through regular means.
Answer: After searching the web I found the answer provided by Sonickyle27 which was the closest answer for my Android Moto Z phone. However I had approved the storing of my videos on my SD card, so I found the data stored in pieces using my file manager on the external storage (SD card): Android/data/com.amazon.avod.thirdpartyclient/files.
I use BETTER quality (medium), have 76 videos, 59 hours, 20.4GB in downloads. The file manager shows 76 folders with video and audio files that cannot be played outside the app.

Amazon Video download location


Need help on /kill command an usage of @e

Question: Hi everybody I need some help with minecraft.
I an a command : <code>/kill @e[type=!Player,ArmorStand]</code> and it didn't work
What I wanted : A command that kills every entity except ArmorStand and Players. Could someone help me?
Comment: It is... the solution there will work for you.
Answer: Target selectors cannot accept multiple arguments of the same type.
To get around this, you should first create a dummy scoreboard objective like this:
<code>/scoreboard objectives add Kill dummy
</code>
Then, in this order, run the following commands:
<code>/scoreboard players set @e Kill 1
/scoreboard players set @e[type=ArmorStand] Kill 0
/scoreboard players set @a Kill 0
</code>
Now every entity that you want to kill should have a Kill score of 1, and Players/ArmorStands a kill score of 0.
All you have to do next is kill all entities with a kill score of at least 1:
<code>/kill @e[score_Kill_min=1]
</code>


Android google maps button style

Question: I would like to place a button on top of my google map, which is pretty easy.  However I would like it to look like the buttons google uses (zoom buttons, locate me button).  Is there a way I can 'cheat' and find the styles they used for their buttons.  Or has anyone else created this style before?
Comment: do you mean the skin of the buttons?
Comment: yeah, I could not find that anywhere
Answer: If you disassemble Google Play Services apk by using apktool, and look into drawable* folders, you will find the resources for these buttons among other resources.
For example, this is the drawable of the upper zoom button:
res/drawable/maps_btn_zoom_up.xml, and this is the "empty" button: res/drawable/maps_btn_standalone.xml. Looking at them, it is a lot easier to match their style.
The apk will probably be named like com.google.android.gms-#.apk, where # is some number; you can snatch it from a device which has Google Play Services installed by using adb pull command, it doesn't even require rooting if you know the exact file name.
Update
Here is the archive with relevant resources for the empty standalone button, obtained by this way.
(sha256: 4b974a8c23bb8df54b9aa244489e8a7ab5d4d3e17d0c003f411bccbe8a75d622)
And some numbers:
Button height and width is 38dp
Shadow padding: top 1.5dp
bottom 2.5dp
side 2dp
The background image is NOT nine-patch, but it's pretty easy to create one if you need.
Comment: Did you pull these files already?  If so can you just show the styles here?
Comment: I think the button height and width is subjective
Comment: Any suggestions on creating the shadow padding?
Comment: @AntiEarth standard techniques apply.
Answer: I made this 9-patch image to use as background for the view that you want to be like a google maps button:

The color of the button content is #666666.
Here is an example of a custom view that looks like a google maps button using that background and that color for the text:
Comment: we have a winner!!
Answer: The button is a 70% semi-transparant white.
Or in HEX, #B3FFFFFF
Answer: I was looking for the same thing, and found this question:Change zoom controls in a MapView
It appears a button is 2 images, a normal state and a clicked state.
For your purposes, you'd need to style the button yourself / 'cheat' the system. You can get a good template from either the google play lib or the support library.
Comment: I know how to create styles, but it will take me days to match their style.  I want the xml.

Android google maps button style


Will the water heater be damaged if its turn off and on?

Question: Is it ok to turn off water heater when no one is home or using the water?
Comment: What type of heater -- gas, electric, other?
Answer: I'd advise against turning off and on the water tank daily. For the physical tank and parts, a hot water heater turns on and off frequently during it's operation and won't suffer any damage from the switching, with the possible exception of the controls themselves. The bigger concern is large temperature swings by leaving it off for long periods of time and then reheating the water.
Turning off a hot water heater and allowing it to cool to 32 to 42 °C (90 to 108 °F) can allow pathogens to grow. See this question and answer for more details about ideal water heater temperature settings.
Turning a cold tank on, if your system has a one way "check valve" preventing back flow of water into the municipal system, can result in a large pressure increase. That dramatic swing can overload the capabilities of a small expansion tank if you have one, and cause valves to fail in your home. The failing valves will be seen as dripping fixtures, running toilets, or a leaking TPR valve on the water tank itself.
For a vacation home where the tank is turned off for several months, I wouldn't have these concerns. The tank is typically allowed to cool well between the lower limit for pathogens, and the water lines often have air in them from being drained or are being run to purge the stale water, which allows for the expansion as the water heater turns back on.


How can I improve the specification table on the back page of this brochure design?

Question: I'm working on a brochure for this Garmin device and would appreciate some feedback! In particular, how I could improve the Specification table on the back page and any design tweaks you think are necessary. Thanks for your help :)
Comment: Hello and welcome to GD.SE! We typically require of critique questions to be fairly specific so I edited your title accordingly. Is there something about your table that you feel is off and needs improvement?
Comment: So... so.. so much could be done. Stop looking at it as a "table" but rather 10 item headers and minor subtext... so display 10 things on page.. do that... forget the "table" structure completely. -- 2 rows of 5 items.. 5 rows of 2 items... 3 rows of 3 items then a callout item.... so .. so.. so much can be done it's impossible to answer. You've merely locked yourself into seeing it as a table structure....
Comment: For one thing, top-align the text in the cells. And _use the correct multiplication character_. The letter x does not mean 'by' – you want × for that.
Comment: Hi. Welcome to GDSE.  What do you think is wrong with the table, or why do you think it needs to be improved?
Answer: This question is a bit vague, but I'll give it a go!
Generally I think all the elements are too evenly spaced out. You can create a more harmonious layout by moving similar elements closer and create more space between groups of objects.
Here is a quick manipulation of your layout made in Photoshop. Don't pay too much attention to the details.

Front

The margins seem too narrow, I made them wider.
The lines between the list items are not needed to differentiate between them. I removed them.
The list items are too far away from each other to seem like a group. I moved them closer.
It's a problem that the background image has so many details right behind the product. Almost looks like small antennas sticking out. I've evened out the background and move the product up a bit. It's a bit empty so it needs more work, but I think it's better to be able to see the product without clutter. Could be done in other ways.

Back

The margins seem too narrow, I made them wider.
The header haven't got enough space around it. I moved it down and increased the space to the table below.
The rows with multiple lines look messy. I top-aligned the text in the cells.
There is too much space between the table rows. It makes the table fall apart. I decreased the space between rows.


Can you have multiple accounts on one device?

Question: I am considering buying Minecraft Pocket Edition for my two kids.  They share an iPad.  Does MPE have a way to log in so they can each play separately on the same device?
Answer: No. MCPE has only one account, you can have multiple worlds on it though.
Answer: If they share the same iPad, the worlds will be place together but you can have many different worlds with different names so your children can play on their own world. Consider buying another device if you want them the play with each other.


What's the difference between DBA and DA?

Question: In categorization of users I have seen two different categorizations:
First one:

End user
DBA
DBP

and Second one:

End user
DBA
DA

What's the difference between DA and DBA ?
Comment: DBP? Data base professional?
Comment: DA = Data Analyst?
Comment: I've never heard about DA?
Comment: @ShawnMelton: could be Data Architect? Maybe :-). PS: user16948 - whatever you've been told.. DBAs rule :p!
Comment: DA = Data Administrator
Comment: @gbn: DBP = Database Programmer
Answer: According to this and that, a DA is a Data Administrator.  The DA is a buisness oriented individual more involved in requirements gathering, analysis, and design than the DBA.  They establish the flow of data around the organization and between databases and other systems.  Here is a section from the second site:

Database Administration
Any reasonably sized organization that relies on a database for its business
  processes will probably have a Database Administrator or DBA.
The DBA is responsible for:

Installing and configuring the DBMS
Assisting in the implementation of information systems
Monitoring the performance of the database and tuning the DBMS for optimal performance
      Maintaining documentation including recording all changes to the database and DBMS.
Ensuring data integrity is maintained and appropriate backups are made.

Thus a DBA is mainly concerned with the day to day operational aspects of database systems.
Data Administration
Many organizations, in addition to DBAs, will also have a Data Administrator.
  DAs are concerned with the data needs and data flows throughout the entire organization.
  Thus DAs are responsible for:

Specifying data standards across databases
Establishing policies: data usage, security and authorization, data flows into and out of the organization
Assisting the application development process by identifying data resources in the organization
Arbitrating the sharing of data across departments
Increasing the return on an organization's data investment
Comment: Looks like you're defining Data Administrator a lot better in your answer than in mine. +1 !!! BTW I liked the this and that links you supplied.
Answer: My previous employer had MySQL Administrators and Data Administrators (DA).
While a MySQL Administrator was just another term for an operational DBA whose specialty was MySQL and performed the grunt work of making sure MySQL was up and running and just cared about data throughput, the DA was responsible for checking the cohesiveness and integrity of datasets from a logical standpoint.
For all intents and purposes, the terms Data Administrator and Data Analyst could be used interchanegably as the DA. Historically, a Data Analyst may have specific duties in terms of laying out ER Diagrams, Data Flow Charts, and things like these. The term Data Administrator may be somewhat newer and thus less defined.
The role of the DA differentiates itself from DBAs, who may be playing the role of both operational DBA and DA.
Answer: Data Administrator:-
                    A person who logically design , making planes and policies on data.it is also defined the metadata.
DBA:-
        A person who is responsible of entire data after making the database.it manages the data to  avoid the data loss.


Lipschitz map of the ellipse

Question: Is there a L-Lipschitz homeomorphism of the Elipse $x^2/4+y^2=1$ onto the unit circle $x^2+y^2=1$ such that $L<1$?
Comment: Of course, because the ellipse in question has length greater than that of the circle, so there is a Riemannian homothety (with $L < 1$).
Comment: The OP must want it to be Lipschitz with respect to the metric
induced from the Euclidean plane, not the intrinsic Riemannian
metric on the ellipse and circle.  It still feels like the answer
should still be yes but it's not as immediate.
Comment: The metric from the Euclidean plane is assumed and Mixon has the answer.
Answer: Assuming you mean Lipschitz with respect to the plane's Euclidean metric, as suggested by Noam D. Elkies, then no such homeomorphism exists.
The first thing to worry about is where $(0,\pm1)$ are mapped.  Note that they have distance $2$, so a mapping $f$ with $L<1$ will not send these to opposite points on the unit circle.  Put $A=f(0,1)$ and $B=f(0,-1)$.  Then $A$ and $B$ lie in a common semicircle.
Next, we consider $A'$ and $B'$, the points on the unit circle which are opposite $A$ and $B$, respectively.  Specifically, parameterize the portion of the circle from $A$ to $B'$ as $C(t)$ and from $A'$ to $B$ as $C'(t)$ such that $C(t)$ and $C'(t)$ are opposite points on the circle for every $t$.  Then for each $t$, you need $\|f^{-1}(C(t))-f^{-1}(C'(t))\|>2$.  Note that by the homeomorphism, $f^{-1}(A')$ and $f^{-1}(B')$ lie on the same side of the $y$-axis.  Then by the intermediate value theorem, there is a $t$ such that $f^{-1}(C(t))$ and $f^{-1}(C'(t))$ have the same $x$-coordinate.  But that implies $\|f^{-1}(C(t))-f^{-1}(C'(t))\|\leq2$.

Lipschitz map of the ellipse


The number of zero divisors

Question: I'm interested whether there are (i'm sure there are!) some facts about how many zero-divisors might be in rings with certain properties.
For example is there any connection between the cardinality of the ring and the cardinality of the set of its zero divisors? What if it's unitary ring? if it's commutative? if it's boolean?
Especially i'd like to answer the following questions and will be grateful for any help:
1) May the infinite ring have only finite number of zero divisors? If yes, than which additional conditions on ring do we need?
1*) May the infinite non-commutative ring have only finite number of left zero divisors?
2) May there be some left zero divisors and none right zero divisor?
2*) May the ring has finitely many left zero divisors and infinite amount of right zero divisors?
3) Suppose we know that there are $1 \leq n < \infty$ zero divisors. Is there any formula for the number of all finite rings which have exactly $n$ zero divisors? Or at least for the number of non-isomorphic such rings? May be there is some upper bound?
3*) The same question for left (right) zero divisors and the number of finite non-commutative rings
Thanks in advance.
P.S. I use the terminology under which ring may have no unity.
Comment: Here is a link that may be helpful http://mathoverflow.net/questions/31460/can-an-infinite-commutative-ring-have-a-finite-but-nonzero-number-of-non-nilpot
Comment: If there is a left zero divisor in a ring, there is a right zero divisor too, for obvious reasons!
Comment: Oh, i'm ashamed :(
Answer: Here is one connection: if $R$ is a commutative ring with unity with $k$ zero divisors, $2\leq k < \infty$, then $R$ is a finite ring and $|R|\leq k^2$. This is a result of Ganesan, and further details can be found in his paper and those that cite it:
Ganesan, N. Properties of rings with a finite number of zero divisors. Math. Ann. 157 1964, pp. 215-218.

The number of zero divisors


Language-agnostic linguistics questions

Question: Is EL&U the right place to ask linguistic questions that do not pertain to any specific language? E.g. questions on grammar that is shared by most every language.
Answer: According to the FAQ, "Languages other than English (including translation)" are "out of scope for this site".
But wait, don't click away, click here! And if you like what you see, then please do click on "Commit!"
Thanks a bunch.
Comment: I would actually migrate that question to Linguistics if it were up and running... I'll bring it to our very own linguists' attention and see what they say. Thanks for the link.
Comment: @RegDwight: I did read the FAQ before posting, and this question was to clarify that point. There's a difference between a question on another language and a question on languages in general. For instance, [this question](http://english.stackexchange.com/questions/12046/are-word-classes-universal) does not regard English.
Comment: @Tim: The question you linked should have been closed, and it is closed now. There have been a couple of linguistic-theory-ish questions like [this one](http://english.stackexchange.com/questions/7594/english-questions-and-negation-with-do-in-syntax); it focuses on English, but the crux of the question is essentially pure linguistics so I'm still really unsure if it belongs in EL&U. The only reason it can remain in limbo is because such borderline questions have been pretty rare.
Comment: @Kosmonaut, @RegDwight: Thanks, I'll wait for the Linguistics proposal then.
Comment: This answer doesn't help me determine which questions to ask. I don't care about other languages; I want to know the answers for English. If I ask a question that is relevant to the English language, why should it be closed because it applies to _more_ than the English language? As in, if I ask "how does this work?" I don't feel that it is appropriate to close it as off-topic because it works the same in more than one language.
Comment: @MrHen: I catch your drift, but do you have actual *examples* of this happening? It's not like anybody's going around close-voting questions about English words on the sole ground of other languages having words, too. And once Linguistics goes live, the problem will pretty much solve itself. Read Kosmonaut's comment again. It's not about killing a question or two with fire, it's about finding them a better home. It's about redirecting questions to the most appropriate audience so as to get them better answers.
Answer: If the question pertains equally to English and any other language, but if it can be answered by referring mainly to English, I'd say it is fine. The question should also invite a response that is mainly about English; if it does not, it is borderline. For a good question of this sort I am thinking of something like this:

In many languages, the line between
  different kinds of modality, such as
  obligation and probability, tends to
  shift: modal verbs change in meaning
  over time, and new ones are born. Is
  there any theory that explains why
  this happens? I believe that English
  "can" is used to grant permission now
  more often than it used to be.

A good answer would use mainly English examples to elucidate the general phenomenon. If we cannot use universal patterns and comparisons with other languages, how can we hope to deal with English efficiently? We should only banish "interdisciplinary" knowledge if it is fully off topic. Of course this question could go the wrong way if the answers are not about English at all; but I feel that this is a risk we must accept.
Comment: This can be a slippery slope. It's simpler, and possibly more fair, to require questions to be about English specifically, not overarching patterns with English examples.
Comment: @Martha: Hmm I suppose it isn't the clearest of criteria. But couldn't we use our own discretion ad hoc?

Language-agnostic linguistics questions


How to insert a logo in the header?

Question: I am pretty new in WordPress world (I came from Joomla)
I am finding some difficulties to insert a logo into this WordPress test site: http://onofri.org/example/
I want put my logo in the header of the website, instead the "EXAMPLE" text.
Looking into the WordPress configuration panel I am not finding where I can upload the logo and automatically put it instead the "EXAMPLE" text in the header (I don't know if this is a standard WordPress function as in Joomla or if it is a feature that can be made available by some specific themes or if I have to put it directly into the code)
However I am not finding it even in my theme settings.
What have I to do to put my logo? Have I to insert it directly into my HTML code?
Answer: Try modifying the header section a bit to comply with the standards. Here is what your code right now:

Here is how you can modify the things:

    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
       <img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="Logo" width="HERE" height="HERE" />

There are only 3 steps now:

Instead of using the theme's default header image settings, you can edit your theme's header.php with the code given above.
Instead of inserting image from the Add New Media, you can upload image via cPanel (Control Panel of your web host) into the theme folder's sub-folder named 'images'.
And instead of making a huge image with background for your logo, try making a simple background-less logo in Photoshop (or any graphics software) - in case of Photoshop, just do it: after placing the logo image in a layer, just delete the background layer and then save the image for web (File > Save for web... [Ctrl + Alt + Shift + S]) and choose the format PNG-24 for a good result. Then save it as logo.png and place it to the '/wp-content/themes/simplemarket/images/' folder.

Hope you get the rest. If any question, please feel free to comment here under.
Answer: If there is a "logo" functionality, it will be part of the theme. Perhaps a theme option or part of the theme customization system.
I typically use a Custom Header to do this for commercial sites, though a custom header is not specifically for a logo. It is a generic "header image" function.
In short, this depends on the theme. If it is a theme you are creating, you can edit the theme to add it. See the Codex articles already referenced.
Answer: To change the header image go to the admin panel of your wordpress.
In the appearance menu click on header and there you will find the option to upload your header image and Text to appear in your header.
If it's not showing then you have to edit your header file and insert the following code in your header if it does not exist already.
   <?php
    $header_image = get_header_image();
    if (!empty($header_image)): ?>
        <a href="<?php echo esc_url(home_url('/')); ?>">
            <img src="<?php echo esc_url($header_image); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />

    <?php endif; ?>

How to insert a logo in the header?


Why should the destructor of base classes be virtual?

Question: in C++: Why should the destructor of base classes be virtual?
Answer: The better question is when and why. Your question indicates that you think all base classes should have virtual destructors, which is not quite true.
It would make it impossible to apply the empty base class optimization, and could multiply the size of classes up to 16 times than what it would be without virtual on common platforms.
A virtual destructor is needed when you delete an object whose dynamic type is DerivedClass by a pointer that has type BaseClass*. The virtual makes the compiler associate information in the object making it able to execute the derived class destructor. Missing the virtual in such case causes undefined behavior.
If you don't need this, and your class is only used as a base class, it's best to make the destructor protected, thus preventing that users accidentally delete in the described way.
Comment: For another excellent description, see [*Virtuality*](http://www.gotw.ca/publications/mill18.htm), specifically, "Guideline #4: A base class destructor should be either public and virtual, or protected and nonvirtual."
Answer: You want them to be virtual so that all subclass destructors are automatically called when the object is destroyed, even if it is destroyed through a pointer to the base class. In the following code:
class base {
public:
  virtual ~base() { }
};

class derived : public base {
public:
  ~derived() { }  // Inherits the virtual designation
};

int main(void)
{
  base *b = new derived;

  delete b;
}

The derived destructor will only be called if the base destructor is virtual.
As Magnus indicates, you don't have to do this if you aren't taking advantage of polymorphism. However, I try to develop the habit of declaring all my destructors virtual. It protects me against the case where I should have declared them virtual but forget to do so. As Johannes indicates, this habit can impose a small space and performance penalty when the virtual designation is not needed.
Answer: They dont have to be virtual unless you are using polymorphism. If you do use polymorphism they need to be virtual so that the destructors of inherited classes are guaranteed to be called, so inherited classes can do their clean up.
Answer: For situations like this:
class A
{
    virtual ~A();
};

class B:A
{
    ~B();
};

A *a = new B(); //legal, since it's a downcast
delete a; //Unless the destructor is virtual, ~A() is called here instead of ~B().

Answer: It should be virtual to ensure that the destructor of the inherited classes are the ones actually getting called at runtime instead of the base class destructor being called.


Is there a way to add metadata to a docbook article at the the end of the article

Question: I'm rendering a docbook article from the top down and if I encounter certain errors I need to put in a flag into the metadata. What's the best tag I can add at the end to represent this flag? I am writing articleinfo as the first tag in the article so I can't use that. Is there a best practice for this?
Answer: I suggest you have a some little misunderstandings about DocBook.
Note: I assume you use DocBook 4.5 because of articleinfo mentioned. This element is deprecated in DocBook 5.x in favor of info element that is common metadata root element for all top level structure types (books, articles, etc.).
Here are some points you need to put your attention on.
Type or errors

There are several types of errors you can faced (assume you have well-formed xml files - this can be an another fundamental type of error):

Structure errors - i.e. validating again DocBook schema.
Layout errors - i.e. you don't like the way your article is presented on a print matter.
Logical-based errors concerning the text matter - i.e. you don't want to have long sentences, etc.

Depending on the error type there are different ways for fixing:

Structure errors - you can't put a sign of this type of error WITHIN a destination DocBook file, because the structure error prevents destination DocBook to be processed and/or generated.
Layout errors - this is fully depend on you final destination (print, html or just xml) so the answer is - it depends
Logical-based errors - here you are fully qualified to do what you want and to put any information you want within your DocBook file (see Usecase 1 below).

DocBook as a document vocabulary
DocBook is a XML-based vocabulary so you can make any XML -> XML processing using xslt stylesheets other than DocBook XSLT Stylesheets (and its customizations).
Usecase 1: you want to check if your article contains some element (i.e. guimenu). If yes, you want to put a sign within your articleinfo element. You write your own xsl stylesheet to produce final DocBook file with a sign within depend on your conditions.This stylesheet DOESN'T have to be any connection with a a default DocBook XSL Stylesheets.
Comment: Yeah I'm checking for an error within the text that's being put into a docbook. However the program is looking at the text and converting it into docbook in a top down way as it parses the text. I want to prefer keeping articleinfo/info as the first tag so if the parser hits a text error it can add a flag to the end of the document and then xsl picks up that flag and adds a watermark to the first page (or the headers).
Comment: I suggest you need to provide a MCVE https://stackoverflow.com/help/mcve to look at.


missing dispform.aspx and editform.aspx on list

Question: I am getting a 404 webpage not found error when I try to get to a list in sharepoint. When I look in Sharepoint designer I notice that the dispform and editform.aspx forms are missing. Is there a way to restore these? When I try to add a new one I get an error message that the form already exists.
Answer: Did you try deleting them before adding the replacement pages? If not try that. If you can't find them in SharePoint Designer open your page in SharePoint Manager 2010 and try to delete them in there.
Something else you could try is deleting the List and creating a new one. If you can't just delete it because of its content create a ListTemplate (that includes the list's content) from that list before you delete it and restore it afterwards from your template.
Answer: Have you tried looking for them via "All Files" (look in the Navigation pane under Site Objects: All Files -> Lists? If you see them there then it's possible they were customized and the customizations somehow broke SP's ability to recognize them as List Item forms.


Cluster Analysis for mixed data and using a large sample

Question: I wanna perform Cluster Analysis and I have Mixed data (a couple of dummy variables). I've found some information about Gower's distance, but when I tried to use it, R broke down (i guess) because I have a large sample size (almost 1,000,000). Any advice?
Answer: Begin with a subset first. To learn what works and what doesn't.
Don't immediately try to scale.
Also you don't need to use all your data. If you find patterns on a subset, these supposedly are still patterns on the entire data. The purpose of clustering is not to label each point a, b, c. But rather to find actionable patterns and regularities.


updating a log file online and perform some actions

Question: Lets say we have a log file (preferably a txt file) available in the web server. How can we put it online and update it constantly like for every minute. Also, how can we create a script in which it will fetch the log file every minute, analyze its contents and perform some tasks.
Comment: @Death i have updated the question(made it simple, concise and neat) and provided an answer. kindly check. thank you
Comment: this question has been answered, and you marked it as answered! what's the problem?
Answer: It should be enough to publish it in a web server folder.
By this i mean It is possible to write this file and publish it to either an ftp connection or on the web server itself if you have access to this.
I'll be happy to provide more details if you tell me which way you prefer to go :)
Answer: The best approach here is to create/write a bash file, cron job or script. The contents will be following the logic : copy the file towards the public web folder every minute.
for client analyzing the log file. one way is to also create a cron job with the following logic: fetch the new log file, then perform analysis (for example, if it found the word "stopped", then some action will be taken like restarting the process/application) and some action. repeat this for every minute


Why do atoms on the periodic table have the number of valence electrons that they do?

Question: I'm studying year 11 and am learning about valence electrons and how these electrons drive intermolecular bonds.
What I have not been able to find an explanation to is why all the elements on the periodic table have the number of valence electrons that they do.
To me, it seems intuitive that if the halides are so eager to gain an electron, why would their natural state not be to have the 8th electron in their shell?
Comment: Well, but their natural state ***is*** to have the 8th electron (mostly). You might be talking about the elemental state, but elemental halogens are not commonly found in nature.
Comment: I see, I was confusing the elemental and natural states. If their natural state is to mostly have the 8 valence electrons, why do we mention the elemental state at all? Why is this what is displayed on the periodic table?
If the elements natural state is to be stable as such, how do chemical equations work? Should we not assume that the atoms of these elements in the world would then be stable by default and therefor less reactive?
Comment: We mention elemental state because it does exist, albeit sometimes only in the lab. This is what characterizes an element by itself, when not in a compound with other elements; that's why it is displayed on the periodic table for that element. The chemical equations work because they are true. The chemical reactions occur because... well, look around you, and you'll see a plenty of examples. There are no such things as "more reactive" and "less reactive". Reactive towards what, that is the question?
Answer: Atoms have protons (and neutrons) in the nucleus that define the element. For example, Fluorine always nine protons. The number of electrons must balance the number of protons in the atomic state. If fluorine had ten electrons, i.e. a full inner and outer shell, it would be a negative ion with net charge -1, so the electrostatic charge would repel the last electron.
It is only with the help of other atoms nearby that charges can be (almost) balanced. In $\ce{LiF}$, the fairly positively charged $\ce{Li+}$ ion attracts the comparatively negatively charged $\ce{F-}$ ion, so there is no net unbalance in a crystal of $\ce{LiF}$, though in each pair, the valence electron spends most time in the outer shell of fluorine.


Why is there dog tax but no cat tax in Germany?

Question: I believe the most two popular pets one can have are either a dog or a cat. In Germany, one must pay for tax when owning a dog (Hundesteuer). However a similar tax doesn't exist for cats, why?
Comment: [Relevant article about the cat tax debate.](https://www.thelocal.de/20170126/should-germans-have-to-pay-tax-on-pet-cats)
Comment: Because Germany is a cat person, not a dog person.
Comment: @LoverofStructure, what?? If there _is_ a dog-person-country, it's Germany. And that matches the premise: Germany is happy to tax its population, but doesn't consider cats _persons_ :)
Comment: You can [get a licence for a pet cat](https://youtu.be/2maz36_q6Fk?t=66) in the UK, and we do have cat detector vans...
Comment: That's wild @KenY-N
Answer: The history of dog taxes in Germany is mixed and it predates German unification. Some principalities had financial motives, others wanted to discourage dog ownership (e.g. to curb rabies) without an outright ban.
There is a general perception that dogs are more messy than cats. While any owner of a garden can attest to the cat problems, even more people know the experience of stepping into dog excrement on the sidewalk or being accosted by a dog on a too-long leash. This has gotten better with recent regulations, which require dog walkers to bag and dispose of excrement, but that does not remove all traces. And the perception lingers on.
The discouragement factor has resurfaced, too, with higher taxes in some states on breeds deemed dangerous. Again, a complete ban would be politically difficult, so dog owners are steered to less aggressive breeds.
Comment: Cats hide their waste, dogs are in your face about it.  Of course people encounter more dog waste.  Also, dogs tend to be bigger and thus produce more waste.
Comment: @LorenPechtel, cats hide their waste in other peoples' gardens. Hence my initial remark in the second paragraph.
Answer: I am not aware specific situation in Germany.
In general I think it's simply because domestic dogs encroach on public space more than domestic cats. I've never noticed cat feces on the street or people walking cats very often. There are sometimes even designated areas for dogs in parks or poop bags by the trash cans, so it's natural that their ownership is taxed more when it costs us all something to build this dog infrastructure.
In the Czech Republic, the situation is such that individual municipalities can set a yearly dog fee. So that in big cities such as Prague or Brno, owning a dog is usually more expensive than in smaller municipalities. There is no cat fee as well as in Germany.
Answer: It seems to be a mix of history and practicalities.
German Wikipedia informs us that dog taxes were introduced some 200 years ago to discourage dog keeping, either to try to contain the spread of rabies, or to make attacks on humans less likely (also people who could afford taxes could afford to pay damages). Friedrich Wilhelm III. introduced a luxury tax on pet dogs, under the assumption that somebody who could afford to feed a useless pet could also afford to feed the kings table (working dogs were exempt from taxes).
Not all of this even applies to cats - cats feed themselves, and they do not maim or kill people (or if they do, they do it discreetly, and do not leave witnesses).
Cats do spread rabies, but as far as I can tell the solution for cats was not to tax them, but to kill them. I did not find an official law to that effect, but the fact that in 1927 Wilhelm Speyer could write a very successful young adult novel ("Der Kampf der Tertia") about students opposing a state ordered cat extinction event suggests that nobody found the premise particularly unusual (it was even adapted into a 1928 silent movie).
While dog taxes go into the large bucket that finances public works, they do not directly cover any costs caused by dogs. That is just not how taxes work, at least in Germany - determining how money is spend is the prerogative of the (local, in the case) legislature which creates yearly budgets. Setting a purpose for a tax would infringe on their rights, as well as create unwanted side effects (if government want to cover actual costs it has to levy a fee instead of creating a tax, which must not exceed the actual cost being covered. That in turn might set unwanted examples, e.g. if car taxes had to cover the cost of traffic nobody would be able to afford a car anymore). Dog taxes are what is called an "Aufwandssteuer", i.e. if you have enough disposable income to pay for unnecessary things, the government feels entitled to extract some of that (the general idea is that your good income is made possible because of the public infrastructure that is paid for by taxes, although people have been known for having more cynical views).
Instead, taxes are meant to encourage or discourage specific behaviour. That is the reason that there is actually a lobby to introduce cat taxes. For example hunters, at least the ones I know, hate cats with a passion - if you have a hunting lease in Germany, you need to ensure a certain population of live stock, which is difficult and expensive if cats go through the poultry. Hunters kill thousand of cats yearly, but that does not even begin to make a dent into their  general population. Also conservationists would like to see less cats for vaguely similar reasons. But that is where the practicalities start.
For one, it is easier to raise an existing tax than introducing a new one.
Second, there are basically no stray dogs in Germany; locating the responsible tax subject for a dog is mostly a matter of looking at the opposite end of a leash. Cats however are incurably given to rove, which apart from all other problems provides cat owners with plausible deniability.
So in the end, cats are not taxed in Germany for the same reason guns are barely controlled in the USA - historically it is not something that was being done, a lot of people oppose it, and by now we simply seem to have missed the right point in time to do it. That does not mean it is impossible in the future, and some people are actively lobbying for it, it just means that for most politicians this is not the hill they want to die on.
Comment: In my municipality, working dogs still cost lower tax. And that does not only include certified service dogs for blind people, police, rescue, ... or certified hunting dogs but also dogs (without special qualification) kept as watch dog on premises that are sufficiently far away from the next neighbour.
Answer: Why is there no guinea pig tax? Canary tax? Two reasons:

Enforcement. Dogs need frequent walks outdoors, if only to relieve themselves, they are day active, and are big and loud enough to be noticed. Therefore checks are easy, and because they typically need to be accompanied, their owner or somebody with ties to them is readily available. None of that is the case for cats.
The need to regulate dogs, and the expenses they cause as opposed to other pets, become apparent when you compare the experience of stepping in their respective feces.