Remove sharp sounds in audio

Question: I listen to music as a way to relax. However, sometimes the brass section of orchestral works produce quite sharp sounds. Using an equalizer works and reducing the 5-44.1khz sections work, but then everything sound muffled. Is there a way to get rid of these sharp sound (I suppose that's a part of the harmonics of the brass section) without removing harmonics of other sections of the orchestra?
Comment: Can you clarify which equalizer sections you are reducing? You say 5-44.1kHz, do you mean from 5Hz to 44.1kHz? Which would be across the whole frequency spectrum? I've only seen equalizers go up to 20kHz.
Comment: What do you mean by "sharp" ? In music, "sharp" means pitch higher than the correct pitch  - or a half-tone above a named note.   It seems you're more concerned about the **volume level** of certain instruments or certain frequency ranges.
Answer: Rather than simple EQ, which as you've already seen kills all frequencies in the band you're dialling out rather than just in some instruments, I'd instead opt for Multi-Band Compression.
How you implement this is going to depend on what your music source is. On a Mac, it's pretty simple - get a hold of SoundSource & add it into your music routing

For each of those sources, or the global output, you can add plugins, the ones that come with the Mac itself, or 3rd party AU Units.
If you compress hard across all frequencies, then nothing will ever jump out. this is going to sound slightly unnatural if you push it too hard, but it will definitely tame any peaks, specifically by reducing their aggressive frequencies.
Round this off with a multi band limiter & you can brick-wall your output to never reach offensive levels.

This is actually the exact method I use for my media player Mac [HTPC] so I can watch movies whilst being able to clearly hear the dialog, yet not blow the walls out [or annoy the neighbours] when the explosions happen.
Images above from Sound on Sound - Multi-band Compression
Comment: How would I do this in Adobe Audition?
Comment: idk Audition & idk what platform you're on - but generally the same way in any DAW. Find appropriate plugin; tweak until happy.

Remove sharp sounds in audio


Is a super-Earth with the same gravity as Earth possible?

Question: I'm helping a friend construct a fictional planet for a project, and we've run across a problem. He's looking to create a planet nearly identical to Earth, except only larger. It would need to have the same gravity, similar rock content, etc. However, I watched Artifexian's terrestrial planet creation video and used the resources in the video description. ---That's where the issue comes in. According to the graph that was linked, a planet larger than Earth that maintains the same mass falls under the "waterworld" category. We're looking for a world with continents, so that obviously won't work. Is it possible to create an Earth clone that is the same in all aspects except maybe 25%-50% larger?
Comment: This is a good question! Just to clarify, are you keeping the mass of the planet the same but expanding the radius by 25-50%? I just want to make sure I'm not misunderstanding.
Comment: Re: "25%-50% larger", does that refer to surface area or radius of the planet?
Comment: Similar [how to build a planet larger than earth, but has the same gravity?](https://worldbuilding.stackexchange.com/questions/51059/how-to-build-a-planet-larger-than-earth-but-has-the-same-gravity), [Could there be a planet bigger than Earth, but with less gravity?](https://worldbuilding.stackexchange.com/q/11441/20315) // comment not necessarly to point out it a duplicate, but to help ai overlords to link those things together based on similarity
Answer: The video's right; a radius increase of ~25-50% would imply a lower density than that of Earth, which would be likely achievable only if the planet had a substantial water component (I'd cite Seager et al. 2007, but you can look at a lots of different models; beware that there are plenty of uncertainties). However, if you're willing to fudge the mass a little, you can increase that radius to the extent you want.
A nice example is Proxima Centauri b, which is believed to be a bit more massive than Earth and a bit larger. The uncertainties on its mass and radius are substantial, and depend on which observations you trust, but some have argued for median values of 1.30 times the radius of Earth and 1.60 times its mass (Tasker et al. 2019). This would yield a surface gravity of about $0.95g$ - perfectly enjoyable - and would imply a larger amount of water than Earth but still a largely silicate composition.
Whether Proxima Centauri b actually has this mass and radius will require a better understanding of its orbital inclination (which does affect our measurement of its mass) and other parameters, but a planet with $R=1.3R_{\oplus}$ and $M=1.6M_{\oplus}$ would fit what you're looking for.
(As an addendum: "Super Earth" does have a specific meaning in astronomy, but it's typically applied to planets weighing in at somewhere between a couple Earth masses and 10 Earth masses, many of which have hydrogen-helium envelopes and are far from Earth-like, though they may still have surface gravities near $g$ -  see Gliese 163 c and Gliese 1214 b, among others.)
Comment: @Goodies The mass distribution shouldn't really make a difference, so long as it's spherically symmetric - the [shell theorem](https://en.wikipedia.org/wiki/Shell_theorem) says that the only important quantity when calculating the surface gravity is the total mass contained within the planet. If you increase the mass by some small amount, it would increase the surface gravity to the same extent regardless of which layer it's in.
Comment: @Goodies If you took a Black Hole of the mass of the Earth and then put it in the centre of a balloon the size of the Earth, the gravity on the surface of the balloon would be exactly the same as the gravity you are experiencing now. As long as you keep it spherically symmetrical, you can move the mass around inside the surface as much as you like - it won't make any difference.
Comment: It depends on the composition of the planet as well. A heavy planetary core relative to the rest of the planet's mantle and crust mass would also contribute to the lowering G effect .. An entity on the planet's surface would experience less gravity, because the heavy core is relatively far away.. while the core contributes significantly to the total mass M.
Comment: Ah science is right of course.. If Newton already said it.. but I find that shell theorem difficult to grasp, actually.. there's a lot of math in that article ! intuitively I'd say density should have *some* effect.. suppose the center of the planet is a miniature black hole, earth mass.. Total planet radius comparable to earth.. On the surface, I'd feel a gravitational force larger than earth's, because total mass is larger. But I'm quite far away from that miniature black hole ! 6.371 km.. If I'd go to space on that distance from the planet surface, I would not feel any gravity (??)
Comment: @Goodies density can have an effect but it needs to be non spherically symmetric
Answer: You could create such a world. Just create a planet with two times the radius of Earth and make a hole in the middle. To prevent the world from collapsing put some construction on the inside surrface to resist the collapse. A huge magnetic field generator could be placed in the middle to give the world an appriate magnetic field.


Is the 2DS region locked? Will I be able to play NA games on a Japanese System?

Question: If I purchase a 2DS from Japan, will I be able to play American games on it?
Answer: From this site:

Like the Nintendo 3DS before it, the new 2DS is region-locked, which, unfortunately, means that devices can only play games with the same region codes, and you can't access online stores from different regions.

Since Japan is a whole different region than North America, you can't play North American games on it.
See this answer for more information on how Nintendo does region locking (its for the 3ds, but it should be identical for the 2ds).
Comment: This region locking is pretty terrible.  I wanted to try some Japan only games but I'm not about to buy a new system for one game...
Comment: Thank you so much for the information!  That is what I thought, but the info I saw online was not very clear.


sql server, composite keys - ignoring duplicate

Question: Is there a way to prevent sql from throwing an error when I try to save a record that already exists. I've got a composite key table for a many-to-many relationship that has only the two values, when I update a model from my application, it tries to save all records, the records that already exist throw an error Cannot insert duplicate key  is there a way of having the database ignore these, or do I have to handle it in the application?
Answer: you are calling an INSERT and trying to add duplicated keys. This error is by design, and essential. The DB is throwing an exception for an exceptional and erroneous condition.
If you are, instead, trying to perform an "upsert" you may need to use a stored procedure or use the MERGE syntax.
If, instead, you don't want to UPDATE but to just ignore rows already in the table, then you need to simply add an exception to your INSERT statement... such as
....
WHERE
    table.Key <> interting.key

Answer: Try something like this with your insert statement.
insert into foo (x,y)
select @x,@y
except
select x,y from foo

This will add a record to foo, ONLY if it is not already in the table.
Answer: You could try creating your index with the IGNORE_DUP_KEY option so that you only get a warning when you have duplicate keys rather than a true error.
The other option and possibly the better one is to use the MERGE statement rather than insert.  The MERGE statement let's you do Inserts, Updates and Deletes all in one statement and sounds like it should work out well for what you are trying to do.
Last but not least, as you said fix it in your app and only insert the rows that need to be added.


Newsletter system with statistics tracking

Question: Someone I met told me about this enterprise that offered him a newsletter system that would enable him to send newsletters to his clients and tell him which clients actually read it and which, for example, sent it to the trash, marked it as spam, etc. Is this really possible? If it is, how do they do it?
Answer: most of these systems (and there are many) use images or external links to track who/when/where the mail was opened.
technically, the most they can tell you is when something was opened (plenty of clients block images and alternative tracking methods, so it's not accurate), they can guess at when an email was forwarded (and then opened) and provide a vague deductive guess at how many went unread (and of course the obvious stuff like tracking click-throughs on links, unsubscribes, MTA related information like bounces etc.)
There would be no way of knowing if a mail was trashed or marked as spam within a client.
Mailchimp has a pretty good "these are all the things we report on" overview - they are a pretty good base to understand the bulk of mass mail systems and list managers.
Answer: There are some systems that can tell you when somebody has for sure read (or rather at least opened) your message, but there are none that can say for sure that you have not. It is possible to view letters without opening images or giving off any other "signals" that are used to identify an open. It is not possibly to accurately track messages sent to trash or spam as this happens on proprietary systems outside the control or monitoring scope of anyone sending emails.
Answer: It is possible when you make use of return receipts.
Not all email clients support these features, and most of them ask the end-user whether they want to send such notifications.
For a more technical overview of the possibilities, read the RFCs mentioned on the wiki page:
Delivery Status Notifications:

3461
3462
3463
3464

Message Disposition Notifications

3798
(3503)

An alternative method that is generally frowned upon is to make use of embedded images in the email, with a unique URL for each recipient.
When the image URL is requested on the web server, the sender knows the email has been opened.
This is why many mail clients block images by default, and the user has to specifically allow images to be shown in emails.
Comment: Forget "anywhere", it's frowned upon almost everywhere! Note that the default rules for almost every mail client in the world is to block images and to use whitelist style rules to allow them for trusted addresses.
Comment: I know about return receipts, but I think this is not a very good idea because, as you said, the user generally has to agree to send the receipt. A don't know it they are even supported in major webmail services like GMail, Hotmail or Yahoo.
Comment: image tracking is pretty common place. not sure it's frowned upon anywhere. clients may block the images, but it's still the most common way of tracking.
Comment: -1 Because while such RFC's exist in theory, in practice they are are discarded so often that the result is statistically insignificant, hence anybody selling you statistics of of them is basically selling smoke. Guesswork says that where there is smoke there is fire, but anybody interested in the numbers needs to know that they are being shown smoke!
Comment: @caleb not really. Outlook and the MS clients block it, Mac mail doesn't by default unless it has flagged it as spam. Gmail doesn't block by default either. Regardless of your personal preference, it's still the most widely used method of tracking. update: there is a reference table here: http://www.campaignmonitor.com/blog/post/2559/current-conditions-and-best-pr-1/ that indicates 2/3 of mail clients allow images by default.


Why do more languages not support ===

Question: I mean it as it is used in JavaScript. Just curious why this is not supported in more languages? Like Java for example does not have it? Seems to be a very useful operator to have.
Comment: JavaScript's `===` is just there because `==` has annoying, counter-intuitive behavior. Languages that don't have a broken `==` don't need to fix it with a `===`.
Comment: Yes, I understand the behavior. I just think it's terrible.
Comment: Java is a statically typed language, therefore there is no need to check based on type because Java *always* knows the type at compile time. JavaScript has dynamic typing, thus it is not always known what type an object is in advance, thus the extra operator.
Comment: Obvious answer: Because in most languages, == means what === means in Javascript.
Comment: @ReinHenrichs - == in JavaScript (or PHP) is not 'broken' - it's just that the dynamic/loose typing allows for 0 == '0'.
Answer: Javascript's and PHP's "regular" == operator does implicit conversions. === exists so you can omit these coercions when you don't need them or don't want them to apply. In many other languages, including dynamic ones (e.g. Python), implicit conversions are vastly less frequent. That is, integers may be converted to floats when doing math or comparing, but "1" won't go along with 1. In those languages, the == operator is basically the equivalent of looser language's ===.
To pick up the example, Java goes even further - its == will only consider two expressions equal if the evaluate to exactly the same reference, i.e. are the same objects (primitive types are, as usual, an exception). You can't get any stricter. What should a === do, consider two references equal only if they resulted from the same expressions? ;-)
Comment: In C#, it would have been useful to have separate value equality and reference equality operators, rather than having an "==" operator whose behavior sometimes mirrors that of the effectively-virtual `Object.Equals` and sometimes mirrors that of the non-virtual `Object.ReferenceEquals`.  Consider, for example, given function `bool Eq(T p1,T p2) where T:class {return p1==p2;}`, what is the effect of `bool StrEq(string p1, string p2) {return Eq(p1,p2);}`.  If the latter function called `Eq(p1,p2)` it should be expected to use reference equality, but...
Comment: ...it will still use reference equality even if it calls `Eq(p1,p2)`, even though the operands to `==` would appear to be of type `string`.
Comment: @supercat That's interesting and ugly, and yes, separate operators for value and reference equality is a good idea. But it's not really related to the question, isn't it? I'm not complaining, I just want to be clear about this.
Comment: I was reading the question as asking fundamentally why more languages don't have more than one type of equality-comparison operator; your answer seemed to question why such a thing would be needed in Java.  Having an extra operator would be most helpful if code could use it for those types, and only those types, which explicitly define it (the way the `=` operator works in vb.net, btw).  Perhaps Java could have defined a `valueEquatable` interface, and had one of its equality operators only act on primive value types or types which implement `valueEquatable`?
Answer: In JavaScript == uses type coercion for evaluating equality.
0 == false //=> true
1 == true  //=> true
null == undefined //=> true

Using === eliminates type coercion, acting as you would expect the operator to act. If the types are the same and the values are the same it returns true, otherwise false.
Other languages that do not utilize type coercion for equality checks don't need a === because that functionality is standard.

Why do more languages not support ===


How to remotely connect to Ubuntu from Ubuntu using Remmina?

Question: I'm running latest Ubuntu on my machine. I'm using Remmina RDP to remotely connect to Windows machine. But I want to migrate our current Window server to Ubuntu so I have purchased a live Ubuntu server. How do I connect remotely to that Ubuntu server from Remmina? When I enter server information it says unable to connect to server. Any help? Thanks
Comment: RDP is one way. A lighter-but-stiff-full-featured alternative is a web-based frontend like [cockpit](https://cockpit-project.org/), which is in the Ubuntu repositories.
Answer: So I found the answer to my question. If you're like me a Linux noob (been running Linux for just a few months), the best approach is probably to just install a GUI on your Ubuntu Server if everything is in a terminal. If you want to do everything from a terminal, discard this but for others who want desktop, install it via Terminal.
That is what I did
sudo apt-get update
sudo apt-get install ubuntu-desktop

This will install a GUI and you can install other software as needed.
For RDP from Ubuntu to Ubuntu when you have the GUI. Follow this tutorial
Install Xfce
sudo apt update
sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

Install Xrdp
sudo apt install xrdp

Configure Xrdp and then use Remmina on the machine from which you wish to connect.
Comment: >> Configure Xrdp and then use Remmina on the machine from which you wish to connect.

`install a wm, now draw the rest of the owl`


Macbook Pro Hangs/Freezes sometimes

Question: I don't turn off my MacBook Pro very often, and sometimes it just freezes and restarts itself after a few seconds. Its very annoying, especially when I'm working on something. I contacted support a few times and I did everything they said, and recently I started monitoring my memory usage and I noticed that Safari is taking a lot of memory, so I started to restart Safari when I see that its eating up my memory. My MacBook started acting better until just now. While I was waiting for it to restart it self, I saw that the memory levels were ok. So I'm wondering, is there any way I can see the history of Activity Monitor? Or is there any log I can check to see what the error is?
Comment: Some console output after a freeze would be helpful (console is located in the utilities folder). It's usually to large to post here, so use a service like pastebin.
Answer: High memory usage is not a reason for a machine to randomly restart, but if you say the memory usage has an effect on the frequency of it happening, the issue might be a defective RAM. There are several tools to test your RAM, a free example would be MemTest86.
Comment: I'm not sure what the reason is. Thats what I'm trying to find out. Thanks I will check it out!
Answer: I had the same issue on my MacBook Pro (Retina, 15-inch, Early 2013). At random occasions, it would lock up for a few seconds and more often than not restart or shutdown after that.
There was no kernel panic report. No obvious error in console logs. Hardware tests at the Apple Store found no problems.
I recently came to the conculsion that this is triggered by Oracle's version of Java. I had completely uninstalled Java and had no crashes in months. I did not yet suspect Java to be the culprit. I assumed a OS X update had fixed the problem. Then I re-installed the Java SDK because I needed it for a project. In the week after I installed Java, I had 4 sudden reboots. None in the weeks since I again uninstalled Java.
Uninstall Java: https://www.java.com/en/download/help/mac_uninstall_java.xml
Uninstall JDK:
http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html
I have reported the problem to Apple. Radar bug report #26992850.

Macbook Pro Hangs/Freezes sometimes


Physical meaning of enthalpy

Question: I've been reading about thermodynamics and reached the topic about enthalpy . I've understood its derivation but I don't understand its physical meaning ... Also I don't understand why they have divided by the mass of gas to get to the specific enthalpy equation . what's the use of it? I know the meaning of all state variables the enthalpy contains but I can't see the benefit of combining them together to have the enthalpy ..
Comment: Don't try to ascribe too much physical meaning to it.  It is just a very convenient function to work with in doing many many kinds of thermodynamic problems.  You will get the hang of it once you have used it on many problems.  Your time is too valuable to obsess over the physical meaning of enthalpy.
Comment: https://en.wikipedia.org/wiki/Enthalpy
Answer: Thermodynamics was developed largely with gases in mind. In this case work can be done on the gas, the $p\Delta V$  term. But there is also the internal energy U to consider, so when one wants to compare experiments done on the same substance under different conditions it is useful to define a new quantity, which is the enthalpy, as the internal energy plus work done. Thus one has a measure with which to properly compare and one set of measurements with another.
Answer: In physics one of the most fundamental concepts is the conservation of energy and in thermodynamics we systematize, in an ideal manner how to account for the energy and changes in energy in systems. So basically a means of categorical naming, bookkeeping.
The units of enthalpy are energy units such as Joules. And for a homogeneous system, the enthalpy is the sum of the system internal energy and the pressure energy.
As energy, enthalpy is potential in a system in the form of chemical bonds; the making and breaking of these bonds. The direction in which enthalpy changes tells us which way heat is flowing: if $\Delta H < 0$ heat flows out of the system (exothermic), and if $\Delta H > 0$ heat flows into the system (endothermic).
Comment: "If $H > 0$ heat flows out of the system (exothermic), and if $H < 0$ heat flows into the system (endothermic)."  This is incorrect on two levels.  First, the distinction between exothermic and endothermic is determined by *the change in enthalpy*, $\Delta H$.  Second, if heat flows out (exothermic), $\Delta H < 0$; if heat flows in (endothermic), $\Delta H > 0$.

"enthalpy is potential in a system; the ability to do work."  Actually it's the free energy, rather than the enthalpy, that gives the potential to do work.
Answer: A chemical engineer's viewpoint, which will definitely differ from a physicist's viewpoint:
For enthalpy calculations, a standard state is defined, such that the enthalpy of an ideal gas at a stated temperature (e.g., 0K, 273K, etc.) and pressure (e.g., 1 atm) is defined to be 0 BTU/lb (yes, I worked in U.S. units).  Ideal gases that exist at a higher temperature than this obviously have more internal energy than the standard state, and they are considered to have a higher heat content than the standard state.
A liquid at the standard temperature had to lose an amount of heat equal to the heat of vaporization for that compound, meaning that its enthalpy can easily be negative.  Likewise, gases that have a low enough temperature also may have a negative enthalpy (if the standard temperature is not 0K), recognizing that most gases are not ideal, mixtures of gases may involve non-ideal mixing rules, etc.
The concept of "heat content" is useful as long as the standard state is kept in mind, and heat transfer calculations can still easily be done by calculating enthalpy changes for a given substance, or in the case of published data, by looking up enthalpies that correspond to two different temperatures, and calculating the heat transfer into or out of that substance as the difference between the enthalpies at those two different temperatures.
Thus, there are definitions of enthalpy that can be given the physical meaning of "heat content".  In addition, for typical real world problems, fluid flow rates for process design problems are normally not known beforehand, so it is convenient to define a specific enthalpy (e.g., BTU/lb) for a given substance, and multiply by a flow rate (when that data is known) to determine total enthalpy.
Answer: Enthalpy, H,  is H = U + PV where U is internal energy, P is pressure, and V is volume.  Specific enthalpy, h (enthalpy per unit mass), is h = u + pv where u is internal energy per unit mass, P is pressure, and v is specific volume (inverse of density).  Physically, enthalpy represents energy associated with mass flowing into and out of an "open" thermodynamic system.  An "open" system is one with mass transfer in and out, in contrast to a "closed" system where there is no mass transfer. From a Lagrangian viewpoint (following a fixed mass) pv is work; from an Eulerian viewpoint (considering a fixed region) pv is energy.  Most developments of fluid dynamics use the Eulerian viewpoint. Specific heat at constant pressure is based on enthalpy; specific heat at constant temperature is based on internal energy.  For an ideal gas, enthalpy- like internal energy- is a function of temperature only.  Engineering texts on thermodynamics provide more details.  A texbook I like is an old one, Elements of Thermodynamics and Heat Transfer, by Obert and Young, because of the clarity of the definitions and explanation of concepts.
Answer: Enthalpy is heat at constant pressure:
$ dH = dU + pdV + Vdp $
$ dU = \delta Q - pdV $
$ \delta Q = dU + pdV $
$ dH = \delta Q + Vdp $
$ dp = 0 $ for constant pressure
So on a psychrometric chart of air, enthalpy is heat (energy) content  per unit weight.

Physical meaning of enthalpy


4-20mA PLC analog output ground referencing for other devices

Question: I'm currently using a PLC to control an induction heating coil.
I'm using a chinese induction driver that allows 4-20mA PID input. This device runs off standard australian 230v AC 50hz.
I've successfully operated the device using a standalone PID controller that also runs off mains power.
My PLC runs of 24v DC and has it's own din rail mounted power supply.
The output 4-20mA signal is referenced to the chassis of the PLC.
When I connect my PLC PID output to the chinese induction driver PID input, the driver short circuits catastrophically.
I believe this is due to the ground reference of the driver unit and my PLC being different. I confirmed this by measuring the potential difference between the two PID signal negatives and found that there was a 109V DC difference, which explains why the driver overloaded.
My question is, how can I reference the ground of my PLC to the induction driver unit?
I've gone through the circuitry of the induction driver and believe it does not have any features for sharing a ground reference. It receives it's power by L and N wires from a mains outlet. The control board of the induction driver has no grounds to it's chassis enclosure as such, I believe connecting the two chassis would provide no solution.
The standalone PID controller that worked perfectly also operates off mains power (L and N wires with no earth) and provides a 4-20mA signal that the induction driver seems to agree with.
Any information would be greatly appreciated, thank you.
Answer: Hard to tell without datasheets for the relevant products, but it sounds like the driver lacks isolation between the 4-20mA input and the mains. If so, this is a rather sub-standard design.
You can use it if you add a 4~20mA:4~20mA isolator between the PLC and the driver. Make sure the isolator is rated to continuously withstand mains voltage.


How to apply Z-index to a layer in Photoshop?

Question: I am new to Photoshop trying to design a web page and I was wondering is there any way to assign a "z-index" like feature from CSS to a layer to control overlapping between my images?
Answer: To control stacking, you reorder layers in the Layer Panel. (Window > Layers) Simply click and drag a layer to move it above or below other layers in the panel.

There are also a number of commands to Arrange layers in the Layer Menu item which also have associated shortcuts you can use.

Reviewing the general help files or starting with some basic Photoshop tutorials found via Google may be of great benefit.
Comment: @Giannis, since you're new to Photoshop and European. I'd like to point out that you can change the shortcuts shown here and nearly everywhere in the menus. --- I'd suspect that at least in some European countries you can find your self with this same issue that I've always had with the fin-swe keyboards that I've used. There's this issue that when you press shortcut keys involving square brackets, it doesn't work for some reason. The best solution is to just go to the `Edit > Keyboard shortcuts...`, Find the correct menu section and replace the square brackets with something else.
Comment: I've suspected that it might have something to do with the fact that at least with the fin-swe keyboard, you already use a modifier key, when you want a square bracket: `alt+8` add `alt+9`. Changing your keyboard to US from the OS settings does help, but it's obviously not a good idea.
Comment: @Joonas Thanx, i got a book to learn the basics first.


Is Privileged Access Management secured without regular Patch Update?

Question: It is well know Privileged Access Management (PAM) is a solution that helps organizations restrict privileged access within an existing Active Directory environment.
Many big company use it to address their Privileged Access.
The issue is PAM solution system normally advice customer not to Patch their Operating System because it will some sort impact their system.
Is this secured?
Comment: Any patching may affect security. This is, as in other cases, a matter of balance. Does patching break more than it fixed ?
Answer:

PAM solution system normally advice customer not to Patch their Operating System

This does not sound correct and I would suggest calling out the PAM vendor and looking into their competitors. I've never heard of a PAM vendor telling their customer they should avoid patching the OS. Sounds like a poor PAM vendor or a miscommunication


Hidden Service without vps/vm?

Question: Is a virtual private server or virtual machine required to get your webserver to show your .onion correctly. I cannot get my onion viewable and this is the only thing I havent tried. It makes no nense to me why I would need them but most guides out there have a vps...
Comment: Ive tried configging the torrc several times. Why is a localhost ip required? Once again Im not understanding this stuff. Its way different than a normal plain webserver. Ive messed with apache and nginx both in linux and it just wont connect to the hidden service. But you can view my page through my public ip so I know its getting out there. Do I put my public ip in the localhost ip spot? Why do you need a localhost ip put anywhere?
Answer: Neither a VPS or a VM is required to have a working hidden service. You need to configure your torrc file setting up:
<code>HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80
</code>
In the first row you have to setup the directory that contain the files of your HS, and the second row obviously setup the port of your HD.
Once you setted up, restart Tor. Then you should view two file in your HiddenServiceDir: hostname (contains your .onion address), private_key (don't share this one with someone).
The reason of using VM or VPS, is a security reason. Usually you use Whonix like VM because is dedicated for Tor (server side), or you can use a VPS for bandwidth reason.
So, to run a HS you require of the correct configuration of your torrc file, this is a must! Without this you won't get a working HS. Is your choise to use a VM or a VPS, I suggest you to use a VPS with a VM running Whonix.
PS: what did you tried?
Comment: Also, make sure the permissions of the folder specified in the torrc are correct, else Tor will not use it or refuse to start.

Hidden Service without vps/vm?


Is it legal to physically wash money?

Question: I have some money that fell in a mud puddle. It got really dirty, and I don't want to put it in my wallet as it currently is. Is it legal to wash the money?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/140842/discussion-on-question-by-user47868-is-it-legal-to-physically-wash-money).
Answer: Yes
It is perfectly legal to physically wash US currency under US law.
The kind of "money laundering" that is illegal is obscuring the history of funds, making proceeds of crime appear legitimate, or just making the source of funds hard to trace. That violates 18 USC 1956 and/or  18 USC 1957 There may be other relevant laws as well.
This is "washing" money only in a metaphorical sense.
See also this US Dept of Justice page
Comment: **Comments have been [moved to chat](https://chat.stackexchange.com/rooms/147515/discussion-on-answer-by-david-siegel-is-it-legal-to-physically-wash-money); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed.
Answer: As far as the law goes, there shouldn't be any problem with that.  18 USC 333 lists a bunch of stuff you can't do to currency, but the rule ends with the phrase "... with intent to render such bank bill, draft, note, or other evidence of debt unfit to be reissued".  Based on your description you have no intent to render the bill unusable or invalid, so you aren't violating that statute.
On the practical side, US banknotes are made of a blend of cotton and linen, so the underlying material should be washable.  It isn't particularly thick, though, so hand washing would be less likely to result in tears than sending it through the washing machine.  Experts quoted in a New York Times article mention that detergents can damage some of the security features on the bill and cause problems with bill sorting machines and automated money readers.  They also remark that the only completely safe way to clean a bill without risk of damaging it is a process similar to dry cleaning, far too complicated for a DIY solution.
Your safest bet is just to swap it out.  The Bureau of Engraving and Printing runs a Mutilated Currency Redemption program that will swap out heavily soiled or damaged bills for fresh ones.  I usually take my extremely dirty or damaged bills to my bank and they'll swap them out for me.  They send currency to the BEP for replacement in bulk, so it's the same ultimate effect but with less hassle.  Just don't try to put heavily soiled bills in an ATM or any other mechanical bill reader as they can damage or jam the mechanism.
Answer: It is not illegal unless you are damaging the money. 18 USC 333 states that it is forbidden to damage money " intent to render such bank bill, draft, note, or other evidence of debt unfit to be reissued".
You should clean your banknotes with care. [source]: Do not use hot water. Do not use detergent or harsh soap. If you use any cleaning agent, thorougly dillute it. Most dirt will get off with water alone. But the best solution is to take the dirty bankonte to a bank. they'll swap it for a new one.
If you are using a washing machine, use cold water, very little cleaning agents, and put the money in a delicate laundry bag. [source]
This money collector and auction site has a procedure to clean money without damaging it.

How to Clean Paper Money

Place your old paper money on the clean plastic surface
Pour the water in the container
Add a small amount of dish washing soap
Dip the sponge in the soapy water
Very softly wipe the note laterally, from the middle to the edges
Be sure not to scrub or aggressively wipe the note to avoid tear and damages
Make sure you lightly wipe both ends of the notes
Turn the note over and repeat the same cleaning process
To dry, air drying is the best option. It's not recommended to fan dry as the note can blow away. If the note is creased after drying you
can try and flatten it by using a heavy book on top.

Is it legal to physically wash money?


When using redux, why should I avoid doing API calls directly in the component?

Question: So I may be asking the wrong question, so please leave comments and I'll adjust. I was told by another developer that when using redux, I should do ALL API calls within actions and create reducers for them. But I feel that sometimes making the call directly in the component will save me a TON of code. Are there best practices for this sort of thing?
Comment: I'd like to add that it's also much easier to extend the functionality if things are outside of components. for example if you'd like to show a spinner in the entire app while your component is loading, that would be very ugly to do from inside a component. lots of refactoring would be done just to enable what would otherwise be a simple change
Comment: You are supposed to use Redux as centralised state management. You could have a list of tasks and a detailed view as components with independent states, and could enter a state where "task x completed" in the detailed view and "task x in progress" in the list. Some trivial actions, like fetching data for autocomplete can happen outside the state store.
Answer: If the data you are getting from the API is only going to be consumed by a single component then you are fine to write it as part of your component (or better still, a container component). I believe the rationale behind doing your API calls in actions is to ensure that the single source of truth is maintained (the main reason to use 'the react/redux way' for me personally). If you are bringing in data from your API that is to be consumed by multiple components then use redux to ensure the same state is maintained by redux and passed to all components that use it.
Answer: This was previously answered by Redux's creator, Dan Abramov, here: Why do we need middleware for async flow in Redux? .
The summary:

It's just inconvenient in a large application because you'll have different components performing the same actions, you might want to debounce some actions, or keep some local state like auto-incrementing IDs close to action creators, etc. So it is just easier from the maintenance point of view to extract action creators into separate functions.


Sources of good, free icons/images for applications & web apps with permissive license?

Question: I'm interested in finding good icons/images that can be used in both 'free' and proprietary programs.
Please include a description of any license restrictions associated with the source of the icons you suggest.
Answer: I use two search engines:
IconFinder and IconLook.
If you can't find what you want, this blog post has a list of great resources.
Answer: I've used Silk Icons (http://www.famfamfam.com/lab/icons/silk/) on a few projects. It's covered under the creative commons license so you will have to include a link back to the site somewhere in your app.
Answer: http://www.iconarchive.com has a nice selection
Answer: I used Fontawesome to find icons.
Answer: I've had the best luck with Icon Buffet and StockIcons
Answer: A good starting point, and a nice stock icon site.  Some require payment, but there are lots of free sources out there.  However, one of your highest priorities for a commercial application is that it looks good enough to buy - $30 for a good set is cheap compared to the time it takes you to research and find a set, nevermind the time it'd take for you to make them yourself.
-Adam


Spinning Ball in Frictionless Tube

Question: If we have a ball in a frictionless tube, and we begin to spin the tube about one end, the ball will exit the tube, correct? Indeed, there must be some centripetal acceleration, but then what force is causing the centripetal acceleration? The tube's normal force only acts in a perpendicular direction, so what force could possibly be causing the ball to rotate?
Comment: The ball will not rotate - it will slide out of the tube.
Answer: The ball will fall out of the tube, but I think this is precisely because there is no friction to supply the centripetal acceleration. There is still a normal force however this is not towards the point of rotation. Friction would supply a force along the direction of the tube. Since you cannot supply an adequate centripetal acceleration, the ball should fall out.
Remember, you must provide a centripetal acceleration to keep it in circular motion. If you don't have that, then no circular motion! This is simply Newton's first law: the ball would "prefer" to move in a non-circular path and must be coerced not to.
Comment: I totally agree with the fact that the ball mustn't rotate.But see a case where you would have an infinitely long tube. The force analysis does show the necessity of 2 forces, one being the Coriolis force, responsible for giving the necessary boost to the ball along the tangential direction of course, and the other being ,what looks like having the same magnitude and direction as a centripetal acceleration would have! Any thoughts on what might be providing the later, given that only direction in which the tube can interact with ball being the tangential direction?thanks.

Spinning Ball in Frictionless Tube


word replacement with accent "Événement" by "Missions et PAD" not working but word replacement is OK

Question: I try to replace the Menu Title "Événement" by "Missions et PAD". But it is not working.
I tried different word replacements and they are working well. Is it due to the accents ? to a bad coding ?
I am using CiviCRM for wordpress.
Answer: For word replacements you often have to use the english word as the original word, so you would put:
Events => Missions et PAD
For menu entries you can also edit it at Administer - Customize Data and Screens - Navigation menu. Right-click on Events and edit it to change the title.
Comment: Great ! Thank you for your clear explanations. Have a great week-end.
Answer: The problem with this method is that a word in a help text for example is no longer displayed in French but only in English with a French word replaced.
Comment: I don't completely understand what you mean but agree in general that word replacements isn't meant for replacing large amounts of text. Originally it wasn't meant for translation at all, it was meant for english replacement of english words, like replacing Contributions with Payments. So it may not work well in all situations. An alternative for non-english is to use your own .mo file with your changes. You can create .mo files using gettext and the .po files from https://lab.civicrm.org/dev/translation/-/tree/master.
Comment: I'm not sure to understand how to custom translation. Is there a detailed explanation for that ?
I agree that it was meant for english replacement of english words. Perhaps we should adapt the help text in French to that effect.


Can I turn a regular content type into a Commerce product display?

Question: I have an existing working site with lots of content. I've come to the realisation that I could actually sell this content. So is there a way to turn my existing content type into a product display for Drupal 7 Commerce or would you recommend to export all these nodes and create a new product display type and add them back in?
Answer: All you need is a product reference on a node for that node to be a "Display Node." A simple solution would be to just add that and any other fields you think necessary to the "selling" part of the node's function. You might need an alternative View Mode for the content type if there are items you need displayed or not dependent on circumstances.
Comment: Thank you. My content type is a Course and I want my teachers to create Course nodes but not create their own prices i.e. not give them permissions to edit products, only allow them to select the products. If that's possible, I think I should add a reference field on each Course that points to a product (or product display?) so as to allow the teacher to only choose prices available from existing products, correct? If so, I think this should then be a reference field to a product instead of a product reference field to connect both and display them together. Would that work?
Comment: I'm a bit confused because "Display Nodes" are used in Commerce1, while in Commerce2 they were replaced with "Product Displays," a dedicated entity type. If you're using C1, as I initially thought, you can allow teachers to connect to a product using a limited selection. If C2, connecting to a limited set of "product displays" would make sense, and would allow some flexibility in display options, I think.
Comment: Are there more versions of Commerce for Drupal 7 then?
In any case I'll try out today what you suggest and come back once I got a result.
Comment: This works and was actually very easy to do. I now also understand how Drupal Commerce works better. Thank you, beltouche !


WebAPI Validation Errors even though data is valid

Question: I have created a web api and it was working successfully before.  However, something has changed (not sure what) and it is now no longer working.
I used fiddler to compose a PUT to /api/Dealer/19 with the following JSON Data:

{"notes":[],"dealerId":19,"name":"4th Street Auto Co.","phone":"888-776-5085","website":"http://www.cars.com/dealers/98681/4th-street-auto-co/","streetAddress":"5109 Preston Highway","city":"Louisville","state":"KY","zipCode":40213}

I get a 400 error response:

HTTP/1.1 400 Bad Request
  Server: ASP.NET Development Server/18.104.22.168
  Date: Tue, 31 Dec 2013 00:07:12 GMT
  X-AspNet-Version: 4.0.30319
  Cache-Control: no-cache
  Pragma: no-cache
  Expires: -1
  Content-Type: application/json; charset=utf-8
  Content-Length: 123
  Connection: Close
{"Dealer.Name":"Please Enter Name","Dealer.Phone":"Please Enter Phone Number","Dealer.Website":"Please Enter Website"}

I have a ValidationActionFilter which is building the error message:
public class ValidationActionFilter : ActionFilterAttribute
{
    public override void OnActionExecuting(HttpActionContext context)
    {
        var modelState = context.ModelState;
        if (!modelState.IsValid)
        {
            var errors = new JObject();
            foreach (var key in modelState.Keys)
            {
                var state = modelState[key];
                if (state.Errors.Any())
                {
                    errors[key] = state.Errors.First().ErrorMessage;
                }
            }

            context.Response = context.Request.
                CreateResponse<JObject>(HttpStatusCode.BadRequest, errors);
        }
    }
}

My Model looks like this:
public class Dealer
{
    public int DealerId { get; set; }

    [Required(ErrorMessage = "Please Enter Name")]
    [StringLength(100, ErrorMessage = "Name is too long")]
    public string Name { get; set; }

    [Required(ErrorMessage="Please Enter Phone Number")]
    [StringLength(14, ErrorMessage = "Phone is too long")]
    public string Phone { get; set; }

    [Required(ErrorMessage = "Please Enter Website")]
    [StringLength(250, ErrorMessage = "Website is too long")]
    public string Website { get; set; }

    [StringLength(100, ErrorMessage = "Street Address is too long")]
    public string StreetAddress { get; set; }

    [StringLength(50, ErrorMessage = "City is too long")]
    public string City { get; set; }

    [StringLength(50, ErrorMessage = "State is too long")]
    public string State { get; set; }

    public int ZipCode { get; set; }

    public virtual ICollection<Note> Notes { get; set; }
}

What is causing the validation errors even though the fields are there?
Thanks!
Comment: Can you show the controller action method? It may be missing the `[FromBody]` attribute.
Answer: I guess the MVC cannot bind the data to your model and therefore the model is null?
If this is the case, try to reformat the data you post to reflect the model
{"Dealer.Name":"..","Dealer.Phone":"..."...

Instead of {"name":...,"phone":...}
Comment: I switched it and it still didn't work.  Same error still.  The JSON that I am posting to fiddler is the exact same json as it is serialized from Newtonsoft JSonSerializer in the MVC Controller to the view.
Comment: I'd have suggested the same as the 400 response you show mentions that fields by these names are missing.


Invalid bundle structure - The app may contain only one executable file.

Question: This question is similar if not identical but there is no solution. I've looked inside the archive and there's only one executable, so I am at a loss as to how to proceed. Any ideas greatly appreciates.
Comment: I solved it. I'll post the answer when allowed. Believe it or not, a symlink to Xcode had been copied into the bundle.
Comment: I'm not sure, but I wonder whether the "!" in the name is confusing the code that checks the bundle structure.
Comment: Thanks Tom. I don't think so, this name hasn't changed. The only change I can think of is an incremental version of XCode. I'll try to change the product name and see if there is any impact.
Answer:
Invalid Build Structure
The binary file 'YourApp.app/libYourLibrary.a' is not permitted.
Your app may contain only one executable file.

This error occurs when a static library file is mistakenly copied into the app bundle.
You should link the libYourLibrary.a static library via a Link Binary with Libraries build phase.
It should NOT be added to the target's Copy Bundle Resources build phase.
Comment: This helped me figure out the problem, in my case I was adding the framework as a Linked Library AND as an Embeded binary, Removing the Embeded binary from the general tab did the trick!, thank you a lot!
Comment: In my case I added to XCode project 'upload-symbols' from Firebase Library :p
Comment: Oh man, thank you so much! I spend a few days tried figure out what's wrong.
Answer: My app was rejected with the same error message.  It turned out that I was copying a third party framework (Fiksu) in the 'Copy Bundle Resources' build phase.  The framework contained an executable and was already linked to in the 'Link Binary With Libraries' build phase.  I deleted the framework from the 'Copy Bundle Resources' build phase.  The framework continued to work normally in a release build. I resubmitted the app and it passed validation.  Similar solution was posted here:
https://devforums.apple.com/message/1020254#1020254
Comment: For XCode version 8+ this type of problem seems to cause the app submission process to actually completely crash XCode.
Answer: In hindsight the error is straightforward. An executable file was accidentally added to the project. In my case "Develop!.app/Xcode" meant that Xcode was the executable. Checking the list of files in the project I found a symlink to Xcode. (Maybe I dragged it from the dock somehow and dropped it into the project).
If you are getting this error look at the files in your project -- there is an executable there somewhere.
Answer: I had this issue for the first time on an app I'd submitted over several versions with no issues.
I found that somehow that although I'd linked to one of my own libraries, one of the source files from that same library appeared in the list of files in the "Copy Bundle Resources" list. I have no idea how it got there but removing it meant that my app build, archived and was submitted successfully. :-)
Answer: If you are getting error in following format:
"Invalid Bundle Structure - The binary file 'Abc.app/AnyFileName.o' is not permitted.
Build Phases > Copy Bundle Resources > check your file AnyFileName.swift will be added too here. (Remove it)
validate it with XCode. Error gone !!
Answer: In my case I tried to remove references but nothing worked for me. Then I uninstall particular pod, remove references as mentioned here and then install that particular pod again. It worked for me.
For those who required elaboration check below:
1)
In Podfile comment the particular pod by adding # in the beginning and save it:
On command line run: pod install // It will uninstall that framework
2) Removed references of that framework from:

Link Binary with Libraries // In Build Phase
Copy Bundle Resources  // In Build Phase
Embed Frameworks

3) Now install Pod again, Remove # which you added before and save it.
On command line run: pod install // It will install that framework again
Answer:
Just delete the exec file from your bundle and delete the "Executable file" key from your bundle resources.
After that archive and validate the the the build it will work.


Spring - inner methods called by @Transactional(readOnly = true) method to write

Question: If a method has annotation @Transactional(readOnly = true), is there a way to allow inner methods to write?
Example:
Class A {
   @Transactional(readOnly = true)
   public void readFoo(){
       b.writeFoo();
   }
}

Class B {
   public void writeFoo(){}
}

I know it sort of defeats the purpose of having the readOnly annotation but I just want to know if there's a way.
Answer: @Transactional(propagation = Propagation.REQUIRES_NEW) worked for me. A thing to be cautious about is that if the method takes in a hibernated object, this will not work. This only works if you retrieve the hibernated object and makes changes within the Propagation.REQUIRES_NEW method.
Answer: readOnly attribute of @Transaction annotation is just hint for the transaction manager. It depends on underlying technology you use to manage transactions. It can just optimize transactions read-only performance (Hibernate) or it can simply ignore readOnly attribute at all.
I think that if you annotate writeFoo() i.e. like this
@Transactional(readOnly = false, propagation = Propagation.NESTED)

It can act independently on parent read-only transaction and write without problems. But I haven't tested this myself.


What navigation publications are required when flying from KSNA to KAVX?

Question: If I'm flying to Catalina Island (KAVX) from John Wayne Airport (KSNA), which is 30 miles over water, what navigation publications are required to be on board for the route of flight?
Comment: The requirements for over land and over water are the same, you don't need any additional publications. Just do thorough planning and a full walkthrough before you go. Keep an eye on your temps and pressures like you ordinarily would, but above all enjoy yourself.
Comment: Just keep in mind that there is a right traffic pattern for Rwy 22 and that the sight picture is very different from what you are used to. Be sure to maintain the correct traffic pattern altitude, 2,602 MSL and watch for downdrafts on final. There was a hump in the middle of the runway that obscures the end of the runway so don't freak out when it looks like you are running out of runway. I haven't been there since they refinished the runway, so it may have been fixed. My passengers and I always wear life vests when flying there but they aren't required by any regulation.
Comment: [Closely related](https://aviation.stackexchange.com/q/8584/62). I'm not sure it's possible to answer this question clearly unless you also tell us the aircraft type (in case 91.503 applies) and if it's a part 91 or 135 operation (all part 135 flights are required to have charts on board).
Answer: You'll need the navigation publications appropriate to your flight.  If you're flying under VFR, then you'll need the appropriate sectional chart, and should have airport diagrams.  You'll need to be aware of the airspace and how to communicate and navigate in it.  You should have taxi diagrams.  For VFR flying, I've always made a practice of having the appropriate terminal charts, sectionals, WAC's, and airport publications.  I have also always carried IFR enroute charts, as these provide useful information about communications enroute, as well as airspeed and navigation information.
These days, a subscription to Foreflight usually covers it, and I've flown all over using little else.
If flying IFR, you'll need appropriate IFR publications.
You should have a copy of the airport information, airport facility directory, or equivalent, etc.  If you don't carry and reference the current data, and end up getting busted, you'll have little to fall back on as an excuse.
Comment: @Will - Part 91.103 states, "Each pilot in command shall, before beginning a flight, become familiar with all available information concerning that flight." It does not say that the pilot must have it onboard. You just have to have a way of proving you **know** the data. I do agree that at least an appropriate paper sectional should be on board every flight. Even if you have some type of EFB. That's just prudent. It is not required under Part 91 flight under VFR unless you are flying under Subpart F.
Comment: @Will - I do agree with you that the pilot in question should carry everything you have mentioned. It is just not required for a light GA piston aircraft.
Comment: @Will - Most posters on this site will take the terms "required" or "legal" to indicate that there is a regulation pertaining to the subject. Unless the poster is flying under FAA FAR Part 91.503, there are no regulations requiring the carrying of current charts in an aircraft while VFR. The pilot only needs to show that they have somehow fulfilled Part 91.103. That does not mean that it is not wise or recommended that they carry current charts. Secondly, the FAA has discontinued the WAC charts.
Comment: None of those are required.
Comment: Perhaps you can explain why you think appropriate publications are not required.  Do you fly under IFR?  VFR?
Comment: A pilot is required, as stated, to have data appropriate to the intended flight.


Using parameters with Embedder

Question: Embedder offers up some cool functionality, but I don't see where it explains how to set video parameters. It says you can, but not seeing how. Anyone successfully done this?
Answer: You have to use the previous example and format your own code to match.
Instead of
youtube_showinfo="0"

it goes in as
youtube_showinfo:0

Answer: The documentation has an example and a list of supported parameters.
You basically pass a configuration object into the Embedder function. For example in this case I am setting max_width and max_height:
{{ craft.embedder.embed (entry.videoField, {max_width:500, max_height:800}) }}

Are you looking for a specific parameter?
Comment: It took me a few minutes to realize that the notes were formatted wrong. Once I swapped out the '=' with ':' it all came together.

Using parameters with Embedder


One click EXE or autoit script to start an SSH tunnel

Question: I know I can write an autoit or batch file, and it would be pretty easy, but does anyone know of a good one click executable to start an SSH tunnel? Ideally, I'd like to have a compilable autoit script that I could also include my key in (I would be the only one with a copy of this EXE, it's just nice and tidy to have a single exe)
Answer: You can use PuTTY (free, open-source, portable, Windows) as a command line utility:

putty.exe -ssh email@example.com

You just need to add PuTTY to your Path:

PuTTY Command Line Options:

126.96.36.199 `-i': specify an SSH private key
<code>   The `-i' option allows you to specify the name of a private key file
   in `*.'`PPK' format which PuTTY will use to authenticate with the
   server. This option is only meaningful if you are using SSH.

   For general information on public-key authentication, see chapter 8.

   This option is equivalent to the `Private key file for
   authentication' box in the Auth panel of the PuTTY configuration box
   (see section 4.20.5).
</code>
Answer: I use bitvise ssh client with proxifier portable edition. (If you want I can give detailed instructions, but it should be pretty simple to figure out).
Comment: please "give detailed instructions" ...


Custom formatter cucumberjs

Question: I've been searching for a way to get cucumberjs report to output junit xml. I know that there's a bunch of npm modules that does this. However, they are NOT doing it how I want them to. They are splitting up each step as test case, but I would like for each test case to be a scenario instead. I did find this; but as I continue reading this post I am not sure if this feature was added to cucumberjs it self or not. Then somewhere someone wrote that cucumberjs did allow for custom formatters. I went to read the documentation on this here. I also looked at the example but the example was how to run a test on the custom formatter not how to add/use a custom formatter.
Answer: Couple month ago I stuck with same problem. To cut long story short I decide that I didn't found any appropriate solution, so I wrote own formatter. You just can install cucumber-junit-formatter from npm. As I understand from your question this formatter will covers you needs.

Custom formatter cucumberjs


How do I securely manage a VMWare ESXi 4.1 host over the internet?

Question: I would like to place my VMware ESXi 4.1 server in a data center but I'm concerned that assigning a public IP to the host to enable remote management over the net (with VMware vSphere client or SSH) might leave the server vulnerable to attacks. Is there a better/safer way for a person with a limited budget to remotely manage a VMware ESXi 4.1 server over the net. Please note I do not have access to a firewall appliance to configure VPN.
Comment: you have means to pay for a server in a data center, but yet you cannot get your hands on a firewall?
Answer: There isn't any way to do this effectively. ESXi does have a firewall built in, so you could in theory lock down the management interface to your remote IP addresses, but if your IP address ever changes... too bad.
You need to have some way to VPN into the network and put the ESXi interface on a private network.
Answer: Have you considered a free firewall such as PFSense?  You could consider running it as a VM on the same server if you didn't want to dedicate a box or possibly incur additional monthly costs in the datacenter.
Comment: would this allow me to secure the host or the guest machines?
Comment: @jmm312 - what you do is you install PFSense and then attach the public IP address to an interface inside PFSense. Then, on your virtual switch you attach the internal interface of pfsense, and enable the management interface on that internal switch. That way your management network is not exposed. This can also be used for protecting your entire virtual network and is what we've done a few times.
Answer: Erm...
And if the reason ou want to connect to the ESXi host is because of a fault - or you need to shutdown the VMs to apply a patch or configuratino change to ESXi itself, but your only way in was through one of said VMs, don't you have a but of a problem?
Comment: Hi Dave, are you asking a follow up question here ?
Answer: We have the same situation. We have a virtual machine running pfSense that we use for day-to-day access to VMware and to the virtual machines.
For emergency access, we're using a VPN service provided by our collocator which allows one user to login and gain only access to the management interface of VMware.
Our initial setup had a dedicated firewall device -- which is what I recommend you get if you can't get VPN access through your collocator. We don't do this anymore for the simple reason that it died.
Answer: I would say put the ESXi host on a private network and have some form of secure VPN access into the private network. Because then, you're not exposing the ESXi host directly to the public net. Someone would have to breach your VPN service first in order to even see the ESXi host. You decrease your likelihood of having your ESXi host exploited.
I'd say use good password practice is an obvious one.


How do carnivores (cats, dogs) catabolize protein for energy?

Question: If cats are obligate carnivores and require no carbohydrate in their diet, do they derive all the glucose their cells need through gluconeogenesis? Some sources I've found state that carnivores get their glucose from the animals they're eating, but that conflicts with the fact that they say cats and dogs require NO CARBOHYDRATE in their diet whatsoever. My guess is they just catabolize protein for energy and are better equipped to deal with the acidic waste products than humans are?
Answer: Obligate carnivore means they must eat meat (specifically to get taurine, which they can't synthesize), not that they can't also eat other things. In the wild, I've been told, some of a cat's nutrition may actually come from the stomach contents of prey. And mine have expressed interest in everything from broccoli to Graham crackers.
But it is certainly possible to burn protein and fats for energy. Humans do it too; where do you think the calories in a lean steak come from?
Nothing very special; basic biology.
(There are amino acids we can't synthesize too, but they're ones which are relatively easy to get from plants.)
Comment: Related [How to make my own BARF food (for a cat)](http://pets.stackexchange.com/questions/10773)


How to wire up a combined fan and light?

Question: I have red blue black white and copper(ground) coming out of my bathroom ceiling. I'm hooking up a fan light combo with 2 black 2 white and two green wires. I need to know which wires go to which?
Comment: You need to specify what part of the world you're in. Colors are used to mean different things in different places.
Comment: How are they grouped?  To which I mean, the wires arrive either in one or more sheaths (wrappers) or a conduit hole.  Which wires are in which sheaths/holes?    If they're all in one sheath, you have the almost mythical 14/4 or 12/4 cable.  Cool.
Comment: So is this an exhaust fan and light combo? How many switches are there on the wall 2 or 3? Did the original unit that you are replacing have three devices in it: (1) a regular light, (2) an exhaust fan and (3) a heat lamp w/ or w/o a fan blowing over it? Leaving aside the ground wire you have 4 wires coming out of the ceiling, one question is are two hot and two neutral  or are three hot and one neutral.
Comment: Can you post photos of the inside of the light/fan box and the switch box that controls it please?
Comment: Does your instruction manual provide a wiring diagram? Typically, you can find the wiring instructions by looking for the model online. If you post a diagram, we can help interpret it.
Answer: A bathroom overhead light position commonly has 3 separate loads in it:

Overhead light
Fan
Heat lamp or air blast heater

A perfect cable

source
The electrician who installed this did an excellent job future-proofing, going out of his way to use the rarely-seen 12/4 or 14/4 cable. This is perfect for a bathroom overhead light, because it provides all the wires you'll ever need, in one cable: black, red and blue are "hot" wires for all 3 of the above loads.  White is a shared neutral, and ground is ground of course.
You can choose colors as you please, or as the bathroom switches are already wired.  You can tighten the wire-nut not-so-tight to hold wires together for testing, or pop the cover off the bathroom switch and see how that's wired.
One of your wires will not be used; if it's not already capped, just put a wire-nut on top of it and tape the wire-nut onto the wire so it doesn't fall off (as they're prone to with only one wire).
All the neutrals get tied together.
Why does the fixture give two white wires?
They are both neutral.  One is the neutral for the lamp, and the other is the neutral for the fan.  This gives you the flexibility to feed the lamp and fan from separate circuits (in that case the neutrals would need to be separated.)
Answer: I'd use a voltage tester to find out if any of the black, blue & red in the ceiling is permanently hot or is turned off by a switch somewhere nearby.
Then I'd wire the appropriate wires depending on which switch I wanted to control the fan and which the light

Some (many? most?) fan and light combos have a pull-switch on the unit or a wireless remote control, I suspect that might not be the case here as you have two complete sets of wires. If it is the case and you want that switch/remote to solely control whatever it controls, you need to connect the relevant black to a permanent hot wire (which would also be black in a rational world but I'd check with a voltage tester).
Using the type of connector pictured below makes it easier to try out connections to see which black is fan and which light (or some other funky combo - see instructions for fan/light unit). Otherwise you might be having to make and remake connections with wire nuts - which I suspect is annoying.

I don't live in a part of the world that uses those wiring colours or which has much use for ceiling fans, so take my advice with a pinch of salt.


Can 您 to be used in plural form?

Question: Can 您 be used as a plural form?  For example, if a child tries to address to both parents at the same time: 请您放心.
Comment: It's controversial. If you are still learning it is best to not use 您们. I don't find the expression problematic, but there are a lot of people who do. Is it mothers-in-law or mother-in-laws?
Comment: https://zh.wikipedia.org/wiki/%E6%82%A8%E4%BB%AC
Answer: We do not use 您们 as a plural form in Chinese. If you want to show respect for more than one person with 您, you can add number + 位 to address these persons. For example:
您二位 for two persons
您三位 for three persons
您几位 for a few persons
Answer: Usually 您 is not pluralized with 們 like other personal pronouns. This is because etymologically 您 is a contraction of 你 and 們, and still connotes second person plural in some varieties of northern Mandarin, so some would say that adding another 們 is redundant. However, since Standard Mandarin is used in regions that don't natively use the pronoun 您, there is a tendency to treat it the same as other singular pronouns by analogy, so usage of 您們 is sometimes seen. Grammarians will still object to it as a non-standard form.
The proper way of explicitly addressing multiple persons in the second person is to attach number + 位. Thus in the child addressing both parents example, they would say 您二位. In somewhat less formal contexts, 您兩位 or 您倆 are also used.
Answer: NO!
But there are lot of native Chinese who use "您们".
Look at this video, the elegant princess said "您诸位".
Answer: In a prescriptive sense, 您们 is grammatically incorrect, according to multiple authoritative sources (which includes the Xiandai Hanyu Cidian 现代汉语词典).
Nevertheless, it is extremely commonly used in daily conversation (especially in northern China), and for sure everyone would understand you, and few would raise an eyebrow. (Southerners do not frequently use 您 in the first place, so 您们 is much less prevalent.)
So, if you are writing, or taking the HSK or the Putonghua Shuiping Ceshi, then 您们 is wrong without a doubt. However, if you just want to Chinese people, I see no problem using it.
Answer: As a native speaker, I would recommend just using 你们 instead of trying to use 您 and making it plural. As long as you put 请 in the front, that is as polite as a sentence can get in Chinese. No need to be too worry about using 您.
Answer: No. 您 is the abbreviation for 你们, just like 嫑 is an abbreviation of 不要, which is a very common situation in Chinese. So it's already a plural word, you can't re-pluralize it.
Actually, It's a universal phenomena to use plural form to show respect for others. For example, in English, "you" is the plural form of "thee". People use "you" to show respect to you. As time goes by, the singular form is simply not used anymore. Maybe 你 will also be forgotten in Chinese some day.
Answer: 你这句话在古文中为『请二老放心』,前面几位说的都对,不过『您几位』是不太正式的说法,正式的古文说法是『列位』,现代说法是『诸位』,但是『诸位』显然已经去了敬语,只能再用『请』在整个句子中。『您』并不是一个非常流行的语法,它主要流行在以北京为中心的一个小圈子里。南方更流行你,或者用具体的官职名或社会关系(如令尊)来表尊称。其根本原因是只有在北京,才会对陌生人使用敬语。『您』是典型的对陌生人的敬语,虽然也泛化到了对熟人的称谓上。
Answer: The expression "您们" is not used in Chinese, usually we say "你们", if the child does not specify to talk to his father or mother, then he can say "你们", if he is talking to his mother, then he will say "你". The word "您" is usually used as an honorific and is used in written language. With people we know well, we say "你" and that's it.

Can 您 to be used in plural form?


How can I view the list of the questions that were the most recently reopened on a given SE site?

Question: I wonder if there is a way to view the list of the questions that were the most recently reopened on a given SE site.
Answer: There's an overview in the moderator tools - you need 10k reputation to access those, not a diamond:

Other than that, your best bet is probably SEDE: this query lists the most recently reopened questions since the last refresh (every Sunday morning UTC).

There is no way to get real-time information via a Stack Exchange API call - post history isn't exposed this way.
Answer: You can use the "Recently Reopened" list in the 10k tools (https://meta.stackexchange.com/tools?tab=Close&daterange=last30days), otherwise you're stuck with guessing using the homepage (reopens bump the question) or SEDE (only updated on Sundays).


Help with writing letters!

Question: In a story I'm writing, the two main characters write letters to each other frequently. The characters are close, and have a romantic relationship that starts midway through the story. The story takes place in a fantasy setting, so the letters are written in a way that uses very little slang, and tries to keep a professional tone. One of the characters is prince, and the other is his personal assistant. In the princes letters, he adresses his assistant by his name. I was wondering how the assistant should adress the prince in his letters without it feeling awkward.
Comment: Why would the assistant not simply address the prince in the same way that he addresses him face to face? And why would that feel awkward? If the assistant addresses the prince with "Your Highness" in person, he will address him with "Your Highness" in his letters. If they are already lovers and the assistant addresses the prince as Dave (or whatever the prince's name is), he will address him as Dave in his letters. Just like you do when you write a letter! Or do you address people in letters differently than you do face to face? If I'm missing something, please edit your question and explain.
Answer: Answer these:

What does the assistant call the prince when they're in public?

How does he address him when they're alone?

How high is the risk that some third person may read the letter?

If someone did, what would the consequences be?

All of these may, of course, have different answers at different points of the story.
Consider the customs and rules of your setting. Is it on the prince's discretion to let a courtier call him by name outside of formal occasions, or would it be a transgression against God-given order? And conversely, are expressive displays of loyalty to one's liege common and even expected?
And keep in mind that how cautious or casual they are about the possibility of revealing their relationship applies not only to the address but to the whole letter.
Answer: My book is in a fantasy setting (semi-medieval) and I use letters in several places.
Do what serves the story best would be my advice. As with dialogue you don't always want to literally write it out. Sometimes you can just summarize.
Dialogue summary:
Alice spent the next hour bringing them up to speed with everything that'd happened.
Letter summary:
Brian held her letter in his shaking hands. It confirmed all his worst fears. She wanted a divorce.
At the beginning of my novel my MC is seeing a guardsman. He is not very literate and I express that in his letter by writing it out in the story explicitly.
I also looked on the web for historical details about letters, how they were signed off, sealed and so on.
Hope that helps.

Help with writing letters!


Illustrator: Locking an object from exporting?

Question: I would like to somehow lock an object so that when I "Save for Web", that particular item on artboard is not included in export but everything else is?
Comment: make it invisible with `Object > Hide Selection`?
Comment: Then I don't understand your question, please explain. What is there not good about hiding the unwanted objects, exporting, and un-hiding them?
Comment: No, I want to have it visible, only not export it
Answer: In most cases, it is not possible to have something visible on an artboard and have it be ignored when exporting or saving.
Guides are an exception.
If you just need a visible indicator in the file, you can turn practically any shape (including text) into guides. These are visible in AI, but nowhere else.
Template Layers also have some use.
If you set the objects you do not want to export/save on a single, combined layer, then set that layer as a Template, the template contents do not export/save when using Save for Web.

Objects do however take up space. So the objects on the template layer won't show, but the space where they are located is factored into saving/exporting. In other words, they are invisible visually, but their dimensions are still used when calculating width and height upon exporting/save for web.

The red line indicates the Save for Web size without clip to artboard on. So the space for the red rectangle is seen and used, but the rectangle itself is not visible.
Using template layers this way seems to work for Save for Web or saving to PDF. I can't comment on other save/export methods.


Doubt about the derivation of the Callan-Symanzik equation

Question: I was reading about the Callan Symanzik equation from Peskin and Schroeder. On page 411, they assume that since $G^{(n)}$, the connected Green's function is renormalized, the $\beta$ and $\gamma$ functions cannot depend on the cutoff $\Lambda$. Why is this so?
Comment: Good question and good to doubt +1, but you may need to provide more detail discussions. and include the formulas, etc
Answer: As explained in the book, the Green's function has already been renormalised and thus the dependence on the regulator (whatever it is) dropped. In fact, nothing in the l.h.s. of Eq. (12.41)depends on the regulator. Hope this helps.


Is it obstruction of justice to advise someone not to answer questions from the police?

Question: If two people X and Y are together and the police come and start interrogating X and Y says, "Don't answer any of their questions."., can the police then arrest Y for obstruction of justice?
Comment: https://www.youtube.com/watch?v=d-7o9xYp7eE
Answer: No
Advising someone to do something that the police will shortly be telling them they have the right to do can hardly be obstruction.


Why are table based sites bad for screen reader users?

Question: How much easier is it for screen readers to handle
 based websites as opposed to older
 based websites, and why are they worse?
Comment: I found this a useful link on the subject http://webaim.org/techniques/tables/#uses
Answer: Screen readers assume the content inside a table is tabular, and reads it as such. E.g. "row 1, column 1: (contents)". If you use tables to lay out your site, this won't necessarily make any sense. You are telling the end-client you have data with tabular significance, when you actually don't.
By contrast, div have no meaning other than "section", so screen readers make no attempt to signify them. You can use divs to make arbitrary visual breaks in your layout without impacting the meaning of the markup.
This is what we mean when we say "semantic" markup. Semantic means the markup accurately describes the meaning of the content inside of it - tables wrap tabular data, ULs wrap unordered lists, etc.
Comment: I imagine they largely didn't. You'd be surprised just how unfriendly the internet (and the world at large) is to people with a serious disability like blindness.
Comment: you mean table based site was painful for screen reader users.  how they were surviving till css and dive based site invented ?
Comment: @Jitendra painfully, as you said.
Answer: Table based sites may confuse the screen reader for the type of data that is being presented. Originally tables were used to show a 2D list of data. But with tables being used to fit designs, the readers would have to distinguish the intention of the table.
Answer: It depends on what a table is used for. If a table is used for layout the screen reader has no way of knowing this and reads cell by cell, starting in row one, column one, row one column two, row two column one row two column two, etc which often isn't the way the content is meant to be viewed. If data needs to be displayed in a structured form tables are the best way to go with screen readers since keystrokes can be used to read row by row and column by column. As a screen reader user I find it anoying when data doesn't appear to make any sence because it is either layed out poorly with a table, or a table isn't used at all and some other visual indication is used.
Comment: so all screen use very like div based structure for layout?
Answer: The viewpoint that DIVs work better with screen readers than tables is missing the real issue.
Current CSS and HTML standards simply don't provide any explicit tags/indicators to aid screen-readers.  Until they do, regardless of whether you use DIV or tables, you have to just hope that your "semantically correct CSS page", or "get the job done tables" work with most screen-readers.
Don't forget, it is equally easy to create an incomprehensible page using DIVs only, as it is using tables.


Remote Desktop Username Logon Failure - Remote Desktop only Passes local Account Domain - Win 7 Pro

Question: Remote Desktop Logon Failure - from windows 7 across multiple VPN and NAT, to a Win 08 R2 server.  Logon to the local account has been used and is good.  Multiple users can hit the same account with no issues in same format, as well as mutiple OS.  From my location I can successfully open RDP client using said credentials from Windows 7 Desktop.  Logon Failure is windows 7 laptop, it only passes local account domain, despite various attempts of using ./username, and ip/username, and hostname/username, the destination event viewer repeatedly shows the same result of my laptops name as the domain.
For example, my laptop name is mylaptop, and the remote account is testmgr.  All of the logon attempts from mylaptop, result in logon failure with failed logon as mylaptop\testmgr.
The successful logons show testsystem.cor.int\testmgr,
Note: The username typed into the windows credential of the successful system did not require entering the destination domain or host name before the user name.  You simply need only type the username of testmgr - voila you are in.
The destination systems are on corporate domains, while none of the systems using the RDP client belong to any domain.  I have hacked on this for weeks, and have sought out guidance from several knowledgeable people with no luck, "....just reload it..."  This should not be that difficult to figure out.
Answer: To login with a domain account from a system that does not belong to the same domain, try entering the username using the format remote_domainname\tesmgr.
Comment: Workgroup is the default domain.


How to apply a user defined function between rows in pandas using both rows values?

Question: I have two rows of data in a Pandas data frame and want to operate each column separately with a function that includes both values e.g.
import pandas as pd
df = pd.DataFrame({"x": [1, 2], "z": [2, 6], "i": [3, 12], "j": [4, 20], "y": [5, 30]})
    x   z   i   j   y
0   1   2   3   4   5
1   2   6   12  20  30

The function is something like the row 2 val minus row 1 val, divided by the latter - for each column separately e.g.
(row2-row1)/row2
so I can get the following
0.5  0.667   0.75   0.8   0.833

Based on the following links
how to apply a user defined function column wise on grouped data in pandas
https://www.geeksforgeeks.org/apply-a-function-to-each-row-or-column-in-dataframe-using-pandas-apply/
https://pythoninoffice.com/pandas-how-to-calculate-difference-between-rows
Groupby and apply a defined function - Pandas
I tried the following
df.apply(lambda x,y: (x + y)/y, axis=0)

This does not work as it expects y as an argument
df.diff()

This works but then it is not exactly the function I want.
Does anyone know how to achieve the result I expect?
Comment: can you make 1 more row in example and edit desired output?  2row is short to understand perfectly
Answer: df.diff(1).div(df)

output
    x   z    i    j   y
0   NaN NaN  NaN  NaN NaN
1   0.5 0.67 0.75 0.8 0.83

With a short example, I answered. If I'm misunderstanding something, edit your example more long. I'll answer again.
Answer: After testing many things I found out that it was not required to include two variables in the Lambda function (x,y), but just one and treat that as a vector with all values in the column, so the following solved the issue
df.apply(lambda x: (x[1] - x[0]) / x[1], axis=0)

This avoids having a result with NaN in the first row.


Lists.asmx truncates data

Question: I have a custom Site page that contains some javascript code (using jquery and SPServices), that calls Lists.asmx Web service to perform CRUD operations on the list. At the init, my js code needs all list items. Recently I notided, that the latest added list items are not returned. Using Fiddler, I investigated that they are not simply included in the result set.
As older items seem to be useless for my code, there's a simply solution just to clear them.
But the question still remains, if the Lists.asmx has any limit of the items to return, and if it has how to configure it.
Thx in advance.
Answer: You need to specify the number of results in the CAML query sent to the Lists web service.  SharePoint Magazine had a good article about using CAML queries against the web service: http://sharepointmagazine.net/articles/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list.  In addition, the MSDN documentation on the CAML query schema might be helpful for you: http://msdn.microsoft.com/en-us/library/ms467521.aspx.
Answer: I assume you're using Lists.GetListItems to get the list items.
In the call the rowLimit specifies how may items you maximum want returned. If it's not specified, then the rowLimit is taken from the view with the Id specified in viewName, if that isn't specified then from the default view.
The query parameter can be used to limit the selection based on a CAML query (see the answer from @JohnChapman) and can also specify the order, so you get the newest items first.

Lists.asmx truncates data


Inequality between the norm of derivative and the derivative of norm

Question: Let $x(t)=[x_1(t)~x_2(t)~\cdots ~x_n(t)]^T$, function $x_i:R\rightarrow R$ is differentiable, then it can be drawn that when $p=2$, $\|\frac{d}{dt}x(t)\|_p\geq \frac{d}{dt}\|x(t)\|_p$. I wonder if this inequality holds when $p\neq 2$, and if it does, show why.
Comment: Please give more context... Is it $L^p(\mathbb R)$ or $L^p(\mathbb \Omega)$ for a particular $\Omega$ ? also what is $x$ ? do you mean  $x(t)\in L^p(\Omega)$ for every $t$ ? and if yes what are the assumptions on $x$ ?
Comment: As it is stated, this inequality is always true: The left hand side is something wich is nonnegative and the right hand side is the derivative of a constant, hence zero. If you mean by the $\|\cdot\|_p$ norm, the $p$-norm for vectors in $\mathbb R^n$ and if $x:\mathbb R\to\mathbb R^n$ is a differentiable curve then your question gets a meaning. Is this what you mean?
Answer: Consider
$$\left|\frac{\|x(t+h)\|-\|x(t)\|}{h}\right|≤\left\|\frac{x(t+h)-x(t)}{h}\right\|$$
which follows from the lower triangle inequality.
From this consideration you get that whenever $\partial_t x(t)$ and $\partial_t \|x(t)\|$ exist in a normed vector space, then you must have
$$\partial_t \|x(t)\|≤\big|\partial_t\|x(t)\|\big|≤\|\partial_t x(t)\|$$
Comment: What is the condition for the equality to exist?
Does $x(t+h)$ and $x(t)$ have to be linearly dependent?


apple configurator 1.7 downgrade ios from 10 to 10

Question: I am using apple configurator 1.7.2. Accidentally someone upgrade IOS to version 11 as image for every no ipod touch. Is any way I can go back to version 10? I need it for run older application which not support version 11 yet. Thanks for any help
Answer: Solved. After calling apple support this option is not allow in apple configurator.


How do I continue once I beat level 7-7?

Question: I am playing Donkey Kong Country Returns and I'm on level 7/7. When I beat that world it won't open a road to the new stage instead it opens a road that backtracks to level 7/5. Why? How do I continue?
Comment: If I had to take a guess, you may have found one of multiple exits to a stage, or a stage you previously beat might have multiple exits.  I suggest backtracking through previous stages and looking for things you might've missed.
Answer: Levels 7-5, 7-6, and 7-7 have 3 secret switches that must be activated to continue to level 7-R.
As per the level 7-5 description from IGN:

SECRET SWITCH
   Ground pound where you see the downward pointing arrow made out of bananas. The wheel will turn and a hatch will open. Down the hatch with you and pound the big red button you find inside. What's it do? Well, when you hit the big red buttons in this and the two subsequent levels, level 7-R opens up. Needless to say, if you don't unlock this level, you're not going any further in this game than 7-7.

For level 7-6:

SECRET SWITCH
   Hit the blue circle by the purple balls of electricity then run back to the left and ground pound the broken bit of flooring. The Blast Barrel underneath will lead you to this level's big red button.

For level 7-7:

SECRET SWITCH
   Ground pound the metal slab between the two flame jets to reach this level's big red button.