Category Archives: Software

Link collection homomorphic encryption algorithm

… is a form of encryption that allows computations to be carried out on ciphertext, thus generating an encrypted result which, when decrypted, matches the result of operations performed on the plaintext…

First publication: acm.org
Introduction: technologyreview.com
Details: en.wikipedia.org
Use in genomics: nature.com
R package: www.louisaslett.com

install.packages(c("Rcpp", "RcppParallel", "gmp")) 
install.packages("http://www.louisaslett.com/HomomorphicEncryption/dl/HomomorphicEncryption_0.2.tgz", repos=NULL)
library("HomomorphicEncryption")
p <- pars("FandV")
k <- keygen(p)
c1 <- enc(k$pk, c(42,34))
c2 <- enc(k$pk, c(7,5))
cres1 <- c1 + c2
cres2 <- c1 * c2
cres3 <- c1 %*% c2
dec(k$sk, cres1)
dec(k$sk, cres2)
dec(k$sk, cres3)

CC-BY-NC

No, there are no super humans

A new study – repeated by many newspapers – claims genes that rescue even in severe Mendelian disorder: cystic fibrosis, Smith-Lemli-Opitz syndrome, familial dysautonomia, epidermolysis bullosa simplex, Pfeiffer syndrome, autoimmune polyendocrinopathy syndrome, acampomelic campomelic dysplasia and atelosteogenesis.

A comprehensive screen of 874 genes in 589,306 genomes led to the identification of 13 adults harboring mutations for 8 severe Mendelian conditions, with no reported clinical manifestation of the indicated disease.

But we know about the reliability of 23andme results

Finally! 23 and the FDA warning

who even mixed up samples in the past.

Searching for genes that makes your resilient to disease is interesting of course but not very new with more examples of cystic fibrosis survivors available. Any new proof by the 23andme study is missing so far as the authors were unable to recontact any of the 13 resilient indiviuduals for whatever reasons.


CC-BY-NC

Up- and download in a single page application

This still not a trivial task given the patchwork of code pieces floating around. When writing a route finder app I came up with the following solution

# html
<form id="myform" enctype="multipart/form-data" action="upload.php" method="POST" target="_parent">
  <input type="hidden" name="uuid" value="1"/>
  <input id="myfile" type="file" name="file"  style="display: none;"/>
  <input type="submit" value="send" style="display: none;"/>
</form>

# query javascript that starts the upload
$("input[id='myfile']").click();

# upload.php
# note the redirect with javascript not with php allows to pass state parameters
$uuid=htmlspecialchars($_POST["uuid"]);
$uf = basename($_FILES['file']['name']);
$fn='data/'.$uuid.'.gpx';
if (move_uploaded_file($_FILES['file']['tmp_name'], $uf)) {
  rename($_FILES['file']['name'],$fn );
  file_put_contents ($fn , $txt, FILE_APPEND );
  echo '<script type="text/javascript">window.parent.location = "index.php";</script>';
}

The upload needs a quick refresh of the webpage (which could be avoided by posting to an hidden iframe and controlling response by an ajax call). The download doesn’t need a refresh:

# note the combined get and post commands
# don't know why this is necessary
$.ajax({
  data: "uuid="+fn,
  type: "post",
  url: "download.php",
  success: function() {
    window.location = 'download.php?uuid='+fn;
  }
});

CC-BY-NC

Sci-Hub and Elsevier: like David and Goliath?

The publishing industry complains about Sci-Hub, the Kzakhstan website that provides free PDF access by pulling them through some .edu proxies. This is not new while the publishing industry’ protest is getting louder and louder: Continue reading Sci-Hub and Elsevier: like David and Goliath?


CC-BY-NC

Track down the “no object… error in post.php”

Recently I encountered this strange error message in WordPress when trying to write a new post. Maybe I haven’t done any major changes, only removed a security plugin recently while the whole system is continuously updated.

Disabling all plugins and reverting to the standard twentyfifteen theme did not help. Inspection of post.php also did not show anything unusual (the indicated line number was probably wrong due to several includes). Googling the error message also did not help as these lead only to site specific problems. Continue reading Track down the “no object… error in post.php”


CC-BY-NC

Blockchain – The next science revolution

There is a huge economical interest in bitcoins. And reading a bit more about the blockchain technology behind, I expect that scientific data will soon move towards the same path as soon as we drop Nature, Science and many more journals as gatekeepers

A block chain or blockchain is a permissionless distributed database based on a protocol that maintains a continuously growing list of data records hardened against tampering and revision, even by its operators. The initial and most widely known application of block chain technology is the public ledger of transactions for bitcoin,which has been the inspiration for similar implementations often known as altchains.

Although people are talking so much about releasing study data into the public domain – allowing reviewers to test central claims of a paper – there is no progress at all. Even being part of an EU funded collaborative study, I could never get the full data set.

Maybe it isn’t block chain alone – it may be also  cooperative storage cloud as in the following video example.

 

Added 31 Dec 2016: Blockchain started back in Jan 2009, occupies currently 105 GB and is distributed among 5400 nodes. Zündfunk (in German) has a nice feature about the blockchain referring mainly to the “Blockchain Revolution“, a new book by Don and Alex Tapscott.


CC-BY-NC

WordPress Integrity: A simple intrusion detection

As I see so many scripts trying out wordpress vulnerabilities, it is just a matter of time until one bot will succeed. The only chance I see is to remove those unused themes and plugins, autoupdate wordpress and run weekly backups.

Another option is to monitor file integrity with this short php script

$cmd='find ./wordpress -type f -exec md5sum {} \;> ./hidden/wordpress.md5';
exec($cmd,$ret);
echo "<pre>"; print_r($ret); echo "</pre>";

Results can be seen with

$cmd='md5sum -c ./hidden/wordpress.md5 | grep -oh ".*FAILED.*"';

CC-BY-NC

Upgrade and root Honor 6

Note to myself

* backup system data to SD card
* get new Honor 6 firmware (H60-L04,Android 5.1.1,EMUI 3.1,West Europe) from Huawei (mirror), copy it to the SD card and install it using the existing emui app
* restore system data
* get bootloader unlock code from Huawei and send it via open usb connection to phone (fastboot oem unlock ****************)
* install kingroot root app from playstore and root
* install droidwall


CC-BY-NC

I am a parasite too

Jeff Drazen writes in the NEJM

… a new class of research person will emerge — people who had nothing to do with the design and execution of the study but use another group’s data for their own ends, possibly stealing from the research productivity planned by the data gatherers, or even use the data to try to disprove what the original investigators had posited. There is concern among some front-line researchers that the system will be taken over by what some researchers have characterized as “research parasites.”

As with other remarks of Jeff Drazen, I regard this as a severe misunderstanding of basic scientific principles. Basic science is always a cooperative enterprise: somebody gets the money, somebody designs the study, somebody does the fieldwork, somebody the laboratory analysis, somebody the statistical testing and somebody the writing up of the results. You can only steal something that’s being owned by someone. If I can disprove what an original investigators had posited, isn’t that advanced science? Often a re-analysis is indispensable for internal reasons. boston.com therefore describes that statement as “paternalistic arrogance”.


CC-BY-NC

Sind Sie Optimist?

ZEIT Wissen (: Andreas Labert, Christian Schwägerl). Frage an Martin Nowak: Sind Sie Optimist?

Ja, es kommt bei mir ein ganz tiefer Optimismus zustande. Ein Glaube an den Logos, an eine fundamentale Wahrheit, die uns aber nur teilweise zugänglich ist. Man kann natürlich behaupten, es gibt diese Wahrheit nicht, aber was ist die Alternative dazu? Es bliebe eigentlich nur der Nihilismus, die Ansicht, dass nichts einen Sinn ergibt – das würde dann aber die Wissenschaft mit einschließen.


CC-BY-NC

Updating to PHP 7.0

“Deprecated means deprecated” this is what I learned today. In practice, PHP finally kicked out some functions breaking now my web serve. Errors may be expected
* when a variable is used but not declared before.
* split is deprecated, use explode instead and take care that there is always something to explode

list($a,$b) = explode("/","$word/");

* eregi is deprecated, use

preg_match('/hello/', $string);

* end($array) is not working, use

$arry[count($array)-1]

The true/false shortcuts 1>1 ? T : F isn’t anymore acceptable

1>1 ? true : false

Unfortunately owncloud calendar sync stopped working – took me quite some time to find out why

Array to string conversion at /owncloud/3rdparty/sabre/dav/lib/CalDAV/CalendarQueryValidator.php#62

As owncloud hotfixes did not work and a own cloud update failed, I had to switch back to 5.6.

 


CC-BY-NC