31 January 2020

Android Studio tips

  •  If you are used to windows shortcuts, be sure to map CTRL+Y (delete line) to redo. This is OK in Intellij now, but  change does not seem to have made it to Android Studio yet
  • Markdown plugin
  • The Intellij markdown plugin does not work in Android Studio.Use the Markdown Navigator Enhanced plugin as an alternative.This is a paying plugin , but it is free for Community IDE's, and I think Android Studio qualifies as such.
    Works fine for me anyway.

29 January 2020

Git error on new repository: fatal: refusing to merge unrelated histories

Scenario

You have a local project you want to add to a git cloud repository (like github).
You create an empty git repository on the platform.
On your local system you add the repository to your project, for example by doing:

$ cd myProject
$ git remote add origin https://github.com/myAccount/myProject.git
$ git push -u origin -all
error: failed to push some refs to https://github.com/myAccount/myProject.git
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.


This should work without errors!? Well, let's follow the suggestion...

$ git pull origin master
warning: no common commits
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/myAccount/myProject
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
fatal: refusing to merge unrelated histories


Cause

You get this error if you created the repository on the git cloud repository with one or more files in it, for example a README.md or a license file.

Solution

$ git pull --allow-unrelated-histories origin master
 From https://github.com/myAccount/myProject
 * branch            master     -> FETCH_HEAD
CONFLICT (add/add): Merge conflict in README.md
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.


Resolve the merge conflicts, then

$ git commit -a
$ git push -u --allEnumerating objects: 89, done.
Counting objects: 100% (89/89), done.
Delta compression using up to 8 threads
Compressing objects: 100% (81/81), done.
Writing objects: 100% (87/87), 25.17 KiB | 560.00 KiB/s, done.
Total 87 (delta 32), reused 0 (delta 0)
remote: Resolving deltas: 100% (32/32), done.
To https://github.com/myAccount/myProject
   efa6140..4dc0893  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.



All's well now!

26 January 2020

experimental replacements for git checkout

The git checkout command has two forms. Since git 2.23 there are two experimental separte commands for each form.

  • git restore
    • replaces git checkout <path> to restore specific files to the current working directory. Examples of old/new equivalents:
      • git checkout ac36590 hamburger.md
      • git restore -s ac36590 hamburger.md
        # -s (or --source) commit or branch
      • git checkout -- tiramisu.md
      • git restore tiramisu.md
        # restore from index
      •  
      •  other interesting options
        • --staged: restore to index
        • --staged --worktree: restore to index and working directory
  •  git switch
    • replaces git checkout to switch to another branch. Examples of old/new equivalents:
      • git checkout feature
      • git switch feature

      • git checkout -b newFeature
      • git switch -c newFeature # -c or --create

25 January 2020

ISOC to sell .org domain to private investors for over 1 billion dollar


Last year ICANN (Internet Corporation for Assigned Names and Numbers), the organisation that supervises DNS, lifted the price cap on .org domain names, despite many protests. This was a decision taken by staff, not by the board. .org domain names are used by many non-profit organisations.
Now that more money can be made here, ISOC (Internet SOCiety), the authority who manages the .org domain, has put the top domain up for sale.
ISOC has immediatly found a candidate who wants to pay $1.135bn for it: Ethos Capital a completely new company with only two staff members, set up by... the former CEO of ICANN, Fadi Chehade, backed by investment companies. Ties of these investment companies with American republican billionaires have raised concerns about political neutrality with respect to the non-profit organisations under the .org umbrella.
A third of the purchase is going to be financed by debt, implying that Ethos capital will have to earn a lot of money with the sale of those domains.
People have been protesting and asked the ICANN board to halt the decision, arguing that, as ICOS never purchased .org, they do not have the right to sell it for more than a billion dollar.

16 January 2020

SHA-1 fully and practically broken

Redently scientists have been able to break SHA-1, with a computational cost (e.g. on Amazon cloud) of $11K.
You should only use the SHA-2 family of secure hash functions (SHA-256, SHA-512...) now.

15 January 2020

Jongeren in tijden van big data

Met hun video’s op TikTok
als een digitale prikklok
weten machtige Chinezen
heel hun leven af te lezen.

Wie er links of rechts een date had?
Wel, Mark Zuckerberg, die weet dat.
Dankzij kiekjes, filmpjes, flardjes,
ruim voorzien van tags en hartjes.

Een id moet dezer dagen
ook hun vingerafdruk dragen.
Privacy is, zo te zien,
zó 2019!

Stijn de Paepe - dagvers 11/01/2020

git state management

The Three Trees


 Detailed


9 January 2020

Firefox 72: get rid of push notification popups

In Firefox 72 you can now avoid random websites asking to send you notifications. Automatically say no in options> privacy and security, scroll down to notifications and click settings...
Then:


Additionally Firefox has enhanced security by making fingerprinting more difficult.

Developer features:

  • debugger watchpoints: breakpoints on property changes.
  • experimental CSS motion path feauture: an easier way to animate than transform.