Saturday, March 22, 2014

Rejoice! Keeping iPhone-based Browser from Re-loading Open Windows Upon Returning from Other Apps

Stumbled on this way to keep Safari and other web browsers on the iPhone from automatically re-loading open browser windows when you switch back into them from another application, typically the launchpad (i.e., where you see all your app icons). Puzzlingly for most people, the behavior is inconsistent; sometimes it happens, other times not. I'll explain why in a paragraph down.

This method works with other iPhone browsers such as the popular Mercury browser since the code this method uses is part of the iOS (the iPhone's operating system), not any particular app. This method also may work for browsers found on iPads, etc. I don't know though since I'm iPad-less.

Before revealing it (torture!), I'll briefly explain why the pages refresh. The iOS is memory-paranoid. As much as possible it yields only the memory it needs to for an app to run. This is because it can't tell either how many apps the user will open or keep open but "backgrounded" when the user switches out from it without quitting out of it. Windows and the Mac OS have the same challenge as does any other OS that allows more than one application (or program) to run at a time. The issue is more significant for the iOS because the iPhone has relatively less memory free to allow applications to claim. Apps like web browsers are notorious memory hogs, so the iOS kabashes their grabs for free memory. The biggest way they do this is to clear the browser's page content stored in memory when the browser app is backgrounded. Disabling "Background auto-refresh" in the system settings for the iPhone doesn't change this behavior. So when the user switches back to the browser, it must re-fetch the open browser windows' content either from file cache, the original source server, or both. Annoying. Anything typed into a text box is lost, sessions are sometimes expired unnecessarily, etc. As mentioned above, the behavior is inconsistent. That's because the memory cache purge done by the iOS happens at its "discretion" based on how well it's currently doing for free memory.

People have been asking Apple about this since Safari was released with the iPhone and to my knowledge they haven't described a way to disable this behavior by way of a general setting or simply added a way to suppress this behavior in the Safari prefs.

The method is simple, but before switching out of Safari (or any other browser app), you must remember to do it. What you do is touch and hold on a piece of text (a single word or letter is fine), then lift your finger off the screen. The word or letter will be selected and the familiar little pop-up that says "Copy | Define" appears. Touch "Define" and the screen that shows the word's definition or says it couldn't find a definition pops up. Now, do *not* touch anything else; not "Done", "Search the Web", or anything else. Now press the Home button (i.e., the one on the bottom portion of the front face panel of the iPhone with the square in it). You will be switched back to the springboard with all your app icons and from there can do anything else you want. Then, touch the browser icon for the browser you were in and you'll switch back into it. The definition screen covering the browser window will still be there. Touch "Done", and the screen drops away. Blessedly, the open browser window(s) will *not* reload.

Remembering to do this may take some time but eventually it'll become habitual, like anything else.

Feel free to share this life-changing tip far and wide. If you must thank me, name a kid or two after me, or my missus, Brenda. After all, girls named "Matthew" don't have an easy time of it in school. =)

-----
Addendum: A couple times when I originally posted this, I referred to 'Safari' as 'Navigator'. Don't know what got into my head. I've corrected those mistakes.

Wednesday, March 12, 2014

Found it: The fix for chronic muscle cramps (works for me, anyway...)

Thought I'd share this. If you suffer from regular muscle cramping or know someone who does, read on. If not, well, you may still want to read it, since the stuff I discuss has a lot of other applications aside from helping alleviate that particular problem.

I have had since around age 35 regular issues with muscle cramping, especially of the calf and foot. A common problem for many, sometimes a severe calf cramp would strike as I fell asleep, causing me to fly out of bed in all-consuming pain so bad I couldn't scream much less speak (if you have this, I need not elaborate). Once or twice I've had quad cramping which is itself utter torture, and a few more times, hamstring cramping like this, almost as excruciating. I've never been water-boarded, but I can't imagine anything more totally consuming of one's attention that also leaves him so utterly incapacitated as these kinds of cramps. The worst instance I ever had was a near-total-body cramp, including my quads, hamstrings, calves, and the muscles across my ribs and down my sides. Basically, I collapsed to the floor and fairly prayed for death as I tried as best I could to stretch out these muscles. Any way I moved made one place cramp harder and no place cramp less. If I had done this in the presence of another person, I am sure they'd've called 911 in the belief I was having a grand mal seizure or something like that.

I started drinking diet tonic water (as in gin-and-tonic, minus the gin) for the quinine, which helps reduce muscle cramps. It has done a pretty good job of reducing the cramps, especially the night calf cramps. However I still got the occasional calf muscle spasms that would become a cramp if I didn't quickly get up to stretch, or the foot cramping that causes the toes to flex in different directions (again, if you have this problem, I need not elaborate on the pain and the incapacitated state it puts you in). Typically I might start to get these cramps during even relatively moderate exercise and if I caught them fast enough, could stretch in time and maybe stop it. So the tonic water is good, but still not all the way across the finish line.

I got tired of reading articles that said this kind of cramping was "idiopathic", i.e., medical researchers don't know the cause. So I started thinking about "who-and-when" and then maybe the "why" would come to me. It seemed to me that this kind of thing hits people who fit one or more of these descriptions: 1) are past a certain age, 2) get a lot of intense physical exercise, including any heavy labor, 3) are exposed to cold temps. in a certain range for too long or 4) spend a lot of time sitting with few or no breaks to take a walk somewhere.

All these things have this in common: they result in a lack of circulation in the lower extremities. In the case of "people past a certain age", circulatory efficiency tends to drop for a number of reasons even if they get regular exercise which isn't excessive. Over-exercise (relatively speaking) depletes the oxygen and glucose in muscles; when you stop, the body re-routes the blood back into the core of the body to start supplying oxygen and nutrients to the vital organs. So now, the extremities are both depleted of oxygen and glucose but they still need to wait until the vitals are in better shape before getting their share of blood back. Cold temp exposure: blood goes into the vital organs and leaves the extremities to fend for themselves -- sorry calves, it's about priorities. Sedentary people: Restricted blood flow. Between the torso and the legs, there's a 90-degree crease created by sitting on a chair with one's body weight reducing the blood flow into and out of the lower legs. Result: bad circulation and under-fed muscle fibers.

So I started looking around for something that can increase circulation but isn't Yet Another Drug nor "Only $79/Bottle For A 30-Day Supply!". It seems too obvious a thing for it not to have a common solution. Eventually I came across reports by people about the amino acid L-arginine (the "L" just means it's a "left isomer" of the arginine molecule). It seems to have a lot of health-related applications, not just helping with increasing circulation (see http://en.wikipedia.org/wiki/Arginine ).

L-arginine is sold at supermarkets (local to Rochester: Wegman's), drug stores that stock a good range of vitamins, etc. You can also buy it on-line; it's relatively cheap. It finds a wide appeal marketed as a work-out supplement to be taken before or after hitting the gym. The promise is of course that users will get "pumped" like Ahhnold, have amazing amounts if energy, etc. The showy labels for these L-arginine products pitch it as a nitric oxide booster, implying that you're buying nitric oxide powder or pills. But read the label, it's just L-arginine . But the powder products especially seem to give the user a big boost of energy. That's because the powder is absorbed much more quickly through the stomach walls and it is used by the liver to generate nitric oxide in one fell swoop. However in pill form or if taken in less-than-directed doses of powder more frequently during the day than the pill form, the "energy boost" doesn't occur, but it will still have an effect that serves an anti-cramp purpose.

Nitric oxide is a vasodilator, increasing blood flow throughout the body. As people age, they are able to use L-arginine to form nitric oxide less and less effectively. The other conditions leading to muscle cramps create a state where more oxygen is needed than usual in the muscles, or it's depleted, or it has run off along with the blood that's been re-routed to the body's core. In all these cases, dilating the circulation system generally will get the blood flowing more freely through the body. Based on my reading about this amino acid's effects, like other substances in the body, the biggest consistent influence on how much of it can be made useful in the body is one's age. Again, while the amount of nitric oxide one needs to maintain an open and clear circulatory system doesn't seem to change over time, the ability of the body to produce nitric oxide directly from the lining of the arteries or to utilize L-arginine to make nitric oxide steadily diminishes.

So I added L-arginine tablets to my diet. 3-4 g/day: 2 in the AM and 1-2 in the PM. Since doing so, my cramping problems have nearly entirely disappeared. Occasionally I have a calf tremor or a foot starts to feel a little stressed this way, but the problem seems to have abated almost entirely. My calves used to be tight all the time, too; now, they're not. So I think, all this time it's been bad circulation.

I hope if you have this same problem and try L-arginine for it, it works for you.

BUT BEFORE SIGNING OFF, some notes/cautions: 3-4 g/day is fine for me. But you may need more or less, depending on weight, severity of problem, age, etc. Also, the amount of this amino acid you take for this problem, if it stays relatively low (I'd say 5 or fewer g/day for an adult 180-200 lbs., but that's a SWAG), shouldn't require you to think about balancing it with something else, especially if you are not susceptible to or have an issue with certain health conditions. If you have a condition like HSV I or II or another "resident virus" of some kind, a compromised immune system, or a tendency to grow tumors (L-arginine fosters HGH production), you should balance your intake of L-arginine with L-lysine (see http://en.wikipedia.org/wiki/Lysine ), another amino acid. They work together in the body and L-lysine reigns in L-arginine's tendency to enable resident viral growth. Even a small amount of L-lysine as compared with the L-arginine has a substantial effect on reducing L-arginine's tendency to foster viral reproduction. Humans naturally possess both amino acids either because we synthesize them ourselves and get them in our food (L-arginine) or just get them from food (L-lysine). So if that's a concern for you at all, it's worth doing your own research.

Since L-arginine has this dilating effect on the circulatory system, if you're on meds for any blood pressure or heart condition, or take nitrates, talk to your MD first. Some meds you don't think cause blood pressure to decrease could also pose a danger. For example, ED drugs like Viagra cause blood pressure to drop, so taking both L-arginine and Viagra too close together may cause a blood pressure so low as to cause dizziness and in extreme cases, more significant symptoms (great way to kill a "romantic mood", huh?). There is also a herb called xylitol used as a sugar substitute for diabetics and a preventive of middle ear infections in children. However if you ingest xylitol and L-arginine, the xylitol will block L-arginine's ability to stimulate glucagon production in the pancreas. Glucagon, when released, causes the liver to convert stored sugar to usable blood sugar. So the short version is: If you are diabetic, ask your MD about this topic. Adding L-arginine to your diet may cause your body to overcompensate relative to your insulin injections and other blood sugar-regulating meds and mess up your blood sugar stability. People not using significant amounts of xylitol don't have to be concerned, particularly those without diabetes or another blood sugar regulation condition. (Xylitol is in fact found in small amounts in a number of common foods, so you're already living with its effects anyway.)

Done!