Choosing Voltage Divider Resistor For LDR

Question: I have a 2Mohm dark resistance LDR and i'm wondering what would be the best choice for the fixed resistor. If I made it too large then it would be very insensitive and if I made it too small then it would be very sensitive and draw more current which I heard can create more noise on the MCU ADC. What would be a good value to use ?, would 10k be fine ?
Comment: 10% of dark for sensitive threshold for dark level.
Comment: Do you want to just have a digital input used? Or are you preferring to use an ADC for this?
Answer: There are a number of approaches.

Use the ADC together with the LDR and a capacitor and a way to reset the capacitor voltage, then gather many samples used to work out the exponential decay slope by linearizing the data and then using a least squares fitting (LSQ} routine to work out the slope and therefore the \$\tau\$. Doing so will require you to work out the offset (and subtract it) prior to performing the logarithm. Also, this requires a different treatment of the noise at low ADC values vs high ADC values, because there is a difference in influence of noise at low ADC values vs high ADC values and the typical LSQ fitting algorithm. It can be done, but it is complex to get right.
Use a resistor divider. The price here is that the ADC values will bunch up on one end or the other of the ADC range, as the LDR goes over two to three order of magnitude change from light to dark. Working out a good approach here, together with the needed hysteresis, can itself be tricky. It's workable. But it poses difficulties, too.
Use an opamp and a BJT to perform a logarithmic function to linearize the range. This works and provides a nice, linear voltage span over which the ADC operates while the LDR transits over its up-to-3 orders of magnitude change. But it means an opamp, of course.
Go digital. Here, you design an analog circuit that provides the needed hysteresis and generates a digital output that is easily read by a digital input of an MCU.

I'm sure there are many more; as many as the imagination can create, in fact. But the above provides a quick overview pointing out that there are many ways to solve problems. You just have to pick your poison and go with it.

Here, I'll give you two different ways to approach this, both of which generate a digital output with hysteresis. Neither of these require an ADC. To start, both the left and right schematics are symmetrical and balanced. We'll need to add some positive feedback to produce the hysteresis to both. But for now, it's enough to just get the basic ideas:

simulate this circuit – Schematic created using CircuitLab
The left side is kind of like a flip-flop. The right side is more like a differential amplifier (long-tailed pair) and should be seen as a kind of teeter-totter that can tilt to one side or the other.
This leads to two different ways to add in the LDR:

simulate this circuit
The difference between them is just 5 resistors vs 6 resistors. The one on the left provides a clean output that spans the full range of the supply rail voltage. The one on the right provides a fairly clean output but it won't reach the supply rail. Either works fine. But the one on the left is probably better for a simple digital output and it uses one resistor less than the other. So probably better, overall, for something like this.
Using a simple digital I/O pin also saves you from messing around with an ADC. It's very cheap and easy to use (though not as cheap if you already have an extra ADC that isn't being used.)

So, using the left side circuit, it accepts an LDR and provides hysteresis. The circuit here is based on \$V_\text{CC}=5\:\textrm{V}\$ and will become active when the current rises above \$40\:\mu\textrm{A}\$ (when the LDR drops below \$100\:\textrm{k}\Omega\$) and will stay active until the current drives below \$15\:\mu\textrm{A}\$ (when the LDR rises above \$270\:\textrm{k}\Omega\$.)

simulate this circuit
Adjust \$R_5\$ to change the hysteresis -- a little lower or higher will be fine.
If you are using \$V_\text{CC}=3.3\:\textrm{V}\$ instead, change \$R_1\$ and \$R_2\$ to \$120\:\textrm{k}\Omega\$ and then adjust \$R_5\$ to suit your hysteresis range.
It has very nice, clean hysteresis and provides a very simple digital input value. And you can easily test it separately, using a voltmeter to measure the IO PIN output, before you commit yourself to something with the micro.

The alternative is that you use the ADC and set up a divider, like you mentioned. Or consider the ideas that Tony has suggested.
Answer:
10% of dark for sensitive threshold before dark level
or 5% of dark for sunrise detection
or 1% for bright light.
These are just educated guestimates.

To correctly choose the best R, determine what comparator threshold or midpoint for an analog amp, the median LUX level you expect to see then I*R=Vthreshold to choose an R value.
1st define the task of the LDR , then the ambient light , thus Current then the R to determine the midpoint V or V threshold.
A photo diode is more accurate but gives less current and needs an Op Amp or transistor for gain.
I prefer the 5mm Panasonic Light sensor.  It is accurate , cheap and only needs a 3 terminal LDO, load R and cap.  and a comparator to accurately measure LUX threshold. It can be used as a LUX meter for a camera for example or a regulator for MPT control of a PV array to determine the optimum PV voltage as a current
source. The Voltage is chosen by Light current and Load R is far more accurate than an LDR.
Unlike an LDR it has 3 1/2 decades of light range with high consistency between devices.

But then if you have an LDR use it with 100k for now.
http://www.digikey.com/product-detail/en/panasonic-electronic-components/AMS302/255-2655-ND/2125641
Comment: The problem with 3-4 decades of current range will be in arranging the ADC to handle it well. It was a pain handling 8 decades on a Hamamatsu (from below \$100\:\textrm{fA}\$ to \$7\:\mu\textrm{A}\$ max when some of the IC aluminum traces on the Burr Brown IC would start to migrate from the current.) Wonderful devices, of course. But a handful of decades is not entirely trivial.
Comment: Agreed. I found some problems with Mil-Std-883B old BB ADCs which had Agnd shift from Dgnd current causing deadspots on a 12 bit ADC.  while most log amps on SA's have greater range. meanwhile this student is just trying to make something like a Night Lite and just needs to know the Ambient Lux level to determine the uA level amd comparator threshold to choose R within 1 decade of current range. definitely trivial.
Comment: I couldn't use log amps as they weren't _linear_ enough in their logarithmic responses. We were providing pyrometry and required accuracy figures of \$50\:\textrm{mK}\$ after calibration with NIST traceable standards and repeatability between instruments about 10 times better than that. Over 8 decades! Expensive equipment. But uniquely good, too. Also had to be conscious of leakage -- the usual epoxy IC packages leak too much, pin to pin, even clean as a whistle. \$10^{11}\Omega-\textrm{cm}\$ isn't good enough.
Answer: The choice of resistor depends on the resistance of the sensor at the range of light you care about.  If you are using the LDR as one resistor of a resistor divider, you get the most sensitivity at the light level where the two resistors are equal.
If you're worried about too much current draw, then consider sampling the sensor only occasionally.  You don't say what the application is, so we have no way to know if this is appropriate.  Drive the high end of the resistor divider from a digital output.  Turn this on just long enough to take a A/D reading, then turn it off again.  Let's say you sample the light level 10 times per second, and that it takes 20 µs each time.  That means it will be powered up only 0.0002 of the time.  Even if the sensor took a whopping 1 mA when on, the average current draw would be 200 nA.


usbtmc0 device: how to change default behaviour

Question: I have a PM100D powermeter device from Thorlabs.
The problem I encounter is, I would like to communicate with it through writing and reading from the node file in /dev.
I tried doing this in ubuntu 16.04 previously, and I therefore created an appropriate udev rule that would make me owner and groupowner of the created node. However, this was leading nowhere, as I then could never write anything into the created node in /dev. I should say in ubuntu, somehow the system never created a usbtmc0 for me, it just created the node somewhere in /dev/bus/usb/xxx/yyy
When i tried doing the same writing and reading commands in Debian, it all worked fine. I now understand that the reason why is because i'm actually writing in /dev/usbtmc0 which is automatically created when i plug my device from Debian, but it did not in ubuntu. the node which was created in ubuntu, in the form /dev/bus/usb/xxx/yyy is created also now: therefore i have somehow both /dev/usbtmc0 and /dev/bus/usb/xxx/yyy being created when i plug my device in Debian. Again, if i try to communicate with the usbtmc0 node, all goes fine, but if i try to communicate through the xxx/yyy node, the writing goes wrong (i get a "OSError: [Errno 22] Invalid argument" from python).
When plugged and unplugged in ubuntu and debian, i checked in each case that the module usbtmc was loaded, and it was loaded at plugin-time in each case (i made sure of that by first removing the module and then plugging the device, and after that, i checked that the module was loaded back)
So i suppose my question is double:
1) how could i change the default behaviour of node creation from usbtmc? that is, specifically in Debian, the node gets created for the root user, except i'd like to make my python script work for anyone on the computer. I can't quite seem to make udev help me here, because i don't seem to control the creation of usbtmc0. Any ideas?
2) is there a way to force usbtmc to create a node in ubuntu 16.04? it does not do it by itself, though it does with debian 9. also, somehow, on my computer, dmesg does not warn me about the creation of usbtmc0 node, whereas it does on another computer
[Mon Mar 12 16:26:55 2018] usb 3-1.6: new full-speed USB device number 15 using ehci-pci
[Mon Mar 12 16:27:00 2018] usb 3-1.6: New USB device found, idVendor=1313, idProduct=8078
[Mon Mar 12 16:27:00 2018] usb 3-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Mon Mar 12 16:27:00 2018] usb 3-1.6: Product: PM100D
[Mon Mar 12 16:27:00 2018] usb 3-1.6: Manufacturer: Thorlabs
[Mon Mar 12 16:27:00 2018] usb 3-1.6: SerialNumber: P0016534

thanks very much for your help.
EDIT: as a matter of fact, i can indeed influence the usbtmc0 node with a udev rule, simply with such a line in the /etc/udev/rules.d/10-local-rules file
KERNEL=="usbtmc*", MODE="0666", GROUP="usbtmc"

Answer: A comment: you can also specifically target the PM100 power meters.
(/etc/udev/rules.d/usbtmc_thorlabs.rules)
# Thorlabs PM100USB/PM100D
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1313", ATTRS{idProduct}=="8072", GROUP="usbtmc", MODE="0660"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1313", ATTRS{idProduct}=="8078", GROUP="usbtmc", MODE="0660"


how to install package via composer?

Question: I would like to add library to my drupal 7 custom module. Library can be installed via composer, but i can't find a solution for install? How can i install this library? I have installed "composer manager" but i still can't get it running.
Comment: Disagree with the close vote on this.  How to use composer with Drupal is definitely on topic.
Comment: I would love to know the answer of this question too.
Answer: To get started, add a composer.json file to your module.  The only thing you need here is the require section that includes your external library.
Composer manager is one way to combine all of your dependencies together, but there are other options to get Drupal to load your autoload.php file.  The technique I prefer is to create a project-level composer.json file in your Drupal root, and use the module composer_vendor to include your autoload.php file.
The easiest way to get started is to use the composer_generate Drush extension to build your project-level composer.json file.
$ drush dl composer_generate
 $ cd /path/to/drupalroot
 $ drush composer-generate > composer.json
 $ composer install

Composer-generate will add all of the projects currently used in your Drupal site, plus composer_vendor, so composer install should just work for you.  The main magic here is in the custom autoloaders added to the template; take a look at the output to see what was included.
Some caution needs to be used here, of course; the default template will put all of your modules in sites/all/modules/contrib.  You can edit the template prior to running composer install if this isn't what you want.
You'll also have to be careful if you have any modified modules; there are a number of ways to deal with any hacked content, but that's a bit beyond the scope of this one question.
Update
If you don't want to run Drush, you can also hand-type your own composer.json file using the project https://github.com/drupal-composer/drupal-project.  This is the template that composer-generate is based on.
Comment: we don't use drush. It is about this lib: https://github.com/giggsey/libphonenumber-for-php
Comment: You could install Drush and use it only to download and run the composer_generate tool.  This would be faster than hand-typing your own composer.json file.
Comment: @greg_1_anderson adding on to the main question, how can we load vendor autoload.php for 3rd party api?
Comment: Drupal 8 will load the autoloader for you, so I presume you are asking about Drupal 7. Either use the composer_vendor module I recommend above, or just add the include to your settings.php file.

how to install package via composer?


The associated prime ideals of $Ext^i_R(M,N)$

Question: If R is a commutative noetherian ring, M and N are modules with M finite. It is well known in commutative algebra that $AssHom_R(M,N)=Supp(M)\cap Ass(N)$. But I want to know whether there is a formular for $AssExt_R^i(M,N) ?$ Thanks!
Comment: Are you looking for an equality or would a containment $\subseteq$ be good enough?
Comment: Equalities are going to be hard to find, given that there are lots of examples with, say, even Exts vanishing and odd Exts non-zero.
Comment: @Karl Schwede: An equality or a containment is welcome.
Comment: Pardon my ignorance, but are the associated primes of Ext related to the associated primes of Hom in any way?
Answer: The short answer is no, as hinted at in the comments by Karl and Graham. I would argue that even the question of understanding the minimal primes of $\text{Ext}^i(M,N)$ (which is the minimal set of the associated primes, hence an easier question) is intractable. Let's assume that $R$ is Noetherian and $M,N$ are finitely generated.
Since $\text{Ext}$ localizes, one essentially needs to understand when $\text{Ext}^i(M,N)$ vanishes over a local ring $R$. There is no good answer in general. Even in the very nice case when $N$ is the canonical module (assuming it exists), these $\text{Ext}$ are Matlis dual to the local cohomology modules of $M$, and while there are good bounds on the indices when they vanish (below the depth and beyond the dimension), there are no general result which can tell you exactly when.
Here is one more way to see the complexity of the problem even when $i=1$. Take a free cover of $M$ to get an exact sequence $0 \to M_1 \to F \to M \to 0$. Applying $\text{Hom}(-,N)$ to get:
$$0 \to \text{Hom}(M,N) \to \text{Hom}(F,N) \to \text{Hom}(M_1,N) \to  \text{Ext}^1(M,N) \to 0$$
Assuming some mild condition on $M,N$ (reflexive for example), this shows that the set of associated prime of $\text{Ext}^1(M,N)$ is a subset of the set of primes $p$ such that $\text{depth}(\text{Hom}(M,N)_p) = 2$. Again, this set is not very well understood in general.


Advice on entry form file uploads and S3

Question: Just planning out an entry form that includes a file upload field – an assets field hooked up to an S3 bucket. I see some documentation on entry form assets here, but need some advice on getting this working with S3 if anyone's done this before? Any help very much appreciated.
Answer: This is a great learning resource. Worth the investment, IMO, if you're building a lot of sites with Craft CMS.
https://craftquest.io/lessons/switching-from-craft-local-assets-volume-to-s3


How can I keep food hot for extended periods without an active heat source?

Question: Say I have a hot dish, and I want to keep it hot and safe (i.e. >140F) without any heat source (no electricity, no fire) for as long as possible, say morning to evening, or even over a day. Just using something insulated won't be enough for more than a few hours, so what else can I do?
Comment: This is inspired by [this question](http://cooking.stackexchange.com/questions/59703/can-i-use-cast-iron-on-a-hot-plate) about keeping things hot through the Sabbath, but I can easily imagine having a really long drive or maybe even something like camping, with chilling and reheating on the other end not being an option.
Comment: Okay, mod hat on: if you have something you think answers the question (as a couple people have so far) post it as an answer. Cleaning up.
Answer: The long drive is easy. There are 12 volt cooler/warmers available that would cover that need. But you have to do your homework. I found several that say they heat to 140° F or above, but I did see a couple that don't go over 135° F. There are also reusable hot and cold packs that can be used in an insulated cooler or carrier that will keep food safe for 4 - 6 hours.
There are several other options that could be used for a long drive or camping, etc.

Instant, disposable ice packs or heat packs; don't require a heat or cold source and can be replaced as needed.

Hotpots - Transfer hot food to the hotpot and it keeps hot for several hours.

Hot pot casseroles - Food can be cooked in and carried or stored, staying hot for several hours.

Other ideas for camping:

A chafing dish type setup.
A camping stove.

*Both have certain time limits and shouldn't be left unattended.

If you use the 12 volt cooler/warmer you can plug it in as needed. However you need to be sure that you don't run your car battery down. You can avoid this by running the vehicle while heating/cooling. (Not the most efficient.) Also, in some cars (like mine) the plugs will not work unless the car is on.
Comment: The question stipulates "no electricity, no fire."
Comment: @PrestonFitzgerald The only things in my answer that are flame based would be a heat source for the chafing dish set up or a camping stove. Both are feasible if you know you are going camping. I think all of the others are in line with the "no electricity, no fire" parameter of the question.
Comment: I was just talking about the car. Thought you might have missed it in the OP.
Comment: @PrestonFitzgerald It wasn't in the OP, but in Jefromi's comments below the question he mentions a really long drive or camping as possible situations where you might want to keep food hot for a long period.
Comment: I was trying to avoid things that need plugging in and go for totally passive solutions, but it's not the worst thing to have them also mentioned. Maybe it'd be nice if you reorganized, to put the no electricity no flame things first, and then give the "if you have a car..." and "if you can have fire..." as followups?
Answer: It looks like a popular solution is a good ice chest with heated bricks. I found several variations of this technique on various sites. It's an improvement over simply insulating since you have a lot of additional thermal mass and it's starting out at a much higher temperature.
You wrap the bricks in foil and heat them in the oven (e.g. 30 minutes at 450F) so that they're holding plenty of thermal energy, then line the ice chest with towels to protect it and place the bricks in. You might want another layer of towels around the food too, and you can place additional insulation over the top to fill any remaining space.
Depending on the food, I expect this could actually result in cooking it a bit further, but it'll definitely stay hot a long time. I haven't actually tried this and people's assessments of how long it lasts vary wildly. But given that ice chests can stay cold for a day or two in good conditions, I suspect that if you get the details right, this might well do the same for staying hot.
Comment: Would the ice chest not melt to some degree? I've had some of those 10 gallon water cooler jugs melt with barely 180 F water in them... wouldn't the bricks be hotter?
Comment: @Catija It sounds like people have successfully done this; some of the sites I found it on even attributed it to an episode of Good Eats. Ice chests do seem like stronger plastic than water cooler jugs, but I don't really know exactly how hot they can handle.
Answer: And then there is this one, out of Dutch antiquity. It really, really works.
http://www.rootsimple.com/2011/12/hay-boxes-or-fireless-cookers
Comment: Welcome to Seasoned Advice! Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.


What does proving a subset is a subspace accomplish?

Question: If $V$ is a vector space that has closure properties and satisfies the axioms and $S$ is a subset of $V$, why wouldn't $S$ always have closure under addition and scalar multiplication (which are required to show $S$ is a subspace) because since $S$ is a subset of $V$, doesn't that mean $S$ would have the same properties as $V$?
Comment: So why is the subset $S=\{(1,0)\}$ of $\Bbb{R}^2$ closed under addition and scalar multiplication? It isn't because $(1,0)+(1,0)=(2,0)\notin S$.
Comment: @JyrkiLahtonen that's a nice example. So a subset can contain some elements of the set but is not necessarily a subspace, but if a subset is shown to be a subspace, it's like a smaller defined vector space within the larger vector space?
Comment: Correct. One of the more economical ways of proving that a set is a vector space is to show that it is a subspace of a known vector space.
Comment: @JyrkiLahtonen I understand why a subset needs to have closure properties to be a subspace, and it seems obvious to me that one wouldn't have to validate all the axioms again to prove a subset is a subspace, but I don't have an intuitive understanding as to why that is. Is it because every element of the vector space will satisfy the general axiom proofs therefore the elements in the subset will also satisfy them?
Answer: Take the trivial example of $V=\mathbb R$ as vector space over $\mathbb R$. Take $S$ to be any set other than $\{0\}$ and $\mathbb R$ itself. Then $S$ is not a subspace of $V$.
Proof:
If $S$ does not contain $0$, it does not contain a neutral element of addition (this especially also applies to the empty set). Thus it cannot be a vector space, and in particular no subspace of $V$.
If $S$ contains any $x\in\mathbb R\setminus\{0\}$, but there exists an $y\in\mathbb R\setminus S$, then be $\lambda=y/x\in\mathbb R$. Then $\lambda x = y\notin S$ despite $x\in S$ and $\lambda\in\mathbb R$, therefore scalar multiplication is not closed in $S$. Thus $S$ again is no subspace of $V$. $\square$
Answer: No, because it could be that $v, w \in S $ but $v+w \not\in S $ or $\lambda v \not\in S$.
Note that you have to prove both closure properties: one does not entail the other.
Here are some examples:
Take $V = \mathbb{R}^2 $ . Now, $ \{(x,y)\in \mathbb{R}^2 \vert x\in \mathbb{Z},   y\in \mathbb{Z} \} $ . This subset is closed under addition but not under scalar multiplication (for a number in $\mathbb{R}$, which is our field).
Then consider $\{(x,y) \vert x=0 \vee y=0 \} $. This set is closed under scalar multiplication but not under addition.
Lastly, consider $\{(x,y) \vert x^2+y^2=1 \} $. This set is not closed under any of the two operations.


What is Lintian for?

Question: I have read https://lintian.debian.org/ but do not understand what that means in simple words. Which are examples of debian policy rules to be violated and detected by lintian?
Answer: Lintian is a quality assurance tool that runs automated checks on various aspects of packages conformity to the Debian policy. If a package don't respect one of the rules, the issue is reported in the Lintian Reports database.
It helps packager to get metrics to build better packages.
Comment: This answer could be improved, but has the basic fact right, which is that lintian is a tool whose main purpose it to check packages for compliance with Debian Policy. The people who work on Policy and lintian are largely the same. One point that is not clear is that lintian is a command line tool which can be run either during the building of a Debian binary package, or on an already existing Debian binary package, and will return the results of its tests to standard output. Lintian is automatically run during builds of the Debian archive, and its results can be found on lintian.debian.org.
Comment: smonff, feel free to add the above to your answer, or if you prefer, I can add a separate answer, though there are already 3 here.
Comment: @FaheemMitha I don't feel that free since you seem to know it much more better than me! I initially tried to give a very simple response. Thanks for adding these informations.
Comment: @FaheemMitha now the initial question has been changed, I don't even know if my answer makes sense
Comment: smonff, he asks what lintian is, and for examples. You have covered the first; you could also add something on the second.
Answer: Examples of errors found are on the tags page. Clicking such a tag leads to a description of the problem.
Example:

https://lintian.debian.org/tags/killall-is-dangerous.html

Interesting are the privacy tags:

https://lintian.debian.org/tags/privacy-breach-facebook.html
https://lintian.debian.org/tags/privacy-breach-generic.html

Finding spelling mistakes:

https://lintian.debian.org/tags/spelling-error-in-binary.html
Answer: One of the main advantages offered by Free and Open Source Software is transparency of code.  In order for this to be of any importance, however, there needs to be at least some concerted effort put into actually checking that this code is bug-free, complies with certain standards (some of which may be imposed by the community at large, and some by smaller organizations like the Debian Project), and is easily readable for others who wish to do the same.
Lintian, though I'm not familiar with this project specifically, seems to be a project backed by the Debian Project with the aim of carrying out this task.

What is Lintian for?


Amazon EC2, Edge locations

Question: I have a plan to move my terminal servers to the Amazon cloud. Amazon does not have any trust able zone in Germany and only has some Edge locations which can deliver requested information from the availability zones to the end users with high speed. I was wondering is there any way to use Edge server features for speeding up the terminal servers which are hosted on the trust able  zones in other locations.
Answer: Edge locations have nothing to do with EC2. They are used by CloudFront distributions. You can use CloudFront for static web site assets, but nothing like SSH access to EC2 instances.

Amazon EC2, Edge locations


What is the avahi daemon?

Question: I just learning about daemon, by that time I came know avahi daemon can you please explain detaily about avahi daemon and why linux has a avahi user ?
Answer: In short: avahi is a Linux implementation of a protocol also known as "Rendezvous" or "Bonjour"). Its goal is to let devices, connected to the local network, broadcast their IP-address together with their function. Hence the printer can from time to time broadcasts : My IP is 192.168.23.45 and I can print any postscript document with ipp prottocol; a NAS can say: My IP is 192.168.23.88 and I can stream music, save your backups, and act as a fileserver.
If it is not what you want to hear on your network you can stop / disable the avahi daemon with the standard systemctl command, but if you run a cups-broadcast daemon, it will start the avahi itself.
Linux uses fictive users usually for security reasons, not to give the attacker any chance to hack a process owned by root. So you can see a postfix or mail,  and postgres or mysql users. The daemon, owned by such unprivileged user, gives less chance for the attacker to get the superuser rights.
Comment: Well, I do not want to start a flame. But in my local net it is for nothing, I set and thats why I know all IP and function of all devices in my network. For a large network, or for net without an smart admin, this protocol (and hence its daemons) can make the network configuration easier, but you pay for it with more _noise_ on your net. After connecting the new net-printer (which gets its IP by dhcp) you can start to configure your printing subsystem by asking for _all print capable new devices_, without knowing ist IP.
Comment: @einpoklum The broadcasts (or multicasts) happen at intervals (like every 30 seconds), so avahi-daemon listens for local Rendezvous/Bonjour broadcasts and caches the list of systems it hears about, so applications using the Avahi libraries will get the list of Rendezvous/Bonjour devices essentially immediately. So when you e.g. open a "select network printer" dialog, you'll get an essentially complete list immediately, instead of having to wait up to 30 seconds for the printers to pop in one by one.
Comment: Is the daemon only for broadcasting, or also for reception?
Comment: Definitely yes, the avahi daemon listens UDP port 5353. You can check it with the command `netstat -lup` or `ss -lup` as superuser.
Comment: But what is this listening used for? What benefits from having avahi running?
Comment: @telcoM: Actually, yours and schweik's comments together constitute a full-blown additional answer, IMHO. Thanks.
Comment: I realize this is a little old, but, just so I understand. If I disable avahi, I still get network discovery capabilities it is just much slower? In my situation I do have a complex network environment around several back-office applications, BUT, those applications are ring-fenced from direct access and have high bandwidth capabilities and requirements between them. If I wanted to end the network chatter, but on the RARE occasion needed to discover something it would still work but slowly?
Answer: AFAIK: avahi/bonjour/rendezvous service need cooperation of all devices. Each device is announcing its service by several broadcast per minut, while your computer with avahi daemon running/listening keeps a collection of available services. If you stop the avahi daemon on your computer but all devices continue with their advertisement, the list of services can be quickly rebuild, after you start avahi daemon again. But if you somehow force all the device to stop broadcasting of their "rendezvous" info, even the running avahi daemon does have nothing to collect, hence the easy config will not be possible. Yes, there are some other ways how to keep the knowlidge about services, available in your reach, e.g. port scanning, local DNS, etc. The avahi way is very easy and it has a growing support. It is your deal to decide which way to follow.
This was compilled from my and telcoM's comments and Internet.
Answer: Dripping faucets are annoying even if we all need running water.  I don't use mDns, so I've deleted it without incident (apt-get --purge remove avahi-daemon).  Further information about disabling it can be found here:  https://www.stigviewer.com/stig/red_hat_enterprise_linux_6/2020-09-03/finding/V-218006
Comment: I found that useful; I guess the downvotes are because it doesn't answer the main part of the question, the way the other's do, so would've been better as a comment.
Comment: This does not appear to try to answer the given question.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

What is the avahi daemon?


Execute actions (actions module not rules module) programatically

Question: How can an action from the actions module be executed programatically? In D7 there was actions_do() but in D8 actions are plugins or configuration entities according to https://www.drupal.org/node/2020549.
Answer: You should inject the plugin manager as a service if possible, but for a plugin (code) based action:
<code>$manager = \Drupal::service('plugin.manager.action');
$action = $manager->createInstance('action_plugin_id')
$action->execute();
</code>
Or if it's an advanced action, it's a config entity, so load and execute it that way:
<code>$action = \Drupal\system\Entity\Action::load($action_id);
$action->execute();
</code>
Again if DI is an option, inject the entity type manager service and use that to load the action instead.
Comment: It's an advanced action I would like to execute that has configuration. It means I created an advanced action in config/system/actions. As far as I understand 'action_plugin_id' does not specify this advanced action?
Comment: All plugin instances (including actions) have an ID, it'll be in the name of the config file
Comment: I misunderstood @Sebastian, sorry, I thought you meant you'd added it via configuration. I edited the answer to cover your use case


how to mount a ufs filesytem with strictatime option

Question: How to mount a ufs filesystem with strictatime option. I didn't find the option in freebsd.
Answer: That is a Linuxism. strictatime and relatime are not used on FreeBSD. Access time in general is rarely used in FreeBSD (mostly for mailboxes). Because of that you will often see people mount using "noatime" on FreeBSD.
The default is however to update the access time. You will then only set noatime when you do not want that.
This means that the default mount is the same as strictatime on Linux. See mount


Process builder to exclude queue when sending email alerts

Question: I have a Process builder to trigger email alerts for users when lead source is deal.
I am having issues when i try to exclude queue members on the email alert.I get the following error when i update the process flow criteria to exclude owner id contains Left(owner id, 3) = '00G' or i use the developer name and update the owner to the queue.
'An unhandled fault has occurred in this flow, An unhandled fault has occurred while processing the flow'
Comment: try creating a formula checkbox field on Lead called `Is_Owned_by_Queue__c` and then have PB filter on that field
Answer: Please create a formula field of Text type with the Owner.Type and check that field value. If the field value is User send the email alert. Though there is no direct way to get the value in formula field but below can be used to get it
<code>IF( ISBLANK( Owner:User.Id ), 'QUEUE', 'USER' )
</code>
Now you can use that value to run your process.


Can I run ASP Classic on Chakra?

Question: Chakra is the code-name of the updated Javascript engine Microsoft packaged into IE9.
It's possible to use JScript as the development language for an ASP Classic page.  This normally runs on the JScript engine built-in to Windows, something that has been present in all versions of Windows since NT4 Option Pack (c.1996).
The question is, it is possible to use Javascript running on the Chakra engine, for ASP purposes?
Answer: Apparently not.
I tried with this simple sample script:
<code><%@ language="Javascript" %>

<script language="Javascript" runat="server" src='json2.js'></script>

<script language="Javascript" runat="server">

(function() {

    scriptEngineInfo = function () {
        var s = {
            engine : ScriptEngine(),
            version: {
                major: ScriptEngineMajorVersion(),
                minor:ScriptEngineMinorVersion()
            },
            build: ScriptEngineBuildVersion()
        };
        return s;
    }

}());

var x = scriptEngineInfo();
x.Timestamp = (new Date()).valueOf();

Response.Write (JSON.stringify(x));

</script>
</code>
When "Javascript" is the name of the language, as above, I get this result:
<code>{
  "engine": "JScript",
  "version": {
    "major": 5,
    "minor": 8
  },
  "build": 16982,
  "Timestamp": 1331866901948
}
</code>
When I do as suggested in this answer and configure Chakra as a named scripting engine, then replace the three occurrences of "Javascript" in the above script with "Chakra", then run the "page", I get correct, expected results:
<code>{
  "engine": "JScript",
  "version": {
    "major": 9,
    "minor": 0
  },
  "build": 16441,
  "Timestamp": 1331867213695
}
</code>
The major version of 9 shows I am using Chakra.
BUT if I then re-request the same script, it fails with a 500 error, saying:

Can't execute code from a freed script

If I try again, it gives me

A trappable error (C0000005) occurred in an external object. The script cannot continue running.

If I try again, I get:

A ScriptEngine threw exception 'C0000005' in 'IActiveScript::GetScriptState()' from 'CActiveScriptEngine::ReuseEngine()'.

This is repeatable, for this script, on my machine.
From this I conclude that Chakra has not been engineered for the ASP environment.
Answer: The Active Scripting architecture allows the scripting host (i.e. the ASP.dll) to cache a somehow parsed interims code delivered by the scripting engine. This is heavily used by ASP, and makes it quite fast. We are running huge scripts (multiple 1000 lines of code), and the first call takes multiple seconds before the code is actually executed, while further calls execute the code already after 1/10 second.
Must likely due to the new JIT-Compiler, the scripting interface is not served well, and ASP gets confused. This problem does not exist with the given WSH test case, because WSH does not use the caching, as it does not organize the code to be executed.
It would be interesting to see if the Chakra 9 engine works if the ASP caching is disabled - I can't test it right now, and I assume that for big scripts like ours it will not bring desired effect. But it's worth a try for smaller scripts.
When installing IE9, the installer also deploys an old JavaScript 5.8 Engine (build 16982), and it's installed above the one coming with IE8 (17562). I don't know the significance of this "downgrade", but it seams its better not to installe IE9 on a server running Classic ASP.
Maybe IE 10's Chakra will provide better ActiveScripting architecture support. Let's hope.

Can I run ASP Classic on Chakra?


how to calculate the volume of tetrapod?

Question: I want to calculate the volume of a tetrapod , but I couldn't find any idea.
here is a simulation of the volume :
Comment: @mounir ben salem By the Solidworks you used, give to reach the volume. But congratulations on wanting to go beyond the easy ...
Comment: Is there a standard definition of a tetrapod?  Each picture I'm finding is somewhat different than all the others.
Comment: A possible definition: the union of four conical frustums of some base radius, top radius and height, the bases arranged in a tetrahedron with each base some distance away from the centre. (Oh, and fill in the space in the middle.)
Answer: A simple possible tetrapod is formed by an inner sphere and four equal cone frustums built on the faces of a tetrahedron (see picture below, where cones are shown instead of frustums). The sphere is tangent to tetrahedron edges and to obtain the volume of tetrapod one must add the volume of the sphere with the volume of the frustums, but subtract the volume of the four spherical caps (pink colored in the picture).

If $r$ is the sphere radius, then tetrahedron edges have have length $2\sqrt2 r$, the circles forming the frustums bases have radius $a=(\sqrt6/3) r$, while the height of each cap is $h=r(\sqrt3-1)/\sqrt3$.
One can then apply standard formulas to get the volume of the sphere without caps:
$$
V={4\over3}\pi r^3\left({8\over 3\sqrt3}-1\right).
$$
To this the volume of four frustums must be added, but that depends on their height and upper base radius.


When Mithril is used to bootstrap a cardano node, does it decrease its size?

Question: I'm trying to understand the capabilities of Mithril. I noticed that you can bootstrap a cardano node using it as shown here: https://mithril.network/doc/manual/getting-started/bootstrap-cardano-node. But what does it mean to "bootstrap" the node? Does it only speed up the verification process or does it make the size of the node smaller?
Answer: "Bootstrap" means starting the node from scratch, and Mithril enables a fast bootstrapping of the Cardano node.
However, the size of the node database does not change: under the hood, the database of the Cardano node is restored from a Mithril certified snapshot. This accelerates significantly the synchronization of the database that is otherwise achieved by downloading data sequentially from other nodes.
Comment: Actually, the fast bootstrap of the Cardano node is the first implemented use case for Mithril. In the long run, other use cases will be implemented, one of which will probably enable trustless light wallets that could run on devices such as smartphones.
Comment: I see, I was hoping it would allow cardano node to run on low spec devices e.g. smartphones. But it's certainly not the case. Thanks!
Comment: Gotcha, I look forward to these use cases. But would this trustless light wallet still rely on services such as Blockfrost to query data or would it be able to sync on its own? Is that too soon for me to ask?
Answer: AFAIK, Mithril has a "currently" and an "in the future".
Currently:

the entire cardano-node's database (~136GB) is signed by nodes running Mithril and downloaded by the new node
thus, "fast bootstrapping" by downloading 136GB isn't all that light weight (do they also compress it?)

In the future:

since Mithril as a signature-scheme-and-a-process-architecture can sign any data, not just "the entire database", then it can be used to sign data much smaller
e.g, for a light wallet, it can receive a signed set of utxos, so you'll know both that (1) that's how much assets you have without needing to trust the node where you received the data from, and (2) construct a valid transaction to spend them.

Thus, looks promising!
(Somebody correct me if anything is wrong in the above.)


Centrifuge + doppler

Question: Does the Doppler effect come into play in any interesting or useful way if a radio transmitter or receiver is spin in a centrifuge? For example, one whose radius was the same as the wavelength of the radio signal (say, ~300 meters for 1 megahertz signal). Or, is the fact that the speed of the centrifuge will never get even close to the speed of the radio wave (speed of light) mean that nothing will happen? Would it then be more useful to consider a sound wave (speaker or microphone in a centrifuge) instead?
Comment: this is an application of the Doppler shift that a rotating target casuses https://en.wikipedia.org/wiki/Inverse_synthetic-aperture_radar
Comment: Do you wish to demonstrate the effect?  [A control line aeroplane illustrates the effect well.](https://youtu.be/-MHJJhbCmdA?t=27)
Answer: I believe that Doppler shift techniques can detect velocities of distant stars as small as 0.3 $\text{m s}^{-1}$, so I'm sure that the shift due to your radio transmitter being whirled would be detectable (assuming that metal walls of the centrifuge don't present a problem). The  effect might not be very useful, though, except as a rather wacky way of monitoring the centrifuge speed or perhaps as a way of demonstrating to high school students that projected circular motion is sinusoidal.

Centrifuge + doppler


Finding residues physically interacting in a PDB structure and sequence related to that structure

Question: I am going to describle the problem completely. First I should say that there are two kinds of interactions: transient and stable interactions. We are supposed to work on stable interaction like interactions between two monomers in a heterodimer. In a heterodimer there are two chains in which there are some residues between monomers which take part in the interaction of monomers and building the structure of heterodimer and also there are other residues interacting inside each monomer for building the structure of that monomer. There are some PDB IDs related to heterodimers in PDB. Now imagine that we are trying to show which residues are physically interacting between two monomers in a heterodimer and then we are trying two show the site of these physically interacting residues in the sequence related to that special structure. For that, we need to find the sequence related to that structure and we can download it from PDB. But if we want to make a multiple sequence alignment of that sequence, first we need to find the refseq sequence of that and then we must blast the sequence and find homologues of that sequence. Here there are some challenges: first, we must find residues interacting in the structure of heterodimer between two monomers. Second, we must find the sequences of monomer chains of the heterodimer and map the interacting residues in the structure to the sequence. Third, we know that when a structure is solved and its monomers are sequenced, may be they are not able to completely sequence the heterodimer and residue numbers are maybe different from the related refseq sequence. I would like to know how can we find the related refseq sequence (or sequences, in the case of heterodimer) and then how can we map the physically interacting residues in the structure of PDB ID to refseq sequence (finding the sites of these interacting residues in that refseq sequence) regarding three challenges mentioned above. Imagine that I have 100 PDB IDs of 100 nonredundant heterodimers and I would like to find and download the structures, sequence and finally refseq sequence. What should I do?
Comment: Dear jaslibra. Thank you for your nice comment
Answer: My reputation isn't high enough to make a comment, but have you considered a modelling software such as PyMol or Chimera? You can execute a command line script with softwares such as these and these have the functionality to predict H-bonds.
In the PDB files there is information regarding the GenBank and UNIPROT info of the protein, and you can find more information here:
http://www.wwpdb.org/documentation/file-format-content/format33/sect3.html.
If you want RefSeq ID, you can use GenBank info you extract and convert by piping into a biomaRt (Bioconducor) script, although maybe there is a more direct way.
As for finding which residues in the sequence are interacting, I'm fairly certain that the software packages like PyMol or Chimera will give you information about the interacting residues.
From what I understand, you will want to filter out only the residues that interact and are on different chains (e.g, Chain A vs. Chain B). This process will require you to work with the syntax of the different software packages when you are scripting. For example, Chimera has a basic primer here:
https://www.cgl.ucsf.edu/chimera/current/docs/ProgrammersGuide/basicPrimer.html
Note that I only gave a reference to Chimera because I am more comfortable with that then other packages and there is likely a more efficient way to do this. With Chimera, you can find the position within the chain of residues participating in the interaction and then you'd store these in a file to do whatever you want later.
I hope this helps.
Comment: Hi jaslibra, thanks for your comment, and welcome to Bioinformatics Stack Exchange. This comment is well-structured, and looks long enough and verbose enough to be an answer for this question, so I haven't flagged it as a comment. I look forward to reading more comments and answers such as this in the future.


Trust in bitcoin networking

Question: I am new to the subject, but as I was studying I wasn't able to understand something and I would appreciate if anyone could help me.
I understand that in most aspects bitcoin doesn't rely on trusting the nodes. It's in the best interest of each node to validate and append blocks broadcasted by other miners, so we can assume that the nodes will do it. It's in the best interest of each node to validate the transactions they put in a block, otherwise it will be rejected. But why do nodes gain in propagating the transactions they receive? If that's not how it works, how is the transaction poll created?
Answer: There is a distinction between miners and nodes though miners will (or at least should) run a full node to check that the blocks they are attempting to mine are valid blocks. I think you are using the terms "miner" and "node" interchangeably here. There are many nodes (majority) on the network that just validate transactions and blocks and don't attempt to mine blocks.

Why do nodes gain in propagating the transactions they receive?

Full nodes and miners want to receive information on the latest transactions and blocks from peers. And hence effective propagation relies on software that can both send and receive this information. In theory the software could be altered to only receive and not send. But if this became a serious problem on the network some nodes could choose to only maintain connections with nodes that are both sending and receiving and the "selfish" nodes might struggle to maintain connections with peers.
Answer: The nodes run software which contains the best-for-everybody rules about how the network should operate. One of those rules is that nodes should forward new transactions to other nodes.
There is no incentive for them that I know of, other than, to not do so, would risk not participating in the network of nodes that do follow the best-for-everybody rules. By not participating, they are spending their own resources without being able to participate in the network's rewards.
And as another commenter mentioned, they would be made to not participate, because the nodes that are following the rules would eventually ignore them.
Answer: Mining bitcoin is based on game theory. Play by the rules and get financially rewarded. Selfish miners risk not making a profit and damaging the coin's reputation. And alternative node software gets squeezed out by the majority because nodes/miners follow the longest chain. Not sure if this answers your question?

Trust in bitcoin networking


Why was Moldova the only post-Soviet country to elect a communist government?

Question: For much of the period following the collapse of the USSR, Moldova was governed by an elected Communist government, uniquely among post-Soviet states.  What factors were at work in Moldova which led them to choose a communist government, unlike all the other former Eastern Bloc countries?
Comment: Many if not most were governed by ex-communist officials, actually. Yeltsin, Aliev, Nazarbayev, Shevardnadze; heck I would have trouble finding non-Baltic ones who weren't KPSS bigwigs before.
Comment: You severely underestimate the popularity of communism in 1991.
Comment: @user4012 You're absolutely correct, but none of those leaders called themselves communist in the post-soviet era.  Also, Aliev, Nazarbayev, etc. were not elected, whereas, Moldova's elections seem to have been (relatively) free
Comment: Maybe the communist party in Moldova was quite capable?
Answer: According to wikipedia article on Moldova, communist government ruled from 2001 to 2009, so I would link its election with dissatisfaction most CIS nations felt with their democratic governments, since the 90s were a time of multiple economic crises for post-Soviet states. Ruling Moldovan democratic party at the time has succumbed to internal conflict and failed to deliver on its campaign promises, thus losing trust of the people, and the communists moved in to fill the void. And since then right and centrist parties were unable to effectively consolidate until 2009, when they unsuccesfully initiated parliament crisis to depose Communist president Vladimir Voronin, but failed to capitalise on it. That crisis culminated in civil unrest, which, again, led to loss of trust by those parties.
Thus, the only reason moldovans chose this government is that they saw that communist party relatively consistently delivered on what they promised, and democrats did not. That is not to say that they chose communism - some sources view this party as communist only in name and in fact being rather centre-right.
Another point of note is that prior to 2001 election Moldovan electoral legislation changed, which also might've contributed towards communist victory in that particular election.


Handling national signs like ą ę in url? - your option

Question: how do you handle them?
Answer: In domain names, you can do use IDN domains, if they are supported by the registrars you want to register them with.
Elsewhere in the URL, they are generally sent by the browser as utf8 urlencoded. Only recently I was looking at:
http://en.wikipedia.org/wiki/Pfeffern%C3%BCsse
And found it curious that there was a ü in the URL. Firefox shows it as a proper character though.
Answer: You'll want to have a look at both IDNA and Punycode, which are the standards that handle this in domain names.
Answer: You might want to take a look at RFC 3986 Uniform Resource Locator: General Syntax. This specifies how to handle non-ASCII characters in URLs. The general idea is to UTF-8 encode each character, convert each resulting byte to its two-digit hex value and append a '%'.
Of course, anothing option is just to strip them out of a URL or replace with something like an underscore, it depends on your requirements.
Answer: The problem with those names is that they are easily confused with other characters. So I should need a very good reason to use them. For example if your company name is "Schröder", I would use both schröder.com, schroder.com and even schroeder.com, the extra cost is justified because it is just to easy to create a malicious name.


how embed windows program into java applet?

Question: how i embed a running windows program into java applet, like notepad, mspaint,...
Answer: I don't think you can. One of the basic principles of Java is security, and if you were able to embed an innocuous Windows program like Notepad, what's to stop someone else from embedding some kind of a virus in the applet?
Not to mention, standalone programs aren't really embeddable in anything. You'd need to have some kind of embeddable widget - that exists for, say, Excel (that's how you can get spreadsheet boxes in MS Word documents) but not for every program out there.
Comment: Microsoft's programs do tend to be embedable, (mspaint runs inside eclipse for instance) applets however can't do this sort of thing.
Answer: You might be able to do something with a signed applet... but you are not going to be able to get the app to display on a remote machine.
If you just want it for local use you could probably convince an applet to launch notepad (I haven't ever thought of doing something like that, but if the applet is signed it is out of the sandbox so I cannot see why you could not), but it will launch on a new window on the local machine.
You could look at JACOB for Java-COM integration which might maybe do what you want, again if it is only on the local machine.  You would still need a signed applet.
Answer: You can't, applets are sandboxed an you won't be able to call out to anything as external as other programs.
Comment: This just means the applet needs to be signed.  It is still possible.
Answer: Maybe it could be done with:

The real Windows program, running on a real Windows box with a VNC server
The applet version of the TightVNC client

Obviously this would be best suited to running on a corporate intranet (the OP does not specify where it will be used.)


Selling shares of a publicly traded partnership?

Question: I invest in individual stocks and some ETFs through a stockbroker.  Last year, I bought less than $200 worth of shares in a company, which I did not realize was a publicly traded partnership until I received a Schedule K-1 (Form 1065) from them when I filed my taxes.  This year, I am planning to move overseas, and I would like to sell these shares as soon as possible.
The Partner's Instructions for Schedule K-1 (Form 1065) say this:

Generally, a partner who sells or exchanges a partnership interest in a section 751(a) exchange must notify the partnership, in writing, within 30 days of the exchange. ...

If a partner is required to notify the partnership of a section 751(a) exchange but fails to do so, the partner will be subject to a penalty for each such failure. However, no penalty will be imposed if the partner can show that the failure was due to reasonable cause and not willful neglect."

Aside from this, I didn't find anything on the IRS's website describing whether selling these shares has any different requirements from selling other publicly-traded companies that I own shares of.
I have never worked for this company.  Do I really need to notify this company that I want to sell these shares?
Answer: No, you just execute a trade through your broker the same way you purchased it.


App launched via widget is closed via phone's back button which is taking to the app's activity which is launched via shortcut

Question: I have an issue with the closing and restarting of my application. I have a widget on homescreen and also I created a shortcut for the app on homescreen. I am entering the app via shortcut and closing it in Activity B by pressing phone's home button. Now I launch the app via widget and pass through Activity A -> Activity B -> Activity C, then I come back to exit the app via phone's back button which goes like from Activity C -> Activity B -> Activity A. In Activity A, when I click back button it should close the app, but inspite of this it's showing the Activity B which is running in background that I launched by app shortcut.
I tried by killing the app in onPause(), it works fine. But then I have a Camera functionality, so as soon as I click a picture and click on save, it exits the app. I think on moving back to the activity from phone's Camera it goes into onPause() which is causing the app to exit.
Can anyone provide a solution for this.  Thanks a lot.
Answer: Instead of killing the app in onPause start the activity from shortcut or widget using intent flag :
FLAG_ACTIVITY_CLEAR_TOP or
FLAG_ACTIVITY_CLEAR_TASK

Please refer : this


Promorule "Buy 3 Pay 2" does not apply

Question: I have to make some promo when you buy 3 items discount 1, and only pay 2, but when i try to buy the discount does not apply, this is my screenshot from the promo.
Answer: The condition says that the product must be in all of the selected categories. Try changing that to:
Category is one of
Answer: Aparently works, but its there some way to no affect the shipping, becouse the shipping table rates is "price (total) by destination" so the total are 59.97 thats mean 0 or free shiping, but the reality the client gone pay 39.98 thats mean the pay 10 $ for shipping.

Promorule "Buy 3 Pay 2" does not apply


Partial Derivative Chain Rule When Variables Are Not Independent

Question: Let's say, $x$ is a function of $t$ ($x = x(t)$) and $y$ is a function of $t$ ($y = y(t)$). And, $f$ is a function of $x$ and $y$ ($f = f(x, y)$). Then by the chain rule $$\frac{df}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}$$. However, when you take the partial derivative of a function wrt a variable you keep all other variables constant. So, I am not sure how $\frac{\partial f}{\partial x}$ and $\frac{\partial f}{\partial y}$ above can be calculated, since you cannot keep $y$ constant if $x$ is allowed to be varied and vice-versa. Can someone please explain what I am understanding wrong?
Comment: $\frac{\partial f}{\partial x}$ is calculated for $x$ independent variable and then it can be considered at point $(x(t), y(t))$.
Comment: $f(x,y)$ is a mapping from $\mathbb R^2 \rightarrow \mathbb R^1$, and its partial derivatives are computed independently of any other mappings, which in your case is $\mathbb R^1 \rightarrow \mathbb R^2$ and defined by functions $x(t),y(t)$.
Comment: To be clear, the chain rule generally is applied when the variables *are* mutually dependent on one another.
Comment: I suggest you read [this answer of mine](https://math.stackexchange.com/a/4384452/568204) and the various link in there. The issue is you need to be crystal clear on what the notation means and what it doesn't mean.
Answer: The issue is that you are using $x$ as both as a free variable, and as a function, $x(t)$. And likewise $y$.

The notation $\dfrac{\partial f}{\partial t}$ is really being used as an implicit shorthand for $\dfrac{\partial f(x(t),y(t))}{\partial t}$.
$~$ Where $f(x(t),y(t))$ is a convolution of the bivariate function $f$, with monovariate functions $x$ and $y$, each evaluated with the same argument $t$, a free variable.

Likewise you are using the notation $\dfrac{\partial f}{\partial x}$ is used as shorthand for $\left.\dfrac{\partial f(u,v)}{\partial u}\right\vert_{\raise{2ex}{u:=x(t)\\v:=y(t)}}$ .
$~$ That means to evaluate the partial differential of $f$ with respect to its first argument and then form a composition by substituting those arguments with $x(t)$ and $y(t)$.
$~$ Thus you are evaluating the partial differential of the field $f(u,v)$ over the $t$ parametised curve $\{\langle x(t),y(t)\rangle\}$

So the chain rule is actually:
$$\dfrac{\partial f(x(t),y(t))}{\partial t}=\left.\dfrac{\partial f(u,v)}{\partial u}\right\vert_{\raise{2ex}{u:=x(t)\\v:=y(t)}}\cdotp\dfrac{\partial x(t)}{\partial t}+\left.\dfrac{\partial f(u,v)}{\partial v}\right\vert_{\raise{2ex}{u:=x(t)\\v:=y(t)}}\cdotp\dfrac{\partial y(t)}{\partial t}$$
But this is annoying to read and write, so the shorthand is used for convenience.
Comment: That makes sense. Thanks!


Migrating Matrix and Wygwam to native grid and rich text in version 6

Question: Is it at all possible to Migrate Matrix and Wygwam fields to native Grid and Rich Text fields in version 6?
Answer: You could create an XML template that outputs your wygwam and matrix field data and use Datagrab or Smart Import Export to import it to the new native fields.
Answer: Wygwam fields should be able to switch those without issues. Matrix stores it's data differently, so exporting / importing should be an option. In V2 there was a script (somewhere) that provided a migrration from matrix to grid.
Answer: here's the Playa & Matrix Importer script Jelle is talking about https://expressionengine.com/add-ons/playa-matrix-importer


iPhone Web App -- Links launched via "Home Screen" mode

Question: I have an mobile web application that I'd like users to be able to use on "home screen mode" (that is, adding it as a bookmark to the homescreen, and then launching the web app via the home screen button).
However, this seems to behave differently than if it the web application was accessed via mobile Safari. For example, whenever I click a link on the web application (even an internal link), it separately launches an instance of Safari instead of displaying the page within the current "browser" (or whatever is launched when you click a bookmark on the home screen). How do I fix this?
Thanks!
Answer: iPhone Safari Web App opens links in new window


In what order should I read the Robert Langdon books?

Question: The Robert Langdon book series by Dan Brown consists of:

Angels & Demons (2000)
The Da Vinci Code (2003)
The Lost Symbol (2009)
Inferno (2013)
Origin (2017)

Does it make the most sense to read them in that order, or does it not matter if they're read in the right order?
Comment: I'm voting to close this question as off-topic because I think it belongs on literature.stackexchange.com (where it came from) - this is neither Sci-Fi nor Fantasy.
Comment: So funny to see that this question was migrated from Literature to Science Fiction & Fantasy.
Comment: This was migrated from the old [literature.se], which failed in beta. There is now a new one, which seems to be doing quite well.
Comment: Question locked after [meta discussion](https://scifi.meta.stackexchange.com/q/12056/31394).
Answer: The books can be easily read standalone, there is very little cross over between them (despite having the same protagonist). If you read them in publishing order (which is also chronological) you will get a little more from it.
However, the three books have quite different appeals. Beyond the common theme of symbology:

Angels & Demons (my favourite) combines technology and religion
The Da Vinci Code has a lot about puzzles and history
The Lost Symbol is Freemasonry, and has more "action" than the last two

Given that the crossover is minimal, this could influence any choice in reading order (or even whether you read them all!)
Comment: are you sure? http://en.wikipedia.org/wiki/Angels_%26_Demons angels and demons was before da vinvi code
Comment: I wasn't listing them in order :) just wrote the list as I went. Sorry for the confusion!
Comment: tnx for order ... i wrote comment because question was What order should I read the Robert Langdon books?
Answer: You should read Angels & Demons first, then The Da Vinci Code second, then The Lost Symbol third, and finally Inferno. A new book in the series has been released, called Origin. This new book also features Robert Langdon; it should probably be read last.
Comment: You're the first answer with the new book! Great find!
Answer: I haven't read Angels & Demons, but there are certainly references in The Lost Symbol that refer to events in The Da Vinci Code. I believe there's at least one semi-important event in the latter that refers back to Angels & Demons. Definitely read them in that order.
Comment: Rather quite minor: the character of Vittoria has an active role in *Angels and Demons*, and there is a brief mention of Robert meeting her in an airport a few months back (in the timeline of the story of course) in *Da Vinci Code*. Additionally, the librarian they visit in *Da Vinci* knows about Robert's visit to the Vatican archives in *Angels and Demons*. (I don't know if there's anything else I can say that won't be a spoiler for they who haven't read...)
Comment: I was racking my brians for what the crossovers were :) so thanks very much!
Answer: Each book is pretty standalone. Overall there are minor references from the later ones to the earlier ones, but they will not impact you if you haven't yet read the earlier books.
Interestingly, the movies for the first two seem to be mixed up - Angels & Demons has some mentions of events which evoke The Da Vinci Code.
Comment: Angels and Demons was published three years before Da Vinci Code... http://en.wikipedia.org/wiki/Dan_brown
Comment: My bad. I got Da Vinci Code well before I got Angels and Demons, so I probably assumed that was the order they were published.
Answer: I read Angels & Demons and I believe that should be the first book you read because it is the one that introduces Robert Langdon to us. In addition, Angels & Demons came out in 2000, The Da Vinci Code came out in 2003 and The Lost Symbol in 2009. There is also another book now in the Robert Langdon series, Inferno, which came out in 2013. You should read that last.
Answer:
Angels & Demons
The Da Vinci Code
The Lost Symbol
Inferno
Comment: Why is this the correct order?


Schengen visa under appeal, when can I reapply?

Question: Our Schengen visa to France was refused on the basis of, what I understand now, some basic errors with the documentation provided. We appealed that decision, but in retrospect I do think it unlikely that the appeal will be accepted (failure to provide exact itinerary as it wasn't in required documentation, and a hotel booking lapsing as we didn't make the non refundable payment). I do feel we can make a much better application now. My question is, that as it has been 10 days since we submitted the appeal, how much longer do I wait before filing a fresh application? If I re-apply, would the fact that I have already appealed an earlier decision negatively impact my new application?
Comment: Are you sure it was just some basic errors, and not a fundamental question of fitting the profile of a typical tourist (income, ties to homeland, ...)?
Comment: Yes. We're a double income family, with properties, employment and bi-annual trips to various parts of the world. While returning our documents, the individual asked us whether any of our hotel bookings had been cancelled.
Answer: According to the French Ministry for Europe and Foreign Affairs

If your visa is refused, you may also submit a new visa application immediately and at any time.
You may appeal against a decision to refuse you a visa by applying to the Commission de recours contre les décisions de refus de visa d'entrée en France (Board of Appeals against decisions to refuse an entry visa to France) within 2 months of the date of notification of the refusal.

As you note, before re-applying, you would want to remedy any issues raised in the refusal, making changes and improvements as appropriate.


Working remotely with Mac

Question: I've Macbook Pro which I'm using now. I want to buy a new computer and I am between choosing Mac Pro (if new one comes out) and buying a standard PC which will be more powerful than Mac Pro for the same price (4000-5000 euro). Since I want to keep having Mac System for some tasks I thought of buying Mac Mini and connecting to it remotely. I know it's done via VNC but was wondering how's the "work" with it? I mean with Windows systems RDP is quite reliable on newest systems and you can really do a lot without feeling it's actually a remote desktop. With my old "VNC" days it always was somewhat pain to do so. Is it still so? I'm heavy Windows user so I use Parallels a lot but I like some features of Mac (sms sending, photos and few other features) so I would like to have both worlds.. not necessary buying Mac Pro which will be overpaid (hardware wise)
Answer: It comes down to this statement:

I'm heavy Windows user so I use Parallels a lot but I like some
  features of Mac (sms sending, photos and few other features) so I
  would like to have both worlds.. not necessary buying Mac Pro which
  will be overpaid (hardware wise)

Get the PC that you like, get a cheap (even pre-owned) Mac like a Mac Mini or a MacBook Air and connect them via a KVM switch that will handle switching your monitor, keyboard, and mouse.
Or...
You could just get a 4K Video Switch and get a Bluetooth mouse and keyboard that supports multiple devices ([Logitech][3] has a number of multi-device Bluetooth products).  I have a Logitech mouse and keyboard that supports 3 devices each and I easily switch between my iMac, my Surface Pro, and a BSD machine with a BT dongle with no problems.  Obviously, my iMac and Surface have their own screens and I only need the mouse, keyboard, and video on the BSD box when I have to work directly on the console (which is rare)
I do a lot of different work on different platforms and I can say that VNC is horrible over a LAN connection.  If you plan on doing things like Photos or anything graphic related, you are going to want a direct (not remote) video
Comment: I do know KVM but wanted to avoid it. But if VNC is horrible even on the lan than I guess I have no option but a) Buy a Mac and accept consequences for hardware b) Buy a PC and Mac Mini and accept KVM.
Comment: I only use VNC in dire emergencies because it's so bad.  Give it a shot...if you have a friend with a Mac, try using VNC to see how it works for you.
Comment: Ye, it's always been bad on any platform but thought maybe there were some upgrades to technology. Windows RDP with its newest options really works nice. In new setup I plan 4 monitors and optionally a 5th one if there's a need so I'm a bit afraid of complications when it comes down to switching things with KVM.
Comment: That's a lot of monitors.  Have you thought of putting OS X in a VM?  I am not "officially" recommending due to Apple licensing, but it might be something you want to research.
Comment: Yes I did some research that way but also have no experience with it. Also I'm a bit afraid it will be hard to get updates and things won't work like on "mac". Always being problematic, especially with newest systems. Do you have any insight regarding that? As in will it work a bit like native or will it kill me like VNC does :-)
Comment: I have seen it used with Photos and other native Apple apps with no tech problems, however, I haven't seen it under heavy load.
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/39335/discussion-between-madboy-and-allan).

Working remotely with Mac


On an iPad, can I "markup and reply" to two PDFS in the same email?

Question: If someone sends me an email containing a PDF attachment (or a JPG, or another image format...) I know that, on an iPad, I can markup the attachment and then send the marked-up document in a reply to the sender.  But what if the email contains two PDFs?  Is there a way to mark up the first, return to the original email, mark up the second, then send a reply containing both marked-up documents?
Answer: I do this all the time.

Save both to Files
Mark up with abandon
Reply and attach

This works in Outlook, native mail, and the fastmail iOS/iPadOS app.
Comment: This obviously works, and solves my problem, but there's something very fluid about tapping an attachment, marking it up, and sending it back without ever having to leave Mail, and I was hoping for a similar workflow here.


In order to use a Genasi racial power, must I be in the appropriate manifestation?

Question: I am a Firesoul Genasi with Extra Manifestation (Water) and Extra Manifestation II (Earth). As I understand it, in order to get the passive bonuses that come with each manifestation (i.e. +1 Reflex and resist fire for firesoul, +1 racial bonus to both Fortitude and saving throws for earthsoul), you must be using that manifestation. Does this also hold true for the racial power (Firepulse for Firesoul, Earthshock for Earthsoul)?
Answer: The racial powers and bonuses a genasi gains are a direct result of the elemental soul they are manifesting.
Each manifestation has a description of what you gain when using that manifestation. Both the passive bonuses and the powers are listed in this description so you only gain these benefits if you are using that manifestation.
This is backed up by the fact that the Extra Manifestation feat allows you to switch from one to another rather than giving you the benefits of other manifestations in addition to the one you're already using and, as @Oblivious Sage pointed out, the Double Manifestation epic-tier feat, which only then allows you to manifest 2 different elements at once so long as you already have access to them (via the Extra Manifestation feat).
If merely having access to more than one manifestation allowed you to gain it's benefits, the Double Manifestation feat would be unnecessary and/or both of these feats be worded in such a way that told you what extra benefits you would gain.
Comment: To reinforce this point, there is an epic-tier feat, Dual Manifestation, that allows you to manifest 2 different elements at once.
Comment: I was about 95% convinced by this answer. I went and looked at the relevant rules and became 100% convinced by the text of *Extra Manifestation*, particularly the use of the word 'instead' (emphasis mine): "When you take a short rest or an extended rest, you can adopt this new elemental manifestation *instead* of the one you *had been* exhibiting."


How to attach velcro tape permanently to builders plastic?

Question: Hey I'm wondering how to attach velcro tape to builders/greenhouse plastic? I have made a greenhouse and have the openings on the frame. Originally I put velcro tape on the frame and flap which worked great for a week, but now when I open it, the tape has lost it's adhesive properties and isn't attached.
I could use gorilla double sided tape, but expect the same result.
Could it be sewed on or some other adhesive? I thought of backing it with fabric mesh tape and stapling it. Any ideas? Thanks!
Comment: I know we're not here for product recommendations, but I have to ask if you've ever seen these [tarp zipper doors](https://www.homedepot.com/p/Homax-7-ft-Clear-Tarp-Zipper-Door-3142/206526231)?  They use adhesive to stick to the plastic, and the zipper doesn't need as much force to undo as velcro.
Comment: I haven't! Thats a very good solution! Will see if I can find it in Sweden. Cheers
Comment: We seems to have a range of understandings of what you mean by the plastic sheet.  I've assumed something very flexible, as I had a zip-up greenhouse made of that, and am familiar with it from tent windows as well.  But one of the other answers might be thinking of a much more rigid sheet
Answer: Plastic to plastic connections are often heat-bonded instead of being made with an adhesive. You might be able to literally iron them together.
You'd have to play with iron temperature settings and expect to totally melt through some plastic while testing to see what works for you.
Do this outside where the smell of melting plastic won't cause anyone any headaches.
Answer: In this case I'd pop-rivet it on, punching both materials with a leather punch, and using washers under the rivet heads.  You could use webbing on the other face for reinforcement but it's quite hard to punch (a hot punch also seals the cut edges).  I'd rivet both ends and the middle of the strip if it's stretched out.  If it gets slack, glue or the original self-adhesive backing could be used in addition to help the materials lie together if it gets slack, with the rivets taking the load.
Sewing would also work - it's tedious by hand but might not fit under a machine.
This assumes you've got quite thick flexible sheet - I have seen rigid greenhouse plastic, which would need drilling for rivets, and sewing would require many tiny holes to be drilled - not recommended.
I have had a similar repair before, where I didn't want to puncture the plastic (a mapcase, link is to outdoors.se).  The glues I tried were only partially successful.
Answer: I find the website ThisToThat useful for suggestions on what glue to use to attach different materials. You just select material 1 and material 2 and it gives you suggestions. For plastic to plastic (not PVC) it suggested either epoxy or a silicone-based adhesive (in the US, there are a range of "goop" products for repairing e.g. plastic/foam/rubber shoe soles).
I also found a big brand name plastic bonding system that appears to be cyanoacrylate (super glue) used on surfaces that have first been "painted" with an activator. They claim this works even on polyethylene and polypropylene:

The key to success is our 2 part system with activator to prime the
surface prior to gluing plastic together. Works on all plastics
including hard-to-bond polyethylene and polypropylene.
Comment: Superglue is brittle, and will crack off if the plastic can bend.  It's also not good for filling the gaps you'll get all over (from the texture of the velcro backing).  But the "all plastics" one is good - I've used it in work to bond flexible PP to rigid aluminium.  Epoxy is also brittle in thin layers, but at least fills the gap


About location of android development tools (ADT)

Question: Anybody can tell to me about location of ADT after installation.
I want to know, this tool will be saved in "android-sdk-windows" folder of Eclipse or another folder.
Comment: This seems to be rather a RTFM question, not one worth our brainpower imo.
Comment: your question has answered itself...
Answer: There's no a specific folder where you must put android-sdk-windows. The only thing you MUST do is configure your eclipse ADT plugin to point to that folder (where ever it is).
Answer: I explain more about my question.
I have shared my android-sdk with some of my visitors (I put sdk on my web-host to be downloaded by my visitors because accessing to android website in my country is denied by Google). One of my visitors asked me a question where is the location of ADT.
and because I didn't know, I asked this question.


Should three-fifty be hyphenated?

Question: In a fiction book, here's a sentence that needs punctuation help: "I'll give you three-fifty for it." (We're talking about $350, but we don't want to use numbers.) We want to spell them out. Should "three-fifty" be hyphenated or not?
Answer: Consider the pronunciation of "three fifty".  Is there more stress on the "three" than on the "fifty"?  If so, you're dealing with a word compound, and there can be a hyphen.  If not, "three fifty" is a phrase not a word, so stress should come at the end.
"Fifty" has more stress than "three", so no hyphen.
Comment: Huh? You start by saying if either word has more stress there can be a hyphen, then you finish by saying that because "fifty" had more stress use no hyphen?
Comment: @nnnnnn, My answer was partly incoherent.  I've corrected it by replacing "or" with "than".  Thank you for your comment.  My conclusion is that there should be no hyphen, since the stress suggests that this is not a compound.
Answer: In US English and British English, "three fifty" would not indicate the number 350 without significant context contributing to that interpretation. It would indicate the number 3.50, typically in terms of money ($3.50 or £3.50). And in these contexts, it would not be hyphenated.
Both the example given in the question and the examples of money are themselves not formal language, though, and would therefore not necessarily follow traditional rules of grammar. Language is a flexible device, and for writers of novels, short stories, and novellas, poetic license often trumps grammatical correctness. The foremost question to an editor's mind should be one of whether the meaning of the writing is clear and whether the style fits the presentation holistically.
To be grammatical, one should say "three hundred fifty." Further, to express £3.50 most clearly and grammatically, one ought to say "three pounds fifty," or, for $3.50, it should be "three dollars and fifty cents."

Should three-fifty be hyphenated?


What is the best way to build my resume outside of work?

Question: I am a junior software dev at a small software company. I can't really get anything from my company in terms of advancement as there are people in the way so I will need to leave in about a year. There is no real opportunity for additional responsibility either as the project scope is very fixed for our client.  What are the best ways to build my resume outside the company?
Comment: Contribute to open source projects. Start your own project. Start an account on github (or similar) and begin posting public repositories of code golf and code kata projects. You answered your own question in the meat of your question. How do you build your resume? BUILD.
Answer:
Start building your resume with whatever you do in the current company. That is probably the best you can do. Even if there are not big opportunities, try to get involved in more than you already do. That will help building your CV.
(idea) Start your own company.
(idea) Volunteer.
(idea) Find another job, do not wait too much in a dead-end job.