Control single-light LED strip 24v with Raspberry pi and mosfet

Question: I'm trying to make my LED strip fade-in and fade-out by using Raspberry-pi 4, unfortunately for me, I am not an electronic expert. Every tutorial I saw so far was for RGB LED strips and I have a single-color(3000K) LED strip with just 2 pins (+ & -).
Im have:

LRS-50-24 datasheet
30N06L datasheet
4m LED strip single color (3000K) 24V
Raspberry Pi 4

My question is how to connect the MOSFET and the LRS-50-24 to the PI in order to control the fade-in/out by GPIO python code?
Appreciate any help
Comment: @tlfong01 the gate-source threshold voltage is too high for a 3.3V logic level. Vgs,th should not be more than half the logic voltage at most, especially if you switch high currents. So my judgement is: the mosfet is not suitable and it will become hot and may fail.
Comment: I see, the IRLB8721 appears to be unsuitable, too. Its Vgs,th is 2.35V, but you need a mosfet with no more than 1.5V. Ideally, you want to measure 24V when the mosfet is off and 0V when it is on.
Comment: @tlfong01 I bought it at a local store, I don't have much information about it except its 24V, 10Watt per meter and 3000K
Comment: @tlfong01 I dont see the wiring diagram in that video, could you check the link?
Comment: (4) Your power mosfet's "Gate to Source Threshold" voltage Vgs(th) is (3V3 ~ 5V) logic level trigger.  So you can use a jumper wire to connect DC voltage, say from a battery 3V to 6V to the gate terminal of the mosfet, which should switch on and light up your LED stripe. ***WARNING***: Me just a friendly hobbyist, No guarantee no nothing wouldn't blow up or melt down. Good luck.  Cheers.
Comment: @SimSon what kind of mosfet do you suggest to use?
Comment: @Simson, I agree the OP's mosfet is not the best choice. I used to use IRL540N and found it OK for 3V2 logical level input, for "small" currents < 3A. An alternative is BSS240N. Imgur does not allow me to upload rubbish too frequently. So uploading BSS240N as an answer.
Comment: As I said, I suggest to use a MOSFET with a Vgs,th of no more than half the logic level voltage *at max*.
Comment: @SimSon good news. I replaced the MOSFET with IRLB8721 and it's working. BUT the power of the LED lights is very weak... why is that? reminder - it is 24V LED strip with 10watt per meter
Comment: Can you messure the voltage between drain and source? In case the mosfet is fully on it should be in the range of millivolts.
Comment: @SimSon when led turned off its 8.2V and when turned on (full bright) its 4.72V
Comment: @SimSon what other features I should look up for when searching for the right mosfet? other than Vgs,th <= 1.5V. Any recommendations on how to search for it?
Comment: Well, voltage and current ratings are trivial. Next priority is Vgs,th to be as low as possible. When switching currents of more than 1A, the last thing is an on-resistance Rds,on as low as possible, as this will determine the final voltage drop (U=RI) and power dissipation (P=RI²) in the mosfet. But the most critical feature when controlling mosfets with a Pi really is Vgs,th. Search for "Logic Level MOSFETS".
Comment: @SimSon I tried looking for one here https://www.digikey.com/en/products/filter/discrete-semiconductor-products/278?s=N4IgTCBcDaILYHsDOAzApgFxAXQL5A but none have all features you recommended. I will really appreciate if you could help me find one or two which fits
Comment: Please let us know which led strip you are playing with: (1) Aliexpress 24V 4000k Led Strip:
https://www.aliexpress.com/cheap/cheap-24v-4000k-led-strip.html
Comment: (1) Ha, if you are sure it is 24V, then you can take a small risk and test it with your 24V high class power supply, which should have short circuit protection. (2) You just connect 24V directly to the LED stripe and see if it lights up (I guess you might have tested it this way already. :)).(2) Your power MOSFET seems N-channel, so you should use it as a "Low side switch", see this wiring diagram: https://i.imgur.com/v5KszyF.jpg. (3) Please let me know you know more or less I am talking about.
Comment: @Omn, sorry, I gave you the wrong link. I have edited my post. Please try again.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/120535/discussion-between-sim-son-and-omri).
Answer: Non Answer
(1) This is not an answer, but just a temporary place to upload pictures.  So this non answer would be deleted later.
The OP's MOSFET can be replaced by the following.

(2) The OP's mosfet 30N06L has a similar Vgs(th) spec to my favourite IRL540N. So I guess there is big chance it can happily entertain the OP's low current LED stripe.


What does Islam say about unintentionally passing a contagious disease that kills someone?

Question: A person is sick but still goes on work.He knows he is somewhat sick,but still goes to work without considering the potential harm he could be doing to the vulnerable ICU patients by going to work with sickness .In an extreme case that someone or some people die from a sickness unintentionally passed on by this worker ,is this worker considered a killer in Islam.
Comment: Why would he encounter an ICU patient at work?
Comment: My understanding of an ICU patient is that of a person that can -in best case- barely walk a few moves.
Answer: Many scholars began books with the below Hadith. Imam Al-Bukhari commences his book of Hadith (Saheeh Al-Bukhari) with this Hadith and explains that every action that is done without seeking Allah's pleasure is invalid and devoid of reward.

Narrated 'Umar bin Al-Khattab:
I heard Allah's Messenger (ﷺ) saying, "The reward of deeds depends
  upon the intentions and every person will get the reward according to
  what he has intended. So whoever emigrated for worldly benefits or for
  a woman to marry, his emigration was for what he emigrated for."
  Sahih al-Bukhari 1

It is possible that the limits of the saying, 'actions are by intention', are that the action is good, corrupt, acceptable, rejected, rewarded, or not rewarded according to the intention. Therefore, this statement informs us of the Islamic ruling concerning this: the correctness or incorrectness of the action is in accordance with the correctness or incorrectness of the intention.
The saying of the Prophet (PBUH) after this: 'and for everyone to what he intended' informs that one can not gain anything from his action except what he intended. So if he intended good, he gets good. If he intended evil then he gets evil. This second statement (of the Hadith) is not merely reiterating the first, because the first statement points to the fact that the goodness or corruptness of the action is according to the intention necessary for that action to exist. The second statement points to the fact that the reward of a person for his action is according to his good intention, and that the punishment for his action is according to his evil intention.
If a sin is done unintentionally, inshallah he is forgiven by Allah as it was never his/her intention do so. For example, on eating at McDonalds (USA) you may find out that the french fries are laced with beef flavoring. Your intention was only to eat the vegetarian potato fries and you were unaware that they also had (non-halal) sprinkling of beef on them. As long as you were unaware, you are not accountable for it.


Travel itinerary for Japanese visa

Question: Hey am from Uganda and am planning for a travel in japan on a visitor visa and among the document asked are the travel itinerary and personal tax return .
How best can I prove my travel itinerary when it comes to hotels and flight?
Answer: I would imagine...
A list of hotels/accommodations with reservation confirmation with dates.
And a list of transportation if you already made some reservation for them (planes tickets in and out of Japan, planes or train tickets inside Japan... )
Comment: @Mark Every decent accom in Japan has free cancellation until the day before check-in, though; some even have it on the same day.
Comment: It's usually recommended you don't book flights/accom until the visa is locked in.
Answer: It's generally not advised to book your flights, hotels etc before getting the visa confirmed.
You can simply provide a list of the expected dates, locations, maybe activities and costs per day (estimated).  The idea is to show you have a rough idea of a plan, and you know how much it might cost, and the tax return will help show you're likely to be able to cover it.
If staying with or visiting friends, list them too, as it shows you've got contacts there too.

Travel itinerary for Japanese visa


Will a thin or thick cutoff angle grinder wheel last longer?

Question: If size of cut didn't matter (not in a confined area), wouldn't a thicker cutoff wheel last longer? I was comparing mainly between a 1/16 and 1/8 width wheel. I was trying to compare between cutoff wheels that you can get at Harbour Freight vs what you would buy at big box home improvement stores.
Also, do the diamond cutoff wheels work that much better than masonary wheels?
Comment: Cutoff wheels have a funny way of fracturing and throwing shards.  Such tools and "Harbor Freight" generally are a bad combo.
Answer: Cutting disks should be thin. Grinding disks are thicker. Thicker disks means removing more material, which takes more time. Typical disks in Europe is 1mm thick, and I'd categorize a 1/8" (3.7mm) as a hybrid, usable for both cutting and grinding, but not excellent at either.
A thinner disk also leads to less heating in the material cut, as less energy is deposited.
In addition the disk should be made for the material you're working with. Different materials behave differently.
Answer: Stick to a brand name cutoff wheel. , 1/8 " should last longer depends on what you are cutting. And always wear safety glasses.
Answer: It depends what you are cutting. A metal disk will out preform with metal.  a metal cut off disk is a good recipe for an injury with masonry. Are diamond blades worth the cost I use them when I need a very clean cut with not much damage next to the area being cut. Diamond blades also are usually coated on a metal disk so they do not fly apart like a fiber blade. I have 1/2 a dozen different blade types and thicknesses as there is really no true universal disk, or blade for a grinder when considering both cutting and grinding both metal and masonry.
Answer: It isn't that the diamond blades have a longer rating on them.   It is that they provide a cleaner cut.
If I am cutting rebar I get the cheapest blades possible and they last 4-6 cuts.  If I get something 10 times more expensive they last 6-10 cuts.
If I am cutting tile I go with a diamond blade to get a smoother cut and less cracking chance (vibration means more chance to crack).   I will get a thinner disc for tile (thicker for stone).
If I am cutting granite or other stone I go diamond to lessen chance of chipping.
If I am cutting off things that don't belong or cutting weird stuff like backer board I generally use a cheap metal disk.  On my metal disks I get thicker because they last longer and I don't need to be exact.
I would also agree with most here on HF is not the ideal place to buy an angle grinder.   I have tried their tools and like all of their cheap power tools the number one issue is the shutoff not working right.   The last thing you need in an angle grinder is, your a stuck on a cut and the wheel won't stop spinning when you release.


Hold Harmless-Want on half of LLC and NOT self

Question: I recently applied to a position to teach yoga, as an independent contractor.  I have formed an LLC, and now the gym would like me to sign a hold harmless agreement.  I want to make sure the LLC is signing the agreement, and not myself so that any potential claims would have to be brought through the LLC.  Is it enough to sign the hold harmless as "manager of [LLC name]"?  I also filled out the W-9 with the LLC name in addition to my own.
Answer: SHORT ANSWER
The hold harmless agreement binds you individually if you sign it individually. But, you may have liability to the firm you are contracting with as a matter of law anyway, as an individual, unless that is expressly waived by contract with the person who might otherwise sue you.
You should get liability insurance for yourself and your LLC. If the place you are working with doesn't have a waiver in place with students already, you should have your students sign one that is drafted by a lawyer in your particular state.
I don't address this is the long answer, but you also shouldn't have signed a W-9 for yourself individually. Only the LLC should have had to fill out the W-9, although this probably doesn't do any great harm.
LONG ANSWER
Two Main Kinds Of Liability: Contract and Tort
There are two main kinds of liability (there are other kinds of liability too, but they come up much less often).
One is for entering into a contract with someone and failing to perform that contract causing the other person not to receive the benefit of the bargain, which is called contractual liability.
The other kind of liability is called tort liability. Tort liability arises when you have a non-contractual legal duty towards someone (i.e. a duty that arises as a matter of law), you breach that duty, and that duty causes someone to suffer damages. If you also have a contract with that person tort liability can be limited, but not eliminated.
The most common form of tort liability by far is liability for "negligence" in which the duty that arise as a matter of law is the duty to use reasonable care under the circumstances to refrain from causing harm to another person.
Limiting Contractual Liability
It is possible to limit contractual liability by saying so in the express language of the contract. Only parties to a contract have liability under a contract. It is also possible to have broader or narrower scopes of an indemnification clause, or to limit another person's right of subrogation against you (i.e. the right to sue you to pay part of what they had to pay when they are held liable for a wrong you committed).
A disclosed agent of a principal (or employee of an employer) including a manager of an LLC, is not contractually liable for breaching the principal's (or employer's) contract. An undisclosed agent or principal (i.e. someone acting on behalf of another but acting as if he or she is acting on his own behalf) is liable on the contract along with the principal or employer.
The principal is liable on contracts entered into by a disclosed purported agent with mere "apparent authority" to do so, even if the agent is not actually authorized to enter into the contract, and the principal in that case has recourse only against the agent.
So, if you sign a contract in your capacity as a manager of the LLC, rather than in your person capacity, and you do not personally guaranty the contract, you do not have contractual liability on the contract. Typically, to do so, you would sign the contract like this (the italic portion would be signed and underlined; the rest would be printed):
XYZ, LLC
By Leonara the Great
Leonara the Great, as Manager
Tort Liability
Vicarious Tort Liability Of An Entity
A principal or employer, including an entity, has "vicarious" liability for the acts of all of the principal or employer's agents and employees within the scope of their agency or employment, even if the principal or employer prohibited those people from doing that as a matter of policy, contract or a specific instruction not to do so.
So, the LLC is liable for anything you do related to the LLC's yoga business.
Liability Of Disclosed Agents, Employees, Managers And Officers Of Entities
As explained below in a case that is representative of the overwhelming majority rule in the U.S., a human being is responsible to third parties for torts in which he participates in the absence of a waiver for that person, even if acting an an agent or employee or contractor of another company:

(I have no idea why I can't get this to appear as text rather than as an image).
Limiting Tort Liability
Tort liability cannot be limited in the absence of a contract with the person actually harmed, or via a statute that limits tort liability.
It is possible to contractually waive tort liability to a person signing a waiver, in advance of a tort occurring, not predicated on contract that arises from negligence or as a matter of strict liability, but not in cases of intentional conduct, reckless conduct, willful and wanton conduct, conduct amounting to bad faith, and conduct that amounts to "gross negligence". Gross negligence is a failure to act using reasonable care that is so extreme and obvious that is comes close to being reckless in character.
Practical Options
Almost every business that engaged in activities that could give rise to personal injuries buys liability insurance that covers lawsuits against the business and the employees and agents of the business (i.e. in this case, your LLC and you personally acting on behalf of the LLC) to address this risk.
This provides two benefits to you and your company: (1) it provides a lawyer, free of charge, to defend you if you are sued for a covered risk, and (2) it pays awards against you in a lawsuit or via a settlement related to a covered risk, up to a stated dollar amount.
Insurance is a near necessity, because not all risks can be waived and even if you have a waiver that is upheld by a court, that doesn't prevent you from having to hire a lawyer to defend yourself in that lawsuit.
Just to provide a reality check that this really is what people do, my wife was an independent contractor pilates instructor for a while and while she did that she paid for liability insurance in addition to having waivers signed by her students. (Bigger studios will have waivers for students already in place that cover you.)
Comment: Given the nature of the person's business a public an products liability insurance may not respond if an injury was caused by advice given rather than direct action i.e. if someone hurts themselves because of how you negligently told them to do a yoga move. The OP would need professional indemnity insurance for this.
Comment: About form W-9: In case of a pass-through LLC or similar "disregarded entity", form W-9 must list the owner's tax information along with the LLC/entity name.
Answer: In general, a contract will state who the parties to the contract are, often near the top of the contract. If the contract says that the parties are "John Jones" (the instructor) and "Great Bend Yoga Studio" Jones may be bound personally, even if Jones signs as manager of "Jones Courses, LLC". It is better practice for the contract to be written so that it is between the LLC and the studio:

This contract is between Jones Courses, LLC and Great Bend Yoga Studio. Jones Courses agrees to hold Great Bend Yoga Studio harmless in the event of ...

Any other mentions of Jones as a party within the contract should be changed to instead mention the LLC.
Aside from that detail, the very comprehensive answer by user ohwilleke looks good to me.
Comment: Excellent point.


Can you reverse the arrow of time?

Question: Has there been any attempt to reverse the arrow of time?
Comment: intriguing question.  my time machine only takes me to future times.
Comment: I just tried and I can't.
Comment: It's all reversable, so long as you only look at individual particles.  Things only get tricky when you have large ensembles of particles to work with. The question is not whether you can reverse "the arrow of time," but whether you can overcome the laws of statistics and make the entropy of a closed system decrease.
Comment: Should this be cross-posted to se/interpersonal-skills?
Comment: Do you mean like on a universal scale...?
Comment: Yes.  Just hit the reverse button on the remote.
Comment: The second law of thermodynamics wouldn't be a law if you could reverse the arrow of time. What's the use in trying something that's completely impossible?
Answer: First, it should be noted that "reversing the arrow of time" is not the same thing as "traveling back in time" (of course you didn't say this, but just in case other readers have this idea in their mind). Second, you are probably more familiar with the reversal of time's arrow than you realize.
The arrow of time is just a different way to view the second law of thermodynamics. Really, the arrow of time is just our perception of entropy increasing. For example, if we were able to see all of the gas molecules in a room suddenly gather in the corner of the room without any external forces acting on the particles, it would look like the gas molecules were "moving backwards in time", since we would normally expect gas molecules over time to diffuse away from being highly concentrated in the corner of a room.
In contrast, when entropy is at a maximum (or not definable) the arrow of time loses any direction or meaning. For example, let's take our same gas in our room at equilibrium (maximum entropy) and record a video of the gas for a long time. Now, let's run the tape in reverse. It would look just like if we were playing it forward. You would not be able to distinguish between backwards and forwards. The lack of entropy increase has removed the perception of time flowing in some direction.
Therefore, to answer your question, most certainly. We do it a lot. Just look for a system whose entropy is decreasing. For example, the food in your refrigerator. If you were to only focus on some warm food you just put into your refrigerator, you would see energy leaving the food as the motion of the food particles became less random; energy would flow from being "less concentrated" to "more concentrated". At this level, you could conclude that your refrigerator has reversed the arrow of time.
Of course, as we know, the decrease in entropy from the refrigerator will be accompanied by an increase in entropy outside of the refrigerator, but a decrease in entropy (reversal of the arrow of time) has occurred somewhere. Therefore, the arrow of time was reversed there as well.
All you need to do is decrease the entropy of a system, and you will have reserved the arrow of time for that system.
Of course, if you mean to ask if we can universally reverse the arrow of time, then the answer is no. As you can probably tell, this would mean reducing the entropy of the universe. Unless our universe is not a closed system and we can find a way to have some external "forces" that can decrease the entropy of the universe, then this is not possible. Typically we assume the universe is a closed system, so entropy must always increase (until the heat death of the universe), and therefore the arrow of time will always be "forward".
Answer: Actually, yes. And the arrow of time has been experimentally reversed in a chloroform molecule in a NMR setup.
The "trick" here is that in normal discussions about thermodynamics different systems are assumed to be uncorrelated: thermal motions are random and part A and part B of the system will not give any information about the state of the other part. If there is mutual information one can make (microscopic) systems that have heat flowing from cold to warm parts or otherwise break the arrow of time. The decrease in mutual information compensates for the entropy reduction (and this gets potentially bigger for quantum mutual information).
On a macroscopic scale this is unlikely to work very well, since there are too many degrees of freedom to manipulate.
Comment: You are talking about a chemical reaction right? Not a particle or atom, like reversing a Muon decay?
Comment: @ÁrpádSzendrei - No, not a chemical reaction. Just transfer of energy between the different vibration modes of different atoms.

Can you reverse the arrow of time?


How do I retrain myself to memorize germanic note naming (C-D-E) if I've been taught the latin one (Do-Re-Mi) as a kid?

Question: Basically the title contains the entire question. I learned music as a kid in Ukraine. In Eastern Europe (ex-USSR), commonly used note naming is "Do-Re-Mi-Fa-Sol-La-Si" ("fixed do solfège"), not the germanic "C-D-E-F-G-A-B". Nowadays, I have no trouble reading music, I instantly recognize the notes, but I'm constantly stuck if I need to pronounce them aloud in English. Is there a good technique to "retrain myself" into thinking in English notation after I've already ingrained a different one a long time ago? Did anyone here had a similar experience?
Comment: There is no need to retrain, they are sepa tea te systems so just learn it the same way anyone else would -- memorize the name of the physical positions,  and drill.  Similar to how you'd do it for intervals: http://music.stackexchange.com/a/4283/28
Answer: It seems to me the process of relearning the names of the notes is akin to learning to speak a new language - but fortunately you only have to learn a small number of words.
Perhaps flash cards - one with Do on one side and C on the other, another card with Re on one side D on the other and so on.  Shuffle the deck and just pull out a card and say what's on the other side.  Quickly check your "guess" by turning over the card.  Do it both ways (guess the letter name or the solfège name while looking at the other).  Eventually you will have them all memorized and will be able to instantly say E when you draw the Mi card or say F when you draw the Fa card.
Good luck!
Answer: The "Do-Re-Mi-Fa-Sol-La-Ti" pattern refers to the scale degrees in a scale, these are not representative of specific notes until you specify which key this is in. For example...
In the case of C Major: "Sol" is the G note.
Do-Re-Mi-Fa-Sol-La-Ti
C--D--E--F--G---A--B

But in the case of D Major: "Sol" is the A note.
Do-Re-Mi-Fa-Sol-La-Ti
D--E--F#-G--A---B--C#

So for each of the 12 different major scales the solfège "Do-Re-Mi-Fa-Sol-La-Ti" pattern will represent different notes. We do use solfège here in the US and I learned it as a kid as well, but solfège is different from the actual notes.
If it helps you can apply the solfège pattern to the actual notes. If you're in the key of C Major, then C=Do, D=Re, E=Mi, etc. and you can think of it mentally this way. The more familiar you are with each of the 12 keys the easier this will be and all you can really do here just practice. The more time you spend working on it the better and faster you will get at it.
Comment: You misread my question. You are talking about [movable do solfège](https://en.wikipedia.org/wiki/Solf%C3%A8ge#Movable_do_solf.C3.A8ge). In many countries (e.g. France, Italy, Russia) the solfège system used is different -- [fixed do solfège](https://en.wikipedia.org/wiki/Solfège#Fixed_do_solf.C3.A8ge). In it, Do is _always_ C, Re is _always_ D, and so on. In other words, "Do" and "Re" are actual _names_ of the notes. The names "C" and "D" are never used (and often even unheard of).
Comment: Oh, that's interesting. I'd never heard of that...in that case this is simple memorization as you just have to associate the terms you already know with new terms. Sounds like you already know the mapping from Do to C, Re to D, etc. so it's really just a matter of doing it repeatedly until it becomes as easy to do as the fixed solfège.
Comment: For example, B minor is "si mineur" in French, and "H Moll" in German.
Answer: It's a shame that the people you're trying to communicate don't understand you.  I've seen adult musicians brought up in Latin America use do-re-mi in the U.S. and be reasonably well understood by people brought up with C-D-E....
With any memorization task, the more difficult one finds it, the greater the need for a mnemonic.  I will propose something for you -- but please don't hesitate to modify it.
For reference, here again is the equivalence chart:

Do-Re-Mi-Fa-Sol-La-Ti
C---D--E---F--G---A--B

The easy ones are

Mi - E because they rhyme
Fa - F because they start with the same letter.

Here are some suggestions for the others:

C: toniC
D: reD (the color)
G: God (think of the sun god)
A: Ah (The doctor says, "Stick out your tongue and say 'Ah'."  'Ah' rhymes with la.)
B: If you are a Spanish speaker, perhaps you could use this: tiBia.  If you on the leading tone, almost up to tonic, you are lukewarm, in other words, you are heating up some water and it is almost hot.  (For non-Spanish speakers, I'll explain that tibia means warm but not hot.)

A fun exercise might be to try to sing "Do, a deer" (from The Sound of Music) with the C-D-E method:

C, a deer, a female deer,
D, a drop of golden sun,
etc.
Comment: Our word *tepid* means this.  Interestingly, the English *tibia* is the shin bone, as it is in Spanish.


Weird line in my mirrored mesh

Question: was following a tutorial where I stumbled into this weird line in my mirrored mesh (sorry for the feet lol)

You can also download the blender file
Answer: Problem
This is caused by faces inside your mesh. The main sign of this is that the crease only appears when subsurf is turned up; the inside faces add weight that pulls the verticies inwards (according to the subsurf algorithm).
Solution
Tab into edit mode and uncheck the X box in the Mirror modifier. Your properties panel should look like this:

This will leave you with half a human. Change into face select mode:  and select these faces:

Key X and select Faces. Tab out of edit mode and recheck X in the Mirror modifier. This is the repaired mesh:
Answer: I had a similar problem, And I just increased the merge limit in the mirror modifier, and it worked for me :)
Answer: I had a similar problem after applying the mirror modifier (no crease but a sharp line between mirrors). What worked for me was to select all and use Mesh - Normals - Set from faces in edit mode after the modifier was applied.

Weird line in my mirrored mesh


breadth first or depth first search

Question: I know how this algorithm works, but cant decide when to use which algorithm ?
Are there some guidelines, where one better perform than other or any considerations ?
Thanks very much.
Answer: If you want to find a solution with the shortest number of steps or if your tree has infinite height (or very large) you should use breadth first.
If you have a finite tree and want to traverse all possible solutions using the smallest amount of memory then you should use depth first.
If you are searching for the best chess move to play you could use iterative deepening which is a combination of both.

IDDFS combines depth-first search's space-efficiency and breadth-first search's completeness (when the branching factor is finite).
Comment: In chess you want to use depth-first with alpha-beta pruning to reduce the average branching factor to its square root. iterative deepening can be added too. Good answer though +1
Answer: BFS is generally useful in cases where the graph has some meaningful "natural layering" (e.g., closer nodes represent "closer" results) and your goal result is likely to be located closer to the starting point or the starting points are "cheaper to search".
When you want to find the shortest path, BFS is a natural choice.
If your graph is infinite or pro grammatically generated, you would probably want to search closer layers before venturing afield, as the cost of exploring remote nodes before getting to the closer nodes is prohibitive.
If accessing more remote nodes would be more expensive due to memory/disk/locality issues, BFS may again be better.
Answer: Which method to use usually depends on application (ie. the reason why you have to search a graph) - for example topological sorting requires depth-first search whereas Ford-Fulkerson algorithm for finding maximum flow requires breadth-first search.
Answer: If you are traversing a tree, depth-first will use memory proportional to its depth.  If the tree is reasonably balanced (or has some other limit on its depth), it may be convenient to use recursive depth-first traversal.
However, don't do this for traversing a general graph; it will likely cause a stack overflow.  For unbounded trees or general graphs, you will need some kind of auxiliary storage that can expand to a size proportional to the number of input nodes.  In this case, breadth-first traversal is simple and convenient.
If your problem provides a reason to choose one node over another, you might consider using a priority queue, instead of a stack (for depth-first) or a FIFO (for breadth-first).  A priority queue will take O(log K) time (where K is the current number of different priorities) to find the best node at each step, but the optimization may be worth it.

breadth first or depth first search


Can implicit costs be negative?

Question: I think that conventionally implicit costs are positive but if for example we consider a negative interest rate as an implicit cost, the implicit cost would be negative. Is this true? Can implicit costs be negative?
Answer: We can define a (positive) cost to be simply a negative benefit.
In which case, a (positive) benefit is simply a negative cost.
So yes, in general, costs can be negative.

Note though that in economics, it doesn't usually make sense to speak of costs in isolation or benefits in isolation. Instead we usually look at the net benefits (i.e. all benefits minus all costs) or net costs (all costs minus all benefits).
So to use your interest rate example, usually when one buys say a 10-year bond, the benefit one gets in return is the positive interest rate. However, countries like Germany and Japan have issued bonds with negative interest rates. So, it seems silly that anyone would buy such bonds -- with negative interest rates, one is clearly getting a (negative) benefit and hence incurring a cost. However, this cost must be compared to other costs -- for example that of safely storing some sum of money. When the proper cost-benefit analysis has been made, we will usually find that for the buyers of these German and Japanese bonds, the net benefits are positive (or equivalently, the net costs are negative).

Can implicit costs be negative?


First time homeowner and getting a mortgage?

Question: My wife and I are looking to purchase our first house. What is the best approach for finding a mortgage? We're looking for a conventional 30yr fixed (w/10-20% down).
Thanks!
Answer: If you have good credit, you already know the rate -- the bank has it posted in the window. If you don't have good credit, tell the loan officer your score. Don't have them run your credit until you know that you're interested in that bank. Running an application or prequal kicks off the sales process, which gets very annoying very quickly if you are dealing with multiple banks.
A few pointers:

Shop for TCO, not the best rate. Most folks stay in a home for 5-7 years, so you should increase the weighting of closing costs in your evaluation.
Understand the costs associated with the loan in detail. This varies from state to state.
Explore first time homebuyer programs offered by your state, county or city. I received $7,500 in grants and forgivable loans from NYS through their SONYMA program when I bought my first home.
Don't worry about your credit score and get into a tizzy over the effects of inquiries.
Look for local banks and credit unions with lower (not lowest) advertised rates. Go in and talk to them, understand their policies and practices. These institutions usually offer the best value.

You're looking for a plain vanilla 30 year loan, so avoid mortgage brokers -- they are just another middleman who is tacking on a cost. Brokers are great when you need more exotic loans. Always, always stay away from mortgage brokers (or inspectors or especially lawyers) recommended by realtors.
Answer: First of all, think of anyone you know in your circle locally who may have gotten a mortgage recently.  Ask him, her, or them for a recommendation on what brokers they found helpful and most of all priced competitively.
Second of all, you may consider asking a real estate agent.  Note that this is generally discouraged because agents sometimes (and sometimes justifiably) get a bad reputation for doing anything to get themselves the highest commission possible, and so folks want to keep the lender from knowing the agent.  Yet if you have a reputable, trustworthy agent, he or she can point you to a reputable, trustworthy broker who has been quoting your agent's other clients great rates.
Third of all, make sure to check out the rates at places you might not expect - for example, any credit unions you or your spouse might have access to.  Credit unions often offer very competitive rates and fees.
After you have 2-3 brokers lined up, visit them all within a short amount of time (edit courtesy of the below comments, which show that 2 weeks has been quoted but that it may be less).  The reason to visit them close together is that in the pre-approval process you will be getting your credit hard pulled, which means that your score will be dinged a bit.  Visiting them all close together tells the bureaus to count all the hits as one new potential credit line instead of a couple or several, and so your score gets dinged less.
Ask about rates, fees (they are required by law to give you what is called a Good Faith Estimate of their final fees), if pre-payment of the loan is allowed (required to re-finance or for paying off early), alternative schedules (such as bi-weekly or what a 20 year mortgage rate might be), the amortization schedule for your preferred loan, and ask for references from past clients.
Pick a broker not only who has the best rates but also who appears able to be responsive if you need something quickly in order to close on a great deal.
Comment: http://www.credit.com/credit_information/credit_help/Credit-Improvement-Your-History-Searching-Credit.jsp each bureau has a different window, but they are all at least 2 weeks in the US.  Search for duplication.
Comment: My understanding from the Clark Howard radio show is that credit pulls for a mortgage in the same 2 week window will count as one.  No harm in doing it all in one weekend, but you could stretch it out if need be.
Comment: @MrChrister - thanks.  I'd heard weekend before, but it's good to know that it can be a bit longer.
Comment: I've heard 2 days, not 2 weeks for the pulls to count as one.
Answer: Check with you local bank where you have an account. Sometimes they can offer a discount that results in a good rate.  I just refinanced a month ago with Bank Of America and their rates were very competitive.  What set them aside from the rest was their low closing fees.
Otherwise I would shop around on bankrate.com and it will show you results of both local and online mortgage brokers.  It will list the rates and expected fees.  The also list an average national rate so you can compare the rate you are considering and see if there could be a better deal elsewhere.
Comment: I would avoid online rates for a first mortgage, there are just so many variables.  I would get a mortgage from a person, but definitely go online to get an idea of what to expect.
Comment: @MrChrister - I agree, for the first time process you want someone who will be there in an office you can visit if there is a problem.  Plus with online brokers I've seen a whole gamut of consumer complaints!
Comment: As a first time person, there are so many combinations and questions I wouldn't have known to ask.
Answer: Make sure you shop around and ask a lot of places for a good faith estimate.  Last I knew, the good faith document is the same everywhere and long form that makes it easy enough to compare the hard numbers from place to place.  I have gotten several estimates for various scenarios and I have had them hand written and printed.  (I discounted the hand written ones because that broker seemed pretty disorganized in general)
Learn the terms online, and start comparing.  Use the good faiths as a negotiation tool to get lower rates or lower costs from other brokers.  See how accurate the person is at listening to you and filling out the paperwork.  See how responsive they are to you when you call with questions and want some changes.
Check with at least four places.

Your current bank(s)
Your current credit union.  (Get one if you don't have one)
A couple of mortgage brokers.

The more places you shop, the better idea you will have of what fees are high and what interest rates are low.  I might pay a higher fee to get a lower interest rate, so there are lots of trade offs to consider.
Answer: I second the suggestions for your local credit union and asking co-workers who might also be in the process of a home purchase. Additionally, you want to educate yourself as much as possible so that you can ask questions about the calculations responsible for the differences. I got different values starting from the various online automatic quotes all the way through to the GFE and it was not obvious to me. You can also sign-up for free workshops for first time home buyers, though most of the material will be a breeze it helps you get worksheets going and lists going for documentation that you need to gather. You might want to start at the HUD site and explore. Especially the Borrower's Rights. The cost booklet was very helpful for me to interpret the GFE, but honestly I didn't appreciate it the first time it was handed to me. Finally, you might meet qualifications to take advantage of FHA programs; the waitlists discourage everyone including the loan brokers, but you want to at least be aware of programs that can help.


Best way to create identity contracts for organisations

Question: What is the best way to create identity contracts for organisations based on their information like name, address, organisation type(buyer/seller) etc. I have tried using factory pattern to create these identity contracts , i have also looked into ERC725 implementation.
Comment: Could you elaborate a little but more about the use cases?
Comment: Hi mikhail , use case is  a marketplace for organisations to sell and buy, when these organisations signup on the platform i want to take their information and create blockchain identity for these by a deploying smart contract for each using web3.js.Hope this clears
Answer: 725 v2 definitely works, each entity will be able to execute arbitrary bytecode and to store data. However, they will be able to change that data as well. Of course, these changes will be visible in the transactions but then this should be monitored all the time
You may create a modified version where some of the parameters are set in stone when the identity contract is deployed, such that the identity cannot be changed. The functionality of executing arbitrary bytecode should be included as in ERC725.
Hope this helps.
Answer: You may just issue ERC-721 non-fungible tokens and log company information together with token ID at the moment each token is issued.  This way you will associate company info with token ID and benefit from following widely adopted standard.


How many people knows about Kazehaya Kamito's secret?

Question: How many people knows that Kamito was Ren Ashbell?
Answer: At the end of the anime only one living person besides Kamito knows that he is Ren Ashbell, and that's the princess Fianna Ray Ordesia.
Ellis's older sister Velsaria Eva Fahrengart found out during the fight in the last episode but dies right afterwards.
Ellis and Clair both suspect that he is Ren but both are put off by various things. The principle being that as Ren he fought with a black blade in his left hand and now he fights with Est (a white blade) in his right hand.
While the relationship between him and Greyworth Ciel Mais (headmistress of the school) isn't stated in the anime, in the light novels she was the one who taught him how to fight with a sword before the first Bladedance he competes in, and so also knows that he is Ren Ashbell.
Answer: WARNING SERIOUS SPOILERS AHEAD read at your own risk
In the anime only Greyworth, Fianna and Velsaria know that he is Ren Ashbell (also, Velsaria didn't die after her fight with Kamito. He liberated her from the cursed armament seal implanted in her heart, which saved Velsaria's life but made get unable to use spirits again. She appears many other times in the novels). Meanwhile, in the light novel there are more characters (most of which aren't introduced in the anime) who know his secret.
So far, in the light novel the ones who know are:

Greyworth
Restia (his contacted spirit)
Fianna
Jio Inzagi
Claire
Velsaria
Rubia Elstein (Team Inferno's leader and Claire's older sister)
Reicha Alminas (current Fire Queen)
Muir Alenstarl (former Instructional School teammate)
Lily Flame (former Instructional School teammate)
Sjora Kahn (Alphas Theocracy's princess and Team Inferno's witch in the Blade Dance)
Lurie Lizaldia/Yggdra (Numbers member and winner of the Blade Dance before Kamito)


Can you trace someone through picture header information?

Question: I learned that jpg, png, bmp and most image files contain headers and plain text in them. I decided to open a jpg file in Notepad and saw a bunch of information and I was wondering if there was a way to find out the origin of the computer it came from or some other information.
Comment: There are loads of free tools, if you give this service an iPhone photo its will extract all the Exif data which now include gps with lat/long coors of where the photo was taken  http://metapicz.com/#landing
Answer: Modern Smart phones embed GPS coordinates into pictures. http://www.howtogeek.com/211427/how-to-see-exactly-where-a-photo-was-taken-and-keep-your-location-private/
This is often how sought out individuals are found and detained because they take photos with their phones unaware the photo contains the location as well.
It all depends on the software/hardware/individual/etc taking the photo. Yes, its very possible, and its being done today.
Comment: I tried a EXIF data reader on several selfies from Twitter (random people) and none of them had GPS coordinates. I then found out that many/most social media websites strip EXIF data from photos. I just wanted to add this because I think it's worth noting.
Comment: Facebook for example removes almost all EXIF data - however, we can only speculate about the reasons.
Comment: @lukas while it may be stripped before serving it, there is no reason to think that it does not store this data for itself
Answer: With experience in the computer forensic field the short answer is Yes.
As other people said it's called EXIF data. You can get information such as camera settings and lens used, time and date etc. On some newer camera models GPS tagging is available. Also all new smartphones have gps on them. Meaning when the photo is taken the GPS coordinates go in the EXIF data file format. You can't track really but you can see where the photo was taken. There are a few free EXIF viewers such as the Opanda one. You can "play" with it to see what information you can get from different photos from different devices.


Why does the down-vote popup say: "This question doesn't show any research effort; it is unclear,or not useful."?

Question: I've notices that when the pointer hovers over the down-vote button there is a popup that says: "This question doesn't show any research effort; it is unclear,or not useful."  Is that what down-voting a post is meant to indicate?  Just curious.
Comment: Yes, that is what it is supposed to indicate.
Comment: This wording is standard on many SE sites, and is necessarily a terse summary of what makes a Question "bad" (note that it simply negates the hover wording for upvote buttons).  A more detailed set of guidelines is shown at [ask].  What users consider useful (or adequate researching) is an opinion, but this is consistent with the theory of Community Moderation.
Comment: @StevenThomasHatton Note that, on this meta site, the way I've noticed it apparently being used, the way I sometimes use it myself, and I've seen several statements about it, is that a down-vote instead generally just means disagreement with what the post is saying. Conversely, an up-vote often means general agreement with the post.
Comment: @JohnOmielan I was actually asking in regards to math.se since there seems to be some confusion among participants as to what the intent of the down-vote feature is.
Answer: This question comes up on many of the StackExchange sites; see for example here for example, which in turns references another site.  The wording is fixed across sites, and is intended to provide a helpful reminder to someone thinking about up- or down-voting.
There has also been discussion in the past about changing the tooltip, particularly for Meta sites where up- and down-voting often carries a connotation of agreeing or disagreeing with a proposal; see here for example (that's a duplicate but I think has more useful discussion than the main question it links to).
So directly answering: an upvote on the main site should indicate that the question has made some effort (not necessarily research, depending on the site), or has value in some clearly definable way.  A downvote, contrariwise, indicates that insufficient effort has been made in producing the question.  On Meta, votes may in fact be indicating approval or disapproval instead, especially if the feature-request tag is present.
Comment: I got in trouble for downvoting questions by one person that could be sieved the same, and because output from code that had errors. I consider it crank behaviour, and the code I found out wasn't even written by them ( not to mention it got a debate going after I pointed out the wrong output).


What is an Augmented 6th chord?

Question: In studying music theory I have heard the term Augmented 6th quite a few times, but I'm not quite sure what it is. What is a Augmented 6th and how is it used in a composition?
Comment: Note: I do know what an Augmented 6th chord is, but I would like to have this information on the site.
Comment: Interesting. I *don't* know what an augmented 6th chord is -- yet -- but look forward to finding out tomorrow when I read this article that I quickly found: http://musictheoryblog.blogspot.com/2008/02/augmented-sixth-chords.html
Answer: Augmented sixth chords? The bass leads by semitone down to the root of the next chord; the ascending leading tone to the root of the next chord is also present in one of the upper voices. The notes are really a minor seventh apart, but, because they are written as the second and seventh degrees respectively relative to the root of the next chord, the interval formed is written as an augmented sixth.
As an example, the most basic augmented sixth chord is an Italian sixth. Used as a predominant in the key of C, that is, leading to a G major chord, it would be A♭ in the bass with C and F♯ in the upper voices. The interval A♭ to F♯ is the augmented sixth. The other commonly used forms of augmented sixth chord are the French sixth, which in this example would add D to the Italian sixth's upper voices, and a German sixth, which would add E♭ instead.
The Wikipedia article is fairly comprehensive.

What is an Augmented 6th chord?


How to maintain scroll position of the aspx page which contains usercntrols

Question: i have to maintain scroll position of a page which contains Usercontrols and some buttons in it.
when controls in usercontrols are clicked the page is post-backed.
i want to maintain the page scroll position where it is before.
I have tried Maintainscrollposition= true like this things in my pages.
please suggest me with some examples.
thanks in advance.
Answer: make sure you have Maintainscrollposition= true in the page where you use the usercontrol. (i suppose you already tried to put it in the usercontrol header)
if that doesnt work then in page_load, add Page.MaintainScrollPositionOnPostBack = true;
if it still doesnt work then let me know and i will try and find a javascript code i used in the past..


Choice of f1 score for highly imbalanced dataset?

Question: I am confused whether to use f1 score with 'micro' average or 'macro' average for better evaluation.
Given my dataset is highly imbalanced(600:100000)
Answer: To summarise this answer,
Macro calculates and F1 score for each class then averages them.
Micro calculates the recall/precision for each class, averages them then calculates the F1 score.
Micro average is preferable in a multi class situation where one class heavily outweighs the others.


Why aren't we in public beta yet?

Question: I thought the private beta was only supposed to last 7 days. We have been in for 9 days at the time of writing, and we are still in private beta. What are the condidions needed to reach public beta?
Answer: Sorry about that, folks! We normally do write a post when a private beta is being extended.
Arduino just needs some more time to come up with some additional questions, just to make certain there's plenty of interesting things for folks to do once the doors open. Nothing to be alarmed at, you're doing a great job - just need to build up the base a bit more.
Pops can chime in with any other guidance now that he's feeling better (which is probably what's to blame for you not getting a notice when we decided to extend the private beta).
Our bad.
Answer: We've actually been talking about this in chat. Apparently the private beta can last up to 2 weeks. If it's performing well, it is possible to go public after 1 week though, but it all depends on reviews by the SE Community Managers.
From what I've read of other betas, I get the impression we're doing fairly well. There may be some issues regarding our scope though, and the possibility of overlap with existing SE sites.
Answer: Arduino went into public beta a few hours ago!
Congrats, everyone!

Why aren't we in public beta yet?


Word for one who does not eat onions

Question: Is there a single word for someone who does not eat onions? I remember having heard this word somewhere but do not remember it now.
Comment: As someone who is allergic to onions, it would be nice if such a word was in common use.
Comment: I propose a new word "unonioner".
Answer: Someone who is alliumphobic has a fear of onions (allium cepa) in general, and certainly wouldn't eat them!
An alliaphage is someone who eats garlic (and, by extension, onions), so if you can negate that in some graceful way (analliaphage?), you'll have a word for someone who doesn't eat onions.
Edit: Per the comments below, I suggest the term non-alliaphage for someone who doesn't eat onions.
Comment: @DavidRivers True. There isn't a single word for every concept in the English language, that's why we have sentences. So if we really must crowbar in a single word, it seems we'll have to live with some kind of Latin-Greek behemoth of a neologism. Is there a single word for "*Latin-Greek behemoth of a neologism*"? :)
Comment: To be pedantic, I wouldn't recommend anyone to expect what you mean by a Latin-Greek behemoth of a neologism.
Comment: @Hugo  Although not a single word, *[inkhorn term](http://www.worldwidewords.org/articles/inkhorn.htm)*, "words which were being used by scholarly writers but which were unknown or uncommon in ordinary speech" may be relevant.
Comment: @DavidRivers: Yes, as I was drifting off to sleep last night, _non-alliaphage_ popped into my head as a less hideous chimera.
Answer: Background: The terms "akreophagy" (var. "acreophagy") and "aristophagy" were coined in the 19th century to mean anti-flesh-eating.
http://www.archive.org/stream/cu31924091890685#page/n25/mode/2up
http://www.caninestyle.co.uk/ordergoldenage/Home/page8.html
Allium is the onion genus; the term "alliaphagy" is attested as a term for a garlic- or bulb-eater:
http://books.google.com/books?q=alliaphagy
In the same way, you can coin a term for an anti-bulb-eating: "analliaphagy". However this suffers from overgeneralization: it can mean an avoidance of any plant in the allium genus. If you do not mind mixing your Greek and Latin roots (which offends the purists but is still commonplace), then use the Latin word "cepa", "onion": "acepaphagy" or "ancepaphagy".
The corresponding terms for a person who does not eat onions, then, are acepaphage or ancepaphage.
Answer: Alliumphobia is the word that you are looking for, but I think alliumphobia describes the phobia in the scent of certain plants including onions.
Answer: @eeerahul, I'd say that 99.99 percent of people in western countries  are subjected to onion and garlic cooked foods from birth, so there is no exact single word in English for non-onion garlic eaters
As in Hindi and Sanskrit we have word like jain food, satvik, bhojan etc... because these types of food habits are found only in Asian countries like India, Sri lanka, China, Bhutaan even in Pakistan etc.
Hence you have a great question, and you can raise this concern to authorities like Oxford University Press, Cambridge, Harvard press ... in order to have a single word for this type of eating food habit. Especially because "organic" food is spreading across the world rapidly; we need a single word to describe it in one shot :)
Answer: Jain Vegetarians do not eat onion and garlic.
Comment: Or any root vegetable, and adhere to a whole bunch of other rules. Not eating onions does not define them. -1
Comment: Yeah, but I was looking for a specific English word for this.

Word for one who does not eat onions


Open LWC as a full page without salesforce header

Question: I have a button on Lightning Record page. On click i am redirecting to a LWC. Is there anyway where i can redirect or open the LWC in a full screen page. As of now it is opening with salesforce main header.
Answer: You can create a lightning application and open it in Lightning without the standard header.
An app is a special top-level component whose markup is in a .app resource.
Ref: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/apps_overview.htm
Answer: I am afraid that this is not possible. The header is static content of the general LEX.
While you maybe could do it via css i would not recommend it because it can break at any time when salesforce changes structure / their own css.
Potentially you could also serve it via a Visualforce page and adress it this one instead which can be displayed on an own full page - but not sure if lightning out is worth the price.
i would just keep it as is to be honest


Is it safe to write batch files with Unix line endings?

Question: I think I ran across a bug in a batch file because it was written with unix line endings. Is this a known problem with cmd.exe running batch files in windows?
Comment: Which bug did you run into? Commands failing to start? Or just that it looked as if there are not line endings when you open the file with notepad?
Comment: I have never had a problem, and I always use unix line endings.  But that doesn't mean that there isn't some problem I have just been lucky enough to miss.
Answer: This really isn't a "bug"... as it is by-design.  Windows new-lines are defined as "\r\n" ... or a "Carriage Return" and "New Line" combination... whereas *nix flavors prefer omitting the carriage return.  You should always use "\r\n" in anything in Windows where possible.  Anything else may be interpreted incorrectly... and cause a great deal of unexpected results.
Comment: Notepad can't handle Unix line endings, but WordPad can, PowerShell can, many other things can as well.
Comment: I came across an issue where call :label didn't jump to a label, but the same call later on the file did jump to the label. The file in question was using \n line endings. I switched to \r\n line endings for all batch files in my project and the problem was gone. I didn't re-test with \n endings to confirm it wasn't just a one-time fluke (the scripts takes nearly an hour to run).
Comment: Cam you provide some more examples when .bat files do not work correctly with nix line endings?
Comment: @MichalKordas Without going through and testing every version of every Microsoft OS and *nix distribution, that's sort of a tall order to give.  This really isn't the place to go into a detailed discussion on the subject.  Best practices are such that Windows uses \r\n, *nix uses \n, and sometimes mac uses just a \r.  Since Only Windows uses batch files, it's best to assume you should use \r\n.
Comment: @MichaelHampton: _Windows 10_ (in 2015) notepad does handle LF, finally. _And_ for UTF8 it no longer forces a nonstandard, useless and frequently harmful BOM :-)
Answer: For batch files there is no big difference between unix line endings and windows line endings.
Currently, there is only a glitch known for the behavior of GOTO and CALL, while searching for a label.
The label parser fails to find a label, if the label is on a 512 byte boundary relative to the current file position.
The difference is, because the carriage return is used for an internal line reset.
See Call and goto may fail when the batch file has Unix line endings
Despite the label scanner, it's unexpected to find more problems, because the batch parser removes all carriage returns directly after the percent expansion phase.
Sample to show the problems:
@echo off

goto :main

:func
echo ************************************************
echo ************************************************
echo ************************************************
echo ************************************************
echo ************************************************
echo ***********************************************
echo ***********************************************
echo ***********************************************
echo ************************************************
echo never go back to :main
echo This is the end of :func
exit /b

:main
:main
echo This is main
goto :func
exit /b

The output is

This is the end of :func
Comment: This is not true. I know from experience. Unix line endings cases arbitrary failures when using gotos to jump to labels.
Comment: @SimonStreicher You are right, there is a difference in the label parser. dbenham discovered that 2019 in [Call and goto may fail when the batch file has Unix line endings](https://www.dostips.com/forum/viewtopic.php?t=8988)
Answer: It seems that batch labels are skipped when LF (Unix line-ending) is used in a .bat file.
Answer: Kinda, but...
You will have to be a paranoid and

always duplicate your label lines!
never use colons outside of label definitions!

Eg.:
@echo off
goto main <- No use of colon
...

:main
:main <- Repeat label
echo At least one of the above labels are discoverable

REM main part done <- No use of colons in comments

How it works
When using Unix line endings, the label parser will skip over some labels because of an off-by-one error. This is due to the parser's use of 512-byte sized chunks and the assumption that line endings is denoted by two characters, \r\n, rather than one, \n. When a label is erroneously skipped over, the next erroneous skip can only occur at an offset of 512 bytes. If you duplicate a label on the next line, the duplicated label will be within the 512 limit, and can act as a fallback.
Furthermore, as demonstrated by @jeb, the parser also misinterprets the end of each 512-byte size chunk as a new line (as well as somehow ignoring white space characters between a colon and the next text on these pseudo lines). A comment such as :: main section can trigger the parser into somehow reading the text : main as the label :main.
In summary, not only can the parser skip labels, it can also misinterpret comments and other pieces of text as labels.
Why not just stick with dos line endings?
It's not always safe to assume that your batch script will retain its line endings, especially when using Git or sharing content over GitHub. It's also convenient for cross platform projects not to care about line endings and assume Unix line endings as a common denominator.
Comment: Nice idea to duplicate the labels. But it's not 100% safe, because it's possible that a `goto` or `call` ends at a complete wrong file position
Comment: Thanks @jeb. I can't seem to wrap my head around it, mind explaining some more?
Comment: This might be luck, but using the following example of wrong file position https://www.dostips.com/forum/viewtopic.php?t=8988#p58898 -> https://www.dostips.com/forum/download/file.php?id=421 , if I add a new line under `:test` as `:tst2` then I get the wrong file position as expected, but changing `:tst2` to `:test` the goto actually ends up at this new `:test` label as intended
Comment: I added a sample, that shows the problem and it doesn't help to duplicate the label
Comment: @jeb very clever indeed!
Answer: The answer is: you may get "lucky" and it will work with LF, but don't count on it. We had same problem as the original requestor.
Our process would end up with bat files that were only LF, and (sorry could not find a pattern) sometimes a label would be 'not found', though clearly it was there. Would have to convert to CR-LF, or make random changes until it worked!


Are there movements that are always unsafe?

Question: Do I eliminate certain movement from my routine, no matter what? Right now, I raise a weight overhead, crunch with a weight, and do ballistic movements. I do not feel they harm me. Are these a recipe for injuries, even with proper form?
Comment: Standing on a swiss ball juggling dumbbells. Standing on a swiss ball doing squats. Actually, pretty much anything done standing on a swiss ball seems unsafe to me, unless you're training for a Cirques du Soleil show.
Comment: Nothing is perfectly safe. There is no way to prevent injuries with certainty, we can only reduce risk. How much risk you take and how you manage it depends a lot on your goals and your individual fitness and training. You haven't provided any of this information, so your question can not be answered, you'll only get opinions.
Comment: Can you be a bit more specific?  As written, your question is asking for opinions.
Comment: @rrirower: you are right that the question could lead to that, but it could also be answered with references.
Comment: @DarkHippo: apparently they indeed are many exercises standing on a swiss ball. Just Google images of it, and be amazed.
Answer: Yes, some movements are unsafe. Not every person will get injured but there are exercises and activities that have higher injury rates. Specifically, the crunches you mentioned place a tremendous load on the spine. Here is an article and video on why not to do crunches and what to do instead. Stuart McGill has a lot more info if you decide to dig deeper than the article and video.
Answer: With proper form? Yes, they may lead to injuries, if you are attempting to lift more than what your body is capable of, or doing explosive movements without proper stretching and warmup. Everyone is different and the way our bodies respond to different exercises differ from person to person.
To prevent injuries, we need to keep in mind how much we are loading ourselves. Loading should be done progressively, and with proper care. If I want to overload 100lbs more in a week as a beginner, then I'm just asking for injuries, no matter how good my form is. Also, regarding explosive moments, yes, injuries may happen if not done under correct supervision. The problem with explosive movements is, sometimes it throws the form out of the window. We just get carried away and call injuries in. Does that mean we should give everything up? No, the idea is to make our bodies able enough to handle those. With nutrition, rest, and taking it easy, and doing things  progressively. When our muscles and tendons are strong enough, they can withstand the explosiveness, but don't forget to warm then up with light movements and do enough stretching to make them prepared for what coming next.


Recreating Document Version History - how to modify Version Create Date

Question: I am trying to create a functionality of transfering the Document set with all its history to another library in the same site. My implementation on reproducing the history of single document is based very much on https://julieturner.net/2011/06/maintain-file-version-history-when-movingcopying-files-between-sharepoint-sites/, but somehow modified to my environment with minor/major versioning enabled.
To create a major version I use File.Approve method, but this sets the last modified date of newly created major version.
I have tried to do UpdateOverwriteVersion, SystemUpdate, SystemUpdate(false) to update the version data, but failed to modify date or created unnecessary minor version.
Is there any way to restore the date when the document version was created in environment where major/minor versioning is enabled?
Answer: I am not aware of which version of SharePoint you are using. But the CSOM has a functionality called MoveTo. Which moves the files as well as preserves the metadata information.
<code>context.Site.CreateCopyJobs(new string[] { "sourceurl1","sourceurl2" },
   "destinationurl", new CopyMigrationOptions()
       {
          IsMoveMode = true,
          IgnoreVersionHistory = false,
          AllowSchemaMismatch = true,
          NameConflictBehavior = MigrationNameConflictBehavior.Replace

      });
context.ExecuteQuery();
</code>
Note: To prevent loss of data make sure the version settings and the library schema matches at both source and destination.
Comment: I appreciate your proposal, but all other code is written in using server side methods. Also, I have to migrate a document history up to a certain document version, create a snapshot for a document set and than continue with version transfer.


Bought Ether from ethereum presale (genesis) Forgot password

Question: I bought ethereum from the presale. I have the json file but unfortunately forgot the password. Is there a way I can access the wallet?
Comment: So it may be possible to brute force the password depending on how bad it was and what you can remember. The ETH guys are *not* obliged to help you with this. However if the amount of money is large you may be able to find a whitehat who will help you.
Answer: No.
From the Ethereum presale message:

You are about to make an ether purchase. Please keep the attached wallet file safe. It will serve as a cryptographic receipt of your purchase, along with your password.
The password you created and entered on the sale site is the key to your ether so please do not forget it. And please note: there are no mechanisms in place that will enable the Ethereum team to help you recover a lost password. Once it is lost, your purchased ether will be permanently inaccessible.


Where can I go to have my writing reviewed both in terms of style and technical content?

Question: I would love to have essays reviewed both in terms of quality writing and in terms of its content. I have researched a few sites but this service does not seem to exist.
Comment: "technical content" is really making your request unusual. You can get a literary review, or a technical one, but normally not both at once.
Comment: Your choice of title, tags and descriptive text is inconsistent (essays / creative writing vs. technical writing). Can you decide on one or the other or make your question general?
Comment: I am working on a piece which combines those 3. It is an essay which refers to imaginative entities, which I use to convey technical knowledge.
Answer: I've never used any online service for reviewing, editing, and/or critique.  I always get it from peers and mentors.
There are some advantages to having your writing reviewed online, like speed and convenience, but in the end, you don't really know where it's going or who's really reading it.
I would recommend finding people you trust--coworkers, friends, teachers, professors, family members--to look over it, and to tell them what you want them to look for ahead of time.  Also, be sure to ask for critique from people who would be qualified to give it to you.  For instance, asking an English major with a specialty in creative writing to review your technical essay on infectious diseases may not be the best choice.
Good luck!
Answer: The services exist, google "critique service" (without the quotes). Ignore the "copyedit" services (if that is all they do), they are just checking spelling and grammar and formatting.
Actual critique services are just damn expensive; running roughly $100/hr, or if the work is long enough, around 2-4c per word, OR $10.00/page for short works, or $8.00 per page for long works. I know you are writing essays, but if somebody wrote a 90,000 word novel (typical) that would be 360 pages, and by these prices anywhere from $1800 to $2900 for a critique.
They are easy to find, most will give you a quote on a word count.
An essay of 5000 words or so may not be bad, but still perhaps $200.
Answer: A university.
If you want your writing evaluated, apply for a relevant university course and use said writing as a part of the work you produce for that course (e.g. a university assignment, a thesis, a research paper, etc).
You may be able to pay an academic thousands of dollars to evaluate your writing and give you feedback, but they're typically very busy people so you'd generally be better off just paying for the university course they're teaching, or getting them to become your PhD or research Master's Degree supervisor instead.
Answer: For the last year or so, I've been on a critique-exchange site called "Scribophile". They work on a "karma" system --you typically critique three other people's work for every piece of work you put up for review.
I've found it very useful. There is a strong focus on fiction, but you can also post non-fiction. And it's a good community ,with a wide range of writers, from new beginners, to writers with a long string of publications and established careers. The main commonality is that it's people who are serious about writing, and about getting better at it.
(It's free to join, premium features are available if you upgrade. I have no personal affiliation with the site other than membership.)
Answer: Depending on whether you're a student at a university, I would recommend using the Writing Center at your local college campus.
Absent of that option, I would maybe recommend Fiverr.com, namely, the beta readers there. I use Fiverr beta readers to beta read my short stories (creative writing has always been my weakest spot in writing) and they've been pretty helpful; however, you would probably have to do some research as to which beta readers would be most appropriate for the type of writing you're doing. Also, as a shameless plug, I do run a gig on Fiverr.com (https://www.fiverr.com/brianhinman806) that is essentially an off shoot of the services I used to offer as a Writing Consultant for the University of Wyoming. I would be happy to work on your writing. However, all gigs on Fiverr are paid (not free).


Usage of present participle with include

Question: In order to say

My job must involve using computers,

how would I use the present participle of use?
Is this correct?

Mein Beruf muss Computer benutzen einschließen.
Answer: German uses the present participle very scarcely compared to English. The only thing it is used for on a regular basis is as an adjective or an adverb.

Der bellende Hund nervt mich.
Der Hund kam auf mich zu, bellend, geifernd, die Zähne bleckend.

For all other uses of the English present participle (or gerund for that matter), my advice is to avoid a direct transfer to German. It will most likely be unidiomatic (though understandable).
The options you have are using a noun or making a dependent clause with the activity (or, as @Toscho suggested in a comment to the other answer, an infinitive-construction). Which one is better depends on the particular case. I'll use 3 different intro-sentences but they are interchangeable.

Mein Job muss die Benutzung (das Benutzen) von Computer umfassen.
Zu meinem Job muss gehören, Computer zu benutzen.
Mein Job muss beinhalten, dass Computer benutzt werden.

The first version is the best, the third one is awful.
In this particular case, depending on what exactly the context is, another phrasing is possible.

Mein Job muss mit Computern zu tun haben.
Answer: I'd say (tersely)

Mein Beruf muss Computerbenutzung einschließen.

This wording contains "use of computers" as a noun.
Comment: Thanks. Should I always use a noun in cases like this?
Comment: @CharlieHarding No, it depends on the verb used. Generally, you have two possibilities: 1. use a noun derivative: `Benutzung`; 2. usa an infinitive structure: `Mein Beruf muss es einschließen, Computer zu benutzen.` For `einschließen` the noun derivative sounds better to me, for `beinhalten` both variants sound the same to me.


Reason for change in colour of light

Question: We all know that light has constant speed, and variable wavelength, and frequency. Suppose I have a big red glass square sheet. When white sun rays pass through it, their colour changes from white to red. I am unable to understand this effect
Comment: Please do not edit your question to change it entirely. If you are currently blocked from asking questions, then you must wait until that restriction is removed. Do not try to find ways around it.
Answer: "White light" contains all the colors and when the light passes through the red glass all other colors are absorbed but the red goes through.
Comment: @LostCause I did not know that frequencies "perceived" anything...
Comment: "The color red can also be perceived when the retina receives any of a range of frequencies. If only photons in this frequency range arrive at the retina, while excluding photons in the ranges that perceive green or blue, then red is perceived by the brain."
Comment: This is an incomplete answer. The color red can also be perceived by a combination of frequencies, if only this combination of frequencies passes the glass and all the rest are absorbed, the glass will look red.
Comment: @LostCause, if you have a more complete answer, please post it.
Answer: First think, why is that glass sheet Red?
Answer: it permits only certain wavelengths to pass through, absorbing all others. Those that passed are predominantly red, as perceived to our eyes.
White light being a combination of all colours contains the wavelength range of red, which is the only part of the spectrum that the glass lets pass through.
Answer: Essentially, white light is a combination of all colours in the visible spectrum. Now, when the light passes through the red glass, The glass absorbs all the colours of shorter wavelengths/higher frequencies and allows only red light(longer wavelength) to pass through it. I highly recommend you to study Color subtraction from this link:
https://www.physicsclassroom.com/class/light/Lesson-2/Color-Subtraction

Reason for change in colour of light


Why Google Books show different pages from different locations?

Question: I have been told that when opening Google Books from different locations (countries) and using different browsers, it displays different pages from the same book. Can anybody explain me why is this?
Comment: I do wonder how truly random this is. I tried connecting from thee different IPs (different ISPs even) but from the same country and I get exactly the same subset of pages blocked. Not logging in to google from any of these machines.
Answer: For some books, Google doens't have the copyright's holders permission to show the whole content of the book, so they just show a random subset of pages. Maybe, those permissions are also country-dependant, so they are allowed to show a different amount of pages depending on the country.
That's why, in some cases, you can see a "different" subset of the book, as they haven't identified you as the same user that already saw the book (you're using different browsers and or from different countries)


How to root htc desire 326g dual?

Question: I have HTC desire 326g dual SIM. It regularly revert back it setting. Like when installed apex launcher and selected always for using it but it always asks for launcher on restart. And it runs on kit Kat. I think now kit Kat is old so I want to replace the os too. I've tried to root it with kingo one click root apk as well as many more methods described in different sites. So any guide line.
Answer: first of all you've gotta unlock the bootloader on the HTC dev (you've gotta sign up first it's free) and you need to use the fastboot oem unlock command if they still support that model of phone. but the sad news is that phone is not a very well know phone at all so there is not root at the moment. so you stuck on a non rooted phone. theres no recovery like cwm or trwp.

How to root htc desire 326g dual?


Share book uploaded to my Google Play Books account with other account

Question: I uploaded a book to my Google Play Books account and I want to share it with another account, is that possible?
I know that I can give it the .epub file but I deleted it.
Answer: As long as you uploaded that specific book to google play books (in contrast to buying it on that platform) you can simply download it as a epub/pdf file using Adobe Digital Editions.
A detailed tutorial on this procedure can be found at Google Play Help.
Comment: Can't you just download it directly from the site like you do with purchased books and then he could email the book to the other account and they could upload it on there end?
Comment: Thank you for your answer, I suppose that I will have to do that of download it and upload in the other account


Brake lever placement on a road bike

Question: I am just going to re-wrap my road bike's handlebar tape tomorrow.  Before I do that I was wondering what the proper place is to put the brake levers.  I know they should be pointed vertically, however I was wondering if there is a rule of thumb.
Comment: Do you mean aero brake levers or traditional?  The proper position varies - aero levers are generally best used from the hoods, while traditional levers are best used from the drops.
Answer: In the olden days one idea was that the bottom of the levers should be along a line projected from the bottom straight section of the bars. I don know why, and that was often an uncomfortable position for me. So I am a long-term follower of the "what feels comfortable" approach.
This is connected to what angle your handlebars sit at, so it's important to get that right at the same time. If you were happy with how they were before you started, leave them there.
My first step would be to attach the brake levers to bare bars, ideally without cables (it's easier if you're doing new cables at the same time). If you have a wind trainer, put the bike in that because it will make evaluating the feel of the bike easier.
Then try the two positions that matter to me - resting on the hoods, and standing up pulling on the levers. The latter is harder because it's usually something I do on hills or in sprints, not cruising along the flat. So I focus mostly on the resting position.
Sit on the bike, rest on the hoods and see how you feel. Lift the levers a little and see if that feels better. Then drop them back. Only a few millimetres at a time. Once you have somewhere that works for you, you're done.
Comment: Note also that, if you find that "what feels comfortable" is with the hoods most of the way up the drop, you might consider switching to a shorter stem while you've gotten everything already apart!
Comment: @DC_CARR: I was trying to avoid getting into that :) If you find the hoods are more comfortable spread out rather than parallel to the bike, you might consider narrower bars. And so on...

Brake lever placement on a road bike


Cascading SharePoint List Filter

Question: I have a list in my sharepoint site that has two columns I want to filter by on a webpage.  I want to have the first sharepoint list filter webpart to have the person select a Project Manager.  Than I want the second sharepoint list filter webpart to only list the Projects that are assigned to the Project Manager selected in the first sharepoint list filter.  Once the person selects the project in the second sharepoint list filter It will update a list view with information about the selected project.  I can't figure out how to set the connections to make this cascading work.  Any help would be greatly appreciated.
Answer: <code><script src="https://site name/jquery.min.js"></script>
<script src="https://sitename/jquery.SPServices.min.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
    $().SPServices.SPCascadeDropdowns(
    {
        relationshipList: "Employee",
        relationshipListParentColumn: "Company",
        relationshipListChildColumn: "Title",
        parentColumn: "Company",
        childColumn: "Employee",
        debug: true
    });
});
</script>
</code>
Put that script in a script editor web part and make necessary changes to those columns.

Cascading SharePoint List Filter


2014 E250 Tire size change

Question: I have salvaged NEW tires LT225/75R16 from a 2011 E350 dully and want to mount them on a 2014 E250, existing E250 tires are LT245/75R16.
What would be my confidence level that they would function approximately the same ?
Answer: Tires sizes are fun. Here's what's going on:

your current tires are 245 mm wide, your new tires are 225 mm wide.
both sets of tires have the sidewall 75% of the width of the tire.
both sets of tires fit on a 16 inch wheel

Here's what it means:

your new tires are skinnier than what they are replacing. This provides better grip in winter conditions (same weight on a smaller tire contact patch means more pressure applied to the pavement), but less grip in summer conditions (smaller tire contact patch)
although your new tires are skinnier, they still have the same aspect ratio (75%), meaning they are overall smaller by about 4% here's the tire calculator I use. This means your speedometer and odometer will be off by about 4%. Since these tires are smaller, you will be going 4% SLOWER than what your speedometer is reporting (you'll really be going 48 when it  says 50), and you would have travelled 4% less distance than what the odometer says (you would have really travelled a distance of 288 when it reports 300, making you think you are getting better gas mileage).
your new tires will still handle about the same as your old tires, except for the 2 points above.

Personally, I like to stick to tires that keep my instruments reporting accurately. I do change tire sizes on some of my vehicles, but the new tires sizes are still the same size around as the old ones, meaning I get to tune my contact patch without messing up my odometer or speedometer.

2014 E250 Tire size change


Spottin outside ProTools

Question: Dear sound Designers,
I need to know if exist a way, using softwares like soundminers, basehead or similiar, to spot a region outside pro tools and drag it at the beginning or at the end of an audio file storaged in a network hard disk.
I need the opposite feature of spotting audio into a daw because my need is to update files with new regions recorded and do that on the fly!
Thanks for the answers,
Bye
Giorgio
Answer: I use "Audiofinder". Its an amazing librarian / processing tool, and it spots to Pro Tools. Give the demo a trial.
http://www.icedaudio.com/
Answer: Sorry but I don't think this is possible. You can drag regions from the timeline or region bin to the structure sampler an avid / digi virtual instrument plugin. That's the only time I've seen dragging anything from pro tools to another application. Are you ware that you can export regions from pro tools as audio files ??
Comment: yes I have to export audio but in the same time quickly update an audio file in a network hard disk, putting the exported audio file at the beginning on in the end of that file....
Answer: Not quite sure I entiiirely understand what you're asking. But, if you're looking to add some audio to the start/end of a bunch of already recorded audio files then perhaps using some kind of audio editor with batch processing might be worth looking at?

Spottin outside ProTools


Setting up a simple proxy

Question: I'm going to China for a week, and I'd prefer to be able to watch YouTube while I'm there. Since it's blocked, I presume I'm going to need a proxy. I have a Mac and a Linux box at home that I can use, but I'm not sure how complicated setting up a proxy is. From what I understand, I should be able to do it with a browser that supports HTTP 1.1 CONNECT if I connect to my machine at home. Can I do this, and if so, what browser can I use, or if I have misunderstood something, do I have any other simple solutions?
Answer: The latency for web browsing is going to be very high and thus very slow if you are going to tunnel all the way to your house and then back out to the internet. You may as well set up a VPN connection, or take advantage of a free VPN service such as Hotspot Shield.
Answer: tinyproxy works well if its for your own use - i'd suggest using a non standard port, tieing it up with a dyndns service, and using proxy switcher on firefox to turn it on or off. Its fairly simple to set up on linux based system  (its commonly found i nrepositories) and unless you need to ip address restrict it, needs no setup.

Setting up a simple proxy


Best option to take a flight when I book two separate flights one domestic connecting to another international flight at EWR?

Question: I have booked two separate flights one from domestically in the US at EWR Newark airport. And other one is an International long journey flight to India. So the time gap between the domestic flight and International flight is 3 hrs. Will it be enough for me to collect the luggage and move to another terminal and complete the checking and security? I have another alternate that is to take previous day flight and need to be in the airport for more than 10 hrs. Which option is better?
Comment: Note: on such case the baggage rules of first leg are the domestic rules. Note: it depends also on period (winter: I would prefer more time), and the starting airport (if it has just few flight, which it seems to imply from the question, if one place as problem, the airline must wait and bring a new place...very seldom this is done)
Answer:
the time gap between the domestic flight and International flight is 3 hrs. Will it be enough for me to collect the luggage and move to another terminal and complete the checking and security?

Maybe, but it doesn't really matter, because the check-in deadline for the second flight will be at least 60 minutes before departure, the chance of the first flight being delayed by two hours is fairly significant, and the consequence of missing the second flight is probably even more significant.  It's a risk I would not take.
Answer: We've had plenty of similar questions on this site. "Is X amount of time enough for a self-connection in airport Y". And the answer is roughly always the same, save for a few details: it can be done, but if you don't, it will cost you.
The first point to note is that if you have checked bags, then you must take into account the check-in deadline for your second flight. This varies a lot between airlines, airports, destinations, and more. In your case, the only non-stop flights from EWR to India are flown by United or Air India, and in both cases, the check-in deadline is 60 minutes.
This means that you now have 2 hours to:

deplane
get to baggage claim
reclaim your bags
go to the departures area (which, from your question, is in a different terminal)
queue in line and check-in

If your first flights arrives on time, this should be very easy and completely doable (compared to more complex scenarios where you need to go through passport controls for instance, or airports where inter-terminal transfers can be quite long, or if you have to wait for you luggage at CDG).
However, if anything goes wrong (flight delayed, luggage taking a bit too long to be delivered), then if you don't make it to the check-in desk for your second flight on time, you will be considered a "no show". For most fares (especially the cheaper ones), that means your booking is no longer valid, and you will have to book and pay for another flight, at the last minute. At some periods you may have an issue with availability, and nearly all time you'll have to pay a lot more for a last minute flight than one booked in advance.
Also, if this is the further flights on that ticket (e.g. you have a return flight after that), then the following flights are very likely to be cancelled as well.
With the second flight being a long-haul international flight, you have two issues which make this problematic:

flights can be expensive
the next flight is probably the next day, or even later.

If you have to stay overnight (most likely), then you will have to find a hotel, pay for it, along with transfers to/from the hotel, meals, etc.
If you stay overnight, you also have the issue that you may be affected by any deadlines for Covid tests and need to take a new test.
Most people say the minimum is 4 hours before two flights booked separately to have enough margin. I'd modulate that quite a bit, as it depends a lot on the combination of flights, and especially the cost and frequency of the second flight. An overnight layover is recommended in this case.
Answer: Another factor worth considering is that Newark currently has a runway replacement project in progress, extending into October, which along with weather has been regularly causing delays at the airport. That means a higher likelihood your domestic flight into Newark could be delayed, while your outbound flight to India is still more likely to leave on time.
Newark is regularly delay-plagued anyway even without construction. I wouldn't risk this, personally, certainly not with the need to claim and re-check checked bags and change terminals.
Answer:
Will it be enough for me to collect the luggage and move to another terminal and complete the checking and security?

No one knows. At this point it comes down to probabilities and risk management. With 3 hours in Newark coming in domestically you have an ok chance of making it: maybe 70/30 or so. Given the consequences of missing your flight and maybe having to buy a new same day (or next ay) ticket on the spot: is that risk acceptable to you?
You can certainly increase your chances by not checking bags, and determining if you can do on-line check in for your India flight without manual doc checks (immigration, Covid, etc).
Answer:
So the time gap between the domestic flight and International flight is 3 hrs.

I would only accept a transfer like that under the following conditions:

it is a single ticket with bags checked through to the destination.
the airport is small. Like under 10 gates and a single terminal building.

While three hours might be theoretically possible, it will only be possible if everything works perfectly. That is unlikely to happen at Newark in normal years.
If you have a single ticket your bags will be at the departing gate in 10 minutes, and you can (assuming the same terminal) walk directly there airside - no dealing with security again.
Comment: @ugoren if you bother to look up the definition of MCT you will see it is for connections bought on the same ticket. No claiming and rechecking of bags, frequently no dealing with security. Just walk to the next gate.
Also, there are plenty of airports small enough that the people working there all know each other and can literally yell down the concourse that the passenger will be there in two minutes. I've had exactly that situation occur (bag recheck due to customs) and that's almost exactly what happened. Although they used the phone instead of yelling.
Comment: So your answer is: "Don't do this with 3 hours between flights on separate tickets."
Comment: @Willeke 10-word answers usually get flagged as incomplete / poor quality / "can you elaborate a bit". You should know that by now.
Also, if you bother to review point #2, 3 hours + separate tickets are no problem at small airports.
Comment: I do appreciate longer answers but missed a conclusion or to the point advice in your answer.
Comment: The airport size matters very little. If the incoming flight arrives on time, a 3h connection is plenty (MCT for domestic-international at EWR is 1:15). If the incoming flight is late, no airport would be small enough.


A word for being troubled at others' potential schadenfreude against me

Question: Schadenfreude is "enjoyment obtained from the trouble of others." I'm not looking for the antonym of that, but instead if there is a similar word for the object of schadenfreude. For instance, is there a word for me knowing (or being troubled that) others are experiencing schadenfreude at my expense?
Comment: Embarrassment/humiliation?
Comment: possible duplicate of [What's the antonym for Schadenfreude?](http://english.stackexchange.com/questions/61008/whats-the-antonym-for-schadenfreude)
Comment: It depends on what troubles the "object" is having. I can't think of something better than the periphrastic "happy at my expense."
Comment: BTW there is a Greek cognate: epicaricacy
Comment: @MattЭллен: The OP clearly says he does not want the antonym; besides this question is very different IMHO.
Comment: @Shyam true, I've edited the title so it's more applicable.
Answer: 'Schadenfreude' is a German word. 'Opfer' i.e. victim, describes the person suffering from schadenfreude.
Answer: The concept of self-pity encompasses negative feelings by the suffering person, but it primarily concerns the source of the pain, rather than additional pain based on others' enjoyment. Cambridge defines it as

care and sadness about your own problems

At times, those who are identified as self-pitying are even thought to take some satisfaction in their suffering. American Heritage defines it as

Pity for oneself, especially exaggerated or self-indulgent pity.

Martyrdom is similarly used to refer to those who suffer and perhaps derive some self aggrandizement in their suffering.  Compact OED offers, as one definition of martyr

a person who displays or exaggerates their discomfort or distress in order to obtain sympathy

Again, the word does not generally convey an enhanced pain based on others' joy.
Answer: Riffing off @WolfSchumacher's answer, you're after a fear (Angst) of being the victim (Opfer) of schadenfreude (Schadenfreude).  German being famous for its compounds, you could coin:

Schadenfreudenopferangst

It's preposterous, but Schadenopfer (victim of damages), Opferangst (fear of victimhood) and Freudenangst (fear of joy) are all attested to varying degrees.
The resulting term would, of course, be entirely incomprehensible to English speakers, however.  An all-Greek offering isn't much better epicaricacothymophobia (working off mac389's comment).  And maximizing parts familiar to English speakers hardly improves things: I don't see schadenfreudothymophobia taking off any time soon.