Does charging a phone with another phone's charger affect it in any way?

Question: I have a Samsung S4 and because its charger is short I charge it with a Samsung Wonder charger. I am afraid that it can damage the battery or something. Will it?
Answer: Generally speaking the wrong charger to the wrong phone can cause damage.
However in your case, I do not believe that there is much to worry about.  The article below is a gizmodo article that explains in pretty good detail.
http://gizmodo.com/can-i-use-the-same-charger-for-multiple-devices-510829339
Basically the whole using the "wrong charger" was an issue back before the micro-usb standard.  Now that there is an international standard for the micro-usb, the voltage is limited to 5V.

This used to be a much bigger issue on account of the wide variety of proprietary charging units and pin connectors that came with each device. Thankfully, the advent of USB changed all that and has provided an easy, standardized platform for charging devices. All USB cords carry the same 5V, regardless of if it's got a 30-pin head or a microUSB plug, whether it's first-party or third. That means DC chargers are now brand agnostic; if the volts, amps, and connectors are compatible, an Apple wall wart can charge an HTC just as easily as a Samsung. That if, though, is where people run into trouble.

In terms of the current, there can be issues that arise in the amounts of amperes that are flowing through  Take for instance the iPAD can charge off of 2.1 amp.  If the charge to it is only say 1 amp, then it won't charge as quickly.

Because they have consistent, standardized voltage, USB chargers need another means of putting more power (in terms of watts) into larger gadgets faster. To do so, the system will increase the current (measured in amps). Most USB cables designed exclusively for charging (as opposed to data transfer) limit the current to between 1 and 1.5 amps, although new iPad chargers can deliver 2.1amps, and a standard USB port on your laptop only puts out .5 amps. This is why a 1 amp charger isn't effective on a 2.1 amp iPad. The device consumes power at the same rate that it's added.

Gizmodo also discusses things such as chips in the battery that monitors the charge (why you can plug your phone in at night and go to bed).

Smart chargers are those that utilize a small CMOS chip to monitor and manage the state of charge (SoC) and state of health (SoH) of similarly-equipped batteries. This is a de facto feature on most every modern secondary battery on the market, and it's ubiquitous among Li-ion systems. This feature allows the batteries to be left unattended when charging without the fear of having them overheat and explode, and while maintaining 100-percent capacity over long periods via a trickle charge.

The author of the Gizmodo article, ANDREW TARANTOLA, does not think that you should use a different phone charger and that you should use the specific device's charger with the specific device.

Once you're sure that your device's needs line up with your charger's output, all that's left is ensuring your USB cords are equipped with the proper pin connector. The micro-USB to USB cord that came with your last phone works just as well with your new one and can plug into any suitable USB power brick, so why do you have multiples of it—each with its own brick?
Instead, just stash a single spare brick in your bag, bring only the cords you need, and stagger your device charging so that one is always plugged into a port on your computer.
Tl;dr? While you can use the same charger for multiple devices, you probably shouldn't. Not unless you want to ruin your gear, or wait a lifetime for it to recharge.

So if you do not want to take the risk or what not, then you can use the correct charger (specific charger for specific phone).
I'm currently using a motorola backflip usb cable with the iPhone wall charger to charge my Samsung Galaxy S4 Active.  I have not noticed any issues at all.
Comment: Can you elaborate on how the "wrong charger" can cause damage? As they are pretty standardized (voltage etc.), that's hard to imagine.
Comment: If you read the article you'll see that not all chargers have the same specs.  By "wrong charger" I mean a charger that did not come with the phone.

However, like I said.  I do not think that you will have an issue.

Also, now days, if I am not mistaken, there is an actual chip inside the device that prevents damage.
Comment: The following link refers to the new international standard requirement for micro-usb cables. Based off this, again, I believe you should be fine.
http://android.stackexchange.com/questions/34573/is-using-chargers-of-phone-not-meant-for-it-harmful-to-the-battery?rq=1
Comment: Thanks for the explanation! But could you please include that with your answer? I read that article, yes. But in case of "link rot" (it means, when that article becomes unavailable), that information would be lost here. That's why we prefer to have at least an excerpt of the relevant facts included directly with the answers, while keeping the link *for reference*. Thanks a lot!
Answer: As long as the charger volts and amps are the same, you shouldn't have any issues. Take a look at the charger and it will have the stats you need to be aware of written right on it. Seems like in your case, you have both chargers handy (because you said the reason you wanted to use the other was the cable being too short).
I've personally been using chargers from phones for my tablets and vice versa for years without any issue. Obviously, it's best to use the charger that was designed for the device, but with everything being micro-USB these days, most of the time things are pretty safe.
Comment: Thx everbody for answers really appreciate it.(^o^)


How to make a list of ESRI GRID rasters in Python

Question: Tipically, ESRI GRIDS are not defined by a file extension like for the .tif files, but they are stored in a info folder plus an extra folder corresponding to the name of the raster. Arcpy allows to return a list with the ListRasters function. What is the best way to do it in a python script?
Answer: If you work with ArcGIS 10.1 SP1 or above, you can use the arcpy.da.Walk() function to list Esri or other GIS data formats recursively. Use the type parameter to restrict the search to Esri GRID files:
import arcpy, os
workspace = r"C:\directory"
output_folder = r"C:\other_directory"
walk = arcpy.da.Walk(workspace, type="GRID")

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        print filename
        arcpy.RasterToOtherFormat_conversion(os.path.join(dirpath, filename), output_folder, "TIFF")

Comment: Thanks. Actually, the idea was to do it without the arcpy package. Sorry for not specifying it.
Answer: You might have to dig into that extra folder after listing all of the info folders using python.
Use the os module to list all of the info folders, then for each folder look for an extra folder. Inside that extra folder, look for one of the extentions that are stored with a GRID file (like .adr)


Simple question about multivariate/multiclass classification

Question: From this link Text Classification using Naive Bayes, there are two models described for classification, Naive and Bernoulli. My question is if i want to make this classifiers for multiclass (multivariate) classification i should use techniques like: one vs. one/rest and etc?
Answer: Instead of one-by-one comparison, why not characterizing the entire probability distribution. Let $p(c_i | n, \vec{\theta}_i)$ be the posterior probability that the new observation $n$ belongs to a class $c_i$, then according to the Bayes' theorem:
\begin{equation}
p(c_i | n, \vec{\theta}_i ) =
p(c_i) \frac{p(n | c_i, \vec{\theta}_i)}
{\sum_{k=1}^{M}  p(n | c_k, \vec{\theta}_k)p(c_k)}  ,
\end{equation}
where $M$ is number of classes which can be in general bigger than two. Having the above probability distribution, you can decide on class assignment for an item $n$ according to the maximum posterior probability. Note that the likelihood function $p(n | c_i, \vec{\theta}_i)$ can be set according to what modeling technique you're going to use. For example, for a Naive Bayes classifier, the features $\vec{\theta}_i$ are assumed to be independent.
Comment: yeah sure, it's good for everything. In fact, it's not the matter of bein good or bad, it's just right way for doing this.
Comment: I just have one more question, is this good for text classification?
Comment: Thanks, i asked because i have some hard time with computing the estimate :D


RSS of simple linear regression onto principal components

Question: Is the RSS in a simple linear regression onto the largest principal component always less than or equal to the RSS of a simple regression onto the rest of the smaller principal components? I feel that this should be the case because the variation in the data is greatest along largest principal components, so I feel that there should be better fits along larger components. Is there a flaw in my reasoning, and if so, why? Thanks in advance.
Comment: Exactly which "principal components" are you referring to?  Evidently this is a PCA, but does it include the response variable or not?  And if it doesn't include the response variable, why should there be any reason to suppose there is some universal relationship (or even some meaningful restrictions) between the response variable and any subsets of the principal components?
Answer: As ISLR notes on pages 233-4, principal components regression is based on the hope that:

... the directions in which [the predictors] show the most variation are the directions that are associated with [outcome]. While this assumption is not guaranteed to be true, it often turns out to be a reasonable enough approximation to give good results.

So there can be no guarantee that RSS after regression onto the largest principal component will be less than that after regression onto smaller principal components. It might often be true in practice, but you can't count on it in general.
Comment: What is the justification behind this statement? I'd like to understand why this is the case. It seems very counterintuitive to me.


Is there a Jewish protocol for civil disobedience to civil law?

Question: I'm asking if there is a specific Jewish protocol for civil disobedience for civil laws/civil wrongs such as racist policies (ex. Heschel, Martin Luther King Jr. and the making of Civil Right Act of 1964) for countries in which existing Jewish communities exist.
Answer: In general, while Jews are obligated to follow the law of the land (dina d'malchuta dina - "the law of the land is the law"; see Nedarim 28a, Gittin 10b, Bava Kama 113b, and Bava Batra 54b), this is not the case if the law would force them to violate divine laws (including those regarding human rights).  Similarly, if the law is unjust/discriminatory in nature, it is nonbinding (see Maimonides, Laws of Robbery and Loss 5:14 and Shulchan Arukh Choshen Mishpat 369:8). Furthermore, if the unjust laws are ideologically aimed at obliterating Jewish customs (shmad), civil disobedience is mandated even when it would result in martyrdom (see e.g. Maimonides Laws of the Fundamentals of the Torah 5:3).
Comment: Maimonides: "In general: any law enacted by the king for everyone, which does not single someone out, is not theft. Seizing from one individual alone, not in following with broadly-known laws, is strong-arming and considered theft." MLK: "An unjust law is a code that a numerical or power majority group compels a minority group to obey but does not make binding on itself. This is difference made legal. By the same token, a just law is a code that a majority compels a minority to follow and that it is willing to follow itself. This is sameness made legal."


Create node with angularjs

Question: I have created web service of content and views that will export content in JSON format. Now I'm getting node data with simply call web service path with $http.get(...) It will successfully loads the all node. But Im not able to  create(actually don't know how to create) with Drupal web service and angularJs.
Answer: You Should mention for which drupal version you needs solution. Anyways, in drupal you need to mention for what you actions you are creating REST service. Like for reading a post, or creating a post or maybe to update or delete a post or user or any other entity. There are several tutorials out there. If you would google, then you will easily find one. However, by following below link you can easily create REST service for creating a node also.
https://www.drupal.org/docs/8/core/modules/rest/javascript-and-drupal-8-restful-web-services
Hope this helps, if you need solution for Drupal 7 then google it, you will get numerous. If you are a visual learner then there are also good quality video tutorials on youtube as well.

Create node with angularjs


How to manage 70K redirects

Question: I have a website with about 1.5M pages. I am condensing pages that do not have large amounts of content to improve the quality of the site. As a result, I have about 70K pages that I have added a canonical link to, pointing towards the new master page for the content.
Now I want to completely work the existing pages out of the system. I want to 301 redirect the existing pages to the new master pages that the content now resides on. I am running IIS and normally would use RewriteMaps (Apache).  I am concerned that adding 70k lines to my web.config, to be parsed for every URL, is going to affect performance.
Any suggestions on a known/tested way to accomplish this?
Comment: What powers the pages?  Are they static pages or is they dynamically generated?  If dynamic, what programming language?
Comment: Is there a pattern to them such that they could be implemented with small number of rules based on regular expressions?
Comment: static..... If they were dynamic it wouldn't be a problem.
Comment: Find out the pattern to make is simpler in few codes.
Comment: There are no solid patterns.  The files reside in many different folders and are named as the first sentence of the document.  TY for the help, I think I may just have to insert a < meta> redirect with no refresh time in each file.
Answer: There are two solutions I can think of:

Find patterns in the redirects and see if you can cut the number down. For example, if you had a large chunk that redirected from one folder to another, you could match something like /folder/([A-Za-z0-9-]+) and redirect to /newfolder/$1. This might still leave a large number of redirects though.
Redirect all unfound pages to one script, where you look up a list of redirects in a database or other file. If you find a match then redirect, otherwise serve a 404. Using only one redirect at the server level means serving all your regular pages lose no speed. Your redirects may technically be slower but it should likely be negligible, and they will not be the most popular pages.
Comment: I think I can do something with number 2 with a custom 404 page.  By only performing the long look up on pages not found versus every page will not affect my good traffic at all.
Comment: I am extremely happy with the custom 404 solution, it works perfect for what I am doing.  TY for the help.

How to manage 70K redirects


Has the sun become way brighter the last years?

Question: Up to last year, I never got blinded by the sun in everyday situations (e.g. running towards it), at no time of the year I was. But since last christmas, it occured to me more often that I cannot watch in the direction where the sun is because it is so bright that it really hurts me.
My mother and my roommate have observed the same phenomenon independently of me.
This, of course, is only anectodal evidence, which is practically worthless. We all get older and we may have the same kind of "photophobia", or we just forgot about being blinded the last few years and just now consciously felt an remembered it.
Therefore I want to ask this question: is there any objectively observable increase of brightness over the last few months and if so, why?
Comment: Atmospheric effects can also change perception.  I couldn't find any easy graphs that go to 2015.  But here you can download a dataset for analysis of solar irradiance.  http://www.nrel.gov/midc/ornl_rsr/
Comment: hottest sun is relative to earth proximity and sunspots which have 11 years cycle. last 3-4 years had high sunspots, increases total broad radiation a few percent. check sun brightness graphs by year on google images.
Answer: The Sun's luminosity is stable to 0.1% - it varies slightly in response to, or associated with, levels of solar magnetic activity (Solanki & Unruh 2012).
This variation would not be perceptible and is completely outweighed by the $\pm 3.4$% variation caused by the non-circular orbit of the Earth (the Sun is closest in January).
Obviously, if you live in the northern hemisphere, then the Sun is generally higher in the sky now (in May) than it was in December. Its direct light is less absorbed/scattered by the atmosphere. This is a much more perceptible effect. It could change the visual brightness by tens of per cent, and by even more in the short wavelength blue part of the spectrum. That is the only physics-based explanation I can offer.
Comment: @zephyr https://arxiv.org/abs/1210.5911
Comment: Purely out of interest, do you have a reference for the "stable to 0.1%" claim? It'd be interesting to learn how such a measurement is made and how all the sources of noise and artifacts are taken into account.
Answer:
is there any objectively observable increase of brightness over the
  last few months?

No. It's entirely your subjective perception that has changed.
The Sun is pretty close to a black-body radiator. That means the amount of energy we receive from it depends on two factors: its temperature, and its apparent size (the angular size of the solar disk as seen from Earth).
The apparent size of the Sun has obviously not changed. Way too many things would go completely haywire if that happened - I'll leave that as an exercise to the reader.
Its temperature has not changed either. This could be measured in various ways - but there's another way which is simpler: this being a black-body radiator, its temperature and its apparent color are correlated. The color of the Sun has not changed, obviously.
TLDR: The Sun is still working as it always had.
Comment: "The color of the Sun has not changed, obviously." While that perhaps *should* be obvious, I've heard several people claim to have noticed a change in the sun's color in recent years, so it may be worthwhile to include measurements of the sun's spectrum to show that it is hasn't changed (within acceptable margins).
Comment: @called2voyage I'm pretty sure all actual scientists working in the field of solar science would have noticed any changes way before any random folks claiming to see changes in the shade of color of the daylight.
Comment: I agree, but since we are a public outreach site, it would be to our benefit to make things explicit.


Bathroom GFCI Troubleshoot

Question: House about 15 years old. Upstairs bath has light switch (ceiling and 4 bulb over vanity) , exhaust fan switch and two GFCI plugs either side of vanity. Flipping the light switch trips the breakers - both. The lights over the vanity have been burning out frequently over past 6 months. Exhaust fan does not trip and any and all appliances plugged in do not trip. The light switch trips and then I took out all bulbs and it still trips. I replaced the switch and it still is the same. What should I check next? I'm thinking one of the fixtures, either ceiling or vanity must have a problem. Any other thoughts or confirmation would be appreciated - what to look for?
Comment: Just to clarify. There are two CFGI outlets with TEST/REST button, one each side of the vanity. When you turn on the light switch BOTH of the GFCI outlets trip their safety shutoff and go dead. Correct ?
Comment: Has anything been done about the time this started happening, or did it just start on its own?
Comment: Nothing done for years except to change light bulbs - went from incandescent to screw in fluorescent. All worked fine until a few month ago.
Answer: I think it is a safe bet that it is one of the fixtures. You seem to have ruled out everything else. Start with the fixtures that have been burning out lamps.
If you feel confident, turn off the breaker and remove one of the fixtures. It may or may not be obvious if it is the culprit. Cap off the wires coming out of the wall, turn on the breaker and try the switch. Repeat if the problem persists.
Edit: Upon re-reading, when you say "trips the breakers", do you mean the reset button pops out on the GFIs, or the circuit breaker trips??
A GFI is NOT a circuit breaker.
Comment: No I meant trip the GFCI reset button.
Comment: some times the wiring gets a nick in the fixture / or if metal box if metal was used and grounded that may be the cause ,or give you something to look for. my apprentice recently wired some motion lights with emt/metal box
it worked for a day then 1 light went out and the other stayed on all the time. He nicked the hot it blew after working for a day and smoked the sensor fixed the wiring and replaced the sensor and all better
Answer: UPDATE: I went directly to the light fixture above the vanity - it was actually two fixtures on either side and the left one after being removed allowed the system to function properly. I removed all and the only thing I could see was that all wires at the light sockets appeared burned - not through the insulation or anything but discolored like they had gotten hot.I bought new light sockets and installed those and the lights are on, the GFCI's are holding and everything is back to normal. Appreciate the confirmation of action by Speedy Petey and interest from others.

Bathroom GFCI Troubleshoot


unresponsive keyboard and mouse after update

Question: I have Dell Inspiron desktop machine running Ubuntu 14.04 with dual boot.
At some moment I started having non-responsive USB keyboard and mouse on wake up after suspend on some occasions. As I'm lazy and it did not occurred often I just rebooted and continued my work.
At last I got no keyboard or mouse after reboot. Keyboard works in grub and both fail on login screen. Plugging keyboard/mouse off/on did not help.
I re-installed 14.04.02 and it worked out of box just fine until I installed all updates. Then no keyboard or mouse again.
I installed 12.04 and it worked exactly as 14.04! Fine out of box, no keyboard or mouse after installing updates.
I ended up installing 14.04, disabled all updates and it is fine so far, but I want to know what causes this problem and what specific update is at fault.
Any ideas?
Answer: If you have a spare keyboard or mouse then login go into setting > software and updates then under the tab additional drivers what till you see drivers keep you other keyboard and mouse plugedin so it can look for those as well. If it doesn't work then you might want to reasearch you piticular mouse and keyboard and look for anything similar to your situation.


Why is adaptive security stronger than CCA1 security, and weaker than CCA2 security?

Question: We know in CCA1 security, after seeing the challenge ciphertext,

no more decryption oracles are allowed to the adversary.

But in adaptive security, what should the adversary do?  Please help me solve the puzzle.
Comment: Where have you heard of "adaptive security"? How was it defined there?
Answer: The word adaptive security could possibly refer to:

security with respect to the definitions of IND-CCA2, possibly emphaizing that is the adaptive case of IND-CCA (IND-CCA1 is called non-adaptive)
Real-time adaptive security, but that's not really in the field of cryptography but network security.
Gartner published a paper Designing an Adaptive Security Architecture for Protection From Advanced Attacks (behind a paywall), and is referred to in various blogs. It seemed to have stirred some interest, but google mostly gives you results for "what is adaptive security", and after a quick glance none of those articles seem to be about cryptography. It seems to be mostly about network security and business management (including things like risk management, incident response, continuous monitoring etc. )

I don't think there is any (commonly used) security definition stricly between IND-CCA1 and IND-CCA2.


Apple Mail - my sent email marked as spam in client's inbox

Question: Email sent from the same address, but sent from my iPhone, are being received as normal. It seems that only email sent from my computer (Mac Pro 2013, trashcan) are being marked as spam in my client's inbox. My email address is my own domain (my first name at my https domain dot ie) and I have been emailing some of these clients successfully for a decade. Can anyone help? My domain is not blacklisted. thanks
Comment: Are you connecting to the Internet from a different network on your Mac than on your Iphone? Spam filters often use the sender's IP address to determine whether the mail is spam or not.
Comment: No, same wifi, is that what you mean?
Comment: Yes, that' what I meant. It's odd. I don't know how easy this is going to be for you, but I'd examine the emails that my clients receive, have a look at the headers and see why they are being marked as spam; spam filters add in the headers info about why they mark emails one way or another. (Of course, I don't know if you are in the same city than your client, or whether your client even knows what a mail header is...)
Comment: If I save the email as a draft, then send it from my iPhone, it seems to send ok. Does this tell you anything new?
Comment: not really, no, Sorry.
Answer: It seems that the problem was with my SMTP settings. I had to authorise my IP address in my website control panel, and in apple mail I had to turn OFF 'automatically manage connection settings', so that I could select the port, SSL, and authentication recommended from my web host.


Unreal Engine Movie Render Queue Plugin

Question: I am developing a plugin to stylize videos and images rendered through Movie Render Queue. What I want to do now is capture the image processed by Movie Render Queue at runtime and stylize the images one by one and encode it into a movie. Which C++ API can be used to capture the images from Movie Render Queue at runtime (while rendering) not on disk?
Answer: To capture images from a rendering program like Movie Render Queue at runtime, you can use a C++ API such as OpenCV. OpenCV is a popular, open-source library for computer vision tasks, and it includes a range of functions for capturing, processing, and encoding images and video.
Here is an example of how you could use OpenCV to capture an image from Movie Render Queue and stylize it:

<code>#include <opencv2/opencv.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main() {
  // Initialize a capture object to grab frames from Movie Render Queue
  VideoCapture capture(0);

  // Check if the capture object was initialized successfully
  if (!capture.isOpened()) {
    cout << "Failed to initialize capture" << endl;
    return -1;
  }

  // Create a window to display the stylized images
  namedWindow("Stylized", WINDOW_AUTOSIZE);

  // Loop until the capture is stopped
  while (true) {
    // Grab a frame from the capture
    Mat frame;
    capture >> frame;

    // Check if the frame was grabbed successfully
    if (frame.empty()) {
      cout << "Failed to grab frame" << endl;
      break;
    }

    // Stylize the frame here...

    // Display the stylized frame
    imshow("Stylized", frame);

    // Wait for a key press to continue
    int key = waitKey(1);
    if (key != -1) {
      break;
    }
  }

  return 0;
}</code>

In this example, the VideoCapture object is initialized with a capture index of 0 to grab frames from the default video input (e.g. the webcam). You can specify a different index or a file path to capture from a specific video source.
The capture >> frame line grabs a frame from the capture, and the imshow() function displays the frame in a window. The waitKey() function is used to pause the program until a key is pressed, which allows you to view the stylized frames one by one.
You can use the various functions in the OpenCV library to stylize the frames as you wish, and then use the VideoWriter class to encode the stylized frames into a movie file. For more information and examples, you can refer to the OpenCV documentation: https://docs.opencv.org/master/

Unreal Engine Movie Render Queue Plugin


Linking Functional Block (FB) from development project to Testing Project -TwinCAT 3 - Beckhoff

Question: I have created a testing project to run unit tests using TCunit framework and wanted to link files from development project worked by another colleague.
But there is only Add option when i right click on POU folder in solution explorer of TwinCAT.
When i did so, a copy of a file is made in testing project POU folder. Now I have two copies of same file i.e. in POU folder in testing project and POU folder in development project.
The problem i want to avoid is , if there are changes in the development project files i need to update POU folder in the testing project also manually.
Is there any solution to avoid the duplication?
Answer: You could create a library from your development project and reference it in yout Unit Testing project.
By right-clicking on the development project you can select "Save as Library". Once the library is generated you can install the library using the library manager and install the file.
Finally in your unit test project you can add this library by right clicking on the References and choosing the library you just installed.
Unfortunately this still requries to manually update your libray when there are changes but is a somewhat cleaner solution.
Comment: Thank you very much for the suggestion. I think, here i need to create the library every time if there are changes in the Development project. why the referencing is not provided in twinCAT? I feel it important feature and also present in other language and IDE's .
Answer: I haven't tried this, but maybe you can try to make a hard symbolic link to the folder content you want in your test project. And then import the content from the symbolically linked folder into your test project.
Edit 18 April 2020
I made a small batch script to facilitate the hardlinking.
Comment: I have created soft link to the files in POU folder in Development folder to Test Folder. Files need to be explicitly added to the project, it doesn't automatically recognize the folders or files.
Comment: @KumaraswamyGaviyappa No problem. How did you add the folders to your unit test project? It doesn't automatically recognize the folders when they are in the project directory right?


How can I avoid wasting shots on zombies that are already dead, but haven't fallen in Left-4-Dead?

Question: In Left-4-Dead, zombies don't always fall immediately when killed (especially with a pistol or machine gun), but instead there is a delay. Since I've currently been shooting zombies until they fall, I've been wasting bullets. How do you figure out when to stop shooting and when to move onto the next zombie?
Answer: Here are a couple ideas.
Foremost, after a while you just get a "feel" for when a zombie is dead, or when he is still coming after you.  You know about how much damage it takes.  Note that different difficulties will require you to get different feels for this, so you'd need to play on the same one for a while.
Alternatively, you can switch your fire between a couple of zombies.  A bullet usually stops or at least slows down a zombie, even if he is going to continue rushing at you.  This gives you some time to deal with other zombies that may have gotten ahead in the rush due to this.  You can always come back to the first zombie later on if you discover he's really still alive.
Note that you can't rely on their "animations" per se because of the ragdoll physics.  If a zombie starts falling, he's dead, but quite often they take a full second or more before they actually begin to fall.  You can't rely on a certain pose or position to indicate that a zombie is dead.
Answer: Just for the record, this is supposed to add to the terrifying feel of the game (which I completely agree with)
However, if you raise the gamma a bit, then you will be able to see that the zombies start to fade when they die, even if they're still standing.  That's always worked for me.
Answer: The best way I have found to be sure a lone zombie is dead it to try to walk through them. A living zombie will stop you, but you can walk right through a dead one. If they stop you, just push them back and shoot them again.
If you fighting a hoard, shoot at multiple layers of zombies. When the front one dies, you will just start hitting the back ones.
Comment: Hmm, if your method for telling if a zombie is dead is to walk right towards it, I don't think you'll last long in the zombie apocalypse... ;)
Comment: I should note that I play a lot of vs, where moving on quickly is more important that avoiding the occasional hit from a common.
Comment: plus on Expert you can't really afford to give even the regular zombies any free hits as they *really* hurt.
Comment: passable for Versus, not so for Expert/Realism modes.
Answer: I might be wrong, but they only "fade" in the censored versions of the game.
There is no way to be sure 100%, if a body shot has killed a CI or not. The only way to be sure is landing a head-shot, especially with pistols and the assault rifle.
It's a whole different story in L4D 2 with the introduction of melee weapons, but I won't get into that.
Comment: -1 because, actually, the only way to be sure is to nuke the site from orbit. j/k, +1 for good answer. oh and by the way, if you see their leg get blown off, they are dead immediately, even on expert.
Answer: Set your Left 4 Dead launch options to include <code>-lv</code>
That way all killed zombies will fade away immediately.
Comment: just note that, lv stands for "low violence", which also limits other things such as blood spatter etc.
Answer: Count bullets.
Seriously, that's what I do.  It's not something I actively do anymore, now it's more of a feel but occasionally I still catch myself mentally counting.  As soon as the dead count is reached I just assume the zombie is dead, whether it's standing or not.
Because of this I prefer the AK47 (2 to body always kills), the magnum (one anywhere) and the snipers(one anywhere).  It's a little harder with the desert eagle, the trick is to not count each bullet but count each burst.  For me the m16 is just a bullet fest.
Obviously there are some caveats.  If I'm boomed and in a zombie rush I often just empty my clip at head level(unless I've got a sniper).  Anytime I see a headshot the zombie is dead.
My technique doesn't work well in expert mode.
Comment: My technique is similar: Don't aim for center mass at all, just go for head or limb shots at close range with a shotgun.  Head still attached to shoulders?  You missed, fire again.


On the Autocorrelation Matrix of an ARMA(2,2) to derive the Yule Walker Equations

Question: For an AR(2) I can get the Yule-Walker equations: $$\begin{cases} \rho_1=\alpha_1+\alpha_2\rho_1 \\ \rho_2=\alpha_1\rho_1+\alpha_2 \\ \rho_k=\alpha_1\rho_{k-1}+\alpha_2\rho_{k-2} \end{cases}$$ starting from the Autocorrelation Matrix.
But how can I manage the MA part to get the complete autocorrelation matrix in the case of an ARMA(2,2)?
Answer: Let's define a general ARMA model of orders $(p,q)$ as follows:
$$
\psi_t \equiv \sum_{i=0}^p \alpha_i\, y_{t-i} = \sum_{i=0}^q \theta_i\, \epsilon_{t-i} \,,
\mbox{ with } \epsilon_t \sim NID\,(0, \sigma^2_\epsilon) \,.
$$
where $\alpha_0$ and $\theta_0$ are normalised to $1$.
You can check that multiplying $\psi_t$ by $\psi_{t-\tau}$ and taking expectations in both sides of the equation yields:
\begin{equation}
\sum_{i=0}^p \sum_{j=0}^p \alpha_i \alpha_j \gamma_{\tau+j-i} =
\sigma^2_\epsilon \sum_{j=0}^{q-\tau} \theta_j \theta_{j+\tau} \,,
\end{equation}
where $\gamma_i$ is the autocovariance of order $i$.
The mapping between the autocovariances and the parameters in an ARMA model is not as rewarding as in an AR model. The above equation does not return a system of equations that can be easily solved to obtain an estimate of the parameters by the method of moments. The Yule-Walker equations are instead easy to solve and return an estimate of the AR coefficients.
Although it is not straightforward, the method of moments can still be applied for an ARMA model by means of a two-steps procedure: the first step uses the Yule-Walker equations and the second step is based on the equation given above. If your question goes in this direction I could give you further details about it.
Edit
The following is an extract from pp. 545-546 in D.S.G. Pollock (1999) A handbook of time series analysis, signal processing and dynamics, Academic Press (changed notation $\theta$ is $\mu$ in the original source):
1)
\begin{eqnarray}
\begin{array}{lcl}
E(\psi_t\psi_{t-\tau}) &=&
E\left\{ \left( \sum_i \theta_i \epsilon_{t-i} \right)
\left( \sum_j \theta_j \epsilon_{t-\tau-j} \right) \right\} \\
&=&
\sum_i \sum_j \theta_i \theta_j E(\epsilon_{t-i} \epsilon_{t-\tau-j}) \\
&=&
\sigma^2_\epsilon \sum_j \theta_j \theta_{j+\tau} \,.
\end{array}
\end{eqnarray}
2)
\begin{eqnarray}
\begin{array}{lcl}
E(\psi_t\psi_{t-\tau}) &=&
E\left\{ \left( \sum_i \alpha_i y_{t-i} \right)
\left( \sum_j \alpha_j y_{t-\tau-j} \right) \right\} \\
&=&
\sum_i \sum_j \alpha_i \alpha_j E(y_{t-i} y_{t-\tau-j}) \\
&=&
\sum_i \sum_j \alpha_i \alpha_j \gamma_{\tau+j-i} \,.
\end{array}
\end{eqnarray}
Putting (1) and (2) together:
$$
\sum_i\sum_j \alpha_i\alpha_j\gamma_{\tau+j-i} =
\sigma^2_\epsilon \sum_j \theta_j \theta_{j+\tau} \,.
$$
Comment: @Ihab I have added some details extracted from the book Pollock (1999). Chapter 17 in that book contains further details.
Comment: thank you for the answer. Would you mind developing more  how the two steps procedure works or provide some references?
Comment: thanks a ton @javlacalle. I am probably missing something: your edit proves the equation you mentioned earlier, but how can I use this equation to actually find the different parameters?
You mentioned something about using a combination of this equation and the Yule Walker equations to get the final result. I would much appreciate it if you can elaborate on that.
Comment: @ javlacalle thanks for the book reference. I think I will find what I am looking for there. Cheers


Increase in entropy derivation

Question: so i'm following a derivation of the statement in the title and it goes the following way. Consider we have a system and we look at two processes between two states $(1,2)$ and $(2,1)$ where path $(1,2)$ is reversible and $(2,1)$ is irreversible. So we have:
$$\oint dS=\int_{1}^{2} dS + \int_{2}^{1} dS \le 0$$
Since $(1,2)$ is a reversible process we can write in the following way:
$$\int_{2}^{1}dS +(S_2-S_1) \le 0 \\ \Rightarrow \int_{2}^{1}dS \le (S_1-S_2) $$ $$\Rightarrow S_{irr} + \int_{2}^{1}dS = (S_1-S_2)$$ Where $S_{irr}$ is the bonus increase in entropy due to the irreversability of the process. So now if we say that the system is isolated $(\delta Q=0)$:
$$\int_{2}^{1}dS=\int_{2}^{1}\frac{\delta Q}{T}=0$$ $$\Rightarrow S_{irr} = (S_1-S_2)$$ My question here is why when we assume that the system is isolated don't we say that the other integral is also going to result in zero $(S_2-S_1=0)$?
Answer: Most of your analysis seems incorrect to me.  For the combination of reversible and irreversible cycle you describe, $$\Delta S_{cycle}=\Delta S_{1,2}+\Delta S_{2,1}=0$$That is, for a system which undergoes a cycle, the initial and final states of the overall cycle are identical, and the entropy change is zero.  If the irreversible part of the cycle is adiabatic or isolated, $$\Delta S_{2,1}=\sigma>0$$where $\sigma$ is the entropy generation during the irreversible part of the path.  So we have $$\Delta S_{1,2}+\sigma=0$$or $$\Delta S_{1,2}=\int_1^2{\frac{dQ}{T}}=-\sigma<0$$This tells us that the reversible part of the path cannot be adiabatic or isolated, and some heat transfer must occur over this part of the path.  There is no possible cyclic path comprised of an irreversible- and a reversible adiabatic segments.
Comment: Thanks a lot! Just one question. What about ideal Carnot cycle? isn't the 2nd and 4th part reversible  adiabatic?
Comment: The typical Carnot cycle is not irreversible for any of the 4 parts.  The entropy changes of the 1st and 3rd isothermal parts sum to zero, and the entropy changes of the 1st and 3rd parts are each zero.
Answer: Because in an isolated system you can have a spontaneous process, this can happen by removing a constraint within the otherwise isolated system itself. For example, you can have a rigid adiabatic wall separating two fluids at  different temperatures and/or  pressures and the equilibrium is maintained while the wall is in place. Now remove the wall and observe a spontaneous relaxation process during which the temperatures and pressures equalize. With the spontaneous equalization comes an irreversible entropy production that is characteristic to the process itself. As long as the spontaneous process is not so violent that macroscopic quantities cannot even be defined, at every instant/step/stage of the spontaneous process you have a system entropy dependent on the state of the system and a positive entropy production dependent on the process.

Increase in entropy derivation


Remove delete-attachment button for every media

Question: I'm trying to find a way to permanently remove the delete_attachment button from the media details modal. I don't want to use CSS to do it... and haven't been able to find a way as of now. Does anyone have an idea ?
Answer: Rather than focusing on the button itself, focus on what you want users to do. If you don't want your users to be able to delete media, and you are also comfortable with them not being able to delete other post types (Posts, Pages, etc.), you can create a custom role for these users.
<?php
// In a plugin, add_role will create an entirely new role to assign to users.
add_role('media_editor', 'Media Editor', array(
    // The capabilities below will let these users add, edit, read,
    // but not delete any type of content.
    'create_posts' => true,
    'edit_posts' => true,
    'edit_others_posts' => true,
    'edit_private_posts' => true,
    'edit_published_posts' => true,
    'read_private_posts' => true,
    'read' => true,
    'upload_files' => true
    // You may also wish to add capabilities for other post types,
    // such as create_pages, edit_pages, or custom capabilities
    // for custom post types.
);
?>

Once this code runs, you can then edit each user and change their role to "Media Editor" (or whatever you decide to call it in your code).
By removing the users' ability to delete any type of posts, they will no longer see the delete button in the media details modal, or any other location. If instead you focus on one button in one modal, you may be leaving other locations - such as the Media Library itself - with buttons they can still use.
Answer: I you look at the code that generates this button in media-template.php (currently on lines 488 and 599) you can see that it is pretty much hard coded. So there is no easy way to make sure this button doesn't show up. Hiding it with CSS seems to be the right way.
That would not prevent people from unhiding by fiddling with the CSS, of course. But if someone really means to do harm, he could copy the whole html node from another install and copy it into the DOM of your site on his user side. Then he could still delete the file ... unless you make sure on the server side that the command is not accepted. Ultimately, if you want to prevent people from deleting files, it is not about what code you send to the user end. It's about what is accepted on the server end. That's what you should manage.
A simple option would be to look into wp_delete_attachment. You could use the delete_attachment hook to see if the current user is supposed to do deleting here and kill the page load if he is not. A bit crude, but it works.


Send video stream from android device

Question: I'm new in android. I was planning to create a Video streaming mobile to mobile in the same wifi connnection but i don't know how to start. I've read about the RTP/RTSP/UDP for streaming video and some sources but I cant follow the process at all. Can someone explain to me how to send or broadcast a video playing in android device then send the data in a server? So that it can be access in like "rtsp//: something like that so that the other device can view it. Sorry for the small info
Answer: For most mundane purposes related to your question, there's a really good solution:
DroidCam (or DroidCamX, for PRO version)

https://play.google.com/store/apps/details?id=com.dev47apps.droidcam
https://play.google.com/store/apps/details?id=com.dev47apps.droidcamx&hl=en&gl=US
https://www.dev47apps.com/

I use the PRO version for unlimited streaming resolution. For about $3-4 bucks I have a software that streams the video from my Android phone from a camera of choice (front, back, back wide-angle), over the wire to the PC (works perfectly with Ubuntu Linux and Windows), or over WiFi connection to the LAN. As longs as you have a static local IP address assigned within your LAN, your camera stream is available through the port of choice.
Linux and Windows PC clients have options to control autofocus. Android-side software has options for optimizing stream bitrate and quality ("Limit FPS", "FPS Boost").
This is one of the very few paid apps I've had so far, I predominantly use it as a substitute for a web camera (a rather cheap one).
Answer: There are two things involved in this.
 1. Implementation of RTSP
 2. Converting android camera output into RTSP source.
I could not find any open implementation while I was searching for it almost 6 months back. Here is the one which worked for me with little tuning. But you have to clone the repo and work on it directly to get it working
https://github.com/mutaphore/RTSP-Client-Server

Send video stream from android device


Which way do black hole jets spin?

Question: The centers of black holes and quasars often have jets coming out the two poles of an accretion disk, say north and south.  Is it known if the two jets spin in the same direction or opposite directions to each other?
Comment: what makes you think the jets spin?
Comment: I think the question is what makes you think they don't spin... not a whole lot out there with zero angular momentum. I'm no relativistic jet expert, though. Have no idea on the answer to this question.
Comment: It all depends on what mechanism for jet formation you pick.  If it's just the geodesic model, then they will certainly spin -- angular momentum in equals angular momentum out, minus what is exchanged with the star.
Answer: The Blandford-Znajek process and variants are leading contenders for explaining black hole jets. The driving energy for the jets is extracted from the black hole spin and transferred to the outgoing plasma by twisted magnetic fields. Along with energy, the jets must contain the lost angular momentum from the black hole, which then ultimately comes from material being accreted from the disk.
Thus I would expect that the angular momentum vector in the jets (in both directions) is in the same sense as the black hole angular momentum. i.e. the material spirals away from the black hole in the same sense in both directions. e.g. If the black hole spins clockwise looking down on its "north rotation pole", then the angular momentum vector points south. Material travelling towards you and away from you will also spin clockwise.
See also models for astrophysical relativistic jets from compact objects and
Why are polar jets emitted along the axis of rotation?
Answer: Looking at Earth's spin down upon the north pole, it is counter-clockwise. Looking at Earth's spin down upon the south pole, it is clockwise.  The sense of helicity depends upon the observer's position.  (If the spin is relativistically propagating, the observer only has one POV.  Beta-rays are chiral left-handed until they are slowed.)
Looking down in one direction all the way through, there is a problem with angular momentum disk vs. jets if the mirror-direction jets are not spinning in the same sense while traveling in opposite directions.  Choose your nomenclature to define the relative directions of spin.
This is not a frivolous problem!  Chemical optical rotation is "coming toward," viewed through a polarimeter.  Geometric rotation is "going away," whether clockwise rotation drives the screw into wood (if yes, right-handed).  Optically left-handed quartz is observed to be crystallographic space group P3(1)21, which is a right-handed 3(1) screw axis (and 3(2) left-handed).  It gets worse!  P3(1)21 quartz and P3(2)21 berlinite are both levorotatory, as optical rotation is not sourced by physical atomic mass distribution, J. Appl. Crystallogr. 19, 108 (1986).
When you say "same direction of rotation," define it very carefully.
Comment: Yes, I did mean "Looking down in one direction all the way through". I can conceptualize and agree with your comment "there is a problem with angular momentum disk vs. jets if the mirror-direction jets are not spinning in the same sense while traveling in opposite directions." but close to a black hole there is a lot going on with a lot of energy. Mostly wondering if observations have provided a proof of this and I would be very interested in any research in this area. Your crystallographic comments and analogy are also very interesting, thank you.
Comment: If you label the orbit of the matter in the accretion disk "prograde", would that help define terms for the answer? i.e. are both jets in prograde rotation, both retrograde, one prograde and the other retrograde...?

Which way do black hole jets spin?


How soon before contract end should an intern start looking for a permanent job?

Question: I am an intern currently at a museum and my contract ends in 3 months with no option for another contract because it is an internship. My contract ends in about 3 months. When should I start looking for a new job? I don't want to not get a job because I am already committed full time to another until a specific date. I just need some guidance on this issue.
Thank you
Comment: Why not start looking now?
Comment: If someone offered you a job starting before the end of the internship, is there any reason you couldn't take it? Is there a notice period for your internship?
Comment: @Robin it could harm contacts they've made at the museum (assuming it's relevant to their profession) not sticking out an internship doesn't tend to look great
Comment: @RobinBennett - *is there any reason you couldn't take it?* I can't speak for the OP of course, but in many educational programs, completion of an internship is required to complete the program. So, of course, leaving the internship early could put the program at risk.
Answer: You should start looking immediately. Employers specifically looking for entry level positions (internships, people just coming out of school, people leaving other internships) understand that it's typical for candidates to have fixed commitments (i.e. finishing an existing internship, or reaching a graduation date) and usually account for it in their hiring processes.
Most employers have a spot on their application for applicants to indicate a desired start date. You can put your date there, and if there are comments allowed, indicate that you are waiting to finish an existing internship.
Plus, if you wait, you may miss a great opportunity.


Can SuperAlloy Darkshine be hurt?

Question: It's said that the battles SuperAlloy Darkshine lost was due to running out of stamina , not because his physical body was damaged. Is this true? Can SuperAlloy Darkshine be hurt?
Answer: Said by whom?
The only fight you see Darkshine have in the manga at this point is against Bug God, which is an easy victory.

 In the webcomic, he suffers a psychological breakdown in his first fight (ending in chapter 76) against Garou when the thought that he might lose occurs to him.  Even then we see him bleeding from his mouth and nose.  In his second fight against Garou (chapter 85) he is easily knocked down, has multiple minor cuts and a head laceration at least, and ultimately can't even get one word out without coughing blood before passing out.  He's not explicitly shown or stated to have any broken bones, or anything more severe than any of that, though the coughing bit suggests he might have fractured ribs.  He ends up knocked out and unable to continue fighting in pretty short order, one way or another.

Before all that we're told he had never lost a fight before (chapter 76; as a hero at least; before he started training maybe he'd been in a school fight or something and lost), and never really felt challenged.
Comment: You are missing what happens in the webcomic
Comment: @Pablo What do you mean?  It's right there in the spoiler tag, so I don't know what you think's missing.

Can SuperAlloy Darkshine be hurt?


Can I title something without an article?

Question: I want to name my YouTube channel "Girl Pockets". Do I need the definite article "die" or can I just call it Mädchentaschen?
Comment: First of all, you can name your YouTube channel however you see fit. Next, you probably want to read about the indefinite plural article.
Comment: 'die' is a definite article
Comment: As a side note: while "Mädchentaschen" certainly is a literal translation of "girl pockets", it IMHO does not convey the same connotations as 'girl' is in my experienced used slightly broader than the German 'Mädchen'... you might want to go for a different translation depending on the actual topic of that channel
Comment: As mentioned, you can name it whatever you want. It's the translation of "Girl Pockets" and does not require the definite article in this context. Also could imply that there is multiple "Girl Pockets" or the channel is about a group of people who identify as "Die Mädchentaschen". It really depends on the content but that falls outside the scope of the german language SE.
Answer: You don't need the article in a title.
If you do use the definite article "die" here, you get a different meaning. Much like in English, it would mean that you refer to special, known, definite girl pockets. If you leave it out, it means that you refer to  girls pockets in general. "The girl pockets" would mean something different, and so would "Die Mädchentaschen".
Using no article in plural is like using the indefinite article in singular. In German as well as in English, "Girl pockets" is actually the plural of "A girl pocket".
Off topic: If you're talking about pockets in dresses, trousers etc. and not exclusively refering to "girls" in the sense of kids and very young women (< 25y), it might be better to call it "Frauentaschen" or "Mädelstaschen" or something else. "Mädchen" has a more narrow sense in German than "girl" has in English.  Especially, it isn't used by women to refer to other women or their female friends ("me and my girls"). "Mädels" is sometimes used in that sense. Also, "Taschen" includes purses, bags, pouches etc. Maybe there are already German speakers in your audience who know the vibe of your channel and have some ideas. If your channel's videos are in English anyway, you could also consider just using the English title for German, too, perhaps adding a German subtitle. German speakers are used to that. For example, film and TV show titles are often just using the English title nowadays ("Two and a half men", "How I met your mother", "The Big Bang theory").


Positive semigroups and convex operator

Question: Let $\{Z(t)\}_{t\geq 0}$ be a strongly continuous positive semigroup on a Banach lattice $V$ (endowed with ordering $\leq$). Let $\phi:V\rightarrow V$ be a convex operator. I want to prove that $$\phi(Z(t)f)\leq Z(t)(\phi f),\quad f\in V,\quad t>0.$$
Can someone out there help me out?
Comment: If we use the same definitions, then a linear operator is a special case of a convex one and then I believe your statement does not hold without further conditions. What I have in mind is in $C_0(\mathbb{R})$ taking the left shift group and as $\phi$ taking mirroring along the $y$-axis. Then the two sides are not always comparable if I am not mistaken.
Comment: They are definitely not equal...
Comment: For the historical record, the user who asked this question formerly used the name "Gul E Hina".
Answer: OK, I write my comment into an answer. A linear operator is a special case of a convex one and then I believe your statement does not hold without further conditions.
What I have in mind is in $X:=C_0(\mathbb{R})$ taking the left shift group as $Z(t)$ and as $\phi$ taking mirroring along the y-axis, i.e., $\phi f(s)=f(-s)$.
If you take now a bell-shaped curve like $f(s)=e^{-s^2}$, then $f$ is positive, $\phi f = f$, and $Z(t)(\phi f)$ has maximum at $s=-t$, and it is between 0 and 1 elsewhere.
On the other hand, $\phi(Z(t)f)$ has a maximum at $s=t$ and it is immediate that we cannot compare the two functions in the usual ordering.
Wolfram Alpha gives me these images.

ADDED 01/05/2014:
You can easily modify this example to the following: Let $\Gamma\subset\mathbb{C}$ be the unit circle, $Z(t)$ the usual rotation group and $\phi$ mirroring to the $x$-axis ($\phi(e^{is}) = e^{-is}$). Taking a nonconstant continuous function $f$ on the circle you can draw the same conclusions. Then you have an example in a $C(K)$ space such that $Z(t)1 = 1$.
ADDED 01/07/2014:
Let $f(z)=\Re z+1\geq 0$, then $(Z(t)f)(e^{is}) = f(e^{i(t+s)}) = \cos(t+s)+1$, hence $\phi(Z(t)f)(e^{is}) = \cos(t-s)+1$.
On the other hand, $\phi(f)=f$, and  $Z(t)(\phi f)(e^{is}) = (Z(t)f)(e^{is})=\cos(t+s)+1$. Hence, they are not comparable and you can produce a similar picture as above to demonstrate this.
Comment: Sir, for $X=C(\Gamma)$ (continuous functions on unit circle), rotation group is defined as
$$(T(t)f)(s)=f(e^{it}.z),\quad f\in X, z\in\Gamma$$
Let $\phi$ be mirroring along $x$-axis (which means to take conjugate) i.e $\phi(z)=\overline{z},\quad z\in\Gamma.$
If I take $f(z)=z^2$, for $z\in\Gamma$, then f is continuous. $(T(t)f)(z)=f(e^{it}.z)=z^2e^{2it}$,
$\phi[(T(t)f)(z)]=\overline{z}^2e^{-2it}$,
$\phi(f(z))=\overline{z}^2$,
$T(t)[\phi(f(z))]=\overline{e^{it}.z}^2=\overline{z}^2.e^{-2it}$
Sir this is how I tried. It may be wrong.
Comment: I deleted my comments and added a detailed example. You should consider real valued functions if you want to preserve positivity. Good day to you.
Comment: Why do you think so? You mix up something again...
Comment: $1$ is the constant one function, not $Z$....
Comment: $Zv\neq v$. The linear polynomial is never considered to be an identity element in these spaces, only if you make an algebra by composition.
Comment: I suggest you to ask a separate question where you formulate clearly what is your question. In this thread you already asked three questions by editing, and it gets confusing.

Positive semigroups and convex operator


How to display a page's featured image?

Question: I want to get the URL of a page's "featured image", as I want to use the page's featured image as the background image for the banner at the top of the page. The background image for the banner changes according to what page I'm on, as they will have different featured images.
Answer: Adapted from this thread on the WP forums:
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); ?>

<?php endif; ?>

Add this to your single page template, after the_post(). I'd reccommend having a default header image so that if the page doesn't have a featured image it falls back to using that.
'single-post-thumbnail' can instead be an array with the ideal header dimentions, such as array(600, 30).
Comment: Happy to help. Could you mark the question as answered? Thanks.
Comment: Should not put PHP in your CSS though
Answer: Since you are using the image outside of the loop, you need to get the ID of the post first. Then use that to get the featured image's URL.
function wpse207895_featured_image() {
    //Execute if singular
    if ( is_singular() ) {

        $id = get_queried_object_id ();

        // Check if the post/page has featured image
        if ( has_post_thumbnail( $id ) ) {

            // Change thumbnail size, but I guess full is what you'll need
            $image = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'full' );

            $url = $image[0];

        } else {

            //Set a default image if Featured Image isn't set
            $url = '';

        }
    }

    return $url;
}

Now you can use this to echo the featured image's url at header.
<?php echo wpse207895_featured_image();?>
For eaxmple:
<header class="site-header" style="background-image: url('<?php echo wpse207895_featured_image();?>');">
    ....
    ....

Answer: I found this worked for me
You can use the page's Feature Image as a background image for an element like this -->
<?php $backgroundImg = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full' );?>
<article class="banner" style="background-image(url('<?php echo $backgroundImg[0]; ?>'))">

But I would recommend using it in an image element, in the 'src' attribute -->

 <?php $backgroundImg = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full' );?>
 <img src="<?php echo $backgroundImg[0]; ?>" alt="Feature Image">

and set the image size to fit whatever size the banner element is.

How to display a page's featured image?


Regex doesn't work in google analytics custom segmentation

Question: I want to extract string matched with r'^/study/[0-9]+/' by URI in Google Analytics custom segmentation.
To extract specific string, i applied ^/study/[0-9]+/ regex to page. but it's doesn't work.
it doesn't filter /study/?filter_by=category&category=job. other things are same too.
What's wrong with that?
Answer: Could use an or to include a literal ? and then an | to include your other filter:
^/study/\?.*|[0-9]+/

So the RegEx I gave you was written to include a ? and anything after that ?; I read your question wrong. :)
Are you trying to create an advanced segment using this RegEx? If so, we ran into this issue a few weeks ago and submitted a bug to Google. They got back to us with this:
This is working as intended. When you create a segment based on a page regex it will match any session that has at least one page matching that regex. It then proceeds to include that session in the segment along with all other pages it visited, no matter if they match the regex or not.
If you just want to see the pages that match that regex than forget about custom segments.
Go into the Page report and do a report filter.
I believe it was @Eduardo who wrote this.
Comment: regex does work on other concepts (e.g language) but not on `page`


Is the complement of a zero-dimensional subset of the plane path-connected?

Question: Let $X$ be a zero-dimensional subset of the plane $\mathbb R ^2$.  Is $\mathbb R ^2\setminus X$ necessarily path-connected? I feel the answer must be yes but I need  a reference. If it helps, assume $X$ is nowhere dense.
Answer: If the zero-dimensional set $X$ is not closed, then the answer is "no".
To construct a suitable example, take any open bounded neighborhood $U\subset\mathbb R^2$ of zero, whose boundary $\partial U$ does not contain a topological copy of $[0,1]$. For example, for $U$ we can take a bounded connected component of the complement of the union of two suitable pseudoarcs in the plane. Then the set $$X=\mathbb R^2\setminus\{\vec a+\tfrac1n\partial U:\vec a\in\mathbb Q^2,\;n\in\mathbb N\}$$ will have the desired property: it is zero-dimensional and its complement $\mathbb R^2\setminus X$ does not contain a copy of $[0,1]$ (by the Baire Theorem) and hence is not path-connected.
Answer: At least if $X$ is compact, the answer is yes. Indeed, by Corollary 2 of Theorem IV 3 in:
W. Hurewicz, H. Wallman, Dimension Theory. Princeton Mathematical Series, v. 4. Princeton University Press, Princeton, N. J., 1941,
compact sets separating points in $\mathbb{R}^{n+1}$ must have topological dimension $n$.
In particular, compact sets separating points in $\mathbb{R}^2$ must have (topological) dimension $1$ or $2$ so sets of dimension $0$ cannot separate points.
Comment: You know, reading your answer makes me wonder which specific kind of topological dimension OP had in mind (but then again R^2 is polish so it doesn't really matter...)


CO/ALR Outlet Wire Mount Screw Torque

Question: When installing a CO/ALR outlet is there a recommended torque specification for the mounting screws? Unfortunately, I have some aluminum wiring in my home.
Comment: I put some CO/ALR receptacles in my house 40 years ago. I tightened the screws very tight with a standard hand screwdriver that fit well into the slot in the side screws. I checked one recently and it was still tight. Personally I would use AlumiConns and copper pigtails rather than CO/ALR receptacles. Are you aware that code now requires "tamper resistant" receptacles in many places? Do these even come in CO/ALR?
Comment: Is it not stamped on the receptacle or in the instructions?  "Labeling and instructions" are essential, see NEC 110.3b.
Comment: Not on the one I have. Came in a plastic bag, Leviton #12650. I think I saw them available in boxes too. Perhaps instruction sheet will be included. Think I will check next trip to the store.
Answer: I think you're confusing Alumi-conn connectors (which do have a recommended torque) with CO/ALR. A normal CO/ALR outlet simply needs to be hand tight. I've never seen any specification listed for torque, nor have I ever needed to use my torque screwdriver on one.
Leviton's CO/ALR installation instructions do not list a recommended torque.
Answer: If you need a number, use 14 in-lbs
According to this 2013 IAEI Magazine article on the UL 498 test battery, when UL is wiring up receptacles during the testing they perform to qualify a receptacle design for the UL listing mark, they torque the receptacle screws to 14 in-lbs, nominal.

CO/ALR Outlet Wire Mount Screw Torque


Ejabberd and jwchat configuration

Question: On Leap 15, I have installed the latest version of ejabberd, and have tried to install jwchat. But ejabberd now uses yml files, and none of the jwchat tutorials use yml files, but I have tried to make the connection.
My question is what in the setup (using ejabberd as the server, and not apache) determines the web url for the chat? site:5280/web/jwchat/index.html gives me a 404.
Some tutorials have a line that I think would translate at
"/web": mod_http_fileserver
but this does not seem to matter. Since jwchat is in /var/lib/ejabberd/www/jwchat, where does the "web" in the URL come from?
I get nothing in the webaccess.log file, and the main log file says it accepts my connection to 5280.
How do I get jwchat to serve pages?
Answer: With this example configuration:
<code>listen:
  -
    port: 5280
    module: ejabberd_http
    request_handlers:
      "/jjj": mod_http_fileserver

modules:
  mod_http_fileserver:
    docroot: "/var/lib/ejabberd/www/jwchat"
</code>
Let's imagine you have installed JWChat in the path you mentioned. Then, the local file at location

/var/lib/ejabberd/www/jwchat/index.html

will be provided when you visit the URL:

http://localhost:5280/jjj/index.html
Comment: Thank you, thank you. It would be great if there were some comments in the yml file about this. But, it is still not quite working. I have it on a host with a dynamic dns address. If I add its internal ip address to the yml file, and use
Comment: But, it is still not quite working. I can log in, and the windows pop up. But I do not see any of the people using xmpp clients. Nor do I see buddies. Using pidgin, I did not have to "add" them to see them. All users are visible to everyone. Any ideas? Thanks again.
Comment: I tried both bind and polling, but still no window content. I also tried adding users, but they get no authorization requests.
Comment: Now I get service unavailable message in the pop up window. Do I need to comment out the ejabberd_service stanza in ejabberd.yml? If so, how should it be configured for jwchat?
Comment: The docs say "If HTTP Polling is enabled, it will be available at http://server:port/http-poll/. " So in this case, how does one access the jwchat pages? localhost:5280/http-poll/web/index.html does not work.

Ejabberd and jwchat configuration


Value of placement services for non-members

Question: I am curious about what people think about value of limited period (typically, a year) placement services, provided by academic professional organizations, such as Academy of Management. For example, see this page. In particular, I am interested about the subject in the context of first-time academic job seekers, like me, targeting junior faculty or, more likely, postdoctoral opportunities. The reason I am asking this question is to determine the value and feasibility of those time-limited placement services, considering the availability of nice and free resources, such as HigherEdJobs.
Comment: It looks like the service provided by this organization is to post your anonymized resume on their web site for a fee, wait for employers to read the resume and contact the organization expressing interest, and then put them in touch with you.  I have some trouble believing that search committees are spending time trawling sites like this to try to recruit viable candidates.
Comment: @NateEldredge: Thank you for the comment. I was also not sure about feasibility of using such services, considering the existence of unrestricted outlets, like HigherEdJobs - hence my question
Answer: For industry jobs recruiters are very important for a first time employee seeking contract work.  However for academic jobs I doubt they're of any use.  Like you said there are academic job sites like Higher Ed.  Each discipline also usually has a career website.
If you're looking for postdoc positions your advisor is the best resource because many are given out by word of mouth alone.  Finally each institution is usually required to place job announcements and applications on their HR's web page.  So spend some time going to each University's website.
Comment: I strongly second this comment. Academic jobs are severe buyers' markets. Any attractive position is likely to have dozens, if not hundreds of well-qualified applicants banging down the doors. Committee members simply have no need to go casting around to get larger applicant pools.
Comment: Thank you, Mark and @shane (+1 to both), for your insights. I agree with you. I was skeptical about such service(s), but just wanted community's confirmation of my thoughts.


Jquery Onclick and reference to the object clicked

Question: I've got the following jQuery expression, Inside the function I need a reference to the object that was clicked, is there a way to do this?
$('#tagList li').click(function() {
  /* contents */
});

Answer: Use $(this)
Answer: you can use the return value
$("#tagList li").bind("click", function(e) {
    alert(e.currentTarget + ' was clicked!');
});

or if you want, you can simple point to the object in jQuery mode
$("#tagList li").bind("click", function(e) {
    alert($(this) + ' was clicked!');
});

if you're new to jQuery, I strongly suggest you to see some screencasts from Remy Sharp in jQuery for Designers, they are great to understand a little bit of how jQuery works, and better yet, how to use the console.log() in order to see the objects that you can use!
Answer: Yes, the this keyword references the DOM element that was clicked.  You can "wrap" it like this:
$(this)

This will allow you to treat it as a jQuery object.
Answer: The this keyword is what you are looking for. Often you will want to apply the jQuery function to this to do your job. Example:
$('#tagList li').click(function() {
  $(this).css({ color: 'red' });
});

Answer: Adding a new answer that will cover more use cases, specifically when you want to use arrow functions.
It's also recommended that you don't add a JS click to an li element. Instead you should use a button or anchor (something clickable) nested inside this element.
Since the element that you click could be a child, you need to make sure you target the correct element.
In my example, I will be assigning the click to a button inside the li as well as a class on it. The markup will simply be:

<button class="tag-button">Tag 1</button>

Then the javascript:
$('#tagList li button.tag-button').click((e) => {
  const thisButton = $(e.target).hasClass('tag-button')
    ? $(e.target) : $(e.target).closest('.tag-button');
  // do something with thisButton
});

This ensures that you are targeting the element that the click was registered on. If you have any nested markup inside your button (such as  or ) then it is possible for the event target to be the nested element rather than the element you wanted to assign the click to.


Can multiple transaction be on the same block?

Question: It seems like multiple transaction can be grouped under the same "block" number?
Answer: Yes, that is correct. Blocks are not singular transactions, but a set of transactions. The amount of transactions included depends on the size of the block and the time (average block time is 15 seconds).
Answer: More detailed explanation can be found here

Ethereum has a gas limit rather than a block size. The gas limit is a cap on both processing and storage/bandwidth because the cost of a transaction/function is fixed in units of gas for each type of instruction.
The gas limit is voted up or down by each miner and each miner
  determines what gas price it is willing to accept which is like
  bitcoin transaction fees but on a per gas basis rather than a per
  transaction basis.
Here is a chart of some gas related data To figure out how many
  transactions can fit in a block you dont need to know what the price
  of gas is. You just need to know how much gas a transaction uses and
  divide the gas limit by that.
If the network receives a load of spam transactions that start filling
  up blocks then miners have 2 choices. They can vote up the gas limit
  to fit in more transactions or they can start increasing the gas price
  and reject transactions that pay too low a fee. Like with bitcoin a
  transaction with a low fee might still get through but it would have
  to wait until a miner that accepts a lower fee (lower gas price) is
  willing to let it in.
With a sustained spam attack it would just getprogressively more
  costly to do transactions until either the spammer runs out of money
  or the miners make so much money that they start expanding the network
  capacity...


Find surface area of part of cylinder.

Question: I ran into trouble when I'm trying to find a surface area of parts of the cylinder $x^2+z^2=4$ bounded by another cylinder $x^2+y^2=4$, I simply used a traditional way of double integral, change into polar coordinate calculate
$$
\iint\limits_{x^2+y^2=4}
  \sqrt{\left(\frac{\partial z}{\partial x}\right)^2+
        \left(\frac{\partial z}{\partial y}\right)^2+1} \,dx\,dy
 =
\int_0^{2\pi}\int_{0}^{2} \frac{2r}{\sqrt{4-(r\cos\theta)^2}} \,dr\,d\theta
$$ and eventually this integral diverges. Could anyone tell me where I was wrong ?  thanks a lot.
Comment: It doesn't seem like it diverges. Eventually you get something that looks like $$4\sec^2\theta(1-|\sin\theta|) = \frac{4}{1+|\sin\theta|}$$ which has no singularities anywhere. The key is that you get a difference of two diverging things, which if you separated them out before evaluating limits, is not allowed to be considered separately.
Comment: Why not parametrize the surface of the cylinder in cylindrical coordinates to start with? (Also, please don't use the differential geometry tag if you don't know what it means.) :)
Comment: I'm sorry if I abused the tag of differential geometry. I just thought it can be counted as an elementary-level or introductory-level of Differential geometry problem(curves and surfaces), and thanks for the correction and comment, I cannot just other kinds of parametrization since it has such a requirement.
Answer: Per my comment, the integral simplifies down to
$$\int_0^{2\pi} \frac{4}{1+|\sin\theta|}\:d\theta$$
after doing the $r$ integral. The easiest way to compute this integral then would be to exploit symmetries
$$ = \int_0^\pi \frac{8}{1+\sin\theta}\:d\theta = \int_0^\pi \frac{8}{\cos^2\left(\frac{\theta}{2}\right)+\sin^2\left(\frac{\theta}{2}\right)+2\cos\left(\frac{\theta}{2}\right)\sin\left(\frac{\theta}{2}\right)}\:d\theta$$
$$= \int_0^\pi \frac{8}{\left[\cos\left(\frac{\theta}{2}\right)+\sin\left(\frac{\theta}{2}\right)\right]^2}\:d\theta = 16\int_0^\pi \frac{\frac{1}{2}\sec^2\left(\frac{\theta}{2}\right)}{\left[1+\tan\left(\frac{\theta}{2}\right)\right]^2}\:d\theta$$
$$ = \frac{-16}{1+\tan\left(\frac{\theta}{2}\right)}\Biggr|_0^{\pi^-} = 16$$
And then the final answer for the problem would be $32$, doubled to account for both sides of the cylinder.
Comment: @Sebastiano because in very general terms, integrals don't care about the action of functions at specific points, they care about the limits to specific points (if you have a finite number of discontinuities, this disclaimer is necessary to make that broad statement). Here, the limit we care about is from below.
Comment: thank you very much, sir. it does requires a little analysis near infinity which I might ignore.
Comment: Why do have you chosen upper bound $\pi^-$ instead of $\pi^+$?
Comment: I believe this is the right choice since we are actually evaluating this in the interval [0,/2),  I figure out that it can also be done by dividing cos at the beginning by changing the definite integral to improper integral to find a trick-less solution.
Comment: Thank you very much. I have before upvoted your answer. Best regards.
Answer: Easier to keep this in rectangular coordinates.
Limits
$x^2 + y^2 = 4\\
x^2 + z^2 = 4\\
y^2 = z^2\\
y = \pm z$
This suggests that integrating with respect to y and z makes more sense than integrating with respect to x and y.
$x = \pm \sqrt {4 - z^2}\\
dS = (1, - \frac {\partial x}{\partial y}, - \frac {\partial x}{\partial z})\\
dS =(1,0, -\frac {z}{\sqrt {4-z^2}})\\
\|dS\| = \frac {2}{\sqrt {4-z^2}}$
$4\int_{0}^2 \int_{-z}^{z} \frac {2}{\sqrt {4-z^2}} \ dy\ dz$
we are multiplying by 4 because over the triangle in the yz plane, there is a surface above the plane and a complimentary surface below the plane.  There is then an identical surface that appears when $z < 0$
Comment: thanks, it's also very helpful

Find surface area of part of cylinder.


How to see the version of the TAP file

Question: This is a telecom based query.
we receive TAP files from the clearing house.
i want see on unix which version of TAP does it belong.
how can i do it.Isthere any tool to find the TAP file version?
Answer: Try  tap3Editor its very easy to use as well do lots of other features apart from printing the version of the tap files.

How to see the version of the TAP file


Kali Linux: from light to full distro

Question: Is there a way to go from Kali light distro to full? Which packages do I need to install?
Answer: The sets of packages installed for the various flavours of Kali are defined in live-build-config. In this instance you need to look at the set of packages in Kali light and packages in Kali full: the latter adds kali-linux-full and kali-desktop-gnome.
So to get all the utilities installed in Kali full:
sudo apt-get install kali-linux-full

If you want to install the GNOME 3 desktop used by default in Kali full:
sudo apt-get install kali-desktop-gnome

If you want to uninstall the XFCE desktop used by default in Kali light:
sudo apt-get purge kali-desktop-xfce

You can use the full set of utilities from the XFCE desktop, so you may want to try out the various possibilities before uninstalling anything.
Answer: According to this question the Light distro has a lighter desktop environment and fewer packages. To go to the 'full' one, I would guess you just apt-get install the ones you need to use.
Comment: @Skrrp Yes, XFCE is worth trying; I mentioned removing the XFCE meta-package because Kali full doesn't install it by default, that's all (so strictly speaking to get a setup identical to an initial installation of Kali full it needs to be removed).
Comment: As a respectful counterpoint to @StephenKitt, you may not want to remove `kali-desktop-xfce`. My personal preference at the moment is LXDE but there's nothing wrong with XFCE as an environment. I find LXDE and XFCE to be faster and just as capable as full Gnome or KDE. I don't want to spawn another instance of the desktop wars debate here, but play with them; find out which desktop works for you.
Comment: @StephenKitt I understand your explanation.
Comment: @StephenKitt Here you go. Thanks again. @ Skrrp i follow your suggestion for sure (also Gnome is another 900mb to download ;))
Comment: @FedericoPonzi unless you are paying per MB download, there is no reason to not download. Gnome and KDE are for sure 'easier' environments to use, XFCE and LXDE are for sure 'lighter' environments. If you're unrestricted by cost then try them all.
Answer:
Thanks! But which packets do i need? – Federico Ponzi Aug 12 at 14:21

I thinks that depend on what you use kali for.
If you use kali for wifi cracking you may need to install aircrack-ng, hashcat and others driver for monitor mode.

Kali Linux: from light to full distro


SOAP RMI C++ - Java & C++ communication

Question: Can you please advice with an example of using SoapRMI-C++ to send/receive objects between C++(top) and Java(bottom) layers of an application.
Please let me know its feasibility and implementation complexities.
Thanks,
Gtk
Answer: Don't.  Use something like Protocol Buffers.
Soap is verbose and slow.  And RMI leads to poor program design when messages that would've taken nanoseconds to send instead become messages that take microseconds (if the two programs are on the same box, or maybe on the same LAN) or even milliseconds to send.  And it's imperative nature also tends to encourage designs in which the client and server depend on each other's state in a fairly intertwined way, just like the caller and callee do when making an ordinary method call.  It encourages the size of the state horizon to encompass the end-to-end latency of the client talking to the server which can greatly slow it down and lead to errors.
Use techniques in which the message passing is explicit and that encourage you to focus on the data being passed over the operation that is to be performed by the remote side.  Again, this points to a solution like Protocol Buffers.
I wrote a paper a long time ago on why RPC (and by extension RMI) was a bad idea.  In it I single out CORBA, but most of my arguments apply to almost any form of RPC.
Additionally, the existence and popularity of languages like Erlang show that explicit message passing is good even for communications between different threads on the same CPU where latency and network delays are not an issue.  This is because it greatly decreases the coupling between threads.  Threads no longer have to agree to always acquire a mutex before doing certain things or anything like that.  An individual thread's state horizon no longer encompasses that of the other threads on the system.   It also reduces synchronous behavior in which several threads want control over the same mutex or piece of shared state.

SOAP RMI C++ - Java & C++ communication


Do item frames and the items they contain prevent/reduce creeper blast damage?

Question: I just had a creeper blow up in my house and the house seemed to suffer almost no damage (a few wooden wall and floor blocks broken). Only the 16 item frames and items they contained, which were all side by side in a 4x4 pattern on the wall next to where the creeper exploded, were all left broken and floating nearby. So I was wondering, do item frames and the items they contain act like "ablative armour" and absorb the shock of the explosion or was it just weird luck that my house wasn't destroyed (the walls and floor are all wood and glass).
Answer: No, I don't believe so. All items in item frames will be dropped (Popped out of their item frames) and have the same Blast Resistance.


Torchlight 2 - Does Focus affect skills which has elemental components?

Question: Does Focus adds to damage from elemental skills, such as the Berserker's Shadow Burst or Frost Breath?
Comment: I know focus affects stuff like "+50-60 poison damage", but I'm also curious if it affects the "50% of weapon dps as poison damage" kind.
Answer: Yes.
If a skill says deals X amount of Y as Ice/Fire/Poison/Shadow damage or just plain: deals X amount of Ice/Fire/Poison/Shadow damage your Focus stat will be used in the calculation of your damage.
So if you're going to use a lot of skills that mention Elemental Damage, it makes sense to invest in the Focus stat. Even so, my Outlander uses only skills with elemental damage and only has Focus points invested.
It's also easy to verify this (if you don't mind using the console on a test character).
Just use Frost Breath on the dummy, my level 2 hit for about 6 damage on average. I then gave him 200 more Focus (= 100% more elemental damage) and he hit for about 12 on average.


De-Authorise iTunes account on my 3 stolen PC's

Question: I have had 3 PC's stolen during a break in. How can I de-authorise my account on these without access to them ?
Answer: Follow these instructions from Apples Knowledge Base:

Click iTunes Store on the left side of iTunes.
If you're not signed in to the store, click the Account button, then
  enter your account name and password.
Click the Account button again (your Apple ID appears on the
  button), enter your password, and then click View Account.
In the Account Information window, click Deauthorize All. *

Note: You may only use this feature once per year. The Deauthorize All
  button will not appear if you have fewer than two authorized
  computers. If you need assistance on using this feature, please
  contact iTunes Store support via email
  (http://www.apple.com/support/itunes/store/).
Answer: You can use the Deauthorize All button.


Redefining nodata value into zero in QGIS

Question: I have an image which I clipped with an AOI polygon. The contour area was set to pixel value = 0 and I have a nodata value of -32768. I want to redefine the nodata value into zero. I used to do this with ArcMap easily in the raster calculator, but in QGIS I don't see how I could do it. Any ideas?
Comment: Do you want it purely for visualization or you need to set it to null wherein you will conduct further raster calculations?
Answer: In QGIS, you can use Raster Calculator with the following calculation:
("your_raster" != -32768) * "your_raster"

With this calculation, if the cell value is -32768 you will get a 0 in that cell and if it is different from -32768 the cell will keep the value it had.
Comment: Note that this does not work for values like -3.40282e+38.
Comment: Nice solution.  Just a note for others trying this: In QGIS, the nodata value for a layer can be found under the layer Properties, then Information (top item), then scroll down to Bands.
Comment: you can define/redefine the nodata value through raster tools/conversion/translate. I've found this to be a good workflow step when using the raster calculator. The other useful step is right-click/export. in this step, you can set pixel values to nodata (Tick the nodata option: add a nodata category: leave 'from' blank, and set 'to' to 0). this does work with values like -3.40282e+38.
Comment: This should work, but doesn't for me! My values are either 1 or "no data." The "no data" values are reported as "n/a" in the properties but "no data" via the identify features tool. No variation seems to make the calculation work (i.e. "n/a", "no data",  !=1, etc). I can't get the "no data" values replaced either. Pain!
Comment: First use Raster/Conversion/Translate to specify a different no-data value, then use Egidi's answer with the original no-data value.  Otherwise the tool skips over the no-data values in the calculation.
Comment: I tried this solution, and QGIS just kicked my nodata value to a different number
Answer: The simplest one-step and, IMO, most consistently reliable solution to reclassifying NoData to zero is to use the Reclassify Grid Values tool (SAGA) in the processing toolbox.
After selecting the raster to be reclassified, simply scroll to the bottom of the dialog, ensure the box replace no data values box is checked.  The default value is zero (but you can substitute something else of course).  Then uncheck the replace other values box and leave all other fields alone (so all you are doing is ensureing one box is checked and unchecking another - no other settings are required).
Comment: I agree. Nothing else really worked for me (my nodata value was something like -3.4e+38).
Comment: Unfortunately this method no longer appears to work in QGIS 3.8. The processing form will not execute without tweaking all of the other settings. Error: "Wrong or missing parameter value: ...."
Comment: for QGIS 3+ select ```SAGA=>Raster tools=>Reclassify values (single)```
Comment: Had exactly the same problem as @ArMoraer. This was the easiest solution, worked perfectly.
Comment: I fixed the nodata to 0 value issue, but by the mean time it applied little changes to my other raster values
Answer: I found a solution for this. First I convert the image into a vrt layer (gdalbuildvrt) with -srcnodata 0, then I translate it back into a tif file with gdal_translate -a_nodata.
Worked fine!
Answer: I guess you can do that with the raster calculator.
If not with the help of GRASS plugin and r.null you will do it easily.
That option means you will have first to create a GRASS mapset to import your raster in.
Comment: could you elaborate on *how* to do that with raster calculator?
Comment: `r.null` did it for me.
Comment: Agreed. This is a simple solution in QGIS for replacing nodata with values and vice versa.
Answer: Having the same problem, in the end I used Python directly -- you may have to adjust numpy.where for your specific purpose. In the case below, the pixel values are kept as they are if they are >= 0, all other pixels -- in this case this is only ones with the no-data value -- are set to "0"
import gdal, gdalconst, numpy
maskfile = gdal.Open('C:\Users\max\Desktop\Baltic2.tif', gdalconst.GA_Update)
maskraster = maskfile.ReadAsArray()
maskraster = numpy.where((maskraster >= 0), maskraster, 0 )
maskband = maskfile.GetRasterBand(1)
maskband.WriteArray( maskraster )
maskband.FlushCache()

Answer: For QGIS 3.28 there is a "Fill NoData cells" tool under Raster tools
Comment: This answer should be up voted as of today it is the easiest and best one
Answer: For python script you can use the following line before WriteArray.
maskband.SetNoDataValue(0)

Answer: I had a similar problem but in my case, the original raster had no data as no data.
So, at first, I tried using the following approach but didn't work fine because gdal.open procedure read my no data  as 255.
ds_Raster = gdal.Open(PathRaster)
if ds_Raster is None:
    print('Could not open', + ds_Raster)
    sys.exit(1)

##  **Raster Georreference**  #
geotransform = ds_Raster.GetGeoTransform()
wkt = ds_Raster.GetProjection()
Raster = ds_Raster.GetRasterBand(1).ReadAsArray()
Raster[np.isnan(Raster)] = 0

So instead of use, Raster[np.isnan(Raster)] = 0 I had to use the following comand which worked fine
Raster = np.where((Raster != 255), Raster, 0 )

Answer: I have tried using both rastercalc plugin and Raster Calculator and neither worked - Syntax error.  What did work was the Warp tool and specifying the source and destination nodata values (see underdark's answer to a similar question How to exclude missing values from raster layer?)
Answer: What worked for me was exporting the raster as .asc file, then opening in a text editor and using find and replace to replace the old NoData value with the value that I wanted.
Answer: In my case, it was a satellite image I needed to convert to 8 bit and it kept outputting no data values when using -scale in gdal_translate.
I was able to solve the issue by exporting the raster(right-click layer -> export -> save layer as...) to a new file as rendered data (checkbox at the top of the dialog window).
Answer: An other solution is to use the "Reclassify by table" in the processing menu. With it you can reclass your input pixel with the -32768 nodata value to 0 and set the output nodata to 0 in the advance parameter.
Answer: I ended up using python3 and the rasterio library, to change nodata into 0.
import rasterio
x = rasterio.open('./Venice_Combined.tif',"r+")
data = x.read()
data[data == x.nodata] = 0
x.write(data)

It would be prudent to make a copy of the input file before doing this because it overwrites the original.
Comment: I think you need to open it with read-write permissions. Did you include the "r+" part?
Comment: to note: the XML file is updated rapidly, but for some reason the tif file updates about 1 minute later after the code has finished running. But to me, this is the most straight forward method.
Comment: [AttributeError: 'DatasetReader' object has no attribute 'write']-----I am getting this error for "data[data == x.nodata] = 0"
Answer: A previous answer by @simo suggested to use GRASS r.null.
My "no data" value was set to -9. To get r.null to work for me I had to first run r.null to set -9 as "NULL", and in a second step again run r.null to replace the NULL value with 0. My resulting raster has all pixels defined (STATISTICS_VALID_PERCENT=100), the new minimum is 0, and the maximum is the same as in the original raster.
Answer: To replace the "-3.4028230607371e+38" value with "no data", I used Raster Calculator with the following expression:
( "myraster" )  /  ( "myraster" > 0 )

I guess you can change the 0 value to your convenience....
Comment: For me this replaced everything less than 0 EXCEPT "-3.4028230607371e+38" with the value "-3.4028230607371e+38"
Answer: After trying many of the suggestions mentioned above, I found a simple solution which worked for me in QGIS 3.20.1, with a NODATA value of  -3.40282e+38. I could not get the normal raster calculator method described in other answers to work.
However, using the gdal raster calculator in the Processing Toolbox (gdal_calc), I was able to do this with a calculation of "greater(A ,0) * A" and adding the command line parameter "--hideNoData". The calculation causes anything 0 and under to become 0, and the command line parameter hides the no-data from the script so it's calculated as a regular number.


What is the sedimentary form of gabbro/diabase? What would it look like?

Question: Gabbro is an intrusive, mafic, and igneous rock. How would it turn into sedimentary rock?
Answer: The only way for any igneous rock to transform into sedimentary form is through erosion, grain by grain. It won't be done en masse. The most easily erodible parts will dislodge from the surface first.
When the grains have deposited into a sedimentary bed, over time, they will just be grains of minerals. If there are other forms of igneous rock nearby and they erode into the same bed, over the same period, no-one will be able to distinguish a gabbro portion from another host rock portion.


ElasticSearch 6.4: no master re-election until node restart

Question: I'm experimenting with a cluster of two master-eligible nodes (node30, node207) and I noticed that master re-election process doesn't start unless I restart the non-master node.
Below is my node elasticsearch.yml (the second node - node207 - has a similar one, with a different node.name only):
    network.host: 0.0.0.0
    cluster.name: mycluster
    node.name: node30
    discovery.zen.no_master_block: all
    discovery.zen.ping.unicast.hosts: ["node30", "node207"]

Here's my scenario:

Start both nodes and node30 becomes a master node. Cluster health shows two nodes in a cluster.
Disable TCP ports 9200/9300 on node207. There are networking errors in node207 logs. No master is visible.
According to documentation - https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-discovery-zen.html - after 3 retries (ping_retries) node207 should elect itself as the new master (discovery.zen.minimum_master_nodes is 1 by default). This never happens.
Restart node207. After several failed attempts to ping the old master (node30), it will elect itself as a master.

Without restarting, master re-election is not happening.
Is it expected behavior?
Answer:
discovery.zen.minimum_master_nodes is 1 by default

This is a misconfiguration. You must set discovery.zen.minimum_master_nodes to 2 since you have two master-eligible nodes.


How to export from ASP.NET to Powerpoint 2007?

Question: I'm working on a project that I'm trying to export data from textboxes in asp.net website project to a powerpoint file. I writing ofcourse in C#.
The whole concept is to use the data the a user inserts to the text boxes and they are sent after clicking a OK button directly to a powerpoint file. I'm using OFFICE 2007 so I'm using powerpoint 2007 for this.
A similar concept that I'm already using in the website project is doing the same thing but exporting to a WORD format file. I bumped against this following site a software to perform this and it's called: SoftArtisans. There website is http://www.softartisans.com/ .
Now, if somebody has a clue or a tutorial how I can do this, Export to a powerpoint file I'll be very thankful.
  I am also using Microsoft SQL Server 2008 R2 to save the data in the database, so if maybe someone knows how to export the data from the textboxes from the website TO the database and then TO the powerpoint file that could help to.
Thank you very much for your help and support.
Answer: I would suggest using Office XML
HTH