json – Erro do Index fora do Range sem declarar o Range

Estou fazendo requisições e tratando as reponses através de um Unmarshall na seguinte Struct:

type Cidade struct {
    Name         string `json:"city"`
    Confirmed    int    `json:"last_available_confirmed"`
    Deaths       int    `json:"last_available_deaths"`
    NewConfirmed int    `json:"new_confirmed"`
    NewDeaths    int    `json:"new_deaths"`

type APIResultados struct {
    Count    int      `json:"count"`
    Next     string   `json:"next"`
    Previous string   `json:"previous"`
    Results  ()Cidade `json:"results"`

Nas funções, eu tenho a atribuição da Struct e um método Unmarshall, com tudo certinho:

apiResults:= APIResultados{}
jsonErr := json.Unmarshal(body, &apiResults)
if jsonErr != nil {

Eu tenho isso acima repetido em três funções com as partes essenciais idênticas (tratamento da response, tudo certinho), e elas são identicas porque apenas clonei a primeira em três e alterei alguns dados que não tem a ver com o tema.

O problema é: quando executo as três funções gêmeas, as duas primeiras funcionam, e a terceira retorna o erro:

panic: runtime error: index out of range (0) with length 0

O que não faz nenhum sentido, pois sequer declarei o tamanho da Struct na linha Results ()Cidade json:"results"

Eu já fiz alguns testes, e quando deixo as duas primeiras funções comentadas, a terceira funciona normalmente. Isso me faz crer que é algum “limite de uso de memória” em alguma coisa. Também tentei alterar o timeout das requests pra 120 segundos, mas creio que não seja isso.

Looking for details on Dynamic Range vs ISO

I have been reading up on maximizing dynamic range of digital sensors in order to get a rich image and soft roll-offs. One thing that I cannot wrap my head around are the following concepts and the combination of them:

  1. Digital sensors tend to push multiple steps of dynamic range below 18% grey when the ISO is decreased. To maximize dynamic range in both shadows and highlights and get softer roll-off it seems right to shoot at higher ISO.

enter image description here

  1. Simultaneously, there seems to be a pretty wide consensus that exposing to the right (ETTR) yields best results in terms of dynamic range for digital sensors. This indirectly implies lowering the ISO to keep highlight from clipping. Or must ETTR be combined with ND filters som these purposes?
  2. Multiple sources suggest that shooting above native sensor ISO could yield further movement of dynamic range steps above 18% grey – could this really be true?
  3. The chart shown in the image suggests that dynamic range in highlights/shadows is relative to 18% grey. Is that most often true?
  4. This site and many others imply that overall dynamic range is lost at higher ISO: https://photonstophotos.net/Charts/PDR.htm.

The only conclusion I can positively draw is that light scenes should be shot at slightly higher ISO to maximize highlights dynamic range while dark scenes should be shot at low ISO to maximize shadow dynamic range. But I can’t figure out how to apply ETTR technique to this line of reasoning.

I am aware of the confusing nature of the question, but I cannot boil it down more due to my lack of further understanding in the topic. Any input is much appreciated.

timeline – Display a range on a number line with a value

Is there a standard or good way to display a range of values (lower bound and upper bound) along with a particular value. The particular value might be too low (below the lower bound), too high (above the upper bound, or normal (between the bounds)? As in results from a blood test. For example, here’s a very crude drawing of those 3 scenarios:
enter image description here

Maybe a timeline type of interface?

vba – Autorecalculate Excel function that evaluates a string as a named range?

I have 2 workbooks, an monthly sales input workbook, and a calculation by type workbook.

I have used named ranges in the calculation workbook to reference the different months in the input workbook (i.e. JUN_2020, etc.)

I wanted to make a dynamic daily sales show up in the calculation workbook using the Named Ranges as a variable.

I came across this function in the thread submitted by chris neilsen (Excel function that evaluates a string as if it were a formula?)

Function ev(r As Range) As Variant
    ev = Evaluate(r.Value)
End Function

I looped the data into an excel basic index function

=INDEX(ev(monthvar),row, dayofthemonth)


monthvar = text turned to named range
day of the month = 1-31 in another column

It works just fine until I update the data in the input workbook, where it does not update the data in the calculation workbook.

I looked around for depends and calculation in the VBA but I don’t really understand VBA.

It is a large workbook so application.volatile is not a good option.

Any help is appreciated

plotting – Limit Y-axis Evaluation but NOT the Plot Range

I have seen some answers to similar questions, but usually they are satisfied with just limiting the plot using PlotRange.
I want to keep the plot range as I have it, and just limit the range that is evaluated.
I don’t want to show that horizontal line at 90 (which is part of the output) so I want to limit the output to just above 90 (like 90.1) so that I can instead show the horizontal dashed line as the output approaches it asymptotically.
I think it does not tell the story as clearly if I just limit the range to 90 since it would be approaching the x-axis so I want to keep the displayed range down to 80.

eq1 = NSolve(0.5==(-(Pi)/3)r^3(1/Cos((Theta)*Degree)^3)(2+Sin((Theta)*Degree))(1-Sin((Theta)*Degree))^2, (Theta));
Labeled(Plot((Theta)/.eq1, {r,0.6203, 6} ,ImageSize->700,ImageMargins->0,ImagePadding->{{22, 10}, {15, 5}}, PlotRange-> {{0,6},{90,180}}, GridLines ->{{{0.62,Dashed}}, {{90, Dashed}}}, Ticks ->{{0,0.62,1,2,3,4,5,6},{10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180}}),{"Contact Angle ((Degree))","Tube Radius",  "Maximum Contact Angle for Plug of Volume 1 at Critical Bond Number" }, {Left, Bottom, Top}, RotateLabel -> True, Spacings ->{0,1,0})

sharepoint online – New-PnPTerm : Specified argument was out of the range of valid values

You have to check, which languages are allowed in your Term store.

Replace your tenant name in the following URL and then open it in a browser:

In my case, the term store had only English (lcid 1033) set as default language and no additional Working language was defined.

When running the PowerShell, it automatically took lcid 1031 (German) as default, so it failed. When I tried setting manually lcid 1031, it still failed. When I set lcid manually to lcid 1033, the command succeeded, but that was not, what I wanted.

The solution was to got in the term store administration and add German as a working language. Afterwards, I was also able to run the command without setting lcid. It is also possible to change the default Term Store language afterwards.

Iterating over a C# range

Using GetEnumerator extensions added in C# 9 I was able to do the following:

    public static class Extensions
        public static IEnumerator<int> GetEnumerator(this Range range)
            var start = range.Start.Value;
            var end = range.End.Value;            

            var current = start;
            while (current <= end)
                yield return current++;

Which enables me to do this neat thing:

foreach (var i in 1..5)

What I want to know is what are potential problems or side effects. Apart from a little performance loss, what downsides can you see if I would write like this in the future instead of using a for loop?

How to sum a range columns from another google sheet

I get this daily data consumption spreadsheet report from a vendor that looks like this

userid    feb1    feb2    feb3     .    feb29 
u1        100     34      23       .     4
u2        0       24      21             62
u3        300     25      5              1
u4        50      5       6      
un        23      52      3        .     42

where n is my total number of users.

What I care about is simply tracking the daily consumption of all users.. so my final sheet should look like this

date        daily consumption
feb1        14,971     
feb2        6,898       
feb3        10,666     

feb29        10,543     

Currently I’m doing this by writing this in each line in my final sheet, for example to get the 14,971 for feb1 I’m putting


Naturally this is very manual and slow work. I want to know how to do this using a single formula or pivot table etc. I tried using array formulas, queries, pivot tables but I keep on getting stuck. Any suggestions?

windows 10 – How to force Chrome to use discrete GPU for specific range of URLs?

I do a lot of development in the context of html5 canvas on my laptop. It has Intel UHD Graphics and NVIDIA GeForce 2060. When the browser window has focus, the load on the GPU (integrated) increases dramatically. And since the Intel graphics processor is significantly weaker than the same one from nvidia, then I would like to forcibly select a more productive component of my laptop.

I am aware of how to choose this for the browser (application) in general. https://superuser.com/a/1324484/1278689

But how select such preference for only a range of specific URLs? I don`t really want to use NVidia for every site on the web.