Should we synchronize blockchain from scratch after every scheduled hard fork?

Question: Should we synchronize blockchain from scratch after every scheduled hardfork or just update the binaries and synchronizing blockchain from where it was synced with pre hardfork binaries?
Answer: I think generally just update the binaries and sync from where you left off. I believe the resync from scratch with the most recent binaries (v0.10) were due to significant changes to the database format, and resyncing was generally faster than converting the old one.
Answer: No, we shouldn't have to resynchronize from scratch as it would create moments in the monero network where there are fewer functioning copies of the blockchain.
Imagine - if everyone sync'd from scratch at the same time, who would they be synchronizing from?
Hopefully this is the last major database reformat.
Comment: Hopefully pruning will be possible soon as database upgrades is to be expected going into the future.


Set theoretic question about real valued functions

Question: It's a question I've been thinking about but I can't find an easy answer. I think it will be interesting. Can there be a countable collection of real valued functions $f_1, f_2 , ... $ such that for any subset $K$ of $\mathbb R$ of cardinality continuum, the set of those $n$ such that $f_n(K)$ is not the whole of $\mathbb R$ is finite?
Comment: If CH fails, it is impossible, by taking any uncountable $K$ of  size less than $\mathbb{R}$. Perhaps you want $K$ of size continuum?
Comment: Do finitely many $f_1,...f_n$ not always satisfy the desired property?
Comment: @oktan, @mathahada: you don't need to throw constant functions in; if the finite set of functions is presented as an infinite sequence, as the question specifies, e.g. $f_1, \ldots f_k, f_k, f_k, \ldots$, and if again  we're careful to take the question literally and look not at whether *sets of functions* are infinite but at whether *subsequences* are, then it's clear that this list doesn't satisfy the property.
Comment: @Joel - yes. I have not even considered that option :)
@oktan - You are totally right, but that's easily fixed by extending the list to an infinite set consisting of constant functions
Answer: I have three observations.
First, I have noticed that there can be no such sequence of
functions $f_n$, if one insists that every $f_n$ is a
measurable function. In particular, there can be no sequence of Borel functions with your property. To see this, suppose that
$f_n:\mathbb{R}\to\mathbb{R}$ is a countable sequence of
measurable functions. If infinitely many $f_n$ are not
surjective, then clearly the property will fail and we are
done. So we may assume that all but finitely many of the
functions are surjective, and by throwing away finitely
many functions, we reduce to the case where all $f_n$ are surjective.
For each natural number $n$ and real $y$, let
$A^y_n=f_n^{-1}(y)=\{\ x\ \mid\ f_n(x)=y\ \}$. For any fixed
$n$, the sets $A^y_n$ for various $y$ partition
$\mathbb{R}$ into continuum many disjoint measurable sets.
Since one cannot have uncountably many disjoint positive
measure sets, it follows that there must be some $y_n$ (and
in fact many such $y_n$) with $\lambda(A^{y_n}_n)=0$, where
$\lambda$ is the Lebesgue measure. Let
$K=\mathbb{R}-\bigcup_n A^{y_n}_n$, which is the complement
of a measure $0$ set, and so in particular, $K$ has size
continuum. Observe that $f_n[K]$ omits $y_n$ by
construction, and so there is no $n$ for which
$f_n[K]=\mathbb{R}$, showing that the desired property
fails. I guess the argument actually doesn't need that
every $f_n$ is measurable, but only that $f_n^{-1}(y)$ is a
measurable set for every $y$.
Second, this idea combines with the idea that Gowers had briefly posted yesterday, namely, the idea of making a large cardinal assumption, and allows us now to prove the following theorem.
Theorem. If the continuum is a real-valued
measurable cardinal (a hypothesis that is equiconsistent
over ZFC with the existence of a measurable cardinal), then
there is no such sequence of functions
$f_n:\mathbb{R}\to\mathbb{R}$.
Proof. Suppose that the continuum is a real-valued
measurable cardinal. This means that there is a
countably-additive real-valued measure $\mu$, measuring
every subset of $\mathbb{R}$ and giving points measure $0$.
We may assume that $\mu$ extends the Lebesgue measure.
Using this measure, every function $f_n$ is measurable, of
course, and so the idea of the paragraph above goes
through, using the new measure in place of the Lebesgue measure. QED
In particular, this shows that if large cardinals are consistent with ZFC, then a negative answer to your question is also consistent with ZFC. So one shouldn't expect to be able to build a sequence of functions provably exhibiting the property.
Finally, third, I noticed that if the Continuum Hypothesis holds,
then there is a sort-of-near-positive solution in the sense that there is a sequence of functions
$f_n:\mathbb{R}\to\mathbb{R}$ such that for every
uncountable set $K\subset\mathbb{R}$, the combined range is
onto, meaning $\bigcup_n f_n[K]=\mathbb{R}$. (And in fact,
the existence of such $f_n$ is equivalent to CH.) To see
this, let $\lt$ well-order $\mathbb{R}$ in order type
$\omega_1$. In particular, every real $x$ has only
countable many predecessors in $\lt$, so enumerate them
as $f_n(x)$ for $n\in\omega$. If $K\subset\mathbb{R}$ is
any uncountable set, then $K$ is unbounded in the
well-order, and so every real $y$ is a predecessor of some
element of $K$, and so $y=f_n(x)$ for some $x\in K$. Thus,
$\bigcup_n f_n[K]=\mathbb{R}$, as desired.
Your question is very interesting!
Answer: EDIT: The following answer was not correct, as pointed out in the comments (though the false part is now deleted). At least it shows that there cannot be a finite collection of functions with the demanded property, but the infinite case is still open:
$\textbf{Claim}$: Let $A \subset \mathbb{R}$ of continuum size and let $f: A \to \mathbb{R}$ then there exist $\mathcal{c}$ (contiuum size) many subsets of $A$ of size $\mathcal{c}$ such that for each such $X$, $f(X) \neq \mathbb{R}$.
$\textit{Proof}$: Consider a partition $P$ of $A$ of size $\mathcal{c}$ such that each element of $P$ has size $\mathcal{c}$. If for $\mathcal{c}$-many elements of $P$ $f(X) \neq \mathbb{R}$ then we are finished thus we may assume w.l.o.g that for each $X \in P$ $f(X) = \mathbb{R}$. Then we can pick for each $r \in A$ and each $X_i \in P$ an $x_i \in X_i$ such that $f(x_i) = r$. Thus we obtain for each $r \in$ $A$ a set $Y_r \subset \mathbb{R}$ of size $\mathcal{c}$ such that $f(Y_r) \neq \mathbb{R}$.
Now let $f_1, f_2,..$ be an arbitrary sequence of functions from $\mathbb{R}$ to $\mathbb{R}$. By our claim there is a set $A_1$ of continuum size such that $f(A_1) \neq \mathbb{R}$. Then using our claim again there exists an $A_2 \subset A_1$ such that $f_2(A_2) \neq \mathbb{R}$, and an $A_3 \subset A_2$ and so on.
Thus if $f_1,...,f_n$ are real valued functions, then there is a set $A$ of continuum size such that $f_i (A) \neq \mathbb{R}$ for each $i \le n$.
Comment: I don't understand the last paragraph. What if each $A_n$ happens to be set of all those reals larger than $n$?
Comment: I am sorry and you are right. So please forget my incorrect answer.
Comment: It still proves the claim that a finite collection of functions can't satisfy the criteria so I think you should edit your post to emphasize that


how to control all shop lights from one motion sensor shop light

Question: So I recently replace a big 8 ft CCFL shop light with 3 smaller 4 ft shop lights.  1 has a motion sensor built in.  My thought when I bought them was to install the motion sensor might above the garage door, wire the hot and neutral coming from the switch to the motion sensor and then use the 2 prong outlet built into each light to connect the other two in series to each other.  Then I leave the switch on and all the lights come on when the motion sensor trips and turns off after the time out time.  In practice with the switch on the 2 normal shop lights stay on all the time and the motion sensor turns on and off as expected.   Here is the model shop light I'm using https://www.costco.com/Feit-4-ft.-Linkable-LED-Utility-Motion-Sensor-Shop-Lights,-2-pack.product.100415188.html
Comment: Hello, and welcome to Home Improvement. Unfortunately, the fixtures are probably functioning as designed, and there's not much we could suggest that would help.
Answer: Code requires that you use every device according to its labeling and instructions (because the testing behind the UL listing didn't test it any further than that).  So your first stop is back to the labeling and instructions on the lamp, and see what it says about using the receptacle to control other lights via the motion sensor.
Knowing Feit Electric, I suspect it does not permit that use, and the motion sensor does not switch the receptacle, and it is there to serve general loads like drills or trouble lights.   Or, their vision for this product is that you simply enable all the motion sensors and allow each light to decide independently.
I am no great fan of Feit's reliability and would not miss an opportunity to return a Feit to the store and get something quality. Generally everything electrical at CostCo is the pinnacle of Cheese junk.
If you really want to do motion sensor for the whole garage, they (not CostCo) sell individual "stalk" motion sensors, that screw into a junction box cover.  If you use the type which has a neutral wire, you can have 2 or more motion sensors for better coverage.  From those you power your lights.
Comment: Thanks for the answer. I suspect the way I'll have to do this is to tear apart the motion sensor light and change how it feed power to the chained outlet it has.
Comment: @AdamAbel that's not allowed for a variety of reasons.  Not least, the motion sensor may not be rated for that much power, these things are built cheap. Also if these are integral LED lights, it is almost assuredly the case that the motion sensor is not 120V *at all*, and is on the LVDC side of the power supply. Most you could hope for is to hork in a relay, which would be better.


How do double-buffers work in opengl?

Question: As I understand, the back-buffer is used for rendering the image while the front-buffer is drawn on the screen. So if you have only one image to be drawn on the screen, then you only need to swap the buffers one time because in the second swap the image is already drawn and there is no point to draw the same image again. However, when I tried to swap buffers no more than 2 times the graphics slow down a lot and move the window from one position to another takes 10-20 seconds. My question is... Why?
How double-buffers works then?
Answer: Yes, the back buffer is for the GPU to write the frame that's in-progress, while the display controller sends the front buffer to the attached display. Swapping buffers doesn't really copy anything these days. The display controller has a register which tells it the address of the frame buffer to display. Swapping buffers simply puts the address of the old back buffer in this register, making it the front buffer. You should only swap buffers when the frame is complete (i.e. you've finished drawing all the objects) and you want it to be displayed. This frame will continue to be displayed until you swap buffers again.
In some configurations (e.g. in EGL it depends on what swap interval you set) swapping buffers will make the CPU wait (block) until the GPU has finished rendering that frame. In others, the CPU can continue to queue up draw calls for further frames.
Comment: "*Swapping buffers doesn't really copy anything these days.*" I wouldn't be too sure. Lots of implementations swap via copy, especially if your application is windowed.
Comment: @NicolBolas Well OK, if you're going into a compositor, there will probably be a copy *somewhere* along the line. I was more thinking of the case where the output is going into the display controller directly. My point is that OP was thinking that each `eglSwapBuffers` or equivalent is pausing while it copies a bunch of data, but the problem is something completely different.
Comment: You only explained what I already knew.
My question is, Why does my screen slow when I do not swap the buffers?
Comment: Lol I tried my code again and now it doesn't slow down the screen. Anyway, thanks for all.

How do double-buffers work in opengl?


Hume's problem of induction

Question: Hume argued that assuming A causes B isn't the same as arriving at a truth of logic. However, even though Hume cautioned the "the mental habit" of induction should be used carefully he still believed it could be useful and didn't deny causation outright. In other words, I can't conclude A causes B like I can say there are no round squares, but Hume denied such a thing as an uncaused cause and accepted that things are causally determined. Therefore I can say the sun will rise tomorrow if I correctly understand the causes of sunrises and that those causes occurred. Am I understanding this correctly?
Answer: The problem of induction is our tendency to project past observations onto current or future situations without the use of reason. We do it out of custom/habit, and because the inductive evidence is so strong we can rely on it for our daily lives.
Hume says you can say the sun will rise tomorrow simply because you have experiential knowledge of it rising, a posteriori. You do not need to know any related causes, only that this has occurred before, so you have reason to expect it to happen again.
Knowing the sun will rise tomorrow is not a cause/effect relationship outside of your own collected experiences. It's one of Hume's matters of fact formed from a habit of expectation and an association of your own ideas (day and night, the time on your clock, etc).
If you wanted to substantiate your claim that the sun will rise tomorrow, you could cite other causes, yes. They would not avoid the problem of induction, though, because they are still experiential in nature, which leads to circularity.
There are some pretty good responses in another SE thread about solving the problem of induction that go into more depth with non-Hume resources.
Main source: Hume's Enquiry Concerning Human Understanding, Sections 4 & 5
Comment: Thank you. But Hume didn't deny causation altogether, right? We see the constant conjunction of events and assume A causes B, but it's still possible A does actually cause B. It can't be rationally proven like 2+2=4 which must follow logically and science may only say A causes B until proven otherwise. With that said, a major point of determinism is that all things are causally linked (there are no uncaused causes) and Hume was a soft determinist. Correct?
Comment: Absolutely, yes. Hume was a soft determinist and did not deny causation. There are no uncaused causes, just a circular link of unproven and unprovable a posteriori observations. Note that Hume might even say science can't prove A causes B, it merely comes up with more distinct cause/effect relationships.
Answer: Hume denies the validity of the Principle of Sufficient Reason (PSR), and, as I see it, he effectively denies all cause and effect. In A Treatise of Human Nature, he considers several arguments in PSR's support, including those from Thomas Hobbes and John Locke (THN, I, 3, 3). Although this principle is said to be "impossible for men in their hearts really to doubt", Hume finds "no mark of any such intuitive certainty" (THN, I, 3, 3).

[A]s all distinct ideas are separable from each other, and as the
  ideas of cause and effect are evidently distinct, it will be easy for
  us to conceive any object to be non-existent this moment, and existent
  the next, without conjoining to it the distinct idea of a cause or
  productive principle. (THN, I, 3, 3)

It is hard to see what might be left of causation after such a statement. The idea that an object can exist one moment and be non-existent the next, without any reason, destroys any possibility of continuity, so long as there is some discontinuous result that may be conceived.
Comment: I'm not sure about this. Hume's argument was that it's impossible to prove A causes B but not that B can be an uncaused cause or denying causation altogether. Everything we know about how A causes B is based on experience and could be falsified, unlike the logical conclusion that all bachelors are unmarried men which is true by definition. In fact, Hume argued determinism was essential to free will because without it (determinism) our actions would be purely random and not the result of our enduring character traits (previous causes/effects).
Answer: The point isn't 'solving' the problem of induction, it is recognising limits on the certainty of our knowledge. Arguably doing that, is one of the unique hallmarks of science. https://scienceornot.net/2012/02/07/all-scientific-models-are-tentative/
Quantum mechanics is a great illustration of this. Causality has been abandoned at a fundamental level, for a probability based pattern-like correlation. https://scienceornot.net/2012/02/07/all-scientific-models-are-tentative/
The pattern-based (rather than fundamental)  nature of causality at a macro-scale has been obscured by the interlocking and cross-correlation of relatively complex macro-scale systems.

Hume's problem of induction


Xposed Framework removed after manual CM update?

Question: I'm currently running the official nightly of cm12.1 on my LG G3 AT&T (model d850) with the Xposed Framework installed. However, every time I manual update Cyanogenmod (as I don't have a compatible recovery for automatic installation), the Xposed Framework gets removed/disabled, forcing me to locate the downloaded framework zip file (xposed manual installation because of reasons). This is not really a big issue for me and doesn't greatly affect myself or my phone in anyway but it will be glad if someone has found a 'possible' solution for this minor bug
Comment: Pretty sure updating destroys the system partition, which Xposed is installed to. Could be wrong though.
Comment: Yeah I was thinking that too... At one point I thought the updates would just overwrite files not folders (referring to /system), unless the xposed framework modifies system files (e.g. build.prop). But idk tho...
Comment: You need to check the updater script in one of the zip files.
Comment: @jeffery-lin ah yes I found a function called 'install_overwrite'. So um...yup. That's enough said....but thanks btw!
Comment: You can add this as an answer to help others that may stumble upon this question in the future.
Answer: Ok so this isn't a bug but in the updater script of the xposed framework, a function called install_overwrite is called upon several occasion and, hence the name overwrite, will replace pre-existing file in the /system folder. So in order to install the xposed framework, it's necessary to reinstall it with each update.
Comment: That's true – as Xposed replaces a part of the system's framework (one file) to "hook in and expose its interfaces" (hence the name), which an OS update again would overwrite – effectively disabling Xposed.
Answer: This script will automatically reinstall Xposed after dirty-flashing a ROM (i.e. flashing it without wiping userdata). The linked post includes instructions to download and how to install it, and describes how it works.
https://www.reddit.com/r/xposed/comments/3u2xw9/release_xposed_addond_backup_scripts_it_keeps/
Try to search "xposed script after updating cyanogenmod" with your search engine
Comment: Welcome to Android Enthusiasts! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. Otherwise, your answer becomes useless in case the link dies. For further hints, please see: [How do I write a good answer](http://android.stackexchange.com/help/how-to-answer).


How can I get over the fear of being recorded in music?

Question: I've started playing the violin about 2 years ago, and I have to admit I have no confidence in my playing at all. Whenever I practise alone, I always feel terrible after and yet when I practise with others I always feel fine. I have a GCSE recording soon and i'm so scared i'll mess it up. Can someone give me advice?
Comment: Why are you afraid exactly? Yoy doubt your skills or are afraid of being treated badly? Or maybe you are scared of not being able to play correctly?
Answer: Play something on which you have confidence that no one can play better than you.
You will see the difference.
Answer: This is one of those 'just do it' things.  Just do it.  The more you analyse, the more you'll suffer.  If you want to do it, do it.  If you don't, don't.  The world won't care.  It has too many violin players already!


Guice to Spring Dependency Injection

Question: I have a project where we are using Guice for DI on the backend layers, and Spring MVC for UI. Now I am looking to do dependency injection of Backend objects initialized with Guice into my Controllers, using Spring. Am thinking of exposing the backend objects through services, but is there an easier way? Some frameworks for doing something like this maybe??
Answer: Is this, guice-with-a-spring-twist, what you are trying to achieve?
Another possibility is the Guice based MVC library Lime MVC, but it may not be production ready.

Guice to Spring Dependency Injection


Will perfect black hole apply force on matter?

Question: While standing on a planet its gravitation force is noticeable and manifests only through the normal force, e.g. if jupiter had rocky surface, standing on the surface will apply about 2.5 times more force than when standing on earth. However sky diving on earth and on jupiter (without atmosphere) would apply the same amount of "destructive" force, that is 0. Thus gravitation force cannot really destruct matter without something for the matter to interact with.
If a black hole with no matter falling into it exists, will a person with space suite die if he would "jump" into it? he will have nothing applying "destructive" force on it, just kinetic energy that cannot manifest without something to hit.
Answer: We can be sure you will die because of tidal forces. Assume you are falling towards the black hole feet first, then your feet are closer to the singularity so accelerate faster than your head. As you approach the singularity the difference gets so great it will tear you apart.
Also your left and right sides are accelerating towards a single point (the singularity) so they are accelerating along paths that converge. That means your left and right sides are being pushed together, so as you get near to the singularity you'll be squashed sideways as well as being stretched out.
This will always kill you because for any black hole the tidal forces become infinitely strong as you reach the singularity (though quantum gravity probably intervenes before the forces actually become infinite). If it's any comfort, for small black holes the tidal forces only get lethal in the last few milliseconds so you probably wouldn't feel much.
It's relatively easy to calculate what happens to an observer falling into a black hole, and the observer reaches the singularity (and their death) in a finite time. You'll find the calculation in most books on General Relativity. If you're interested I can suggest a couple of fairly accessible books. In General Relativity it isn't possible to say what happens at the singularity because the curvature becomes infinite. Since physicists are reluctant to believe infinities occur in nature, most people believe that General Relativity is only an approximate theory and near the singularity you need to do your calculations with a quantum gravity theory instead. Unfortunately no-one knows what this other theory is.
Answer: I may be thinking a bit too simple here, but doesn't gravity imply collision/contact at some point in time? In other words, what would cause your black hole (which is simply a point with density such that nothing can escape)?
Comment: The single point that is causing the black hole can never be reached because of time dilation. people say that a person that will fall into a black hole will die. my question is why will he die if nothing applies force on him


Ethereum library for iOS/Android?

Question: Are there any existing native libraries (not whole wallets, I do not need a UI but want to sign transactions and call smart contract functions embedded in another app) for iOS or Android? If not, are there efforts currently ongoing or what is the closest I could get right now?
Comment: Related: http://ethereum.stackexchange.com/q/7351/2460
Comment: Did you manage to make an iOs or Android app that interact with ethereum?
Answer: There are some guys who are running geth on Android and iOS. you could find the libs and the apk project. But seriously, you need to wait the light protocol client because it is a bit insane to use a full client (Many Go of storage + so many writes that it will use battery and storage longevity).
Look this:
Android

Ethereum on Android: https://www.reddit.com/r/ethereum/comments/3wx09s/experimental_android_geth_library_archive/
LES (Light client protocol): https://github.com/ethereum/wiki/wiki/Light-client-protocol
Karalabe (one dev of geth): What can I use to interact with the Ethereum network from an Android device?

The geth with LES is in test currently. I have made few benchmarks:

600MB disk storage (4GB of write) vs 4.8GB for fast synch
20min to synchronize vs 21min for fast synch

iOS

Native implementation on Swift of geth functionality: web3swift
Answer: There is Nethereum which is a .Net client for Ethereum.
You can use Xamarin (comes free with VS now) to build Android, iOS and Windows apps through the .Net framework.
Github link - https://github.com/Nethereum/Nethereum
Answer: (Note: I haven't done any mobile development for a while, and certainly none related to Ethereum. The below answer therefore includes a level of conjecture. I don't know of any existing efforts.)
Android apps are (most often) written in Java, so it's plausible that the relevant parts of EthereumJ could be ported with relatively little pain.
It's also been possible to write Android apps in Go since (Go) version 1.4, though I'm unsure how well supported this is. It does, however, raise the possibility of a Geth port, or partial port. Similarly, looking at Go's available mobile packages, it looks like iOS support is also there.
Edit:
Or I could have just Googled... (Thanks Ellis for the prod.)
This entry on the official GitHub repo describes how to perform an Android-Geth port, and references the more general Ethereum cross compilation page. From there, the xgo README has some further details of building mobile libraries.
I can't immediately see any pre-built libraries/images.
Comment: There are some guys who are running geth on Android and iOS. you could find the libs and the apk project.
Answer: web3j now provides a Android release for working with Ethereum nodes. web3j is a lightweight Java library that provides full support for Ethereum's JSON-RPC API and transaction signing.
It also provides generation of smart-contract wrappers for deploying, transacting and calling smart contracts.
You need to run your own client, or use a cloud-based service like Infura to work with it.
As mentioned by Richard, the Geth team also provide a pre-built Android binary now. This is built using gomobile, rather than being a pure Java implementation like web3j.
Comment: That seems like just another wrapper for a full node. Don't see how this can natively sign transactions.
Comment: See documentation at http://docs.web3j.io/transactions.html#offline-transaction-signing

Ethereum library for iOS/Android?


Can a private pilot placard an inoperative instrument?

Question: For certificated small aircraft that are not required to have a minimum equipment list. If you have an instrument break while on a cross country flight and it is not a legally required instrument for the type of flight. You are on the ground at a distant airfield and would like to return to your home-base mechanic rather than hiring an A&P in the middle of the trip.(or if the airport has no local services)
Can the pilot legally label the instrument as inoperative for the duration of the trip without hiring an A&P to officially "deactivate" and placard the item?
Comment: In a practical sense you could simply take off and claim the instrument broke in flight. I just want to know what the "correct" answer is for the bureaucrats, officials, inspectors, oral exam, etc. 91.213 d 3(ii) mentions "if deactivation... involves maintenance, it must be... in accordance with part 43" but to me that is extremely vague, is breaking not deactivation? Does breakage not imply that it will eventually involve maintenance?
Comment: Not sure if it's per regulation, but one training flight we noticed that one of the fuel gauges was stuck (it didn't move even though we were draining from both tanks, we confirmed that after landing). The instructor wrote it up in the aircraft log, notified the maintenance department, and the scheduling department to have it looked at before the next flight. The instrument wasn't fitted with a sticker (whether that's because he didn't have one with him or what I don't know).
Comment: But you were in flight at the time the failure was noticed and landed at your base with the preferred maintenance department. Yes? This is basically the opposite of what my question is about.
Comment: Yes, we noticed in flight that one of the fuel gauges wasn't moving. It was written up, the aircraft continued operating that day, and the next time I went up a week later it'd been fixed.
Answer: The answer to your question is probably. The rule governing this is

§91.213   Inoperative instruments and equipment. (a) Except as provided in paragraph (d) of this section, no person may take off an
  aircraft with inoperative instruments or equipment installed unless
  the following conditions are met:

and if you skip past the MEL section (which, as you noted, doesn't apply to most small general aviation aircraft) you see the conditions that must be met.

(3) The inoperative instruments and equipment are—
(i) Removed from the aircraft, the cockpit control placarded, and the
  maintenance recorded in accordance with §43.9 of this chapter; or
(ii) Deactivated and placarded "Inoperative." If deactivation of the
  inoperative instrument or equipment involves maintenance, it must be
  accomplished and recorded in accordance with part 43 of this chapter;
  and
(4) A determination is made by a pilot, who is certificated and
  appropriately rated under part 61 of this chapter, or by a person, who
  is certificated and appropriately rated to perform maintenance on the
  aircraft, that the inoperative instrument or equipment does not
  constitute a hazard to the aircraft.

Suppose your landing light burns out. A landing light is not required unless you are flying for hire, so you can put a piece of tape under the switch and label it Inoperative and you are good to go.
If your transponder fails, turn it off and mark it Inoperative. If you are going to fly in airspace that requires a transponder, you have to jump through some hoops per §91.215, but you are still good.
If there is something that requires removal or disabling—and it is not something you are allowed to do in Part 43—then you need an A&P to remove or disable it and make a logbook entry. I'm having a hard time thinking of something that would need disabled and yet you could still legally fly the airplane. The best I can come up with right now is a stuck push-to-talk button. That's not listed in Part 43 as something that you can perform maintenance on, so an A&P would have to disable it and make a logbook entry.
By the way, you can fly forever with inoperative equipment. There is a LORAN in plane I fly that has been marked inop since they decommissioned LORAN. When I put a new radio in my plane 10 years ago, I kept the old one in case something happened to the new one, and marked the nav portion inop.
Comment: On further review and [informally] consulting with somebody from the FAA on the interpretation. The key answer is in "(4) A determination is made by a pilot, who is certificated and appropriately rated under part 61 of this chapter..." Basically this gives the pilot very broad authority regarding placarding and the whether their is a need to have an A&P disable the item.
Comment: Don't forget that some equipment listed in the AFM as "required" must be functional for flight, even if it's not listed in 91.215. I seem to remember the C172 "required" a pilot's seat cushion, for example. :-)  Since all that stuff in the AFM is incorporated into the type certificate for the craft, it has to be functional. And of course, there's common sense and safety, regardless of whatever anyone else says.
Comment: @grumpy1arrival If you want to make a flight with inoperative _required_ equipment, it is sometimes possible with a ferry permit. I don't know exactly how that works though.
Comment: Indeed. In the US, a ferry permit can be obtained by contacting the local FSDO. (Just noting this here in case someone stumbles upon this thread someday.) Described here: https://aviation.stackexchange.com/questions/814/how-do-i-obtain-permission-to-fly-an-airplane-that-isnt-airworthy
Answer: For the US, 14 CFR Part 43.3(g) says:
"[T]he holder of a pilot certificate issued under part 61 may perform preventive maintenance on any aircraft owned or operated by that pilot which is not used under part 121, 129, or 135 of this chapter."
Appendix A of Part 43 contains the specific list of things a pilot can do. In general, if it's not on that list, a private pilot without A&P certification cannot perform the task.
At the time of this posting, it reads:

(c) Preventive maintenance. Preventive maintenance is limited to the following work, provided it does not involve complex assembly operations:
(1) Removal, installation, and repair of landing gear tires.
(2) Replacing elastic shock absorber cords on landing gear.
(3) Servicing landing gear shock struts by adding oil, air, or both.
(4) Servicing landing gear wheel bearings, such as cleaning and greasing.
(5) Replacing defective safety wiring or cotter keys.
(6) Lubrication not requiring disassembly other than removal of nonstructural items such as cover plates, cowlings, and fairings.
(7) Making simple fabric patches not requiring rib stitching or the removal of structural parts or control surfaces. In the case of balloons, the making of small fabric repairs to envelopes (as defined in, and in accordance with, the balloon manufacturers' instructions) not requiring load tape repair or replacement.
(8) Replenishing hydraulic fluid in the hydraulic reservoir.
(9) Refinishing decorative coating of fuselage, balloon baskets, wings tail group surfaces (excluding balanced control surfaces), fairings, cowlings, landing gear, cabin, or cockpit interior when removal or disassembly of any primary structure or operating system is not required.
(10) Applying preservative or protective material to components where no disassembly of any primary structure or operating system is involved and where such coating is not prohibited or is not contrary to good practices.
(11) Repairing upholstery and decorative furnishings of the cabin, cockpit, or balloon basket interior when the repairing does not require disassembly of any primary structure or operating system or interfere with an operating system or affect the primary structure of the aircraft.
(12) Making small simple repairs to fairings, nonstructural cover plates, cowlings, and small patches and reinforcements not changing the contour so as to interfere with proper air flow.
(13) Replacing side windows where that work does not interfere with the structure or any operating system such as controls, electrical equipment, etc.
(14) Replacing safety belts.
(15) Replacing seats or seat parts with replacement parts approved for the aircraft, not involving disassembly of any primary structure or operating system.
(16) Trouble shooting and repairing broken circuits in landing light wiring circuits.
(17) Replacing bulbs, reflectors, and lenses of position and landing lights.
(18) Replacing wheels and skis where no weight and balance computation is involved.
(19) Replacing any cowling not requiring removal of the propeller or disconnection of flight controls.
(20) Replacing or cleaning spark plugs and setting of spark plug gap clearance.
(21) Replacing any hose connection except hydraulic connections.
(22) Replacing prefabricated fuel lines.
(23) Cleaning or replacing fuel and oil strainers or filter elements.
(24) Replacing and servicing batteries.
(25) Cleaning of balloon burner pilot and main nozzles in accordance with the balloon manufacturer's instructions.
(26) Replacement or adjustment of nonstructural standard fasteners incidental to operations.
(27) The interchange of balloon baskets and burners on envelopes when the basket or burner is designated as interchangeable in the balloon type certificate data and the baskets and burners are specifically designed for quick removal and installation.
(28) The installations of anti-misfueling devices to reduce the diameter of fuel tank filler openings provided the specific device has been made a part of the aircraft type certificiate data by the aircraft manufacturer, the aircraft manufacturer has provided FAA-approved instructions for installation of the specific device, and installation does not involve the disassembly of the existing tank filler opening.
(29) Removing, checking, and replacing magnetic chip detectors.
(30) The inspection and maintenance tasks prescribed and specifically identified as preventive maintenance in a primary category aircraft type certificate or supplemental type certificate holder's approved special inspection and preventive maintenance program when accomplished on a primary category aircraft provided:

(i) They are performed by the holder of at least a private pilot certificate issued under part 61 who is the registered owner (including co-owners) of the affected aircraft and who holds a certificate of competency for the affected aircraft (1) issued by a school approved under §147.21(e) of this chapter; (2) issued by the holder of the production certificate for that primary category aircraft that has a special training program approved under §21.24 of this subchapter; or (3) issued by another entity that has a course approved by the Administrator; and
(ii) The inspections and maintenance tasks are performed in accordance with instructions contained by the special inspection and preventive maintenance program approved as part of the aircraft's type design or supplemental type design.

(31) Removing and replacing self-contained, front instrument panel-mounted navigation and communication devices that employ tray-mounted connectors that connect the unit when the unit is installed into the instrument panel, (excluding automatic flight control systems, transponders, and microwave frequency distance measuring equipment (DME)). The approved unit must be designed to be readily and repeatedly removed and replaced, and pertinent instructions must be provided. Prior to the unit's intended use, and operational check must be performed in accordance with the applicable sections of part 91 of this chapter.

Don't forget also, of course, that "required" equipment involves not only the Part 91 required items for the type of flight, but also what is written in the AFM, STC documents and any placards that might apply to the intended flight conditions.
Comment: This would be an excellent answer to whether a PPL could repair the broken instrument, but I don't see how it addresses merely adding an "INOP" sticker to said instrument without actually repairing it. Does that even qualify as "maintenance"?
Comment: If the instrument is non-functional, then it deactivated itself and no maintenance is required--just the INOP sticker. If it is malfunctioning, then in some cases you could pull it's breaker to deactivate it, which is also not maintenance. What non-required equipment truly requires "maintenance" to deactivate? For safety reasons, a pilot should be able to shut off anything non-essential in flight, e.g. to reduce battery load if the alternator fails.
Comment: Right, but we already know that we can't *just* placard it... per the FAR, it has to be both marked INOP and "deactivated" (the definition of which is supposedly intentionally vague). So if that is the question, it's definitely "No".
Comment: I suppose this touches my question; changing fuses is maintenance, even vacuuming the interior and washing the windows is maintenance. Where I come from disabling an item is not maintenance. (because the state of the widget is not maintained)
Comment: Keeping in mind my question is completely academic. The practical answer would be formed based on the needs of a specific situation and all the fine details of real life.


What should someone do if he/she didn't pay zakat over 2 or 3 years?

Question: What if someone didn't pay zakat for 2 years. Should he/she consider paying for the 2 years. What are the rules/punishment that he/she will receive from Allah. What does Quran say about those persons?
Jazakum Allah Khayraa
Answer: A person who denies Zakah is considered a disbeliever. First there must be an attempt to correct him. If he insists on his denial, he must be killed for disbelief. However, an allowance must be given to the person who recently converted to Islam on account of his ignorance of its principles. He must be directed until he abides by and acknowledges the giving of Zakah. As for one who though acknowledges the obligation to pay Zakah but abstains from giving it, he only incurs sin without being considered a disbeliever. Rather he should be given a discretionary punishment and forced by the ruler to pay Zakah. If a powerful group of people abstains from paying Zakah though acknowledging its legality, they must be fought until they pay it. This is confirmed by Abu Hurairah's narration that, "When the Messenger of Allah (peace be upon him) deceased and Abu Bakr was appointed Caliph, some Arab tribes became apostates. Umar said to Abu Bakr, "Why would you fight these people while Allah's Messenger (peace be upon him) said: I have been directed to fight against people till they testify that there is no god but Allah. Whoever professes it is granted full protection of his property and life except for a right cause and his (other) affairs rest with Allah?" Upon this Abu Bakr said, 'By Allah, I would definitely fight against those who make a difference between Prayer and Zakah, for it is the obligation upon the rich. By Allah, I would fight against them even if they withheld a cord (used for hobbling the feet of a camel) which they used to give to Allah's Messenger (peace be upon him) (as Zakah).'Umar said, 'Then I became convinced that Abu Bakr was right.'"
Abu Hurairah (may Allah be pleased with him) also reported that Allah's Messenger (peace be upon him) said, "The owner of gold or silver who does not pay the poor due (Zakah) will have a bitter punishment on the Day of Resurrection. Plates of fire will be beaten out for him; these will then be heated in the fire of Hell and his sides, forehead and back will be cauterized with them. Whenever these cool down, (the process will be) repeated throughout a day whose extent will be fifty thousand years until Judgment is pronounced among the servants, and he sees whether his path is to take him to Paradise or to Hell."
Abdullah bin Masud (may Allah be pleased with him) reported Allah's Messenger (peace be upon him) as saying, "There is no owner of property who does not pay Zakah but it (his property) will turn into a bald snake and enclose his neck. (The Prophet, peace be upon him) then recited, 'And let not those who covetously withhold of the gifts which Allah hath given them of His Grace, think that it is good for them: nay, it will be the worse for them; soon shall the things which they covetously withheld be tied to their necks like a twisted collar on the Day of Judgment.'" (Surah Aal `Imran 2:180).
`Ali (may Allah be pleased with him) reported, "Allah's Messenger (peace be upon him) cursed the one who accepts or gives interest, the one who witnesses to it and the one who records it; (and cursed) the female tattooer and the woman who gets herself tattooed; (and also cursed) the one who withholds Sadaqah (Zakah), the Muhallil (the one who marries an irrevocably divorced woman then divorces her with the aim to return to her previous husband) and the Muhallal Lahu (the one who irrevocably divorces his wife and gets her married to another then divorced from another man in order to marry her again."
Answer: Yes, someone should pay your zakat that they didn't pay - asap.
Generally speaking Allah will wait your taubah until you're dead, this is Allah's rahma. Dead can happen anytime, If Allah don't want to give more rahma, Allah won't give someone a chance to repent.
Comment: Why should someone else pay for another? + Isn't it mandatory to provide an authentic evidence/ahadith/quranic verses in your answer?


How can I determine if a typical low-end telescope is a refractor or reflector?

Question: Is there a way to distinguish (with no manual, product info etc)?
Comment: a refractor will have a thick glass lens in front and will tend to taper down to an eyepiece at the other end, whereas a reflector will either be open in the front, or have a thin glass corrector plate. A reflector will be heavier in the back because of the mirror. If you can add any additional information (a name, a photo, some dimensions (diameter, length) or other details) that might really help!  **update:** Oh! there's an answer already!
Answer: There is a wide variety of telescopes, so it's a bit difficult to give a general answer, but here are some pointers:
If there is an open-end, it likely is a reflector telescope (perhaps a Newton). In this case, you can see the secondary mirror attached inside.
When you look through the place where you set the eyepiece, are you facing the same direction as the telescope? If not, it is a reflector.
Look into the part that you would normally point towards what you are trying to observe. If you can see a mirror at the opposite end, it is a reflector.
On certain reflectors, there is a lens on the side that you point towards what you want to observe. In this case, there also is a smaller mirror attached to the inside of this lens. You can't see the reflective part of this smaller mirror, but there should be a couple of screws on the back, that can be used to align the mirror with the rest of the telescope.
On a refractor, the part that you point towards what you want to observe is a lens that should have a rather round surface (as opposed to flat). This lens usually is not at the end of the tube, but rather there is a part to protect from stray light.
It the tube tapers a bit, it most likely is a refractor.


HoHoHo! Winter Bash 2016 is here!

Question: The end of the year is upon us, and here in Stack Land, that can only mean one thing: it's time for Winter Bash 2016!
Event Overview
Winter Bash is a fun, lighthearted event we run every year as a way of celebrating the many amazing people who make our communities awesome. It's open to any Stack Exchange site that chooses to participate.
During Winter Bash, users earn virtual hats by completing certain tasks. They're sort of like badges, but they're more visible and less permanent. Hats can be "worn" on users' avatars just about anywhere avatars show up on the network.
In 2012, 2013 and 2014 we asked our community if we're up to hats... as the overall participation has been positive. In 2015 we accepted the participation straight away, and in 2016 we believe the community will also embrace it, but we'd like to hear from you - would you like to participate? Would you have any problems with the fancy hats?
The Details

This year's event will start on 19 December 2016 and run up to and including 08 January 2017. Users will be able to see all the hats they've earned on http://winterbash2016.stackexchange.com. That site will also have an FAQ to explain how things work.
Individual users who don't want to participate, don't want to see hats, and/or are generally anti-hat will have an "I hate hats" option available. And just like last time, at the end of the event, all hats will go back into storage.
The only visual change to the Stack Exchange sites themselves will be the presence of the hats and the "I hate hats" button in the footer.

Hats in 2014 http://sstatic.net/stackexchange/Img/promos/winter-bash-2014/2.jpg

Nevertheless, if there's any strong reason the community is not up to it - let's say Grinch is very influential this year around PM.SE - then please let us know. Otherwise, let it snow!
Answer: Yes, Project Management would like hats!

HoHoHo! Winter Bash 2016 is here!


What is better for wireframing: Photoshop or Illustrator? Why?

Question: I have come across a lot of websites and forums talking about creating PSD wireframes which are later used by UI engineers to build the front end. I always thought Illustrator was more suited for wireframing.
Comment: See http://ux.stackexchange.com/questions/4352/what-tools-ideally-affordable-ones-would-folks-recommend-for-creating-a-website and http://ux.stackexchange.com/questions/831/which-prototyping-tools for existing wireframe questions
Answer: While illustrator has cleaner lines and may create fine looking wireframes you will not be able to quickly move into designing the UI. But more importantly you should use what ever you can ideate and prototype with quicker and easier. Thats the most important.
Comment: Photoshop versus Illustrator for web design is such a stupid arguement perpetuated by lack of knowledge. Photoshop is great for editing photos. For web design it's extremely limited. Illustrator is great for creating vector art. For web design, it's also limited.  That said, I have 5 years experience with Illustrator (and a similar amount of experience with Photoshop) and find it much easier to create layouts in Illustrator, purely because you can move from wireframes to proper UI design easily - read this http://www.smashingmagazine.com/2011/01/17/productive-web-design-with-adobe-illustrator/
Comment: Why do you say one can move easily into designing the UI in Photoshop? Are you specifically talking about the visual elements?
Comment: Yes, specifically the visual elements can be freely modified and styled. In Illustrator those stylings can be limited.
Comment: Admittedly, previous versions of Illustrator haven't been as nice for pixel precision, but Photoshop plainly sucks for resizing things and having a fluid workflow - because it's not designed for this type of work.
Comment: +1 for whichever allows you to work quickly and iterate faster. That's the whole point of wireframing.
Comment: Illustrator is a great tool for web design. I disagree that it is difficult to move into the UI design phase after wire framing in illustrator. If anything it is potentially easier if you understand the tool.
Answer: You should try FireWorks, its best of both worlds Photoshop & Illustrator with little compromises, it is build for Web development.
Here is my flow
Paper Sketch >> FireWorks >> HTML
Don't complicate your building process, keep it light as much as possible till you hit the HTMLs. Fireworks lets you have different states, Master Page, better slice tools. The whole project can be done on one file.
Comment: If only Adobe would treat FW as a first-class citizen.  I don't think there has been a substantial improvement made since about 2002.
Answer: ...It depends. If I had to choose between the two, I'd probably recommend whichever tool you knew best, just so you could prototype quickly and hassle-free.
But in certain contexts, a 'realistic' wireframe built by image editor is unsuitable anyway. If you just want to discuss workflows or broad concepts, the extra text and buttons of the real UI could be a distraction. This is especially true if you're speaking to clients, who have (from what I've seen) a bad habit of confusing the prototype with a nearly-released real thing, and get easily sidetracked talking about the trivia ("Ooh, but don't write the label like that...").
Now, you could just be using PS to create an 'abstract' mock-up, but then, why not use a tool like Balsamiq or Mockingbird?
As I said, it depends. I'd really need to know more about your circumstances.
Comment: "Whatever you know best" is probably the way most people do it. If you're used to Photoshop it's going to be quicker even if you have to redo everything from scratch then it will be to learn Illustrator, and vice-versa.
Comment: +1 for Balsamiq. Great tool that lets you concentrate on the UI rather than the details.
Answer: I'm UXD at Adobe.
Johnathan Shariat is correct, go with whatever is quickest and stay tool agnostic when possible. I would especially encourage sketching or balsamic mockups in order to produce less polished looking wireframes.
The sketchier it is, the more the focus stays on the core concepts and content as opposed to getting entangled in the details or look and feel.
As for our team;
Mostly we use illustrator and omnigraffle for wireframes (with Fireworks and InDesign being used but slightly less common) We also mostly use illustrator for visual design and screen designs  / final UI components. Since it's extremely easy to go from wireframe to pixel perfect and reuse components.
It's not ideal, but it most cases it beats the crap out of Photoshop workflow.
Whoever said photoshop was not good for wireframe --> polished screen design should really omit that detail from the answer, it's entirely misleading.
Comment: Great input, an excellent unbiased answer.
Answer: Its pretty simple to answer this question very accurately. There is a continuum that each stage sits on, and it has a relevant 'best' software package to use.
Conceptual > structural > prototype > actual UI
depending where you are in this process dictates what you use. A few of the commenters speak about easy of jumping into the final UI, but you may only consider this a plus if you are very close to the end of the process.
Here are the corresponding software packages (which follow a similar number of stages but are more fluid.
Illustrator > Balsamiq/Mockingbird/Visio etc > Photoshop
[Conceptual > structural > prototype > actual UI]
I have ordered the software to align to the function that they can complete the quickest, and most efficiently. Of course you could use Photoshop for designing the structure, but why do yo need all that visual, power, and little organizing power at that stage?
Comment: You can use Illustrator or Photoshop for all of stages you listed. Just because you use Photoshop, it doesn't mean you're implementing the final graphical designs with it. Balsamiq is a much better tool for conceptual/wireframe design.
Answer: I switched from Photoshop and Illustrator to Balsamiq more than 3 years ago and have never looked back.
It's impossible for me to imagine a more efficient way to create wireframes.
I tried Fireworks and Omnigraffle as well, but Balsamiq is the best.
Answer: In general we use,
Photoshop for, Photo enhancement , Photo color correction ,Software/Web/Mobile UI design. most of our designers is familiar with Photoshop.
Comment: See my comment @jonshariat. Photoshop is only used for software/mobile/web ui design because that's what people are familiar with, or because they've been told it's the best. In reality, Photoshop is not notably superior to Illustrator in any way for this type of work, and is inferior in many cases. Fireworks is useful too, as is InDesign. Making broad sweeping statements like you have are bad, and lead people to using Photoshop for tasks where it's workflow may not be optimal and another program might be better equipped.
Comment: you are right @djlumley, i have change my answer.
Comment: I do agree with you about colour correction and photo enhancement though, Photoshop is really the best program for that sort of thing :)
Answer: I've used Illustrator, Photoshop and Omnigraffle for wireframing. However recently I came across using keynote for wireframing. In keynote you can have click states and animations that resemble what the user will experience.
Here are a few sites that have info and templates if you are interested.
http://keynotopia.com/themes/
http://keynotekungfu.com/
You should also check out Axure for interactive wireframing
http://www.axure.com/
Answer: I guess it depends on the requirements and skills of your organisation. My personal experience would be neither. I would use a tool specifically designed for wireframing/prototyping.
Omingraffle/Axure are popular desktop based solutions. Focussing more on prototyping than just wireframing but are pretty powerful. Personally I find the learning curve a little high for Axure when used for anything but basic click through wireframes.
Visio is a good starting point if all you require is static wireframes. It has a decent enough templating engine built in.
Personally I find the ability to rapidly iterate wireframes/prototypes useful and would go for a web based tool such as: Hotgloo/Balsamiq/Gliffy/mockingbird.
Moving away from wireframes and towards prototyping: If you need richer functionality and have the skills I would consider using a framework such as Bootstrap to develop a HTML/CSS/Javascript prototype.


How Can I Tell the Day of the Week of a Date?

Question: I'd like to build in some logic based on the weekday (e.g. Monday, Tuesday, Wednesday) of a given date.  How can I identify the date, using either formulas or Apex code?
Answer: Formulas
There isn't a built-in function to do this for you, but you... UPDATE: As of Spring 2018, there's a built-in function for this: WEEKDAY().  It returns an integer where 1 is Sunday, 2 is Monday, 3 is Tuesday, etc.
Apex Code
You could do the same thing with time deltas, but you can also use the poorly documented DateTime.format() function:
// Cast the Date variable into a DateTime
DateTime myDateTime = (DateTime) myDate;
String dayOfWeek = myDateTime.format('E');
// dayOfWeek is Sun, Mon, Tue, etc.

Comment: I know this is an old thread, but myDateTime.format('u') may be a better option -- it returns "Day number of week (1 = Monday, ..., 7 = Sunday)". According to the documentation. format() uses the locale of the current user, so I wouldn't want to bank on .format() always returning english words for days (if it does now, that may be "fixed" in the future).
Comment: One word of caution re casting the date to a datetime - you can end up on the wrong day and begin to question your sanity...you are better off doing a new instance and setting the time - see here for more details: http://salesforce.stackexchange.com/questions/117163/datetime-day-returning-inconsistent-value#117163
Comment: Re: Apex Code method: Will that always use the English abbreviations (Mon, Tue, Wed, etc.), or is it localized?  If localized, you wouldn't want to try converting the String to a number, or assume that a date is a weekend if it's "Sat" or "Sun".  In that case, an Apex version of the formula is a safer method.
Comment: +1 from me too, you have no idea how many times I had to tell my colleagues that `Date.toStartOfWeek()` gives Sunday for all these weird users with en_US locale ;) @tomlogic - yes, guaranteed to be always English.
Comment: ditto @MikeChale, +1 for Datetime.format()
Comment: Please note that casting a `Date` to a `Datetime` may introduce off-by-one errors due to time zone issues.
Answer: Another alternative that avoids the pitfalls of format() returning locale specific values is to use the daysBetween() function between a known date and the comparison. (This is the apex equivalent to your formula)
For example the 1st Jan 1900 is a Monday, so the following code will give you the day of the week index with Monday being 0.
Math.mod(monday.daysBetween(dateValue), 7)

It is important to note that this will only work for days greater than the fixed date, the below assertions show this (the last assertion fails)
Date monday = Date.newInstance(1900, 1, 1);

Date wednesday = Date.newInstance(2012, 11, 14);
Date thursday = Date.newInstance(1900, 1, 4);
Date sunday7 = Date.newInstance(1900, 1, 7);

System.assertEquals(2, Math.mod(monday.daysBetween(wednesday), 7));
System.assertEquals(3, Math.mod(monday.daysBetween(thursday), 7));
System.assertEquals(6, Math.mod(monday.daysBetween(sunday7), 7));

//Date before the fixed monday, result is -3
System.assertEquals(4, Math.mod(sunday.daysBetween(Date.newInstance(1899, 12, 28)), 7));

Comment: @devilpreet Yes, since there is no time component, 1st Jan 1900 in Hawaii is just like 1st Jan 1900 in Australia.
Comment: Great solution to the this! Going to be handy knowing 1st Jan 1900 is a Monday!
Comment: This is great! Since Apex has Date and DateTime as different type. Would this be true for all timezones that 1st Jan 1990 is Monday?
Comment: Hello. The code is great. The monday should be changed to known sunday = Date.newInstance(1900, 1, 7);   - as from salesforce docs  https://blog.bessereau.eu/assets/pdfs/formula_date_time_tipsheet.pdf
Answer: Since Apex uses Java's SimpleDateFormat, you can get the full name of the day of the week.
Date d = System.today();
Datetime dt = (DateTime)d;
String dayOfWeek = dt.format('EEEE'); //This returns - Monday, Tuesday, Wednesday, etc..

Basically the same apex code as @Benj provided except the format part.
For a full list of supported formats, check [SimpleDateFormat Class][1]
Be careful when using format method as it converts to the local time zone of the context user, consider using formatGmt or format(dateFormat, timezone) if dealing with different timezones. For more information on this check [Apex Datetime Methods][2]
[1]: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html  [2]: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_datetime.htm
Comment: Your `SimpleDateFormat` link is a 404
Comment: This can provide misleading results in some cases.  Getting the date (without the time) and then converting to a datetime puts into GMT time.  Depending on your location and the time of day you run this, you can actually get the wrong day of the week.

Better to get the DateTime directly using System.now() and use that to get day of the week.
Answer: For SOQL queries, you can use the DAY_IN_WEEK() Date Function.
Answer: For reference, an Apex code version of the modular division approach is:
public static Integer dayOfWeekNumber(Date aDate) {
    return Math.mod(Date.newInstance(1900, 1, 7).daysBetween(aDate),7);
}

Sun = 0, Sat = 6
Comment: For what it's worth, formula syntax (not Apex) has now gained a WEEKDAY function. http://releasenotes.docs.salesforce.com/en-us/spring18/release-notes/rn_forcecom_field_formula_functions.htm#rn_forcecom_field_formula_functions
Answer: I know all the answers are correct and enough, but I wanted to know this is also the way you can calculate the day of week. Day number of week (1 = Monday, ..., 7 = Sunday) for Date or Time Component. Please refer this : https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for more info.
Date d = System.today();
Datetime dt = (DateTime)d;
String dayOfWeek = dt.format('u');
System.debug('~~~~~~~~~ ::'+dayOfWeek);

Answer: Other than the modular division method, the most reliable and brief solution is this:
DateTime dt = DateTime.newInstance(myDate, Time.newInstance(0,0,0,0));
String dayOfWeek = dt.format('u');

This assigns the numeric day of the week in String form (1=Monday, 2=Tuesday, ... , 7=Sunday) to dayOfWeek. If you simply cast to DateTime, the time zone adjustment will reach out and bite you.
Answer: Simplified everything for myself from the examples below, maybe you will come in handy :)
public static Integer getWeekdayNumberFromDate(Date fromDate) {
    return Integer.valueOf(((Datetime) fromDate).format('u'));
}


Use wavelet transform to extract a waveform of certain frequency

Question: how to apply wavelet transform method to extract alpha waveform( higher and lower band frequency known) from a given known signal ?
Comment: As the auto-generated closure message says, your question is very ill-posed --- it's not clear what you're asking. Why ask about wavelets when you also ask about a certain frequency? Surely the Fourier transform (or a variant) would be better equipped than the wavelet transform for that sort of problem? Can you explain what you mean or what you are trying to achieve? More details might give a better question and, therefore, better answers.
Comment: I dont think what is being asked is vague. It asks how to Alpha waves (neural oscillations in the frequency range of 7.5–12.5 Hz[1] arising from synchronous and coherent (in phase or constructive) electrical activity of thalamic pacemaker cells in humans. They are also called Berger's wave in memory of the founder of EEG). Possibly rewording of the question is necesary
Answer: The mother wavelet is a bandpass filter. This means we have to apply the CWT(in this case), calculate the correspondence between scales and frequencies, zero out everything outside the known frequency band for the alpha wave and invert the transform.
data = Import["your_sample_eeg_data"];

ListLinePlot[data]

cwd = ContinuousWaveletTransform[data, MorletWavelet[], SampleRate -> 200, Padding -> 0]

freq = (cwd["SampleRate"]/(#1 cwd["Wavelet"]["FourierFactor"])) & /@
   (Thread[{Range[cwd["Octaves"]], 1}] /. cwd["Scales"]);

ticks = Transpose[{Range[Length[freq]], freq}];

WaveletScalogram[cwd, Frame -> True, FrameTicks -> {{ticks, Automatic}, Automatic},
 FrameLabel -> {"Time", "Frequency(Hz)"}, ColorFunction -> "SunsetColors", ImageSize -> 500]

So, we are interested in the 5th octave(the region between 10.51 and 5.25, of course, roughly speaking)
mwd = WaveletMapIndexed[#1 0 &, cwd, Except[{5, _}]]

WaveletScalogram[mwd, ColorFunction -> "SunsetColors"]

It's like performing a brain surgery with a chainsaw ;__;
ListLinePlot[InverseContinuousWaveletTransform[mwd]]

Those are the basic steps I would perform if I have to extract a signal within a certain frequency band.
Answer: Beyond the good response of -sector-
You can use applying the prior results of a succession wavelet decompositions of a discrete Wavelet applying only one level decomposition for a haar wavelet as to segment frequencies for both Detail and Scaling coefficients. You keep on applying this until the desired range. You would need to calculate the equivalent frequency range in herts for each segmented part.
Beyond wavelets you can use mutitaper for a weak sense stationary time series (you make the series stationary of second order by any methods suitable depending on the signal - Loess regresión to remove MA, removal of existing AR terms or diferenciation which ever or combination of them provides second order stationarity to the series and then test for stationarity with time frequency stationarity tests).
Then you use multitaper to extract the spectrum of frequencies then using a white noise F test determine the relevant frequencies position in the frequency spectrum and then using this construct a band pass filter for the frequencies you want removed, effectively reconstructingt the signal desired frequency range.
See the multitaper package in R
One caveat is that it is posible that important information on the signal is eliminated by the process of making the series second order stationary. One way to minimize this is to partition the data by segmenting the data in similar variance segments. So in obtaining the second order stationarity of a similar variance segment less of the signal is eliminated in making the series second order stationarity.
Alpha waves are similar to an AR process or low MA process so the requirement of weak sense stationarity may eliminate them from the signal.


Can you sued for libel for telling the truth in negative advertisement?

Question: In the event of a lawsuit against a previous employer for non payment. And the evidence against them includes notarized statements from previous employees with statements towards the owner refusal to pay them. If you took them to court, and they were found guilty. Can you be sued for libel, if you put out advertisements that portray the owner/company in a negative view even though you weren't lying?
Answer: In general, one defense against libel is to prove that your statements are true.
If your employer sues you for libel, and you do not dispute that you ran the ads, you would need to prove that your claims are true. You may personally be sure that your claims are not in fact libelous (because you know they are true), but the relevant concern here is whether you can prove that your claims are not libelous in a court of law.
If your employer sues you for libel, you have the advantage that your have already organized a substantial defense. You could use the same evidence from your nonpayment case as you do in the libel case against you, which makes it substantially easier to handle the libel suit. If it held up in court during the nonpayment case, it may do well in the libel suit as well. Of course, if you do not win your nonpayment suit, then that does not speak well about the ability of your evidence to hold up in court.
Even if you do win, however, take care that the scope of your claims does not exceed what you can actually prove: if you have 10 verifiable witness statements from people defrauded by your manager, but you claim in your ad that he defrauded hundreds of people, then obviously your available evidence does not go very far in defending against the libel charge. Those ten witnesses may be enough for you to win your nonpayment case, but not necessarily enough to defend you against libel, depending on your exact statements.
As another answer already notes, stealing is quite different from nonpayment: the former implies bad-faith intent to permanently deprive you of something, while nonpayment could simply be the result of a poorly run business or unexpected financial setback. If you only have evidence of a history of nonpayment with no evidence about motivation, an accusation of stealing might be difficult to prove.
My guess as a non-lawyer is that a safe statement to make might be, "I have successfully sued Comapny X [or whoever the defendant was] for nonpayment, and included as evidence 10 other accounts of people who suffered a similar fate." Such a statement is an easily verifiable matter of public record.
Comment: FYI in the USA the plaintiff has the burden of proving the statements are false.
Answer: Be careful what you say. Even if it is true that the company did not pay its debts, that proves nothing about the owner and vice versa. Legally they are different people and making the claim about the owner for what the company did is the same as making a claim about me for what my brother did.
Further, not paying debts isn't stealing. Stealing is taking personal property from someone with the intention of permanently depriving them of it. It's possible that a fraud was perpetrated if at the time you were engaged they had no intention of paying you, although this is clearly difficult to prove. If they haven't paid because your work was allegedly defective or they simply don't have the cash, there is no criminality at all.
Comment: You make a good point about the difference between company and owner.
Comment: As well as the technicality of it being considered stealing. Thou, in the event of me winning the case against them in court and I choose my wording better (Maybe thief isn't the best choice). I'm I liable for telling the truth if public ads were shown?


How to get a Component in Tridion using Core Service?

Question: Am new to Tridion Core Service, can someone help me with the sample code to read and get the Component from Tridion using Core Service?
Answer: Welcome to Tridion
Core Service is a .Net web service API, allows you to interact with the CMS from another machine than the CMS server itself and before jumping on writing CURD operation using Tridion Core service I would recommend to you , please go through to SDL documentation and learn about Tridion Core Service ,there you will code snippets as well that will help you in writing CRUD operation using Core service
About Core Service https://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20Sites-v2/GUID-9E83FE0C-F650-451F-BEB3-7960A4925D90
READ operation https://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20Sites-v2/GUID-973CC313-C411-4737-8263-F04D4378331C
Comment: sample code for getting component ?
Answer: You may also want to check out the 'Core Service Recipies' section of the Tridion Cookbook here: https://github.com/TridionPractice/tridion-practice/wiki/CookbookDocumentation
There are some excellent examples in there to get you started.
Answer: You can read all components using the core service client,
<code>static void RetrievingItems(CoreServiceClient client)
{
    var filterdata = new RepositoryItemsFilterData();
    filterdata.Recursive = true;
    filterdata.ItemTypes = new[] { ItemType.Component };

    XElement resultxml = client.GetListXml(_publicationId, filterdata);
    if (resultxml != null)
    {
        foreach (var component in resultxml.Elements())
        {
            var compData = (ComponentData)client.Read(component.Attribute("ID").Value,
                                                      new ReadOptions());
            //Do whatever you want with componnetData
        }
    }
}
</code>


Is the quarterback allowed to make an underhand throw in the NFL?

Question: Is the quarterback allowed to make an underhand throw in the NFL? If so, if the pass is incomplete is the play dead?
Comment: @corsiKa: Not really. Underhanded passes tend to be short and usually happen very quickly after the ball is snapped. So, there's plenty of precedence.
Comment: I believe the technical term for an underhand pass is "intercepted" because that's what's going to happen every freaking time.
Answer: From the NFL rulebook (Rule 8, Section 1, Article 1), the definition of a forward pass is when

(a) the ball initially moves forward (to a point nearer the opponent's goal line) after leaving the passer's
  hand(s); or
  (b) the ball first strikes the ground, a player, an official, or anything else at a point that is nearer the
  opponent's goal line than the point at which the ball leaves the passer's hand(s).

There is no distinction made between overhand, underhand, or sidearm passes and they all follow the same rules..

When a player is in control of the ball and attempting to pass it forward, any intentional forward movement of
  his hand starts a forward pass.

so yes, an incomplete pass would warrant the play being dead.
There are plenty of instances of underhand passes being used in the NFL and other levels of play, usually as a shovel pass (a kind of screen pass), but also sometimes when the quarterback is being dragged down and wants to get rid of the ball as quickly as possible.
Comment: As a follow-up question, what if you are holding the ball in your hand, behind the line of scrimmage, and fumble the ball forward?
Answer: The quarterback may throw the ball in any way he likes as long as he uses his arm(s).  Whatever way he decides to throw the ball - underhand, granny-style, basketball shot-style, in between his legs, whatever - they are all treated exactly the same.
If he throws it underhand forward, that is perfectly legal.  If the receiver drops this the ball it is dead, incomplete pass.
Now let's go ahead and add two other examples that we are seeing a lot now.
1) Can a quarterback throw overhand backwards?  The answer is still the same.  Any ball thrown overhand, underhand or whatever backwards is all the same.  The difference on a backwards pass is that the throw isn't actually a throw, it is treated the same as a hand-off.  Meaning if dropped it is a live ball.  Also for stats purposes if a QB throws the ball backwards 20 yards across the field to a WR, it is not a passing attempt, it is a rush attempt by the WR.  Several times this year in the NFL I have seen scorers count these overhand backwards passes as passing yards/receiving yards and watched them get changed to rush attempts.
2) Some coaches have (IMO) used the passing rules to manipulate fumble risks and passing/receiving stats for their team.  In your basic spread formations you have several variations of motion or jet sweeps.  It has become the trend for the QB to use a pop pass in these cases instead of a hand-off.  The pop pass is simply the QB releasing the ball in the air with two hands right in front of him.  If you actually slow down most pop passes the ball indeed travels backwards but in real time looks to be even or the same.  The reason the ball travels backwards is because as QB receives the ball in a gun formation he is going backwards (even if it is slightly).  So when jet receiver drops this pass/hand-off it is ruled an incompletion.  When he catches it it should be statted as a completion for however many yards the WR gets running.  This allows a QB/WR to rack up stats against "slower" competition while proving no skill set.  (I watched tape on a kid this year with 1200 yards receiving at the high school level - which if you don't know is excellent.  500+ of the yards where on jet sweeps.  Still 700 yards is great and he is a great prospect but very very deceiving.)


Hilbert Syzygy Theorem - Induction step

Question: Does someone know in which books, lecture notes or ... I can find the induction step of the proof of Hilbert Syzygy Theorem? I'd only found the proof for R[x] (e.g. Weibel) and I haven't really an idea how the induction step works. Thank you!
Comment: I added the "commutative algebra" tag.
Answer: I'm not sure exactly which kind of proof you're looking for, but a proof by induction using Gröbner bases is presented in Chapter 15 of Eisenbud's Commutative Algebra, see Corollary 15.11 specifically.
There's also a more abstract homological proof in Chapter 19, see this related question: Best exposition of the Proof of the Hilbert Syzygy Theorem by Eilenberg-Cartan
The first proof is closer in spirit with Hilbert's original proof.
Answer: A proof using Gröbner bases is in Using algebraic geometry by David A. Cox, John B. Little, Donal O'Shea, Theorem 2.1.
However, I was always sure that there should be (at least in the graded case) an inductive proof along the lines of Atiyah-Macdonald's proof of Hilbert--Serre theorem, namely by induction considering the 4-term exact sequence
$$0\to K_i\to M_i\to M_{i+1}\to L_i\to0$$
where $K_n$ and $L_n$ are the kernel and the cokernel for the operator of multiplication by $x_n$ (these are modules over the polynomial ring in $n-1$ variables), but something escapes me at the moment, so I just leave it here as a wish....

Hilbert Syzygy Theorem - Induction step


Is it includes in gunnah/sin to have no knowledge about any matter/work and perform that work on our own desire?

Question: Sometimes, I have no knowledge about any specific work or matter in Islam. Then I perform that work according my own desire. For example, I know the rules of performing wudu. If I don't perform it according that specific rules then It includes in sin and my wudu would not be acceptable. Then if I don't know about any work, their rules/ sharia how to perform them and I perform them on my own then are they included in sin or not?
Answer: Firstly and obviously, you should do your best to find out what is haram, what is halal, and what is best practice in general. Having said that, both the Qur'an (al-Ahzaab 33:5) and Hadith make it clear that if someone does something out of ignorance, or does something incorrectly, but is well intentioned, then it is not a sin, and this includes not doing something that one should be doing. So in a sense, Allah, unlike the laws of the land allows ignorance as an excuse. That's a part of what makes him the most merciful, of course!
Answer: If you know every rule of any work then you are responsible mean it is sin/gunnah if you commit it.And if you don't know the proper rules then you are not included in "Gunnah".
And one thing more you also have to concern with related person's(ULMAA) who know better.


Spiritual elements in a science-fiction novel

Question: Does using unexplained spiritual elements (soul, "spiritual"/non-physical beings, afterlife, God, etc.) in a story with a futuristic setting make it science fantasy rather than science fiction?
Comment: (Who cares? A good story is a good story.)
Comment: @Aerovistae - Then you have succeeded amazingly well. :)
Comment: Nausicaa of the Valley of the Wind, Ghost in the Shell, Lake of the Long Sun (and the series), Star Wars, and Avatar-among others. I rest my case.
Comment: Disclaimer: the above comment was not intended to be useful or helpful.
Comment: If its any help, Amazon allows you to add upto 3(currently, I think) genres to your book. So you can tag it both SF and Fantasy.
Comment: Babylon 5 was able to weld both Religion and SciFi very well.  Religions of Earth were still extant and instead of dying, new ones were created.  The Mimbarin began the Earth-Mimbari war and ended it over the religion and the second episode establishes that souls are real.  Both the Narn and the Centari have religions figures, with the former being more concerned about spiritual matters and the latter seem less so, but still have idols and swear by the god(s) of their faith.  And the Vorlon... well... for those who haven't seen it, that's a thing...
Answer: Is Star Wars fantasy or science fiction? I say fantasy, but they sell it as SF.
So there are stories which meander along the borders. But to categorize your story you should not only ask what it is about. For example it's also important how the story ends.
We are tagging genres to make it easier for the readers to pick what they want. If you sell a romance and it has no happy ending you can really disappoint a whole bunch of readers. A tragedy they wouldn't have picked up.
High Fantasy is often about the eternal fight of Good and Evil. If Evil wins, readers could be disappointed. They don't expect (and probably do not want to read) such an ending when picking up this genre.
When you are in doubt about your genre, ask your test readers. Often their distant point of view can clarify this issue more easily.
Or look at the books you read yourself and ask to which of them your book is most comparable to. Then use the genre of that book.
Comment: How would you categorize [FF: The Spirits Within](http://www.imdb.com/Title?0173840)?
Comment: But apart from that, it's one of these movies where I would flip a coin to decide if it is Fantasy or SF. Or both. That's what the movie does: "Fantasy" in the name and tagged a as SF.
Answer: There are a few ways to answer this. Which answer you use depends on what you want to achieve - something lacking in the original question. Does the work already exist and you're just trying to categorize it? Or are you in the planning stages?
For this answer, I'm assuming that there are deities or other spiritual elements explicitly in your story.
If there are deities:
Deities of any sort are fantasy, and we should all grow up and acknowledge this. This is the prototypical hardline-atheist answer. Your book will be looked at as such.
Deities may seem unlikely, but what if "god" is really just a powerful energy being? Arthur C. Clarke did this, as did Star Trek. It's a way to have gods in your fiction, still have it be science fiction (maybe), and avoid disrespecting religion.
"Pagan" gods are, of course, fantasy. The god I worship is real, so that makes this sci-fi. That would make your book religious fiction. I'm not aware if religious science-fiction exists or not, so you'd either be joining an existing genre or creating a new one.
If there are no deities, but there are spirits or ghosts, that would probably make your book a fantasy, or possibly what's now called a "paranormal" book.
Comment: Boy, that sounds complicated. Is this a philosophical discussion or a genre categorization?
Comment: Just doing my best to answer a vague question in a helpful way.
Comment: I am in the planning stages. It is a mix - the God in the story is like an Omega Point / singularity entity that created the Universe, similar to Asimov's in The Last Question. The story also has agents
 that interfere in human lives like angels, though not anthropomorphic.
Answer: Sometimes, it all comes down to a very precise answer to a very simple question: Are you dealing with magic or advanced abilities that transcend the current human understanding of the universe?
Some people will say that there's no difference between those two things. For such people, it's all fantasy, end of story. However, those people make up a fairly small percentage of the science fiction community.
There has been a long history, in science fiction, of elements that are beyond our current understanding of the laws of the universe. Some are relatively minor (the movie Dreamscape) while some have been quite dramatic (the Q in Star Trek, or the Vorlons in Babylon 5).
On the other hand, there have been stories with magical and religious elements that still had the look and feel of science fiction (Star Wars, and the Warlock of Gramarye books by Christopher Stashef). Some people consider them fantasy, some don't. Does it really matter?
In the end, I think the most important thing is to focus on writing a good story. Let people argue about labeling it once it's been printed.
Answer: I got some basic definitions that more or less are accepted by the majority - the average reader:
fantasy
"the faculty or activity of imagining impossible or improbable things."
"Fantasy Novel is any book that contains unrealistic settings, or magic, often set in a medieval universe, or possibly involving mythical beings or supernatural forms as a primary element of the plot, theme, or setting."
science fiction
"fiction based on imagined future scientific or technological advances and major social or environmental changes, frequently portraying space or time travel and life on other planets."
"Science fiction is a genre of fiction in which the stories often tell about science and technology of the future. It is important to note that science fiction has a relationship with the principles of science—these stories involve partially true- partially fictitious laws or theories of science."
paranormal
"denoting events or phenomena such as telekinesis or clairvoyance that are beyond the scope of normal scientific understanding."
"A ghost story may be any piece of fiction, or drama, that includes a ghost, or simply takes as a premise the possibility of ghosts or characters' belief in them. ... It is a form of supernatural fiction and specifically of weird fiction, and is often a horror story."
Now, combining those looks complicated. You have phenomena beyond the scope of scientific understanding of your sci-fi setting. And you have a specific sci-fi setting because of definition : "...future scientific or technological advances". Plus fantasy that states "Fantasy is any story that contains unrealistic settings".
So you need to merge 1) a scientific future setup with 2) an unrealistic setting and 3) phenomena falling outside the scope of scientific understanding. And all those, scientific + unrealistic + unexplained setups must coexist.
The only viable way to this is different species (different intelligent life forms), unknown to each other and met under unclear circumstances. Different species have different tech levels, different cultures, knowledge methods and motivations. 'alien A' and 'alien B' may both teleport but if their technologies are vastly different (still teleport mass in a standard way) one will see the other as 'ghost' and 'paranormal' as each one understands its own tech thus teleportation is only possible through the known method. 'Alien C' is far more advanced so abilities of this one enter the sphere of impossible for the other 2 species. I cant really think of anything else that could mix those genres.
Still, as already mentioned, readers will categorize subjectively.
Answer: That's a question of definitions that one could debate endlessly. Definitions are invented by people, often indirectly by simply using words with a certain meaning in mind without necessarily spelling out a definition. On subtleties like this, different dictionaries will often have different details to the definition.
So really, I agree with @temporary_user_name's comment: Who cares? Just write a good story.
To actually answer the question: I don't see how referring to God or the soul would of itself make a story not science fiction. If a character in a realistic adventure novel said, "It was a miracle that we escaped", and in context it was apparent that he meant that literally, I don't think that would make this now a "religious story" and not an "adventure story".
Or more to the point, suppose someone wrote a story where a character invents a machine that can detect and measure a soul. I'd think that is practically the essence of science fiction: postulating a new and extraordinary technology and exploring the implications. The fact that the technology overlaps a subject that has historically been thought of as "religious" would to my mind make it, at least potentially, more interesting science fiction, not non-science fiction.
And in real life, genres intersect all the time. I've read science fiction murder mysteries and spy thrillers set in fantasy worlds. Almost any genre can include romance subplots. Etc. To say that a story might have elements of science fiction and also elements of religion is an unremarkable assertion.
Answer: If you look at a large portion of sci-fi there is always a spiritual element to it of some kind or another. Star Wars has the Force; Battlestar Galactica had the Lords of Kobol (and was based of the works of a devout Mormon, who's faith heavily influenced his writitngs), even things like Stargate had various faiths and senses of spirituality interspersed in it. So no, I wouldn't use spirituality to gauge whether a work is a piece of Science Fantasy or Science Fiction.
I would also add that there is a huge difference between religion and spirituality. You can be a spiritual person, without being religious. There is no hard and cut definition of spiritualism. And that, therein, lies part of the problem you are experiencing.
To me there are larger facets to the story that would make the distinction - but that is not what is asked here.
Answer:
Does using unexplained spiritual elements (soul, "spiritual"/non-physical beings, afterlife, God, etc.) in a story with a futuristic setting make it science fantasy rather than science fiction?

If they are treated as real then yes. If we just have a scifi MC that believes in God and souls and ghosts, then no.
I would also classify Star Wars as a Science Fantasy; but Star Trek as science fiction, despite the tendency of many characters in Star Trek to refer to "life essence" or whatnot.
Of course most science fiction takes on fantasy elements. Star Trek uses FTL travel, Time Travel, Transporters, all of which violate the laws of physics as we know them.
But the pretense in Star Trek is that all of this is technology and nothing but. It can coexist with religion, but there is no magic, no ghosts, no God making decisions about what happens next. Even their God-like figures (Q for example) are explicitly alien and using alien technology, Q can be killed.
That is not the pretense in Star Wars; they are explicitly on the spiritual side, an unexplained magical Force that transcends space and can be used only by an elite. The Force is not strong in most people. That they supplement that with technology does not make it science fiction.


Windows Server 2008 Upgrade to R2 with Hyper V

Question: I would like to upgrade two Windows Server 2008 servers to Window Server 2008R2 and would like to know if anyone else has done this and if they ran into any issues.  I am running Hyper V on both of these servers, I dont' know if that complicates things or not.
Comment: We are looking at the same issue.  Does anyone else have more feedback on moving our Hyper-V servers to R2?
Answer: I'm upgrading my Hyper-V/2008 machine tonight.  Only 2 issues that I've had is that I needed to move the page file off of the system drive to allow for enough free space, and I decided to discard my snapshots from my VMs before doing the upgrade.
These KB articles were helpful for me...

http://support.microsoft.com/kb/957256
http://support.microsoft.com/kb/972502
Answer: What kind of services do you use this Win2008 server for? Is it just a virtualization platform? If so, then I would suggest not upgrading but rather deploy R2 on new hardware, test it in a lab and make sure it works as you expect, then migrate the virtual machines from the old box to the new box in a properly staged go-live strategy.
In general, I try and avoid in place OS upgrades for anything other than test machines. It's always better to start from scratch.


How can I find the type of RAM my Dell Inspiron R14 (5420) uses?

Question: I own a Dell Inspiron R14 (5420) laptop (i5 3rd gen). Currently, it has 4GB of RAM installed, but I would like to increase the RAM to 8GB. I don't know how to figure out what the specifications should be for the replacement RAM. How can I find out what type of RAM to purchase for my laptop?
Answer: Googling Inspiron 5420 ram will give you an answer pretty quickly.  Spec for the RAM is DDR3 PC3-12800, DDR3 PC3-10600, DDR3 (non-ECC) SODIMM  - and you will need 2 x 4 GIG sticks.  It might be an idea to have a look at what RAM is currently installed, so you know if you have 1 or 2 sticks and the speed - you may be able to save yourself the cost of 1 stick.  [ You should always try get identical memory though ]
One of the nice things about Dell is their service tags.  You can typically find this reference on the bottom of the notebook - plug it into their website and it will show you the details of the computer, normally including the RAM configuration.
Answer: You can look it up on crucial. It uses DDR3 PC3-12800/DDR3-1600 Unbuffered NON-ECC RAM - you don't have to buy it from them.


Why do we not generally have "enneane"?

Question: Most numerical prefixes are based on Greek roots, but for "nine" we use the Latin root instead which seems inconsistent.  Thus, for instance, "nonane" instead of "enneane", or in mathematics "nonagon" instead of "enneagon" (although here the Greek form seems to have more traction) .  Why?  Can we use the Greek root as an alternative?
Comment: Only if "non-ane" means it's not an alkane.
Comment: Why wouldn't "any-ane" be inspecific as to number?
Comment: Personal opinion: I think 20th century nihilist would prefer spelling it nonane to enneane. These undertones may play more in the subtleties involved in word preference than one may think, also especially as in Rome\Greek myths there was often 9 main gods, "by the nine gods he swore", so 9 was a sacred number.
Answer: Perhaps not a complete answer, but this might put you on the right track. It looks as though a lot of the system we have today grew out of recommendations made by August Wilhelm von Hofmann in a paper titled On the Action of Trichloride of Phosphorus on the Salts of the Aromatic Monamines
He actually suggested using the Latin numerals as a prefix for the alkanes with n>3. So pentane was quintane, hexane was sextane, etc. Over time, the Latin prefixes fell out of favor and were replaced with the Greek one's except in the case of nonane (and quadrane which became butane rather than tetrane). A Yale website, which led me to this article and helped me answer a previous nomenclature question about the alkanes (Etymology of saturation degrees (-ane, -ene, -yne) in aliphatic compounds), posits that it might just be that enneane just doesn't sound as good. Plus the trend from the polygons probably reinforced keeping it around.
So not a full answer, but at least it shows that nonane wasn't chosen to break the trend, but remained in spite of new naming convention.
The author of the Yale page does mention that their source was The Name Game by Alex Nickon and Ernest F. Silversmith, so perhaps there is more information there.
Answer: I believe Tyberius gave an extremely reasonable answer for the question and it deserves to be the best answer. I just want to provide some supporting facts for his argument. For example, there are a lot of 9-membered-enes, -en-ynes, and -en-oic acid derivatives among marine natural products. For instance, siamol is a  biologically active natural product with given IUPAC name, 1,5-dimethyl-7-(2-methylprop-1-enyl)cyclonon-4-en-1-ol. If name with the Greek origin had been used, it should have been: 1,5-dimethyl-7-(2-methylprop-1-enyl)cycloenne-4-en-1-ol.
The compound $\mathrm{5D}$ (See Process A in scheme below) is given the IUPAC name, (E)-5-phenyl-3-(2,2,2-trifluoroethyl)cyclonon-4-enone. The Greek origin name would have been(E)-5-phenyl-3-(2,2,2-trifluoroethyl)cycloenne-4-enone. I think you got my point.

Note: Even though we use pent prefix for 5, we still use 'quintet' to describe splitting pattern of 5.
About nonagon in mathematics: Wikipedia states that

In geometry, a nonagon /ˈnɒnəɡɒn/ (or enneagon /ˈɛniːəɡɒn/) is a nine-sided polygon or 9-gon. The name "nonagon" is a prefix hybrid formation, from Latin (nonus, "ninth" + gonon), used equivalently, attested already in the 16th century in French nonogone and in English from the 17th century. The name "enneagon" comes from Greek enneagonon (εννεα, "nine" + γωνον (from γωνία = "corner")), and is arguably more correct, though somewhat less common than "nonagon".
Comment: @MathewMahindaratne I think this is definitely the key to why "non" stuck around, since the ane, ene, and yne endings were already established and names like enneaene would have proved confusing.
Comment: Another reason why nonagon is more common than enneagon is that the latter can be confused with the most common way to pronounce $n$-agon (a generic word for a polygon with $n$ sides), a word which (arguably) a mathematician uses more often.
Comment: @FedericoPoloni I thought it was generally n-gon and that that the "a" came from the numeric prefix.
Comment: @Federico usually the generic term is "$n$-gon", spelled and pronounced without the "a".  In fact "enneagon" has two vowel differences from "$n$-gon".

Why do we not generally have "enneane"?