How to start an industrial revolution without textiles

Question: My world does not have stagnant technology, and of course there is going to be an industrial revolution. In the real industrial revolution, it began with the need for textiles, which led to the spinning jenny, then the waterframe, and so on. I was wondering how is it possible for a fantasy world to industrialize, but with another product to start it instead.
Comment: The obvious would be iron/steel production. You need powered machines for trip hammers, which basically take over for smith's arms hammering things out. With production levels high enough, you get to build skyscrapers and whatnot... though it'd be weird to see everyone wearing pre-IR rags in such a cityscape. If they have a wilderness, the industrial revolution can be lumber sawmills and whatnot. Most other products require a previous stage of industrial revolution (chemicals, etc) to have occurred just from infrastructure requirements.
Comment: The cool thing about worldbuilding is everything is possible unless you choose to disallow it. What's stopping you from saying that industrialization began with something else?
Comment: Automation follows value. Clothes were expensive, thread was expensive.
Answer: Like textiles, you need something people are working on every day.
Really, the same story played out in the change from our hunter-gatherer society to intentional farming; intentional farming is a kind of "industrialization" that lets a few people work so that everybody doesn't have to spend their days searching for naturally occurring food.
That was "industrializing" the "-gatherer" part of the equation, but in reality, there is evidence that we first "industrialized" the "hunter-" half with animal husbandry; domesticating and leading goats as we walked our annual gathering routes. We find signs of goat feces and bones along the path. And goats are the easiest animals to domesticate, they can eat any kind of vegetable matter (even sticks), they are relatively docile and provide milk and meat on occasion. We also "industrialized" hunting by partnering with wolves instead of going it alone.
That is in terms of "industry" in the sense of intentionally organizing and pursuing some beneficial activity.
So you might focus on what remains in labor for the critical processes of producing food, many of which were done by hand. Weeding. Harvesting. Cooking. Threshing. Grinding, for flours, that is extremely laborious by hand, but the first water mills used water wheels to turn stones for grinding grain. The first windmills were machines to harvest wind to turn grinding stones.
Water pumping, even today in primitive countries, people (mostly women and children) walk hours from their villages to wells to bring back water. A simple windmill (or even water wheel in a river) could provide the energy to lift water to pipes high enough to flow downhill to a village.
So didn't the Roman Aqueducts, about 19 BC and some 31 miles long, constitute an "industrialization" of water collection? They literally built their own river from the mountains to Rome, over 2000 years ago, and (kept in repair) the Acqua Vergine is still a functioning aqueduct.
The Archimedes screw is a clever but simple machine for raising water from a lake or river to height, and with a tiny bit of imagination it can easily be powered by a windmill.
Feeding of a herd of animals; goats or chickens or cattle, for example hay production.
Even the automation of tanning hides. In many equatorial climates, textiles are not absolutely necessary. But even there, sensitive genitals tend to be protected, and leather protective gear was often devised for battle or working in the field, dealing with thorns or bitey animals or sharp rocks. Like leather gloves and vests, which we still wear when working with thorny plants, wood, metal or livestock. Or definitely hot and often sharp metals in a forge. Not to mention shoes to protect our feet from rough ground and the many sharp corners it offers our feet. The tanning of skins into leather has several steps ripe for mechanization and industrialization.
Not to mention many other aspects important to civilization that can be mechanized, or machines could multiply the strength of a specialist. Digging, for example. Forestry, such as felling trees, stripping branches, sawing, etc. That is what the early "sawmills" did, used river flow to run huge saws to process trees into lumber.
On the Digging front, humans have been processing bog iron (naturally occurring iron-rich accumulations found in swamps) into steel for a few thousand years, and both mining, refinement and the forging of steel are target rich for automation. The Bronze and Iron ages did not come about without mining and forging. Roman swords and armor did not magically appear. Steel production began four thousand years ago.
Human industrialization truly began thousands of years before textiles, with the mechanization of tasks in ways that relieved us of work. Textiles was just a convenient place to experiment with this. But it certainly is not the only starting point, you can start with any life-critical, time-consuming task.
The most obvious being the needs for food, water, shelter and weapons, for offense or defense.
Think about the necessities of primitive life, and how we have utterly mechanized and industrialized our production of those necessities. Read up on the history of those, and find the seeds that started them. The textile industry was likely just a cultural accident, a focus of work to which a clever inventive mind happened to be deeply exposed, so that is where they focused their efforts.
But really, isn't it just an extension of the automation of cotton or flax production by farming, harvesting and threshing (in the case of flax)? Isn't it "what you do next" after you are reliably gathering a ton of fiber?
it could have been anything, I think. I see this all as a piece, we automate and "industrialize" one step at a time. Frequently we have been focusing on the most work and time intensive tasks we deem necessary for survival.
Comment: Got to upvote any recognition of the need to protect sensitive genitals from biting animals!  Especially goats.
Answer: It almost has to start with textiles
The point of starting the Industrial Revolution with textiles is that it created the conditions for a very large number of people to join the workforce, which created the conditions for the continuation of the Industrial Revolution.
To put it bluntly, you cannot have a proper Industrial Revolution if you don't have a large workforce available to work. If all your workforce is busy with some vital activity, then you will need to pay them very well indeed to entice them to work in your factories, which will make your products too expensive, which will limit your volumes, which will stunt the industrial development.
Before the Industrial Revolution, textiles were really really expensive; expensive in terms of money, yes, but this only reflected how expensive they were in terms of time consumed to produced them. They were so expensive that it was perfectly normal and reasonable for a man to include his clothes and bedsheets in his will, and to specify their distribution among his heirs.
Before the Industrial Revolution, basically all women spent all their time not consumed with housework and cooking spinning thread and sewing and weaving.
The standard epitaph of an ordinary Roman woman was "she was a good wife; she weaved cloth".
The other advantage of industrializing the production of textiles is that cheap textiles can be exported anywhere. Cloth is cloth, everybody wants cloth, and if you can make textiles significantly cheaper than everybody else then the entire world is your market. This brings money and raw materials into your country, and enables the expansion of the Industrial Revolution.
Chain reaction
In real history, the beginning of the Industrial Revolution went something like this:

Industrialize the production of textiles.
This liberates about half the working time of the female population, which is now suddenly available to work for wages in factories. For example, making paper, which drops the prices of books, which raises the literacy level, which creates the conditions for the next stages.

The world has an insatiable appetite for cheap textiles. The merchant class sees the unprecedented opportunity and starts exporting textiles worldwide.
This makes a lot of capital available for investment.

Seeing how profitable the exportation of cloth is, merchants put pressure on the early industrialists to make more. But the production of cloth is limited by the availability of wool. The price of wool rises to the point where many land-holders are incentivised to switch the use of their land from growing crops to growing sheep. This makes a large number of agricultural workers redundant, creating a large worforce pool ready and willing to work for wages in factories.

With available capital sloshing around and with a large workforce willing to work for wages, the industrialists can now expand the new work models into producing metal and ceramics goods, which were the second wave of industrialization.

At this stage, your country is the factory of the world. You can make many essential goods much cheaper than anybody else, which gives you a world-wide market, which brings even more money and raw materials into your country. The cycle reinforces itself.

Conclusion

It is this positive feedback cycle that you need to imagine for your Industrial Revolution to take off. In real history it started with texiles because (1) everybody in the world needs textiles, and (2) the difference in price between hand-made and machine-made textiles was so great that industrializing the production of textile gave a tremendous competitive advantage to the early industrial powers.

And don't forget that your industrial workforce still needs to eat. In real history, the early industrial revolution was accompanied by a maybe less well known Agricultural Revolution which increased agricultural productivity so that a smaller agricultural workforce could feed the ever increasing industrial workforce.
Comment: @TheDyingOfLight textiles aren't just for garments - as you said in your answer, ships are essential to move goods and ships need sails, also rope (have a look at early Industrial Age rope-making factories), plus other uses such as the bedding mentioned, tents / sunshades in a hot climate...  Excellent answer, +1 just for the final dot point on the Agricultural Revolution being a necessary precondition for the Industrial Revolution.
Comment: Textiles aren't the only option for the feedback cycle.  Farm machinery would also work: historically, upwards of 90% of the population was engaged in food production; today, it's around 1%, and much of that comes from more efficient machinery, not better crops and fertilizers.
Comment: The thinking is right, but textiles is too narrow. The process works for ANYTHING with a couple of criteria: pre-industrial production takes a LOT of work time and has a wide need customer base. This applies to food, maybe there is a universal tool that that species need to replace a "lacking" digit on their hand, even glasses if short-sightedness is near universal in the species. Anything goes here that fullfills the two criteria. Textiles is just what did it for us humans
Comment: While I agree with you on the importance of fabrics, do you have an idea beyond my iron idea what could start is for a species that just doesn't need clothing (hot planet or them being furry)?
Comment: @KerrAvon2055 While I'm not 100% sure about this I believe that clothing was historically the largest market for fabric. It's not that the need for it disappears, it's that the market is much smaller. Say you are dealing with lizards sleeping on preferably heated stone. I wonder about the alternative.
Comment: +1 just for "basically all women spent all their time ... spinning thread". And it really was *all* women, from the queen on down.
Answer: Iron and Steel
The Southern Song dynasty almost industrialized in the 13 century. Iron production seems to have been the main driver behind it all. They failed because the domestic market was weak, the bureaucratic state held too many monopolies, Chinese culture made it harder to question the classics (preventing an enlightenment movement) and getting crushed by the Mongols probably didn't help either.
As I see it you need a few things to industrialize:

One (or more) high value processed products with a huge market and low barriers to market entry
A workforce (workers and capitalists) that can actually decide what it wants to do (no caste system, this is probably what killed India in this respect)
A merchant class to distribute the goods economically, thus generating capital for investment
A sufficiently hands off state or one where the merchants and capitalists are already in charge (see England for the former and the history of merchant republics and political power in all the other successful parts of Europe (especially the Dutch))
A competitive environment where those who stick to dogma will only drive those who seek to explore new ideas into their enemies laps, sowing the seeds of their own destruction
enough infrastructure to support cities and to transport goods (this means rivers and canals, forget land transport for bulk cargo (it's called the silk road for a reason))
probably a host of other factors I forgot to mention
Comment: @breversa Your land transport is limited by how much you can carry per camel, cart, slave, ... Given a mass restriction a perfect trade good has a high value to mass ratio. Spices, gems and other luxury articles fulfill this rule. Among them silk, as it was value dense enough to justify carrying it across Asia. This doesn't mean you can't trade less value dense goods over land, but your distances are limited by the value vs the transportation cost. Ships are faster and cheaper, thus you can access more markets.
Comment: What do you mean by "forget land transport for bulk cargo (it's called the silk road for a reason)" ?
Comment: Thank you for the clarification that "silk = high value to mass ratio" which makes road transport still viable.
Comment: Exactly on breversa, if the species is universally nearsighted for example, glases could be exactly this product, and they would be valid via land transport as well owing to their high price to weight ratio
Answer: Automate weapons manufacture or some industry that is key to warfare.
This would be in a world where some small niche is already using steam power but it's not spread yet. Then a major war and someone from the industrialized industry realizing their tools can be used to augment a critical warfare industry. With that happening the war could last longer, maybe the smaller country wins, or any other imbalancing factor would be a spark to get other country governments/leaders to take notice and then to seek out the same industrialization in their domestic war industries. And then in peacetime you'd still have those devices around and people across the economy could start applying the industrialized tools to their own native industries.
Answer: If you want to have an industrial revolution in a similar fashion to Britain, at the simplest level you need four things:

An existing cottage industry producing a widely desired and used product that's not too easy to make. In the case of Britain this was textiles, before the mills there were thousands of cottages where wool, hemp, cotton and other raw materials were turned into clothing, painstakingly by hand. It was slow and productivity was terrible, but it was able to consume the materials available.

Some event that rapidly increases the quantities of these raw materials, and the demand for the finished products, so much that the existing cottage industry cannot possibly keep up. In Britain, this was mainly from imported cotton from Egypt, India and the US thanks to the reach and influence of the empire.

Significant scientific and technological capabilities. Industrialisation needs scientists and inventors, otherwise there's no technology available to improve how it's already being done in the cottages. Europe had this pretty much since the renaissance.

A reasonable amount of wealth and prosperity, and a culture of entrepreneurship. These are your keen eyed tycoons put two and two together, and use the advances in science and technology to address the oversupply and meet demand, by turning the cottage industry into a modern factory based system. Obviously they need some wealth to get started, to build the buildings and fabricate the machines, and clearly nobody is going to do it if they can't get stinking rich! (or at least get some kind of reward or prestige). And again, Britain near the peak of its imperial might had lots of wealth and plenty of people willing to take a risk to make it big.

I think with these criteria, you've actually got something pretty flexible. You can swap out textiles for something else, though really it's the perfect product for this sort of thing. Pottery and glass perhaps, though perhaps with those you could just have the demand suddenly skyrocket, causing a labour shortage, since in most places clay and sand are plentiful. Maybe some metals, though due to their durability it's hard to make demand go up suddenly. But I think you could could come up with something.
Answer: You need to justify the lack of textiles.  Even if people wear only fig leaves, you have sails, and ropes, and nets, and bags.
What is a textile:  A flexible material of 1 or 2 dimensions, with a reasonable strenth to weight ratio.   Textiles now are used to make jets and bicycles.  (Carbon fiber cloth composit)
Steel and wood come to mind as replacements. Concrete for dams and canals for water control.
Answer: It depends on what's readily available.
Textiles are useful for many things, as other answers have pointed out.  If the society you're writing about is broadly similar to humans on Earth, they will need some form of cloth  - not just for clothing, but for nets, sails, flags, furniture (upholstery)... and that's not even getting into associated products: a society without twine, rope, thread, or yarn would almost certainly be very different from the humans-on-earth baseline.
Rather than obviating the need for those things, it might be easier to explain why their manufacture is trivial.  In many societies on earth, some "cloth" usages were commonly leather instead of woven material.  So run with that - include a few other creatures or plants that produce materials similar to the various things we, in our world, used textiles for.  Maybe there are giant pufferfish whose flesh remains supple after washing up on land, or trees with tough-but-flexible bark, or giant onions whose skin is easily adapted.
Having gotten rid of the need for textiles, we come to the question at hand: what other products are constantly necessary, and time-consuming to produce?
Well, let's tackle "constantly necessary" first.  Maslow's Hierarchy of Needs points to physiological needs being the most important.  It would be tricky to alter the places of air, food, or water without producing a society unrecognizable and difficult for your audience of humans on earth to identify with.  Clothing would also be on that list, but that's the textiles you're trying to avoid.  How about shelter?
If the world has few readily-available resources that can consistently stand up to the forces that act on the structures of the world, it would be plausible that most people spend enormous amounts of time on the upkeep of their dwelling.  A combination of tornadoes (ripping up structures above ground) and earthquakes (making below-ground structures unsafe) could tie up a lot of time in the repair of houses.  Or maybe acid rain that eats structures away and pools below-ground, so that people are forever repairing the roofs of their houses and other structures.
Some innovation that helps people's buildings stand up to their environment would open up far more people's time to, well, do other things - invent things, manufacture leisure items, come up with increasingly-complicated art.
Answer: First devise your society, then build their automation around what they need.
If you envisage cities of marble, industrialise quarrying and cutting masonry.
If you envisage amphibious frog people who build beaver style dams and dens, industrialise around harvesting all that wood.
If your society is constraint to not have available metal, perhaps you'd industrialise around making fiberglass style kelp-reinforced ceramics or polymers.
If you envisage a society of ruminants, perhaps industrial scale Sauerkraut is more efficiently digested than grass. As a bonus, anything that helps your inventors be healtier or more efficient is a good innovation multiplier.
If you imagine a mountain kingdom hostile to draught animals, perhaps transport is the starting point for mechanisation.
Answer: Q: "I was wondering how is it possible for a fantasy world to industrialize, but with another product to start it instead."
Vaccines and other pharmaceutics
Precursors
The industrial revolution is driven by an earlier industrious revolution,
See: wiki - Industrious revolution
An industrious revolution is driven by demand, not technology. Textiles drove an industrious revolution, as did candle sticks, coinage, bricks, glasswork, alcoholic beverages, and home decoration. Work previously done by individual craftsmen gets organized in factories. For an industrial revolution to occur, the product should require technological advancements.
In below answer, the early industrious revolution around beverages, that is beer, whiskey and liquors would become a precursor of pharmacy, not textiles.
How would this industrial revolution be caused by another product ?
Early history aside, the start of the industrial revolution based on textiles is widely regarded as ca 1760, rooted in the invention in 1734 of the flying shuttle. So.. we need something in the story that will occur before that point in time, requiring a certain product, putting an incentive to produce it in very large quantities, that would make textile production machinery a less relevant factor.
Now, suppose in your story, folks started pharmaceutic industries in the 1740's.
There are many applications of medicine, like aspirin and penicilline, all requiring medical advancements that did not happen. But vaccines may be a good example of having a plausible medical product, that could be in high demand as well. In 1720, the first vaccinating method was experimented with in Europe.
Vaccines
Now suppose the actual vaccine invention, dated 1796 for smallpox would have been a bit earlier, in the 1720's already. Producing attenuated or inactivated vaccines is quite easy, only.. it had to be produced in accurate dose and, in standard size glass packaging. Also, you'd need hollow needles to admit the vaccine.
Fictional part: the 1730-1745 Covid pandemic
Some Corona virus variant popped up and although the pandemia was not as severe as the medieval pest had been, the contagiousness and the resulting fast spread and lost working time impacted the economy for years and it made doctors think.. it accelerated scientific research into contagious disease and it would accelerate industrial production technology, millions of vaccines were needed.
Fictional part: earlier discovery of blood types
This is a key condition to let the medicine idea work: your story could put the discovery of blood types Karl_Landsteiner a few centuries earlier, by experimentation, an army doctor discovered blood types around  1702. This research was conducted in a way modern folks would find disgusting: prisoners of war were exposed to a variety of blood samples, accurate book keeping resulted in the discovery of 4 blood types. A few years later, a primitive clinical method was devised, involving coloring blood samples, to predict the safety of the vaccine.
Fictional part: earlier hollow needle
Injection is a technology already conceptualized in the 15th century, but it was not until 1659 until in Britain, first experiments were conducted. At this point I need a little hand waiving, they were invented in 1844, with the textile industrial revolution well underway. I'm not sure if the history of metallurgy makes 18th century injection needles plausible. But it would certainly require accelerated technological advancement to produce steel hollow needles. The offspin of the development of fine metallurgy may have been multifold and spawn many new products. By 1800, the textiles manufacturing equipment would look common, the pharmaceutics industry would be at the center of development.
Answer: Building on the answer from AlexP "It almost has to start with textiles".
What you need is a product that is

A scarce good that is needed on a more massive scale. Only products or services made on a massive scale can justify industrialization.
Hard or labor intensive to make manually. If it's easy to make manually, industrialization doesn't really serve a purpose.
Easy to manufacture with simple machines. Since you are talking about starting industrialization, you have to assume that the technology isn't instantly very advanced.

Textiles are the prime candidate; they meet all criteria perfectly. If you want to avoid starting with textiles, you would almost have to start with a civilization that doesn't need textiles in the first place - that is, a civilization in a very mild climate.
The second and third candidates I can think of are ones that also drove the real-world industrial revolution: transportation and communication.
Finally, one other options are the sins. In particular, drug production, as well as possibly mechanical pleasure devices. Gambling probably wouldn't work because there is nothing to be produced; it's just redistributing.
Answer: Plastics.
This may seem like a leap, but hear me out. Natural polymers, like rubber, Shellac, and various gums and resins, are all around. All you need is for the dominant culture in your world's history to have a strong relationship with one of them to excuse the idea that they might experiment with them, and/or try to create synthetic versions.
There are a lot of synthetic polymers, and a lot of methods for making them. The earliest ones in our own history were discovered during the industrial revolution, partly because that was what created a large scale demand for certain naturally limited materials (rubber, ivory, etc.). These early plastics and plastic molding techniques often involved relatively accessible ingredients; Parkensine, one of our first plastics, is a treatment of cellulose in Aqua Fortis. Another, Galalith, is made through suspending Caesin in Formaldehyde. Vulcanization, a process for hardening rubber, works with natural rubber and sulfur. Natural scientists from the era leading up to the industrial revolution had access to these materials - they just need a reason to experiment with them, and the freedom to do so.
Pre-industrial revolution, education is far more of a luxury, and thus scientific research tends to be pushed towards immediately practical purposes. However, there are always exceptions. In our history, research into electricity mostly started as a hobby for a handful of well funded scientists around Europe and its colonies that was showy enough to earn funding from the ruling class. If you come up with a reason why a wealthy society might fund otherwise eccentric research into manipulating natural plastics, and from that grow into synthesizing plastics, I think its very possible to imagine certain plastics being discovered early, a demand for them growing, and their production slowly becoming systemic until it is a legitimate industrial process.
This would fill the exact niche that textiles filled in our own history - the creation of something malleable, something standardized and useful from which all manner of other products could be developed in a deeper spiral of further industrialization. Whatever unit of plastic is made standard, it can be molded, stretched or hardened to fit any number of possible practical uses, serving as the backbone of an inescapable new economy.


Poker Strategy for all ins

Question: If an opponent goes all in pre-flop and I have 8 8 and everybody else has folded, what are the respective odds on either player winning the hand?
Answer: It depends on what kinds of hands your opponent would go all-in with.  If it's a tournament and he's short stacked in late position, he might have many types of hands. If it's a cash game or early in a tournament and he's got a relatively large stack, his range of hands is likely a lot tighter. Of course, if you know this opponent and his tendencies, you might be able to narrow it down a little more.
You can estimate your odds of winning against a range of hands with an equity calculator such as PokerStove.

Against a random hand, your odds of winning are about 69%.
Against the top 50% of hands, your odds are about 60%. (Your opponent could have 33+,A2s+,K2s+,Q2s+,J4s+,T6s+,96s+,86s+,76s,65s,A2o+,K5o+,Q7o+,J7o+,T8o+,98o)
Against the top 30%, your odds are about 55%. (55+,A2s+,K5s+,Q7s+,J8s+,T8s+,98s,A7o+,A5o,K9o+,Q9o+,J9o+,T9o)
Against the top 20%, your odds are about 51%. (66+,A4s+,K8s+,Q9s+,J9s+,T9s,A9o+,KTo+,QTo+,JTo)
Against the top 10%, your odds are about 44%. (88+,A9s+,KTs+,QTs+,AJo+,KQo)
Against the top 5%, your odds are about 34%. (99+,AJs+,KQs,AKo)

So, this really becomes an exercise in estimating your opponent's hand range here.
Answer: Unless it is a bluff you are facing:

two over cards
this is what you are hoping for
you are pretty close to a coin flip 1:1
QJ suited has a more ways to beat you so you are very close to 1:1
not suited not connected you are like a 57:42 favorite
but A9o is not a likely push
what 88 has going for it is that it is block on Q high straight or lower
over pair
this is what you fear
you are a 4.5:1 dog
you are dog to AA - 99
a lot of players will shove with AA - JJ

If you are less than 10 BB then you kind of need to gamble.
Less than 20 BB and you have blinds coming up might be time to gamble
If you have them covered and they are short stacked then they could be pushing with a wider range; you and can afford to lose; so I would gamble.
Clearly, 88 is hand that would rather get in cheap and is not afraid of multiple opponents. You are 8:1 for flopping a set and that is a hand that would likely hold up.
TT is a better hand in that spot.  As you have blocks on a Ace high straight.  A loose player could play ATs KTs that you dominate 2:1.  JJ is a hand is a hand I would typically call with unless they are tight.
starting hands odds
If it is a bluff or semi bluff then 88 stands up good
It is a pair and a block on a wide range of straights
If you think they are coming in light then a good hand to make a stand
If you are in the blinds and the raise came from the CO then call

Say they are semi bluffing 67 suited:
You are 4:1
Even a semi bluff with A little suited:
You are 2:1
On an outright bluff of 2 under:
You are 4.5:1

Poker Strategy for all ins


Screen orientation landscape back to portrait not working

Question: I've racked my brain for hours over this issue.  I have created a main.xml and designed one for the res/layout-land (landscape) format and another one for portrait in res/layout.
When I rotate the emulator (ctrl-F11), my app rotates properly to landscape using the correct main.xml, but a subsequent rotation back to portrait just keeps the landscape mail.xml.
This was done in a 2.0 AVD..
Out of despiration I downloaded the new Sample Code for Multiple Resolutions and had to create a new 2.1 AVD, to my surprise rotation with this app works correctly as expected.  So I then decided to try my app on the 2.1 AVD and it works perfectly.
So, is this a Bug in a 2.0 AVD or is there something special I need to be doing for < 2.1 SDK versions?
This is driving me crazy because no where did anyone mention this issue.
Thanks in advance
Comment: I see the same in 2.3.3 emulator now... 1.6 and 2.1 work fine though... makes testing difficult :)
Answer: FWIW, it's officially reported as bug here.
Comment: The workaround is to hit the home button when you are in portrait mode, that will reset the gravity sensor
Answer: Installed a fresh Android development environment, and created a new 2.3.3 AVD. (Both arm and x86). Both have the same problem, even with the system apps. So it's not a bug in your code, cause the system apps have the same problem.
Pressing 'home' and restarting your app works to get it back to portrait though.
Answer: Unless you specify
<activity android:name="MainActivity" android:configChanges="orientation">

In your manifest, I think your app should automatically select the correct layout.xml. So, seems like a bug in the emulator to me. Anyway, I found that the emulator is buggy in other ways. Ex. it runs the code twice when you change the orientation back.
Comment: When you change the orientation, the activity is re-created and its onCreate() method is called again which re-creates the whole activity. So its not a bug..
Answer: I am using Eclipse for Java Helios, and Android 2.2 and I experienced this same problem on my laptop. I found out what the problem was for me at least. Sometimes I work on my laptop in an area that doesn't have wifi so I am not connected to the internet and this seems to cause this problem. I have tested it by going to a wifi hotspot and, sure enough, the switching between portrait and landscape and back again works fine. Maybe the emulator just has to have a connection to do that or it is a bug in the emulator.
Answer: I've only done 2.1 development, but another thought I just had would be to try CTRL-F12 (Switch to NEXT layout orientation) instead of CTRL-F11 (Switch to PREVIOUS layout orientation () and see if anything changes.  This is from Controlling the Emulator.
Also, there are a number of lifecycle methods you could override to monitor what is happening behind the scenes.  That might let you know if there's a bug in the emulator.
Answer: Yes, the emulator is a bit buggy when it comes to orientation changes. I haven't experienced this specific problem, but it does sometimes do strange things. However this definitely isn't an issue with < 2.1 SDKs, on a physical phone at least, because I'm still stuck with v1.5 on my Hero and it properly handles orientation changes by picking the right layout folder to get the xml files from.
Answer: I was also faced same problem. I solved it. I don't think this is an emulator bug. I think in some real phones also it will behave like this. The main reason is the activity is not refreshing. You can do one thing - override the
public void onConfigurationChanged(Configuration newConfig) {
    // TODO Auto-generated method stub
    super.onConfigurationChanged(newConfig);
    startActivity(getIntent());
    finish();

}

and reload the current activity. It will help you.


How do you choose whether to roast or fry a vegetable?

Question: What are the differences in flavor and texture when using the different techniques? Do some vegetables call for one technique rather than the other? Assume you oil the container you roast in.
Comment: Fry as in deep fry or stir-fry (in a wok or a frying pan) ?
Comment: @Max Fry as in stir-fry (in a frying pan), but an answer about frying in woks would also be interesting to me. I'm especially wondering about what happens if you chop vegetables sufficiently small when you stir-fry, so you don't have to worry about the inside not cooking (fast enough).
Answer: Stir frying in a pan or in a wok (it's more or less the same thing) is and should be done on high heat and should be a quick operation.
Raw vegetables need to be cut into small size to be cooked as quickly as possible. If you use large pieces of vegetable there is the risk of moisture leeching out and reduce the pan temperature and it will start to boil or steam instead of frying.
In some instances, some vegetables can be par-boiled or blanched in advance to speed up the stir-fry process.
In the case of roasting, it is different, it is a longer process and you can use larger pieces of vegetables; the heat is not that intense and will come from all around the food; not just an intense heat from the bottom.
The oven heat will take care of removing the humidity/moisture from the vegetables.
Oven roasting will also help creating different flavors in vegetables (browning) ; it will usually accentuate the sweetness of most vegetables.
2 different applications, 2 different end results.
Comment: Thank you for your answer, which is useful! I think what I understood is the following-- if you have bigger pieces, you can cook vegetables longer without them breaking down into mush. If you cook vegetables longer, you can get accentuate the sweetness of vegetables. On a pan, you can't cook bigger pieces because it will boil instead of frying. Honestly, I don't fully understand the last part, and why you can't cook on a pan at a low temperature for a longer time. Why should moisture behave differently in a pan and an oven if you maintain the same temperature?


P5js SVG Export

Question: I have a P5js sketch which creates a font that users can type anything they want.
I want to allow the user to download an svg/pdf (vector) version of their result.
As of now I succeeded to have them download a .jpg version using the save order and saving a shot of my screen.
Any ideas?
Comment: No, we ended up developing the website without the option
Answer: That's an old thread, but maybe my solution will be useful to someone. To export vector graphics in P5js to SVG file, first I use SVG renderer from p5.svg.js library - this will put svg element directly into HTML document. Exporting is to extract the content of that element (by outerHTML property) and save it to a file (like in this post).
So, for example, your "Save as SVG" button callback function may look like this:
function downloadSvg()
{
    let svgElement = document.getElementsByTagName('svg')[0];
    let svg = svgElement.outerHTML;
    let file = new Blob([svg], { type: 'plain/text' });
    let a = document.createElement("a"), url = URL.createObjectURL(file);

    a.href = url;
    a.download = 'exported.svg';
    document.body.appendChild(a);
    a.click();

    setTimeout(function()
    {
        document.body.removeChild(a);
        window.URL.revokeObjectURL(url);
    }, 0);
}

Comment: p5.svg.js seems unmaintained, unfortunately.
Answer: From googling "p5.js svg", there doesn't seem to be a built-in way to work with SVG images in p5.js.
However, that search returns several promising results:
Here is a GitHub issue with a discussion about working with SVGs in p5.js.
Here is a project that attempts to add SVG support to p5.js:

The main goal of p5.SVG is to provide a SVG runtime for p5.js, so that we can draw using p5's powerful API in <svg>, save things to svg file and manipulating existing SVG file without rasterization.

Another discussion that links to two more SVG libraries.
The p5.SVG library sounds especially promising. I suggest you try something out and post an MCVE if you get stuck.
Answer: A new package called canvas-sketch seems to solve this issue. They have a wealth of examples for p5.js as well.
const canvasSketch = require('canvas-sketch')
const p5 = require('p5')

const settings = {
  p5: { p5 },
  // Turn on a render loop
  animate: true,
}

canvasSketch(() => {
  // Return a renderer, which is like p5.js 'draw' function
  return ({ p5, time, width, height }) => {
    // Draw with p5.js things
    p5.background(0)
    p5.fill(255)
    p5.noStroke()

    const anim = p5.sin(time - p5.PI / 2) * 0.5 + 0.5
    p5.rect(0, 0, width * anim, height)
  };
}, settings)

If you use p5 globally, there's also an example for that called animated-p5.js

P5js SVG Export


Magento does not create custom redirects for old urls

Question: We experience a problem with creating custom redirects for old urls. If we update the URL key of a product the old URL stops working (404), although the checkbox "Create Custom Redirect for old URL" is checked (right below URL key). Its Magento ver. 126.96.36.199. Any clue what could cause the issue? I'm running out of ideas unfortunately. Thanks for any tip!
Answer: Please try re indexing after you make the change.
this can be done in cpanel or ssh to magento root and run:
<code>php ./shell/indexer.php -reindexall
</code>
Also take a look into Catalog > URL rewrite management, there may be something odd going in there; for example one time I found one page that somehow had 10 URL rewrites and I was only able to get it to work after deleting them all.  You could also try setting up a custom rewrite here to get this working.
Have a look at here for manually re-indexing: http://davemacaulay.com/manually-reindex-data-in-magento-using-ssh-command-line-ee-1-13/.


Can I run one Craft install on multiple domains and/or subdomains?

Question: Is it possible to have one Craft install running multiple domains and/or subdomains?
For example having the same Craft install running a blog Channel at blog.example.com and also an about Single at example.com/about.
Answer: Update for Craft 3
Craft 3 includes native support for multi-site installation. Here's a link to the official docs and here's a link to another question with more resources.
Old answer for Craft 1 & 2
Credit to @LukeHolder for the original answer, but here's a bit more detailed and technical answer. Note, this might not be possible on all hosts.
Place the craft folder above both domains, add Craft's index.php file to both domain web roots and set the $craftPath variables in them to point to the same craft folder.
To make a template (say for a blog) only load on its own subdomain instead of whenever any of its slugs are requested on any domains you can run this quick check:
<code>{% set domain = craft.request.getServerName() %}

{% if not domain starts with 'blog' %}
    {% redirect '404' %}
{% endif %}
</code>
This will make "blog.example.com/some-blog-post" load, but "example.com/some-blog-post" will redirect to the 404 page.
Links to posts can formatted like this to add the subdomain to the URL:
<code>http://blog.example.com/{{ entry.uri }}
</code>
While this isn't an end all solution, it is a functional workaround, especially if it's only for page or two. Use Craft 3 if you can.
Comment: Simon, how do I add the subdomain to automatically generated links from a (redactor) rich text field? Is this possible?
Comment: Short of manually editing the links I don't know of any good options.
Comment: try putting {siteUrl} into the craft config? http://glui.me/?i=ao3ste0jh061kdj/2014-06-16_at_3.49_pm.png/
Comment: I don't see what that would do as Craft would still have no idea what sections load at what URLs.
Answer: Yes, it is possible to have a Craft install on multiple domains and subdomains as long as you only access the control panel from a single domain and you only have a single installation of craft that all the domains and subdomains use.
The limitation is all domains would be using the same url router and content - although for multi language content having different domains might be the way to switch on which language to use.
Comment: I'd like to see an example or tutorial for that kind of setup.  Using subdomains for the locals seems to make much more sense than url segments.
Comment: Found the multiple subdomain feature extremely useful for making a dev.site.
Answer: No you can't. In Craft's early days, they had a MSM-like (ala ExpressionEngine) feature, but they eventually removed because it overcomplicated the system.
You will have to run a unique craft install per domain. However, these Craft installs can at the very least share the same craft/app folder: http://buildwithcraft.com/help/sharing-craft-files
Comment: the question was asking if you can use different domains which is true, what you cant do is use the same install to run different website that have different content and url structures. See my answer below.
Comment: My mistake. I misunderstood the question. :)
Comment: @tynpxl, I found your answer very helpful. My interpretation of the original question was exactly like yours.
Answer: I was also looking for an elegant solution to server multiple domain from the same Craft instance and this is what I found.
The multiple domains documentation will assist your domain setup and is pretty easy: http://buildwithcraft.com/docs/multi-environment-configs
Where I got hung up is adding content which is specific to one domain.  The only 'hacky' work around I could come up with was using rewrite rules (.htaccess, etc) to append the request with a url segment that could be targeted via routes.
example.com -> main site
example2.com -> landing page site.  .htaccess rewrites to example2.com/lp/news
In the example above, I could also access the /lp/news from blog.example.com unless I want to manage conditionals in configs / .htaccess (for this domain, not this domain, etc).
At the end of the day, it's pretty clear Craft isn't intended for multiple sites and I don't recommend solutions that become a spaghetti mess to manage.  If it's a landing page or two, I think using the combination of configs, routes and rewrite rule would do the trick...anything else I would look into a separate instance.


Can't play dvd - vob files

Question: Works fine in Windows 7 I just put in the dvd and it plays.  I've downloaded VLC for Ubuntu 11.10 and tried playing both the individual vob files (didn't work) and the root directory on the dvd (also didn't work).  I've read something about mounting the dvd as an iso?  Could someone talk me through getting this to work?  For what it's worth they're legit dvds, not copies or anything, so I'm surprised I can't get it to work.  Thanks in anticipation!
Comment: the codec DVD's use is patented, that's why it's not working
Answer: https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs
Answer: Install Medibuntu using  command Line in Ubuntu 9.10 + ( Including Ubuntu 12.04 LTS Precise Pangolin):
Open terminal and enter the folowing command :
sudo -E wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

Enable DVD support:
To play encrypted DVDs, the libdvdcss2 package is essential. libdvdcss is a simple library designed for accessing DVDs like a block device without having to bother about the decryption.
If you already added Medibuntu repositories above, you can Install from software center or using the terminal by entering the following command:
sudo apt-get install libdvdcss2 && sudo /usr/share/doc/libdvdread4/./install-css.sh

source

Can't play dvd - vob files


get_object_vars() vs. cast to array

Question: Are there any differences between get_object_vars($obj) and (array) $obj ?
Both seem to return the public properties of the object.
Which is better?
Answer: This is not exactly true.
get_object_vars is scope-sensitive and will return all visible properties excepting static properties regardless of their visbility. If you call it from outside your class, you'll only get the public members; from a derived class, you'll get the protected and public members; and from the class itself, you'll get all the members. The array keys represent the property names, and are not mangled.
The (array) cast returns, at least on PHP 5.3.0, all the object properties, public and otherwise. The name of the properties are mangled according to their protection level:

public: not mangled, identical to property names
protected: key name for property starts with a *
private: key name for property starts with the name of the class

See casting to an array for more informations.
I hope you'll be able to better understand which one is the most appropriate for your situation.
Comment: To add, for the `(array)` cast, the `*` for protected and the *classname* for private members will be enclosed in null-bytes (`\x00`), so strictly it's `\x00*\x00` for protected members and likewise for the private members: `\x00className\x00`. Related: **[Array to Object and Object to Array in PHP - interesting behaviour](http://stackoverflow.com/questions/6325447/array-to-object-and-object-to-array-in-php-interesting-behaviour/6325631#6325631)**
Comment: Another difference (at least in PHP 5) : with `get_object_vars` the keys will be cast to int if they are numbers, where casting returns string indexes : https://3v4l.org/2Wb9j
Comment: One more to `(array)` is that it won't include `static` properties either regardless of their visibility.
Answer: The get_object_vars() function is a clearer method of achieving the effect you want. Although casting it to an array is a solution as well, this behavior might change in later versions of PHP.
I don't know if there is an actual difference between the two methods but the arguments above would lead me to use the function.
Comment: Why should the array cast be less reliable in its behavior than the function? Do you have documentation supporting it?
Answer: Better is what is what you actually need. get_object_vars() doesn't show private and protected members. See this comment in the manual for an example.

get_object_vars() vs. cast to array


how to compare two different enzymes with same Km?

Question: I have a test today I study at HUJI and I encountered this question which I can't figure out: if two different enzymes have the same kM and the same substrate what can I say about the two?

same Vmax
dosn't have the same Vmax
may or may not have the same Vmax
the proportion between kM to Vmax has to be 0.5
Answer: Km is the concentration of the substrate at which the rate of the enzymatic reaction is equal to 0.5 * Vmax. Km alone says nothing about the actual value of Vmax . . .


Scan unmounted external USB drive for malware without Infecting the system

Question: I have an external USB backup drive that I suspect being infected with a rootkit and fear it might spread to the host Linux system when just connected. Some experts say that some malware has infected systems from USB media even when unmounted. How can I scan and clean it safely?
Thank you
Comment: Indeed. This is possible if the "malware" is located within the boot block/partition. Ideally, you'll want a resident (TSR - in memory) AV product. But I'd be hard pressed to recommend one. That's something only *you* can determine from research based on your own security standards. :)
Comment: Why would the OS *execute* the boot block on a hot-plugged USB disk that hasn't been mounted? But a USB device that has been modified at hardware/firmware level for evil purposes might also emulate a USB *keyboard* and start blindly sending common shortcut keys for opening a terminal window, then commands after them. Anyway, if you suspect high-grade malware, don't scan infected disks with your primary computer; go to a flea market, get a cheap old computer you can easily afford to reinstall or even completely lose, and use that for scanning the disk.
Comment: The problem is that the USB stick is *unusable* if the stick cannot be plugged in. So what's the alternative? Throw it away? If the OP intends to ever use it again. The OP will want to guard against being "bitten" by anything that *may* be present on it. Hence my reply. Further reading of your reply strongly indicates yo don't understand how *infinitely* small the infections can be, or what they are capable of accomplishing. The affect can, when intended, take *years* to manifest, and are capable of a *wide* array destructive accomplishments.
Comment: Thanks @telcoM really for the insights. I have read about a rootkit - #badBios one - that infected an unmounted media. That's why I'm so afraid of dealing with my external HDD. I tried to get that resource for you but couldn't find it now.
Comment: somebody: I know the danger.. and I'm trying to find a solution.
Comment: @telcoM: Here's where I got the info on unmounted media being infected by rootkits from:
https://twitter.com/dragosr/status/393022639549063168
Answer: Disable all udev rules that will automatically execute something when you plug in any USB device. ("Desktop" environments in particular like to have automounters etc., but disable the rest for good measure).
Alternatively: Make a bootable USB stick with a read-only compressed file system with whatever you need to scan and clean the drive, disconnect your main harddisk from your computer, boot from the USB stick. As the system on the USB stick is compressed, it's impossible to remount it read-write, even if the rootkit should be devious enough to try.
But the probability of your USB drive being infected with a rootkit is really really low.
Comment: Thank you so much @dirkt for your input.. I'm searching and learning how to do it right now.
However.. if you can guide me more please:
We have here three different things:
- External USB HDD has been connected, mounted, before.. on a possibly BIOS-Resident-rootkit-infected system: Will that make it infected?
If not infected: Why?
If infected:
- Same External USB HDD now connected unmounted, on a clean system: Will it infect the new system's Media or BIOS?
Much Thanks!
Comment: That entirely depends on the BIOS-resident rootkit - if the *system* has been infect (i.e., BIOS flash ROM), and it sits deep enough and bypasses the OS, it can do whatever it wants, and nothing you do in the OS will prevent it from doing so. OTOH, if it's only the harddisk that contains the BIOS-rootkit, nothing will happen as long you don't execute any files from that harddisk. So connecting and mounting it is completely safe (assuming you don't have any automation that wants to execute files on it, like Windows does).


Surface area of a convex set

Question: In 2D perimeter(P) of a convex set around origin may be written as $P=1/2 \int m(\theta) d\theta$. Where $m(\theta)$ is the diameter of the set in the $\theta$ direction. This is related to Cauchy-Crofton formula. The question is if anything similar known at higher dimensions ?
Comment: There are Cauchy-Crofton formulas in all dimensions. The constants in front of the integrals are certain canonical measures on Grassmannians, and you are integrating over spaces of affine lines, and affine hyperplanes, etc, depending on the application. But there are versions that apply to your situation -- using spaces of affine lines.
Comment: I know some people use these generalized Cauchy-Crofton theorems in their work but off the top of my head I don't know a great reference for them.  They come in a wide variety of flavours.  They're not very hard to prove -- kind of a fun exercise in the basic geometry of the canonical bundles over Grassmannians together with the Fubini theorem and various change-of-variables theorems for integration.
Comment: Thanks, it would be good to get a reference to look at. I actually need the formula.
Answer: A good reference is Klain and Rota's little book Introduction to Geometric Probability, especially Section 5.5.
Here's the formula.  The surface area of a compact convex subset $K$ of $\mathbb{R}^n$ is
$$
\frac{1}{\omega_{n - 1}}  \int_{S^{n-1}} Vol_{n-1}(\pi_{\theta^{\bot}} K)  d\theta.
$$
Here $\omega_{n - 1}$ is the volume of the unit Euclidean $(n - 1)$-ball, $\theta^\bot$ is the linear subspace of $\mathbb{R}^n$ orthogonal to the point $\theta$ of $S^{n - 1}$, and $\pi_{\theta^{\bot}}$ is orthogonal projection onto that subspace; also, $Vol_{n - 1}$ is Lebesgue measure on $\mathbb{R}^{n - 1}$.
As you may know, this is a special case of the more general "Crofton formula" for the intrinsic volumes.  In the surface area formula, we're effectively integrating over the space of all $(n - 1)$-dimensional linear subspaces of $\mathbb{R}^n$; for the general Crofton formula, we integrate over the space of all $k$-dimensional linear subspaces of $\mathbb{R}^n$, for some fixed $k$.  This gives the formula for the $k$-dimensional intrinsic volume.  All this is nicely explained in Klain and Rota.

Surface area of a convex set


How do I create a single page application in Rails?

Question: I'm creating my first Rails 3.2 application after completing the excellent Rails Tutorial.
I would like my application to do this:
Pull a random recipe from the database (I have finished this bit using the 'index' action and this bit of code: <code>@recipe = Recipe.find(:first, :order => 'Random()'))</code>
If the user clicks the 'something similar' button, the app fetches a related recipe from the db
If the user clicks 'something different', the app fetches an unrelated recipe
From what I understand, there should be an action for both 'something similar' and 'something different'. Is this correct?
Should I use a  POST form with submit buttons for 'something different' and 'something similar' to determine which action to take?
Also, how can I keep the user on a single page throughout (so they always see the URL as http://www.whatshouldicookfordinner.co.uk rather than /recipes#somethingdifferent)?
Answer: To keep the user on the same page throughout, you will want to use AJAX.  Check out this railscasts, you can apply the concept to what you are trying to do.
Answer: Use a javascript framework/library (Ember, Backbone, Angular, Knockout, Meteor, Batman, etc..)
Check out this railscast: http://railscasts.com/episodes/323-backbone-on-rails-part-1


Modern IE languages which do not permit consonant cluster at the begining of syllables

Question: and also please guide me how to acquire such information from online linguistics resources (for example WALS.info).
Comment: I think [Persian](https://en.wikipedia.org/wiki/Persian_phonology#Phonotactics) counts, unless you consider consonant + semivowel sequences to be clusters. EDIT: But you seem to be familiar with Persian already...
Comment: Yes Persian is one of them
Comment: The only WALS map that I think would be relevant is [Syllable Structure](http://wals.info/feature/12A#2/19.3/152.9) and it does not show any Indo-European languages with simple syllable structure.
Comment: As already mentioned, Persian does not allow it. Therefore, you will hear some familiar words prefixed with an e-, especially loans. Unfortunately, I am not aware of such resources online to write a full answer. Let me have a look at it first.
Comment: @sumelic. This is because they define "simple" too narrowly. Persian does in fact have only single consonants in initial position, but in medial position it allows up to three consonants in succession.
Comment: @fdb: Right; I'm not saying the map rules out the existence of other languages that would answer this question, I'm just saying the map is not useful for identifying an answer to this question.
Answer: Modern Persian is known for this, hence Isfahan from earlier Spāhān, and I assume some other related Iranian languages share this phonotactic constraint.
Western Romance languages have tendencies against initial st-, sp-, sk-, similar to Persian (and Turkish).  Thus they have typically inserted e- (and many even drop the -s- in writing or speech, see for example the descendants of Latin schola), Ladino, Walloon and Sardinian go both ways.  Some Eastern Romance dialects changed or change s- into ʃ- before some consonants, similar to High German.
We should make a distinction between tendencies and real constraints, for example modern borrowings into French do preserve the clusters in words like psychologie, xylophone, sphère and so on.  Likewise the English rules for loans are a bit looser, whereas Spanish is stricter, but like English it breaks with the written form even in prescriptive use.
Every language has some tendencies ie frequencies and it is hard to know all regional spoken variations, but Slavic, Baltic, Germanic, Armenian, Celtic, Albanian, Hellenic are mostly happy with consonant clusters (although Greek has no ʃ and thus no t͡ʃ, German has no ʒ and thus no d͡ʒ and so on, and of course German has ʃt- but no st- in native words).
So my sense is that simple binary categorisation is not possible, and the remaining candidates are other Indo-Iranian languages, or non-Romance creoles or mixed languages with strong influence from Western Romance.
One method to check initial patterns is to seek in the dictionary, for example en.wiktionary.org/wiki/Index:Scottish_Gaelic/s#st, being sure to check the IPA pronunciation as languages like English and Spanish do not necessarily pronounce these even when written.


Want to start a new Castleville account on my iPad

Question: I downloaded my friends Castleville account on my iPad. Now I would like to start my own Castleville game. I uninstalled her game and removed all the data from Game Center. Next I went to the App Store to install the game but it has the little cloud icon with the down arrow on it. When I install it the game is still hers. Is there a way to download a game as if it's never been used before on my device so that I can play my own game from the beginning? Thanks
Answer: This is likely because her Apple ID is being used for Game Center.  To fix will require that you have your own Apple ID.

Go to Settings
Tap Game Center
If you see her Apple ID, change it to yours

If that doesn't work, This is because the game either stores game data in iCloud or somewhere other than just in Game Center.  To fix will require that you check with the developer on which Apple ID affects game status.
If signing out of Game Center doesn't fix things, then delete the app and all of its data. Then re-download the app. Lastly, before launching, use your Game Center account/Apple ID.
Comment: Thanks for the answer but I've done all of your suggestions. It is my Apple ID in Game Center. In fact, I have two Game Center ID's and the game loads her progress on both accounts. Not sure if this is a developer issue, Game Center issue, or Apple iCloud issue. Frustrating


How do I find the Stack Exchange site I'm looking for?

Question: Say I have a question and I'm not sure what Stack Exchange site to ask it on. Is there a place to ask a question and get it routed to the correct Stack Exchange site?
Comment: This should be a [tag:faq].
Comment: Sure But first `Say I have a question`, Please tell us your question.
Comment: @Computerone: In order to give him advice *on which site to post* we need the actual question, but in this case we don't since it is about the step before that.
Comment: @PatrickHofman Yes exactly that is what I am asking for.
Answer: First, you need to do some homework. So, having your question in mind, you could think of a few keywords to search for. You can search for your question in the network broad search page on StackExchange.com.
If not found, check the site list if there are some sites that could fit. Then read the help center > Asking page to see if your question is on-topic there.
If you are still not happy or in doubt, and need some advice, you can ask your question here, as Martijn told you in his answer.
Answer: Asking about where to post your question is on-topic here.
Tell us as much detail about your question as you can and tag your post with site-recommendation and we'll tell you a) if the question would be suitable for the Stack Exchange model and b) on what sites it could be on topic.
Comment: In general: Isn't that too much? Asking each time the same question twice, once here, to get it routed to the proper site, then there again?
Comment: @DavidBalažic: I didn't say you had to post the question itself.
Comment: @ .. strange it does not autocomplete.. Yes, but you'll have to tell the basics of the question, not the whole but still smilar. The point is there are still two questions, a "meta" question and the actual question. I [asked](http://meta.stackexchange.com/q/253896/176236) more or less the same thing. A search that would take some keywords and spit out the most fitting sites would be great: faster than asking on meta and it does not require work from other members (to answer the meta question).
Comment: @DavidBalažic: the whole point of asking here is because you don't *know* where to post your question. If you knew where to go, why ask here?
Comment: @DavidBalažic: I doubt that it is easy to automate this task by typing in a few keywords. `android` can mean any of Stack Overflow, Android.SE, or SciFi or Movies, to give you a very simple example.
Comment: @DavidBalažic: and my name doesn't auto-complete because I am the author of this answer and there are no other people commenting here but you and me. There is no ambiguity about whom would be notified in that case.
Comment: 1.) I guess this i a matter of opinion. Some would say, the user should research himself instead of asking "simple" questions, other recommend just go and ask".
2.) Of course, a single keyword like _android_ would match a lot, one would have to enter more to get a useful answer, like on any other search engine.
Comment: @DavidBalažic: Meta is no different from other sites, we do expect you to share your effort when asking a question about where to ask a question.


Did the previous painter neglect to prime?

Question: The paint on our house is peeling badly.  It's yellow paint over wood siding (clapboard).  When I scrape, I get pieces of paint that are yellow on both sides, and bare wood underneath.  Does that mean that the previous owner failed to use primer?
Answer: It would appear to be that way.  There should be a layer of primer.  If they did I am sure you would have seen some white on the other side instead of just yellow.
Answer: Yep. Or he used cheap primer, or he used the wrong primer, or he used primer made by a different manufacturer. All can lead to paint failures rapidly. I can think of a few application problems (such as applying the paint with a sprayer on a hot surface on a hot day) that could also lead to a failure to bond to the substrate.
Comment: "he used primer made by a different manufacturer", really this makes a difference?  I understand different types of primer but I don't see how useing one brands primer with a different brands paint would make a different (as long as it was the proper type).
Comment: That's what the paint store people say, and I've got no reason to disbelieve them. It has to do with the drying process and what kind of surface the end material wants to adhere to. Some primers leave things somewhat shiny/smooth -- Benjamin Moore Superior K046 is one I can think of -- and some paints don't adhere to things that are shiny and smooth. Benjamin Moore Aquavelvet N319 will adhere perfectly, though.


TeamCity: GhostscriptSharp: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Question: PDF converting fails while running test on CI. I'm using GhostscriptsSharp library for converting.
I'm not facing this issue while running my test locally, PDF-file is converted to images correctly.
I've been searching the internet for a solution but so far every thing I've found hasn't helped me find a solution.

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
  at GhostscriptSharp.GhostscriptWrapper.CreateAPIInstance(IntPtr& pinstance, IntPtr caller_handle)
  at GhostscriptSharp.GhostscriptWrapper.CallAPI(String[] args)
     at GhostscriptSharp.GhostscriptWrapper.GeneratePageThumbs(String inputPath, String outputPath, Int32 firstPage, Int32 lastPage, Int32 width, Int32 height)
     at Framework.Utils.FileUtils.ConvertPdfToImages(String pdfPath, String imagesPath, Int32 pageCount) in c:\TeamCity\buildAgent\work\8e7aa88e702dfaf7\Framework\Utils\FileUtils.cs:line 90
     at StepDefinitions.General.Search.SearchTableSteps.ThenImagesAreCorrectInDownloadedDocumentFromSearchGrid(Table table) in c:\TeamCity\buildAgent\work\8e7aa88e702dfaf7\StepDefinitions\General\Search\SearchTableSteps.cs:line 282
     at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
     at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments)
     at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance)
     at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
     at Features.Clerk.Version_2.Clerk_QuickDocFeature.ScenarioCleanup() in c:\TeamCity\buildAgent\work\8e7aa88e702dfaf7\Features\Clerk\version_2\ClerkQuickDoc.feature.cs:line 0
     at Features.Clerk.Version_2.Clerk_QuickDocFeature.Clerk_DownloadRedactedDocument() in c:\TeamCity\buildAgent\work\8e7aa88e702dfaf7\Features\Clerk\version_2\ClerkQuickDoc.feature:line 28
     at TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.ExecuteInternal(ITestThreadExecutionContext testThreadExecutionContext) in c:\TeamCity\buildAgent\work\1ace6ed01d0a43bb\TechTalk.SpecRun.Framework.Interfaces\TaskExecutors\StaticOrInstanceMethodExecutor.cs:line 40
     at TechTalk.SpecRun.Framework.TestAssemblyExecutor.ExecuteTestNodeTask(TestNode testNode, ITaskExecutor task, TraceEventType eventType) in c:\TeamCity\buildAgent\work\1ace6ed01d0a43bb\TechTalk.SpecRun.Framework.Executor\TestAssemblyExecutor.cs:line 215
Comment: Without the relevant steps/code responsible for the error message, it will be difficult to help you with your problem.
Comment: There is a 64 bit version of ghostscriptsharp now. However, I couldn't get it to work at all.

As others have noted, if you have IIS available and don't mind allowing 32 bit applications to run, this is the fix: IIS > application pool > {website} and right click > Advanced Settings > Enable 32-bit Applications = True. Recycle the app pool AND stop and restart the website.
Answer: The 'incorrect format' error usually occurs when attempting to load a non-.NET assembly (e.g. a native code DLL) as if it were a .NET assembly, or a binary that was compiled for a different platform (e.g. 32 bit vs. 64 bit). Use a tool such as ILSpy (for managed assemblies) or Dependency Walker (for native DLLs) to verify that the binary's properties match those of the process. Since it looks like a 3rd party assembly (GhostscriptSharp) is attempting the load, it may be necessary to reflect that assembly to determine which file the error is about.
Answer: If exception is thrown with message "An attempt was made to load a program with an incorrect format", this is likely due to the 32-bit file gsdll32.dll running on a 64-bit server. In iis, you must set "Enable 32-Bit Applications" to True for the Application Pool in which the application runs. Recycle the App Pool after making this change.
Derived from this answer.
Comment: I ran into this issue. Website was busy so I didn't want to stop and start it. However, just recycling the app pool after the change did not work. I had to stop the site and restart it before 32 bit ghostscriptsharp started working.

IIS > application pool > {website} and right click > Advanced Settings > Enable 32-bit Applications = True.
Answer: I've solved the same problem in my project in Visual Studio 2013 by checking the option Project->Properties->Build Platform target: Prefer 32-bit (if Platform target is set to Any CPU)
Answer: Under the team city build step for xunit there is, under advanced options, a .NET Runtime, with a dropdown for platform (which is normally hidden). This defaults to Any CPU/MSIL which runs xunit.console.exe which is 64 bit. If you change it to x86 it'll use xunit.console.x86.exe which will succeed.


How do I enable authentication for an Office add-in?

Question: I'm working on an Excel add-in that enables users to post data to a database.  That same database is also part of an ASP.NET website and has Membership Provider tables.  What I'd like to do is integrate the Excel add-in with the authentication for the website so that I can associate the data with the user from whom it came.  The problem I'm solving is one of attribution, not security.  So I'm open to other possible solutions that do not involve the use of a username and password.  For example, I've considered giving each installation of the add-in a guid that gets registered with the database when the program is initially installed.  I don't know if this is a good solution.  And I don't know where/how I would persist the guid locally on each machine.  My gut tells me the simplest solution is to somehow tap into the existing ASP.NET Membership Provider for the website since the website and add-in share a database.  If it's possible to do that, please explain how.  If not, or if you can propose a better solution, please explain what that solution is and how it would work.
Answer: Maybe this post helps: WCF, ASP.NET Membership Provider and Authentication Service. It describes that you can extract the cookie out of a wcf Auth call and reuse it
Edit: Another URL you might have a look at: http://galratner.com/blogs/net/archive/2011/01/25/forms-authentication-with-client-application-services.aspx


designing a circuit to energize a 5hp motor when current is sensed to include a time delay (delay on release)

Question: I am designing a circuit that would energize a 5hp motor(dust collector) when any of several woodworking machines are energized and would include a time delay(delay on release).
I would like to use a current sensing device on one of the 230V legs of the feed line to a sub panel. This would then energize a contactor which would energize the dust collector. I would also like to have the collector run an additional 15s before de-energizing.
The dust collector(5HP) requires a 1 PH, 30amp circuit.
I have researched and found many options but none specific to my needs. Basically, what I want is that when I turn on one of several(8) machines in my wood shop, that a 5hp dust collector is energized and will continue to run 15s longer and then shut off. All the machines will be in the sub panel and the feed for the dust collector will be fed from a different panel (not subject to the current sensing device) I believe all the parts to do this are available, but can't seem to find them.
Any help, would be much appreciated.
Comment: Something like this? http://wiki.diyfaq.org.uk/index.php?title=Current_activated_switch (be aware if you think this is what you'd like to try this schematic is bad!!!....Tell me and I'll offer some changes to it. If you don't want to build your own there are plenty of Current activated switches that use current transformers: http://www.ebay.com/sch/i.html?_nkw=current+sensing+switch  ....you just use the relay contacts to turn on your external timer
Comment: Btw, are you sure your dust collector is 5HP at 30A/120VAC?  NEC table 430.248 says that a 5HP 120VAC motor pulls 56A at full load...
Comment: My fail to mention, 5hp/230V
Answer: You're on the right track -- time to DIY an industrial control panel
The requisite parts for this aren't too terribly hard to find if you know where to look.  You'll need a:

suitable delay-OFF relay (the Macromatic TE-8816U is relatively cheap, UL listed, and rather versatile)
motor contactor rated for 5HP @ 240VAC 1ph with a 24VAC coil (the Square-D 8910DPA22V14 will do the trick, although you may be able to find a used-but-serviceable one cheaper)
current sensing switch (such as a Functional Devices RIBXKTA)
standard 240VAC to 24VAC HVAC control transformer (you can get this anywhere HVAC supplies can be found)
suitable wire for inside the control panel (I'd just use 14AWG THHN for the control circuits within the panel with the wire to the current sensor being 14/2 NM, while the existing wire for the dust collector circuit can be reused)
NEMA enclosure and length of standard DIN rail to hold it together (you can get these at any electrical supply house)

Electrically speaking, what you're dealing with looks like this:

simulate this circuit – Schematic created using CircuitLab
In it, XFMR1 is the control transformer with its primary connected to the L1 and L2 for the dust collector circuit, and SW1/R1 represent the current sensing switch as there's no current controlled switch part in CircuitLab -- one end of it goes to the same end of the 24VAC transformer as A1.  RLY1 is the time delay relay with A1 connected to one end of the 24VAC secondary, S connected to one end of SW1, A2 to the other end of the 24VAC secondary, 15 to the same end of the 24VAC supply as A1, and 18 connected to the coil of RLY2.  Set RLY1 to delay-off (function code D on the TE-8816U) and for the time delay of your choice.
RLY2, in turn, is the contactor -- the other coil end on RLY2 (silver terminals btw) goes to the same end of the transformer as the A2 terminal on the time delay relay, while the contact terminals (brass terminals) connect in line with both legs of the 240V circuit to the dust collector.  SW2 and SW3 represent the existing breakers, with SW2 being the breaker for the dust collector and SW3 being the breaker for the feeder to the rest-of-the-shop subpanel.
Mechanically speaking, the current sensor can live clamped around one leg of the feeder in the subpanel for the shop tools, while the transformer and the contactor can be mounted to the back of the NEMA enclosure with screws.  The time delay relay chosen goes on a DIN rail, which also screws to the back of the NEMA enclosure.  The existing cables for the dust collector can simply run into the NEMA box, while the cable connecting the current switch to the rest of the stuff can be 14-2 NM (it's a bit overkill, but hey! we don't really care if this is a Class 1 or a class 2 control circuit).
As to explaining this to the electrical inspector, it's a simple example of an industrial control panel under NEC Article 409 -- you have a power circuit (the dust collector), a control circuit (the loop running out to the current-switch), and control devices (contactor, time-delay relay, and transformer), all wrapped up in a neat box.  Article 409 of the NEC expressly allows industrial control panels to rely on the upstream branch circuit protection as ours does here and also provides for the time-honored tradition of field-fabricated control panels.
Of course, if you feel one bit uncomfortable putting this together yourself, this is something that shouldn't pose a problem to put together for any electrician with industrial controls experience.
Comment: ThreePhaseEel@peter Wow, This is just what I was looking for. Thanks so much for taking the time to write this out. I don't see any problem doing this myself and you have made it so easy with all the information provided.


Bottleneck effect

Question: Is it true that animals that faced a severe bottleneck will have genetic deficiency for a long time? Does it mean they will all look the same for a long time?
Answer: A population bottleneck (see also founder effect), by definition is an event of sudden reduction of genetic diversity due to a sudden reduction in population size. Of course, such reduction of genetic diversity is not restricted to animals (unlike you seem to suggest) but to any population of living creatures.
Given that part of the phenotypic variance is caused by genetic variance, it means that after a bottleneck, phenotypic variance will be lower after the bottleneck than before the bottleneck indeed. However, a bottleneck might be coupled with a environmental change which could change the genetic variance in itself and the above might not be true anymore (see this post for an introduction to quantitative genetics).
Because, deleterious alleles tend to be recessive, a reduction in genetic diversity often causes a reduction in mean fitness. In humans, cases of founder effects have been shown to be associated with an increase in recessive genetic disease such as observed in Quebecois or in Amish.
The time needed to restore the genetic diversity very much depend upon the exact demography at play, as well as the mutation rate and selection coefficients. As a rule of thumb that many population geneticists use in numerical simulations; if $N$ is the population size at equilibrium (after bottleneck), then $10 \cdot N$ generations is enough to restore a good genetic diversity.

Bottleneck effect


Ubuntu 14.04.1-desktop-i386.iso will not boot

Question: I have an old XP laptop that I want to refresh by using Linux.
Downloaded ubuntu-14.04.1-desktop-i386.iso and burnt onto DVD as an image, not just copied the iso file.  Changed the boot order to boot from DVD first. The machine tries to read the DVD for a while, but gave up and bootes Windows XP from the HDD.
I checked the MD5 and it's correct.
The DVD is not readable in Windows Xp - should it be?
I have tried 2 different DVD burners, CDburnerXp and InfraRecorder, each time choosing to burn image.  I have tried booting both on a Dell Dimension desktop and a Toshiba Equium laptop. The same result each time.  Cannot try USB as the machines do not support USB boot.
Any ideas?
Answer: Yes the DVD should be readable in Windows. It should contain several files and folders. You should check the CD/DVD in an other computer. If it can not be opened there as well, need to create an other one. If you can read the disk on the other computer you might have a technical problem with the CD/DVD drive.


Music & Focus During Writing

Question: I hate listening to silence while I write, so I usually end up listening to music, but then I lose my focus.  I don't really like classical or lo-fi that much and they don't help me concentrate on the task at hand.  So I usually attempt to find music that fits the mood of my writing, like emotional music for poetry or tense music for an action sequence.  But sometimes those things distract me.  Any recommendations for artists or albums that help you stay focused, and techniques to stay focused?
Comment: I don't think any two people are going to concur on what makes good noise to have around while writing.
Comment: In it's current form, this question is very opinion-based, as Ash pointed out. I believe it can be salvaged if you edit it to ask how to stay focused on your writing, and use your particular case as an example. Before doing so, search for similar questions. They might have the answers you need.
Comment: You say classical and lo-fi don't help you concentrate, but obviously the music you are selecting isn't helping you concentrate **either**, since it is distracting you. I'd suggest you listen to music in a language you don't understand; the "distraction" you feel may be your brain parsing language (the lyrics), competing with "writing" which is **also** a function of language, internal listening and parsing of language. What you need is music without lyrics (instrumentals), or with lyrics you cannot automatically understand.
Comment: @Amadeus I think that music is distracting *per se*, because its meldoy and rhythm draw attention to themselves. Better are meaningless sounds like nature and (faraway) kid's play.
Comment: @user57423 Fair enough. Personally I write in silence and enjoy it; the only time I listen to music while writing is specifically as an imagination aid; if I have some specific kind of music in the bg of my scene that is noticed by the MC, or music is being actively enjoyed by the MC. But the OP is a teen, and teens (to me) are particularly obsessed with music as a defining theme of their social lives, I think it is helping them figure out who they are as adults. Much more so (imo) than adults with jobs, spouses and children. So I am thinking of an answer the OP can accept.
Answer: What many writers do is work in a public place: a cafe, a library, on the train. Such a place provides a background noise to relax all the senses. Personally I like libraries best, as they have a quiet working atmosphere and yet provide some non-distracting sensory input when people move as they work or walk through the shelves. But many writers like cafes, recently J. K. Rowling famously wrote Harry Potter in one.
Comment: If one doesn't have access to such a place, or would rather write in the comfort of their own home, YouTube can also provide these sounds quite readily.
Answer: This question is opinion-based, as firstly, only you can know what will work best for you, and secondly, there is very little chance that anyone will agree on what it is 'best' to listen to. All we can do is give you some options.
I myself generally write in silence, but on occasion I need to set the mood for a particular scene, and I will listen to music. What you listen to depends entirely on two things: what helps set the mood you're after, and what keeps you focused. You obviously want the music to do its job, but you also don't want it to distract you.
Experiment. Look at other music genres. I myself highly recommend listening to 'epic music', like the artists Audiomachine or Two Steps from Hell, but that is just me. My brother listens to rock music while he writes, which is something I'll never understand.
If you simply can't find any music which both sets the mood and doesn't distract you, consider sounds. There are a host of multi-hour-long videos on YouTube of nothing but crickets chirping, wind whistling, or waves crashing. You can even find the sounds of fantasy battles, crowded halls, and whales singing underwater. It's all there. Just pick the sound which works best for your writing (or better yet, is present in the scene you are writing, if you're writing fiction), and play it. (Pro tip: trying searching for 'nature sounds' followed by whatever specific sound you're after.)
If any amount of noise distracts you, there are two things you can do: Firstly, determine if the problem lies with your writing, and not what you listen to. If you're focused on the sound (or lack of sound) instead of what you are writing, it might be that what you aren't interested in what you are writing. That's a whole separate question, which I'm sure has been asked before on this site. Try searching for it if that's the case. (Another pro-tip: include 'is:question' in the search bar to limit to questions.)
Second, if you determine the problem is not with your writing, then you will have to write in silence. You say you 'hate listening to silence' while you write. Why? Figure out the reason, and you might deduce what the problem is. If you need something to set the mood, perhaps a simple picture will suffice, no sound required. If it is in fact just the simple silence which you don't like, then again, try to deduce why. Why are you focused on the silence rather than your writing? Why is it affecting you so? What can you do to counteract it?
As I said in the opening paragraph, only you can know what will work best for you. Hopefully some of this will be useful in helping you figure out what that thing is.

Music & Focus During Writing


Escape character issue in "run keyword if" in Robot Framework

Question: This script is not working as the string contains single quotes (') and double quotes (") and comparing the string is not working in this case.
${Key1}=      set variable     It\'s in \"Detailing\": The Perfect Gift
${KEY_FLAG}   run keyword if   "${Key1}"=="It\'s in \"Detailing\": The Perfect Gift"        set variable        X1
log     ${Key_FLAG}

Any solution ?
Comment: Can you please fix the formatting of the code. It's impossible to see the indentation and whitespace unless you mark up the code as code.
Answer: The condition passed to Run keyword if needs to be a valid python expression after substituting.
The easiest solution is to do one or both of the following:

use triple quotes to quote the string
use robot's ability to directly use the variable as $Key1 rather than ${Key1}

Also, it's not necessary to escape the quotes when calling Set Variable. They are harmless but make the code harder to read.
For example, the following example uses both techniques and should pass:
*** Variables ***
${KEY_FLAG}  ' and "

*** Test Cases ***
Example
    ${Key1}=  set variable  It's in "Detailing": The Perfect Gift ${KEY_FLAG}

    run keyword if  $Key1=='''It's in "Detailing": The Perfect Gift ' and "'''
    ...  pass execution  the condition is true
    fail  the condition is false


Sci-fi. A space cloud engulfs Earth. Men live underground and require a rare mineral for power

Question: A black cloud engulfs the Earth forcing men to live underground. They need a rare mineral to create the sub-space fields they use for power. A prospector discovers an underground city of lizard people with a different sub-space technology. He combines the technologies to create a new sun for Earth.
Comment: What is this? A movie, short story, book, anime...?
Comment: When you say men, do the women live above ground?
Comment: @user14111 Apparently, you deleted it immediately after answering... ?
Answer: "The Sun Maker", a novella by Jack Williamson.
ISFDB synopsis:

A mysterious anomaly enters the solar system and prevents solar energy from reaching the earth. Human civilization retreats underground to be powered by tiny solar reactions inside tiny universes of compressed space until things return to normal. A scientist discovers that gravity has also been blocked and the sun is now out of reach. His further explorations discover that a long vanished advanced reptilian civilization had followed a similar path when a similar anomaly led to the extinction of the dinosaurs, and their superior technology can be adapted to save mankind.

The excerpts below are from the 1958 paperback anthology Race to the Stars edited by Leo Margulies and Oscar J. Friend.
A black cloud engulfs the Earth forcing men to live underground.

Uncannily the purple dusk had dimmed into awful night. The Sun had gone, and with it had gone the Moon and the stars. The sky remained utterly black, for no dawn could come while the Blot kept its grip. Earth lost its precious heat. The cold of outer space dropped its deathly hand upon dark seas, hills and plains. Men had no choice but furious burrowing into the Earth.
Mountains of rubble grew above the wastes of new snow. ME-driven tractors lumbered through the night, dragging sledge-trains laden with refugees and their goods. Men retreated in perfect order, at first. But then the orderly retreat degenerated to a frantic rout, for disaster struck ruthlessly.
Gravitation thrust in a vicious twist through the Fault. The oceans and the frigid air leaped in weird convulsions. The uneasy planet quivered—until the frightful blizzards whipped down. Tidal waves rolled far inland, and froze to plains of ice. The Earth shook, and volcanic fire luridly lit the night.
Not even one quarter the world's savagely battered, terrified survivors were moved safely below. Even those who reached the refuges were decimated when the sea broke with fearful force through the shuddering rocks. Then quake and eruption slashed their pitiful numbers still further.
But the race lived, for children were born in the refuges.

They need a rare mineral . . .

"Output six-twenty!" He juggled a key, incredulously. "Input only five-ninety. That means thirty horsepower of free energy—power to save mankind!" He clutched Cord's arm. "Where did you get that crystal?"
"The Marudu region in Borneo," Cord told him. "There'th jutht a pocket of the stuff in an odd little crater. Geologithts believe it'th a meteoric depothit. Oneth I wath preth agent for a conthern dealing in gold mineth in Borneo. When I found out the propertieth were thalted, they paid me off with a worthleth claim."
"Worthless?" echoed Drake. "It's worth everything!"
Cord hastily deeded the deposit to the Emergency Council.
"It wath worth nothing to me," he said modestly. "And thith ith a time when every man mutht do hith share."
A flight of American bombing planes carried Drake's mining expedition to Borneo. In a short time they brought back the first heavy bags of the precious greenish crystals.

. . . to create the sub-space fields they use for power.

"Those little coils create a sub-space about the metal head," Drake told him. "They warp space itself to form a tiny sphere—in effect, a tiny universe—strong enough to withstand unthinkable pressure and millions of degrees of heat.
"The solar reaction takes place inside. Atoms are stripped of orbital electrons, mangled, broken down into energy, very much as in the actual Sun." He pointed at a quivering needle. "There's the output. Nearly six hundred horsepower."

A prospector discovers an underground city of lizard people . . .
Jeremy Cord is exploring for a new deposit of the rare power isotope "cereum 148" when he discovers an alien underground city:

Cautiously he peered through the passage—
He gaped into a blue-walled tunnel!
The amazing tube was larger than those that men had made. Twenty feet wide, the blue, porcelainlike lining was something that seemed as hard as durite. The soft illumination came from a bare, dim-glowing wire strung along the arched roof. [. . .] Questions clamored in him. Were the builders of this passage men—or perhaps some race of monstrous troglodytes that had never seen the lost Sun? Might the strange science witnessed here aid struggling mankind? Or did it threaten only a more certain doom?
[. . . .]
Their hairless bodies were naked, except for a sort of light harness to which odd little implements and pouches were clipped. Their smooth skins had a polished luster, as if they were covered with invisibly fine scales, Jeremy thought. They were mottled with bright hues of red, green and orange splashed haphazardly all over them.
But there was something else, something that made Jeremy shudder.
A stronger odor reached him, forced up his nostrils by the wind rushing around the vehicle. It was the same mustiness he had distastefully noticed before. For some reason, it sent an eerie prickling along his spine. It made him stare, shuddering, at the slow, gliding grace of one purple-and-green creature moving through the car.
These things were snaky—reptilian!

. . . with a different sub-space technology. He combines the technologies to create a new sun for Earth.

"Once," he said quietly, "I dreamed of making a new Sun."
Gay's dark eyes stared at him, unbelieving, terrified for his sanity.
"Don't hope for too much," Jeremy grinned. "But I'm going to try."
"Jerry!" Her trembling fingers caught his arm. "How?"
"I know how the saurians made their cavern Suns, or I think I do," he told her. "And there's matter enough in the old Moon—if it didn't get lost in the Fault!"
"A new Sun!" It was half question, half protest. "That sounds almost insane!"
[. . . .]
"We'll have to build a field-projector to control the new Sun's sub-space. Probably the elements of the auxiliary converter can be rewired to do the trick. And still the bigger job is left. We'll have to build an atomic bomb, to start the solar reaction, and carry it out to the Moon. If we can find the Moon in the dark, that is, on whatever new orbit the Fault has given it!"
[. . . .]
"Mr. First Regent. Gentlemen!" Jeremy's voice was a mere halting croak. "I've news for you. The Fault has passed. Outside, a new Sun is shining. Already the air is rising."


Prototype JavaScript Ajax FIFO Queue

Question: I am writing a small web-based IM client, it works well however I am running into some issues.
The system is written with PHP and JavaScript, it uses authentication ID's which it puts on each page, when an ajax request is made it must include this authentication id. It's not a perfect system but I have no ability to change it.
the IM system is using periodic executors (Prototype library), there are 2 periodic calls it makes:

update contact list, since this doesnt change very often it gets updated every 30 seconds or so
check for new messages, this happens ever 5 seconds right now.

The issue is:
Periodic executor makes call to update contact list, uses the authentication id, the PHP side picks up that request, checks the authentication id, performs the task, returns the new list in JSON format along with a new authentication id to be used on subsequent requests.
If a check for new messages (timed) or sending of a message (not timed) occurs before the first function returns, the authentication id has not yet been updated. Therefore it uses the same authentication id as the previous request. That authentication id gets rejected by the PHP side of the system.
I'm looking for a way to serialize the requests into a FIFO style queue, meaning that any ajax request that's made (check messages, check contacts, send message) can be pushed onto the queue and will execute as soon as the previous ajax call is complete (100% done and returned)
Answer: It may be a good idea to create a request queue class and use that to handle your ajax requests.  I'm sure you can find something made already by googling but here's one I found that should work for you:
http://positionabsolute.net/blog/2007/04/ajax-request-queue.php
You would have to replace all your ajax calls to use that new function but modifying a class like this should solve your problem.

Prototype JavaScript Ajax FIFO Queue