Counter example to Zooko’s triangle? [on hold]

So Zokoo’s triangle is a conjecture that is often explained by this trilemma:





pick two

But what if we hash the public key of an user and turn it into a meaningful identifier?

For example, we can use the hash as an input to get an unique profile picture with Gravatar (the default profile picture generator of Stack Exchange). We can also pass the hash as a seed to a neural network that generates profile pictures with people, animals, landscapes, etc.

But that’s not good, we can’t fetch an user identified by their profile picture, so we have to create meaningful character strings. I call it the “exquisite corpse” method: Let’s say the hash contains 6 alphanumerical characters, we can divide it into 3 parts of 2 characters each. The first part identifies an adverb in a dictionary of 3844 words ((26*2+10)²), the second part identifies an adjective is a dictionary of 3844 words and the third part a noun in a dictionary of 3844 words. This way, we obtain usernames like Extremely Metaphorical Chicken.

Maybe you would say that relying on a common arbitrary dictionary of words makes it not distributed, but in this case the arbitrary choice of the hash function would also make it not distributed. The ‘distributed’ criterion means that every peer on the network can do name resolve by themselves, not that we can’t rely on a common standard. Every peer can download the dictionary and/or the Gravatar generator (although I concede installing a whole neural network would be too much).

Is it a proper counter-example to Zooko’s triangle or I am mistaken? If so, should we change “human-meaningful” to “human-choosable”?

Thank you for your help.

PerfLib 2.0 counter removal failed with exit code 2

When I’m installing SQL server 2017 express edition, I’m facing this error:

PerfLib 2.0 counter removal failed with exit code 2. Command line: C:\Windows\system32\unlodctr.exe /m:hkengperfctr.xml from directory C:\Program Files\Microsoft SQL Server0\Shared.

And it shows that I have 3 features are failed:enter image description here

this is my summary:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Anyone can give me some ideas to fix this?

Cannot enable User Input Delay performance counter on Windows Server 2016

As per;

One should be able to enable the User Input Delay performance counters.

I have added to the registry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]  "LagCounterInterval"=dword:00005000 

Rebooted the system, but such counter is not available.

On Windows 10 this works. But I can’t get it to work on Windows Server 2016. As the article hints it’s enable per default on Server 2019, one can conclude that Server 2016 is also supported.

Does anybody know more about this?

Windows batch for loop refer to array with global variable as counter

I have problem with this for loop:

@echo off setlocal enableDelayedExpansion  set /a ID=1  for /f "delims=" %%G in ('dir *.jpg /b') do (     set filename[!ID!]=%%~G     set /a ID+=1 )  set /a ID-=1  set /a NEXT=2  FOR /L %%G IN (1,1,%ID%) DO (      echo "convert !filename[%%G]! !filename[!NEXT!]! -delay 20 -morph 10 %%G_morph.jpg"     set /a NEXT+=1  )   endlocal 

Question is how may I get array with global variable ( which is increasing ) working?

I tried lots of configurations like %%filename[%%NEXT%%]%% etc…

First one !filename[%%G]! works great but how may I get next array value?

Pull-up sequence accumulator counter

I wanted to create a function describing a sport game called “Leader”. The idea is that you make as many push-ups as you can, increasing each repetition by 1 and as you reach your maximum, each next repetition is decreased by 1 until you reach 0 push-ups eventually.

I managed to do this using dictionaries, but I think this could be done in much easier way.

def leader_step(max):     i = 0     psps = {0: 0}     cnt = {0: 0}     k = 1     while max + abs(k) >= psps[i]:         if psps[i] >= max:      # decrease push-ups as they reach max             k = -k         i += 1         psps[i] = k + psps[i-1]         if psps[i] < 1:         # game stops when you reach 1 push-up             del psps[i]             break         cnt[i] = cnt[i - 1] + psps[i] # counting the sum of all push-ups     del psps[0]     del cnt[0]     return psps.values(), cnt.values() 

Function should return 2 sequences:

  1. showing the number of push-ups at each repetition
  2. showing total sum of push-ups made at each repetition

Why does my loop counter seem to be passed by reference?

I stumbled upon something that threw me for a loop and pared it down to this simple example:

class Program {     static void Main(string[] args)     {         new Program().Run();     }      public delegate void EventDelegate(int val);     public event EventDelegate Event;      public void Run()     {         Event += EventHandler;         var tasks = new List<Task>();         for(int i = 0; i < 5; ++i)         {             tasks.Add(Task.Run(() => Event?.Invoke(i)));         }         Task.WaitAll(tasks.ToArray());     }      public void EventHandler(int val)     {         Console.WriteLine("event {0} handler started", val);         Task.Delay(1000).GetAwaiter().GetResult();         Console.WriteLine("event {0} handler complete", val);     } } 

This outputs:

event 5 handler started event 5 handler started event 5 handler started event 5 handler started event 5 handler started event 5 handler complete event 5 handler complete event 5 handler complete event 5 handler complete event 5 handler complete 

I expected to see values 0 through 4 in indeterminate order. It’s as if the loop counter i is being passed by reference, or boxed once and then the boxed value modified. What is actually going on here?

I found this Q&A and this answer, which seem to confirm what I expected, not what I’m seeing.

I also found that if I change the line

tasks.Add(Task.Run(() => Event?.Invoke(i))); 


var x = i; tasks.Add(Task.Run(() => Event?.Invoke(x))); 

…then I get the output I expected.