问:
"POST /home_tests/10/vote/ HTTP/1.1" 302 0 In an if/else condition, only else is triggered
I want to make a questionnaire. There is a column with the correct answer from the admin. When voting, it checks against the 'answer' field and stores the votes that matched in 'correct_votes' and the rest in 'votes' . For reconciliation, there is a condition 'if', 'else'. Also, for my understanding, I made it to print 'correct' if the voices with 'answer' converge and 'not correct' if they do not converge. But for some reason, when voting, it always prints 'not correct' and votes are not recorded in 'correct_votes' even when they are the same as 'answer'. But 'else' always works and voices are recorded there.

```<code>view.py

def vote(request, question_id):
    question = Question.objects.get(pk=question_id)
    try:
        selected_choice = question.choice_set.get(pk=request.POST['choice'])
    except (KeyError, Choice.DoesNotExist):
        return render(request, 'home_tests/question.html', {
            'question': question,
            'error_message': "You didn't select a choice.",
        })
    else:
        if selected_choice.votes == question.answer:
            print('correct')
            selected_choice.correct_votes += 1
            # selected_choice.save()
        elif selected_choice.votes != question.answer:
            print('not correct')
            selected_choice.votes += 1
    selected_choice.save()
    return HttpResponseRedirect(reverse('home_tests:results', args=(question.id,)))
</code>```
```<code>models.py

class Question(models.Model):
    objects = None
    language = models.ForeignKey(Language, null=True, blank=True, on_delete=models.CASCADE)
    question_text = models.CharField(max_length=200, null=True, blank=True)
    answer = models.CharField(max_length=250, null=True, blank=True)
    pub_date = models.DateTimeField('date published', null=True, blank=True)

class Choice(models.Model):
    DoesNotExist = None
    language = models.ForeignKey(Language, null=True, blank=True, on_delete=models.CASCADE)
    question = models.ForeignKey(Question, on_delete=models.CASCADE, null=True, blank=True)
    choice_text = models.CharField(max_length=250, null=True, blank=True)
    votes = models.IntegerField(default=0, null=True, blank=True)
    correct_votes = models.IntegerField(default=0, null=True, blank=True)
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
</code>```

I try vote and became:

Quit the server with CONTROL-C.
[09/Jan/2023 18:49:27] "GET /home_tests/home/ HTTP/1.1" 200 2591
[09/Jan/2023 18:49:28] "GET /home_tests/10/ HTTP/1.1" 200 785
not correct
[09/Jan/2023 18:49:40] "POST /home_tests/10/vote/ HTTP/1.1" 302 0
[09/Jan/2023 18:49:40] "GET /home_tests/10/results/ HTTP/1.1" 200 521

enter image description here

Body:
I want to make a questionnaire. There is a column with the correct answer from the admin. When voting, it checks against the 'answer' field and stores the votes that matched in 'correct_votes' and the rest in 'votes' . For reconciliation, there is a condition 'if', 'else'. Also, for my understanding, I made it to print 'correct' if the voices with 'answer' converge and 'not correct' if they do not converge. But for some reason, when voting, it always prints 'not correct' and votes are not recorded in 'correct_votes' even when they are the same as 'answer'. But 'else' always works and voices are recorded there.

view.py

def vote(request, question_id):
    question = Question.objects.get(pk=question_id)
    try:
        selected_choice = question.choice_set.get(pk=request.POST['choice'])
    except (KeyError, Choice.DoesNotExist):
        return render(request, 'home_tests/question.html', {
            'question': question,
            'error_message': "You didn't select a choice.",
        })
    else:
        if selected_choice.votes == question.answer:
            print('correct')
            selected_choice.correct_votes += 1
            # selected_choice.save()
        elif selected_choice.votes != question.answer:
            print('not correct')
            selected_choice.votes += 1
    selected_choice.save()
    return HttpResponseRedirect(reverse('home_tests:results', args=(question.id,)))

models.py

class Question(models.Model):
    objects = None
    language = models.ForeignKey(Language, null=True, blank=True, on_delete=models.CASCADE)
    question_text = models.CharField(max_length=200, null=True, blank=True)
    answer = models.CharField(max_length=250, null=True, blank=True)
    pub_date = models.DateTimeField('date published', null=True, blank=True)

class Choice(models.Model):
    DoesNotExist = None
    language = models.ForeignKey(Language, null=True, blank=True, on_delete=models.CASCADE)
    question = models.ForeignKey(Question, on_delete=models.CASCADE, null=True, blank=True)
    choice_text = models.CharField(max_length=250, null=True, blank=True)
    votes = models.IntegerField(default=0, null=True, blank=True)
    correct_votes = models.IntegerField(default=0, null=True, blank=True)
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)

I try vote and became:

Quit the server with CONTROL-C.
[09/Jan/2023 18:49:27] "GET /home_tests/home/ HTTP/1.1" 200 2591
[09/Jan/2023 18:49:28] "GET /home_tests/10/ HTTP/1.1" 200 785
not correct
[09/Jan/2023 18:49:40] "POST /home_tests/10/vote/ HTTP/1.1" 302 0
[09/Jan/2023 18:49:40] "GET /home_tests/10/results/ HTTP/1.1" 200 521

enter image description here


来源: stackexchange

问:
print a second df by pulling the same values from two different df columns that do not match
I have two different unmatch (columns&rows) data frame, actually one of these df is a subset of the other df. also we can call main and subset dfs. And I want to find matched values between subset and main df. Then I need to add the matched value from main df to subset df.

1 -- > also you can examine my example table
For example:

```<code>>>dfa
Col1  Col2
1     0,01
2     0.002
3     0.02
4     0.003
5     0.004
6     0.005
7     0.008
>>dfs
Col1  Col2
1     0,01
2     0.002
3     0.02
4     0.004
> output
Col1  Col2    Col2
1     0,01    0,01
2     0.002   0.002
3     0.02    0.02
4     0.003   NaN
5     0.004   0.004
6     0.005   NaN
7     0.008   NaN
</code>```

In this example dfs is subset of dfa. and I want to find only same values from Col2 and add to dfs for new column.

Thanks all.

ContentLicense: CC BY-SA 4.0

Body:
I have two different unmatch (columns&rows) data frame, actually one of these df is a subset of the other df. also we can call main and subset dfs. And I want to find matched values between subset and main df. Then I need to add the matched value from main df to subset df.

1 -- > also you can examine my example table
For example:

>>dfa
Col1  Col2
1     0,01
2     0.002
3     0.02
4     0.003
5     0.004
6     0.005
7     0.008
>>dfs
Col1  Col2
1     0,01
2     0.002
3     0.02
4     0.004
> output
Col1  Col2    Col2
1     0,01    0,01
2     0.002   0.002
3     0.02    0.02
4     0.003   NaN
5     0.004   0.004
6     0.005   NaN
7     0.008   NaN

In this example dfs is subset of dfa. and I want to find only same values from Col2 and add to dfs for new column.

Thanks all.


问:
How to load data dynamically in multiselect Dropdown using Select2
I am trying to take the data dynamically from the Sql to a Dropdown that is in a modal window (Bootstrap) in order to update the data using Select2, I implemented the suggested code dropdownParent: $('#para2') from the official page but when I open the modal window the Dropdown appear empty I am not having the expected results, please help me to correct this problem.

HTML

```<code>  <div class="row">
            <div class="col-md-6 col-sm-6 col-lg-5 form-group">
              <label class="col-form-label col-md-4 col-sm-2 label-align" for="descx">Para <i class="fa fa-users"></i></label>
              <select name="acompanantes" id="para2" class="nuevo" multiple="multiple" data-placeholder="Para" style="width: 95%">
                <option value=""></option>
                {{empleado}}
              </select>

            </div>
        </div>
</code>```

PHP

```<code>function buscaMemoPorID(){

  $soloID = $_POST["idMemo"];

  $query = " SELECT TB_Memo.ID_Memo, TB_Memo.Fecha_Creacion, a.Nombres +' '+ a.Apellidos as Destinatarios, b.Nombres + ' ' + b.Apellidos as Remitente, TB_Memo.Asunto, TB_Memo.Contenido, TB_Memo.ID_TipoMemo, TB_Memo.ID_EstadoMemo, TB_Memo.Fecha_Envio, c.Descripcion, TB_Memo.ID_Memorandum, TB_Destinatario.ID_Empleado as Para
  from TB_Memo
  inner join TB_Destinatario on TB_Memo.ID_Memo = TB_Destinatario.ID_Memo
  inner join TB_Remitente on TB_Memo.ID_Memo = TB_Remitente.ID_Memo
  inner join [IHTT_RRHH].[dbo].[TB_Empleados] a on TB_Destinatario.ID_Empleado = a.ID_Empleado
  inner join [IHTT_RRHH].[dbo].[TB_Empleados] b on TB_Remitente.ID_Empleado = b.ID_Empleado
  left outer join [IHTT_MEMORANDUM].[dbo].[TB_EstadoDestinatario] c on TB_Memo.ID_EstadoDestinatario = c.ID_EstadoDestinatario
  Where TB_Memo.ID_Memo = $soloID";

  $p = array();
  $data = $this->select($query, $p );

  $datos[1]=count($data);
  $datos[0]=array();
  for($i=0; $i<count($data); $i++){
    $datos[0][$i] = array("ult" =>1, "num" =>$data[$i]["ID_Memo"], "nome"=>$data[$i]["ID_Memorandum"],"tipoMe" =>$data[$i]["ID_TipoMemo"], "estaMe" =>$data[$i]["ID_EstadoMemo"], "asunto" =>$data[$i]["Asunto"], "contenido" =>$data[$i]["Contenido"], "fechEn" =>$data[$i]["Fecha_Envio"], "fechCre" =>$data[$i]["Fecha_Creacion"], "De" =>$data[$i]["Remitente"], "Para" =>$data[$i]["Para"], "estado"=>$data[$i]["Descripcion"], "Destinatarios"=>$data[$i]["Destinatarios"]);
  }

  echo json_encode($datos);

}
</code>```

JS

```<code>function cargaMemoEspecifico(idmemo){
  var cant = $("#mostrar").val();
  var form_data = new FormData();
  form_data.append("action","buscaMemoPorID");
  form_data.append("idMemo",idmemo);
  $.ajax({
      url: 'api_con.php',
      dataType: 'json',
      cache: false,
      contentType: false,
      processData: false,
      data: form_data,
      type: 'post',
      success: function(data){
          var area = data[0];
          if(data[1]>0  ){

              var detalle='';
              var cantidad=80;
              var total=0;
              var num=1;
              for(i=0; i<area.length; i++){

                let datos = tinymce.get("mensaje2").setContent(area[i].contenido);

                $("#modalconsulta2").modal("show");
                $("#buscab2").val(area[i].De);
                $("#para2").append("<option value='" + area[i].Para + "'>" + area[i].Destinatarios + "</option>");
                $("#modal-asunto").val(area[i].asunto);
                $("#modal-fecha").val(area[i].fechCre);
                $("#mensaje2").val(area[i].contenido);
                $("#idMemo").val(area[i].num);

   }
</code>```

Body:
I am trying to take the data dynamically from the Sql to a Dropdown that is in a modal window (Bootstrap) in order to update the data using Select2, I implemented the suggested code dropdownParent: $('#para2') from the official page but when I open the modal window the Dropdown appear empty I am not having the expected results, please help me to correct this problem.

HTML

              Para
              <select name="acompanantes" id="para2" class="nuevo" multiple="multiple" data-placeholder="Para" style="width: 95%">
                <option value=""></option>
                {{empleado}}
              </select>

PHP

function buscaMemoPorID(){

  $soloID = $_POST["idMemo"];

  $query = " SELECT TB_Memo.ID_Memo, TB_Memo.Fecha_Creacion, a.Nombres +' '+ a.Apellidos as Destinatarios, b.Nombres + ' ' + b.Apellidos as Remitente, TB_Memo.Asunto, TB_Memo.Contenido, TB_Memo.ID_TipoMemo, TB_Memo.ID_EstadoMemo, TB_Memo.Fecha_Envio, c.Descripcion, TB_Memo.ID_Memorandum, TB_Destinatario.ID_Empleado as Para
  from TB_Memo
  inner join TB_Destinatario on TB_Memo.ID_Memo = TB_Destinatario.ID_Memo
  inner join TB_Remitente on TB_Memo.ID_Memo = TB_Remitente.ID_Memo
  inner join [IHTT_RRHH].[dbo].[TB_Empleados] a on TB_Destinatario.ID_Empleado = a.ID_Empleado
  inner join [IHTT_RRHH].[dbo].[TB_Empleados] b on TB_Remitente.ID_Empleado = b.ID_Empleado
  left outer join [IHTT_MEMORANDUM].[dbo].[TB_EstadoDestinatario] c on TB_Memo.ID_EstadoDestinatario = c.ID_EstadoDestinatario
  Where TB_Memo.ID_Memo = $soloID";

  $p = array();
  $data = $this->select($query, $p );

  $datos[1]=count($data);
  $datos[0]=array();
  for($i=0; $i<count($data); $i++){
    $datos[0][$i] = array("ult" =>1, "num" =>$data[$i]["ID_Memo"], "nome"=>$data[$i]["ID_Memorandum"],"tipoMe" =>$data[$i]["ID_TipoMemo"], "estaMe" =>$data[$i]["ID_EstadoMemo"], "asunto" =>$data[$i]["Asunto"], "contenido" =>$data[$i]["Contenido"], "fechEn" =>$data[$i]["Fecha_Envio"], "fechCre" =>$data[$i]["Fecha_Creacion"], "De" =>$data[$i]["Remitente"], "Para" =>$data[$i]["Para"], "estado"=>$data[$i]["Descripcion"], "Destinatarios"=>$data[$i]["Destinatarios"]);
  }

  echo json_encode($datos);

}

JS

function cargaMemoEspecifico(idmemo){
  var cant = $("#mostrar").val();
  var form_data = new FormData();
  form_data.append("action","buscaMemoPorID");
  form_data.append("idMemo",idmemo);
  $.ajax({
      url: 'api_con.php',
      dataType: 'json',
      cache: false,
      contentType: false,
      processData: false,
      data: form_data,
      type: 'post',
      success: function(data){
          var area = data[0];
          if(data[1]>0  ){

              var detalle='';
              var cantidad=80;
              var total=0;
              var num=1;
              for(i=0; i<area.length; i++){

                let datos = tinymce.get("mensaje2").setContent(area[i].contenido);

                $("#modalconsulta2").modal("show");
                $("#buscab2").val(area[i].De);
                $("#para2").append("<option value='" + area[i].Para + "'>" + area[i].Destinatarios + "</option>");
                $("#modal-asunto").val(area[i].asunto);
                $("#modal-fecha").val(area[i].fechCre);
                $("#mensaje2").val(area[i].contenido);
                $("#idMemo").val(area[i].num);

   }


问:
netlogo help for put more conditions
I'm new, and I need to do something for my master, but I really don't have idea!!
I want to put a new characteristic in a breed.... like make a difference between people (who have more money and who have less) but I was trying everything and always i have a new problem.

What do you recommend to me? What do I need to put?

I have "compradores" but now I want to put a difference on them (and I don't know how) (in the space we have stores and list of shop).

```<code>ask patches [ set pcolor yellow ]
set productos ["aceite" "bebidas" "cerveza" "detergente" "especias" "flores" "gasoil" "huevos" "infusiones" "jamon" "kafe" "levadura"]
set-default-shape compradores "person"
create-compradores 10 [
  set color pink set heading 0 set size 2
  setxy (random world-width) + min-pxcor (random world-height) + min-pycor
  set lista-de-compra n-values 10 [item (random (length productos)) productos]
  set memoria []
]
</code>```

Title: netlogo help for put more conditions

Body:
I'm new, and I need to do something for my master, but I really don't have idea!!
I want to put a new characteristic in a breed.... like make a difference between people (who have more money and who have less) but I was trying everything and always i have a new problem.

What do you recommend to me? What do I need to put?

I have "compradores" but now I want to put a difference on them (and I don't know how) (in the space we have stores and list of shop).

ask patches [ set pcolor yellow ]
set productos ["aceite" "bebidas" "cerveza" "detergente" "especias" "flores" "gasoil" "huevos" "infusiones" "jamon" "kafe" "levadura"]
set-default-shape compradores "person"
create-compradores 10 [
  set color pink set heading 0 set size 2
  setxy (random world-width) + min-pxcor (random world-height) + min-pycor
  set lista-de-compra n-values 10 [item (random (length productos)) productos]
  set memoria []
]


问:
My custom tflite image classifier perfoms well in python but when I launch it in Android studio it doesn't work at all
We were doing a course project and faced this issue. The idea is simple, three categories: cats, dogs, and cars, the app should classify the photo in one of these. There are lots of tutorials how to implement an already taught net like ImageNet but we needed to do a custom one. I used Tensorflow Keras, saved model as h5 and then converted it to tflite with metadata, in which I specified resize and normalize options. Unfortunately, it didn't work at all.

Official Tensorflow documentation says that you need to preprocess the image like this

```<code>import org.tensorflow.lite.DataType;
import org.tensorflow.lite.support.image.ImageProcessor;
import org.tensorflow.lite.support.image.TensorImage;
import org.tensorflow.lite.support.image.ops.ResizeOp;

// Initialization code
// Create an ImageProcessor with all ops required. For more ops, please
// refer to the ImageProcessor Architecture section in this README.
ImageProcessor imageProcessor =
    new ImageProcessor.Builder()
        .add(new ResizeOp(224, 224, ResizeOp.ResizeMethod.BILINEAR))
        .build();

// Create a TensorImage object. This creates the tensor of the corresponding
// tensor type (uint8 in this case) that the TensorFlow Lite interpreter needs.
TensorImage tensorImage = new TensorImage(DataType.UINT8);

// Analysis code for every frame
// Preprocess the image
tensorImage.load(bitmap);
tensorImage = imageProcessor.process(tensorImage);
</code>```

`
We tried many times, and as I understand it's not needed if you specified metadata because without this it works a little bit better.
I guess that the problem is that it does preprocessing automatically but I haven't find anywhere which interpolation method it uses or how can I override that interpolation method. In Keras I use ImageDataGenerator and flow_from_directory to load data and it uses nearest neighbour by default. I have no opportunity to train the model again so it would be better if you tell how can I override it in Android Studio.
Thank you in advance

Body:
We were doing a course project and faced this issue. The idea is simple, three categories: cats, dogs, and cars, the app should classify the photo in one of these. There are lots of tutorials how to implement an already taught net like ImageNet but we needed to do a custom one. I used Tensorflow Keras, saved model as h5 and then converted it to tflite with metadata, in which I specified resize and normalize options. Unfortunately, it didn't work at all.

Official Tensorflow documentation says that you need to preprocess the image like this

import org.tensorflow.lite.DataType;
import org.tensorflow.lite.support.image.ImageProcessor;
import org.tensorflow.lite.support.image.TensorImage;
import org.tensorflow.lite.support.image.ops.ResizeOp;

// Initialization code
// Create an ImageProcessor with all ops required. For more ops, please
// refer to the ImageProcessor Architecture section in this README.
ImageProcessor imageProcessor =
    new ImageProcessor.Builder()
        .add(new ResizeOp(224, 224, ResizeOp.ResizeMethod.BILINEAR))
        .build();

// Create a TensorImage object. This creates the tensor of the corresponding
// tensor type (uint8 in this case) that the TensorFlow Lite interpreter needs.
TensorImage tensorImage = new TensorImage(DataType.UINT8);

// Analysis code for every frame
// Preprocess the image
tensorImage.load(bitmap);
tensorImage = imageProcessor.process(tensorImage);

`
We tried many times, and as I understand it's not needed if you specified metadata because without this it works a little bit better.
I guess that the problem is that it does preprocessing automatically but I haven't find anywhere which interpolation method it uses or how can I override that interpolation method. In Keras I use ImageDataGenerator and flow_from_directory to load data and it uses nearest neighbour by default. I have no opportunity to train the model again so it would be better if you tell how can I override it in Android Studio.
Thank you in advance


问:
How to get the closest point on bounds when I'm inside the bounds?
I’m making an VR game where the user can load a 3D model from a server and place tooltips over it to display info about specific points, so, I’m creating the logic to place the tooltips in a 3D space.

I need to get the closest point on bounds to create a vector between it and the tooltip’s attach point, so I can use that direction to place the tooltip without colliding with the mesh, the problem is, the meshes are concave most of the times, therefore the anchor point of the tooltip is inside the bounds, so Collider.ClosestPointOnBounds will not work properly.

Is there a way to get ClosestPointOnBounds when the position is inside the bounds?


问:
How to have a fixed value be replaced with NAs in SQL based on columns that DATE in their names
I have a SQL query below where at the final table, I need to the query to go through and for every column that has the word "DATE" in the name, the query will go and find the value "1900-01-01" and replace it with NULL or NA value.

In the below I have simplified the column / query, I have 100s of date columns so can't individually list them

```<code>SELECT DISTINCT
col1
col2
col3
col4
col5
col_date_1
col_date_2
col_date_99
FROM "DATATABLE"

WHERE col1 = '2020'
WHERE col2 IS NOT null
    AND col3 NOT IN ('criteria1', 'criteria2')
    AND col3 LIKE '0510%' //but exclude '0510005000'
    AND NOT((col4= 'NA' AND col5 IN ('TX', 'XK', 'XT', 'Y1', 'Y2', 'Y3', 'Y4', 'YR', 'ZH', 'ZI', 'ZJ')))

</code>```

Body:
I have a SQL query below where at the final table, I need to the query to go through and for every column that has the word "DATE" in the name, the query will go and find the value "1900-01-01" and replace it with NULL or NA value.

In the below I have simplified the column / query, I have 100s of date columns so can't individually list them

SELECT DISTINCT
col1
col2
col3
col4
col5
col_date_1
col_date_2
col_date_99
FROM "DATATABLE"

WHERE col1 = '2020'
WHERE col2 IS NOT null
    AND col3 NOT IN ('criteria1', 'criteria2')
    AND col3 LIKE '0510%' //but exclude '0510005000'
    AND NOT((col4= 'NA' AND col5 IN ('TX', 'XK', 'XT', 'Y1', 'Y2', 'Y3', 'Y4', 'YR', 'ZH', 'ZI', 'ZJ')))


问:
TypeScript Not Correctly Inferring Values From Object.entries
Suppose I have the following simple code:

```<code>const allowedUpdates = {
    'title': 'val1',
    'categories': 'val2',
    'preview': 'val3'
}

for(const [key, val] of Object.entries(allowedUpdates)) {
    console.log(allowedUpdates[key])
}
</code>```

TypeScript assigns both key and val variables with types string, whereas really the variables should be of union types 'title' | 'categories' | preview' and 'val1' | 'val2' | 'val3' respectively.

As a consequence, in the console.log line, I get a TypeScript error saying:

Element implicitly has an 'any' type because expression of type
'string' can't be used to index type '{ title: string; categories:
string; preview: string; }'.

No index signature with a parameter of type 'string' was found on type
'{ title: string; categories: string; preview: string; }'.

How does TypeScript not realise that the code will work, and how can I get around this issue?

Body:
Suppose I have the following simple code:

const allowedUpdates = {
    'title': 'val1',
    'categories': 'val2',
    'preview': 'val3'
}

for(const [key, val] of Object.entries(allowedUpdates)) {
    console.log(allowedUpdates[key])
}

TypeScript assigns both key and val variables with types string, whereas really the variables should be of union types 'title' | 'categories' | preview' and 'val1' | 'val2' | 'val3' respectively.

As a consequence, in the console.log line, I get a TypeScript error saying:

Element implicitly has an 'any' type because expression of type
'string' can't be used to index type '{ title: string; categories:
string; preview: string; }'.

No index signature with a parameter of type 'string' was found on type
'{ title: string; categories: string; preview: string; }'.

How does TypeScript not realise that the code will work, and how can I get around this issue?


问:
A function in excel that outputs a Y or an N if all the values are equal for a specific value

Components
Serial Num
Market 1
Market 2
Market 3

1234
100000000
N
Y
N

1233
100000001
N
Y
Y

1235
100000000
Y
N
N

1236
100000000
N
Y
N

1231
100000001
Y
Y
Y

I have a table with over 1k rows each with repeating and different serial numbers. The table's market status (Y or N) is based on an Xlookup that checks the component number and the components market status in another tab. The components market status is accurate. However, since the serial numbers repeat, I'm trying to create a function that can check that if for example, check if Serial number "100000001" is fully qualified Market 2. When it checks Market 2 would be "Y" because all of the "100000001" have a Y in Market 2 but if we do the same for "100000000" it should be "N" because not all of its Market qualify or have "Y". It would be simple there were a small amount of serial numbers but there's over 1k so I was trying to find out if anyone knows if this could even be possible with a spreadsheet of this size. In essence I think it would be like an Xlookup function but it would need to find and check the market status for each Serial number found and then equate if the value is equal to "Y" for each, if they all are then "Y" would come out, otherwise "N".

I hope this makes sense. It's the first time I post on stackoverflow, as such, definitely feel free to let me know if there's anything I can do to make this question clearer or up to standard with StackOverFlow language.

--

I tried using the =FILTER function but when it outputs data it creates a spill since for each serial I would need space below to give me the values. From there I would create an =AND(EXACT([range of the values output],"Y")). This would determine if all the values in the range are equal to Y, if they are "TRUE" would be the output, if not then "FALSE".

I also tried creating an xlookup function that would look for the smallest value. In doing so I would make the Market outputs Y1 and N. What I hoped would happen is that if it came across an "N", it would give me that output first. Since all it takes for the market status of the serial to be "N" is one N in its market. Only way it can be a Y is if they're all the same. Nonetheless, this does not work since XLookup only looks for the value of the serial code and not the market status value.

Hey guys thank you all for your support! I figured out a solution to the madness haha. I downloaded Ablebits which has the ability to merge together cells that contain duplicate values and the columns that contain those values are included together separated by semicolons. For instance, if merged all the cells in my example, serial number "100000000" would have the following under each market: Market 1 (N;Y;N), Market 2 (Y;N;Y), Market 3 (N;N;N). From there I created 2 color conditions in this order. 1.) if any cell contains an "N" then it would be red indicating that it isn't qualified. 2.) If any cell contains a "Y" then it would be green [since the first rule made those that contain an N red, then this one would only apply to those that have all Y;Y;Y;Y or just 1 "Y" if it didn't repeat. It does not exactly give me an output of Y or N but with all the values in a cell we can distinguish which ones have all qualifications and which don't.


问:
Any R package uses NanoString panel standard to normalize count matrix?
I was trying to use NanoTube and NanoStringDiff packages to normalize my NanoString RNA seq data. We incorporate the panel standards to address the batch effect but I don't know how to use these two packages to normalize the data incorporating the panel standards. Alternatively, if I use nSolver (NanoString designed GUI software) to normalize the data, can I use packages such as limma or DESeq2 to perform differential expression on the normalized count matrix?

Here's the info of panel standard and the two packages. I've read through the vignettes and manuals but couldn't find info to incorporate panel standards in these two packages.

Panel Standard

NanoTube

NanoStringDiff


问:
.sh script to install vscode and newrelic
I am using FAI to make a custom Debian installer. I am trying to make a script to install vscode and newrelic.

```<code>wget https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64
sudo apt install ./code_1.74.2-1671533413_amd64.deb
sudo apt install apt-transport-https
sudo apt update
sudo apt install code
</code>```

Could I have help on installing the newrelic monitoring tool for Debian and improve the VS Code download?
Thank you!

I already tried the vs code install script and it did not work.

Body:
I am using FAI to make a custom Debian installer. I am trying to make a script to install vscode and newrelic.

wget https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64
sudo apt install ./code_1.74.2-1671533413_amd64.deb
sudo apt install apt-transport-https
sudo apt update
sudo apt install code

Could I have help on installing the newrelic monitoring tool for Debian and improve the VS Code download?
Thank you!

I already tried the vs code install script and it did not work.


问:
Tokenizer keras.preprocessing.text always returns a list of many zeros
I created a simple neural network that has 9 labels to determan hatespeech comments.
i used the glove.6B.100d as a base for my AI.
now after i build the model i wanted to predict a scentence but after i use the tokenizer.texts_to_sequence("Text") the array is just"[[]]"

here is the code for the prediction

```<code>import tensorflow as tf
from keras.preprocessing.text import Tokenizer

Z = []
#toxic_comments is a csv with some comments and the labels
sentences = list(toxic_coments["Text"])
for sen in sentences:
    Z.append(preprocess_text(str(sen)))

tokenizer = Tokenizer(num_words=5000)
tokenizer.fit_on_texts(Z)

X = tokenizer.texts_to_sequences(['Naughty Comment']) #<= Bad Test Comment
X = pad_sequences(X, padding='post', maxlen=maxlen)
print(X)

labels = ["Reject Newspaper","Reject Crowd","Rejection Count Crowd","Sexism Count Crowd","Threat Count Crowd","Insult Count Crowd","Profanity Count Crowd","Meta Count Crowd","Advertisement Count Crowd"]
pred = model.predict(X)
for i, p in enumerate(pred[0]):
    print(labels[i], p)

</code>```

The Output:
[[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]
Reject Newspaper 0.08198401
Reject Crowd 0.044294477
Rejection Count Crowd 0.31464878
Sexism Count Crowd 0.015070438
Threat Count Crowd 0.0095721185
Insult Count Crowd 0.17211622
Profanity Count Crowd 0.07748076
Meta Count Crowd 0.06826261
Advertisement Count Crowd 0.017438024

what am i doing wrong here? Why is it always zeros no matter what i put in the Text field

Body:
I created a simple neural network that has 9 labels to determan hatespeech comments.
i used the glove.6B.100d as a base for my AI.
now after i build the model i wanted to predict a scentence but after i use the tokenizer.texts_to_sequence("Text") the array is just"[[]]"

here is the code for the prediction

import tensorflow as tf
from keras.preprocessing.text import Tokenizer

Z = []
#toxic_comments is a csv with some comments and the labels
sentences = list(toxic_coments["Text"])
for sen in sentences:
    Z.append(preprocess_text(str(sen)))

tokenizer = Tokenizer(num_words=5000)
tokenizer.fit_on_texts(Z)

X = tokenizer.texts_to_sequences(['Naughty Comment']) #<= Bad Test Comment
X = pad_sequences(X, padding='post', maxlen=maxlen)
print(X)

labels = ["Reject Newspaper","Reject Crowd","Rejection Count Crowd","Sexism Count Crowd","Threat Count Crowd","Insult Count Crowd","Profanity Count Crowd","Meta Count Crowd","Advertisement Count Crowd"]
pred = model.predict(X)
for i, p in enumerate(pred[0]):
    print(labels[i], p)

The Output:
[[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]
Reject Newspaper 0.08198401
Reject Crowd 0.044294477
Rejection Count Crowd 0.31464878
Sexism Count Crowd 0.015070438
Threat Count Crowd 0.0095721185
Insult Count Crowd 0.17211622
Profanity Count Crowd 0.07748076
Meta Count Crowd 0.06826261
Advertisement Count Crowd 0.017438024

what am i doing wrong here? Why is it always zeros no matter what i put in the Text field


问:
How to unit test function that references CookieManager?
The application in question has a logout function that among other things, performs a call to CookieManager.getInstance().removeAllCookies(null):

```<code>fun logout(...) {
    showLoader(true)

    msgRepo.unregisterSendBirdHandlersAndPushToken(
        onSuccess = {
            clearUserData(...)
            // ...
            onLogout()
        },
        onFailure = {
            clearUserData(...)
            // ...
            onLogout()
        }
    )
}

/**
 * Helper to clear user data before logging user out
 */
private fun clearUserData(...) {
    // ...
    CookieManager.getInstance().removeAllCookies(null)
}

</code>```

Two tests reference the aforementioned logout function. They both are quite similar and look a bit like this:

```<code>@Test
fun `verify logout with success`() {
    // .. Other code
    HardLogoutHelper.logout(...)
    // ...
}
</code>```

The tests fail with the following error message:

'void android.webkit.CookieManager.removeAllCookies(android.webkit.ValueCallback)'
java.lang.NoSuchMethodError: 'void android.webkit.CookieManager.removeAllCookies(android.webkit.ValueCallback)'
at com.example.helpers.HardLogoutHelper.clearUserData(HardLogoutHelper.kt:86)

I've tried running the test with Roboelectric via @RunWith(RoboelectricTestRunner::class) and I have have tried creating a custom Roboelectric Shadow for the CookieManager class. The issue seems to persist even when using Roboelectric.

Why is the previously mentioned error message being thrown, and how can it be fixed?

Body:
The application in question has a logout function that among other things, performs a call to CookieManager.getInstance().removeAllCookies(null):

fun logout(...) {
    showLoader(true)

    msgRepo.unregisterSendBirdHandlersAndPushToken(
        onSuccess = {
            clearUserData(...)
            // ...
            onLogout()
        },
        onFailure = {
            clearUserData(...)
            // ...
            onLogout()
        }
    )
}

/**
 * Helper to clear user data before logging user out
 */
private fun clearUserData(...) {
    // ...
    CookieManager.getInstance().removeAllCookies(null)
}

Two tests reference the aforementioned logout function. They both are quite similar and look a bit like this:

@Test
fun `verify logout with success`() {
    // .. Other code
    HardLogoutHelper.logout(...)
    // ...
}

The tests fail with the following error message:

'void android.webkit.CookieManager.removeAllCookies(android.webkit.ValueCallback)'
java.lang.NoSuchMethodError: 'void android.webkit.CookieManager.removeAllCookies(android.webkit.ValueCallback)'
at com.example.helpers.HardLogoutHelper.clearUserData(HardLogoutHelper.kt:86)

I've tried running the test with Roboelectric via @RunWith(RoboelectricTestRunner::class) and I have have tried creating a custom Roboelectric Shadow for the CookieManager class. The issue seems to persist even when using Roboelectric.

Why is the previously mentioned error message being thrown, and how can it be fixed?


问:
Finding connection
I want to find out if there are any circular connections using Python.
Let's say I have a matrix A:

A = [["a", "b", "ab"], ["b", "d", "bd"], ["d", "c", "dc"], ["d", "a", "da"], ....]
```
<p>In case of circular connection it prints the matrix T.
in this case:</p>
<pre class="lang-py prettyprint-override"><code>T = [["a", "b", "ab", "b", "d", "bd", "d", "a", "da"],...]`
</code>```

I tried for loop inside for loop but I get weird results.

M = [["a", "b", "ab"], ["b","d","bd"], ["c","d","cd"], ["d", "a", "da"]]
X = []
T = []

for i in M:
    if X != 0:
        X = i
        for j in M:
            if j[0] ==X[0] or j[0] == X[1] or j[1] == X[0] or j[1] == X[1]:
                T.append(j)
print(T)
```

Can anyone please help here? I am just a beginner at Python and would really apreciate any help.

Title: Finding connection

Body:
I want to find out if there are any circular connections using Python.
Let's say I have a matrix A:

A = [["a", "b", "ab"], ["b", "d", "bd"], ["d", "c", "dc"], ["d", "a", "da"], ....]

In case of circular connection it prints the matrix T.
in this case:

T = [["a", "b", "ab", "b", "d", "bd", "d", "a", "da"],...]`

I tried for loop inside for loop but I get weird results.

M = [["a", "b", "ab"], ["b","d","bd"], ["c","d","cd"], ["d", "a", "da"]]
X = []
T = []

for i in M:
    if X != 0:
        X = i
        for j in M:
            if j[0] ==X[0] or j[0] == X[1] or j[1] == X[0] or j[1] == X[1]:
                T.append(j)
print(T)

Can anyone please help here? I am just a beginner at Python and would really apreciate any help.


问:
Running Docker Image: php warning: module 'imagick' already loaded in unknown on line 0
When I commented the extension=imagick.so from php.ini everytime I run php artisan --help or any command nothing appear.

```<code>docker exec -it ti_api bash
root@95dzer3rc:/var/www/html# php artisan
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
root@95af8eb7e08c:/var/www/html# php artisan
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
root@95af8eb7e08c:/var/www/html# php artisan --help
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
</code>```

Body:
When I commented the extension=imagick.so from php.ini everytime I run php artisan --help or any command nothing appear.

docker exec -it ti_api bash
root@95dzer3rc:/var/www/html# php artisan
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
root@95af8eb7e08c:/var/www/html# php artisan
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
root@95af8eb7e08c:/var/www/html# php artisan --help
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0


问:
my btn's onclick code make a "ArgumentException" wrong
i try to make a keyboard with lot of btn, and i got "ArgumentException: Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.GameObject'." as the result...

heres my code, can somebody tell the newbie where went wrong...

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class a : MonoBehaviour
{
    void Start()
    {
        List<string> btns = new List<string>();
        btns.Add("aa"); // aa is the btn name.
        foreach (var item in btns)
        {
            GameObject bo = GameObject.Find(item);
            Button btn = bo.GetComponent<Button>();
            btn.onClick.AddListener(delegate(){
                this.OnClick(bo);
            });
        }
    }

    void Update()
    {

    }

    public void OnClick(GameObject sender)
    {
        Debug.Log("ah");
    }
}
</code>```

i want to press a btn and it'll type the btn's alphebat in a string array.
but when it went wrong i have tried to use Debug.Log() to see where the bug is...

Body:
i try to make a keyboard with lot of btn, and i got "ArgumentException: Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.GameObject'." as the result...

heres my code, can somebody tell the newbie where went wrong...

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class a : MonoBehaviour
{
    void Start()
    {
        List<string> btns = new List<string>();
        btns.Add("aa"); // aa is the btn name.
        foreach (var item in btns)
        {
            GameObject bo = GameObject.Find(item);
            Button btn = bo.GetComponent<Button>();
            btn.onClick.AddListener(delegate(){
                this.OnClick(bo);
            });
        }
    }

    void Update()
    {

    }

    public void OnClick(GameObject sender)
    {
        Debug.Log("ah");
    }
}

i want to press a btn and it'll type the btn's alphebat in a string array.
but when it went wrong i have tried to use Debug.Log() to see where the bug is...


Title: mvn sonar:sonar overrides the top level pom build time and runs sequentially at the end

Body:
After integrating sonar qube into my maven multi-module build and running

mvn -U -B -Dmaven.test.failure.ignore -Psonar verify sonar:sonar

I see the following build times

[2023-01-06T17:00:17.831Z] [INFO] ------------------------------------------------------------------------
[2023-01-06T17:00:17.831Z] [INFO] Reactor Summary for my-project 1.0.1:
[2023-01-06T17:00:17.831Z] [INFO]
[2023-01-06T17:00:17.831Z] [INFO] my-project ............................................ SUCCESS [01:52 min]
[2023-01-06T17:00:17.831Z] [INFO] my-project-common ..................................... SUCCESS [ 22.046 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-migration .................................. SUCCESS [  3.998 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-test-common ................................ SUCCESS [ 33.710 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-dto ........................................ SUCCESS [  3.010 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-producer ................................... SUCCESS [ 31.773 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-db ......................................... SUCCESS [01:07 min]
[2023-01-06T17:00:17.831Z] [INFO] my-project-utils ...................................... SUCCESS [ 23.637 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-server ..................................... SUCCESS [05:50 min]
[2023-01-06T17:00:17.831Z] [INFO] my-project-client ..................................... SUCCESS [ 32.758 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-http-client ................................ SUCCESS [  5.322 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-integration ................................ SUCCESS [02:43 min]
[2023-01-06T17:00:17.831Z] [INFO] jacoco-coverage-report ................................ SUCCESS [  8.389 s]
[2023-01-06T17:00:17.831Z] [INFO] my-project-other ...................................... SUCCESS [01:00 min]
[2023-01-06T17:00:17.831Z] [INFO] ------------------------------------------------------------------------
[2023-01-06T17:00:17.831Z] [INFO] BUILD SUCCESS
[2023-01-06T17:00:17.831Z] [INFO] ------------------------------------------------------------------------
[2023-01-06T17:00:17.831Z] [INFO] Total time:  15:22 min
[2023-01-06T17:00:17.831Z] [INFO] Finished at: 2023-01-06T17:00:17Z
[2023-01-06T17:00:17.831Z] [INFO] ------------------------------------------------------------------------

where the my-project .... build time of ~2 minutes took me by surprise.

Then on the console output I noticed the following

Building my-project 1.0.1 [15/14]

i.e. It builds the 15th step out of 14.

Examining the output it seems this is an extra step added by sonar. But it re-uses the the top level pom.xml name masking it's build time and hiding its own.

Is this expected? Is there a workaround to avoid the override?

I'm also curious if there is a way to integrate sonar and run its analysis in parallel rather than sequentially at the end?

i.e. It could analyse the finished modules while the next module is being built in parallel.

Note: The integration is via jacoco

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.8.5</version>
</plugin>


问:
How to implement a for loop when multiple dataframes are involved?
I am currently working in R and this is a samople of a task i was assigned:

```<code>POINA[1] <-sum(as.numeric(ifelse(  (datos1$c_res==1 | datos1$c_res==3) & (datos1$r_def==0) & (datos1$eda>=15 & datos1$eda<= 98) & datos1$emp_ppal==1 & datos1$ambito1 != 1 ,1,0)))
POINA[2] <-sum(as.numeric(ifelse(  (datos2$c_res==1 | datos2$c_res==3) & (datos2$r_def==0) & (datos2$eda>=15 & datos2$eda<= 98) & datos2$emp_ppal==1 & datos2$ambito1 != 1 ,1,0)))
POINA[3] <-sum(as.numeric(ifelse(  (datos3$c_res==1 | datos3$c_res==3) & (datos3$r_def==0) & (datos3$eda>=15 & datos3$eda<= 98) & datos3$emp_ppal==1 & datos3$ambito1 != 1 ,1,0)))
POINA[4] <-sum(as.numeric(ifelse(  (datos4$c_res==1 | datos4$c_res==3) & (datos4$r_def==0) & (datos4$eda>=15 & datos4$eda<= 98) & datos4$emp_ppal==1 & datos4$ambito1 != 1 ,1,0)))
POINA[5] <-sum(as.numeric(ifelse(  (datos5$c_res==1 | datos5$c_res==3) & (datos5$r_def==0) & (datos5$eda>=15 & datos5$eda<= 98) & datos5$emp_ppal==1 & datos5$ambito1 != 1 ,1,0)))
POINA[6] <-sum(as.numeric(ifelse(  (datos6$c_res==1 | datos6$c_res==3) & (datos6$r_def==0) & (datos6$eda>=15 & datos6$eda<= 98) & datos6$emp_ppal==1 & datos6$ambito1 != 1 ,1,0)))
POINA[7] <-sum(as.numeric(ifelse(  (datos7$c_res==1 | datos7$c_res==3) & (datos7$r_def==0) & (datos7$eda>=15 & datos7$eda<= 98) & datos7$emp_ppal==1 & datos7$ambito1 != 1 ,1,0)))
POINA[8] <-sum(as.numeric(ifelse(  (datos8$c_res==1 | datos8$c_res==3) & (datos8$r_def==0) & (datos8$eda>=15 & datos8$eda<= 98) & datos8$emp_ppal==1 & datos8$ambito1 != 1 ,1,0)))
POINA[9] <-sum(as.numeric(ifelse(  (datos9$c_res==1 | datos9$c_res==3) & (datos9$r_def==0) & (datos9$eda>=15 & datos9$eda<= 98) & datos9$emp_ppal==1 & datos9$ambito1 != 1 ,1,0)))
POINA[10] <-sum(as.numeric(ifelse(  (datos10$c_res==1 | datos10$c_res==3) & (datos10$r_def==0) & (datos10$eda>=15 & datos10$eda<= 98) & datos10$emp_ppal==1 & datos10$ambito1 != 1 ,1,0)))
</code>```

I have several dataframes, that for sake of simplicity, are named "datos1".. "datos120". This dataframes are the results of telephone polls. Each dataframe contains different individuals and each poll corresponds to a specific week in the year.
POINA[i] is a numeric vector where each entry is the total sum of surveyed people who fit the criterion specified above.

As can be seen, the criteria remains the same every week but, since each week is a diferent frame datos[i] changes for every POINA[i].

Is there a way such that i dont have to write the 120 weeks one by one?

I have tried doing it manually but there are just to many cases so, any help in making this more efficient would be deeply apreciated

Body:
I am currently working in R and this is a samople of a task i was assigned:

POINA[1] <-sum(as.numeric(ifelse(  (datos1$c_res==1 | datos1$c_res==3) & (datos1$r_def==0) & (datos1$eda>=15 & datos1$eda<= 98) & datos1$emp_ppal==1 & datos1$ambito1 != 1 ,1,0)))
POINA[2] <-sum(as.numeric(ifelse(  (datos2$c_res==1 | datos2$c_res==3) & (datos2$r_def==0) & (datos2$eda>=15 & datos2$eda<= 98) & datos2$emp_ppal==1 & datos2$ambito1 != 1 ,1,0)))
POINA[3] <-sum(as.numeric(ifelse(  (datos3$c_res==1 | datos3$c_res==3) & (datos3$r_def==0) & (datos3$eda>=15 & datos3$eda<= 98) & datos3$emp_ppal==1 & datos3$ambito1 != 1 ,1,0)))
POINA[4] <-sum(as.numeric(ifelse(  (datos4$c_res==1 | datos4$c_res==3) & (datos4$r_def==0) & (datos4$eda>=15 & datos4$eda<= 98) & datos4$emp_ppal==1 & datos4$ambito1 != 1 ,1,0)))
POINA[5] <-sum(as.numeric(ifelse(  (datos5$c_res==1 | datos5$c_res==3) & (datos5$r_def==0) & (datos5$eda>=15 & datos5$eda<= 98) & datos5$emp_ppal==1 & datos5$ambito1 != 1 ,1,0)))
POINA[6] <-sum(as.numeric(ifelse(  (datos6$c_res==1 | datos6$c_res==3) & (datos6$r_def==0) & (datos6$eda>=15 & datos6$eda<= 98) & datos6$emp_ppal==1 & datos6$ambito1 != 1 ,1,0)))
POINA[7] <-sum(as.numeric(ifelse(  (datos7$c_res==1 | datos7$c_res==3) & (datos7$r_def==0) & (datos7$eda>=15 & datos7$eda<= 98) & datos7$emp_ppal==1 & datos7$ambito1 != 1 ,1,0)))
POINA[8] <-sum(as.numeric(ifelse(  (datos8$c_res==1 | datos8$c_res==3) & (datos8$r_def==0) & (datos8$eda>=15 & datos8$eda<= 98) & datos8$emp_ppal==1 & datos8$ambito1 != 1 ,1,0)))
POINA[9] <-sum(as.numeric(ifelse(  (datos9$c_res==1 | datos9$c_res==3) & (datos9$r_def==0) & (datos9$eda>=15 & datos9$eda<= 98) & datos9$emp_ppal==1 & datos9$ambito1 != 1 ,1,0)))
POINA[10] <-sum(as.numeric(ifelse(  (datos10$c_res==1 | datos10$c_res==3) & (datos10$r_def==0) & (datos10$eda>=15 & datos10$eda<= 98) & datos10$emp_ppal==1 & datos10$ambito1 != 1 ,1,0)))

I have several dataframes, that for sake of simplicity, are named "datos1".. "datos120". This dataframes are the results of telephone polls. Each dataframe contains different individuals and each poll corresponds to a specific week in the year.
POINA[i] is a numeric vector where each entry is the total sum of surveyed people who fit the criterion specified above.

As can be seen, the criteria remains the same every week but, since each week is a diferent frame datos[i] changes for every POINA[i].

Is there a way such that i dont have to write the 120 weeks one by one?

I have tried doing it manually but there are just to many cases so, any help in making this more efficient would be deeply apreciated


问:
Remote svg image .NET MAUI
I can't display remote svg images in <Image> control.

Example:

When I try to display this image, I don't see anything.

<Image Source="https://www.meteosuisse.admin.ch/static/product/resources/weather-symbols/120.svg" />
```
<p>It's the same with this image</p>
<pre class="lang-xml prettyprint-override"><code><Image Source="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics#/media/File:SVG_Logo.svg" />
</code>```

But if I only change the url of the image with this one which is of type JPG, everything works

<Image Source="https://aka.ms/campus.jpg" />
```

Am I doing something wrong?

.NET MAUI Version: 6.0.548
Microsoft Visual Studio Enterprise 2022 (64 bits) - Current
Version 17.4.3

Best Regards

Tested on

Windows (net6.0-windows10.0.19041.0)

Android (net6.0-android)

I have see this question but here, the problem is only with SVG remote image.

Title: Remote svg image .NET MAUI

Body:
I can't display remote svg images in <Image> control.

Example:

When I try to display this image, I don't see anything.

<Image Source="https://www.meteosuisse.admin.ch/static/product/resources/weather-symbols/120.svg" />

It's the same with this image

<Image Source="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics#/media/File:SVG_Logo.svg" />

But if I only change the url of the image with this one which is of type JPG, everything works

<Image Source="https://aka.ms/campus.jpg" />

Am I doing something wrong?

.NET MAUI Version: 6.0.548
Microsoft Visual Studio Enterprise 2022 (64 bits) - Current
Version 17.4.3

Best Regards

Tested on

Windows (net6.0-windows10.0.19041.0)

Android (net6.0-android)

I have see this question but here, the problem is only with SVG remote image.


问:
How to run an application on a newer GLIBC?
There are some posts and answers on similar topics but I have a different case. And I am looking for a  solution without using patchelf.

I am using an OS with GLIBC version 2.17 and my application requires GLIBC version 2.18.

I compiled GLIBC version 2.18 on the OS and I am able to run my application using below steps:

./bin/patchelf --set-interpreter
/home/nexir/glibc/build/elf/ld-linux-x86-64.so.2 --set-rpath
/home/nexir/glibc/build /home/nexir/app/myapp

/home/nexir/app/myapp

I do not get any errors and my application able to start successfully.

I am looking for another solution to run my application without using patchelf command. Since, it is modifying my application executable, my client doesn't accept it.

When I run my application using the below command:

LD_PRELOAD=/home/nexir/glibc/build/libc.so.6 /home/nexir/glibc/build/elf/ld-linux-x86-64.so.2 /home/nexir/app/myapp

I got Segmentation fault error.

What is the problem with my command? If patchelf works, then there must be another way to run it.


问:
'file.absolute.existsSync()': is not true on uploading multiple files to storage flutter firebase
I'm trying for so long to upload multiple selected files to firebase storage but getting the same error again and again.

I'm picking up multiple files, they are getting picked just fine I've printed files they are going to the List just fine but when it comes to uploading it gives this error

```<code>Unhandled Exception: 'package:firebase_storage/src/reference.dart': Failed assertion: line 127 pos 12: 'file.absolute.existsSync()': is not true.
</code>```

This error is coming on my uploadTask which is

```<code> UploadTask uploadTask = storageReference.putFile(File(fileNames![i]));
</code>```

I've tried so much but couldn't do so. If anyone knows what I'm doing wrong please let me know.
Here's the complete of the code

```<code>List<String>? fileNames;
  List<String> downloadUrls = [];
  bool isUploading = false;

  @override
  Widget build(BuildContext context) {
    Future<void> filePicker() async {
      FilePickerResult? result =
          await FilePicker.platform.pickFiles(allowMultiple: true);
      if (result != null) {
        setState(() {
          fileNames =
              result.paths.map((path) => path!.split('/').last).toList();
        });
      }
    }

    Future<void> uploadFiles() async {
      setState(() {
        isUploading = true;
      });

      for (int i = 0; i < fileNames!.length; i++) {
        String fileName = fileNames![i];
        String filePath = 'files/$fileName';
        final storageReference =
            FirebaseStorage.instance.ref().child('reports/$filePath');
        UploadTask uploadTask = storageReference.putFile(File(fileNames![i]));
        await uploadTask.whenComplete(() {
          storageReference.getDownloadURL().then((fileURL) {
            downloadUrls.add(fileURL);
          });
        });
      }

      setState(() {
        isUploading = false;
      });
    }
</code>```

Body:
I'm trying for so long to upload multiple selected files to firebase storage but getting the same error again and again.

I'm picking up multiple files, they are getting picked just fine I've printed files they are going to the List just fine but when it comes to uploading it gives this error

Unhandled Exception: 'package:firebase_storage/src/reference.dart': Failed assertion: line 127 pos 12: 'file.absolute.existsSync()': is not true.

This error is coming on my uploadTask which is

 UploadTask uploadTask = storageReference.putFile(File(fileNames![i]));

I've tried so much but couldn't do so. If anyone knows what I'm doing wrong please let me know.
Here's the complete of the code

List<String>? fileNames;
  List<String> downloadUrls = [];
  bool isUploading = false;

  @override
  Widget build(BuildContext context) {
    Future<void> filePicker() async {
      FilePickerResult? result =
          await FilePicker.platform.pickFiles(allowMultiple: true);
      if (result != null) {
        setState(() {
          fileNames =
              result.paths.map((path) => path!.split('/').last).toList();
        });
      }
    }

    Future<void> uploadFiles() async {
      setState(() {
        isUploading = true;
      });

      for (int i = 0; i < fileNames!.length; i++) {
        String fileName = fileNames![i];
        String filePath = 'files/$fileName';
        final storageReference =
            FirebaseStorage.instance.ref().child('reports/$filePath');
        UploadTask uploadTask = storageReference.putFile(File(fileNames![i]));
        await uploadTask.whenComplete(() {
          storageReference.getDownloadURL().then((fileURL) {
            downloadUrls.add(fileURL);
          });
        });
      }

      setState(() {
        isUploading = false;
      });
    }


问:
OpenCV 4.5.5 and Yolo Failed to parse NetParameter file
I've tried downloading both v3:

```<code>wget https://pjreddie.com/media/files/yolov3.weights
wget https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg
</code>```

and v4

```<code>wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.cfg
</code>```

but both result in similar parsing errors with OpenCV 4.5.5 ??

```<code>cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:207: error: (-212:Parsing error) Failed to parse NetParameter file: yolov4.cfg in function 'cv::dnn::dnn4_v20211220::readNetFromDarknet'
</code>```

though working directly from the python console and importing cv2 and then running

```<code># Load the YOLO model
model = cv2.dnn.readNetFromDarknet("yolov4.cfg", "yolov4.weights")
</code>```

seems to work - thoughts ?

Body:
I've tried downloading both v3:

wget https://pjreddie.com/media/files/yolov3.weights
wget https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg

and v4

wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.cfg

but both result in similar parsing errors with OpenCV 4.5.5 ??

cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:207: error: (-212:Parsing error) Failed to parse NetParameter file: yolov4.cfg in function 'cv::dnn::dnn4_v20211220::readNetFromDarknet'

though working directly from the python console and importing cv2 and then running

# Load the YOLO model
model = cv2.dnn.readNetFromDarknet("yolov4.cfg", "yolov4.weights")

seems to work - thoughts ?


问:
Azure Devops pipeline and Unity floating license server fails to get license on 2nd run
The first time I run my unity pipeline, the self-hosted agent gets the license and builds the unity project.  The project will fail its build and I suspect the task is not returning the license when it dies in the pipelines thread.

The next run of the pipeline fails to get the license and build.

There's a unity utility called unity.licensing.client.exe that supposed to return the license.

Unity.Licensing.Client --return-floating  (where id is the lease id)

I'm not sure where to find the lease id and I'd like to call this in a subsequent task if the previous task fails.

I'd appreciate help with that lease id.

I've rebooted all the computers involved.
In my task I've used powershell and the unity build task (consuming 2/3 licenses)


问:
What are algebraic effects, exactly?
There is this concept of "Algebraic Effects" sometimes coming with "handlers", sometimes not, but for the life of me I can't find a clear introduction or even a definition.

What exactly is (are) an Algebraic Effect(s) ?

What is the "handler" ?

How do they relate to Functional Effects (cats-effects, ZIO) ?

How do they relate to Monad Transformers ?

Concrete example are most welcome.

Title: What are algebraic effects, exactly?


问:
Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16
I'm receiving this giant error when i try to install bundler or rails or even when i try to start the server. any suggestions please? I am a beginner and have no idea what to do??? I already tried what the error suggested (install libyaml) and reinstalling ruby but it still does the same thing. Also tried gem pristine all but nothing.</p>
```<code>gem install bundler

Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16
Ignoring bindex-0.8.1 because its extensions are not built. Try: gem pristine bindex --version 0.8.1
Ignoring bootsnap-1.13.0 because its extensions are not built. Try: gem pristine bootsnap --version 1.13.0
Ignoring bootsnap-1.7.5 because its extensions are not built. Try: gem pristine bootsnap --version 1.7.5
Ignoring byebug-11.1.3 because its extensions are not built. Try: gem pristine byebug --version 11.1.3
Ignoring date-3.3.3 because its extensions are not built. Try: gem pristine date --version 3.3.3
Ignoring debug-1.7.1 because its extensions are not built. Try: gem pristine debug --version 1.7.1
Ignoring debug-1.6.2 because its extensions are not built. Try: gem pristine debug --version 1.6.2
Ignoring digest-3.1.0 because its extensions are not built. Try: gem pristine digest --version 3.1.0
Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7
Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Ignoring ffi-1.15.1 because its extensions are not built. Try: gem pristine ffi --version 1.15.1
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0
/Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Traceback (most recent call last):
        23: from /Users/angie/.rvm/rubies/ruby-2.7.4/bin/gem:21:in `<main>'
        22: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:44:in `run'
        21: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `do_configuration'
        20: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `new'
        19: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/config_file.rb:182:in `initialize'
        18: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/config_file.rb:332:in `load_file'
        17: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems.rb:715:in `load_yaml'
        16: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        15: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        14: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/yaml.rb:4:in `<top (required)>'
        13: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        12: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        11: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych.rb:15:in `<top (required)>'
        10: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         9: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         8: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/nodes.rb:2:in `<top (required)>'
         7: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         6: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         5: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/nodes/node.rb:4:in `<top (required)>'
         4: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         3: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         2: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/scalar_scanner.rb:2:in `<top (required)>'
         1: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
/Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': dlopen(/Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle, 0x0009): tried: '/Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/strscan.bundle' (no such file), '/usr/lib/strscan.bundle' (no such file) - /Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle (LoadError)
</code>```

Body:
I'm receiving this giant error when i try to install bundler or rails or even when i try to start the server. any suggestions please? I am a beginner and have no idea what to do??? I already tried what the error suggested (install libyaml) and reinstalling ruby but it still does the same thing. Also tried gem pristine all but nothing.

gem install bundler

Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16
Ignoring bindex-0.8.1 because its extensions are not built. Try: gem pristine bindex --version 0.8.1
Ignoring bootsnap-1.13.0 because its extensions are not built. Try: gem pristine bootsnap --version 1.13.0
Ignoring bootsnap-1.7.5 because its extensions are not built. Try: gem pristine bootsnap --version 1.7.5
Ignoring byebug-11.1.3 because its extensions are not built. Try: gem pristine byebug --version 11.1.3
Ignoring date-3.3.3 because its extensions are not built. Try: gem pristine date --version 3.3.3
Ignoring debug-1.7.1 because its extensions are not built. Try: gem pristine debug --version 1.7.1
Ignoring debug-1.6.2 because its extensions are not built. Try: gem pristine debug --version 1.6.2
Ignoring digest-3.1.0 because its extensions are not built. Try: gem pristine digest --version 3.1.0
Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7
Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Ignoring ffi-1.15.1 because its extensions are not built. Try: gem pristine ffi --version 1.15.1
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0
/Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Traceback (most recent call last):
        23: from /Users/angie/.rvm/rubies/ruby-2.7.4/bin/gem:21:in `'
        22: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:44:in `run'
        21: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `do_configuration'
        20: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `new'
        19: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/config_file.rb:182:in `initialize'
        18: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/config_file.rb:332:in `load_file'
        17: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems.rb:715:in `load_yaml'
        16: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        15: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        14: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/yaml.rb:4:in `<top (required)>'
        13: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        12: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        11: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych.rb:15:in `<top (required)>'
        10: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         9: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         8: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/nodes.rb:2:in `<top (required)>'
         7: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         6: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         5: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/nodes/node.rb:4:in `<top (required)>'
         4: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         3: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         2: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/scalar_scanner.rb:2:in `<top (required)>'
         1: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
/Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': dlopen(/Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle, 0x0009): tried: '/Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/strscan.bundle' (no such file), '/usr/lib/strscan.bundle' (no such file) - /Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle (LoadError)


问:
Naming bars in barplot
Using this example:

library(ggplot2)

WWII <- function

barplot(table(x,y) + main = "main title" + xlab = "name of X" + ylab = "name of y"+ border = "black" + col = c("colors"))

My question is how can you adjust the names of the different bars, not the "xlab" title, neither the "ylab", but the names down the bars.

I have tried the formula before and I was wondering how to title my bars

Title: Naming bars in barplot


问:
Calling C++ dll in C# debug dll working but release dll not working
I have some c++ code that I'm calling from my c# code..

When I build the c++ dll in Debug mode calling the dll and getting it to return something works fine..

When I build the c++ dll in RELEASE mode calling the dll I get this error:

and pretty much no stack trace.. I'm printing out things in the c++ code to to try to verify that that's running.. and everything appears to print out fine..

C++ code:

```<code>    #define MyFunctions _declspec(dllexport)
#include "stdafx.h"
#include "../DoorOpenerSketch/Desfire.h"
#include "../DoorOpenerSketch/DesFireKey.h"

extern "C" {

    MyFunctions int GetData(unsigned char data[], byte* dataFromCard)
{
    try
    {

        const int DES_SIZE = 16;
        const int AES_SIZE = 16;
        Desfire i_Desfire;
        unsigned char u8_DataFinal[16];

        i_Desfire.Authenticate2(0, &i_Desfire.DES2_DEFAULT_KEY, dataFromCard, u8_DataFinal);

        int tlen = 3;

        memcpy(data, u8_DataFinal, sizeof(u8_DataFinal));

        return 1;
    }
    catch (char* p)
    {
        return 0;
    }

}

}
</code>```

C# code

```<code>      public const string CppFunctionsDLL = @"C:\Users\UserName\Desktop\Desfire.dll";

        [DllImport(CppFunctionsDLL, CallingConvention = CallingConvention.Cdecl)]

    static extern int GetData(byte[] outPutData, byte[] dataFromCard);

  public static byte[] GetEncryptedAnswerForCardInCplusplus(byte[] initialResponseFromCard)
        {
            byte[] outPutData = new byte[16];
        var hr = GetData(outPutData, initialResponseFromCard);

        return outPutData;

        }
</code>```

In the c# code it fails here:

```<code> var hr = GetData(outPutData, initialResponseFromCard);
</code>```

and like I mentioned before I can see "test this ran 90" printing out to the console

Body:
I have some c++ code that I'm calling from my c# code..

When I build the c++ dll in Debug mode calling the dll and getting it to return something works fine..

When I build the c++ dll in RELEASE mode calling the dll I get this error:

and pretty much no stack trace.. I'm printing out things in the c++ code to to try to verify that that's running.. and everything appears to print out fine..

C++ code:

    #define MyFunctions _declspec(dllexport)
#include "stdafx.h"
#include "../DoorOpenerSketch/Desfire.h"
#include "../DoorOpenerSketch/DesFireKey.h"

extern "C" {

    MyFunctions int GetData(unsigned char data[], byte* dataFromCard)
{
    try
    {

        const int DES_SIZE = 16;
        const int AES_SIZE = 16;
        Desfire i_Desfire;
        unsigned char u8_DataFinal[16];

        i_Desfire.Authenticate2(0, &i_Desfire.DES2_DEFAULT_KEY, dataFromCard, u8_DataFinal);

        int tlen = 3;

        memcpy(data, u8_DataFinal, sizeof(u8_DataFinal));

        return 1;
    }
    catch (char* p)
    {
        return 0;
    }

}

}

C# code

      public const string CppFunctionsDLL = @"C:\Users\UserName\Desktop\Desfire.dll";

        [DllImport(CppFunctionsDLL, CallingConvention = CallingConvention.Cdecl)]

    static extern int GetData(byte[] outPutData, byte[] dataFromCard);

  public static byte[] GetEncryptedAnswerForCardInCplusplus(byte[] initialResponseFromCard)
        {
            byte[] outPutData = new byte[16];
        var hr = GetData(outPutData, initialResponseFromCard);

        return outPutData;

        }

In the c# code it fails here:

 var hr = GetData(outPutData, initialResponseFromCard);

and like I mentioned before I can see "test this ran 90" printing out to the console


问:
jogamp jocl native bind only for clEnqueueMapImage0 are missing
In my jogamp jocl program when i call (non static) CLCommandQueue.putMapImage() i get this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.jogamp.opencl.llb.impl.CLImpl.clEnqueueMapImage0(JJIJLjava/lang/Object;ILjava/lang/Object;ILjava/lang/Object;ILjava/lang/Object;IILjava/lang/Object;ILjava/lang/Object;ILjava/lang/Object;IJJ)Ljava/nio/ByteBuffer;
    at com.jogamp.opencl.llb.impl.CLImpl.clEnqueueMapImage0(Native Method)
    at com.jogamp.opencl.llb.impl.CLImpl.clEnqueueMapImage(CLImpl.java:226)
(not important)
```

I have installed proper (matching version in manifest) version of natives (gluegen too (classes + natives)) bc for every else (native tho) method it works but not on that one for some reason, any help? maybe i have to make additional native bindings by myself because for some reason these one dont work?

WHY? HOW?

PS. sorry for bad english

I tried restarting, switching machine, putinng natives in root(workspace) directory, and no positive results.
I can give examples too

Body:
In my jogamp jocl program when i call (non static) CLCommandQueue.putMapImage() i get this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.jogamp.opencl.llb.impl.CLImpl.clEnqueueMapImage0(JJIJLjava/lang/Object;ILjava/lang/Object;ILjava/lang/Object;ILjava/lang/Object;IILjava/lang/Object;ILjava/lang/Object;ILjava/lang/Object;IJJ)Ljava/nio/ByteBuffer;
    at com.jogamp.opencl.llb.impl.CLImpl.clEnqueueMapImage0(Native Method)
    at com.jogamp.opencl.llb.impl.CLImpl.clEnqueueMapImage(CLImpl.java:226)
(not important)

I have installed proper (matching version in manifest) version of natives (gluegen too (classes + natives)) bc for every else (native tho) method it works but not on that one for some reason, any help? maybe i have to make additional native bindings by myself because for some reason these one dont work?

WHY? HOW?

PS. sorry for bad english

I tried restarting, switching machine, putinng natives in root(workspace) directory, and no positive results.
I can give examples too


问:
Show a view on top of a Sheet - SwiftUI
I want to show a Sheet, and then show a certain view (toast in my case) over all the NavigationView, including the Sheet, but it's showing behind the Sheet.

This is my Toast ViewModifier:

```<code>struct Toast: ViewModifier {

    //MARK: - PROPERTIES

    @ObservedObject var toastManager = SharedToastManager

    //MARK: - BODY

    func body(content: Content) -> some View {
        ZStack {
            content
            toastView
        }
    }

    private var toastView: some View {
        VStack {
            ...
        }
    }
}

extension View {

    /// Shows toast with configuration
    /// - Returns: Toast view
    func toast() -> some View {
        self.modifier(Toast())
    }
}
</code>```

This is my AppMain:

```<code>@main
struct MyApp: App {

    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

    var body: some Scene {
        WindowGroup {
            MainScreen()
                .toast()
        }
    }
}
</code>```

And this is my MainScreen:

```<code>struct MainScreen: View {

    //MARK: - PROPERTIES

    @State var isShowing = false

    //MARK: - BODY

    var body: some View {

        NavigationView {

            VStack (spacing: 22) {

                Button {

                    isShowing = true

                } label: {

                    Text("Show sheet")
                }
            }
        }
        .sheet(isPresented: $isShowing) {
            EmptyView()
        }
    }
}
</code>```

I need please your help to show the toast over the sheet view.

Title: Show a view on top of a Sheet - SwiftUI

Body:
I want to show a Sheet, and then show a certain view (toast in my case) over all the NavigationView, including the Sheet, but it's showing behind the Sheet.

This is my Toast ViewModifier:

struct Toast: ViewModifier {

    //MARK: - PROPERTIES

    @ObservedObject var toastManager = SharedToastManager

    //MARK: - BODY

    func body(content: Content) -> some View {
        ZStack {
            content
            toastView
        }
    }

    private var toastView: some View {
        VStack {
            ...
        }
    }
}

extension View {

    /// Shows toast with configuration
    /// - Returns: Toast view
    func toast() -> some View {
        self.modifier(Toast())
    }
}

This is my AppMain:

@main
struct MyApp: App {

    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

    var body: some Scene {
        WindowGroup {
            MainScreen()
                .toast()
        }
    }
}

And this is my MainScreen:

struct MainScreen: View {

    //MARK: - PROPERTIES

    @State var isShowing = false

    //MARK: - BODY

    var body: some View {

        NavigationView {

            VStack (spacing: 22) {

                Button {

                    isShowing = true

                } label: {

                    Text("Show sheet")
                }
            }
        }
        .sheet(isPresented: $isShowing) {
            EmptyView()
        }
    }
}

I need please your help to show the toast over the sheet view.


问:
Organic Social YouTube API
Currently, we are in the process of building out our database with our data engineers.

We wonder if YouTube provides API for all organic social data?
•   If it does have an API connection, what are some of the information we need to provide our data engineers to set up the connection? And is there a step-by-step guide somewhere that we can follow?
•   If not, is there a way to set up some sort of scheduled report that automatically sends us reports every day or every week through email?

Haven't tried anything, don't know where to start.

Title: Organic Social YouTube API


问:
JS: Find out whether a class method was called from a child class using super.method()
Is there a way to determine how and what called the method in a base class?

Let's assume this:

```<code>class Base {
    myMethod() {}
}

class Child1 extends Base {
    myMethod() {}
}

class Child2 extends Base {
    myMethod() {
        super.myMethod();
    }
}

class Child3 extends Base {}

// extending another Child
class Child4 extends Child2 {}
</code>```

If the method is not implemented in the child class or any of its parents (excluding Base), I would like to throw an error from Base.myMethod, for example:

```<code>let c1 = new Child1();
c1.myMethod(); // Method found on instance, works

let c2 = new Child2();
c2.myMethod(); // Method found on instance, calls super method (on Base), works

let c3 = new Child3();
c3.myMethod(); // No method found on instance, Base class throws an error

let c4 = new Child4();
c4.myMethod(); // No method found on instance but is found on parent (Child2), thus works
</code>```

So basically the only time that I want to throw an error is when the Base's myMethod was called "directly", without any super.myMethod() in the call stack. Any ideas how to determine this? Thanks a lot!

Body:
Is there a way to determine how and what called the method in a base class?

Let's assume this:

class Base {
    myMethod() {}
}

class Child1 extends Base {
    myMethod() {}
}

class Child2 extends Base {
    myMethod() {
        super.myMethod();
    }
}

class Child3 extends Base {}

// extending another Child
class Child4 extends Child2 {}

If the method is not implemented in the child class or any of its parents (excluding Base), I would like to throw an error from Base.myMethod, for example:

let c1 = new Child1();
c1.myMethod(); // Method found on instance, works

let c2 = new Child2();
c2.myMethod(); // Method found on instance, calls super method (on Base), works

let c3 = new Child3();
c3.myMethod(); // No method found on instance, Base class throws an error

let c4 = new Child4();
c4.myMethod(); // No method found on instance but is found on parent (Child2), thus works

So basically the only time that I want to throw an error is when the Base's myMethod was called "directly", without any super.myMethod() in the call stack. Any ideas how to determine this? Thanks a lot!


问:
Invalid operation: plan should not reference subplan's variable
does anybody know what happened? i was using sql coding in quicksight to prepare data, but i don't know why i get this bug
my code:

```<code>select c.event_time from listing_events_with_counter c
</code>```

a screenshot here

i just want to simply extract this column, then i just get this error:
Error details
region:
eu-west-1
timestamp:

1673292426845
requestId:

971acbe3-c266-4bae-8c09-ec54258c99ca
sourceErrorCode:

500310
sourceErrorMessage:
Amazon Invalid operation: plan should not reference subplan's variable;
sourceErrorState:

XX000
sourceException:

java.sql.SQLException
sourceType:
REDSHIFT

Body:
does anybody know what happened? i was using sql coding in quicksight to prepare data, but i don't know why i get this bug
my code:

select c.event_time from listing_events_with_counter c

a screenshot here

i just want to simply extract this column, then i just get this error:
Error details
region:
eu-west-1
timestamp:

1673292426845
requestId:

971acbe3-c266-4bae-8c09-ec54258c99ca
sourceErrorCode:

500310
sourceErrorMessage:
Amazon Invalid operation: plan should not reference subplan's variable;
sourceErrorState:

XX000
sourceException:

java.sql.SQLException
sourceType:
REDSHIFT


问:
react-scrollspy-nav causes error after deploying react app
I want to active menu on scroll in my react app. I have used a react-scrollspy-nav for this functionality. It works fine when i run it on local server but when i deploy so it shows a blank screen

i have used a react-scrollspy-nav  in my app, which is working perfectly on local server on my laptop but after deploying on netlify, it shows blank screen with an error on console that says

Uncaught TypeError: Super expression must either be null or a function
at ScrollspyNav.js:423:1

Link of my react app

If i remove this module react-scrollspy-nav and deploy it, my app does not show blank screen and works well but without the functionality of scrollspy which i want in my app


问:
Promtail using consul as service discovery doesn't work the labels
I'm configuring Promtail to use Consul's Service Discovery and when I put the labels to define which directory I'm going to get the logs from, I get this error when starting Promtail:

promtail[10203]:   line 23: field labels not found in type consul.plain

The configuration file is this:

```<code>server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: system
  static_configs:
  - targets:
      - localhost
    labels:
      job: varlogs
      __path__: /var/log/*log

- job_name: 'myjob'
  consul_sd_configs:
  - server: 'localhost:8500'
    labels:
      job: myjob
      __path__: /var/log/*log
  relabel_configs:
  - source_labels: ['__meta_consul_tags']
    action: keep
    regex: '.*,(myjob),.*'
    replacement: '${1}'
</code>```

The error is in this line labels, does anyone know how to solve it?

Body:
I'm configuring Promtail to use Consul's Service Discovery and when I put the labels to define which directory I'm going to get the logs from, I get this error when starting Promtail:

promtail[10203]:   line 23: field labels not found in type consul.plain

The configuration file is this:

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: system
  static_configs:
  - targets:
      - localhost
    labels:
      job: varlogs
      __path__: /var/log/*log

- job_name: 'myjob'
  consul_sd_configs:
  - server: 'localhost:8500'
    labels:
      job: myjob
      __path__: /var/log/*log
  relabel_configs:
  - source_labels: ['__meta_consul_tags']
    action: keep
    regex: '.*,(myjob),.*'
    replacement: '${1}'

The error is in this line labels, does anyone know how to solve it?


问:
.responsetext does not get the entire code
On following website, i am trying to fetch the value(970.15 today) using MSXML2.ServerXMLHTTP and .responsetext.
I have done it on another site and found the info in the text.
On that site though, .responsetext does not this value anywhere, but when i do inspect element in my browser, i do see it !
I discovered that function to read information on sites only last week, so still learning ! If anyone can help me, that would be great !

https://www.spglobal.com/spdji/en/indices/equity/sp-euro-50-equal-weight-50-point-decrement-index/#overview

Since it did not work, i put .responsetext value in a cell and copy/pasted it in notepad but did not find 970 is the file.
Note that to put the text in a cell, i had to get rid of the first 50 characters ... i did not understand this either !

Thanks !
G


问:
Script working only with Routers and Switches
I would like help in this Script here, i am totally new in Python, just want to know if you guys have any Idea, why this script below works good only with routers and switches, for ASA and WLC 5500 and 9800 it don't works.

This is the script:

```<code>from netmiko import (
    ConnectHandler,
    NetmikoTimeoutException,
    NetmikoAuthenticationException,
)

from netmiko.ssh_autodetect import SSHDetect
from netmiko.ssh_dispatcher import ConnectHandler
import getpass
import os
import time
import sys
import subprocess
import logging
import re

password = getpass.getpass()
username = os.getlogin()
devices = []
with open('devices.txt') as routers:
    for i in routers:
        RR = {
            "device_type": "autodetect",
            "host": i,
            "username": ('admin_' + username),
            "password": password,
        }

        print (f'admin_{username} is connecting to the Device: {i}')

        try:
            connect = ConnectHandler(**RR)
            guesser = SSHDetect(**RR)
            best_match = guesser.autodetect()
            print("="*100)
            print(connect.find_prompt() + ':' + best_match)
            print("="*100)
            configs = []
            with open('commands.txt') as configu:

                   for c in configu:

                        output = connect.send_command(c)
                        print(c)
                        print(output)
                        print("-"*50)

        except (NetmikoTimeoutException, NetmikoAuthenticationException) as error:

            print ('!!!ERROR!!! The admin_' + username + ' COULD NOT CONNECT ON ' + i)
            print(error)

        continue

        connect.disconnect()
</code>```

Tried to run this script in WLC and ASA.

Appreciate any help : )

Thanks

Body:
I would like help in this Script here, i am totally new in Python, just want to know if you guys have any Idea, why this script below works good only with routers and switches, for ASA and WLC 5500 and 9800 it don't works.

This is the script:

from netmiko import (
    ConnectHandler,
    NetmikoTimeoutException,
    NetmikoAuthenticationException,
)

from netmiko.ssh_autodetect import SSHDetect
from netmiko.ssh_dispatcher import ConnectHandler
import getpass
import os
import time
import sys
import subprocess
import logging
import re

password = getpass.getpass()
username = os.getlogin()
devices = []
with open('devices.txt') as routers:
    for i in routers:
        RR = {
            "device_type": "autodetect",
            "host": i,
            "username": ('admin_' + username),
            "password": password,
        }

        print (f'admin_{username} is connecting to the Device: {i}')

        try:
            connect = ConnectHandler(**RR)
            guesser = SSHDetect(**RR)
            best_match = guesser.autodetect()
            print("="*100)
            print(connect.find_prompt() + ':' + best_match)
            print("="*100)
            configs = []
            with open('commands.txt') as configu:

                   for c in configu:

                        output = connect.send_command(c)
                        print(c)
                        print(output)
                        print("-"*50)

        except (NetmikoTimeoutException, NetmikoAuthenticationException) as error:

            print ('!!!ERROR!!! The admin_' + username + ' COULD NOT CONNECT ON ' + i)
            print(error)

        continue

        connect.disconnect()

Tried to run this script in WLC and ASA.

Appreciate any help : )

Thanks


问:
larger video url is not loading inside react player
Hey all I am using react player to running the video inside my application. But the problem is when I use larger size video that is of more than one minutes then react player showing black interface.

you can see the image below.
[1]: https://i.stack.imgur.com/Hf3Ka.png

No control is working properly.

I am using following code for this operation.

```<code><ReactPlayer
  // Disable download button
  config={{ file: { attributes: { controlsList: 'nodownload' } } }}

  // Disable right click
  onContextMenu={e => e.preventDefault()}

  // Your props
  url="https://media.w3.org/2010/05/sintel/trailer_hd.mp4"
  className="react-player"
  controls
  width="100%"
  height="100%"
/>
</code>```

Please someone help me. Thank you in advance.

Body:
Hey all I am using react player to running the video inside my application. But the problem is when I use larger size video that is of more than one minutes then react player showing black interface.

you can see the image below.
[1]: https://i.stack.imgur.com/Hf3Ka.png

No control is working properly.

I am using following code for this operation.

<ReactPlayer
  // Disable download button
  config={{ file: { attributes: { controlsList: 'nodownload' } } }}

  // Disable right click
  onContextMenu={e => e.preventDefault()}

  // Your props
  url="https://media.w3.org/2010/05/sintel/trailer_hd.mp4"
  className="react-player"
  controls
  width="100%"
  height="100%"
/>

Please someone help me. Thank you in advance.


问:
Why does the Scroll to Text Fragment break my CSS layout?
When clicking on a result from a Google SERP, sometimes a Scroll to Text Fragment is added to the URL request, e.g. https://example.com/#:~:text=Lorem%20Ipsum, and highlights the targeted text in purple. That's pretty neat, but it break my CSS layout.

On one of my divs elsewhere on the page (not the one that gets highlighted), I'm using an absolutely-positioned :before element to add a rounded effect to the top of a 100%-wide div.

how it normally looks

The rounded pseudo-element is trimmed off of either side, since it is position: absolute, and not in the page flow. But, when there's a Scroll-to-Text Fragment added, which highlights a paragraph further up the page, for some reason the pseudo element is allowed to push the screen wider and break page layout.

how it looks if there's a scroll-to-text highlight on the page

Am I forgetting something about how CSS works, or is this a bug?

As a workaround I tried to detect this with JS window.location.hash so that I could dynamically remove my pretty rounded effect, but the Scroll to Text Fragment hash is not detected by JS (at least in Chrome). Thanks for any help.


问:
how to use require when using a library in a component
Install a library I do npm and everything is fine, it creates the folder in node_modules, but now I want to use it in a component but in the documentation require is used to call it, I do the same thing but in the console it shows me, require is not defined, how Can I solve this? I tried directly accessing the folder with but it doesn't work? how could i solve this?