Browsed by
Year: 2009

The secret Van der merwe bread recipe

The secret Van der merwe bread recipe

Here is the 1kg bread that I often make.
It is rich and moist, and is made with no sugar or yeast preservatives like you would expect of a proper bread.
I estimated amounts, as i normally measure ingredients by eye.
First soak:

  • 1 cup kibbled soy or soy grits
  • 1/4 cup oil (olive or canola)
  • 1 table spoon crushed garlic (optional)
  • 1/4 cup poppy seeds (or sonneblom seed)
  • 1/4 cup sesame seeds
  • 1 spoon salt
  • 2 cups water

Soak above ingredients in your bread mixer for about 2 hours or more.

Then add:

  • 3.5 cups (white) wheat flour
  • three tea spoons crushed fresh yeast, depending on whether you want the bread fluffy or solid (If the fresh yeast is very moist, kneed it into a bit of the flour)

Put on cycle for normal or french bread. You want the bread dough moist but not wet, otherwise the bread will rise too fast and collapse. For the first number of times you do this recipe, check on your bread maker after it has been mixing for 10 minutes or so – if it is too wet (sticky to a spoon or hand), add a bit of flour.

Ajax python “hello server” example

Ajax python “hello server” example

Ajax provides direct messaging between a browser page and the server from where the browser page originated. For example, only a part of a web page may be loaded using Ajax (like google maps).

There are examples of Ajax on the web, but i have not found one of them that used mod_python as a back-end. I thought I would provide a simple “Hello world” example as reference:

I assume you have apache2 and mod_python working. I have Python Version 2.5.2 and Apache2 version 2.2.8 on Ubuntu.

File “test_ajax_helloserver.html” : contains the ajax javascript code that your browser will execute.
File “hello_server.py” : contains the ajax response that mod_python will execute on the server

Copy and paste the text below into your favourite text editor.
Save the two files in the same directory/folder under your Apache mount point.
Load “test_ajax_helloserver.html” through your Apache webserver, and test it by clicking the button.

test_ajax_helloserver.html

 
<html><head><title>AJAX Hello Server mod_python (hello_server.py) Test</title>
<script type="text/javascript">
var req;
function sendServerRequest(){
   req = newXMLHttpRequest(); // register the callback function
   req.onreadystatechange = updateMsgOnBrowser
   //specify url correctly in open(requestMethod,url,isAsync,username,password)
   req.open("POST", "hello_server.py", true); //or "POST"
   req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   //get the text input element (payload) and send it to server
   var msg_value = (document.getElementById("testmsg")).value;
   req.send("form_send="+msg_value);  //send(payload) send(null)=no parameters
}
// This is the callback function that called from the server with the XML data
function updateMsgOnBrowser() {
  if (req.readyState == 4) {
     if (req.status == 200) {
        if(req.responseXML == null){
           var msg_display = document.getElementById("display_result");
           msg_display.innerHTML="XML response error<p><b>Content-type:</b>"+
               req.getResponseHeader("Content-type")+"<p><b>Response:</b> "+req.responseText;
        } else {
           testXML=req.responseXML;
	   if (!testXML.documentElement && req.responseStream) { // Microsoft hack
	      testXML.load(req.responseStream); // another reason to drop IE
  	   }
           var stime=(testXML.getElementsByTagName("server")[0]).getAttribute("time");
           var ctype=(testXML.getElementsByTagName("ctype")[0]).firstChild.nodeValue;
           var msgval=" - )" ;
           if (testXML.getElementsByTagName("message")[0].firstChild!=null){
                 msgval=(testXML.getElementsByTagName("message")[0]).firstChild.nodeValue;
           }
           var version=(testXML.getElementsByTagName("version")[0]).firstChild.nodeValue;
           var msg_display=document.getElementById("display_result");
           msg_display.innerHTML="<p><b>Server received:</b>"+msgval+
             "<p><b>Python Version:</b> "+version+"<p><b>Server Time:</b>"+stime+
             "<p><b>Content-type  server:</b>"+ctype+
             "<p><b>Content-type browser:</b>"+req.getResponseHeader("Content-type");
        }
     } else {
       var msg_display = document.getElementById("display_result");
       msg_display.innerHTML = "ERROR: "+ req.status +" "+ req.statusText;
     }
  }
}
//helper function to get a XMLHTTPRequest
function newXMLHttpRequest() {
   try { return new XMLHttpRequest(); } catch(e) {}
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
   try { return new ActiveXObject("Msxml2.XMLHTTP");    } catch (e) {}
   alert("XMLHttpRequest not supported");
   return null;
}
</script>
</head>
<body><h1>Simple javascript ajax to server test</h1>
<input id="testmsg" type="text" value="Hello Ajax server">
<button onclick="sendServerRequest()">Send ajax request to Server</button>
<div id="display_result" style="{background:honeydew;}">
Response from "hello_server.py" on the server will go here </div>
<div id="error_msg"></div>
</body></html>

hello_server.py

 
import  sys,time
def index(req):
    req.content_type="Content-Type: application/xml"
    submit = req.form.getfirst("form_send", "no form parameter")
    s= "<?xml version=\"1.0\"?>  <server time=\"%s\">\
        <ctype>%s </ctype> <message>%s </message> <version>%s </version>\
       </server>" % (time.ctime(),req.content_type,submit,sys.version)
    return s

You would need a different javascript pattern/design if you plan to a have web-page that simultaneously sends multiple Ajax request.

If you get the error “405 Method Not Allowed”, the python module is not processing the “POST request. This may be due to the security configuration of the Web server. You could try changing your “POST” to a “GET” in the javascript. If you get a XML response error it may be because mod_python is not running properly.

The housing of domestic bees

The housing of domestic bees

Bees are industrious, organised and intelligent. Instead of explaining this in an article, I submit the following photo to the reader. See how those bees are watching me whilst I was checking out their health by opening their hive.

Like other Fauna and Flora, bees have been domesticated. The environment of domestic bees were changed by the introduction of artificial hives. Most honey bees are managed in in boxes where they store their honey in rectangular combs that are easily harvested. Feral colonies (bee colonies their native habitat) are not the norm. Whilst a lot of feral bees have been decimated by pests like the  Varroa mite, feral colonies have proven to be more resistant to pests than domesticated bees.

Man-made beehives normally adopt the Langstroth design. Bees store their honey and babies in frames. About nine of these frames are placed in boxes. A number of these boxes are stacked on a “bottom board”.

hive structure

Bees normally land on the bottom board and walk into the hive entrance at the bottom.

At the end of spring, bee keepers empty about half the honey out of each hive. Some commercial bee-keepers can be mercenary about the amount of honey they harvest. To ensure that bees make it through winter, bee-keepers feed the bees sugar water or an equivalent. This is like raiding the fruit and veggies and replacing it McDonalds food.

Varroa mites are like big ticks. If you were the size of a bee, a Varroa mite l;arger than a rat would be sucking your blood. A bee with more than one Varroa mite does not last long. Most bee-keepers use insecticides to control the amount of Varroa.

Bees will clean out their hives by removing dead bees, waste, the odd Varroa mite and other debris from the combs. As bottom boards are flat, the debris normally accumulate there. The beehive entry point therefore become the accumulation point of the hive debris.

bee movement pattern

Live mites often end up on the bottom board with the debris, where they can re-attach themselves to bees that walk in and out of the hive.

Some bee colonies spend more effort on hive hygiene by cleaning out their hives. It is well known that bees that are hygienic are more resistant to Varroa mite and pests.

Many scientist say there is no single cause to “colony collapse disorder”. “Colony collapse disorder” seems to be related to infections and Varroa.

The hive can be seen as an ecosystem that include bees and bee pests. The introduction of the artificial hive has changed this ecosystem, allowing pests to evolve their behavior to gain a competitive advantage.
Unhygienic hives are a breeding ground for many illnesses and may be the cause of colony collapse disorder (just like damp, drafty houses cause many illnesses in humans)

One method to improve the hygiene design of bee boxes, is to install a bottom board that allow debris (including live Varroa mites) to fall through onto the ground.

I have made such a bottom board,- as shown in the picture.

better bottom boards