click() function on selenium not working in C#

Question: I am really fed up from this problem and not finding any solution.
The problem is that I am trying to test a website using test automation in C#. For this I need to sign in, but the sign-in button is not actually a button, it's a span tag with property set 'role=button'.
I am using Selenium with Chrome web driver and using unit extensions to automate the test. The problem is whenever I run the test in Test Explorer the click event is performed, but the page does not navigate to next page, and nothing happens. However, when I set a break point and run the same test through main function it works fine.
I have to set the break point to perform click operation and perform login operation.
I am using a Visual Studio console application. Here is the pic of my web site html tag.
Comment: Please format your answer to make it more readable and provide some code.
Comment: the problem does not occur with simple click() function on a simple button
Answer: Try to click by JavascriptExecutor.
JavascriptExecutor is an interface provided by Selenium Webdriver
WebElement element= driver.findElement(By."Your Locator"))
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();", element);

It's an java code you can modify it using reference of below link:-
Execute JavaScript using Selenium WebDriver in C#
Hope it will help you :)
Answer: The problem is most likely the Click function is not loaded at the time you run the test "quick", but it is when you debug.
Try load the page. Wait for 1 second. Then getElement and click it.
This is normal in pages that add javascript function to elements dynamically.
Answer: From what I understood the click is performed before the page is fully loaded. Try using explicit wait and expected conditins
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.Until(ExpectedConditions.ElementToBeClickable(logInButton)).Click();

This will wait up to 10 seconds for the button to be clickable before clicking on it.
Answer: If you have Selenium.Support included in your project you can do the following
Driver.ExecuteJavaScript("arguments[0].click();", element);

ExecuteJavaScript is an extension method available in the library
Answer: I fixed this issue by storing element in an IWebElement type variable and then click it.
IWebElement runButton = driverIE.FindElement(By.XPath("//*your XPath"));
runButton.Click();


AdS/CFT seminal papers?

Question: I am about to begin my PhD in the applications of duality and holographic techniques to open problems in condensed matter physics. An area often called AdS/CMT. Having seen some relevant reviews, I realize that it is easy to find some nice descriptions and discussions concerning how holography is used to tackle such issues, i.e. holographic superconductors etc. However, in most such reviews the origin of the correspondence is only at best motivated, lacking any detailed discussion.
  I would like to ask your opinion about which two or three seminal papers regarding AdS/CFT should I focus on, in order to gain a deeper understanding on how the original correspondence was formulated on the first place. Brief remarks together with your suggestions are more than welcome.
Comment: Possible duplicates: http://physics.stackexchange.com/q/36303/2451 , http://physics.stackexchange.com/q/61647/2451 and links therein.
Comment: Also see the answer by Genneth to this question: http://physics.stackexchange.com/q/8162/
Answer: The following paper currently has almost 7500 citations.  Why does it have so many?  Because it is amazing; read it.
Anti de Sitter Space and Holography, by Edward Witten
The canonical, detailed review is the following paper which currently has nearly 4000 citations (pretty weak...I know).
Large N Field Theories, String Theory and Gravity, by MAGOO
Everyone I know who works in AdS/CFT has read Witten's paper above more than once, and at least once with pen and paper in hand to redo his computations.  The paper by MAGOO is the go-to reference in the field.
Answer: Concerning applications of holography, you should perhaps first read Andreas Karch's fresh introduction here:

http://motls.blogspot.com/2013/09/guest-blog-on-applications-of-holography.html?m=1

which also links to papers and proceedings that map the landscape of the papers, too. Josh is of course right that those are some of the key papers of AdS/CFT itself but you may have specifically wanted applications outside high-energy physics.

AdS/CFT seminal papers?


Does Gödel's Incompleteness Theorem really say anything about the limitations of theoretical physics?

Question: Stephen Hawking believes that Gödel's Incompleteness Theorem makes the search for a 'Theory of Everything' impossible. He reasons that because there exist mathematical results that cannot be proven, there exist physical results that cannot be proven as well. Exactly how valid is his reasoning? How can he apply a mathematical theorem to an empirical science?
Comment: Godel's theorem only says for some *fixed*, recursively defined, axiom system there are statements you can't prove or disprove. A consequence of this is that you can add it (or its negation) as an axiom to get a new equiconsistent theory which can prove (or disprove) it. That shouldn't matter for physics because you can just add new axioms when you want. There's no reason a result in physics must be proved in terms of some fixed axiom system (like ZFC say)
Comment: @spernerslemma not really, because if you add the unprovable as an axiom, you can construct new unprovable statements for the new system. So Godels construction applies to every system.
Comment: On the meeting with Roger Penrose he said mostly the same things about the seeking of the "Theory of Everything".
Comment: Related post on Phys.SE: http://physics.stackexchange.com/q/14939/2451
Comment: @m0nhawk Speaking of Roger Penrose and Gödel's incompleteness theorem, I think this is a great site: http://thinkinghard.com/consciousness/math-journal.html.
Answer: Hawking's argument relies on several assumptions about a "Theory of Everything". For example, Hawking states that a Theory of Everything would have to not only predict what we think of as "physical" results, it would also have to predict mathematical results. Going further, he states that a Theory of Everything would be a finite set of rules which can be used effectively in order to provide the answer to any physical question including many purely mathematical questions such as the Goldbach conjecture. If we accept that characterization of a Theory of Everything, then we don't need to worry about the incompleteness theorem, because Church's and Turing's solutions to the Entscheidungsproblem also show that there is no such effective system.
But it is far from clear to me that a Theory of Everything would be able to provide answers to arbitrary mathematical questions. And it is not clear to me that a Theory of Everything would be effective. However, if we make the definition of what we mean by "Theory of Everything" strong enough then we will indeed set the goal so high that it is unattainable.
To his credit, Hawking does not talk about results being "unprovable" in some abstract sense. He assumes that a Theory of Everything would be a particular finite set of rules, and he presents an argument that no such set of rules would be sufficient.
Comment: After giving the Goldbach example in the lecture you linked, Hawking says "Although this is incompleteness of sort, it is not the kind of unpredictability I mean," and goes on to give a more precise information-theoretic explanation of how he thinks the result might apply. I feel you've misrepresented his argument here.
Answer: @Sperners Lemma's comment should really be promoted to an answer. For indeed, it is a fairly gross misunderstanding of what Gödel's theorem says to summarize it as asserting that "there exist mathematical results that cannot be proven", for the reason he briefly indicates.
And incidentally, though it is a quite different issue, a Theory of Everything in the standard sense surely doesn't have to entail that every physical truth could be "proven". Let's bow to the wisdom of Wikipedia which asserts

A theory of everything (ToE) or final theory is a putative theory of
  theoretical physics that fully explains and links together all known
  physical phenomena, and predicts the outcome of any experiment that
  could be carried out in principle.

So NB a ToE is a body of laws which (if we assume that they are deterministic) will imply lots of conditionals of the form "if this happens, then that happens". But a ToE which wraps up all the laws into one neat package needn't tell us the contingent initial conditions, so (even if it is deterministic) need not tell us all the physical facts.
Comment: It seems reasonable to assume an isomorphism between arithmetic and experiment ($2+2=4 \cong 2kg + 2kg = 4kg$, etc.) - wouldn't that make Godel's theorem apply? (There are some set of weights which when added together represent the experiment's own Godel number, etc.)
Answer: He can't. What would it even mean to "prove" a physical result? A ToE would condense all of the physical laws we've observed into a unified (and preferably compact) form, but as an empirical statement it would not imply, nor be implied (or even affected) by, results in mathematics. No mathematical axiom system has anything more to do with reality than any other one, including e.g. ones to which Godel's theorem does not apply, ones in which Godel's theorem cannot be proven, or even ones which are just inconsistent.
Answer: The accepted answer is good, but there are several additional interesting ways we can look at the question. (My personal favorite is "it doesn't matter"; see Part 3.)
Part 1: Wait and See
The first important fact is that many mathematical systems are both consistent and complete. Godel's Incompleteness Theorem only applies to systems that are "powerful enough to allow self-referentiality". In fact, Godel essentially proved his theorem by formalizing the self-referential sentence "this sentence is not provable". Consider that sentence for a moment. If that sentence can be written in a consistent mathematical system, then it's either true or else it's false. If it's false, then that means the sentence's claim is wrong, so it must be provable. And if it's provable, then it must be true. That's a contradiction. Therefore the sentence can't be false, so it must be true -- and so the statement's claim must be correct, and the statement itself must not be provable.
But there are plenty of mathematical systems that don't have the ability to express self-referential sentences like this one. In such a system, Godel's proof simply doesn't apply. The most famous two relevant examples are number theory, where Godel's proof holds, and therefore which is incomplete; and the first-order theory of the real numbers (specifically the theory of real closed fields), which is provably both consistent and complete, and in which Godel's proof cannot be formulated. See this answer for some good details.
From this perspective, the truth of Hawking's claim seems to boil down to the question of exactly what mathematics would be involved in a Theory of Everything. Would it only use the theory of real closed fields? Then it could easily be complete. Would it require a theory of integer arithmetic? Then indeed it would be incomplete. There isn't much more we can say here besides "it depends on the underlying math, so we'll have to wait and see".
Part 2: A Clever Argument
Now, it is easy to imagine someone responding to the above with the following kind of clever argument:

Any Theory of Everything would have to model the world in which we
  live, which includes mathematicians. Anything a mathematician can
  prove, the Theory of Everything can prove that a mathematician would
  prove. Therefore, a Theory of Everything has to be able to model all
  of mathematics, and so must be incomplete.

Although it's clever, it's wrong. Intuitively this is because there's a big difference between what a theory contains, and what it knows about. This is (slightly more than vaguely) analogous to the relationship between a computer and its data. If you stumble across a computer containing some unreadable files, you can still manipulate the bits in that file, or delete the file, or do anything else to it that the computer can do to files in general -- you just can't interpret those files as anything special. Now, it might be that one of the files is an encrypted tool that can hack into government databases. But that won't make any difference to you, since you don't have the extra knowledge necessary to understand and work with the file in that higher context.
As a more precise example, the theory of real numbers, and the theory of arithmetic on the integers, share the same relationship. The real numbers contain the integers, of course -- but the first-order theory of real numbers doesn't have the structure to recognize them as a distinguished set that follows the axioms of Peano arithmetic. Like the computer and its unreadable file, the reals contain the integers, but don't understand how they work.
The clever argument makes the same subtle mistake. Our universe contains mathematicians, so any Theory of Everything, which has to describe the universe in general, has to describe mathematicians in particular. But it doesn't have to describe mathematicians as distinguished entities, and it doesn't have to understand what they do. Just like the computer understood the encrypted file only as a series of bits, a Theory of Everything would likely only understand the mathematicians as a motion of particles and shifting energy gradients, rather than in terms of axioms and theorems. And this description could be entirely compatible with a mathematical framework that is both consistent and complete.
Part 3: It Doesn't Matter
Ok, so our Theory of Everything may or may not end up being mathematically incomplete. But if it were, what would that mean to us as humans? Sure, we'd import some purely-mathematical instances of incompleteness, e.g. the continuum hypothesis, but that wouldn't exactly keep a physicist up at night. So what would incomplete statements about the universe look like?
Well, incompleteness happens when there is a well-formed statement in our system, which is therefore either true or false (assuming a consistent system), but which we cannot prove or disprove. Of course "proof" and "disproof" don't technically exist in the physical sciences, and the closest thing we have is a large amount of evidence for or against. But let's not fuss over this distinction, as Hume's done that enough already. We can reasonably say that the claims we cannot prove or disprove empirically are the claims for which we cannot obtain evidence for or against. The term for such claims is unfalsifiable. Examples include Russell's Teapot, the dragon in Carl Sagan's garage, and many others.
And of course, the reason scientists are dismissive of unfalsifiable claims is that -- by definition -- the predictions they'd generate if true are the same as the predictions you'd get if they weren't true. If you can't see Russell's Teapot, it might be because it doesn't exist, but it might be because it's just too small! You'll often hear that unfalsifiability is a big deal for scientists because if there aren't differences in prediction, there's no way to experimentally decide between the two. This is true, but really short-sells what's going on. Unfalsifiability is a big deal because -- again by definition -- it means that whether or not the claim is true simply doesn't make a difference in any way.
With this in mind, what if we did end up with an incomplete Theory of Everything, and one in which there were physical examples of incompleteness in addition to mathematical examples? It's simple: it just wouldn't matter. By definition of how incompleteness works, these examples would have no empirical bearing on our existence. True, the Theory wouldn't be able to answer all questions that we could put to it -- but it would, again by definition, be able to answer any question that had even the faintest sliver of practical value. After all, a universe in which one of these unanswerable questions happened to be true would be empirically indistinguishable from a universe in which it happened to be false.
Comment: You said that "many mathematical systems are both consistent and complete", but arguably there aren't any interesting such systems, since Gödel showed that one only needs to be able to express statements about the natural numbers (a pretty basic requirement for most of mathematics) in order to allow for self-referentiality!
Answer: I saw this and thought this argument would not be complete without mentioning the work of david wolpert http://arxiv.org/abs/0708.1362
He shows that a theory of everything is impossible.
Comment: Knowing the exact physical laws (TOE) doesn't mean everything can be predicted... I don't think his result applies. In fact Wolpert's result is true regardless of what the physical laws of a system are, and whether they are known or not. I made the same mistake... the result does not render all physical laws (TOE) unknowable or unable to be compiled into a single theory, but rather limits what can be predicted, regardless of what the laws are.
Answer: I am with Hawking on this one, though perhaps for different reasons.
It is not particularly difficult to show that some theoretical aspects of nature encode arithmetic.  That is to say, as an example, that the theory of electrodynamics "contains" a copy of the natural numbers, together with addition and multiplication.
That is enough to satisfy Godel's theorem, to show that the theory of electrodynamics is "incomplete".
Of course, I have only described an argument that a single theory is incomplete, not that every theory is incomplete.
Answer: Since "Theory of Everything" needs to be expressed in some kind of proof, which will be partially mathematical and partially observation, it is not clear, how such proof can be validated without the component of mathematics.
Quantum computing might solve this problem for us, as it is able to operate using mathematical constants that are not verifiable or provable after they are executed, just like some theories in mathematics, that we can observe.


How to set up GDB for debugging Rust programs in Windows?

Question: How can I configure GDB for debugging Rust programs in Windows, including setting-up the Rust pretty-printers, and debugging either in an IDE or the command-line?
Answer: Rust installation
First, you need to compile your programs with the Windows GNU ABI Rust installation. The MSVC ABI uses a different debugging format than the one GDB understands, so that won't work. MSVC ABI compiled programs would have to debugged with Visual Studio (or possibly LLDB, in the future).
GDB
Second step is to get GDB itself. The recommended option is to get it from either TDM-GCC or mingw-w64:

TDM-GCC (http://tdm-gcc.tdragon.net/): Has available a download package with GDB only (without GCC or the other tools, which you don't need). Special keys work in Windows terminal only. Recommended GDB for use with Eclipse/RustDT.
Mingw-w64 (http://mingw-w64.org/): Special keys work in Windows terminal only. Recent versions seems to have a bug: command-line arguments with spaces in them are parsed incorrectly.
Cygwin: Not recommended. Special keys work in Windows terminal and bash terminal. Paths have to be specified in Cygwin format, and this seems to break a few things. Doesn't work properly with Eclipse/RustDT.

Enabling pretty-printers
Rust provides some extensions to GDB to enable a better display of certain Rust native types, such as enums, slices, and vectors. With the pretty-printers, variables of this type will be displayed in a structured way, instead of the low-level representation. For more info see https://michaelwoerister.github.io/2015/03/27/rust-xxdb.html .
The pretty-printers are only included in the Linux (and Mac OS?) distributions of Rust, not the Windows one (Issue reported). But they can be made to work in Windows.
Download the Linux Rust archive (https://www.rust-lang.org/downloads.html), extract and locate the rustc/lib/rustlib/etc directory inside. Now copy the etc folder to $RUST/bin/rustlib , where $RUST is the location of your Rust installation. The Python scripts there will then be located in $RUST/bin/rustlib/etc.
If you only intend to use GDB from within RustDT, and have RustDT 0.4.1 or above, you can skip to the next section: "Using GDB in Eclipse with RustDT".
Now, GDB needs to be configured to load these scripts. Locate the gdbinit file of your GDB installation (for TDM-GCC, should be gdb64\bin\gdbinit, for mingw-w64: mingw64\etc\gdbinit). Now add the following text to the end of the file:
python
print "---- Loading Rust pretty-printers ----"

sys.path.insert(0, "$RUST_GDB_ETC")
import gdb_rust_pretty_printing
gdb_rust_pretty_printing.register_printers(gdb)

end

But replace $RUST_GDB_ETC with the location of the etc directory with the Python files, for example D:/devel/tools.Rust/rust/bin/rustlib/etc. Note, even though it's a Windows path, make sure you use the forward-slash ('/') as a path separator, to avoid escape issues in that string literal.
To verify this works, start gdb. If you see the "---- Loading Rust pretty-printers ----" message before the prompt and no Python errors after, things should be working. To confirm, type the command info pretty-printer. There should be a line with "rust_pretty_printer_lookup_function" in the output if the pretty-printers were loaded successfully.
Using GDB in Eclipse with RustDT
If you successfully completed the steps before, you are nearly good to go to use GDB from within RustDT. Just a few details:

If using TDM GDB, the GDB executable to be started must be the one at $TDM_ROOT/gdb64/bin/gdb.exe, not the ones at $TDM_ROOT/bin/gdb.exe or $TDM_ROOT/bin/gdb64.exe, because these last two are wrappers for the correct executable, and they don't work properly when RustDT/CDT starts the GDB process.
If using RustDT 0.4.1 or above, the pretty-printers will be configured automatically, as long as RustDT finds them in ${RUST_ROOT}/lib/rustlib/etc. You can verify this worked by starting a debug launch, opening the corresponding "gdb traces" console page in the Console view, and searching for the string "Registering Rust pretty-printers for Windows":

For RustDT versions prior to 0.4.1, to enable the pretty-printers, you much configure the launch configuration to run the gdbinit file that you just modified in the previous section. The default gdbinit is not executed when GDB is started by RustDT/CDT, only the one you specify in the configuration. So change the "GDB command file" field from .gdbinit to, for example D:\devel\tools\TDM-GDB\gdb64\bin\gdbinit:
Comment: In my experience, there are too many bugs with rustdt+gdb on Windows, and enabling pretty-printing only makes it worse. For one, every Vec will be displayed as string including all its items, no matter how many. For two, I've seen reproducible freezes when stepping out of a function. I figure right now it's better to disable pretty-printing. Many things don't work, but at least it doesn't freeze. YMMV
Comment: Hum, I think I will change the wording of the User Guide from "slowdown" to "long pauses / freezes", since that is more accurate.
Comment: True. This was mentioned in the User Guide: "Having the pretty-printers enabled may sometimes cause slowdown when debugging, if the Variables view is visible, and the value of uninitialized variables is displayed." And there might be other issues with pretty-printers too.


How can I obtain a character count?

Question: I want to count the number of characters within a brief essay, like an abstract or summary thesis, including math symbols. Is there a command like the one in microsoft word (preferences, statistics) that count characters?
Comment: Welcome to TeX.SX.  It might just be me, but I would consider it very strange (or at least very ambiguous) to include mathematics in a character count.  See [`texcount`](http://app.uio.no/ifi/texcount); it's a separate program installed along with LaTeX.  If you paste everything but your preamble into a throw-away document, you can get a round-about estimate with the byte count.
Comment: Ok, thanks, but I need to write my essay within a rigorous limit of characters. I don't know exactly if for an article abstract mathematicians consider text only.
Answer: As already mentioned by Sean in the comments, you can use TeXcount: either through the web-service or by running the Perl script (which may already have come along with your TeX installation) using the option -char (or -letter).
Note that this counts letters only, i.e. not including punctuation and spaces (although some special characters are permitted as part of words and thus counted along with letters). An estimate of the number of spaces could be the word count for the same document.

How can I obtain a character count?


If $\{ww^R \mid w \in L\}$ is regular, is $L$ itself regular?

Question: If $L$ is some language and
$\{ww^R \mid w \in L\}$
is a regular language then does $L$ have to be a regular language?
Comment: Yes, $L$ consists of the first halves of a regular language: https://cs.stackexchange.com/q/14192/4287
Comment: @HendrikJan I encourage you to put it in the answer box, even if the answer is short :)
Comment: @JohnL. Ha, that is funny.
Comment: @nirshahar Thanks, but please be my guest, and make the answer, preferably a little longer than my comment.
Comment: Yes, $L$ consists of the first halves of context-free palindromes, https://cs.stackexchange.com/a/109637/91753.
Answer: Let $A = \{ww^R \mid w \in L\}$, and suppose that $A$ is regular. What can we say about $L$?
For a word $w \in \Sigma^*$, let $E(w) = \{x : wx \in A\}$. Since $A$ is regular, there are only finitely many different $E(w)$.
Say that $w \in L$ is self-terminating if it has no extension in $L$. If $w \in L$ is self-terminating then $E(w)$ is finite, and the unique longest word it contains is $w^R$. Therefore if $w_1 \neq w_2$ are both self-terminating words in $L$, then $E(w_1) \neq E(w_2)$. Consequently, there are only finitely many self-terminating words in $L$. Let $L'$ result from removing them and all their prefixes. Thus every word in $L'$ has infinitely many extensions in $L'$.
Say that $w \in L'$ is creative if there are two different letters $\sigma,\tau$ such that both $w\sigma$ and $w\tau$ have extensions in $L'$. If $w \in L'$ is creative then we can recover $w$ from $E(w)$ by taking the longest common suffix which appears infinitely often. This implies that there are only finitely many creative words in $L'$. Let $L''$ result from removing all creative words in $L'$ and their prefixes. Thus every word in $L''$ has infinitely many extensions in $L''$, and all of them are prefixes of a single $\omega$-word.
Let $x$ be an $\omega$-word that $L''$ has infinitely many prefixes of, and choose the shortest such prefix $w_x$. We can recover $x$ from $E(w_x)$ in the following way: the first $\ell$ letters of $x$ are the reverse of the suffix of length $\ell$ of all long enough words in $E(w_x)$. It follows that $L''$ consists of prefixes of finitely many $\omega$-words.
Let $x$ be one such $\omega$-word. By the pigeonhole principle, there exist $n_1 < n_2$ such that $x_1 \ldots x_{n_1},x_1 \ldots x_{n_2} \in L$ and $E(x_1 \ldots x_{n_1}) = E(x_1 \ldots x_{n_2})$. Since all long enough words in the former start with $x_{n_1+1} \ldots x_{n_2}$, it follows that $x_{n_2+1} \ldots x_{n_2+(n_2-n_1)} = x_{n_1+1} \ldots x_{n_2}$, and continuing in this way, we see that $x$ is eventually periodic, say $x=yz^\omega$.
The number of words of given length in a regular language is eventually periodic. It follows that we can modify $L''$ to another language $L'''$, differing in finitely many words, such that $L'''$ also consists of prefixes of finitely many $\omega$-words, and furthermore there exists a modulus $m$ such that for each $a \in \{0,\ldots,m-1\}$ and each $\omega$-word, either all prefixes of length $nm+a$ are in $L'''$, or none of them. Up to finitely many words, for each $\omega$-word $x = yz^\omega$, these prefixes are of the form $y' (z')^*$.
Every two $\omega$-words in $L'''$ differ in some symbol. It follows that for each such word $x$, and for each $a$, we can use regular closure operations to isolate the corresponding subset of $A$, which is of the form
$$ \{ ww^R \mid w \in y z^* \} = \{ y z^n (z^R)^n y^R \mid n \geq 0 \}. $$
We can further use regular closure operations to isolate
$$ \{ z^n (z^R)^n \geq 0 \}. $$
Applying the pigeonhole principle to the sets $E'(z^n)$ (where $E'$ is the analog of $E$ to the new language), we see that $E'(z^{n_1}) = E'(z^{n_2})$ for some $n_1 < n_2$. Since $(z^R)^{n_1} \in E'(z^{n_1}) = E'(z^{n_2})$, it follows that $z^{n_2}(z^R)^{n_1} = z^{n_1} (z^R)^{n_2}$, and so $z = z^R$.
We conclude that there exist $a,b \in \mathbb{N}$, words $w_1,\ldots,w_a,y_1,\ldots,y_b$, and palindromes $z_1,\ldots,z_b$, such that
$$
L = \sum_{i=1}^a w_i + \sum_{j=1}^b y_j z_j^*.
$$
The corresponding language $A$ is
$$
A = \sum_{i=1}^a w_i w_i^R + \sum_{j=1}^b y_j (z_j z_j)^* y_j^R.
$$


Grand Central Dispatch efficiency

Question: Running a ray tracing program as a single thread on an iMac quad-core processor the CPU utilisation is 12%. OK so one of the Intel hyper-threads has been 100% allocated to the process. When GCD is used the program completes in a quarter of the time, but is consuming more than 90% of the processor availability. It would appear that all eight of the iCore HTs have been allocated to the process. So why does the app only run four times faster and not eight times faster?
Answer: Hyper threading is weird. If you have a four cores + hyper threading Mac, then you have four cores that can either run one thread at 100% speed, or two threads at 60% speed (if you are lucky). That should be enough info to do the maths.
If you use a laptop, then your clock speed is limited by heat. So you might be able to use one core at 3GHz forever, but if you use four cores then the clock speed might be reduced to 2GHz after some time to limit the heat produced. Take that into account as well.

Grand Central Dispatch efficiency


How to install Symfony2 on IIS with ISAPI_Rewrite

Question: I'm stuck with IIS6 for a specific project and I am having difficulty using ISAPI_Rewrite. I use the symfony1 guide, installed ISAPI_Rewrite3 and I am trying to install a project as a subdirectory (using a virtual directory) within a website domain.
There is already a website live at mydomain.com and I want my project to be under mydomain.com/myproject (without the trailing web folder). So I created a virtual directory in IIS under mydomain.com, created the folder c:\myproject and added those lines in the global httpd.conf configuration file
<code>  # Defend your computer from some worm attacks
  RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]

  # we skip all files with .something except .html
  RewriteCond URL /myproject/.*\..+$
  RewriteCond URL (?!/myproject/.*\.html$).*
  RewriteRule /myproject/(.*) /myproject/$1 [L]

  # we keep the .php files unchanged
  RewriteRule /myproject/(.*\.php)(.*) /myproject/$1$2 [L]

  # finally we redirect to our front web controller
  RewriteRule /myproject/(.*) /myproject/app.php [L]
</code>
But everything results in a http 404 not found when pointing to mydomain.com/myproject. Anyone had any success installing sf2 with IIS6 and ISAPI_Rewrite?
Answer: You have 2 rules starting with the same pattern "/myproject/(.*)", this might cause issues.
Also some rules are excessive. Please try the following config:
<code># we skip all files with .something except .html
RewriteCond URL (?!/myproject/.*\.html).*
RewriteRule /myproject/.*\..+ $0 [I,L]

# finally we redirect to our front web controller
RewriteRule /myproject/.* /myproject/app.php [I,L]
</code>


Why does M365 keep accepting phishing emails that Gmail rejects?

Question: At my work email, which is handled by MS Office 365 Outlook, I keep getting phishing emails, typically 3 times a week, usually with some attachment "your company's monthly financial report" or "voicemail recording - high priority", or "proforma invoice". All of that is obvious BS, because none of that applies to me.
Those attachments are nearly always thinly disguised html files that would (presumably) forward me to an imitation log-in web page, or present a log-in via some script. Sometimes the phishing email even tries to legitimize the fake login script, saying "a login will be required to see the attachment".
A few times I uploaded the suspected phishing attachment to VirusTotal, and it's always reliably detected as a phishing or malicious attachment.
I can't fathom why Microsoft 365 isn't capable of detecting and blocking these easy-to-identify phishing emails.
Just for kicks, I tried forwarding one such email to my personal Gmail account, but Gmail smartly and immediately declined to deliver it, replying "Remote Server returned '552-5.7.0 This message was blocked because its content presents a potential 552-5.7.0 security issue."
I religiously keep clicking the "report phishing" in Outlook, but these emails keep coming.
If there's anything I can do to improve this situation, please let me know.
Answer: Your work M365 administrator may have adjusted the sensitivity of the junk mail settings. You need to work with them to see how to improve the sensitivity.


Did the Resurrection Really Happen?

Question: Came across a doc that really made me question whether the resurrection really happened. Happy to hear any opinions.
https://archive.org/details/resurrection_202210
Comment: You're probably going to have to be a bit more specific. What is the gist of the argument made in the doc you link to?
Comment: We do not deal with 'opinions' on this site. Therefore the question is off-topic. The document linked to is also the expression of a series of personal opinions expressed by an anonymous author.
Comment: the bible has 12 witnesses of a resurrected Savior, who knew Jesus before hand. Seems like the burden of proof for falsity is on the author of the article, not the other way around
Comment: You should take a look at the help pages.  Questions asking opinions are not valid here. Try rephrasing the question in a form that fits the guidelines
Comment: My *opinion* is that the linked document is a bunch of useless verbiage.
Comment: The title of the document and authour details speak volumes.  This site is about Christianity, and the opinions of someone who is afraid to be identified can not be taken seriously.  Why don't you post your question in the Skeptics section where it belongs?
Answer: Introduction
This is a very important question; after all, as Paul tells us, "If Christ has not been raised, your faith is futile, and you are still in your sins" (1 Cor. 15:17). If the resurrection did not happen, then none of us should be Christians; rather, we should follow some other religion, or perhaps no religion at all. Fortunately, as Anthony Flew (a prominent philosopher and lifelong opponent of Christianity) put it:

The evidence for the resurrection is better than for claimed miracles
in any other religion. It's outstandingly different in quality and
quantity.

I think that Flew was right; in this answer, I will try to explain why.
There are three primary reasons to believe in the resurrection of Jesus: firstly, it makes sense theologically; secondly, the tomb of Jesus was found empty; and thirdly, the disciples of Jesus saw him alive after his crucifixion. Let's evaluate each of these reasons in turn, and see what we can conclude. I warn the reader that this post is quite long; however, I think it is more important to be thorough than to be concise.
Theological Background
The first thing to consider is whether God (assuming that there is a God) would be likely to become incarnate. There seem to be at least some good reasons for thinking that he would: for one thing, it provides a way for him to show solidarity with his creatures, by sharing in the sufferings that they endure (for more on this topic, see Adams 2003). For another thing, the incarnation allows God to go beyond merely telling us how to live, by actually showing us how to live. Human beings often learn best when given an example, and by becoming incarnate, God can provide us with a perfect example of how we ought to conduct ourselves ethically.
A final reason why God might become incarnate is that it would give him a way to help us atone for our sins. All of us have wronged God in various ways, and there seems to be no way in which we, acting on our own, could make suitable restitution for such wrongdoing. Restitution is an important part of forgiveness; if I steal your money, it isn't enough for me to simply say I'm sorry. Rather, I should also try to compensate you in some way. But how could we possibly compensate God for the wrongs we do to him? The incarnation provides a possible solution: by becoming incarnate, God can live a perfect life in our stead, a life with which we can associate ourselves. As Paul teaches, when we are baptized, we are baptized into the death of Jesus (Romans 6:3); we, in a sense, offer his life and death as perfect substitutes for our own. For more on this particular topic, I recommend Swinburne (2003, 2010).
We can see, then, that there are a few reasons for supposing that God would want to become incarnate: 1) to show solidarity with our suffering, 2) to give us an example of an ethically perfect life, and 3) to help us to atone for our sins. Let us now proceed to an examination of the historical evidence for the resurrection.
The Empty Tomb
While there is controversy among NT scholars on this matter, the most commonly-held view is that the empty tomb story "probably goes back to the beginning and is likely historical" (Allison 2021, p. 202). Why is this the case? There are a number of reasons.
For one thing, the empty tomb has great explanatory power. As NT scholar James D.G. Dunn put it, "at the historical level it is very hard to explain how the belief in Jesus' resurrection arose unless his tomb was empty" (1985, p. 76). Skeptics often claim that the resurrection belief arose as a result of hallucinations on the part of the disciples. However, this is very unlikely; as Dale Allison notes, "If there was no reason to believe that [Jesus'] solid body had returned to life, no one would have thought him, against expectation, resurrected from the dead. Certainly visions of or perceived encounters with a postmortem Jesus would not, by themselves, have supplied such reason" (2005, pp. 324-325). Similarly, N.T. Wright argues that "Sightings of an apparently alive Jesus, by themselves, would have been classified as visions or hallucinations, which were well enough known in the ancient world" (2003, p. 686).
Another point is that the accounts of Jesus' empty tomb simply don't look like we would expect them to if the Christian community had simply made the story up. As the NT scholar Geza Vermes (himself a secular Jew) wrote:

The identity and number of the witnesses differ in the various
Gospels, as does also their testimony. [...] If the empty tomb story
had been manufactured by the primitive Church to demonstrate the
reality of the Resurrection of Jesus, one would have expected a
uniform and foolproof account attributed to patently reliable
witnesses. (2008, p. 140)

In addition, the gospels attribute the discover of Jesus' empty tomb to a group of women. This is highly unusual; first-century Palestinian culture was rigidly misogynistic, to the point where Flavius Josephus could write (referring to Jewish courts) "From women let no evidence be accepted, because of the levity and temerity of their sex" (Ant. 4.219). Dale Allison notes that "Josephus attributes this ruling (without justification) to Moses, and he implies that it is the law of the land" (2021, p. 157). Early Christian texts also reflect a generally patronizing view of women; as Allison writes:

We meet the same prejudice in Gos. Mary 9:4, where, after Mary
Magdalene divulges what the risen Jesus has taught her, Peter
responds: "Did He really speak privately with a woman and not openly
to us?" Then there is Ep. Apost. 10, where the male apostles
disbelieve Martha (Mary) when she, at Jesus' command, declares that he
has risen. They ask, "What do you want with us, O woman? Can one who
is dead and buried be alive?" After she reports back, Jesus sends
another female. She is greeted by the same dismissive response. (Ibid,
p. 155)

Similar sentiments abounded in pagan society, to the point where the presence of women in the gospels was often used as an argument against Christianity. According to New Testament scholar N.T. Wright:

The debate between Origen and Celsus shows that critics of
Christianity could seize on the story of the women in order to scoff
at the whole tale; were the legend-writers really so ignorant of the
likely reaction? If they could have invented stories of fine,
upstanding, reliable male witnesses being first at the tomb, they
would have done it. (2003, p. 608)

Indeed, the later gospels (i.e. Luke and John) display an obvious desire to have male witnesses visiting the tomb, in order to confirm what the women have claimed. As the German scholar Ulrich Wilkens noted:

Later tradition shows a clear tendency to have the disciples at least
confirm the women's discovery afterwards (Luke 24:12, 24; John
20:2f.), and later tradition also has the disciples present on Easter
Day in Jerusalem (Luke and John as compared with Matthew and John 21).
Accordingly, it must be accepted that the core of the narrative is
indeed that the women found Jesus's tomb empty in the early morning of
the first day of the week. (1978, pp. 116-117)

It is also worth noting that the later gospels all make various changes to Mark's original account. Matthew places guards at the tomb (27:62-66), and has Jesus rise before the stone has been moved (28:2-6), thus precluding the idea that thieves stole the body. Luke expands the number of women at the tomb (24:10), has the men double-check their testimony (24:24), and has the burial clothes still in the tomb (24:12), again precluding the idea that Jesus' body was taken by graverobbers (who would not have bothered to unwrap his corpse before spiriting it away). John has a solider piece Jesus' side (19:34-35), thus ensuring that he was really dead. He also, like Luke, has men check the tomb (20:3-10), finding neatly rolled burial clothes inside (20:6-7).
Dale Allison notes that these apologetic expansions "reflect the sense that a single sentence from an angel (Mk 16:6-7) was not enough, that the relatively plain story in Mk 16:1-8 was inadequate, that it left too many disagreeable possibilities unaddressed" (2021, p. 153). Similarly, NT scholar Daniel Smith notes that the "narrative adjustments to the empty tomb story all show that the story itself was something of a problem, something that needed further explanation and elaboration and defense" (2010, p. 181). All of this adds further evidence that the empty tomb was not simply made up out of whole cloth: why would a Christian author invent a story so liable to be criticized by outsiders, one which required so much defensive alteration by later writers? These fact provide evidence that "some history lies in the background, that the narrative was not a purely imaginative construction but was rather rooted in memory of an initially confusing circumstance" (Allison 2021, p. 152).
It is interesting to note that while the document you presented uses the differences in the gospels as reason to doubt the resurrection, actual historians treat them as reason to endorse the claim that Jesus' tomb was empty!
All-in-all, I think we can agree with the late classicist Michael Grant (himself an agnostic), who wrote that historians "cannot justifiably deny the empty tomb," stating "the evidence is firm and plausible enough to necessitate the conclusion that the tomb was empty" (1999, p. 176). With that said, let's move on to an examination of the appearances of Jesus.
The Appearances of Jesus
Virtually all NT scholars agree that the disciples did have various experiences, which they interpreted as sightings of the risen Jesus. Historian E.P. Sanders summarizes the consensus quite well, when we writes:

That Jesus' followers (and later Paul) had resurrection experiences
is, in my judgement, a fact. [...] I do not regard deliberate fraud as
a worthwhile explanation. Many of the people in these lists were to
spend the rest of their lives proclaiming that they had seen the risen
Lord, and several of them would die for their cause. (1993, pp. 279-280)

Similarly, Gerd Ludemann (an agnostic) writes that "It may be considered historically certain that Peter and the disciples had experiences after the death of Jesus, in which Jesus appeared to them as the resurrected Christ" (1995, p. 80).Of course, the common skeptical reply is to claim that the disciples were hallucinating, caught up in a frenzy of grief and religious fervor. But this explanation can only get us so far; to quote Dale Allison, "One person can hallucinate, but twelve at the same time? And dozens over an extended period of time? These are legitimate questions, and waving the magical wand of 'mass hysteria' will not make them vanish" (2005, p. 269).
It is also worth noting that not all those who saw the risen Jesus had been his disciples before the crucifixion; most notably, the apostle Paul was a self-admitted persecutor of Christians before he was converted by his vision on the Damascus road. This point was even acknowledged by Anthony Flew, a well-known philosopher and lifelong opponent of Christianity. To quote:

The evidence of Paul is certainly important, and strong, precisely
because he was a convert. He was not a prior believer, he was not an
apostle… [rather,] he had been an active opponent. I think this has to
be accepted as one of the most powerful bits of evidence that there
is, precisely because he was converted by his vision. (2009)

With all this in mind, it is extremely difficult to dismiss the appearances of Jesus as mere hallucinations. Jesus was seen by both individuals and groups, by his earthly friends and a hostile outsider; it would be hard to find anything even remotely like this in the psychological casebooks.
Conclusion
What can we conclude from all of this? At the minimum, we can agree with Maurice Casey (an acclaimed NT scholar and prominent agnostic), who wrote that "the historical evidence is in no way inconsistent with the belief of the first disciples, and of many modern Christians, that God raised Jesus from the dead, and granted visions of the risen Jesus to some of the first disciples, and to St Paul on the Damascus Road" (2010, p. 498). In fact, it seems we can go further; as Dale Allison puts it:

Early Christianity offers us a missing body plus visions to several
individuals plus collective apparitions plus the sense of a dead man's
presence plus the conversion vision of at least one hostile outsider
[i.e. the apostle Paul]. Taken as a whole, this is, on any account, a
remarkable, even extraordinary confluence of events and claims. If
there is a good, substantial parallel to the entire series, I have yet
to run across it. (2021, p. 346)

In short, if Christianity is not true, then it is the product of the most outlandish series of coincidences that the world has ever seen. The historical data renders all of the essential Christian claims, if not provable, then at the very least as live explanatory options within the evidential framework.
Can we go even further? After assessing the historical data, Richard Swinburne (a professor of philosophy at Oxford University) used Bayes' theorem to calculate the probability of Jesus' resurrection (given a 50% chance that theism is true), with the result being that "the total evidence gives a probability of [97%] that Jesus was God Incarnate who rose from the dead" (2013, p. 251). Elsewhere, philosopher Stephen T. Davis (of Claremont McKenna College) estimates a probability of "well over [50%]" (2020, p. 21) that the resurrection occurred.
Of course, these numbers are highly controversial, and depend upon a number of prior arguments and assumptions (for example, how likely it is that God exists at all); that being said, they do show that serious, well-informed scholars have estimated a better-than-even chance that Jesus Christ was in fact God Incarnate, and that He did, in fact, rise from the dead. If the reader believes that there is even a slight chance that God might exist, then they ought to be a Christian.
Comment: It is interesting to note that while the document you presented uses the differences in the gospels as reason to doubt the resurrection, actual historians treat them as reason to endorse the claim that Jesus' tomb was empty! Agreed. But do YOU believe there is even a slight chance that God might exist?
Comment: @Lesley Yes, I'm a theist. Following the argument that I've given above (i.e. that theists ought to be Christians), I'm also a Christian.
Answer: The article you have referred to uses a Jewish argument from Deuteronomy 13.  We are therefore going over the same ground as answered to this question on Christianity Stack Exchange:  Resurrection and Deuteronomy 13
The point is that the Old Testament prophesies that

"the Holy One" of God would be resurrected: "Nor will you allow your Holy One to see corruption (bodily decay)" (Psalm 16:10);

This Holy One, the Anointed One, would be the Son of God (Psalm 2);

This Holy One would be a descendant of King David (2 Samuel 7:16); and he would sit on the throne of David forever, meaning he would have the power of an endless life;

This Chosen One would be a King setting up a Kingdom which would never be destroyed; he would come in the days of the Roman Empire (Daniel 2:44)

This Holy One or Anointed One, Messiah, would be "cut off, but not for himself", i.e. he would die for the sins of his people (Daniel 9:26);

After his death Jerusalem and its Temple would be destroyed (Daniel 9:26), and the Temple will never be rebuilt (Daniel 9:27);

The LORD promised to this Servant "It is too small a thing that you should be my Servant to raise up the tribes of Jacob, and to restore the preserved ones of Israel; I will also give you as a light to the Gentiles, that you should be my salvation to the ends of the earth" (Isaiah 49:6);

He would rise from the dead the third day (Hosea 6:2) which is figured in several passages, Genesis 22:4, Jonah 1:17, Esther 4:16, 1 Samuel 30:12.

Even if we do not believe the book of Daniel gives the day of the Messiah's resurrection to the exact day, we can at least see that Daniel's "70 sevens" (Daniel 9:24), or 490 years, after a decree to restore ownership of Jerusalem to the Jews, gives the approximate time of the Messiah's coming to the first century.

His resurrection is prophesied in Isaiah chapter 53.  Here is the 1917 JPS version of the chapter:-

JPS Tanakh 1917 , Isaiah chapter 53:-
1 'Who would have believed our report?
And to whom hath the arm of the LORD been revealed?
2 For he shot up right forth as a sapling,
And as a root out of a dry ground;
He had no form nor comeliness, that we should look upon him,
Nor beauty that we should delight in him.
3 He was despised, and forsaken of men, A man of pains, and acquainted with disease,
And as one from whom men hide their face:
He was despised, and we esteemed him not.
4 Surely our diseases he did bear, and our pains he carried;
Whereas we did esteem him stricken,
Smitten of God, and afflicted.
5 But he was wounded because of our transgressions,
He was crushed because of our iniquities:
The chastisement of our welfare was upon him,
And with his stripes we were healed.
6 All we like sheep did go astray,
We turned every one to his own way;
And the LORD hath made to light on him
The iniquity of us all.
7 He was oppressed, though he humbled himself
And opened not his mouth;
As a lamb that is led to the slaughter,
And as a sheep that before her shearers is dumb;
Yea, he opened not his mouth.
8 By oppression and judgment he was taken away,
And with his generation who did reason?
For he was cut off out of the land of the living,
For the transgression of my people to whom the stroke was due.
9 And they made his grave with the wicked,
And with the rich his tomb;
Although he had done no violence,
Neither was any deceit in his mouth.'
10 Yet it pleased the LORD to crush him by disease;
To see if his soul would offer itself in restitution,
That he might see his seed, prolong his days,
And that the purpose of the LORD might prosper by his hand:
11 Of the travail of his soul he shall see to the full, even My servant,
Who by his knowledge did justify the Righteous One to the many,
And their iniquities he did bear.
12 Therefore will I divide him a portion among the great,
And he shall divide the spoil with the mighty;
Because he bared his soul unto death,
And was numbered with the transgressors;
Yet he bore the sin of many,
And made intercession for the transgressors.

The translation of verses 10 and 11 in most Christian versions reads something like:-

10 Yet it pleased the Lord to bruise Him;
He has put Him to grief.
When You make His soul an offering for sin,
He shall see His seed, He shall prolong His days,
And the pleasure of the Lord shall prosper in His hand.
11 He shall see the labour of His soul, and be satisfied.
By His knowledge My righteous Servant shall justify many,
For He shall bear their iniquities. (New King James Version)

Verses 10 and 11 are speaking of his resurrection.
The Jews in denying the resurrection of our Lord Jesus end up disbelieving the prophesies of their own Tanakh, the Old Testament.

Did the Resurrection Really Happen?


Is it possible Bottom Tabview like iphone in android?

Question: I need a tabview , but i has to be at bottom , am having a custom title , it covers most of topview . So i want to go v with bottom tab view . Other question is that , can i add Tabview in a tabview.
Thanking you ,
Srinivas
Answer: Take a look here: Android: Tabs at the BOTTOM
While it is possible to have multiple levels of Tabs in a layout, you probably don't want to do this from a UX perspective and add other UI elements. :-)


Sharing Ownership of Minecraft Education Edition

Question: My friend and I made a creative world in Minecraft Education Edition where she hosted. She wants me to play even when she is not hosting the world. Is there a way for us to share ownership?
Answer: Sadly you cannot do this as of now. The way that this is solved in other versions of Minecraft is either with a dedicated realm, or with a dedicated server, but that is not offered with Minecraft Education Edition.
Pure speculation here: you might be able to have a file stream system on both of your computers and have the game read the world on that, so when each of you plays individually that world is updated on the other person's computer. However, this might be restricted due to Minecraft Education Edition basis on Minecraft Bedrock Edition.
Answer: The only way would be to export and import the world each time someone would want to update that world. I have tried this and it is the only way but it isn't ideal.


What is the call to cli(); routine in interrupt service routine for SPI?

Question: I see this in examples of ISR code but what is it?
Comment: cli() disables interrupts so that the ISR itself is not interrupted ... sei() enables the interrupts again
Comment: ok. Thanks for all answers. This problem can be closed.
I found the problem with the ISR routine and not knowing what the cli() was for just slowed me down a little.
Answer: Interrupts are normally turned off automatically when an ISR is called.
There are two instructions that allow software to turn off (cli) and on (sei) interrupts to create a sequence of non-interruptable instructions, i.e. an atomic operation or critical section.
In some MCU there are several levels of interrupt priority and an ISR with lower priority may be interrupted by an ISR with higher priority. An atomic operation may also be required in an ISR with lower priority.
There are also cases where an ISR may allow interrupts (with the same or lower priority) to occur after the critical section of the ISR.
Normally an ISR should not contain cli()-sei() especially for the AVR. The hardware will automatically turn off interrupts during the execution of the ISR.
Cheers!
Comment: Thank you both for the clarification. It's interesting that the ISR that I was looking at uses the cli() at its start but forgot the esi() when closing. But it's got other problems also. Regarding the Arduino as a SPI slave, I know I have good data coming in at a very low clock rate by checking with a Logic Analyzer but the Arduino(UNO or Mega) shows garbage (all '?'). It never sees the '\n' and I can only stop it by counting characters to set the received_data flag before ending the ISR. Weird. Can't figure out why.
Comment: Post the sketch or the ISR in a new question if you are happy with the answer to your original question. We try to keep a clean question-answer session to allow others to find and follow. Extending with additional questions does not help reuse.


WDK build environments versioning

Question: Sorry if I am asking something obvious. I was trying to recompile usermode helper dll for a driver using Windows 7's WDK when I noticed that is distributed with different dll for each OS built using respective os, platform build enviroments. Makefile shows that it only liks agains libraries in SDK_LIB_PATH. I tested WinXp x86 and WinServer2003 x64 on Win7 x86,x64 and they seem to be comatible. Do I need to distribute separate dll for each os platform commbination?
Answer: Generally, no.  You must provide separate DLLs for 32- and 64-bit platforms, but unless you want to take advantage of features found only in a certain version of Windows, a driver built for XP will usually work on later versions of Windows.  There are some exceptions; for example, print drivers that display a UI from the rendering DLL will not work on Vista and above.

WDK build environments versioning


A word reminiscent of "matriculate"

Question: I'm looking for a word that means "to move slowly though a process or system." I was writing an email and I used the word "matriculate", but it clearly is not the word for which I'm looking (football announcers non-withstanding). Is there a word that sounds like matriculate that means what I want here or am I way off base? I wonder if the fact that it sounds like "trickle" is what has me wrong?
Answer: Are you thinking of percolate?

Water slowly percolates through the soil.

A word reminiscent of "matriculate"


How do you slice a joined model into equal slices?

Question: I would like to take a complex model with many joined object and slice the whole thing in into regular slices. I have tried Bisect and Ctrl R but that doesn't work on a joined object. Any help?
Comment: Related : [How can I slice an object horizontally into equal pieces?](http://blender.stackexchange.com/questions/39510/how-can-i-slice-an-object-horizontally-into-equal-pieces/39519#39519)
Answer: You can use the Boolean modifier in intersection mode for this.

Add a box (cube) the size of the desired slice
Add a Boolean modifier to the object you want to cut into slices
Position the box precisely on the slicing axis (Z in the example above).
Duplicate the original object and apply the modifier to add a slice.
Answer: You probably could benefit from useing knife project from different views (eg. Right / Top / Left / Bottom).
Please see this solution: Knife Project.
In your case you would have to just walk through these steps multiple times, until you have the sections that you need.
The movie ['The Cell' - released year 2000] used this effect to show the internal anatomy of a horse.


Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

Question: I am using arduino pro mini (which contains Atmega328p AU) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I am wondering if I can use cc2541 itself for processing data in order to remove arduino from circuit, so that I can save power and money. I am quite new to electronics domain. Please suggest any ways to achieve it.
Comment: If you have GPIO pins available and if you can write the code, you can do that for sure.
Comment: I don't know whether this HM10 module can be programmed (because it has a limited number of exposed pins), but again I am not sure. If you are concerned about power, you can always make your micro-controller sleep when not working. That will save you a lot of battery juice. If you are willing to go all out, then you can design your own custom board using CC2541 and upload your code to it. This will save lots of money if you are going for a bulk but for hobby, I won't advise you to go that way.
Comment: @Whiskeyjack, I know 'what to code' but can I upload that code to cc2541? How can I do that?
Comment: I believe you can't "custom code" HM-10. You've a specific sets of AT commands which you can send via UART / USB, and get results on the same channel.
Comment: Thanks @dastaan, Then how can I remove arduino from my circuit to save power? Are there any ways?
Comment: [According to TI](https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/338308), it should be possible to reflash a firmware that allows development with BTool.
Answer: TL;DR version -- if you are trying to do this for just one chip and just yourself (i.e. not a product), it's probably not worth it since you'll need to spend at least $50 for a programmer.
The CC2541 is a combination of a BLE radio and 8051 with either 256K or 128K flash, and 8K of RAM.  It has 23 GPIO pins, some of which can be re-purposed as I²C, SPI, UART, and programming interface
The CC2541 comes from TI with firmware supporting HCI (Host Controller Interface), which is at a lower level interface than AT commands.  Some vendors, such as HMSoft, have taken the CC2541, packaged it on a board, and provided an AT command interface on top of TI's stack.  That is the HM-10 on your Shield.  The HM=10 can be bought separately, for example here.
Yes you can put application code on a CC2541, and use all of its I/O capabilities for your own use.  It can be re-programmed using two of the GPIO pins using a TI programmer called CC Debugger, which costs $50.
The gotcha is all of TI's documentation assumes you are using the IAR Embedded Workshop for 8051, which costs almost $3000.  (IAR has a free evaluation version which is good for only 30 days.)  I don't know how hard it would be to use one of the free 8051 compilers out there.
I have not used the HM-10.  Instead, I have used the Silicon Labs (formerly Bluegiga) BLE113, which is another small module with a CC2541 packaged inside a shielding can plus some capacitors and an antenna and costs the same as the HM-10 ($12).
The advantage of the BLE113 (besides the fact that it is shielded and FCC certified) is that instead of programming the 8051 in C, they have provided a language called BGScript, which is a BASIC like syntax -- you can literally write a BLE application in a few dozen or so lines of code.
Here is the complete BGScript code, for a BLE wireless thermometer that sends back the temperature to a host once a second:
<code>dim tmp(5)
dim celsius
dim offset
dim addr(6)

#init gap mod, bonding and start freerunning times on system boot
event system_boot(major ,minor ,patch ,build ,ll_version ,protocol_version ,hw )

    #Get local BT address
    call system_address_get( )(addr(0:6))

    # Write BT address to DI service serial number string
    call attributes_write(xgatt_dis_2a25,0,6,addr(0:5))

    #Set device to advertisement mode and allow undirected connections
    call gap_set_mode(gap_general_discoverable,gap_undirected_connectable)

    #Allow pairing
    call sm_set_bondable_mode(1)

    #set timer to periodically create an interrupt with interval of 1s
    call hardware_set_soft_timer(32768,0,0)
end

#timer expired
event hardware_soft_timer(handle)
    #Request for ADC reading
    call hardware_adc_read(14,3,0)
end

#ADC measurement ready
event hardware_adc_result(input,value)
    offset=-1600

    # ADC value is 12 MSB
    celsius = value / 16
    # Calculate temperature
    # ADC*V_ref/ADC_max / T_coeff + offset
    celsius = (10*celsius*1150/2047) * 10/45 + offset

    #set flags
    tmp(0:1)=0
    #set as float
    tmp(1:4)=float(celsius, -1)

    #write the temperature information to the GATT database
    call attributes_write(xgatt_htm_2a1c,0,5,tmp(0:5))
end

event connection_disconnected(handle,result)
    #in case if disconnect, return to advertisement mode
        call gap_set_mode(gap_general_discoverable,gap_undirected_connectable)
end
</code>
(There is also an XML file, gatt.xml that contains all of the GATT service and characteristic UUIDs etc.)
BGScript has access to all of the chip's peripherals, such as the GPIO pins, I²C, SPI and UART, and in the example above, the ADC.  You don't have to buy an 8051 development environment because they give you one for BGScript for free.  You still have to buy the $50 TI programmer though.
Answer: These days, Texas Instruments (TI) provide their Code Composer Studio (CCS) for free. It's a full-featured IDE capable of supporting a huge range of TI processors. The original poster asked a classic "open-a-can-of-worms" question which is to be commended. The reality is that a 'simple' BLE transciever is controlled by a complex System on a Chip (SoC) IC. It really is a complete computing platform on a chip with its own Real Time Operating System (RTOS) to help you get access to the features or peripherals the processor is connected to such as the RF module and any switches or sensors.
Programming an Arduino is child's play compared to programming an SoC, but then there comes a time in a developer's life when they must yet again face a mountainous learning curve in order to better themselves.
Comment: Do you have any *actual evidence* that CCS supports the CC254x?  Those parts originate with an acquisition and use an 8051 core rather than a TI-traditional processor core.  A comment mis-posted as an answer has today **alleged CCS does not support the CC2541** so could you either support your suggestion or withdraw it?
Comment: Unfortunately, as of today's updates, Code Composer Studio does *not* support the CC2541, or anything else with an 8051 CPU core. I just downloaded and updated to be certain.


Does RetroPie's automatic USB ROM transfer copy/overwrite previously copied ROMs?

Question: If I add a few more ROMs to my USB drive and plug it in, is it going to copy the entire collection again? If so, does it overwrite the files or keep them all? I am using a pi-3 with the latest version of RetroPie.
Answer: Only the files that do not exist on the RetroPie will copy over.
If the file located on our USB drive is ...roms/nes/Adventure Island.nes but the file ...roms/nes/Adventure Island.nes already exists on our RetroPie, it will not copy it and it will not be overwritten.
If, however, you change the filename to ...roms/nes/Adventure Island (USA).nes RetroPie will copy it, and you will have both, simply because the filename is different.
This is the default behavior, and the most logical.
Comment: I answered my own question because I learned how it worked through my own experience. Hopefully this will help someone else in the future.


Free action/no action encounter power available to all players?

Question: The DM I play with for encounters passes out these power cards that are either a free action or a non-action (can't remember) encounter power that lets you add to a skill check roll, add a damage die, add a to hit roll, or gain an extra minor action. I can't for the life of me remember what it is called, but he did say its out of either DMG or DMG2, though it may be simply something he designed himself.
Comment: sounds like a house rule to me. There are D&D fortune cards, but they are fundamentally different, you don't happen to have one that you could post do you?
Comment: I agree that those sound like Fortune Cards.  I was involved in a 1 shot where they were used, though I don't remember the exact mechanics other than that you had the card 'til you used it, then on some cue you could draw another afterward.  Here's an index of them so you can see if there are any you recognize: http://www.dandwiki.com/wiki/Fortune_Cards_%284e_Index%29
Comment: Those sound similar to the cards you use in Living Forgotten Realms.  If you list some card names and text I could tell you for sure.
Comment: I know it sounds like a fortune card, but its not (I have seen and used those). Rather than being different cards all of these options are on a single card that he printed and can be used in and out of combat (encounter power basically) to do basically give more oomph to anything from a skill check to an attack.  It may not exist within the game and be some kind of self-made powercard based on things stated in DMG 1 and 2 for 4e, but I wasn't sure and Thought I'd ask.
Answer: Hmmm, so I was wrong and it was completely DM fiat w/ him putting in a lot of time to create a power card for his house-rule. Sorry to have wasted your time.
As requested:
The program used to create the power cards: http://magicseteditor.sourceforge.net/
and
the power card templates: http://www.dungeoncrawl.us/power_cards/
I'll post again when I have an example of the exact power/ability I was talking about.
Comment: Actually I think it's a pretty neat idea for a mechanic so I am glad I got to know about that.
Comment: I will post a version of it (either just the text or if I can link a suitably sized scan of it/jpg I will as well) as soon as I can so you can see exactly what I was rambling about. It was neat because it wasn't game breaking in anyway and helped tie Rollplay and Roleplay together a bit more during combat.


Is it possible for a non-singular matrix to not have an inverse?

Question: I know that a singular matrix cannot have an inverse, but I was curious as to whether or not a matrix with a non-zero determinant can have an inverse. And from what I understand the requirement for a matrix to be non-singular is that it has a determinant that is not zero.
Comment: The answer posted is correct, so I won't post an answer, but my intuition here is:  Firstly a bijective function has an inverse; it's easy to prove that the inverse is linear.  Secondly non-singular means injective.  It's an interesting property of finite-dimensional vector spaces that there's some duality between range and null space; this commonly encoded in the rank+nullity theorem.  From which it follows that an injective map must be surjective too.
Comment: @Gaffney's comments are far better, in the sense of being explanatory, than the accepted answer. The accepted answer is literally correct, of course, but to my mind is not explanatory. (There is a frequent, unfortunate possibility in mathematics of proving that something is true ... without effectively _explaining_ why it is true. A further unfortunateness is that there is little professional pressure to do better, and also there's the pop mythology that "it's all about logic"... )
Answer: Every square matrix $\mathbf{A}$ has an adjugate matrix $\textbf{adj}(\mathbf{A})$ formed from the cofactors of $\mathbf{A}$, even if $\mathbf{A}$ is singular. The inverse of a square matrix is the matrix
\begin{equation}
\mathbf{A}^{-1}=\dfrac{\textbf{adj}\mathbf{(A)}}{\textbf{det}\mathbf{(A)}} \tag{1}
\end{equation}
Since, if $\mathbf{A}$ is nonsingular, then its determinant is non-zero, every non-singular square matrix $\mathbf{A}$ has an inverse defined by equation $(1)$.
Wikipedia reference: https://en.wikipedia.org/wiki/Adjugate_matrix
Answer: I will add my two cents to the answer above:
One has:
$\mathbf A\cdot \operatorname{adj}(\mathbf A)=\det(\mathbf A)\cdot\mathbf I$
whre $\operatorname{adj}(\mathbf A)$ is the adjugate of matrix $\mathbf A$
So if the elements of $\mathbf A$ are in a field (like real or complex numbers), nonzero determinant implies $\mathbf A$ is invertible with $\mathbf A^{-1}=\det(\mathbf A)^{-1}\cdot\operatorname{adj}(\mathbf A)$
However, if the matrix is over a commutative ring which is not field (for example $\mathbb Z$), $\mathbf A$ is invertible only if $\det\mathbf A$ is invertible in the ring (in the case of $\mathbb Z$, we should have $\det\mathbf A=\pm 1)$
In other words, it is entirely possible for a matrix with a non-zero determinant to not have an inverse. Just not for real or complex matrices.


Disallowing Free Shipping Rule if promo reduces cost to below minimum amount

Question: We have a free shipping promo on international orders $100 and over.  We also have free shipping on all domestic orders.  My question being, on international orders how can I set up the rule so that if the total is under $100 after the discount, they don't get free shipping?  Ex:  We run a Holiday Promo for 20% off store wide, item is regularly $100, with the promo the new total is $80.  Since that new total is under $100, I would like the free shipping rule to be unavailable to this customer.
Answer: You can set the minimum amount for the free shipping method to $100 and only mark the international countries to be allowed to use this method. You'd need to grab one of the other modules, flat rate for example, in the system to be used for the domestic shipping.
If you are already using the flat rate for regular shipping or somesuch, there's plenty of downloadable shipping modules that allow similar behavior.
See: http://www.magentocommerce.com/images/uploads/admin_shipping_freemethod.jpg


How to start sustainable living in UAE?

Question: I live in UAE. Here government has started few initiatives recently but I think there is far way to go. I am trying to be more thoughtful for the things I use but It is very difficult as whatever the alternate ways I look for are more time consuming or costly and I end up choosing non environmental friendly ways. What my essential question is that where to start ? Like I have switched from plastic cups to drink water from one portable cup but what are the small suggestions like that which I can embedded in my life swiftly.
Answer: There are lots of small things you can do. The list is potentially endless and really depends on what you consider to be 'small' effort. But to give a few examples:

Always carry a sturdy reusable bag with you and stop using single-use plastic bags
Fully switch off electronic devices when not in use (many devices go into stand-by mode and will still consume some electricty)
Turn down heating or cooling a bit to reduce energy consumption
Replace all light bulbs in your house with low-energy LED bulbs
Drive your car more efficiently (shift to high gear quickly, don't speed, use cruise control, check tyre pressure regularly)
Use public transport more often
Eat less meat
Buy less stuff
Stop watering plants and switch to permaculture
Plant trees or shrubs in your garden (suitable for your climate)

I'm sure, if you browse around on this website, you will find discussions about many more things you can do. Perhaps over time, when you are willing to also take bigger, more effective steps you could consider to:

Better insulate your house
Install solar panels on your house or join/setup a local energy cooperation
Buy an electric car or join/setup a car-sharing scheme
Stop travelling by plane
Talk to local authorities or politicians, share your concerns with them and ask them to take more action.

Whatever action you choose, do share your concerns and efforts with the people around you. That way you hopefully inspire them to also take action. If your friends and family in turn share their efforts it could end up having a snowball effect.
Comment: Question is tagged [tag:city-living], so *Drive your car more efficiently* or *buy an electric car* do not really apply, because city living does not need car ownership.  On the other hand, not travelling by plane is difficult when living in the UAE, unless not travelling to most of the world at all.  Maybe one could take a ferry to Iran and then travel to Europe or East Asia by train from there, but it's not easy.
Answer: I found few while surfing internet

Switch to portable cup.
Carry reusable bags.(clothe tote bag).
Carry steel spoon.
Use a sustainable razor.
Switch to bamboo brush.
Use reusable straws.
Try switching to menstrual cup.
Turn off lights and all electric products.
Compost your kitchen waste.
Think twice before shopping.
Buy long lasting things.
Reduce dairy intake.
Try using self made cleaners from orange and lemon wastes.
I am vegetarian for all the others go meat free (even one day a week!)
Replace cheese.
Try using public transports.
Switch to clothe tissues from paper tissues.(Because you can reuse them after use by washing them.)

I will keep updating list once I found few more things.
Comment: vote for a party that supports sustainable initiative, join associations that are promoting sustainability, change job for something that has a significant impact, or at least no negative impact, put your money in a bank that finances sustainable projects.
Answer: There are a lot small changes that can be done and one can be improved over time thinking sustainably. Important thing is to start and know it comes with some discomfort at the beginning.
Answers above have good tips. Here are few you can add to them that I personally developed:

Switch off lights in the rooms you are not in/be more dark tolerant overall/use less lights.
Replace balcony and porch lights with solar energy lights.
Don't run water when not in use even between gaps of brushing teeth/washing hands/washing dishes etc.
Be scarce when using household chemicals/use mindfully/think about fishes in the rivers/seas/oceans.
Don't overeat/eat just enough.
Plan food preparation ahead/this way it is easier to make environmentally friendly corrections and changes.

7.Enjoy walking/carrying groceries from nearby store.
8.Cook simple food which requires less energy consumption and is quick to be done.
9.Shop sustainably with companies and brands that are eco friendly/joining them you strengthen the message of sustainable living as well.
10.Invest in things/brands that are durable/easily reparable/have a good customer service.
11.Try to repair first till you throw something/always have household glue in supply.
12. Have at hand the list/contact numbers of good/reliable service men for household repair.
Sustainable living habits need to be  developed/discovered in the process as there are immense combinations, alterations and choices situationally.

How to start sustainable living in UAE?


Putting away 20% down payment money next 3 years to purchase home

Question: We are considering buying a house in next 3 to 4 years. I am putting away my wife's salary into the savings for next 3 years until we come up with 30% money in the bank to take care of down payment, closing fees and etc. Now the question is if I want that money to make me money right now while sitting in the bank for next 3 years, what is the best option to do so. Should I invest that money in mutual funds account or should I put that money into something else considering it's very low risk and beneficial. Any thoughts?
Comment: Does this answer your question? https://money.stackexchange.com/q/39156/36669
Answer: Imagine if you had put your funds into a diversified equity mutual fund 2 weeks ago. You might have lost ~15-20% of the value of your downpayment savings.
In a scenario where you need funds on the short term [and 3 years is short term for these purposes], you want to take on as little risk as possible. That means a savings account, or some form of a guaranteed savings bond, depending on your jurisdiction. Earning nothing over 3 years doesn't sound too bad compared with losing 20%.
Comment: @Jitbhatt1283 Your bank will make money if you do what they recommend (probably through account management fees + possibly investment fees if you buy an affiliated mutual fund). Take their advice with a grain of salt. If a car salesman 'insists' you get leather seats in your car, does that mean you must do it?
Comment: Savings account, CD's, guaranteed but low return, better than nothing, and better than risking your down payment in the short term.
Comment: @Jitbhatt1283, It is all a question of risk. Sure, you can put that money in something that could earn more, but it will -- by definition -- be riskier. As Grade Eh Bacon notes, you could have put it in the Dow 3 weeks back in the hopes of making more, but it obviously was riskier in that you would have lost a significant %. Your plan is to have that money in 3 years for a home down payment. If you want to put that 3 year plan at risk, then sure, you may be able to make more money. But if you want to be sure to have it in 3 years -- less risk -- you need to accept lesser returns.
Comment: Appreciated. However, in the next 3 to 4 years if I really wanted do something with the funds that would generated some cash flow over the period of those years, what's my best option. These funds are strictly my wife's salary going in and running the household on single salary as disciplined. Just wanted to understand when bank tells me why don't you do something with your money instead of sitting in savings account and I told them the purpose, they still insist invest. I am so confused at this point
Comment: @Jitbhatt1283 What does that mean, "they insist"? Normally, it's up to you what you do with your money. You don't owe them an explanation.
Answer: Well, the U.S. overnight bank rate is 1.25% but that rate is not currently available to investors in short-term government bonds and is not expected to survive much longer in special-rate bank deposits.
Since a fund or a savings account is required for on-going deposits, then the likely choices are a 2.2 year duration investment-grade corporate-bond fund, a 2.6 year duration TIP fund, and a 0.57 year duration high-yield bond fund.


Are there any comics where Superman is influenced by several types of Kryptonite in the same time?

Question: I've seen and know some types of Kryptonite and know what its effects are, but is there something canon (or even non-canon) that shows what effects can happen when various different types of Kryptonite influence Superman at the same time?
Comment: And some indications of what happens when they're mixed; http://en.wikipedia.org/wiki/Kryptonite#Forms_of_Kryptonite
Comment: http://img1.wikia.nocookie.net/__cb20090603171617/superman/images/8/87/Kryptonite_Varietals.jpg - An overview
Comment: I also imagine that whatever effect that such an amalgam would have would be influenced by whatever the effect of the Red K would be were he exposed to it by itself.
Answer: Yes, there are several times when Superman is exposed to multiple kinds of Kryptonite:
Red and Green Kryptonite dust seems to rob him of his powers permanently (Superman #152)

A ray comprising Red and Green Kryptonite causes him to develop a third eye in Action Comics #275

Red and Gold Kryptonite gives Superman 'super-amnesia' in Superman #178

There are also two "imaginary stories" involving mixed kryptonite sources.
In Superman #192, Superman is subjected to an alloy of Gold, Red and Green Kryptonite. The effects are that he has amnesia and loses his powers.

In Superman #162, Superman exposes himself to the rays of Red, Gold, Green and Blue Kyrptonite. The effect is to literally split himself into two identical (and hyper intelligent) Supermen.


Have there been any successful "airdrops"?

Question: Starting with Auroracoin, a lot of coins aimed to perform an "airdrop" and distribute their coins to certain groups of people. I am wondering, have there been any successful airdrops? If so, how did they accomplish this task? I was trying to follow these at some point, but I have never heard of any coin pulling it off.
Comment: I am very interested in this too. Maybe you should have a look at stellar (they doing it bound to facebook users and they are at least somehow successful). I made a proposal for a pure "airdrop"/ basic income currency here: https://forum.ethereum.org/discussion/1598/basic-income-circles-reputation-market-based-approach-to-solve-the-identity-problem-sybil-attacs#latest
Comment: @user599464 Well, Facebook authentication is only so reliable. I was also thinking about some basic income currency in regards to this.
Answer: I remmeber there was BitcoinTalkCoin - the one with BCC ticker, in fact there were few sharing the same idea). They successfully "airdropped" the coins to BTT users, registered before the coin anouncement. I received some myself :) although it was pennies, you can say that the mission was accomplished.
Answer: From what I can gather, there were a bunch of people who were able to claim auroracoins through the airdrop using SMS/Facebook based on various forums and social media outlets. In that sense the airdrop was successful. But who knows how many of the airdrops were legitimate. For all we know, most of the airdrop might have gone to the creators of the coins so they could cash out. I haven't seen any evidence against this.
Any airdrop that is targeted towards a local population is going to be difficult and costly to pull off because there is no way to easily verify people's identity. Furthermore, how can you verify that the coin's creators aren't claiming the airdrop to themselves? In my opinion, the creator of these coins are using "airdrops" to build up hype and don't really have any practical way of handling the airdrop. Or worse, they fully intend to claim most of the coins themselves and sell it off before it crashes. In a sense , it's an age old pump and dump scheme applied in the alt coin arena.
Comment: Actually, Auroracoin and other "national crypto currencies" supposedly used national ID systems to verify people's identities.
Comment: From what I read, they did not. It doesn't make any sense how they would do that anyways. How do you verify that whoever is claiming their ID is not an imposter if the ID is publicly available?
Answer: Byteball and Stellar did quite well. Byteball is new and the marketcap is already $100M. You can find details here https://wiki.byteball.org/airdrop
Comment: Could you please give us a few more details? How did they select the recipients? What is their niche or makes the coins interesting? How do they compare to other better known cryptocurrencies?
Comment: It uses DAG which is similar to IOTA. It's distributed to all BTC or BYTE holders. I find the distribution completely unique and genius. You can find all the details on their Bitcointalk thread. https://bitcointalk.org/index.php?topic=1608859.0
Comment: @GeorgioGeorgiev, It would be better to edit your answer to include the requested details.  It's much better than having good answers sitting down in the comments.  You will also have enough space to summarize the bitcointalk thread, which is much better than just linking to it.


Difference between "garbage" and "trash"?

Question: What's the difference between garbage and trash? Is the difference significant?
Comment: Garbage is what you program into a computer. Trash is what you try to keep your daughter from dating.
Comment: Wait what, no love for *rubbish*, *litter*, *junk*, *refuse*..?
Comment: @RegDwight
Well, this question is sorta specific to AmE
I'm not hating on BrE! :D
Comment: Ah yes. Mkay. I took the liberty of adding the AmE tag.
Comment: This is highly dependent on locale and culture.  In some cities trash and garbage must be separated, in others, not.  Where they aren't separated the choice of terms is likely to be based on family background as much as anything.
Answer: I think the saying "one person's trash is another person's treasure" helps answer this question. Trash more often has the meaning of something discarded, whereas garbage more often carries the meaning of true refuse, often food waste. Of course, food waste can be a treasure to a gardener working on a compost pile, but I'm speaking generally here. It's not a very significant distinction, and the terms are often used interchangeably, but there are instances when they are not synonymous.
This excerpt from a 1986 Orlando Sentinel article titled "Trash Vs. Garbage: Any Big Difference?" supports this general distinction in meaning:

There was a little note stuck to the can. It said, in essence, that my refuse hadn't been picked up because -- and I quote -- ''trash and garbage had been mixed.''
I hate making mistakes like that. I didn't close the cover on a book of matches before striking. It was weeks before I got over the guilt.
I called Georgia Waste Systems, where I have my trash/garbage account, to apologize. They were very nice and said a lot of people make the same mistake I did and they were not planning a lawsuit.
As long as I had somebody on the phone who could explain, I asked, ''What is the difference between trash and garbage?''
''Garbage,'' the woman said, ''are things that come from the bathroom or kitchen.''
''You mean like bread you leave out for months and green things start growing on it?'' I asked.
''Precisely,'' she said.
''Trash,'' she continued, ''is basically anything else. We do not pick up leaves, for instance, or old furniture or boxes of materials that were collected when somebody cleaned out their attic.''
Comment: Probably worth saying that "trash and garbage had been mixed." won't be widely understood; the distinction isn't firm enough for that phrase to make sense. Normally you'd say something like "food and non-food waste had been mixed".
Answer: The distinction my grandparents made was that they burned their trash but not their garbage. If this was ever the general rule, it no longer is.
UPDATE: There's some evidence for this definition in the 1896 Webster's Collegiate Dictionary, although there definition (2) doesn't include waste paper, which my grandparents definitely included in trash.

Trash: 1. That which is worthless or useless; rubbish; refuse. 2. Esp., loppings and leaves of trees, bruised sugar cane, etc. 3. A worthless person.
  Garbage: Offal; refuse animal or vegetable matter from a kitchen; hence, anything worthless or loathsome.
Comment: Trash was the stuff they disposed of by burning themselves. Garbage was the stuff they paid somebody to haul away.
Comment: can't you technically burn anything?  or do you mean things that are flammable, per se?
Comment: That's interesting, never heard that one before.
Comment: that's interesting; i suppose most people don't burn any waste nowadays, though.
Comment: @bcc32: It's probably illegal to burn your waste nowadays, which is why I commented that this may not still be the rule. It also may not have been the generally accepted definition ... I don't know.
Comment: This is interesting. In many places, yard waste burning is still common and legal within strict guidelines like [these](http://www.lehighfd.com/life-safety-division/burning-regulations/). Notice there that there is some effort put into defining yard _trash_ and distinguishing it from other "trash." It's assumed, however, that _garbage_ is illegal to burn. I think in most of these ordinances, you'll find an effort to switch to the term _yard waste_, probably to avoid the ambiguity of _trash_.
Answer: I am almost 80 years old.  When I was a child, I remember we had two collections, trash, and garbage.  The trash was cans, paper, etc.  Garbage was what we used to put into a strainer in our sinks before we washed dished (garbage disposers hadn't been invented yet?)  The trash went to a "sanitary-fill" where piles of trash were burned, and then metal cans were extracted with a electro-magnet.  Then what was left was pushed over into a canyon and covered with dirt.  The garbage was given to places that raised hogs and pigs.  Also, the garbage can was a small container with a lid to keep off the flies, but most of the trash containers were not covered.  Well, that is the way it was seventy years ago!
Answer: Garbage is organic (e.g. food scraps, etc.).
Trash is inorganic (e.g. bottles, cans, etc.).
Comment: Who says? Is this a regional dialect?
Comment: A garbage-collector friend of mine specified the distinction as "garbage is wet, trash is dry", and as explained further is basically this organic/manufactured distinction.
Answer: It seems to me that "Trash" is more of a slang term.  I suppose they are both an alternative for "refuse".  They are somewhat contextual, as well.  For example:

That outfit makes you look trashy.

In this sense, the word trash is used to imply the wearer of the clothing appears to be disheveled, careless, or provocative.  Personally, I wouldn't say,

That outfit makes you look like garbage.

The context has shifted to imply the wearer now resembles a large pile of refuse.  I seriously doubt this is the case.  I suppose they may be modelling the "Derelict" line of fashion clothing, featured in the Zoolander movie.


How do you wait/join on a WCF Web Service called from Silverlight?

Question: If you call a web service from Silverlight like this:
MyServiceClient serviceClient = new MyServiceClient();
void MyMethod()
{
  serviceClient.GetDataCompleted += new EventHandler<GetDataCompletedEventArgs>(serviceClient_GetDataCompleted);
  serviceClient.GetDataAsync();

  // HOW DO I WAIT/JOIN HERE ON THE ASYNC CALL, RATHER THAN BEING FORCE TO LEAVE THIS METHOD?

}

I would rather wait/join with the asych service thread inside "MyMethod" rather than leaving "MyMethod" after calling "GetDataAsync", what is the best way to do this?
Thanks,
Jeff
Answer: No you cannot do this way. You will end up in a deadlock. GetDataCompleted is called by the mainthreed. The same threed thait is waiting in WaitOne.
Answer: I have to ask; why?  The point is to provide your user with a fluid experience and waiting on a web service call will not necessarily do that.  I suppose you want the full block of content to load before the Silverlight control loads.  In that case, I would turn to caching the content rather than forcing the client to wait indefinitely.
Answer: To do this you would use a ManualResetEvent in your class (class level variable) and then wait on it.
void MyMethod()
{
  wait = new ManualResetEvent(false);
  // call your service
  wait.WaitOne();
  // finish working
}

and in your event handler code
void serviceClient_GetDataCompleted(...)
{
  // Set values you need from service
  wait.Set();
}

Answer: You could also use a lambda and closure to get similar behavior:
serviceClient.GetDataCompleted += (s,e) =>
{
  // Your code here
};
serviceClient.GetDataAsync();

Answer: If you had a base class provide the mechanics of building a WCF channel, it could then be used to build the BeginX / EndX methods for a async call.
public class ServiceFooCoordinator : CoordinatorBase<IServiceFoo>
{
    public IAsyncResult BeginMethodFoo ()
    {
        IAsyncResult ar = null;
        IServiceFoo channel = null;
        channel = _factory.GetChannel();

        Begin( channel, () => ar = channel.BeginMethodFoo( null, channel ) );
        return ar;
    }

    public Bar[] EndMethodFoo ( IAsyncResult ar )
    {
        IServiceFoo channel = null;
        channel = _factory.GetChannel();
        return channel.EndMethodFoo( ar );
    }
}

Which can then be used in a method:
 ServiceFooCoordinator _coordinator;

 var asyncResult = _coordinator.BeginMethodFoo();
 try
 {
   var result = _coordinator.EndMethodFoo( asyncResult );
 }
 catch ( Exception )
 { }

Which gets you your asynchronous call in a sychronous manner.


Create request with SOAP ui

Question: Is it possible to create soap ui request with data ? right now I know how to create new request which gives you template what you should send to your webservice (which is read from you wsdl), is there a way so your requests fills with data based on type(ex: String,Integer, Date) from wsdl, from soap ui or any other test tool ? thank you
Answer: In Soap UI 4.5.1 there's an option under preferences that once set will auto populate new requests with dummy data that is type safe instead of the default '?'.
File->Preferences->WSDL Settings-> Tick option "Sample Values" and hit OK.
Comment: This! Thank you, you saved me a ton of time! Donating virtual cookies!
Answer: Yes, you can use SOAPUI to complete this task. you can fetch your data from several sources like Excel,plain csv file,Database liks DB2,POSTGRES. You can also write your groovy scripts to control the flow.Various things you can do to achieve this...
Answer: You can enter data directly into the XML request generated by SoapUI, you can write scripts to populate data, or if you have the Pro version, it gives you a GUI form, based on the request, where you can simply type the data. i.e. it makes a data-entry screen for you.
The pro version can also pull data from databases, generate data from a string list, etc.. for example, I recently needed to send several thousand SOAP payloads with dummy data for firstname/lastname, etc.. So I made up two string lists, one with first names of past and present NFL quaterbacks, one with last names.  I had the data generator in SoapUI (Pro) randomly select a string from each, and submitted it in a stress test for 1000 iterations. The results were very useful, yet very amusing, giving names like Drew Montana.

Create request with SOAP ui