Voltaire Quotations

June 17, 2007

Appreciation: Voltaire Quotations
Appreciation is a wonderful thing. It makes what is excellent in others belong to us as well.

Determination: Voltaire Quotations
Chance is a word void of sense; nothing can exist without a cause.

Responsibility: Voltaire Quotations
Each player must accept the cards that life deals him or her. But once in hand one must decide how to play the cards in order to win the game.

Belief: Voltaire Quotations
Faith consists in believing when it is beyond the power of reason to believe.

Friendship: Voltaire Quotations
I don’t agree with a word you say, but I will defend to the death your right to say it.

Adventure: Voltaire Quotations
If we do not find anything very pleasant, at least we shall find something new.

Integrity: Voltaire Quotations
Judge a man by his questions rather than his answers.

Love: Voltaire Quotations
Love is a canvas furnished by nature and embroidered by imagination.

Kindness: Voltaire Quotations
Love truth, and pardon error.

Health: Voltaire Quotations
Rest is a good thing, but boredom is its brother.

Courage: Voltaire Quotations
Stand upright, speak thy thoughts, declare the truth thou hast, that all may share; be bold, proclaim it everywhere.


GPS and relativity theory

June 17, 2007

What the Global Positioning System Tells Us about Relativity
Tom Van Flandern, Univ. of Maryland & Meta Research
From the book ‘Open Questions in Relativistic Physics’ (pp. 81-90), edited by Franco Selleri, published by Apeiron, Montreal (199 8)

**************************************

1. What is the GPS?

The Global Positioning System (GPS) consists of a network of 24 satellites in roughly 12-hour orbits, each carrying atomic clocks on board. The orbital radius of the satellites is about four Earth-radii (26,600 km). The orbits are nearly circular, with a typical eccentricity of less than 1%. Orbital inclination to the Earth’s equator is typically 55 degrees. The satellites have orbital speeds of about 3.9 km/s in a frame centered on the Earth and not rotating with respect to the distant stars. Nominally, the satellites occupy one of six equally spaced orbital planes. Four of them occupy each plane, spread at roughly 90-degree intervals around the Earth in that plane. The precise orbital periods of the satellites are close to 11 hours and 58 minutes so that the ground tracks of the satellites repeat day after day, because the Earth makes one rotation with respect to the stars about every 23 hours and 56 minutes. (Four extra minutes are required for a point on the Earth to return to a position directly under the Sun because the Sun advances about one degree per day with respect to the stars.)

The on-board atomic clocks are good to about 1 nanosecond (ns) in epoch, and about 1 ns/day in rate. Since the speed of light is about one foot per nanosecond, the system is capable of amazing accuracy in locating anything on Earth or in the near-Earth environment. For example, if the satellite clocks are fully synchronized with ground atomic clocks, and we know the time when a signal is sent from a satellite, then the time delay for that signal to reach a ground receiver immediately reveals the distance (to a potential accuracy of about one foot) between satellite and ground receiver. By using four satellites to triangulate and determine clock corrections, the position of a receiver at an unknown location can be determined with comparable precision.

2. What relativistic effects on GPS atomic clocks might be seen?

General Relativity (GR) predicts that clocks in a stronger gravitational field will tick at a slower rate. Special Relativity (SR) predicts that moving clocks will appear to tick slower than non-moving ones. Remarkably, these two effects cancel each other for clocks located at sea level anywhere on Earth. So if a hypothetical clock at Earth’s north or south pole is used as a reference, a clock at Earth’s equator would tick slower because of its relative speed due to Earth’s spin, but faster because of its greater distance from Earth’s center of mass due to the flattening of the Earth. Because Earth’s spin rate determines its shape, these two effects are not independent, and it is therefore not entirely coincidental that the effects exactly cancel. The cancellation is not general, however. Clocks at any altitude above sea level do tick faster than clocks at sea level; and clocks on rocket sleds do tick slower than stationary clocks.

For GPS satellites, GR predicts that the atomic clocks at GPS orbital altitudes will tick faster by about 45,900 ns/day because they are in a weaker gravitational field than atomic clocks on Earth’s surface. Special Relativity (SR) predicts that atomic clocks moving at GPS orbital speeds will tick slower by about 7,200 ns/day than stationary ground clocks. Rather than have clocks with such large rate differences, the satellite clocks are reset in rate before launch to compensate for these predicted effects. In practice, simply changing the international definition of the number of atomic transitions that constitute a one-second interval accomplishes this goal. Therefore, we observe the clocks running at their offset rates before launch. Then we observe the clocks running after launch and compare their rates with the predictions of relativity, both GR and SR combined. If the predictions are right, we should see the clocks run again at nearly the same rates as ground clocks, despite using an offset definition for the length of one second.

We note that this post-launch rate comparison is independent of frame or observer considerations. Since the ground tracks repeat day after day, the distance from satellite to ground remains essentially unchanged. Yet, any rate difference between satellite and ground clocks continues to build a larger and larger time reading difference as the days go by. Therefore, no confusion can arise due to the satellite clock being located some distance away from the ground clock when we compare their time readings. One only needs to wait long enough and the time difference due to a rate discrepancy will eventually exceed any imaginable error source or ambiguity in such comparisons.

3. Does the GPS confirm the clock rate changes predicted by GR and SR?

The highest precision GPS receiver data is collected continuously in two frequencies at 1.5-second intervals from all GPS satellites at five Air Force monitor stations distributed around the Earth. An in-depth discussion of the data and its analysis is beyond the scope of this paper. [1] This data shows that the on-board atomic clock rates do indeed agree with ground clock rates to the predicted extent, which varies slightly from nominal because the orbit actually achieved is not always precisely as planned. The accuracy of this comparison is limited mainly because atomic clocks change frequencies by small, semi-random amounts (of order 1 ns/day) at unpredictable times for reasons that are not fully understood. As a consequence, the long-term accuracy of these clocks is poorer than their short-term accuracy.

Therefore, we can assert with confidence that the predictions of relativity are confirmed to high accuracy over time periods of many days. In ground solutions with the data, new corrections for epoch offset and rate for each clock are determined anew typically once each day. These corrections differ by a few ns and a few ns/day, respectively, from similar corrections for other days in the same week. At much later times, unpredictable errors in the clocks build up with time squared, so comparisons with predictions become increasingly uncertain unless these empirical corrections are used. But within each day, the clock corrections remain stable to within about 1 ns in epoch and 1 ns/day in rate.

The initial clock rate errors just after launch would give the best indication of the absolute accuracy of the predictions of relativity because they would be least affected by accumulated random errors in clock rates over time. Unfortunately, these have not yet been studied. But if the errors were significantly greater than the rate variance among the 24 GPS satellites, which is less than 200 ns/day under normal circumstances, it would have been noticed even without a study. So we can state that the clock rate effect predicted by GR is confirmed to within no worse than ±200 / 45,900 or about 0.7%, and that predicted by SR is confirmed to within ±200 / 7,200 or about 3%. This is a very conservative estimate. In an actual study, most of that maximum 200 ns/day variance would almost certainly be accounted for by differences between planned and achieved orbits, and the predictions of relativity would be confirmed with much better precision.

12-hour variations (the orbital period) in clock rates due to small changes in the orbital altitude and speed of the satellites, caused by the small eccentricity of their orbits, are also detected. These are observed to be of the expected size for each GPS satellite’s own orbit. For example, for an orbital eccentricity of 0.01, the amplitude of this 12-hour term is 23 ns. Contributions from both altitude and speed changes, while not separable, are clearly both present because the observed amplitude equals the sum of the two predicted amplitudes.

4. Is the speed of light constant?

Other studies using GPS data have placed far more stringent limits than we will here. But our goal here is not to set the most stringent limit on possible variations in the speed of light, but rather to determine what the maximum possible variation might be that can remain consistent with the data. The GPS operates by sending atomic clock signals from orbital altitudes to the ground. This takes a mere 0.08 seconds from our human perspective, but a very long (although equivalent) 80,000,000 ns from the perspective of an atomic clock. Because of this precision, the system has shown that the speed of radio signals (identical to the “speed of light”) is the same from all satellites to all ground stations at all times of day and in all directions to within ±12 meters per second (m/s). The same numerical value for the speed of light works equally well at any season of the year.

Technical note: Measuring the one-way speed of light requires two clocks, one on each end of the path. If the separation of the clocks is known, then the separation divided by the time interval between transmission and reception is the one-way speed of the signal. But measuring the time interval requires synchronizing the clocks first. If the Einstein prescription for synchronizing clocks is used, then the measured speed must be the speed of light by definition of the Einstein prescription (which assumes the speed of light is the same in all inertial frames). If some other non-equivalent synchronization method is used, then the measured speed of the signal will not be the speed of light. Clearly, the measured signal speed and the synchronization prescription are intimately connected.

Our result here merely points out that the measured speed does not change as a function of time of day or direction of the satellite in its orbit when the clock synchronization correction is kept unchanged over one day. As for seasonal variations, all satellite clocks are “steered” to keep close to the U.S. Naval Observatory Master Clock so as to prevent excessive build up of errors from random rate changes over long time periods. So we cannot make direct comparisons between different seasons, but merely note that the same value of the speed of light works equally well in any season.

5. What is a “GPS clock”?

Cesium atomic clocks operate by counting hyperfine transitions of cesium atoms that occur roughly 10 billion times per second at a very stable frequency provided by nature. The precise number of such transitions was originally calibrated by astronomers, and is now adopted by international agreement as the definition of one atomic second.

GPS atomic clocks in orbit would run at rates quite different from ground clocks if allowed to do so, and this would complicate usage of the system. So the counter of hyperfine cesium transitions (or the corresponding phenomenon in the case of rubidium atomic clocks) is reset on the ground before launch so that, once in orbit, the clocks will tick off whole seconds at the same average rate as ground clocks. GPS clocks are therefore seen to run slow compared to ground clocks before launch, but run at the same rate as ground clocks after launch when at the correct orbital altitude.

We will refer to a clock whose natural ticking frequency has been pre-corrected in this way as a “GPS clock”. This will help in the discussion of SR effects such as the twins paradox. A GPS clock is pre-corrected for relativistic rate changes so that it continues to tick at the same rate as Earth clocks even when traveling at high relative speeds. So a GPS clock carried by the traveling twin can be used to determine local time in the Earth’s frame at any point along the journey — a great advantage for resolving paradoxes.

6. Is acceleration an essential part of resolving the “twins paradox”?

If the traveling twin carries both a natural clock and a GPS clock on board his spacecraft, he can observe the effects predicted by SR without need of any acceleration in the usual twins paradox. That is as it should be because cyclotron experiments have shown that, even at accelerations of 1019 g (g = acceleration of gravity at the Earth’s surface), clock rates are unaffected. Only speed affects clock rates, but not acceleration per se.

Suppose that the traveling twin is born as his spaceship passes by Earth and both of his on-board clocks are synchronized with clocks on Earth. The natural on-board clock ticks more slowly than the GPS on-board clock because the rates differ by the factor gamma that SR predicts for the slowing of all clocks with relative speed v. [gamma = 1/sqrt(1-v2/c2)] But everywhere the traveling twin goes, as long as his speed relative to the Earth frame does not change, his GPS clock will give identical readings to any Earth-synchronized Earth-frame clock he passes along the way. And his natural clock will read less time elapsed since passing Earth by the factor gamma. His biological processes (including aging), which presumably operate at rates comparable to the ticking of the natural clock, are also slowed by the factor gamma.

Since this rate difference is true at every instant of the journey beginning with the first, there are no surprises if the traveling twin executes a turn-around without change of speed and returns to Earth. He will find on journey’s completion what he has observed at every step of the journey: His natural clock and his biological age are slower and younger by the factor gamma than that of his Earth-frame counterparts everywhere along his journey, including at its completion. The same would have been true if he had not turned around, but merely continued ahead. He would be younger than his peers on any planet encountered who claim to have been born at the same time that the traveler was born (i.e., when he passed Earth) according to their Earth-frame perspective.

Clearly, acceleration or the lack thereof has no bearing on the observed results. If acceleration occurs, it is merely to allow a more convenient comparison of clocks by returning to the starting point. But since the traveler can never return to the same point in space-time merely by returning to the same point in space, the results of a round-trip comparison are no different in kind from those made anywhere along the journey. The traveler always judges that his own aging is slower than that in any other frame with a relative motion.

Then why isn’t the traveler entitled to claim that he remained at rest and the Earth moved? The traveler is unconditionally moving with respect to the Earth frame and therefore his clocks unconditionally tick slower and he ages less as judged by anyone in the Earth frame. However, if the traveler makes the same judgment, the result will depend on whether he values his natural clock or his GPS clock as the better timekeeper. If he takes readings on the GPS clock to represent Earth time, his inferences will always agree with those of Earth-frame observers. If he instead uses the results of the exchange of light signals to make inferences of what time it is at distant locations, he will conclude that the Earth-bound twin is aging less than himself because of their relative motion. But on the occasion of any acceleration his spaceship undergoes, the traveler will infer a discontinuity in the age of his Earth-bound counterpart, which can be either forward or backward in time depending on which direction the traveler accelerates. At the end of any round trip after any number of such accelerations, the traveler and Earth-bound twins will always agree about who should have aged more.

7. Does the behavior of GPS clocks confirm Einstein SR?

To answer this, we must make a distinction between Einstein SR and Lorentzian Relativity (LR). Both Lorentz in 1904 and Einstein in 1905 chose to adopt the principle of relativity discussed by Poincare in 1899, which apparently originated some years earlier in the 19th century. Lorentz also popularized the famous transformations that bear his name, later used by Einstein. However, Lorentz’s relativity theory assumed an aether, a preferred frame, and a universal time. Einstein did away with the need for these. But it is important to realize that none of the 11 independent experiments said to confirm the validity of SR experimentally distinguish it from LR — at least not in Einstein’s favor.

Experiment Description Year
Bradley Discovery of aberration of light 1728
Fresnel Light suffers drag from the local medium 1817
Airy Aberration independent of the local medium 1871
Michelson-Morley Speed of light independent of Earth’s orbital motion 1881
De Sitter Speed of light independent of speed of source 1913
Sagnac Speed of light depends on rotational speed 1913
Kennedy-Thorndike Measured time also affected by motion 1932
Ives-Stilwell Ions radiate at frequencies affected by their motion 1941
Frisch-Smith Radioactive decay of mesons is slowed by motion 1963
Hafele-Keating Atomic clock changes depend on Earth’s rotation 1972
GPS Clocks in all frames continuously synchronized 1997
Table 1. Independent experiments bearing on Special Relativity
Several of the experiments bearing on various aspects of SR (see Table 1) gave results consistent with both SR and LR. But Sagnac in 1913, Michelson following the Michelson-Gale confirmation of the Sagnac effect for the rotating Earth in 1925 (not an independent experiment, so not listed in Table 1), and Ives in 1941, all claimed at the time they published that their results were experimental contradictions of Einstein SR because they implied a preferred frame. In hindsight, it can be argued that most of the experiments contain some aspect that makes their interpretation simpler in a preferred frame, consistent with LR. In modern discussions of LR, the preferred frame is not universal, but rather coincides with the local gravity field. Yet, none of these experiments is impossible for SR to explain.

For example, Fresnel showed that light is partially dragged by the local medium, which suggests a certain amount of frame-dependence. Airy found that aberration did not change for a water-filled telescope, and therefore did not arise in the telescope tube. That suggests it must arise elsewhere locally. Michelson-Morley expected the Earth’s velocity to affect the speed of light because it affected aberration. But it didn’t. If these experimenters had realized that the aether was not a single entity but changed with the local gravity field, they would not have been surprised. It might have helped their understanding to realize that Earth’s own Moon does not experience aberration as the distant stars do, but only the much smaller amount appropriate to its small speed through the Earth’s gravity field.

Another clue came for De Sitter in 1913, elaborated by Phipps [3], both of whom reminded us that double star components with high relative velocities nonetheless both have the same stellar aberration. This meant that the relative velocity between a light source and an observer was not relevant to stellar aberration. Rather, the relative velocity between local and distant gravity fields determined aberration. In the same year, Sagnac showed non-null results for a Michelson-Morley experiment done on a rotating platform. In the simplest interpretation, this demonstrated that speeds relative to the local gravity field do add to or subtract from the speed of light in the experiment, since the fringes do shift. The Michelson-Gale experiment in 1925 confirmed that the Sagnac result holds true when the rotating platform is the entire Earth’s surface.

When Ives and Stilwell showed in 1941 that the frequencies of radiating ions depended on their motion, Ives thought he had disposed once and for all of the notion that only relative velocity mattered. After all, the ions emitted at a particular frequency no matter what frame they were observed from. He was unmoved by arguments to show that SR could explain this too because it seemed clear that nature still needed a preferred frame, the motion relative to which would determine the ion frequencies. Otherwise, how would the ions know how often to radiate? Answers to Ives dilemma exist, but not with a comparable simplicity.

Richard Keating was surprised in 1972 that two atomic clocks traveling in opposite directions around the world, when compared with a third that stayed at home, showed slowing that depended on their absolute speed through space — the vector sum of the Earth’s rotation and airplane speeds — rather on the relative velocities of the clocks. But he quickly accepted that astronomers always use the Earth’s frame for local phenomena, and the solar system barycentric frame for other planetary system phenomena, to get results that agreed with the predictions of relativity. Being unaware of LR, he did not question the interpretation at any deeper level.

Experiment Type Notes on Reciprocity
Bradley Aberration Moon exempt
Fresnel Fresnel drag Existence of aether
Airy Existence of aether Water in ‘scope ignored
Michelson-Morley No universal aether Aether “entrained”?
De Sitter c independent of source Double star aberration
Sagnac c depends on rotation Local gravity field non-rotating
Kennedy-Thorndike Clocks slow Motion w.r.t. local gravity field
Ives-Stilwell Ions slow “
Frisch-Smith Mesons live longer “
Hafele-Keating Clocks depend on rotation Preferred frame indicated
GPS Universal synchronization Preferred frame = local gravity
Table 2. Independent experiments bearing on Special Relativity
Table 2 summarizes what the various experiments have to say about a preferred frame. These experiments confirm the original aether-formulated relativity principle to high precision. However, the issue of the need for a preferred frame in nature is, charitably, not yet settled. Certainly, experts do not yet agree on its resolution. But of those who have compared both LR and SR to the experiments, most seem convinced that LR more easily explains the behavior of nature.

8. How does the resolution of the “twins paradox” compare in LR and SR?

In LR, the answer is simple: The Earth frame at the outset, and the dominant local gravity field in general, constitutes a preferred frame. So the high-speed traveler always comes back younger, and there is no true reciprocity of perspective for his or other frames.

In SR, the answer is not so simple; yet an explanation exists. The reciprocity of frames required by SR when Einstein assumed that all inertial frames were equivalent introduces a second effect on “time” in nature that is not reflected in clock rates alone. We might call this effect “time slippage” so we can discuss it. Time slippage represents the difference in time for any remote event as judged by observers (even momentarily coincident ones) in different inertial frames.

For example, we would argue that, if it is 9/1998 here and now, it is also 9/1998 “now” at Alpha Centauri. But an observer here and now with a sufficiently high relative motion (say, 99% of c; gamma = 7) might judge that it is 9/1994 at Alpha Centauri “now” (meaning that he just left there one month of Earth time ago, and it was 8/1994 then). Or he might judge that it is 9/2002 at Alpha Centauri “now” (meaning that he will arrive there in one month of Earth-elapsed time, and will find the time to be 10/2002). These differences of opinion about what time it is at remote locations are illustrations of time slippage effects that appear only in Einstein SR to preserve the frame independence of its predictions.

So as a traveler passes Earth in 8/1994 at a speed of 0.99c , time slippage effects begin to build up. Seven months later by his natural clock, the traveler arrives at Alpha Centauri. His own GPS clock shows four years of elapsed time, and indeed Alpha Centauri residents who think they are calendar-synchronized with Earth agree that the twin arrives in 9/1998. But the traveler is convinced by Einstein SR that only one month of Earth time has elapsed since he passed Earth and noted the time as 8/1994. The traveler, upon arriving at Alpha Centauri, claims that the time is “now” 9/1994 on Earth. Alpha Centauri residents claim it is “now” 9/1998 on Earth. The difference is the time slippage predicted by SR.

If the traveler orbits Alpha Centauri at a speed of 0.99 c, then whenever he is headed in the direction of Earth his opinion changes to Earth time “now” is 9/2002. And whenever he is again headed away from Earth, Earth time is once again 9/1994. Earth time “now” changes continually, according to SR, because of these time slippage effects needed to retain frame reciprocity. Earth residents — even the ones who died in 1998 — are oblivious to their repeated passages into the future and past of the traveling twin, with concomitant deaths and resurrections.

So when the traveler finally does return, he will indeed find that time on Earth is 10/2002, just as his GPS clock shows. He accounts for this as two months of elapsed time on Earth’s slow-running clocks during his own 14-month (by his natural clock) journey, plus 8 years of “time slippage” when the traveler changed frames. There is no logical or mathematical inconsistency in this resolution, which is why SR remains a viable theory today.

We are, of course, free to question whether or not this mathematical theory retains a valid basis under the principles of causality. For those of us who answer “yes”, LR is unnecessary, and inelegant because it depends on a preferred frame. For those of us who answer “no”, LR is then the better descriptor of nature, requiring the sacrifice of symmetry (“covariance”) to retain causality.

9. What physical consequences arise from the differences between LR and SR?

In SR, speed causes changes in time and space themselves, not just in clocks and rulers. Rest mass remains unchanged, but resistance to acceleration increases toward infinity as speed approaches c. There is no absolute time or space in the universe. The time at remote locations depends on what frame one observes from. All frames are equivalent.

In LR, speed relative to the preferred frame (the local gravity field) causes clocks to slow and rulers to contract. Electromagnetic-based forces become increasingly less efficient with increasing speed relative to the preferred frame, and approach zero efficiency as speed approaches c. There are natural, physical reasons why these things should be so. [2] The frame of the local gravity field acts as a preferred frame. Universal time and remote simultaneity exist.

The single most important difference is that, in SR, nothing can propagate faster than c in forward time. In LR, electromagnetic-based forces and clocks would cease to operate at speeds of c or higher. But no problem in principle exists in attaining any speed whatever in forward time using forces such as gravity that retain their efficiency at high speeds.

[1] Alley, C.O. and Van Flandern, T. (1998). “Absolute GPS to Better Than One Meter”, preprint not yet submitted for publication.

[2] Van Flandern, T. (1993). Dark Matter, Missing Planets and New Comets, North Atlantic Books, Berkeley, CA.

[3] Phipps, T. (1989). “Relativity and Aberration”, Amer.J.Phys. 57, 549-551.


Notes about “directions” in software development

June 17, 2007
  • When doing software development the safest approach is to start the first with vertical design and development (up-down fits better agila and use-case driven development) and then elaborate on horizontal tiers as required.
  • When doing error handling in an application the best approach is from outside to inside. The first have generic error handling wrapping around topmost process and go inside process routines and wrap and handle as reqiuired.

On arguments

June 17, 2007

The great British philosopher John Stuart Mill wrote in On Liberty,
“Strange it is, that men should admit the validity of the arguments for free discussion,
but object to their being ‘pushed to an extreme’; not seeing that unless the reasons
are good for an extreme case, they are not good for any case.”


The Physics of Gluttony

June 17, 2007

http://www.technologyreview.com/Energy/13909/ 

November 12, 2004

The Physics of Gluttony

The obesity epidemic has a simple solution. If you want to lose weight, either eat less, or breathe more.

By Richard A. Muller

Physics can sometimes cut through the mess of complex problems with a simple conservation law. A year ago, in my column “The Physics Diet,” I applied conservation of energy to the problem of obesity. I argued that exercise burns so few calories that it cannot be a major way of losing weight.

But many people I have spoken to believe there is another benefit to exercise: it changes your metabolism. When that happens, you burn more calories naturally, and so your food doesnt turn into fat.

Let me address this issue by invoking another physics principle: conservation of mass. More specifically, let me talk about the conservation of carbon atoms. When you digest food, its carbon atoms enter your blood. Unless they are expelled from your body, they add to your weight. But here is the salient observation: the only effective way your body has to get rid of digested carbon is to combine it with oxygen to form carbon dioxide, and then expel it through your lungs. Unless you breathe out the carbon, you gain weight.

Here are some numbers, taken from books on exercise physiology. Fat, protein, and sugar all contain about 0.1 gram of carbon per food calorie consumed. So if you digest 2,000 calories of food (a typical daily diet for adults) then you take in about 200 grams of carbon. At rest, each breath exhales about 0.5 liter of air containing about 1 percent carbon, for about five milligrams per breath. After a day at 12 breaths per minute, you get rid of about 120 grams of carbon. Thats less than you ate, so youll gain weight.

But few of us spend the whole day resting. Walking increases your respiration by a factor of two to three. Running at eight kilometers per hour (five miles per hour) increases it by a factor of eight to 10. Put together a nice combination, and youll lose all the carbon you consumed, and your weight will be stable. Walking, running, and being active does increase your metabolism–the rate at which you burn calories–and it increases your breathing rate too.

The mistake people make is to think that an hour of moderate exercise will change their body chemistry enough so that theyll “burn” away the calories even when they are inactive. But unless you breathe more rapidly, the carbon will stay in your body. If you want to lose weight, eat less or breathe more. And the only effective way to breathe more is through increased activity. There is no such thing as stimulating your body into a higher resting metabolic rate.

But what about all those people who seem to eat more than we do, but stay thin? Dont they contradict my conclusion? I wondered about that too, so I started asking these people three questions: How often do you snack? Do you always finish your meals? How often do you have dessert after a meal?

My conclusion from this survey: thin people actually eat less. I’ve verified this by watching them. If they order a burger, they get it without the shake, and they leave the fries on their plate.

There are other mistaken beliefs about weight gain. The most widespread one is that eating junk food puts on pounds faster than “healthy” food. Some people have tried to sue McDonald’s as being responsible for their weight gain. In the recent award-winning documentary Super Size Me, director and star Morgan Spurlock ate nothing but junk food at McDonald’s for 30 days, to see how bad the results would be. Indeed, he gained 25 pounds, and his doctors said his health deteriorated significantly.

But was he actually testing junk food? Not really; he was testing the effects of overeating. He decided that every time he was asked if he preferred the “supersize” meal, he would say yes. He apparently knew that it was McDonald’s policy to recommend this choice to every customer, and as a result he had supersized meals for breakfast, lunch, and dinner. He was probably eating about 6,000 food calories a day–triple what his body needed. It’s not easy to do that, and Spurlock had trouble keeping it down.

In the end, Spurlock’s weight gain and poor health probably had little to do with the junkiness of the food. The same thing would have happened if he had similarly stuffed himself at a gourmet restaurant–or at a salad bar, if he heaped enough shredded cheddar over his blue cheese dressing for three meals a day.

Junk food may or may not be good for you. That depends on your cholesterol level and other factors, such as vitamin and mineral content. But for weight gain, the only thing that matters is how much you eat (specifically, how much you digest) and how much you breathe out. That’s just conservation of mass.

Should we blame McDonalds for recommending the super-sized meal? I don’t think so. In reaction to lawsuits and health concerns, the company is already phasing out super size fries and drinks. In any case, the explanation for the program’s success probably lies elsewhere. I owned a restaurant for six years, and I became very sensitive to customer complaints. Patrons really appreciate large servings. In fact, they often notice food quantity more than the quality.

What makes large servings especially dangerous is that many people find it hard to leave food on their plates; my own mom considered it a sin. (I seem to recall that some poor child in India was going to starve if I left food behind, although I never understood the logic of that argument.) I think she was reflecting her experience growing up during the Great Depression, when food was expensive and salaries were low. These days, the sin isn’t leaving food behind–it is cleaning your plate when you have been served too much.

But even if you have learned to moderate your mealtime intake, there are other hazards throughout the day. Coffee breaks, over the last two decades, have transformed into coffee and brownie and huge-chocolate-chip-cookie breaks. In recent years, nibbling has become pervasive. I have noticed that the students who take my classes at Berkeley now eat not only at meals but also between classes, during lectures, and even during exams. This is a real change, and I believe I see it in the size of many of my students. I don’t know how widespread this eating epidemic is, but my daughter lives in France, and she reports that over there it is considered rude to eat a candy bar in someone else’s presence. In the United States, eating is the chief form of instant gratification. Bored? Tired? Between tasks? Get a snack. It is the American way.

Gluttony was once considered one of the seven deadly sins. But we rarely hear that word these days. I think we need to bring it back into our everyday vocabulary. We also have to recognize that the problem is not junk food and bad metabolic rates. If we can end our epidemic of gluttony, then it will put an end to our epidemic of obesity.


Processing an SSAS 2005 cube from the command line with XMLA

June 17, 2007

There was a question recently on the Analysis Services newsgroup asking how to process an Analysis Services 2005 cube using XMLA from the command line. Below is a script based on Chris Harrington’s excellent Thin Olap blog. This is the absolute minimum script required to get an Analysis Services database to process (ie. No error handling ).

Processing an AS2005 cube from the command line with XMLA

*****************************************************

On my machine I processed my “Sandpit“ database (the sandpit is where I play) with the following command

cscript xmlaProcess.vbs Sandpit http://locahost/sql05/msmdpump.dll

In order to run this script from your environment all you need to do is:

copy and paste the following script to a file called xmlaProcess.vbs
If it is not already configured you will need to setup HTTP access on your server
(see here for information on how to configure AS 2005 for HTTP access: http://www.microsoft.com/technet/prodtechnol/sql/2005/httpasws.mspx)
and then run it from the command line by executing
cscript xmlaProcess.vbs (as a user with Admin rights)
Have Fun!

'// Create XMLHTTP instance
Dim oHttp
Dim lResolve
Dim lConnect
Dim lSend
Dim lReceive
Dim sUrl, sXmlaProcessCmd, sXmlaPre, sXmlaPost
Dim sDatabase, sXmla
If wscript.arguments.count = 2 then
sDatabase = wscript.arguments(0)
sUrl = wscript.arguments(1)
Else
wscript.echo “You must specify the parameters in order to run this script”
wscript.quit(1)
End If
Set oHttp = CreateObject("MSXML2.ServerXMLHTTP.4.0")

lResolve = 60 * 1000
lConnect = 60 * 1000
lSend = 60 * 1000
lReceive = 60 * 1000
oHttp.setTimeouts lResolve, lConnect, lSend, lReceive

oHttp.open “POST”, sUrl, false

oHttp.setRequestHeader “Content-Type”, “text/xml; charset=”"UTF-8″”"
oHttp.setRequestHeader “SOAPAction”, “”"urn:schemas-microsoft-com:xml-analysis:Execute”"”

sXmlaPre = “” _
& “” _
& “”
sXmlaPost = “” _
& “


SQLServre 2005 BI SSAS

June 17, 2007

WEB SERVICE definitions

June 17, 2007

I’d like to take a little bit of your time today to discuss a topic that has been gaining a lot of prominence over the last couple of years or so: Web services. Have you heard of terms such as XML, SOAP, and WDDI? Have you wondered how these “new” buzzwords could help you in your continuing quest to improve your software development efforts? Well, I know I have — so much so, that I decided to do some exploration about it to educate myself, and by extension, all of you.

After defining what a Web service is, and discussing a couple of essential terms in some detail, we’ll use IBM® Rational Rose® XDE™ Developer, IBM® WebSphere® Application Developer and IBM® WebSphere® Application Server to step though a couple of examples, using Java™ as our language of choice. (For you .NET users, don’t despair! Check out JJ Kuclish’s article on .NET and Web services here). Hopefully, this will give you enough information to whet your appetite about using Web services, using these essential tools and technologies as your guide.

So, what are Web services, anyway?

There are many recognized definitions of Web services. The W3C classifies Web services as “programmatic interfaces made available to use the World Wide Web for application to application communication.”1 Sun Microsystems® refers to them as “Web-based enterprise applications that use open, XML-based standards and transport protocols to exchange data with calling clients”.2 Probably the best definition of Web services I’ve found, though, is the following:

“Web services are a new breed of Web application. They are self-contained, self-describing, modular applications that can be published, located, and invoked across the Web. Web services perform functions, which can be anything from simple requests to complicated business processes. A sample Web service might provide stock quotes or process credit card transactions. Once a Web service is deployed, other applications (and other Web services) can discover and invoke the deployed service.”3
The key point from the definitions I’ve gleaned from my reading boils down to one essential tenet: Web services make universal communication across the Web a reality. If you need a particular type of functionality, you can create it and publish it on the Web in short order, and also utilize other services that may be important to you. In addition, the underlying architecture(s) are straightforward enough that you can understand them easily, enabling you to start writing your own Web services very quickly. While I will not go into detail about all the aspects of Web services architecture here, I will define a few of the essential technologies you need to know about in the next section.

What technologies comprise a ‘Web service’?

Before you can take a look at how you can create your own Web service, you should familiarize yourself with a few of the required technologies that make up one. I won’t dive too far into any of them — I just want to give you a sense of what’s required as you start thinking of how you can utilize Web services in your development efforts.

XML — XML stands for eXtensible Markup Language. It is a language that is used for documents containing structured information (content as well as information that describes the role of said content).4 XML was created to insure that structured documents could be used over the Web. It is highly flexible, and used in a wide variety of internet applications. (For more information on XML, see the xml.com home page)

SOAP — SOAP is the acronym for Simple Object Access Protocol. It is a lightweight communication protocol for information exchange in a distributed and decentralized environment (making it perfect for Internet communication)5. It is based on XML, and is one of the underlying protocols used for Web Services. (Take a look at Websites such as w3schools.com to get more detail on how to use SOAP.)

UDDI — UDDI expands to become the Universal Description, Discovery, and Integration protocol. Another one of the underlying Web services protocols, it allows you to, as you create your Web services, to build it on an interoperable platform that will enable other programs to find and utilize them on the Internet6. (Background data about UDDI can be found on the Oasis UDDI Web site.)

WSDL — WSDL is short for Web Services Description Language. It is an XML language that provides a model and a format for describing Web services. It allows you to separate the service (abstract functionality) from the service description (concrete details)7. (You can learn more about WSDL by reading this W3C article:
http://www.w3.org/TR/2004/WD-wsdl20-20040803/#intro).

W3C Web services activity site - http://www.w3.org/2002/ws/

Sun Microsystems - http://java.sun.com/Webservices/index.jsp

Norman Walsh, What is XML? October 1998 - http://www.xml.com/pub/a/98/10/guide1.html#AEN58

SOAP protocol specification, 2000 - http://www.w3.org/TR/2000/NOTE-SOAP-20000508/

UDDI protocol specification - http://www.uddi.org/about.html

WSDL language specification - http://www.w3.org/TR/2004/WD-wsdl20-20040803/#intro


SQLServer 2005 Notifications Services

June 17, 2007

Overview of Notification ServicesNotification Services provides a framework for developing subscription-based applications through which users are notified about events.

Instances
A Notification Services instance is defined in an XML configuration file and implemented as a Microsoft Windows® service that stores its data in a SQL Server database. The instance stores subscriber data that can be shared across all of its applications, and controls the generation and delivery of notifications. The Windows service for an instance is named NS$instance_name and the database associated with the instance is named instance_nameNSMain

Applications
Each instance can control multiple applications. An application is defined in an XML application definition file (ADF) and implemented as a database named instance_nameNSapplication_name. Applications store information about events, subscriptions, and notifications.

The main features of Notification Services in SQL Server 2005 are described in here

  • Subscription Management ObjectsAn API for building subscription management applications through which users can subscribe to events.
  • Event APIsFour ways for event sources to enter event information into the system: a managed API, a COM-based API, an XML file–based API, and a stored procedure–based API.
  • Set-based subscription processingSet-based operations to relate events to subscriptions and generate notifications. This approach means that your notification application can use the performance and scalability of the SQL Server relational database engine.
  • Notification formatting and deliveryExtensible Stylesheet Language (XSL) to format notifications for multiple device types, and deliver them using an extensible delivery channel architecture. This allows notifications to be delivered to virtually any kind of device using any protocol.

    This animation describes how you can use Microsoft® SQL Server™ 2005 Notification Services to implement subscription-based notification solutions. Notification Services is a framework for implementing applications that notify subscribers when specific events occur.
    Notification Services solutions are configured using two kinds of XML file: a configuration file, which contains the settings for an instance of Notification Services, and application definition files, or ADFs, which contains settings for an individual notification application in that instance.
    These files are used to define SQL Server databases; one for the instance, and one for each application. Events can be anything that a user might want to be notified about, such as a stock price change, an order shipment, or a goal scored in a soccer match.
    Events are submitted to Notification Services by an event provider and stored in a database table.
    Users register themselves as subscribers through a subscription management application, specifying details about the subscriber, subscription details for specific events, and information about devices that notifications can be sent to.
    They can create subscriptions that send notifications as events occur, or at regularly scheduled intervals. Notification Services uses an internal generator component to match events to subscriptions and create appropriate notifications.
    Because event data and subscription data are stored in tables, the generator can use set-based SQL queries to perform the matching operation extremely efficiently.
    The notifications are then passed to an internal distributor component, which formats the notification appropriately and sends it to the devices specified by the subscriber. The notifications can be sent in various forms, including e-mail, SMS text messages, and .NET Alerts.


  • vb6 SOAP CLIENT AND .NET WS

    June 17, 2007

    Problem with VB6 client to send string array and receive array of objects from .NET Web Service.

    It is better to use send xml and return xml interface.

    Calling a Web Service using VB6 with SOAP 3.0

    Calling .NET Assemblies and Web Services from VB6

    SOAP 3 stuff

    Private Sub Command3_Click()On Error GoTo ErrHDim deptname As String

    Dim unit1 As New clsUnit

    Dim reader As New SoapReader30
    Dim clnt As New SoapClient30

    clnt.MSSoapInit “http://st2cpraplt01/CPR.Common.Data.SAEmployee/SAEmployee.asmx?wsdl”

    deptname = “TRANSPORTATION/FIELD OPERATION”
    reader = clnt.GetUnitsOfDepartment(deptname)

    MsgBox (reader.Body)

    ErrH:

    MsgBox (Err.Description)

    End Sub