Category Archives: Software

Convert MS SQL Server database to SQLITE

It took me basically 2 days to figure that out as most hits at Google were misleading.
My recommendation now is to install Docker and use a 2019 version of MS SQL Server.

docker pull mcr.microsoft.com/mssql/server:2019-latest
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=you_should_know_it" -e "MSSQL_PID=Express" -p 1433:1433 --name sql1 --hostname sql1 -d mcr.microsoft.com/mssql/server:2019-latest
sudo docker ps -a
# gives you the id like bea83... below that is needed to copy the mdf file to the container
docker cp /Users/you_should_know/database.mdf bea8369066ed:/var/opt/mssql/data
docker cp /Users/you_should_know/database_log.ldf bea8369066ed:/var/opt/mssql/data

Login as su and change permission of the uploaded file. Afterwards attach the database

sudo docker exec -u 0 -it sql1 "bash"
chmod 777 /var/opt/mssql/data/data*.*
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "you_should_know_it" -Q "CREATE DATABASE [new_data_base] ON (FILENAME = N'/var/opt/mssql/data/database.mdf'),(FILENAME = N'/var/opt/mssql/data/database_log.ldf') FOR ATTACH"

Cool, on localhost:1443 we can now see MS SQL Server working..
Connecting with Azure was a dead end, also with SQL Pro Studio as the export could not be read by SQLITE.
Razor SQL worked (do not use DB Tools -> Export but DB Tools -> Database Conversion).
This generates a sql file that SQLITE will understand.

 cat run.sql | sqlite3 database.db

Fortunately Galactica is down

I just started a review of Galactica.

but today the search bar is already gone. So what happened here? cnet knows more

Galactica is an artificial intelligence developed by Meta AI (formerly known as Facebook Artificial Intelligence Research) with the intention of using machine learning to “organize science.” It’s caused a bit of a stir since a demo version was released online last week, with critics suggesting it produced pseudoscience, was overhyped and not ready for public use.

There is no need to make any further comment.

https://twitter.com/JoeBHakim/status/1592621465018720256?s=20&t=LrwiBQLg4qK_zBUofTRXPA

Claims
Vitriol

On code review

https://debruine.github.io/talks/RIOT-code-review-2022

A R function creating 96 well plate sample assignment

Most recently I had to add forgotten data to a SQL server database that was in use only until 2010. Script language was Cold Fusion at that time creating a visual interface to 96 well plates where proband IDs are assigned to plate positions by drop down fields.

R doesn’t have any good way for formatted data entry. Some shiny apps would be helpful but a bit overkill here. Data export into a javascript framework would be also a more professional solution while I just needed only a quick way to modify my database.

So I came up with some R code producing html code embedding javascript functions that can export the result as SQL code, so a 4 language mixup.

96 well plate assignment
dataentry <- function(plate_id,city) {
# get orig IDs from database first

# position identifier A01, A02...
pos = NULL
for (i in 1:8) {
  pos = c(pos, paste0( rep( LETTERS[i], 12), str_pad( 1:12 ,2,pad="0" ) ) )
}
	
HTML <- paste('<html>
<script>
function download(filename, text) {
  var element = document.createElement("a");
  element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text));
  element.setAttribute("download", filename);
  element.style.display = "none";
  document.body.appendChild(element);
  element.click();
  document.body.removeChild(element);
}
function saveValues() {
  var frm = document.getElementById("f");
  var params = "";
  var sample_id = ',sample_id,';
  for( var i=0; i<frm.length; i++ ) {
    sample_id++;
    var fieldId = frm.elements[i].id;
    var fieldValue = frm.elements[i].value;
    if (fieldValue) params += "INSERT INTO samples (plate_id,plate_position,patient_id) VALUES (',plate_id,'," + fieldId + "," + fieldValue + ")\\n";
  }
  download("',plate_id,'.SQL",params);
}
</script>
<body>
<form id="f">')
	
# dropdowns
sel ='<option value=""></option>'
for (i in 1:dim(patients)[1]) {
  sel <- paste0(sel,'<option value=',patients[i,"patient_id"],'>',patients[i,"Orig_ID"],'</option>\n')
}
for (i in pos) {
  if (substr(i,2,3) == "01") HTML <- paste0(HTML,'<BR>')
  HTML <- paste(HTML,'<select id=',i,'>',sel,'</select>')
}
	
HTML <- paste(HTML,'</form>
<br><input name="save" type="button" value="SQL" onclick="saveValues(); return false"/>
</body></html>')
	
sink( paste('plate.html') )
cat(HTML)
sink()
}
dataentry(725,'city')

Why lines of code is a bad metric for a programmer

There  is a long explanation over at medium

committing code is a small part of what software engineers do. There are many ways in which you can contribute technically without writing much code. In fact, the best senior engineers I know are great at prioritization, delegation, and simplifying. Their pull requests are tiny because they’ve made the code modular and straightforward. … Writing negative code is a point of pride! If you refactored a complex piece of logic, picked a good library to solve a problem, or eliminated unnecessary features, then you’ll have a negative commit history. ..  fine-tune configs, research arcane issues, and dive deep into underlying architecture. Working on these jobs can mean days of research just to make a few-line change.

The same applies to amount of funding received by a scientist (although frequently used for calculation of salariy). If I can achieve the same impact at a fraction of the costs, isn’t that much better than producing more costs?

At least one positive advice?

Is there at least one positive advice of all that Musk utterance?

https://archive.ph/TcxaF#selection-1319.0-2987.210
  1.  Avoid large meetings
    Large meetings waste valuable time and energy – They discourage debate – People are more guarded than open – There’s not enough time for everyone to contribute. Don’t schedule large meetings unless you’re certain they provide value to everyone.
  2. Leave a meeting if you’re not contributing
    If a meeting doesn’t require your: – Input – Value – Decisions Your presence is useless. It’s not rude to leave a meeting. But it’s rude to waste people’s time.
  3. Forget the chain of command
    Communicate with colleagues directly. Not through supervisors or managers. Fast communicators make fast decisions. Fast decisions = competitive advantage.
  4.  Be clear, not clever
    Avoid nonsense words and technical jargon. It slows down communication. Choose words that are: – Concise – To the point – Easy to understand Don’t sound smart. Be efficient.
  5. Ditch frequent meetings
    There’s no better way to waste everyone’s time. Use meetings to: – Collaborate – Attack issues head-on – Solve urgent problems But once you resolve the issue, frequent meetings are no longer necessary. You can resolve most issues without a meeting. Instead of meetings: – Send a text – Send an email – Communicate on a discord or slack channel Don’t interrupt your team’s workflow if it’s unnecessary.
  6. Use common sense if a company rule doesn’t make sense
    Contribute to progress – Apply to your specific situation Avoid following the rule with your eyes closed. Don’t follow rules. Follow principles.

Warning : 2) and even other x) only suitable for slightly autistic, self obsessed and excellent scientists.

 

 

Katzenjammer II

Seltsam, was gerade auf Twitter los ist wenn wir CT Bergstrom glauben, der eine Team Email von Musk geteilt hat.

putative chief twit email as distributed by CT Bergstrom https://archive.ph/ZNWIN

Es sieht so aus als sei Twitter nun in der Gewalt von einem reichen Mann, der einem pseudoreligiösen Mars Kult angehört – nachzulesen in dem aufschlussreichen Artikel von Dave Troy

This is a reference to “longtermism” the heavily marketed philosophy being promoted by Musk and his friend William MacAskill that asserts the only thing that matters is humanity’s future in space, and that the only goal of the living is to maximize the number of future humans alive, as well as the number of artificial intelligence instances that could possibly exist in the future. This mandate is most often used to brush aside calls for improving conditions and alleviating suffering among the living here on Earth now. Because, the theory goes, giving a poor person a blanket isn’t likely to be as useful for the future of humanity as building a rocket to Mars. Longtermism is heavily influenced by “Russian Cosmism” and is also directly adjacent to “Effective Altruism.” Musk’s stated mission, which he intends to fulfill in his lifetime, is to “make humanity a multiplanetary species.” The anti-democratic urge in longtermism is rooted in the belief that “mob rule” will lead to nuclear annihilation; we should, Musk thinks, be guided by “wiser” minds.

 

 

 

Surveillance Publisher

Capitalized value? Personalized PDFs? DFG warning? User tracking? Forced marriage? It is incredible how scientific publishers are expanding their business. Here is a new paper

This essay develops the idea of surveillance publishing, with special attention to the example of Elsevier. A scholarly publisher can be defined as a surveillance publisher if it derives a substantial proportion of its revenue from prediction products, fueled by data extracted from researcher behavior. … The products’ purpose, moreover, is to streamline the top-down assessment and evaluation practices that have taken hold in recent decades. A final concern is that scholars will internalize an analytics mindset, one already encouraged by citation counts and impact factors.  

Sure, this already happens as some committees look only at lists of impact factor and grant sums. In the near future, they will switch to Elsevier`s “human ressources” management system Interfolio to compare candidates.

Founded in 1999, Interfolio supports over 400 higher education institutions, research funders and academic organizations in 25 countries, and over 1.7 million academic professionals and scholars. Theo Pillay, General Manager of Research Institutional Products, Elsevier, said: “Interfolio has a proven track record in supporting the academic community, thanks to its deep understanding of faculty needs, institutional workflows, research assessment and academic careers, combined with its agile technology and experienced leadership.

Back to the original article

the publishing giants have long profited off of academics and our university employers—by packaging scholars’ unpaid writing-and-editing labor only to sell it back to us as usuriously priced subscriptions or article processing charges (APCs). That’s a lucrative business that Elsevier and the others won’t give up. But they’re layering another business on top of their legacy publishing operations, in the Clarivate mold. The data trove that publishers are sitting on is, if anything, far richer than the citation graph alone.

Data is the new oil, indeed.

Katzenjammer I

Auf Science Twitter ist die Stimmung am Tiefpunkt nachdem Wissenschaftler scharenweise den Dienst verlassen.

https://twitter.com/CT_Bergstrom/status/1585880361292435456

obwohl doch klar ist, daß Continue reading Katzenjammer I

How to publish your preprint

How to save hundreds of $$$ paying a predatory publisher: Use the preprint form at Github and create your own PDF that can be uploaded to OSF or any other preprint server for free.

brew install --cask vscodium
brew install --cask mactex

and continue with the instructions here…

 

Ein mathematischer Gottesbeweis

Ein mathematischer Gottesbeweis geht zurück auf Guido Grandi und  wurde vor kurzem wieder mal ausgegraben von u/Prunestand bzw Cliff Pickover.

0 = 0 + 0 + 0 + ...
  = (1-1) + (1-1) + (1-1) + ...
  = 1 - 1 + 1 - 1 + 1 - 1 + ...
  = 1 + (-1 + 1) + (-1 + 1) + (-1 + 1) + ...
  = 1 + 0 + 0 + 0 + ...
  = 1

was letztendlich einer Schöpfung aus dem Nichts entspricht wo doch eigentlich “nihilo ex nihilum” gilt.

Die Grandi-Reihe hat nur leider keinen Summenwert, weil sie nicht konvergent ist. Anders gesagt

0 + 0 + 0 + ...                          # N Elemente
(1-1) + (1-1) + (1-1) + ...              # 2N Elemente
1 - 1 + 1 - 1 + 1 - 1 + ...              # 2N Elemente
1 + (-1 + 1) + (-1 + 1) + (-1 + 1) + ... # 2N + 1 Elemente
1 + 0 + 0 + 0 + ...                      # N + 1 Elemente

dh die 4. Zeile enthält eine falsche Aussage.

Frustriert oder erleichtert? Auf arXiv geht es weiter mit Gödels Gottesbeweis.