Tags

Topics

  • Article
  • Blurb
  • Exercise
  • Links
  • Miscellaneous
  • Reflection
  • In topic Article

    View: Full posts | Listing

    Review: Body by Science (John R. Little, Doug McGuff, 2008)

    Sunday, April 4th, 2010 about ,

    /static/2010/04/body-by-science.jpg

    Do you want get fit? Healthier, lose weight, or get rid of pain? Thought you had to had to work out five days a week and run five miles a day?

    Nope.

    This book challenges the conventional wisdom when it comes to working out for health -- work smarter, not harder! It guides you through the mechanics of fitness and what it actually means, with low-level details. Instead of saying "running will make your heart work more efficiently" or "lifting weights makes you stronger", you'll get to know exactly what these adaptions are and how they're done on a cellular level.

    What is it about?

    Focus in the book, as I see it, is how to make you generally fit, strong and healthy, while not giving you specific advice on how to grow as much muscle as possible or working out to win Strongman-competitions. Emphasis is always on balance between the activities that breaks down the body, i.e. exercise, the rest that builds up the body, and the importance of working out at a proper intensity.

    Again, if you thought low-intensity steady-state running is what you should do to be more fit, think again; in fact, LISS for "cardiovascular exercise", they argue, does not do you any good at all. The driving force behind aerobic performance is to constantly push the boundaries upwards to produce lactic acid thus increasing muscle cell work capacity. The adaptions are thus on the level of the muscle cell which in turns drives the rest of the body to be more efficient at providing an adequate amount of oxygen.

    With this follows that you should avoid the middle ground, and instead aim for short high-intensity sprint intervals, and in resistance training always working out to failure to maximize the muscle fiber recruitment, choosing exercises that involve major muscle groups. Also, because of the intensity, these workout sessions should be performed infrequently -- just once a week, in order to properly recover and get enough time for super-compensation. High-intensity workouts are more efficient, they argue, as they are shown to produce the same adaptions as lower-intensity sessions ten times longer in duration. This translates to doing short bursts once in a while, instead of continously pushing around at half speed. The resistance training program given describes compound movements using machines for safety when taking a set to failure, but free weights can also be used. If you know Nautilus, the training style advocated there is the basis for the Body by Science program.

    Again, this is for general fitness. When it comes to specific sports or other activities where there by nature is a lot of variation on the intensity, of course, that should also be trained.

    Digging down deeper, there's a fairly large part of the book devoted to explanations of how your body works: from generating ATP for energy, the function of the apolipoproteins forming cholesterol, muscle fiber types, recruitment & recovery time, how glycogen synthesis works and insulin sensitivity, to free radicals during physical stress. It also describes what genes are responsible for muscle growth, and how some are more suited towards endurance sports rather than strength, all in great detail.

    Next up, a chapter describing proper practice for athletes involved in sports, and how common mistakes are done by coaches not separating specificity from conditioning, wearing down when they should be building up. This means you should aim for technique for the purpose of getting better at the sport, but not trying to get in better shape at the same time as this drives the wrong skill set adaptions. A few examples are given, such as fotball players forced to train with a slightly deflated ball, just to make it harder/more conditioning, where in fact, the actual conditioning gained is minimal and in reality, it would force a parallel skill set from playing with a properly inflated ball, all leading to a generally pretty bad training session not really gaining anything. Another good example is how using a treadmill translates very badly to regular running -- again, an example on how training for something makes you good at just that, but not necessarily a similar activity.

    Rounding off the book, there's a short part on diet and how it affects health and weight loss, especially in the light of resistance training. It's sparse in detail, but slanted towards paleo-style eating, i.e. mostly animals and some plants. There are many other resources available on the topic for someone who wants to learn more, e.g. Mark Sisson's "The Primal Blueprint".

    My thoughts

    Besides an interesting read on how the body works and the adaptions made, a few things related to training made an impression on me: make sure to make each workout count, push your boundaries and make sure to recover properly before next workout, instead of working out more often but at a lower intensity. Without proper stimuli, there is nothing driving adaption. The dicsussion on technique and separation from conditioning is another excellent point. Again: work smarter, not harder.

    I like the technical discussions in the book, but if I wanted an actual training program, it would lack in detail. It does tell you what exercises to perform and good explanations with images on performing them, but without - in my view - a proper training program. For this, you should look into something like StrongLifts 5x5.

    Nevertheless, if you're into low-level talk, interesting references and a different view on exercise, this book is an interesting read.


    2 Comments »

    Review: Underground Bodyopus - Militant Weight Loss & Recomposition (Dan Duchaine, 1996)

    Saturday, April 3rd, 2010 about , ,

    Dieting to go from overweight to get normal? What if you're already reached your goal and want to go beyond normal? Most diet books cater to people who struggle trying to get rid of a flabby belly, fat thighs and what have you. You, on the other hand, is already fit -- at least, that's what people keep telling you. But you know that's not good enough for you. You want to get really tight.

    Then, this book is for you. It requires, and assumes, experience lifting weights, discipline and adherance, so again, it is not for the average dieter.

    Chapters

    /static/2010/04/bodyopus-cover.jpg
    1. A Diet book for people who aren't fat
    2. What we'll acomplish in BODYOPUS
    3. Who am I
    4. The usual warnings: on doctors, drugs and the FDA
    5. Body fat and fat percentages
    6. Measuring body fat percentages: the awful, awful truth.
    7. The easy stuff: dieting9 by hte (popular) numbers
    8. Maintenance manipulation: the pre-diet diet
    9. Real dieting
    10. Adjusting your calories
    11. Protein recomendations
    12. Amino acids: non-recommendations
    13. Amino acids as drugs
    14. Arranging your proteins
    15. Dietary fats: recommendation
    16. Dietary fats: hierarchy and arrangement
    17. Carbohydrate recommednations
    18. Problems with modern dieting
    19. The isocaloric diet
    20. Muscle catabolism while dieting
    21. Anti-catabolic strategies
    22. Anti-catabolics in the real world
    23. How dieting slows down the metabolism
    24. Optimizing your metabolic rate
    25. (ugly) lower body fat
    26. Thermogenic agents and body temperature
    27. Anti estrogens
    28. Appetite suppressants
    29. Tricks of the trade
    30. The "top 50" dieting drug list
    31. And finally, at last: BODYOPUS
    32. Before BODYOPUS
    33. Ketones, glucagon and ketogenic diets
    34. The rebound training system
    35. Rebound redux
    36. Bare bones bodyopus
    37. Bodyopus in the flesh
    38. Optimal things needed.
    39. Bodyopus with all the plumbing
    40. Bodyopus countdown
    41. Recomposition rodeo
    42. Recomposition abracadabra
    43. Recomposition numbers
    44. Recomposition rules
    45. Bodyopus variations
    46. The bodyopus workout schedule
    47. Bodyopus coda
    48. Special section: diuretics for bodybuilding competitors.

    The Book

    It starts with your standard disclaimer, as some of the advices given in the book are not for the faint of heart -- literally: metabolism-altering drugs, steroids and duiretics.

    Starting with some background info on Dan and the training and diet methods eventually leading up to BODYOPUS, it starts off with the basics of dieting. Gradually, you're eased into the low-carb ketogenic diet by discussing the setup of the standard american diet (SAD)-based "slash 10% of calories, keep fat low, protein and carbs high" and the specific advantages/disadvantages of that, in order not to scare anyone off by giving too drastic suggestions on what a diet should look like. Moving further into scary-land, a zone-like/isocaloric setup (1:1:1 CHO:FAT:PRO) is presented, which, according to Dan, works even better than the regular method. Finally, you reach the BODYOPUS setup, which is your basic ketegonic diet coupled with a specific training program and the weekly carb load which supposedly is key to the feat of driving muscle anabolism up and fat percentage down - yes: building muscle while dieting.

    While this all might sound fairly basic, all aspects of dieting are described in detail. There is very little left untouched or unexplored by Dan. If there is something to write about a topic related to dieting, he will do so. From the long discussion on whey protein vs free amino acids, how to make your drugs work better, metabolism of MCTs and ketones and body temperature down to exactly what happens to the body at low fat percentages. This gives for a far more interesting read if you're into the low-level technical aspect of dieting -- which I do. There are some controversial statements, such that on a >10% deficit, just upping protein won't work, instead you have to go ketogenic in order to preserve muscle mass. This goes against what many others in the business, e.g. Lyle McDonald, say.

    Generally, Dan is a witty writer and throws in masterpieces like as this throughout the text:

    Frozen egg whites come in a 5 gallon block, about the size of a block of ice for an igloo when Eskimos buy them pre-fab. How big? Bigger than the freezer in my refridgerator, and there's no room in the big freezer in my basement 'cause I got my dead grandma in there.

    The free language, as depicted above, together with the deep-diving into details gives the book a good flow and is easy to read. You might want some background in basic metabolism, but most everything is explained on the way, so if you have no background, that's OK too.

    Who is this book for? Again, as it says in the preface of the book, it's the diet book for people who are not fat. It assumes you have a few years of training background and have good knowledge on how your body reacts to working out, dieting and generally pushing the limits.

    Or, simply anyone fascinated by dieting and training.


    No Comments »

    Review: A Guide to Flexible Dieting by Lyle McDonald

    Sunday, January 31st, 2010 about ,

    Unlike other books on weight loss, this book is not about a specific diet, but rather everything that revolves around the actual dieting. There are a few basic principles that are common in all diet setups, he argues, and the reason why diets fail is because the side effects of the diets are not properly addressed.

    For example, the basic idea behind weight loss is to create a negative energy balance such that the body is forced to draw upon its fat stores for energy. There are individual variations on how to best achieve that effect, depending on many factors, such as age, sex and insulin sensitivity. For someone with pre-diabetes (or worse), lowering the carbohydrate intake (specifically high-glycemic) is a good idea, but for others it might not matter where energy is cut, as long as the essentials are provided for.

    Who Is The Book For?

    Now, being on a diet - in most setups - is about depriving yourself of something, be it carbs, fat or just energy itself. What happens if you by accident deviate from your diet plan? Will that one piece of "forbidden food" be enough to satisfy whatever craving you have, or do you start binging uncontrollably? It's the difference between being in control, and leaving control to an outside force: if you put yourself in a mindset where you don't feel guilty about having satisfied your craving, but instead tell yourself it was a planned step out of the path, you will have a higher chance of successfully returning back and following through with your diet. This is a very important realization to make, as it is for many people the make-or-break of a diet. Moreover, you might find yourself in a situation, such as a vacation trip, where it is simply too inconvenient to follow your diet. Lyle here introduces the concept of a "full diet break" with a few eating guidelines on how to make the best of the situation.

    Other concepts, known from books such as "Ultimate Diet 2.0" is the structured refeed, performed to raise metabolic state and offset the tarnishing effect of being on a diet for longer periods -- for a large person, it might very well take years to slim down to a healthy weight, and planned breaks or refeeds once in a while can go a very long way towards following through with that entire year (or similarly long period) of dieting.

    Finally, the book discusses how to eat at maintenance - you're not going to diet for the rest of your life, are you? While I don't fully agree with Lyle's view in terms of what constitutes healthy food, the guidelines are good enough for most people, and if you've been on a diet for a longer time, chances are you'll be able to adapt his recommendations to suit your specific needs.

    Conclusion

    Slanted towards the psychological side of dieting, the book is fairly unique in that it does cover the actual dieting part too. Usually, you'll find books addressing either side, but rarely together. It's an interesting read, if you're wondering how you should deal with your diet and have no other material by Lyle. If you have previously read "Ultimate Diet 2.0" and "Rapid Fat Loss Handbook" (or "The Ketogenic Diet"), it does not offer very much that is new, however, but it is still an interesting read.

    Lyle's writing in A Guide to Flexible Dieting is clear, informative and casual, making it a quick read, hopefully leaving you with a new perspective on how to go about with dieting and the various aspects involved.


    No Comments »

    Review: Breaking Dawn by Stephanie Meyer

    Sunday, January 31st, 2010 about , , ,

    The conclusion of the Twilight Saga.

    Immediately in the table of contents there is a surprise waiting: the book is split up in three parts. The first is rather short, and as in the other books told by Bella. Then, it flips to Jacob's point of view, followed by the finale where you again follow Bella on her adventures.

    In the last book, Edward convinced Bella to marry him. What follows here is the period of time between Bella keeping her promise and Edward keeping his -- the final transformation to a Cold One, a vampire. They plan it so that Bella can be away from her family during her first days as a new-born, to spare her the agony of craving their blood, not wanting to hurt them. Before that, however, they head off for their honey moon, to to southern America and from there by boat. Bella, getting her wishes through at the island, finds herself in her personal heaven, and would rather not return to school at all when the honey moon approaches its end. Things do not quite work out the way they had planned, and are abruptly forced to head back home when Bella's health mysteriously starts degrading.

    Instead of getting to know more about what's happening, we're presented with Jacob's point of view -- which was indeed frustrating, as it somewhat stalls the story, but Stephanie manages to pick up speed and make Jacob's angle add flavor to the story. His agony of not being able to help Bella, and how his view of the vampires changes gives more depth to the person behind the wolf.

    Eventually, the story returns to Bella, and the conclusion of the story. Her special ability proves both interesting and useful in the ending scenes, where the world is turned completely upside-down for Bella and her new family -- very harsh, yet full of love.

    Trying to put the book down during the final chapters of the book is an exercise in futility...


    No Comments »

    Review: The Warrior Diet by Ori Hofmekler

    Saturday, January 30th, 2010 about , ,

    The day is divided into different phases where one alternates between undereating and overeating. According to today's recommendations, you should have three meals and a few snacks in between, which amounts to consuming food five to six times daily, or about every third hour. This makes you mostly stay in the fed state. At the other end, we have intermittent fasting (IF), where the periods of not being in the fed state are longer, usually between 16 (e.g. eating 12:00 to 20:00) to 24 hours (alternate-day fasting).

    This Book is about Intermittent Fasting

    The proponents behind the various schemes of eating have their own arguments: you should eat every third hour to keep a steady blood sugar level, keep hunger off and avoid the "starvation response", whereas the alternate view is that the blood sugar level is perfectly regulated by the human body even when you're not eating, hunger is mostly about habits, and that there is no short-term starvation response. The views behind the IF camp is also supported by science. Perhaps not very surprisingly, I'm a proponent of IF.

    Main advantages of fasting, and therefore the basic ideas of IF, include:

    • makes you more alert through the hormonal environment imposed by fasting;
    • mimicks caloric restriction on life span and health;
    • boosts the effect of resistance training;
    • forces the body to rely on stored body fat for energy;
    • lowers insulin levels, helping so-called stubborn fat come off more easily; and
    • making the meals (meal, really) more filling if energy intake is restricted.

    Some of these are still controversial and/or have been verified only in rat studies (such as the prolonged life span), however, others have support in studies on man. So far, so good.

    Ori's Take on Intermittent Fasting

    Ori discusses fasting in terms of undereating and overeating in an historical context, where warriors (e.g. the Romans) would nibble on food during the day to support heavy physical activity, which at the end of the day would be followed by a meal and relaxation, preparing for the next day. Here is where we find the main difference between The Warrior Diet and other IF approaches, where fasting means fasting (no caloric intake), whereas Ori gives go on fresh fruit and vegetables, and an occasional protein source such as whey, yoghurt and eggs in small amounts. The reasoning goes that one should consume foods containing certain enzymes, meaning live food, as well as for maintainin the proper alcaline/acid balance. Fasting is by Ori considered to help the body detoxify itself, which would not be possible if constantly in the fed state. This is certainly controversial, and so far I have not found any evidence the body indeed needs enzymes from food to function properly -- the ones required will be produced by the body itself. Same goes for the acid balance. The parts on hormones and how various foods (and toxins) affect them is mostly-accepted, and is an interesting read, though. Specifically, he discuses the effects food has on the sex hormones and the ones controlling your metabolism, and speculates how eating correctly might even reverse certain illnesses.

    The reader might be lead thinking Ori proposes a low-carb diet, but the emphasis is more on proper carbohydrate sources rather than limiting them altogether. In fact, in the recipe section and recommended foods, many meals are high in carbohydrate and low in fat. That might not be completely representative of the overall views, however, as it is stated at several places in the text that in order to lose fat (especially the stubborn kind), you should trade carbohydrates for fat; limiting the intake to vegetables and the higher-glycemic carbohydrate sources to directly after working out, or as the last course of your meal to minimize the insulin response. There is also a section on Ori's preferred style of resistance training (avoiding failure at all costs, again mimicking how warriors were supposedly trained). Neither the advice on resistance training nor the recipes is something you couldn't pick up in a beginner's strength training book or cook book.

    Aside from the rather long (and somewhat repetitive) sections on warrior history, what made the book interesting in my view is mainly the theory on "meal intensity" and how it plays a greater role in muscle development than simply total intake, which really does go in line with my observations, as well as (slightly far-fetched) one Norwegian study comparing the effects six versus three meals a day, with the latter resulting in greater muscle mass gains. Having one meal at the end of the day, when everything is done and there is time for relax, would be more in line with how wild animals live, while also being a nice way to round off the day. Perhaps somewhat analoguous to sleeping, you would rather want your eight hours of sleep in one chunk instead of naps spread out over the day. Anecdotally, I've noticed better results (mainly in terms of fat loss) doing 20-22 hour daily fasts, compared to the 16 hour regimen I used to follow. Whether the reason is that I do eat less is not important, as I'm allowed to eat until satisfied once a day followed by a good night's sleep, ready for the next day's tasks. Moreover, quoting Mark Sisson (Mark's Daily Apple; The Primal Blueprint) in his article 17 Reasons You're Not Losing Weight in the section on IF:

    If all goes well, your hunger won’t necessarily disappear, but it’ll change. A successful IF tames hunger, makes it less insistent and demanding.

    What Did I Learn?

    Would I recommend this book? Maybe, if you're interested in history, spirituality and a bit of biology/hormones. I personally followed something close to the plan outlined by Ori for a few weeks before I read the book, agreeing fully in the praise of the diet by the athletes in the preface of the book -- it is a lifestyle I can see myself follow. Moreover, Ori acknowledges there might be times where you would not be able to follow the recommendations fully, and that you should just let it pass to later on continue with your new-found way of life. Lifestyle is really where emphasis is put, where most other diet books are about restriction. Granted, fasting is also a form of restriction, but in my view the least problematic of plethora of restrictions available.

    If you're not prepared to put the time or money into the book, I'd say you will be equally well off simply fasting until night, eat and then go to sleep, as the rest of the book does not really introduce anything required to, well, not eat, save for some advice on certain foods and their health benefits. Working out (specifically resistance/weight training), as with most good books on diet, is optional, but encouraged to speed up fat loss, improve on your physique and general health. Again, the material could be easily picked up elsewhere for specific goals, however, I believe that the book for many gives a nice back-to-back "diet solution" which could be comforting. It's fairly cheap, so why not?


    No Comments »

    Review of “The Twilight Saga: Eclipse” by Stephanie Meyer

    Friday, December 11th, 2009 about , ,

    If the first book introduced Edward, and the second book introduced Jacob, this is the book where Bella's internal struggle is played out, where she is forced to choose between the two. As if this wasn't enough, the past is starting to catch up with her. Introduced in the previous book, the vampire Victoria and the ancient Volturi coven are out to get Bella, and their paths is intertwined in a rather odd way.

    More oddities happen when the truce between werewolves and vampires is strengthened, in fact turning into a joint effort to ensure the safety of Forks and the safety of Isabella Swan.

    We are also introduced to more of the history of werewolves, as well as the history of werewolves. All this gets Bella torn, not being able to choose. However, she finally makes her choice in the very end, a choice that causes her much grief.

    I'd say this book is mostly acting like a bridge tying up loose ends. It is, like the other books in the series, easy to read, and while there is not much happening in terms of concrete action, the events taking place in Bellas mind are enough to cause both laughter and tears. It's easy to sympathize with the choices she has to make and feel for her.

    The book ends in such a way that it's almost impossible to resist opening the first page of Breaking Dawn, the final book in the Twilight Saga.


    No Comments »

    Review of “The Twilight Saga: New Moon” by Stephanie Meyer

    Sunday, December 6th, 2009 about , , ,

    The second book in The Twilight Saga.

    Young girl Isabella Swan's 18th birthday is coming up. She quite decisively tells Edward not to give her any gifts. He does do as she tells him to, but when taken to the Cullen's, she finds out that the others were not as obedient.

    Here's where things take a sharp turn. Bella is suddenly made aware the true face of the vampire race, and finds herself left alone in Forks. This is the prelude to Bella's new life, spending more time with an old acquintance presented in the first book. Except, she can't really get rid of her old life, and in fact, she eventually does more and more to be reminded of it.

    As she continues trying to relive the past, danger present itself, again, threatening Bella and the one's she holds dear. Ironically, the series of events leads her to a race against the clock to save someone else's life....

    Ending the book, Bella is more torn than ever about her feelings and the way of life she has chosen. Untangling the mess she's put herself in continues in the third book, Eclipse. Other than some abrupt turns that only get a fairly simplistic explanation, New Moon widens the perspective on the Twilight universe, and provides an arch in the story, towards the next book.

    A quick read, probably more so than the first book, due to the familiarity of the characters but also thanks to the intriguing love story accompanied by Bella's thoughts, underlying the Twilight Saga.


    No Comments »

    Review of “The Twilight Saga: Twilight” by Stephanie Meyer

    Sunday, November 22nd, 2009 about , ,

    The first book of The Twilight Saga. First book I've read exclusively on the Sony Reader Touch (PRS-600), a good experience with the pocketability of the device, reading comfort and the built-in Oxford Dictionary lookup.

    The saga is centered around a confused teenage girl, Isabella, or Bella, as she prefers to be called, who is forced to move up to rainy Forks, Washington, to live with her dad as the family situation in Phoneix gets complicated.

    Trying to settle in, she finds herself strangely attracted to a handsome boy in school, who isn't quite like the others. Indeed, he and his siblings does not often speak to the other kids in school, and while Bella makes new friends at school, she can't help but wonder about this mysterious boy.

    As time passes, she gradually gets to know more about him: both directly, and indirectly from the people of the small town of Forks. In a small town where everyone knows everything about each other, keeping secrets is hard. However, some secrets are better kept than others. Thus begins the story of an impossible relationship...

    At the core of the book lies the classic opposition between unconditional love and the harshness of real life, where ends not always meet. Stephanie Meyer convincingly portraits the confused life of a 17 year-old girl, without dumbing down either language nor thoughts, painting a rich view of the world.

    Dialog-driven, mixed with Bella's inner dialogue, the book is easy to get through, and gave me both laughter and sadness. There are a few weak points in the story where more detail could have been given out, but all in all, it is a good saga and a solid read. It left me with a desire to find out more about her and the adventure that is her life, continuing in the book New Moon.

    Recommended.


    No Comments »

    Vitlöksfräst halloumi med dijon och fetatäckta rotsaker

    Wednesday, September 30th, 2009 about

    Skiva rödbetor och grovstrimla morötter. Koka 10 minuter i saltat vatten.

    Mosa ihop 100g fetaost och några matskedar creme fraiche i en skål. Salta och peppra.

    Lägg över de kokta rotsakerna på bakplåtspapper på en ugnsplåt. Lägg på en klick fetakräm på varje rödbetsskiva. Eventuellt olja och salt på morotarna. In i ugnen, 200 grader varmluftsugn, 10 minuter.

    /static/2009/09/beetroot-baking-tray.jpg

    Börja stek skivad halloumi när det är ca 3-4 minuter kvar på rotsakerna.

    Et voila! Lägg upp allt på en tallrik och servera med dijonsenap.

    /static/2009/09/beetroot-halloumi-carrots-dijon.jpg

    No Comments »

    Mandelscones och gräddglass

    Sunday, May 24th, 2009 about , ,

    /static/2009/05/lchf-to.gif

    När man äter riktig mat får en del onaturliga maträtter stryka på foten. Helt i onödan visar det sig! Mandelscones till frukost, hamburgare till middag, och till efterrätt bjuder jag på en helt fantastiskt god gräddvaniljglass!

    Mandelscones

    /static/2009/05/mandelscones.jpg

    Blanda ihop

    • 1 dl pofiber
    • 1 dl fiberhusk (malda psylliumfrön)
    • några teskedar salt, efter smak. scones brukar ha mycket salt i.
    • 3-4 dl vatten

    Det skall bli en gummiaktig, men inte hård, boll. Luktar svamp, men misströsta inte.

    Rör ned

    • 3 äggulor
    • 1 msk smör (på ett ungefär)
    • 1 dl vassleprotein, naturellt
    • 2 dl malda/finfinhackade sötmandlar (för oss utan mixer)

    Blir ungefär som en bröddeg snarare än sconessmet. Använd händerna!

    Vispa äggvitorna hårt och rör försiktigt ned i degen ovanför. Nu är det ungefär som sconessmet! Klicka ut som vanliga sconesplättar på en oljad (de tenderar att fastna i underlaget) plåt eller oljat bakplåtspapper.

    I min varmluftsugn tog det 15 minuter på 225C. Lite högre värme, ev lite kortare tid, i vanlig ugn. Justera efter önskad knaprighet. Kan även stekas! Smeten kan förvaras i en burk i kylskåpet, men var uppmärksam -- protein är (tyvärr) en utmärkt grogrund för bakterier...

    Ta-da! Fluffiga och mumsiga (mjuka) scones! Kan förvaras i påse och blir mer som mjukt bröd till dagen efter, fortfarande lika gott. Säkerligen goda att rosta.

    Perfekt för utflykter, biobesök eller en slö helgdag.

    Hamburgare med bröd

    /static/2009/05/mandelsconesburgare.jpg

    Mandelsconesbrödskiva som botten. Stryk på ett (tjockt) lager dijonsenap. På med valfri hamburgare. Några ostskivor. Tacosås och majonnäs. Ett stort salladsblad.

    Häpp!

    Gräddglass

    /static/2009/05/glass.jpg

    Häll följande i en shaker

    • 3 dl vispgrädde
    • 2-3 krm vaniljfrön
    • 1 msk honung (kan med fördel justeras nedåt, ev. ersättas med sötningsmedel)

    Skaka tills det slutar låta, dvs grädden blivit fast. Häll över i en bunke med lock, rör ned 3 äggulor, in i frysen. Färdigt på några timmar. Jag tog upp glassen och rörde om två gånger under tiden.

    Glassen blir ungefär som Ben & Jerry: man får ta upp den en liten stund före, eftersom den är mer kompakt än BigPack och andra glassar med invispad luft. Smälter direkt på tungan, utan ett spår av iskristaller!

    Fantastiskt gott, och nyttigt!


    5 Comments »

    Programming Challenge: Crypt Kicker

    Wednesday, February 4th, 2009 about ,

    Problem 2.8.4 in Programming Challenges by Steven S. Skiena and Miguel A. Revilla:

    Decrypt all words in the input text, based on a dictionary of known words.

    Given below are samples of possible input:

    • Dictionary: and, dick, jane, puff, spot, yertle
    • Sample input: bjvg, xsb, hxsn, xsb, qymm, xsb, rqat, xsb, pnetfn

    This is a substitution crypto with the constraints imposed by the possible mappings between encrypted and clear-text letters. First thing I thought I'd need was a way to get the plain words that could possibly match a crypto word. So I defined a utility function plain-word-list-from-crypted:

    (defun plain-word-list-from-crypted (crypted &optional (dictionary *dictionary*))
      "Extract the words from the dictionary that matches the length of the crypted word."
      (if (not crypted)
          '("")
          (remove-if-not #'(lambda (word) (= (length crypted)
                                                (length word)))
                         dictionary)))
    
    * (plain-word-list-from-crypted "rqat")
    ("dick" "jane" "puff" "spot")
    

    For convenience, I stuffed away the input (the original text asked to parse input lines):

    (defparameter *dictionary* '("and" "dick" "jane" "puff" "spot" "yertle"))
    (defparameter *input* '("bjvg" "xsb" "hxsn" "xsb" "qymm" "xsb" "rqat" "xsb" "pnetfn"))
    

    Unification

    As you can tell, the plain word list doesn't tell us anything about the compatibility between words. We immediately see that the word puff is not one of the target words, by quickly performing the unification in our heads. Inventing <=> for unifiable and </> for not unifiable, we get (from crypto to plain side):

    • r <=> p
    • q <=> u
    • a <=> f
    • t </> f, as f is already associated with a

    By setting up a mapping between each visited letter in the crypto and plain words, we can tell when the unification would fail by looking at the previous mappings set up by the unification engine. So, let's start by doing a simple two-word compatibility test:

    (defun words-consistent-p (crypt-word plain-word)
      "Internally consistent?"
      (let ((mapping (make-hash-table))
            (reverse-mapping (make-hash-table)))
        (loop for crypt across crypt-word and plain across plain-word
          unless (gethash crypt mapping)
            do (setf (gethash crypt mapping) plain)
    
          unless (gethash plain reverse-mapping)
            do (setf (gethash plain reverse-mapping) crypt)
    
          never (or (not (char= (gethash crypt mapping) plain))
                    (not (char= (gethash plain reverse-mapping) crypt))))))
    

    It works by setting up a mapping for each letter in the word, as well as a reverse-mapping. Setting up only a (forward) mapping would work for qymm </> pufF, but give a false positive for qymM </> puff. That's why we need to look at the mappings on the right-hand side as well, i.e. the reverse mapping. That realization behind us, checking the words for consistency is a simple matter of filling the mappings and stop when a conflict is found.

    It also gave me some much-needed practice in abusing LOOP.

    Goal Solving

    By unifying all rules, a sought goal is reached. In our case, that would be a full mapping between encrypted and plain letters.

    Now, we can't reach our goal by just looking at word pairs. We also need to build up our constraint table, i.e. letter mapping, and continue solving for the other word pairs under the accumulated constraints. One way -- in fact, most likely the only way -- of doing that is to look at crypto words and the set of reasonable plain words associated with it, specifically, the ones of equal length (just a small readability optimization), and then trying to unify the crypto word with those plain words.

    The plan:

    1. Start with the first crypto word in the input
    2. Find all possible plain-text matches for that word
    3. For each word, check the pair for consistency, building up a mapping along the way.
    4. If a pair was found, save the mapping and go back to step 2.
    5. When there are no more crypto words in the input, save the mapping and use it to translate between crypto and plain-text words.

    WORDS-CONSISTENT-P needs to know how to communicate the results with its caller. Adding input mappings, we get (along with a helper function):

    (defun update-hash-table (this other)
      "Update this with the key-value pairs of other."
      (maphash #'(lambda (k v) (setf (gethash k this) v))
               other)
      this)
    
    (defun words-consistent-p (crypt-word plain-word mapping* reverse-mapping*)
      "Internally consistent?"
      (let ((mapping (make-hash-table))
            (reverse-mapping (make-hash-table)))
        (update-hash-table mapping mapping*)
        (update-hash-table reverse-mapping reverse-mapping*)
        (and
          ;; only return the new mapping if the words were consistent
          (loop for crypt across crypt-word and plain across plain-word
            unless (gethash crypt mapping)
              do (setf (gethash crypt mapping) plain)
    
            unless (gethash plain reverse-mapping)
              do (setf (gethash plain reverse-mapping) crypt)
    
            never (or (not (char= (gethash crypt mapping) plain))
                      (not (char= (gethash plain reverse-mapping) crypt))))
          (list mapping reverse-mapping))))
    

    Good. It now takes input mappings, checks the words for compatibility and returns the updated mappings.

    Reaching The Goal

    We now have a way to use the accumulated mapping in the calling program. Looking back at the proposed algorithm and just writing without doing much thinking, we might end up with something similar to the following almost-but-not-quite-there-yet piece of code:

    (defun solve-goal (crypto-words mapping reverse-mapping)
      (if crypto-words
        (dolist (plain-word (plain-word-list-from-crypted (first crypto-words)))
          (when (words-consistent-p plain-word (first crypto-words)
                                    mapping reverse-mapping)
              (solve-goal (rest crypto-words)
                          (first (words-consistent-p plain-word (first crypto-words)
                                                     mapping))
                          (second (words-consistent-p plain-word (first crypto-words)
                                                     mapping)))))
        mapping))
    

    Just reading it out loud, I think you'll get something quite similar to the original idea: stop when there are no words left, otherwise iterate through each plain word, and if it could be unified with the crypto word, continue trying to solve the goal for the rest of the input using the accumulated mappings.

    It still lacks some details, and could be less inefficient. Let's do something about that:

    (defun solve-goal (crypt-words &optional (mapping (make-hash-table))
                       (reverse-mapping (make-hash-table)))
      (if crypt-words
        (dolist (plain-word (plain-word-list-from-crypted (first crypt-words)))
          (let ((dicts (words-consistent-p (first crypt-words) plain-word mapping
                                           reverse-mapping)))
            (format t "~A <=> ~A? ~A~%" (first crypt-words) plain-word (if dicts "Yes" "No"))
            (when dicts
              (let ((final-mapping (solve-goal (rest crypt-words)
                                               (update-hash-table mapping (first dicts))
                                               (update-hash-table reverse-mapping (second dicts)))))
                         (when final-mapping
                           (return final-mapping))))))
        mapping))
    

    Let's run this:

    * (solve-goal *input*)
    bjvg <=> dick? Yes
    xsb <=> and? Yes
    hxsn <=> dick? No
    hxsn <=> jane? Yes
    xsb <=> and? Yes
    qymm <=> dick? No
    qymm <=> jane? No
    qymm <=> puff? Yes
    xsb <=> and? Yes
    rqat <=> dick? No
    rqat <=> jane? No
    rqat <=> puff? No
    rqat <=> spot? Yes
    xsb <=> and? Yes
    pnetfn <=> yertle? Yes
    #<HASH-TABLE :TEST EQL :COUNT 17 {AC1E799}>
    

    Looks good. To verify the mapping is OK, try to translate the crypto text:

    (defun translate-crypt-input (dictionary crypt-words)
      (let (words)
        (dolist (crypt-word crypt-words)
          (push (coerce (loop for c across crypt-word collecting (gethash c dictionary)) 'string)
                words))
        (format nil "~{~A~^ ~}" (nreverse words))))
    
    * (translate-crypt-input (solve-goal *input*) *input*)
    "dick and jane and puff and spot and yertle"
    

    Sweet! Let's try it with another data set where the solver needs to do more backtracking:

    (defparameter *input** '("rqat" "qymm" "bjvg" "xsb" "hxsn" "xsb" "qymm" "xsb" "rqat" "xsb" "pnetfn"))
    * (solve-goal *input**)
    
    rqat <=> dick? Yes
    qymm <=> dick? No
    qymm <=> jane? No
    qymm <=> puff? No
    qymm <=> spot? No
    rqat <=> jane? No
    rqat <=> puff? No
    rqat <=> spot? No
    NIL
    

    Hey! What happened? Once it has failed, it seems to just continue failing!

    Backtracking

    Backtracking is the concept of trying to reach a goal with the first item in a data set and continue moving towards that goal by unification, peeling off another item from the input on success, until the first failure. When that happens, back up one step in the input and try again with next item.

    As it turns out, we need to pass along a fresh set of mappings for each invocation of SOLVE-GOAL or the backtracking won't work. This concept maps nicely onto a recursive call chain. However, as noted, we can't allow for failures to propagate backwards, so we need to copy the mappings when passing them on.

    While we're at it, let's make SOLVE-GOAL clue us in on the current step of the unification process:

    (defun copy-and-update-hash-table (this other)
      (let ((new (make-hash-table)))
        (update-hash-table new this)
        (update-hash-table new other)
        new))
    
    (defun solve-goal (crypt-words &optional (mapping (make-hash-table))
                       (reverse-mapping (make-hash-table)) (level 0))
      (if crypt-words
        (dolist (plain-word (plain-word-list-from-crypted (first crypt-words)))
          (let ((dicts (words-consistent-p (first crypt-words) plain-word mapping reverse-mapping))
                (spaces (coerce (loop for i from 0 to (* 2 level) collecting #\Space) 'string)))
            (format t "~A~A <=> ~A? ~A~%" spaces (first crypt-words) plain-word (if dicts "Yes" "No"))
            (when dicts
              (let ((final-mapping (solve-goal (rest crypt-words)
                                               (copy-and-update-hash-table mapping
                                                                           (first dicts))
                                               (copy-and-update-hash-table reverse-mapping
                                                                           (second dicts))
                                               (1+ level))))
                         (when final-mapping
                           (return final-mapping))))))
        mapping))
    

    There! A test run should now give us a proper mapping, if the goal was reached:

    * (solve-goal *input**)
     rqat <=> dick? Yes
       qymm <=> dick? No
       qymm <=> jane? No
       qymm <=> puff? No
       qymm <=> spot? No
     rqat <=> jane? Yes
       qymm <=> dick? No
       qymm <=> jane? No
       qymm <=> puff? No
       qymm <=> spot? No
     rqat <=> puff? No
     rqat <=> spot? Yes
       qymm <=> dick? No
       qymm <=> jane? No
       qymm <=> puff? Yes
         bjvg <=> dick? Yes
           xsb <=> and? Yes
             hxsn <=> dick? No
             hxsn <=> jane? Yes
               xsb <=> and? Yes
                 qymm <=> dick? No
                 qymm <=> jane? No
                 qymm <=> puff? Yes
                   xsb <=> and? Yes
                     rqat <=> dick? No
                     rqat <=> jane? No
                     rqat <=> puff? No
                     rqat <=> spot? Yes
                       xsb <=> and? Yes
                         pnetfn <=> yertle? Yes
    #<HASH-TABLE :TEST EQL :COUNT 17 {AEBBB69}>
    

    It seems so! Let's verify:

    * (translate-crypt-input * *input**)
    "spot puff dick and jane and puff and spot and yertle"
    

    Nice!

    Notes

    Only the first goal will be reached, any other (possible) goals are discarded. Also, instead of hash tables, association lists and assoc/rassoc could be used. Less wasting could be accomplished with a stack where the failing result could be popped off. It could be written in a more idiomatic Common Lisp style.

    But that's for another day!


    6 Comments »

    Short Review of “Solved: The Riddle of Illness” (4th Ed.) by Stephen Langer

    Friday, January 30th, 2009 about ,

    Are you intolerant to cold? Do you have high cholesterol? Feeling tired often? Got the blues? Hard time concentrating, or problems reading at night?

    It could be your thyroid.

    Hypothyroidism, low metabolism, is a hard-to-spot condition that manifests itself in nearly as many ways as the number of patients suffering from it. This book aims to explain common ailments people tend to have today, and how there might very well be a large number of people that are, in fact, suffering from the same underlying problem, despite different diagnoses. Many diagnoses, such as fibromyalgia, chronic fatigue syndrome, and even the common depression, are to blame on today's laboratory tests where patients earlier found hypothyroid now do not suffer from that but instead something else.

    It is no wonder, then, why Broda O. Barnes, leading endocrinologist specialized on the thyroid gland, picked the title "Hypothyroidism: The Unsuspected Illness" for his 1976 book. Around that time, synthetic drugs were introduced to the market, where desiccated thyroid was previously used. Relying on the (nowadays) exact test results instead of noting the morning under-arm temperature, the clinical findings (i.e., the patient's story) as well the patient's medical history, has lead many to be proclaimed healthy and instead being told "it's all in your head", "exercise more", and similar.

    Moreover, Langer, with over a decade of experience treating hypothyroid patients, discusses how he in addition to thyroid hormone treats his patients with mineral and vitamin supplements, often deficit in patients. But most of all, he gives examples of patients and their symptoms, and how they were successfully treated, where earlier doctors did not. Throughout the text, numerous studies and articles published in well-renowned medical journals, such as New England Journal of Medicin (NEJM) and Journal of the American Medical Association (JAMA), are used as references, backing the claim he makes in the book.

    Reading this book I marked some passages I found informative, which should hopefully give you a taste of the book to make the decision to buy it yourself. However, I only started doing so midway through the book. Also, I did not cover in depth some of the chapters, such as the ones on typical female problems.

    Below follows a list of chapters, some with selected parts copied in.

    1. Special Note

      (...) certain conditions other than hypothyroidism (such as chronic viral infections) can reduce a person's basal body temperature, too. Therefore, it is incument (...) perform a complete battery of thyroid tests -- total and free T3, T4, TSH, and antithyroid antibodies, anti-TPO, antithyroglobulin -- in addition to the basal temperature test.

    2. "Nothing Organically Wrong"

      "If your thyroid function is normal, your [morning] temperature should be in the range from 97.8F (36.5C) to 98.2F (36.8C) degrees. If it's lower, you're probably hypothyroid." The treatment--Armour Thyroid--brought gratifying results (...) ecstatic about painless menstruation and normal body temperature

    3. Why So Much Hidden Hypothyroidism?

    4. What's Sabotaging Your Thyroid?

    5. Care and Feeding of the Thyroid

    6. The Great Controversy: Synthetic Versus Natural

      In this age of stress, the adrenal glands of many--if not most--people are overworked and weakened. Even mild adrenal insufficiency can slow down this conversion [T4 to T3]. (...) If this T4 conversion doesn't happen, the patient experiences symptoms of an overactive thyroid gland: rapid heartbeat, palpitations and increased sweating.

    7. Body Heat

      Dr. Broda Barnes never thought of himself as a maverick. It was obvious to him that natural thyroid would treat hypothyroidism more effectively than the synthetics. It was also obvious to him that temperature should be a major consideration in diagnosing hypothyroidism. After all, he had seen the normal rabbit grow cold, shivering and sick after its thyroid gland had been removed.

    8. Thyroid and Sex -- for Women

    9. Thyroid and Sex -- for Men

    10. How to Enhance Fertility and Pregnancy

    11. Thyroiditis: A Growing Menace

      What are Hashimoto's thyroiditis' classic symptoms?

      1. Deep fatigue (...) go to sleep exhausted and wake up even more so.
      2. Depression. (...)
      3. Memory loss, characterized by severe problems with recent memory and ability to concentrate (...)
      4. Nervousness ranges from mild anxiety to full-blown panic attacks (...) Many patients (...) tell me, "I have no reason I know of to feel this way. Something's wrong physically, (...)"
      5. Allergies, food and environmental.
      6. Heartbeat irregularity and palpitations
      7. Muscle and joint pains
      8. Sleep disturbances and insomnia
      9. Reduced sex drive
      10. Menstrual problems
      11. Suicidal tendencies
      12. Digestive disorders.
      13. Headaches and ear pain
      14. Lumps in the throat
      15. Difficulty swallowing

      Usually any elevation of antithyroid antibodies is significant. My policy is to treat patients medically for thyroiditis even when they have just a small elevation of antithyroid antibodies, if they also present sypmtoms of this disorder. I emphasize this point, because many doctors become interested in this condition only if the antibody level is sky high.

      During this trying period, she had been hospitalized for six months in a psychiatric unit and treated with lithium, a major anti-depressant, and had numerous rounds of shock therapy. (...) Noting that her thyroid levels were normal but that she had an elevation of antithyroid antibodies, I treated her with (...) a quarter grain of Armour Thyroid (..). Within ninety days, all of her major symptoms were under control, and she was on the road to recovery.

      (...) my clinical experience leads me to believe that Hashimoto's thyroiditis is caused, in part, by viral infections such as chronic Epstein-Barr virus [kissing disease].

    12. How to Beat Hyperthyroidism

    13. Selenium Deficiency and Hypothyroidism

      However, the T4 to T3 conversion requires the catalytic selenoenzyme iodothyroninedeiodenase. As a consequence, T4 and T3 deficiencies together are commonest in individuals living in environments depleted in both iodine and selenium.

    14. A New Look at Iodine

    15. Better Skin, Better Living

    16. Mind and Emotion: The Thyroid Connection

      (...) even in seemingly mild cases of myxedema, there is an underlying irritability and hostility, in addition to mental and physical sluggishness.

      Dr. Hoskins noted a chip-on-the-shoulder attitude, an abnormal responsiveness to petty annoyances (...) retarded ability to think, inability to concentrate, introversion, and failing memory.

      Subclinical hypothyroidism can remain latent for years and not show itself in emotional or mental symptoms until after severe stress.

    17. Reversing Depression

      In examining 350 inpatients and 44 outpatients at Fair Oaks Hospital in Summit, New Yersey, Dr. Mark Gold, MD, found a "significant incidence of low-level hypothyroidism", convincing him that depression is often the first sign of low-level thyroid failure not always detectable by the usual thyroid function tests. Traditional blood tests for thyroid function in depressed patients revealed only 10 percent hypothyroids.

      During the 1950s, blood tests came into vogue and were not always positive for hypothyroidism. Patients were told that they no longer needed thyroid, and most of them suffered decades of unnecessary depression, anxiety, and physical discomfort and limitation.

      "I do have good days and weeks, sometimes months. But it's worse this winter than last"

    18. Medical Look-Alikes: Hypoglycemia and Hypothyroidism

      Another piece of evidence is that blood cholesterol is usually high in hypothyroidism.

    19. Diabetes: A Preventable Illness

    20. How to Prevent a Heart Attack -- Your Own!

      My experience with many patients is that elevated cholesterol is often caused by hypothyroidism, even subclinical hypothyroidism.

      [I. B. Friedland] concluded that thyroid hormone controls blood fat and cholesterol levels and recommended thyroid therapy in human beings with elevated fats in the blood serum.

      Some experts suggest "that patients with high cholesterol should be assessed for thyroid function before they are given cholesterol-lowering agents," continues the report.

    21. Be Kind to Your Arteries!

      The relationship between low thyroid function and high serum cholesterol level found by three researchers, E. F. Gildea, C. B. Mann, and J. P. Peters, indicates that a serum cholesterol level below 275 mg/l (7 mmol/l) practically excludes the diagnosis of hypothyroidism.

      "On the average, the rise in cholesterol is approximately four times as great as the drop in metabolism."

    22. Dramatic Treatment for Circulatory Problems

      "I find articles and books making the nonsensical statement that diabetes aggrevates or accelerates hardening of the arteries," Dr. Barnes said. "No way! Hypothyroidism is perhaps the leading cause of this condition."

    23. Guard Yourself Against Cancer

      Subnormal thyroid function appears to invite cancer.

    24. Alzheimer's Disease or Something Else?

      "I'm so forgetful. I sometimes forget where I parked my car at the supermakret--or even that I have a car. It's so hard for me to think that I almost have to push thoughts around in my brain by strength of will."

    25. Better Coping with Menopause

    26. Is Fibromyalgia Really Incurable?

      One study Dr. Lowe conducted of thirty-eight fibromyalgia patients revealed that twenty-four (63.2 percent) were deficient in thyroid hormones (...).

      Even if your TSH is within the so-called normal range, Dr. Lowe is convinced that you could still be suffering from one or more of sixty-four major symptoms of hypothyroidism

      Four false beliefs held by most doctors make it possible for you to be in what is called "the normal range" and still be hypothyroid:

      1. The sole cause of thyroid deficiency symptoms is hypothyroidism.
      2. (...)
      3. Hypothyroid patients should only be permitted to use synthetic T4 (levothyroxine formulas such as Synthroid and Levoxyl [and Levaxin]).
      4. Patients' replacement dosages should be limited only to amounts that keep the TSH within the normal range.

      (...) inadequate thyroid hormone regulation of many patients (...) doctors conclude that the illness is something differentt, such as fibromyalgia or chronic fatigue syndrome.

      "You know, come to think of it, I remember having these symptoms off and on since I was in my early teens" [says one patient]

      "I have found that many hypothyroid patients also have cellular resistance to thyroid hormone," states Dr. Lowe. "Most of these patients don't benefit from T4 alone, but some of them do from desiccated thyroid, presumably because of the relatively high T3 content (...) However, we've stopped altogether giving patients T4 alone."

    27. Stress and Free Radicals

      (...) chlorine and fluoride in the water supply, (...)

      Unfortunately, some doctors still supplement low thyroid patients only with synthetic T4 on the erroneous assumption that conversion to T3 is automatic. When they fail to respond, the doctor may conclude that they are not hypothyroid, after all, and offer no treatment, causing frustration, accelerated stress, and continued symptoms of hypothyroidism.

    28. Overweight? How to Be a Good Loser

      It is possible to be hypothyroid even with an adequate thyroid hormone output because of biochemical differences in the receptor sites in our cells, and this condition will show up on the basal temperature test.

    29. Tobacco and Alcohol: Thyroid Gland Enemies

      (...) thiocyanate is a suppressor of the thyroid gland.

    30. How to Thrive in a Polluted World

      However, several authorities now advocate a one-to-one ratio: 1,000 mg of magnesium to 1,000 mg of calcium, for example.

      "Studies have documented that mercury causes hypothyroidism, damage of thyroid RNA, autoimmune thyroiditis, and impairment of conversion of thyroid hormone T4 to the active T3 form....Mercury blocks thyroid hormone production by occupying iodine-binding sites and inhibiting hormone action even when the measured thyroid levels appear to be in the proper range."

    31. Live Longer, Healthier, and Younger

      A Harvard University study showed that two-thirds of 312 patients with arthritis were hypothyroid.

    32. Some Things You Ought to Know...

      Hashimoto's thyroiditis runs in families, and most individuals afflicted are between the ages of thirteen and forty-three. Symptoms range from mental to physical: a faulty memory; difficulty itn thinking; depression; nervousness; allergies; diminished interest in sex; (...) alternating constipation and diarrhea, pain in joints and muscles (...), headaches.

    33. For Doctors Only

      To ignore the the thyroid connection, however, is merely (...) not to treat the underlying causative factor of their illnesses. Simple examples of this are patients with recurrent infections who are chronically treated with antibiotics.

      More than a hundred years of research has established a definite relationship between subnormal temperature, no matter how slight, and hypohtyroidism.. Broda O. Barnes, MD, PhD, (...). A clinical researcher in hypothyroidism for half a century, Dr. Barnes published more than a hundred papers on his investigations in the most reputable medical journals.

      Through the years, he found a much higher correlation of low BMR results with his patients' basal metabolic temperature than with results of any other test for hypothyroidism. In addition, many of these clinically hypothyroid patients actually had euthyroid blood tests.

      Basal temperature range reading is between 97.8F (36.5C) to 98.2F (36.8C). A lower temperature indicates possible hypothyroidism. The main complaint I encounter from physicians is that the basal temperature test is unscientific; they feel that hypothyroidism can be diagnosed only by the standard laboratory blood work. That is exactly what I once thought.

      (...) natural, desiccated thyroid preparation, as I do, based on the premise that what's natural is more complete and, so, should provide better clinical results. In a short time, my energy level increased. My ability to concentrate improved dramatically, and many minor, nagging symptoms disappear.

      The subtle development of hypothyroidism, too, makes diagnosis difficult. (...) Hypothyroidism is often such an extremely subtle disease that physicians misinterpret its symptoms, states Gerald S. Levey, MD, (...) in a journal article, "Hypothyroidism: A Treacherous Masquerader."

      Hypothyroids characteristically have thick and puffy skin, due to an accumulation of a mucinlike substance (...) which binds water. (...) The hypothyroid's common problems are loss of appetite with either no weight loss or an acual weight increase (...)

      Neurologically, the hypothyroid (...) often suffers decreased circulation to the brain, which may contribute to a generalized slowing of all intellectual functions, including speech. These persons frequently lack initiative and may even be described as slow-witted. Memory frequently appears impaired, (...) an increased level of irritability. Sleepiness is another common symptom.

      Hypothyroidism should always be considered in the differential diagnosis of children who are hyperactive.

      Many low-thyroid patients complain of night-blindness. (...) Slurred speech and hoarseness are likewise found occasionally in hypothyroidism, due to a buildup of mucopolysaccharides in the tongue and the larynx.

      The most common complaint of the hypothyroid adult male involving the reproductive system is a general dimunition of sex drive and libido.

      (...) vague muscular and articular pains as well as coldness and stiffness of the extremeties (...) are often worse in the morning or after immobilization and are exacerbated by cold and dampness.

    34. Conclusion

      (...) and are often dismissed with such remarks as, "It's all in your head," "Go home and live with it," "You're depressed," "You're under stress," "It's just middle age," "This happens to elderly," "or "Everyone has the same complaints."

      Even worse, some are started on antidepressants or tranquilizers--a practice not unlike removing a flashing red light from your car's dashboard and feeling that the mechanical problem indicated has been solved.


    I dearly recommend this book (89 SEK at Bokus.com) to anyone with a diffuse feeling of "there's something wrong", or possibly even suffering from a specific problem in the list.

    Knowledge is power.


    4 Comments »

    Hash Tables and a Wee Bit of Sugar in Common Lisp

    Monday, January 26th, 2009 about ,

    Update 2009-01-26: Zach Beane pointed out that &rest lists are useful. The reader macro was written by Rainer Joswig in a Reddit-comment. Cookies to Zach and Rainer!

    There's been some discussion in the Reddit crowd about the supposed nasty syntax of Common Lisp's hash tables. Well, there is no hash table syntax, only function calls. Compare the Python version:

    >>> dict([("Abe", 26), ("Lincoln", 25)])
    {'Lincoln': 25, 'Abe': 26}
    

    to the Lisp version:

    (let ((h (make-hash-table :test 'equal)))
      (setf (gethash "Abe" h) 26
            (gethash "Lincoln" h) 25)
      h)
    

    Alright, a bit tedious. There is precious little sugar in Lisp. What you can do, instead, is to make a small convenience function. It was suggested at Response to: Problems with Lisp to make a fairly straight-forward translation of alists into hash tables:

    ({} '(("Lincoln" . 26) ("Abe" . 25)))
    

    A bit verbose, though, and if we're going to throw away the extra conses, there's really no point in making it an explicit alist. We might as well use a prettier syntax, how about:

    (defun {} (pairs)
      (let ((h (make-hash-table :test 'equal)))
        (loop for (key value) on pairs by #'cddr do (setf (gethash key h) value))
        h))
    

    Usage:

    * ({} '("abe" 26 "lincoln" 25))
    #<HASH-TABLE :TEST EQUAL :COUNT 2 {...}>
    * (loop for key being the hash-keys of *
      do (format t "~A is ~A years old~%" key (gethash key *)))
    
    abe is 26 years old
    lincoln is 25 years old
    

    Better?

    Yes, but we can make it better yet. How about just throwing all arguments into a list? Great for the trivial case where we just want a simple hash table. Enter &rest argument lists:

    (defun {} (&rest pairs)
      (let ((h (make-hash-table :test 'equal)))
        (loop for (key value) on pairs by #'cddr do (setf (gethash key h) value))
        h))
    

    And we got rid of the enclosing list:

    ({} "abe" 26 "lincoln" 24)
    

    Excellent! Reader macro version left as an exercise to the reader...


    7 Comments »

    Ät mer vitamin Dejlig!

    Saturday, January 24th, 2009 about ,

    I dagens GöteborgsPosten kan vi läsa att en ny studie från geriatrikavdelningen på Sahlgrenska i dagarna bekräftat vad andra studier också observerat:

    Hög nivå av D-vitamin i blod-serum är relaterat till inte bara längre livslängd utan också bättre muskelstyrka, ökad lungvolym och bentäthet samt mindre benägenhet för inflammationer. Ämnesomsättningen påverkas positivt och risken för diabetes minskar, berättar Dan Mellström.

    Uppdaterad 2009-02-24: Vi kan i GP, DN m.fl. genom TT läsa att D, och inte C, är vitaminet mot förkylning.

    Supervitaminet?

    Många av de undersökningar som gjort visar att D-vitamin -- särskilt stora doser, ungefär 7000 IE (180 mikrogram) per dygn -- har en rad hälsobefrämjande effekter på andra områden, som till exempel:

    • minskar risken för, och förhindrar förekomsten av, många former av cancer
    • tros förebygga autism hos barn
    • lindrar depression bättre än ljusbehandling

    En annan ganska färsk studie har dessutom visat att människor som lider av depression blir bättre av ett högre intag D-vitamin, där de fått 50'000 D3/vecka i ett år i sträck. De har sedan mätt upp olika depressionsmarkörer och funnit att de med nivåer över 40 mikrogram per liter har avsevärt färre. Det är mycket hoppfullt, och förhoppningsvis kommer även Sverige ikapp: 9-38 mikrogram per liter är intervallet du skall ligga mellan i Sverige. Med nyare forskningsrön kommer de justeras uppåt. Som jämförelse, efter några månader med 50'000 D3/vecka, var mina blodnivåer 106 mikrogram per liter.

    Hur skall man då få i sig såna mängder?

    Vitamintabletter innehåller bara 300IE (7,5 mikrogram) D-vitamin och är verkningslösa. Tyvärr räcker det inte heller att vara ute i solen, mellan september-oktober och mars-april bildas ingen D-vitamin i huden på våra breddgrader:

    Det finns övertygande studier från flera håll i världen som visar att så låga doser som 7,5 mikrogram inte har någon effekt alls, säger psykiater Mats Humble, som tillsammans med kollegan Susanne Bejerot i somras därför föreslog utlysning av en nationell informationskampanj om D-vitamin.

    Holistics (finns på hälsokostbutiker) har D-vitamin som innehåller 2000IE (50 mikrogram).

    Livsmedelsverket agerar bromskloss

    Tyvärr ser det ut som att inte att Apoteket kommer att få börja sälja D-vitamin i verksamma substanser än på ett tag:

    Första steget är att uppnå de rekommendationer som finns, säger Wulf Becker på Livsmedelsverket.

    ...och hur skall man uppnå de rekommendationerna, Wulf Becker, när det i praktiken inte finns etablerade medel att uppnå dem med?

    Med ett standardsvar som vid det här laget börjar likna tobaksindustrin förr så hackiga skiva om kravet på fler studier fortsätter de att gå hand i hand med läkemedels- och livsmedelsindustrin. Dan Mellström kommenterar:

    Forskningsresultaten pekar tydligt i en riktning. Det är väldigt starka data [...] utöver observationsstudierna även ha genomfört behandlingsstudier (där deltagarna exponeras för viss ändring i kosten, exempelvis i form av kosttillskott). Men sådana studier kostar mycket pengar. Eftersom D-vitamin är billigt att tillverka och inte inbringar stora vinster är läkemedelsbolagen inte särskilt intresserade av att bekosta dem. Kanske skulle staten göra det istället?

    Ja, vi får väl se.


    2 Comments »

    I Like Macros

    Monday, September 29th, 2008 about ,

    Here's code to stuff away attributes for people from LDAP. I just happened to have that code lying around and fiigured it'd be useful for others.

    There has been confusion over a supposed runtime penalty of macros over at Lispit, so I'll try clarify that at the end.

    In The Beginning, There Was Uglyness

    We begin with the code I started with. Lots of duplication:

    (defun ldap-users ()
      (let ((people (make-hash-table :test 'equal)))
        (ldap:dosearch (ent (ldap:search *ldap* "(&(telephonenumber=*) (cn=*))"))
                       (let ((mail  (car (ldap:attr-value ent 'mail)))
                             (uid   (car (ldap:attr-value ent 'uid)))
                             (name  (car (ldap:attr-value ent 'cn)))
                             (phonenumber (car (ldap:attr-value ent 'telephonenumber))))
                          (setf (gethash uid people)
                                (list mail name phonenumber))))
        people))
    

    You can think of a "let binding" as a local variable, that disappears outside the LET form. Notice the form of the bindings -- they are very similar, differing only in the attribute of the LDAP entity and the name ("local variable") to bind the value to. Useful, but a bit verbose and contains duplication.

    On the Quest for Beauty

    Now, wouldn't it be nice if we didn't have to have all that duplication? A common idiom is is WITH-... macros, that binds values based on an expression that you can grab the valeus from. Let's introduce our own macro that works like that, WITH-LDAP-ATTRS, and replace it in our original code.:

    (defun ldap-users ()
      (let ((people (make-hash-table :test 'equal))) ; equal so strings compare equal!
        (ldap:dosearch (ent (ldap:search *ldap* "(&(telephonenumber=*) (cn=*))"))
                       (with-ldap-attrs (mail uid name phonenumber) ent
                           (setf (gethash uid people)
                                 (list mail name phonenumber))))
        people))
    

    Did you see how a bunch of lines suddenly disappeared, and was replaced with just one single line? How to do this? Using macros, of course -- code that writes code! Macros in Lisp is a totally different animal than the ones you can find in C/C++ through the use of the pre-processor: here, you can run real Lisp code (not the #define fluff in cpp) that generates Lisp code, before the other code is compiled. Macros can use any real Lisp code, i.e., ordinary functions. Essentially no limits.

    Getting Rid of Ugly

    So, let's see how this was done. To replace one attribute, we define a function:

    (defun ldap-attr (entity attr)
      `(,attr (car (ldap:attr-value ,entity ',attr))))
    

    The backquote syntax looks a bit hairy, but what it does is easy. When you call LDAP-ATTRS, it'll spit out a list that contains the value of attr (that's the comma), followed by car ("first element in the list" (cons pair, actually), and there is in fact a function called first you can use, too), which receives the first value in the list returned by ldap:attr-value. Because this isn't code we want to run when we compile the code (getting the attribute values is what we want to do when we run the program), we don't add a comma before the call.

    Anyway. Moving along, to the rest of the macro:

    (defmacro with-ldap-attrs (attrs ent &rest body)
      `(let ,(loop for attr in attrs
             collecting `,(ldap-attr ent attr))
         ,@body))
    

    The ,@-syntax is to put the contents of a list somewhere, instead of the actual list.

    Result

    You can easily verify that this will give you the right thing. Macros are often written this way: you start off with code you want to make simpler (the output), what you want to write instead (the input), and then you start molding the macro until your input gives the correct output. The function macroexpand-1 will tell you if your macro is correct:

    (macroexpand-1 '(with-ldap-attrs (mail phonenumber) ent
                      (format t "~a with ~a" mail phonenumber)))
    

    evaluates to:

    (let ((mail (car (trivial-ldap:attr-value ent 'mail)))
          (phonenumber (car (trivial-ldap:attr-value ent 'phonenumber))))
      (format t "~a with ~a" mail phonenumber))
    

    If you compare the LET-bindings of the expanded macro with the code in the beginning, you'll find that it is in the same form!

    Compile-time vs Runtime: Macros vs Functions

    A macro is code that is run at compile-time, with the added twist that they can call any ordinary function or macro as they please! It's not much more than a fancy filter, taking some arguments, applying some transformations and then feeding the compiler the resulting s-exps.

    Basically, it lets you write your code in verbs that can be found in the problem domain, instead of low-level primitives from the language! As a silly example, consider the following (if when wasn't already a built-in):

    (defmacro my-when (test &rest body)
      `(if ,test
         (progn ,@body)))
    

    if is a built-in primitive that will only let you execute one form in the branches, and if you want to have more than one, well, you need to use progn:

    ;; one form
    (if (numberp 1)
      (print "yay, a number"))
    
    ;; two forms
    (if (numberp 1)
      (progn
        (assert-world-is-sane t)
        (print "phew!"))))
    

    With our new friend, my-when, we could both a) use the more appropriate verb if we don't have a false branch, and b) add an implicit sequencing operator, i.e. progn:

    (my-when (numberp 1)
      (assert-world-is-sane t)
      (print "phew!"))
    

    The compiled code will never contain my-when, though, because in the first pass, all macros are expanded so there is no runtime penalty involved!:

    Lisp> (macroexpand-1 '(my-when (numberp 1)
                            (print "yay!")))
    
    (if (numberp 1)
      (progn (print "yay!")))
    

    Note that macroexpand-1 only does one level of expansions; it's possible (most likely, in fact!) that the expansions continues further down. However, eventually you'll hit the compiler-specific implementation details which are often not very interesting. But continuing expanding the result will eventually either get you more details, or just your input s-exp back.

    Hope that clarifies things. Macros is a powerful tool, and one of the features in Lisp I like.


    1 Comment »

    A Silly Consumer/Producer

    Monday, September 29th, 2008 about ,

    The ten-minute, naive, consumer/producer design pattern in CLOS. Observations:

    • standard-method-combination gives :after, which is a nice way of hooking onto superclasses.
    • multiple dispatch lets me spend my time doing more important things than thinking of what class a method should belong to.
    • interactive and iterative development is extremely fast and keeps me in the zone, thanks to the lack of a edit-compile-fix-run cycle.

    Framework

    (defclass producer ()
      ((consumers :accessor consumers
                  :initform '())))
    
    (defgeneric add-consumer (producer consumer)
      (:documentation "Add a consumer (a function taking one argument)
      to a broadcast's list of interested parties"))
    
    (defgeneric remove-consumer (producer consumer)
      (:documentation "Reverse of add-consumer"))
    
    (defgeneric broadcast (producer object)
      (:documentation "Broadcast an object to all registered consumers"))
    
    (defmethod add-consumer (producer consumer)
      (pushnew consumer (consumers producer)))
    
    (defmethod remove-consumer (producer consumer)
      (let ((consumers (consumers producer)))
        (setf consumers (remove consumer consumers))))
    
    (defmethod broadcast (producer object)
      (dolist (consumer (consumers producer))
        (funcall consumer object)))
    

    Example subclass

    (defclass direct-producer (producer)
      ((latest-broadcast :accessor latest-broadcast)
       (latest-broadcast-p :initform nil))
      (:documentation "I broadcast the latest broadcasted object when a new consumer is added"))
    
    (defmethod add-consumer :after ((producer direct-producer) consumer)
      (when (slot-value producer 'latest-broadcast-p)
        (funcall consumer (latest-broadcast producer))))
    
    (defmethod broadcast :after ((producer direct-producer) object)
      (setf (slot-value producer 'latest-broadcast-p) t)
      (setf (latest-broadcast producer) object))
    

    Example code

    Lisp> (let ((producer (make-instance 'producer)))
            (add-consumer producer
                          #'(lambda (obj) (format t "I got myself a ~A object!~%" obj)))
            (add-consumer producer
                          #'(lambda (obj) (format t "I has object: ~A~%" obj)))
            (broadcast producer 'cheezburger))
    
    I has object: CHEEZBURGER
    I got myself a CHEEZBURGER object!
    
    Lisp> (defparameter *direct-producer* (make-instance 'direct-producer))
          (add-consumer *direct-producer*
                      #'(lambda (obj) (format t "I got myself a ~A object!~%" obj)))
          (broadcast *direct-producer* 'kitty)
    
    I got myself a KITTY object!
    
    Lisp> (add-consumer *direct-producer*
                        #'(lambda (obj) (format t "I has object: ~A~%" obj)))
    
    I has object: KITTY
    

    No Comments »

    Tre enkla steg till hälsa och viktkontroll!

    Sunday, September 28th, 2008 about , , ,

    /static/2008/09/frukt-small.jpg

    Det talas mycket om olika dieter i media och det är svårt att säga vilken man skall gå efter: GI, Viktväktarna eller medelhavskost? Kanske rentav en rivstart som Cambridge eller Naturdiet, för att sparka igång förbränningen?

    Egentligen är det inte alls särskilt svårt! I den här artikeln ger jag tips på när det är bäst att träna, vilken sorts mat du bör äta, samt ett menyförslag du själv kan variera.

    Det är viktigt att du läser igenom hela artikeln! Om du har tidsbrist, prioritera Meny och Resultat!

    Bra näringskällor

    Se till att hålla en kost som innehåller balanserade mängder magra proteinkällor, fiberrika kolhydratkällor som fullkornspasta, fullkornsris och quinoa, samt försök undvika mättade fetter (t.ex. smör). Använd vegetabiliska oljor i matlagning, och gärna margarin att steka i. Med en teflonpanna kan du skära ner på stekfettet ytterligare.

    Måltidsoptimering och träning

    1. Börja dagen med ett träningpass på tom mage. När glukosförråden är tomma i kroppen kommer energin nämligen att tas från det lagrade kroppsfettet.
    2. Ladda sedan depåerna & hjälp musklerna till återhämtning med en nyttig frukost.
    3. Ät en ordentlig lunch, och ta gärna en powernap efter maten. Du blir mer produktiv om du inte är sömnig!
    4. Glöm inte mellanmål när blodsockret sjunker och du börjar känna dig hängig. På så vis orkar du det där lilla extra.
    5. Middagen bör innehålla en stor del av dagens totala energiintag. Ät gärna lite senare på kvällen, så sparar du in kalorierna från kvällsmaten. Det är lättare att sova när du inte är hungrig. Om du ändå skulle bli hungrig, ta ett litet mellanmål som kvällsmat.

    Maten

    /static/2008/09/kyckling-medium.jpg

    Det är viktigt att tänka på vad man äter, och jag anser att Livsmedelsverkets rekommendationer är alldeles för frikostiga vad gäller fett, och samtidigt riskerar att man får i sig för lite fibrer. De rekommenderar att 25-35E% (ungefär en tredjedel) av all energi du får i dig under en dag kommer från fett. Ungefär 10-15 procent är mer rimligt. Protein är något annat du inte skall få i dig för mycket av, eftersom det är skadligt för njurarna att äta för mycket.

    Kolhydrater är lite för lågt räknat, så ät gärna lite extra bröd och frukt. Frukt är viktigt för sitt vitamininnehåll, viktiga antioxidanter, hjälper på eftermiddagen när blodsockret har sjunkt och innehåller mycket fibrer som är bra för magen.

    Vad skall du då äta? För att du skall få i dig rätt mängd av de tre grupperna protein, fett och kolhydrater kan du välja bland maten i listan nedan.

    • Magra och nyttiga proteinkällor
      • kyckling och kalkon
      • mager skinka
      • magert nötkött, max 10%
      • fettsnåla (5-10%) ostar
      • lightkeso
    • Nyttiga fetter från växtriket
      • olika oljor, som solrosolja och rapsolja
      • om du måste ha smör på smörgåsen, välj ett margarin som Becel, med kolesterolsänkande effekt.
    • Fiberrika kolhydratkällor
      • quinoa
      • bulgur, couscous (gärna fullkorn!)
      • matvete
      • pasta
      • potatis
      • musli, flingor, havregryn
      • all frukt & bär, gärna banan (bra till frukostgröten!)

    Meny

    /static/2008/09/frukost-small.jpg

    Att räkna på energiprocent kan vara lite omständligt, så här får du en meny som hjälp på traven!

    Frukost:Havregrynsgröt med lingonsylt och minimjölk. En grov smörgås, kaffe, juice och ett kokt ägg (men se upp med kolesterolet).
    Mellanmål:Frukt, vad som finns tillgängligt. Söta krispiga äpplen som Royal Gala är goda.
    Lunch:Pastakycklingsallad med en fräsch tomatsalsa, och en frukt efteråt. (Undvik feta såser!)
    Middag:Ugnsrostad potatis, en bit lax och en sallad bestående av många rostade grönsaker. Sås gjord på lätt-cremefraiche, gärna Viktväktarnas magra variant med 5% fetthalt.
    Kvällsmat:En smörgås med lättmargarin, mager ost och några skivor paprika.

    Följer du mina råd med regelbunden träning och nyttig, mager mat, kommer du på snart uppnå resultat!

    Resultat

    Genom att äta som en sumobrottare med en låg andel fett och en hög andel kolhydrater kommer du sakta men säkert att öka i vikt.

    Vänta nu, sumobrottare?

    Ja, sumobrottare.

    De får den allra största delen av sin energi från ris, nudlar och öl, vilket lätt kan översättas till quinoa, fullkornspasta och frukt i vår del av världen.

    Sumobrottare Livsmedelsverket
    Kolhydrater 70 E% 60 E%
    Protein 15 E% 10 E%
    Fett 15 E% 30 E%

    Visst ser det ut som att sumobrottaren lever sundare med så lite fett i sin diet? Och är inte de två kosthållningarna väldigt lika varandra?

    Visst äter sumobrottare mycket mer mat än de flesta andra -- trots det fungerar mekanismerna bakom precis lika bra om du äter normala portioner! Om du ändå börjar öka i vikt, dina trogna försök att följa GI och Viktväktarna till trots, och därför börjar äta mindre mat leder det till att du får i dig för lite protein med resultatet att du går ner i vikt i form av mestadels muskelmassa, men i stort sett bibehållen mängd kroppsfett.

    Dessutom kommer du ha en förhöjd halt av kroppens stresshormon, kortisol, som utsöndras vid svälttillstånd. Det stänger effektivt av fettförbränningen.

    En längre förklaring till de tre stegen

    När du sover ställer kroppen ner förbränningen, och genom att inte äta när du vaknar kommer kroppen fortsätta ha en låg förbränningstakt, eftersom den inte vet nästa gång maten kommer. Träning på tom mage förstärker ytterligare den effekten. Det blir segt att träna och kroppen förbränner mindre energi. En tupplur efter en ordentlig lunch kommer hålla insulinnivån hög eftersom du inte använder musklerna lika mycket när du sover, som annars hade kunnat tagit hand om en del av blodsockret och undvika insulinhöjningen. Mellanmålen efteråt gör att insulinnivån underhålls till en konstant hög nivå, vilket gör att blodsockret lagras in i fettcellerna samtidigt som det spärrar utflöde från fettcellerna.

    Tittar vi på matrekommendationerna och menyn har vi en hög andel kolhydrater som ser till att hålla insulinnivån på en konstant hög nivå för att se till att kroppsfettet inte används i onödan.

    Frukt

    Äpple, päron, banan, apelsin och andra frukter innehåller ungefär samma fördelning av socker (fruktos, glukos) som i läsk (se [frukt]). Utöver sockret är C-vitamin det som är meningsfullt att få i sig från frukt. Tyvärr innehåller apelsin (som har ungefär samma mängd socker som läsk) bara 83 mg/100g apelsin. Broccoli är en bättre kandidat, med samma vitamininnehåll och 3g kolhydrater, varav <2g är enkla sockerarter.

    För att ta ett välkänt exempel ur naturen: björnar lägger om sin kost till största delen bär och frukt på hösten, vars uppgift är att ha en jämnhög insulinnivå så att maximalt med energi lagras in som fett för att överleva vintern. Samtidigt som insulinet förhindrar det fett som redan har lagrats in i kroppen att användas som energikälla.

    Fibrer

    Icke-lösliga växtdelar, som bark och rå potatis. Vi kan inte tillgodogöra oss någon näring från det, och de irriterar tarmgångar. Uppvärmning bryter ned cellulosan växtcellerna är gjorda av till enklare sockerarter vi kan tillgodogöra oss. De med IBS-symptom har särskilt stora problem med fiberrik mat. Har man problem med trög mage har en större mängd fett i maten samma effekt som fibrer.

    Vegetabiliskt fett

    Det finns bl.a. två fettsyror som vi människor behöver: omega 3 och omega 6, vilka vi bör äta i proportionerna en del omega 3 och max två delar omega 6. I själva verket innehåller alla vegetabiliska fetter (förutom rapsolja) tjugo till hundra gånger så mycket omega 6 som omega 3. Omega 6 är inflammationshöjande, och ger upphov till ett sämre immunförsvar med bl.a. förkylningar som följd.

    Vidare behöver de flesta människor som inte bor i soliga länder ett extra tillskott av vitamin D för att fungera ordentligt, främst D3 som finns i animaliska fetter. Det krävs stora mängder D2 (vegetabiliskt) för att få samma effekt som det animaliska D3. Brist på fett kommer ge en brist på D-vitamin som utöver korttidsproblem som förkylningar och depressioner ger problem på lång sikt, såsom benskörhet då kroppen inte kan tillgodogöra sig kalciumet i maten och istället använder skelettet som en kalciumkälla.

    Då vegetabiliska fetter är överlag fleromättade binder de gärna med extra syre, vilket är samma sak som oxidering ("rost"). Följaktligen krävs det att du får i dig fler källor till antioxidanter ju mer vegetabiliskt fett du äter.

    Mättade fetter

    Sägs orsaka högt kolesterol. Det är då viktigt att tänka på att kolesterol består av ett bra kolesterol och ett dåligt kolesterol. Mättat fett främjar det bra kolesterolet och verkar sänkande på det dåliga; vidare behövs alltid en viss mängd kolesterol för att kunna omvandla solljus till D-vitamin på sommaren.

    Till skillnad från vegetabiliska fettsyror (fleromättade) är de stabila och behovet av antioxidanter för att klara av de enkelomättade fetter vi får i oss tillfredställs till en hög grad av kroppens egenproduktion.

    Protein

    Det finns en rad essentiella aminosyror (från animaliska källor) man avser när man talar om protein, och äter man för lite behöver kroppen använda musklerna för det som proteinet från mat egentligen borde användas för, som cellreparationer och muskeluppbyggnad. Kom ihåg att även hjärtat är en muskel!

    [frukt]http://www.kostdoktorn.se/?page_id=41

    10 Comments »

    Paulún bevakar sina intressen

    Monday, September 22nd, 2008 about , ,

    I samband med att Fredrik Paulún lanserade sin bok "Sanningen om GI" 18 september skrev han en notis om det i sin blogg. Jag skrev där följande kommentar, som två dagar senare inte längre fanns kvar:

    Utmärkt! Ser fram emot att läsa den.

    Jag hoppas att du har rättat dina missförstånd om lågkolhydratkost, för du missade på några punkter i din senaste artikel om LCHF i Expressen.

    (Eller så var det jag som missförstod dig, det är inte lätt för oss med nedsatt mental kapacitet, så du får ursäkta!)

    För den nyfikne, se Andreas Eenfeldts sant/falskt om lågkolhydratkost.

    Fel med vilje?

    Det handlar alltså om Fredrik Pauluns artikel i GT/Expressen om lågkolhydratkost, där han påstår att nackdelarna är att kosten ger

    • nedsatt mental kapacitet,
    • minskad träningslust,
    • fler inflammationer,
    • ökad risk för benskörhet,
    • ökad risk för njursten,
    • huvudvärk,
    • förstoppning,
    • fettförgiftning pga endotoxiner, och
    • brist på näringsämnen

    som Andreas Eenfeldt tar upp i sitt inlägg. Jag har svårt att ta Fredrik Paulúns påståenden på allvar när han saknar väl underbyggda argument. Givetvis gör Fredrik Paulúns egenintressen i frågan det svårare att vara objektiv.

    Nu finns även ett utdrag ur hans bok "Sanningen om GI", specifikt kapitlet om LCHF med extra kommentarer. Tyvär är det precis samma innehåll som artikeln i Expressen/GT/KvP. Anekdotiska bevis mot LCHF och förväxling av övergångsbesvären en del kan få med långtidseffekter. Själv har jag inte haft några övergångsbesvär alls. Förvisso är bevisen för LCHF även de till stor del anekdotiska, i det att det inte gjorts särskilt många större studier på lågkolhydratkost.

    Att Paulún tar till anekdotiska bevis mot lågkolhydratkost är just för att den i regel är så framgångsrik, något man inte kan säga om resultaten av en kost baserad på antingen Paulúns GI-modell eller Livsmedelsverkets rekommendationer!

    D-vitaminbrist ger benskörhet

    Något som inte ges en närmare förklaring är sambandet surt blod och benskörhet, vilket skulle var att ketonkroppar (mestadels aceton) är sura, vilket gör att kroppen måste kompensera med något basiskt (kalcium) vilket alltså skulle tas från skelettet.

    Men! I själva verket får man benskörhet på grund av brist på D-vitamin och för lite fett, eftersom du då inte kan tillgodogöra dig kalcium i kosten! Se artikel i Läkartidningen ("D-vitaminbrist vanligare än vi trott?"). Ihop med den lägre fetthalten i vanlig kost indikerar alltså detta att det snarare är större risk att få benskörhet på Livsmedelsverkets kostrekommendationer!


    3 Comments »

    Programming Challenge: Jolly Jumpers

    Saturday, March 29th, 2008 about ,

    Problem 2.8.1 in Programming Challenges by Steven S. Skiena and Miguel A. Revilla:

    For a list of n<3'000 integers, check if the absolute difference between each successive number contains the entire range of integers between 1 and n-1. A list of one number is trivially jolly.

    Specifically, this is what the program will tell you for these lists of numbers:

    1 4 2 3    => Jolly!
    1 4 2 -1 6 => Not jolly.
    1          => Jolly
    

    So, let's define a Jolly predicate that captures this. We'll fill in the details later:

    (defun jollyp (list)
      (cond
        ((= (length list) 1) t)
        (t (check-jolly list))))
    

    What came across my mind next was to calculate the differences between the numbers. Easy enough, once you've consulted the HyperSpec and realized you need more hand-holding, leading to a tutorial for the Common Lisp Loop Macro:

    (defun get-differences (list)
      (loop for x in list
            for y in (rest list)
            collect (abs (- y x))))
    
    (get-differences '(1 4 2 3))
    => (3 2 1)
    

    Something to note here is that LOOP will stop whenever any loop variable has reached the end of its sequence. The verb collect also does what you'd expect it to, namely accumulating values which will be the resulting value of the form.

    Now that we have a list of differences, we want to check that it contains each number 1..n-1, where n is the length of the list of numbers. Easiest way to do this is to perform a parallel loop, again, with one variable iterating through the differences and the other counting up from 1:

    (defun check-jolly (list)
      (let ((diffs (sort (get-differences list) #'<)))
        (loop for x from 1 to (1- (length list))
              for y in diffs
              always (= x y))))
    
    (check-jolly '(1 4 2 3))
    => T
    

    Again, very straight-forward. SORT is a destructive operation, so we're introducing a new variable in the LET binding, containing the sorted list of differences.

    Almost done! We'll need to make sure it's working, though. Start with known good test data:

    (defparameter *test-data-1* '(t 1 4 2 3))
    (defparameter *test-data-2* '(nil 1 4 2 -1 6))
    (defparameter *test-data-3* '(t 1 2))
    (defparameter *test-data-4* '(t 1))
    

    First parameter is the expected jollyness. Combining the test data with code to run the test, here's what we get, with some extra output on the screen:

    (defun test-jolly-jumpers (test-data)
      ;; extract test data
      (let* ((input (rest test-data))      ; just the numbers
             (was-jolly (jollyp input))
             (expected (first test-data)))
        ;; did our algorithm actually work?
        (if (eql expected was-jolly)
            (format t "OK!   ")
            (format t "BZZT! "))
        ;; and the result
        (if was-jolly
            (format t "~A is Jolly~%" input)
            (format t "~A is Not jolly~%" input))))
    
    (test-jolly-jumpers *test-data-1*)
    => OK!   (1 4 2 3) is Jolly
    

    Make sure an incorrect test is indicated as such:

    (test-jolly-jumpers '(t 1 5 2 8)) ; shouldn't be jolly, and the test is wrong
    => BZZT! (1 5 2 8) is Not jolly
    

    Seems to work! Finally, a simple way of running all tests at once:

    (defparameter *tests* (list *test-data-1*
                                *test-data-2*
                                *test-data-3*
                                *test-data-4*))
    (defun run-tests ()
      (dolist (test *tests*)
        (test-jolly-jumpers test)))
    
    (run-tests)
    => OK!   (1 4 2 3) is Jolly
       OK!   (1 4 2 -1 6) is Not jolly
       OK!   (1 2 ) is Jolly
       OK!   (1) is Jolly
    

    The entire program looks like this:

    (defparameter *test-data-1* '(t 1 4 2 3))
    (defparameter *test-data-2* '(nil 1 4 2 -1 6))
    (defparameter *test-data-3* '(t 1 2))
    (defparameter *test-data-4* '(t 1))
    
    (defparameter *tests* (list *test-data-1*
                                *test-data-2*
                                *test-data-3*
                                *test-data-4*))
    
    (defun run-tests ()
      (dolist (test *tests*)
        (test-jolly-jumpers test)))
    
    (defun test-jolly-jumpers (test-data)
      ;; extract test data
      (let* ((input (rest test-data))      ; just the numbers
             (was-jolly (jollyp input))
             (expected (first test-data)))
        ;; did our algorithm actually work?
        (if (eql expected was-jolly)
            (format t "OK!   ")
            (format t "BZZT! "))
        ;; and the result
        (if was-jolly
            (format t "~A is Jolly~%" input)
            (format t "~A is Not jolly~%" input))))
    
    (defun jollyp (list)
      (cond
        ((= (length list) 1) t)
        (t (check-jolly list))))
    
    (defun check-jolly (list)
      (let ((diffs (sort (get-differences list) #'<)))
        (loop for x from 1 to (1- (length list))
              for y in diffs
              always (= x y))))
    
    (defun get-differences (list)
      (loop for x in list
            for y in (rest list)
            collect (abs (- y x))))
    

    The program fell out quite naturally, by assuming I had access to functions such as JOLLYP, and continuing building downwards. Moreover, when I changed the definition of a function, I could just send the new definition to Lisp, switch over to the REPL, test it and continue writing. This way of working felt very natural, as both the source code and the actual program was always accessible for tweaking while writing it.

    To steal a phrase from Kent Beck: Lisp really lets you embrace change!


    19 Comments »

    Freezing Lisp in Time

    Wednesday, March 26th, 2008 about ,

    Running a set of (possibly long-running) functions on (possibly transient) data might not always be possible. So, when you're done with the heavy processing and finally want to distribute your work as an application, or maybe resume work later after that RAM upgrade, here's how!

    Reload & Recalculate?

    It might not always be possible to initialize the image to the same state: consider having done calculations on data that is no longer available because they were gathered using an external data analysis tool, or maybe you're feeding the logs from a web server directly into your Lisp image. Saving your Lisp image gives you a way of storing data native to Lisp, without having to load it from external data sources, such as an SQL database or similar, and into your image as regular Lisp data.

    Also, because code is data, saving your Lisp image really gives you everything! I will just give a trivial example to explain the concept, but you can (and should!) load code your application depends on and what else you need. In fact, you could customize the default Lisp image SBCL uses at startup, if you have helper functions you often use and don't want to load a file and run a couple of functions, just to get the image in the right state. Or perhaps you have a utility function for automatically deploying request handlers as applets in your web server? Be creative!

    Save Lisp and Die!

    If you use SBCL, there's a handy function named sb-ext:save-lisp-and-die you can use, like this:

    $ sbcl
    ;; define some data just so we can see it'll be available next time
    * (defparameter *bar* "World")
    ;; ... and the mandatory Hello World function
    * (defun foo () (format t "Hello, ~A!~%" *bar*))
    * (sb-ext:save-lisp-and-die "/tmp/my-spiffy-lisp.core")
    ... snip output ...
    $
    

    At this point, SBCL will die, but don't worry. Your image is safely stored in the core image:

    $ sbcl --core /tmp/my-spiffy-lisp.core
    * (foo)
    Hello, World!
    

    You can even make your core image executable! Then, you specify a top-level function that either shouldn't return (i.e., present the user with a REPL), or return an integer like any other UNIX app. And, using the special variable *posix-argv*, you can easily get the command line arguments to the application (starting with the second value in command line list, first one being the name of your binary... almost, it's actually "sbcl" on my end). Let's reload the image we saved earlier:

    $ sbcl --core /tmp/my-spiffy-lisp.core
    * (defun main ()
        ;; were we given a name? If so, rebind *bar* to that name and call FOO.
        (let ((*bar* (or (second *posix-argv*)
                         *bar*)))
          (foo))
        1)
    
    * (sb-ext:save-lisp-and-die "/tmp/my-spiffy-executable.core"
        :executable t
        :toplevel 'main
        :purify t)
    
    ... snip output ...
    
    $
    

    Now, we have something we can run as a regular application, from the command line!:

    $ /tmp/my-spiffy-executable.core
    Hello, World!
    $ /tmp/my-spiffy-executable.core Lisper
    Hello, Lisper!
    

    The resulting core file is 25M (7.1M bzip2'd), which is a bit large, because it bundles the Lisp library, including things you don't use, together with the SBCL executable. The SBCL executable binary itself, however, is rather small and contains mostly just the garbage collector and a few other things. In fact, most of Lisp is stored in a core image. Lacking a usable tree shaker, there's not much to do about the file size.

    On the up side, the image you just saved includes all libraries in use, so there are no external dependencies (save for any C/C++ libraries you might have FFI'd in). Ultimately, this gives you a good method for distributing your application together with a full Lisp!


    12 Comments »

    Close
    Powered by ShareThis