At what altitude do winds exert the most force?

Question: Imagine I want to make a floating wind turbine like the Altaeros BAT, which is tethered and uses helium. What would be the best height to keep such a device deployed? I know that wind velocity decreases near the ground due to friction with the Earth's surface. Though, the density of air decreases with height, so the force of high winds aloft are lessened.  Considering these issues, at what altitudes do the winds exert the most force for a tethered wind turbine to produce the most energy?  Please disregard the energy required to keep the turbine afloat.
Answer: ".....the density of air decreases with height, so the force of high winds aloft are lessened." I can personally vouch for the difference between a 60mph wind at sea level, and one at 14,000 feet! However, however, the single biggest difference between the two altitudes isn't so much the force of that wind, but the consistency of that wind speed, which seems to matter most to wind generation.
Here's how a wind turbine engineer would think of this problem:
From The Engineer's Toolbox- Power generated from the wind
Theoretically power in moving air - or wind - can be calculated
P = 1/2 ρ A v^3
  =  1/8 ρ π d^2 v^3
where
P = power (W)
ρ = density of air (kg/m3)
A = wind mill area perpendicular to the wind (m2)
v = wind velocity (m/s)
π = 3.14....
d = wind mill diameter (m)
Comment: -1 This does not answer the question.
Comment: I have provided a qualification to the OP's question. A link to extensive definition of the OP's question. The equation that solves the OP's question. And the defined variables in the OP's question. The OP now has everything to generate an algorithm that plots power vs. altitude for any point on earth....


What are the pros and cons of HLSL vs GLSL vs cg?

Question: What are the pros / cons of the three?
Comment: Correction: "closed as not constructive" should say "closed as violating dimwit policy", because this IS constructive.
Comment: It seems like you first would need to decide on what API you were going for (OGL or DX) and what platforms before you decide what shader language.
Comment: I think this question is brilliant. How about a community wiki? I am new to all this and a question of the differences to shaders is exactly what I need to know.
Comment: This is no longer accepting answers, sadly, so I'll have to leave a comment: you can choose either GLSL or HLSL if you're using Vulkan, both can be compiled to SPIR-V.
Answer: coderanger is right about HLSL targeting DirectX, GLSL targeting OpenGL and CG being available with both interfaces.
However there are other things to consider (learned on the OGRE forum) :

CG will not allow you to use the latest features of GLSL (I'm not sure about HLSL). It's a middle ground so you'll not be able to fully exploit the GLSL features, only the common one until Shader Model 3.0 (AFAI understood).
CG is made by NVidia that optimize it for it's card but don't seem to do lot of work for ATI cards... some people report that there might be problems with ATI cards using CG.
OpenGL seem to be a bit slower than DirectX on Windows platforms. That's really relative to what you're doing and the reason for this find it's source in the drivers implementations but it's good to know before you choose the API and the associated shader language. However, OpenGL is the only one interface available on all (win/mac/unix/some consoles) platforms. So knowing that, using exclusively GLSL might be the better choice for a non-Microsft-centric-cross-platform game.
NVidia drivers on Linux seem to be more stable than ATI drivers, making CG more interesting if you need to be sure it works nicely on linux (that's all reported informations, you'll have to check for details)

So, if you're not using the lastest shader features, CG seem a good choice. GLSL seem a beter one if you're going full OpenGL. HLSL if you're going exclusively on Microsoft platforms.
Now first developping in HLSL for windows to use DirectX and then convert to GLSL for linux and mac could be the better solution to be sure of performance and have the larger set of shader features available. It might however be a lot of work (didn't do it myself so I cannot tell). OGRE graphics engine (and other engines) allow to use any API (DirectX or OpenGL or others) so it helps, but there is still shader code to convert if you go this way.
That's all the information I gathered while choosing my shader language (I've not made my decision yet).

Update: Valve did a conversion of one of their game to OpenGL and found no way to make the DirectX version faster than the OGL one. So keep in mind that the state of driver implementation, API quality, etc., all that change too much each year for you to totally rely on raw performance as an argument to choose one or the other. With this in mind, choose OpenGL/GLSL to simplify your life when working (or having plans or hopes to work) with other platforms than Windows, use DirectX/HLSL if you really want to use only Microsoft platforms and focus and maybe have some good API faster than OpenGL (this is reversing now, so don't count on it); use CG if you want to provide both possibilities to the user, but if you have the work force (and tools) to do it, using both GLSL and HLSL might be a viable solution too.

Update (2012): It is important to note that CG has been discontinued, and is no longer supported or actively worked on by Nvidia. Nvidia recommends that all users switch to a combination of GLSL and HLSL, or a newer library such as nvFX (on github). This is because it was too difficult to maintain feature-compatibility between GLSL and HLSL.
Comment: "OpenGL seem to be a bit slower than DirectX on Windows platforms." In most cases it's usually due to vendor support for drivers with OpenGL is not as good on Windows as it is with DirectX.
Comment: __Yes__.  NVIDIA doesn't seem to care about problems with ATI cards.
Comment: @Community: Do you have any links for the discontinuing of support for Cg?
Comment: Note: I chose OpenGL/GLSL in the end because of recent improvements and the need to make sure my game works on some non-MS tablets.
Comment: https://developer.nvidia.com/cg-toolkit
Comment: Ah yes, I know about that but I should have added it.
Comment: @NicolBolas That part was added but I'm not the author. I couldn't find any link at the time but there is apparently an effective lack of update of CG so I guess it was true. Also it looks like APIs will change again soon, so...
Answer: I can only talk about CG vs HLSL because those are the 2 I have used so far.
Cg is not the same as HLSL.
In Cg, NVIDIA did an excellent job in creating a very clean shader syntax.  Its very similar to HLSL.
But, tie-together with D3D9/D3D11 (init code, shader compilation code) is much cleaner on HLSL than Cg.  -1 Cg.  Cg has a nasty bit of start up code that you don't even need to have for HLSL over D3D.
In Cg, you have to "cgGetNamedParameter" for every uniform shader variable you want to set/modify. And you have to maintain a CGparameter reference in your code for that variable
// C++ code to interact with Cg shader variable (shader language independent)
CGparameter mvp = cgGetNamedParameter( vs, "modelViewProj" );
CG::getLastError("Getting modelViewProj parameter");  // check for errors
cgSetMatrixParameterdr( mvp, &modelViewProj._11 ) ;   // setting the matrix values

In HLSL, this ends up being much cleaner - just one line, and you don't have to maintain that CGparameter variable.
// D3D9 C++ code to interact with HLSL shader variable
DX_CHECK( id3dxEffect->SetMatrix("modelViewProj", &mvp._11 ), "Set matrix" ) ;

In the above, DX_CHECK is just a simple function that checks the HRESULT that gets returned from the SetMatrix call.  The above code is d3d9.  D3D10 and 11, are of course, a lot more painful (since there isn't an ID3DX11Effect object).
Before I started using HLSL, I used to look at this code and actually get jealous.
Although NVIDIA did their best to make a common interface for Cg between OpenGL/D3D, practically speaking its not that way, and you have cgGL*, cgD3D9, cgD3D10, cgD3D11 function groups to contend with.  So that whole works for OpenGL and D3D!! claim only goes so far.  You still have to wrap everything up into OpenGL/D3D #ifdef type groups to make it work on different platforms.  -2 Cg.
Further I have recently had a bad experience with Cg/ATI cards, which I'm pretty sure isn't my bad. (Someone else try it out?).  I think it may be true that NVIDIA doesn't completely test ATI cards, as Klaim claims.  Or that ATI doesn't test on Cg.  One way or the other, there's a mismatch there and some sort of conflict of interests.  -3 Cg.
All in all I preferred Cg.  Its shader code syntax and naming is clean, sweet, and tidy.  Its too bad its got these other problems.
Answer: My very basic understanding is that HLSL is only for DirectX and GLSL is only for OpenGL. Cg is basically the same language as HLSL, but can be used with either DirectX or OpenGL (though via different runtime code).
Comment: -1.  This is an extremely rudimentary answer and one would hope to find more extensive information on this site.
Comment: -1: I agree with bobobobo.
Comment: Unfortunately I have to -1 for the same reasons as bobobobo.
Comment: +1 That's my understanding as well, personally I like using cg whenever I can, but it does add an extra dependency beyond the render system itself; and I seem to recall having some strange issues with OpenGL, cg and ATI drivers with some more complex effects...
Comment: I'm using Ogre and thus have all three available to me, but if I want to have both DirectX and OpenGL I have to either write the shaders in both HLSL and GLSL or just cg? Is that right?
Comment: Yes, Cg compiles down to both systems. Testing on both can get very time consuming though, so this might not be the best thing to spend resources on.
Comment: My understanding is that HLSL and GLSL are very closely related in the first place.
Answer: Another crucial difference between HLSL and GLSL (I don't know CG so I can't speak for it) is that with HLSL Microsoft provide the shader compiler as part of the D3D runtime whereas with GLSL your hardware vendor provides it as part of their driver.
This has advantages and disadvantages on both sides.
With the GLSL method the vendor can tune the compiler to the capabilities of their hardware.  They know their own hardware best, they know what to do and what not to do.  On the other hand the disadvantage is that - in a world where there are multiple hardware vendors - you have a situationwhere there can be inconsistencies between shader compilers, and the vendor also has complete free reign to screw up.
With the HLSL method Microsoft control the compiler.  Everyone is on a consistent tech base, and if a shader compiles successfully in one place then it can be reasonably supposed to compile everywhere.  The same shader will produce the same compiled output irrespective of vendor (all other things being equal of course).  On the other hand the HLSL compiler has to be a "works consistently on everything" thing, so it's not able to pull any special vendor-specific tricks to get the last few drops of juice out of the tank.
If this comes across as though I have a preference for the HLSL view of the world it's because I do.  I've been bitten badly before by wildly inconsistent behaviour on different platforms, and in one case even ended up having to roll a load of GLSL back to ARB ASM just to get a baseline that worked.  NVIDIA's GLSL compiler can be viewed as particularly notorious here - it will even accept HLSL syntax and keywords, meaning that if you're not careful you can end up producing shaders that will only work on NVIDIA and nothing else.  It is a jungle out there.
Comment: To be fair, NVIDIA's GLSL compiler has gotten rather more strict about what it does and does not accept since those days. But even today, there are what I call "NVIDIA traps" that make it easy to do something that you think should work, but don't according to the actual spec and AMD drivers.
Comment: I'd even go so far as to say that developing on ATI/AMD, or at the very least cross-checking with ATI/AMD on a regular basis, is still an absolute must.  You get two kills for the price of one there as you'll also catch bugs in their OpenGL driver too.
Comment: When targeting Vulkan, or OpenGL implementations supporting SPIR-V, GLSL shaders can be pre-compiled to SPIR-V.
Comment: @Andrea - yes, that's correct; obviously neither Vulkan nor SPIR-V existed at the time the question was asked (and the asnwer was written).
Answer: You might want to look into the RTSS (Run Time Shader System) that comes with Ogre as well. It is fairly new, but you basically write shaders in code rather than external files. I have not implemented it yet, but definitely plan to use this when the time comes.
Here is a huge series of tutorials on the Ogre wiki as well for writing shaders.
http://www.ogre3d.org/tikiwiki/JaJDoo+Shader+Guide
As for your original question, like Praetor said, its not really a matter of pros/cons, it is a matter of what rendering system you want are going to use. Since using DX/OpenGL with Ogre is just a matter of loading the plugin, you will most likely want to use .cg format.
Answer: I have been using both, I started with glsl and moved to hlsl only because the project demands it. Given the choice, it's glsl all the way. glsl feels very slick and hlsl feels like it came out off an engineer's hobby bench.


Professional organisation

Question: Hi I'm a student about to graduate with an interest of going in to sound design. Was just wondering if anyone was a member or recommend becoming a member of any professional organisation (such as the AES)?
Thanks
Answer: If you're interested in game audio sound design, GANG (the Game Audio Network Guild) at http://www.audiogang.org/ is a good place to start. They're quite supportive of students and rookies.
AB

Professional organisation


Replacing an on and off switch with a mechanical timer

Question: I have an outdoor light that is run by a regular wall switch.  I want to change this to a mechanical timer switch.  The mechanical timer switch has two ports for wires.  When I opened the wall switch I found three black wires: one in each of the push in ports and one under a side screw.  How do I wire in the mechanical switch that has two ports when I have three black wires attached to the old regular wall switch?
Comment: yes, can you post a photo of the inside of the box please, and is this one of the timers that fits inside a wallbox, or does it provide a box of its own?
Comment: In order to help you it would be good to have some pix of the opened box and the timer you're attempting to install.
Answer: Sometimes receptacles and switches are used to join two wires together out of convenience.  What you have is a regular switch with two terminals, but the electrician has used a push terminal and a screw terminal to join two hot (black) wires.  The push terminal and screw terminal next to it are the same electrical connection.
Lets say the top of the switch has a black wire on the screw and one in the push terminal and the bottom of the switch just has one wire in the push terminal...  To hook up the new switch, you're going to pigtail the top two wires to one terminal on the timer.  That means connecting the two black wires and a new short length of black wire with a wire nut and then connecting that short wire to the switch.  The wire currently going to the bottom of your switch will just get connected to the other terminal on the timer.
Answer: OK, you've got a hot,black, wire coming from a breaker into the switch. From there another black wire is connected to almost the same location of the switch, probably using a backstab, making that wire hot to go to another location. Those two wires should be wire nutted together with a 6" piece of appropriately sized wire and connected to the line side of the switch. The black wire at the opposite end of the switch is the load wire going to the outdoor light and should be connected to the load side of the switch. If line and load terminals are not indicated, then either terminal can be used for your feed or light wire.
As always, remember to turn off the power when doing any of this work and if you have a voltage tester or meter, verify the hot wires.


Heat Loss through a run of insulated piping

Question: I've been racking my head around calculating the amount of heat loss still water will experience through a run of insulated piping. The water in the tank is maintained at roughly 550°F saturated, and a standpipe measures the water level some distance away. However, most of the example problems and literature I can find assume some movement of water through the piping, and here, we know the water will be still. I'm assuming this needs to be setup in a way that we can equate the Qin to be equal to Qout, with Qout being losses due to radiation and convection, and we should be able to find the temperature at the end of the pipe if we know all of the other parammeters, but I'm not sure how to setup my Qin. Any ideas? Thank you in advance.
Comment: I don't think there is any somple way to do this; it's well beyond undergrad heat transfer.  I think what you will find is that steam will condense in the leg and create a cold convection loop down and back to the tank.  You will need actual measurements to get it right.   I would start at zero flow, and once you have an idea of the flux rate figure out what that would do in terms of steam condensation and use that for flow rate.
Answer: Have a look at heatsink calculations used in power electronics. The thermal loss calculation is quite analogous to an electrical circuit. This will all be much simpler in SI units rather than your quaint °F but I've left the numbers there for now.

Voltage ⇆ Temperature above ambient (°C or K)
Current ⇆ Heat flow (W)
Resistance ⇆ Thermal resistance (°C/W or KW-1)
Ground ⇆ Ambient temperature (°C or K)

Figure 1. A thermal model built using CircuitLab1.
With the values I've chosen the simulator shows that the junction of pipe X and Y should be at 358°F and a heat throughput of almost 6 W.
I suggest that you make up a resistor model as complicated as you require, measure the temperatures at each junction and calculate the heatloss on some section that you know the ratings for and play with the resistor numbers until the model agrees with your readings. Ultimately you're interested in the current through Rx.
1 CircuitLab is not free but if you head over to SE's Electrical Engineering you can play with it for free. There's a button on the question editor toolbar.


What electronic items can I bring into the airplane cabin?

Question: I want to know what items are allowed into the airplane. I know that, for example, laptops and tablets are allowed. However, what about power bank/batteries or external hard drives?
My question is about the electronic devices I can bring into the airplane.
Comment: Agreed that this is too broad. Also, every airline I've ever flown with has had clear guidance on its website.
Comment: This shows a lack of research. A simple google search would have given plenty of information.
Answer: All electronic items are allowed except those that are prohibited by the airline; or the country's security rules. These include:

Large batteries (see Can you put an ordinary Mac laptop (with the battery) in checked luggage? for some details on the capacities).
Anything that can be used as a weapon.
Electronic items that do not turn on (cell phones, laptops, tablets, e-readers, etc.) or are malfunctioning may not be allowed, depending on the airline and your itinerary.
Anything that cannot fit in the carry-on size and weight requirements.
Anything else specifically prohibited. For example, for the UK here is a list of electronic items allowed; and the TSA (for the US), has this to say:

Please carefully pack your electronics items, making sure all cords
  are wrapped and any DVDs, CDs, or cassettes are removed from their
  devices. While you can pack expensive, fragile electronics items in
  checked or carry-on bags, we recommend packing them in your carry-on.
  Laptop computers, full-size video game consoles, CPAP machines,
  full-size DVD players, and video cameras that use video cassettes must
  be removed from their carrying cases and submitted separately for
  x-ray screening. Small and portable electronic items (smart phones,
  tablets, portable games, etc.) do not need to be removed from their
  carrying cases or carry on bags.
For items you wish to carry-on, you should check with the airline to
  ensure that the item will fit in the overhead bin or underneath the
  seat of the airplane.
Even if an item is generally permitted, it may be subject to
  additional screening or not allowed through the checkpoint if it
  triggers an alarm during the screening process, appears to have been
  tampered with, or poses other security concerns. The final decision
  rests with TSA on whether to allow any items on the plane.
Answer: You are generally allowed to carry power banks and external hard drives with you as carry-on baggage. I had some AA batteries confiscated when I tried to take them with me at Frankfurt. They were for my camera but the officials did not agree. As for other electronic goods, please be more specific so we can let you know from our experiences. Also, this varies with respect to airports and countries as well.


How does Cheat O'Matic work?

Question: How does this program access other processes memory? How can it write into the address space of another process? Wasn't it supposed to segfault or something?
Comment: I can't get this to work, all search results return empty...
Comment: It doesn't work on some programs for some unknown reason. Try with the Windows calculator...
Answer: A program with a system privilege level is capable of mapping physical addresses to its own virtual address.
Cheat O'Matic (and poke) maps the physical address of whatever program it is trying to scan into its own virtual space.
Once this is done, it scans all the bytes for the target value you enter.  It isolates the correct memory address by asking the user to altering the address to known values and basically does a diff between the old and new memory to find the changes.
Comment: On windows the functions VirtualAllocEx and VirtualQueryEx allow you to read and write in the memory of another process.
Answer: One way to do it is to inject a DLL (Google for 'Dll injection') into the address process that you want to spy on: that DLL is then inside the process and can do things with the process' memory. The spy process can use an Interprocess Communication method (pipes, sockets, anything) to talk with the DLL which it injected into the other process.
Injecting a DLL takes administrator priviledge (e.g. to set a relevent entry in the system registry).

How does Cheat O'Matic work?


Did Jesus really go to "hell"?

Question: There are several sayings that "Jesus went to 'hell' after His death to save the then present people in hell". I do find it hard to believe this. A few questions then conjure themselves to mind that "if Jesus really went to hell, did He feel the 'torments' and 'searing heat' that people there feel?... Why did He 'save' those there at the time?...and who where they (hell inhabitants)? I want the FULL light of this truth; any insightful answer is very appreciated.
Comment: Related question, for this idea:  [What is the Biblical basis for the concept that Jesus spent time in Hell?](http://christianity.stackexchange.com/q/488/21576)
Comment: Welcome. Unfortunately, this question isn't a good fit for this site: we don't attempt to discover the truth, *per se*, but rather our goal is to objectively describe and learn what specific groups of Christians believe. If you'd like to narrow the question by asking for the biblical basis for a particular view, or for the view of a particular denomination, this question may be answerable.  When you get a chance, I hope you'll take a minute to take the [tour] and learn [how this site is different from others](http://meta.christianity.stackexchange.com/a/1809/21576).
Comment: Related question, against this idea: [What is the biblical basis against the idea that Jesus descended into hell?](http://christianity.stackexchange.com/q/41999/21576)
Comment: Two more that are similar to this one and likely to be closed: [Harrowing of Hell](http://christianity.stackexchange.com/q/13993/21576) and [Understanding the idea that Jesus descended into Hell](http://christianity.stackexchange.com/q/26238/21576)
Comment: Different denominations have different opinions about whether his descent to preach in hell was literal. The Church of Jesus Christ of Latter-day Saints teaches that he organized missionaries who went, among whom were the patriarchs and prophets from the Old Testament period, instead of going himself. See D&C 138, starting in verse 28. https://www.lds.org/scriptures/dc-testament/dc/138?lang=eng
Answer: The Apostle's Creed (believed by Catholics, Orthodox, and orthodox Protestants) states:

I believe in Jesus Christ, his only Son, our Lord,
        who was conceived by the Holy Spirit
        and born of the virgin Mary.
        He suffered under Pontius Pilate,
        was crucified, died, and was buried;
        he descended to hell.
        The third day he rose again from the dead.
        He ascended to heaven
        and is seated at the right hand of God the Father almighty.
        From there he will come to judge the living and the dead.

1 Peter 3 says:

17 For it is better, if it is God's will, to suffer for doing good
  than for doing evil. 18 For Christ also suffered once for sins, the
  righteous for the unrighteous, to bring you to God. He was put to
  death in the body but made alive in the Spirit. 19 After being made
  alive, he went and made proclamation to the imprisoned spirits— 20 to
  those who were disobedient long ago when God waited patiently in the
  days of Noah while the ark was being built. In it only a few people,
  eight in all, were saved through water, 21 and this water symbolizes
  baptism that now saves you also—not the removal of dirt from the body
  but the pledge of a clear conscience toward God.

From this second passage, it seems that Jesus visited the prisoners (presumably in Hell) AFTER he was made alive. Some believe that Jesus experienced the torments of Hell, but since Jesus had already been "made alive", his suffering was over, so it is likely that his visit to Hell did not cause him torment. All the torment he experienced was on the Cross.
A translation of a 1583 Catholic catechism states (as see here: http://biblelight.net/prison.htm):

The Fifth Article
Q. What is the fifth article? A. He descended into hell, the third day
  he arose again from the dead.
Q. What means, he descended into Hell? A. It means, that as soon as
  Christ was dead, he descended into Limbo, to free the holy fathers who
  were there.
Q. How prove you that? A. Out of Acts ii. 24, 27. 'Christ being slain,
  God raised him up loosing the sorrows of hell, as it was foretold by
  the prophet,' Psalm xv. 10. 'Thou wilt not leave my soul in hell, nor
  wilt thou give thy Holy One to see corruption.'
Q. What other proof have you? A. Ephes. iv. 8, 9. 'He ascending on
  high, hath led captivity captive; he gave gifts to men; and that he
  ascended,' what is it but because he descended into the lower parts of
  the earth?
Q. Did he not descend to purgatory to free such as were there? A. It
  is most probable he did according to 1 Pet. iii. 19, 20. 'Christ being
  dead, came in spirit; and preached to them also that were in prison,
  who had been incredulous in the days of Noah, when the ark was
  building.'

While I do not subscribe to a belief in limbo, one common understanding is that prior to Jesus' death on the cross, no one could enter Heaven, because none were forgiven for their sins yet. Thus all people were in the place of the dead, separated into two categories, those who would enter Heaven after Christ paid the price, and those who would be sent to Hell for final judgment. Some call this place of waiting where the faithful people were kept "Abraham's bosom", recalling the story of the rich man and Lazarus in Luke 16:19-31 (https://www.biblegateway.com/passage/?search=Luke+16:19-31).
However, since Scripture is very short on details concerning this question, one should consider the matter carefully before coming to a conclusion as many fanciful embellishments have popped up over the years which lack any basis.
For one perspective on this issue, see http://www.desiringgod.org/articles/he-descended-into-hell
Comment: Orthodox Protestants are those who accept the seven ecumenical councils and the creeds that they produced, including the Apostle's Creed and the Nicene Creed.
Comment: My point is only that this is a very controversial passage, and that though you make a good attempt at treating it at a high-level, there are still significant gaps.  The problem is not with your answer so much as with the question; it's a Truth question that should be closed and (ideally) left unanswered.
Comment: I'm not sure who "orthodox Protestants" are, but there are many Protestants who accept the Apostles Creed and reject your analysis of it.
Comment: @Nathaniel, I welcome new perspectives on this matter. I am a Baptist and have faithfully related what I have learned, also I have quoted from a Catholic source to introduce their views. On what point do you have a different notion? The factuality of the descent into hell? Whether Christ's suffering ended on the cross or continued during his visit to Hell? The possibility that the faithful did not enter heaven prior to the resurrection? Or some other point?
Comment: Sigh. You and Pontius Pilate must be best buds. ;)
Comment: That's a pretty insulting statement to make without an explanation.  I have no problem with telling you what I think is the truth, but that's not the purpose of this site.
Comment: I meant no insult. Pilate is famous for saying, "What is truth?" when responding to Jesus.

Did Jesus really go to "hell"?


Does it cost gas to access data stored on the IPFS with a smart contract?

Question: I want to store about 4MB of data on the IPFS.

I then want to create a smart contract that can access the data or a subset of the data on the IPFS.

I know that data already stored on the Ethereum blockchain casts no gas to access.

But what if my data is stored immutably on the IPFS and then accessed via a smart contract call; will it cost any gas?

If so, how much gas will it cost (a ratio like USD/MB-Retrieved would be nice).
Comment: Reading data anywhere does not cost gas. Smart contracts also allow public variable to be read without gas costs.
Comment: Reading data costs no gas for an off-chain client. But when you want to do it in a smart contract, it will cost gas, too.
Answer: You cannot directly access IPFS data from a smartcontract. If you store file hash, it will cost you gas as this opcode list states https://docs.google.com/spreadsheets/d/1m89CVujrQe5LAFJ8-YAUCcNK950dUzMQPMJBxRtGCqs/edit#gid=0
But you can access IPFS source from a smart contract via oraclize provider, and yet it will charge you for each such transaction.
Answer: There is no cost associated to access data stored on the IPFS with a smart contract. However, you will have to pay if you want to store data on contract in the first place. Lets see how we are going to access our data:

Store the data on IPFS. Get the hash/identifier of the file we stored.
Store that hash/identifier in smart contract. This will cost gas.
Get data from smart contract. This will not cost any gas.
Use this hash in a call to IPFS api to get the data of file.

Note: You cannot directly access any file on IPFS.
Comment: First you say "I do not think that there would be any cost associated" and then you give instructions which cost gas. Hmm?
Comment: Yes, for answering OP's question, there is no gas cost at reading step.
Comment: I have updated the answer to lay emphasis on "no cost to access data of smart contract"
Answer: IPFS is not a miracle worker. It is simply an external provider which is 'convenient' to use with Ethereum smart contracts.
This means you have to integrate the actual logic in an old-fashioned backend system. Ethereum blockchain (smart contract) can contain hashes for the IPFS files, so the contract will basically just have pointers to the files but no direct access to the files.
There is no USD/MB-Retrieved ratio as you can store whatever size files in IPFS and the hash will be always the same size. The only difference is the IPFS usage costs, but that has nothing to do with Ethereum per se.
The gas cost for using IPFS is the cost of storing the hash and whatever else your contract needs.


Why isn't ice a good electrical conductor?

Question: Water can conduct electricity, and some solids can conduct. Why can't ice? Are ice molecules too packed together to let valence shell electrons bounce across each other to create electrical charge? Does ice stop conducting completely at absolute zero?
Comment: Ice can conduct electricity, but not very well.  Electricity is conducted by free ions in water.  The ions come from dissolved salt and from electrons released by disintegrated water molecules.  Unless the valence electrons are freed from the water molecules, they don't play a part.  In ice, the ions don't travel easily, as they are locked into crystals.  Here is a succinct explanation: https://van.physics.illinois.edu/qa/listing.php?id=16435
Comment: @ernie: that comment probably could be turned into a good answer ;)
Comment: Welcome to Physics.SE! Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. See the [How to Ask](http://physics.stackexchange.com/help/how-to-ask) page for help clarifying this question. Thanks!
Comment: Valence electrons (as usually defined) are not the carrier of electric current (as valence bounds are paired electrons and thus correspond to filled bands, which do not conduct).
Answer: Conduction in water is mostly ionic - for pure water you have a very small fraction of ionized molecules (about 2 parts in 10$^{-7}$), so conductivity for pure water is poor. Add a little electrolyte (for example NaCl) and conduction improves. But in an ice crystal, the molecules / ions cannot move, so the main conduction mechanism is disabled. In that case you rely on occasional conduction band electrons - but there aren't many of those around. The band gap is about 7.8 eV source which means that the number of electrons excited into the conduction band at 0C will be extremely low - the fraction given by the Boltzmann factor $e^{-E/kT}=e^{-322}$
Contamination and impurities can bring the band gap down significantly - but pure ice is a good insulator.
Comment: One other comment, @Floris.  If you slowly freeze salt water, the ice is composed of fresh water.  This means that even in the presence of electrolytes, the ice's electrolyte concentration will be somewhat lower (sometimes MUCH lower) than the solution that it came from.
Comment: @DavidWhite good point


The use of Chaos weapons against Chaos

Question: I have read in a comment that quote " There are some chapters that even use Chaos forged weapons against Chaos ", the comment is from this question
. Wouldn't the chapters using such weapons be considered heretics for using unclean weapons and machinery(war-machines are weapons, right?). Is this true(the usage of heretical weapons)? And if so, which are those chapters?
Answer: Some are, some aren't depends how open they are about it and what they do with said weapons/vehicles
Relictors (Fire Claws)
When fighting a Champion of Tzeentch, Librarian Decario used its own daemon weapon against it to easily destroy it, this was after power weapons and terminators proved useless against the Champion. After this they believed that daemon weapons could be used to fight chaos and went around collecting all daemon artifacts they could find.
Eventually they were found out by the Imperium and group of Inquisitors and other Chapter Masters forced them to hand over all the artifacts to be destroyed and sent the Relictors on a century-long penance crusade.
They survived this crusade and rebuilt their chapter but carried on their collecting in secret. This collecting eventually culminated with a Relictors raid on the remote Diamedes Archive where the Space Marines destroyed an Inquisition force guarding a Chaos artifact of great power and claimed it for their own.
After this and other conflicts with the Inquisition during the 13th Black Crusade resulted in them being declared Excommunicate Traitoris and were all but destroyed by the Grey Knights. Only a few hundred survived and its believed they fled to the eye of terror.
Some of this is covered in the novel Angron's Monolith
Space Wolves
The space wolves are known to claim spacecraft they board for the chapter if they can be cleansed. This has allowed them to amass and maintain an abnormally large fleet for Space Marine standards, consisting of 8 Battle Barges and many other ships. Codex: Space Wolves (7th Edition)
Logan Grimnar uses the axe Morkai. The axe is from a Chaos Champion of Khorne Logan defeated in battle on Armageddon. Before he would use it he had it reforged.
Arjac Rockfist: Anvil of Fenris
Comment: So kind of not since the Fire Claws were considered traitors after all and Logan reforged it. It kind of clears the items or expels the chapter.
Comment: @BalinsonofFundin Just because they were declared heretics doesnt mean they actually were its just what the inquisition said because they weren't happy with them. They did this to the Soul Drinkers aswell and tried the same with the Space Wolves at one stage but that didn't work out too well for them. Some inquisitors even use daemons to fight other daemons.
Comment: Can't that be applied to the heretic legions that defected during the Horus Heresy? Since they are bound more to their brothers than to their emperor? They were still banished to the Eye of Terror. @Bosc
Comment: Some of them yes, the Thousand Sons weren't heretics (fighting to kill the emps) at the start and same for the Alpha Legion. The Grey Knights Chapter's original founding members were all from traitor legions. @BalinsonofFundin
Comment: So, are there any chapters / legions that are using the heretic weapons and are still part of the Imperium? @Bosc
Comment: No don't believe there are any chapters that use chaos weapons and are still considered part of the Imperium. Maybe the odd individual but not an entire chapter. @BalinsonofFundin

The use of Chaos weapons against Chaos


Update Community User Description

Question: See this question for background.
I think that it is misleading that the community user is the user of record for approved community suggested errors - considering that the community user description does not mention that this is a function of the community user.
Suggestions (one or all)

Add to the description that community user is the user of record when community suggested edits for questions and answers are approved
In the mouse-over for community-suggested edits, give the name of the user who approved the edit

Alternatively, for community suggested edits that are approved, list the name of the approving user as the user of record for the update (after all, without their approval, it wouldn't go through) and add " (Community Edit)" after their name to indicate the source of the edit.
Answer: I've implemented (1).

Update Community User Description


How much more economical are planes with retractable gears vs. those with fixed gears?

Question: Many small planes have fixed gears, some have retractable gears. All things being equal, the plane with retractable gears would have to be more expensive than fixed gears, as the mechanisms involved in retracting them is obviously more complicated than fixed gears. On the other hand, planes with fixed gears should have somewhat more drag than a similar plane with retractable gears when they're retracted. This would imply that a plane with retractable gears would consume less fuel than one with fixed gears. If the difference could be quantified, how much more economical would the plane with retractable gears be vs. one with fixed gears?
Comment: I guess you meant to write "planes with fixed gears should have somewhat **more** drag than a similar plane with retractable gears"
Comment: It is pretty common for retractable gear to allow an aircraft to fly faster, on the same engine, instead of to fly at the same speed, with lower fuel burn (although there is always a choice of what throttle setting to use)  Additionally, realize that retractable gear generally adds weight to an aircraft as well, which further complicates things.
Comment: The difference is quantifiable. Look at the difference between the Cardinal 177's with fixed gear vs the retractable ones. Or the 172 RG's vs conventional.
Comment: Cardinal's with fixed gear (FG) can supposedly be almost as fast as retractable  gear (RG) when equipped with good aerodynamic fairings.  I'm changing mine now - better nose wheel pant with fairing to clean up the nosewheel scissor; better  main gear wheel pants with a more aerodynamic fairing over the leg and the top and bottom of the leg fairing; a better tailcone fairing to close gaps around the stabilator trim tab rod; and a fairing around the exhaust pipe.  Once the paper all settles, we'll see how it does!  RGs also have 20HP more to haul their extra gear retraction stuff.
Comment: @PeterKämpf, yes, that is what I meant to type. Unfortunately, fingers and brain couldn't get it together, and I didn't catch it before submitting. Thanks to fooot for correcting that.
Answer: Consider the Piper Turbo Arrow IV vs. the Piper Turbo Dakota... Same max gross weight, same engine, same wing, but the Arrow (with retractable gear) is nearly 12% faster at full cruise power.  This would imply that, at the Dakota's cruise speed, the Arrow should burn roughly 14% less fuel (give or take a little; it's 75% vs. 65% power, but at different altitudes).  Given this, the Arrow will cost less to fly for a given trip ($/nm).  The trade-off is that the Arrow costs more to buy, maintain, and insure, while having a smaller useful load.
Note that I chose these models for a reason: The Turbo Dakota is literally a fixed-gear version of the Turbo Arrow IV with no other major changes.  In most cases where a model is available in both fixed and retract, the retract has a more powerful engine.  This makes comparisons much more difficult.  YMMV
Comment: Fuel costs are one thing, don't forget maintenance costs as well.
Comment: @RoboKaren lemme just edit to make that clear...  Thanks!
Comment: Just to make sure I'm covering everything, I'm only counting fuel, oil, TBO items, and a minor set-aside in the cost per mile.  The remaining costs (insurance, parking, annual, repairs, etc.) are important, but without knowing how many hours / miles to spread them over, I don't really include them in the hourly/per mile costs.  The Arrow is still cheaper per mile (because it is enough faster), but probably will cost more overall.
Answer: One thing to consider is your drag profile and mission requirements. If you have a cumbersome aircraft with high amounts of drag cruising at slower speeds vs. an aircraft designed for impressive maneuverability and high speed, the impact of adding a fixed gear becomes much more drastic. For the cumbersome craft, going with a fixed gear might be much more economical because the complexity and cost is so much less and the added drag of having a fixed gear might not noticeably affect the design parameters. For the other example, the added drag of having a fixed gear would substantially diminish the craft's capabilities. I don't think you can simply put a standard "quantification" to the economical benefit because in the end, the benefit/detriment of having a fixed gear vs. retractable gear really depends on the aircraft.
Comment: And don't forget, there's two types of RG pilots - those who have, and those who will.      (land gear up, that is - and not always of their own making).    If you really want to move fast, put on a turbo, or turbonormalizer, to maintain sealevel engine HP up into the lower drag atmosphere, up where O2 is needed.  I'm good with less maintenance, lower insurance, and hopefully speed increase with faster fairing.  Have only been to 12,500 ft once, to cross the Rockies leaving the Mount Rushmore area heading southwest. 10,500 ft is normally enough for east coast and mid-continent flying.


Can you eat cheese with bread-that-was-cut-with-a-meat knife?

Question: If you intentionally cut bread slices with a meat knife, can you then eat that slice of bread with dairy products?
Comment: My understanding of using treif utensils is that they're fine as long as you don't use them to aid in cooking. Assuming you're not slicing piping hot bread, you should be fine. I'm not too familiar with the halacha though.
Answer: In the Shulchan Aruch it was generally assumed that knives had some amount of residue on them, so the answer would be a simple "no."
I know rabbis who you'd consider "modern Orthodox" who feel this still applies today -- if you look carefully at the serrations -- so the answer would still be "no." I know other rabbis who you'd consider "ultra-Orthodox" who have said today's knives are cleaner (thank you, modern detergent technology, and stainless steel) so there may be more room for leniency.
So take a very careful look at the knife, then ask your local rabbi.
Comment: What if it's an onion roll?


Safe operating parameters for GPIO pins

Question: Recently I have started using the GPIO pins more frequently and am a little bit wary of frying them. I read an article here about 10 ways to fry an Arduino. Since the pi has 3.3v logic and I believe has a less max output current rating per pin it seems the Pi is even more of an issue. I haven't seen any summaries recently about what to avoid while using the pi. Could someone point me to one? Of couse the article above is a little biased but those are all real ways that could fry a board. Any ideas?
Comment: Relevamt: http://raspberrypi.stackexchange.com/questions/9298/what-is-the-maximum-current-the-gpio-pins-can-output . If the current draw etc is too big that may also fry it.
Answer: Only power the Pi from a 5V power supply.
Don't make connections to the pins on the expansion header when the Pi is powered.  It is easy to short a pin to an adjacent pin which might cause a damaging short-circuit.
Don't connect a voltage less than 0V or greater than 3.3V to the Pi's gpios.  Be especially careful if connecting a device which is powered from 5V.  One or more of its outputs might feed 5V to a Pi gpio.  Use a resistor divider pair to drop input voltages from 5V to 3.3V.
Don't try to source or sink more than 16 mA from an individual gpio.
Don't try to drive a motor or relay coil or any inductive load directly from a Pi gpio.  The gpio will not be able to supply enough power.  A motor is especially dangerous as if spun it will act as a generator feeding potentially dangerous voltages into the Pi.
Do learn how to use sensor datasheets.  They have the information you need to find out:

how and whether it's possibe and safe to connect the sensor to the Pi
how to read and control the sensor
Comment: Generally speaking, the GPIO on the Pi (as well as the pins on Arduinos, and so on) are put together as cheaply as they can be, with the understanding that these are experimenter's boards and subject to physical and electrical destruction if improperly used. If you were building an actual product that used GPIO pins, I would think that doing everything you could in circuit design to buffer and protect those pins would be a necessary component. On the low end is resistor dividers, better would be transistor based logic-level shifters, most protective would be opto-isolators.
Answer: I really wonder why you state that you cannot find any summary as to how to safely operate the Pi's GPIO. But nevertheless it's a good idea to check and double check before frying the fragile pins...
A first stop should be the official website of the Raspberry Pi Foundation: namely this and the usage section linked there. Another helpful place is elinux.org and always worth a visit.
And in addition to Joan's comprehensive answer: Don't try to source or sink more than 16 mA from an individual gpio. Also note that the total current sourced or sinked from all GPIO together (the sum of all pins) should not exceed the limits of the 3.3V rail. Raspberrypi.org states: The GPIO pins can draw 50mA safely, distributed across all the pins; an individual GPIO pin can only safely draw 16mA.

Safe operating parameters for GPIO pins


Gmail offline mode

Question: I'm connected to my network and Wi-Fi is on but I cannot search in google nor can I send email.  It says that gmail is offline.  How do I change this?
I'm using a ProScan Android tablet.
Answer: Just because you are connected to WiFi does not mean you are online.

Try browsing using your built in browser. If you can then post it.
If you can't, then check if you can browse in other devices connected to the same WiFi network.
If you can't, then try running diagnostics in your router. This will show if your router can connect to your ISP. To do this, you have to open router settings in a web browser. Check your router manual for more info on this.

Please post the result from all the abide tests.
Answer: which android do you have ? what version of gmail do you have. Tell in detail that what your gmail is actually telling. Do you had forced closed it? if force closed, then try clearing its data and later do everything that you have done in the first time.

Gmail offline mode


Is it possible to "close" a port by dos'ing it?

Question: If I see port 25 is open, but I dont have access to the program running the smtp server, could It be flooded with enough information to make it unusable (but not affect any other services)?
Answer: You could make the program behind the port unusable. If the given program handles the DoS so badly that it actually fully crashes and thus dies, the program will give up the port, and the OS will reclaim it after a moment or two. After that, it's available for use for any application running on the machine. Assuming it has the right priviledge to use that port and so forth.
Answer: Opened or Listening Port means a service working and listening to this port(s) in order to do something.
Like Web server, it's listening on port 80 which mean a particular service listens to this port
to stop the port you have to stop the service it self.
You can stop the service by kill its process or Attack it by DoS (if it's vulnerable) or DDoS by flooding this service.
Comment: If you DoS attack the daemon listening on that port, you won't close it properly, unless the daemon actually dies rather than freezes. If I'm not mistaken the TCP handshake has occurred before the daemon gets a chance to accept the connection, meaning that a client will be able to connect to that port. To the client it will appear that the daemon is up but not responding to any requests.  If I am mistaken about when the TCP handshake occurs then it will appear as if the port has been filtered.  In neither case is it actually "closed".
Answer: I asked this question without a good understanding of ports, however, I now do.
A port is not a fixed bandwidth like a usb plug or cat5 connection, just a way to tell the kernel what application is to be reached.
It is therefor not possible to flood a specific port and prevent access to only that port in the way ddos does to an entire server


Does Fu have a "super" transformation?

Question: The Dragon Ball Wikia doesnt list any transformation for Fu, but this more than a power-up looks like a transformation. The black aura alone could be a powerup, but his eyes turn red and his hair gets spiky similar to a super saiyan. Does any manga or videogame show Fu have a transformation or it's just a powerup? It's not only a semantic issue because a transformation allows the user to boost his power beyond the limits of his base form. I dont think there is anything official about this, but I think it's worth mentioning just in case, there are many fans already calling this "super Fu" or "super saiyan devil".
Answer: That's the form called Super Mira as the name suggest it was first used by Mira by and since Fu is Mira's son i guess he can use it too.The form itself is just Super Saiyan but mutated by demon DNA.I'd link the wiki but i can't so try finding it as "Super Mira" there.

Does Fu have a "super" transformation?


XCode fails to run app on device, saying the program being debugged is not being run

Question: I'm running Xcode, trying to get my app to run on my iphone. I'm getting the error message "the program being debugged is not being run."
Answer: The solution was to remove my developer provisioning profiles from my phone using Xcode's organizer window while my phone was connected to my computer, then to re-add my developer provisioning profile, which I re-downloaded from developer.apple.com.
Comment: Worked for me - thanks. I think it was caused by one of my profiles expiring (even though I wasn't using that particular one at the time).
Comment: If you are using Xcode 3.2.3, you won't need to re-download, just remove the expired provisioning profile as mentioned above.
Answer: It only worked for me when I removed another unrelated expired provisioning profile from the device. Very weird.
Comment: Same for me! I had to remove all expired profiles from the device. Weird!
Answer: All I needed to do to resolve this problem was reboot my device.
Comment: I tried deleting the development provision profile and redownloading and adding it to my iPod Touch via the Organizer window, but no luck.  Shutting down Xcode and rebooting the iPod fixed it for me.
Comment: Some how this method worked after rebooting both of of my devices (Laptop & iPhone)
Answer: I too have had this problem several times and I think I've just finally (after several months) wrapped my head around Apple's logic.
When developing, it's very common to have to use a new provisioning profile; often because you add a new tester, or an old one expires.  So, you dutifully add the new user's UDID to your provisioning profile, download it and then drag that into xcode.
Then, you click on the settings for your project (or target) and tell it to use that new distribution profile.  You probably used the "all configurations" under the "configurations" pull-down, like I did.  Whoops.
What this does is to associate your DISTRIBUTION profile with all compile configurations.  But, distribution profiles don't work with debugging!  You have to make sure you don't override your DEVELOPER profile under your debug configuration.  If you do that, just go back to your project, select "Debug" under configurations, and select the appropriate DEVELOPER profile to compile with.
Hope that helps, guys.  -VTPete
Answer: To fix this I deleted the last app which I had deployed to the app using xcode and then built my current app again and it worked fine.
Answer: The other suggestions didn't work for me either.
It started working after I changed the "application-identifier" in the Entitlements.plist to the App Id found in the Provisioning Profile. The default was $(AppIdentifierPrefix)$(CFBundleIdentifier) which I changed to "H2GC99UNHN.au.com.mydomain.myappname".
The Xcode default: $(AppIdentifierPrefix)$(CFBundleIdentifier) would work if those variables resolved correctly. CFBundleIdentifier refers to the "Bundle identifier" in your Info.plist.
I never found out where to set the AppIdentifierPrefix which should be something like H2GC99UNHN.
To find your App ID in Xcode go to the Window menu, then Organizer. Click on the correct Ad Hoc provisioning profile, the App Identifier is one of the properties.
PS: To get the app on my device for testing I am using "Build and Run" in Xcode (I don't know any better). But the run part will fail because I have removed debugging symbols in my Beta configuration. Just let the run part fail and then reopen the app manually.
This error makes sense if the signed app is linked to the profile and it's certificate via the app id.
Answer: For those people who are still getting this error after trying all the above, the following solution just fixed it for me after I was getting the error.
I do jailbroken development, so to bypass mandatory code signing I had modified XCode's Info.plist under /Developer/Platforms/iPhoneOS.platform.
To fix the error, just revert those modifications: replace all instances of XCCodeSignContext with XCiPhoneOSCodeSignContext in that Info.plist file.
Comment: Possibly not relevant because OP isn't jailbroken.
Comment: I'm not jailbroken but deleting those files fixed it.
Answer: You should check which certificate you ase using, remember to use developer provision for debug on you device and ensure all configuration is done.
Answer: I have two developer identities (work and home) and use the same device for development.  I also use a wildcard app identifier (xxxxxxxxxx.*) at home, and I often build different apps using the same profile.  Sometimes when I switch locations (e.g. from work to home) I get the above error.
Removing and re-adding the developer profiles from the device, reloading the profile from Apple and restarting the device (in various combinations) did not solve the issue for me.
What did enable running and debugging on the device again was:

go to project settings in Xcode (double-click project name)
search for "identity" to find the setting "Code Signing Identity" / "Any iOS"
tick "iPhone Developer: My Name (mydevid)" under the section for my home profile (for Application Identifiers '*')
do not tick "iPhone Developer:" under "Automatic Profile Selector", even if it "currently matches" the same developer ID and profile

(I also quit Xcode and did rm -rf build, but that is probably not needed).
Answer: This happened to me after installing an AdHoc distributed app to my device. I had to restore the device to make the debugger work again.
Answer: I was having the same trouble and none of the above worked (even wiping / restoring the device).
Then I looked and saw that I had mistakenly set all my targets to use the adhoc distribution profile. Which doesn't support debugging.
See also iPhone Debugging: How to resolve 'failed to get the task for process'?
Answer: I just had to power off my iPhone device and restart the same.
I tried in this order:

Delete app in Xcode.
Delete build folder in Finder.
Restart device.

Only 3. worked for me.
imp: My Provisoning profiles are valid for almost a year and there was no reason for them to expire (I even cross-checked them to be doubly sure :)).
If this hadn't work, I would have checked - as someone rightly suggested, if Developer provisioning profile was being used - which was, in my case.
Answer: Ah, latest version: I have Core-Plot framework included in my project. My old development profile expired and I dowloaded new profile, changed the project with the latest profile, but I had this error anyway.
So, I needed to open Core-Plot framework project itself, change code signing there to latest profile, build it, go back to my original project, rebuild it and then everything started working fine again.
Answer: I ended up deleting my Target to fix this freakin headache.  To add a new one, right-click Target > New Target > Application.


To get the master private key of HD wallet

Question: How can I get the master private key of HD wallet bitcoin core satoshi client 0.14.2? Any command for that  on bitcoin core console? Currently I am on Testnet3.
Answer: go to help-> debug window -> console
Enter:
walletpassphrase "your walletpassphrase here" 60, to unlock the wallet if its encrypted.
dumpwallet  "filename", will crate a plain text file in same directory where your wallet .dat file is form which you can get your xprv.
walletlock, to lock your wallet
Don't forger to erase the file after you get the info. Also if u change your wallet password the xpri will change.
Comment: Just one correction. dumpwallet "filepath+filename" and after that It will not automatically create text file but You can go to that file -> properties and then change the extension and open it with notepad. Thanks again


Maximum/ ideal length of ethernet cable?

Question: What is the maximum and/or ideal length of an ethernet cable?  Is there a distance that data cannot be transferred over an ethernet cable, say over X number of feet?
Comment: As far as ideal length.  The ideal length would be as long as necessary and no longer.  Be it for cost, interference, cable management or latency (for all the hard core gamers out there).  Excess unneeded cable can cause problems.
Comment: which is odd, as we've got some 10cm patch cables in our server room/switch bays.
Comment: There is also a MINIMUM length, to avoid problems like reflection.
I encountered this years ago, when I was doing up my house. I cn't remember the value, but I THINK a cable one foot long was not recommended!
Comment: That depends. Ethernet can run on fiber for many, many kilometers. Ethernet runs on a variety of media (coax, UTP, fiber, etc.), and there are multiple ethernet standards for each medium with varying maximum  distances. You would need to be specific about the medium in question and the ethernet standard used on that medium.
Answer: There is no ideal length of a cat 5 cable but the specification states that it should not be more than 100m (328 feet).
More info on the wiki page
The specification of 328 feet has to do entirely with collision detection in a CSMA/CD (Carrier Sense Multi Access / Collision Detection network.  Basically, the length is limited by the fact that the shortest possible frame size (64 bytes) can be sent out on the wire and if a collision occurs, the sending node will still be sending that frame when it hears the collision (due to a jam signal or higher than normal amplitude).  If a collision occurs during the first 64 bytes of a frame, this is a normal collision.  If something is out of spec such as the cabling is too long and the collision occurs after the first 64 bytes, this is a late collision and will not be retransmitted until an upper layer of the OSI model detects that the packet did not make it to its destination.  You can run longer cabling and the network will still function, but there will be issues.
Comment: True, if the cable is used for ethernet (which is very likely, of course). The maximum length of 100 meter ensures that collision detection mechanisms work as expected (and maybe also ensures the signal strength is okay?).
Comment: The statement "the length is limited by the fact that the shortest possible frame size (64 bytes) can be sent out on the wire and if a collision occurs" applies in gigabit networks but is not true for 10/100 networks. The speed of a signal in copper cables = 200,000,000 m/s. 64 bytes = 512 bits. (200,000,000[m/s]/100,000,000[bits/s]) * 512[bits] = 1024 meters (or 512 meter round trip) maxim distance to detect collisions during a 64 bit packet.
Comment: Before there were network switches, hubs would repeat signals which along with round trip propagation delay is the reason for the 543 rule. that you  can have a maximum 5 network segments daisy chained with 4 repeaters, and 3 mixed networks, though the mixed network rule does not apply to twisted pair.  Furthermore, switched networks buffer and queue packets which removes even the 543 restriction.
Comment: Instead the main limiting factor is a cable's impedance, which attenuates the signal, and a Network cards (NIC) ability to differentiate between high and low signals at the other end. the specs specify 100 meters, but with quality cable that have lower impedence and good termination with minimal cros talk or alien talk, two NICS can sometimes communicate well over cables longer than 100M
Comment: Category-5 cabling was de-registered last century. The only currently registered cable categories are 3, 5e, 6, and 6a.
Answer: The ideal length is exactly as long as you need (up to 100 meters) and no longer.  Every extra 11.9 inches adds another nanosecond of extra latency.
Comment: I just swapped out my 25' cable for a 10' cable here at home.  Those extra 15 nanoseconds are going to help me to be the first answerer on Stack Overflow.  Thanks for the suggestion, Joel!
Comment: Signals travel down copper wire at about 200,000,000 meters a second that is approximately 656168000 feet or 1.524 nano seconds a foot.
Comment: While latency is important to network performance, it is not a limiting factor in determine  a 100 m specification.
Answer:
What is the maximum and/or ideal length of an ethernet cable? Is there
  a distance that data cannot be transferred over an ethernet cable, say
  over X number of feet?

Your question is really too broad. Different ethernet standards use different media with different lengths.
Some ethernet standards and the cable length limits:
<code>10BASE-5       500 meters
10BASE-2       185 meters
10BROAD-36    3600 meters
10BASE-T       100 meters
10BASE-FL     2000 meters
10BASE-FB     2000 meters
10BASE-FP      500 meters
100BASE-TX     100 meters
100BASE-T4     100 meters
100BASE-FX    2000 meters
100BASE-SX     300 meters
100BASE-LX10 10000 meters
1000BASE-T     100 meters
1000BASE‑CX      25 meters
1000BASE‑KX       1 meter
1000BASE‑SX     220, 275, or 550 meters
1000BASE‑LX     550 or 5000 meters
1000BASE‑LX10 10000 meters
1000BASE‑EX   40000 meters
1000BASE‑ZX   70000 meters
1000BASE‑BX10 10000 meters
1000BASE-T1      15 meters
1000BASE‑TX     100 meters
1000BASE-RHx     15 to 50 meters
10GBASE-T       100 meters
10GBASE-SR      300 or 400 meters
10GBASE-LR    10000 meters
10GBASE-ER    40000 meters
10GBASE-ZR    80000 meters
10GBASE-LX4     300 or 10000 meters
10GBASE-LRM     220 meters
10GBASE-CX4      15 meters
10GBASE-KX4       1 meter
10GBASE-KR        1 meter
10GBASE-PR    20000 meters
</code>
There are other ethernet standards with other cable length limits. Some cabling has other requirements, too. For example, UTP cabling has a limit of 100 meters, assuming 90 meters of solid-core, horizontal cable (better performance, but more fragile) and a maximum 10 meters of stranded patch cable (worse performance, but less fragile) split between both ends.
There are also different grades of fiber cabling, and some ethernet standards can be used at different distances, depending on the fiber grade, while others require a specific grade of fiber.
Answer: Ideal: As short as possible, as isolated as possible.
Maximum: 100 meters without repeaters.
Answer: To be in spec, a CAT 5 UTP cable should not exceed 100 meters.  Cable can be connected with repeaters and you can get another 100 meters and so on.  However, if you network is too large, then the TCP/IP packet will take so long to go from end to end computers will reach the timeout before they get a reply back.  At that point other devices will have to be used to retransmit the packets, like switches/routers...  I'm not sure about that distance/time before packets are considered lost.
Comment: I truly doubt the maximum length is about timeouts. I've always learned it's to ensure proper collision detection. (Timeouts limits are much, much longer than the microseconds used for collision detection.)
Comment: Category-5 cabling was de-registered last century and there is actually no such thing for the last 20 years. The only currently registered cable categories are 3, 5e, 6, 6a, and now 8, which is shielded and limited to 30 total meters.
Answer: Maximum length of Ethernet over CAT5 has very interesting information.
TL;DR:

the maximum for ethernet is actually 2500m (or up to 5500m), to avoid crosstalk
the 100m (90m horizontal + 10m server patches) is set to limit the loss of signal strength so that a cable can still be certified as cat 5a
Comment: Category-5 cabling has been deprecated since the last century. The only currently recognized cable categories are 3, 5e, 6, and 6a.
Comment: The official maximum for Ethernet links is 40 km, e.g. 10GBASE-ER over engineered SMF. Inofficial -ZR runs for up to 100 km. It all depends on the medium you use.


Can I open Whatsapp backup messages from Nokia C7 on Android phone?

Question: I have a backup files from older phone (Nokia C7) where Whatsapp is not supported anymore. These files are stored in data/wa: MsgStore.bak.1, MsgStore.bak.2, MsgStore.bak.3, and I have there very important message which I would like to open it again. So I was thinking if it's possible to install Whatsapp on Android phone, add those backup files in storage and recover it back to readable state.
Answer: It's not possible as explained here Whatsapp backup: Unable to move from windows phone to android
You can try the PC software or other methods mentioned here 4 Ways to Transfer Data from Windows phone to Android for Free
Answer: As a fellow (die hard) veteran user of Symbian OS, I can tell there is a solution (or a trick) to log in back to WhatsApp in order to access your messages.

Simply change the date to 1/6/2017 on Symbian phone which will allow it to run WhatsApp without that pop-up.

As we can expect this trick won't last long, so as soon you you log in, get your classified chats send them (or forward them to android device, and save them there.  All the best :)
Comment: Ok, that phone is not with me right now but it is has it my friend, so basically he should just change a date in a settings, reboot a phone and that's it, yeah?
Comment: No need to reboot, he should change date in Settings, and opening WhatsApp he should instantly access old chats. I tried and tested and confirmed   it to be working :)
Comment: I'm one step further so now it will open whatsapp and prompt to enter phone number to register an account, but it will stuck at 'initializing'...
Comment: Try restarting your device, AFAIK you should access your old messages without having to verify your number again, at least thats how I did it on my device, I think for your situation after restarting you should prevent a data connection, so this way you go straight to old chats


Can't figure out how to distribute the power

Question: so I'm making a project, kind of BB-8 droid replica, and I stumbled upon a problem. Since I am using two RC brushless motors, ESC's and batteries, I want to make my Uno board fed up from those batteries. Also, I want to use inductive charging set that would charge both batteries. Can anyone tell me or give some kind of scheme how should I distribute the power from batteries and what additional boards should I buy?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/38985/discussion-on-question-by-andajus-cant-figure-out-how-to-distribute-the-power).
Answer: The best option is to connect the 5V/2A output of the UBEC to the 5V pin on the Arduino. In my experience, 7.4V is not enough to feed into the input jack on an Arduino especially if it is from a battery, as the voltage will drop when current is being drawn by other loads. I have built an Arduino controlled robot using a 6V NiMH battery and brushed DC gearmotors (so no ESCs or UBEC) and used a $5 5V 1A step-up/step-down converter so that even if the battery voltage dropped below 5V, it could still power the board. However, since you have a UBEC that is not in use, use it. Note that if you put voltage into the 5V pin, disconnect it when you are connecting the arduino over USB or you might damage your board.
As for inductive charging, I don't know of any off-the-shelf solution designed for charging a 2S lithium ion battery. The best option for charging would probably be an easy way to open the ball to access the batteries.
Comment: About that problem You wrote in bold I had already known since I tried programming my ESC.
Comment: EDIT
I agree that opening and then charging would be the best choice but I'm making this as a gift and not much people have Li-ion chargers laying in their houses :D so the idea is to make it like Sphero BB-8 which is with inductive charging system. I found something in adafruits page https://www.adafruit.com/products/1407 which might work just fine because it would really fit into my project. The problem is that I would need a board that would take power from inductive set to charge the batteries... but any sketch I  have made is messed up and I don't want to try anything that I don't get it.
Comment: That inductive charging system is only capable of 5V at 500mA. You could easily step this up to charge a 6V or 7.2V NiMH battery as they are relatively forgiving about charging conditions, but it would probably be difficult (as well as dangerous) to try to charge a 2S LiPo this way.


Macintosh Performa 200 Mouse and Keyboard Issue

Question: I have a Macintosh Performa 200 and I'm trying to get it working again. It powers on normally and then it brings up the normal Mac OS screen but the mouse and keyboard don't work. Yesterday they were working fine but today the mouse will not move and the keyboard does nothing. I have plugged both directly into the computer but this doesn't help?
Comment: Welcome to Retrocomputing Stack Exchange. Please read the [tour] to get a feel for how the site works.
Answer:
I have plugged both directly into the computer but this doesn't help?

The Performa 200 is, AFAIR, a Classic II, thus using ADB. Mouse goes into Keyboard (either side) and the keyboard connects to the ADB plug on the Mac. That's the single, leftmost  DIN plug, right between Audio In (to the left) and External Floppy (to the right).
From your description I assume you have pluged them into Printer and/or Modem which are two DIN located all the way to the right (between SCSI and Audio Out).
Comment: I thought that as well but the modem and printer ports are different so the keyboard couldn't physically fit into it.
Comment: @DylanMurphy Did you use the **right** (read leftmost) DIN plug? If yes, you might want to clean the connectors, or try differnt cables and/or devices.
Answer: The Performa 200 has an ADB fuse soldered to the main board. From this picture of the PCB, it seems to be F2, located in the upper right corner between the DB19 connector for the external floppy and the 20-pin header for the internal one. This fuse sometimes breaks when ADB devices are plugged into or unplugged from a running system.
However, as Raffzahn suggested, you might accidentally plugged the keyboard and/or mouse into the Mini-DIN 8 modem or printer ports. This might have caused damage to the connectors or the peripherals.
Comment: Do you know how easy it is to source and replace that part or is there a website where I can find people that will do it as a service? Also, could it be that the ball in the mouse has some dirt in it. Are there any keyboard shortcuts that I can press after the computer boots to see if it is the mouse or the port? Thanks.
Comment: The first thing you can to is check if there is still power supplied to the ADB port. [The ADB pinout](https://whitefiles.org/b1_s/1_free_guides/fg1mt/pgs/h10b.htm) shows the pins for +5V (pin 3) and GND (pin 4). If you have a multimeter, you can check for the correct voltage. I don't know the exact type of fuse, but it seems the current on ADB is limited to 500 mA. Any competent electronics or TV technician should be able to test and, if required, replace the fuse for you.
Comment: Thanks Michael for the help. Finally are there any keyboard shortcuts that I can press after boot up to see if it is the mouse?
Comment: Hi, there is no f2 and I have changed the PRAM battery and there is no current on the port. I have added an image of the logic board onto the answer?
Comment: @MichaelEngel EDIT - the mouse did work all of a sudden once but then, later on, it stopped working?


How to get access to the references?

Question: I don't have any institutes' login credentials or free account. But some of the answers to my questions contain links to references. I can't access them. Is there any other way to do so? I do not mean the use of illegally accessing the journals or articles. But my question is that unless I have account credentials from an educational institute am I unable to view the content freely?
Answer: I don't consider this a duplicate. I also think that this is a highly pertinent question for many users of the site, especially in light of the frequency with which answers here refer to the primary literature (which I consider to be a very good thing).
First and foremost, it should be said that no answer should require somebody to read an article to fully understand the answer. Any crucial information from the article should be paraphrased (or quoted, ideally within reasonable limits) and inserted in the text of the answer itself.
Sometimes, it suffices to read the abstract or the first page of an article to get a gist of what the article is about.
However, if access to the full article is desired, the first port of call should be the person who has cited the article. They should usually be able to help you with getting a PDF, or by summarising any pertinent information in the article. Edit: Don't you dare ask for a PDF here, or you will be turned away in no uncertain terms.
The next thing to look for is a free copy lurking on the Internet somewhere. Some authors upload copies of their own articles on their group websites. For example, all of David Macmillan's papers can be accessed via http://chemlabs.princeton.edu/macmillan/publications/.
Finally, one thing should be clarified, because the topic has come up in the past, not just in meta but also in chat. There are illicit ways of obtaining papers, which I will not link to here; the moderators cannot police the private usage of such channels. However, please do not promote them on Stack Exchange (e.g. by posting links to such websites), as they will be removed. See also: https://chemistry.meta.stackexchange.com/a/4297/16683
Comment: @pH13-YetanotherPhilipp, what methods users use on their own computers to obtain access to papers is none of our business. I also don't consider talking about it to be the same as promoting it. I think people are sufficiently mature to decide for themselves what is conscionable, and that there is no point in pretending that such methods do not exist. However, the suggestion for clarification is duly noted.
Comment: Ok, I think that this is as far as I will revise it. I would like to retain the point that it is not really our job to be the moral police.
Comment: *"do not promote it on Stack Exchange"* ... In my eyes, you are promoting it by writing about this option, even if unwanted. Also, by *"we don't really care"* you make it sound ok to go this way; I care and I clearly don't want to be part of your "we" there, who is this "we" anyway? :) Honestly, I think you should really rephrase the last part of your answer to make very clear, that this option is by no means truly accepted (here). In the end it is probably illegal in a lot countries to use this source and you don't want to promote s.th. illegal.
Comment: @pH13-YetanotherPhilipp, is this more neutral/agreeable to you now?
Comment: Indeed, but I think you can completely delete the "The mod team ..." sentence and nothing changes the message.
Answer: If you don't have credentials and they are required, officially you cannot get the full text from the publisher.
Of course, there are numerous alternative methods, but those are an off-topic on Chemistry.SE.
Semi-officially you can:

Try to search the internet for the PDF file. Sometimes it's stored publicly on an FTP server, uploaded by an authors to their blog, or just mirrored by another publisher.
Contact author(s) directly via email and ask them to send you a copy.
Ask a friend who is affiliated with a university to get the paper for you.
Ask on internet. There are forums and subreddit devoted to papers exchange (questionable ethics included).
Somehow acquire access to the network of a university which has a subscription. Some universities post login-password pairs for its VPN for graduate students or guests.

How to get access to the references?


Travel Europe under abbreviated first name on reservation?

Question: Our family has always abbreviated the first name as we all only use our middle names, as in D. Mike Dewey. If reservations are under D. Mike Dewey and the  passport says Dennis Mike Dewey - will this cause a problem?
Comment: Reservations for what? Restaurants, train seats, flights, hotel rooms?
Answer: For flights, it could be problematic and would depend on where you are flying to and from, your citizenship, and the experience and mood of the staff checking you in.
In such cases, the airline staff that check you in have a certain amount of discretion and for some journeys, they may well allow it, just as they would allow a case of first name, initial, last name.
In other cases, some airlines may seize on the opportunity to levy an additional charge at checkin to change the name to match.  I have had this before when 2 letters in my name were transposed.  A US$250 typo!
Many airports now require self check-in.  A machine is almost certainly not going to allow you to pass without intervention from an airline representative.
One specific problem situation may arise if you are not a U.S. citizen and are attempting to board a flight to the U.S.  In this case, it is unlikely that any airline would take the risk of allowing you to board.  The reason being the huge amount of passenger data that the U.S. government requires, and the amount of checks and pre-processing that is done.  If the airline perceives any risk that a discrepancy could cause you to be denied entry to the U.S. (or any other country for that matter), then they will not allow you to board.
Almost every advice you are likely to receive is to ensure that the name printed on your ticket matches the name of our passport.
Comment: As an example, Delta's machines are extremely picky. For a flight to Canada as a US citizen, it wouldn't let me check in because my ticket was for "FirstMiddle Last" and my passport was "First Middle Last" (the agent checked me in fine of course).
Comment: For international flights (including into the USA), it is necessary that the passport information entered by the traveler exactly match the documentation presented in person.  However, the requirements for the spelling on the ticket/reservation are more lenient.  This is because reservations and tickets are often arranged by corporate purchasing drones, and any airline that isn't compatible with corporate purchasing practices is going to find themselves losing a large volume of their customer base.  Whitespace, spelling errors, transposed first and middle name are common at that stage.
Comment: @BenVoigt - could you elaborate on what you mean by "entered by the traveller"?  Entered into what system? At what point in the process? I have never come across a situation where the passenger is granted the ability to amend the booking name; whether that booking has been made through an agent (in person or via a purchasing team), or directly with the airline.  Agents servicing corporate procurement teams are often willing to correct minor issues - but protocol dictates that only the agent can make such a change.
Comment: @PassKit: It doesn't alter the booking name, but that isn't necessary -- airlines have leeway in how they handle the information in their own system.  The governments only care about the information sent to [APIS](https://en.wikipedia.org/wiki/Advance_Passenger_Information_System) or similar, which doesn't come from the booking, and can be edited by the traveler until shortly before the flight.
Comment: @AndrewRay: I guess my comment wasn't clear, because I thought I said that the government doesn't look at names on boarding passes or tickets.
Comment: @BenVoigt Oops, no, I misread it.


How well can humans detect vitamin-richness?

Question: Humans do prefer fatty, sweet/starchy and salty. And fatty foods are rich in vitamins. How well can humans detect vitamin content apart from fattiness of food? Can humans choose the vitamin-richer of otherwise identical peanut butter, cheese or chicken leg?
Comment: Do you have a source for your claim that "*fatty foods are rich in vitamins*"? Have you looked at the nutrition information on a bag of potato chips recently?
Answer: Based on what I could search I guess that humans (and other organisms) usually do not have strong sensory mechanisms for micronutrients (Miyamoto et al, 2013).
There are some reports on sensing of metal ions, especially zinc and copper, by some organisms, including mammals (Bird, 2015; Ballou and Wilson, 2016). However, I haven't come across any study that talks about vitamin sensing.
Answer: From wikipedia

A vitamin is an organic compound and a vital nutrient that an organism requires in limited amounts. An organic chemical compound (or related set of compounds) is called a vitamin when the organism cannot synthesize the compound in sufficient quantities, and it must be obtained through the diet; thus, the term "vitamin" is conditional upon the circumstances and the particular organism

A vitamin is therefore not defined by its structure but by its availability. There is therefore no taste associated to vitamins in general. So, no we are not able to sense vitamins generally speaking just because there is no natural objective category of substances that one can call vitamin.

Note by the way, that the health effect of vitamins supplmentation (for most people) is debated. For example, you might want to have a look at the following two skeptics posts

Do vitamins improve memory abilities?
Do vitamin supplements have any health benefits?

One of the most important scientist of the 20th century, Linus Pauling advocated for the health benefits of vitamin C. Due to his strong influence, the reputation of vitamin C quickly grew but his work remained controversial and there are still very little evidence that supplement of vitamin C does any good.
Comment: "Note by the way, that the health effect of vitamins is debated." That's just wrong. The health effect of vitamin **supplementation** - at least for people without deficiencies - is debated. If you do not provide enough vitamins in your diet you will most definitely have adverse health effects.
Comment: This sounds wrong to me. There are certainly structures associated with the recognized human vitamins. There are no *taste* receptors for them, but humans also have hundreds of olfactory receptors, and for most of them the ligands are still unknown. Also, we might detect vitamins "by proxy", for example recognizing the smell of citrus fruits as "healthy", even if there is no direct receptor for ascorbate (vitamin C). I don't think we know enough about olfaction to be able to answer this question in the negative.
Comment: That wikipedia article seems human-centric and lists 13 vitamins. If we limit our definition of vitamin to those, is your "no we are not able to sense vitamins" still true?
Comment: Yes, very likely. You can have a look at the diversity of food source in which those vitamins are found and imagine a single taste would be common to them all.
Comment: That was more a typo than a misunderstanding from me as this point was made clear in the last paragraph. Thanks for the comment, I edited the post accordingly.


Difference between a netbook, a notebook, and a laptop

Question: What's the difference between the terms 'netbook', 'notebook', and 'laptop'? I've always just called portable computers "laptops", but apparently there is a technical difference between the three.
Answer: Sorry for digging up a old topic but I only just found it and had this to share!
Comment: _*is still looping around the "I'm stuck" boxes and wondering how he got there*_
Comment: Hahahaha that's awesome!
Comment: Awesome dude. I needed that :)
Answer: Laptop / Notebook
The term's laptop and notebook are generally interchangable.  Traditionally they refer to any type of portable computer.  However, with the introduction of the netbook, a laptop generally refers to computers with screens of 14+ inches.  These computers are considered "full featured."
Full featured means they have regular Intel or AMD processors and optical drives.
Netbook
A netbook is a small, ultra-portable computer.  Microsoft defines a netbook as any portable computer with a screen less than 10.7".  They generally weigh less than 3 pounds and have no optical drive.  Currently netbooks mostly use the Intel Atom processor.
Ultra-portables
There is another type of laptop that covers portable computers with screens that are 11"-13" in size.  These are generally very portable, light-weight, but are full featured (have full blown Intel/AMD processors).  They usually have optical drives.
Comment: As further reading, here's a recent article arguing it's "Time to drop the Netbook label": http://edition.cnn.com/2009/TECH/ptech/08/20/cnet.drop.netbook.label/index.html
Comment: Personally, I don't think we need to drop the term, but make it more relevant - I see them as not just no CD but also solid state (sorry 10" models).
Comment: Ultra Portables can have 3-4" screens, like the N800/N810/N900
Answer: As far as I know, the types of mobile computers are all marketing driven. There are no standards bodies which define the categories (other than, say which computer type Microsoft is willing to license their OS). So there is a lot of crossover in between the categories. And categories come and go based on what sells at the time. Some common categories of mobile computers are:

Desktop Replacement
Laptop
Notebook
Thin & Light Notebook
Ultra-Thin Notebook
Sub-notebook
Netbook

Descriptions of these categories:

Desktop Replacements were popular a few years ago. They typically had poor battery life and were relatively very big and cheap.
Laptops are the most common type (maybe until recently) and typically have most of the features of a desktop computer, but with a 15-17" screen and 1-2 hrs. of battery life.
Notebok computers leave out features commonly found on a desktop computer that aren't needed, have increased battery life and smaller screens (~13" is common).
Thin & Light Notebooks typically have even less features than Notebooks, ~12" screen and have increased battery life with weight in the 4 lbs. range.
Ultra-thin Notebooks, are typically very expensive and have a small profile at the expense of features.
Sub-notebooks (probably the precursor to the Netbook) are notebooks with a reduced feature set that are powerful enough to run a normal OS, but with a tiny tiny keyboard and little 10.1" screen.
Netbooks typically are extremely inexpensive, underpowered computers that are targeted to be good enough for web surfing and email type tasks.
Comment: Description #1 -- Desktop Replacements were not cheap -- if anything, they were more than an equivalent desktop due to the need for a monitor and getting everything assembled in a mobile environment.
Comment: By today's standards, you are right, they weren't cheap. But 5-6 years ago, they were the cheapest laptops you could get. They were a hundred or two dollars more than a desktop. The ones I'm thinking of had low end processors (Intel Celeron or AMD Duron), terrible battery life, 17" displays, probably weighed 10-12 lbs. I'm sure there were high end versions of these as well, but my memory is the low end is what was popular. DTR's probably put pressure on the traditional laptop to come down in price.
Comment: Your are missing a category, portable workstations. There are high end laptops with decent (not spectatural) graphics, processors, memory and drives. They are used as replacements for workstations in areas like CAD. They also make decent game machines. Look at the Dell Precision series as an example.
Comment: Post-bounty note: The "marketing driven" is a timeless answer, which could include newer lines of products we see today--Chromebook, GPD MicroPC, Raspberry Pi laptop--that do not really fit into the three categories defined by the accepted answer. These niche products are indirectly covered by this timeless answer.
Answer: You have to go way back in history to find the original difference between a notebook and laptop.  The original laptops were 2-3" thick and weighed 10ish pounds despite having a small LCD.  They replaced luggable systems that weighed 20ish pounds, had a suitcase like form factor, typically a mini-CRT as the display, and which had to be thumped onto a desk to be used.  The term notebook originally referred to the first systems with a form factor similar to current 14/15" models.  Now days the laptop/notebook terms are used synonymously.
Answer: New terms are invented each time a new class of small computers becomes popular and/or somewhat standardized, to distinguish them from the previous ubiquitous type.

"Portable computer" was the original term in the 1970s and 1980s covering machines like the Oborne One, these were retro-named "luggable" later on to make fun of their unwieldy size.
"Laptop" took off in the late 1980s to distinguish the first flat, fold-open computers that didn't require a desk.
"Notebook" took off in the 1990s to emphasize machines smaller and lighter than the laptops more common up to that time.
"Netbook" took off a few years ago to describe very small laptops with wi-fi internet but without legacy features like disk drives.

Of these terms, all have levelled off in their usage except for "laptop" which seems to me the generic term for now.
Here's a useful visualization thanks to Google Ngram Viewer:
Answer: Notebook and laptop seem to be very similar in definition.  I have never noticed any difference between their uses.
However, netbook is usually used to describe a very small, ultra-portable laptop / notebook.  The size is usually smaller than 10" (although some people also use it for 12"), and the weight is usually in the range of 1 - 2 kg.
Comment: Laptop means notebook. But there might be some variance in what kind of people use either term, as this Urban Dictionary definition reveals: http://www.urbandictionary.com/define.php?term=notebook :)
Answer: Notebooks and laptops are the same to my knowledge (unless of course you're talking about paper notebooks).
A netbook is a laptop designed primarily for things like internet browsing, word processing, messaging and the like. A netbook is also small enough that you can bring it with you wherever you go. As indicated by the other answers, a netbook is usually no more than 11 inches in size and will not weigh more than 2 or 3 pounds. TYhey also usually (but not always) sport an Intel Atom processor, which is a low powered processor that has the advantage of offering a minimum of power drain.
Answer: Microsoft sells XP to netbook manufacturers at a reduced price, so that they don't concede this fastest growing market segment entirely to Linux. To get this reduced price, there is a maximum hardware specification of what Microsoft considers a netbook. It includes a screen no bigger than 10 inches, hard drive of 160 GB, 1 memory slot shipped with at most 1 GB of memory. Many buyers have to throw away the 1 GB SODIMM when they want to upgrade to 2 GB. I don't have a printable reference for this information, I heard it on the [PC Radio Show].1
Comment: I believe hardware vendors (Intel and AMD, particularly Intel) also have limitations on which chipsets they'll sell to support various levels of CPU.
Answer: I just heard about another category called Smartbooks that seem to be somewhere between a smartphone and a netbook. They use RISC processors and a small (6"), high resolution (1024x?) screen, have a keyboard (thumbboard?) and run a 'proper' OS, e.g. Ubuntu Linux. They are starting to hit the Japanese market.
I think of a netbook as something that's cheap enough to be an impulse buy and small enough to fit in whatever bag you happen to have so that you will take it anywhere. It will be powerful enough for most web apps, but probably not much good for games. It's probably not going to be your main PC if you do more than surf. A laptop could be a main PC.
Answer: Laptops and Notebooks are synonymous. Netbooks are smaller and more portable and have longer battery life, they are generally used for simple things like browsing the internet and word processing and come equipped with an Intel Atom processor.
Answer: I once heard someone say that the term "laptop" is being avoided lest someone uses it on their laps, injure themselves through overheating, and sue the manufacturer.
Answer: Apart from what others have already mentioned ... laptops were usually considered somewhat larger then notebooks, due to their drive unit (FDD, CD/DVD ...). That difference nowadays has disappeared.