How can I find the historical stock price for a specific stock on a specific date?

Question: I am looking for an old stock price of a company that subsequenty has merged with another company.  I am looking for the stock price of Union Electric (UEP) on Oct. 12, 1992.
Answer: Go to a large reference library and ask to see the Wall Street Journal for October 13 1992.
Answer: I've had luck finding old stock information in the Google scanned newspaper archives. Unfortunately there does not appear to be a way to search exactly by date, but a little browsing /experimenting should get what you want. For instance, here's a source which shows the price to be 36 3/4 (as far as I can read anyway) on that date.
Answer: A quick search showed me that UEP merged into Ameren on Dec 31, 1997, and Ameren still exists today.  So I took a look at Ameren's Investor Relations website.   Unfortunately, they don't provide historical stock prices prior to Ameren forming, so starting with 1998.  However, I've had good luck in the past emailing a company's investor relations contact and asking for data like this that isn't on the website.  It's reasonably likely they'll have internal records they could look it up within.


Is it possible to show template in Angular when data is ready?

Question: I use Angular routing. When I click to some url, it shows me template with undefined fields until data from http rest service is loaded. Is it possible to wait and show template when data is already loaded and binded?
Comment: Yes it is ! all you gotta do is to use ng-bind directive.  rather then going with {{}} braces for binding the model's value. or while routing, you can go with resolve method.
Comment: What router do you use? share code
Answer: You can use ng-cloak

The ngCloak directive is used to prevent the Angular html template
  from being briefly displayed by the browser in its raw (uncompiled)
  form while your application is loading

Another option is use ng-bind instead of double brackets {{ }}


Why is Address Space Layout Randomization not effective against the Open SSL Heartbleed Vulnerability?

Question: My understanding is that ASLR randomly arranges the key data areas of a process, and so reading contiguously above a buffer as is done in heartbleed would not be enough to achieve the exploit.
Answer: ASLR randomizes the addresses of critical parts of the processes memory, i.e. stack, heap and where libraries are loaded in order to make it unpredictable where a specific piece of code or data structure is located. But this kind of knowledge is not needed in the first place to exploit Heartbleed.
The Heartbleed vulnerability relies on an out of bounds read within an already allocated buffer on the heap. It does not need the base address of the heap for this, all what it needs is that sensitive data are still located at the heap and that they are located behind some newly allocated buffer. An image taken from Inference of Memory Bounds: Preventing the Next Heartbleed visualizes the problem nicely:

Relating to this image: in case of Heartbleed the buffer allocated for the TLS heartbeat was the blue one. But since the claimed size given in the heartbeat request was larger than the actual size of the heartbeat request and the heartbeat response trusted this wrong size OpenSSL ended up not only to include the payload of the original heartbeat request (blue) but also the data behind it on the heap (red) and thus leaked the sensitive information. No knowledge of any actual address was required for this.


What are Private Servers?

Question: I have seen a couple questions recently asking about private servers for Clash of Clans. I looked them up online, and I can't find any information about them, only sites offering them. What are these private servers? Are they even legitimate?
Comment: @Lokuzt I don't think it's off topic - if the OP wanted to know *how* to create a private server, that might be off-topic. However since the OP is only looking to find out what they are, that is on-topic.
Comment: I'm voting to close this question as off-topic because this question as nothing to do with gaming. What are Private Servers doesn't belong here.
Answer: A private server is a server not hosted by SuperCell that you can connect to to play if you root/jailbreak your mobile device to edit the host file to allow you to access a different IP address with the game. You can get unlimited resources and gems on some private servers.
As for if they are legitimate, it depends on your definition, they exist, but are most likely not legal. I am not a lawyer, but Supercell's TOS seem to forbid this, specifically in section 1.1.
Answer: I'm pretty sure they don't exist, given how Supercell operates. Their games can only be played on the servers that they provide. Any site offering a server is as legitimate as a site offering cheaper gems - it's a complete scam!
I even doubt a modded app would be able to run on a server that is not Supercell's.
To conclude there's a reason those questions are locked, and it's not only the rules! :D

What are Private Servers?


Android: Return to previous activity without calling finish()

Question: I have an android application with a LOT of activities, think of something like a book where every page is a new activity. The user can make changes in each activity, for example highlight certain texts with different colored markers etc. and it's crucial that I'll remember this information as long as the application stays alive (and I don't want/need to remember any of this when it's not). As I understand the best mechanism for storing this kind of information is via onSaveInstanceState(Bundle outState) and onCreate(Bundle)/onRestoreInstanceState(Bundle) rather than lets say, the Preferences mechanism. My only problem is that the user can navigate backwards to previous pages (Activities) and the only way i know of achieving this is by calling finish() which of course kills the current activity without calling onSaveInstanceState(Bundle outState) and even if it did call it, the next time I would launch an activity representing that page it would be an entirely new instance. So my question is: Is there a way to go back to the previous activity without calling finish()? or, is there a better way to save this information? maybe through static variables?
Thanks!
P.S.
I know I could also implement my app differently so that not every page would have its own activity but this isn't the answer I'm looking for.
Answer: Try to use startActivity() with flags such as Intent.FLAG_ACTIVITY_CLEAR_TOP.
You could read the full story here:
http://developer.android.com/reference/android/content/Intent.html#setFlags(int)
Answer: I had exactly the same problem and after I thought and tried a lot, IMHO I found the most feasible solution. I inherited the Activity and adds a static method to kill if exists only. So, instead of killing the activity whenever it exits. I kill it whenever it is called again. For example,
MyActivity.killIfExists();
startActivity(new Intent(this, MyActivity.class));

So that, the app will always be singleton and save its state with onSaveInstanceState.


How do I open a public hardcore only game?

Question: How do I open a public hardcore only game?
Comment: Next time, you should try not to use all caps for your title, use proper capitalization and include more details instead of adding meaningless filler
Answer: All online games opened by hardcore are for hardcore only. So all you need to do is just open a public game with your hardcore, and it'll automatically be hardcore only.
Answer: Log in with your hardcore character (possible once you reached level 10 with a softcore character), start a game in the act you want, and then press ESC and make the game public.


Replacing light fixture on switch, 1 hot wire powering 2 rooms

Question: I had to replace the light fixture in my bedroom thats on a switch. There is 1 hot wire that powers the bedroom light and also 2 other rooms. after installing the new light i became a bit confused on the wiring and now if i turn the light switch in bedroom off it pops the breaker..Also 1 of the other rooms does not have power anymore. what did i connect wrong? i connected all black to blac and white to white.
Comment: Show us the "before" pictures you should have taken of how the wires were connected when it worked. Odds are excellent that all whites were not together, then. "Old style switch loop" probably applied. When you get confused about things electrical, stop and ask for help without just forging ahead, confusedly - that's how problems happen.
Comment: The problem was someone had put a piece of wood in the cieling with a hole drilled in it and 3 sets of wire running through the hole and wires caped with no slack. i wanted to add a proper light fixture box but had to uncap all wires to get them through the small hole
Answer: Based on comments, there are 3 cables. Likely setup is:

Incoming power (from panel, possibly by way of other receptacles, lights and switches)
Ongoing power (to the rooms that don't have power any more)
Switch loop

To fix:

Turn off the breaker

Disconnect and separate the 3 cables so that no bare wires (except grounds) are touching each other or fixture or box or anything but air

Turn on the breaker

CAREFULLY use a non-contact tester to determine which cable (and should be just the black wire of that cable, but sometimes there is phantom voltage induced in the matching white wire) has power.

Turn off the breaker.

Mark the cable you found as the INCOMING POWER cable.

Connect ONE of the other black wires to the black wire of the INCOMING POWER cable.

Turn on the breaker.

Use your non-contact tester to check if the black wire at the switch has power or not. If it has power, mark the cable you found as the SWITCH LOOP cable.

Turn off the breaker.

If you did not find the SWITCH LOOP cable yet, repeat the same process with the other black wire (disconnecting the first one that you tried - do not connect them all together).

If you still did not find the SWITCH LOOP cable, STOP and ask for more help.

Assuming you found the SWITCH LOOP cable, mark the last cable as ONGOING POWER:

Put a piece of black tape on the SWITCH LOOP white wire.

Put a piece of red tape on the SWITCH LOOP black wire.

Put a piece of red tape on the light fixture's black wire.

(All taped wires will be referred to from now on as if they were the color of their tape.)

Connect all black wires together with a wire nut or Wago connector.

Connect all white wires together with a wire nut or Wago connector, including the light fixture's white wire.

Connect all red wires together with a wire nut or Wago connector.

Connect all bare ground wires together with a wire nut or Wago connector.

Turn on the breaker and test.

Make sure you use a good non-contact tester - UL or ETL listed. Something like this Klein from Amazon:
Comment: thank you so much. will try this
Comment: it worked just as you said. and i bought the tester you pictured. thank you soo much
Comment: now i just need to figure out why the living room and kitchen outlets have no power. And no i gave not messed with the wiring there..lol
Comment: Hurray! To quote "Hannibal" Smith of the A-Team: *I love it when a plan comes together!*


Converting xnb files to fbx files

Question: All the while I can only find how to convert from FBX to XNB but not the other way around. Does anyone know how can I do that?
Comment: This is typically a one way operation.
Answer: XNB is a binary container for all your content in programs that use the XNA content pipeline, this includes models, but also textures, fonts, audio, and sprites.
While it is possible to extract information from an XNB file (see for example this plugin for paint.net that extracts the textures in an XNB file: ) I do not know of any programs that extract model information. You will probably have to write your own program to do this.
On another note, why would you want to extract models from an XNB file, did you lose the source models? Or are you trying to extract and use a model that you didn't make yourself? Because that is legally gray/black territory.
Answer: Googling, I found these descriptions of the file formats:

FBX (Filmbox) is a proprietary file format (.fbx) developed by
  Kaydara and now owned by Autodesk. It is used to provide
  interoperability between digital content creation applications.

and

...compiled data files (.xnb) produced by the XNA Game Studio 4.0 Content
  Pipeline build process...

Judging from those short quotes, I'd guess it's a case of data loss in translation. Not all data in FBX ends up in XNB.
EDIT: Microsoft has posted a sample XNB parser (along with the format spec) which could be a starting point for the converter: http://xbox.create.msdn.com/en-US/sample/xnb_format
Comment: Correct, it's also some kind of DRM system, as you can't just copy/use art assets the easy way (although there are some converters for some file formats).
Comment: but underlying they are still 3d objects right? just like jpg is a lossy file format, can be converted to and from png. I don't understand why xnb to fbx tools are so hard to find. If they exist, at all.
Comment: From further googling, apparently the files also contain shaders and stuff. I guess it would be possible to reverse-engineer the format and make such a converter, but its usability would be limited.

Converting xnb files to fbx files


Copying files from local server to remote server using powershell

Question: Apologies if this has already answered directly or indirectly in SF.
My requirement will be as follows:

Move a deployment folder that has got files and subdirectories to a remote sever.
Pass credentials that will be required for the remote server.

I used 'Start-BitsTransfer' and 'copy-item' commands along with 'new-pssession' but I was not able to transfer the files successfully.
All the errors that I get is the path is not found (remote server) or something to do with authentication going bad.

Kenny's answer did solve the above problem, but now I am facing a new issue.
The below script works for the first time while connecting to the remote server.
Now, if I reuse the script by only changing the remote server to another servername, then I get the below error:
Exception calling "MapNetworkDrive" with "5" argument(s): "The local device name has a remembered connection to another network resource.
"
At line:20 char:1
+ $net.mapnetworkdrive("F:", "\NEWSERVERNAME01.COM\share\", "true",  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
"
Any idea on how to get through the above error ?
Answer: You can create a PSDrive
<code>New-PSDrive -Name "Computer1" -PSProvider FileSystem -Root "\\Computer1\Folder" -Credential $cred -Scope global
cp data.bin Computer1:\
</code>
THe PSDrive only exists during your powersehll session.
If you want to tranfer data through powershell remoting see this post
https://stackoverflow.com/questions/4225748/how-do-i-pass-named-parameters-with-invoke-command


how windbg determine which OS symbols to download for a dump file

Question: When I do a dump file analysis, I setup symbol path to point to Microsoft symbol server. How does windbg knows that the dump file was generated under what OS and how does it downloads correct symbols for that OS?
Answer: To match symbols to binary, WinDbg looks at the thing called Debug Directories. Debug Directories are sections in PE modules (which is a file format used by Windows for all types of executables). Debug Directories simply contain links to types of debug information. If you type command in cmd window link /dump /headers <my_module_name>, it will print out something like this:
...
Debug Directories

    Time Type       Size      RVA  Pointer
-------- ------ -------- -------- --------
4CC78FB1 cv           22 00102588   101988    Format: RSDS, {30976E0B-FBF7-45EF-8608-99932F2B791F}, 2, ntdll.pdb
4CC78FB1 (   A)        4 00102584   101984    BB03197E

...

This is output for ntdll.dll. You can see that CV (for CodeView) debug information is contained in  ntdll.pdb, and GUID of that PDB has to match the one in the link. That GUID is generated randomly for each module at build time.
Command !lmi in WinDbg will also dump this information, in different format.
What WinDbg does when loading symbols from symbol server is it sends request to symbol server to get file named 'ntdll.pdb' with matching GUID.
Comment: Do you mean this info is part of PE modules embeded within assemblies? When I create an application, I can run it over different OS with different Service packs. I am confused as to how this info stored in PE module can be used when application itself is running on different OS.
Comment: Each PE module has its own symbol file. There is no such thing as "symbols for OS", because OS is composed of a mixture of versions from different service packs, patches, hot fixes, private binaries, etc.
Comment: Let' say application assembly was compiled on Vista. I generate a dump for it on Windows 7 and another one for Windows Server 2008. In this case PE module will have Id for Vista, correct? How the two dump will get symbols for Windows 7 and 2008 in this case?
Comment: Again, there is no "OS symbols", there are symbols for particular PE module. Dump contains list of modules currently mapped to the process address space. There are different versions of kernel32.dll -- for different OS's processor architectures, more versions come with different OS patches. When debugger needs to resolve symbols for kernel32.dll, it looks up at the module information structure, which is created by the loader at the time module originally was loaded into process. This information contains some sections from PE image, including Debug Directory.


Refuelling during a run?

Question: I've reached a point where my training runs are long enough (2 - 3 hours) and far enough (15+ miles) that I  need to take on board some additional energy in the form of gels and/or sports drinks in order to complete them.
Is there any documented or recognised rate or consumption or guidelines as to how this should ideally be done in order to get the maximum benefits?
Should they be taken at regular intervals throughout the run or delayed towards the second half of the run?
I appreciate this will vary depending on effort and fitness; I am currently using a couple of gels and a bottle of sports drink to get me through a 19.5 mile three and a quarter hour run although the last 3 or 4 miles are still a real struggle.
Answer: The standard advice is:

a good meal 3 hours before race/training
refuel (like a small gel+water) 20 minutes before start
begin fueling 15 minutes after you start
hydrate every 15-20 minutes
use bars/gels/drinks every 10-30 minutes

Another thing is that you can calculate how many calories you'll burn and be sure to get that much from your gels/drinks in regular intervals.
Generally you have to try and see what works for you.
(I don't know how well are all these documented but they get used a lot)
Be careful
when running for 2+ hours you may refuel too little but you may also do so too much: don't drink too much, don't refuel too much; it's dangerous.
Comment: how do you carry it? I would like to run these lengths, but carrying water seems counter intuitive.
Comment: @Mild: 1) You can schedule your stops where there will be water 2) You can run a circuit where you leave water at the start 3) there are special "fuel belts".
Comment: @Mild One of these types of bottles is best: http://www.jjbsports.com/pws/ProductDetails.ice?ProductID=10929 plus your own homemade isotonic drink
Comment: homemade isotonic drink? got a good recipe?
Comment: I carry one or two bottles with hand straps: http://amzn.to/iEVXeN For self-supported runs over 20 miles, I run with a vest: http://amzn.to/lugai3 I like the bottle better. You get used to either. I carry gels in the bottle pouches.
Answer: This article says:

a mix of carbs, proteins, and healthy fat 30-60 min. before running
100-200 calories per hour during your run (whether with gel packs, snacks, or sports drinks)
refuel within 30 minutes after the run with 8-12 oz of a sports drink

I personally think GU isn't very appetizing and would opt for packets of honey instead. Although honey won't have sodium and potassium like you find in gel packs.
I found an interesting study and an article that suggests training your body to tap into your fat stores.

the study says to create a condition where your body is used to using fat stores:

Train at the top of your fat-burning zone (run without going anaerobic)
Raise the lactate threshold

It concludes that "before a long race or run you will have more endurance and perform better if you eat a meal containing carbohydrate two to three hours before. Early in the morning, your liver glycogen stores, which supply blood glucose, have been depleted by the overnight fast. The brain and nervous system rely on blood glucose for energy. If you start a marathon without replenishing these stores, you will bonk. The two-hour time interval is sufficient to reduce blood glucose levels back to normal and restore fat metabolism."
the article mentions a "superstarch" drink UCAN you can try to see if it doesn't wretch your stomach

Refuelling during a run?


Why aren't fusion reactors using centrifuges?

Question: If fusing of nuclei in stars requires pressure, heat, and gravity, why not use a centrifuge to increase the gravity? We currently have the technology to make diamonds, and generate immense temperatures. Thus surely if you increase the effective gravity, that would reduce the required temperatures! After all, as I understand it, the temperatures only need to be higher than a star, due to the lack of pressure - gravity!
Comment: The answers given elsewhere don't really answer the question! Bear in mind, fusion *can* currently be achieved, it merely takes more energy than is produced! Fusion occurs when temperature, pressure are sufficient to fuse 2 or more atoms together. Current fusion reactor technology generates temperatures way beyond those even at the core of the sun, and the force of gravity on the sun is 1,280g! We can generate forces way beyond 1,280g. (Car crash sensors can easily be rated at 3000g. I've repaired them!) Thus claiming we cannot generate solar temperatures clearly is wrong!
Comment: So please, if you *actually* know why increasing the pressure/gravity won't reduce the temperature required on earth compared to current temps, please answer!
Comment: I don't know where you got that figure of 1280 g for the Sun's gravity. It's ~27.9 g at the surface, but it's much higher near the core, see [this plot](https://i.stack.imgur.com/8o8En.png), which I created using the [Standard Solar Model](https://gist.github.com/PM2Ring/212e9a8cc73c203a93d288606ac4e466/) (BP 2004).
Answer: The pressures required to force fusion to occur are so great that there simply is no material existing that is strong enough to apply such forces to a sample of matter to be fused.
Regarding the use of a centrifuge to apply compression to a fusion sample, the same comments apply: there is no material strong enough to make such a centrifuge out of.
In any case, note also that the pressure needed to trigger fusion has to be applied to the sample in all directions, something that centrifuges cannot do.
Comment: Temperature inside the sun is of the order of millions of degrees. Your value of 5000K is for the atmosphere and has nothing to do with the fusion reaction.
Comment: The temperature and pressure in the center of the sun are 1.5E7K and 2.6E16pa.
Comment: Gravity on the sun is 1280g. Temperature of sun is 5,788k. The temperature in current fusion reactors are way beyond those of the sun! Thus that is a non-sequitur! Also the mere fact we CAN generate fusion on earth, it just takes more energy than it currently generates PROVES what you stated is simply untrue! The only thing we aren't currently generating on earth is the gravity - and a centrifuge increases gravity! Still need an ACTUAL reason why not using centrifuges!
Comment: I feel the core of the question is being missed! We CAN generate fusion, thus generating necessary heat is IRRELEVANT! a centrifuge simulates increasing the gravity (or pressure - O'm not a physicist - hence the question). Thus would increasing the force on the matter reduce the temperature required?
Comment: It's contained currently by magnets - thus your response is IRRELEVENT! How can adding additional kinetic energy to the process not aid the process? It's clear you don't understand the question!
Comment: Calm down,  dodgy.  try to be nice. I am trying to be nice.
Answer: To add to @NielsNelsen's answer: it's not just that no solid material can withstand the needed pressure. The heat and heat capacity of the plasma are also problems. The plasma is high pressure primarily because of the high temperature, the density of the plasma is actually quite low (remember: $P = k \,(\mathrm{number\ density})\, T$). Because of this, if you allow the plasma to come in contact with the walls it would very quickly cool - low density means low heat capacity.
That's why just about every fusion reactor idea relies on either inertia or magnetic fields to confine the reaction. In inertial confinement, you use lasers (National Ignition Facility), explosions (think fusion bombs), or something similar to cause the temperature and pressure to suddenly reach insane levels faster than the hydrogen can fly apart. The reaction then proceeds until the density drops.
Magnetic field confinement relies on inventive and careful structuring of dynamic magnetic fields to hold the plasma away from the reactor walls. These are the tokamaks, stellerators, etc.
Why not just drop the temperature and up the pressure? Well, that won't work. Let's do some basic calculations. The fusion rate is going to be proportional to the number of collisions between nuclei that are above a certain energy cutoff $E_c$. The collision rate is proportional to the square of the number density (because you need the density of two nuclei being in the same place).
In an ideal gas you have $PV = NkT$. Divide both sides by $V$ and $kT$ and you get the following formula for the number density:
\begin{align}
   \frac{N}{V} &= \frac{P}{kT}
\end{align}
Strangely, the density goes down with temperature, so you might think that you'd want the lowest temperature possible. Doesn't work, though. When the temperature gets low enough you just liquefy and then freeze the hydrogen, and you density stops going up at that point unless you apply more pressure mechanically.
Those kinds of pressures aren't feasible for physical things to exert, though. You're trying to force the nuclei of atoms together by pushing other atoms into them. Do you see the problem? The pressures needed to get fusion going in the fuel would exert enough mechanical back pressure to rip apart the bonds between the atoms of the walls, liquefying them, too. Even if you could keep the walls from breaking apart, if the atoms in the walls have lower atomic number than nickel/iron on the periodic table you're probably going to get them to start fusing with the hydrogen, too. If the walls have higher atomic number, you'll probably start catalyzing fission. Either way, no container made of atoms could withstand the demands this would place on it.
Even if we disregard that bit of physics, though, there's a huge problem with the fraction of atoms above the cutoff energy. The formula for that looks like
\begin{align}
     f(E >= E_c) &= \frac{\int_{E_c}^\infty \exp\left(-\frac{E(p)}{kT}\right) \, p^2 \mathrm{d}p}{\int_{0}^\infty \exp\left(-\frac{E(p)}{kT}\right) \, p^2 \mathrm{d}p},
\end{align}
where $E(p)$ is the energy of a nucleus with momentum $p$. This integral is a little complicated, but the key factor here is that as temperature drops the fraction of the exponential $e^{-E/kT}$ drops exponentially. To counteract that exponential drop you'd need to up the pressure exponentially to compensate, and that's just not feasible.
Notice, I didn't mention gravity. Because gravity is just the mechanism that allows the sun to achieve high enough pressure and density to get fusion at a lower temperature than we can achieve here. That, and the sun is stupendously huge, so fusion there is actually kind of slow, but it doesn't matter because there is so dang much sun. The power output per unit mass in the core of the sun is actually comparable to either your body or a compost heap rotting, I forget which. Because of its size, the outer layers can insulate the core to keep it hot, and the core just has enough mass that the total power output is huge even with the low density.
Comment: As I said [here](https://astronomy.stackexchange.com/a/51320/16685), the Sun's power in the core is roughly equal to a compost heap per unit volume. But the core density is ~150 g/cm³, so the power per unit mass is abysmal. ;)
Comment: @DodgyBob As Sean & Niels said, the gravity itself is only relevant because it creates pressure (via weight), and high pressure itself is only relevant because it causes high density. Your centrifuge can't create pressure without some kind of barrier that the plasma gets squeezed against. We normally confine fusion plasma using electromagnetic fields because solid matter can't withstand the high temperature, and would suck heat out of the plasma.
Comment: @DodgyBob I'm explaining why if you attempt to add the pressure needed using a centrifuge you will fail. Yeah, if you had God's indestructible perfectly insulating hand, you could do exactly what you want. Us mere mortals have to work with real materials under real conditions, and those materials will both drain heat and break down.
Comment: @DodgyBob BTW, the proto-Sun was hot from gravitational collapse converting gravitational potential energy to kinetic energy. It took hundreds of thousands of years to shed enough heat so that its core could achieve the density necessary for sustained p-p fusion.
Comment: That's all well and groovy, but doesn't answer the question! as I understand, heat pressure & gravity affect fusion. Thus if say AxBxC = fusion, A=temp, B=pressure, C=gravity. Thus if you increase B, A and/or C can be reduced. I'm sure there are practical issues, ultimately can you increase gravity or pressure and reduce the heat requirement? I'm sure I'm missing something, so what is it?
Comment: Still doesn't answer the question! Why can't adding additional pressure aid the fusion? You seem to be avoiding or not understanding the question! Copying and pasting an article / paper doesn't answer the question! If pressure is required to generate fusion, how can providing EXTRA pressure not aid? It will add kinetic energy to the process!
Answer: I answer only because the asker isn't satisfied with any of the currently existing five answers. And I think in some sense that's valid - nobody has directly addressed the concepts that they are asking about, although I think some answers contain correct and useful statements about how fusion actually works.
The question seems to assume that gravity plays some role in generating the pressure in fusion experiments, so if you were to effectively increase gravity, fusion would be easier to achieve. This is completely incorrect.
Gravity is involved in generating the pressure of the atmosphere in the following way: the sea level pressure of the atmosphere is the weight of a the entire column of air above us divided by the cross-sectional area of that column. So if we were to increase $g$, then the weight of each molecule of air would increase, and the pressure at sea level would increase. However, fusion experiments don't consist of physicists looking at the atmosphere at sea level and going "huh... why isn't it fusing already?"
For basically anything else, gravity plays no role in generating pressure. Consider a gas at high pressure in a container (for example we start with the atmosphere then compress it with a piston). The pressure is described by the ideal gas law $P=nk_BT$. So the pressure comes from the density and temperature and gravity has nothing to do with it. Putting the apparatus in a centrifuge will not change the pressure. Another way of seeing it is that the pressure comes from the force per area we can apply on the piston (leverage, gears, motors, etc.), and that's going to be a lot more force than we could ever achieve from a centrifuge.
So what about fusion experiments? As others have pointed out, for fusion experiments the plasma is too hot to be in contact with container walls, which would destroy the container walls and ruin the plasma at the same time. There are generally two kinds of particle confinement for fusion - magnetic confinement and inertial confinement. In magnetic confinement, charged particles are prevented from escaping by magnets which restrict the particle's motion. In inertial confinement we start with a solid mass and we compress it... really there's no confinement, but for a short period of time you have something really hot and denser than a solid. So like the situation with the piston-compressed air, gravity is playing no role in generating the pressure. We start with some initial density of gas (or solid for inertial confinement), then turn it into a hot plasma confined in some other way, which makes the pressure astronomically higher than the initial gas pressure.
It is true that fusion experiments rely on "pressure" (usually phrased as density) for success. A fusion experiment's efficacy can be parameterized by the "fusion triple product" - temperature times density times confinement time. Essentially, when this triple product increases, the likelihood increases that a charged particle will undergo a fusion reaction before it escapes from the plasma. Higher temperatures mean more collisions and the collisions are more likely to produce fusion, higher density means more collisions, and higher confinement time means more chances to fuse before being lost. Physicists are working as hard as they can to increase these three numbers. But since gravity never had anything to do with the pressure, increasing gravity using a centrifuge won't help.
Let's look at some numbers to see how this works. Below is a plot from  this wiki page of different experiments' triple product. JET's confinement time is about a second, and its triple product is about $10^{21}\text{ keV m}^{-3}\text{s}$. So its density times temperature is $10^{28}\text{ K m}^{-3}$ (one keV is about 12 million Kelvin). When we plug this into the ideal gas law we get a pressure of about 1.3 atmospheres. But we can also find much higher pressures in inertial confinement experiments with much lower confinement times. NIF is one such experiment which boasts a triple product of $10^{22}\text{ keV m}^{-3}\text{s}$. Its confinement time is $10^{-10}\text{ s}$, so we get a pressure of about $1\times 10^{12}$ atmospheres.
Comment: Gravity is a source of pressure! Thus it will have an effect! The five answers or whatever it is now state there is no material that can handle the heat - YET WE CAN PRODUCE FUSION - JUST NOT EFFICIENTLY! Thus all those people who googled a paper on fusion MISS THE POINT!!!!! Fusion requires pressure and temperature! The "basics" are simple, the practicalities aren't! Instead of re-posting papers you don't understand, explain WHY additional kinetic energy won't increase heat! This is physics 101! Stop pretending you know the answer if you don't! The responses don't understand the question!
Comment: @DodgyBob Gravity is _a_ source of pressure... for the atmosphere. It is not _the_ source of pressure in current fusion experiments. Fusion requires temperature, density, and confinement time, or you can phrase it as pressure and confinement time (see the triple product discussion in my answer). Additional kinetic energy will always increase heat... that's basically what heat is. I never said anything to the contrary. Honestly I suspect you didn't read any of my answer. Most of what you're saying is addressed in the answer or not in any way a response to anything I said in the answer.
Answer:
Thus surely if you increase the effective gravity, that would reduce the required temperatures!

It really doesn't.  Temperature is effectively a measure of particles speed and KE (across a distribution).  That tells you what fraction of them have sufficient energy to overcome the coulomb barrier.
Increased pressure or density might affect the rate of fusion, but it doesn't let you lower the temperature.

the temperatures only need to be higher than a star, due to the lack of pressure - gravity!

No, you need temperatures very similar to that of a star.  There are a couple of things that will modify that need:

Materials.  D-T or even D-D fusion can happen at temperatures slightly cooler than necessary for proton fusion.
Efficiency.  Fusion happens at a relatively slow pace in the sun.  If you want the energy to come out faster, then a higher temperature greatly increases the rate.
Comment: You can increase the rate with higher temperature (the rate of fusion in the sun is orders of magnitude too slow for commercial use).  But you cannot remove the minimum temperature requirement with higher pressures.  https://physics.stackexchange.com/questions/281082/nuclear-fusion-with-extremely-high-pressure-and-low-temperature
Comment: All fusion rates already include tunneling.  The required temperatures would be much higher without it.  But it's still common to speak of "overcoming the coulomb barrier".  Even with tunneling, the fusion rate is effectively zero below a critical temperature.  The point is that realizable pressures don't lower that critical temperature.
Comment: A tokamak generates 100 million degrees celsius, the sun surface temp is under 5.8k, core temp is "only" 15 million ! Thus your temperature argument CANNOT be valid! Gravity on the sun is 1280G, Pressure to make diamonds is 725 kpsi. We can actually fuse atoms currently on earth, thus increasing the pressure and or gravity, will thus reduce any need for temperature! So why wouldn't a centrifuge make fusion occur at lower temperatures?
Comment: Really? You can't quantum tunnel through that barrier? How else do you explain muon catalyzed fusion? https://en.wikipedia.org/wiki/Muon-catalyzed_fusion
Comment: https://www.fusionenergybase.com/article/measuring-progress-in-fusion-energy-the-triple-products See the fusion triple product for an explanation of why density is considered one of three key parameters for successful energy-producing fusion reactions. The idea is essentially - all fusion reactors easily have high enough temperature for _some_ fusion reactions to happen. The question is whether or not each nucleus is likely to undergo a reaction before it is lost. Increasing the density increases the number of collisions it sees, each giving a chance of fusion.
Comment: The temperature is already achievable, because we achieve fusion! Friction of particles, increases energy, hence the heat! We can contain the matter using magnets, the problem is the energy used. A centrifuge is a known technology, the efficient heating isn't. You provide energy, you can increase heat and pressure. Still haven't heard a valid reason why it couldn't work!
Comment: Any pressure we can achieve doesn't increase the fusion rate appreciably.   If you could remove heat losses, that would be great, but increasing the pressure doesn't help.
Comment: Again, doesn't answer the question! Current tech cannot increase ENOUGH, but my question is COULD IT!? We cannot generate fusion currently for extended periods. Thus as of Aug 23 no process "works" for commercial fusion at all! My question is pretty simple CAN A CENTRIFUGE AID FUSION? If you need x amount of heat / pressure, if you increase the heat / pressure by "injecting" kinetic energy, that is reducing the need for generating heat by other means! Is it possible? Is it currently practical/possible? 2 completely different questions! & heat resistance of materials - IRRELEVANT!!!!
Comment: No.   We can generate fusion for extended periods, but only with an energy cost.   A centrifuge or any other external pressure will not reduce the temperature requirements.
Comment: @DodgyBob there is no possible material (bar neutronium - which may not even be stable outside neutron stars) which can hold a centrifuge together that spins fast enough to lower the temperature requirements by any appreciable amount. Even then the temperatures might still be high enough that the walls would melt/vaporize/etc.
Comment: Using magnetic confinement in a centrifuge would be impossible because of the extreme magnetic field strengths required to counteract the force.
Answer: Dodgy Bob, I just came across your question and wanted to pass along an experiment I set up years ago to test exactly what were asking in your asking specific to centrifugal fusion.
Here are some of the assumptions I was working with:
Specific to reproducing the Sun's G-force:

Using a pulley wheel that had a curved lip on each side of the wheel I poured deuterium onto the horizontally mounted wheel.  The idea here was that, once the spinning started, the deuterium would be held in place within the curve of the wheel's "lip".  The speed of the wheel could be tuned to match the required g-force and two copper rods were mounted on both sides of the wheel to allow for the plasma arc on both sides (horizontally). The copper rods were connected to a high voltage plasma generator.
You can see the experiment here at my YouTube site.  I did not study physics in college so I still don't understand the results you see in the video.  The radiation detector I mounted on the steel cabinet was picking up radiation but I can't say why.  Ionized deuterium fused by high voltage is kind of an old school method of fusion that's been around a long time. It's possible that's what we are seeing here.  My understanding is that if neutrons were being released they are not picked up by this type of radiation detector and have to be identified by a neutron "bubble detector" which I did not have available.
All in all it was very interesting!
Here is the video:
Centrifugal Fusion Video by Guy Cobb
Answer: Simply because gravity is attractive, while the centrifugal force is repulsive. You need a force from all sides in order to do the fusion process.
Comment: The pressure we experience from the atmosphere is in all directions. This is despite the fact that it is generated by the earth's gravity, which only acts in one direction. A centrifuge does the same thing. It compresses a sample by applying a force in one direction, but as the material reaches equilibrium, it can be described as having a pressure, which will indeed be enhanced by the centrifuge.
Comment: Thanks for that. My concept is to provide additional force to achieve the required temperature for fusion. It may well be utterly impractical, it might use way too much energy to achieve. However, hypothetically, would a centrifuge aid fusion?


PCman filemanager displays old data on USB mounted drive

Question: When I plug in usb flash drive, or even my camera and open File Manager only old data that was previously on usb drive (or Camera's memory card) is shown. I can't open any of those files or see any new listed. Is there any way to clear usb cache, some temp files or something where that data is stored. I am using Lubuntu 12.04.
Answer: Solved the problem by installing Nautilus. Now I use it as default file manager and have no problems stated above or any other at all.
Answer: I'd recommend the PCManFM re installation:

Remove existing PCManFM.
sudo apt-get remove pcmanfm

Install PCManFM again.
sudo apt-get install pcmanfm

After that reboot the system to see the changes.
sudo reboot

Comment: Tried that already, but problem wasn't solved. Nautilus was the only solution that worked. Thanks anyway.


How do I create persona for international airport website?

Question: How do I create persona for international airport website?  How do I Identify my audience where audience base is diverse? And how many personas needed to be designed?
Comment: @JohnGB I agree that this question is very broad, but how can people new to the field get into it? I think we cannot expect newcomers to focus on a single item. And sure, there are books on persona creation, but probably not one focussing on airports ;-)
Comment: This wasn't closed because I don't like the question, but rather because it doesn't meet the requirements of questions on this site with this format.  Any reasonable answer to that question would be a small lecture series, and so doesn't suit this format.  People new to UX have many resources to go to, and if you want something as broad as this, then it's better to get a book dealing specifically with personas first. Then, if needed, you will have enough background to ask a narrow question.
Answer: Hmm, "international airport website" is a little too vague. Are you targeting people flying from this airport?
Then it's easy - there should be plenty of people available for interviews at the airport: They have some experience with the airport (maybe even the website), they usually have some time (while waiting in a queue), and they probably have some opinion or story that they can share with you. So I'd spend a day doing some "pilot" study where I wander around the various places (drop-off, parking, check-in, shops, boarding, at least) and ask people about why they came here and what they want to do here. Be sure to interview outgoing (in the security queue or waiting to board) as well as incoming (at the luggage queue) people. Frequent hand-luggage-only people will be harder to interview, but there's usually some distance to walk; I'd try to accompany them.
The pilot should allow you to identify the most common groups related to travel: People bringing or picking up somebody else, first-flyers, business travellers, holiday travellers, together with some cross-sections like public transport vs. own car or just-flyers vs. heavy shoppers (maybe there even are shop-only visitors?). After you have these identified, you can tailor interview guides for these prototypes, do detailed interviews for each, and from these results, create personas.
I have no idea who else you might be interested in - job applicants, environmental groups, freight and transportation?
If you specifically need to target people who never visit(ed) the airport, I have no other idea than local newspapers/boards/etc.
Comment: Thanks virtualnobi! yes I mean people flying from this airport. And I was bit stumbled upon which audience to segment and who are the most important once to target and find commonalities. Your answer will surely helped me.
Comment: Harshal, glad I could help. If no better answer comes up, consider marking this as the best - feedback like that keeps us motivated.


Why do the edges of glass blocks create a shadow?

Question: I have always observed that the shadow of glass blocks becomes darker as the glass is moved away from the surface where the shadow falls. And I know this is because refracted light rays from the glass block leave the block at an angle which creates the shadow of the glass block in the first place. However, whenever I try to observe the shadow of a glass block I can clearly see a dark outline of the block formed by its edges, irrespective of the distance from the surface where the shadow falls. And it is this outline, I seek an explanation for. Why is it that no matter how the glass block is oriented or how far it is from the surface where its shadow falls, its edges always form a distinct shadow?
Comment: There, I added a picture of the shadow I wanted to know about. I think it has something to do with the light being incident on the edge with an incident angle of 90 degrees to the normal, and hence the ray refracted inside the glass with a angle of refraction equal to the critical angle of the light in the glass. So, refraction occurred at the edge and that's what causes the shadow. I think that's the answer but I don't know for sure though. Is it really possible to have a light ray refract with an incident angle of 90 degrees.
Comment: there may be several things going on there.  Can you post a photo or video of exactly what you're observing?
Comment: good photo.  how does it change as you tilt it?  My guess is that is total internal reflection.  Iff you know what the index of refr. for your glass, you could use snells law to verify this...but don't forget: your light is likely not coming straight down.
Answer: Not all the light shining on the top surface of your glass block can pass straight through the block.
Inside the block, total internal reflection occurs at the side faces. The light which was "supposed" to exit through the sides is refracted to the inside. This causes the shadow you observe and a slighly brighter middle section, which is hard to see.
In fact, you might be able to see a brighter rim on the inside of the side's shadows if you move the block very close to the table.
Answer: Some sources say that about 6-7% of light gets reflected on hitting a glass.A glass seems to be transparent, but it not. Actually we cannot create a completely transparent solid body.
At molecular level:
When light encounters a material, it can interact with it in several different ways. These interactions depend on the wavelength of the light and the nature of the material. Photons interact with an object by some combination of reflection, absorption and transmission. Some materials, such as plate glass and clean water, transmit much of the light that falls on them and reflect little of it.
Regarding thicker shadows at edge
If you see the mirror sideways, you will find that its green in color. The green color is due to presence of impurities like iron. With naked eyes you cannot see through the mirror in side ways orientation, thus the incident light are obstructed to pass completely through the edges, hence the shadows at edge are thicker
I hope that I was able to answer your question, Comment if you have any doubt or query :)
Comment: Actually, I can see through the glass when it is in side ways orientation. The green colour is only visible if I see the side at an angle.
Comment: yeah the color depends on iron content , but as you must have noticed a bit of green of side, that means it is obstructing the light rays and not absorbing green wavelength , thus it can be considered hindrance. The green color can be controlled by varying the amount of iron quantity.
Answer: [This was an answer to an earlier version of the question, and doesn't address the band-of-shadow thing at all.]
I think the answer is that glass isn't that transparent, and in particular there are fairly significant losses at the surfaces (this is why camera lenses have fancy coatings which attempt to reduce the loss at the air-glass surfaces).
So, while there are effects due to refraction there is also the blunt effect that, if there's a bit of glass between you and a source of light -- and particularly if there are air-glass or glass-air surfaces -- then not all the light reaches you.  The result of this is shadows with fairly hard edges.
Answer: It appears to me that your piece of glass is beveled on the edges. When I place a beveled and non beveled piece of glass side by side directly under a light only the beveled one has the shadow.The angled edges are reflecting and refracting the light away from the area directly below.


Could not resize shared memory segment error

Question: I have a PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) running in a docker container.
I get the following error with some queries:

could not resize shared memory segment "/PostgreSQL.860708388" to 536870912 bytes: No space left on device`

system:

Ubuntu 18.04.5
memory: 126 GB
cores: 64

disk usage is fine, as well as quotas.
Postgres settings:

work_mem: 30GB,
dynamic_shared_memory_type: posix
max_parallel_workers_per_gather: 32
Answer: Lowering number on max_parallel_workers_per_gather to 8 seems to have fixed the problem in my case.


Ipad Air totally unresponsive

Question: I was just using it and I let the screen go off and now it will  not do anything. I tried plugging it into a computer. It won't turn on or off. The battery was not low.
Comment: Try holding `Home` + `Power` button for a while.
Answer: Typically, you still follow the traditional steps which does let you charge it for at least 30 minutes just to be sure the battery indication wasn't stuck at an incorrect reading:

http://support.apple.com/kb/TS3274

If none of the steps there work, you'll need to take it in for hardware service or a replacement.
Comment: I tried plugging it into a computer but it doesn't even come up with the little thing either. Plus I had it on the charger ALL last night. It's been unplugged for 2 hours.

Ipad Air totally unresponsive


Is touching a ground wire nailed to the brick wall safe?

Question: So I am living in an apartment. This apartment is kinda old so it does not have the ground contact (Every electric outlet in this building comes out in 2 sockets only - no ground). I have a running desktop PC. Since there is no ground plug I have to use an adapter to convert the 3 prongs of PSU into 2 prongs on wall socket. This apparently gives my PC static shock whenever I touch on the metal part. A friend of mine gave an advice of hooking a wire from a screw bit of the PC, the other end wrapping around a nail punched into the brick wall. Assuming doing this would get rid of the static shock in my PC, would I get shocked (or any serious injury) if I (accidentally) touching the wire, or the nail end ?
Comment: If that wire is a ground you would have to make contact with it and connect to a ground like your adapter or install a 3 wire receptacle) In the U.S. code changed a few years back allowing tapping  a ground if it was connected to the source of the power (at the main or within 5' of entry to the building if a water pipe) there are rules for the connection but just putting a nail l in the wall close won't work.
Comment: never assume anything ... it would only work if the nail contacts a grounded object
Answer: Touching the wire placed in the brick wall will do nothing, as will the entire wire.  It's safe because it's also ineffective.
To do better: you could in theory run a wire from a nearby metal cold water pipe.  Start with one of these:

Then run an extension wire to a nearby cold water pipe, and use one of these:

Or speak with your landlord about paying for an electrician to do what amounts to the same thing.
The third prong can help dissipate nuisance static, and it helps the surge protection equipment in your power strip or PC work better.  It has little impact on safety in this particular case.  Note that a GFCI device would solve no actual problem, though an electrician might want to install one because it easier than running a wire.
Comment: 1) OP's concern is static, why do you write that brick is ineffective? ESD mats are not copper either. 2) GFI protects the user in the event of a fault and a loop through the user and ground, which is what one of the hazards is. This is not uncommon in isolated setups.
Answer: Static electricity always is an instant shock and then nothing, and it won't repeat unless you get up and walk around.  Any shock which repeats or sustains is AC mains voltage trying to kill you.
Just because of the way electrical resistance works, most of the time you will feel it but it won't be able to flow enough current on a route through your body that would kill you.
Why is AC mains trying to kill you? Faulty PSU in the Poor auxiliary equipment (monitor, router, printer).  Most PSUs (especially in 230V-land) need to be built so either wire can be "live". That is because most European sockets are reversible - flip them over and the other wire is live.  But making PSUs safe also makes them more expensive.
A quality PSU should entirely isolate you from mains power, so it will not zap you. You will still get zapped by static electricity. Nothing will fix that.
There are two workarounds.

Use a RCD/GFCI protector of some kind. That will disconnect both live and neutral wires if you are starting to be electrically shocked. That will also shut off the computer, though.
Establish proper safety earthing.  And there is a Codebook standard for doing that, and don't do anything less. Unfortunately many 5-continent installations depend on the utility to provide safety earthing.

Trying to do earthing "halfway" is counterproductive.  If you aren't doing your earthing correctly, then you may be making things worse. If your computer is shocking you, then attaching that to a water pipe that isn't properly earthed is only going to make that water pipe shock anyone who touches it!
Answer: A nail in a wall is not an Earth [or Ground depending on where you live]. A dry internal wall is just not a route to Earth.
An Earth is at minimum, a long heavy metal spike driven into the actual [physical dirt] ground, to which all Earth/Ground connections are bonded. The main Earth in compulsory Earth territories actually runs back to the local electricity sub-station on the main power grid.
A makeshift [& in compulsory Earth territories often used as a backup, but not only] Earth connection is to bond all bare metal piping together & wire Earth connections to that bonding. This works to some extent because [& if] the pipes actually run though the physical ground before they enter the property.
This only works at all if the piping to the property isn't plastic.
I would consult an electrician & not trust to guesswork or hearsay.
Note that even if your computer casing was correctly earthed, you could still get a static shock when touching it if you have plastic-soled shoes & nylon carpets [or rub a cat on an amber rod, or a balloon, or any of those old physics class experiments]. You would discharge your imbalanced potential to earth, using the ground connection & the case's propensity to act as a Faraday cage, protecting the computer's components.
Answer: This is a trick and it can work well to dissipate static.
Since you are attaching the wire to the already exposed screw of the PC and not an internal wire, you are fine.
But note it will not provide adequate grounding as the PSU requires. If there is an internal short of some sort, the nail/wire will not provide a secondary high-current path to ground.
In situations like this it is safer to use an extension cord with built-in ground fault protection.
This will reduce the hazard. And you can still ground the PC with the wall/nail to dissipate static.


Recording/capturing/grabbing remote desktop RDP session as video on Linux?

Question: I have just learned about RDP, and have successfully used remmina on my Ubuntu machine to connect to a remote Windows PC.
Now, I would like to record that remote desktop session as video from the client (Ubuntu) side - however I have difficulty finding what I can use for that on Linux; I have found https://github.com/rdp/screen-capture-recorder-to-video-windows-free but that seems to be for Windows. The only thing relevant I could find is https://www.jedi.be/blog/2010/08/30/capturing-the-screen-of-your-virtual-machines-using-x-vnc-rdp-or-native/ from 2010, which recommends:

Recording a video:
The only way (I found) is to capture the RDP session as a video is to use ffmpeg as explained in the X-session, with rdesktop displayed in Xvfb session.

I cannot really tell if remmina uses rdesktop - but I've found https://github.com/muflone/remmina-plugin-rdesktop so it probably doesn't. In any case, I could probably open remmina in an Xvfb session instead, and otherwise follow that approach - that is, use ffmpeg to grab the virtual desktop/Xvfb session.
But, what I'm thinking is: remmina (or a program it calls) must at a certain point "render" the pixels, that I'm seeing as the end result of the RDP connection - so ultimately, I'd like those original pixels saved as files; otherwise there is overhead of rendering those pixels on screen, and then having another tool (ffmpeg) grab them back again, and compressing them as a video frame.
I'd expect the captures of "original pixels" to be uncompressed frames of pixels, that is, file sizes of a capture will be huge - but then, I'd have proper source material to encode as a video as I wish (in a separate ffmpeg encoding pass).
So, is there an already existing tool (like remmina, rdesktop, xfreerdp which I haven't tried yet) that would save the uncompressed/original pixel frames of an RDP remote desktop session - or possibly, encode those frames as video in real-time (so you don't have to use another tool to re-grab the pixels from screen in order to screen capture a video)?
I was also thinking - if none of these tools can capture frames of video from the RDP session, maybe there is some proxy that can be used? I know there is https://github.com/ribasushi/rfbproxy "a record/replay proxy for RFB (used by VNC)" which can act like that for VNC: you run rfbproxy to connect to a VNC server; and with your VNC client you connect to the rfbproxy instead; then rfbproxy saves the "original" frames of the VNC remote desktop session in its own format. Is there something like that for RDP on Linux?
Comment: For screen recordings, I am using `ffmpeg -f x11grab  ...` in a [script](https://tex.meta.stackexchange.com/a/2869) that encodes the video on-the-fly to a file in `/dev/shm/`. It should work with `remmina` as well.
Comment: (The script does not record audio.)
Answer: The world has moved on since 2010. AFAIK it's still not possible to MITM an RDP session to create a recording (plenty to steal passwords and NTLM hashes) as can be done with VNC. Bit there are several screen recorders available for Linux. Here's a comparison of some the available screen recorders on Linux. If you are using Gnome desktop, then you already have a screen recorder installed.


US citizen born in Mexico. Do I need a Mexico passport to travel to Mexico by plane?

Question: I was born in Mexico and I became a US citizen through naturalization. I am going to travel to Mexico for vacation. Do I need a Mexico passport to travel? Or can I just travel with my US passport?
Comment: See the above. To enter Mexico as a Mexican citizen, you'd want to show one of the listed documents, but it doesn't need to be a Mexican passport. You'll need your US passport, of course.
Answer: You need a US passport to re-enter the US by air.
To enter Mexico, you should have a Mexican passport or one of the documents listed here


How to overcome addiction to sweet sugar foods?

Question: I have developed addiction to sugar sweet flavoured food intakes. I am worrying as I believe it can lead to severe consequences.
How should I overcome this addiction ?
Comment: maybe start eating more fruits and salads, also juicing greens over time changes your taste preferences, but it does take some time
Comment: Please upvote whichever answers you like best.
Answer: Here are some ways to tame those sugar cravings.
Give in a little. Eat a bit of what you're craving, maybe a small cookie or a fun-size candy bar, suggests Kerry Neville, MS, RD, a registered dietitian and ADA spokeswoman. Enjoying a little of what you love can help you steer clear of feeling denied. Try to stick to a 150-calorie threshold, Neville says.
Combine foods. If the idea of stopping at a cookie or a baby candy bar seems impossible, you can still fill yourself up and satisfy a sugar craving, too. "I like combining the craving food with a healthful one," Neville says. "I love chocolate, for example, so sometimes I'll dip a banana in chocolate sauce and that gives me what I'm craving, or I mix some almonds with chocolate chips." As a beneficial bonus, you'll satisfy a craving and get healthy nutrients from those good-for-you foods.
Go cold turkey. Cutting out all simple sugars works for some people, although "the initial 48 to 72 hours are tough," Gerbstadt says. Some people find that going cold turkey helps their cravings diminish after a few days; others find they may still crave sugar but over time are able to train their taste buds to be satisfied with less.
Grab some gum. If you want to avoid giving in to a sugar craving completely, try chewing a stick of gum, says nutrition advisor Dave Grotto, RD, LDN. "Research has shown that chewing gum can reduce food cravings," Grotto says.
Reach for fruit. Keep fruit handy for when sugar cravings hit. You'll get fiber and nutrients along with some sweetness. And stock up on foods like nuts, seeds, and dried fruits, says certified addiction specialist Judy Chambers, LCSW, CAS. "Have them handy so you reach for them instead of reaching for the old [sugary] something."
Get up and go. When a sugar craving hits, walk away. "Take a walk around the block or [do] something to change the scenery," to take your mind off the food you're craving, Neville suggests.
Choose quality over quantity. "If you need a sugar splurge, pick a wonderful, decadent sugary food," Moores says. But keep it small. For example, choose a perfect dark chocolate truffle instead of a king-sized candy bar, then "savor every bite -- slowly," Moores says. Grotto agrees. "Don't swear off favorites -- you'll only come back for greater portions. Learn to incorporate small amounts in the diet but concentrate on filling your stomach with less sugary and [healthier] options."
Eat regularly. Waiting too long between meals may set you up to choose sugary, fatty foods that cut your hunger, Moores says. Instead, eating every three to five hours can help keep blood sugar stable and help you "avoid irrational eating behavior," Grotto says. Your best bets? "Choose protein, fiber-rich foods like whole grains and produce," Moores says.
But won't eating more often mean overeating? Not if you follow Neville's advice to break up your meals. For instance, have part of your breakfast -- a slice of toast with peanut butter, perhaps -- and save some yogurt for a mid-morning snack. "Break up lunch the same way to help avoid a mid-afternoon slump," Neville says.
Reference :  http://www.webmd.com/diet/features/13-ways-to-fight-sugar-cravings#1
http://dailyburn.com/life/health/sugar-addiction-detox/
Comment: I investigated and found that some (or all) of your post is quoted from your sources. I wonder if you could please [edit] it and mark all of the quoted text as a [blockquote](https://daringfireball.net/projects/markdown/syntax#blockquote)?
Comment: @ tealhill ..sure and will do it
Answer: There are two aspects to feeling "addicted" to sugar

Expecting a very sweet taste to the things you eat and drink, and not enjoying unsweetened or less sweetened versions. Maybe you like three sugars in your tea or coffee, or you sprinkle sugar on cereal, fruit, and the like
Getting a "rush" when you eat something sweeet, and feeling a drop later, which you fix by having more sugar.

Not everyone experiences the second, but many do. Your approaches to the situation depend on which thing you're trying to fix.
For being used to a sweet taste, try a little while of not eating the things you expect to be sweet. No tea or coffee, no cereal, no toast, whatever. Then when you reintroduce the food, use half the sugar that you used to. If that sounds too unpleasant, try gradually reducing the amount of sugar you add over a few weeks. Switching to alternate sweeteners (whether "healthier" like honey or maple syrup, which might provide a few micronutrients as well as sweetness, or lower-calorie like Splenda, Stevia etc) isn't going to help this pattern of needing sweetness, so it's a poor solution. When you can't get diet ginger ale you'll just drink regular ginger ale because you patterns haven't changed so you don't like water. If you want to eat and drink fewer sweet things, do that, don't change where the sweetness comes from to make your old pattern ok.
For the sugar rush/high followed by crash, things are different. Whenever you eat something sweet, be sure to eat some protein or fat at the same time or very shortly afterwards. This will mute the high a little and more importantly, prevent the crash. This was an issue for both my children and they learned how to get something other than pure sugar into their system quickly. So if you start your day with jam on toast, instead of two slices of that, have one of jam on toast and then one of peanut butter on toast. If you start your day with a bowl of fruit, how about putting some yogurt (ideally not zero fat yogurt) in there too? If you have a donut or cookies at 3pm, could you not also have a little cheese (brought from home, it won't spoil) or some almonds or peanuts (which will keep for weeks) as well?
Answer: Sugar is a kind of food. So, you might want to try some food-addiction support programs.
Overeaters Anonymous is a good option. Sugar addicts are always welcome to join their program.
They have:

meetings you can visit
a podcast
books and pamphlets that you can buy
and a sub-Reddit where you can post.

Thoughts?
Answer: You may want to try the following suggestions:

Don't keep any sugary foods in your home. Instead, buy healthier options such as fruit.
If you do buy sugary junk foods, buy smaller quantities. Also, put some sugary junk food in a bowl, then close the package and put it away. This will reduce your temptation to eat too much.
Also, gradually change your habits. For example, instead of adding honey to breakfast cereal, add fresh or dried fruit. Raisins and dates are convenient and inexpensive.
If a sugar craving hits, distract yourself. For example, you could phone a friend, or read a book, or go bicycling.
Comment: Could you merge the two answers into one? Thanks
Comment: I kept them separate on purpose. Why do you think they should be merged?
Comment: Generally, we only expect one answer per user. You can use markdown to show that there are different parts to your answer. You can just provide multiple solutions in one answer.


Using Airplay with Noise

Question: Is there any way to connect my Airplay system to Noise? I know that I can make it work with XMMS2 through a plugin.
I have an AirPort Express which run perfectly with OSX 10.10 and Windows 10.
Comment: I'm assuming you have an AirPort Express not AirPlay Express (which I could not find anywhere), so I edited it accordingly.
Answer: I found this solution for Ubuntu, which in theory should work in Freya too.
First install some packages related to PulseAudio (a sound API used by elementary) by typing the following in a terminal:
sudo apt-get install pulseaudio-module-raop pulseaudio-module-zeroconf paprefs

Then start the PulseAudio preferences by typing paprefs and check the two options under Network Access. The window could look similar to this screenshot.
Reboot your system.
Click on the sound indicator and open the sound settings (example screenshot). With a bit of luck you can now select your AirPlay device from the list of available outputs.
Based on answer to "Is there a way to stream audio/video to an Apple Airplay Device?", created by StackExchange contributors.
Comment: Sorry about the AirPlay mistake an thanks you for your answer.
Answer: I tried the answer above, and it would not work with my newer Airport Express.
After a lot of reading, it seems that newer devices use UDP rather than TCP. PulseAudio 11+ supports this, however as eOS is based on Ubuntu LTS, there is no easy way to achieve this without compiling a newer PulseAudio yourself.
I managed to compile and install PulseAudio 11.1 and use this rather than the system installed one. Details here:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/PulseAudioFromGit/
The next problem is that Avahi and AirPort don't play well together. If you've enabled detection of AirPlay devices in paprefs, an incorrect IP beginning with 169.* is reported, and this causes playback to fail.
The solution is to disable auto detection in paprefs, and load the RAOP module manually in your ~/.config/pulse/default.pa file, and specify your Airport's IP address.
See julien-gargot's reply here near the bottom:
https://github.com/hfujita/pulseaudio-raop2/issues/21
I used encryption=none option.
Everything now works fine, and I've had no issues! Looking forward to the day when Ubuntu and eOS support this stuff out of the box.
Arch based distros and I presume Fedora will already come with latest PulseAudio 11.1 installed, so you only need to perform the final step of loading RAOP manually.
Regards,
John

Using Airplay with Noise


If it's possible to change solidity code once deployed in ethereum blockchain

Question: I deployed solidity code in ethereum blockchain. Now my client ask to add some function in the deployed solidity code and need update that code in same contract address but i do no if it's possible or not.If any one know please answer the above question.
Comment: No. You can change the code once deployed.
Comment: could you help me out
Comment: Sure. Contact me on skype : prashant23061 . Let's see if I can be of help
Answer: Once deployed, then the original code is final.
Further upgrading of a smart contract becomes difficult as it would require that you've taken upgradeability patterns into consideration during your early contract architecting stage (e.g. you could use proxy contracts, libraries, or registry contracts to separate certain concerns from each other to allow for upgradeability mechanisms).


Class imbalance and statistics

Question: I have a dataset with 5000 observations with class 0 and 300 observations with class 1. I would like to run some statistical analysis, for example on the average length of strings, the number of words, ...
I was calculating the average. Do you think it makes sense to calculate and compare these values with a similar difference In classes?
Answer: The answer to this question really depends on the insights you are after with these statistics.
Generally speaking however, it is wise to investigate per class in such a situation. Taking your examples this would entail comparing average string lengths for both classes. This will help you understand how both classes are (dis)similar given the dataset.

Class imbalance and statistics


Cannot edit CiviCase Activity Status from list view

Question: From the List view of CiviCase Activities of a case, I cannot edit the "Status" of an activity; the drop down flashes and then goes back to current status. To edit, I have to click "edit" and go into every single Activity one by one. Is this a bug or a set-up problem?
Comment: Could be a both ;-) What you could do is use chrome/firefox and press f12 this will open a developer tool which might show some errors. Those errors could probably give an indication fo what goes wrong.
Comment: This has now been fixed!
Comment: Note that you need to click on `tick` button in order to save your selection in the dropdown.
Answer: As a clue to lead to possible answer, I am seeing the same kind of issue when I try to edit an activity. Drop-down boxes (e.g., status) and search-for-match fields (e.g.,assignees) are hidden behind the activity screen and, even if the screen is minimized, do not allow editing when clicked. We are WordPress 4.97, CiviCRM 5.3.2. This is the first we've encountered this.


What is the "surface code" in the context of quantum error correction?

Question: I am studying Quantum Computing and Information, and have come across the term "surface code", but I can't find a brief explanation of what it is and how it works. Hopefully you guys can help me with this.
Comment: I don't know about brief, but https://arxiv.org/abs/1208.0928 is where I started learning about the surface code from.
Comment: Welcome! To clarify: should answers assume that you have already taken a wikipedia-level look into [toric codes](https://en.wikipedia.org/wiki/Toric_code) and [stabilizer codes](https://en.wikipedia.org/wiki/Stabilizer_code)?
Comment: I don't know about toric codes or stabilizer codes :| But I will read about it
Comment: Nice! Then that should be a great start I think. I suggest to perhaps take a quick look at those and put some more details into the question: things that you already think you understand and others that don't make so much sense yet. Once it's answered, this could be a very helpful Q&A for people that come after you: these are important concepts and the terminology is indeed a little confusing.
Comment: Related:  ["Quantum Error Correction: Surface code vs. color code"](https://physics.stackexchange.com/questions/169176/quantum-error-correction-surface-code-vs-color-code) from SE.Physics.
Answer: The surface codes are a family of quantum error correcting codes defined on a 2D lattice of qubits. Each code within this family has stabilizers that are defined equivalently in the bulk, but differ from one another in their boundary conditions.
The members of the surface code family are sometimes also described by more specific names: The toric code is a surface code with periodic boundary conditions, the planar code is one defined on a plane, etc. The term 'surface code' is sometimes also used interchangeably with 'planar code', since this is the most realistic example of the surface code family.
The surface codes are currently a large research area, so I'll just point you towards some good entry points (in addition to the Wikipedia article linked to above).

Topological quantum memory (paper)
Surface codes: Towards practical large-scale quantum computation (paper)
My blog series introducing surface codes

The surface codes can also be generalized to qudits. For more on that, see here.
Comment: The surface codes would work for any qubits. In some sense, with surface codes you are creating a topological quantum computer using non-topological qubits.
Comment: Does the surfaces codes works only for topological quantum computers?
Answer: The terminology of 'surface code' is a little bit variable. It might refer to a whole class of things, variants of the Toric code on different lattices, or it might refer to the Planar code, the specific variant on a square lattice with open boundary conditions.
The Toric Code
I'll summarise some of the basic properties of the Toric code. Imagine a square lattice with periodic boundary conditions, i.e. the top edge is joined to the bottom edge, and the left edge is joined to the right edge. If you try this with a sheet of paper, you'll find you get a doughnut shape, or torus. On this lattice, we place a qubit on each edge of a square.

Stabilizers
Next, we define a whole bunch of operators. For every square on the lattice (comprising 4 qubits in the middle of each edge), we write
$$
B_p=XXXX,
$$
acting a Pauli-$X$ rotation on each of the 4 qubits. The label $p$ refers to 'plaquette', and is just an index so we can later count over the whole set of plaquettes. On every vertex of the lattice (surrounded by 4 qubits), we define
$$
A_s=ZZZZ.
$$
$s$ refers to the star shape and again, will let us sum over all such terms.
We observe that all of these terms mutually commute. It's trivial for $[A_s,A_{s'}]=[B_p,B_{p'}]=0$ because Pauli operators commute with themselves and $\mathbb{I}$. More care is required with $[A_s,B_p]=0$, bot note that these two terms either have 0 or 2 sites in common, and pairs of different Pauli operators commute, $[XX,ZZ]=0$.
Codespace
Since all these operators commute, we can define a simultaneous eigenstate of them all, a state $|\psi\rangle$ such that
$$
\forall s:A_s|\psi\rangle=|\psi\rangle\qquad\forall p:B_p|\psi\rangle=|\psi\rangle.
$$
This defines the codespace of the code. We should determine how large it is.
For an $N\times N$ lattice, there are $N^2$ qubits, so the Hilbert space dimension is $2^{N^2}$. There are $N^2$ terms $A_s$ or $B_p$, which we collectively refer to as stabilizers. Each has eigenvalues $\pm 1$ (to see, just note that $A_s^2=B_p^2=\mathbb{I}$) in equal number, and when we combine them, each halves the dimension of the Hilbert space, i.e. we would think that this uniquely defines a state.
Now, however, observe that $\prod_sA_s=\prod_pB_p=\mathbb{I}$: each qubit is included in two stars and two plaquettes. This means that one of the $A_s$ and one of the $B_p$ is linearly dependent on all the others, and does not further reduce the size of the Hilbert space. In other words, the stabilizer relations define a Hilbert space of dimension 4; the code can encode two qubits.
Logical Operators
How do we encode a quantum state in the Toric code? We need to know the logical operators: $X_{1,L}$, $Z_{1,L}$, $X_{2,L}$ and $Z_{2,L}$. All four must commute with all the stabilizers, and be linearly independent from them, and must generate the algebra of two qubits. Commutation of operators on the two different logical qubits:
$$
[X_{1,L},X_{2,L}]=0\quad [X_{1,L},Z_{2,L}]=0 \quad [Z_{1,L},Z_{2,L}]=0\quad [Z_{1,L},X_{2,L}]=0
$$
and anti-commutation of the two on each qubit:
$$
\{X_{1,L},Z_{1,L}\}=0\qquad\{X_{2,L},Z_{2,L}\}=0
$$
There's a couple of different conventions for how to label the different operators. I'll go with my favourite (which is probably the less popular):

Take a horizontal line on the lattice. On every qubit, apply $Z$. This is $Z_{1,L}$. In fact, any horizontal line is just as good.

Take a vertical line on the lattice. On every qubit, apply $Z$. This is $X_{2,L}$ (the other convention would label it as $Z_{2,L}$)

Take a horizontal strip of qubits, each of which is in the middle of a vertical edge. On every qubit, apply $X$. This is $Z_{2,L}$.

Take a vertical strip of qubits, each of which is in the middle of a horizontal edge. On every qubit, apply $X$. This is $X_{1,L}$.

You'll see that the operators that are supposed to anti-commute meet at exactly one site, with an $X$ and a $Z$.
Ultimately, we define the logical basis states of the code by
$$
|\psi_{x,y}\rangle: Z_{1,L}|\psi_{x,y}\rangle=(-1)^x|\psi_{x,y}\rangle,\qquad Z_{2,L}|\psi_{x,y}\rangle=(-1)^y|\psi_{x,y}\rangle
$$
The distance of the code is $N$ because the shortest sequence of single-qubit operators that converts between two logical states constitutes $N$ Pauli operators on a loop around the torus.
Error Detection and Correction
Once you have a code, with some qubits stored in the codespace, you want to keep it there. To achieve this, we need error correction. Each round of error correction comprises measuring the value of every stabilizer. Each $A_s$ and $B_p$ gives an answer $\pm 1$. This is your error syndrome. It is then up to you, depending on what error model you think applies to your system, to determine where you think the errors have occurred, and try to fix them. There's a lot of work going on into fast decoders that can perform this classical computation as efficiently as possible.
One crucial feature of the Toric code is that you do not have to identify exactly where an error has occurred to perfectly correct it; the code is degenerate. The only relevant thing is that you get rid of the errors without implementing a logical gate. For example, the green line in the figure is one of the basic errors in the system, called an anyon pair. If the sequence of $X$ rotations depicted had been enacted, then the stabilizers on the two squares with the green blobs in would have given a $-1$ answer, while all others give $+1$. To correct this, we could apply $X$ along exactly the path where the errors happened, although our error syndrome certainly doesn't give us the path information. There are many other paths of $X$ errors that would give the same syndrome. We can implement any of these, and there are two options. Either, the overall sequence of $X$ rotations forms a trivial path, or one that loops around the torus in at least on direction. If it's a trivial path (i.e. one that forms a closed path that does not loop around the torus), then we have successfully corrected the error. This is at the heart of the topological nature of the code; many paths are equivalent, and it all comes down to whether or not these loops around the torus have been completed.
Error Correcting Threshold
While the distance of the code is $N$, it is not the case that every combination of $N$ errors causes a logical error. Indeed, the vast majority of $N$ errors can be corrected. It is only once the errors become of much higher density that error correction fails. There are interesting proofs that make connections to phase transitions or the random bond Ising model, that are very good at pinning down when that is. For example, if you take an error model where $X$ and $Z$ errors occur independently at random on each qubit with probability $p$, the threshold is about $p=0.11$, i.e. $11\%$. It also has a finite fault-tolerant threshold (where you allow for faulty measurements and corrections with some per-qubit error rate)
The Planar Code
Details are largerly identical to the Toric code, except that the boundary conditions of the lattice are open instead of periodic. This means that, at the edges, the stabilizers get defined slightly differently. In this case, there is only one logical qubit in the code instead of two.
Comment: You can assess the number of logical qubits for a stabilizer code as follows: the code subspace is defined by the projector onto the $+1$ eigenspace: $P=\Pi_n\frac{I+K_n}{2}$. The dimension of the space is rank($P$)=Tr($P$) (which is 2^number of qubits). For a product of stabilizers, if that product contains a Pauli matrix, it has trace 0, so the only non-zero terms are those which combine to give identity.
Comment: @user1936752 yes, exactly.
Comment: This is a very nice answer but could I ask why the surface code only encodes 2 logical qubits? I could not quite follow the argument you made to show that the stabilizer relations reduced the dimension of the Hilbert space to 4.
Comment: Thank you for replying. Sorry for the basic questions but can I check that in the projector above, the identity acts on all $n$ physical qubits? And is $K_n$ the stabilizer e.g. $XXXX$ on four qubits and $I$ on all remaining qubits?
Comment: The initial state is also needed here, please refer here in the end of section 3.1 : https://amslaurea.unibo.it/21591/1/Thesis_Online.pdf


Function point to kloc ratio as a software metric... the "Name That Tune" metric?

Question: What do you think of using a metric of function point to lines of code as a metric?
It makes me think of the old game show "Name That Tune".  "I can name that tune in three notes!"  I can write that functionality in 0.1 klocs!  Is this useful?
It would certainly seem to promote library usage, but is that what you want?
Answer: I think it's a terrible idea.  Just as bad as paying programmers by lines of code that they write.
In general, I prefer concise code over verbose code, but only as long as it still expresses the programmers' intention clearly.  Maximizing function points per kloc is going to encourage everyone to write their code as briefly as they possibly can, which goes beyond concise and into cryptic.  It will also encourage people to join adjacent lines of code into one line, even if said joining would not otherwise be desirable, just to reduce the number of lines of code.  The maximum allowed line length would also become an issue.
Answer: KLOC is tolerable if you strictly enforce code standards, kind of like using page requirements for a report: no putting five statements on a single line or removing most of the whitespace from your code.
I guess one way you could decide how effective it is for your environment is to look at several different applications and modules, get a rough estimate of the quality of the code, and compare that to the size of the code. If you can demonstrate that code quality is consistent within your organization, then KLOC isn't a bad metric.
In some ways, you'll face the same battle with any similar metric. If you count feature or function points, or simply features or modules, you'll still want to weight them in some fashion. Ultimately, you'll need some sort of subjective supplement to the objective data you'll collect.
Answer: "What do you think of using a metric of function point to lines of code as a metric?"
Don't get the question.  The above ratio is -- for a given language and team -- a simple statistical fact.  And it tends toward a mean value with a small standard deviation.
There are lots of degrees of freedom: how you count function points, what language you're using, how (collectively) clever the team is.  If you don't change those things, the value stays steady.
After a few projects together, you have a solid expectation that 1200 function points will be 12,000 lines of code in your preferred language/framework/team organization.
KSloc / FP is a bare statistical observation.  Clearly, there's something else about this that's bothering you.  Could you be more specific in your question?
Answer: All metrics suck. My theory has always been that if you have to have them, then use the easiest thing you can to gather them and be done with it and onto important things.
That generally means something along the lines of
<code>grep -c ";" *.h *.cpp | awk -F: '/:/ {x += $2} END {print x}'
</code>
If you are looking for a "metric" to track code efficency, don't. If you insist, again try something stupid but easy like source file size (see grep command above, w/o the awk pipe) or McCabe (with a counter program).
Answer: The metric of Function Points to Lines of Code is actually used to generate the language level charts (actually, it is Function Points to Statements) to give an approximate sense of how powerful a programming language is.  Here is an example: http://web.cecs.pdx.edu/~timm/dm/functionpoints.html
I wouldn't recommend using that ratio for anything else, except high level approximations like the language level chart.
Promoting library usage is a good thing, but the other thing to keep in mind is you will lose in the ratio when you are building the libraries, and will only pay it off with dividends of savings over time.  Bean-counters won't understand that.
I personally would like to see a Function point to ABC metric ratio -- as I am curious about how the ABC metric (which indicates size and includes complexity as part of the info) would relate - perhaps linear, perhaps exponential, etc...  www.softwarerenovation.com/ABCMetric.pdf


Renting at a Loss While Banking on Capital Gains

Question: I live in an area that is rapidly growing. My current house (based on comps) has appreciated $50k in two years to give an example. I currently have an opportunity to buy another for a reasonable price in the same area. I have the cash on hand and the income to do it as well. I'm debating renting the original. Here's the issue: the average rent in my area is the same as my mortgage (which is fixed rate). So, with all things considered, renting would mean a loss. My question is this: given how rapidly the area is growing, does it make sense (or could it) to eat the loss for a while counting on 1) rent eventually increasing 2) the gains in the value of the house?
Comment: There's nothing nonsensical about it, I'm stating the current state of affairs. My monthly payment is $X per month, average rent is $Y per month. Currently, Y is less than X. Given that, I'm asking if renting could still make sense.
Comment: Negative cash flow doesn't mean unprofitable.  The problem underlying the question is potential for negative cash flow, which is fair to be worried about.  Liquidity crunches are real.   But, you may or may not have a "loss" in the tax and accounting meaning.  The principal part of mortgage payments will show up nowhere on Schedule E.  Try filling out a Schedule E for your expected year to see if you are likely to have a loss or gain.  https://www.irs.gov/forms-pubs/about-schedule-e-form-1040
Comment: "Here's the issue: the average rent in my area is the same as my mortgage (which is fixed rate). So, with all things considered, renting would mean a loss." - This is a nonsensical statement. Your mortgage payment is a function of your agreement with the bank, it doesn't need to correlate with rent. Would you pay double the rent on the same house to a person who got a 15 year mortgage instead of a 30 year? No, that makes no sense.
Comment: @Pat The nonsensical part is the statement "renting would mean a loss".
Answer: You are betting on the value of the property increasing.
Tax issues regarding rental property have a few subtleties.

the average rent in my area is the same as my mortgage (which is fixed rate).

Don't forget property taxes and any HOA or condo fees. Some people forget that. For the typical homeowner these don't have any tax issues, but for a rental property these expenses are used to reduce taxes on the income. These expenses can also go up over the years. Some jurisdictions give a tax break to owner occupied properties, which the rental property would not qualify for.
The principal portion of the monthly payment doesn't reduce tax on the rental income.
This can mean that the rental property owner can lose money each month via cash flow, but still owe taxes because a portion of the monthly mortgage payment.
Good news, you have to depreciate the property.
That will help reduce your taxes. Of course when you sell the property that depreciation will be recaptured.
If you buy the new property, and turn it immediately into a rental property, then determining the expenses preparing it to rent, and determining the base value for depreciation is more straight forward. The downside is that the lender will require 20% down, and might charge a higher rate.
If you rent the original house handling the transition is more complex. You probably don't need a new loan, but if in the future you do want to refinance the lender will treat the loan differently.
Don't forget that you will have expenses with each new tenant, plus you could have a month or two without a tenant. Never forget repairs and maintenance.

The question is how long can you hang on with loss each month to make it worthwhile? Remember future increases in value are not guaranteed.  People in my neighborhood took 10 years to get back to the peak after the 2006-2010 drop in prices.
Comment: So I should have worded that better. The average rent is the same as my monthly payment, that's including mortgage, taxes, etc. My plan with the new property is to make it a permanent residence for at least two years. It wouldn't immediately become a rental as well. Other points well taken, thanks for the anwswer!
Comment: @Pat Make sure you read the last paragraph here a few times. Do not underestimate the chance that the market goes down, and not up.
Comment: @Grade'Eh'Bacon Yup point well taken. I've been looking at the housing index for my area to see how it reacted to the last crash and how long the recovery took.
Comment: @Pat Even the last crash may not look the same as the next one, if there is one...
Answer: You say that since rent would be the same as your mortgage, you'd be operating at a loss, but that mortgage money doesn't disappear. Instead, you'd be trading ready cash for added principal on your mortgage. Is that worth it? Maybe. If you calculate that you'll lose $200/month in order to make a $1500/month mortgage payment, that's a reasonable tradeoff, and a different calculation than the one you seem to be making.
Comment: Interesting. I've seen that interpretation in some other places too. That's also a good point that that money isn't "gone" per se since it's being paid into principle.


Remove multiple bindings in IIS 7

Question: I'm hosting about 100 sites in IIS. I'm moving to a new ip range. While I've added the new ip addresses manually ( it took some time) I would like to avoid removing the old ip's manually. I have already removed the old ip's from the network. Is there a powershell command that would allow me to remove bindings for all sites containing a specific ip address?
Answer: You have a list of IP addresses and you would like to remove each one from bindings in IIS?
If so, put the list of IP address(one per line) in a text file, ie. IPs.txt, open powershell, cd to the directory where IPs.txt sits and run the following:
Import-Module WebAdministration
cat .\IPs.txt | % { Get-WebBinding -IPAddress $_ | Remove-WebBinding -Confirm:$true}

You will have to confirm each delete but this is most likely preferable to deleting an incorrect binding, ie. if you have an empty line line in the file it will return ALL bindings..
Answer: I would look at using the Web Server (IIS) Administration Cmdlets in Windows PowerShell
There's some awesome functionality available for doing what you're after.
Example:
Get-WebBinding -IPAddress "192.168.*" | Remove-WebBinding -WhatIf

This example selects all web bindings on the local machine that matches the ip address (including wildcard) then pipes the results to the Remove-WebBinding cmdlet. Obviously you'd need to set the criteria up for your own scenario. Remove the -WhatIf switch only when you're sure you've selected the bindings you're interested in and are ready to do it (!)
You may have been able to have used the Set-WebBinding command that also exists in this module to just update the original ones.
Hope that helped.

Remove multiple bindings in IIS 7