What are the aberrations of an SCT? And how can they be eliminated?

Question: The Schmidt-Cassegrain telescope is amazing! It is compact, suitable for astrophotography ,and it requires little to no collimation. However, the SCT has some inherent optical issues. What are they? What are their causes? and how can they be eliminated?
Answer: The primary aberration present in a Schmidt–Cassegrain telescope is spherical, due to the primary mirror being spherical in shape; that causes light at the edges to have a different path length than light at the center, and thus a different focal point.

The image above, from Wikipedia's "Schmidt corrector plate" webpage, shows an exaggerated corrector; they are actually much flatter.
The secondary aberration is coma, though this is present to a much lesser extent. Coma is a spherical aberration from rays that come in off-axis. Coma shows up as little off-axis comet-shaped blobs that point inwards towards the center of the field and get bigger as you look towards the edge of the field of view.
Persons wanting a lengthy technical and mathematical explanation will enjoy reading sections: "10.2.2. Full-aperture Schmidt corrector: Schmidt camera" and "10.2.2.4. Schmidt-Cassegrain telescope (SCT)" of the https://www.telescope-optics.net/ website.
Recent improvements in the design are offered using aplanatic flat field Schmidt-Cassegrain optics. Here's a screenshot from Celestron's video showing the difference between a standard versus aplanatic Schmidt telescope design:

The competing system from Meade is called Advanced Coma-Free (ACF™) optical design. Claiming also to offer coma-free pinpoint star images and flatter image fields while reducing astigmatism and eliminating diffraction spikes.
The website forum "Starry Nights - Cats & Casses" compares Celestron and Meade.
Answer: Astigmatism. No way to eliminate in SCT. Reduce it with proper fixing of every optical element. Astigmatism is only eliminated with 3-mirror scheme.
Curvature of field. No way to eliminate in SCT.
You are forced to use so-called "field flatteners".
If kept in good range, does not hurt, if you are not going to do astrophotography (which with SCT nobody does).
Chromatism. No way to eliminate residual chromatism from corrector.
Corrector blur. No way to eliminate low-quality corrector aberrations.
Overall, SCT is good consumer design (together with MCT), providing nice compromise for all aberrations for astronomical observations (not astrophotography).


How can I print a PDF X-1A from a iWork Pages document?

Question: In order to use my university's printing shop, they said they need a PDF x-1a format.
I noticed in Pages that I can print as "Save as PDF-X" but a little googling says this is not exactly the PDF x1a format, but another one. Googling did not turn up exactly how to get the x-1a format.
Comment: It seems that with Mavericks 10.9 (and as early as Lion 10.7?) that the "Save as PDF-X" is no longer an option. I have started a question for that: https://apple.stackexchange.com/questions/159552/
Answer: If they can take PDF-X1/a, then they can take any of the others as well; you shouldn't have any problems.
PDF-X1/a was simply the first in a long line of iterations of a new PDF schema that basically does a lot of preflighting for you (it's one of the best things to happen in the printing industry in a long time). It means your document is "press ready", which mainly applies to SWOP presses but can apply to small printers as well.
As a footnote to all of that...   You can also output press-ready PDFs using the Mac OS X-supplied "Save as PDF" button in the print dialog box from just about any application.


What is 'unsigned char near'?

Question: I read a datasheet and I found variable defined as unsigned char near Sample_X. What is this, and how does this differ from unsigned char Sample_X?
Comment: Based on part experience with x86 in DOS, I would expect this with some pointer type and in a 16bit environment. Yet what the OP quoted does not look like a pointer and the datasheet link would imply some MCU. Search for the keyword "near" in the following two links: http://www.microchip.com/forums/m549709.aspx  https://barrgroup.com/Embedded-Systems/How-To/Efficient-C-Code
Comment: perhaps allows the compiler to use small relative offsets?
Comment: It should be noted that this is a compiler extensions, not standard C
Comment: FYI, the keyword, `near`, is an example of a _storage class specifier_.  It tells the compiler something about how or where the storage for the variable should be allocated.  (See filo's answer, below, for more about `near`).
Comment: Is this really on-topic here?
Comment: It may be about CCM. Considering that code is mainly targeted for a MCU, it may be an indirect suggestion to linker by the support of compiler for placing it on CCM (core coupled memory) if available.
Answer: The MCU specified here is a Freescale MC9C08 series, which uses a slightly enhanced version of their HC08 architecture.  This is an 8-bit core, which (like many such) has shorter instructions and faster access to "zero page" addresses than others.  Zero-page addresses are only 8 bits long instead of 16 bits, so instructions referencing them can be 2 bytes instead of 3, and take 1 cycle less to execute as a result.
The "near" keyword instructs the compiler to put the variable in "zero page" if possible, for better performance.  Compilers specifically written for embedded development, such as this one, usually implement such extensions to the language (here described as "C Support for Zero Page").
Comment: I edited the answer to provide more detail and references.  In fact it's from Freescale's newer HCS08 architecture, but this is code-compatible with the older HC08 and HC05 architectures.  The (now positively ancient) 6800 and 6502 architectures are also closely related.
Comment: I like this answer, but do you have a source for your information?
Comment: Nice, much better!
Comment: So, its usage is very similar to the `register` keyword (for cases where you are really sure that this is where you need optimization), but slightly less extreme?
Comment: More or less.  The difference is mainly due to the fact that 8-bit CPUs typically don't have a register bank per se, only a single accumulator and a couple of index registers.  But it's also analogous to the use of "near" vs. "far" pointers on x86, in that there is a difference in the size of the address and how long it takes to complete an access.
Answer: Depending on the CPU architecture there may be different instructions to access data at different address. Here is an example from Keil for one of their compilers.
The near access has a certain memory limit, so you may give hints to the compiler to place some frequently used variables in an area that is accessible by shorter instructions (obviously describing access to an 32-bit address space is larger than 16-bit address space). This can translate to smaller/faster code.
Comment: There's more information in [What is the difference between far pointers and near pointers?](https://stackoverflow.com/q/1749904/1115360)
Comment: @AndrewMorton: That question relates to `far` and `near` pointers on the largely-obsolete 8086 architecture.  The same keywords are used in related but different fashion on 8-bit microcontrollers.
Comment: @supercat The question just asks generally, although the answers focus on the old architecture. Someone knowledgeable should write an answer on it explaining how they are used for 8bit microcontrollers.
Comment: @curiousdannii: The code in question was written for an 8-bit micro.

What is 'unsigned char near'?


How can I set Spotlight metadata to files?

Question: I am looking for a command line utility (I need to use it in a script) that can set Spotlight metadata to files.
Answer: You can always use the command line tool xattr, which lists/reads/writes/erases the filesystem's extended attributes of a file.
That's what spotlight uses to build it's index.
Note that spotlight information keys are prefixed with com.apple.metadata:
As quick example, to change the display name on spotlight of a file:
xattr -w com.apple.metadata:kMDItemDisplayName MyNewFilename.txt ActualFile.txt

to access xattr help, type on t:
xattr -h

Comment: Still works on El Capitan. Some stock applications like Safari, don't accept writes, though.
Answer: I don't think there's a way to -- the Spotlight indexes are generated by metadata importers that scan files and figure out their properties.  If the relevant importer doesn't detect some property, then as far as Spotlight is concerned it doesn't exist.
Now, it might be possible to change the actual file in such a way as to add properties to its index entry.  This page claims you can add extended attributes starting with "com.apple.metadata:" and they'll be added to the spotlight entry for the file, but I couldn't get it to work.  The SpotMeta project extends the import system to add extended attributes to the spotlight database, but only works on OS X v10.4.  Not an actual solution, but that's as close as I could find...
Comment: I don't think so -- if I understand right, it only uses one importer per file type, so your importer would have to replace the regular importer(s), meaning spotlight wouldn't see anything except your info (that's why SpotMeta wasn't an importer, but a mod of spotlight itself).  BTW, apparently you can add a finder spotlight comment with `xattr -w com.apple.metadata:kMDItemFinderComment "commenthere" filename` and it'll get indexed as the kMDItemFinderComment attribute.
Comment: Do you suppose that a database (to temporarily store metadata) combined with a spotlight importer (to pull the metadata from the previous DB) would work? I need to add metadata to simple files (jpeg, txt, rtf etc) just like Safari adds the "Downloaded from URL" metadata to every file I download from the interwebs.
Comment: @GordonDavisson thanks for your clarifying comment "Only one importer per file type". That makes clear that if I wanted an additional parameter like "Compression Ratio" for lossy compressed images (JPEG, WEBP, etc) it is not possible to create an additional MDimporter handling those public image file types which runs in addition to `/System/Library/Spotlight/Image.mdimporter`. If we want that the only possibility is to request from Apple to add a new attribute to the central `Image.mdimporter`.
Comment: @porg Keep in mind that I'm not an expert on this, and it's possible something has changed in the last decade of updates. I'd take a look at the current docs and see if there's any new option to do this.
Comment: [Spotlight on search: How to diagnose and fix problems](https://eclecticlight.co/2021/02/19/spotlight-on-search-how-to-diagnose-and-fix-problems/) is a good article as a whole, but neither the article nor the included diagram answers the particular question of how "more than one importer per UTI" is handled.
Comment: Hence I asked two more macOS filesystem/metadata experts: EclecticLight.co and Houdah.com — Will see what they tell me on that matter.
Answer: Here is a Python function I use to write Finder Comments to a file using the system shell. They show up in Spotlight, but not in the Get Info box...
def writexattrs(F,TagList):
    import subprocess
    """ writexattrs(F,TagList):
    Writes the list of tags to xattr field of file named F
    """
    plistFront = '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array>'
    plistEnd = '</array></plist>'
    plistTagString = ''
    for Tag in TagList:
        plistTagString = plistTagString + '<string>{}</string>'.format(Tag)
    TagText = plistFront + plistTagString + plistEnd

    WhichAttribute = "com.apple.metadata:kMDItemFinderComment"
    # Other attributes you might want to try: ["kOMUserTags","kMDItemOMUserTags","_kMDItemUserTags","kMDItemkeywords"]
    XattrCommand = 'xattr -w {0} \'{1}\' "{2}"'.format(WhichAttribute,TagText.encode("utf8"),F)
    # optional, print command format to check:
    # print XattrCommand
    ProcString = subprocess.check_output(XattrCommand, stderr=subprocess.STDOUT,shell=True)
    return ProcString

Answer: If you have installed Apple Developer Tools (usually appears under /Developer/Tools), then you have access to the SetFile and GetFileInfo commands which both assist in manipulating metadata of files.
Additionally, I found a set of command line utilities called osxutils that may prove useful with additional requirements that come up while writing your scripts.
Comment: SetFile and GetFileInfo do not interact with the Spotlight metadata but with the filesystem metadata. That's why mdls does not return the same as GetFileInfo ( http://pastie.org/private/w2pzgheje9afyguadhj5fq ). osxutils does not seem to provide the functionality I require and has been abandoned since 2005 (about the same time Spotlight came out).
Comment: I see. I didn't find any resources that indicated too significant a difference. I will continue my search and update my answer with more on point content. My apologies for the incorrect information.


Why is creating a golem not considered evil?

Question: Creating a golem requires binding an earth elemental to it.  It is akin to enslaving an intelligent being (the stupidest of them, small earth elementals,  have an intelligence of 4 , minimum for sentience is 3). But creating one is not considered an evil act.  Why?
Comment: And this is why questions about the alignment of acts are off topic.  Comment discussion deleted, this should stay closed.
Comment: This appears to be inviting us into a morality examination, but [we don't handle alignment questions like this](https://rpg.meta.stackexchange.com/q/5357/1204). Alignment is subjective and wishy-washy and an excellent way to start an argument in which nobody is correct -- except where it's hard-coded by the mechanics, which is the circumstance where we accept questions about in-game alignment.
Answer: Because not all elementals are considered intelligent creatures
The rituals don't describe what kind of elemental spirit is bound when creating a golem, so we could assume that any elemental is valid, even the smallest of them are valid. Checking the main four elemental types, Air, Earth, Water and Fire, they all got only 4 intelligence.
4 Intelligence is just barely above animal level, but still not on par with dumb creatures like a spiritual mount or familiar (6), they are more like magical beasts, which have 2+ intelligence.

Magical Beasts are similar to animals but can have Intelligence scores higher than 2 (in which case the creature knows at least one language, but can't necessarily speak).

A Mudman, on the other hand, has no intelligence score, being merely something like chaotic constructs of pure elemental power that has the bare minimum instincts to be able to defend it's own existance, as described under their flavor:

Mud pools are formed where the Elemental Plane of Earth and the Elemental Plane of Water commingle in the multiverse, and thus mudmen are born. Occasionally, a vortex opens to a region on the Material Plane where magical waters have stagnated against the land, thereby forming a mud pool. Mudmen pass through this vortex to the Material Plane. Though not evil, mudmen look with disdain on any who trespass in their mud pools.

Which makes you wonder why they don't have at least 1 intelligence. I guess they just aren't bright enough even to realize they are alive. But it makes you wonder if there aren't other elementals like a mudman that has no intelligence.
However, considering the most common elemental used are earth elementals, we have to take a look at what 4 intelligence means. Looking at the definitions of Ability Scores:

Can speak but is apt to react instinctively and impulsively, sometimes resorts to charades to express thoughts

Yep, sounds intelligence enough. But what are the examples of such creatures?

Otyugh, griffon, displacer beast

No, all those are beasts with slighly higher intelligence than animals, mostly used as mounts or guardians. So it makes sense that a small elemental can be used as a guardian golem without being considered an evil act, if taming a gryffon isnt an evil act either.
Flavor vs mechanics
Do not be so rigid when reading that text simply because it is mentioned on the flavor of golems that they are created using an elemental, but doesn't mention what type, CR, what spell you can use and how knowing that spell affects the cost of the creation ritual (it would be cheaper if you know how to summon them), so that part of the text has no mechanical weight.
What you are thinking about are those elementals that the game calls as True Elementals, which are spirits inhabiting elemental matter, which can be summoned and bound by spellcasters. While the game says that the statistics of such elementals are always the same for their size (see earth elementals), it doesn't really list all possible sizes, missing Tiny, Diminutive and Fine creatures.
Knowing that, elementals are described as coming in a variety of forms:

These creatures appear to be little more than living clumps of elemental material but take many shapes and sizes, and in many cases, when the term 'elemental' is used, it refers to one of these creatures.

But even more specifically, earth elementals mimic the Material Plane life forms:

Like other elementals they come in a variety of forms often imitating Material Plane life forms.

So why are elementals limited to small size if we have cats, birds, and even insects in the Material Plane. The bestiaries are not an exhaustive list of all creatures that exist, as such, there may be tiny, diminutive and even fine earth elementals that we never heard about.
Comment: Comments are not for debate; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/78739/discussion-on-answer-by-shadowkras-why-is-creating-a-golem-not-considered-evil).
Answer: In short? Racism
D&D (on which pathfinder is based) was extremely racist. Or maybe the term is speciesist? I don't know. What I do know, is that if you kill an Elf, you're an evil murderer! But if you kill an Orc, you're a hero! And killing an elemental? eh, who cares?
It's a fact of life in the D&D world that the moral standing of a being depends on its race. You can freely rob, kill, enslave, and do pretty much whatever you want to without being evil, as long as you don't do it to one of the "good" races. This even applies if you are a member of that race; a Drow killing other Drow is just something that happens, no more significant than eating a sandwich, while a Drow killing an Elf is a severely evil act.
Depending on what you believe, the morality of an action is either determined by society, the gods/god, or is some fact of the universe. Whichever it is though, applies to pathfinder. Society doesn't care, the gods don't object, and the rulebooks (the facts of the universe) say it's fine. Q.E.D.
Keep in mind, that the fictional world you are playing in is not the real world, and the rules of the world are different - whether those are rules of physics, or of law, or of morality. Just because something is evil in OUR world, doesn't mean it is also evil over there.
Just consider, there are people in our world who believe that eating ham is a sin. Is it a sin in your game world? Ask your DM. Maybe ham is fine, but anyone eating chicken is immediately pulled into hell.
Trying to evaluate your actions in-game according to real world morality simply doesn't work. The entire game is built around killing things and taking their stuff, and if you're going to insist on trying to act according to our modern sensibilities, all it's going to get you is shanked by the next goblin you meet.
So, in conclusion? Enslaving elementals is not an evil act, because it is a different world, with different moral rules, and in that universe the moral rules say it is not evil.
Comment: This is a controversial answer, but... I don't think it's wrong, technically.
Comment: It IS wrong, in several ways, and shows a lack of understanding of the settings. The CORE of the answer, saying that real world does not equate to fantasy world, is probably correct, but not all of the associated reasoning.
Comment: Could the downvoters please comment why? I suspect most of them are just kneejerk responses from people unable comprehend the idea of a different morality, but if not I'd like to hear it.
Comment: @YogoZuno Could you expand on this please? I'm not hugely involved with the lore, so it's quite possible I might just be getting the wrong idea from the adventures/books I have read. What have I not understood about the setting?
Comment: @Benubird In-game, there are canonical spell effects for determining good and evil natures. So, a particular version of morality is established as an in-universe fact. In addition, while the alignments are open to interpretation, many of the situations you outlined ARE actually ruled evil actions (killing a helpless opponent, for instance, or slavery), regardless of the target.


I'm writing blindly and I need help dealing with it

Question: Writing isn't like drawing, and I can't take a step back and look at it and search for flaws in the story, because it's in my head already, and I know it, and I can't forget it. So when I write I write blindly, not knowing the quality of the end result. I wonder if there are ways to help me there, so even if I didn't know with my heart, I knew with my mind that at least it's not wrong in this and that.
One of the ways I came up with is to plan my story arcs instead of just writing it. Another way to have a friend who'd read my story and be my guiding dog, but I don't have friends or editors or money for editors.
So, do you know any other ways to help my problem?
Comment: "I can't take a step back and look at it and search for flaws in the story" Actually, that's something you should be trying to do. You might need to put it aside for a few weeks or months before you come back and look at it, though.
Answer: There are two sides of writing. First, is the glorious act of creation, thinking up plots, fleshing out characters, and building worlds. Then there is the mundane, blue-color work of making all of those dreams make some kind of sense (also known as revisions).
I think that you are asking about the second and less glamorous part of the job. I will tell you about how I go about this work, but every writer has their own take on this. I typically make multiple passes over the work, focusing on a different aspect of the writing each time. The following paragraphs cover some but not all of the possible things to look at.
Obviously, you need to look at spelling and grammar. I also look at the variation of sentence and paragraph structures. Is there enough variation? Are there sentences that are too long? Are there paragraphs that are too long? Is the choice of vocabulary appropriate? These are micro tests that deliberately ignore the larger picture.
Next, I look at the physical and temporal sequencing of the events in the story. Does the story require a character to be in two places at the same time? Is it clear to the reader what the actual sequence of events is, given flashbacks, foreshadowing, and other writerly tricks? In other words, could the events of the story happen in a real world? There might be reasons why that requirement should be waived, but the writer should make that decision consciously.
Next, I look at point of view. The rule is that each scene should have a single point of view. There should be no jumping from from one point of view in one sentence to another point of view in the next sentence. As always with these rules, there are exceptions and some of these exceptions are regarded as great literature. But you appear to be starting out and my advice is to crawl before trying to leap the abyss.
A related topic is the narrative structure of the story. Who is telling the story? To whom are they telling it? How close in time are they telling it? How close in terms of emotional content is the narrator (that is, showing rather than telling)? Take the same plot but think about it as if it were told to a lover, to a judge, to a stranger in a bar, or to a dead grandfather. Each of these choices creates a different story, some better, some not so much.
Another related topic is the decorations in the story. What does the point of view character notice? What do they not notice? Colors, smells, textures, sounds, music, industrial design, fashion, and a hundred other things can be used to decorate, and thus enrich, the story.
By looking at all of these different aspects, as well as hundreds of others, you can come back to the overall story with fresh eyes. You may find that the story has changed considerably from the story you started with. You might even find that you, as the writer, have changed as well.
Comment: Do you really look at spelling and grammar, sentence length etc. before the big picture? Doesn't it feel like a waste to perfect all that stuff on something you end up cutting out? (Or are you just using it as practice?)
Comment: I do that to get as far from the story as possible. Think of it as a calming exercise. It may turn out to be a waste of time but I tend to knead stories many times before they escape.
Comment: Fair enough. I tend to just get away from it by putting it aside for a bit.
Answer: I had this problem for years. In fact, I think all writers do. You can't experience your writing the way other people do, because you bring so much personal context to each word and scene.
I think you're actually asking two separate questions here. In terms of structure, there's a lot of good books that can help you learn how to bring order to your writing. The ones I'm currently recommending are The Writer's Journey, Story Genius and Techniques of the Selling Writer.
As far as getting feedback, after years of avoiding it, I joined an online writing group and it's been one of the best experiences of my writing life. The one I'm with is called Scribophile, and I recommend it highly (NOTE: This is not spam, I have no financial interest in the the group). They have a "karma" system that encourages high quality feedback. But I'm sure there are plenty of other good options as well.
I DON'T recommend soliciting feedback from friends and/or family. That's just a recipe for tears and frustration.
Comment: +1 for that last sentence. i take great pains to keep my writing accounts out of family hands, lol.


Is OECD an acronym, an abbreviation, or something else?

Question: Is OECD,Organisation for Economic Co-operation and Development, an acronym or we just call them as simply an abbreviation because every letter is pronounced one by one in the same way just like in the alphabet.
Comment: Is this really "entirely acceptable with a dictionary"? I think not, so let's just disagree with the close votes. :)
Answer: Strictly speaking, it's only an acronym if you can pronounce it as a word.
Scuba & laser are 2 that spring to mind.
Otherwise it's just an abbreviation.
Comment: I've just learnt that there is a term called 'initialism ' which means "a word made from the first letters of each word in a phrase. Unlike acronyms, initialisms cannot be spoken as words: they are spoken letter by letter. ".So OECD is an abbreviation and initialism but not acronym, right?
Comment: I'd agree with that, though I've just learned about initialisms as well!
Comment: I'd  say that _scuba_ and _laser_ were etymologically formed from acronyms, but have become so widespread and common that they're not treated as acronyms anymore. I think UNESCO might be a better example of an acronym that's still regarded as an acronym.


What is the game design lingo for the computer's ability to render shiny water?

Question: What is the game design lingo for the computer's ability to render shiny water? I am new to game design and I'm trying to write a formal paper to a colleague.
Comment: Realistic water rendering? I don't think there's a separate term for this
Comment: Its a very general term and has to do with how on the last gen consoles (360,3) could finally render running water and shiny slime.
Comment: I don't recall ever seeing a term for this specific ability, because this was just one of a whole package of abilities that went mainstream roundabout 2002 or so.
Answer: It sounds like you're looking for "per-pixel lighting"
Previous/lower-spec shading modes often used "vertex lighting" where the shading function was evaluated only at the vertices of each triangle and interpolated in between. This made it impossible to get crisp specular highlights (the sharp bright spots you see on shiny objects that move with your view angle) or other forms of specular reflection (like reflection maps)
This is often paired up with techniques like Phong/Blinn-Phong shading (particular shading formulas that were popular for calculating specular highlights, before physically-based/inspired models became more prevalent) and normal mapping (a technique using textures to add fine surface detail smaller than the rendered triangles, which gives specular highlights and reflections more edges to catch and glint off of)
This is also related to consoles supporting a programmable fragment stage in their programmable pipeline, allowing developers to write custom pixel shaders / fragment shaders to implement these lighting and reflection models. Early rendering hardware (ones with a "fixed function pipeline") lacked a programmable fragment stage, limiting games to combinations of pre-configured shading options.
Answer: Depends on the tech you use.
For a mostly flat water surface you can use bump mapping (adjusting the normal vector based on location on the mesh and some algo to create waves) to add reflective highlights to give appearance of waves. This means sampling a non-color texture in the fragment shader.
For bigger movement you'll need to actually change the surface geometry. This can be done with tesselation shading or it's predecessor geometry shading. Or you can just send a lot of triangles to the gpu. Doing the per-vertex displacement+normal manipulation requires sampling a texture in the vertex stages.
Answer: That would depend on how good you want it to look. If you just want to look wet and shiny and reflect only the light, look for Phong model lighting. If you want to the water to reflect everything else, look for reflection mapping.
Phong model lighting performs lighting calculations per pixel, which makes for reasonably accurate lighting effects
Reflection mapping requires rendering to a temporary texture then sampling later when rendering the water. This can either by static, i.e. a skybox, or dynamic, which is a version of a skybox which is redrawn each frame.
Combining both of these effects along with some messing around with surface normals, and some refraction computation, can create a reasonably convincing water effect. This video, which I made a few years ago demonstrates this reasonably well.


Bathroom fan won't turn on

Question: I'm installing a bathroom fan and I can't get it to power on. I want to wire it to the switch that controls the lights in the bathroom. The power comes from the lights to the switch. After splicing everything together in the attic the fan won't turn on but the light does. When I disconnect the fan the light turns off but when I connect it it turns on. The fan has a connector that plugs into the fan. That fan motor has a wall plug. I confirmed that fan works but getting an extension cord and plugging it to the wall and to the fan. I removed the splice from switch and connected just the fan and light together and confirmed there was voltage. The light turns on but still no fan. I don't know what to do. Would it be simpler to run a separate switch for the fan?
Answer: OK, it looks like you wired the fan in series with the lights. Disconnect the fan. Get the lights to works like they did before. Then, after turning off the power, disconnect the two wires leading to the lights. Connect the wires from the fan to the wires from the lights, white to white, and black to black if in the USA. Then connect those two sets to the two wires that originally fed just the lights.

Bathroom fan won't turn on


Asset creation in ethereum

Question: Is it possible to create assets in ethereum which will automatically get linked with a particular address and will be able to send from one account to another without using a contract? I have seen that there is concept of tokens in ethereum, but what I want is to be able to create multiple assets and settle an exchange between them.
Comment: Yes done many times. You can try it out with the Mist Wallet application.
Answer: For starters, you can take a look at the Metacoin project and the concept of colored coins.

A Meta Coin is a coin that is launched on top of another blockchain, as a "meta" layer. For example a small amount of ether is "marked" and can represent an ounce of gold or a share in a company or even points in a video game. Other words for meta coins that are also used are: Tokens, Cryptoequity, Assets, Crypto Assets, Colored Coins and more.
Comment: Actually bitcoin blockchain has its own api for creating assets and transacting them like in [multichain](http://www.multichain.com/getting-started) but i could not be able to find the same in ethereum
Comment: If you figure out some way to link the `data` field with the Ether being transferred(`value`), you can use the data field to represent a digital asset.
Answer: Are you referring to a new currency over Ethereum? Assets in terms of transactions are bound to their originator (which signs them with a private key using an EC signature); one of the core ideas of the block chain is that each action made by any peers is publicly available and verifiable to others.
If your goal is to create a custom coin over Ethereum have a look at this article.
Answer: Thanks for all the help.But I think smart contract is the only possible way to do this and I have figured out with contract only to create and transfer assets.
Comment: I am struggling with same doubts. Can you plz add more details? The way is to create assets in form of solidity struct/objects and store them in array or something in smart contract where the owner of asset is also recorded and this ownership transfer will be in form of just changing field value which stores owner address and set new owner address. Is this right or you did it in a different way?
Comment: Use the concept of token contracts to implement your assets in ethereum there are number of ERC standard contracts which you can implement just use tokens as assets .

Asset creation in ethereum


Diffraction of monochromatic light

Question: I am learning the diffraction these days, and I am quite curious about the energy distribution of the light. We know that for single slit diffraction the monochromatic light will form some bright and dark areas. Where does the energy of the dark place go? Does it just disappear?
Comment: If there were no slit, all the energy would be at the center, a projection of the width of the beam, diffraction just splits the  original energy into bright and dark fringes
Answer: The light doesn't reach the centre of the dark spots where intensity is 0 because of Huygen's principle.
Each wave front is made up of an infinite number of wavelets, and these wavelets interfere to produce the single slit diffraction pattern.
The maxima are the points where the wavelets interfere constructively, and the minima are the points where the wavelets interfere destructively, meaning no light reaches the minima.
If this answer doesn't make sense to you then research single slit diffraction and Huygen's principle and it'll make more sense.
Comment: yes, it helps, thank you very much ! it was my first time to use this website,  i feel good, thank you very much for your help !
Answer: You can see diffraction as the interference between all the small spherical waves emitted from the different points of the slit (the Huygens-Fresnel principle).
On the resulting diffraction pattern you show, in the dark regions, there is no power due to destructive interference while in the bright regions, you have constructive interference. So the power which passes through the slit is distributed on the bright fringes and never gets to the dark regions.
Comment: thank you very much for your answer, so can I say the energy is still exist,just distributed on the bright fringes ? if we add up the energy of all the bright fringes, it is equal with the energy of the light before diffraction.(I think it is the law of energy conservation)
Comment: Absolutely! The power passing through the slit is conserved and equal to the one of the integrated diffraction pattern
Answer: The energy does not disappear. The energy that would have gone to the dark spots--if not for diffraction--is diverted to the bright spots. If you were to remove the slits and use a lens to make a band of light as wide as the diffraction pattern, you would find that the light at the center is dimmer than the central peak of the diffraction pattern.
The light bands are concentrated light that was diverted from the dark bands. The total amount of light is the same.
There's a great video from MIT to show that interference just moves light around. It does not create or destroy light.
Where Does the Light Go?
Comment: yeah, thank you very much for your help. I think I have got what I want to know, thank you very much for your answer !

Diffraction of monochromatic light


I am a Pakistani, in a same sex relationship, applying for a Tier 2 visa soon. What proof can my partner provide to apply for Tier 2 dependent?

Question: I have been living with my partner for more than a year now but we are in the closet so we don't have an address to our name or a joint bank statement. We have lots and lots of pictures but I don't think those would suffice in convincing the UKBA of the seriousness of our relationship. What else can my partner show as proof of relationship? Please help?
Comment: The country you're applying for is the UK? If so then https://visas-immigration.service.gov.uk/product/pbs-dependant-partner and https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/477216/PBS_dependant_guidance_11-15.pdf may be relevant.
Answer: It may be difficult, if not impossible, to include your partner as a Tier 2 dependent, as you would need to prove that you've been living together in a relationship similar to marriage, and that it has been at least two years. Documentary evidence would include joint leases or rental agreements, bills for shared utility accounts, important documents for each of you that show the same address (identity cards, driver's license, passport).
That may limit your options. Your partner may be able to apply independently for his own long term UK visa. Another alternative could be for both of you to emigrate to another country which does recognize your union and, after the appropriate time, several years, apply to emigrate to the UK under the Tier 2 (or other) scheme.


How can I create a site on the tor network? PHP

Question: I programmed on my PC a website in php using xampp and mysql server, but how do I send these files contained in my folder, which is located at:
(ex: htdocs/my finished site),
to the tor network?
Answer: You should point the address:port of you webserver to Tor.
First, create a folder in which the files for the .onion domain will be put on:
sudo mkdir /var/lib/tor/<site_name>

Change the permissions:
sudo chmod 0700 /var/lib/tor/

Change the folder ownership to user running Tor (in Debian is debian-tor):
sudo chown -R debian-tor:debian-tor /var/lib/tor/

Edit your /etc/tor/torrc file and insert these lines
HiddenServiceDir /var/lib/tor/<site_name>
HiddenServicePort 80 <webserver_address>:<port>

Replace <webserver_address>: with the address:port of the webserver, for example 127.0.0.1:8080
Restart Tor:
sudo systemctl restart tor.service

And finally pick up the address of your hidden site:
sudo cat /var/lib/tor/<site_name>/hostname

(Sorry if my English is bad).
Comment: basically it is, **but the PHP itself needs to be secured to prevent any data leaks**!
Comment: Yep. There is a lot of tutorials about this just searching in Google..


Hierarchy file display

Question: I am working on an application which should display multiple files with each file being dependent on one or more files. There are 2 levels of nesting (fileA -> fileB -> fileC) and there can be 25 files per level. More files can have same dependency (fileA->fileB, fileD->fileB).  I was thinking to do something similar to folder/subfolder structure,but the problem is that I have to show the files with the duplicated dependencies being listed only once. Anyone met this before or has some suggestions?
Comment: Welcome to the site, @Michelle. Can you clarify why the folder/subfolder approach doesn't work? Are there dependency loops? (It seems like in your example A and D are both analogous to subfolders of B.)
Comment: Thank you. Because client said that in the entire listing each file should appear only once, so I cannot visual show fileB dependent on both fileA and fileD.
Answer: The folder/subfolder structure is very intuitive, because people work already like that in their file browser,  and it maps also very well to the concrete worlds of paper files.
Showing the file only once seems however a terrible loss of information that might mislead the user:

he might want to discard a document because he thinks it's not used elsewhere
he might discard folders because he thinks they are empty and useless
search functions might appear inconsistent with the display.

I'd therefore suggest to display every occurrence of the file,  making however clear that it exists several times, for example:

showing the first occurrence as expected by your customer, and showing the remaining ones in a way to make redundancy clear (e.g. ASCII display:  between brackets, GUI display: grayed out).
showing all occurrences but with a marker showing it exists several times
ideally for GUI interface, the user would be able to locate/move to other occurrences of the same file, for example by right-clicking on the file

However a question should be ellicited with the user:  does he focus on the hierarchical structure ?  Or is he interested in a flat list of documents ?  In the latter case, you could opt for an inverted presentation:  a list of files sorted bottom up, with right to the file  column for the folder (one in most cases,  but with an expansion block that may allow to display additional folders.
Comment: Yes, the interest is on the hierarchical structure. I will apply your suggestion to use a marker to point duplicate references with a link to the files. Thank you.

Hierarchy file display


Can future rental income be applied to present debt-to-income ratio when applying for second mortgage?

Question: If someone wants to purchase a second home as a source of rental income (and potential investment), would (or could) a lender apply the estimated future income from rent on to the present debt-to-income ratio of the loan applicant?
Answer: They will include the rental income into the calculation. They don't give you a 100% credit for the income because they have to factor that you might have a gap between tenants.  Years ago they only credited me with 66% of the expected monthly income.
Example:

$600 Principal, Interest, Taxes, Insurance, Condo Fee
$400 Rent credit (2/3 of the $600 in rent I charged the tenant)
Resulting in an expected loss of $200 a month.

This expense was then supposed to come from the 10% of my income that was allocated for monthly non-principal mortgage loans, e.g student loan, auto loan, credit card debt...
Answer: Having both purchased income properties and converted prior residences into rental properties I have found that it is difficult to get the banks to consider the potential rental income in qualifying you for a loan.  It helps if you have prior rental experience but in many cases you will have to qualify outright (i.e. without consideration of the potential income).  The early 2000s were great for responsible borrows/investors but today's regulations make it much more difficult to finance income property.
Answer: Generally speaking, no they won't. In this case, though I haven't done it myself, I was recommended to put the mortgage on the real estate after it's been leased out and has a contract on it.  Then, yes, they will use it for that.  But, ex-ante don't expect any bank to count on income from it because, at that point, there's zero guarantee you'll get it leased, and even if you do, at what rate.


replacing a toshiba hard drive in a mac mini

Question: I took my mac mini in to a computer repair shop, they said I needed a new hard drive, so I paid them $300.00 to do the repair.  Later on when I went to set up my mini mac it wouldn't work, and I found out that they replaced my apple hard drive with a toshiba hard drive. why would they do that
Comment: Please add your MacMini model, the hard disk type (SSD or HDD) and size to your question. 300 $ seems a lot for just changing a hdd. BTW Apple doesn't manufacture hard disks themselves, they only put their brand name on it. A normal computer repair shop doesn't have access to Apple branded hard disks or SSDs.
Answer: Yeah it sounds like maybe you just need to install the OS onto it (I guess "it wouldn't work" isn't really defined, so this is a guess).
If Tetsujin's suggestion doesn't work, and you have the older Mac Mini (I know my Mac Mini had the drive die - and it's from 2005, so internet recovery wasn't available), then put a Mac OS CD in the drive and boot up while holding down
    Command + C
to boot from the CD drive.  Then install the operating system from that.
You might also want to make sure the shop gave you back your old hard drive, since it has all your stuff on it.  Depending on how dead the drive is, you could put it into an External Enclosure and try to get some of the data off it. (Make sure you choose the correct drive connection: IDE (older computers), SATA (newer computers I think?), or other types (mSATA etc.).
Answer: Apple don't make hard drives & it doesn't really matter who made it, so long as it's correctly formatted for the computer.
For $300 I would have expected the store to at least format it put a clean OS on it - that is a lot of money for a simple HD, which cost about $40 per terabyte these days.
$300 would buy you a 1TB SSD drive.
To get a basic OS onto it now, you need to boot it & hold  Cmd ⌘   R  at the chimes, which will allow you to use Internet Recovery.


How to Determine If a VirtualBox Appliance Is Headless?

Question: A VirtualBox virtual machine may be launched headless or with the traditional GUI type. I've sifted through the vboxmanage documentation but can't find a way query the current type. Short of grepping running processes or X windows, what's the best mechanism to determine if a VM is headless from Bash?
Note: I also tried diffing vboxmanage showvminfo and vboxmanage guestproperty enumerate between headless and GUI sessions but the only deltas were timestamps.
Answer: Some ideas...
If you're using Linux try comparing their /proc/${PID} directories. Maybe you could find the open socket in fd/ or a DISPLAY env set in environ. Beware it's zero-terminated (use tr '\0' '\n').
Cheers
Comment: thanks for the suggestion but I'm really looking for a more builtin and supported mechanism (i.e., I want to avoid avoid grepping processes).


Diet Plan for Building Lean Muscle

Question: I'm new to weight training and my overall goal is to gain lean muscle mass and get rid of fat. I have incorporated cardio and strength training into my program, but need help with the diet. I'm a highschool student, so that doesn't really help my situation. All suggestions are welcome! If you need clarification I'll be happy to respond! Thanks!
Comment: What do you need help with? What is wrong with your diet? What do you want your diet to be?
Comment: I agree with Raditz, there are many potential avenues for a diet plan. Are you looking for the basic guidelines of what your nutrition should look like, or are you looking for something more specific? What is your nutrition currently like?
Comment: I'm looking for a diet plan that would help me build muscle but lose fat. I want something that's doable as a high schooler. Anything helps!
Comment: I can certainly put together some general guidelines, but let me ask you another few questions. What is your height/weight/sex and bodyfat percentage? https://i.imgur.com/xAyq8D4.jpg
Comment: My body fat is about 20-24% my height is 5'11 1/2 and 183 @JustSnilloc
Comment: Forgot to mention I'm a guy
Answer: There are a few things to consider, but let's break it down into categories...

Water - Drink plenty of water! Have it with every meal, every snack, and even inbetween if you're thirsty. If it's reasonable for you, carry a water bottle with you wherever you go and you can sip on water all day long. There are so many benefits to simply drinking water that this should be a no-brainer.
Calories - A TDEE Calculator will be a good starting point, but your weight scale will be what confirms what you stick with. As both a new lifter and as someone with enough extra bodyfat, you're a prime candidate for something called a "body recomposition" (building muscle and losing fat simultaniously). To do this, you'll want to maintain your current weight, and to do that you'll want to eat a certain amount of calories every day (refer to the beginning of this paragraph). Right now, you'll want to do something like 2700 calories a day, but if you end up gaining or losing weight at the end of any given week, just modify your calories by 200 or less depending on how close you are to maintaining your weight that week.
Protein - Protein is a macronutrient, one of three (the other two are Fats and Carbohydrates). To ensure that you're getting the maximum muscle building benefits of protein, you'll want to consume about 0.8 grams of protein per pound of body weight. So for you, right now you'll want to eat 146 grams of protein each day. This shouldn't be consumed in a single meal, but rather spread throughout the day.
Fats and Carbs - Apart from protein, the rest of your calories will come from these other two macronutrients. There are various ratios which you might hear suggested, but just do what works for you - it really doesn't matter. Keep in mind that fats tend to be more satiating while carbs are your body's primary source of energy.
Micronutrients - All of these are important, but most notable of all is going to be fiber (30 grams a day). You don't have to wrack your brain trying to find a perfect balance of all your micronutrients in each meal across the entirety of the day. Instead, just make an effort to include them all throughout the day.
Meal Planning - Download "MyFitnessPal" to your phone and plan your days in advanced. There are several meal planning strategies, but one that I would suggest is the three part meal; a protein, a leafy/fibrous carb, and a starchy carb. Experiment though, see what other people are doing and find out what works best for you. Some people have success eating every 2-3 hours while others have success eating in a small several hour window. Some people have success by eating only certain kinds of foods while others have success by only eating certain amounts of food. My biggest suggestion here would be to do what is sustainable for you, if you hate what you're doing, it isn't sustainable.
Supplements - They aren't necessary, but they can certainly be helpful. Protein powders for example are just one of many potential sources of protein that you might choose to utilize. Multivitamins likewise contain the same vitamins that you can find in normal food. Preworkout is something that you're simply not going to get from food, but it's also something that couldn't be more optional. Two supplements that I would recommend are creatine (5 grams a day) and omega 3 fish oils (2000-3000 milligrams a day) as they provide many benefits and are unlikely to be sufficiently found in a person's food intake alone. One of the best places to find quality supplements is going to be LabDoor, an unbiased source with fair lab tested reviews.

... all of that said, if you want to make the most out of your time spent in the gym and your time spent recovering, you'll want to make sure that you're following a competent training program that was created by someone credible. Make sure whatever program you follow matches your training goals too. Best wishes!
Comment: JustSnilloc that's a good and complete answer, ty

Diet Plan for Building Lean Muscle


Can I use a Chinese business visa (M) for tourism?

Question: I have a valid multiple entry 60 day Chinese business visa that I use to travel for work. I am planing a trip to China that is only for vacation, can I use my business visa or do I need a tourist (L) visa also?
Answer: Whenever I or anyone I know went to China for work, we/I always entered in on a tourist visa. Usually, there's no distinction or separation between the two.
So with a business visa, you should be able to enter into the country and do some touring/sightseeing. Nothing really prevents from traveling around the country. Likewise, if you have a tourist visa, you can travel around and conduct some business.
Here's an excerpt from this site to confirm:

Visas are issued to permit entry into a country for a specific purpose: to allow travel for leisure, or to conduct business activities. In general, 'tourist' visas are issued specifically for the purpose of travel for pleasure, while a 'business' visa generally permits a traveler to engage in normal business-related activities. You need a supporting letter to apply for business visa. However, there is no distinctive line between tourist visa and business visa. In another word, tourist visa will not prevent you from conducting business in China.

Hope this helps!
Comment: That site is **not** an official site. However I do agree that generally the Chinese have historically had no issue with people entering under tourist visas to visit trade fairs, visit factories (buying) and the like. Of course that could change at any time, and if you are a Lotte salesman you might have rather more issues at the moment than a newly minted importer. Anyway, this doesn't really answer the question- I strongly suspect it's not a problem as @Belle implies, but I see no official evidence of it.
Comment: This is not completely correct. A business visa will allow you to legally conduct business, a tourist visa does not. Basically a business visa is better than a tourist visa.
Comment: That some people use an L visa for business doesn't address the question of whether an M visa can be used for tourism.


How to transfer a question with its coments from Beta to Chat

Question: I have encountered many instances of a question being transferred from History to chat, along with all its comments. (This question in chat is one of the most recent.) I've tried to do this myself, but it doesn't work. Could you give me instructions or a link with instructions telling me how to transfer a question plus its comments to chat?
Comment: The only way I know to do it as a user is to wait for the "Please avoid extended discussions in comments. Would you like to automatically move this discussion to chat?" message to come up and click the link. As a mod, we have the ability to access a "move comments to chat" link from the mod menu.
Comment: You can always create a chatroom yourself and paste a link to the question in it though. Then you can provide a link to the chatroom in a comment on the question.
Answer: Only moderators can do this, generally.
However, if you chat back and forth with one user long enough it eventually prompts you to take it to chat.


Transportation from Upper East Side to Newark International

Question: What are the transportation options from 78th and 2nd to Newark international? Any insights into evaluating trade-offs in the evaluating options are appreciated: please state if any relevant actual experience.  Any feedback to narrow the question is appreciated. Thank you
Comment: Just for future reference: when asking a question relating to a specific airport, please use the tag corresponding to its three-letter IATA code (here [tag:ewr]).  And also, the tag [tag:airport-transfer] is appropriate for questions about ground transportation to/from an airport.  I just mention it because it looks like many of your recent questions have needed retagging.
Comment: https://travel.stackexchange.com/questions/84042/new-york-city-from-newark-airport may give you a start.
Answer: I like to use Rome2Rio to get a quick overview of multiple transportation options between two points, whether within a city or across the world. By default it will display results broken down by mode of transportation, and for each mode, showing the estimated time and cost. For each mode, you can click on it to get more details such as the exact routes and schedules and pricing information.
From the search results we can see that, excluding driving yourself, the cheapest option is public transportation, expecting to take a bit over an hour to get there. If you're in a hurry you can take an airport shuttle for quite a bit more than that, but since I know how traffic is in Manhattan, I would take the 22 minute estimate with a huge rock of salt.

So the usual tradeoffs people have to make getting to and from an airport are time, cost, and the need to carry a lot of baggage. If you have more than one checked bag per person, it's probably best to get an airport shuttle even if it's more expensive, as moving that baggage around the subway or a NJ Transit train would be unwieldy at best. If you're traveling in the middle of the night and the tunnel isn't under construction or something, then maybe that can be done in 22 minutes and you can trade off the cost for time if you really need to. Otherwise if you have no more than one checked bag and one carry on per person, you can probably just take public transit with little difficulty.
Comment: Clever use of technology
Comment: "excluding driving yourself": the round-trip toll to cross the Hudson is $16 (not considering EZPass discounts), so unless it's truly a 1-way trip, the cost of $1-$3 is deceptive.  It's just that they charge $16 in one direction and $0 in the other.
Comment: @phoog AFAIK the toll only applies when entering Manhattan, and exiting is free. It's not clear whether the OP will be returning, but perhaps others who read this might, so it's good to keep this in mind.
Comment: Yes, that's what I said, isn't it? It's a $16 round trip. If you drive to the airport, you'll almost always have to pay the toll on the way back, unless I suppose you catch a ride with someone who doesn't live in Manhattan.  (Also, if you take a taxi, you have to pay the round trip tolls in addition to the airport surcharge.)
Answer: Note: This answer specifically refers to public transportation options, as it is assumed by default that Manhattan traffic + Lincoln Tunnel traffic will be horrendous. As noted by phoog in the comments, airport shuttles and taxis will likely be faster than public transportation when traffic is low.
From 78/2nd to Newark, the most effective way to go by public transportation is to take the (Q) from either 72 St or 86 St stations (depending on which is closer) to 34 St - Herald Square. From there, walk west to Penn Station to access New Jersey Transit. Alternatively, you could transfer to a 1/2/3 train at Times Square and then go one station south to Penn Station but the transfer corridor is circuitous and definitely less convenient than walking from Herald Square.
Service to Newark Airport is provided by the Northeast Corridor and North Jersey Coast Lines. The Northeast Corridor (the more frequent one) timetable can be found here: https://www.njtransit.com/pdf/rail/R0070.pdf
For the NJ Transit trip planner, it's available on the NJ Transit website
Once you're on a NJ Transit train for Newark Airport, the ride shouldn't be more than 25 minutes.
At the airport, you will then need to take the AirTrain to your terminal.
Comment: Although the traffic is usually horrendous, there will be times when it is not.  At 5 a.m. on a Sunday, a taxi is probably the fastest way to go, certainly faster than public transportation.  The 86th street station is closer to 78th St because there is an entrance on the northeast corner of 83rd and 2nd.  If you're changing to the 1-2-3, the easiest way is to take the stairway at the middle of the downtown Q platform, which leads you to a fairly direct corridor (from the uptown Q, the best way is to take one of the stairways at the uptown end of the platform, which is indeed more circuitous).
Comment: I would also include a link to the NJT site, which has a planner that will give train times for all trains at once, so the traveler doesn't need to pay attention to which line any train is on.
Comment: @phoog Good point - I've linked the NJ Transit homepage in the post.


Asus P5N-D Motherboard / NVIDIA nForce 750i SLI Southbridge: mix RAID1 and non-RAID?

Question: I have an Asus P5N-D motherboard which includes the NVIDIA nForce 750i SLI chipset.  The motherboard has 4 Serial ATA 3Gb/s slots and the chipset supports RAID 0, RAID 0+1, RAID 5, and JBOD.  I currently have a RAID 1 setup.  However, I'd like to add another hard drive (an SSD) which will become my primary drive while the RAID 1 drive becomes my data drive.  Is this configuration typically supported?
Answer: So far as I know this should be fine, on most raid controllers you should be able to set whether a disk is handled by the raid controller or the BIOS. Most probably this setting is in the bios, however check in both places.


What forces act on cascade-type thrust reverser blocker doors?

Question: What is the stress or force that loads the cascade-type thrust reverser blocker doors? As we know, blocker doors are closed and block the airflow going through the C duct. The engine is a V2500 with 25000 lbs thrust.
Comment: Is this a homework question?
Answer: ATTENTION, very coarse analysis !
This is a bit vague, but maybe this will give you a starting point.
Generally on turbofans, about 70% of the total thrust is provided by the fan.
If you consider a high power brake using 80% of the max thrust, this gives you
TADAAAAA 25000*0.8*0.7 = 14000 lbs (yup that's rocket science).
Now, this gives an approximation of the power provided by the fan. However, the outlet angle is not parallel to the main flow. Assuming that the mass flow rate as well as the magnitudes of the velocities are conserved in the transfer and that the outlet angle is about 45° from the engine axis, it gives
qm x (v2-v1) = F where qm is the mass flow rate, v2 the outlet velocity vector and v1 the inlet velocity vector, while F is the force of the fluid on the structure.
Because of the angles this gives qm x (0.5+1) x v1 = FX and qm x 0.5 x v = FY on the doors.
Then, assuming (yes, I said to pay attention at the beginning of my answer) that Ffan = qm*V1 = 14000 lbs, which is quite doubtful unfortunately, we obtain FX = 21000 lbs and FY = 7000 lbs.
Regarding stresses, it is IMHO far to dependent on the actual parts of the engine to assess.
If anyone can check this to be sure, be my guest ;).


Custom formula for keyframe automation - Adobe Premiere Pro

Question: Is it possible to enter custom math/scripting formulas for keyframe animation inside Premiere Pro?
Answer: Not from within premiere. You would need to do that in AfterEffects.
AfterEffects is better suited to do animation regardless. Once you've set up your compositions, you can then import them directly into premiere and lay them into a sequence using Bridge.
This way you can easily jump back and forth between AE and PPro and any changes made to your AE Comp will immediately update in PPro provided you have Bridge and the Dynamic Link Option enabled.
Comment: wish, there was a way to do it in premiere too.
Comment: Depending on what they are trying to do, it is quite likely that the Motion effect in Premiere can handle this.  After Effects is certainly much more powerful, but basic keyframing and position effects are perfectly doable (if more of a pain) in Premiere directly.
Comment: Also worth mentioning that you can export from premiere timelines. Select the clips and right-click and choose `replace with after effects composition` and they'll be turned into an AE comp. There you can use expressions to do exactly what you want to do.
Answer: Depending on what exactly you are trying to accomplish you actually could do this by making images of the portions you want to animate and using the Motion effect on the various layers, however it will be pretty tedious to do.
As Martin Andrews mentioned, After Effects is much better equipped for handling this kind of thing, but depending on your specific goals for the animation, it is likely possible in Premiere.


How are Hidden Abilities passed down in Sun/Moon?

Question: So, I have a male Talonflame with its Hidden Ability (Gale Wings) and a female Pelipper with a normal ability (Keen Eye). I'm trying to breed a Wingull with a Hidden Ability but I can't pass down one even though they are in the same egg group. Does the female have to have the Hidden Ability to pass down to the Wingull?
Answer: Yes, when breeding Pokémon of different species, only the female is able to pass down their Hidden Ability to the offspring. The only instance when a male is able to pass down their Hidden Ability is when breeding with a Ditto.
Comment: IIRC, the male is also able to pass down their HA when they breed with a female of the same species.
Comment: @SGR It doesn't seem like it. Both Serebii and Bulbapedia say that males can only pass down their ability if they breed with a Ditto.
Comment: Danmaku is right, if two Pokemon of the same species breed only the female can pass down the HA.


List of attacks on Tor

Question: I'm studying Tor for educational purposes and I haven't been able to find many resources about attacks on Tor (even the once that have been patched). Most of the articles are too general or don't explain the attack in detail. I've even found this Thirteen years of Tor attacks, but it's almost unreadable. Can you share some of the links of the attacks that you think are interesting? Thank you
Answer: I don't think anyone will do your research for you but here are some links with a lot of good information.

Paul Syverson's home page
Roger Dingledine's home page
2012 Tor Specification
Selected Papers in Anonymity
Comment: thank you, I really appreciate your help! I was just hoping that users with more experience might know some sites that aren't listed as the first ones on google. Tor is a very popular topic among a wide variety of people, so it's fairly hard for me to find something that really explains how the protocol works and not just general info.

List of attacks on Tor


Honda accord high beams never shut off

Question: I have a 2005 Honda Accord.  Recently, whenever I turn off the engine the high beams stay on!  I tried to cut the power from the battery and turn it on again but the high beams are still on.
Can you help me, please?
Answer: Find your high beam relay in your under hood fuse box. Put your finger on it and have a friend flip the high beams on and off. It should click. If not, replace. Else, see other answer for the switch.
Answer: Your light switch may be defective. Buy a $15 multimeter (WalMart has them), and perform a continuity test on the switch. This involves setting the multimeter either to a resistance setting (100-1000 ohms should work, most multmeters have this setting) or to a continuity setting (not all mutlimeters have this setting).
If you are using a resistance setting, continuity between 2 pins will display a reading on your multimeter (an actual number other than 0), whereas lack of continuity between 2 pins will either read 0, or display something saying the reading is out of range (each multi-meter is a little bit different for this). If your multi-meter has a continuity setting, they usually beep when you have continuity.
To get comfortable telling the difference between continuity and no-continuity readings, set your multi-meter to a your chosen setting, make sure the electrodes aren't touching and look at the screen: that's no continuity. Then touch the electrodes together and look at the screen: that's continuity.
Once you've figured out the setting, perform the continuity test by sticking each electrode in the combination of connectors listed on the link with the switch in the stated positions. In case the link above goes dead, a 2005 Accord needs continuity between:

pins 1 and 12 with the switch off
pins 7 and 12 with the switch to running/parking lights (1st position)
pins 2, 7 and 12 with the switch to headlights, with high beams off (no blue light on your dash). (test the pins 2 at a time: 2 & 7, 2 & 12, then 7 & 12)
pins 8 and 12 with the switch to headlights, with high beams on (blue light on your dash).

The link above tells you how to remove the light switch and how the pins are numbered.
Comment: Might be relay melted together.
Comment: Instead of a continuity test on the switch I'd suggest backprobing the switch connector on those pins. if you have voltage where you shouldn't unplug the connector and check for power (or ground) on the output pins harness side. This way you cover two tests without having to remove the switch or contort your body to test.
Answer: I just fixed this exact problem in my 2003 Accord EX V6. All of the symptoms you mentioned apply. The circuit-board module (Omron G8C-402H Keyless Control 38830SDA-A210-M1) inside the ostensibly sealed portion of the main under-hood fuse box must be replaced.
There's an excellent video on YouTube showing how to remove the main fuse box from under the hood and gain entry to the sealed portion of that fuse box (search for how to replace the ELD (Electronic Load Detector) on the 2003 Accord).
The exact same method is used to replace the $30 ELD inside the sealed portion of the fuse box, for those experiencing the headlight intermittent dimming/brightening phenomenon.
Answer: I had a similar option on my 2004 Honda Accord 4 cylinder in Ghana. It's hard to get the fuse box in the aftermarket but fortunately, the problem was solved when I switched from the OEM halogen bulbs to led bulbs both low and high. Amazingly, the problem come back when I change to halogen and stops when I use led bulbs

Honda accord high beams never shut off


How to sort some values from an array in a controller in Rails?

Question: I've got a links array that I'm saving to a database. The problem is that the records aren't saved in the order of the array ie links[1] is saved before links[2] and so on...
This is a example from the view file:

  Label
  <input id="links_9_name" name="links[9][name]" size="30" type="text" />
  <input id="links_9_url" name="links[9][url]" size="30" type="text" />

And this is my controller:
def create
    @links = params[:links].values.collect { |link| @user.links.new(link) }

    respond_to do |format|
         if @links.all?(&:valid?)
         @links.each(&:save!)

        flash[:notice] = 'Links were successfully created.'
        format.html { redirect_to(links_url) }
      else
        format.html { render :action => "new" }
      end
    end
  end

Thanks in advance!
Alfred
Comment: why do you need to save them in order? i'm just curious :]
Comment: Before I get proper sorting functionality in place I just want to save them in the order they were filled in for simplicitys sake.
Answer: The reason your links aren't being stored in order is that you're not presenting them to the db in order.
-- The param object is not an array, even though, to an extent it might look like one. Rather, they are a hash where the keys are integers. You can tell this is true because you need to use
params[:links].values.collect

if it was an array, you'd use
params[:links].collect

Any time you use .values method, the key order is indeterminate.
Solution
I agree with @p.g that you should be very careful about using db id's as an order. Eg suppose you want to change the order later? I often have 'list_order' as a field in my models.
To reorder the params, and save in order of the key, try the following:
links_param = params[:links]
ordered_keys = links_param.keys.sort
@links = ordered_keys.collect {|key| @user.links.new(links_param[key])}

Added: also note that the keys might well come in as strings, not integers. So if you have more than 10 of them, might be an idea to sort them as integers:
ordered_keys = links_param.keys.sort{|a,b| a.to_i <=> b.to_i}

Added in response to comment about saving the "display_order" --
First, add new field to model, :display_order. Be sure to add an index on the field since you'll be sorting on it.
Then, in your controller, you need to expose the key to the model. Eg something like this:
 links_param = params[:links]
 links_params.keys.each{|key|links_params[key][:display_order] = key.to_i}

Now when you build your user.link object, the display_order param will be set too.
Comment: Don't get that code to work, still a strange order...

...how can I fetch the number from links[] and put in a seperate column?
Comment: Got more than 10 and with that code snippet it worked flawlessly! Thanks a lot!
Answer: Alter your schema so it has a display_order column or something similar, and have this pushed through as a hidden input on the front end.
Relying on the id column for ordering is discouraged, as it is essentially an arbitrary value created by the DB, which happens to follow a logical sequence most of the time. Having a separate column for the order won't break DRYness because it is (technically) for a different purpose.


How to send new order emails through SMTP Pro using Observer

Question: I'm running Magento 126.96.36.199 and it's not sending new order emails if I choose a certain payment method.
I know the error is in the payment method because cron jobs are running and every other payment method sends their new order email. I'm using SMTP Pro (aschroder).
This faulty payment method let's me choose the order state after the payment is accepted.
I'd like to use an Observer to send new order emails, and triggers when a certain state is chosen for an order.
There are several guides out there explaining how to set an observer, but I'd like to know how can I call SMTP Pro to send the email.
Answer: go to app/code/local/Mage/Core/Model/Email/Template.php
line
 line 407 put
<code>if (!($this->hasQueue()) && $this->getQueue() instanceof Mage_Core_Model_Email_Queue)
</code>


What is the simplest way to determine if two or more TLEs describe two or more satellites in lead-follow?

Question: If two more more up to date TLEs have same inclination and the same period they are in the same orbit, but how do I check if they are also following each others path, in a train?
Comment: Hi @justin welcome to Stack Exchange! Thank you for clicking accept but I recommend you don't accept an answer right away. It's possible that other answers will be posted or that someone will find an error in or something missing from my answer. I'd say give it a few days before you click accept.
Answer: I'll take a stab a this.
A "train detector" needs only to detect if the orbits have the following four characteristics:

The two spacecraft are actually in orbit at the same time
The two orbits are co-planar
The two orbits have nearly the same shape (eccentricity)
The two orbits have very nearly the same mean motion (orbits per day)

I'll assume that you can check item #1 yourself.
Item #4 requires a judgement because two spacecraft only need to have nearly the same mean motion. It doesn't have to be exact because a slight difference may only cause the "train" to de-phase over months or years, and as long as one of them has some ability to perform occasional orbital station-keeping maneuvers the train can be maintained. So let's just define
$$\delta = \frac{n_2-n_1}{n_2+n_1}$$
and say that $|\delta| < 0.001$ or some similar number. A one part per thousand difference in mean motion in LEO with a period of 90 minutes means the relative phase angle between the two will change by 360 degrees in 60 days or so. The definition is arbitrary and you are welcome to make it tighter; going to 1E-04 gets you to nearly two years.
Item #2 has two criteria:

Inclination
Longitude (or Right Ascension) of ascending node

Both of these also require limits on the differences; they don't need to be exact matches, but only close enough to meet whatever definition of a "space train" you'd like to require. It is important to point out that when the inclinations are different, the orbital planes will precess around Earth's axis at different rates due to Earth's oblateness as express by $J_2$ and the difference in those rates depends on several parameters of each orbit, so you can not treat these separately.
Item #3 has one criteria which is eccentricity, but the effects are complicated. If the Earth's gravitational field were spherically symmetric then different eccentricities with the same mean motion would result in a period oscillation in the distance between the two spacecraft. The nature of that oscillation will depend also on the differences in their arguments of perigee but it will be like a little "dance" between the two. Imagine a slinky train where the relative positions between adjacent "cars" of the train can oscillate.
A very notable subtlety with eccentricity is that there is a second order effect on the relationship between semimajor axis and period. Because Earth's $J_2$ is a quadrupole moment it's strength varies as $1/r^4$ and so a more eccentric orbit of exactly the same semimajor axis will have a shorter period or have a larger mean motion (orbits per day)! For details on that see the excellent answer to Equation for orbital period around oblate bodies, based on J2?

Taken all together, you can see that what seems like a simple problem becomes complicated due to Earth's oblateness and substantial $J_2$ which mixes the effects of tiny differences in each orbital parameter.
The best way forward I can see is to set limits on the four enumerated parameters and then run an SGP4 calculation with edited variations of TLEs in the hypercube defined by your limits and see the effect of each using some design of experiment methodology, or instead with a Monte Carlo technique of creating an ensemble of TLEs using random numbers to vary each of those parameters within your limit range. In all cases you'll have to decide what is and what isn't a "space train".
Enjoy!

Appendix:
Wikipedia's A-train says that currently it has four active spacecraft:

Orbiting Carbon Observatory 2 or OCO-2
Global Change Observation Mission or GCOM-W1
Aqua
Aura

Here are their current TLEs from Celestrak:
<code>OCO 2
1 40059U 14035A   20237.92319585  .00000020  00000-0  14372-4 0  9990
2 40059  98.2050 177.6833 0001511  80.6324 279.5045 14.57111340326998

GCOM-W1 (SHIZUKU)
1 38337U 12025A   20237.87049493  .00000020  00000-0  14522-4 0  9992
2 38337  98.1994 176.8895 0002496  99.5779 328.0152 14.57074379439977

AQUA
1 27424U 02022A   20237.87245431  .00000056  00000-0  22413-4 0  9990
2 27424  98.2055 177.5270 0002453 105.8467 322.0067 14.57111576973832

AURA
1 28376U 04026A   20237.93375889  .00000062  00000-0  23709-4 0  9997
2 28376  98.2080 179.7403 0001576  81.5765 278.5612 14.57111144856893
</code>
Comment: thanks for the right way to do it vs a naive attempt I dreamed up after posting the question: assuming un-eccentric orbits, move forward one object in time by 1/10th of its periodicity then see if the great circle distance between it and the other satellite in question has changed by 1/10th of the circumference of the globe. Wait that doesn't work. Move both forward X seconds and check if great circle distance is unchanged, to within an error.
Comment: I did want to analyse a bunch of TLEs to detect all trains as directly as possible and wasn't too sure about comparing each of 500+ to each of 500+, by propagation. Seems like a combinatorial explosion to do it empirically?
Comment: @uhoh mentioned the phase angle in regards to item 4, but shouldn't the phase angle be important for a "train"? Two satellites on opposite sides of the orbit (phase angle = 180 degrees) is not much of a train. Two satellites separated by a phase angle of 2.5 degrees still puts the satellite on the order of 300 km (200 miles) apart. This is something that Justin should decide -- what constitutes a train.
Comment: @uhoh Another thing to split out as a separate criteria is the direction of the perigee. If all other parameters were the same, including the eccentricity and phase angle/mean anomaly, but the argP were different then you could still see oscillation. You have already picked up something very similar in your point #3, though this oscillation could arise from either of eccentricity or argument or perigee being different with the other parameters being uniform between the two objects.
Comment: @justin your [empirical approach](https://en.wikipedia.org/wiki/Empirical_research) is definitely a reasonable way to do it! My interpretation of your question was that you wanted to analyze the values in the TLEs without propagating them. But if you want a "train detector" that uses SGP4 propagation then that certainly will work! Why don't you write that up as a second answer. It's always okay to post an answer to your own question in Stack Exchange! Questions can certainly have multiple good answers.
Comment: @justin okay let me think about that further...
Comment: @JohnHoltz ya "space trains" should be "in the eye of the beholder". It would be fun to check the A-train to see what distance it keeps. A quick check of n2yo.com shows [OCO-2](https://www.n2yo.com/?s=40059&live=1) and [Aura](https://www.n2yo.com/?s=28376&live=1) about 55 degrees apart in latitude right now for example.


After Down Vote, my reputation gets less

Question: Why is that when I down vote a post then 2 of my reputation gets deducted?
Comment: Quite simply, I think it's to encourage new users to think carefully before they downvote.
Comment: I don't believe this. Even when I downvote, my reputation gets less by 1 . I am not a new user ; I have been here for 10 months!
Comment: This seems to be quite contradictory to your freedom of expression!! If by reflecting your opinion, you are losing your very own hardly-gained reputations, then how can it be worthy??
Comment: @user36790: You misunderstand; the reputation loss when down voting is for all members. When I said it was to encourage new users, what I meant was it encouraged new users since they have less reputation than an old user, who has probably amassed enough reputation that 2 points or so means 'nothing.'
Comment: @JamalS: Now ,sir, you are making the right statement. Thanks for the response.
Comment: @user36790 A privately owned website such as Stack Exchange can restrict your freedom of expression as much as it wants, as long as it isn't discriminatory in who it decides to restrict. Ultimately, if you don't like it, you don't have to be here. Also, anyone who has enough rep to downvote has enough rep to comment so you can express your views on any question or answer that way without losing rep.
Answer: You lose 1 point for downvoting an answer and none for downvoting a question. This is because downvoting hurts the post's owner. We want you to only downvote when you seriously believe it deserves it. We don't want people to downvote simply because they feel like it or don't like the author or don't like that they used "your" instead of "you're" somewhere in a 1000 word post.
That said, it is only a loss of 1 rep point for downvoting an answer because we realize that reputation is hard-earned and we don't want to discourage free expression of opinions; 1 rep point is not much at all.
Downvoting is not to be taken lightly, so this is status-by-design because we want you to take it seriously but not be discouraged from using it. -1 for downvoting a post gets the point across but doesn't hurt too much.
Comment: Yes, downvoting is necessary to remove bad answers from the top of the answer lists and the view of readers as well as to mark poor questions. Downvoting is an integral part of the process. But comments do sometimes suffice. The trick is to know when an answer needs a comment, a downvote, both, or neither
Comment: +1 . Will I downvote you?B-) .... Joking; .... Really after reading that I have realized the importance of downvoting and of course the hard-gained reputation...you can write comment if you have some issue with the answer but not have to downvote,right?? But one thing I wanna ask, so after all that, is downvote really necessary?? Nevertheless an intuitive answer:)
Comment: Yes, you are right. It is like interlocuting with the terrorists and if matter is worst , then armed operation( I mean downvoting) becomes essential but at the sake of the lives of your own countrymen(my reputation)!! Good metaphor, heh? Thanks for making the novice-users like me aware about the downvoting.
Comment: @user36790 It was an okay metaphor. It won't win you best metaphor of the month (not by a long shot), but it was decent. And you're welcome; that's what meta is for
Comment: I will think twice before downvoting and will not abuse this to the greatest extent. Adieu!
Answer: That's the way the system works.  You should have a look at the available help pages, e.g. this one:
https://physics.stackexchange.com/help/whats-reputation
You lose 2 points when someone downvotes one of your questions or answers and you lose 1 point when you downvote someone else's answer.
Answer: A downvote symbolizes your disagreement with someone's work. It is literally saying, This answer is not useful (hover your mouse over the downvote, that is the alt-text that pops up). The loss of 2 rep for you suggests that the decision to downvote should not be taken lightly (i.e., just downvoting for the heck of it) that you should truly judge whether the post really is wrong or misguided.
As an aside, you gain 10 rep when your answer is upvoted and 5 when your question is upvoted. Unless you are downvoting >5 answers for each answer-upvote (or >2 answers for each question-upvote) you receive, you are still going to gain reputation based on simple math.


MV(X) Patterns: How much nesting is too much? Is not enough?

Question: Posts may be smaller than they appear! Skip the bulleted list.
Lemme Just Say...
I know that this is going to be largely (entirely...) opinion-based. Everyone has their own approach, and their own best-practices ideology, but I'm hoping to glean some thoughts from those who have worked on successful web-apps previously.
There are plenty of resources discussing various MV(X) patterns, but they mostly just detail the interaction between the components, and never seem to dive deeper into separating various components, nesting models within one another, and so on. Hopefully this can become that, and devs will be referencing your insight for generations to come.
The Set-Up
(For ease, I will use "app" to mean "web-app")
Take the following mock app, based on a simplified FB layout:

A quickish run-down (for reference, just skip to question below):
Header (left->right)

Hamburger Menu

May be a drop-down type of menu, or a permanent fixture
Some menu items have "data" associated with them (i.e. dynamic values, showing numbers of messages, new items, or whatever)

App logo/home-page link
Search area
Links and btns to profile, home, settings, etc
User drop-down menu

Standard drop-down (click-n-go)
Menu btn is thumbnail img from "my" profile

Main Body (An infinite list of various posts/imgs/videos/etc)

Post options dropdown (Report, hide, embed, share, etc)
Top area (post contents)

Poster profile image/hyperlink to their profile
Poster username/hyperlink to their profile
Time hyperlink (points to page of similar-time posts)
Post comment
Image, video, hyperlink, etc from third-party site

Bottom area (viewer interactions)

Like, comment, share btns
"My" profile img
Comment text area

Text area houses btns to add external media to comment

Previous comments

User profile img
User comment
Like, comment btns
Likes and time hyperlinks
Comment options dropdown (Report, hide, embed, share, etc)

Finally, the Question(s):
These questions are pretty heavy, and I know there is no simple answer shorter than a novel. What I'm trying to get is different peoples' approaches, general rules-of-thumb, and the like. I understand the principles of various MV(X) patterns, but I always doubt myself when implementing, and feel like I'm just hacking stuff together that another developer would be appalled at.
I'm not necessarily looking for an answer to every question-mark that follows (there are a lot...). The seemingly endless strings of questions are more to illustrate the shit-show that runs through my head every time I work on a new project.
FINALLY... Finally, the Question(s):
For even a simple-ish app like above, how many models/views/controllers (M/V/C) is too many? Is too few?
I understand that there is a lot going on above, so let's just look at the top-left hamburger menu for a moment:

Is the menu not an M/V/C of its own, and simply a set of components of the Header M/V/C? And the Header handles all menu-related stuffs?
Is the entire menu (including the hamburger icon and drop-down portion), a single M/V/C, nested within the Header, inside a wrapper?
Should each menu item be its own M/V/C? Or maybe just those with the additional data that needs to be collected, displayed, monitored and updated? And the simple click-n-go hyperlink items are just components of the menu M/V/C?

And then up a level, to the entire Header:

Is EVERY element its own M/V/C? Or perhaps only those that are more complex (i.e. menus, search area)?
Are the menu btns part of the Header M/V/C, so that the Header controller handles hover/click events? And then the actual menus are their own M/V/C within wrappers in the Header?

And so on...
Yep, a headache. So many what-if's. And the header is comparatively simple, next to the post items within the main body.
Final Thoughts
This is the stuff of nightmares. Seriously, this crap keeps me up at night, trying to figure out how to approach something like this without totally F-ing it up, and leaving it entirely unmodifiable for future devs. The proper/effective execution of these kinds of things could be the difference between an acquisition and going tits-up.
Thanks for making it to the bottom, and thank you for any and all help. I'm not the only one losing sleep over this.
Answer: I think the answer is fairly simple.
Where you have the same thing twice, like your left and right drop down menus, generalise it into a widget and reuse the code. (ie it gets its own View model, View and Controller which are reused)
When you have a thing only once,(ie the header) group all its components into one big view model, view, controller. Or rather, don't worry about splitting it up yet.
SO for your example page I would have the following structure
<code>PageVM Page
    HeaderVM Header
        MenuVM LeftMenu
        MenuVM RightMenu
        string Link1;
        string SearchString
        string Link2
        ..etc
    PostVM[] Posts
</code>
With controllers roughly per VM (with MVVM stick the controller actions on the associated VM)
Models are a slightly different problem, in that they should be defined by your business logic/Domain rather than your UI.
I think you might be over egging the pudding to say these choices are so important. Usability, speed of response, scaleability are far more important.
Throw out your clever architecture if you can make it run faster or cheaper
Comment: Thanks for the input, that helps a lot. But, since there is only one header, why did you make it a VM of its own, opposed to assigning its elements directly to the page VM? This is why it's such a headache, trying to figure out the *best* method. What's the cutoff for complexity and reusability, when to make separate VM, and so on.
Comment: because presumably you have more than one page with the same header. even if its just the terms and conditions or login


Ethereum HD wallet collision?

Question: I created random HD wallet seed using eth-hd-wallet package, then imported it into Metamask and got expected addresses:

0xF011B485DF2A66A3019dEa82E1EBbf7C716443A1 (m/44'/60'/0'/0/0)
0x9590D9ca47290358eaF1Cc8482Beb2fc09D25c72 (m/44'/60'/0'/0/1)
0x3cAd996C8C9205374aECF81eE8EDd80f2489dA04 (m/44'/60'/0'/0/2)

... and so on. But when I am using the same mnenomic in truffle-hdwallet-wallet I see that zeroth address is 0x959fd7ef9089b7142b6b908dc3a8af7aa8ff0fa1, second address 0x4e90a36b45879f5bae71b57ad525e817afa54890 that already has number of transactions on etherscan in Rinkeby testnet.
From now I have 2 questions:

How it could be, I mean duplication of mnemonic phrase?
Why truffle-hdwallet-provider shows me different address then Metanask or bitcore-generated ones?
Answer: Yep, it really was "duplicated" mnemonic phrase equal to... undefined.

Ethereum HD wallet collision?


PHP maximum memory limit and Apache process memory consumption

Question: How does the PHP maximum memory limit affect the memory that an Apache process consumes? If for example I've set it to 256MB, does this mean that every process will try to allocate this amount of memory, or all the processes together or what?
Answer: PHP's memory limit is the maximum amount of memory that will be allocated within PHP.  In the default MPM, that means each Apache child will use, at most, (Apache overhead+memory_limit) bytes of RAM.  Of course, that discounts the possibility of other extensions also allocating memory, but that's a separate issue.  Lastly, it should be noted that the children don't pre-allocate memory_limit bytes of RAM at startup; it's simply a hard cap that's enforced as needed.
Comment: +1, that's how I understood it as well.
Answer: But, for approx 100ms, it does use memory_limit.
My webhost installed CloudLinux, with a reasonable 256MB RAM limit.
My AJAX code, calling 4 php pages simultaneously, suddenly stopped working, with 500 errors.
(Suspected a lot of things, erroneously)
On this server, memory_limit was 128MB, host kindly reduced it to 64MB.
Loading 5 php pages (actually basic html, saved with .php extensions) as my Homepages, I was able to eliminate any Javascript or PHP code. CloudLinux gave 500 errors - yet here is the "php" it was loading 5 of:
<!DOCTYPE html>

<meta charset="utf-8" />
<title>First Page</title>

First Page

So, specifically, it does use memory_limit of RAM - only for a very short time, presumably to test the allocation possibility. This becomes a problem with CloudLinux (excellent idea), high PHP memory_limit and code calling multiple PHP pages.