Looking for a fine U.S. Latitude and Longitude grid (0.25, 0.5 degree)

Question: There is a global latitude and longitude grid data available at 1 degree resolution and higher (http://www.arcgis.com/home/item.html?id=f11bcdc5d484400fa926dcce68de3df7). Is anyone aware of a finer resolution dataset (at 0.25 and 0.5 degree)? Or alternatively a way to make it in ArcGIS/GDAL/Python using the 1 degree product?
Comment: Can the Fishet Tool not accomplish this?  I don't have an ArcInfo license here, but give a look.
Answer: As @Dan Patterson says Create Fishnet is the ArcGIS way to go - and, at least at 10.1, it seems to be available at all license levels.
Comment: There is a good "demo" of how to do this on the Esri "GeoNet" forum.
[How do I create a fishnet grid that aligns with a 15 minute data frame grid?](https://community.esri.com/thread/207696-how-do-i-create-a-fishnet-grid-that-aligns-with-a-15-minute-data-frame-grid)
Answer: Other alternatives is to us XTools or ETGeoWizards. Both have a tool for making polygon and line grids at a user specified distance (ie: 0.25 or 0.5 degrees).
Answer: You can create 1 degree or 30 minute grids in the ArcGIS Data Frame Properties, as follows:

Right click your Data Frame in the TOC > Properties > Grids
Select New Grid
In the second window of the Grid and Graticule wizard, choose 1
degree for both the parallel and meridian sections.  Alternatively, choose 30
minutes (i.e. for 0.5 degree).

You can also convert your grid to graphics within the Dataframe Properties > Grids window.
Answer: The "USGS Map Indices Downloadable Data Collection" hosts a wide variety of resolutions of lat/long grids.  As stated on their data download page:

This data consists of data grids for the entire United States area,
  including 1 X 2 Degree, 1 X 1 Degree, 30 X 60 Minute, 15 X 15 Minute,
  7.5 X 7.5 Minute, and 3.75 X 3.75 Minute. The grid was generated using ESRI ArcInfo GIS software.

The USGS offers downloads in a variety of formats, but the most ubiquitous is the ESRI Shapefile (grouped by state).
You can also view these datasets through an USGS hosted ArcGIS REST Web Service.


How do you give weapons elemental damage? (Fire, Lightning, Dark)

Question: Ive been playing Dark souls 2 for some time now and I was wondering how to add elemental damage to my weapon. Does anyone know how?
Answer: In order to add elemental damage to a weapon you have to unlock a series of events.

Unlock Blacksmith McDuff in Lost Bastille
Light the torch on the far side of the room
reload so he is sitting at the bench.
Get the 'Dull Ember' from the Iron Keep
Go back to McDuff and give the ember to him

You can now interact with him to create elemental weapons. In order to create one, you must have an elemental stone to give to him. This stone will be used in the process so be careful what you choose.
Answer: Here is some info on upgrading your weapon to include elemental damage.
With reference to: LINK

At certain reinforcement levels, specific blacksmiths can ascend a
  weapon. There are numerous ascension paths to choose from. They can
  change the stat scaling of the weapon, altering its base statistics
  dramatically, and sometimes add an elemental damage type and/or an
  auxiliary effect.
The weapon must be at the required level in order to be upgraded down
  a specific path and some require specific Embers that can be found
  throughout the world.

There is a lot of types of upgrades you can make. Simply refer to the link to check them out.
Comment: The page that you linked refers to Dark Souls, not Dark Souls II. Here is the link to the list of blacksmiths in Dark Souls II, but DS2 being released just days ago, the list is far from complete http://darksouls.wikia.com/wiki/Category:Dark_Souls_II:_Blacksmiths
Comment: if you want me to state the upgrades and their requirements, just say so. However, it is more convenient to check the wikia page. everything there is stated \
Comment: Please add that some of the weapons have elemental damage even without upgrading.


Wireless internet security

Question: I have just installed Ubuntu 10.10 (dual booted with Windows 7) on a laptop which will connect to the internet through a wireless internet connection and I want to ensure that this is secure. I have installed GUFW and enabled the UFW firewall and set incoming to deny. What else can I do to secure this laptop?
Comment: It's enough i guess..
Answer:
Keep your installation updated: Even Linux programs will have security issues ocassionally, so make sure you periodically install all suggested updates for your system.
don't install packages you don't need: What isn't there on your system can't have security risks. This is especially true for daemons/server of any kind. I.e. if you don't need a webserver, uninstall apache. Ubuntu doesn't come with those by default but if you added one, consider removing it.
consider disabling Flash and Java plugins for your browser: Of course if you need one of those, you'll have to leave it enabled. Make sure you update the plugins, then. However, if you don't need e.g. a Java plugin in your browser, consider removing icedtea6-plugin, sun-java6-plugin and the likes
filter your internet: there are many browser extensions that help you filter the internet from stuff you don't need and can carry security issues

Flahblock Addon (xul-ext-flashblock )
disables auto-play for flash applications. Flash apps are replaced by a "play" button that starts the app on click. Also, it allows to whitelist sites like youtube or hulu, when you're sure they pose no thread
Adblock Plus (xul-ext-adblock-plus ) filters website ads that often don't come from the original site but from third parties that may not be as trustworthy as the original site you're visiting. However, if you trust a site and want to support it by viewing ads, it allows whitelisting known good sites.
NoScript disables JavaScript everywhere you don't whitelist, helping keep you safe from JavaScript exploits or some XSS-Attacks

don't run stuff you don't trust: not only executable files are dangerous. Recently, PDF files could include security risks, too. Those are mostly designed for the original Adobe Reader, however standard caution is still useful when opening files from untrusted sources
don't add random PPAs or install random packages: Addins PPAs or installing packages from website might be a huge convenience when installing programs that are not included in Ubuntu sources (or just plain old), however keep in mind that third party-repositories not only are able to install malicious software through updates, but that the installation process usually runs as root, which includes any scripts included in the installation package. Only add PPAs and packages from a trusted source, if you must have them.
keep your laptop physically secure: This one depends on what kind of security you wish to achieve. Consider buying a hardware chain and lock (Kensington Lock) so your hardware can't be stolen. As a basic precaution, lock your screen when you leave the laptop for longer than a few seconds by clicking the power-off button top right and selecting lock screen.
Encrypt your data: if you travel with sensitive data, consider encrypting your data. When installing Ubuntu or adding a new user, there is a checkbox that says Encrypt my home directory. This encrypts your home directory and protects its contents when your device is off. Keep in mind, however, that as long as the laptop is running, files are not protected and accessible.
Answer: That's pretty much all you need.  By default, no "server" services run on Ubuntu, so technically even starting ufw (using gufw) is overkill.  Obviously if you later configure services, then these should be ideally firewall protected so that only your desired clients can see them.
Having said that, you still want to ensure that your wireless connection is properly protected (which isn't really Ubuntu specific but I'll add it here for completeness):
Go to the network manager applet, right click and choose Connection Information.  Highlight your wireless network, then check the Security :

That should say either WPA/WPA2 or WEP.  If it's Open, then you have to reconfigure your router, then reconnect your laptop with the proper key.
Comment: Stay away from WEP. Yes, it is more secure than open wireless, but not much anymore. WEP can easily be cracked in 2011. WPA/WPA2 is much harder to crack, without loosing too much bandwidth or performance.
Comment: My security is "unknown"
Comment: True, WEP is generally easy to crack, but for a home installation, who would bother?  But yes - if security is important, stay away from WEP.
Comment: I've never heard of "unknown" security type before, sorry babelproofreader.  To check the security "manually", right click on the network manager applet, and choose "edit connections", then click on your Wireless tab, highlight your SSID (network name), click "Edit", then click on the "Wireless Security" tab.
Answer: The problem is not the security of the laptop (incoming ports etc) you've taken care of those. The problem is that wifi is inherently insecure by the nature of you broadcasting all your information for a 30 foot radius.
Always use ssl/https, always ensure you're using an encrypted WPA2 network (not WEP) and plug in via ethernet if you really want to make sure.
Answer: Get rid of Windows 7?
More seriously, always use SSL websites (https://) where possible and install some security/privacy-related extensions in Firefox, e.g. NoScript, Adblock Plus, Better Privacy, Cookie Monster, Ghostery, HTTPS-Anywhere, Passwordmaker.
Answer: As mentioned previously, go with protected wireless, using WPA/WPA2, avoiding WEP or open wireless. Also, avoid unknown applications, or those that have not been reviewed first. Anything you do on the internet today should all be encrypted using SSH/HTTPS. Although Ubuntu is not installing services by default, this is something that a local Linux guru should check to make sure nothing that you don't know is running. There also may be services for things such as Bluetooth, Eudora or other end-user services that you don't need. The less programs you run, the better/safer you are. For example, Ubuntu is known to run an email agent of some kind for checking your email, regardless of the email software you use. I usually disable half a dozen of such services on my installation, before starting to really use it.

Wireless internet security


How to adjust my theme, so that all elements (e.g., the search in the header) keep their position after changing the size of the screen?

Question: my theme (www.wortwaerts.net) works fine in IE8: If I change the window size by squeezing or stretching it, all elements (especially the search and category dropdown in the header) keep their position - and a horizontal scroll bar will appear if the screen gets to small.
My problem: In other browsers, e.g. Mozilla, squeezing the window makes the search shift upwards and the category dropdown downwards – also, the text content is cut off and no horizontal scroll bar appears that enables the user to read the cut-off content.
Does anybody know why only in IE8 all elements keep the position? And how to fix the elements and make a horizontal scroll bar appear in other browsers as well (how to change which theme files)...? Putting <code>#screen { width: 58.875em; }</code> into style.css doesn't work...
I'm really a starter and would be happy about any hint :o) Thanks, Felix
Answer: just add "min-width: 58.875em" to your code it shoud work but i'm not sure...


Making homemade pasta

Question: In making homemade pasta some recipes call for semolina flour. There are two types of semolina that I know of one is the course grind and one is the fine grind which they call durum flour. Both are from semolina wheat. So the question is when they call for semolina flour which one do you use ?
Comment: I've made pasta with regular flour, 00 flour, semolina flour and a mix and match of all of the above and they all turned out fine enough for family and friends.
Answer: There is not one correct answer to your question.  I've seen recipes with, and have used, both.  So, it depends on the type of pasta. A recipe for capunti (a hand rolled pasta from Puglia) that I enjoy, uses 1/2 semolina and 1/2 durum...  while an extruded pasta noodle might use all semolina. You might be guided by identifying the type of pasta, and its region of origin, to see what is typical. However, I would have to assume that when a recipe calls for semolina flour it generally means the course grind version.
Comment: Just to be clear, are you saying that a recipe might simply call for "semolina flour" but actually mean half and half semolina and durum?
Comment: @Cascabel I've edited my response above.

Making homemade pasta


How to change default font size when preview open microsoft excel document?

Question: I use macbook air, Preview is brilliant, But seems can not zoom out microsoft document(word, excel), So I want to change the default font size.
But how?
Answer: Enter the following command into the terminal. Quit and relaunch Preview.
<code>defaults write com.apple.Preview NSSystemFontSize -int X
</code>
Change X to desired font size.
Source: http://www.macosxtips.co.uk/index_files/13-things-you-didnt-know-about-preview.php
Oh, and to Apple - ever heard of UI?!


What remains the same: voltage, current or resistance?

Question: A current 1 ampere passed through a conductor which resistance is 10 ohms, if the current become 2 amperes, then will the resistance of the conductor will remain 10 ohms, and if not, then what is the resistance in the second case?
Comment: Hi and welcome to physics.SE! Please note that [homework-like questions](https://physics.meta.stackexchange.com/q/714/50583) and [check-my-work questions](https://physics.meta.stackexchange.com/q/6093/50583) are generally considered off-topic here. We intend our questions to be potentially useful to a broader set of users than just the one asking, and prefer *conceptual* questions over those just asking for a specific computation.
Answer: There is not sufficient information to answer this question.
For starters, the question contradicts itself. A conductor is something with (close to) zero resistance. A conductor with a resistance of 10 ohms is not a (perfect) conductor. But let's say that 10 ohms is good enough to call something a "conductor". After all, 400 feet of 24 Gauge copper wire has a resistance of 10 ohms and we call "copper wire" a conductor.
400 feet of 24 Gauge copper wire has a resistance of 10 ohms. If you run 1 ampere of current through it then the 400 feet of 24 Gauge copper wire has a resistance of 10 ohms. If you run 2 amperes of current through it then the 400 feet of 24 Gauge copper wire still has a resistance of 10 ohms. That's because 400 feet of 24
 copper wire has a resistance of 10 ohms.
Sure, if you run enough current through the wire then eventually it'll heat up and the resistance will increase, but that's not something you'll see a large effect from under ordinary operating conditions. (2 amperes is below the 3.5 ampere maximum current rating of 24 Gauge copper wire.) Figuring out how much something's resistance changes when you run current through it is a complicated process. It depends on how hot the wire gets. How hot the wire gets depends on heat dissipation. Heat dissipation depends on all sorts of things from the material it's made of to the density and temperature of the surrounding air.
Your question never specified that you're using 400 feet of 24 Gauge copper wire. It could be 12 Gauge copper wire. It could be silver wire. You could be running current through a transister, for which the meaning of the word "resistance" becomes very complicated very fast.
Fortunately, we usually use the word "resistance" to describe an electrical component called a "resistor". The great thing about resistors is that their resistances tend to be constant within their standard operating ranges. If 1 ampere and 2 amperes are both within a resistor's operating range then its resistance is going to be pretty much the same, much like 24 Gauge copper wire.
But let's suppose it's not. Let's suppose you want to find out what the resistance of your imperfect conductor is. That's easy to solve. All you need is Ohm's Law.
$$V=IR$$
$V$ is voltage. $I$ is current. $R$ is resistance. If voltage is fixed and the current is doubled then resistance is halved. If resistance is fixed and the current is doubled then voltage is halved.
So there's your answer. Did you double the current by modifying the voltage or modifying the imperfect conductor? If the former and your conductor behaves like a resistor then the conductor's resistance stays the same. If the latter then your conductor's resistance has just halved.
Answer: You state the material carrying the current is a "conductor". That would normally imply metal. But as @Isusr has already pointed out, 10 ohms would involve a very long and thin wire to achieve that resistance in the case of copper conductors.
That being said, the resistivity of an electrical conductor is a function of temperature. For metallic conductors, the resistivity ($ρ$) and resistance ($R$) can be considered to vary linearly with changes in temperature according to the following relationships, for a given temperature range:
$$ρ=ρ_{0}[1+α(T-T_{0})]$$
$$R=R_{0}[1+α(T-T_{0})]$$
where
$ρ_0$ = resistivity at $T_0$
$R_0$ = resistance at $T_0$
$α$ = temperature coefficient
For a conductor of given resistance R, we know that the power dissipated in the conductor is given by
$$P=I^{2}R$$
Increasing current increases power dissipation, which increases the temperature of the conductor and thus increases its resistance. Whether or not this is a practical concern with respect to electrical conductors is another matter.  Consider the following example:
We have 400 feet (122 m) of 27 gauge copper wire which @Isusr says would have a resistance of 10 Ohms (presumably at room temperature).  For copper we have:
$$α=\frac {4.29 x 10^{-3}}{^0C}$$
$$ρ_{0}= 1.724 x 10^{-8} Ohm-m$$
A temperature rise of 75 C increases its resistivity to $2.278x10^{-8}$ Ohm-m. If this temperature rise exists over the entire 122 m length of conductor, the resistance $R$ of the conductor will rise from 10 Ohms to about 13 Ohms.
Now let's consider the possibility of getting this temperature rise over the entire conductor if we increase the current from 1 ampere to 2 amperes, assuming the conductor is laid out straight (as opposed to being coiled up).  If I did my calculations correctly, this increases the power dissipation from 10 watts to 40 watts, or a 30-watt increase over the entire length.  This is an increase of 0.0065 watts/inch. I should think that such a small increase in dissipation per unit length would result in a negligible temperature rise.
But if we had a coil of wire, the situation would be quite different as the watt density (watts per unit volume) would be much higher.
Hope this helps.
Answer: Resistance of a particular resistor is fixed. However, it depends on the material the resistor is made of. The resistance offered by the resistor is also affected by the temperature of the resistor at the time of usage. The resistance of a given resistor varies directly with temperature.
Keeping temperature constant, the value of resistance is given by $R=\frac{V}{I}$, which is the famous Ohm's Law. What will change when the current changes is the Voltage, (or I should say what "causes" the change in current) is the voltage since you can change the current only by changing the Voltage across it for a particular resistor at a particular temperature.
Answer: Resistance is a property of a material in which conduction occur and is dependent on temperature. Resistance remains same, doesn't  matter if we increase current of some Ohmic devices. But voltage varies. We had defined Ohms law as voltage is directly proportional to the current given the temperature remains same. The constant which equates the proportionality is actually called Resistance.
Of course, resistance will vary with temperature. As time goes on the increase in temperature of the conductor may cause, change in resistance, but by a negligible amount.


Non-linearity of neural network classification

Question: Why is it that logistic regression is considered a linear classifier, but a neural network with a sigmoid activation function and sigmoid output layer is considered non-linear? I am aware that logistic regression is considered linear because its inputs are a linear combination of the original inputs, but couldn't the same be said of the neural network example?
Answer: A neural network with a single sigmoid neuron is also a linear classifier when the output is thresholded for classification. But, more than one layer produces a non-linear one because the decision rule can't be written in the following form:
$$\sum w_i x_i+b>\tau$$
where $\tau$ is threshold, $w_i$ are learnable weights and $x_i$ are features. This is why logistic regression is referred as a linear classifier.
Comment: Maybe to elaborate a little:
When talking about the (non)linearity of models, the combination of weights is considered. The use of non-linear function does not lead necessarily to non linear models. (although they are needed to "create" them). In case of a logistic regression only a single sigmoid function is used. But all weights are added linearly before that transformation. In a neural network  at least two non-linear transformations are used. No you have a scenario where the combinations in not linear.
Comment: So, a neural network with 2 sigmoid units is considered to be non-linear simply because the input to the second sigmoid unit is non-linear due to the non-linear activation of the inputs?
Comment: @terribleprogrammer, this has to do with how many hidden layers there are. In the case of logistic regression, there is zero. If there is at least one, you get nonlinearity.


Connected to Wifi but no internet

Question: Hi so I'm a complete Ubuntu beginner and I have just installed it.
So the problem is that I am connected to the Wifi (wireless) but I can't actually use the internet. I am using Ubuntu 16.04.
Comment: Then thats a problem with your wifi
Answer: I found a simple fix.  I didn't have any problems pinging IP addresses; I ran into problems when I tried to issue a command like:
ping google.com

In other words, I could connect to the internet, as affirmed by the wifi indicator, but I was having problems turning domain names into IP addresses.  This process is handled by the text file /etc/resolv.conf, so I decided perhaps it need to be updated.  I issued the command:
sudo resolvconf -u

but Ubuntu spit this back at me:
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf

This was the source of my problem: somehow /etc/resolv.conf was pointing to /run/resolvconf/resolv.conf .  Fortunately, once I removed the bad symbolic link and created a new symbolic link the wifi worked immediately.  That is, I ran the following commands:
sudo rm /etc/resolv.conf
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf

and the wifi was back up!  I hope this simple solution works for you too!
Comment: This worked for me on Ubuntu 16.04. Have been looking for a simple answer like this for ages!
Comment: After following the mentioned steps, as an additional step, I had to set DNS server IP from the network settings. Then that IP saved in the /etc/resolv.conf . Finally it worked.
Comment: good grief. I was about to throw the machine away, assuming undiagnosable hardware failure
Answer: knowing how to address a non working internet connection may help as follows.
opening a terminal and...
See if you can ping or traceroute to google's public dns.
ping 126.96.36.199
mtr 18.104.22.168

If you get communication with Googl's public DNS then skip down to the last step on DNS.
If you're not getting a ping/traceroute to Goole's DNS then start by making sure your wireless addapter is getting IP information with the command.
ifconfig

output should have ip information listed for your wireless adapter something like...
wlan0   Link encap:Ethernet  HWaddr 00:xx:xx:xx:xx:xx
    inet addr:192.168.1.55  Bcast:192.168.1.255  Mask:255.255.255.0

next check to make sure you have a default route
route

output should have a route something like...
default         192.168.1.1    0.0.0.0         UG    0      0        0 wlan0

At this point you should be able to ping and/or traceroute to Google's public DNS "126.96.36.199".  If not then call your Internet provider for additional help with your internet connection.
Now that we can ping google's public DNS we can be well assured that our internet is working. If you're still having problems then your computer is most likely not reaching a working DNS service.  You can check your DNS servers with...
cat /etc/resolv.conf

You should also check the connection status in your network manager if you're using a desktop version of ubuntu. Once you have identified/set your DNS servers make sure you can ping them as well.  If you can ping the DNS servers that you have set then the problem resides above the network layer in a firewall or application issue.
Answer: Check if systemd-resolved is running  sudo systemctl status systemd-resolved
Mine wasn't, so I started it.
sudo systemctl start systemd-resolved
sudo systemctl restart network-manager

Now I have access.
Answer: This may help.
When I loaded Ubuntu 16.04.1 on my old desktop I already had Windows Vista installed.
Although I used a second reformated HD disk Ubuntu keeps track of the Windows operating systems and will allow you to boot to it as an option.
This seems to interfere with the WiFi it connected correctly but would not access the internet and nothing I did would fix.
I removed the original Windows disk from the system and reinstalled Ubuntu and now have no problems with my Wifi.
Answer: /etc/resolv.conf contained a local IP-configuration-definition (did not occur via LAN), which I commented out according to https://www.youtube.com/watch?v=YJpPltoXpIs
Answer: In my case, after installing KDE NEON i had the same issue.
Resolved following the instructions on this post Connected to the wireless but no internet access and moosee333 instructions on resolv.conf file.
My resolv.conf has this values (default ones on live usb):
nameserver 127.0.0.53
In my OS the resolv.conf file is located in /run/NetworkManager/ with a symlink in /etc/
I had to undo the firt part of the instructions about NetworkManager.conf, because that left the machine without wifi.
I hope this comment help other users.
Thank God for this great community.

Connected to Wifi but no internet


What is the Out-of-time-ordered correlator for free fermion system?

Question: The Out-of-time-ordered correlator (OTOC) is defined as $\langle[W(t),V(0)]^2\rangle$, and can be considered as a new way to extract quantum chaos. However, the understanding of this special correlator is not clear. For a simple example, what the free fermion OTOC behaves? Both lattice or continuum case are welcome.
Comment: Since OTOC can detect the scarmbling of quantum dynamics system, the interest lies in quantum many-body interacting systems to reveal its  quantum chaotic behaviour (some works on interacting fermion system, e.g. https://journals.aps.org/pra/abstract/10.1103/PhysRevA.95.011601, and for those work with SKY model you can find them easily) . For free fermion, this correlator will simply trivial and free of Lyapunov  exponent (chaos doesn't occur in such integrable/dynamic determined system) and stay constant, which depends on what local obserables you choose and calculate with fermion commutator.
Answer: First of all, your definition of the OTOC is wrong. It is supposed to be composed of the static and time-evolved versions of the same operator, so it should read $C(t) = - \langle [\hat{V}(t),\hat{V}(0)]^2 \rangle$. The minus sign has become standard in the field.
The understanding of this function is not that hard to grasp: if $\hat{V}(t)$ and $\hat{V}(0)$ commute for all times, nothing happens. Your question, regarding the free fermion case, can be generalised for all cases where $\hat{V}$ commutes with the Hamiltonian: nothing happens. This makes sense, since if you're looking for something that could be called chaos, then it shouldn't arise with such a trivial time evolution. But if your time evolution is interesting enough to provide operators that stop commuting, then your OTOC starts giving off meaningful stuff. It was postulated that a special (momentum) OTOC version growth rate should be closely tied with Lyapunov exponents, something that didn't turn out to be exactly true, but close enough in some aspects. The reason behind this postulate regarding the momentum-OTOC is that, using a test function $f$ and the static position basis,
\begin{align}
[\hat{p}(t), \hat{p}(0) ]f  &= -i \hbar \left[ \hat{p}(t) \frac{\partial f}{\partial q(0)} - \frac{\partial}{\partial q(0)}(\hat{p}(t) f) \right] \\
&= (i \hbar f) \frac{\partial \hat{p}(t)}{\partial q(0)} \, ,
\end{align}
so that
\begin{align}
C(t) &= -\langle [\hat{p}(t), \hat{p}(0) ]^2 \rangle \\
&= \hbar^2 \bigg\langle \left( \frac{\partial \hat{p}(t)}{\partial q(0)} \right)^2 \bigg\rangle \\
&\approx \bigg\langle \left( \frac{\Delta{p}(t)}{\Delta q(0)} \right)^2 \bigg\rangle_{\text{phase space}} \quad (\equiv C_{cl}(t))\, ,
\end{align}
that is, for times smaller than Ehrenfest's time, this approximation should be quite reasonable. Now, if we're talking about a chaotic map, it means that for small deviations on position we'll have very large (exponential) deviations on momentum. This suggests that, after a little analysis,
\begin{align}
C_{cl} (t) &\approx (e^{ \Lambda t})^2 \\
\Rightarrow \Lambda &= \lim_{t \to \infty} \lim_{\Delta q(0) \to 0} \frac{1}{2t} \ln \left[ \frac{C_{cl}(t+1)}{C_{cl}(1)} \right] \, .
\end{align}
The classical expression for the Lyapunov exponent is given by
\begin{align}
\lambda = \lim_{t \to \infty} \lim_{\delta Z(0) \to 0} \frac{1}{t} \ln \left( \frac{|\delta Z(t)|}{|\delta Z(0)|} \right) \, ,
\end{align}
where $\delta Z$ represents the separation between trajectories and $|.|$ the norm. Notice how $\Lambda$ and $\lambda$ are very similar. This motivates the study of OTOCs in the context of quantum chaos.
Comment: First thank you for answering. However I don't think the minus sign is by any means conventional or standard. For a very recent paper Phys. Rev. Lett. 120, 110603 (2018), the equation (1) is clearly without minus sign. I can see some of researchers might be more comfortable with a minus sign, such as in Phys. Rev. Lett. 118, 086801 (2017), but it's not normal.
Comment: And I actually have a question. Is that the OTOC of a state would be interesting only with some sophisticated choice of operators? And even if I choose two sets of operators that have some non-trivial property, the two corresponding OTOC could behave differently?
Comment: I am used to the definition with the minus sign and didn't know people used it with a plus sign too. Now, what do you mean by sophisticated operators? My example is nothing but two momenta... Quite peasant.
Comment: Dear @QuantumBrick, could you please introduce some introductory materials (books or papers) for me on OTOC, I am recently starting to learn this but have no clue where to start, thanks a lot.


Weighing half-balls

Question: A bearing factory cuts four solid steel balls into halves by rolling them through the vertical laser and then drops into a collecting bin. The eight half-balls looks identical but due to rail precision error the slice makes halves with 1gram difference in weight. To sort them into four 100g pair with lighter and heavier halves,a digital and/or the balance scale are available for use. How many weighings is needed?
Comment: *exactly* 1g each?  That's some extremely precise imprecision.  Also, are we weighting these to get a number, or against each other?
Comment: 1g difference between light and heavy halves maybe 0.5mm differnce in height. Without caliper its hard to distinguish. Although just the least number of trials is to be determined ,we need to solve it for both weighing machine.
Comment: I don't get the 100g part
Comment: The 8 halves makes 4x 100g pairs of 49.5g light + 50.5g heavy. That is 1g difference.
Comment: bin w/ [ 4H 4L ]  -->  (LH)  (LH)  (LH)  (LH)  pairs
Comment: @BenBarden- against each other one machine might save 1 weighing while the other might save 2 weighings.
Answer: Put all the 8 halves on the digital scale. It will read 400 gm (not considered as a reading as this is a known fact).
Remove 2 halves at a time and read the digital scale. If the weight reduces by 101 gm, it means HH - two heavier halves were taken out. Put them separate. if the weight reduces by 99 gm, it means LL - two lighter halves were taken out. Otherwise, LH - two complementary halves were taken out completing one pair. In either of the case, keep the comppair separate.
Do this 2 more times, you'll 3 pairs of halves out. And it is known to you whether they are LL, LH or HH. Basis this, you already know the combination in the last pair that is still on the scale (so no need to get the scale reading).
Now, all you need to do is arrange them into complementary pairs of halves since you already know the combinations taken out of the scale.
So, in total, this can be done with 3 readings of digital scale.
Comment: +vote with note: The same approach can work by weighing each removed set separately and directly.
Comment: It is a known fact that the 8 halves weighs 400g. You dont have to use the digital scale for the first reading.  There is a better first move for your correct method.
Comment: Removing 2 halves.. is same as placing six halves.
Comment: Yes. That's why I have mentioned in the answer that the first reading is not to be considered since it is a known fact. And yes, removing two halves is the same as placing six halves. Just did this way so the process could be clear.
Answer: 3 is the worst-case bound, but you can do better on average by enabling short-circuit outcomes using a digital scale. Number the 8 things 1-8.

First weigh 1234.

If you get 4-0, that is, HHHH (or LLLL), you're immediately done - (15)(26)(37)(48) works. This happens with probability $1/35$, saving you 2 weighings.
If you get 3-1, probability $16/35$ (WOLOG presume you've gotten HHHL unknown order), next weigh 1256. Note that 12 cannot be LL, 56 cannot be HH.

If this second weighing gets HHHL, 12 must be HH, and you save the third weighing as (17)(28)(34)(56) works. This happens with probability $1/4$.
Similarly, if the second weighing gets HLLL, 56 must be LL, and (12)(35)(46)(78) works.
If you get 2-2, simply weigh 12 itself, and you can still figure it out.

If HH, then (15)(26)(34)(78)
If HL, then (12)(56)(37)(48)

If you get 2-2, still weigh 1256 next.

If you get HHHH or LLLL, you save the third weighing with probability $1/18$ - (13)(24)(57)(68) works.
If you get HHHL (HLLL similar), weigh 12 itself:

If HH, then (13)(24)(56)(78)
If HL, then (12)(34)(57)(68)

If you get HHLL, again weigh 12 itself:

If HH or LL, then (13)(24)(57)(68)
If HL, then (12)(34)(56)(78)

Therefore, you can save $1/35\times2+16/35\times2/4+18/35\times1/18$ to use $94/35$ weighings on average.
Comment: You  mean it is better if  you dont  have to sort the complimentary pairs always in 3 trials? Alright..then maybe the 3 trials on balance scale has higher chances
Comment: I'm saying sometimes I can sort in less than 3, but always by 3 trials
Comment: I understand i was refering to the earlier solution that needed to use the digital scale trice. No chance of  using it just once or twice
Answer:
 It seems like 4 balance weighings is an upper bound. In some outcomes, we don't find out the individual weights of some halves. But they can be paired up correctly nonetheless.

 Note also that any partitioning of the 8 halves into 4 pairs can only have a small number of "configurations", by counting mixed pairs (M), pairs with 2 heavy halves (H) and pairs with 2 light halves (L). The possible configurations are (4M), (2M,1L,1H), (2L,2H). Our target is to find a partitioning with (4M).

 Name the half-balls 1...8. Weigh 1 against 2 (1).

 Case 1: 1 and 2 are not equal. Weigh 1+2 against 3+4 (2). The result will tell you that 3 and 4 are either both heavy, both light, or mixed. Now weigh 1+2 against 5+6 (3). Again, this will tell you whether 5 and 6 are heavy, light, or mixed. Whatever the outcomes are, you can infer enough to pair everything up. For example, if 3 and 4 are heavy, and 5 and 6 are mixed, then 7 and 8 are light. If 3 and 4 are mixed, and 5 and 6 are mixed, then 7 and 8 are mixed. Et cetera. In any event, keep any known mixed pairs together, and pair up light+heavy halves to get the others.

 Case 2: 1 and 2 are equal. Weigh 1+2 against 3+4 (2). If they are equal, we are done because we know 1234 are equal, thus 5678 are equal to each other and we can just make pairs. So we only care about when 1+2 are not equal to 3+4. Assume 1+2 is heavier (we can reverse all subsequent logic if 1+2 is lighter).

 So we know that 1 and 2 are heavy, and we know that 3 and 4 are either mixed or both light. Weigh 3+4 against 5+6 (3). If 5+6 is lighter, then 3 and 4 are mixed, 5 and 6 are light, and 7 and 8 are mixed. If 5+6 is heavier than 3+4, then 3 and 4 are light [proof: assume 3 and 4 are mixed. then 5 and 6 are heavy, making for a total of at least 5 heavy halves (1, 2, 5, 6, and either 3 or 4)] and we can weigh 5 vs. 6 (4) to determine the rest of the halves.

 Finally, if 5+6 is equal to 3+4, then either each of those pairs is mixed, or each of those pairs is light. If each pair is mixed, then 7 and 8 must be light. If each pair is light, then 7 and 8 must be heavy. You can determine which of these is the case by weighting 1 against 7 (4).
Comment: +vote with note: The excellent insight at the beginning of this approach allows for one fewer weighing by using the digital scale alone.
Answer: Using Balance Scale with  3 trials or  less :
1st) Place  4 halves on each pan . Always rotate the scale 180°  when it  tilt to right so we have 3 cases:
HHHH > LLLL
HHHL > LLLH
HHLL = HHLL
From the tilted cases in 1st trial :
2nd)  Place  2 halves  on each pan from 1st trial's left pan .We have 2 cases:
HH = HH   with  (LLLL) set aside     (only case done with 2 trials)
HH > HL     with (LLLH) set aside    (done with the next trial)
3rd) Replace the 4 halves on the scale with 4 set aside halves. 2 halves on each pan and we are done with 1 case.
LH > LL   with (HH) (HL) set aside
From the balance case in 1st trial :
2nd)  Place  2 halves  on each pan from 1st trial's left pan .We have 2 cases:
HL = HL   with  (HHLL) set aside   (done with the next trial)
HH > LL   with  (HHLL) set aside   (done with the next trial)
3rd) Replace the 4 halves on the scale with 4 set aside halves. 2 halves on each pan and we are done with 4 cases.
HL = HL   with  (HL)(HL) set aside
HH > LL   with  (HL)(HL) set aside
HL = HL   with  (HH)(LL) set aside
HH > LL   with  (HH)(LL) set aside

Weighing half-balls


Are the "." and ".." entries in a dir listing always the same?

Question: When would the "." and ".." entries in a dir listing differ?  (I understand they represent two different directories, but they always list identically with the same date and time in a default dir command.  Do they ever differ?)
Comment: Can you give an example (perhaps with a screen shot)
Answer: As to the actual listing:
27/08/2011  11:23    <DIR>          .
27/08/2011  11:23    <DIR>          ..

They're using the date of the current directory for both. If you start in C:\Users\Chris (say) you might get the above. But when you go up to C:\Users you get:
26/07/2011  21:20    <DIR>          .
26/07/2011  21:20    <DIR>          ..

So the date of .. in the first case is not the same as the date of . in the second. Which is apparently wrong as they are (or should be) the same directory. However, . and .. are references to the current and parent directory and are both created at the same time - when the directory was created - so it's actually correct (thanks to Synetech inc for pointing this out)
The only time the timestamps would be different is if one or other of . or .. were recreated.

The original answer:
. means the current directory.
.. means the parent directory.
So under normal circumstances they are always different.
The only time they yield the same result is when you are at the root of the disk. So at C:\> dir . and dir .. produce the same output.
Comment: That's wrong, because `..` not given the timestamp of the parent directory, it is given the timestamp of the current directory. This is because `.` and `..` are both created when the directory is created.
Comment: answer to the point, great.
Comment: Edited to emphasize the question is regarding their appearance in a dir listing.
Comment: @mike - tried to answer the revised question to justify the votes ;)
Comment: @Synetech - Ah! The penny drops
Comment: I suspect they might also be different if a clock tick happened to take place between the creation of the . entry and the .. entry.  We'd have to look at the code to be sure, though.
Answer: No, they will always be the same. Because these are directories, not files, they are handled slightly differently (in fact, they are not even normal directories, they are pointers as eL01 said, so they are handled even more differently than normal directories).
When you create a directory, two entries are automatically created:

. points to the newly created directory
.. points to the the new directory's parent

Obviously . will have the current date and time that the directory is created, and while it may seem logical for the timestamp of the parent directory to be copied to .., that is not how it works. When you create a new directory, both of the pointers receive the current date and time. This is the case from DOS through Windows 7 on both FAT* and NTFS.
Comment: +1 since it seems you were the one coming up with the answer ChrisF is now presenting ;-)
Comment: @Jonas, actually, ChrisF's answer makes the same mistaken assumption that most people would: that `..` would have the timestamp of the parent. (I would not be surprised if some day, a new file-system—WinFS?—were to finally do it that way).
Comment: Starting with his [4th revision](http://superuser.com/revisions/335150/4) I'd say he doesn't make that assumption any more.
Comment: @Jonas, ah okay. I didn't see the edits. Oh well, he's getting new up-votes anyway; I guess that's the point to the edit function.
Comment: I should have credited you in that latest revision - I'll do so now.
Comment: For the record, I just checked on my Linux box and you do get different timestamps.
Comment: Thanks guys. In any case, the point is that they are the same because they are special cases and handled differently. (I just checked and apparently [WinFS](http://en.wikipedia.org/wiki/Winfs) was formally cancelled! I was looking forward to it to; it really would have helped with file organization.) `:-(`
Answer: I actually can't give you proof, but I think:
Every directory has a list of directories and files it contains. To make it possible to use relative paths every directory needs those two pointers - one to itself . and the other directory one level above .. - those two pointers are just created on the time the directory itself is created.
So the timestamp of .. is actually not the timestamp of the directory above but the timestamp of the pointer to the directory above.
Comment: That is correct. The `..` entry is given the timestamp of the current date and time when the current directory is created.


Do I need a company name to publish on Google Play?

Question: I'm going to upload my Android mobile game on Google Play. But it seems like all games are developed by companies(such as Zynga, and King) and I don't see individual's names as developers. Do I need to register a company name officially? I think it costs a few hundred dollars... If I have to, how and where do I register? or instead of registering a company for a few hundred dollars, if I make a domain website that is named as my company name, would it provide me some protections?
Also, do I need to trademark my game's title as well?
Thanks!
Answer: You can put what you want under developer name. Just make sure its not a trademark being used or registered trademark.  Or just use your real name. It doesn't matter too much.
If you make up a name and brand yourself as it, its a trademark. A website would help prove you used it first.
Comment: I'm no lawyer, but actually publishing a game under that name (whether it's the product name, company name or whatever) should be enough to show that you used it first. It still won't make it obsolete to register the actual trademark, though.
Comment: Yes, you only need to prove you used it first but having a website certainly wouldn't hurt if it ever went to court.
Comment: But how do I know if the studio name I chose is being used? I think one way would be Google search but how can I be sure that Google search lists all studio or company names that are being used? What if the studio name owner does not have a website?
Comment: Ya search around and if there is no evidence that someone is probably using it then you are probably good. If not chances are you will get some sort of legal action letter or something and a chance to change before it ever went to court. Ofcourse I am no lawyer.  (also I have 0 experience with laws outside the usa)


Equation for a Locus

Question:
I'm wondering how to go about finding the equation that defines this locus. In short, the locus is all the points the same distance from the closest point on $e^x - 1$ as $(0,1)$. The setup in GeoGebra also lets me change the function it depends on easily which produces very interesting results for almost every function (for a straight line, it produces a parabola).
Comment: can you express the distance from any point $(x,y)$ to any point $(x',e^{x'}-1)$?
Comment: One of the definitions of the parabola is the locus of a point which is equidistant from a fixed point (the *focus*) and a straight line (the *directrix*),
Answer: The distance from any point $P(x, y)$ on the required locus to the fixed point $Q(0, 1)$ is given by $$PQ^2=x^2+(y-1)^2$$
The distance from the same point $P(x, y)$ to a point $T$ on the given curve $(t, e^t-1)$ is given by
$$s=PT^2=(x-t)^2+z^2$$
where $z=y-e^t+1$ hence $y-1=z+e^t-2$.
The point $T$ is closest to $P$ when $s$ is a minimum wrt $t$ :
$$\frac{ds}{dt}=2(x-t)(-1)+2z(-e^t)=0$$
$$x=t-ze^t$$
The required locus is defined by $PQ^2=PT^2$ :
$$x^2+(y-1)^2=(x-t)^2+z^2$$
Substitute to eliminate $x, y$ leaving an equation in $z, t$ :
$$(t-ze^t)^2+(z+e^t-2)^2=z^2e^{2t}+z^2$$
$$t^2-2tze^t+e^{2t}+4-2(ze^t-2z-2e^t)=0$$
$$z=\frac{t^2+(e^t-2)^2}{2[(t-1)e^t+2]}$$
Co-ordinates of points on the locus can be obtained in terms of parameters $t$ and $z(t)$ :
$$x=t-ze^t, y=z+e^t-1$$

Equation for a Locus


Reading subset of the table using Dapper in C#

Question: I am using Dapper in the project, and it's ok if I need to get either the single primitive type (int, decimal, string, etc) or any db entity, but I need to read just 2 columns from the table, and I faced with lots of the challenges here:
This is a simple query:
SELECT col1, col2 FROM Table1

Where I expect to receive string and int
And this is how I read the data once the query is implemented:
var field1 =  (await result.ReadAsync<string, int>()).FirstOrDefault();

And this is not compilable.
I tried to create the class which contains 2 fields: string and int and use that type instead of  .
So it results to the following correction:
var field1 =  (await result.ReadAsync<MyData>()).FirstOrDefault();

class MyData
{
string...

int ...
}

and it compiles but I get null for string and the proper data for int.
The query itself is correct, I tested it and it's fine.
So the question is how to read the 2 columns?
Comment: I think for your original code what you wanted was `ReadAsync>()`
Answer: Your second approach looks correct. Dapper by default maps on convention. Name of properties in your MyData class and the name of column should be same so that Dapper can map correctly.
So, your MyData class should look something like this:
class MyData
{
    string col1...
    int col2...
}

In case, your property names have to be different, you need to modify your query to use column alias something like below:
SELECT col1 AS MyProperty1, col2 AS MyProperty2 FROM Table1

Also note that in case of complex query/mapping, your table name should match with your name of POCO/Entity class.
There are ways to override the default mapping. Please refer this question for detailed discussion on Dapper's mapping.


How does lightning increase the voltage within a substation (how does current increase voltage)?

Question: I'm new within the power industry and was introduced to a scenario I had a question about. So, while discussing the need for surge arresters came up, we began talking about lightning. I know that lightning is produced by a voltage difference (between the clouds and ground/earth) which causes a strike. So, if this lightning strikes equipment within the power/substation grid, this would cause a huge surge in current right? Well, when discussing the surge arresters, they are rated and were being discussed in terms of voltage. So I was reading that lightning causes voltage surges. Can someone explain how this happens outside of equations. I get V=I/R, so by the equation, if you increase the current you get a larger voltage. But can someone explain this in terms of like physics/real world, how does the potential difference inside the station increase due to an influx of current. Sorry if this is a dumb question, I can really only conceptualize voltage in terms of like batteries, and I can't seem to make sense of this through that anology.
Comment: Lightning doesn't cause a huge surge in current; it **is** a huge current. So, 50,000 amps hitting a live conductor that has an impedance of maybe 0.1 ohms, raises the voltage by 500 volts.
Comment: The current in lightning is one way which means it increases the charge imbalance to a system which changes the potential. Think...static electricity or even charging a capacitor.
Comment: I would suspect the emp from the lightning bolt induces a voltage in the line
Comment: Lightning causes a surge current when it touches the line. It cause also a surge in voltage when the wave generated touches (after propagation) the substation. This is the reason why the impedance of a added short transmission line (+/- 500 m), just before the substation, is enough "long" and of very low impedance to make a voltage reflection coefficient = -1. So the overvoltage on substation equipment is the "lowest" possible.
Answer: Here is a simulation ... of what "happens" in the electrical "system" when lightning strikes a line but not to the very nearest of the substation ...
It is only an example. It is up to you to use the exact parameters of the whole system.
One can see the "drastic" reduction of "overvoltage" at the substation, in some cases.

Other case

Long line is open
Answer:
I know that lightning is produced by a voltage difference (between the clouds and ground/earth) which causes a strike.

That's more or less true, up to a point. It's probably better however to look for how the voltage difference is caused.
The thunderstorm moves electrical charge about. Some clouds or parts of the cloud end up with more positive charge on them, others with more negative charge. I don't recall which way the ground/cloud charge difference tends to happen, and that's not important right now.
The clouds have relatively low capacitance with respect to each other and to earth, so that charge separation creates a very high potential difference.
Now we come back to your quote. The high potential gradients close to the charged parts ionise the air creating a conducting channel, and allows the charge to move along the channel. When the channel has grown to bridge two clouds, or the cloud and ground, the charge can flow rapidly along the ionised channel, causing a very high current (current = charge/time). This is the lightning stroke, transporting charge from one place to another.
In the context of a power station, what a lightning stroke does is dump a large quantity of charge into the conductor that it hit. The capacitance with respect to ground of the part struck may be fairly low, so again this creates a high potential difference. That difference may be much smaller than the cloud to ground difference that caused the lighting stroke, but it may be much larger than the difference the power station was designed to withstand. The insulators in the power station could flash-over and fail, allowing large currents to flow and cause damage to themselves and what they're connected to.
Surge arresters, and more importantly the equipment that surge arresters form part of, channel this current, this movement of charge, safely around rather than through vulnerable parts of the power station.
The charge in batteries is the same basic stuff as the charge on thunderclouds, electrons, charged ions, it's only the magnitudes and the precise charging mechanisms that are different. Chemical batteries use chemical energy to move charges around. Thunderstorms use mechanical energy in something similar to a natural Van de Graff generator to move charges.


Using a phone Bluetooth headpiece to listen to music from computer

Question: I have a Bluetooth headset (Handsfree) HipStreet BT Lite, this supports phone audio but does not support media streaming.  I downloaded an app for Android (BTmono) that changed this behavior and allowed me to use it to listen to music with the headpiece. Is there any Windows software that will allow me to use my headpiece for listening to music?
Answer: If your computer has a bluetooth adapter, try pairing the headset with it and see if it shows up as an audio output device (Start -> Control Panel -> Sound).
Comment: No, It does not, As I have mentioned it has only "Phone Audio" as Output, It gives an option (the only option) to forward Skype Calls to it.


Disable SSLv3 in Dovecot --> TLS handshaking failed: no shared cipher?

Question:
Ubuntu 12.04
OpenSSL 1.0.1-4ubuntu5.20 14 Mar 2012
Dovecot 2.0.19

The situation is I'm trying to disable SSLv3 in Dovecot by adding !SSLv3 to the ssl_cipher_list:
ssl_cipher_list = EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:!SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA

restart the Dovecot, then check log, I got:

Oct 29 05:00:46 mail dovecot: imap-login: Disconnected (no auth attempts): rip=118.71.13.x, lip=107.170.105.y, TLS handshaking: SSL_accept() failed: error:
  1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher

what I don't understand is: the above cipher list support some TLSv1.2:
openssl ciphers -v 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:!SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA' | grep -i tls
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-SHA256   TLSv1.2 Kx=DH       Au=RSA  Enc=AES(256)  Mac=SHA256
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AES(256)  Mac=SHA384
DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-RSA-AES128-SHA256   TLSv1.2 Kx=DH       Au=RSA  Enc=AES(128)  Mac=SHA256
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(128) Mac=AEAD
ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AES(128)  Mac=SHA256

Running tcpdump while using Thunderbird to connect to Dovecot:
Secure Sockets Layer
    SSL Record Layer: Handshake Protocol: Client Hello
        Content Type: Handshake (22)
        Version: TLS 1.0 (0x0301)
        Length: 177
        Handshake Protocol: Client Hello
            Handshake Type: Client Hello (1)
            Length: 173
            Version: TLS 1.2 (0x0303)
            Random
                GMT Unix Time: May  4, 2099 21:21:49.000000000 ICT
                Random Bytes: db3c676892cb86a10350aae7fa67868ed4935862593455bc...
            Session ID Length: 0
            Cipher Suites Length: 46
            Cipher Suites (23 suites)
                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)

You can see that at least both client and server support ECDHE-RSA-AES128-GCM-SHA256, why the handshake failure?
Secure Sockets Layer
    TLSv1.2 Record Layer: Alert (Level: Fatal, Description: Handshake Failure)
        Content Type: Alert (21)
        Version: TLS 1.2 (0x0303)
        Length: 2
        Alert Message
            Level: Fatal (2)
            Description: Handshake Failure (40)

Comment: The answers have addressed the problem, so I'll comment on the question :) OpenSSL server can select a ciphersuite using ECDHE (or ECDH-anon, but you don't want anonymous) only if configured with a "temp" ECDH curve either directly or via a callback, which matches the "supported curves" in the ClientHello (which you truncated). If the client is also OpenSSL other than RedHat it supports all named curves, but others may not. On a quick scan of current source, it appears Dovecot 2.2 does temp ECDH curve but 2.1 and 2.0 don't. ...
Comment: ... However, if the client is selecting "only-in-TLSv1.2" ciphersuites to block SSLv3 like you are, those include some using DHE, and for DHE OpenSSL server more simply requires "temp" DH params (not needing to match a client extension) and Dovecot 2.0 DOES do temp DH params, so if you see any DHE-RSA+(AEAD or SHA2) suites in the ClientHello then you have a valid complaint.
Answer:
The situation is I'm trying to disable SSLv3 in Dovecot by adding !SSLv3 to the ssl_cipher_list:

This is a bad idea because there are no ciphers specific for TLS1.0 and TLS1.1, that is they use the same ciphers as SSL 3.0. Only TLS1.2 defined some new ciphers. This means, that if you disable SSLv3 ciphers no SSLv3 clients can connect, but also no TLS1.0 or TLS1.1 clients. This is probably not what you intended to do.
The real way is not to disable the SSLv3 ciphers, but to disable the SSLv3 protocol, but I cannot see an option for it in Dovecot 2.0. According to https://zmap.io/sslv3/servers.html there is an ssl_protocols setting in Dovecot 2.1+, but the same page also wrongly recommends to disable SSLv3 ciphers in Dovecot 2 which is just wrong.
Comment: check out the source from zmap.io's suggestions: : "For older (dovecot) versions you will have to patch the source code." ([Askubuntu: How do I patch/workaround SSLv3 POODLE vulnerability (CVE-2014-3566)?](http://askubuntu.com/a/537197))
Comment: I doubt that this is the (only) source for zmap.io because it does not recommend disabling SSLv3 ciphers - contrary to zmap.io.
Answer: iirc ssl_ciphers is not the right place to disable a protocol, try:
# dovecot
ssl_protocols = !SSlv2 !SSLv3

after this i'd suggest to test your server with the script from testssl.sh
Comment: what @steffen said: "For older (dovecot) versions you will have to patch the source code." src: - [Askubuntu: How do I patch/workaround SSLv3 POODLE vulnerability (CVE-2014-3566)?](http://askubuntu.com/a/537197)
Comment: The reason is we are running Dovecot 2.0.19 on Ubuntu 12.04.


Convex sets as intersection of half spaces

Question: I want to prove that any closed convex sets can be written as an intersection of half spaces using only the separation theorem as a pre-requisite. I'm getting a feel that I need to show two sets are subsets of each other, but not being able to understand how exactly to go about it.
Answer: I think that your approach should work.
Let $C\subseteq \mathbb{R}^n$ be a closed, convex set. Let $\mathcal{H}$ be the collection of closed, half-spaces that contain $C$. You would like to show that
$$C = \bigcap_{H\in \mathcal{H}}H.$$
First we can show $C \subseteq \bigcap_{H\in \mathcal{H}}H.$ Let $x\in C$. By the definition of $\mathcal{H}$, any $H\in \mathcal{H}$ satisfies $C\subseteq H$. Hence $x\in H$ for any $H\in \mathcal{H}$ and therefore $x\in \bigcap_{H\in \mathcal{H}}H.$ This gives us the desired inclusion.
It is left to show that $C \supseteq \bigcap_{H\in \mathcal{H}}H.$ We prove this using the contrapositive, that is we will show that if $x\not\in C$ then $x\not\in \bigcap_{H\in \mathcal{H}}H.$ So choose $x$ such that $x\not\in C$. Since $C$ is closed and convex, there is a hyperplane that strictly separates $x$ from $C$. This hyperplane defines a half space $H$ containing $C$. Hence $x\not\in H$ implying that $x\not\in \bigcap_{H\in \mathcal{H}}H$. This proves the desired inclusion.
Comment: When you show the first direction, i.e. $C$ is contained in $H$, you use the premise that $H$ is the collection of closed half-spaces that contain $C$.   that premise is not part of the premise OPs question.  He just says "can be written as an intersection of half spaces " but does not say that $C$ is contained in $H$.  so how can you use that?
Comment: The proof assumes there is at least one half space that contains $C$. A counterexample is $C=\mathbb{R}^n$.
Comment: Of course some people define $\cap_{H \in \phi}H=\mathbb{R}^n$. This assumes we somehow know we are working in $\mathbb{R}^n$ (the color green is a point that is "in each one" of the sets in the collection of no sets).
Comment: This proof only works if $\mathcal{H}$ is the collection of **all** half-spaces that contain $C$. Right?
Comment: We should note that the existence of a halfspace that contains $C$ comes from the Hahn-Banach theorem (or the hyperplane separating theorem), so the space should be a locally convex topological vector space.


Including a research experience with no recommendation letter

Question: I am applying to graduate schools in the United States this year. I have research experience for one year in algebraic geometry. I learned a lot from this experience, mostly by reading papers, books, and doing calculations. I have produced no publication (algebraic geometry is a hard field). However, I have a conflict with my advisor and therefore can not include him as a recommendation letter provider. So can I omit this experience completely from my CV? would it be ethical? or should I mention it and risk the admissions committee drawing the conclusion that my research performance was bad and therefore reject my application immediately as many people here seem to suggest?
Answer: I see no reason to omit it. I see no reason to have the supervisor write a letter of recommendation either. They are independent things. You want the best letters you can get and they seem to be from others here. You also want to show that you have some research experience even if it wasn't sufficient to result in publication.
I assume you mean undergraduate research, of course, which is limited in time and scope. The limitations are, well, limiting in what can be done. With more scope you might have gone further, as you would be expected to do with a more open ended program in a doctoral degree.
List it, even list the name of the supervisor if he has some prominence. But have the letters attest to both your background accomplishments and the probability of your future success.
Most places would consider it improper to contact someone that you didn't include in your application materials. But if they do, and you are questioned on it, just be honest about the situation. Conflicts happen. People know that.
Comment: Does this also apply if this is the only research experience I have? I've just started a new research experience with a new supervisor. I think he is impressed by my performance, but I have been working with him for only 1 month. Is it appropriate to sk him for a recommendation letter? If he can't provide me with that letter, will the above advice apply?
Comment: If you are in the US, it will be fine. Very few undergraduates have any serious research experience at all. Even a bit is a pretty good indicator. If the new advisor stays impressed he would probably be a good choice as well as willing. But choose the people who know you and can support your candidacy best.


Convert Landsat 9 Surface Reflectance product DN to surface reflectance values

Question: I downloaded the Landsat 9 L2 imagery from Earth Explorer for the purpose of calculating NDVI. However, when opened in ArcMap 10, the pixel values are in the range of 7000 to 45000. I understand that Surface Reflectance-derived imagery is the most suitable for NDVI and other change detection studies. Most solutions provided in forums show only how to derive TOA reflectance from DN. Do TOA reflectance and Surface reflectance mean the same thing or produce the same results? Since the bands already read LC_09_xxx_SR_T1, should they just be simply rescaled? If so, how can I accurately achieve this? And are there other alternatives to accurately derive NDVI?
Comment: Welcome to GIS SE. Kindly limit your post to address one question.
Answer: From usgs.gov:

Each floating point pixel has an offset applied and then multiplied by
a gain to bring the value into the 16-bit integer (or unsigned
integer) range.  These values are referred to as scaled integers.  To
allow the user to get the data back to its original floating point
value, a scale factor and offset are provided for each band.  The
scale_factor should be applied to each pixel and then the offset added
(i.e. Digital Number (DN) * scale_factor + offset).

The scale factor and offset for L2 SR products are  0.0000275 and -0.2.
Comment: Thank you for this suggestion
Comment: The method you proposed worked fine for rescaling the DN to SR values. however, my study area contains some clouds which still seem to affect the area of classified vegetation. I was hoping from little findings that the SR bands would retain values from the earth's surface regardless of whether clouds hover over that spot or not. In this case, at every spot a cloud is visible, the value is significantly deviated from the neighboring cells. Any assistance in resolving this would be greatly appreciated.
Comment: No, the satellite can't see through clouds so surface reflectance will contain clouds if they're present.
Comment: https://gis.stackexchange.com/help/someone-answers
Answer: If you want to use Python, you could use libraries designed to help you to handle satellite products such as EOReader.
Reflectance conversion and spectral index computation are already handled.
from eoreader.reader import Reader
from eoreader.bands import NDVI

prod = Reader().open("your/landsat9")

# Load those bands as a dict of xarray.DataArray
ndvi = prod.load([NDVI])[NDVI]

More details in this notebook.

Disclaimer: I am the maintainer of EOReader.
Comment: Noted with gratitude @remi.braun


BJT Biasing with negative voltage

Question:
I got this question as a school assignment (1st year electrical engineering). I have to calculate the 3 unknown resistor values. The values which were given are in the schematic. Further \$\beta = 100\$ and the transistor is an NPN BC547B. The problem for me is the negative \$V_{EE}\$ voltage and the \$V_x = 0\$V. I don't really know where to start (already stuck for an hour). Can you give me some hints or an example so I know how to go further? I have already looked at a lot of BJT biasing examples but can't find one (I think) which really fits my problem.
Comment: Would it help to shift everthing up by 15 volts?  Vee = 0 V, Vx = +15 V and Vcc = +30 V?  The point we call "Zero Volts" is arbitrary.
Comment: Remember that absolute voltages are just a arbitrary choice for what to call 0.  You can pick whatever node you want to call 0 V, as long as all the relative voltages everywhere are still as stated in the problem.
Comment: Thank you for the clarification that I can change the point which I call zero volt.
Answer: Negative voltages are nothing to be afraid of. They work exactly like positive voltages, just with a minus sign. I'll walk you through the first part, which is to figure out \$R_1\$.
You know the voltage across \$R_1\$ is 15V. If you find the current through \$R_1\$, you can calculate the resistance with Ohm's Law. The current through \$R_1\$ is equal to the current through \$R_2\$ plus the base current. Ohm's Law gives you the current through \$R_2\$:
$$I_{R2} = \frac{0\ \mathrm V - -15\ \mathrm V}{5\ \mathrm{k\Omega}} = 3\ \mathrm{mA}$$
You're given the collector current and \$\beta\$, so you can easily calculate the base current:
$$I_B = \frac {I_C} {\beta} = \frac {1\ \mathrm{mA}} {100} = 0.01\ \mathrm{mA}$$
So the current through \$R_1\$ is:
$$I_{R1} = I_{R2} + I_B = 3\ \mathrm{mA} + 0.01\ \mathrm{mA} = 3.01\ \mathrm{mA}$$
This is almost (but not quite!) equal to \$I_{R2}\$ by itself. In real life, you would probably ignore \$I_B\$ unless \$\beta\$ were lower, but this is homework, so let's do it the hard way. :-)
Now you can calculate \$R_1\$:
$$R_1 = \frac {15\ \mathrm V - 0\ \mathrm V} {3.01\ \mathrm {mA}} = 4.98\ \mathrm{k\Omega}$$
I'll let you handle \$R_C\$ (trivial) and \$R_E\$ (harder) on your own. Please be sure to post the work you've done if you have any follow-up questions.
Comment: Thank you very much for the help. +1 for the explanation on how to use the β value of a transitor.
Answer: In all cases it's not the "absolute" voltage which matters, it's the voltage across the resistors that matters.
\$R_1\$
\$R_1\$ and \$R_2\$ form a voltage divider with a small load \$I_B = I_C/\beta = 10\mu\$A. You're given \$V_x = 0\$, so the voltage across \$R_2\$ is \$0 - V_{EE} = 15\$V. By Ohm's Law the current through \$R_2\$ is \$15\text{V}/R_2\$, which is \$3\$mA. The current through the divider is much larger than the load current, so if you just need an approximation you can ignore \$I_B\$.1 In that case the voltage across and current through \$R_1\$ is the same as \$R_2\$ and  therefore the two are equal. Alternatively, you can use the voltage divider equation, which can be simplified by noticing that the voltage divider output is halfway between \$V_{CC} = 15\$V and \$V_{EE} = -15\$V and therefore the voltage is divided in half. The simplified equation is
$$\frac{R_1}{R_1 + R_2} = \frac{1}{2}$$
which gives you the same result, \$R_1 = 5\text{k}\Omega\$.
If you can't approximate, note by KCL that the current through \$R_1\$ is the current through \$R_2\$ (\$3\$mA) plus \$I_B\$, or \$3.01\$mA. Now you have the voltage across \$R_1\$ (\$15\$V) and the current through it, so you can use Ohm's Law to calculate it exactly.
\$R_C\$
You're given \$I_C = 1\$mA and \$V_Y = 5\$V, so you know you have \$15-5=10\$V across \$R_C\$. Since you know the voltage across and current through the resistor, Ohm's Law gives you the required resistance.
\$R_E\$
The transistor is on since \$I_C = 1\$mA, so assume a \$0.6\$V (or \$0.7\$V) \$V_{BE}\$ drop. Since \$V_x = V_B = 0\$V, that means \$V_E = -0.6\$V. This gives you the voltage across the resistor: \$V_E - V_{EE} = -0.6 - (-15) = 14.4\$V. Remember
$$I_E = \frac{\beta + 1}{\beta}I_C$$
and both \$\beta\$ and \$I_C\$ are given, so you know \$I_E\$. Alternatively, you already know \$I_B\$ so you can also use the fact that
$$I_E = (\beta + 1)I_B$$
Again, you have the voltage across and current through the resistor so you can use Ohm's Law to calculate the required resistance.
1 Typically the rule of thumb is that if the unloaded divider current is 10 times the load current it is safe to make an approximation.
Comment: @Null, Yes but this is a 1st year EE course. It takes some experience to understand when approximations can be safely used. Typically I figure that if the divider current is 10x the base current it is close enough. But that is in the real world, not in EE101.
Comment: (After Rc) "You're given IC=5mA and VY=5V, so..." You may want to edit that 5mA to 1mA
Comment: @JImDearden Thanks for the catch. I was thinking of the 5V I was about to type. For a minor correction like that feel free to edit my answer.
Comment: @mkeith Fair enough, for a 1st year EE course I should have been more explicit that I was making an approximation and why.
Comment: @Null, I clicked the upvote because of your edit and request.
Comment: @Null Thank you very much for the help. +1 for the explanation on how to use Ve. I still have a small question about the last formula you stated: Ie=(β+1)Ic. In my book the formula for calculating is Ie with Ic is: Ie = β/(β + 1)Ic. For calculating Ie with Ib I could find the formula: Ie=(β+1)Ib. Maybe you have mixed up both formulas or am I wrong?
Comment: @4lloyd Yes, I did mix up my formulas and I've updated my answer. Your equation for \$I_E\$ is flipped, though -- it's as I put in my updated answer. \$I_E\$ is the sum of \$I_B\$ and \$I_C\$ so it's slightly greater than \$I_C\$.
Comment: @Null Of course, \$I_E\$ should be slightly larger than \$I_C\$. Thank you for the clarification!
Answer: I will just give you some hints since it is course work. You can calculate Rc with the information provided, because you know the voltage on both sides of Rc, and you know the current flowing through it. You can calculate Ib with the information provided. After you do that, you can calculate the current flowing through R1, so then you can calculate R1 using the voltage and current. In order to calculate RE, you need to assume a certain voltage drop across base-emitter junction of Q1. You can pull that from the datasheet if you want, or you can use a typical value such as 0.6 or 0.7V. But since the type of transistor is actually specified in the problem, I would probably go look at the datasheet to see if it shows a graph of typical Vbe vs Ib.

BJT Biasing with negative voltage


連れ添う and 結婚-Is there a difference in nuance

Question: Can someone please tell me if 連れ添う which I have read that it also means "to marry", "becoming man and wife", "to become a couple" has another kind of nuance compared to the typical word 結婚 ? Because I haven't many resources to get a better understanding, can I assume that 連れ添う can be used to describe a couple, as in, they love each other and live together but not necessarily being  married (they didn't have an official wedding ceremony). There is this character, a woman, in a manga that said: 長く連れ添ったわ. She said this about the man she stayed with for many years until he passed away. I also want to add that the woman is a vampire who lived for hundreds of years and I do question if she actually married the man.That's why I believe that she said
連れ添う, to emphasize that she just stayed faithfully by the man's side for a long time and she didn't have to become his wife or anything. Please tell me your opinions!
Answer: The original meaning of 連れ添う is simply "to accompany". Sometimes it can refer to something totally unrelated to marriage. For example, 連れ添って歩く usually just means "to walk next to each other." 連れ添い is often interchangeable with mere 付き添い, depending on the context. This means you can safely use 連れ添う with someone who are not legally a husband and a wife.
When 連れ添う means something related to marriage (or de facto marriage), it's closer to "to live together as a couple" rather than "to become a husband and a wife". It describes a continuous action, but not a change of state. By contrast, 結婚する is often described as an instant state-change (aka punctual) verb like 知る.

彼は結婚している。 He is married.
彼は連れ添っている。 (weird)
彼は妻と長年結婚してきた。 (weird)
彼は妻と長年連れ添ってきた。 He has been with his wife for a long time.

Finally, 結婚する is a matter-of-factly, plain verb. 連れ添う is more literary or romantic, and implies the spiritual bond between the two.
Comment: Thank you! "連れ添う is more literary or romantic, focusing on the spiritual bond between the two", this is what I was thinking about, just like you said! This really helps me out to explain something about the characters!


Kodi - Play Music and Minimize

Question: I want Kodi to play music (YouTube) in the background, without it displaying anything on the screen - freeing up the machine to display pictures, etc.
Per this minimizing isn't possible - but is there some command/API to completely turn off the display?
P.S. It's running on a Raspberry Pi 2.
Answer: Pressing the <code>\</code> on the keyboard should bring standard window borders and buttons. Then you can minimize the window.
Im pretty sure it should work, but I can't confirm it on Raspbian at the current time. Try it!

Kodi - Play Music and Minimize


Difference between "probabilistic modeling" and "statistical modeling"

Question: Is there a formal difference between the terms "Probabilistic Model" and "Statistical Model"? Is there a methodological difference between the two or just a preference of terminology? I see the former used most often with graphical models and Bayesian models, while "statistical" seems to be anything specifically Frequentist.
Comment: I wouldn't read too much into this. I haven't noticed an aversion among Bayesians to talking about statistical modeling. My impression is that probabilistic modeling is the more likely phrase if authors think of themselves as probabilists and have little or no concern with estimation or inference using real data, and conversely for statisticians and data-sensitive texts. Thus a probability-oriented text might emphasise the theory of Markov chains, Markov processes, etc., etc. but say little about confrontations with real data.
Comment: I thought probabilistic models are those that output probability (can be 'statistical' or 'machine learning'), so frequentist logistic regression would be probabilistic and bayesian linear regression would not. But I don't know actually if this is correct interpretation
Answer: Stats textbook are sometimes divided into two sections: 1) Probability and 2) Statistics.
Probability was about permutation, combination, conditional probability. Probability was often explained with dice, coins, colored marbles and other discrete artifacts. Probability is the measure of the likelihood that an event will occur. Although probability can be calculated using statistical models, and probability does not have to be from countable events and a rational number on 0-1, that would be its first meaning. Statistics was about mostly real number measurements, like the t-, z-, W- and U- statistics. A statistic (singular) or sample statistic is a single measure of some attribute of a sample (e.g., its arithmetic mean value).
There is an overlap or gray zone for probability for the discrete distributions including the binomial distribution, the multinomial distribution, and the Poisson distribution, which are still finger counting, i.e., literally countable probable events, for which statistics are parameters and for statistics for continuous distributions that are real number models of probability.
Probability models as a first meaning imply countability, for example, the likelihood of getting exactly 5 heads from 10 coin tosses. Statistical models, as a first meaning contain some statistic. However, one can say that "Marginal probability is a statistic" so that using which phrase is used when depends on what connotation one is making.


Mastering: Openings, Middlegame or Endgame

Question: Which of the following is better to master: The openings, middlegame or endgame? Also, which is worth mastering?
Answer: Thats an extremely opinionated question.
Example, I study end games more and generally ignore openings. Middle games to me is largely tactics driven. I find studying end games easier than openings which seems purely rote in learning. I know folks who can recite openings , love studying them and think studying openings is easy. They are horrible with end games and hate studying end games. Its far to subjective.
Answer: The opening.
It's common sense. Is it easier to manage something with 32 moving parts, or 5?
Purdy said that it's relatively easy to play a fair opening (though impossible to play a perfect one), because one or two slips in the opening won't kill you, whereas one or two slips in the ending swing wins into draws, draws into losses.
Chess players do better to study the ending first. How can you play a middlegame unless you can judge the ending on the horizon? It's easier to learn with fewer pieces on the board, and the mistakes there are far more costly than at other times.


Ubuntu 16.04 failed upgrade

Question: I have been using ubuntu 15.10. Yesterday i decided to upgrade to 16.04.
The software manager aborted saying upgrade failed because of too many errors.
Then i made the mistake of rebooting without fixing the install. Now it seems like i broke a lot of things.

Ubuntu is now not detecting my ethernet card at all. While booting there is a message, saying cannot start raise network interfaces. And then there is also a message saying. eht0 no such device found
Also there is a problem with the desktop, the menus and all window borders have completely dissappeared.

I mainly want a solution to the ethernet problem, without which i cannot access internet.
But an overall solution to fix everything would be perfect.
I have already tried :
<code>dpgk --configure -a
apt-get -f dist-upgrade
</code>
Is there a way i can fix only the broken packages, without having to erase and reinstall everything from scratch using a livecd?
Any help will be appreciated
Answer: Upgrading from unstable release to LTS it's a bad idea. Use clean install. It prevents you from too many problems in a future.

Ubuntu 16.04 failed upgrade


Seeking Russian Orthodox birth records for Laski/Leski in Grodno region of Belarus. . .c. 1880 - 1905

Question: My grandfather Zuk/Zukowsky immigrated in 1905.  Born 1887, his younger brother Nikita about 4 years younger. . .one older brother Phillip.  Russian Orthodox.  Passenger list for Nikita indicate birth in Laska/Leski in Grodno, now part of Belarus. Can you tell me how to find such records?
Answer: Some general advice on starting work in a new locality can be found in my asnwer to Determining what records are available in a particular locale?.
Use gazeeteers, maps, and research guides for Belarus to determine what records exist and who holds the records.  Using the FamilySearch Research Wiki, search for the name you want plus the keyword genealogy in the main search box. For example: Belarus Genealogy.
Things to look for on a main FamilySearch Wiki page include:

links in the right hand sidebar to sub-articles on various record types including Church Records
The blue button for Belarus Online Genealogy Records
The research advice under the Getting Started section and under Research Tools
Other sections in the right-hand sidebar including Belarus Background and Local Research Resources

The article Belarus Online Genealogy Records includes multiple websites, not just those online at FamilySearch.
When using FamilySearch Historical Records, search the catalog by place. Remember to:

take into account the historical names of places (gazetteers can help)
search all jurisdictions
read the corresponding Family Search Research Wiki article for any record collection you discover (usually by clicking the Learn More on the individual collection's catalog page under the description of the record set)
watch out of indexes to the records that might be in the record book itself

As new records are digitized and added to FamilySearch, before the catalog entry is ready, browsable records can be discovered via the new page Explore Historical Images.  Search by place (remembering once again to search all jurisdictions that might apply), not by the name of your person.
Keep a record of where you searched, and how you searched, and any findings, whether positive or negative. If you can't find the archive which holds the records and order a record directly from them, you will have to repeat your search as more records come online.  Having a good record of what you already did allows you to vary search technique as your search skills improve.


Incompatible integer to pointer conversion assigning to 'int *' from 'int'

Question: I have yet another pesky warning I would like gone. Basically, I have an int declared like this: @property (nonatomic, assign) int *myInt; and set like this: myInt = 0;. It is also synthesized in the implementation file. I am getting a warning on the line where I set the int's value and it says Incompatible intiger to pointer conversion assigning to 'int *' from 'int'. What should I do to fix this?
Answer: There's a big hint in the error message!
In C and Objective C, an int is a primitive data type. You've written int *, which means "a pointer to an int", whereas it looks like you just wanted an int.
So change your property to this:
@property (nonatomic, assign) int myInt;

For more info, google "C pointers" and you'll find information like this: http://pw1.netcom.com/~tjensen/ptr/pointers.htm
Answer: Yes, simply remove asterisk (*) from declaration.
for example.declare BOOL isChecked instead of BOOL * isChecked.
Answer: int *MyInt is a pointer to int, not an int.
As others told you, just remove the * and you will have a regular int.
Answer: Another way to resolve this is to simply not declare a pointer (drop the asterisk):
@interface ViewController : UIViewController {
    NSUInteger myObjcInt;  // unsigned ( >= 0 ) NSObject int, yo
}

Comment: Touche. I was reading this post during a search for an NSInteger-related issue, not Int.  A little too quick on the reply there, guys.  My bad.
Comment: That's not another way — it's the same thing occulus said. BTW, your comment calls it an "NSObject int", which doesn't really make a lot of sense as a term.


php mysql search

Question: My code contain
SELECT * FROM newchap WHERE company LIKE '%$company%' OR  Category LIKE '%$cat%'

It works perfectly however, when the field $company contain empty, it return all result in MYSQL.
How to prevent it?
Answer: SELECT *
FROM newchap
WHERE (company LIKE '%$company%' AND company != '') OR Category LIKE '%$cat%'

Answer: Since the % wildcard can be any combination of characters, if it's empty you're selecting any company at all; your query in that case is
SELECT * FROM newchap WHERE company LIKE '%%' OR  Category LIKE '%$cat%'

You could add an AND condition into the SQL to filter out the case where the company is empty, or you could just check for that in PHP.  If this is a common case that should be faster, since it will save you running a query at all.
Also — and this is very important — if there's any chance that $company or $cat could contain user input, you should be using a parameterized SQL query.  otherwise you're creating a vulnerability for an SQL injection.

php mysql search


Can a paper get rejected in the copyediting phase (after peer review acceptance)?

Question: A journal with high impact accepted my paper after peer review.  In the copy-editing phase I noticed some errors -- mostly mixed up references.  Can the paper now be rejected due to these errors?  What about if I want to update some references?
Answer: Formally, a paper can be rejected at any time, even after printing.  E.g. IEEE describes such cases, which are mostly plagiarism-related.  In your case of mixed-up references, a rejection is unlikely.
Updating references should be a non-issue in the early copyediting phase but problematic in the late stages.  You might have to live with published wrong references.
Answer: If you ask for too many changes on the page-proofs  it might be that you are charged a fee for this. Various journals say they will charge for too many changes as it increases the production cost; but I have never heard of a situation where it actually happened.
Mixed-up reference, especially if these are clerical errors, does not sound that dramatic a change, so this should be a non-issue.
Updating reference is perfectly fine; journals will even actively ask for more complete data if available in the page-proofs if the original manuscript only quoted a preprint for example.
Generally, once you are in the copy-editing phase the scientific decision to publish your paper was already taken. A reason for it not to be publish typically could only be procedural (e.g., you do not agree to sign the copyright form or otherwise mess up the process completely) or possibly very severe problems with the paper that emerge.


A very stuck oil plug

Question: I have a 2005 Dodge Stratus,  this is my first time doing the oil change (I'm the 3 owner). I can't get the oil plug off. I have tried a ratchet , wrench and a hammer. The car was warm when I tried I heard that can help. Any other ideas?
Comment: A picture of the plug would be helpful
Comment: Use a longer wrench or t-bar.
Comment: What you heard was wrong. Both the plug and the sump into which the plug fits will expand when warm, thus making the plug _harder_ to remove. Let it all cool down before you try again.
Comment: Be sure you're turning it the right way.  Things can be confusing upside down.
Answer: Metal expands when it heats, so warming an engine isn't a good way to free up the plug, although it's good to have warm oil when you change it as it flows more freely. First, get some penetrating spray like WD40 and spray it on. Then spray more on 20 minutes later. Then spray more on 20 minutes after that and try the nut again, repeated sprays and giving it time to soak in can work wonders. Spraying and leaving it overnight isn't a bad idea.
Next, get a longer lever. A breaker bar or something similar will give you lots of torque on the plug. If you don't have one use a "cheater", which is a length of pipe that fits on the end of your wrench. Make sure you are getting a good grip on the plug and not rounding it off.
Once you get it off make sure you torque it down to spec, the reason you're having problems could be it was over-tightened in the first place. 14 foot-pounds seems to be a common number but check your service manual to make sure.
Once you free it and it starts to move you could then heat up the engine to get the oil warm, then stop it and remove the plug fully to drain.
Answer: Oil change tip - how to loosen a stuck oil pan drain plug / bolt:  https://www.youtube.com/watch?v=UwqA1vifRjI
This guy shows exactly what you are looking for, 'IF' the problem is not a rounded off bolt.
If the bolt has been rounded off by repeated attempts to get it out, there are several options available to you.  I don't have all the terminology, but this fellow explains and demonstrates several methods of removing rounded bolts:
https://www.youtube.com/watch?v=ix1-NVOC83w
A great explanation of extractor sockets and tool quality vs performance:
https://www.youtube.com/watch?v=_EfLTszAr7w
When you get it out, move your head real quick.  I'll never forget my first oil change.  LOL  I don't know which was more humiliating; the fact that it happened or the merciless ribbing I endured afterwards.  :)
Comment: Oil drain plugs are usually stuck when they are tightened without the gasket (crush washer). Next time, use a washer and tighten the plug to the specified torque and you will have no problems loosening it later. Another advantage of using a crush washer is that it prevents damaging the oil pan threads in case of over-tightening the plug.

A very stuck oil plug


Difference between "equal variables"

Question: Consider for example a production function with one variable.
Let's say the function is f:R->R y=I, where y is the quantity produced and I is the quantity of some input used for production.
In this situation the quantity of some good produced and the quantity of some input used for production is always the same.
We still would say there are two quantities/variables but what's the difference between them when they are always the same?
Comment: Why would quantities always be the same? 2 apples = 100ml of juice. 20 apples = 1L of juice?
Comment: @BrsG That is an assumption. Suppose a relationship exists where two variables are the same.
Comment: @Giskard: I see, quantities=variables. This threw me off.
Answer: Consider how you have defined the problem.
There is a function defined as
$$f: \mathbb {R} \rightarrow \mathbb {R}$$
$$\;\;\;\;\;\;\;\;\;\;\;\;y=f(I)=I\qquad (1)$$
Look at the domain and the codomain: they are both $\mathbb {R}$, that is, according to the definition of function,  $f$ assigns one (and only one) real number to each real number.
Then $f$, according to $(1)$, is defined as the function that assigns to each value in $\mathbb {R}$, that is a real number,  of the independent variable $I$ that real number itself.
This kind of function, of a set $A$ to itself, that assigns to each element of the domain the element itself is called the identity, or the identity function.
In your case, $f$ is the identity function between real numbers, that is the equality is between real numbers.
In your  economic problem, where  domain and codomain are $\mathbb{R}$,  these real numbers  are some kind of measure, expressed through real numbers,  of input and output.
So, the equality has nothing to do with the nature of the objects involved, be they  inputs, outputs, oranges or apples. The objects are not necessarily the same, even if their measures, as expressed through real numbers, can be the same.
You can see:
https://en.wikipedia.org/wiki/Identity_function
Answer: A bijection between two things does not mean that these two things are the same.
For each night there is exactly one day, yet night and day are quite objectively different (e.g., in average temperature).
I can always transform 1 push-up's worth of energy (approx. 7kcal, but kcal is also a made up unit of measurement) into a push-up; yet the energy and the push up are IMO obviously quite different, for example the first could be transformed into many things.
Suppose there is an economy with two industries, producing apples and oranges, the production functions of which are $F_A(L) = L$ and $F_O(L) = L$; i.e. in both industries the amount of output is equal to the amount of labor used. Yet clearly, labor and output are different, as it is possible that the 10 units of labor available are distributed so that the outputs in the industries are 8-2 respectively; thus neither output is equal to total labor. It is possible to transform an apple into an orange by reallocating labor, but apples are not oranges.

Bonus: Rational numbers and integer numbers are not the same, though a bijection exists. Admittedly this is more tricky when infinite quantities are involved.

Difference between „equal variables“


Guitar song from the movie The Town That Dreaded Sundown (2014)

Question: In the movie The Town That Dreaded Sundown (2014), there is a scene where the sheriff is alone with a girl, and he puts a tape on and one of the best bluesy intros to a song I have ever heard comes on, but I cannot identify the track.
The video is Not Safe For Work, but can be found here on YouTube.
Answer: I haven't been able to verify which song it is exactly, but there is a list of songs mentioned at the credits. Who performed which one is not readable on my copy.

Goodnight Sweet Dream
Jesus Christ
Two Hearts Entwine
A New York Love
Happy Call
God Rest Ye Merry Gentlemen
Silent Night
Your Other Man

Other relevant writers/composers in that movie are Jaime Mendoza-Nava and Ludwig Göransson.
While not a definitive answer, I do trust this list will help you find the track you're looking for.
Comment: Thanks For Your Input Mast, I Have Just Sat And Gone The Credits And Typed Every Song Into You tube And None Of Them Are The Track I am Looking For? Im Truly Stumped With This One!!
Answer: It is most likely either a song that was recorded in the studio specifically for the movie or possibly a stock music track that isn't required to be credited. See the following Blues Acoustic track for an example:
https://motionarray.com/stock-music/acoustic-blues-11635
There are many stock music tracks out there that are commonly used in movies and television because they are less expensive than paying a studio royalties to use an official song.


React JS Legacy code described as `hacky`, why would the author state this?

Question: I have some legacy code from a site that I'm currently working on, and the author added some comments stating that the solution they coded was a bit hacky.
Would anyone know why that would be the case, and why they would have stated that?
    const onClickDownloadFile = (id, filename) => {

    const token = state.token;
    if (token === "") {
        return;
    }

    const req = new Request(process.env.REACT_APP_API_URL
        + "/path/"
        + id
    );

    fetch(req, {
        headers: new Headers({
            "Authorization": "Bearer " + token,
            "Accept": "application/octet-stream"
        }),
        method: "GET"
    })
    .then(res => res.blob())
    .then((data) => {

    // This is a little hacky but gives a download link the browser will understand
        const url = window.URL.createObjectURL(new Blob([data]));
        const link = document.createElement("a");
        link.href = url;
        link.setAttribute("download", filename);
        document.body.appendChild(link);
        link.click();
        link.parentNode.removeChild(link);

    })
}

Answer: Probably backed is not able to send proper HTTP headers like "content-disposition: attachment". Trying to fix it on UI side we left with code that tries to simulate click on the link so browser will start fetching the resource.
Building link and clicking on it is not related to React self. Author just tried to fix missing contract/agreement between what UI needs and what backend could deliver.
Answer: Without reaching the author, we will never know why they deemed it hacky. I deem this code hacky for two reasons:

The code creates a  element, sets a link, automatically clicks it, and then deletes it. Manually triggering clicks on elements is very hacky, as we should not take control of the user's actions. Rather, we should empower them to click elements, instead of our code doing this behind the scenes.

A best practice in React is to not use JavaScript DOM APIs to render HTML. Instead, you read state and props, and use that information to update the HTML your React component renders. This code does not follow this React pattern. Instead it uses DOM APIs to create and remove those elements (such as document.createElement() and document.appendChild() and parentNode.removeChild(). Instead, you would want to see something like the following be added in the render() function of your React class or component:

render() {
  return Download your file now;
}

Answer: This is likely because they are creating a new element in the DOM, then invoking the download attribute, before deleting the element again. Certainly isn't the best practice but seems to get the job done