How do I know if root account has been compromised?

Question: My server was hacked with some files being overwritten to generate spam links on the index page. All my previous backups contain the same modified files, making the nuking from orbit option a puke. If the server root has not been compromised, I intend to just clear the infection and monitor further. What are the signs to look out for to determine if my root has been compromised?
Comment: Ok. Maybe you should add which distribution and version.
Comment: Which operating system?
Comment: Install an identical system, physically mount both hdds on a system, check for differences
Comment: @S.L.Barth, linux.
Comment: check the history file for commands that you didn't execute? else look for gaps in the file to indicate deleted entries?
Answer: Your computer has been rooted if an unauthorized user (how defined? becomes difficult on systems with many accounts) has gained access to it. If JoeUser is an account with little access to anything of importance (how defined? by whom? how is importance level tracked?) nothing much might be lost, but any unauthorized (ie, hostile) access has the potential for further breaches, given the way ordinary humans behave -- see the movie War Games for an entertaining and not too fantastic account with drama, or the Cuckoo's Egg by Cliff Stoll for a much more realistic, though still dramatic account from reality. Things have not improved much since Stoll's little adventure (and the browser / web / server / live database Internet has made things vastly more dangerous), and official (govt., corp., org., ...) resources are still pretty clueless.
On the other hand, if JoeUser is the local superuser account, any breach is more or less disastrous, as everything on the machine(s) is in principle completely lost. All data, all configuration information, and probably all connectivity information (topology, all passwords (if users have been foolish), ...). An attacker will likely want to continue to have access to the machine(s) and so will try to so configure the system as to perform normally, save that when the attacker wants access for further depredations, it is still available to him.
The techniques used for such things are as varied as people's imagination and low cunning.  They are usually called rootkits. Since very few people are really good at this sort of thing, and since many attackers are scriptkiddie level folks, techniques are often reused. There are several rootkit scan programs (some good, some not so good, ...) which can find the traces left by some (perhaps many) of these schemes. But if the rootkit scanner you choose is not aware of whichever rootkitting technique was used on your machine, you won't hear about it. Or, even worse, what about the situation in which the rootkitting attack on your machine isn't traceable by a looking for traces on your disk or machine memory, or is really new and none of the rootkit scanning programs have any provision for finding evidence of it?
In actual reality, you won't generally have the time, nor sufficient expertise on your particular machine (OS), to find rootkit traces that no scanner can find. Thus as a practical matter, the reformat / reinstall from trusted media / reconfigure / acceptance test / pray option is likely the only one with any real credibility.
In your case, you may not have been rootkitted. Depending on the configuration of your server software, root access may not have been required to do the spam distribution you report. IF that is so, you may be able to merely reformat the server's partition (if hat's how you had it setup) / reinstall / .... Inappropriate configuration of the server and its resources (files, access to executables, and other accounts' files (eg, read only for SSL operations, special configuration files, exec PATH setup in the environment, ...) may have been the entry point.
Make sure your server is correctly locked down to prevent such access, not an easy task. Requires considerable time and expertise in following the boards, books, conferences, ... to be sure you're up with the current best practice -- which, of course, may have hidden vulnerabilities no one currently is aware of.
There are no easy answers.  is not available and will not be until Internet standards are rather less porous than they are currently.
Comment: One additional note: You can use an external scanner off a CD or DVD, which you can trust to some extent (except against the canonical Three Letter Agency). Microsoft has a bootable scanner, and you can use the linux boot dvd's to look for 'known' rootkits (I dont know of specific linux software to do this).
Comment: Or you could scan the hard drive when mounted on a known good computer with appropriate protection against getting the good computer hacked.


API to get water body names by coordinates

Question: We have some geometry records - water bodies in a DB which does not have name. I have tried to use Google Geocoding to extract them but it seems that it is more suitable for addresses. Is there any API to get water body names by coordinates?
Answer: You can try BigDataCloud's reverse geocoding API: https://www.bigdatacloud.com/geocoding-apis/reverse-geocode-to-city-api
This API is based on the administrative/non-administrative boundary and provides the name of the smallest region which can be land or water.


Events of adding/editing catalog rule

Question: Are there any event will be dispatched after the user adding/editing the rules in Promotions->Catalog price rules/Shopping cart price rules, i'm going to write a module to log these actions.
Answer: I think you can use catalogrule_rule_save_before and catalogrule_rule_save_after.
You can get the rule object in your observer like this:
public function doSomething($observer) {
    $rule = $observer->getEvent()->getRule();
    //do something with $rule
}

Comment: how about adminhtml_controller_salesrule_prepare_save?
Comment: @hkinterview. That could work. But that won't get dispatched if I call `$rule->save()` from outside the admin controller. In the way I described it, it works independently from the place you call the `save`.
Answer: Hook onto the event: salesrule_rule_save_after and catalogrule_rule_save_after for shopping cart and catalog rules respectively. Also, to just be on the safe side you could check in the observer you are going to create that the admin session is active before you log what you need to from the admin session.
The model corresponding to the Shopping cart rules is salesrule/rule and it has a event prefix of salesrule_rule so whenever this model is saved the event : salesrule_rule_save_after will be dispatched.
Comment: how about adminhtml_controller_salesrule_prepare_save?
Comment: This wouldn't work for catalog pricing rules.

Events of adding/editing catalog rule


SPI driver for communication

Question: I want to load my kernel module which communicates with my device over spi interface. I have tried loading my modules but it's showing spidev is already installed.
I see 2 modules named spidev and spi_bcm2835 already installed.
Can I know what does these modules do and help me in running my use case?
Also, I have tried removing spidev module but only driver is getting registered but probe is not getting called.
Comment: I am confused.  Raspbian stretch has built in SPI, IC, UART.  So it is not necessary to load the kernel modules yourself.
Comment: I am also confused of your use of the term "use case".  Are you talking "UseCase
Analysis" using the "UML/SysML" language?  I also don't understand "probe not getting called".  All sounds scary to a SPI newbie like me.  BTW the SPI newbie, ie, me is now learning how to build a SPI touch LCD kernel module.  He finds building a SPI kernel module very very hardt, not to mention developing one! :) https://raspberrypi.stackexchange.com/questions/98549/lcd-tft-screen-2-8-ili9341-spi-connect
Comment: My above link to SPI kernel module building tutorial by developer uju on GitHub is very newbie friendly, with detailed instruction and explanation on how to remove unwanted old SPI touch LCD kernel module and build your own new SPI touch LCD kernel module.  Perhaps you can let us know more about your SPI kernel module, if it is also on GitHub.
Comment: Newbie True or False Qustions: (1) A kernel module is a compiled code that can be inserted into the kernel at run-time. (2) A driver is a compiled code that runs in the kernel to talk to hardware device. (3) A large part of a running kernel is driver code. (4) A driver may be built statically into the kernel file on Rpi SD card. (4)
A driver may also be built as a kernel module so that it can be dynamically loaded later. (5) Not all kernel modules are drivers. (6) Some drivers are kernel modules. (7) A device tree is a kernel tree. (8) A kernel tree is a device tree.
Comment: "I want to load my kernel module which communicates with my device over spi interface." - I am very confused.  Can you tell us what is your "device"?  Is it an SPI ADC such as MCP3008, or a SPI IO thing, such as MCP23S17?
Comment: @tlfong01, sorry for confusing you.
What I want to do is: I want to load my driver which communicate over spi interface with my device.
But some module that's already present is not letting my driver to communicate with the device.
Comment: And I don't have my driver on Github. It's proprietary.
Comment: And regarding probe, probe is the function/call back called. by the kernel module, when a device info matched with the info provided by the device specific driver.
Comment: Thank you for your explanation.  But what confuses me is the following: (1) For the last 10 years as a Arduino and Rpi hobbyist, I have been writing drivers for sensors and actuators etc, and my drivers interface with SPI, I2C, UART, and also GPIO etc. I know I can use Raspbi Config to enable/disable Rpi's SPI/I2C/UART drivers etc, by commenting out the /boot/config.txts' dtoverly statements.  What puzzles me is that you can do the very hard thing of writing a SPI kernel module, but you seem not to know the very simple thing of disabling a conflicting SPI kernel module.
Comment: I'm very new to work on SPI as well as Raspberry.

What do you mean by conflicting?
Is there anything that I have to change in my driver?
Comment: Ah, I did not realize that you are new to SPI and Rpi.  I know your kernel module is  proprietary, but perhaps you would at least let us know which platform and lanuage you are using: Arduino C++ or  Win10IoT F#?  To prevent further misunderstanding, I am drafting an answer.  Please comment if my brief description of your question in my answer is totally wrong, or more or less OK?
Comment: Thanks a lot @tlfong01

My driver is written in c.

And I didn't install any kernel module. I'm just installing my driver.
Sorry If my question is misleading.
Comment: You are welcome.  No hurry, take your time.
Comment: Ya this is what i want and I also want to know what does spidev and spi_bcm2835 modules do and their differences?
Comment: Well, let us start with spidev, and forget spi_bcm8235 for now.  To understand the spidev linux kernel driver, you need to have a very rough idea of what is DT, Device Tree, and DTO, DTB etc, and also the boot loader (which is in Rpi's ROM, I guess).  You might need to look at how a python/C module uses the spidev kernel driver to interface with a SPI device, such as a SPI touch LCD screen.  I have summarized some points in the Appendices.
Answer: Congratulations on writing a kernel module.  That is quite hard.
The only thing which loads SPI on a modern Linux system will be device tree.  You need to search /boot/config.txt and comment out or remove all SPI related lines.  I believe most such lines will contain spi.  You then need to reboot.
Comment: "only thing" ... for many drivers, you can bind devices to drivers via sysfs.
Comment: @domen I didn't know that.  If you want edit my reply to add that information or post a link and I will add it.
Comment: I read that to run/launch a kernel module, eg, the ili9341 SPI touch LCD kernel module, the "only thing" you need to do is edit the file /etc/rc.local, adding the following line:
sudo /path/to/fbcp-ili9341/build/fbcp-ili9341 &
Answer: Question

I want to load my kernel module which communicates with my device over spi interface. I have tried loading my modules but it's showing
  spidev is already installed.
I see 2 modules named spidev and spi_bcm2835 already installed. Can I know what does these modules do and help me in running my use case?
Also, I have tried removing spidev module but only driver is getting registered but probe is not getting called.
I'm very new to work on SPI as well as Raspberry. What do you mean by conflicting? Is there anything that I have to change in my driver?

Answer
Brief description of the OP's question.
He has developed a kernel module and wishes to run in Rpi Raspbian with SPI interface.  He found that Raspboian already has two drivers installed:

(1) spidev,
(2) spi_bcm2835.

He was wondering if he should

(a) remove those two SPI drivers, or
(b) interface with those two drivers.

/ to continue, ...
References
/ to add later, ...
Appendices
Appendix A - What is the difference between kernel drivers and kernel modules?
Reading notes

A kernel module is a bit of compiled code that can be inserted into
the kernel at run-time, such as with insmod or modprobe.
A driver is a bit of code that runs in the kernel to talk to some
  hardware device. It "drives" the hardware. Most every bit of hardware
  in your computer has an associated driver. A large part of a running
  kernel is driver code.
A driver may be built statically into the kernel file on disk. A
  driver may also be built as a kernel module so that it can be
  dynamically loaded later. (And then maybe unloaded.)
Standard practice is to build drivers as kernel modules where
  possible, rather than link them statically to the kernel, since that
  gives more flexibility. There are good reasons not to, however:
Sometimes a given driver is absolutely necessary to help the system
  boot up. That doesn't happen as often as you might imagine, due to the
  initrd feature.
Statically built drivers may be exactly what you want in a system that
  is statically scoped, such as an embedded system. That is to say, if
  you know in advance exactly which drivers will always be needed and
  that this will never change, you have a good reason not to bother with
  dynamic kernel modules.
If you build your kernel statically and disable Linux's dynamic module
  loading feature, you prevent run-time modification of the kernel code.
  This provides additional security and stability at the expense of
  flexibility.
Not all kernel modules are drivers. For example, a relatively recent
  feature in the Linux kernel is that you can load a different process
  scheduler. Another example is that the more complex types of hardware
  often have multiple generic layers that sit between the low-level
  hardware driver and userland, such as the USB HID driver, which
  implements a particular element of the USB stack, independent of the
  underlying hardware

Appendix B - Example of a statically bound driver module
Reading Notes

To add the DS18B20 One Wire Temperature Sensor driver module to the device tree, add the following line in /boot/config.txt
dtoverlay=w1-gpio,gpiopin=14

Appendix C - Example of a dynamically bound kernel module
Reading notes

To launch the ILI9342 touch LCD kernel module at startup, add a line
  in the file /etc/rc.local
sudo /path/to/fbcp-ili9341/build/fbcp-ili9341 &

Appendix D - Device Tree Overlays (DT, DTB, DTO, Boot Loader etc) - Android Source
Reading Notes

A device tree (DT) is a data structure of named nodes and properties
  that describe non-discoverable hardware. Operating systems, such as
  the Linux kernel used in Android, use DTs to support a wide range of
  hardware configurations used by Android-powered devices. Hardware
  vendors supply their own DT source files, which Linux then compiles
  into the Device Tree Blob (DTB) file used by the bootloader.
A device tree overlay (DTO) enables a central device tree blob (DTB)
  to be overlaid on the device tree. A bootloader using DTO can maintain
  the system-on-chip (SoC) DT and dynamically overlay a device-specific
  DT, adding nodes to the tree and making changes to properties in the
  existing tree.
This page details a typical bootloader workflow for loading a DT and
  provides a list of common DT terms. Other pages in this section
  describe how to implement bootloader support for DTO, how to compile,
  verify, and optimize your DTO implementation, and how to use multiple
  DTs. You can also get details on DTO syntax and required DTO/DTBO
  partition formatting.

Appendix E - Python SPI Kernel Driver [Project]

This project contains a python module for interfacing with SPI devices
  from user space via the spidev linux kernel driver.
import spidev
spi = spidev.SpiDev()
spi.open(bus, device)
to_send = [0x01, 0x02, 0x03]
spi.xfer(to_send)

/ to continue, ...

SPI driver for communication


Latkes with applesauce

Question: If one eats a latke with applesauce should he make a bracha on the applesauce (is the applesauce considered tafel to the latke ? )
Comment: I cant imagine the applesauce being the ikkur
Comment: @DanF Latkes are probably HaAdama, unless you're using pureed packaged potato-food to make them. But then who wants to eat them anyway?
Comment: In most cases, both the latkes and the applesauce get the same bracha - *shehakol*. Thus, it wouldn't matter. Unless you have chunky applesauce.
Comment: @DoubleAA My understanding (I could be wrong) is that unless the potatoes are "visible" as potatoes, it's shehakol. Most people I know, say *shehakol* on potato kugel (perhaps, there are different minhagim). Latkes are essentially made the same way as kugel except kugel is baked, latkes are fried. Those "potato buds" or what I call summer camp potatoes are ugly. I consider it "chometzdik" potato starch. I might as well use my left-over Pesach potato starch.
Comment: @DanF it depends if it's shredded or not. If it is then it's *ha'adamah*; if not, *shehakol*.
Comment: How do you know the oil isn't the ikkar? ;)
Answer: Brachot.org writes:

The tofel item needs to be eaten along with the Ikar.[Shaar HaTzion 212:21, Vezot HaBracha (pg 89). Even though the Laws of Brachos (pg 209) seems to argue on this, it clear from his examples and footnote that he's not arguing but just is using different terms than the Shaar HaTzion.] For example, apple sauce with latkes would be considered tofel and wouldn't require its own bracha. If there is leftover applesauce it does not require another Bracha, however, if one takes more applesauce it will require a Bracha.[Halachos of Brachos (pg 59-60)]

Latkes with applesauce


Question for philosophers - How would you call the following view of the meaning of life?

Question: Question for philosophers - How would you call the following view of the meaning of life?: "There isn't much point in assessing the intrinsic or extrinsic value or meaning of life. Accept life as it is - even if it's futile or absurd - and simply focus on living."
Comment: Please clarify in what sense words intrinsic and extrinsic have been used and why you need them.
Comment: It sounds like a crude version of [existentialism](https://en.wikipedia.org/wiki/Existentialism).
Comment: Some kind of Epicureanism, I guess.
Comment: Does this answer your question? [What is the meaning of "meaning of life" and why do people seek it?](https://philosophy.stackexchange.com/a/12672/9148)
Answer: This would be a good piece of advice only if you thought of humans only as  animals having some intelligence.
Not all human beings can focus on life alone (as you believe) because human beings have great intellectual capacity. This will motivate them to discover new areas of life. They will also try to maintain what they attained. Gradually they will try to find solutions about existence and about their own existence. If humans are the highest of all living things, it is an inevitable natural process for perfection.
So your philosophy will not work as one that applies to everyone.
If the great were born into this world, the following quote would not be in vain.

Each soul is potentially divine. The goal is to manifest this divinity
within by controlling nature, external and internal. Do this either by
work, or worship, or psychic control, or philosophy – by one or more
or all of these-and be free.
-- Swami Vivekananda

https://www.swamivivekananda.guru/2017/04/26/each-soul-is-potentially-divine/


Is it possible to read SMS with broken touch and disabled usb debug?

Question: I've just broken my touch screen, but there is an extremely important text message in my device. USB debug is disabled, and I can't enable it because touch is broken. :\
Is it possible to reach that SMS somehow? Could it be reachable via Google services somehow? The device is functional and is connected to internet.
Comment: You might wish to check: [How do I backup data (SMS/contacts) from a device with a broken screen?](https://android.stackexchange.com/q/25646/16575)
Answer: If your device has a USB OTG port (My Xperia Z1 Compact and Nexus 7 do, and I believe most recent devices do) you may be in luck - get a USB OTG adapter (mine was from a pound shop - if your in the uk try Poundland) and a USB mouse - plug them in to your phone and you can then control it.
Its a bit of a faff at first but better than nothing.
Comment: And I always seems to forget that mouse and keyboard can easily be connected in Android like with any other Linux system. :-)
Comment: Yupp. And if the device has an HDMI port, a matching cable and TV might solve the issue with "visibility" – if the device is lacking that as well :)


jQuery MultiSelect uncheck by Index, not by val()

Question: I'll try to make this sensible...
Using jQuery multiselect checkbox plugin. Options are added dynamically via AJAX call.  When user selects an item/option and closes the selectbox, the item is added to the UI along with a "Remove" icon.  The icon has an ID added to it dynamically so that User can remove the item from the UI which I also want to uncheck from the closed selectbox.  The ID that's added is the "value" of the selected option so that I can associate the item on the UI with the option in the selectbox.  This works great when the Value is short (less than 2 words).  But when the value is larger than 2 words, I get an error: "unrecognized expression: checkbox[value=xxxxx]".  This error is thrown from jQuery:
<code>Sizzle.error = function( msg ) {
    throw new Error( "Syntax error, unrecognized expression: " + msg );
};
</code>
Comparing the actual Value with the "msg", it appears the jQuery is truncating the ID after 2 words and so can't match it to any know selectBox Value.
Okay, so I decided to use the "index" of the selected item and add it to the "remove' icon (along with an identifer) which would associate it with the selected option in the Selectbox.  When removed from the UI, I strip the identifier and just use the Index.  My problem is that I can't uncheck the thing.  I've tried this:
<code>$('select#'+cOption).multiselect("widget").find(":checkbox[index="+delVal+"]").each(function() {
                this.click();   // Remove check from deleted option
</code>
No error, just no uncheck.
I'd post the whole thing but it's quite large and somewhat complex.  Basically I just want to uncheck a selected option by Index rather than Value.
Comment: what is `delVal`?  the index or value?
Comment: As mentioned... "I strip the identifier and just use the Index".  It's an integer from 0-4 (5 selections, max).
Answer: Use
<code>$('select#'+cOption).multiselect("widget").find(":checkbox[index='"+delVal+"']").each(function() {
                this.click();  });
</code>
instead of
<code>$('select#'+cOption).multiselect("widget").find(":checkbox[index="+delVal+"]").each(function() {
                this.click();
</code>


Trying to create a map with co-ordinates

Question: I'm trying to create a map with the co-ordinates for the location but if i select map units it creates black boxes in the corners of the map instead of a line of co-ordinates. If I used centimeters it puts the co-ordinates in the correct places but they are the same for latitude and longitude which is incorrect. I have ensured that the CRS is set correctly for the grid and the map and I'm struggling to work out how to rectify this. Below are screenshots to show the output I am getting.
Answer: When you chose map units for your grid they are in metres (like the OSGB Grid you are using) so you need to add a reasonably large spacing - I like 100,000m (or 100km) like this:

Or you can use Lat/lon by changing the crs of the grid to EPSG:4326 and using a 1 degree separation like this (notice how the lines are no longer straight):

You hardly ever want to use cm as those are just measured along the page and have no relation to the map whatsoever.


Can I build an app that works with TFS2008 as well as TFS2010? How?

Question: I am compiling some code that interacts with TFS2008, and I'd like to update it to support TFS2010 as well.
I tried compiling the existing code against the TFS 2010 assemblies (installed with Team Explorer 2010, available on my machine in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies), and got a compile-time warning:

warning CS0618: 'Microsoft.TeamFoundation.Client.TeamFoundationServer' is obsolete: 'The TeamFoundationServer class is obsolete. Use the TfsTeamProjectCollection or TfsConfigurationServer classes to talk to a 2010 Team Foundation Server.

That brings up the question - will it be possible to have a single code base that communicates with TFS2008 as well as TFS2010?
If I "upgrade" to use TfsTeamProjectCollection (etc) in order to be able to connect with TFS 2010, will the updated code be able to connect with TFS 2008?
Is it a better idea for me to fork the code, and maintain two sets, one to connect to TFS 2008, and one to connect to TFS 2010?
Looking for some insight.
Answer: The TFS 2010 API will work for both 2008 and 2010 TFS servers.


How is the harmonic map related to the second fundamental form?

Question: For a smooth $f $ between (pseudo-)Riemannian manifolds $M$ and $N$, the harmonic maps equation (or the wave maps equation) is:
$$
\text{trace} \nabla \text d f = 0
$$
where $\nabla$ is the Levi-Civita connection induced on $T^*M \otimes f^* TN$ and $\text d f = \frac {\partial f^i}{\partial x^\alpha} \text d x ^\alpha \otimes \frac{\partial}{\partial f^i}$ is a section of $T^* M \otimes f^* TN$. If we write out the equation in coordinates, we see that
$$
\Delta_g f = - g(\text{grad} f^\alpha, \text{grad}f^\beta) {}^h \Gamma_{\alpha \beta}^i \partial_i
$$
where ${}^h \Gamma_{\alpha \beta}^i$ is the Christoffel symbol on $N$. I have seen the claim that if $N$ is an immersed submanifold of Euclidean space, then the harmonic maps equation becomes
$$
\Delta_g f = - \text{II}(\nabla_a f, \nabla^a f)
$$
where $\text{II}$ is the second fundamental form of $N$. But I cannot see how this would follow from the previous expression. I also suspect this holds so long as $N$ is an immersed submanifold of some larger ambient manifold, so I believe the proof could possibly proceed without appealing to coordinates. Is there a thorough reference that explains this connection?
Answer: Here are some references where the authors explain this fact:

Fanghua Lin & Changyou Wang's The Analysis of Harmonic Maps and Their Heat Flows (pages 2 and 3)
Struwe's chapter on Nonlinear partial differential equations in differential geometry (page 262).

Other references that talks about harmonic maps:

Frédéric Hélein and John C. Wood's chapter (#8) from Handbook of Global Analysis
Jürgen Jost book Riemannian Geometry and Geometric Analysis chapter 9.
Richard Schoen and Shing-Tung Yau's book Lectures on Harmonic Maps


Practical Tcpdump examples?

Question: I want to collect tcpdump examples, as many as possible!

E.g.: how to filter FTP passwords on eth0; OR how to filter HTTP 404 errors, etc.
Answer: It doesn't do any filtering, but this example creates a handy continuous packet sniffer:
tcpdump -n -C 128 -W 100 -z /home/user/compress_logs.pl -i br0 -w /home/user/packetlogs/packetlog.pcap &

-n don't do reverse lookup on IPs, don't convert port numbers to text descriptions, don't convert MAC addesses to names, etc..
-C 128 rotate capture files every 128,000,000 bytes
-W 100 limit the number of capture files being rotated (see -C) to 100
-z /home/user/compress_logs.pl run script compress_logs.pl on each rotated capture file
-i br0 capture on interface br0
-w /home/user/packetlogs/packetlog.pcap use file name /home/user/packetlogs/packetlog.pcap
& this is parsed by bash; indicates that the command should be run in the background (asynchronously)

Put it in /etc/rc.local to run on boot. It captures all packets on interface br0, which could be two interfaces in-line as a tap or two interfaces hooked to a passive tap, or one interface hooked to a mirrored switch port (I've used all three in practice)
It writes ~128MB files and will automatically rotate up to 100 of them. When it captures 128MB of data, it will close the file, open a new one, and fork the specified command with the old filename as an argument - in this case a little Perl script that compresses the previous capture file for quicker transfer off the IDS server.
I use this when I have to monitor a connection for a long time (like a day or two) and need to go back and find an event that occurred at a specific time. The small files are much easier to handle in Wireshark than one huge pcap file.
Comment: this ones the best so far :)
Answer: Capture only HTTP POST data:
tcpdump tcp[2:2] = 80 and \(tcp[20:4] = 1347375956
or tcp[24:4] = 1347375956
or tcp[28:4] = 1347375956
or tcp[32:4] = 1347375956
or tcp[36:4] = 1347375956
or tcp[40:4] = 1347375956
or tcp[44:4] = 1347375956
or tcp[48:4] = 1347375956
or tcp[52:4] = 1347375956
or tcp[56:4] = 1347375956
or tcp[60:4] = 1347375956\)

A bit unwieldly but certainly useful. tcp[2:2] captures, starting from position 2 of the TCP header, 2 bytes (which are the port, port 80 being for HTTP traffic).
Then we want to compare the first 4 bytes of TCP data to 'POST'. The TCP header is minimum 20 (decimal) bytes, but since the TCP options are variable length, from 0 to 40 bytes (padded to a 32-bit boundary and starting at ), we have to test every 4 bytes from 20 to 60 (decimal). Finally, 1347375956 is the base10 big-endian binary representation of the ASCII text 'POST'. Use the values below for other HTTP types:

GET 1195725856 (includes the space after 'GET' which is needed because we are comparing with 4 bytes)
POST 1347375956
PUT 1347769376 (includes space)
DELETE 1145392197 (just 'DELE', actually)

For other types, convert the 4 ASCII characters to hex (you must use 4 characters exactly), then treat the hex bytes as one number and convert it to decimal. For example, POST is 50 4f 53 54. 504f5354 converted to decimal is 1347375956.
Answer: Capture everything to a file (so you can analyze it later with Wireshark or something):
sudo tcpdump -i en0 -s0 -w ~/capture.pcap

-i en0 capture on interface en0
-s0 use the whole packet (don't truncate -- snarf 0)
-w ~/capture.pcap write to packet capture file ~/capture.pcap
Answer: Filter-making cheat sheet:
http://staff.washington.edu/dittrich/talks/core02/tools/tcpdump-filters.txt
Comment: Wireshark has provided a very useful tool for creating filters: https://www.wireshark.org/tools/string-cf.html
Answer: If you want to monitor clients DNS requests on an OpenWRT router:
tcpdump -n -i br-lan dst port 53

-n don't do reverse lookup on IPs, don't convert port numbers to text descriptions, don't convert MAC addesses to names, etc..
-i br-lan capture on interface br-lan
dst port 53 filter destination port 53, the port for DNS service

Practical Tcpdump examples?


Can a pipe in Linux ever lose data?

Question: And is there an upper limit on how much data it can contain?
Comment: its lose not loose. loose is a loose tooth
Comment: @intuited: bad delimiter ")" (missing open parenthesis)
Comment: made my day, 4 more characters go :)
Answer: Barring a machine crash, no it can't lose data.  It's easy to misuse it and think you're losing data however, either because a write failed to write all the data you requested and you didn't check the return value or you did something wrong with the read.
The maximum amount of data it can hold is system dependent -- if you try to write more than that, you'll either get a short write or the writer will block until space is available.  The pipe(7) man page contains lots of useful info about pipes, including (on Linux at least) how big the buffer is.  Linux has buffers of 4K or 64K depending on version.
edit
Tim mentions SIGPIPE, which is also a potential issue that can seem to lose data.  If the reader closes the pipe before reading everything in it, the unread data will be thrown away and the writer will get a SIGPIPE signal when they write more or close the pipe, indicating that this has occurred.  If they block or ignore the SIGPIPE, they'll get an EPIPE error.  This covers the situation Paul mentioned.
PIPE_BUF is a constant that tells you the limit of atomic writes to the buffer.  Any write this size or smaller will either succeed completely or block until it can succeed completely (or give EWOULDBLOCK/EAGAIN if the pipe is in non-blocking mode).  It has no relation to the actual size of the kernel's pipe buffer, though obviously the buffer must be at least PIPE_BUF in size to meet the atomicity guarentee.
Comment: I actually abandoned my answer after loading this one. You may want to mention SIGPIPE, http://en.wikipedia.org/wiki/SIGPIPE
Comment: There might be a scenario where you kill the writer or the reader so the writer thinks it's written something that the reader hasn't read?
Comment: PIPE_BUF in limits.h will tell you how big the limit is. sysconf() with _PC_PIPE_BUF can tell you at runtime (on linux anyway)
Answer: Data can be lost in a pipe when the following happens:

A process (the writer) writes n bytes of data to the pipe, where n≤PIPE_BUF. This write is guaranteed to be atomic and will never block.
A process (the reader) reads only m<n bytes of data and exits.
The writer doesn't attempt to write to the pipe again.

As a result, the kernel pipe buffer will contain n-m bytes which will be lost when all handles to the pipe have been closed. The writer will not see SIGPIPE or EPIPE since it never attempts to write to the pipe again. Since the writer won't ever learn that the pipe contains leftover data that will simply disappear, one can consider this data lost.
A non-standard way of detecting this would be for the writer to define a timeout and call the FIONREAD ioctl to determine the number of bytes left in the pipe buffer.
Comment: Shouldn't that be FIONREAD? Note on Linux at least FIONREAD indicates how much data is unread on the write descriptor (stdout for example), but doesn't seem to indicate the reader has gone away. It seems useful to me if there was a mode to have the kernel send a SIGPIPE to the writer if the reader went away without reading all of the data
Comment: Thanks, fixed the typo. Indeed, `FIONREAD` doesn't indicate whether the reader has gone away, hence the need to define a time-out. Yea, I would also find it useful if `SIGPIPE` were sent.
Answer: If you are referring to using the | operator in the shell then no, it will not lose data.  It merely connects the app on the left side's standard output stream to the app on the right side's standard input stream.  If you are piping data between apps and aren't getting the results you expect, try using > to redirect standard output from the first app to a file and then use < to use that file as standard input for the second app.  That way, you can inspect the file amd make sure the data is being sent in the format you expect.
If you mean a pipe created by the pipe function then the answer is still no.  According to this man page, writing to a full pipe will block until enough data has been read to make room for the write data.  It also states that the size of a pipe is 4KB in Linux pre-2.6.11, and is 64kB on 2.6.11 and later.
Answer: Your pipe isn't losing data.  If you're losing data in your application, try debugging it with gdb.
A couple of things to look for:
1) Is your buffer large enough to hold all the data that you're reading?
2) Check the return codes from your read() on the pipe for errors.
3) Are you sure you're writing all of the data to the pipe?
4) Is your write/read operation getting interrupted by a signal?  ie: SIGPIPE?
Answer: The reason you will not lose data is that when the buffer associated with the pipe fills up a call to write will block until the reader has emptied the buffer enough for the operation to complete.  (You can do non-blocking writes as well, but then you are responsible for making sure you complete any writes that would have blocked.)

Can a pipe in Linux ever lose data?


What happens when you apply the path integral to the Einstein-Hilbert action?

Question: The Einstein Field Equations emerge when applying the principle of least action to the Einstein-Hilbert action, and from what I understand the path integral formulation generalizes the principle of least action. What happens when you apply the path integral instead of the action principle to the Einstein-Hilbert action?
Answer: Your questions essentially amounts to ask

How do we quantize GR?

which is the starting point of quantum gravity (QG). GR is a non-renormalizable theory, at least from the traditional perspective of perturbation theory in QFT. So the path integral with the (exponentiated) Einstein-Hilbert action as weight factor cannot easily be used to make meaningful physical predictions. New approaches to QG are needed, such as e.g. string theory (ST).
Comment: So, the integral over the paths diverges if you do try to take it?
Comment: @user1825464 Well, the Euclidean version of the Einstein-Hilbert action is unbounded from below, so the path integral blows up when you try it.
Comment: Is that specific to the Euclidean version?
Comment: @user1825464 "This unboundedness [of the Einstein-Hilbert action] is caused by the conformal mode of the metric, whose kinetic term enters the kinetic term of (both the Lorentzian and Euclidean action) with the "wrong" sign." Page 12 of [arXiv:1203.3591](http://arxiv.org/abs/1203.3591).
Answer: The other answer and its comments are on point. I just wanted to add a little something. "What happens" is a kind of vague question. Like, what would you say "happens" when we put the action for a particle into the path integral?  In any case, I thought the question might partially be asking "what would it mean to do this?" In the case of QM, we integrate over the space of all possible paths for the particle; in QFT, we integrate over the space of all possible field configurations.  And quantum behavior arises from the fact that paths other than the classical one contribute something to the path integral - they happen in some sense, too. Thinking along these lines, what "happens" for the EH action in the path integral is that we now integrate over the space of all metrics - the "right" one (the one that solves the EFE) is no longer the only one that contributes to the path integral.
Comment: I think "What happens" is a perfectly unambiguous question. The asker clearly understand what the path integral means; (s)he is asking what kind of results we get if we do that.
Comment: Not interested in arguing the point but I'm not sure what makes it clear to you that the asker understands what the path integral means.  All they say is "from what I understand the path integral formulation generalizes the principle of least action."  That's hardly exhaustive.  They very well might know all about it, but it wasn't clear to me from the post.
Comment: Besides, what's the harm in the answer even if they did know this?  It might be of interest to someone else, and if not, please, by all means ignore it :)
Comment: Don't get me wrong - I wasn't chastising them, and there's nothing wrong with not being familiar with some concept. "[F]rom what I understand" just doesn't sound like someone who's formally studied it.  And then there's the question in the comments about the Euclidean action, which suggests they may not be familiar with Wick rotation (and how unboundedness from below in the Euclidean version has consequences in the Minkowski version).  But really, we're just speculating with limited evidence about what someone knew or didn't know. I think I've spent enough time on that now.  Cheers!
Answer: There are many issues associated with the path integral definition of the gravitational action, but here is one in particular :
Path integrals tend to be rather ill defined in the Lorentzian regime for the most part, that is, of the form
\begin{equation}
\int \mathcal{D}\phi(x) F[\phi(x)]e^{iS[\phi(x)]}
\end{equation}
Due to the fact that the integral oscillates, being a complex phase. To make them converge, a real factor is introduced, either by slight rotation of time ($t \rightarrow t(1 + i\varepsilon)$), or going all the way to Euclidian spacetime ($t \rightarrow it$). This gives the Euclidian path integral
\begin{equation}
\int \mathcal{D}\phi(x) F[\phi(x)]e^{-S_E[\phi(x)]}
\end{equation}
To converge properly, it is usually required that $S_E$ be positive. This is not the case for the gravitational action, which, in Euclidian form, is
\begin{equation}
S_E = -\frac{1}{16\pi G} \int d^nx \sqrt{g} R_E(x)
\end{equation}
It can even be made arbitrarily negative since a conformal transformation involves a term of the form
\begin{equation}
-\frac{6}{16\pi G} \int d^nx \sqrt{g} \Omega_{,a}(x) \Omega^{,a}(x)
\end{equation}
Since the conformal factor is more or less arbitrary, and you have to integrate over those configurations, it is a rather big problem to show convergence of the action.
Comment: $S_E$ being positive does not necessarily imply that the path integral converges.
Comment: No but it is most certainly helpful.
Comment: Not really, because what matters for renormalisation are the physical dimensions of the coupling constant. If you invert the signs making it positive it will still not converge for the same reasons as if it were negative.
Comment: While not the only problem in path integrals of the gravitational action it is one to consider in such things : http://www.sciencedirect.com/science/article/pii/055032137890161X
Comment: Probably quite stupid of me, but how did you find the equation for the euclidean action? I would just get one $i$ from $dt = i d\tau$ which together with the $i$ in front of $S$ gives me $-S_E$. I then still have the same sign inside $S_E$. Note that (for the examples I tried at least, namely various BH solutions) changing the sign of the time component in the metric does not affect R). Thus, I find$R_E=R$ (at least for those cases ). Where does the extra minus sign in $S_E$ come from?


Stationary distribution of a Markov chain with a random transition matrix

Question: Consider a Markov chain $\{X_t\}$ on a finite state $\mathcal{S} = \{1,\dots, S\}$ space whose transition matrix $P$ is populated by elements of the form
$$ p_{ij} = P(X_{t+1} = j | X_t = i)$$
and we know that the $S$ vector $p_i = (p_{i,1},\dots, p_{i,S})$ follows a Dirichlet distribution with concentration parameter $(\alpha_{i1},\dots,\alpha_{iS})$, and this is true for $i \in \mathcal{S}$. Does the notion of an associated stationary distribution make sense in this context? And if so, can it be described in terms of a Dirichlet distribution?
Comment: @Xi'an No, but you only know the distribution of the elements, not the realizations
Answer: The transition matrix $P$ is almost surely strongly irreducible, hence produces a Markov chain with a stationary distribution $\pi$ associated with the eigenvalue $\lambda_1=1$ of $P$, i.e., $\pi P=\pi$. According to this paper, when $S$ grows to infinity, $\pi$ converges to the uniform distribution in total variation.
When considering the case $S=2$, the stationary distribution associated with$$P=\left(\begin{matrix} 1-a &a\\ b &1-b\end{matrix} \right)$$
is$$\pi=(b\ \ a)\big/(a+b)$$where $a\sim\mathcal B(\alpha_1,\alpha_2)$ and $b\sim\mathcal B(\alpha_2,\alpha_1)$, which shows $\pi$ is not a Dirichlet variate.
Comment: What about with fixed $S$?
Comment: Right, thanks, I accepted the answer. May I ask about the case before where a new realization was drawn at each $t$?
Comment: This is a very interesting case, but while there is a stabilisation due to the finite state space, I thought the chain cannot be stationary in the Markov sense, since the transition varies at each time.  See however this answer on [math overflow](https://mathoverflow.net/a/211322/64496) that shows the opposite, by integrating out the Markov matrix.


Why is a chet with a patach pronounced differently?

Question: Why is a chet with a patach at the end of a word pronounced "ACH" and not "CHA"? Example: מָשִׁיחַ
Comment: Does anyone think this is in scope?
Comment: @BA, "the _title_ should specify..."
Comment: As noted in an answer, this is not quite worded correctly. Also, the title should specify that you are referring to the end of the word.
Comment: @SethJ "a chet with a patach at **the end** of a word" ?
Comment: Astonishing, I think, that questions pertaining to the Hebrew language and to Israelite history are considered tangential to Judaism. I've read the FAQ, I'm just saying.
Answer: Actually, the question is why it is spelt differently, and not why it is pronounced differently at all. If you wanted to say meshicha, you certainly could. That would be a different word, of course, though a related one. It would be spelt משיחה.
For words that end in -ach, orthographic convention has us conclude them with the chet. This is also the case for words ending in -'a (such as רקיע) and in -ah, where the final ה is consonantal (such as אלוהּ).
The reason for all of these is that the final vowel/consonant combination is not preceded by a phonological alef, but by a rounding off of the previous vowel. Hence, mashi(y)ach, raqi(y)a and elo(w)ah.
Comment: Not all agree with your last paragraph http://judaism.stackexchange.com/q/2313/759
Comment: @doubleaa, that may be, but Shimon is correct.
Comment: Actually, it doesn't matter if I'm wrong: the issue isn't how people pronounce *alefs* and elided vowels today vs. how they did in the past, but that people did (and do) differentiate between them, that such a differentiation is manifested here, and that its represented orthographically. That last line was really just by way of an example, though different communities pronounce things in different ways.


When is Avraham's birthday?

Question: I saw in a popular book a suggestion that Avraham was born on Rosh Chodesh Tevet. Does anyone have any backing sources for this?
Comment: See Gemara Rosh Hashana 11a: R' Eliezer holds he was born in Tishri, R' Yehoshua holds he was born in Nissan. (Exact dates not given)
Comment: From Bereshit 17:26, Rashi seems to suggest that Avraham Avinu and Ishmael had the same birthday. בעצם היום הזה. שֶׁמָּלְאוּ לְאַבְרָהָם צ"ט שָׁנָה וּלְיִשְׁמָעֵאל י"ג שָׁנִים נמול אברהם וישמעאל בנו:
Answer: This page (it is too much to simply copy and paste) speaks of the medrashic concept that the righteous die on their birthdays [scroll down to citation 27 in the text]. As such, acknowledging that Avraham Avinu was righteous, and the gemara mentions possibilities for the Yahrzeit:

Avraham Avinu (2124 - 1638 B.C.E.:), according to some sources (Bava Basra 91a). [According to others, Avrohom Avinu's Yartzeit is 1 Tishrei, or Nissan [Moed Katan 28a].

one could work backwards and derive a birthday commensurate with the death date one accepts.

This answer deals with the sources for the yahrzeit as well.
Comment: I'm not seeing any mention of the date of Avraham's passing in Bava Batra 91a. Your source appears to be unreliable.

When is Avraham's birthday?


how to implement Java program in cloud computing??I

Question: I created JAVA program which uses external library called FLANAGAN.JAR.I want to implement the same program in cloud.For cloud computing JAVASCRIPT is necessary.But I am new to JAVASCRIPT.I dont know how to implement my java program in cloud.
Shall i post my code.??Give me any suggestions or idea?
Answer: No javascript is not a necessity for cloud. You may run your code in many different ways on the cloud. As you did not give any details about your code or application, it is difficult to offer a proper way, but you  may want to check Amazons Elastic Beanstalk for a better understanding to run your code i. Cloud computing is too wide, you may run your code on the cloud in some different ways.
Comment: Did you read my comment? You may run your code with the help of Beanstalk. If you read about it and tried smt I may, otherwise no. You should try first.
Answer: The way you can run your code on the cloud depends on the provider you use. Firstly, you will need to choose between an IaaS (Infrastructure as a Service) or a PaaS (Platform as a Service) to put your application on the cloud.
On an IaaS you need to choose the OS you want, like for example Linux Ubuntu, and then you have to install/configure everything as if it is your own computer. If you want to avoid this configuration process, you can use a PaaS.
If your Java program is based on a Tomcat 7 stack, then maybe this guide will help you out to understand a way in which you can do it on a specific PaaS.


Why don't the employment rate and unemployment rate sum up to 1?

Question: According to Turkstat, the Turkish employment rate was 44.9 and the unemployment rate was 10.1 in December 2012. I would expect the unemployment rate to be 1 - employment rate. How are those numbers calculated so that they won't sum up to 1?
Comment: Total newbie in how these figures are calculated. But are those figures a % of the population? Or the *capable* population? Are students considered? The retired? The only way I can see it totalling 1 is if it's a statistic of able-bodied persons that can work.
Answer: "Unemployed" are people who are actively searching for a job. A lot of people are not employed, but are not "unemployed" because they're not looking for a job. Being infants, housewives, retired, students, etc.
Comment: Also "discouraged workers" who were looking for work but have dropped out of the workforce because they've found it too difficult to get work
Comment: This becomes extremely important when comparing the unemployment rates of different countries, as they might use subtle but important differences in how they define "unemployed".
Comment: Another relevant factor is part-time employees who may be counted pro rata for employment statistics, but not included in the unemployment statistics.
Comment: Please explain the downvote, whoever it was
Answer: The employment rate is the percentage of people in the country who are currently employed compared to the total population of the country.
Unemployment rate is the percentage of people looking for work compared to the total number of people currently in work. This number can increase in 2 ways. If the number of people looking for work increases and/or if the number of people employed decreases. The opposite is the case for the unemployment rate to decrease.
That is why it is important to look at the details behind the numbers to understand what is really happening to the unemployment rate.


Renaming Output feature classes

Question: I am running two models using an iterator in each.  I want my output (feature class in a GDB) to be named after the field value from which it was selected as opposed to "I_feature1_join1', etc.
Answer: The answer in Use Get Field Value tool to calculate field? shows how you can accomplish this.
In short, use the Get Field Value help (modelbuilder only tool) on the featureclass in question. Using its output variable name, supply that as an inline variable in your output featureclass parameter. If the GFV param name was called fieldValue, your output FC param would reference it by <code>%fieldValue%</code>
Comment: Thanks, that really helps.  I set up the 'Get Field Value' the plug in 'fieldvalue' into my output feature class but get and error due to 'invalid characters'.  The field name has several spaces in them and I assume it counts the space as invalid character.  Should I create a new field that removes the spaces and replaces with '_', and what is the formula for that.
Comment: Ya, it sounds like you'll need to do some scrubbing on those names. Either with CalcField or perhaps even a full Python script tool. Though CalcField / CalcValue and some Python should do what you need

Renaming Output feature classes


Tilemill: set max extent for export

Question: Is it possible to set map extent to be displayed on mapbox ?
If so could you please send me an example ?
Answer: Could you please clarify your question: Do you want to want the actual bounding box coordinates displayed on your map when hosting with MapBox? Or are you asking how to set the extent of the area being exported from TileMill?
For the first you could create a legend in tooltips and just manually enter the coordinates. Copy and paste them from settings.
For the latter see #6 "Select the map 'Bounds'" in 6. Exporting a Map in the TileMill crash course tutorial: http://www.mapbox.com/tilemill/docs/crashcourse/exporting/
Comment: Hi Chris exactly , the exporting map in crash course was my search. Indeed the question was a bit confuse. Thanks for the help . Jorge Vidinha

Tilemill: set max extent for export


Arch and KDE unable to login to paid WiFi network

Question: I am in a camping and would like to connect to the internet. The camping's WiFi is not protected by an SSID but by a custom page restricting the access to the internet. My trouble is in loading that page. When clicking on the login button from the KDE notification, it gets me to networkcheck.kde.org which fails to load. If I click on the Firefox notification, it redirects me to the correct URL of the camping's login page, but it doesn't load.
The WiFi works on android and windows devices, I have also achieved connecting it on my laptop but doesn't know why it doesn't work anymore.
I have tried playing with Firefox's and kde's network settings without success, I have tried disabling ufw but it didn't do anything. I have tried rebooting, disconnecting and reconnecting.
I have installed arch using archinstall and I think I copied the network config from the iso.
Comment: I think you're mixing up terms: "Not protected by an SSID": The SSID is the network ID that the access point broadcasts. It's what you'd call "network name". It's not a protection mechanism, just a network name.
Comment: maybe that AP is set up to selectively only redirect android & windows connectivity sites check. Try going to one of the usual android ones, e.g. http://connectivitycheck.gstatic.com
Comment: Yes I meant IPV4 or 6. I tried using connectivity check.gstatic.com but it did the same as Firefox, it found the URL but couldn't load the page.
Comment: As an aside version gives you a free hour of wifi and you can use `macchanger` to change your mac address and just keep logging back on.
Answer: I had the experience that some paid Wi-Fi webpages don't work under Firefox on Linux and my solution was to install chromium to just log in to the Wi-Fi.


NULL imputation in training and testing data set

Question: I have a dataset and I'd like to to use it for classification purposes. There are some columns with NULL values that I need to impute. I want to impute with either median or mean but what I want to know if I should impute that with median/mean before spliting into train and test or I should first split into train and test, then impute with median/mean in train data set and take the value for median/mean from the training data set and apply that to my test data set?
Comment: Is any of the variables you want to impute the dependent variable, or are they all independent variables?
Comment: they are the independant (feature) variable
Answer: In a classification context, it's fine to impute values of the independent variables for all cases before the train–test split (so long as your imputation scheme ignores the dependent variable, as mean or median imputation would). The train–test split is only supposed to hide values of the dependent variable, not the independent variables.


Are asymmetric black holes possible?

Question: From an outside observer, if matter falls into a black holes from only one side, would the black hole's growth be asymmetric, and would it's gravity be non-isotropic?
Comment: @PM2Ring For simplicity sake, let's assume a non-spinning black hole whose matter  is falling in straight center. All of the matter is falling in from one side.
Comment: @GrapefruitIsAwesome Could you elaborate or link to an answer?
Comment: My uneducated guess is that if you dumped a *huge and continuous stream of matter* into one side of a non-rotating black hole so that it was in a non-equilibrium state for an extended period of time, the event horizon would have a static *ever so slightly non-spherical* shape. Related: [Are black holes spherical during merger?](https://astronomy.stackexchange.com/q/31989/7982) and [What can be learned from, or noted in this LIGO Orrery video?](https://astronomy.stackexchange.com/q/28610/7982)
Comment: Why do you think it might become asymmetric? Is your black hole spinning? Bear in mind that the black hole can move, so it will be gravitationally attracted towards the incoming mass, but it will also obey conservation of momentum when it absorbs that mass.
Comment: It's not going to stay asymmetric for long due to gravitational radiation.
Comment: @H2Forge I don't know of one off the top of my head.  If I have a chance to get to it before someone else posts an answer I'll add one.
Answer: Any asymmetry would disappear extremely rapidly, damped by the emission of gravitational waves. This is demonstrated by the briefness of the ring-down phase after a binary black hole merger - which is about as extreme an asymmetric accretion event as you could imagine. The outcome of the merger is an axisymmetric, but not spherically symmetric,  Kerr black hole.
Answer: There are two classes of black hole asymmetries I will consider in this answer.  The first the is Kerr black hole which is the class of black holes with non-zero angular momentum and no net charge.  These black holes have a non-spherical event horizon, and therefore do not have spherical symmetric, but they do have rotational symmetry about their axis.  This is a steady-state configuration and will persist unless perturbed.

Image from Wikipedia.
The second case considered is a non-steady state such as might be found during the merger of two black holes or another compact object such as a neutron star.  These effects will also occur when any matter enters the black holes, as it will be non-steady-state, but the magnitude of the effects will be smaller.
Prior to the Merger
Prior to merging, black holes can be deformed by tidal effects.  This does not seem to be a general effect, but only impacts black holes that were not spherical to begin with.

Through new theoretical analysis, Le Tiec and Casals predict that
tidal bulges can indeed occur during mergers. For a black hole
spinning at 10% of its maximum possible rate in an asymmetric tidal
field, their calculations show that tidal bulges can appear, with a
corresponding quadrupolar TLN of 0.002. In comparison, the quadrupolar
tidal Love numbers (TLN) for a much more deformable Earth is 0.3, while a neutron star has a number of about 0.1. (Spinning black holes can be deformed by tidal forces, calculations reveal)

Are also Tidal Deformation and Dissipation of Rotating Black Holes (slides).
During the Merger
During a black hole merger the shape of the event horizon can be come quite complex.

As two black holes approach each other, a 'duckbill' shape protrudes
from each of the two event horizons towards the other one. This
protrusion extends longer and narrower until it meets the protrusion
from the other black hole. At this point in time the event horizon has
a very narrow X-shape at the meeting point. The protrusions are drawn
out into a thin thread. The meeting point expands to a roughly
cylindrical connection called a bridge. (Wikipedia)

Image from On Toroidal Horizons in Binary Black Hole Inspirals
See also Are black holes spherical during merger? (as mentioned by uhoh in the comments)
After the Merger
Post merge, the event horizon transitions from a complex state to the steady state Kerr configuration by exiting gravitational waves.

The merger of a binary black hole gives birth to a highly distorted
final black hole. The gravitational radiation emitted as this black
hole relaxes presents us with the unique opportunity to probe extreme
gravity and its connection with the dynamics of the black hole
horizon.... Once the BHs merge, a highly distorted BH settles into a Kerr BH radiating exponentially decaying ringdown emission. (Post-merger chirps from binary black holes as probes of the final black-hole horizon)

See also What causes a black hole ringdown and why can it prove the no-hair theorem?
Answer: The only black hole with an isotropic gravitational field around it is the Schwarzschild black hole, but astrophysical black holes have spin angular momentum and thus are instead better modeled by the Kerr black hole. The Kerr black hole spacetime is axisymmetric, i.e., cylindrically symmetric, about its spin axis. The region that surrounds a Kerr black hole is known as the ergosphere, which is poorly named because it's not spherical for arbitrary spin, and instead is like an oblate spheroid for modest spin and more like a pumpkin for high spin. Essentially, the ergosphere is "a region of spacetime around the black hole dragged by its rotation faster than the speed of light, meaning that from the point of an outside observer any matter inside is forced to move in the direction of the rotation of the black hole." A Kerr black hole has several important surfaces, compared to the simpler Schw case. The ergosphere is bound between the outer event horizon and the outer surface of infinite redshift.

From an outside observer, if matter falls into a black holes from only one side, would the black hole's growth be asymmetric, and would it's gravity be non-isotropic?

You seem to be asking about the effect of accretion. In principle, an accretion disk forms around the black hole, so that it accretes matter from the inner-most stable-circular orbit which is beyond the event horizon.
I am not sure what you mean by "would the black hole's growth be asymmetric?" Are you asking about the change to its shadow perhaps? In the case of the supermassive black hole at the center of galaxy M87 that was imaged by the Event Horizon Telescope, the shadow deviates from circularity within 10%, consistent with prediction of General Relativity for Kerr black holes. The asymmetry in the accretion disk is essentially due to relativistic beaming. The shadow of a Schw black hole is circular. This implies that an initially non-rotating black hole that begins accreting will start with a circular shadow but will begin to appear as non-circular, as its spin increases, to far away observers. If you're wondering about the ergosphere, as a Kerr black hole accretes, its spin increases, which makes the ergosphere more pumpkin shaped as the outer surface of infinite redshift widens at the equator but is squished at the poles. This wonderful animation from the wiki page for Kerr black holes shows how the ergosphere depends on the black hole's spin, and how the non-circularity of the black hole's shadow increases with spin.
Some hydrodynamical models consider asymmetric Bondi-Hoyle accretion onto a Schw black hole, but as far as I can tell, it is often assumed that the gas is treated as a test fluid and does not effect the spacetime geometry, implying that the gravitational field around the black hole remains isotropic, for example here. In principle, accretion should increase the spin of an initially non-rotating black hole, and thus would remove the isotropy of its surrounding gravitational field, resulting in the Kerr geometry. In models that consider asymmetric accretion onto a Kerr black hole, things are even more complicated. But in principle, the axisymmetry of the Kerr spacetime is preserved as the spin and mass increase due to accretion. This is an area of research for magnetohydrodynamical numerical studies of accretion in the Kerr spacetime.

Are asymmetric black holes possible?


Where to stand to throw circles over sticks

Question: Consider a horizontal line with vertical lines centered on the x-axis and placed at gaps of \$\sqrt{2}/2\$.  For a positive integer \$n \geq 3\$, the first half of the lines have lengths \$0, \sqrt{2}, 2\sqrt{2}, 3\sqrt{2}, \dots, (n-1)\sqrt{2}\$ and then the second half have lengths \$(n-2)\sqrt{2}, (n-3)\sqrt{2}, \dots, 0\$.
The goal is to find a circle center on the horizontal line so that for every pair of consecutive vertical lines, there exists a circle with that center which fits between them  without touching either of them. For example, in the following illustration we can see that if we picked the origin for \$n=3\$ and  the center at the origin, it is possible.

For \$n = 4\$, we can see that the center can't be at the origin.

We instead will need to move the center to the left. If we move the center to -1, then it is just possible.

For \$n=5\$ a center at -1 doesn't work and neither does -2.

For \$n=5\$ the desired output is -3.
Task
Given an integer \$n \geq 3\$, output the largest integer valued circle center \$ x
\leq 0\$ so that there exists a circle with that center for each pair vertical lines that goes between the vertical lines and doesn't touch them.
Comment: Any counterexample where the longest one isn't bottleneck?
Comment: @l4m2 It's a great question. I don't have a counterexample but that doesn't mean they don't exist.
Comment: Why the downvote?
Answer: JavaScript (Node.js), 24 bytes
<code>n=>(n*4-2-n*n)/8**.5-1|0
</code>
Try it online!

Any counterexample where the longest one isn't bottleneck?

Looks correct. Proof: scale the circle smaller and see how the allowed distance also get smaller
Used WolframAlpha
Comment: You're the best golfer there ever was!
Comment: I hope someone is able to prove this correct.


How to cool a steel roof during summer

Question: I'm from South India.  My home roof is built with steel panels. During the summer, the roof will get too hot.  I don't know much more about how cool in natural way.
Is there a way to cool the roof naturally?
Comment: Well for sure one thing not to do is paint it black.
Answer: Paint the roof white or silver to reflect as much sunlight as possible. This is a passive method once it is done.
Water removes heat better than air so if you have a source of water, or collected and stored rainwater, it could be sprayed on the roof during times of high heat.
This isn't "natural" but if you have an attic, you could install an exhaust fan with a thermostat switch that comes on when the attic gets too hot.
Good luck!
Comment: Specifically, ask your paint supplier for paint with the highest possible solar reflectivity.  Then keep the roof clean.
Answer: What you want to do is to prevent the heat from the hot roof from flowing into the living space. In the US traditionally this was accomplished by insulating the ceiling of the living space. The attic (aka loft) would get very hot but the insulation on the attic side of the ceiling would prevent heat flow through the ceiling. The attic was vented low and high to promote airflow to reduce the temperature of the air in the attic, but it was nevertheless hotter even than the ambient outdoor temperature.
The next step was to reduce the temperature in the attic by reducing heat flow from the roof into the attic. The main current technique to accomplish this is to place a so called radiant barrier to the underside of the roof. Another approach is to insulate the underside of the roof usually with spray foam, but also by attaching insulating batts to the underside of the roof.
In India and in parts of the US one has to be very careful that in attempting to 'improve' the utility of the structure for its human occupants one does not provide increased harborage for rats. Also one must not create spaces which trap moisture because this would cause rot. The science and art of insulation is very concerned with allowing trapped moisture to quickly escape so interior spaces do not stay moist.
Does this structure have an attic that is accessible for addition of insulation?

How to cool a steel roof during summer


Qt Run Configurations

Question: In Qt Creator->Projects tab, I have multiple build environments and each one generates a different executable name.
I have added a Custom Executable run configuration for each of the build environments to launch the executable from Qt Creator. This requires specifying the path to the executable.  This works ok but when I move the project I have to update the run configuration to match the new path.  Is there a way I could make it relocatable as with a default run configuration?
Defaut Run configuration Types generate this (and more) XML in the .pro.user file:

<data>
    <variable> RunConfiguration0-type</variable>
    <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
    </data>

The problem with this is there is no way to change the name of the executable
A Custom Executable Run configuration Type generates this(and more) XML in the .pro.user file:

<data>
    <variable>RunConfiguration2-type</variable>
    <value type="QString">ProjectExplorer.CustomExecutableRunConfiguration</value>
    </data>

The problem with this is that I have to specify the path of the executable and If I move the project then I have to update the location of the executable in the projects tab.

Is there a way to use a variable pointing to the build dir in a .pro.user files?
Where can I find documentation on .pro.user files?
Answer: I don't know your Creator version but I think the variable %{buildDir} is available since 2.1. I tried it with master snapshot (2.2-to-be) on Windows and it works:
%{buildDir}\debug\myapp.exe

Qt Run Configurations


Ajax Toolkit remoteFunction Returns Timeout and Page not Found errors

Question: I have a Visualforce web page, version 30, that contains a table of Salesforce data and two iframes.  The Salesforce page itself uses the HTTPS protocol. The source of the first iframe is a non-Salesforce page served with the HTTPS protocol.  The source of the second iframe is served with the HTTP protocol.  This means the page needs to mix both the HTTP and HTTPS protocols which is a browser security violation.  In Firefox, the contents of the HTTP iframe never appears and no message is presented to the user.  Thus, the page is unusable.  In Internet Explorer, the user get a message stating "Only secure content is displayed. What's the risk?".  To see the contents of the HTTP iframe the user must click on a button labeled "Show all content", and then click on a second dialog box.  The warning about secure content make the page unusable in IE as well.  Although in IE one can change their security settings to allow mixed protocols, this is a significant security issue and not a viable alternative.
To bypass this mixed protocol security issue with the use of a proxy server, I attempted to use the remoteFunction method from the Salesforce Ajax Toolkit.  The pertinent JavaScript calling this function is shown below. However, calling this function fails with a combination of errors. From the console log I see the "VMT Call Failed: " message with the error:
Error 400 Unable to forward request due to: Read timed out
And from the network traffic log I get a Page Not Found error as follows:
https://test.salesforce.com/javascript/1407490843000/sfdc/source/SessionServer190.js.map. Result: HTTPS GET 404.
What might be the problem here?  Is there a syntax error?  Did the SessionServer190.js.map file change it's location between different versions of the toolkit?  Or between different versions of Salesforce? Or is there some other environmental context that needs to be set up before making the call?  The line "//sforce.connection.sessionId = __sfdcSessionId;" makes no difference whether it is commented or not.
<code><script type="text/javascript">
    // Get sessionId for Ajax Proxy Server
    var __sfdcSessionId = '{!GETSESSIONID()}';
    console.log("Session ID: " + __sfdcSessionId);
</script>
<script src="../../soap/ajax/31.0/connection.js" type="text/javascript">
</script>

<script type="text/javascript">
    function submitVMTProxyCall() {
        console.log("Entered submitVMTProxyCall.");
        //sforce.connection.sessionId = __sfdcSessionId;
        sforce.connection.remoteFunction({
            url : "http://...(URL obscured)",
            onSuccess : function(response) {
                console.log("VMT Call Succeeded " + response);
            },
            onFailure : function(response) {
                console.log("VMT Call Failed: " + response);
            }
        });
    }
</script>
</code>
Comment: Has anyone managed to upload these `.js.map` resources somehow?
Answer: External calls must be done via APEX for security reasons.


Can I install Arch Linux without internet?

Question: I want to install Arch Linux but I haven't internet with fast speed ! In one time I download the official ISO file and started installation and I saw CLI not GUI and I started read documentation and there we must put repository and download some files ! My question is can I install Arch Linux without internet connection with ISO file ?
Answer: You can, but if you want a graphical environment without downloading anything, it would be easier for you to install a distro like Manjaro (which is based on Arch Linux).
Answer: When installing Arch Linux use the -c flag when running pacstrap. This won't help you that much though because youll likely need many more packages anyway. Make sure to install the minimum needed for a chroot then download the rest chrooted. Then you can copy everything in pacmans cache to use on another system.


Relation between the de Rham and Hodge Laplacians on the Exterior Algebra

Question: For a Kahler manifold $M$ we have two well-known Laplacians: the de Rham Laplacian $\Delta_{\text{d}} = ($d$ + $d$^\ast)^2$, and the Dolbeault Laplacian $\Delta_{\overline{\partial}} = (\overline{\partial} + \overline{\partial}^\ast)^2$. Now on smooth functions, these two operators are related by the well-known formula
$$
\Delta_{\text{d}} = 2\Delta_{\overline{\partial}}
$$
Now both these operators act on the exterior algebra. Does there exist a similar formula in this more general setting?
Comment: Yes, the identity holds for differential forms. This is what's
behind the Hodge decomposition. See your favourite book
on Kahler manifolds (Griffiths-Harris, Wells...) for an explanation.
Comment: (I don't think you want the superscript $2$ in your displayed formula.)  On a Kähler manifold, the three laplacians associated with $d$, $\partial$ and $\bar\partial$ satisfy
$$\Delta_d = 2 \Delta_{\partial} = 2 \Delta_{\bar\partial}$$
not just on functions, but also on forms.  This is why on a compact Kähler manifold, one has the decomposition of the de Rham cohomology in terms of the Dolbeault cohomology groups.  This can be found, e.g., in Well's *Differential analysis on complex manifolds*.
Comment: He does want superscripts, since what he calls Laplacian is not...
He is writing the Dirac operator instead...
Comment: Sorry, about that, superscripts in the wrong place. Yes, it still works out, but best to stick to convention.
Answer: If $(X,\omega)$ is Kähler, then it is always true that
$$
\Delta'=\Delta''=\frac 12\Delta,
$$
where these three Laplacians are with respect, in order, to $\partial$, $\bar\partial$ and $d$. This is valid when they act on any space of complex-valued differential forms.
More generally, you can look to differential forms with values in a hermitian vector bundle $E\to X$. In this case, take $D_E$ to be the (unique) Chern connection of $E$ and let $D_E=D'_E+D''_E$ its decomposition in the $(1,0)$ and $(0,1)$ part (then, by definition $D''_E=\bar\partial$).
In this case, you can again compare $\Delta'_E$ and $\Delta''_E$. They no longer coincide, but differ by a order zero operator which is expressed in terms of the curvature $\Theta(E)=D^2_E$ and the (formal) adjoint $\Lambda_\omega$ of the operator $L_\omega=\omega\wedge\bullet$ of wedge product with $\omega$. The relation is
$$
\Delta''_E=\Delta'_E+[i\Theta(E),\Lambda_\omega],
$$
where $[\bullet,\bullet]$ is the (graded) commutator.
On the other hand, coming back to complex-valued differential forms, if you merely suppose your manifold to be hermitian than the relation between the three Laplacians is a little bit more complicated. You have to introduce the torsion operator
$$
\tau=[\Lambda_\omega,\partial\omega]
$$
which is of type $(1,0)$ and order zero (observe that if $\omega$ is Kähler then $\partial\omega=0$). With these notations, you have
$$
\Delta''=\Delta'+[\partial,\tau^*]-[\bar\partial,\bar\tau^*]
$$
and
$$
\Delta=\Delta'+\Delta''-[\partial,\bar\tau^*]-[\bar\partial,\tau^*],
$$
so that $\Delta'$, $\Delta''$ and $\frac 12\Delta$ no longer coincide but they differ by linear differential operators of order $1$ only.


Disable a network interface in Arch Linux

Question: I have the following problem. My PC is very old and it has a built in ethernet port that doesn't work, not due to a misconfiguration, I think it's physically damaged. It didn't work in either Ubuntu or even on Windows. I have an ethernet PCI card which is the one I use. The problem is, for some odd reason, the card that does works sometimes changes from eth0 to eth1 and I have to run dhcpd as I don't always get an IP via DHCP. Now, the actual question is, is there some way to disable the card that doesn't work using its MAC address or something? I can't disable either eth0 or eth1 as I'm sure it's not always "pointing" to the same card.
Answer: Are they the same kind of chipset or different ones?
If they are differnt then probably the simplest solution would be to just blacklist the modules for that Ethernet chipset.
You will first need to find the module name (this is for eth0):
dmesg | grep eth0

See if you have something like the following:
[    2.209295] r8169 0000:05:00.0: eth0: RTL8168d/8111d at 0xffffc90000c6e000, 00:24:1d:11:b6:64, XID 081000c0 IRQ 44

In my case 'r8169' is the module name. You can also see a list of currently loaded modules with 'lsmod' so check that it appears in there.
Next you need to black list the module. There is an entry on the Arch wiki for that.
Answer: Fellow archer here; I have a method I use to disable my nVidia graphic card's HDMI port audio chip based on its hardware pci id; perhaps you could apply the same approach to your nic:
Find the ethernet's pci id:
$ lspci | grep Eth
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)

Find the corresponding directory:
$ find /sys/devices -name *00:19.0
/sys/devices/pci0000:00/0000:00:19.0

There should be a file named "remove" in that directory.
You can disable the device at startup by editing /etc/rc.local
echo 1 > /sys/devices/pci0000:00/0000:00:19.0/remove

On second thought; this may not work in your case if modules get loaded prior to /etc/rc.local finishing... it would do you little good to have /dev/eth0 and /dev/eth1 assigned in the "wrong" order and then have /etc/rc.conf disable one of them... you could still end up with your prefered nic as eth1.  This used to be a problem with alsa on multiple sound cards so methods were devised to assign the numbering of the cards via module parameters.  Perhaps the module itself allows this?
Comment: I don't have anymore that computer, so I'm afraid that I can't test that anymore, but actually it makes sense. Thank you very much.
Answer: I'm gathering from your description this in an onboard NIC.  The best solution would be to disable it in the motherboard BIOS rather than the OS.  The method for this varies by manufacturer but I'm sure you could find a manual for your model online somewhere.
Comment: I didn't think about disabling it from the BIOS. The other answered solved my problem but I think you're right. Thank you for your answer.
Answer: I'm confused it didn't show up: In case you don't need the low level solution proposed by cjpembo, you can just use
ip link set dev <interface name> down

You get them via ip link show.


How to compute $\lim_{x\to \infty} x \sqrt{x^2 + 1} - x$?

Question: I'm not sure which strategy I should use. The indeterminate form is $\infty - \infty$, but I have not found a way to apply l'Hospital yet.  Intuitively, this limit seems to diverge because the $x\sqrt{x^2 + 1} \approx x^2$ and $x^2$ grows a lot faster than $x$.  In other words, the left term dominates the right one.  So I'm looking for a direction to prove the fact.  It doesn't have to be l'Hospital.
Comment: Hint: factor out an $x$.
Comment: All you need is $\sqrt{a+1} \geq \sqrt{a}$.  Can you prove that?
Comment: I think I can prove that. The derivative of $\sqrt{x}$ is always positive, so it's an increasing function.  Therefore, $\sqrt{x + 1| \geq \sqr{x}$.  But I don't clearly see how that lets me to solve the problem.
Comment: For $x\ge\frac34$, we have $\sqrt{x^2+1}\ge\frac54$, therefore, $x\sqrt{x^2+1}-x\ge\frac x4$. A more interesting question would be $\lim\limits_{x\to\infty}\left(x\sqrt{x^2+1}-x^2\right)$.
Answer: Hint: Multiply with the quadratic conjugate i.e. multiply with $$\frac{\sqrt{x^2+1}+1}{\sqrt{x^2+1}+1}$$
Comment: Oops.  It's much easier than that.  I made mistakes above for sure.  Here it is again. After multiplying by the quadratic conjugate, we get $x^3/(\sqrt{x^2 +1} + 1)$.  Applying l'Hospital, we end up with $3x\sqrt{x^2 + 1}$, which explodes up.
Comment: Thank you! I did it.  First I factored $x$ out.  Then I multiplied by your quadratic conjugate.  I got $x^3/(\sqrt{x^2 +1} + 1)$, which takes the form $\infty/\infty$.  Then I applied l'Hospital twice getting $6x\sqrt{x^2+1}/2 + 3x^3/2\sqrt{x^2+1}$, whose term on the right is still unclear but also taking the form $\infty/\infty$, so applying l'Hospital on it alone yields $9x^2\sqrt{x^2 +1}/2$ which goes to $\infty$.  So l'Hospital alone and your quadratic conjugate prove this limit diverges.  Thank you so much.
Answer: My approach would be like this:
$x\sqrt{x^2+1}-x=x(\sqrt{x^2+1}-1)\geq 2x$ when $x\geq 2\sqrt 2$. And when $x\to +\infty$, $2x\to +\infty$, hence $x\sqrt{x^2+1}-x\to +\infty$.
The question is kind of strange though because at first glance I thought it was $\sqrt{x^2+1}-x$. It would be a little more interesting: $\sqrt{x^2+1}-x=x(\sqrt{1+\frac{1}{x^2}}-1)=x(1+\frac{1}{2}\frac{1}{x^2}+o(\frac{1}{x^2})-1)=x(\frac{1}{2x^2}+o(\frac{1}{x^2}))\to 0(x\to +\infty)$.
Answer: The expression $x\sqrt{x^2+1}-x$ can be rewritten, by factoring $x$, as $x(\sqrt{x^2+1}-1)$.
As $x \rightarrow \infty$, $\sqrt{x^2+1} \rightarrow x$ (informally, think that the $1$ will not affect on the large value inside the radical).
Therefore, the expression $x(\sqrt{x^2+1}-1)$ can be written as $x(x-1)$ [valid for $x \rightarrow \infty$].
As $x \rightarrow \infty$, $x-1 \rightarrow x$ (informally, think that subtracting $1$ will not affect on large value of $x$).
Therefore, $x(x-1)$ can be written as $x \cdot x = x^2$ [valid for $x \rightarrow \infty$].
Clearly, $x^2$ tends to infinity as $x$ tends to infinity.
$$\implies \lim_{x \rightarrow \infty} \bigg( x\sqrt{x^2+1}-x \bigg) \rightarrow \infty$$
Comment: It's great that you know how use the written language to show your thought process.  So much easier to read (and pretty to see).  Thank you so much.
Answer: For any $x>0$, we have $$
x \sqrt{x^2+1}-x \geqslant x \sqrt{x^2}-x=x^2(x-1) \rightarrow \infty
$$
Therefore $\textrm{ as } x\rightarrow \infty ,$
$$ \qquad\qquad  x \sqrt{x^2+1}-x \rightarrow \infty .$$
Comment: Very nice argument.  I begin to realize what Brian Moehring had meant.
Answer:
Simply,

$$\sqrt{1 + x^2} > \sqrt{x^2} = |x| = x\,, \quad x > 0
\\ \therefore x\sqrt{1 + x^2} > x^2\,, \quad x > 0
\\ x\sqrt{1 + x^2} - x > x^2 - x\,, \quad x > 0$$
$$\lim\limits_{x \to \infty}{x^2 - x}  = \lim\limits_{x \to \infty}{\left( x - \dfrac{1}{2}\right)^2 - \dfrac{1}{4}} \approx \lim\limits_{x \to \infty}{x^2} \to \infty$$
$$\lim\limits_{x \to \infty}{x\sqrt{1 + x^2} - x} \to \infty$$

Alternatively, one could use logarithms, since $f(x) > \ln{f(x)}$

$$\sqrt{1 + x^2} > \sqrt{x^2} = |x| = x\,, \quad x > 0
\\\sqrt{1 + x^2} - 1 > \ln{\left(\sqrt{1 + x^2} - 1\right)} > \ln{(x - 1)}$$
Now, $\lim\limits_{x \to \infty}{\ln{(x - 1)}} \to \infty$. The rest should be clear.
Answer: As suggested in the comments, we have that
$$ x \sqrt{x^2 + 1} - x =x\cdot \left(\sqrt{x^2 + 1} - 1\right) \to \infty \cdot \infty=\infty$$


Time-dependent state probability harmonic oscillator

Question: For my homework i am considering a harmonic oscillator which´s wavefunction at $t=0$ is the superposition of the eigenstates $\psi_n$.
$$
\psi(x,t=0) = \sum\nolimits_{n} c_n \cdot \psi_n(x)
$$
Now i am asked for the probability of the oscillator occupying eigenenergies $E_n > 2\hbar\omega$ at some point in time which is, taking the energy formula for the harmonic oscillator $E_n = \hbar\omega(n+\frac{1}{2})$ into consideration, equivalent to asking for the probability of the two lowest states. So how do I calculate them? Usually I would do it via the orthogonality relation of the eigenstates but in this case i am missing a kind of boundary condition which i could plug in for my superposition.
Comment: Wouldn't you just pay attention to the coefficients of the first two values in the sum?
Comment: Yes. However i don´t know how to calculate either.
Answer: The answer provided by roshoka is correct. I only want to briefly discuss why the time dependence can be "ignored" in this case.
As the question asks for the probability of obtaining a particular energy eigenvalue at a later time, then you must first understand what the wave function looks like at a later time t. For a system in which the potential is time independent (like the harmonic oscillator), then you can solve the time dependence of the Schrödinger equation once and for all. If you do that, you find that each energy eigenstate evolves independently according to $e^{-iE_nt/\hbar}$, so that you can write your wave function at time $t$ as:
$$
\Psi(x,t)=\sum_nc_n\psi_n(x)e^{-iE_nt/\hbar}.
$$
For a harmonic oscillator, you are correct that $E_n=\hbar\omega\left(n+\frac{1}{2}\right)$, so that energies $E_n>2\hbar\omega$ correspond to $n>1$. This means that the total probability of measuring an energy $E_n>2\hbar\omega$ is given by the probability of measuring each eigenvalue for $n>1$. The probability of measuring a particular eigenvalue $E_n$ is:
$$
P(E_n)=\left|\int_{-\infty}^{\infty}\psi_n^{\ast}(x)\Psi(x,t)dx\right|^2=\left|\int_{-\infty}^{\infty}\psi_n^{\ast}(x)\left(\sum_mc_m\psi_m(x)e^{-iE_mt/\hbar}\right)dx\right|^2=
\left|\sum_mc_me^{-iE_mt/\hbar}\int_{-\infty}^{\infty}\psi_n^{\ast}(x)\psi_m(x)dx\right|^2=
\left|\sum_mc_me^{-iE_mt/\hbar}\delta_{nm}\right|^2
=|c_ne^{-iE_nt/\hbar}|^2=|c_n|^2.
$$
To solve the integral, I have used the orthonormality of the eigenstates. Therefore, the total probability of measuring the system in an energy eigenstate $E_n>2\hbar\omega$ is:
$$
P(E_n>2\hbar\omega)=\sum_{n=2}^{\infty}|c_n|^2,
$$
note that the sum starts at $n=2$. This can be more simply calculated as:
$$
P(E_n>2\hbar\omega)=1-\left(|c_0|^2+|c_1|^2\right),
$$
as roshoka suggests. All of this analysis assumes that the original wave function is normalized.
It may seem redundant having to first construct the wave function at a later time $\Psi(x,t)$ given that the final answer did not depend on time. However, this arises only because you are interested in an energy measurement and the dynamics of the system is governed by the energy eigenstates (this is because the operator that appears in the Schrödinger equation is the Hamiltonian). For the measurement of any other property, the time dependence would not be trivial like in this case, but the approach above would still work.
Comment: Just commenting the dirac version with propogator (partially for my own sake)$|\Psi(t)\rangle = U(t)|\Psi(0)\rangle = \sum_n |n\rangle\langle n|\Psi(0)\rangle e^{\frac{-i E_n t}{\hbar}}$ then $|\langle j|\Psi(t)\rangle|^2 = |\sum_n \langle j|n\rangle\langle n|\Psi(0)\rangle e^{\frac{-i E_n t}{\hbar}}|^2 = |\sum_n \delta_{j,n}\langle n|\Psi(0)\rangle e^{\frac{-i E_n t}{\hbar}}|^2 = |\langle j |\Psi(0)\rangle e^{\frac{-i E_j t}{\hbar}}|^2 = |\langle  j|\Psi(0)\rangle|^2  = |c_j|^2$
Answer: A fundamental postulate of QM is (From Shankar chpt. 4)

If the particle is in a state $|\psi\rangle$, measurement of the
  variable (corresponding to) $\Omega$ will yield one of the eigenvalues
  $\omega$ with proabability $P(\omega_i) \propto|\langle\omega_i|\psi\rangle|^2$. And $P(\omega_i) = |\langle\omega_i|\psi\rangle|^2$ if $|\psi\rangle$ is normalized.

Your eigenvalues are $E_n$, and your eigenvectors are $|E_n\rangle$. So what you need to do is find the complement of the sum of the probabilities for $n=0,1$ using the above.
Do you have actual values or does it need to be done symbolically?
Comment: No, i don´t have any real values to use. Actually, in my course we are just one lecture away from introducing dirac notation. Therefore, is my interpretation right? $P(\omega_i) = \int \overline{\psi(x)}\cdot E_n \cdot \psi(x)  \ dx $
Comment: You could think of it like $P(E_n) = |\langle E_n|\psi\rangle|^2 = \int |\psi_n^*(x) \Psi(x)|^2dx $ then just use orthogonality. Where $\psi_n$ is the eigenfunction corresponding to $E_n$. In the end you should get squares of coefficients, which are probabilities. Take the complement of the sum for $n=0,1$
Comment: --The above comment should have $|\langle E_n | \Psi \rangle |^2$. Where $\Psi$ is the function from your question.-- You could kind of just hand wave it and think about it like multiplying $\psi_0$ into the sum you have in your question and use the orthogonality (and don't forget to square it). Do the same for $\psi_1$. The answers to both of these will be their individual probabilities. Then use those to find out what the probability is for $n>2$
Comment: Thank you very much!
Comment: Another edit: In my first comment, the absolute value squared should be on the outside of the integral.


Opening emacs from TextMate

Question: I want to launch emacs from TextMate, I tried the method with OTC in here, but it would be great if I can learn other methods that I can launch emacs from TextMate.
Answer: You can make a Bundle with a Command that launches emacs.
Or
You can install the GITMate plugin, that adds Git badges and an Open With… menu in the drawer.
Answer: I could make a commands to run emacs as follows.
Bundle → Bundle Editor → Edit Commands

It runs emacs with Command-Control-Option R

Opening emacs from TextMate


How to optimize neural network parameters with REINFORCE

Question: I've seen a few mentions in papers that neural network parameters can be found using REINFORCE algorithm. It was mentioned in the context of nondifferentiable operations involving e.g. step function which appears in "hard attention" or weight pruning. Unfortunately, I haven't seen how to really do this. In Markov Decision Process we have, states (S), actions (A) and rewards (R) so what is what in case of neural net? I don't see how can we find parameters or neural net if the gradient is not well defined.
Any code sample or explanation?
Answer: The term REINFORCE actually corresponds to a method of estimating gradients, it is not particular to reinforcement learning. The paper you linked doesn't appear to deal with RL at all, so the issue they're describing is not one that you should expect to find in a policy gradient application.
If you're using REINFORCE to estimate policy gradients in RL (this is the common use case), your parameters are parameterizing a policy function. The inputs are states and the outputs are actions. The issue with estimating the gradient of the parameters is as follows. In RL the objective is to maximize expected rewards. This is an expectation with respect to the policy of the cumulative reward of a trajectory. If you take the gradient of this wrt the parameters, since the expectation is wrt the policy which depends on the parameters, you can't move the gradient inside the expectation so you can't estimate the gradient from samples. Using REINFORCE however, you use the "log-derivative" trick to rewrite the objective as an expected gradient, which can be estimated from samples.


What determines the speed required to pull a table cloth?

Question: I was watching this show "Street Genius" on National Geographic and the host Tim Shaw demonstrated an experiment about Inertia, What he did was, He tied one end of a table cloth to a car through a long rope and started driving the car, when the rope was taut, the cloth was pulled and the things on the table were still on the table. What are the calculations involved in it and what determines the speed required to pull the table cloth without disturbing the things on it?
Comment: I guess the entire problem depends on *friction* between different objects in the table and the cloth, which adds complexity to the problem.
Comment: It has no relation with speed... only acceleration
Comment: [Youtube](https://www.youtube.com/results?search_query=tablecloth+trick).
Answer: Not sure anyone will look back at this, but I'd like to give an answer anyway!
How do you not disturb the dishes when pulling a tablecloth out from under them?  You're exactly right: this is about the inertia of the dishes and the forces on the dishes from the table cloth while the cloth is being pulled.
Remember from physics that if we plot the velocity of the dish vs time, then the slope is the acceleration, and the area under the curve is the distance traveled.  We want the distance traveled to be less than the distance to the table edge.
To have a small area under the curve, then we want a small amount of time that the dish is contacting the table cloth (t*) and also a small effective friction force (the initial slope). So either pull fast or use a slippery table cloth.
The effective friction force is a tricky thing to predict, since the dish will surely rattle around and only be in contact part of the time.  In fact, predictions about even simple friction coefficients are nearly impossible without just doing the experiment (see citation).
Nature 430, 525-528 (29 July 2004) | doi:10.1038/nature02750; The nonlinear nature of friction: Michael Urbakh1, Joseph Klafter1, Delphine Gourdon & Jacob Israelachvili
Comment: The important thing here is that the friction forces go like $\mu F_N$ for *some* $\mu$, hence the acceleration of the plates is approximately constant, as your "mountain" diagram shows. The total distance moved by those plates is $\frac 12 a t^2$, so you just need to minimize $t$. The answer is therefore *the faster the better*; the distance the plates travel must go like $\frac 12 \mu g (L/v)^2$ where $L$ is the length of the tablecloth, $\mu$ is the coefficient of kinetic friction, $g$ is the gravitational acceleration, and $v$ is the speed of the tablecloth/car.


Downgrading Java 11 to java 8?

Question: How can i downgrade the java version 11 to java 8. As i need jenkins, current jenkins versoin doesn't support java 11. I need to downgrade.
Answer:
You have to install the openjdk-8-jre:
 sudo apt-get install openjdk-8-jre

Next switch to the jre-8 version:
 $ sudo update-alternatives --config java
 There are 2 choices for the alternative java (providing /usr/bin/java).

 Selection    Path                                            Priority   Status

 * 0            /usr/lib/jvm/java-9-openjdk-amd64/bin/java       1500      auto mode
   1            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1500      manual mode
   2            /usr/lib/jvm/java-9-openjdk-amd64/bin/java       1500      manual mode

Add JAVA_HOME variable:
 export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

check java version:
 $ java -version
 openjdk version "1.8.0_151"
 OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12)
 OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Same procedure for Oracle java.
Comment: What is `update-alternatives`? I get `sudo: update-alternatives: command not found` when I try to run it. I don't have apt installed. Is it part of that?
Comment: When I try `sudo apt-get install openjdk-8-jre` I get this error: `Errors were encountered while processing:
 oracle-java11-installer-local.
E: Sub-process /usr/bin/dpkg returned an error code (1).`How to remove oracle-java11-installer-local.
Comment: What about uninstalling the unused jdk 11?

Downgrading Java 11 to java 8?


Why season the meat "liberally"?

Question: Whenever I watch cooking shows on TV, they always advise to season the meat "liberally", even "aggressively". Is there a particular reason for this, or do regular people just tend to under season their meat?
Comment: Simple; stop watching TV, and cook stuff the way you like :-)
Answer: When it comes to steaks, there is specific reason to use a lot of salt.  The Serious Eats food lab goes into pretty good detail about salting a steak.  It has to do with drawing out the moisture on the surface of the steak.  This helps create a nice sear and affects the way the steak cooks.
For other types of meat, I assume they are just telling everyone to season more.  The amount of salt used in a commercial kitchen is unreal.
Comment: Depending on how you are cooking, a great majority of the seasoning can easily fall off into the grill, stick to the pan, or other similar fates. You can avoid the over-salt by going with high quality seasonings, such as Spike or Mrs. Dash, or just rolling your own out of herbs and spices.

Why season the meat "liberally"?