How to stop turning off sequence when power manager says that battery is too low and want to power down?

Question: According to this thread I can disable this thing altogether but this battery-critical-power-down not always happens. Is there a way or terminal command that can stop the power manager shutting down my computer when that infamous message box pops up?
Answer:
Insert nothing here and it should just crash with undetermined results if it actually ends up with an empty battery. Run gconf-editor from command line and go to apps > gnome-power-management > actions.
Command line option:
gconftool-2 --set --type string /apps/gnome-power-manager/actions/critical_battery       nothing

Answer: As far as i know, the computer can be set to either Shutdown, or Hibernate (free space/swap space providing).
If Hibernation is something you consider an alternative, then you should be able to change it in the Power Manager.
If not, then the system is trying to protect it's hard disks/memory from corruption, and it would be very difficult to disable, and is something i can't help with.
Comment: Are you referring to GNOME 3?
Comment: Not specifically, Unity and Gnome 2 offer the same functionality.


What's the difference between char * and const_cast(string.c_str())

Question: I use an external library to deal with udp (OSC) communication between 2 apps.
To format the messages that will be sent, the library is expecting a char* but I get a string from the UI that I have to convert.
While I was dealing with other parts of my code the udp part was hard coded like that :
    char* endofMess = "from setEndMess";

and was working fine. I thought it would be easy to get it working with my strings and wrote :
    std::string s = "from setEndMess";
    char* endofMess = const_cast<char*>(s.c_str());

but unlike for the first example where I was receiving the message correctly formatted, I now receive only gibberish characters. Does somebody know where it can come from?
Thanks!
Matthieu
EDIT : the code I use :
The method to send the message each time OSCVal will change :
void osc500::testOSC(int identifier, float OSCval)
{
UdpTransmitSocket transmitSocket( IpEndpointName( destIP, port ) );
 char buffer[1024];
 osc::OutboundPacketStream p( buffer, 1024 );

p << osc::BeginBundleImmediate
    << osc::BeginMessage( endofMess )
       << OSCval << osc::EndMessage
<< osc::EndBundle;

transmitSocket.Send( p.Data(), p.Size() );
}

And if I have to change the OSC pattern I call this one :
void osc500::setEndMess(String endpattern){
// endofMess = "from setEndMess"; //OK works fine each time it's called

//1st try :
//std::string s = "from setEndMess";
//endofMess = const_cast<char*>(s.c_str()); //gibberish

//2nd try :
//std::string s = "from setEndMess";
//endofMess = &s[0]; //gibberish

//3rd & 4th tries :
//char s[4] = {'t','e','s','t'};
//char s[5] = {'t','e','s','t','\0'};
//endofMess = s; //gibberish
}

Comment: It's not clear whether you're trying to save things to that `char*` or if you're passing that to a network function for it to be sent on the wire.
Comment: It's to change a variable in a function that will say how the message is formatted ex : to change messages from "/firstOSCpattern/ x" to "/secondOSCpattern/ x"
Comment: Add more information to your question by editing it (there's a link for that right under the tags). Don't past code in comments, it's impossible to format.
Comment: @Mat, I just figured it out! :) The problem was what Yakk pointed! Thanks a lot to every one of you, I really appreciated your help, I was kind of desperate!
Answer: c_str() is for read-only access of std::string.
If you want to write to a string through pointers, then use either...

an array (or vector) of char instead of std::string
char* buf = &str[0]; - point directly to the first character of a string

Trick (2) is guaranteed to work under C++11; in practice it works in C++03 too but that relies on compiler implementation of std::string having contignuos storage.
(And whatever you do, keep an eye on the buffer length.)
Answer: I suspect the char* is not written to, it is only non const because it is a legacy API.  If so, your problem is probably that the std::string has fallen out of scope or been modified between the point where you call c_str and where it is used in the guts of the API.
Answer: If you want to modify the std::string content, I think you should use &s[0] (making sure that the string is big enough).
std::string s = "abcdef...";
char* ptr = &s[0];

e.g. (tested with MSVC10):
#include <iostream>
#include <ostream>
#include <string>

using namespace std;

void f(char* ptr, size_t count)
{
    for (size_t i = 0; i < count; i++)
        ptr[i] = 'x';
}

int main()
{
    string s = "abcdef";
    cout << s << endl;

    f(&s[0], 3);
    cout << s << endl;
}

Output:
abcdef
xxxdef


Find (x, y) coordinate on circle intersecting rectangle with width x at an angle?

Question: Given the following:

What equation could calculate the <code>(x, y)</code> coordinates of the blue points of intersection between the circle and the yellow rectangle?
Answer: Expressing the circle using polar variables $\theta$ and $r$ (where $r$ is constant), we'll have
$$
\begin{align}
x&=r+r\cos \theta\\
y&=-r+r\sin \theta
\end{align}
$$
If you draw a hypothetical line from the circle's center to one of the intersection points, you'll see the angle between this line and the $45^\circ$ line is $$\delta=\sin^{-1}\left(\frac{w}{2r}\right)$$ where $w$ is the width of the rectangle.
Thus, the $\theta$ corresponding to the intersection points will be
$$
\begin{align}
\theta&=-\frac{\pi}4\pm\delta\\
&=-\frac{\pi}4\pm\sin^{-1}\left(\frac{w}{2r}\right)
\end{align}
$$
You can now replace the $\theta$ in the first two equations to get $x$ and $y$ coordinates.
Answer: Note that the equation of the circle is $(x-r)^2+(y+r)^2=r^2$ and the equation of the sides of the rectangle(using $x_0$ for the breadth) is $x+y\pm\frac{x_0\sqrt2}{2}=0$, which comes from the fact that sides have slope of $-1$ and perpendicular distance of $x_0/2$ from the origin. You will get 4 intersection points choose accordingly.
Answer: Imagine drawing a line segment between those two blue dots. Its length will be $x$.
Then imagine drawing radii from the centre of the circle to the two dots. You will have created an isosceles triangle with sides $r$, $r$ and $x$. This isosceles triangle is divided into two right-angled triangles. The hypotenuse is $r$, let the angle at the centre be $\theta$ and the opposite side is $\frac x2$.
That means that $\sin \theta = \frac x {2r} \Rightarrow \theta = \sin^{-1}\left( \frac x {2r} \right)$.
Using @Babak's notation:
$$
\begin{align}
x&=r+r\cos \theta\\
y&=-r+r\sin \theta
\end{align}
$$
The blue points are found by rotating by angle $\theta$ clockwise and anticlockwise from $-45^{\circ}$
So set $\theta_1=-45^{\circ} +\sin^{-1}\left( \frac x {2r} \right)$ and $\theta_2=-45^{\circ} -\sin^{-1}\left( \frac x {2r} \right)$ and work out:
$$
\begin{align}
x_1&=r+r\cos \theta_1\\
y_1&=-r+r\sin \theta_1
\end{align}
$$
$$
\begin{align}
x_2&=r+r\cos \theta_2\\
y_2&=-r+r\sin \theta_2
\end{align}
$$
Comment: "The blue points are found by rotating by angle θ clockwise and anticlockwise from 45..." Can you illustrate? Not sure I know how to do this.


Validation of fields using context

Question: I am developing a MVC asp.net web app where I have a view with several forms inside, each one  with its specific context, so many have the same name and the only way to make them different is using the context. I setup the events such as click, change, etc, with Jquery Context, everything works fine...
The problem appears when the client side validation paints the red color for the required fields in my view and all of its forms applying the "field-validation-error" class.
When I enter the required fields contents of the second of my forms, the "Required." validation message that gets cleared is the first one, not the specific message error of the field inside its second form context.
My code looks like:
I have many controls with data annotations that use the Jquery context:
<code>jQuery( expression, [context] )

$('#MyTextField', $('#my-form_context_1')) ;

$('#MyTextField', $('#my-form_context_2'));
</code>
Is there a way to work with JQuery context and apply validation in a specific context?
Answer: With this plugin it's possible to hook to form submit event. Thanks to that you are able to do whatever you want to validate your data.

Validation of fields using context


System app : can't execute commands (Permission denied)

Question: I have a system app (in the /system/app folder and also signed with the system signature) and I would like to execute some commands.
It works well with adb and superuser rights, but everytime I get a "Permission denied" when I make the call from my application.
This is the kind of command I'm doing :
<code>Runtime.getRuntime().exec("iptables --flush");
</code>
Do you know why I have this error ? And how to correct it ?
Thanks !
Comment: why won't you check the output of `Runtime.getRuntime().exec("/system/bin/id");`?
Comment: Did you ever find a solution?
Answer: You need to ask for a SU permissions first from the system.
I would suggest you to use roottools:

RootTools provides rooted developers a standardized set of tools for
  use in the development of rooted applications. In the end, we will
  accomplish this by providing developers with robust, easy-to-use
  libraries that will drastically improve development times as well as
  promote code reuse. This project is open to any proven developer that
  feels they have something to contribute. By pitching in together we
  can streamline our own processes, improve the effectiveness of our
  apps, learn new techniques, and provide a better experience for our
  users.

EDIT: Can you please describe the process of signing your APK with the system certificates? Have you edited your AndroidManifest.xml as well?


Crash due to water bottle

Question: I have a little bit of a unique question here.
Does anyone know of a cycling crash that was caused due to the cyclist drinking out of his/her water bottle?
Comment: Essentially, you're asking a question to which the answer is an unboundedly long list of incidents. There have surely been cases where pros have crashed this way; there have surely been cases where somebody's mate at the club has crashed that way; there have surely been cases where people riding on their own have crashed that way. There might even be some famous incidents but no answer could ever be comprehensive and it's hard to say that one answer is better than another.
Comment: For these kinds of reasons, [list questions are generally discouraged on Stack Exchange sites](http://blog.stackoverflow.com/2011/01/real-questions-have-answers/).
Comment: I've seen someone fail to put a bottle back in the cage, dropped it in a bunch, and those behind had to swerve to avoid.  I was at the end and ended up riding over his bottle and it would have thrown me if I hadn't been ready.   So yes, its totally possible.
Comment: I bet there have been crashes caused by ringing the bell.  VTC
Comment: I'm sure I've read of such a case. I don't follow sports so unless it was here it was in the general news. So a major event like a grand tour or the Olympics, and/or a top British rider
Answer: When I used to ride in a paceline a lot, I had a lot of issues with getting a drink of water while maintaining a straight line. So much so, those riding in the paceline complained. Since then, if I'm riding in a paceline, I wait until I'm at the end of the paceline to get a drink. With practice, maybe this would be less of an issue for me. If you're racing, maybe waiting until you're at the back isn't so much an option but in those situations you have to be very cautious when drafting anyway.
Comment: A lot has to do with the cage (and the bike).  I raised my cage several inches because it was too low to reach without looking.

Crash due to water bottle


What does Arch Linux offer?

Question: I use Macs, Ubuntu, FreeBSD, OpenBSD, and Fedora for different purposes. I'm fairly busy and trying out a new distro takes a lot of time, but I hear lots of good things about Arch Linux from people I admire. I do mostly scientific computing (and some web development), and use Linux as both a desktop and a server. Does Arch offer anything I'm not already getting from one of my current installs? I'm particularly interested in the differences between Arch and Debian
Comment: [Just btw, this might be helpful.](https://wiki.archlinux.org/index.php/Arch_Compared_to_Other_Distributions)
Comment: you're welcome.  It was just a pointer, I still regard your question as completely reasonable. `:)`
Comment: @sr_ thanks for https://wiki.archlinux.org/index.php/Arch_Compared_to_Other_Distributions I have read that already, but still in practice I want to see if it's just me or other people also find it to much trouble to choose all the packages and install everything by hand? I mean I know that I need to change a few things from a standard ubuntu distro but when I tried Arch I need to make all sorts of decisions that I didn't cared about that much.
Answer: I myself have migrated to Arch some months ago, and form my experience I could give you some advices:

You need a lot of free time to install it, afterwards it's just a little more than a regular distro (Fedora, Ubuntu, OpenSuse).
It is fast.
Since it is a rolling release you don't need to bother yourself with huge changes and huge download time.
You decide in the first place what program you want to install.

But you have to have a lot of time to put in it, reading configuration files, official documents, wiki and so on (although most of this is just at the installation phase).
To sum it up, I think that it isn't the distro that you want to work on day to day, but for a personal use and for hobbie it is Great & Fun.
Comment: Once it is set up, it can be easily used to work on day to day basis.
Comment: Though it is risky to use it on production server, I think its [simplicity](https://wiki.archlinux.org/index.php/The_Arch_Way#Simplicity), configurability(init and config files) and package management(pacman) can be useful for production desktops and laptops. The only care user should take is no frequent full-updations. Actually I am planning to set up Arch as my primary OS on my production laptop.
Comment: I mean by work = production enviorment, since a small change could take houres, in comparition to a "known" distros.
Comment: The same effect people get when they use buggy 11th version of their **known** distro.
Answer: Is there any merit in trying Arch? Of course there is.
Provided you:

Are prepared to read all of the excellent documentation that the community had provided;
Are willing to assume complete responsibility for your system and not expect to have your hand held;
Are comfortable with the (admittedly infrequent) occasions where newer packages cause issues, or even breakage, that comes with a rolling release.

Whether or not there are advantages to you depends entirely on your needs and inclinations. Arch means having the  the newest packages, but that comes at a cost in terms of attentiveness to your system.
There is no particular "magic" to Arch (and no inherent "coolness" either); it's a distro like any other that scratches an itch...
Comment: Yes: that pretty much sums it up; full control and total responsibility...
Comment: thanks, so that itch is having full control over everything that is happing to your installation, correct?
Answer: I have been running Slackware releases for some years.  I made my development machine into an Arch box a couple of years ago. I think that Arch holds your hand a bit more than Slackware, in that pacman can detect missing packages, where installpkg doesn't.  To me, it also seemed easier to have a custom kernel on Slackware than on Arch: I gave up on custom kernels and just went with the Arch rolling release kernel.
I don't think Arch takes that much extra time, I would gladly have an Arch desktop (as long as I get to run pacman -Syu once a week), and I would gladly spend 100% of my time in Arch or Slackware.  But my tastes in user interface differ wildly from The Norm, and I do like to have total control over compilers, configurations, etc.
Answer: For experimenting, I've tried Arch.  It's where a lot of people these days are ending-up after having tried LFS or Gentoo long ago.  Frankly, it's a bit raw as intended and reminds me of Slack.  That said, I :heart: GNU/Linux.
I've found FreeBSD has numerous practical advantages:

Developed as a whole.
Security.
Root ZFS (GPT/EFI) install guide works. (CDDL of course)
+= ports(Nonfree(TM) + GNU), I've been able to run everything from

Scipy
Hadoop
Jenkins
Puppet
Varnish (of course)
Riak
Haskell platform
Side-by-side ruby(187, ree, 193, jruby) with AND without rvm, python(272,322) with AND without pythonbrew

The freebsd source ports are pretty current, and easy as any Ubuntu LTS/Debian or Arch.  I'm probably biased as I'm a sysadmin that started in the early Slackware days.
There isn't much I can find wrong with FreeBSD other than it's not quite as new and shiny as Arch.  kFreeBSD and the Nexenta desktop variants would also be interesting.

What does Arch Linux offer?


Convert single PNG image into single PDF

Question: I need a method to convert single images (specifically PNG format) into PDF's that are automatically re-sized to fit that single image (and not remain the default 8.5x11" letter size). I could do this manually with Office or Open office, but it would take too long for a batch of files. I'm using Windows 7. Any help is appreciated!
Answer: You could also use XNConvert (wasn't mentioned in the duplicates answers)

batch processing
automatic resize or predefined resize
output as PDF (and various other formats)
no installation necessary

Comment: Thanks, this method also worked perfectly to solve my problem.
Answer:
In windows you can use print for any number of images as pdf.

just select images and click print.
print as pdf.
save file.
Answer: Download ImageMagick for Windows. Link
Note: Scroll down and read "To verify ImageMagick is working properly, ..."
Then you just have to type in the Command Prompt window:
<code>cd \Users\<user name>\Pictures
convert file.jpg file.pdf
</code>
Comment: Thanks for the advice, I'd upvote you but don't have enough rep. I ended up preferring IrfanView over your method.
Answer: I found a method myself using free IrfanView software and installing the additional PDF plugin (IMPDF). This software has been around since 1996, and is updated regularly and still very flexible/useful. It offers an easy-to-use GUI that even let me select multiple files for batch conversion.
It also has options for image compression quality and to keep the "page format" "like layout" that auto-resizes the PDF's, or even add security encryption if desired.
Answer: Now a days online converters are used to convert multiple files realted to differnet industries. First you drop your image to specific area and then convert and save it to the computer.
Converter made life easy regarding to the files and documents.


Grub-install: what's the root directory

Question: Can anyone provide a clear explanation what the root directory is for grub-install and when to use it?
Comment: Did you mean boot directory? `grub-install` doesn't need the root directory at all.
Comment: @YoMismo No, I meant root directory. See man
Comment: I did, root search returns: `Pattern not found  (press RETURN)` at least in my version (1.99-27+deb7u2)
Answer: The root directory is just what it says: your root directory, i.e /.  If you are running grub-install while booted from some other medium and have your normal root directory mounted somewhere other than /, then you want to specify this argument to point it to your root directory.
Comment: Apparently the `grub-install` of the original grub had the option `--root-directory`, but `grub-install` of grub2 has option `--boot-directory`: _--boot-directory=DIR: Use DIR as the boot directory. The default is /boot. GRUB will put its files in a subdirectory of this directory named grub._
Comment: An nice explanation is [here](http://www.av8n.com/computer/htm/grub-reinstall.htm#sec-grub-install): _"The --root-directory=/x option tells grub where to look for the grub directory during the installation process. The grub directory is /x/boot/grub on typical distributions such as Ubuntu and Debian, but may be /x/grub on some *bsd setups. ... the inode of interest will be reached by the path "/x" during the installation process. Grub assumes this inode will be reached by the simple path "/" later .... This distinction is, alas, not well documented._
Comment: @DavidTonhofer You should convert your comment to an answer :)
Answer: I'm not too much of an expert about GRUB, but as far as I know, the root directory for GRUB it's the directory where you can install a working GRUB when you have started your system in recovery mode:
grub-install –-root-directory=/test/kernelimage /dev/sda
Here the root directory contains an image of the Linux kernel to boot, and must also contain a directory /boot/grub.

Grub-install: what's the root directory


What is "3 inch minus"?

Question: My heavy equipment guy said we should put "3 inch minus" down on a new driveway. What is it, and is it a good choice?
Comment: Related question: [Definitons of various sand, gravel, and rock products](http://diy.stackexchange.com/questions/241/definitons-of-various-sand-gravel-and-rock-products)
Answer: It means anything that will fit through a 3" x 3" screen grid, including large stones, smaller stones, all the way down to dust.  It's something that would typically be used as a deep base to support a finer top layer of gravel.
Answer: A search of the internet reveals that it is "rocks, dirt and stones 3" and under."  From the discussions I've found, it should only be used as a base at that size.  3/4" minus is the most recommended.
http://www.indianriverenterprises.com/4.html
http://www.pirate4x4.com/forum/showthread.php?t=682267
Answer: Interestingly, it seems that different localities tend to use different jargon for stone sizing, with not much standardization. There is no government agency that regulates it. :)
Regardless, since the sources of stone tend to use sieves with defined size holes to sort the stone, this tends to tell you the size of the stone to use. So around here, #3 stone means that which will fit through a sieve with 3 inch holes. In some cases, the stone will already have been run past smaller sieves.
I will suggest that stone with dirt in it will tend to support the growth of weeds, encourage tree roots more, etc. And since these stones tend to be more round, with few sharp edges, they don't really pack that well for a driveway base.
I have also seen that "crusher run" tends to pack very solidly. This is crushed limestone, run through the same sieves to size the stone. The sharp edges of crushed stone prevent things from sliding around, and the presence of smaller crushed stone fills in the interstices, locking things together even more. In fact, #3 crusher run seems to be a common base for driveways around here, with smaller sized crusher run on top as a surface. Our gravel driveway is made of exactly that.
So I would not be at all surprised if the heavy equipment guy was in fact referring to #3 crushed limestone for a base.
Answer: Old post but i thought i'd add my two cents.  Granted the definition can vary from region to region, but i don't think any of the above got it right.  Any time I have dealt with any aggregate in the Midwestern states described as X" minus it has always been crushed stone.  As it is crushed it is screened so that only material of the desired size makes it to the desired deliverable.  So yes 3" minus means that the largest stone will be 3", but it will be very angular since it has been crushed and FULL of material less than 3".  If you driveway has slope that is prone to erosion this is an excellent choice - as it will not wash away in the majority of cases.  In my experience it does 'pack' and tree roots and weeds aren't going to grow better here than any where else...  Other driveway choices are 21A and 22A.  Either choice is good, but determine if either has had a component of clay added to them.  The clay helps bind and shed water vs pass water through...which is most, not all, cases it better for a driveway.

What is "3 inch minus"?


Why do kubernetes kube-api server need etcd-keyfile and kubelet-client-key

Question: As I understand kube-api server acts as a client when communicating with ETCD and Kubelet. Both ETCD and Kubelet act as servers for kube-api. With secure environment (two way SSL authentication), kube-api server needs the ETCD and Kubelet certificates and the CA certificate. What I don't understand is why do we need to provide the private keys of ETCD (etcd-keyfile) and Kubelet (kubelet-client-key) while configuring kube-apiserver.yaml ?
Answer: Because etcd uses X.509 mutual TLS authentication in kubernetes, so the apiserver needs to be able to prove it has ownership over the client certificate that is presented to the server, and that happens via private key
There are other authentication options for etcd, but kubernetes doesn't use them, and it's unclear if the apiserver even offers a non-TLS authentication option for connecting to etcd, even if you wanted to
Comment: Thanks @mdaniel I was confused over mutual authentication initially, so what we provide on api-server.yaml are the api-server client certificates generated for ETCD and Kubelet. Since api-server have the ownership on certs (as you mentioned) the keys are also provided on the api-server.yaml.


How to run sshd on port 500 in High Sierra?

Question: They changed things in later versions of macOS so that you can't just edit etc/ssh/sshd_config like you would in Linux.  What do I type into the shell to run sshd on port 500 instead of 22?
Comment: Any of this solutions working? https://serverfault.com/questions/18761/how-to-change-sshd-port-on-mac-os-x
Comment: is there any way to just like "symlink" the port -- pipe everything straight through for a test -- rather than loading up a .plist etc ?
Answer: To modify the ssh port, you have to edit the ssh launch daemon of the ssh server host:

disable SIP
open ssh.plist:
sudo nano /System/Library/LaunchDaemons/ssh.plist

modify the <key>Sockets</key> (example port here: 10022) from
    ...
    <key>Sockets</key>
    <dict>
            <key>Listeners</key>
            <dict>
                    <key>SockServiceName</key>
                    <string>ssh</string>
                    <key>Bonjour</key>
                    <array>
                            <string>ssh</string>
                            <string>sftp-ssh</string>
                    </array>
            </dict>
    </dict>
    ...

to
    ...
    <key>Sockets</key>
    <dict>
            <key>Listeners</key>
            <dict>
                    <key>SockServiceName</key>
                    <string>10022</string>
                    <key>Bonjour</key>
                    <array>
                            <string>10022</string>
                            <string>10022</string>
                    </array>
            </dict>
    </dict>
    ...

unload and load the daemon
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist

test the ssh daemon
enable SIP

An alternative, less intrusive approach is to create a second ssh launch daemon in /Library/LaunchDaemons/:

copy the ssh.plist
sudo cp /System/Library/LaunchDaemons/ssh.plist /Library/LaunchDaemons/ssh2.plist

modify the ssh2.plist:
sudo nano /Library/LaunchDaemons/ssh2.plist

change the key Label to
<key>Label</key>
<string>com.openssh.sshd2</string>

change the key <key>Sockets</key> as described earlier
disable SSH in the System Preferences > Sharing > Remote Login
load the launch daemon:
sudo launchctl load -w /Library/LaunchDaemons/ssh2.plist

with strict key checking enabled in the ssh config file on a ssh client host you may have to remove the ssh server from the known_hosts file of this remote host.
access the ssh server with ssh user@IP -p <port>
Comment: oh brother..... thats why i stayed on 10.12 until last week. i knew once Apple removed the 3.5mm jack it would be all over what a pity.


What caused LaTeX to suddenly stop working after OS crashed?

Question:
My laptop restarted and when it switched back on, I was unable to run any of the code that had been working previously. As you can see it says there is an error in line 1, saying there is an invalid character, but this had been working before so I am unsure what is wrong and know that it should start in this way. If anyone could help me it would be greatly appreciated.
Comment: the log is saying that the file is full of nulls (byte 0) but the editor window is clearly showing text. so I'd save that file probably under a different name before doing anything else
Comment: Perhaps some invisible character has been added at the start of the line, if you move the cursor to the ``\`` and hold backspace that might be a start. It would have been helpful if you'd copied and pasted the code (and the error message) into the question. Highlight the lot and press ctrl+k (or the code sample button, which is the one like {}) to apply the correct highlighting. This is really good practice in future too
Comment: I copied and pasted the whole thing into a new file and that seemed to do it, thank you
Answer: That seems a lot like an encoding problem to me, a thing that works well in this cases is to erase the line and retype it (not copy/paste). If you get an error on line 2, this means that your encoding is corrupted.
The thing to do then is to edit your file in an editor that allows to display "invisible characters" which are those that causes the problem.
It's a windows related problem, working with utf8 instead of microsoft's one should prevent it from reappearing.


Usage of the word "meet"

Question: I saw some expression like the following : "I met a design problem in .... ", is it a right usage of the word "meet". It just sounds odd to me. I would rather use  "ran into" or "encountered" instead. Any advice ?
Answer: Met a problem is a right usage of meet:

Meet:
1. to come upon; come into the presence of; encounter: I would meet him on the street at unexpected moments.

That said, encountered a problem or ran into a problem would be more common.  Meet simply sounds more reciprocal, where the other two choices only connote activity on your part.  Ngrams shows the following:
Comment: +1 because nothing you say is untrue. Until you pointed it out I never consciously registered the fact that *meeting* is normally reciprocal. But don't forget that *encounter* and *run into* are also used with exactly the same implied reciprocity when the "object" of the verb is another person.
Comment: Emphatic +1 for the use of ngrams. Good answer!
Comment: Nice answer. Not only did I meet a problem, but the problem met me.
Answer: It is certainly correct to use meet a problem to mean to experience a problem.
Answer: Yes,

I met a problem

sounds a little odd but is perfectly fine. It's metaphorical, an example of personification.
So now you have three choices with different stylistic connotations:
- 'met' for metaphorical
- 'encountered' is more formal
- 'ran in to' is informal (and slightly metaphorical, you problem didn't make physical contact)
Answer: "I met a design problem in .... ":
substituting
"ran into" or "encountered"
does not make a difference, at least to me, in the meaning conveyed or in sentence construction.
Agreed, the use of meet in such a context may be relatively rare, making it appear out of place. It is not due to a grammatical error. In that sense, it is certainly odd, though not wrong.

Usage of the word "meet"


Generate random segments

Question: I would like to have a guide to generate segments of length l distributed randomly without intersection in a defined square field. The end of the loop is fixed by the total length of the right generated. Grateful if someone could help me.
Answer: A quick hack is to run a rigid body simulation until you arrive at a frame which looks right. Writing a script to get what you need can be a bit of a puzzle...

Generate random segments


What do Christians do on a Fasting day besides worshipping?

Question: While Christians fast, do they only focus on worshipping God (such as bible reading and praying)? If they involve in any other activity besides worshipping God, would fasting be inefficient? What did the people from the bible do on Fasting days?
Answer: From wiki:

The Church Fathers have referred to fasting without prayer as "the fast of the demons" since the demons do not eat according to their incorporeal nature, but neither do they pray.

From my understanding, the Orthodox are the only large denomination that participate in regular fasting. Almost every Wednesday and Friday include a vegan diet (except shrimp, scallops, etc.) with no alcohol or olive oil. The entirety of lent is like this as well, except alcohol/olive oil is permitted on Saturday and Sunday and only one meal is permitted per day; in addition, no food at all is permitted the first three days and the the final two days of Lent).
During these periods of fasting, they do not "only focus on worshiping God", as they more than likely work and have families to take care of. However, it is expected that they worship much more than usual, as fasting without worship is worthless (i.e., inefficient).
You can think of it as a continuum as opposed to a black or white answer. If one was to fast and worship 100% of the day, it would be more efficient than one who fasted and worshiped only 30 minutes of the day, which would be more efficient than one who did not fast and worshiped 5 minutes out of the day.
This answer is in regards to the Orthodox perspective, as the Catholics and Protestants don't engage in regular fasting. (The Catholics used to fast but relaxed it to the restriction of no red meat on Fridays, during Lent).
Answer: Jesus called us to fast in secret.

Matthew 6:17-18 ESV
But when you fast, anoint your head and wash your face,  that your fasting may not be seen by others but by your Father who is in secret. And your Father who sees in secret will reward you.

I interpret this to mean that Christians who are fasting should continue their day without drawing undue attention to the fast they are undergoing.
If you are supposed to go somewhere, go. If you are supposed to do something, do it.


How to verify if a oil pan needs to be replaced

Question: I have a 2000 honda accord v6 lx with about 190K miles on it. I was told recently by a mechanic that I need to get the oil pan replaced and it was going to cost $400-$500 dollars. I did some research and it appears moderately easy with the right tools I'm sure to replace it myself but how can I verify if in fact, the oil pan needs to be replaced. Thank you for any insight on this.
Answer: The oil pan is not a normal wear item, however being so low to the ground it is possible to damage it. As the oil pan is not removed for regular inspection, any decision made by the mechanic should be visible to photograph without tools or disassembly, either as physical damage or oil leaking.
Have the mechanic put the vehicle on the lift and show to you the damage or leak. If necessary, photograph it using a digital camera with a "macro" setting from 30-50 cm distance with flash, and post the photo here.
Note as Capsule mentioned that some oil pans have striations, casting marks, or even air-cooling fins and these should not be confused with damage. Light scratching and denting on the underside is common and acceptable, but deep scratches, tears, or cracks are signs that the pan should be replaced.
Comment: Also, if you live somewhere with lots of snow, as @dotancohen said, it's so close to the ground that it's going to get blasted with salt all the time in the winter times. It makes it highly prone to rust. I had to replace mine on a Civic 2005 with 180k km due to the rust.
Answer: I would check for:

cracks, but don't take casting marks for cracks (a picture of your pan would be helpful to tell)
scratches
stripped plug thread (but then it would already be leaking since you wouldn't be able to tight the plug back ;-))
any deformation especially on the gasket level
Answer: The oil pan is not a regular wear item, though it might need to be replaced if it's rusted, cracked and/or leaking. Welding an oil pan is difficult, time consuming and not worth it.
Answer: it may need to replaced if it has cracks
Comment: That one is probably pretty obvious? Maybe you'd like to expound on how to check for crack and what other problems might cause leaks?


What if a particle is observed from its own frame?

Question: What if the net force on some particle is zero and we choose that particle itself as the reference frame or a frame moving uniformly relative to the particle. Can we call that frame an inertial frame of reference?
Answer: If the net force on the particle is zero, then its momentum is constant, which in particular means that the particle is moving at a constant velocity. Thus, the rest frame of the particle (the frame moving with the particle) is inertial by definition.
The rest frame is certainly an important case, but there is nothing special about it in terms of being an inertial reference frame or not.
Hope this helps.
Answer: Any reference frame that is not accelerating is an inertial frame of reference. If the net force on the particle is zero, then it is not accelerating and therefore the reference frame of the particle is inertial. Moreover, an observer in any other inertial frame of reference will conclude that the reference frame of the particle is inertial.
Hope this helps.


Is it necessary for a web developer to know how to hack website?

Question: I'm a web developer. I'm just wondering that is it necessary for a web developer to know how to hack website than developing a website?
Answer: I wouldn't say it is necessary to know how to hack a website, but I would say it is necessary to know how to defend one. This may sound like the same thing but they really are different. There are multiple ways to attack a website (SQL injections, cross site scripting attacks, email header injections)  and how you would do this can vary depending on what the attacker is hoping to accomplish (steal information, hijack a session, phishing). Defending against these doesn't require knowing how this is done as they can get quite complicated. All you need to know is how to code defensively to stop this attacks from being useful.
For example, you should always escape special characters when doing a SQL query to prevent SQL injections. You don't have to know how a SQL injection is done. You just have to know that escaping your query properly will prevent these attacks from being successful.
Cross site scripting attacks can be very complicated to perform. But as long as know how to defend against them (use HTTPS for logins, change session IDs when a user logs in, filter user input to avoid HTML code injection, http only cookies, etc) you can present them from being successful.
Knowing how these attacks are performed does make it easier for you to understand how to defend against them. But it is not required to know how these attacks work in detail. A very basic understanding of the concept, along with a strong knowledge of how to defend against them, is enough to ensure you keep your websites safe.
Comment: @ John Code | Does it means that the website that has no "User Input Application etc." is safe from the attack?If your website doesn't have application that requires user interaction is it safe already? is it possible that i might be hacked?
Comment: @adietan63 Not necessarily. You may build your site where some pages do accept parameters and they can be misused (for example, a picture gallery and the links "first page", "previous page", "next page" etc -- if you do not filter/escape such script parameter properly you may get into trouble -- SQL Injection, for example). **Everything** that come from "the other side" (user browser) needs to be validated/escaped -- you should NEVER trust such data.
Comment: @adietan63, Unfortunately it's not that simple. Attacks can happen by placing malicious code in the URL of your web pages. Framing your website also allows for your site to be attacked as users may not know that they aren't really on your site. Then they can be fooled into giving away sensitive information. So even basic websites need to keep security in mind.


What are default owner and group permissions on an external volume?

Question: What are the default owner and group permissions on an external volume? This is for data only.
Comment: you might find this link interesting- http://googlemac.blogspot.com/2007/03/user-99-unknown.html
Comment: We strongly prefer one question per question. If you can edit this to focus on one main theme - that would be awesome. How to change something is very different than describing what exists in the default.
Comment: @bmike. I like to give background information and also explain the reason why because often times people want to know before they will respond with any detail. I simplified the question.
Comment: Thank you - asking two related questions often works very well and you did have some great details. Maybe just softening the title would have gone a long way?
Answer: For MacOS (née OS X), the default owner and group permissions on a freshly formatted external drive are (in several parlances):

775
drwxrwxr-x
user group
whichever-user-formatted-the-external-drive staff

For example, I just hooked up an external drive, my username is mrcook, so the permissions shown for the drive via Terminal and the ls -pal command are:
drwxrwxr-x mrcook staff
To change permissions on an external drive with MacOS, run chmod to change the permissions like read, write, etc. Run chown to change the owner and group. Both chmod and chown can be run without using sudo if you are the administrator of your Mac.
You can read more about chmod and 'chown` on the extremely useful SS64 website which has a list of (most?) MacOS shell commands and their switches.
Update to add information about the "ignore ownership on this volume" checkbox option in the Finder's Get Info
The "ignore ownership on this volume" is checked by default so "everything just works" as Apple likes to say. This option sets the permissions as described above. However, if you uncheck the "ignore ownership on this volume" option, the drive permissions change to system wheel.
I was able to use sudo vsdbutil -c /Volumes/DiskName recommended by this Mac OS X Hints page from 2002 to check the status of the permissions on the drive. The other suggestions worked as well:

sudo vsdbutil -a /Volumes/DiskName to check the option
sudo vsdbutil -d /Volumes/DiskName to uncheck the option

YMMV though depending on the version of MacOS you are using. I highly recommend this previous question on how to change "ignore ownership on this volume" from the command line because the changes made via vsdbutil may not stick after mounting and remounting the drive.


Couldn't get a 741 OPAMP to work as inverting amplifier with smaller (but not so small) resistors

Question: Using a 741 opamp,  I constructed a simple inverting amplifier circuit as in https://en.wikipedia.org/wiki/Operational_amplifier#/media/File:Op-Amp_Inverting_Amplifier.svg   ; I first tried Rf = 1k and Rin = 330 Ohm. Driving the input with a 1khz sine wave with 1v peak to peak amplitude, I expected to see a gain of -3. Instead, I got a bigger output that was so dirty that I couldn't tell what the gain was. I also think that the output was even in phase with the input! (Sorry I don't remember exactly, and am away from the lab now.) Then I put on a load of 1k. Now the output was clean, but still in phase with the input and was small, maybe even smaller than the input! When I replaced Rf and the load with 10k resistors and replaced Rin with a 4.7k resistor, the result was as expected. The gain was of magnitude about 2 but 180 degrees out of phase with the input! Could someone please explain what happened when I used the smaller resistors? Does it have to do with the 741's output impedance? That would seem strange since the output resistance is only 75 Ohm. Thanks!
Comment: In future op-amp experiments, chuck out the 741 and get a modern op-amp. Just about any op-amp is "nicer" than the 741. It wants a substantial bipolar supply, and won't go anywhere near the rails. Even a jelly bean 358 will happily operate on a single 5V supply, and will to within ~1.5V of the rails, IIRC.
Comment: That ought to work. Were the power supplies the correct +-/12-15V? If you were trying this off +/-5V or even 0/5V you need a newer opamp.
Comment: The supplies were + and - 15V.  Thanks for your input!
Answer: The closed loop output resistance should be very low, less than 1 ohm. 75 ohms is more-or-less what you'd expect for AC output impedance.
The output resistance is only low for currents that the op-amp can supply. It will go into limiting mode if the output current exceeds a couple tens of mA roughly. It also cannot drive close to the rails with a heavy load. With a 2K load it typically can get within a couple volts of the rails, but is not guaranteed to do better than 5V, so if your supplies are +/-10V your maximum input signal with a 2K feedback resistor and 660 ohm Rin your maximum input voltage would be about +/-1.6V, and with 1K about +/-800mV. It will be less if your supplies are lower.
Comment: Thanks for replying.  Are you saying that I was trying to make the 741 drive too much current with the low resistance values?


Unable to login using new mysql user added via phpmyadmin

Question: On my computer yesterday I installed 12.04 and applied all updates. I have installed lamp on this system using following command sudo apt-get install lamp-server^ phpmyadmin . I created a new user from phpmyadmin and given that user all the global privileges, but I am not able to login using that new user, I have also restarted the mysql service, reload the privileges, but still its not working. It used to work fine in Ubuntu 10.04.
Comment: try in terminal:  mysql -u username -p  [hit enter and give appropriate password]. Let use know the error message.
Comment: The problem is that during the creation of user, I selected anyhost. But then I deleted the user and selected localhost and now its working.
Answer: Mysql is a bit odd in the fact that you if you want to login from that server only it is 'username'@'localhost' but if you need to login in from another server also you have to add a second user entry 'username'@'ipaddress' or 'username'@'%' for any host (apart from local host) and then grant privileges user each variation.
grant all on mydb.* to 'username'@'localhost'......... ; grant all on mydb.* to 'username'@'%' ......;


Backup SQL Server database to the cloud or network folder

Question: I can take a SQL Server backup to a local disk without any problem, but I now need to backup to a cloud disk or network folder that I can access. What are the best practices to do this?
Comment: You could start by reading some documents about it - there must be hundreds of them out there.
Answer: I can't tell you about the cloud disk but when you backup to a network share you can:

Create a network share and assign permissions (I go with full control) to the SQL Server database engine service account (it has to be a domain account)
Backup database to this share like that:
BACKUP DATABASE AdventureWorks TO DISK = '\\MyBackupShare\AdventureWorksFULL.bak'

You might have to change the SQL Server database engine service account (local account is default).
It's simple. I would recommend using Ola Hallengren's Maintenance scripts though. They give you much more versatility.


which RPM measurement method is suitable?

Question: I have a PMDC motor which is electronically controlled for speed. And it is a closed loop system. A proximity sensor is there to measure the speed of the motor and there are 12 bolts attached to the shaft of the motor so that when it rotates the proximity sensor produces 12 pulses per revolution. I have written a code to measure the rpm  in which I count the pulses in one second and thus calculating the speed. But the problem is I could get a resolution of 5 rpm only. Is there anyway to get a higher resolution like 1 rpm on this system without changing the feedback technology?
Comment: Are you open to adding additional external sensors? Is the resolution you are referring to that of the RPM measurement or the change in speed as a result of the RPM measurement? I assume that by "closed loop system" you imply that the current speed of the motor is updated automatically by the measurements from the RPM sensor. What is the speed range of the motor? What is the sampling frequency of the sensor?
Comment: resolution I meant is of RPM measurement. I could add additional sensor if I have no choice without touching the hardware. Yes,I mentioned I'm checking the pulses every second.
Comment: speed range of the motor is 500RPM@full load
Comment: You say you "count the pulses in one second" but you don't mention how many times per second you check for this pulse... If it is only once per second, you wouldn't be getting results at all since the motor rotates 8.33 times per second, producing 100 pulses per second. I guess a better question is how are you checking for this pulse in code? Is it a HI/LO state? Is it an edge trigger ISR? Also, do you know if there is any "bounce" associated with this sensor as it changes states? That would affect the results as well.
Comment: It's not clear: are you 1) trying to tie into the existing pulse generator to  measure the RPM yourself (and thus not change controller - just use some of its signals) 2) increase the resolution of the existing detection system but then feed the existing controller the signal is needs or 3) install a separate RPM measurement system totally or 4) something else?
Comment: @raforanz An extremely important parameter that you need to specify is the minimum RPM that you need to measure. What is it?
Comment: @Joe Hass 20 RPM
Answer: At 500 rpm the shaft rotates 8.3333 times per second therefore, in 1 second you count: -
12 x 8.33333 pulses = 100 pulses
At 505 rpm the shaft rotates 8.416667 times per second therefore, in 1 second you count: -
12 x 8.41667 pulses = 101 pulses
You want greater resolution so you can add more bolts BUT to get a resolution of 1 rpm you'll need 5 x 12 bolts and that sounds impractical.
You could do a rolling count over a 5 seconds and each second throw away the oldest 1 second count and introduce the newest count but you'll still have a sluggish mechanism for measuring rpm - changes in speed won't be seen as dynamically as you might want.
Alternatively you use a high frequency clock and measure the number of counts between pulses. You can average 12 results (one full revolution) to reduce positional errors of the bolts.
How fast can you clock and count?
Answer - you have a clock with period 256usecs - this means it toggles 3906 times in one second. If you count these clock toggles for every 12 pulses on the proximity sensor (aka one revolution of the shaft), at 500 rpm you'll count for 0.12 seconds and accumulate a total of 469 clock cycles. If you accumulated 468 clock cycles, this would be the equivalent of 501 rpm.
You, of course have the option of counting two or more revolutions to give greater resolution at higher speeds. At significantly lower speeds you might want to revert to counting proximity pulses per second OR clock counts for a fractional rotation of the shaft.
Comment: i can clock with a period of 256us
Comment: @ Andy aka the last point in your answer(that is counting the clock between pulses) is similar to the built in capture peripheral of a micro-controller ,right?
Comment: I'd set up an internal clock and counter so they run automatically and then I'd set up the input pulse to trigger an interrupt which invokes a routine that checks that 12 pulses have passed which then records the clock counts. I would then reset both the clock & pulse counters to zero for it to start all over. I have no other way of describing it because it's not my skill area.
Answer: The most accurate approach for speeds in the range you're looking at is to have each incoming pulse increment a counter and latch the value of a timer.  Periodically sample the counter and latched-timer values, being certain that the sampled values "go together".  For example, if you have hardware pulse-capture counter and pulse-capture circuitry wired to the same input, you might read the counter, then the captured timer value, and then read the counter again.  If the two counter-reads yield different values, repeat the process.  The time to retry the process is less than the minimum time between input pulses, then on the second try both timer values should match.
Once you have done this, then at your desired update interval, compute your speed in pulses per minute as:
Speed = (NewCount-EarlierCount) * TimerCountsPerMinute / (NewTimer-EarlierTimer)
Except when NewCount equals EarlierCount, this approach will yield a value whose precision is +/- one timer tick.  To put it another way, if the input speed is constant, and the timer is itself accurate, the correct reading will be somewhere between
Speed = (NewCount-EarlierCount) * TimerCountsPerMinute / (NewTimer-EarlierTimer-1)
and
Speed = (NewCount-EarlierCount) * TimerCountsPerMinute / (NewTimer-EarlierTimer+1)
Using this approach, if you have a 1MHz timebase, provided your input pulses arrive at 10Hz or faster, you could update your display ten times per second and show a value that was precise to the accuracy of a typical crystal.  Depending upon what you're doing, you may want to suppress updates except when the total difference between the displayed and actual readings reaches e.g. three units on the display (so that when values are changing quickly the display numbers change quickly, but if a value is alternating between 123.4 and 123.5, the display would spend enough time showing each value that a person could see it).
Answer: Measure the time between pulse leading or falling edges.  You get a time estimate for how long it takes to go 1/12 revolution with every pulse.
Answer: If the minimum speed is 20 RPM then you get one revolution every three seconds, and only four pulses per second. You can't get a resolution (much less accuracy) of 1 RPM by simply counting pulses per second. To get the resolution you want at a very low pulse frequency you are going to need to determine the period between the pulses and then calculating the RPM from that. To determine the period, use the pulses to start/stop a counter. The counter must be clocked fast enough that you can still get at least 500 counts when the pulses are coming at 100 Hz (500 RPM) so you need the counter to run at 50kHz or more.


What is the best way to upvote

Question: This may sound like an odd question, but this is what I have the most trouble understanding on Stack Overflow (and other Stack Exchange sites). What is the correct way to upvote? Should I upvote every question I find interesting or should I do it sparingly. Could some of the more experienced users give a short list of their mental checkboxes they go through before upvoting?
Comment: Some answers here: [Why should I upvote a question?](http://meta.stackexchange.com/q/139/21960)
Comment: - You should upvote questions, not people.
 - You should upvote when a question is well-constructed, well-researched (Um, unlike this one) and clear. Do them, and you're fine.
Comment: Lol I suppose I should have done more research.  I wanted some opinions, but I will do more research.
Comment: You can't ask opinion-based questions in any of the sites!
Comment: Sorry, I was seeking experience from other uses not opinions.
Answer: Your votes are for you to use as you see fit. If you think a post deserves an upvote, give it one. You'll only run into trouble if you find a particular person and make it a point to find their posts and upvote multiple of their posts. That's "serial voting" and will get your votes reversed.
For me, I generally consider these things:

Is it well-crafted, with good spelling and grammar? At the very least, has the author put effort into making it readable?
Is it interesting to me?
Would someone else find it interesting?
For answers, is it an actual solution?

But, really, once you spend a little time on the site you'll start finding posts that you'll think deserve an upvote. Follow your gut.
Comment: That makes sense. I am very new, so I am still developing my standards.
Answer: You should only upvote a post that seems to be of high-quality or at least decent-quality. When I look at a post in SO or any site I think of this within about 10 seconds:
If question:

Does it asks a answerable, and reasonable question?
Is effort to solve shown?
Are all parts necessary to help solve problem in question?
Is it well-constructed?
Does it follow all the rules on how to ask a question (the basic and important ones)?

If answer:

Does it even answer the question?
Is it simple enough for everyone to be able to use?
Will it possible for it to help future users?
Is it an answer?
Does it follow the main rules on how to properly answer a question?

There are probably more ways on when to upvote a question or post, but this is a short summary of what I and probably many others do to see of the post deserves an upvote or not. Of course, the Help Center should help! When you vote, do what you want to do, not what we want to do. Go with your gut and mind when voting!
Comment: "*You should only upvote a post that seems to be of high-quality or at least decent-quality*" - I upvote for *many* different reasons. high-quality and even decent quality are not even top of the list, given there are not many high or even decent quality posts (answers sometimes yes, but certainly not questions).
Comment: That's my opinion @James. I did say that there are probably more reasons to upvote a post!

What is the best way to upvote


Is there a limit to how much I should edit my work?

Question: Is adding new ideas to a chapter after finishing it a bad habit? It's my first time writing a novella, and English is not my native language. Is it ok to edit my chapters many times to get a perfect draft?
Answer: It is perfectly possible to add extensively to any work, or any part of it, after you write the first draft.  Many writers have made major changes to works in the revision process, including changing the basic theme, shifting which characters are the main ones, altering large portions of plot, etc.
This takes up time.  This may be unavoidable, but there is also the real peril, in that there are many writers who endlessly revise a work, never to go on to another, and never to publish.  However, that tends to be people who revise a work twenty times.  (If you find yourself endlessly revising, you may want to recruit beta readers.)
Comment: Thank you so much this is really helpful, but btw, how can I find beta readers please?
Comment: @NourFourti Some people ask trusted friends and family members, but I've never had much luck with that --it's hard to get objectivity on either side. Writers groups are a better bet. There are many that meet in local areas, but there are also online ones. The one I've been recommending recently is Scribophile. I'm a member there and I've found it very helpful.
Comment: You may want to break that off as a separate question
Answer: For your first question, it depends. If the idea you add expands on the chapter and makes the story better, then it would be good to add it. If it interferes with the flow of the chapter or makes the chapter too long, then maybe put it somewhere else or give it its own chapter.
As for editing, this is perfectly fine and this is good. Editing is something you'll have to do eventually, so getting it done right away is great. Although, I would recommend finishing the story first before any major editing so that you don't accidentally edit out anything important.
Answer: Well for your first question, I'd say yes and no.
The reason I say yes is because you could do this. It's as simple as that. Adding more to an already made chapter is a perfectly ok thing to do, I've done it a few times myself, actually. As long as the chapter still makes sense after you've finished editing it, and the next chapter is still smooth, that is a perfectly good thing to do.
But the reason I say no is because if you don't do it right, you might just ruin it.
What I mean by this is that if you don't edit the chapter in a way that makes sense than that chapter, well, it will stop making sense. It will become very confusing and readers will put your book down right then and there. And the same applies for if you don't make the transition into the next chapter smooth. What I mean by this is that if you write two chapters and one ends at a certain place and the next starts off at that place, you can't ruin the balance by adding too much more onto the first chapter.
For example: Right now I'm writing a book that I'm calling "Last" (This originally started off as a school assignment and I know that there is already a different book called "Last." This name is still in progress, I'm just having trouble choosing what to call it). In chapter 10, the main character and two of his friends break into a facility to save their friend who was captured and is being held there. The chapter ends with them standing outside the fence that leads to the front door, and chapter 11 starts off with them inside the facility, scoping out the place to see how they can best make it to Emily (the friend) without getting caught by the guards.
If I were to go and add on to chapter 10, making it so that it ends when they find Emily's cell, and then start chapter 11 off with them just making it into The Facility, that wouldn't make any sense. That means that I would also have to edit chapter 11 so that it starts off smoothly where chapter 10 left off.
If you do all of those things, you'll be fine!
Good luck!
Comment: You're welcome! And you too! I hope you're novella becomes a best-seller or something if you're hoping to get it published! And if not, I hope by the end of it you're happy with what you've created!
Comment: Thank you so much and wish you the best for your book!
Answer: My general rule is that you should stop editing a work when you are no longer confident you are making it better. That doesn't necessarily mean you might not come back and edit it again later --after more time has passed, or after you've gotten feedback.
In the larger picture, you should stop editing your work if it gets to a point where endless revisions are threatening to prevent you from completing the work and submitting it for publication.


Word meaning 'easily pleased?'

Question: Especially when used pejoratively. Used to described someone who is easily pleased by small things that are very common or that people can get easily.
Comment: I'm voting to close this question as off-topic because it meets the criteria established by [this guidance from Stack Exchange Management](https://english.meta.stackexchange.com/questions/2160/single-word-requests-crosswords-and-the-fight-against-mediocrity) about such questions. We are not a writing-help and word-game and crossword-puzzle site; we're a site for linguists, etymologists, and serious English-language enthusiasts.
Comment: when you say 'pleased', do you mean, accepting of/satisfied by' or 'delighted by'?
Answer: One suggestion would be undiscerning, which if taken in a perjorative sense can mean someone who is lacking in taste.
Answer: possibly complaisant - If you are complaisant, you are willing to accept what other people are doing without complaining.

Example: Because John is too complaisant in his willingness to please others, people often take advantage of him.
Example: Hector was a poor manager because he was too complaisant, being pleased with his staff working, but not considering the quality of what they did.

[collinsdictionary.com]
Comment: @LeeLeon As your further comment shows, this word is much more about being disposed to please others than being actively pleased with anything oneself, so I'm not sure its a good fit. Can you come up with usages which speak more to the degree of 'pleasedness' of the complaisant person?
Comment: _"complaisant in his willingness to please others"_ Is that not a tautology? Also, isn't there a difference between "willing to please others" (complaisant) and "easily pleased" (which refers to _the person himself_ being pleased)?
Comment: @Flater - possibly not a good example, but the full meaning of the example is that John, in his willingness to accept what others are doing, pleases them by allowing them to take advantage of him. I could probably have found a better example - I'll have a look.
Comment: An interesting word. It is rare and I wonder if that is because in speech it will be confused with 'complacent'.
Answer: I think uncritical will fit well here.

accepting something too easily, because of being unwilling or unable to criticize.
Example: An adoring, uncritical audience
Answer: An answer to the title question is undemanding.
From M-W Learner's Dictionary:

undemanding  adjective ...  not demanding:...
b of a person : not expecting much time, attention, effort, etc., from
  other
  people : not difficult to satisfy
He is an enjoyable, undemanding guest.
Answer: I have three options that come to mind.
Excitable, adj.

responding rather too readily to something new or stimulating; too easily excited.
Chip could be a bit wayward and excitable

Good-natured, adj.

kind, friendly, and patient.
Everyone was very good-natured about my comments.

Affable, adj.

friendly, good-natured, or easy to talk to.
He was an affable and agreeable companion.
Comment: Explain the downvote?

Word meaning 'easily pleased?'


Restrict Asset Library Access to certain user group

Question: Is there a way to restrict a certain user group from getting the full size image in SharePoint?
I have a user group called View Only Users, and set them to view only capability for my asset library.
When the View only User logs in, they can see all the thumbnails but cannot download. But they can still right click on the image, and see the full image anyway.
I'm trying to prevent these group of users from seeing the full size image, unless they are given permission to a particular image. Is this achievable in SharePoint?
Example: Show them the thumbnail image even if they right click and view that image.
Thanks.
Answer: It is impossible to prevent these group of users from seeing the full size image if the group of users have view only permission on it.


should questions closed as being off topic / better intended for expats be auto moved to expats?

Question: I was looking at *Urgent* American citizen studying in the UK. Flight leaves tomorrow, visa in processing and no biometrics? and wondered...  maybe that should be auto-moved to expats instead of just being closed and the OP told to repost the question on expats?
Comment: I personally think that question is fine here, he's not asking about being an expat, he's asking about entering as a tourist. *shrug*.
Comment: Not sure if duplicate or related.
Comment: @MarkMayo That's debatable, that's about travelling to the UK in any case but the OP does not intend to actually visit as a tourist and return to the US, only to enter (ostensibly as a visitor) and start his studies. He is even asking about completing the long-stay visa formalities in the UK (the bit about biometrics).
Comment: @Relaxed ah, good point. yeah it's a bit in both camps, can see why it was closed.
Comment: ^ another reason (imo) that travel and expats should be merged
Answer: The current situation is far from ideal because many posters will be tempted to cross-post in the meantime and we sometimes end up with two identical questions on expats but I believe this is not possible (on a technical level) as long as expats is in beta. The only solution is to flag the question and wait for a moderator to take care of it.
I think we discussed this some time ago, incidentally, but I can't find where.
Comment: Also, auto-migration to sites in beta is generally done done (I read this as a 'rule' somewhere, can't find it now)


Is there a reason not to use the hibernation in Windows?

Question: When leaving the computer for a long time it seems convenient to hibernate it instead of shutting down - all the programs remain in the same state when resumed. Are there any drawbacks in doing so?
Answer: Generally there is no reason not to use it. Just keep in mind, that there are cases, that it won't work as expected.
These apply both for hibernation and suspend (to RAM):

some applications are not hibernation-aware. Eg. games tend to crash.
some WiFi drivers have trouble with hibernation.
networked applications loose connection and most do not reconnect automatically.
DHCP is not invoked, old IP is used, which by then might have been reassigned.

Hibernation vs suspend:

wake up from suspend is immediate, hibernation must load from HDD.
for hibernation you need space on HDD (a least of a size of memory occupied).
hibernation consumes no power at all, while suspend consumes minimal power (few Watts).
Comment: PC World has an article with some data: http://www.pcworld.com/printable/article/id,137328/printable.html
Comment: Nothing serious. I will continue using hibernation :P
Answer: If your computer is capable of S3 Sleep (ultra-low power consumption) there isn't a compelling reason for a desktop to be placed in hibernation. Hibernation has a high user impact, as it generally takes 1+ minute to wake up.
If you're using a laptop, and you need to use full-disk encryption to protect customer or other data, you absolutely must enable hibernation and disable sleep. Why? A sleeping laptop can be woken up to a boot prompt/screen lock screen, at which point an attacker can capture the drive's encryption key via Firewire port or by exploiting a Windows, application or other OS vulnerability.
This may seem far-fetched, but tools are easily downloadable to do these things, and any attacker targeting you is capable of this.
Comment: Another reason to not use sleep...  While it may not require much power, it does take some.  Lose power to the machine while sleeping, and you lose state.  Hibernate doesn't require any power to maintain state.
Comment: True that Sleep (a.k.a Suspend-to-RAM) is enough for energy saving. What I don't like about it is, that it's to easy to wake. Some vibration moves the mouse, and the computer already wakes up.
Comment: This is true. I got into a pretty heated argument recently with some folks internally trying to push a particular energy "solution". Consider that you're average computer is "active" for about 45 hrs * 50 weeks = 2250 hours/yr out of 8760 hrs/yr. So even if vibrations or whatever result in a loss of 90 minutes a workday, you're talking 375 hours/year. Not a big deal when you consider that power savings is saving you >6,000 hours of idle power usage!
Answer: Needs some extra hard disk space to dump the memory
May cause some IP related problems specially with DHCP
Comment: +1 Because I forgot all about this!  With 4GB of RAM, I need to waste 4GB of disk because of the hibernate file!
Answer: If you have any apps or drivers that are leaking memory, you will eventually run very short. This is a non-ideal world problem that may occur. Under ideal circumstances, everything should resume as usual and you can repeatedly hibernate indefinitely.
Answer: If you have a dual boot environment and you allow the other OS, say a Linux variant, access to the NTFS partitions, then hibernate is astonishingly dangerous.
If you hibernate your device, and then reboot into Linux, the NTFS file system is invariably corrupted with real data loss.
Otherwise, I use Suspend to RAM on both Windows and SLED Linux without issue.  Hibernate is ok, but it takes too long to return, so unless I plan to leave the device without power for longer than a week, I exclusively use suspend to RAM.
Answer: Drawbacks I've found is that sometimes the machine is insanely slow for awhile after coming back from hibernation, some machines won't come back at all from hibernation, and some apps will crash after resuming (things that use CUDA, like seti@home seem to be a problem, and sometimes virtual machines under the hibernated OS have issues).
Generally speaking though, hibernation has proven to be the best option for me for most times.  I very rarely ever have to close my apps anymore.  I hibernate at the end of the day, then resume right where I left off later on!
Answer: One reason not to let your computer go into hibernation is if you want to access it remotely (Remote Desktop.)
If you have a VPN connection, you'll have to reconnect after waking up the computer.
Comment: Both of these apply to shutting down, too, so this doesn't answer the question very well.
Comment: @ceejayoz: The question itself could also be interpreted in another way: "When leaving the computer for a long time [...] What are the drawbacks of hibernate instead of have it on?" But maybe you are right.
Answer: One of the drawbacks of suspend is that if the power is lost during suspend, your machine state is gone.
If you insist on using hibernation, keep in mind that hibernating 2-4 GB machine it may take quite a lot of time to save and read hibernation file. In my case,defragmenting disk and then defragmenting hibernation file helped me tremendously when disk was nearly full.
Answer:
Network connections are lost
System is not remotely manageable
It doesn't always work (example: the laptop I'm typing this on)
Comment: Points 1 and 2 are irrelevant - the question is phrased as "hibernate vs. shutting down". Your network connections are lost and the system cannot be remotely managed after a shut down, as well.
Comment: "System is not remotely manageable", wouldn't WOL still be a option?


Salting and hashing passwords, Java and PHP compatibility

Question: I'm trying to make a game that will tie into website content, and users' accounts will be shared across the site multiple versions of the client.
The problem is that the password needs to be salt-hashed in PHP, and I need to be able to verify through Java, and I can't find any information on secure cryptos (like PBKDF2) and ensuring that the generation is identical between PHP and Java.
I've seen some info on using PBKDF2 on PHP, OR Hmac with SHA-1, but not combining them as is suggested in the name of Java's "PBKDF2WithHmacSHA1". I have a handle now on the individual hashing for PHP or Java.
How do I set up the methods to be able to generate a salt and hash on PHP, store it in MySQL and be able to verify passwords through Java's hashing functions?
Would prefer to stick with PBKDF2, if at all possible (unless someone can suggest an equivalent that would work better for cross-compatibility).
P.S. Not particularly sure whether this deserved to be here or on Crypto SE. I figured, since I was asking about specific languages, I'd try here first.
Answer: Try to consider using a pre-built user and password management like JBoss KeyCloak. It is based on standards like OAuth2 and OpenID Connect, and things like password reset, user registration and social login come for free. It includes connectors for Java and JavaScript. Apparently connectors for PHP are available as well.
Answer: So, it turns out it wasn't as complicated as I was thinking it was.  I found this question that said that PHP's equivalent to Java's PBKDF2WithHmacSha1 was the hash_pbkdf2 function with the sha1 algorithm.  From there it was just a matter of transferring the salt and hash from the PHP to the Java.  Here's how it ended up:
1) PHP: For this one, I just copied the guy's pbkdf2 function and generated the salt and hash like he did.
2) Java: All that needed to happen was a bit of a change in the bytecode conversion, and it worked just fine.
After that, all I needed to do was modify the Java code to fit into my server/client setup (including secondary session hashing), and work out a few more bugs surrounding more salt and hash encoding and decoding through network transmission, and it works perfectly now.
A slightly more detailed answer is available on that other question.


What irrigation sytem air coupling is this?

Question: There is a pipe connected to irrigation system right after backflow preventer and some sort of pressure control. It has a coupling that was most likely used to winterize the system.
What kind of coupling is this? How do I connect an air compressor to it?
Answer: That's a quick coupling valve. They're often used on commercial or institutional jobs (large grounds) to provide a place for connecting a temporary hose where a permanent hose bibb would be undesirable. They're less common in a residential setting, so they're going to be hard to find in big-box retail or hardware stores. Try an irrigation supplier.
Yours looks a lot like the Rain Bird part pictured below. I suppose Hunter, Toro, Orbit, etc may also make a similar, but perhaps incompatible, part. Have a closer look at yours to see if you can find any identifying brand/logo/part number.

The mating part is called a valve key.

(Photos from sprinklersupplystore.com.)
Answer: I think your device is an atmospheric vacuum breaker that facilitates self-draining of the irrigation system via one or more automatic sprinkler drains.
Some sprinkler systems are designed in a way that there is no need to blow them out with compressed air. They use automatic drains (video here).
Water will not drain properly unless make-up air is allowed into the system. Your device, I believe, snaps shut when there is water pressure. When pressure drops to zero, the device opens to allow air to enter the pipe, which allows the drain or drains to empty the sprinkler heads and pipes.
You can test this theory by connecting compressed air using any fitting of your choice to the pipe where this device is / was connected. If you get very little water out of the sprinkler heads -- just a few spurts -- and mostly just air coming out of the sprinklers, then you have automatic drains and blowing out the system is unnecessary.
If you have automatic drains that are not working well and you want to blow out the system, you can add a T to the plastic pipe just below the device, insert a ball valve into the T and connect a male quick-connect air fitting. It seems an ideal place for it.


How do I delete edges inside my model?

Question: This is my first time working on modeling; but for some reason, there are edges connected inside the modeling and I'm not sure how to delete these.
Comment: Make your question more specific. "How can I fix this problem?" is to generic. What have you already tried? Can you provide the blend file. so people can look what's going on in your model. Can you describe when (what steps did you do) to get to this issue?
Answer: You could select the verts that are connected to these edges and then hit X >> 'Edges'. But Edge Select Mode is much better for this. You can change the select mode in the header:

Now you can simply right click them and delete them.
The faster way that might work:
In Edge Select Mode, deselect everything with A, then hit CTRLALTSHIFTM. This will select all edges that do not have 2 faces attached to them.
But your Mesh has a Mirror Modifier, so you'd have to deselect those edges. Luckily there's a third option:
Be in Edge Select Mode, select one of these edges with a right click and then choose from the header menu:
'Select' >> 'Select similar' >> 'Amount of faces around an Edge'. All orphan edges will be selected and you can hit x >> 'Edges'.

How do I delete edges inside my model?


initial state in s domain

Question: in question below I couldn't' evaluate the initial state for inductors and capacitor in order to do the s domain analysis. If you can also show me how can I draw the circuit for inital state, I would be really greatful. Thank you!
Answer: For initial conditions, assume the circuit is in a DC state. Thus inductors appear as shorts and capacitors are open. So Just treat the circuit as a resistive network at t=0.
Comment: Thank you for the answer. So can you explain how should I treat the dependent source? Should ı cancel that side of the circuit? If that so how I can calculate the initial voltage of capacitor ?
Comment: I believe node A would be node B + 2ix. Remember is(0) is 0 amps since it is a unit function.

initial state in s domain


Waving the lulav

Question: Why do we wave the lulav forward by הודו, right by כי, back by טוב, left by כי, up by לעולם and down by חסדו?
Answer: If I understand your question correctly, you ask why these words specifically get these directions.
Heard from 2 local rabbanim - The assumption is that you begin with your face (front of your body) facing east or in shul, facing the Aaron. You always wave forward 1st and then wave going in a clockwise direction (i.e. - right is next) then back, left, finally up, then down.
The right side is more important than the left corresponding to the phrase "Y'mincha Hashem Ne'adari Bakoach" (Your right hand, G-d, is glorified (may be mistranslating a bit, here) with strength.)
Up precedes down, since we usually refer to the heavens as G-d's main abode.
Can't say, offhand, where the rabbanim got this info, but it does make some sense to me.
Answer: From Rabbi Reuven Hammer in Or Hadash commentary to Psalm 118:1-20:

The four lines following halleluyah are recited first by the leader of
  the service and then by the congregation. On Sukkot, when reciting the
  first two of these four lines, we take the lulav in the right hand
  and the etrog in the left, pitam (tip) facing upward, and wave
  them six times in the following order: forward, to the right,
  backward, to the left, upward, downward. This symbolizes the presence
  of God throughout the universe. When the Name of God is pronounced, we
  hold them straight and do not point in any specific direction, since
  that would imply that God is only in that spot.
Comment: Per my reading of the question, this answer doesn't really address why we shake the Lulav in each particular direction for each particular word.

Waving the lulav


How to Cite a Supreme Court Syllabus in Chicago Style?

Question: I'm trying to cite the syllabus of a Supreme Court case in Chicago Style (Notes and Bib). Help?
Answer: The first thing you need to nail down is which "Chicago Style" you are supposed to be following. The Chicago Manual of Style, 15th Edition (2003) offers this observation (under the heading "Legal Citations," at 17.275):

Stylebooks. Citations in predominantly legal works may follow one of three guides: The Bluebook: A Uniform System of Citation, 17th edition, published by the Harvard Law Review Association in 2000; (2) the newest style guide, the ALWD Citation Manual: A Professional System of Citation, prepared and published by the Association of Legal Writing Directors and Darby Dickerson in 2000; or (3) The University of Chicago Manual of Legal Citation, 2d edition (2000),edited by the staff of the University of Chicago Law Review... Whichever system you choose, follow it consistently throughout a work.

So if you want to follow "Chicago Style" and your work is "predominantly legal," you should consult the University of Chicago Manual of Legal Citation, not the Chicago Manual of Style, for guidance. I direct your attention, in particular, to Rule 4.2(A)(c)(2) of that style guide:

Supreme Court reporters. Supreme Court cases should be cited in the following order of priority:
1st — US reporter cite if it exists.
2d — S Ct reporter cite if it exists.
3d — WL cite if it exists.
4th — LEXIS cite if it exists.

Unfortunately, as far as I can tell, the UCMLC doesn't discuss how to cite a syllabus to a Supreme Court decision; but in Rule 4.3(c) it suggests that supplementary content associated with a particular court decision may be identified in roman before the name of the case. Consequently, I would consider the following format analogous to the one it approves for "citation to online copy":

Syllabus to Maroonbook v Blue Book, 666 US 999 (2014).

where "666" is the volume number in U.S. Reports (the preferred collection of Supreme Court decisions) and "999" is the page number where the syllabus appears.
On the other hand, if your work is not primarily legal, you're back at square one, trying to figure out the relevant Chicago Manual of Style style—and that book isn't especially helpful for handling legal citations. Still, at 16.106 of the 15th Edition, CMoS provides some basis for adopting the following bibliographical style:

U.S. Supreme Court. 2014. Maroonbook v Blue Book, syllabus, 666 U.S. 999.

The allied note form, closely modeled on CMoS 17.284, would be much the same as the bibliographical form except for the shifting of the year to a parenthetical at the end of the citation, and the omission of the institutional author:

Maroonbook v Blue Book, syllabus, 666 U.S. 999 (2014).

where "1" is simply the number of the note in the relevant chapter or article.
Whatever style you adopt, you won't be able to point to a rule in Chicago that specifically endorses it, but I think that the styles I've suggested are in line with Chicago's preferences in related areas and should keep you out of trouble. For additional advice, I recommend consulting the most recent Harvard Blue Book (which I don't have) to see if it addresses your particular citation situation.


Any advantage to using SVG font in @font-face instead of TTF/EOT?

Question: I am investigating the usage of SVG fonts in @font-face declaration. So far, only Safari 4 and Opera 10 seem to support it. Firefox 3.5 does not support it but there is a bug report but no fix has been supplied yet (though there are patches).
I am wondering, with @font-face support in major browsers, what is the advantage of using SVG font format in lieu of TTF/OTF/EOT formats? The only advantage I can glean from the discussion linked above was that you can add your own missing gylphs to fonts that do not support them yet.
Is there any other reason to specify SVG fonts in CSS?
Answer: The W3C states these advantages:

One disadvantage to the WebFont  facility to date is that specifications such as [CSS2] do not require support of particular font formats. The result is that different implementations support different Web font formats, thereby making it difficult for Web site creators to post a single Web site using WebFonts that work across all user agents.
To provide a common font format for SVG that is guaranteed to be supported by all conforming SVG viewers, SVG provides a facility to define fonts in SVG. This facility is called SVG fonts.
SVG fonts can improve the semantic richness of graphics that represent text. For example, many company logos consist of the company name drawn artistically. In some cases, accessibility may be enhanced by expressing the logo as a series of glyphs in an SVG font and then rendering the logo as a 'text' element which references this font.

But the point of a common format doesn't really count because of the lacking browser support.
Answer: It seems to be the only way to use web fonts on Mobile Safari. So that's a pretty big advantage if you're developing for iPhones and iPads. Font Squirrel's @font-face generator can create the appropriate SVG file and CSS syntax from any OpenType font.
Comment: This is out of date, presumably, unless you really must support really old versions of iOS (which have a tiny usage share). http://caniuse.com/#feat=fontface
Answer: svg webfonts cannot work within an offline webapp. You can see an example here: http://straathof.acadnet.ca/beta2.2 Save this file to an idevice homepage, turn on airplane mode and open it. The svg fonts and the naming system used cause the font url to fail.
hopefully Apple fixes that soon.


The best aproach to translate a page in a web app

Question: I'm developing a web application using Spring, JSF 2 and Primefaces 3. I want the user to be able to choose from different languages. I don't want to use Google Translate. Which is the best approach to translate my website?
Answer: Are you asking how to implement this technically or how to get the content of your site translated?
For the former I trust you can find a guide or five.
For the latter if you don't want to use an automated service like Google Translate then you're going to need humans to do it for you. Unless you have multilingual friends who owe you a favor or, say, a giant, enthusiastic userbase like Facebook or Twitter has, you're not going to get this for free. Your options, basically, are to pay for the services of one of the many, many companies out there that do this, or find multilingual individuals on your own, e.g. by calling local universities' foreign language departments or international student organizations, or posting on Craigslist and the like. As with web development contractors, I think it's safe to assume you get what you pay for.
Comment: I'm asking which is the best way to implement it technically. I only need 3 languages and I believe I can manage on my own!
Comment: See the link in the second sentence of my answer. Lots of documentation on this.
Answer: Take a look at http://www.coreservlets.com/JSF-Tutorial/jsf2/#Properties
Basically, you create a properties file for each language, like messages.properties, messages_fr.properties, messages_es.properties etc. and the appropriate one is loaded according to the locale.
The user can also select the language herself, take a look at the next tutorials at that site to see how to implement it.
Answer: When you say you don't want to use Google Translate, do you men GT specifically, or any such service? Because if you're not using any translation service, you'll have to maintain versions of each page on your site in different languages. And maintain them.
Come to think of it, you probably have to take this approach as none of the online translation services provide a good enough native translation.
Answer: There's probably some commercial machine-translation packages out there, but they don't come cheap, I imagine.
Alternatively, employ an army of translators - there's websites out there where you can hire translators.
You'll probably want to do a search for translation software, then figure out how much it'd cost you.


What is the difference between Character.isAlphabetic and Character.isLetter in Java?

Question: What is the difference between Character.isAlphabetic() and Character.isLetter() in Java? When should one use one and when should one use the other?
Answer: According to the API docs, isLetter() returns true if the character has any of the following general category types: UPPERCASE_LETTER (Lu), LOWERCASE_LETTER (Ll), TITLECASE_LETTER (Lt), MODIFIER_LETTER (Lm), OTHER_LETTER (Lo). If we compare isAlphabetic(), it has the same but adds LETTER_NUMBER (Nl), and also any characters having Other_Alphabetic property.
What does this mean in practice? Every letter is alphabetic, but not every alphabetic is a letter - in Java 7 (which uses Unicode 6.0.0), there are 824 characters in the BMP which are alphabetic but not letters. Some examples include 0345 (a combiner used in polytonic Greek), Hebrew vowel points (niqqud) starting at 05B0, Arabic honorifics such as saw ("peace be upon him") at 0610, Arabic vowel points... the list goes on.
But basically, for English text, the distinction makes no difference. For some other languages, the distinction might make a difference, but it is hard to predict in advance what the difference might be in practice. If one has a choice, the best answer may be isLetter() - one can always change to permit additional characters in the future, but reducing the set of accepted characters might be harder.
Comment: @androiddeveloper: No, they don't. For example, the period / full stop (U+002E) has general category OTHER_PUNCTUATION (Po), which is not one of the listed general categories for isLetter() / isAlphabetic(), nor does it have the Other_Alphabetic property. The same is true for the other punctuation marks you mentioned.
Comment: @androiddeveloper, I take it by "characters that are used for sentences" you mean punctuation marks? Yes isAlphabetic() and isLetter() both exclude those.
Comment: Does "." and "," and other symbols used in sentences ("?", "!", ...) belong to isAlphabetic?
Comment: OK, thank you. So the isAlphabetic is only contains letters and signs that are inside of letter, but not for characters that are used for sentences. Is this an easier and better way to understand it?


Should I use Rails 3 or Rails 2.3.8

Question: I heard Rails 3 is almost ready to be released from beta, meaning its a stable version. But of course the real date still unknown.
So I'm looking for advice from a good RoR developer. Do you think I should learn and use Rails 3 RC version or use Rails 2.3.8?  If I use the RC version now will it be hard to upgrade to the stable Rails 3 version?
Is there a decent RoR developer out there than can offer some guidance?
Thanks.
Comment: http://stackoverflow.com/questions/3026912/rails-2-3-4-vs-rails-3-book-beginner-in-ror/3027463#3027463
Answer: I don't know what a rock developer (!) is, but I'd recommend going with Rails 3 rather than Rails 2.x. Rails 3 represents the future direction of Ruby on Rails, so it's worth getting up to speed with it as soon as you can. To be frank, Rails 2.x is now an evolutionary dead-end. There shouldn't be any significant changes between the Rails 3 Release Candidate and the final version.
The barriers to adopting Rails 3 you might encounter are:

its availability on your production stack
plugin/gem compatibility

For the first issue, I know that the popular Heroku for example are tracking the Rails 3 beta releases pretty closely. Regarding the second issue, not all plugins or gems are compatible at the moment, but a lot of the most popular ones are. If there are specific plugins or gems that you need to use then check here.
Answer: If you need to get a project off the ground now, then by all means go with Rails 2.3.8. It's the safe choice.
There are some significant changes in Rails 3. Some tools will be available to help you upgrade. But no automated tool will ever completely convert your 2.3.8 application to Rails 3. It's hard to tell how much effort is involved, that really depends on your application.
That said, if you are new, learning, and not expecting to release anything for several months, Rails 3 is the right choice. By the time your grok Rails and have something in production, Rails 3 will likely have stabilized, and nobody will be looking back.
Answer: Use rails 3!!  The RC is still in the pipeline, but it's more or less good to go and you won't need to make any code changes when the final release is made
Here are some reasonable resources to get you started with it

http://railscasts.com
http://www.railsdispatch.com/
http://www.teachmetocode.com/
http://rubyonrails.org/screencasts/rails3/

Should I use Rails 3 or Rails 2.3.8


How to design UISegmentedControl view swapping similar to the Facebook 3.0 app?

Question: Probably easiest to explain by example:
In the Facebook 3.0 app, if you click on a friend, it shows "Wall | Info | Photos" in a UISegmentedControl, which acts like a UITabViewController. If you then click on, say, a photo, it pushes a sub view onto the UINavigationController stack, which slides the UISegmentedControl (and parent view) to the left. How would I structure my app design to facilitate this?
I.e. it may be:

UIViewController (with UISegmentedControl containing three items (representing three views)
---UINavigationController
-------UIViewController (i.e. Wall)
----------UIViewController (i.e. Comments on a post, gets pushed onto the stack)
---UINavigationController
-------UIViewController (i.e. Info)
etc...

The question is, if I design it as above, how will I get the UISegmentedControl to slide away with the Wall view if the user clicks on the comments to a post (which pushes the comments view onto the navigation controller's stack)? This seems non-optimal.
Or, I could place the UISegmentedControl inside each of the UINavigationControllers as a subview, but I'm not sure how I would move it between UINavigationControllers as the user switches between "tabs" while maintaining state...
Is there an easier way to design the layout of views?
Answer: Have a look at the Three20 lib by Joe Hewitt.  It's hosted on GitHub.


clear reason behind using session_id and session_name in php?

Question: why do we actually use session_id and session_name in PHP i know it is for security purpose but am not getting clear picture some-one give me some guidance or advice....?
please
Comment: `session_id` used to store session id and `session_name` is used to store session name
Comment: http://stackoverflow.com/questions/13952582/what-exactly-is-session-id-and-session-name-explain-how-they-are-being-us?rq=1
Answer: 1)Sessions work by creating a unique id (UID) for each visitor and store variables based on this UID.
2)Session store value in server so in server all data are unique for each other.
Comment: are they machine dependent ?
Answer: There is not any major difference behind this though, you can use session_id and/or session_name, they are used to store id and name respectively.
session_id and session_name are to get and set the current session ID and session ID name (default is PHPSESSID). session_regenerate_id can be used to regenerate/change the session ID of the current session. This might be useful if, for example, you want to refresh the session ID every 10 minutes or after changing the state of authenticity of a user associated with a session.
The format of a Session Id is AFAIK unique to each and every vendor.
Session Ids have the possibility to be reused though. If the session on
machine A times out then that id could be regenerated for machine B. One
this that should be true, however, is that not 2 distinct sessions, whether
from different browser sessions on a single machine or different machines,
should have the same session Id at the same point in time.
To get a handle on how it 'could' be implemented why not take a look at the
Tomcat source code/documentation and havea look at how it handles sessions ?
http://jakarta.apache.org/tomcat/index.html