Avoid spinners

I see spinners everywhere – although I once learned that this is just poor website design. There are even spinner factories to create you own custom waiting room.
gif
As I am doing a lot of time consuming jpg manipulation here and didn’t want to further increase any server overhead, I went back to rather old fashioned method – the turning slash known from old UNIX and DOS times. It expands my previous article on avoid-browser-flickering-with-dark-backgrounds writing to the preloader div and stopping after loading the iframe.

var str = "|/-\\";
var i = 1;
function myLoop () {
   setTimeout(function () {
      j=str.charAt(i%(str.length));
      $('#preload').text( i ) ;
      i++;
      if (i<99) myLoop();
   }, 150)
}
myLoop(); 
$(function(){
    $('#iframe').load(function(){
        i=99;
    });
});

One of my biggest problems

One of my biggest problems in science certainly is the motivation of finding truth. But as Oliver Burkeman puts it correctly

Even in the world of academia, most people aren’t motivated by the truth. What they want, above all, is not to be bored

And he continues to cite Murray Davis

What is it, Davis asks, that makes certain thinkers – Marx, Freud, Nietzsche – legendary? “It has long been thought that a theorist is considered great because his theories are true,” he writes, “but this is false. A theorist is considered great, not because his theories are true, but because they are interesting.”

Yea, yea, that’s true.

Cycling is good for you (and vitamin D is an activity marker)

Vitamin D level is an activity or lifestyle marker, although this has been largely neglected in the medical literature, maybe except Gannage 2000, Hyppönen 2007, Sohl 2013 and Choi 213. A new paper by de Rui in PLoS now shows that

serum 25OHD levels were significantly higher in individuals who engaged in outdoor pastimes … compared to those who did not. In particular, subjects regularly practicing gardening or cycling had higher serum 25OHD levels than those who did not, whereas 25OHD levels differed little between subjects who did or did not undertake indoor activities.

While these are good news for older cyclists Continue reading

Seite an Seite einschlafen

Aus Seeberger, Schamlose Neugier, Integral München, 2012, S.213:

Es gibt Menschen deren Weltbild gleicht einem Anwesen, bei dem man “eine Mauer um sich herum baut, diese mit Stacheldraht und Glassplittern versieht und Patrouillen ausschickt, um eingebildete oder echte Bedrohungen zu verjagen” wie der Schriftsteller Göran Tunström einmal schrieb. Während bei anderen die Weltanschauung wie “ein großer Hof ohne Mauer und Zaun ist, wo die tagsüber frei umherstreunden Ansichten abends ruhig nach Hause trotten, um Seite an Seite einzuschlafen”.

Avoid browser flickering with dark backgrounds

There is no ultimate solution to avoid the white phase when switching pages in the browser.

Here is a rather simple strategy using embedded pictures. This is usually not recommended as the necessary base64 encoding includes quite some overhead. It influences, however, the browser rendering by basically blocking the download of the remaining page which is probably the anti-flickering effect.

echo '<img src="data:image/png;base64,';
echo base64_encode(file_get_contents($file));
echo '"/>';

Works mostly, but not always. Another interesting approach has been suggested by another user, eg decreasing page loading time by async loading before switching between pages. I didn’t like that so much as it keeps the pages in your browser piling up.

So finally I did a small page only with a large iframe that is covered by a black div and removed only after loading the iframe content. Works on all tested browsers.

<style>
#preload {
background:black;
width:100%;
height:100%;
z-index:2;
top:0px;
left:0px;
position:absolute;
}
</style>

<script>
$(function(){
   $('#iframe').load(function(){
    $(this).show();
    $('#preload').fadeOut();
  });
});
</script>

<div id="preload">loading...</div>

<iframe src="http://external.url.de" id="iframe">
</iframe>

Let your visitors switch background color

There seem to be million of ways to do that – here is the most parsimonious solution that works for me even under difficult conditions and in different browsers.

// should be run in a $(document).ready(function(){ bracket });
// if there is no cookie we set one
if (document.cookie.indexOf("color")!== -1 {
  document.cookie = "color=white";
}
// we need a body class without any background definition
// and a class for body.black that has background:black
if (document.cookie.indexOf("black") === -1) {
  // switch to the new .black class
  $("body").toggleClass("black");
  // this is also possible in the iframe
  $(#iframe").contents().find("body").toggleClass("black");
}
// link or whatever is being clicked for the effect
$(".place").click(function () {
if (document.cookie.indexOf("white") !== -1) {
  document.cookie = "color=black";
}
else {
  document.cookie = "color=white";
}
// reload page with a small delay
setTimeout( function() { location.reload() }, 250 );

Forschung aus fairer Produktion

Davon habe ich heute das erste mal gelesen und zwar auf dem academics.de blog der auf einen ZEIT Artikel vom 15.3. zurückgeht

Hans-Jochen Schiewer hat eine lange Ausbildung genossen. Inklusive Schulzeit dauerte sie vier Jahrzehnte. An der Uni musste er sich auf einem halben Dutzend Stationen mit befristeten Verträgen bewähren. Als er endlich seine erste feste Stelle erhielt, eine Professur für Germanistik, war der Dauerazubi grau an den Schläfen und 46 Jahre alt.
Heute ist Hans-Jochen Schiewer fast weiß auf dem Kopf und selbst Chef einer dieser seltsamen Arbeitgeber namens Hochschule. Seine eigene Ochsentour hat der Rektor der Universität Freiburg nicht vergessen. Es könne nicht angehen, dass “die Universitäten ihren Nachwuchs bis Anfang vierzig in Unsicherheit und Unselbstständigkeit halten”, kritisiert Schiewer heute.

Der Marsch durch die Institutionen hat 1967 begonnen. Wenn ich rechne, dann hatten die Studenten 1967 schon die ersten 15 der 40 Jahre hinter sich. Dann hätten sie eigentlich kurz nach der Jahrtausendwende ankommen sollen. Es sind aber offensichtlich nun erst die Babyboomer, die den Millenials ein besseres Leben ermöglichen wollen, yea, yea.

Why I believe in twin studies

20120609-DS7_0692

Zwillingstreffen im Pillerseetal  7. Juni 2012 - 9. Juni 2012

These are some pictures that I took roughly two years ago on twin meeting in Austria. Twin studies give us some unique opportunities like in this recent paper

We performed a genome-wide study to investigate differences in (i) DNA methylation (using a custom tiled four-plex array containing tiled 50-mers 19,084 randomly chosen methylation sites), (ii) copy number variation (CNV) (with a chip including markers derived from the 1000 Genomes Project, all three HapMap phases, and recently published studies), and/or (iii) gene expression (by whole-genome expression arrays). Based on the results obtained from these three approaches we utilized quantitative PCR to compare the expression of candidate genes. Importantly, our data support consistent differences in discordant twins and siblings for the (i) methylation profiles of 60 gene regions, (ii) CNV of 10 genes, and (iii) the expression of 2 interferon-dependent genes.

WordPress: Multiline site title instead of tagline

I found it hard to change the layout of the tagline in my WordPress Twentyfourteen child theme as the element sits in a different hierarchy. But fortunately we can add text also from the CSS stylesheet (which is not visible in the sourceode!) using the content tag. It does not accept standard HTML while the special formatting is shown on stackoverflow.

.site-title :after {
	font-size: 25px;
    content: "\00000aBut let your communication be Yea, yea;\00000aNay, nay: for whatsoever is more than these cometh of evil";
    white-space: pre;
}

The reason for that? Just a quick fix.