MERN stack authentication and authorization

Question: I am creating a MERN(Mongo, Express, React-redux, Node) stack app where I am adding authentication, authorization and access control features. I know how to implement the authentication service but don't know how to implement the authorization and access control. For example: when user login then he will be able to create, edit and delete todo on his dashboard and no one will be able to see or edit that. How can I implement that? Any links, code or help would much be appreciated. Thanks a bunch!
Answer: This is a great question. And the answer is long :-) I just replied to a similar question here so you could start reading that.
TL;DR
What you are looking for is called externalized / dynamic authorization management. The formal model is called Attribute-Based Access Control (abac / Wikipedia). It was formalized by the Nat'l Institute of Standards & Technology (NIST).
More in depth
You stated:

When user login then he will be able to create, edit and delete todo on his dashboard and no one will be able to see or edit that.

You need to write a policy using attributes that will allow users to do such things and prevent them from doing other things. If we rewrite your requirement, it becomes:

A user can create, edit, and delete a TODO item on a dashboard they own.
No one can see items on a dashboard they do not own.

Looking at the requirements, you realize you have:

a subject (or user) with their attributes (e.g. role, department...)
an action (e.g. view, edit, delete...)
an object or resource (the "TODO" item) and its container (the dashboard).

This means you can start rewriting your requirement in terms of attributes. This becomes:

A user can do action == "view" on object of type == "TODO" if user.username == object.dashboard.owner

You can then add:

deny all access if object.dashboard.owner != user.username

The language to write such policies is called ALFA (alfa / Wikipedia, the abbreviated language for authorization. It's a standard defined by OASIS XACML.
Once you've defined your policies, you'll need to deploy them, run them, and enforce them. This is where the ABAC architecture kicks in:

Policy Administration Point (PAP): where policies are written
Policy Decision Point (PDP): where policies are run / executed
Policy Enforcement Point (PEP): where policies are enforced - this could be an API gateway, an interceptor...
Policy Information Point (PIP): where additional metadata & attributes can be retrieved

The question then becomes: where do you want to enforce? What does your MERN architecture look like? Do you want to authorize:

in the web UI? (functional authZ)
in the API layer (transactional authZ)
in the data layer (data-centric authZ / filtering)

For instance, do you want to filter data from MongoDB and only show allowed results? Do you want to apply authorization on the API layer? API gateways (e.g. Kong) can help you achieve that with authorization plugins e.g. Axiomatics-Kong.
There are open-source and commercial ABAC implementations and a standards body too (I'm the editor of some of the specs such as the JSON/REST request/response)

A Java Policy Enforcement Point in JSON/REST - open source
AuthZForce - an open-source PDP
Axiomatics - a commercial ABAC platform


Feasibility of using Ring Signatures with CoinJoin Technique

Question: There is a Ring Signature implementation in C++ by Libbitcoin team. We can find the details in the following GitHub repository. Is it feasible to use Monero like Ring Signatures together with the CoinJoin Technique in Bitcoin without a soft fork on the core protocol.
Answer: Using ring signatures off-chain to form a coinjoin transaction sounds hard, especially since because BTC doesn't have ring signature support without a hard fork or a soft fork.
You may find Cashfusion, an instance of CoinJoin shuffling, interesting, it's fully applicable to BTC and it uses TOR, which is simpler than Ring Signatures.
Comment: Thank you so much @MCCCS. Cashfusion and Cashsuffle is very interesting. I will check it out!!


Expanding/non-expanding space

Question: Due to inflationary cosmology space  on a large distances expands. However on small distances (locally) we do not record any expansion. Thus there must be a region, domain or a "border line" which separates expanding and non-expanding space. How do we detect or calculate the border between expanding and not expanding space? and what is the physics in that region of transient from non expanding to expanding space?
Comment: Related: https://physics.stackexchange.com/q/2110/2451 and links therein.
Answer: The current rate of expansion according to our most accepted model is around $68\ \mathrm{(km/s)/Mpc}$. That is, every second, a distance of 1 megaparsec will gain about 68 kilometers. 1 megaparsec is around $30.86$ quintillion kilometers. On distance scales relevant to humans, let's say around $30\ \mathrm{AU}=4500000000\ \mathrm{km}$, you'd expect that you'd gain about $0.313\ \mathrm{km}$ per year. That's less than our current measurement uncertainty, but you'd think that we'd notice it after a few decades, right? Problem is that our little corner of space is gravitationally bound. The density of matter around us is sufficiently high to keep the expansion of space to a minimum. It's not really necessary for there to be a point where expansion stops entirely; it's effects on small scales are so weak that the smallest force is enough to overcome it.
So is there a border line? Perhaps. Some cosmologists will tell you that near us the density of energy is greater than the critical density, which means space will eventually stop expanding and start contracting (technically only true if that space not only has closed curvature, but also only if that curvature is large enough to induce contraction, which isn't a guarantee (pay no attention to the technical bits in the asides)). Other cosmologists will tell you that there aren't any regions (within reason) that we can identify as non-expanding space. Assuming a flat spacetime, an over-density of matter slows expansion more, but never completely stops it.
Really, it's not something we could even measure. Our instruments are not sensitive enough to measure the rate of expansion across distances the size of the Solar system or smaller even assuming the full blown value of expansion ($68\ \mathrm{(km/s)/Mpc}$).
That should answer the question of the difference in physics. There isn't any measurable difference. If the effects of full bore expansion are too minimal to notice on human scales, then we shouldn't expect any difference in the physics on those scales for regions that hypothetically experience no expansion. And if there are no such regions, then this all becomes an exercise in imagination, but fun nonetheless.
Comment: @GeorgvonBrzeski Yes, well I'm going to stick with only including what most textbooks say because this site prioritizes mainstream accepted theories, regardless the validity
Comment: @GeorgvonBrzeski I'm not sure what point you're trying to make. As I said, this site prioritizes mainstream accepted physics. It doesn't matter if that physics is right or wrong. The site merely presents what the current trends of physics follow, it doesn't judge the validity or come up with new physics. That said, as a cosmologist, I'm going with what I know from texts and my own personal experience with the mathematics because that is currently the most accepted physics. If you want to change that, write a paper and get most cosmologists to follow it.
Comment: That is what is written in all textbooks on the subject. The illusion of so called space expansion started from mistake of Edwin Hubble when he interpreted his data via Doppler in order "to fit" Friedman solution. Geometry of space is Lobachevskian and locally can be approximated by Euclidean geometry. In Euclidean geometry parallel geodesics ( light rays) stay at fixed distance . In Lobachevskian geometry parallel geodesics spread apart at exponencial rate.  That is why on local scales you do not see "space expansion"  and  large  enough distances are needed to see geometric red shift.
Comment: Jim , textbooks are written by people and people make crucial mistakes. Two Nobel prize laureates rejected principles NMR imaging because textbooks on optics say that having a wavelength L you can resolve the most L/2. That is correct in all optical conventional business. NMR uses L= about 300m so when inventors claimed to resolve centimeter details that sound they never red textbook. Problem is that L=300m but imaging is done via the Radon transform. So inventors went to  investors and built the machine known today as Computed Tomography Scanner.

Expanding/non-expanding space


Would a magnetic rod through Mars shield it from solar wind?

Question: Would a magnetic rod going all the way through Mars shield it from solar wind?
Answer: Theoretically yes.
It would have to produce a magnetic field of sufficient strength of course.
The Earth's magnetic field at the Earth's surface ranges from 25 to 65 µT. Given that Mars is approximately 50% smaller than the Earth and at a greater distance from the Sun, a smaller field would probably be sufficient.
The benefits of the shielding would be:

The level of radiation at the surface would be greatly reduced thus making Mars a safer place to live.
Mars would be able to hold a thicker atmosphere than it has now. One of the reasons that Mar's atmosphere is so thin is due to the solar wind actually stripping away the atmospheric gases.

If such a rod could be built and installed it would be a constant strength and would do a better job of protecting Mars than Earth's field does of protecting the Earth as that fluctuates and is "due" for one of it's periodic reversals.
However, it's probably beyond our current technologies to build such a rod.
Answer: You needn't necessarily run a rod all the way through. A wire wrapped around the circumference of Mars would do the job as well.
Since a magnetic dipole (which is basically what a bar magnet is) can be thought of as a current loop, wrapping a wire around Mars would achieve the same thing.
I have to point out though, that this solution is not very feasible at all. The magnetic field produced by a current through a loop is given by $$B = \frac{\mu _0 I }{2 \pi r} \text{Tesla}$$ Therefore for a magnetic field of ~ $1 \mu T$ and the radius of Mars being $3397$ $km$, we'd need a current of about $100000000$ $A$ ($10^8$ $A$) which is a massive amount of current to generate and sustain.
Comment: Why a wire around the equatorial region? What about two loops at (+ and -) 45 degree latitudes?
Comment: Energy in the solar wind per km^3 is probably far less around the orbit of mars vs earth. So maybe because of both less energy in solar wind and the fact that mars is smaller might require far less strong of a magnetic field. And the current to creat it.


Downloading a specific version of solc within a Docker image

Question: I am working with the release of Solidity v0.4.25 for it works well with py-solc. When running on a local machine the codebase works quite well with 0.4.25. My issue currently is to get the codebase running on a Docker image with Ubuntu. I initially tried installing the Ubuntu PPA but the release that is currently out does not work with my code. Anyone know how to get 0.4.25 installed via the Dockerfile? (first time I have ever asked a question on exchange so quite desperate here).
Answer: If you want to get 0.4.25 version of solc installed in your Docker-image, you could do something like this:
<code>FROM ubuntu
...
RUN curl -o /usr/bin/solc -fL https://github.com/ethereum/solidity/releases/download/v0.4.25/solc-static-linux \
    && chmod u+x /usr/bin/solc
...
</code>


What is braising?

Question: I have a habit of buying braising steak, when intending to stew some beef (be it to eat as a stew, or to later use as a pie filling), but I've always wondered what braising actually is?
Answer: Braising uses minimal liquid to achieve a moist, slow, cook. Stew is soup with attitude: it's much more liquid, with chunks of the star of the show floating in it.
Comment: That works as a difference for me...
Answer: From The Professional Chef:

To braise meat, first sear it in hot fat to the desired color, then simmer it in a covered vessel in stock or another cooking liquid. The amount of liquid used in the braise is crucial to the success of the finished dish.
One of the benefits of braising is that tough cuts of meat become tender as the moist heat gently penetrates the meat and causes the connective tissues to soften. Another benefit is that flavor is released into the cooking liquid to become the accompanying sauce, thus virtually all of the flavor and nutrients are retained."
Comment: That sounds a bit like how I'd stew it, which is where I wonder where the distinction is?
Comment: Sounds to me like it's nothing more than the quantity of liquid -- adding liquid would turn a braise into a stew, I guess.
Comment: @Rowland - stew would (more often) be cubed meat, braised would more likely refer the a larger cut done at once (e.g. pot roast)
Comment: the rule of thumb is: if the meat comes from a part of the animal that moves a lot , it'll be tougher and therefore braise it; otherwise roast leaner cuts.
Answer: Braising is a combination of fast dry heat and long slow moist heat.
The fast dry heat is able to create the flavorful crust on meat in ways that slow heat can't. The dry heat can be extremely hot air in the oven, direct radiation from a broiler, or contact with a hot steel or cast iron pan.
The long slow moist heat creates a steaming process. Importantly, the meat is NOT submerged and boiled in the liquid. The long heat helps break down the tough connective tissue, and the steam helps the meat not dry out. The steam, rather than immersion means more flavor stays with the pieces of meat instead of leeching out into the broth like a stew.
Braising is best used for meat that is too tough to use as good steak, but good for more than just becoming stew meat.
Comment: I'd say the defining difference is in the size of the meat pieces.  A Swiss Steak for example, is a braised tough steak.  If you were to chop the steak first, you'd be making stew.  Braising - Whole cuts, to be presented whole. Stew - chopped cuts, to be served in a bowl or over potato/rice/barley

What is braising?


Marlin: possible to set ZMin limit when ZProbing?

Question: Question: Can a "ZMin-while-probing" be set?
Meaning a minimum Z height the printer bed can move to, while Z Probing.
Purpose: For safety reasons should the probe switch not fire for some reason.
--
in Marlin Configuration.h, I see you can set the height of the Z Axis before deploying the ZProbe:
<code>#define Z_PROBE_DEPLOY_HEIGHT 35</code>
In the context of this question, this is effectively a "ZMax-while-probing", i.e the lowest possible the print bed will be before Z Probing commences.
I am looking for a "ZMin-while-probing" equivalent.  The reason for this is just an added safety check - I know that if the probe switch doesn't fire by Z<=25, then it is not going to, and with this particular printer configuration, that would result in the Z Probe being driven into the printer bed.
Does a setting already exist to create a sanity-check here?
Answer: You have not stated the version of Marlin you are using. I will assume we are discussing the latest Marlin 1.1 RC8.
There is no longer any Z_PROBE_DEPLOY_HEIGHT but in earlier Marlin versions it did not function as you think; it was used to signify the amount of Z travel to execute prior to Z probe deployement. This is to ensure available space for servo-mounted, sled, or other types of "stowed" probes.  This was not a limit to the Z travel, but the amount of Z travel to always execute before begining homing.  If a printer without Z_MAX_ENDSTOP is left at maximum travel position, using non-zero Z_PROBE_DEPLOY_HEIGHT could crash a bot into the Z maximum end position.
In these previous versions of Marlin, the homing height was computed by a combination of the above constant adding and subtracting to/from some others, which has since been replaced by the simpler and singular Z_HOMEING_HEIGHT (which works indpendant from the new Z_CLEARANCE_DEPLOY_PROBE):
<code>//#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing
(G28) for Z clearance above the bed, clamps, ...

#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
</code>
The absolute value of the maximum bed positions are used in Marlin as sanity check to ensure no axis moves greater than this amount in one movement in either positive or negative direction:
<code>#define Z_MAX_POS 200
</code>
If your probe does not function correctly, no ficticious Z_MIN_WHILE_PROBING will prevent a faulty probe from causing a head crash into the bed, so it is not implemented, allowing the Z_MAX_POS sanity check to prevent the Z axis stepper from continuing to run indefinitely during a fauly probe condition.
If your Z_MIN_WHILE_PROBING were implemented, if the printer were powered off (or Marlin crashed, etc) with the head at any Z distance greater than Z_MIN_WHILE_PROBING there would be no mechanism to begin a print on the next poweron, since Marlin will never move in the negative Z axis except during G28 probing and after probing completes successfully.  The only way to recover in this case would be for someone to continually attempt to both home the printer then power-cycle, moving the head Z_MIN_WHILE_PROBING closer to the bed each iteration. This would be an unacceptable user exerience.
Further, if Z_MIN_WHILE_PROBING were implemented, the only percieved safety measure it would add is that during probe failure, the Z stepper would crash into the bed and continue to run for only Z_MIN_WHILE_PROBING stepper rotations instead of Z_MAX_POS rotations.  Regardless, the bed would be impacted so there is hardly any additonal safety added and a stepper driver should not overheat or cause any more damage (other than what was already done to the bed) in a single Z_MAX_POS length of rotations.
For more piece of mind during homing, you may use the Z_MIN_PROBE_ENDSTOP feature with a normally-closed limit switch wired to an available pin on your control board:
<code>// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
//#define Z_MIN_PROBE_ENDSTOP
</code>
Then use the Z_MIN_WHILE_PROBING feature to move the head above the Z_MIN_PROBE_ENDSTOP home position to perform probing.  This will ensure that the printer will crash for only Z_PROBE_OFFSET_FROM_EXTRUDER Z stepper rotations if the probe malfunctions:
<code>#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]
</code>
In summary, to prevent the head from crashing into the bed, you must ensure your Z probe is functioning correctly :)


Can odds ratios increase if you include more variables?

Question: Suppose one wants to compute the odds ratio of a disease for a person in group $A$ versus that of a person in group $B$. Suppose we consider the following: (i) include age in the odds ratio calculation, (ii) include age and height in the odds ratio calculation. Is it possible for the odds ratio for (ii) to be much greater than the odds ratio of (i)?
Answer: Yes, it is possible for group (ii) to be greater. (whether it's MUCH greater would depend on your definition)
For an intuitive point of view, (i) averages out the effect of height among the people in the groups, but (ii) allows the effect to vary.
If you are to look at the calculation (taken from wikipedia on logistic regression), the model is $1/(1+e^{-z})$; so as $z$ gets larger, the odds would increase as well.
Hope this helps.
Answer: Yes, this is entirely possible. What you're talking about is the confounding of the association between Group and Disease by in this case height. It's entirely possible for confounding to push the observed association downward, and when corrected for, to have the odds ratio rise. Indeed, if the confounder is negatively associated with the exposure and the disease, this should be what happens.


MAC from PRF secure under different restriction

Question: Suppose, we have a secure PRF $F$. Then can there be a MAC Scheme $I=(Sign, Verify)$ using F such that $I$ is insecure, but I is secure under the restriction that all the queries for MAC challenges are different?
Comment: "under the restriction that all the queries for MAC challenges are different" that doesn't do much, unless the MAC algorithm does not just depend on the message; you'd otherwise get the same value back each time, which doesn't give the adversary any advantage. Either I'm not getting it or the description of the MAC algorithm lacks detail.
Comment: yeah, we have to create such a MAC, where it makes a difference. And obviously, it must be randomized otherwise it won't make any difference.
Comment: So most probably, we will first get different tags for the same message,m and then  we should be able to create a new tag from the tags we have for the given message
Comment: So if you'd have a semi-random value that you can influence somehow and identical messages then you can possibly use that to create an insecure MAC. But that's just my intuition.
Comment: can you explain a bit more about the construction
Comment: Could you tell us the origin of this question?
Comment: One dumb approach: a "stateful" MAC that uses $F$ for signing as normal. The state keeps tracks of the message with some "efficient" data structure. Upon detecting a duplicate message, output the key.
Answer: Let's leave aside that something like this would still not be considered secure from a cryptographic point of view, since we generally assume an arbitrary (usually probabilistic polynomial-time) attacker.
I assume that the question is asked in the sense that an adaptation of the MAC scheme is sought, which is safe under the given assumption. Let's assume we got $KeyGen$ $k \leftarrow \{0,1\}^n$ with $n$ being the security parameter. Assume $t \leftarrow MAC(k, m) = F(k, m)$ for some message $m \in \{0,1\}^*$. And Assume $b \leftarrow Vrfy(k,m,t)$ with $b\in\{0,1\}$, where 1 is valid and 0 is invalid. This is, given your assumption, secure, if for all queries, all messages are different. But assuming an arbitrary adversary, this is not secure. Thus, we now want to make it secure.
The idea for that is a nonce (number used only once) or a random value (which has a negligible collision probability). Using this we could build $t \leftarrow MAC_r(k,m,r)$ with $r \leftarrow \\\$ \{0,1\}^*$ or $t \leftarrow MAC_n(k,m,n)$, where $n$ is e.g. a counter.
I hope this helps, because honestly I don't quite understand your question completely.
Note: I assume you can proof the security of the previous construction using a reduction proof, reducing the security of $MAC_r(k,m,r)$ or $MAC_n(k,m,n)$ to the assumed security of $MAC$.
Comment: We know the definition of original MAC Security, that we can query polynomially many $x$ and the challenger will return $MAC(k,x)$ where $MAC$  may be random or deterministic. And the adversary will after all the queries return a pair $m,c$ and win if Verify(k,m,c)=1.  We will say that the MAC is secure if the advantage of any polynomial time adversary is negligible. Now we define a slightly weaker definition of MAC Security where all the setup remains, the same as it is but differs only in queries. Now we can not query the same $x$ more than once.
Comment: Now we want to find a $MAC$ from a PRF $F$ such that MAC is weakly secure but not secure under the original security definition.Is this clear now?
Answer: One example would work as follows at a high level: The MAC scheme is built from the PRF $F$, and another probabilistic MAC scheme $M$ and a counter $c$.
For MACing a message $m$: Compute a key $k_M \xleftarrow{$} F(m)$, then send output the mac $\tau = (k_M^{c,m}, M.\textrm{sign}(k_M, m))$ and increase the counter $c$. $K_M^{c,m}$ refers to the the first or second half of $F(m)$ depending on the parity of $c$. Other levels of leakage may also be considered.
As for security, as long as a given message is queried only once, then the adversary only gets half of the key of the "inner" MAC.
I would conjecture that in such a setting, the advantage of the adversary against $I$ is upper bounded by a PRF advantage on $F$, a MAC advantage on $M$ and term of the form $\frac{1}{2^{n/2}}$ for the probability of guessing the second half. (I didn't actually work through this rigorously).


What are some examples / case studies of apps that did better due to improved UX?

Question: Are there any good examples / case studies of mobile applications revamped (improved UX) that have a higher conversion due to the UX adjustments?
Comment: Hi Catandmouse. There are lots of examples out there. Unfortunately UX.SE isn't a good medium to point to such things. "lists of [something]" are  generally off-topic here, since there is no "correct" answer to a bunch of lists that are all equally valuable.
Comment: This is a great shame. This is one of the few questions that could have demonstrated data as a strong point, in more ways than one. All the "show me data or I don't believe..." questions are usually pointless. This one is not.
Answer: Most studies on this seem to come down to navigation, as that is usually the biggest difference between mobile and desktop variants.
Conversion for mobile often boils down to how you present certain choices in the  login and check-out/shopping cart steps. Asking for private data or app rights (such as facebook etc) in the wrong way can scare people off, killing conversion.
Not exactly what you asked for, but I did find 2 helpfull navigation case studies:
Case-study on the effect of the hamburger menu
Case-study on the impact of side drawers navigation on mobile


Average of Fourier Transforms

Question: I'm working on some acceleration data, looking at vibrations and at what frequencies they're occuring. The recorded periods are fairly long (~1 minute) and I was wondering, what's the difference was between doing a FFT on the whole 1 minute data set and taking the magnitudes, vs doing fourier transforms for each second, taking the magnitudes, and then averaging them at the end?
Comment: This question might get better answers (or already have been asked and answered) on [Signal Processing](http://dsp.stackexchange.com).
Answer: This is the basics of spectral analysis using digital Fourier transform. Mountains of literature is written on the subject.
In short, when you do a FFT over the entire data set 1-minute long, you will have fairly high spectral resolution of about 1/60 Hz, or 16.6 mHz (milliHz). But your confidence interval of the amplitude at each frequency line will be very low, you will have a very high ~100% noise level.
When you break your data into smaller blocks, so for each second-long data your spectral resolution will be 1 Hz, low. But, if you take an average of all 60 periodograms, your noise level will be SQRT(60) =~8 times smaller, so you can be much more confident if you see some spectral peaks in your spectrum.
Note, that this works only on power spectrum estimates, Re^2 + Im^2.
So, with a limited data set, there is a trade-off between accuracy of estimates of spectral amplitudes, and frequency resolution of your power spectrum.

Average of Fourier Transforms


Special Price showing at a value of 35 lower in front-end

Question: I am experiencing a strange glitch with low value products. If the difference between the price and the special price is below £35, the special price is showing as £0. If I change the price to more than £35 difference everything resorts to normal. I've uploaded via magmi and via the magento product backend but the issue occurs either way, which makes me think something has gone awry with a config setting somewhere. Anyone ever had any experience of this or have any idea what might be causing it?
Answer: Not something I've ever experienced. Best check all your pricing/promotional rules. Perhaps you have an old rule that has been removed, but the reapply of promotional rules needs to be run to resolve.
I have in some cases seen hosting environments so improperly set up that InnoDB was disabled on the MySQL server, leaving every table set to MyISAM - and thus promotional rules were catastrophically broken because the foreign key relationships were destroyed. Check your DB tables are in fact innodb (the majority should be)


Dungeon Board Game rules scenario

Question: We're new to the game, and already ran across something that struck us as an issue. Here's the scenario:

Wizard stops just shy of a room, fires in a spell that fails to kill the monster. He stays outside the room.
On the next player's turn, he walks through the wizard and into the room to battle the monster (rules say heroes can pass through the same space, but not occupy it unless it's a chamber). Hero fights the monster, loses, but is not ejected from the room.
Wizard's next turn comes. What can the wizard do now? The way the rules read, if he fires a spell into the room and kills the monster, he enters the room to loot, but the room is already occupied by the other hero, so the wizard is forbidden entry. Even worse, the wizard is still just outside the room.

What happens if during the combat in the room, the hero who pushed past is forced out of the room? Technically, the wizard was already in the space just outside the door, and there is nowhere for the hero to retreat to.
Answer: The older TSR version of the rules make this process a bit clearer:

Die roll: 4-5-6; Light Wound!  Drop any 1  treasure card. Retreat back to the nearest empty corridor space. Lose one turn.

Dungeon Board Game rules scenario


Re-enable previews when using alt-tab in Windows 10

Question: I installed classic shell a few days ago and uninstalled it. Now a leftover problem is that the task switcher (alt + tab) only shows app icons (probably XP style?). I tried to find out how to switch back to default look but couldn't find where to configure it anywhere.  Where can I configure this?
Comment: Honestly, in your situation I would *still* have it configured so that I had at least one System Restore point readily available.  I can almost guarantee you that this won't be the last time you encounter an issue that could have been solved very easily if it wasn't disabled.
Comment: It may be easiest to simply drop back to an older snapshot of the operating system by utilizing a [System Restore of Windows 10](https://www.tenforums.com/tutorials/4588-system-restore-windows-10-a.html) just prior to when you installed the classic shell application.
Comment: Unfortunately I don't have that enabled. Hopefully someone knows a fix to this.
Comment: Really?  That is unfortunate.  Unless your hard drive is *extremely* low on free disk space, it is a "best practice" to have that enabled and configured.  There isn't another compelling reason to **not** utilize it.
Comment: yes, I disable it on purpose since I only have a 128GB SSD.
Answer: There is a method using the Registry Editor that can do this. I do not recommend registry editing but it appears that it can be done.
Here are the main steps you may need for this operation:

How to enable old 'Alt + Tab' shortcut using Registry
To enable the legacy Alt + Tab shortcut style on Windows 10, use these
  steps:
Warning: This is a friendly reminder that editing the Registry is
  risky, and it can cause irreversible damage to your installation if
  you don't do it correctly. We recommend making a full backup of your
  PC before proceeding.

Open Start.
Search for regedit and click the top result to open the Registry.
Browse the following path:
<code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
</code>

Quick tip: On Windows 10, you can now copy and paste the path in the
  Registry's address bar to quickly jump to the key destination.

Right-click the Explorer (folder) key, select New, and click on DWORD (32-bit) Value.
Name the key AltTabSettings and press Enter.
Double-click the newly created DWORD and set the value from 0 to 1.
Click the OK button.
Restart your computer.

Once you complete these steps, you can use the Alt + Tab keyboard
  shortcut to switch between running applications using the legacy
  interface.
If you want the modern task switcher back, you can always revert the changes by using the same instructions, but on step No. 8, change the DWORD value from 1 to 0, or delete the AltTabSettings key, and restart your computer.

(Source: How to bring back the old 'Alt + Tab' experience on Windows 10)
Comment: actually I just found the same page a minute ago. Tried the registry fix in there, and it totally worked. thanks.


Can I duplicat (get a copy) of a 0.5 morph curve into a simple bezier curve?

Question:
When I morph the A curve into the B curve (target), and set the Shape Key value to 0.5, I get the C curve. If I duplicat the C curve, I get a bezier curve of a A' / B' curve, not a simple bezier curve. Is it possible to get the simple bezier curve?
Comment: How is the curve that you get after duplicating not a simple bezier curve"? What's sepcial about it? What's a simple bezier curve? There is no such term "morph curve" in Blender.
Answer: Linked Data
There are 2 ways to duplicate an object in Blender.  Shift  +  D  duplicates an object making a copy of the object itself and a copy of the original object's data and  Alt   +   D  (duplicate linked) duplicates only the object, but links the original object's data to it so that when you edit that data(for example the geometry), both objects sharing that data change. So if you want the duplicated curve to be separate and unique, you should use  Shift   +   D  for simple duplicate(as opposed to duplicate linked).
Shape Keys
There are a few ways to "morph" a curve, but if you use shape keys to do it, if you duplicate some object that has shape keys, they will also be duplicated with the object. You can however apply shape keys to any object that has them(duplicated or not) by choosing Apply All Shape Keys From the menu in the Shape Keys panel, Properties Editor, Data tab:

Note that if you have a bezier curve and use shape keys for it, it is still considered to be a simple bezier curve. There is nothing called "morph" curves or objects in Blender.
Answer: If you mean you want the "C" state to be the original state of the curve without the use of shape keys, then just set the shape key to the desired Value (like 0.5 in your example), then click on the Shape Key Specials menu button (the downward arrow) and choose Apply All Shape Keys.


Amazon Elastic Beanstalk - Any file managers?

Question: Are there any file manager UIs I can use with Elastic Beanstalk (upload,view,etc)? Does the AWS Management Console include one? I'm doing PHP and HTML.
Answer: Yes, the Elastic Beanstalk can be managed through the AWS Management Console1 .
Answer: I very often SSH into my Beanstalk instances and use Total Commander (Windows) with SFTP plugin to check things etc. Highly recommendable.
Answer: The management console cannot be used to deploy PHP apps...
here is an extract of the documentation:

AWS Elastic Beanstalk Functionality For PHP Developers
To deploy PHP applications using AWS Elastic Beanstalk, you simply:
Create your application as you normally would using any editor or IDE.
  Create an Elastic Beanstalk PHP environment using the AWS Management
  Console, the command line interface, or the web service APIs. Behind
  the scenes, Elastic Beanstalk handles the provisioning of a load
  balancer and Amazon EC2 resources. Install and configure Git for
  deployments. Commit and push your changes using Git. Elastic Beanstalk
  deploys your files to one or more Amazon EC2 instances running the
  Apache HTTP Server. Within a few minutes you will be able to access
  your application at a customized URL (e.g.
  http://myapp.elasticbeanstalk.com/).
Comment: You're correct. It appears the only thing you can do with the AWS Management console is upload your _entire website_ in a zip file, where using Git makes it much easier to upload individual file changes. There's even some Git UIs on the Mac App Store.


Why is it important/beneficial for an activation function to be zero-meaned?

Question: Conventionally, (although there are plenty of better options) it is being said that as the choice of activation function for hidden layers, tanh should be prefered over sigmoid because it has a zero mean but what if the data at hand is 0.5 mean and we are not willing to zero mean the data? Would tanh still be the go-to option?
Comment: i dont think it's important, sigmoid is just as fine as tanh
Answer: The first part of this answer is regarding your concrete question and the second part summarizes things on activation functions in general because I believe that there are more important factors than what exactly the output spaces of the functions are, for the following reasons:
Should activation functions be zero-meaned:
I would say that in general, it is neither beneficial nor important for an activation function to be zero-mean.

but what if the data at hand is 0.5 mean and we are not willing to zero mean the data? Would tanh still be the go-to option?

IMO this intuition is a bit off because the activation functions are not applied to the data space directly, but to the latent spaces that are learnable:
The matrix multiplication of the first layer will be applied prior to the activation function and it will change the topology of the data, hence also attributes like mean and variance. So your (let's say 2-dimensional) input data can have a mean of [-1, -1], but if the matrix of the first layer learns something like a 180° rotation, the mean of the input to the activation function is now [1, 1]. Therefore, I would say that it is not so important for the choice of activation function what the mean of your data is.
However, in certain cases, it may have some useful properties when the latent representations of your data are zero-meaned, but I would expect this to occur in shallow models rather than deep ones and I would say that this is something to find out empirically for the individual problem.
Disclaimer I don't think this question can be answered definitively, however, this is my understanding of the matter, happy to get comments and remarks on this.

Some facts regarding sigmoid $(\sigma)$ and tanh
Properties of the sigmoid $(\sigma)$

(-) The maximum of the derivative of the $\sigma$ is rather small ($\max \sigma'(x) = 0.25$) which can slow down training and prevent deep models from training at all due to the vanishing gradient problem. (s. derivative of sigmoid and derivative of tanh)

(-) The sigmoid saturates towards $-\infty$ and $+\infty$, thus the gradient becomes small when the pre-activation values are very positive or very negative values, this is also a cause for vanishing gradient and prevents the training of deep models.

(+) A very useful property is that $\sigma(x) \in (0, 1)$. This is the reason why it is commonly used as an output activation for binary classification models. For the same reason, it is the function that is used in gates of recurrent models (s. GRU-cell). So the sigmoid in this case can act as a continuous switch to determine the influence that, e.g. newly input features have on the hidden state of the model.

Properties of the tanh

(-) The tanh saturates towards $-\infty$ and $+\infty$ which poses similar drawbacks as for the sigmoid.

(o) The tanh can provide a larger gradient than the sigmoid ($\max \tanh'(x) = 1.0$), although  there are other functions like the ReLU function that will output a large gradient more consistently.

(+) There probably exist some regression problems for which tanh is a good match as an output activation.

(+) The $\tanh(x) \in (-1, 1)$ this is probably one reason why it is commonly used as the activation function inside RNNs (vanilla, GRU, LSTM). This ensures that the hidden state will always be in this range and doesn't explode after several processing steps.

What about the ReLU? The ReLU function is - to my knowledge - the most commonly used activation function for hidden layers (excluding RNNs). It consistently provides a gradient of one which leads to faster learning, especially for deep models. There are problems like dead neurons that occur when individual neurons produce only negative values (pre-activation) in which case the gradient and the output of that neuron will be zero til eternity. However, there are methods to reduce this problem, like controlling the bias, choosing a smaller learning rate, or switching to the Leaky-ReLu that can recover from 'dead' neurons.


Is it possible to edit the names of Bibtex entries on Google Scholar?

Question: Question as in the title. If I have got a Bibtex entry such as
smith2019apples

can I change it to, say,
smith2019pie

?
Answer: It is unlikely that this is specifically documented anywhere, but the answer is almost certainly no.
Article entries in Google Scholar, which contain the BibTeX link, are based on information crawled by Google on the web. This itself cannot be changed by you, even if you are the author. This is also mentioned in their help page:

The description of my article is wrong and I am appropriately
irritated. How do I correct it?
We apologize, and we assure you the error was unintentional. Automated
extraction of information from articles in diverse fields can be
tricky, so an error sometimes sneaks through.
Please write to the owner of the website where the erroneous search
result is coming from, and encourage them to provide correct
bibliographic data to us, as described in the technical guidelines.
Once the data is corrected on their website, it usually takes 6-9
months to a year or longer for it to be updated in Google Scholar. We
appreciate your help and your patience.

The articles on your profile, for which you can edit some fields, are connected to these existing Scholar entries.
It appears that Google Scholar uses the format <last-name-of-first-author><year-of-publication><first-word-in-title> for its BibTeX entry names. Since you cannot change the title in the original crawled Scholar entry (which would not make much sense in any case), it is unlikely that you can change the BibTeX entry name either.
Answer: Yes. When you export the .bib file, you can run a script (Python, Ruby, shell, other, your choice) over it to transform the name Goggle Scholar gave it to whatever format you want after you download it and before you check it into your source code repository. If this is something that you do frequently, a script is really the only way to go. This isn't necessarily easy. There are some parsing libraries out there, but they all seem to have some issues which you might have to fix or fix the output of (by hand or with another script).
What you can't do as @GoodDeeds points out, is change what Google Scholar calls it in their records since that's a programmatic construction itself that will consistently give it the name you are seeing until that code is changed by Google.


How to add URL to the trusted zone in Internet Explorer?

Question: How can I add an URL to the trusted site? It seems that there are stored in the registry, but where exactly?
The hints I've googled so far weren't helpfull.
The .net programm will run locally on each client.
Edit clarification: I want to do this programmaticly running C# code.
Answer: The following should give you the way to do it in code...
http://blogs.msdn.com/ie/archive/2005/01/26/361228.aspx
-- EDIT --
The original URL has expired, so here's a copy from the archives:
https://web.archive.org/web/20051028021129/http://blogs.msdn.com/ie/archive/2005/01/26/361228.aspx
The sample project .ZIP file is downloadable there as well.
Comment: The code you posted wraps a Com object. Might there be another solution involving the registry?
Answer: MSDN
Adding Sites Programmatically
C#
Comment: http://stackoverflow.com/questions/972345/programmatically-add-trusted-sites-to-internet-explorer
Answer: Check this solution at CodeGuru forums.
In summary, this code uses the COM library, a library which you did say you wished to avoid. However, there is no workaround this situation. Another thing to mention is that this code is written in C++, as the guy who wrote it, CorithMartin, ported it from C#.
<code>#include "windows.h"
#include "stdafx.h"
#include "urlmon.h"
#using <mscorlib.dll>
#include <atldef.h>
#include <atlconv.h>
using namespace System;
using namespace System::Runtime::InteropServices;
#define MAX_LOADSTRING 100

int _tmain(int argc, _TCHAR* argv[])
{
    // constants from urlmon.h
    const int URLZONE_LOCAL_MACHINE = 0;
    const int URLZONE_INTRANET = URLZONE_LOCAL_MACHINE + 1;
    const int URLZONE_TRUSTED = URLZONE_INTRANET + 1;
    const int URLZONE_INTERNET = URLZONE_TRUSTED + 1;
    const int URLZONE_UNTRUSTED = URLZONE_INTERNET + 1;
    const int URLZONE_ESC_FLAG = 0x100;
    const int SZM_CREATE  = 0;
    const int SZM_DELETE  = 0x1;

    HRESULT hr;
    IInternetSecurityManager *pSecurityMgr;
    LPCWSTR sites = SysAllocString(L"http://*.mydomain.com");

    CoInitialize(NULL);

    hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager, (void**)&pSecurityMgr);

    pSecurityMgr->SetZoneMapping(URLZONE_TRUSTED, sites, SZM_CREATE);

    pSecurityMgr->Release();

    return 0;
}
</code>
Answer: It lies indeed in the registry, and it's described right there:
http://msdn.microsoft.com/en-us/library/ms537181%28VS.85%29.aspx
Beware of the UAC in Vista though. It's a real pain to deal with.
Answer: Powershell
<code>#Setting IExplorer settings
Write-Verbose "Now configuring IE"
#Add http://website.com as a trusted Site/Domain
#Navigate to the domains folder in the registry
set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
set-location ZoneMap\Domains

#Create a new folder with the website name
new-item website/ -Force
set-location website/
new-itemproperty . -Name * -Value 2 -Type DWORD -Force
new-itemproperty . -Name http -Value 2 -Type DWORD -Force
new-itemproperty . -Name https -Value 2 -Type DWORD -Force
</code>
Answer: To add a new trusted zone it creates zone registry keys and folders on the path
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
for each domain it creates a new
key with domain name ( sample.com)
a new key under this one with the subdomain (www)
and under this one a new REG_DWORD with name of the scheme (http or https)
value 2 on hexadecimal and that is it,you got it done
Answer: Here's a way to simplify the process.

Create a .exe to ask for the domain (a textbox), specify the
providers (as checkboxes: All, http, https, ftp) click "Add Site to
Trusted Sites" to then do the following:
Create a temp folder on C: as "C:\TempTS\"
Create a .bat file ("C:\TempTS\AddTrustedSites.bat") similar to this:

set regFile="C:\TempTS\AddTrustedSiteTS.reg"
ECHO Windows Registry Editor Version 5.00 > %regFile%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
  Settings\ZoneMap\Domains\MySecureDomain.com\www] >> %regFile
ECHO "https"=dword:00000002 >> %regFile%
regedit /s %regFile%
DEL %regFile%

The ECHO [HKEY_CURRENT_USER... and ECHO "https"... lines can be repeated for each provider checked.  For the "ALL" provider, use an asterisk in place of "https", like such:

ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
  Settings\ZoneMap\Domains\MySecureDomain.com\www] >> %regFile%
  ECHO "*"=dword:00000002 >> %regFile%

Run the .bat file using this call:

System.Diagnostics.Process.Start("C:\TempTS\AddTrustedSites.bat")

After the .bat file is ran (takes mere microseconds), delete both the bat file and tempTS directory.
MacSpudster
(a.k.a. GNoter, TechStuffBC)
=========================
Credit where credit is due:

regedit /s AddTrustedSite.reg
the "/s" will supress confirm dialog boxes
http://www.computerhope.com/registry.html

also:

see http://www.computing.net/answers/windows-xp/bat-file-to-add-trusted-site-in-ie/139995.html


How can a minor void a contract?

Question: What are the requirements for a minor to void a voidable contract? Just contact the other party and say "our contract is void," and stop receiving benefits and fulfilling obligations?
Answer: To void a voidable contract, a minor must:

Notify the other party that the minor is voiding the contract, and that this is because of minority. It may not be strictly required, but it is surely better practice to do this in writing and by some method that preserves a copy of the notice, and/or evidence of delivery, such as email or certified mail or (ideally) both.
Return or restore all benefits already received under the contract, leaving the other party in the same position as before the contract was agreed to.
Cease to receive or accept any future benefits under the contract.

If step 2 cannot be performed, because things received under the contract have already been disposed of or consumed, say, then the contract cannot be voided.
Comment: What happens if the minor bought a new car, which is now worth much less, but still can be returned?
Comment: @
gnasher729 I would need to check for sources on this, but I suspect such a contract cannot be voided, or perhaps the difference in market value must be paid to void it.
Comment: I believe that's incorrect. Minors typically can't void contracts for necessities like food, but major purchases like cars are exactly the kind of transactions the infancy defense is meant to address.
Comment: @bdb484: Presumably "benefits received under the contract" would include the value of the use of the car for the period when the minor had it, which arguably would equal the loss in market value (because that's what it would cost anyone else to own a brand-new car for that period of time).

How can a minor void a contract?


How did Ravenna's mom end up with such insane powers?

Question: In Snow White and the Huntsman (2012), I wonder, who was Ravenna's mother was and why she dies? It seems like with all that power, she should be in a better shape.
Comment: By "she should have been in better shape", do you mean Ravenna's mother?
Answer: Ravenna's mother was supposedly a sorceress, and brought that trait to Ravenna. I am guessing that Finn (Ravenna's brother) did not get that lucky. She probably got the insane powers, one, because she was taught sorcery, and two from her mother. She also could have gotten it from the potion she drank, given to her from her mother before she was taken. I believe Ravenna's mother died because back then, people feared sorcery. They took Ravenna and Finn, thinking the mothers loss of children would make her grow weaker.


Absolutely Continuous Measure and the Radon-Nikodym Derivative

Question: Let $\mu$ be a regular Borel Measure on $\mathbb{R}$ and suppose that there exists a $C > 0$ such that for every $x \in \mathbb{R}$ and $r > 0$
\begin{align*}
\mu((x - r,x+r)) \leq Cr.
\end{align*}
Let m be the Lebesgue measure on $\mathbb{R}$. I have shown that $\mu << m$ ($\mu$ is absolutely continuous wrt m). I now want to show that the Radon-Nikodym derivative of $\mu$ wrt m is in $L^{\infty}(\mathbb{R},m)$.
I know that $\mu$ and m are two $\sigma$-finite measures and $\mu << m$. So, by the Radon-Nikdoym Theorem, there exists a positive non-negative measure function f so that
\begin{align*}
\mu(E) = \int_E f dm
\end{align*}
for every measurable set E. So, I need to show that $f \in L^{\infty}(\mathbb{R},m)$. So I need to show that for every $N \in \Sigma$ with $m(N) = 0$ there exists $C > 0$ so that
\begin{align*}
\left\vert{f(s)}\right\vert \leq C
\end{align*}
for every $s \in N^c$.
I am not sure how to proceed/how to relate this to the above integral or the first equation. Any ideas or recommendations would be greatly appreciated. Thank you in advance.
Answer: First you have $f \ge 0$, so you do not need to worry about taking absolute values.
Hints:

Can you show $\mu( A ) \le d \, m(A)$ for all $A$ and some constant $d > 0$?
Assume that $f \ge c$ on some (measurable) set $A$. What does this tell you about $\mu(A)$ and $m(A)$?
Comment: 1. Yes I showed this. 2. So we assume $f \not\in L^{\infty}(\mathbb{R},m)$. Then for every $M > 0$ there exists a measurable set *N* with $m(N) = 0$ so that $f(s) > M$ for some $s \in N^c$. In particular we have a set N with $m = 0$ so that for some $s \in A = N^c$, $f(s) > C$. So $\mu(A) = \int_A f(s) dm > \int_A C dm = Cm(N^c)$. However, this contradicts the first fact.
Comment: Your solution to 2 is not entirely correct. If $f \not\in L^\infty(m)$, then for every $M > 0$ there is a set $A$ of positive measure with $f > M$ on $A$.


Will mentioning that I'm considering a PhD to start a company hurt my chances?

Question: I would like to do a PhD in pharmaceutical sciences. I love doing research but I'm not sure that I want to become a professor and stay in academia. I would, however, like to commercialize the research I would do and start a company. I think that a PhD would provide crucial research experience, networking opportunities with smart and talented people and a platform to develop a good product. Although many universities encourage entrepreneurship these days, I'm unsure whether they expect this from graduate students as well. I was wondering whether writing this in my Statement of Purpose would hurt my chances to get into a good PhD program.
Comment: Doing a PhD to start a company is like pulling out all of your hair with tweezers to become a peaceful Buddhist monk. Save yourself the pain and focus on the monk-stuff.
Comment: Depends on the job market I'd say. In physics at the moment it's very difficult to get a job and stay in academia after a PhD; there just aren't enough jobs. I think admissions committees would look favourably on applicants who have a plan B (or in your case, a plan A) if post-doctoral research falls through.
Comment: @NatalieHogg could you write that as an answer and explain your justification?
Answer: One thing you should really consider first, is what are your rights to take the research and start a company: in most universities, whatever discovery is made there legally belongs to them. You might be named on a patent but you may not be the legal owner of any of it, or you may need to license the intellectual property from the university.
Now, in some places, they actually encourage this kind of ventures, but it's framed within the university bound; that means they may even help you start a company, but they'll want royalties or something in return.
In the end, I'd recommend you look at where your career goals will be best received, in your field of choice, rather than apply all over and interview to discover they don't encourage this type of outcome. That'd probably save you some precious time.
Answer: As a PhD applicant myself, I don't think this will hurt you, although, as @WetlabWalter says, a PhD may not be the best route for you to take (this is a separate question in itself).
My reasoning for this answer is that in my field (physics) there are simply too many recent or soon-to-be PhDs for the number of post-doctoral research jobs. This has been a well-known problem for the past few years, as a quick Google search of the phrase "how many physics phds stay in academia" shows.
However, I would be careful with the wording of your intentions. Make sure you emphasise the skills your PhD is going to give you (as you have in your question), so that the admissions committee can tell you are not just in it for the perceived prestige, or the hope that it would lend weight to your business ideas.
Finally, I am hoping to stay in academia once I have finished my PhD, and am saying so in my personal statements. However, I fully expect to be asked about this at interview, and am prepared to discuss my alternative career plans (industry, civil service etc). If you explain yourself well at this stage too, and stay open to other possibilities, I don't think it will harm your application.
I think academics are well-aware of the post-doc drought and it's unrealistic for them to expect that everyone wants a career in academia.
Answer: Academia is s sort of pyramid scheme. The number of people interested in positions at the next level up greatly exceeds the number of vacancies. This is not a secret so an applicant who wants to go into industry should not be disadvantaged.
That said, whether you will be allowed to commercialize the results of your PhD research will depend on the University and group / department policies as well as the source of your funding and any conditions attached to that.
Answer: You simply need to show that you are likely to succeed in getting a PhD in the relevant field.
Universities churn out more graduates than the academic job market can absorb.  They understand that many of their graduates are going to work outside academia after graduation.
Many universities actively seek people who have a knack for working on marketable products.  I would therefore think that mentioning your entrepreneurial dream would be a plus -- as long as you show the requisite strengths in your field.


How can I represent video in avi format as a set of matrices using Java?

Question: I have a video in avi format and I would like to represent every frame of the video as a matrix using Java. How can I do it?
Answer: The Java Media Framework might be a good place to start exploring. (Although it is a rather old API, I don't know of any other, better APIs for video processing with Java.)
This is the download page for the JMF
Here is a good structured guide to the JMF.
And here is the API documentation for all the JMF classes.


Nielsen Chang exercise 4.10

Question: I' m trying to figure out how to decompose unitary operator U using only Rx and Ry rotations. I understand that I must use result of exercise 4.8 ($ U = e^{i\alpha}R_n(\theta)$). But I don't understand how, my thoughts is use Bloch vector coordinates and place it instead n-vector coordinate and try to solve using this, but I think it is not correct way. Can anyone help me or give some insights how to solve this exercise?
Comment: Please add the text of the exercise in full.
Answer: Problem 4.10 of Nielsen and Chuang's text asks the reader to produce an $XY$-decomposition of a single-qubit unitary $U$, in parallel with the $ZY$-decomposition given in Theorem 4.1 of the text. That is, the problem asks to show that any single-qubit unitary $U$ can be written as
$$ U = e^{i \alpha} R_x(\beta) R_y(\gamma) R_x(\delta)
$$
for appropriate choices of $\alpha, \beta, \gamma, \delta$.
Certainly, we could proceed along similar lines as the text does for the $ZY$-decomposition of Theorem 4.1, producing the result essentially from scratch. Alternatively, we could simply use Theorem 4.1 and do a "change of reference", to interchange the $x$ and $z$ axes. Let's proceed the latter route and see how this works.
We know that the Hadamard $H$ (which we quickly note is unitary and self-inverse) implements the appropriate swap between $x$ and $z$, while sending $y$ to $-y$. So instead of working with $U$ directly, consider
$$ U' = H U H^{-1} = H U H
$$
which is the frame-rotated $U$. Using Theorem 4.1 of the text, we can produce a $ZY$-decomposition of $U'$.
$$ U' = e^{i\alpha} R_z(\beta) R_y(\gamma) R_z(\delta)
$$
What does this imply for $U$? We will see that the above implies an $XY$-decomposition for $U$.
\begin{align}
U = HU'H &= e^{i\alpha} (H R_z(\beta) H)(H R_y(\gamma)H)(HR_z(\delta) H) \\
&= e^{i\alpha} R_x(\beta) R_y(-\gamma) R_x(\delta).
\end{align}
Notice the change in sign for $\gamma$ that occurs since $H Y H = -Y$. Regardless, we have $U$ written in the required form.
As a final elaboration, this argument could be generalized. We could choose any two orthogonal axes $\hat{n}, \hat{m}$ for rotations in our decomposition, using the fact that we can always frame-rotate to the $z$ and $x$ axes.
Comment: Thanks, understood!
Comment: I tried to change $R_z$ rotation with $R_x$ rotations but I always got $HR_x(\beta)R_y(-\gamma)R_x(\delta)H$ And stopped at this moment without knowing how transform this in desired view.)) I didn't figure it out before this trick)

Nielsen Chang exercise 4.10


Is my.cnf for mysql 5.5 is suitable and well tuned for below hardware spec?

Question: My Hardware Spec
Technology: Ivy Bridge
CPU: Intel Xeon E3 1245v2
Intel Smart Cache: 8MB
Cores / Threads: 4 / 8
Frequency: 3.4GHz+ / 3.8GHz Turbo Boost
RAM: 32 GB DDR3
Hard disk: 2x 2TB SATA3
Raid 1 by software
Bandwidth: 100 Mbps guaranteed

OS
ubuntu 12.04.2 LTS 64 bit server edition
Mysql
version 5.5.29 , 64 bit
My Application Architecture
https://stackoverflow.com/questions/11272776/using-phusion-passenger-nginx-running-same-rails-app-with-multiple-instance
So my server contains 100 rails apps with 100 mysql databases, each database having around 100 tables
My Traffic To The Server
10 to 200 (max) request per second
3000 to 10,000 (max) request per day
Connectivity Between Mysql and Rails
I use sockets  socket = /var/lib/mysql/data/mysql.sock
my.cnf generated by https://tools.percona.com/wizard for the above hardware spec
[mysql]

# CLIENT #
port                           = 3306
socket                         = /var/lib/mysql/data/mysql.sock

[mysqld]

# GENERAL #
user                           = mysql
default_storage_engine         = InnoDB
socket                         = /var/lib/mysql/data/mysql.sock
pid_file                       = /var/lib/mysql/data/mysql.pid

# MyISAM #
key_buffer_size                = 32M
myisam_recover                 = FORCE,BACKUP

# SAFETY #
max_allowed_packet             = 16M
max_connect_errors             = 1000000
skip_name_resolve
innodb                         = FORCE
innodb_strict_mode             = 1

# DATA STORAGE #
datadir                        = /var/lib/mysql/data/

# BINARY LOGGING #
log_bin                        = /var/lib/mysql/data/mysql-bin
expire_logs_days               = 14
sync_binlog                    = 1

# CACHES AND LIMITS #
tmp_table_size                 = 32M
max_heap_table_size            = 32M
query_cache_type               = 0
query_cache_size               = 0
max_connections                = 500
thread_cache_size              = 50
open_files_limit               = 65535
table_definition_cache         = 4096
table_open_cache               = 10240

# INNODB #
innodb_flush_method            = O_DIRECT
innodb_log_files_in_group      = 2
innodb_log_file_size           = 512M
innodb_flush_log_at_trx_commit = 1
innodb_file_per_table          = 1
innodb_buffer_pool_size        = 26G

# LOGGING #
log_error                      = /var/lib/mysql/data/mysql-error.log
log_queries_not_using_indexes  = 1
slow_query_log                 = 1
slow_query_log_file            = /var/lib/mysql/data/mysql-slow.log

I have seen that innodb_buffer_pool_size = 26G, so in 32 GB RAM at least 27 to 28 GB will used by mysql, so there is only less space for running 100 rails apps, so please somebody will edit and optimize my mysql config my.cnf posted in pastebin, to get enough space and speed for running both mysql and rails application.
I planned to use 100 databases connecting with 100 rails application in a single machine, so i use mysql sockets for connectivity, whether will have performance improvement compared to connecting using mysql with ports.
Update
More info about application
My application is not an mission critical application, it's just an student information system for schools. Mysql backup to remote ftp scheduled through webmin at 2 times per day , so i planned to put 100 schools in single server, so 100 rails apps + corresponding 100 mysql databases
Currently the application is not running , now i am at production set-up stage, so i need to have some suggestions  for my.cnf considering equal resource handling for rails and mysql.
Answer: There are some options you will need to consider
InnoDB Buffer Pool
The reason 26G was picked is that you have 32GB of RAM and 80% of that is 25.6 G. Since you mentioned that you will have 100 databases and 100 applications making this a multitenant DB Server, you are going to have to get the InnoDB Buffer Pool just right.
Please run this query:
SELECT IFNULL(B.engine,'Total') "Storage Engine",
CONCAT(LPAD(REPLACE(FORMAT(B.DSize/POWER(1024,pw),3),',',''),17,' '),' ',
SUBSTR(' KMGTP',pw+1,1),'B') "Data Size", CONCAT(LPAD(REPLACE(
FORMAT(B.ISize/POWER(1024,pw),3),',',''),17,' '),' ',
SUBSTR(' KMGTP',pw+1,1),'B') "Index Size", CONCAT(LPAD(REPLACE(
FORMAT(B.TSize/POWER(1024,pw),3),',',''),17,' '),' ',
SUBSTR(' KMGTP',pw+1,1),'B') "Table Size" FROM
(SELECT engine,SUM(data_length) DSize,SUM(index_length) ISize,
SUM(data_length+index_length) TSize FROM
information_schema.tables WHERE table_schema NOT IN
('mysql','information_schema','performance_schema') AND
engine IS NOT NULL GROUP BY engine WITH ROLLUP) B,
(SELECT 3 pw) A ORDER BY TSize;

This will tell you how much space is currently occupied by your MySQL instance. Whatever the total of InnoDB Data Size and Index Size is, that is what you use. If that total is over the 80% limit then you must you the 80% (leaving innodb_buffer_pool_size at 26G).
Since you have a quad-core server, set innodb_buffer_pool_instances to 4.
InnoDB Transaction Log Files
Since 26G was selected as innodb_buffer_pool_size, you are going to need the biggest possible transaction logs. The value 512M was probably picked for innodb_log_file_size because there is nothing to suggest the amount of transaction data (in bytes) that will actually be processed.
To resize your transaction logs
mysql -u... -p... -e"SET GLOBAL innodb_fast_shutdown = 0;"
service mysql stop

Next edit my.cnf, replacing
innodb_log_file_size           = 512M

with this
innodb_log_file_size           = 2047M

Then, replace the transaction logs like this
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak
service mysql start

After a few months of peak activity, you could then run this query during a peak:
SET @TimeInterval = 300;
SELECT variable_value INTO @num1 FROM information_schema.global_status
WHERE variable_name = 'Innodb_os_log_written';
SELECT SLEEP(@TimeInterval);
SELECT variable_value INTO @num2 FROM information_schema.global_status
WHERE variable_name = 'Innodb_os_log_written';
SET @ByteWrittenToLog = @num2 - @num1;
SET @KB_WL = @ByteWrittenToLog / POWER(1024,1) * 3600 / @TimeInterval;
SET @MB_WL = @ByteWrittenToLog / POWER(1024,2) * 3600 / @TimeInterval;
SET @GB_WL = @ByteWrittenToLog / POWER(1024,3) * 3600 / @TimeInterval;
SELECT @KB_WL,@MB_WL,@GB_WL;

Based on what comes back, you should resize the transaction logs again.
Please see my earlier posts on doing this:

Jul 21, 2012 : InnoDB - High disk write I/O on ibdata1 file and ib_logfile0
Feb 16, 2011 : How to safely change MySQL innodb variable 'innodb_log_file_size'?

Multicore Engagement
When the InnoDB Plugin was introduced in MySQL 5.1.38, it set the world of MySQL on fire. Why? Because InnoDB was single threaded. You had to install the plugin to have new setting that allowed InnoDB to use multiple cores.
Rather than writing something lengthy, please read my earlier posts of tweaking MySQL 5.5 to have InnoDB utilitze multiple cores:

May 26, 2011 : About single threaded versus multithreaded databases performance
Sep 12, 2011 : Possible to make MySQL use more than one core?
Sep 20, 2011 : Multi cores and MySQL Performance
Comment: Thanks for you suggestion, I planned to give equal priority to ruby on rails and mysql, on the above scenario i have only less ram for running rails , so can i reduce innodb_buffer_pool_size to 18G
Comment: Can you please check my updated post
Answer: # BINARY LOGGING #
log_bin                        = /var/lib/mysql/data/mysql-bin
expire_logs_days               = 14
sync_binlog                    = 1

# LOGGING #
log_error                      = /var/lib/mysql/data/mysql-error.log
log_queries_not_using_indexes  = 1
slow_query_log                 = 1
slow_query_log_file            = /var/lib/mysql/data/mysql-slow.log

You don't want your logs in you data directory.  This will show a "mysql-bin" database when you start mysql.  You'll probably get some unneeded errors in the error log on startup.  Best to keep that as clean as possible so you can pay attention when something does show up there.
It's general convention to put logs in /var/log anyway.  Further, when possible it's nice to have the logging file system on a separate set of spindles than the data directory.  While it doesn't sound like that would be possible there could still be some gains in keeping the data directory and logging on different file systems, even if still on the same underlying disks.
Be aware that expire_logs_days will purge binary logs regardless of weather slaves are up to date.  Granted if you have a broken slave that's been off for more than 14 days you have larger problems.  In general you'll want to keep enough binlog buffer around so that you can easily spin up a new slave based on your backup schedule.
You might consider having an archiving script that offloads the binlogs to a more permanent archive server and manages the purging.
Comment: Can you please check my updated post.


What is the reason of decreasing portion of the curve of the daughter atom as shown below after reaching a maximum point?

Question: Here A is the parent atom and B is tha daughter atom
Comment: Could you explain what you thought about this process?
Answer: This is an example of the parent nuclei  $A$ decaying to produce daughter nuclei $B$ which in turn decay into granddaughter nuclei $C$.
Activity is the rate of decay of unstable nuclei and is proportion to the number of unstable nuclei.
In this example of such a decay there are initially no daughter nuclei (at the start the activity of daughter nuclei is zero) and the half life of the parent nuclei is smaller than the half life of the daughter nuclei.
Initially the rate of decay of parent nuclei is greater than that of the rate at which daughter nuclei decay (there are not many daughter nuclei and their half life is larger that that of the parent nuclei) so the number of daughter nuclei increases with time (activity of daughter nuclei is increasing).
As the number of parent nuclei decreases so the rate of decay of these nuclei decreases whilst at the same time as the number of daughter nuclei is increasing the rate of decay of these nuclei increases.
Eventually there comes at time when the rate at which both parent and daughter are decaying is the same and this is the peak of graph $B$.
After that time the rate of decay of the daughter nuclei is greater than the rate at which they are produced (rate of decay of parent nuclei) and so as time progresses there is a reduction in the number of daughter nuclei and the number of parent nuclei is also decreasing towards zero.

Update
The answer to this question Proving that the water leaving a vertical pipe [with a hole at the bottom] is exponential (decay) can be used as the basis of a water analogy of the parent to daughter to granddaughter decay graphs.
In the answer is is shown that the flow of water from a container with a hole/tube at the end is (approximately) exponential so consider a set up like this.

Two containers (often burettes in a laboratory experiment) one $A$ with a large "hole" of area $a$ and the other $B$ with a small "hole" of area $b$, with $a>b$, start off at time $t=0$ with water in container $A$ and no water in container $B$.
Whilst reading the next passage think of the volume of water as the number of unstable nuclei and the rate of flow of water as the rate at which nuclei are decaying.
The water in the container with the bigger hole $A$, and all other things  being equal having the greatest rate of flow of water out of the container, represents the nuclei with the shorter half life.
Water is then allowed to flow out of container $A$ into container $B$ which in turn will have water flowing out of it.
Initially water flows out of container $A$ into container $B$ at a faster rate than water flows out of container $B$ so the water level in container $A$ will go down and the water level in container $B$ will go up.
Number of nuclei type $A$ (or activity of $A$) is decreasing whilst the umber of nuclei type $B$ (or activity of $B$) is increasing.
However as the water level in container $A$ drops so does the rate of flow of water out of the container whereas as the level of water in container $B$ increases so does the rate of flow water out of the container.
With one rate of flow going down and the other rate of flow going up there will come a time when both flow rates are the same.
Peak of the activity of $B$ graph.
After that time the rate at which water flows from container $A$ into container $B$ will be less than the rate at which water is flowing out of container $B$ and the level of water will drop in both containers.
Activity graphs after the peak in the activity of $B$.
Answer: I answer by gut feeling.
The daughter atom is generated by the decay of the "parent atom".
When there are many parent atoms, per unit time more daughter atoms are generated than decay (the decay rate is proportional to the number of daughter atoms and the generation rate to the number of parent atoms). This means that the number of daughter atoms increases and therefore the rate of decay (and with it the radioactivity) increases.
As time passes, the number of parent atoms decreases, less daughter atoms are generated and at a certain time their number will start to decrease: from this moment on the radioactivity will decrease.
The shape of the curves is calculated with rather straightforward linear differential equations which are called "rate equations".
Answer: By definition, activity $A$ and $B$ are defined through
\begin{align}
  {A_A}\left( t \right) &= \frac{{\# {\text{decayed A atom}}}}{{{\text{unit time}}}} = {\lambda _A}{N_A}\left( t \right) \\
  {A_B}\left( t \right) &= \frac{{\# {\text{decayed B atom}}}}{{{\text{unit time}}}} = {\lambda _B}{N_B}\left( t \right).
\end{align}
We know that
\begin{gather}
  {{\dot N}_A}\left( t \right) =  - {A_A}\left( t \right) =  - {\lambda _A}{N_A}\left( t \right) \Rightarrow {N_A}\left( t \right) = {N_A}\left( 0 \right) \cdot {e^{ - {\lambda _A}t}}
\end{gather}
therefore
\begin{align} \label{eq:de} \tag{1}
  {{\dot N}_B} & \left( t \right) = \underbrace {\frac{{\# {\text{atom decayed from A to B}}}}{{{\text{unit time}}}}}_{ = r\frac{{\# {\text{decayed A atom}}}}{{{\text{unit time}}}}} - \frac{{\# {\text{decayed B atom}}}}{{{\text{unit time}}}} \\
   &  = r{\lambda _A}{N_A}\left( t \right) - {\lambda _B}{N_B}\left( t \right) \\
   &  = \underbrace {r{\lambda _A}{N_A}\left( 0 \right) \cdot {e^{ - {\lambda _A}t}}}_{\alpha \left( t \right)} - \underbrace {{\lambda _B}{N_B}\left( t \right)}_{\beta \left( t \right)}, \\
\end{align}
where $r$ is the ratio describing how many atom of type $B$ is created by the decay of one $A$ atom (e.g., it can be considered $1$ for the sake of simplicity).

Method 1
Instead of trying to solve the differential equation \eqref{eq:de}, try to imagine the result. ${\alpha \left( t \right)}$ is positive at $t=0$, while ${\beta \left( t \right)} = 0$. After long enough time, ${\alpha \left( t \right)}=0$, but if ${{\dot N}_B}$ weren't $0$, according to ${{\dot N}_B} =  - {\lambda _B}{N_B}\left( t \right)$, it would decay to 0 exponentially. With other words, ${{\dot N}_B}\left( t \right) = 0 \Leftrightarrow {N_B}\left( t \right) = 0$.
So ${N_B}\left( t \right)$ increases in the beginning, starting from $0$, but in the end it doesn't even matter it is $0$ again. If we believe that the funtion is continuous, it must have a maximum.

Method 2
Solve the differential equation \eqref{eq:de} with $r=1$!
The general solution is
\begin{equation}
{N_B}\left( t \right) = {e^{ - {\lambda _B}t}}\left( {C + \frac{{{e^{\left( {{\lambda _B} - {\lambda _A}} \right)t}}}}{{{\lambda _B} - {\lambda _A}}}{\lambda _A}{N_A}\left( 0 \right)} \right).
\end{equation}
Using the initial condition ${N_B}\left( 0 \right) = 0$,
\begin{equation}
C + \frac{1}{{{\lambda _B} - {\lambda _A}}}{\lambda _A}{N_A}\left( 0 \right) = 0 \Rightarrow C =  - \frac{1}{{{\lambda _B} - {\lambda _A}}}{\lambda _A}{N_A}\left( 0 \right).
\end{equation}
Our solution is therefore
\begin{align}
  {N_B}\left( t \right) &  = {e^{ - {\lambda _B}t}}\left( {\frac{{{e^{\left( {{\lambda _B} - {\lambda _A}} \right)t}}}}{{{\lambda _B} - {\lambda _A}}}{\lambda _A}{N_A}\left( 0 \right) - \frac{1}{{{\lambda _B} - {\lambda _A}}}{\lambda _A}{N_A}\left( 0 \right)} \right) \\
   &  = {e^{ - {\lambda _B}t}}\frac{{{\lambda _A}{N_A}\left( 0 \right)}}{{{\lambda _B} - {\lambda _A}}}\left( {{e^{\left( {{\lambda _B} - {\lambda _A}} \right)t}} - 1} \right). \\
\end{align}
Now let's plot the result with $\lambda_A = 2\cdot \lambda_B$.
Special case: $\lambda_A = \lambda_B$
In the case $\lambda_A = \lambda_B$, one gets a $0/0$ type limit in the general solution. By executing it one gets
$${N_B}\left( t \right) = {e^{ - {\lambda _A}t}}\left( {C + {\lambda _A}{N_A}\left( 0 \right) \cdot t} \right)$$
for the general solution. The initial condition says:
$${N_B}\left( 0 \right) = 0 \Rightarrow C = 0,$$
therefore our solution is
$${N_B}\left( t \right) = {\lambda _A}{N_A}\left( 0 \right) \cdot t{e^{ - {\lambda _A}t}}.$$
It looks like the following:

Interpretation
Imagine the following: there are tons of $A$ atoms decaying, $B$ atoms are generated rapidly. There are only a few $B$ atoms yet, only couple of them decays in the beginning, because there are essentially no $B$ atoms. But the number of $A$ atoms are shrinking, less $B$ atoms are generated, furthermore, because the amount of $B$ atoms are higher, larger number of $B$ atoms decay. There is an equilibrium, when $r{\lambda _A}{N_A}\left( 0 \right) \cdot {e^{ - {\lambda _A}t}} = {\lambda _B}{N_B}\left( t \right)$, therefore ${{\dot N}_B}\left( t \right) = 0 \Rightarrow {{\dot A}_B}\left( t \right) = 0$. In the next moment less $B$ atoms are generated by the decay of $A$ atoms, because there will be even less $A$ atoms, but the decay of $B$ atoms doesn't stop, so the number of $B$ atoms start decreasing.


Should I ask this question now, which would be crossposted and on CSTheory history?

Question: I'm asking this question about the history of computation.  It's currently active, so I'm wondering if crossposting, in this case, would be ok.  It's also on the history of computation, but some may view this as research.  Would this be an appropriate subject/question for this site?  I thought that researchers here may want to know about this.
Comment: What is wrong with your post on math.stackexchange.com?  Simultaneous crossposting would be obviously unfair, so please do not do that.
Comment: Regarding cross-posting in general: "While we don't mind a question being reposted, our [site policy](http://meta.cstheory.stackexchange.com/a/231/) only permits a repost after sufficient time has passed and you have not obtained the desired answer elsewhere.[...] simultaneous crossposting duplicates effort and fractures discussion. Please wait a few days and then if your question is still not answered [...] (after summarizing relevant discussions from other sites)."
Comment: You might be interested in [this cstheory question](http://cstheory.stackexchange.com/q/6350/1037)
Answer: I don't see how a post on the history of computation is not at some level about theory. In fact I'd argue that it's ALL theory, up until the time when actual computers were designed. My problem with posting the question here is not one of scope: it's one of nature. The question is really asking for a ton of references, and is overly broad. Most parts of the question would be answered by a textbook, some reference literature and some time spent in libraries.
A more focused question along the lines of "I was looking for information on this particular nugget in the history of computation, and wanted to know if anyone had any information" would be perfectly in scope.
As for whether it should be on math.SE, I actually think it's more appropriate either here or on CS.SE (if appropriately tailored as above).
Comment: It's not clear whether his focus is a history of computing _techniques_, a history of computing _devices_, or a history of computing _applications_.  I think the first focus would be in scope here, although it would be very hard to distinguish it from a history of mathematics.  The other two foci would not really fit here.
Comment: Also: What's an "actual computer"?  Does the Antikythera mechanism count?  The abacus?  Piles of rocks?  Fingers?
Comment: Fair enough (on the issue of an actual computer) :)
Answer: I don't think that this question is on topic on CSTheory.SE, as it is not about theory per se.
It certainly could be considered as on topic on CS.SE, though it might be  a little broad.
In any case, cross-posting is generally frowned upon. You can either ask the Mathematics.SE people to migrate the question to CS.SE. Perhaps asking this question on meta.CS.SE will help prevent your question being closed.


How can I move apps en masse to my SD card?

Question: Apps keep getting installed on my internal storage when I would much rather they be on my much larger SD card that is formatted as internal memory. Is there a way to tell my phone to move a bunch of Apps at once?
Answer: Sorry its not possible with rooting the device either. As PlayStore firstly download the application to your internal memory without seeing your settings whether you want your application on your internal or external. From that state it can be moved from internal storage to external storage if application permits itself.
You can think it as an restriction posed by Google.
Answer: Tutorial :
Note : First Make sure to enable " Allow Unknown Sources Aplications to install "
File Manager Link: http://www.apk4fun.com/apk/50967/

Download an App called " Apps Backup & Restore "
Download Link : http://app-backup-restore.en.uptodown.com/android
Note : You can download it in Google Play Store

2.. Install the downloaded Aplication (apk) in your device "App Backup & Restore "

Open the Application
Make sure you are in a window called " Installed " , where you can see all your installed applications.
Select/Mark all the apps you want to backup and click " Backup" and wait for the process to complete..
Go to your Internal Storage Directory using File Manager
Search for a folder called " App Backup & Restore "
Copy/Move this folder to your Sd Card Directory...

Done
Answered using LG G3


Transitioning from Windows Forms to WPF

Question: For a long time now, I have been stuck with Windows Forms development (started with VB6, and has continued through to C# .NET 4.5), and I have pretty much hit the limit of what Windows Forms can do, both using pure .NET, and special effects with Native Code.
I have tried to learn WPF and XAML, but I get stuck right at WPF's new designer. It really seems very difficult to use in comparison to the Windows Forms designer.
I want to know if there are any alternatives to .NET's WPF designer, that are more suited to Windows Forms developers?
Comment: I usually don't even use the designer, save for checking whether the overall layout is what I would expect; in the end I write everything by hand in XAML and/or use Blend when needed - although I'm not a designer so that barely ever happens.
Comment: It's not difficult to use, you are simply not used to it. The biggest hurdle to overcome is the paradigm shift between the two technologies. Get yourself a good book on XAML, once you get used to XAML you won't even use the designer anymore - you will type XAML directly.
Comment: @slugster, I did wonder about that. The same thing happened with HTML...I used to build the UI with dreamweaver, and now I code HTML by hand
Comment: You can use Expression blend, but I don't think that's really any easier, it's more for designers than developers IMO.  I normally just turn off the preview and work with the xml.
Answer: I like to blog about beginner articles for WPF, and there are a few in particular that may help you out:

Understanding the change in mindset when switching from WinForms to WPF
What is this "DataContext" you speak of?
A Simple MVVM Example

To summarize, the biggest difference between Winforms and WPF is that in WPF your data layer (the DataContext) is your application, while in Winforms your UI layer is your application.
To look at it another way, with WPF your application consists of the objects you create, and you use Templates and other UI objects to tell WPF how to draw your application components.

That's the opposite of WinForms where you build your application out of UI objects, and then supply them with the data needed.

Because of this, the designer isn't actually used that much since your application components are designed in code, and the designer is only needed to draw a user-friendly interface that reflects your data classes (typically Models and ViewModels)
And personally, I prefer to type all my XAML out by hand since it's faster and doesn't make as much of a mess as the drag/drop WPF designer does, although I do use the Designer on occasion to preview what my UI will look like.
So to your answer your question about if there's other WPF designers suited for WinForms developers, I would suggest that instead of looking for another designer, instead look to learn how to use WPF in the way it's meant to be used. Using WPF like it's WinForms means you miss out on much of what makes it so great :)
Comment: Totally agree with @Rachel. The most important realization when coming into the light of WPF is to understand that [UI is not Data](http://stackoverflow.com/questions/14381402/wpf-programming-methodology/14382137#14382137) and act accordingly.
Comment: @HighCore take a look at http://stackoverflow.com/questions/982978/mvvm-for-winforms and you will have to acknowledge that Winforms is just a View / UI component in which business objects can be Bound to user controls. Okay: WPF is more suitable for MVVM but nevertheless Winforms can also work in such a Design Pattern. And as Rachel states "That's the opposite of WinForms where you build your application out of UI objects, and then supply them with the data needed." It's so untrue for although. I always think in a manner of at least Data and View. Data and Winforms / WPF / HTML whatever.
Comment: @YoupTube You're right, Winforms does support data binding, and it is possible to create your own custom bindings for cases where the default binding system won't work too. I wrote this answer and my blog articles with beginners in mind though, and typically beginners think in terms of UI components, not data objects. In addition, binding in WinForms didn't always exist in the state it does now, so many developers that grew up with WinForms, or who are used to other technologies that don't use bindings, will often not identify this key difference when switching to a bound architecture. :)
Comment: @Rachel - just to play devil's advocate: Starting with UI (which buttons, text boxes etc. appear in the window) helps focusing the application on *what* you want to do. The rest is just implementation details of *how* you want to do it.
Comment: It does support databinding at least at the level of Data entry / modification. And those 99.9999999% of developers will also mess-up in WPF I suspect. But let us finish this discussion. WPF is absolutely more powerfull / suitable for MVVM and a separation of concerns but I think you and also Rachel push Winforms in a negative corner. Especially when you keep using the words you use...
Comment: @AshrafAbusada I suppose it depends on how your WinForms application is built, and if you want to use MVVM or not. The two biggest challenges I would see are WinForms applications that are not built in a way that makes replacing the UI layer easy, and the lack of `INotifyPropertyChanged` on the object models. Depending on the complexity of your model layer in the WinForms app, it might actually be faster to just rewrite them.
Comment: @Asaf Yes, the UI can be a good way to start, especially when working with clients to figure out what they want. But when designing and building your application with MVVM, I always find it easiest to start with the properties and functionality of the application classes (Models and ViewModels) first, and to work on the UI second, sometimes in a separate phase.
Comment: -1 Sorry Rachel, but the way you explain it does not impress me. WPF and WinForms are not that different. They're both UI layers in which you can manipulate (CRUD) business objects. The explanation you give on your blog is too simplistic in the way you describe how people think in the Winform an WPF realm.
Comment: @Rachel +1 agreed, especially since a program is often much more than what is visible so using the UI as a template may not always be optimal.
Comment: @YoupTube the fact that *you* know how to separate UI from data regardless of technology does not change the fact that 99.9999999% of winforms developers simply do a bunch of horrible code behind stuff instead of designing an application properly. And NO, archaic useless winforms is completely lacking compared to current technologies and does NOT support DataBinding. Show me the winforms equivalent of this: ``.
Comment: @youpTube show me the winforms equivalent of this: ``. No, we don't "push" anything. winforms' complete lack of features evidences itself every time there's a [*"how do I do this on winforms?"*](http://stackoverflow.com/q/22922233/643085) question which ends up being answered (by me) with a WPF solution because there's no way to deal with winforms' incapabilities and uselessness other than ditching it completely and using decent technology. If you fail to recognize that, that's your problem, not ours.
Comment: I've been working in WPF with the MVVM pattern with Entity Framework for the last 18 months. I've just been forced to go back to a Windows Forms solution to add some features. Oh my days it's awful! so much code & the whole event driven design which creates dependencies between UI & logic seems so wrong. Yes Xaml & the MVVM pattern has a steep learning curve & commanding is a pain to set up but once you understand the power of DataContext & binding you'll never look back.
Comment: I echo the comments above. I tried to use Blend but didn't get on with it. I don't the touch the designer. I write everything in Xaml by hand. Also, Mahapps is a fantastic library for those who want that 'Modern UI' look without having to struggle with custom control templates.
Comment: All what is said about WPF is good, But as developers when we are asked to transform an earlier winforms Application into a new look and feel WPF, We are always asked to use some old classes from the old application, is it OK or just take more time and start from scratch??
Answer: Well although, some people don't agree, I would also recomment to not use the VS designer. At least not to create an interface. If you may want to get a first impression of your implementation without starting the application, it's a good viewer at least as long no sophisticated things like Styles and Templates are used. But, IMHO, its drag and drop result should only be used as prototype and therefore be discarded after it's no longer needed.
Here are some reasons which are important for me not to use it.

The VS designer is working with fix margins and alignments (which is usually not necessary, if you're using the layout controls), means you have to touch many controls, if the requirements are changed. If you're deep in XAML and the WPF mechanics you can create an applications which can be modified with small effort, regarding the look and feel.
Since the designer is generating the xaml, the composition is not optimal and the UI may perform badly. I didn't measure it, it's just a feeling.

A much better alternative is MS Blend, although the start is everything else but easy. Its drag and drop result is much better that the result of the VS designer.
But it's a pretty powerful tool, which helps you to use pretty powerful elements to create a state of the art UI. I recommend to visit at least a short workshop to get an idea of its opportunities.
Back to your question, IMHO, and I think many people agree, get yourself a good book e.g. WPF Unleashed and later, if you want to know more about the details, WPF Pro. There are a lot of features which are different to Winforms. You won't get to know them by using any designer. I think that's the best approach.
Please also consider that there are many frameworks and libraries (e.g. MVVM light, WPFToolkit)  out there, which are already solving some common problems. So it's not necessary to reinvent the wheel.
Answer: I know this is an old question but for the benefit of anyone else looking at this, I think I should redress the balance a bit - reading some of the other answers, I get the feeling that some of the 'don't use the designer' sentiment comes from not using it properly.
This tutorial is quite good to get you going and answers some of the criticisms in the other posts.
For instance, you can switch from the Winforms-like margin-based layout that is the default when you drop a control, to a more WPF-ish style by right-clicking and selecting 'Reset Layout'
This video covers similar ground.
I still prefer the VS2010 designer on balance - VS2013 seems to be a bit buggy when dragging and dropping onto TabItems **, (which my current project uses a lot) - but the VS2013 Document Outline view lets you move things around in that view too, which can be a real plus.
Really, though, to get the most out of WPF and xaml you need to be reasonably fluent in both the designer view and the xaml view and switching between them; if you shy away from the designer, you are missing out on something that can help you a lot.
** Edit - although this seems to have been improved in Update 3 for VS 2013, and in previews of VS14, to date I still get odd behaviour at times.
Answer: I've been through this process  as you did. Afterwards I was teaching everyone in my company WPF. There are a couple of important lessons I have learned and everybody I know who works with WPF.

If you are working with UI controls in the code behind, .... Then you are    doing it wrong. There is absolutely no need for you to deal with UI controls in the code behind.
You do not need the visual developer for clicking on it. You are much more productive by only dealing with XAML.
Use Copy/Paste. Do not trust in your typing capabilities. It will save a lot of headaches.
Think of the XAML just as a window that loks over the data. In the code behind you are changing the data. In XAML you are defining how the UI will interpret the data.
Converters are amazing. As soon as you get a key amount of Converters, your productivity will rocket Sky high. They will take over the role of the crazy amount of control eventhandlers that hide or resize, or what ever about UI,

It makes UI development fun. Especially once you find out how it likes to play along with Asyc processes. It really takes away a lot of the headaches that were caused by Winforms.
Answer: First of all, in WPF (XAML) in Visual Studio deisgner, you should always use the xaml code to build you UI and do not drag and drop you control! You need to keep your code clean. You can use Expression Blend to help you, it's more graphic oriented with drag and drop, but it's not free.
It's not a big learning curve, but I think you should learn how to do your xaml by hand instead of searching for alternative.
Comment: I think advising someone coming from Forms and starting WPF to not use the designer is a really bad idea. The fastest way to understand XAML is to use drag and drop and then observe the code.
Comment: When you drag and drop in WPF, I see that often, you have a lot of margin of -1200 and things like that that does not make sense at all... I've always did it by hand it's better for sure
Comment: Drag-n-drop is no harm, although if you prefer typing, that is also fine. Manually typing is never the key for WPF.
Comment: This is off topic. Make sure your problem is commonplace to all, not yourself only. Besides, you cannot say drag-n-drop is bad, if you have some problems. Relying on designer is still needed and sometimes favored, you might see this is true, if you know how expression is welcomed by both designer and developers.
Comment: yes if you use expression blend, ok you can do it, but i was talking in visual studio...
Comment: No one limits this to VisualStudio, we are talking about WPF.

Transitioning from Windows Forms to WPF


Network card does not see router anymore

Question: Today I was working on some random stuff when suddenly windows asking me for password to my wifi connection. I had to miss-click something, as I was writing and window disappeared.
Now I can't connect to my main wifi router from my laptop. My network card:
lspci
Network controller: Broadcom Corporation BCM43225 802.11b/g/n (rev 01)

stopped to seeing it. It sees, however other networks and can connect to them (but they are not comfortable to work with, I need my main).
When I use external wifi adapter, it works fine (but more usb cables on the desk = more mess). I can connect my mobile phone too.
I have tried to connect through command line, but:
iwlist wlan0 scan

does not show up my wifi network.
I also tried
nmcli c up uuid <uuid>

but it gives only:
Error: Connection activation failed.

I've checked router settings, but didn't find anything wrong there - no MAC filtering or something like that.
rfkill list all
0: acer-wireless: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
3: phy1: Wireless LAN
    Soft blocked: no
    Hard blocked: no

EDIT: I tried restart laptop/router, but it didn't work.
Answer: It looks like the wifi card may not being detected, or other errors are happening with it. Please sesee this link specifically covering broadcom wifi cards to see about installing drivers and troubleshooting it. https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx