Does Google Talk push messages?

Question: I would like to know if Google Talk works like Gmail where it actually pushes your messages onto your phone instead of the phone pulling periodically.
Answer: Yes.
Comment: Cool, so battery drain (by Gtalk) should essentially be null when no messages are received?
Comment: @Weboide I'm not completely familiar with the Jabber protocol but I would assume so, yes.
Comment: I suspect there is a minimal overhead, the server needs to know whether you are online. There might be regular pings. It's difficult to tell without digging into the code.
Comment: @DrG I think you're right about GTalk doing something like that, but I know some other clients don't do it.  If you lose your connection while using eBuddy, for example, you might remain "online" for days without knowing it.  (Which indicates to me that it only sends "I'm signing out now" messages rather than "I'm still online" messages.)
Answer: No, GTalk messages are not received on Android GTalk client while away (sleeping). So I assume there is no pushing, as it is done in the Blackberry GTalk client.

Does Google Talk push messages?


Added too much sugar to tomatoes. How can I fix it

Question: Making my moms homemade spaghetti sauce and her direction said add 1/2 c sugar for 2 qts Tomatoes. It tastes too sweet for me. Can I fix it easily?
Comment: add more tomato?
Comment: Yeah, either add a whole lot more tomato, or give up and make it into ketchup, because 1/2 cup of sugar is a *lot*.
Answer: That does seem to me to be a lot of sugar for a pasta sauce recipe; most I've seen that call for sugar at all would use at most a few tablespoons per two quarts, and even then only if the tomatoes were naturally not very sweet (i.e. the sugar would only be added if necessary).
Regarding how to fix it, you have a few possible options; firstly, as moscafj suggested in the comments, you could dilute the sugar by adding more tomato, ideally having prepared it the same way you did the original batch, up until just before you added the sugar.
The other method I'd suggest would be to try balancing out the sweetness with additional salt or acid; our tongues treat the four 'basic' flavours (salt, acid, sweet, bitter) with some degree of mutual exclusion, so the stronger one is the weaker the others will appear to be. I'd suggest you be careful with this method; if you go too far with adding extra salt and/or acid (such as vinegar or lemon juice), you might end up with something that tastes closer to ketchup than pasta sauce. I'd encourage you to go by taste; separate out a cup or so of the current sauce, taste a bit, think about whether it would taste better if it was saltier or more acidic, then add a small amount of the relevant ingredient, stir, and taste again until satisfied. Once you've got a good handle on whether your particular sauce can be rescued by this method, you can take similar steps with the full batch.
Comment: I would further suggest trying the addition with a small isolated sample of the sauce before adulterating the whole batch, in case you try it and decide it's worse. get one that works on the small scale and only then apply it to the whole batch. Also, consider lemon juice or citric acid as a possible alternative to vinegar in the acid category.
Comment: Agreed on testing a small batch.  Salt can amplify some flavors so might make the sweetness worse.  Bitter might actually help to balance out overly sweet stuff, too.
Comment: I've incorporated your suggestions into the answer, thank you. Regarding the specifics of how the different flavours interact with each other, my understanding is that salt tends to be the most 'powerful', masking the other 'basic' flavours, particularly bitterness, where sweet and sour interact less by 'masking' one another and more by 'balancing'; bitter, finally, tends to be least effective at masking other flavours, at least while it's still at levels most consider palatable. As such, I'd be cautious about trying to use bitter ingredients to balance sweetness.
Comment: Honestly, turning it into ketchup or BBQ sauce might be a great option... I agree % with your advice, including that 1 tablespoon seems like a more standard amount of sugar... In which case, it's 4-8x sweeter than I'd personally prefer.
Answer: I don't know where that recipe came from (the US?), but in Italy a little bit of sugar is added only when the tomatoes are too ripe and a little bit acidic.
To fix it adding salt would not help it because salted is not the opposite of sweet. If you cannot dilute the sugar adding more tomatoes you could try and change the plate into a sweet and sour recipe adding a little bit of vinegar, many people would be horrified at the thought of the ketchup spaghetti, but that is better than the sweet tomato sauce.
Another solution could be to add a lot more basil than usual. Or, if you are still cooking the sauce you could put some spearmint, cooked spearmint sometimes give a slightly bitter aftertaste, that would balance the sweet.


Creating a shadow view

Question: I have a UIView set as "shadow", and I put this view behind a UIImageView to create a shadow effect. The only problem is, if you decrease the alpha of the image, you can see the white part of the UIView. How do I hide the whole UIView except for the shadow? Setting the backgroundColor to clearColor hides both the view and the shadow, which doesn't help. Thanks.
shadow.alpha = 0.95;
shadow.layer.cornerRadius = 10;
shadow.layer.shadowColor = [UIColor blackColor].CGColor;
shadow.layer.shadowOpacity = 1.0;
shadow.layer.shadowRadius = 10.0;
shadow.layer.shadowOffset = CGSizeMake(0, 4);

Comment: Thank you very very much ........ for this code helped me to make a shaddow.
Answer: Have you tried modifying the UIImageView's layer to have the shadow, rather than having two views?
If that doesn't give the desired output, does a black UIView work? If you post a screenshot and the desired effect, maybe I can be of more assistance.
Comment: I took your advice, worked out the bugs, and got it to work that way. Thanks for your help!
Answer: I don't think it's possible to do what you're attempting using the built-in shadow facilities. As you've discovered, there has to be something drawn in order for Quartz to have an outline to automatically shadow. (In this case, it's the background roundrect of the view.)
If you specify an explicit roundrect shadowPath for the shadow view's layer, that will do away with the need for the view to actually draw anything. However, the shadow itself appears to be constructed by filling the shadow path and then blurring and translating the resulting image, so you'll end up with essentially the same effect of a black background for the view.
I agree with Ryan Oksenhorn that you'd be better off working with the image view itself. If you add a shadow there, its opacity will drop with the view's, but that's probably all for the better. Do you really want to fade the image and leave a disembodied shadow behind?
Answer: How about you set
shadow.backgroundColor = [UIColor blackColor];
shadow.alpha = 1.0;

Creating a shadow view


Bluetooth: sync time from an NTP server via Internet connection shared with Android phone

Question: I saw that it is possible to sync time from an NTP server over WiFi. I have the HC-06 Bluetooth module and an Android phone that can share its Internet connection with Arduino via Bluetooth. Would it be possible to sync time/date using this infrastructure? And if yes - how (which libraries, etc..)? Has anybody done it already and there is a tutorial on that?
Comment: you can;t use Bluetooth tethering with HC-06
Answer: No, not really. It is possible, but not easily like you want it to be. The HC-06 is a Bluetooth-Serial bridge. In the Bluetooth protocol there are many types of interfaces, that a client device might expose to the master. A Bluetooth mouse exposes a HID interface, a headset exposes a corresponding audio interface and the HC-06 exposes a pure Serial interface. Thus the HC-06 does not support what ever interface is used for tethering.
Ways, that may make it possible:

Change the firmware of the HC-06 for exposing the correct interface and interact with it. For this you need to know how to reprogram the HC-06 and how exactly bluetooth works. I guess this is over your current level.
Write an app for your Andriod smartphone, which plays the Serial-Internet bridge on the phone. The app would translate between Serial and Internet, involving your own protocol on the Serial interface. Easiest, when you just make a specialized app for syncing time, so that it does not have to do any other communication.

And at that point it is just too much work to go either way. It is unlikely, that you find libraries or any code for this, since it just doesn't make much sense. Instead you could move from an Arduino to an ESP, which can directly connect to the WiFi network in question and thus get directly the time from the internet, without tethering. That is way easier and you can use the many libraries, that already exist for that problem.
Comment: @user1876484, BLE doesn't support tethering. Tethering is a function of classic Bluetooth. and Nano 33 BLE supports only BLE
Comment: I try not to expose WiFi link on my phone (in order to save battery), so I would prefer Bluetooth. Is the above mentioned tethering possible on Nano 33 BLE? And if yes - how will look the code?


Difference between MAC(key, msg) and SHA(key || msg)

Question: I know that SHA(key || msg) is vulnerable to string concatenation attack. However, what if we specified key bit-length and msg bit-length? For example, key bit-length is 256 bit and msg bit-length is 256 bit. If msg or key bit-length is longer than 256 then we simply don't do anything. In this situation, will there be any differences between SHA(key || msg) and MAC(key, msg)??
Comment: Rule 1 of Crypto: Never roll your own. If there is already a thing that does what you want, why change it?
Comment: @MechMK1 I do not change it, I am just curious enough to ask the question. Plus, the idea of concatenating like that was taken from Monero paper https://www.getmonero.org/library/Zero-to-Monero-1-0-0.pdf, where Monero introduces their Ring Signature algorithm, they just concatenate difference component into Hash function and not using MAC.
Comment: @Luc I am very sure and understand the difference between hash function and mac function. I just want to understand more in the particular case as I asked above.
Comment: what do you mean by "difference"? they are two very different things used for different purposes. SHA-0 is very obsolete.
Answer: With the capacity of SHA-3[1] against length extension, It doesn't need HMAC where the key is used twice to build a secure MAC. Instead one can design with prepending the message with the key. Actually, NIST already standardized this into The KECCAK Message Authentication Code KMAC.
With the fixed key and message size, your scheme can be considered as keyed MAC. There is one drawback in your case, the message length prohibits MAC arbitrary messages.
Also, your scheme has a collision where $\operatorname{SHA}(key_1\mathbin\|message_1)=(key_2\mathbin\| message_2)$[2] i.e. the key is used as the message and message as the key ($key_2 = message_1$ and $key_1 = message_2$).
Stick to standards. With KMAC you can MAC arbitrary lengths and have desired output lengths with the help of the cSHAKE128 (XOF - Extendable Output Functions) and have domain separation and even you request different output sizes for the same input, the output will be different.

[1] One can use Blake2 and Skein, too. Those are also resist to length extension attacks
[2] Here we assume that SHA is not SHA-1 or SHA-0. Also note that the SHA-512/256, SHA-512/224, SHA-384 have resistance to length extension attacks. Those are designedNIST  after SHA3
Comment: What do you mean by "Also, your scheme have a collision where SHA(key_1||message_1)=(key_2,message_2) i.e. the key is uses as the message and message as the key.". I did not get this point.
Comment: This sounds a little confusing. Also, the MAC idea works for any hash function which can be modeled as a random oracle. Not just SHA-3, but Blake and Skein as well. The reason why SHA-1, SHA-2, and MD5 aren't safe to use this way for variable length inputs is because they don't behave like a random oracle; which is the case because they are vulnerable to length extension; which is why you have to use something like HMAC instead of simple key concatenation.
Comment: @FutureSecurity a bit better now?


Is there a word for someone who is very good at starting wars among friends?

Question: There is no specific word for it in my mother tongue. Imagine the situation when he meets a group of people, maybe he just met them, with few words he can start a fight among them and the turn against each other.
Any word for that?
Comment: [Instigator](http://www.collinsdictionary.com/dictionary/american/instigate "someone who instigates: to urge on, spur on, or incite to some action, esp. to some evil") is a more general term for someone who likes to cause trouble, but it doesn't have the specific nuance of turning people against each other.
Answer: If any of you out there saw The Beatles' movie "A Hard Days Night" Paul says his grandfather is a "King Mixer."  He further says that his grandfather hates group unity so he gets everyone at it.  I guess it means he gets friends arguing, or something like that.  It must be a term used in England.
Answer: In (fairly vulgar) BrE slang, there's...

shit-stirrer - someone who makes trouble for other people, especially by making known facts that they would prefer to keep secret.

In some conversational contexts you could use He's a [right/real/etc.] stirrer to tone down the vulgarity (which doesn't have to imply a deleted shit, but many native speakers would assume it did).
For more formal contexts you might consider...

troublemaker - a person who habitually causes difficulty or problems, especially by inciting others to defy those in authority.

It's worth paying particular attention to the different "common contexts" following especially in those two definitions. But they don't always apply (i.e. - you might call someone a troublemaker because he habitually reveals sensitive personal secrets which will lead to conflict among others, just as you might call him a shit-stirrer if he's always encouraging others to defy authority).
Having said that, I must admit that because those two "standard" associations are so well established, I might sometimes "lapse" into the vulgar usage even in conversational contexts where I would otherwise tend to avoid it, simply because it's the only really precise term for that specific sense.
Answer: Heh, in 1960's British English, one of my favorite movies called a character like that "a real mixer". I've never heard that in everyday speech in America, though.
I can think of words like "quarrelsome" that could be used that way, but usually mean getting himself into fights instead of others.
Well, if no one else comes up with something, maybe you can bring "mixer" back into fashion. I'd love it if you did.
Comment: Link [here](http://www.imdb.com/title/tt0058182/quotes?item=qt0246870) and [here](http://www.imdb.com/title/tt0058182/quotes?item=qt0486280). Another relevant bit: "You two have never had an argument in your life and in two minutes flat he's got you at it. He's king mixer. He hates group unity so he gets everyone at it."
Comment: I like your suggestion 'mixer', although you won't find it in most dictionaries in that sense, I dug out [one definition](http://www.collinsdictionary.com/dictionary/english/mixer?showCookiePolicy=true) :-). I'd love to know which movie was it, but even without that a +1 from me :-)
Comment: You don't say which specific movie you're referring to, but I'd have said that (both now *and* back in the 60s), *a real mixer* is far more likely to be used to mean either someone who mixes (socializes) easily with others (standard register), or someone who habitually [mixes it](http://dictionary.cambridge.org/dictionary/british/mix-it) (gets involved in *fights* with others *himself*, primarily Cockney slang).
Comment: Sorry to leave you both hanging, it was "A Hard Day's Night", the Beatles's first foray into movies. It's just a really fun and silly movie with tons of character. Always been one of my favorites.


Is it required to input full matrix when using Qiskit HHL algorithm for sparse matrices?

Question: I am working with a very sparse matrix and it seems inefficient to load the full matrix as input into the Qiskit HHL algorithm. Is it possible to input only the non-zero elements, instead ? I am working with a "clean" banded, tri-diagonal matrix.
Answer: At the moment this is not possible, however in the near future it will be possible for the case of tridiagonal symmetric Toeplitz matrices.
The reason for this being that qiskit does not support QRAM or "black-box" access to the matrix elements, so to be able to partly specify the matrix one would need to develop specific methods that work with this limited information, which is only possible if the matrix has some structure.
Comment: Thanks, I appreciate the answer! Will the capability extend towards tridiagonal symmetric banded Toeplitz matrices?
Comment: I think we mean the same thing, a tridiagonal Toeplitz matrix is already banded :)


How can I determine whether my processor is 32-bit or 64-bit?

Question: How can I determine whether my processor is 32-bit or 64-bit? My processor is AMD Phenom 8450 triple-core.
Comment: Use CPU-Z utility and it will also list it's available features.
Comment: Related (possible duplicate?):
[How to tell if a Windows computer has a 64-bit CPU or OS](https://superuser.com/q/208312/358766)
Answer: Another way would be to use CPU-Z. In addition to bitness (AMD64 or EM64T) of the processor, it will display other useful characteristics of the processor.
Another way would be to check directly on the website of the manufacturer. Intel has a database of its processors here and it's quite nice. Unfortunately, AMD does not have such nice interface, but you can always go to their homepage and poke around. Here is the list of their desktop processors. VIA's processors seem to be listed here.
Answer: You could search google/newegg for your particular processor, if you know it by name, and read the specs. The specs on your processor says: 64-Bit Support: Yes.
http://www.newegg.com/Product/Product.aspx?Item=N82E16819103254
But i'd vote for someone else's answer if they could give a quick and easy way to check this without having to know your processor's model. Maybe it says in the bios on boot up?
Comment: Good point, I would think the OS, or at the very least the BIOS would tell you.
Answer: What OS are you on?
In Linux / Mac OS X all you have to do is open a terminal and type uname -p
Comment: I don't think the OP wanted to know that. The question was about the actual processor capability, not what operating system was running on it.
Answer: Open the System Information
Open the Start menu, and click on Programs -> Accessories -> System Tools -> System Information
Look in the System Summary
The System Information tool will display detailed information about your Windows operating system. Once opened it will show the "System Summary" – it's an overview of your computer and operating system.
Look for the System Type Item
On the right hand side of the window you will see a list of items. Look for the item called "System Type".
The value of this item will tell you whether your computer is 32-bit or 64-bit:
x86-based PC: It's a 32-bit computer.
x64-based PC: It's a 64-bit computer.

Comment: @johnprobe if you install a 32bit version of windows, it will always say x86-based pc, even if the cpu has a 64-bit instruction set. as such, your answer is misleading rather than helpful
Comment: Doesn't answer the question: A 32 bits Windows can run on an 62 bits CPU.
Comment: User wanted to know what type of processor they had - the above tells them.
Answer: Google for the processor's name. I found a wikipedia article about AMD processors.
It states, that the 8450 supports AMD64, which means it is a 64Bit processor.
Answer: To the best of my knowledge all Phenom series are AMD/64.  If you need assurance and you're using a Linux or BSD OS take a look at what dmesg says on bootup.
Answer: You can use this program created by Steve Gibson of Gibson Research Corporation called SecurAble. This tool will not only tell you if it is a 32/64 bit processor, it will also tell you if the CPU supports hardware DEP protection and if it supports Hardware Virtualization.
The program requires no installation at all. It simply uses a signed driver and communicates with the processor.
Comment: Unfortunately it's Windows only. I'd like a version that runs under Linux.
Answer: You don't know external 3rd party software. You can just use the terminal prompt to check it.
If you are using Linux:
uname -m

return x8_64 if 64bit and i386 if 32bit
or you can use the easy command:
arch

Return if 64 or 32
If you are using Windows. Open command prompt and run the command:
wmic os get osarchitecture

return whether 32 or 64 bit.
If you are running OSX:
system_profiler SPSoftwareDataType

Return
  64-bit Kernel and Extensions: No   (this output for 32-bit kernel)
  64-bit Kernel and Extensions: Yes (this is output for 64-bit kernel)

Comment: Doesn't answer the question - only tells you the OS type, not CPU type (x64 can run x86 OS)
Answer: For Windows, you can simply type either:
wmic cpu get datawidth

or:
echo %processor_architecture%

in command prompt. wmic cpu get addresswidth is for the OS, not the CPU, in case someone was wondering.
Answer: Phenom x3 processors are basically quad-cores with one core locked (mostly due to defects). These are all 64-bit.
PS - If you're interested, you should google to see and try to unlock your fourth core. A lot of AMD x3 have a working fourth core that can be unlocked to make your processor a quad core.
Answer: Below command on 'command prompt' would display CPU name and family.

wmic cpu get Description

on a 64bit OS

Intel64 Family 6 Model 69 Stepping 1

on a 32bit OS

x64 Family 6 Model 69 Stepping 1

Name of Processor on a 64bit or 32bit OS

wmic cpu get Name

Results in

Name
  Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz


How to make a PMOS work as a constant current source?

Question: I have a circuit in which, the PMOS is biased to a voltage source, the gate voltage, V1, of the NMOS below varies based on the functioning of the analog circuitry before. Because of this, the current through the NMOS (I2) also varies. When the current through the NMOS (I2) becomes greater than the current through the PMOS (I1), the next part of analog circuit starts working. For this, I need a constant current I1 (and I can not use a constant current source). But, in my circuit, the current through PMOS (I1) is varying based on the current through the NMOS (I2), and hence, my next analog circuit is not functioning perfectly. How can I make the PMOS work as a constant current source, independent of I2? I used 65nm technology for developing the circuit. Here is my circuit,
Comment: What are you trying to accomplish overall? This looks like it might be an X-Y problem. There may be better ways to achieve your overall goal than with the approach you have chosen.
Answer: You could make the current sources super robust, with cascodes and what not, yet you will still see that the current provided by it will vary with respect to the input signal of your NMOS.
Why? because you're most likely simulating these circuits in an open-loop simulation, without any feedback (not even DC) around it.
I'd suggest you do the following:

Put a feedback path around your amplifier (e.g. if you want to design this op-amp for a voltage amplifier, you can simply connect the output to the (-) input to bias your amplifier properly and put it in a voltage buffer configuration).

Bias the PMOS with a current mirror. It could be a simple ideal current source with one arrow direction connected to GND, while the other connected to another, properly-sized, diode-connected PMOS transistor (a current mirror, basically). Here, you can decide what kind of current you want running through your actual PMOS current source.

If you actually need a real current source where to derive your currents from, you can look into a bandgap or a PTAT current source. Typically, most ICs have a dedicated block where the current is created (either with a constant or a PTAT behavior). This block can have current mirrors where you copy your current from into your amplifier (via current mirrors).

Feedback and a large loop gain will suppress the voltage swings at the drain of your NMOS, thus your PMOS current source will provide a predictable current to the NMOS and analyzing the stage with an small-signal approximation will be a good approximation to it. You can improve it using cascodes, regulated cascodes as needed, but start from there, I'd say.
As a good former professor of mine used to say:
"You can't force a current through a drain!"
EDIT:
To expand on an observation of yours. You seem to think that biasing a current source transistor with a voltage source should be good enough (based on your schematic drawing).
While this sounds ok at first, there are much better and robust ways to do so:

Why is this idea bad? if you found a gate voltage for the PMOS that gives you the current you want, it'll work only for that particular corner and temperature point, i.e. if you test this circuit with another corner and temperature, you'll see that your current will be different, then you'd need to find another suitable bias voltage. Cumbersome, no?

Instead, why don't we let a diode-connected PMOS biased with a current source decide what its suitable gate voltage must be to be biased at a given current? Then, this circuit will automatically find the right gate voltage to keep the transistor biased at your decided current. In this way, we let the circuit find its own suitable bias voltage according to its environment and PVT variations.

In short, we let the loop of that PMOS diode-connected transistor find its suitable gate voltage for the given current. This is the most robust and efficient way to bias a current, and the reason why you don't usually see current sources biased with voltage dividers or other brute-force voltage sources.
Hope that helps :)
Answer: I am assuming that you have a constant voltage available in your system. You can use that and then use a voltage-to-current converter and mirror that current as shown below. For this to work as a constant current source across temperature, you need a resistor that does not vary with temperature and the 2 PMOS transistors have to be matched.

P.S: The size of the PMOS transistor is quite small. If you plan to use this solution, you need to increase the sizes to have good matching.
Comment: If you connect the Vref to the PMOS, the current that you will get will vary across process and temperature. That is why we do this V-to-I conversion using the opamp to minimize the current variation across process and temperature
Comment: Why did you put an opamp there? Why don't we connect the Vref directly to PMOS and mirror the current?
Comment: @SivaSandilya you can also do that.


When and why do we need the `wait` command on bash?

Question: Doesn't the bash shell already run the commands one by one and wait for the executed command to finish? So when and why do we need the wait command?
Answer: You use wait if you have launched tasks in background, e.g.
#!/bin/bash
task1 &
task2 &
task3 &
wait
echo done

In this example the script starts three background tasks.  These will run concurrently in the background and the wait will wait for all three tasks to finish.  Once wait returns, the script continues with processing the echo done.

As pointed out in comment wait can be given a job number (wait %3) or a pid (wait 1234). While it is easy ( using job or ps ) in interactive bash to find those, it might be more difficult in batch mode.
Comment: @AustinHemmelgarn: Your tip would be complete if you could state how to get the PID of an & job.
Comment: Adding to this, you can use `wait` to wait on specific background jobs (pass a PID for the job), and when doing so it will return the exit status of the job when it exits. This is exceedingly useful for more complex asynchronous programming, as well as waiting for all background jobs to exit before exiting the script.


How can I upgrade my iMac to Lion 10.7?

Question: I have a late 2006 iMac which I would like to upgrade to mac os x  10.7. What options are available to me, such as download or DVD, and where can I buy it from? Will the seller deliver it to my location in Amman, Jordan?
Comment: Could you please be a bit more specific in your question? Please edit the question so that it is easier to understand what your main question is.
Answer: OSX 10.7 Lion was not sold on DVD, the first retail OSX version to do so. You can obtain it through three methods:

Update your system to 10.6.8 (combo update is best via Apple, or Software Update if you like) and then, using the Mac App Store, purchase a copy of Lion
Purchase Lion via the Apple Store website which will email you a download redemption code for Lion: http://store.apple.com/us/product/D6106Z/A/os-x-lion
Use eBay or another website to purchase an official Lion USB key, released for those who cannot download the product. Check with the various sellers to see if they deliver to your location.

How can I upgrade my iMac to Lion 10.7?


How to compare EVI values with NDVI values?

Question: I have been doing NDVI (Landsat 4-5) analysis for my research area for some time now. I recently decided to try out EVI (MODIS). But the EVI values I get are a bit different from NDVI. For example maximum NDVI values reach upto 0.9 but maximum EVI values only reach 0.6. I read that EVI does not get saturated in dense biomass regions like NDVI does so maybe that is a reason for lower maximum EVI values? In any case, is there some conversion factor or some other way to compare the two values for the same region? For example if I say NDVI in a park changed from 0.3 to 0.6 in 5 years, the changes in EVI for the same park ofcourse wont be within the same range. This is a great confusion for the people who await my results as they only understand NDVI values and would think NDVI of 0.6 is equal to EVI of 0.6.
Answer: Well this is not exactly a GIS (definitely not arcgis) question, but remote sensing is somewhat related.
Anyway, EVI (enhanced vegetation index) is similar to NDVI and to SAVI (Soil-adjusted vegetation index). To wit it corrects for atmospheric and soil distortions. As stated in the NASA website "While the EVI is calculated similarly to NDVI, it corrects for some distortions in the reflected light caused by the particles in the air as well as the ground cover below the vegetation".
Conversion is not as straight forwards as can seen by the formula of EVI provided by Wikipedia. I do not recommend conversion or comparison at all, since EVI and NDVI are two different indices. It would be more appropriate to use EVI, in particular in areas rich in Biomass, or in areas with scarce vegetation where soil might influence your results. Additionally, cross satellite comparisons would be wrong due to issues of spatial resolution (250 m in MODIS and 60 m in LANDSAT 4-5) and might be due to other wavelength issues of specific sensors.
If you want to compare NDVI and EVI anyway, I would at least recommend to calculate EVI and NDVI (with atmospheric correction) using data from only one satellite.
Comment: Thanks yes it makes sense to not compare them rather look at them as complimentary indices for measurement of vegetation.
Comment: Note that any Landsat data gives you better spatial resolutions, however it is usually on the account of lower temporal coverage. Also note that NDVI is much more straight forward than EVI, if you need to do calculations by yourself.
Comment: Actually this was part of the reason i tagged this question with ArcGIS. I resampled the MODIS data to the same spatial resolution as NDVI (30m) using ArcGIS before comparing values.
Comment: I see, but you didn't ask about re sampling or any arcgis operation. I however hope this answer would help take your analysis forward. Good luck


Distance required between two wires to avoid EMI

Question: I am running 3 cables cables from a solar heater down to my apartment (around 12 meters), one to power an electric heater and water pump (around 2000 watts in total), one to control a 12V solenoid and a temperature sensor. These 3 wires are wrapped around all the way down. The problem is I get massive fluctuations in my temperature reading +-5 degrees when I turn on the heater. Are these fluctuations due to EMI between from the power cable to the sensor cable? If yes, is it possible to calculate the distance to separate the wires in order to avoid any EMI?
Comment: Is the temperature sensor sharing a common return wire with one of the other circuits? If so then the voltage drop along the cable when the load is on is probably the source of your problem.
Comment: TIA-569, Table 45 gives separation distance recommendations between power cables and twisted pairs. It would be worse if you are using small analog signals.
Comment: I'm confused, what is on the wires exactly? Could you give a schematic with WAY more detail. Also, 1+1=3?; You only even talked about 2 of the supposed 3 wires. By the sound of it, it seems more of a ground loop problem than anything. EMI due to the heater would only be possible if the heater was PWM controlled. 50 Hz will never cause EMI and if it is EMI and the temperature signal is analog, a very simple low-pass 10 Hz RC filter at the input would solve the issue.
Comment: Cerike That 10Hz lowpass will only reduce the EFI or HFI of the 50Hz by 5:1 at most. And with the slewrate of a sinwave being NON_ZERO, you will have displacement-charging currents causing ElectricField interference; also the power-line currents will cause Magnetic Field interference.
Answer: So you have a 2,000 watt load to a resistive-heater and a motor that has a spark-generating slip-ring. Lets model this as 10 amps and 200 volts, our trash generator.
We'll just consider the HFI, the magnetic field coupling. (The other answer provides electric field coupling.)
For worse case, assume 4 meters of wire in the temperature sensor, with 4 millimeter of spacing between the SenseWire and the ReturnWire.
We'll model this magnetic coupling as a SINGLE transmitter wire (we place the RETURN wire at infinity and get no flux cancellation, thus a worst-case trash generator), and a loop 4meters by 4 milliMeters which is the Receiver). Math?
Vinduce = [MU0*MUr * LoopArea / (2*pi*Distance)] * dI/dT
dI/dT (with NO motor sparks) is 10amps * 377 = 3,770 amps/second
Now let MU0 be 4*pi*1e-7 Henry /meter, let MUr be 1 (air, copper)
and the Vinduce becomes
Vinduce = [2e-7 * Area/Distance] * di/dT
and substituting
Vinduce = 2e-7 *(4meter * 4mm)/4mm * 3,770
Note we assumed the distance between Transmitter and Receiver, inside your "3 wires twisted together", is also 4mm.
Vinduce = 2e-7 * 4 * ~~ 4,000 = 2*4*4 * 1e-7 * 1e+3
Vinduce = 32 e-4 = 3.2 milliVolts
Note motor sparks will be 100X or 1,000X faster, raising the trash coupling 100X or 1,000X.
Answer: How about Efield coupling? The Efield requires us to use Ohms Law: displacement current * Z_node.
If the displacement current is 10uAmp, and the Z_node is 100 Kohm, then the V_node is just 10uA * 100 Kohm = 1 volt of voltage at the node.
How do we compute I_displacement? Using Q = C * V, and differentiate with respect to time, we get
dQ/dT = dC/dT * V + C *  dV/dT
Holding C constant, that becomes dQ/dT = C * dV/dT = I_displacement
Thus we need TWO variables to compute I_displacement:
1) The wire-wire capacitance (the exact math needs some hyperbolic sine formula, which I'll provide later)
2) the SlewRate of the interfering voltage
Seems like a lot of bother? Hang in there. This lets you compute COMPUTE the SNR, the signal-noise-ratio of your circuit, or the ENOB the Effective Number of Bits. Thus your measurement accuracy becomes predictable. Willing to work thus a little more math, to
be able to predict your ADC's usefulness? I thought so.
For the Capacitance, for a (useful) first approximation, just use the math
for Parallel_Plate capacitance. Given many wires or traces in typical circuits, using a WIRE_WIRE model is not useful. So use Parallel_Plate.
C_parallel_Plate = E0 *Er * Area / Distance
If you have 5 volts of MCU clock, with edge rate of 5 volts in 5 nanoSeconds, located 1mm away from an analog signal that is 5cm long and 1mm wide, what will be the Electric-Field injected trash voltage?
Assume the analog signal has 10pF total capacitance (opamp Cout, Opamp Cin, and trace parasitic to Ground), and 100 Ohm Rout of the drive-the-trace opamp. (at high frequencies, such as MCU clock edges, Opamps will have high Rout).

simulate this circuit – Schematic created using CircuitLab
What is the coupling capacitance from MCU trace to analog trace. Again assume parallel_plate capacitance, to get a rough idea.
C = 9e-12 Farad/meter * (Er = 1 air, FR-4) * 5cm * 1mm / 1mm
C = 9e-12 Farad/meter * 0.05 meter = 0.45e-12 = 0.5pF
This is plenty accurate, given our assumptions about mechanical topology.
I_displacement = C * dV/dT = 0.5pF * 1 volt/nanosecond
I = 0.5milli * nanoFarad * 1volt/nanosecond and the 'nanos' cancel
I= 0.5 milliamp
Remember we assumed 100 Ohm Rout; ohms law produces 50 milliVolts. For low frequencies.
We have a 5 nanosecond event. At high frequencies, we have a capacitive voltage divider: 5 volts * 0.5pF /10pF = 5v/20 = 0.25 volts
Thus we predict either 0.05 volts for low frequencies, or 0.25 volts for high frequencies. And the MCU clock edge is high freq.
Thus we predict 0.25 volts.
Surprise -----  you should not place a micro-controller clock (or dataline)
very very close to an analog signal.
Your question is about the Temperature Sensor. To compute the Efield upset to the Sensor voltage, we need the Sensor Zout. And we need the dV/dT of the interfering trash.
Notice the Efield coupling gets performed at two frequencies; once you have some confidence with Efields and with the vulnerable nodes of your circuitry, you may choose to use only Low Frequency or only High Frequency coupling math; to do this, you need to model the coupling as a High Pass Filter and be certain your break frequency (the F3dB frequency) is above or below your coupling-frequency.
What is the coupling frequency of 10MHz MCU clock that has 1 nanoSecond edges? I'd use twice the edge-period, or 2 nanoSeconds, that becomes 500MHz.


How long do I have to wait for my offer letter?

Question: It's been nearly two months (next week it'll be 2 months) since I got an email from the Doctoral School at a UK university telling me that I got the place and funding. After 4 weeks of waiting, I emailed them to ask when the letter would be sent out but they gave me no specific answer. Also by chance I learned that someone already received their letter nearly 4 weeks ago. I'm very worried and just wondering how long everyone had to wait to get their offer letters. And should I contact them again about it?
Comment: This is too variable to be useful. Your situation is too unique to get any useful answer here. They will do what they do. But in general, if there is a problem you are more likely to hear about it earlier than later. If you have other alternatives to consider then, yes, contact them. But if you can afford to wait then there isn't much downside. Keep pursuing other options, of course.
Answer: Pick up the telephone. Repeat several times to several people if first call does not get an answer.
Get this resolved within a week.  Have them send the letter express mail.  No more sitting and pining.  If you haven't resolved it by week end, you need to move on and look for a different gig.
Comment: _Have them send the letter express mail._ — In the US, acceptance/funding letters are usually sent by email, but they still have the same legal weight as paper.  Is that not also true in the UK?
Comment: But can they really revoke the offer once they said they would send it to me?
Comment: @JeffE: I'm not sure about this. But they specifically told me in the email that they would send a separate, official offer letter by email so I imagine the email telling me that I got the place and funding was only an informal notification.


Get Month and Day from one column and update another column with same month and day but current year

Question: I have a list for purchase agreements that has a column for start date, what I want is a way to populate another column with the month and day from the start date but with the current year. I assume this can be done through power automate but I can't figure out how.
Comment: Do you need another column editable later on? If no, you can achieve it using calculated column as well. Let me know if you want to do it using calculated column or using power automate only.
Answer: It is perhaps not particularly intuitive, but you want to create an expression using the 'addToTime' function. Something like this:

addToTime(outputs('Get_item')?['body/StartDate'],1,'Year')

where
outputs('Get_item')?['body/StartDate']

is your Start Date field from a previous action in your flow.
See here for a more detailed explanation: https://www.powertechtips.com/add-years-to-date-power-automate/
Answer: If the field is not required to be editable in the future, you can simply create a new calculated column, set as date with this formula:
    =DATE(YEAR(2023),MONTH([Created]),DAY([Created]))

Where instead of [Created] you can add your column name.
You can also use YEAR(TODAY()), but please keep in mind that calculated fields are "recalculated" on item create/edit with TODAY() so you might experience some issue so rather hardcode the correct value like YEAR(2O23) or YEAR([Created]+1) might be more suitable.
Answer: If you don't want to edit values in another date column in future using list forms, you can use calculated column formula for your another column.
Create a new calculated column with formula like:
=IF(ISBLANK([Start Date]),"",DATE(YEAR(TODAY()),MONTH([Start Date]),DAY([Start Date])))

This formula handles the case if Start Date column is blank.
Column Settings:

Output:

Note:

Sometimes comma(,) does not work in formula (it is based on language or regional settings on your site). So in that case use semicolon(;) instead of comma(,).
Use correct display name of your SharePoint columns in above formula.
Wrap column names inside [] if your column name has space in it. For example: [My Column Name].


Converting STL String, and STL Vector into void*?

Question: Ive got some C++ code, that we use to serialize arbitrary data and store it into a specialized image format as metadata.
Anyways, it takes it as a void*. Can i just do a simple memcpy? Or is there a better way to do this?
Answer: STL string may not store the data in a continuos block of memory . Use c_str() method to get a c-style string out of it and serialize it . Since vector stores its data in a continuous manner you can directly serialize it.
Comment: Serialize the vector? Hopefully  you mean by getting the address of the first element and serializing the array, right? (something like `&v[0]`)
Comment: Yes I meant the elements of the vector
Answer: For std::string you can use c_str() to obtain the char* pointing to the internal string.
For std::vector the standard dictates that the elements are contiguous in memory and so you can access the pointer to the beginning of the data as &v[0].
You should of course be careful with these since you are basically handing the library you are using a pointer to the internal data of the objects.  If needed you can make a copy of the data using memcpy using the above as the src pointer but obviously you'll need to take care that you use the correct size. Without knowing the details of the function(s) you're passing this data to it's not possible for us to comment on whether such copying is needed or not.
Answer: As others have pointed out, &v[0] gives you a pointer to the array inside a vector.
However, be aware that serializing data using memcpy is generally not at all portable in C++. The data must be of Plain-Old-Data type (i.e. no non-trivial constructors, virtual functions, user defined destructor or such), but even then you should not expect to get the correct behaviour unless you read it back into to exact same program.
Changing target platform, compiler or even compiler settings can alter the format of the data. The compiler is for instance allowed to and usually will add padding fields in structs.
There are good libraries that allow you to serialize complex data, such as Boost Serialization, if you need to do that. It already has built-in support for std::vector and other standard types.
Answer: The STL Vector stores it's elements in contiguous memory, and therefore you can use memcopy to copy the elements knowing the element size and number.
Comment: Just make sure you copy from the first element (ie &v[0]), not from where the vector object its self is located (ie &v).


Is there any way to test if a function running only on plugin update is successfully running?

Question: Is there any way to test if a function running only on plugin update is successfully running? Right now I am calling function if WP version present in configuration file is not same as plugin version's value in database and so testing by changing value of constant. But is there any other better approach?
Answer:
Is there any way to test if a function running only on plugin update is successfully running?

Yes.
Background
When you update a plugin, WordPress does several actions behind the scenes.

Download the new version of the plugin
Deactivate the old plugin version
Delete the old plugin version
Extract the new version
Activate the new version

In addition to the hooks that WordPress fires during those actions, it fires upgrader_process_complete. This hook passes two parameters to the callback: $this, which is obviously the object instance, and $options['hook_extra'], which are extra arguments passed to the filter hooks called by WP_Upgrader::install_package(). The Plugin_Upgrader class passes the following array:
array( 'plugin' => $plugin,
       'type' => 'plugin',
       'action' => 'update',
)

Upgrader Hook
Therefore, if we want to run a function on a plugin upgrade, we can use this hook.
add_action( 'upgrader_process_complete', 'wpse_262412_upgrader_process_complete' );
function wpse_262412_upgrader_process_complete( $instance, $extras ) {
  //* Only interesting when 'our' plugin updates
  if(
    'plugin' !== $extras[ 'type' ] &&
    'update' !== $extras[ 'action' ] &&
    'my-plugin-name' !== $extras[ 'plugin' ]
  ) {
    return;
  }
  //* Do something useful after your plugin updates
  wpse_262412_something_useful();
}

Checking
If you are developing a plugin and want to makes that a particular function runs on plugin update, then you can add an option to the database:
function wpse_262412_something_useful() {
  include_once( ABSPATH . '/wp-admin/includes/plugin.php' );
  $data = get_plugin_data( 'my-plugin-name' );
  update_option( 'my-plugin-update-option', $data[ 'version' ] );
}

Then we can add an action to init that checks that option value. If the option value is equal to the current plugin version, then we know that the function has run. Then we can make sure we can see that the function has been run, like add an admin notice.
add_action( 'init', 'wpse_262412_init' );
function wpse_262412_init() {
  $data = get_plugin_data( 'my-plugin-name' );
  $option = get_option( 'my-plugin-update-option' );
  if( $data[ 'version' ] === $option ) {
    //* The plugin update function ran successfully
    add_action( 'admin_notices', 'wpse_262412_update_notice' );
  }
}

function wpse_262412_update_notice() {
?>

<?php _e( 'The function has run correctly.', 'wpse-262412' ); ?>

  <?php
}

But is there any other better approach?

Is this better than your approach? I don't know. Depends on your application. It doesn't involve opening and reading a configuration file, so it will likely be faster. But probably not noticeably much. I wouldn't do either method on a production site. Make sure your code works on a development server, then use it. If you're talking about comparing plugin version numbers, that seems like as good as any way to do it to me.


Why don't we take into consideration the rotation and vibration of gas molecules on the pressure of the gas?

Question: While going through the derivation of how to calculate the pressure of an ideal gas we consider only the translation of molecules. Why don't we take into account that the molecules may rotate and vibrate which may change the pressure of the gas under consideration?
Here is the link of the derivation
Comment: How those motions should transfer momentum?
Comment: By hitting the wall.
Comment: which derivation? calculating pressure from what?
Comment: I've added the link.
Answer: "Ideal gas" is jargon for "mathematical model involving point particles with mass and collisions," so it kind of defines away your question as "not askable," but that's an unsatisfying answer.
For a real gas, you get to include other stuff, like the volume of the particles, or (for a molecular gas) rotations and vibrations. Those count as additional "degrees of freedom" in statistical mechanics, and can be considered independently of the components of the velocity along the x, y, and z axes.
For molecular gasses, as you add energy, temperature increases (and along with it, the velocity of the molecules), and at certain temperatures, those rotational or vibrational modes become important.
Here's a graph of the specific heat* (i.e., change in temperature when you add energy) of diatomic hydrogen:
 Source
Note that, at low temperatures, rotational and vibrational modes are not important, and the ideal gas law works surprisingly well (especially if you modify it a bit for the volume of the hydrogen). At higher temperatures, the ideal gas law will lead you astray. The surprising thing is how well it works at low temperatures.
* Technically the specific heat at constant volume
Comment: Thank you brother.
Comment: Sources online say that the ideal gas law breaks down for _low_ temperatures, rather than high ones. Also, doesn't ideal gas law work decently for, say, O2 and N2 around room temperature? Based on that graph in your answer, rotational energy should already be relevant at those temperatures. I'm still lost here
Answer: For an ideal gas, e.g. point like masses, rotation and vibration cannot store energy. For low temperatures and symmetric molecules this is also true for real gases as an observational fact.
For some real gases, however, rotation and vibration must be taken into account., see e.g.
https://en.m.wikipedia.org/wiki/Heat_capacity_ratio


Viber deleted, but my account is still shown on my friends' Viber contacts!

Question: I have deleted Viber app from my phone, but my account is still shown on my friends mobiles as a Viber user.
Is it a bug? What do I have to do to remove my account from my friends mobiles?
Answer: Uninstalling the app won't deactivate your Viber ID. If you want to deactivate your Viber ID, you have to reinstall Viber and do the following procedure:

Open Viber on your Phone
Tap on More
Tap on Settings
Tap on Account
Tap on Deactivate account
Enter your phone number
Tap on Deactivate account again
If you have a PIN enabled, you will be asked to enter your PIN
Tap Deactivate to confirm

More information: Viber Support Knowledge Base - Deactivate or Uninstall Viber on Your Phone
Answer: When you register a Viber account, that account is directly associated with your phone number (same case with Whatsapp) If another person who has Viber installed on their phone has you in their contacts, Viber will scan the contacts (which is why it needs accessing to your contacts as a permission) crosscheck them with the database and match your number with your account.
In shorter words: You deleted Viber application, not your Viber account.
If you want to delete your account then do as following:
Viber > More Options > Settings > Privacy > Deactivate Account
Answer: This is proper behavior. Account deactivation would impose a flaw.
In addition to what was said in other answers there is a normal scenario that you may want to continue using the same Viber account in other phones, tablets or PCs (Windows, Linux).
Therefore expectation that Viber should deactivate your account when you remove the app from a device is what would be unacceptable for practical use. It is like deactivation of your mailbox when uninstalling your e-mail client.


How to execute "php artisan migrate" and other Laravel commands in remote server?

Question: I'm using Laravel 4.2 in remote server and I want to execute Laravel commands php artisan migrate but I don't know how.
Comment: Is your remote server Linux? Do a web search for "server SSH tutorial", that should cover it. Check with your hosting provider that SSH access is provided. If not you might have to run these commands via a script, which is not ideal.
Comment: (Please note that questions this brief, and not featuring any evidence of prior research, will usually be closed here).
Answer: You can ssh to the server and perform the command, you can add your servers public key to the remote server to do this without a password. I made a bash script with the following code which I can then execute manually via command line or from a program, lets say I call it myscript.sh with the following code
ssh firstname.lastname@example.com << EOF
cd /var/www/app/;
php artisan migrate --force; // force prevents artisan from asking for a yes/no on production
exit;
EOF

now I can write 'sh myscript.sh' and it will run migrations on the remote server.
Answer: The preferred way to do this:

ssh into your server (for example, username root & server ip 220.127.116.11: ssh email@example.com).
go to your project folder (for example: cd /var/....)
run the command php artisan migrate.

Original post (not the best way):
You can setup a cronjob like this:
* * * * * /usr/bin/php /var/www/app/artisan schedule:run

This will run every minute and run the migration.
You can change this to everything you want.
If you want to open a url what while be excecuting the command.
Use this code:
Artisan::call('migrate');

Hope this works!
Comment: Why would you use cronjob to run migrate every minute?
Comment: It's an example, he could also call another command like: `php artisan schedule:run`
Answer: For the completeness of this article, you do this with Windows host using PS remote (enable first) then...
$Username   = "{domain}\{domain account}"
$PasswordSS = ConvertTo-SecureString '{domain account password}' -AsPlainText -Force
$Cred       = New-Object System.management.Automation.PSCredential $Username,$PasswordSS

Invoke-Command -ComputerName {server name} -ScriptBlock { cd d:\wwwroot\{website};php artisan migrate } -Credential $Cred

This will return the result to your local machine.
I use this in VSTS release deployments all the time.
Answer: With Mac terminal
Step 1
sh firstname.lastname@example.com e.g 126.96.36.199
Step 2
Enter your password
Step 3
cd /home/admin/web/yourdomain.com/public_html
Step 4 Laravel command:
"php artisan migrate"
Without the "quote"
Ask your host for your IP address and Password if not known by you.
Answer: The solution to this problem could be running once a php code (on the server) like this:
<?php
// installation.php file
echo exec('php /var/www/laravel-app/artisan migrate:install');

and than you need to visit installation.php in your browser.
After migration you should remove the installation file, so nobody can execute it again


Is it OK to use Pulse & Wait? Or it is evil and a cause of write-only code?

Question: Monitor.Pulse/All and Monitor.Wait are useful methods, but I'm getting complaints that when using them in large quantities (I have a DSL designer that spits them out by the dozen), the resulting code becomes unreadable. What do you think?
Answer: If it's sprinkled all over code that you actually have to read, that could be a problem. Why does it come up so often in the first place? Could the functionality actually be encapsulated somewhere else?
Fundamentally there's nothing wrong with Wait/Pulse - but like everything else in life, if it's used inappropriately it will become a problem. Whether or not your use is inappropriate is hard to tell without seeing the code :(
Answer: I'd really advise against this approach - from the MSDN page on PulseEvent:

A thread waiting on a synchronization object can be momentarily removed from the wait state by a kernel-mode APC, and then returned to the wait state after the APC is complete. If the call to PulseEvent occurs during the time when the thread has been removed from the wait state, the thread will not be released because PulseEvent releases only those threads that are waiting at the moment it is called. Therefore, PulseEvent is unreliable and should not be used by new applications. Instead, use condition variables.

Now, Monitor.Pulse might be written using something other than PulseEvent, but the whole concept is pretty flawed - use locks and condition variables properly.
Comment: Pulse doesn't have this issue. The whole concept *isn't* flawed, and the equivalent has safely been used in Java for years.
Comment: Well I've already used it quite a bit, and had no problems so far (apart from people complaining).
Answer: Sounds like something that should be coded by injection as an aspect.  However, my knowledge of the support of AOP in C# is negligible, so I can't offer any more than that.


Remote Sense Self Adjustable Power Supply

Question: I been looking for an off the shelf power supply that can adjust its output voltage to compensate for losses, in my case in transmission line. Searching on DigiKey, I narrowed down my search to power supplies with remote sense feature. For example EMH250PS18 states "Remote Sense Compensates for 0.5 V total voltage drop", another vendor and model MVPS600-1015 state "Output Adjustability +/-3%". In practice I see it adjusting its output to ~5V over nominal 15V. However, adjusted voltage drifts over time, which worries me that it eventually will drop too low for my device to work. At 15V output 0.5V doesn't give me much in terms of current I can deliver to the load. Ideally, I would have larger cable but for now I have to work with what I have which is 24AWG. Anyhow, does anyone know which of the shelf power supply can adjust its output to say +/-5-10V? Is there other ways to compensate for losses in transmission line? Ideally without building custom board.
Comment: I think 3.5A over #24 wire is excessive at any length.  You could start with a much higer voltage (48 V?) to reduce the current, then use a DC-DC converter at the load to reduce the voltage to what the load requires.
Comment: Remote sensing *is* the way, and is never meant to compensate for gross losses (i.e. if you're losing 5-10V between your source and load at 15V on the PSU output, you need to significantly beef up the copper between the source and the load).
Comment: Thank you Adam. I suspected that maybe the case. 3.5A at 15V over 30m of 24AWG cable isn't ideal. Was hopping there maybe a solution I am not aware of.
Comment: If you don't have anything but 24 AWG wire, use like five of them in parallel if you absolutely need 3.5 amps--that stuff's *way* too small for so much current!
Answer: A straightforward way to compensate for transmission losses is to transmit a higher voltage and then put a DCDC step down converter at the far end. The higher voltage means lower transmission losses, and the regulation on the step down converter automatically compensates for any line loses resulting in a constant voltage regardless of load.
Since you only need 15v at relatively low current, you could buy an inexpensive 24v power supply and Buck converter for a few dollars on digikey, Amazon, etc.
Comment: @semenoff - Yours is a common problem, addressed by [Point-of-Load or Point-of-Use converters](https://www.google.com/search?q=%22point-of-load%22+%22POL%22+converters), which is basically what this answer describes,  and is probably a good way to solve your problem. Pumping too much power through those wires wastes energy as heat. Whereas beefing up the copper for such a low transmission voltage would be very expensive, much more expensive than a boost converter at the source and a buck converter at the destination. I suggest 40v at the source. Please accept this answer.
Comment: Agree, Buck converter on receiving end and higher voltage is a way to go. I was trying to avoid rework to the device on receiving end but sounds like this is what we have to do. Thank you for your answer and suggestions.


what is conduction loss in a transistor(BJT)? how is transistor's conduction loss lesser than that in a mosfet?

Question: why does a MOSFET have higher conduction loss compared to a transistor? While designing switching circuits , driver circuits controlled by a microcontroller, how should i select a switching device(i.e; where should i use a BJT/MOSFET)?
Comment: Eerrrm, MOSFET = Metal Oxide Semiconductor Field Effect **Transistor**. A MOSFET is a transistor... You need to clarify your question.
Comment: Do you mean compared to a BJT (Bipolar Junction Transistor), or maybe to a JFET (Junction Field Effect Transkstor)?
Comment: In older texts, "transistor" often means BJT. It's archaic terminology, but I'm not sure I'd call it wrong. That being said, some context for the question would be nice.
Comment: sorry ..! by transistor ,i mean a BJT! it is said that an IGBT combines the best qualities of a BJT and  MOSFET. so ,is lower conduction loss of BJT utilised in a IGBT?
Answer: MOSFETs do not necessarily have lower conduction loss than BJTs- in fact in many cases (especially at low voltage) a MOSFET can do much better. For example a 5m ohm MOSFET switching 100mA (grossly overrated, but I digress) will drop only 500uV. A BJT might drop tens of mV at best.
IGBTs can have competitive conduction losses with MOSFETs if they are both high voltage rated but they tend to be worse if the voltage rating required is low for both types being compared. Often they drop between 1V and 2V at operating current.
BJTs require a lot of base drive current, even just sitting there 'on', whereas IGBTs and MOSFETs require current mostly when they are switching, and only leakage when they are on or off. The base current represents some loss in the transistor and some in the base driving circuitry. MOSFETs and IGBTs can require significant drive current when being driven at high frequency.
IGBTs don't combine the best of both in all ways, or they would be used more often. They're more of a niche product for high voltage (hundreds of volts and up) application. They tend to be a bit sluggish and may require negative bias. They do combine the low static base drive current with the small die size (meaning reasonable cost) for high voltage devices of a given current rating.
If you want a 1000V 10A device to switch at 25kHz the IGBT will look pretty good. If you want a 50V 30A device to switch at 200kHz, a MOSFET will be attractive. BJTs are very useful at lower currents and in some high voltage switching applications.
Comment: thank you..! so the potential drop across the device when "on" is the conduction loss, is that right? if i am wrong please explain what is conduction loss ?
Comment: The power loss (ignoring drive) is just the voltage across the device times the current it is conducting, so yes, it's directly proportional to the voltage drop. MOSFETs and BJTs (and IGBTs) behave differently as current increases - MOSFETs are almost like a resistor for low drops, the other guys behave in a more complex manner.
Answer: In basic terms:

BJT transistors are relatively low-impedance, current-driven devices. They amplify Ibe or Ibc to a higher value Ice or Iec.
FET (MOSFET, or JFET) transistors are relatively very high-impedance, potential(voltage)-driven devices. An extremely low motion of electrons (more capacitive that resistive) 'charges' carriers in a channel, allowing (or blocking) current flow through the source & drain of the device.

For my uses, I select a BJT when I want to work with a lower-impedance signal, and select a FET when I need to buffer a high-impedance signal.


Do vibrations increase an object's mass or weight?

Question: does a vibrating object recieve an increase of mass or weight? and if it does, at what frequency or intensity does it need to vibrate at, and what is the rate of increase? is there a formula for it? and also, is it possible to change an onject's state with vibrations alone? like from gas to solid, or liquid to gas. i know something similar can be done with both heat and vibrations which create plasma. but can it be done with vibrations alone?
Comment: Did you hear about Einstein's theory of special relativity?
Comment: yeah, but i don't really understand it. i'm like, 16 and from a backwater country so i can't say i'm very knowledgable about physic theories. care to explain?
Comment: Yes, I would recommend you watch pbs space time on their videos about mass. Short answer is E=mc^2. For your other question I don't know what your definition of vibration is because heat is vibrations...
Comment: really? i thought heat was a byproduct of vibrations, or vibrations being a byproduct of heat. never thought of them as the same entity
Answer: @Mortimer The Third Great to have you on the site! Weight and mass are separate but related quantities. Weight is the force exerted by gravity on mass. At least, that's what physicists believed until 1905, when Albert Einstein published his ideas on relativity. It became clear that mass of an object is just the total energy of the object at rest, up to a factor of $1/c^2$. So if you raise the temperature of an object by causing internal vibrations to increase, then its mass and thus its weight will increase.
Here is a link to a discussion onbooks on relativity for beginners.
https://www.quora.com/What-is-the-best-book-for-self-learning-Special-and-General-Theory-of-Relativity-What-are-some-beginner-and-advanced-level-books-on-these-topics
Answer:
does a vibrating object receive an increase of mass or weight?

It all depends on the framework and the frameworks depend on the magnitudes of the variables.
In the everyday dimensions of classical mechanics, classical electromagnetism, and thermodynamics the answer is "no". *Mass is a conserved quantity *, defined as
$F=ma$
usually this m is called the inertial mass, the resistance to a change in velocity ( acceleration)
and heating will not do anything to the mass on a scale or in interactions. All commerce of products on earth depends on having the mass a conserved quantity.
When the velocities of the objects become very high, one needs a different framework for compatibility of the mechanics model with the data. In that model the inertial mass changes, the higher the acceleration the larger the resistance, and that is the famous $m$ appearing in $E=mc^2$ . This is [called relativistic mass,]1
$m_{rel}=E/c^2$
where $E$ is the energy of the object and $c$ the velocity of light, and this is with the algebra of special relativity.
This will be useful for calculating how much fuel is needed to reach velocities close to the velocity of light in star travels.
Special relativity has to do with four vectors, and relativistic mass has fallen by the wayside, as a quantity that is a function of velocities and not invariant.
What is used and characterizes particles and ensembles of particles in the small dimensions  is the invariant mass, the "length" of the four vector of a particle , or the length of the sum of the four vectors for an ensemble of particles.

Energy and momentum are conserved quantities in inertial systems in special relativity and one can easily keep track of the energy budget in this formalism.
Note that the invariant mass is only conserved for the individual particle. The addition of four vectors does not lead to the sum of the masses as the invariant mass of the sum. One has to calculate it. Only when all  the particles are at rest, no velocities, the masses can be summed, and they represent, according to the special relativity algebra, the minimum energy of the system.
Thus, when having particles in motion, the addition of the fourvectors will give a fourvector with a mass larger than the rest mass. If, as it happens in nuclear physics, where nuclei are bound, the addition of the four vectors of a bound system will give a mass smaller than the sum of the constituents. Example is the deuterion, the nucleus of deuterium, composed of a neutron and a proton:
The sum of the proton and neutron masses is  2.015941 u
while the mass of the deuterion is           2.013553 u   , smaller, because it is a bound state.
one $u =  3.9654 x 10^{-30}$ kg
This is true for all bound states, and the everyday objects are all bound states by the electromagnetic interaction,  so it should hold that the sum of the fourvectors will add up to an invariant mass smaller then the sum of the masses of the constituent.
Within this caveat, if energy is transferred to a crystal and it starts vibrating , without breaking up, it means that there is less binding energy in total and this will be evident in the sum of the four vectors of the constituents, which will be larger, and thus the invariant mass of the crystal will be larger. The effect though will be very very small, note the values above,  and not detectable with the scales we use to measure and weigh masses. Only with very accurate experiments specially designed one would be able to see the difference

is it possible to change an object's state with vibrations alone? like from gas to solid, or liquid to gas

If you consider boiling water as vibrations transferred from the heat input to the body, yes. Change of phase happens by breaking energy bounds.


Height of recursion tree vs the levels

Question: I read that the height of tree is lgn for base=2 and number of levels are lgn+1. What's the difference b/w both? Aren't they including top most level in the height calculation or the base cases? Can someone please prove me this with some practical example using more grammar instead of Mathematical equations?
Comment: where did you read this? context matters. references plz.
Comment: @KarolyHorvath Introduction to Algorithm 3rd edition by Cormen. It's from the third 4th chapter( Divide & Conquer)
Answer: First, the height of a balanced tree is O(lg n); a completely unbalanced tree (such as a linked list) has height O(n).
The height of a node is its distance from the root (and thus the height of a tree is the maximum distance of any node from the root). From this definition, you can see that the height of the root is 0, its children have height 1, their children have height 2, and so on. A level can be considered all nodes with the same height.
Now consider the set of levels in a tree. The only way to have 0 levels is to have an empty tree; as soon as you have even a single node, there will be at least one level, the one containing the root node with height 0. That is, there is a differene between labelling levels and counting levels. Level 1 is the node with height 0; level 2 is the set of nodes with height 1, level i is the set of nodes with height i-1, until you get to level lg n + 1 consisting of nodes with height lg n.

Height of recursion tree vs the levels


How can a book's copyright year be in the future?

Question: I recently noticed that in the book "Investing for Dummies" by Eric Tyson, the copyright is listed for 2021, even if at the time of making this post the year is still 2020. How is this possible? How can a copyright year be in the future?
Copyright and Publishing information for the book
Comment: Well, the 2021 models of cars are out now, so why not books?
Comment: The second listed answer does answer my question, yes. Unfortunately, I only looked at the top answer to that question, which seemed confusing to me, especially as it stated that "[t]he date shown is more than likely the date that they received confirmation of the copyright registration from the office." On seeing that answer, I thought: how can the US copyright office confirm a registration in the future? The second answer, as well as the answer to the question I accepted, seems to answer my question more directly, however. Thanks!
Answer: As I understand it, anything published after a certain date, possibly in September, gets the following year's date. It is merely a convention. I don't know if it started with publishing textbooks or not, but that would make a bit of sense. The academic year starts in September in many places.
The convention may only apply to certain kinds of books and only in certain places, but the practice is long standing.
Copyright is very long now, but back when it was shorter an extra year meant something. And publishing late in the year would, in essence, be giving up a year of protection.


Multiple 30A outlets on the same breaker

Question: I am upgrading my Garage/Shop electrical installation and adding a few 30Amp circuits. Is there any electrical code restrictions to have multiple 30A outlets on the same 30A breaker?
Comment: BTW: is this circuit 120V only, 240V only, or 120/240V?
Comment: The circuit is 240v only.
Comment: We've gone crazy looking for this in code, and have not had any luck.  We can't find anywhere in Code where it says you can't.    No one piece of plugged in equipment can exceed 80% of load, but then that's the rule *anyway* because of continuous-load rules.
Answer: No, as long as you don't overload the circuit of course
This is stated most clearly in NEC 210.23(B):

210.23 Permissible Loads, Multiple-Outlet Branch Circuits. In no case shall the load exceed the branch-circuit
  ampere rating. A branch circuit supplying two or more outlets or receptacles shall supply only the loads specified
  according to its size as specified in 210.23(A) through (D)
  and as summarized in 210.24 and Table 210.24.

...

(B) 30-Ampere Branch Circuits. A 30-ampere branch circuit shall be permitted to supply fixed lighting units with
  heavy-duty lampholders in other than a dwelling unit(s) or
  utilization equipment in any occupancy. A rating of any one
  cord-and-plug-connected utilization equipment shall not
  exceed 80 percent of the branch-circuit ampere rating.


Why did my tablet just suddenly stop wanting to charge?

Question: I have a Samsung Galaxy Tab Lte and when I plug it in with its original samsung wall charger that charges any other samsung device I have, It's not charging or showing the charging icon. This just happened suddenly and have never had a problem. It doesn't matter if my tablet is on or off and I have cleared all of my apps. Earlier I left it off and on the charger for two hours and it's charging levels rose two percent. What can I do ????
Answer: Sometime the charging part jack in which you enter the chager in tab was damaged or become useless because some shocks or may be broken down so when you push the charger pin inside the tab and push it downward then it start charging this pushing work is of jack but if your jack is useless then you have to slightly push down the charger pin when inside tab. The jack is damaged or not you may know from an expert or from repair shop. But try pushing down slightly the pin near tab wheb it is inserted.


Is the drag coefficient/velocity of of a vehicle based on frontal area?

Question: Does the frontal area of a vehicle determine the velocity/drag coefficient of a car?
A Ferrari 458 has a Cd of 0.33 while a Corvette C6 has a Cd of 0.29. Does this mean the Corvette will have less frontal area and more speed while the Ferrari should make more downforce?
Comment: Treat it as an empirically determined, magical fudge factor. Emphasis on the *magical*.
Comment: Does this mean the Corvette will have less frontal area and more speed while the Ferrari should make more downforce? No, and no. That might be what is happening, but you can't deduce that from Cd.
Answer: The drag coefficient $C_d$ is defined as:
$C_d = \dfrac{2F_d}{\rho u^2A}$
where:

$F_d$ is the drag force, which is by definition the force component in the direction of the flow velocity;

$\rho$ is the mass density of the fluid;

$u$ is the flow speed of the object relative to the fluid;

$A$ is the reference area.

The answer to your first question is "Yes, the reference area for automobiles and many other objects is the projected frontal area of the vehicle". However, the drag coefficient is usually determined experimentally, and the known experimental results indicate that it also depends on the objects' shape as shown below, assuming the reference area is constant for all cases:

It is to be noted that the "shape" also influences the "drag force", in turn,  the "down thrust", as $F_d = f(C_d, \rho, u, A)$, and $u = f(C_d, \rho, A, F_d)$. So, owing to the complex inter-dependencies, there is no simple answer to your latter questions.
Answer: No Cd is not directly related to the frontal area, it has to do with how much that frontal area moving against the stream of air has to fight drag.
For example, consider the old semi trucks' trailers. Because they were boxy they had a large Cd and needed a lot of fuel for even a smalled frontal area.
In modern trailers, they have round corners and adjustable trailer skirts at the end to make them more streamlined.
So a modern trailer with a larger frontal area has a smaller Cd and produces less drag and is much more fuel-efficient.
If we pick two identical cubes and compare them they have identical Cd. Now if you add a half sphere to the front and end of one of the cubes, Its Cd drop to almost half of the other cube.
Answer: The $C_D$ is a convenience factor used by engineers to simplify fluid mechanics for cars and aerodynamics.
A simplified explanation is that the $C_D$ normalises the aerodynamic drag to the frontal area, so that is easier to compare different vehicles.
The statement

"Does the frontal area of a vehicle determine the velocity/drag coefficient of a car?"

to me implies that the size of the frontal area affects the $C_D$ (it implies that the larger the area the greater the $C_D$ or vice versa. However, the $C_D$ it largely independent of the frontal area, although it is calculated from it.
$$C_D = \frac{2\cdot Drag}{\rho u^2 A}$$
where:

$Drag$  aerodynamic force
$\rho$ air density
$u$ is velocity
$A$ is frontal area.

So for example, changing the angles on a rear spoiler, has zero to little effect on the frontal area, but it can change significantly the $C_D$. In that respect those two are independent.
The one case I can think of (there are probably others) that $C_D$ depends on the frontal area, is when the frontal area becomes too small, and therefore the Reynolds number is significantly affected. However, this is probably not too relevant to cars.

So regarding the statement:

Does this mean the Corvette will have less frontal area and more speed while the Ferrari should make more downforce?

Speed is depended on a number of things. I.e. the engine horsepower is important, the gear shift ratio, wheels etc.
Therefore:

you can't make an assessment of the frontal area based on the $C_D$
$C_D$ is responsible for the drag while $C_L$ (coeffient of lift) is responsible for the downforce (Although there is a correlation between $C_D$ and $C_L$).
you can't make an assessment for speed. See below. Which of the two would you think has the highest speed.

Image
$C_D$

Aptera -2

0.15

Buggati chiron

0.38


how to see updates on questions I commented on

Question: in Stackoverflow, I happen to just post a comment on someones question; yet whenever that question is updated or receives answers or comments, I don't get any warning whatsoever. How do I activate that or manage those questions?
Answer: You can favorite that question so that whenever there are any updates to it, you'll be notified regarding that. This is the most you can get out that because there is no such facility on SE to subscribe a question for any updates on it, as of now.
You can read "How do favorite questions work?" for a more detailed information on it.
Comment: @R.J It would be a poor option. Coz, If any updates has been happened in the question, We will not be knowing until manually went to have a look the question.


Will a reference-request tag be made available in the site?

Question: In relation to the question I asked here I was looking for a reference-request tag, similar to the one available in Matter Modelling Stack Exchange. I managed to get stellar answers with references even without the tag, but it would have been great to have such a tag, to explicitly indicate that references would be appreciated. The use case would be when someone asks for a specific design choice and is requesting references to back up the provided answers. So is there any chance such a tag would be made available?
Comment: There is nothing wrong in writing like that. My thought was that such a tag would make it easier to sort those kind of questions.
Comment: What is wrong with simply asking "please provide references" in the question?
Answer: This is Private Beta.
This might sound crazy, but everyone, including you, has enough reputation to create tags:

The tags that we currently have, were made by users creating them based on their own judgement.
If a tag gets created and becomes a matter of dispute, users can propose edits which burninate the new tag, and these will enter the review queue. If users disagree with the result of that process, they can raise the matter here on Meta.
Your question mentions that you have been active on MMSE. I'll mention that on MMSE there's a tags chatroom which is another place in which tag-related discussions can happen in addition to the site's Meta, but it's not clear yet that such a room is necessary here at PLDI.
Comment: Also: before creating a new tag for one's own question, it's a good idea to search for other questions that the tag should also be added to. If there *are* any, add the tag to them too; but if there *aren't* any, think twice about creating the new tag.
Comment: @RayButterworth I agree with both of those suggestions. I can edit them into my answer when I'm on a computer.
Answer: I'm not sure such a tag is necessary; it seems like a meta tag to me ─ it describes what form you want an answer to take, not the topic of the question.
Meta tags can be allowed here if we choose to allow them, but I don't think the community has made a firm decision on that yet. We already have at least one meta tag pros-cons, and there's a discussion here about whether that tag should exist, with no consensus reached yet on whether meta tags are OK.
So I'd say that for now, it's fine to unilaterally create tags for topics or concepts, but probably best to hold off on creating meta tags until there's some sort of community agreement about them. It sounds at the moment that you're already getting references in answers without using this tag, so perhaps this one is not necessary. If you want to be explicit about encouraging answers to include references, I think it's fine to write that in the question.
I should add that questions shouldn't only ask for references.


Send fake response(?packets) to a program

Question: So my idea was.. There is a program that require login to be able to use(the program should work offline aswell not requiring any online data), so i want to make that program to be able to run offline aswell, so what i did is i captured the packets (with wireshark) that moved to the program while logging in, next i tried to replay (with bittwist and colasoft packet player) those packets in offline while trying to log in in the program with that i tried to fake log in, but it not seems to work, the program doesn't receive or accept those packets. What's wrong with my idea or method or how should i do this?
Comment: it want packets i guess, when i am in offline and i try to log in, it sends packets to the server(sure it won't arriva and won't get answer aswell since offline), and awaits for answer, at that time i send the packets but the program doesn't receive or accept those packets.
Comment: This should be on reverse engineering. But it might have a challenge response in there, still check for internet connections, have checksums etc.
Answer: You are trying a replay attack.  Those who design protocols know about replay attacks and try, usually successfully, to defeat them.  Often that's done by using a timestamp or a random number (called a "nonce" by cryptographers) in a hash that's attached to a message.
You can find some detail here: http://en.wikipedia.org/wiki/Replay_attack
Comment: @drpexe: Citation needed.
Comment: This is considering that the software uses some kind of replay protection. Which most dont
Comment: Ok, saying that most of application don't use replay protection without justifying was not the best argument. Thanks for pointing that out!

What I mean is that applications have 2 categories: those that use a secure protocol (such as HTTPS) with replay protection and those that don't.

If the application don't use a secure protocol,, it's VERY LIKELY that the application doesn't have any replay protection. Yes, the developer could have built his own nounce or MAC algorithm, but it would be way easier if he just implemented a secure protocol.
Answer: Is the connection encrypted? If it is, then probably they also use some kind of replay protection. This means that there's not much you can do. Maybe if it's HTTPS you could forge a certificate and add to the root certificates on your PC. I saw this being done to defeat need-to-stay-online games.
If not, you could look at the information on the packets and write a simple authentication server with python (or something similar). Just look at the patterns and reply something meaningful. This is more guaranteed to work than simply replaying packets and it's not really difficult.
Forgot to mention: To make the application send packages to your local server and not the online server, you could edit the HOSTS filename in Windows.
Comment: drpexe can i talk to you directly? like skype or something.. here is mine dezyje (skype)


Disabling screen record protection for specific app using adb

Question: I need to record the screen of an specific app that won't let me do for security reasons. Generally I'd use AZ Screen Recorder but it appears black in this app.
I know it's possible to install some things or plug into the computer to record, but is there a way to disable this record protection on the specific app using adb? Maybe change a flag or something?
Answer: There are two possibilities:

Modify the app removing the screenshot protection. However this is not that simple, as the protection is not application-wide but can be set for every activity (screen in the app) individually. Furthermore the protection can be set using the layout definition (xml in the resource) and/or using Java code (FLAG_SECURE). Both could be accomplished using apktool to decompile, modify, recompile, and sign the app - but this requires a lot of knowledge.
Use a rooted device and a screen recorder that can make use of root permissions. Usually this bypasses the screenshot protection.


Raspbian OS in Windows7

Question: I want to practice Raspbian OS in my windows system(Windows 7 64-bit). Please suggest best and safe application
Comment: you can also use "raspbian for desktop" either as a bootable "live disc", or inside a virtual machine in windows, or even replace windows altogether (this last option is probably not what you want)
Comment: windows 7 64 bit is an *operating system* for an amd64 instruction set (intel or amd cpu) ... raspbian is also an *operating system* but for an arm6/7 cpu ... so the options are very limited - search for "raspberry pi emulation windows QEMU" and you'll find what you probably want
Comment: Of course you may want to convert your Windows PC to dual boot a Linux distribution - Debian is, by definition the most comparable to Raspbian as the latter is derived from it, and from the command line things will look very similar. As it happens I am using such an arrangement (well I triple boot FreeBSD but that isn't relevant here) myself - though I do have to take care that when working in a terminal window that I know whether I have `ssh`-ed into the RPi or not...!
Answer: Get Oracle Virtualbox (it's a free download from https://www.virtualbox.org/) get Debian Stretch X86 (32-bit) from https://www.raspberrypi.org/downloads/raspberry-pi-desktop/ and boot that in a Virtualbox.
Comment: You can use the Raspberry Pi Desktop, linked to by Dougie, to make a bootable USB pen drive, and if you enable persistent storage, you have an experience very much like a Raspberry Pi running from flash.
Comment: Do you feel that it's worth mentioning that Debian Stretch X86 is not exactly the same thing as Raspbian? I think your answer is a good one, but perhaps in a somewhat limited context, and/or it might confuse the point that Raspbian's ARM code can't be emulated under VirtualBox.
Comment: No, because to the naïve user it's virtually indistinguishable from Raspbian on a RPi.

Raspbian OS in Windows7