I thought Ladybirds ate Aphids and kept their population down. But apparently that isn't the whole truth! Check this out:
I don't know about you but I really do wonder if this is at all true. The roles of both the spider and the Ladybird seem so passive. I reckon there's something missing in the equation.
http://www.bbc.co.uk/nature/life/Coccinella_septempunctata#p0039ryj
Wednesday, 13 July 2011
Tuesday, 5 July 2011
Belly button fluff - bacterial haven
The human navel should be designated as a bacterial nature reserve, it seems. The first round of DNA results from the Belly Button Biodiversity project are in, and the 95 samples that have so far been analysed have turned up a whopping total of more than 1400 bacterial strains. In 662 cases, the microbes could not even be classified to family, "which strongly suggests that they are new to science", says team leader Jiri Hulcr of North Carolina State University in Raleigh.
The project was conceived as a light-hearted exercise in science communication, but is making a serious contribution to the understanding of microbial diversity. Since New Scientist wrote about the initiative in April, samples of bacteria taken when volunteers swabbed their navels with Q-tips have had their "DNA barcodes" read by sequencing the gene for 16S ribosomal RNA, widely used in studies of bacterial evolutionary relationships.
My own sample was among 10 per cent of those in the first round in which reactions to amplify the DNA present failed - so the next installment of the comparison of my belly button biome with that of fellow science writer Carl Zimmer will have to wait for another day. Still, Zimmer has already been having some fun with his results, finding among other things that his belly button hosts Georgenia bacteria, previously found in Asian soils.
Results like this reflect our ignorance of microbial diversity, Hulcr suggests: the inhabitants of our navels seem weird because biologists haven't sampled sufficiently extensively to document the full diversity of microbial life in a variety of habitats. He likens reactions to the first round of belly button results to the astonishment of the first European explorers seeing African big game - which today seem commonplace. "Now you're expecting rhino and elephants," Hulcr says.
Also, identifying bacteria to species is difficult. Noah Fierer's team at the University of Colorado, Boulder, classified them into "operational taxonomic units" having 16S ribosomal RNA gene sequences that differed by 3 per cent or less. Apply this standard to mammals, Hulcr explains, and dogs and cats would be lumped together. It means that a "match" between a belly button strain and a species known from the deep ocean, for instance, may actually represent two microbes separated by several million years of divergent evolution.
Although the total number of strains recorded was large, the results so far indicate that a small group of about 40 species accounts for around 80 per cent of the bacterial populations of our belly buttons. "It is tempting to think of the abundant species as the good, core biome of bacteria and the rare ones as transients, struggling to take hold, sometimes at our expense," says Rob Dunn, author of The Wild Life of Our Bodies, and head of the lab in which Hulcr works.
Confirming that theory will require studies on a new scientific frontier: belly button ecology.
Source: http://www.newscientist.com/blogs/shortsharpscience/2011/06/peter-aldhous-san-francisco-bu.html
Also see: http://idle.slashdot.org/story/09/03/02/1742219/Science-Unlocks-The-Mystery-Of-Belly-Button-Lint
Saturday, 25 June 2011
Loading CSS, JS and images from CodeIgniter
Just a quick tip for newbs (me included). If you're having trouble loading css, js or image files into your views/templates in CodeIgniter and you do a Google search to find the solution, you'll find many websites telling you to use the base_url() function. This didn't work for me!
The reason why it didn't work was because I hadn't loaded the url helper class... DUH! Stick this in the constructor of your controller or autoload it in your autoload.php configuration file.
$this->load->helper('url');
Now you can use the base_url() function to get the url path from where to look for those files, e.g.:
This will load a css file called main.css from a folder called styles which is just under the base url folder codeigniter. On my PC it will find the file from: C:\wamp\www\codeigniter\styles\main.css
I reckon the creators of CodeIgniter should have added a constant through which to refer to the base_url and similar paths, or at least make the url class have static functions so url::base_url() can be called instead of base_url() which could be confused for a normal PHP function.
The reason why it didn't work was because I hadn't loaded the url helper class... DUH! Stick this in the constructor of your controller or autoload it in your autoload.php configuration file.
$this->load->helper('url');
Now you can use the base_url() function to get the url path from where to look for those files, e.g.:
<link rel="stylesheet" href="<?php echo base_url(); ?>styles/main.css" type="text/css">
This will load a css file called main.css from a folder called styles which is just under the base url folder codeigniter. On my PC it will find the file from: C:\wamp\www\codeigniter\styles\main.css
I reckon the creators of CodeIgniter should have added a constant through which to refer to the base_url and similar paths, or at least make the url class have static functions so url::base_url() can be called instead of base_url() which could be confused for a normal PHP function.
Friday, 10 June 2011
That's one wierd looking bear - The water bear (Tardigrade)
Check out this stunning photo:
On Monday, this microscopic cosmonaut has once again hitched a ride into space on the Nasa shuttle Endeavour.
Its mission: to help scientists understand more about how this so-called "hardiest animal on Earth" can survive for short periods off it.
More: http://www.bbc.co.uk/nature/12855775
In 2007, a little known creature called a tardigrade became the first animal to survive exposure to space.
It prevailed over sub-zero temperatures, unrelenting solar winds and an oxygen-deprived space vacuum.On Monday, this microscopic cosmonaut has once again hitched a ride into space on the Nasa shuttle Endeavour.
Its mission: to help scientists understand more about how this so-called "hardiest animal on Earth" can survive for short periods off it.
More: http://www.bbc.co.uk/nature/12855775
Thursday, 5 May 2011
Unset function in Javascript
Here's my version of an occasionally required function, Unset(). I wrote this before I found the version on phpjs.org so I thought I might as well publish it online because it's easier to make sense of than the one they wrote.
To briefly explain how it works:
There are three different things that you might want to "unset" in javascript - 1. Individual array elements, 2. a property of an object (which could be a variable, function or an object) and 3. a normal variable, which actually may hold a simple value like 1 or more complex items like an array or an object reference/definition. Each one of these different types of variable are unset in a different way:
1. myarray.splice(index,1);
myarray is the name of an array. index is the index number of the item in the array starting from 0. And the second argument (1), is the number of items to splice/cut out of the array.
2. delete myclass.myproperty;
This simply deletes the variable myproperty from the object myclass. Of course, in javascript, myproperty could contain a simple value, a method or an object.
3. myvar = undefined;
If I've previously defined a variable like so: var myvar = "hello"; then I can undefine it by setting it to the javascript equivalent of null which is "undefined". You can also unset a whole array/object using the same command.
Anyway, here's my general purpose javascript unset() function:
You pass the names of the variables, classes, elements of arrays and object properties as strings and it removes them. You can pass as many arguments to the unset() function as you like. Usage example:
Variable x is now undefined. Array y now holds two elements, a and c. Class z is now an object with two properties.
To briefly explain how it works:
There are three different things that you might want to "unset" in javascript - 1. Individual array elements, 2. a property of an object (which could be a variable, function or an object) and 3. a normal variable, which actually may hold a simple value like 1 or more complex items like an array or an object reference/definition. Each one of these different types of variable are unset in a different way:
1. myarray.splice(index,1);
myarray is the name of an array. index is the index number of the item in the array starting from 0. And the second argument (1), is the number of items to splice/cut out of the array.
2. delete myclass.myproperty;
This simply deletes the variable myproperty from the object myclass. Of course, in javascript, myproperty could contain a simple value, a method or an object.
3. myvar = undefined;
If I've previously defined a variable like so: var myvar = "hello"; then I can undefine it by setting it to the javascript equivalent of null which is "undefined". You can also unset a whole array/object using the same command.
Anyway, here's my general purpose javascript unset() function:
/**
* Unset variables, objects, array elements and object
* properties in Javascript much like you can in PHP
* @author Ahmad Retha
* @license Public Domain
*/
function unset()
{
for(var _i = 0; _i < unset.arguments.length; _i++){
//where item to unset is an array element (var[index])
{
for(var _i = 0; _i < unset.arguments.length; _i++){
//where item to unset is an array element (var[index])
if(_m = unset.arguments[_i].match(/(\w+)\[(\d+)\]/)){
eval(_m[1] + ".splice(" + _m[2] + ", 1);");
//where item to unset is an object item
}else if(unset.arguments[_i].match('.')){
eval("delete " + unset.arguments[_i] + ";");
//where item to unset is a normal variable
}else{
eval(unset.arguments[_i] + " = undefined;");
}
}
}
eval(_m[1] + ".splice(" + _m[2] + ", 1);");
//where item to unset is an object item
}else if(unset.arguments[_i].match('.')){
eval("delete " + unset.arguments[_i] + ";");
//where item to unset is a normal variable
}else{
eval(unset.arguments[_i] + " = undefined;");
}
}
}
You pass the names of the variables, classes, elements of arrays and object properties as strings and it removes them. You can pass as many arguments to the unset() function as you like. Usage example:
var x = 1;
var y = ['a','b','c'];
var z = {'one':1, 'two':2, 'three':3};
unset("x", "y[1]", "z.three");
Variable x is now undefined. Array y now holds two elements, a and c. Class z is now an object with two properties.
Friday, 29 April 2011
Javascript using PHP functions
Ever wanted to use functions easily available in the PHP library but with Javascript?
I found a new project called the PHP-JS project and it's pretty cool. They have covered most of the PHP functions and written some really good Javascript. The other day I needed a snippet of Javascript code to Uppercase the first letters of new words, which is the ucwords() function in PHP. Here's their code:
So to use it I write:
Nice. Visit the site at http://www.phpjs.org/.
I found a new project called the PHP-JS project and it's pretty cool. They have covered most of the PHP functions and written some really good Javascript. The other day I needed a snippet of Javascript code to Uppercase the first letters of new words, which is the ucwords() function in PHP. Here's their code:
function ucwords (str) {
return (str + '').replace(/^([a-z])|\s+([a-z])/g, function ($1) {
return $1.toUpperCase();
});
}
return (str + '').replace(/^([a-z])|\s+([a-z])/g, function ($1) {
return $1.toUpperCase();
});
}
So to use it I write:
//Capitalizes the words to 'The Cat Sat On The Mat'
alert( ucwords('the cat sat on the mat') );
Nice. Visit the site at http://www.phpjs.org/.
Saturday, 23 April 2011
PHP array to Javascript array format
Just been messing around with ajax and a particular jQuery plugin... The easiest way to convert a PHP array to a Javascript array is to use the json_encode() function (PHP 5.2+).
This will output the Javascript array notation:
["One","Two","Three"]
If I use an ordered map array like this:
It will convert it to a Javascript object:
<?php
echo json_encode(array("One","Two","Three"));
?>
This will output the Javascript array notation:
["One","Two","Three"]
If I use an ordered map array like this:
<?php
echo json_encode(array("1"=>"One","2"=>"Two","3"=>"Three"));
?>
It will convert it to a Javascript object:
{"1":"One","2":"Two","3":"Three"}
Monday, 4 April 2011
Bacteriophages and... introducing Virophages
Bacteriophages are viruses that infect/kill bacteria as part of their natural programming. Just like a typical viral infection may give you a sore throat, using a mechanism of infecting the cells in your throat by inserting RNA/DNA into your cells causing your body's immune system to fight back by killing the infected cells - bacteriophages infect bacteria and make them produce more of its viral clones and/or they end up killing the bacteria they infect.
We've known about bacteriophages for a long time and today we use them to insert genetically engineered fragments of DNA into cells so they start expressing the new genes. This is standard practice in genetics labs nowadays.
But up until 2 or 3 years ago we had not come across Virophages - a virus that infects another virus! How such a discovery managed to slip by silently without anyone making a big hoohah about it is crazy!
I'm only speculating that one application of gene therapy using virophages might be, and I haven't given this much thought, is to infect a genetically modified stalwart virus similar to HIV to continually produce a virus that carries a beneficial gene such as the CFTR-coding gene to help sufferers of systic fibrosis. You stick the infected virus into a human being and it starts creating the virus that carries the gene to cure the disease or at least to provide consistent and longer-lasting gene therapy.
The possibilities and applications of this discovery have great potential. Here's an article nature published a few days ago in which I first found out about virophages: http://www.nature.com/news/2011/110328/full/news.2011.188.html
As we're on the subject of microbes, I'd like to take the opportunity to publically complain about Leeds Central Library which has no books on bacteria in its catalogue! (unless they're hiding them somewhere!)
We've known about bacteriophages for a long time and today we use them to insert genetically engineered fragments of DNA into cells so they start expressing the new genes. This is standard practice in genetics labs nowadays.
But up until 2 or 3 years ago we had not come across Virophages - a virus that infects another virus! How such a discovery managed to slip by silently without anyone making a big hoohah about it is crazy!
I'm only speculating that one application of gene therapy using virophages might be, and I haven't given this much thought, is to infect a genetically modified stalwart virus similar to HIV to continually produce a virus that carries a beneficial gene such as the CFTR-coding gene to help sufferers of systic fibrosis. You stick the infected virus into a human being and it starts creating the virus that carries the gene to cure the disease or at least to provide consistent and longer-lasting gene therapy.
The possibilities and applications of this discovery have great potential. Here's an article nature published a few days ago in which I first found out about virophages: http://www.nature.com/news/2011/110328/full/news.2011.188.html
As we're on the subject of microbes, I'd like to take the opportunity to publically complain about Leeds Central Library which has no books on bacteria in its catalogue! (unless they're hiding them somewhere!)
Wednesday, 2 March 2011
Donate Stem Cells today!
It seems that my knowledge concerning stem cell donation is out of date, as I discovered today. I was under the impression that you had to have a surgical operation under full general anaesthetic to extract bone marrow containing stem cells from the Iliac crest of the hip bone... not any more!
All they need to do now is give you a jab with a stimulating factor so you start releasing the stem cells into your blood stream and then they harvest them from your blood. It's almost like blood platelet donation. Saving a life just became much easier. How awesome is that?!
You can talk to someone at your local blood donation centre about donating stem cells (and blood/platelets) or get in touch with the Anthony Nolan Trust. They came to our work place today and all I had to do was fill out a form and spit in a tube so that they could get a tissue (cheek cells) sample to match against their patient database. How easy is that!
All they need to do now is give you a jab with a stimulating factor so you start releasing the stem cells into your blood stream and then they harvest them from your blood. It's almost like blood platelet donation. Saving a life just became much easier. How awesome is that?!
You can talk to someone at your local blood donation centre about donating stem cells (and blood/platelets) or get in touch with the Anthony Nolan Trust. They came to our work place today and all I had to do was fill out a form and spit in a tube so that they could get a tissue (cheek cells) sample to match against their patient database. How easy is that!
Subscribe to:
Posts (Atom)