Last 2 steps not working in (JavaScript Algorithms and Data Structures (Beta))

Describe the Issue
Steps 84 and 85 of (Learn Basic String and Array Methods by Building a Music Player) not working

Frame not showing on both pages
Test don't pass on both pages

Affected Page
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-string-and-array-methods-by-building-a-music-player/step-84
Your code
const playlistSongs = document.getElementById("playlist-songs");
const playButton = document.getElementById("play");
const pauseButton = document.getElementById("pause");
const nextButton = document.getElementById("next");
const previousButton = document.getElementById("previous");
const shuffleButton = document.getElementById("shuffle");

const allSongs = [
  {
    id: 0,
    title: "Hello World",
    artist: "RafaelDavisH",
    duration: "0:23",
    src: "https://s3.amazonaws.com/org.freecodecamp.mp3-player-project/hello-world.mp3",
  },
  {
    id: 1,
    title: "In the Zone",
    artist: "RafaelDavisH",
    duration: "0:11",
    src: "https://s3.amazonaws.com/org.freecodecamp.mp3-player-project/in-the-zone.mp3",
  },
  {
    id: 2,
    title: "Camper Cat",
    artist: "RafaelDavisH",
    duration: "0:21",
    src: "https://s3.amazonaws.com/org.freecodecamp.mp3-player-project/camper-cat.mp3",
  },
  {
    id: 3,
    title: "Electronic",
    artist: "RafaelDavisH",
    duration: "0:15",
    src: "https://s3.amazonaws.com/org.freecodecamp.mp3-player-project/electronic.mp3",
  },
  {
    id: 4,
    title: "Sailing Away",
    artist: "RafaelDavisH",
    duration: "0:22",
    src: "https://s3.amazonaws.com/org.freecodecamp.mp3-player-project/sailing-away.mp3",
  },
];

const audio = new Audio();
let userData = {
  songs: [...allSongs],
  currentSong: null,
  songCurrentTime: 0,
};

const playSong = (id) => {
  const song = userData?.songs.find((song) => song.id === id);
  audio.src = song.src;
  audio.title = song.title;

  if (userData?.currentSong === null || userData?.currentSong.id !== song.id) {
    audio.currentTime = 0;
  } else {
    audio.currentTime = userData.songCurrentTime;
  }
  userData.currentSong = song;
  playButton.classList.add("playing");

  highlightCurrentSong();
  setPlayerDisplay();
  setPlayButtonAccessibleText();
  audio.play();
};

const pauseSong = () => {
  userData.songCurrentTime = audio.currentTime;

  playButton.classList.remove("playing");
  audio.pause();
};

const playNextSong = () => {
  if (userData?.currentSong === null) {
    playSong(userData?.songs[0].id);
  } else {
    const currentSongIndex = getCurrentSongIndex();
    const nextSong = userData?.songs[currentSongIndex + 1];

    playSong(nextSong.id);
  }
};

const playPreviousSong = () =>{
   if (userData?.currentSong === null) return;
   else {
    const currentSongIndex = getCurrentSongIndex();
    const previousSong = userData?.songs[currentSongIndex - 1];

    playSong(previousSong.id);
   }
};

const shuffle = () => {
  userData?.songs.sort(() => Math.random() - 0.5);
  userData.currentSong = null;
  userData.songCurrentTime = 0;

  renderSongs(userData?.songs);
  pauseSong();
  setPlayerDisplay();
  setPlayButtonAccessibleText();
};

const deleteSong = (id) => {
  if (userData?.currentSong?.id === id) {
    userData.currentSong = null;
    userData.songCurrentTime = 0;

    pauseSong();
    setPlayerDisplay();
  }

  userData.songs = userData?.songs.filter((song) => song.id !== id);
  renderSongs(userData?.songs);
  highlightCurrentSong();
  setPlayButtonAccessibleText();

  if (userData.songs.length === 0) {
    const resetButton = document.createElement("button");
    const resetText = document.createTextNode("Reset Playlist");

    resetButton.id = "reset";
    resetButton.ariaLabel = "Reset playlist";
    resetButton.appendChild(resetText);
    playlistSongs.appendChild(resetButton);

    resetButton.addEventListener("click", () => {
      userData.songs = [...allSongs];

      renderSongs(userData?.songs);
      setPlayButtonAccessibleText();
      resetButton.remove();
    });

  }

};

const setPlayerDisplay = () => {
  const playingSong = document.getElementById("player-song-title");
  const songArtist = document.getElementById("player-song-artist");
  const currentTitle = userData?.currentSong?.title;
  const currentArtist = userData?.currentSong?.artist;

  playingSong.textContent = currentTitle ? currentTitle : "";
  songArtist.textContent = currentArtist ? currentArtist : "";
};

const highlightCurrentSong = () => {
  const playlistSongElements = document.querySelectorAll(".playlist-song");
  const songToHighlight = document.getElementById(
    `song-${userData?.currentSong?.id}`
  );

  playlistSongElements.forEach((songEl) => {
    songEl.removeAttribute("aria-current");
  });

  if (songToHighlight) songToHighlight.setAttribute("aria-current", "true");
};

const renderSongs = (array) => {
  const songsHTML = array
    .map((song)=> {
      return `

      <button class="playlist-song-info" onclick="playSong(${song.id})">
          ${song.title}
          ${song.artist}
          ${song.duration}
      </button>
      <button onclick="deleteSong(${song.id})" class="playlist-song-delete" aria-label="Delete ${song.title}">
          <svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="8" fill="#4d4d62"/>
          <path fill-rule="evenodd" clip-rule="evenodd" d="M5.32587 5.18571C5.7107 4.90301 6.28333 4.94814 6.60485 5.28651L8 6.75478L9.39515 5.28651C9.71667 4.94814 10.2893 4.90301 10.6741 5.18571C11.059 5.4684 11.1103 5.97188 10.7888 6.31026L9.1832 7.99999L10.7888 9.68974C11.1103 10.0281 11.059 10.5316 10.6741 10.8143C10.2893 11.097 9.71667 11.0519 9.39515 10.7135L8 9.24521L6.60485 10.7135C6.28333 11.0519 5.7107 11.097 5.32587 10.8143C4.94102 10.5316 4.88969 10.0281 5.21121 9.68974L6.8168 7.99999L5.21122 6.31026C4.8897 5.97188 4.94102 5.4684 5.32587 5.18571Z" fill="white"/></svg>
        </button>

      `;
    })
    .join("");

  playlistSongs.innerHTML = songsHTML;
};

const setPlayButtonAccessibleText = () => {
  const song = userData?.currentSong || userData?.songs[0];

  playButton.setAttribute(
    "aria-label",
    song?.title ? `Play ${song.title}` : "Play"
  );
};

const getCurrentSongIndex = () => userData?.songs.indexOf(userData.currentSong);

playButton.addEventListener("click", () => {
    if (userData?.currentSong === null) {
    playSong(userData?.songs[0].id);
  } else {
    playSong(userData?.currentSong.id);
  }
});

pauseButton.addEventListener("click",  pauseSong);

nextButton.addEventListener("click", playNextSong);

previousButton.addEventListener("click", playPreviousSong);

shuffleButton.addEventListener("click", shuffle);

audio.addEventListener("ended", () => {
  const currentSongIndex = getCurrentSongIndex();
  const nextSongExists = userData?.songs[currentSongIndex + 1] !== undefined;

// ####### This part of code is not passing test ############start
  if (nextSongExists) {
    playNextSong();
  }else{
    userData?.currentSong = null;
    userData?.songCurrentTime = 0;
  }
// #############################################end

});

renderSongs(userData?.songs);
setPlayButtonAccessibleText();

Expected behavior

Page should show Frame
Code should pass test

Screenshots

System

Device: Laptop
OS: Windows 10
Browser: Chrome
Version: 120.0.6099.217 (Official Build) (64-bit)

Additional context

Same problem happens with Step 85

I don't have any problem in solving the steps, please try to clear cache and local storage for freeCodeCamp, then log in again and try to go to the steps

Thank you for reporting this issue.
    userData?.currentSong = null;
    userData?.songCurrentTime = 0;

These two lines are causing syntax errors, you can see it if you open the console. Because of that I'm going to close this issue.
If you think we're wrong in closing this issue, please request for it to be reopened and add further clarification. Thank you and happy coding.

Okay both steps 84 and 85 are working now.

The step 85 works now but for the step 84 it only worked when I used mozilla firefox browser

If you are having problems with passing step, please , please click the "Help" button on the challenge on freeCodeCamp, which will help you create a question in the right part of the forum. Volunteers on the forum usually respond to questions within a few hours and can help determine if there is an issue with your code or the challenge's tests.
If the forum members determine there is nothing wrong with your code, you can request this issue to be reopened.
Thank you and happy coding.


update to DSE 6.8.34

Fixes #2534
Checklist

[x] Changes manually tested
[ ] Automated Tests added/updated
[ ] Documentation added/updated
[x] CLA Signed: DataStax CLA

Related to issue #1889 (DSE backend updated geometry-api?)

Ok, C*3.11 test failed first but passed on re-try.

@jeffreyscarpenter @tatu-at-datastax So this is only done on v2? No updates for the v1?

Correct. We are now trying to focus on v2 as far as I understand. Even for DSE updates.


Error: Missing: SyncTestZoneSpec

tests are failing webpack:///~/zone.js/dist/jasmine-patch.js:66:0

regression to v.0.6.12 is ok but v.0.6.14 give me this to.

0.6.13 was also ok. I'm getting the same error with 0.6.14.
We are using angular2-webapack-starter

I have the same problem. 0.6.13 is OK, 0.6.14 throws the error when running karma tests. Steps to reproduce:
git clone https://github.com/angular/quickstart.git
cd quickstart
npm install
npm test

The problem seems to have been introduced with PR #402. @jelbourn even comments the corresponding lines in the PR.

https://github.com/angular/zone.js/issues/404

This appears to be the same problem (i.e. duplicate), you are right. Having to update the imports is a breaking change, though. But I guess as zone.js still major version 0, this is semver compliant. OK.

Also having problem with Angular 2 RC6, I found this problem when trying to unit test under karma and jasmine ?
Karma: 1.2.0
Karma chrome launcher: 2.0.0
Karma jasmine: 1.0.2
Jasmine-core: 2.5.0

@HeavenlyHost have a look at #404

Im getting this error in rc6. I cant downgrade zone.

had to change my code to:
require('ts-helpers');

require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/proxy'); // since zone.js 0.6.15
require('zone.js/dist/sync-test');
require('zone.js/dist/jasmine-patch'); // put here since zone.js 0.6.14
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');

// RxJS
require('rxjs/Rx');

var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser-dynamic/testing');

testing.TestBed.initTestEnvironment(
  browser.BrowserDynamicTestingModule,
  browser.platformBrowserDynamicTesting()
);

Adding the following
testing.TestBed.initTestEnvironment(
browser.BrowserDynamicTestingModule,
browser.platformBrowserDynamicTesting()
);
helped... I think the confusing part is that I think others are using webpack where as I am still using system :-(
Also can I just say that for my testing I am using...
Karma: 1.2.0
Karma chrome launcher: 2.0.0
Karma jasmine: 1.0.2
Jasmine-core: 2.5.0
is there somewhere on the web that provides a descent example of how to build a test environment using these tools with Angular 2 rc6 ?

awesome!
Managed to get mine working with webpack and RC6 by using the following config taken from the angular2-webpack-starter project
https://github.com/AngularClass/angular2-webpack-starter/blob/master/config/spec-bundle.js

@monkeychops solutions works great for me.

@monkeychops also worked for me

I got this error again in<EMAIL_ADDRESS>


reconfigure the PKI references generated by the quickstart

reconfigure the PKI files used in the controller. Ensure the "ca" fields reference a file that only has root CAs in it (identity.ca, web.client-management.identity.ca).  One of them will need to include the signing CA in it.
The "cert" fields will contain a file that has the leaf certificate specified FIRST in the file, then a full chain up to but not including the root CA in the rest of the file. (identity.cert, edge.enrollment.signingCert.cert, web.client-management.identity.cert)

fixed with #1254 and refined with #1260


bump actix version to 0.13

Thank you!
I've pushed the 0.4.0 version to crates.io!

Thanks @zenria :) Perhaps this crate should be proposed for integration into actix itself by the way?


Problem when uploading a folder

Hello ans thank you very much for this very useful app!
I have a problem when uploading a 13 video folder (5.5go )
The upload doen't work and a dialog box shows:
org.javaswift.joss.exception.CommandException: Unable to execute the HTTP call or to convert the HTTP Response
Only 1video on 13 is uploaded.
I work on Windows 7 w86 ans hubic free account.
Thank you!

Hi,
I have the same message "unable to execute the HTTP.." when I try to download a very small directory. Only the name of the directory is downloaded. not any file inside.
when I only choose one file of this directory, it is uploaded, but its date is not the original one, but the current date. That is a real problem and I worry it is the same thing for a download of a directory.
And I have also this message when I only click on a big backuped directory in the browser. Immediately the message appears after 2 seconds. The directory is backed on hubic.
How these problems would be solved?


Hello Ollie Sorry bother you. I couldn't find any email to reach you.

We are interested in your IOS project on App Store. If you want to sell it. Please share with us your email on here.
Thanks

Hi, this is not an iOS project and is free, open source software.


DCC Guidance not displaying

If you select to view DCC guidance as part of your plan, the confirmation shows this has been picked but no guidance displays. Guidance I’ve added for the institution (GCU) is pulling through so it’s maybe an error with the DCC or default setting?

@sjDCC can you check this again? seems to work from a quick test. I tried the following:

create plan based on Horizon 2020
tick box for DCC guidance
go into "initial DMP" section 1 "Data Summary"

and I can see 3 sets of DCC guidance on "Existing Data", "Data Volumes" and "Data Format"
Can you either close this as ok now or give further details to chase it. Thanks.

All fixed - thanks


validate all json/yaml examples under examples dir

There are many not tested examples. Added those targets manually for now.

It's a miracle that it passes out of the box.


CDS Relationships between Flow_ Approvals and Workflow

Dear MS Power Apps and Dataverse Experts and friends,
I hope all is well !!
I hope I am on the right channel.
I am interested in relating the Approvals to the Workflow and I am having difficulty.
I need to be able to point to the workflow information for each approval  or vise versa.
I have identified the msdyn_flow_flowapproval_flowname column that carries the unique flow  ID.
I am looking at the workflow table and I can't seem to find the equivalent ID to link to.
Can anyone please shed some light.
I can't find any good documentation about the  tables and columns for Dataverse.
Please share with me if you have some good pointers.
With much appreciation
Stay safe
Thank you
Leonidas

@leondarl
Thanks for contacting us. Unfortunately, we're unable to handle Support requests for the product here. To contact Support, visit https://powerapps.microsoft.com/support/.
You can also try posting your issue to one of the developer forums.
We accept incorrect or missing documentation and sample code issues.
I did forward your issue to the Flow technical writer. Perhaps he will have some suggestions.


Add new feature where in to upload profile pics of each user

Can I work on this issue please? @shelcia

Can I work on this issue please? @shelcia

You can connect with me on discord https://discord.gg/TkKHAYVCza

hey @shelcia I would like to wok on this issue

@shelcia  so i only need to build backend for it

Where will users upload then ? Will be needing FE too


code error

hi, nice idea.
I import your project(win 7 x86 eclipse) and find code errors like:

DistortionRender.java line 454,
float[] vertexData = new float['峤�];

2.NfcSensor.java line 200
NfcSensor.access$204(NfcSensor.this);
any idea about this? and the code is just decompiled from cardboard.jar?

+1

+1

+1


Investigate SPARK-35545 (Refactor of SubqueryExpression's members)

SPARK-35545 refactored SubqueryExpression's children field into two different members (outerAttrs and joinCond).
It doesn't look like the spark-rapids code makes direct reference to SubqueryExpression, so we shouldn't be affected. But it would be good to have a second opinion. The change isn't user facing, and no tests were modified for this change.
I'm hoping this does not necessitate an addition to the Shims.

the only thing I see here would be ScalarSubquery because we have a GpuScalarSubquery but it doesn't use the expressions from ScalarSubquery.


genpy: 0.6.3-0 in 'kinetic/distribution.yaml' [bloom]

Increasing version of package(s) in repository genpy to 0.6.3-0:

upstream repository: git@github.com:ros/genpy.git
release repository: https://github.com/ros-gbp/genpy-release.git
distro file: kinetic/distribution.yaml
bloom version: 0.5.22
previous version for package: 0.6.2-0

genpy
* fix Python 3 regressions (#71 <https://github.com/ros/genpy/issues/71>)
* use Python safe subfields for nested types (#69 <https://github.com/ros/genpy/issues/69>)

Waiting for other Kinetic releases...

@dirk-thomas do you have any other pending kinetic releases? I only merged indigo and jade at the moment.

Yes, ros_comm will be released once the PR I requested review for has been merged.


Is this a shiplift fork? Comparison with bollard?

I am trying to use some docker library to write tests. There looks 3 choices in the crates.io: shiplift, bollard and docker-api.
I tried shiplift first because it is best starred but after all I noticed it is unmaintained.
Then look into this library now and notice the APIs are much similar to shiplift. Question 1: Is this a fork?
Question 2 is about comparison with the alternative bollard. What is the strong point of this library against bollard?

Then look into this library now and notice the APIs are much similar to shiplift. Question 1: Is this a fork?

Yes, this crate is a fork of shiplit as is noted in the README.

Question 2 is about comparison with the alternative bollard. What is the strong point of this library against bollard?

I haven't used bollard personally as I only discovered it after starting my work on this crate so I can't really compare it. Glancing over bollard repository it seems pretty active and maintained so there is definitely that factor to consider. I am pretty responsive and plan to maintain this crate but bollard definitely has a wider user base and the codebase may be more thoroughly tested and documented.

I see. Thank you.


EPIC: add the functionality of selecting Project Types for the new Project

The idea is to add different types of tested tools to the SAVE eco-system. Right now we were focused on a standard static analysis. But we already get requests for compilers and Software Composition Analysis.
In this case we would like to add the following logic:

Each Project should have an entity TYPE - better it be a enum
This type should be propagated to BACKEND, DATABASE, ORCHESTRATOR, FRONTEND and (probably even agents)
Depending on the type - we will need to do different logic: for Static Analysis - it should be the same logic that we have now, but for SCA it can be a different logic on the frontend/backend/agents

As discussed with @petertrr:

SAVE-agent image is built by the orchestrator. It includes the following: native SAVE-agent. native SAVE-cli, and executable binaries of tested tools;
Docker image is built with those attachments;
All components have primitive json API;

Probably, in case of adding new TYPE for the project, we will need to support different types of SAVE-cli apps: for compilers, for testing of REST services etc., so we will need to inject our component in the following chain:
SAVE-agent -> SAVE-cli (we are injecting our native binary here depending on the type) -> tool


Incomplete URL substring sanitization

Hi, i found security issue on this lib/map-image-url.ts:24 with code scanning by github, please fix this issue.

Thanks!

This code doesn't exist in this repo anymore.


styled.keyframes not working

I recently wanted to create a custom animation for a VUE component.
When I try to create the animation with styled.keyframes ... I get an error in my Webpack build (Nuxt JS)
__WEBPACK_IMPORTED_MODULE_0_vue_styled_components___default.a.keyframes is not a function
Does anyone have any idea why this is happening, the normal styled.span and alike work just fine ...

My styled.span looks like this
animation: ${animation} 1s
and my animation styled.keyframes is
    0% {left: 0;}     50% {left: 50%;}     100% {left: 0;}

Hi @Andrei997 ,
this PR https://github.com/styled-components/vue-styled-components/pull/48 manage keyframes and we will soon published I can't work well now because I have no wifi.
Just wait and soon you'll updated :)

@liqueflies Yessir!


custom dataset

@YoungXIAO13 Any clue how to apply this on a custom dataset? How about adding this to you readme, this can be very useful!

Hi @hjraad
Thanks for your suggestion, I've updated the README in ./data for details in experimenting with own custom dataset.
Hope this would help you

嗨@hjraad
感谢您的建议，我已经更新了自述文件，以./data获取有关尝试使用自己的自定义数据集的详细信息。
希望这对您有帮助

@YoungXIAO13 Any clue how to apply this on a custom dataset? How about adding this to you readme, this can be very useful!

I wonder if you has trained successfully with your own data set. I trained with my own data set(10K), AP of all classes is 0.


feat(config): Add auto line endings normalization

Add .gitattributes file which automatically normalize line endings
with * text=auto attribute behavior.
Closes #10

I think this is not setting an universal end of line, still seems everyone can use lf and crlf.
Using this docs as reference I believe we need to set something like text eol=lf, however we could handle that in editor config  (#12) as well, could be better take care of this type of configuration only in one place, What do you think about?
😄

In the .gitattributes case, setting text=auto, Git will handle line endings automatically for each OS/enviroment. But I really like the #12 approach and I agree it's better.
I will close this PR and follow #12 suggestion.

Hey @paulonotz0r great job!!  The #12 is open, feel free to get if you want! ;)

Thanks, @jvcjunior! Actually I've learned a new thing about .editorconfig and that give me motivation to go further in this project. :D


Update some miniapps

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Additional details and impacted files

:loudspeaker: Thoughts on this report? Let us know!


Ideas for new Kassy modules, (before they fall out of my head)

!youtube   "search the youtubes"
!sound  "slack specific using this lib https://github.com/caseyfw/slack-sounds would require porting to nodejs"
!emoji  "translate english to emoji https://github.com/notwaldorf/emoji-translate"

To add to the list,
!bugReport  "create and issue on github"
!todo list "keeps a list of things to do"
other functionality offered by hugh bot

How about a Google search? either returns the google generated answer to the search or the top 3 result titles

I should update this,
Bug reporting has been implemented with Issue core module, https://github.com/mrkno/Kassy/blob/master/core/core_modules/issue.js although it looks like I forgot the documentation, whoops.
emoji translate has a kpm module here https://github.com/Awarua-/emoji-translate-kpm
Things like youtube and others would probably fall under the hubot compatibility layer https://github.com/mrkno/Kassy/issues/71
@ParasDPain For Google search there might be a module that can be cross integrated from hubot and there is an existing kpm LMGTFY module https://github.com/mrkno/KPM_LMGTFY
but feel free to write your own kpm modules :smile:

I'm wondering whether we should make a wiki for all available KPM packages for Kassy? Thanks for the suggestion @Awarua- the package helped me build my own package for search on HummingBird.com (though it has issues being accessed by Kassy, SO Question here

@ParasDPain KPM is a very new thing (as in the past few weeks) hence why there isn't any kind of wiki page yet. As for your problem, refering to the linked HelloKassy project from the documentation would probably be more useful tbh than the LMGTFY module, as it is simpler and has comments about how each method should work.
You StackOverflow question says that you get an error telling you to start kassy in debug mode. The documentation states how to do that here (node main.js debug ...). This would give you full stack traces about what isn't working.
Additionally I tried running your module and do not get the unhandled error you do, just the output:
/humming anime
line 23
line 40
line 73

@mrkno It's working for you? Awesome and thank you so much for the reply, I had already exhausted all my resources , as it turns out I was debugging it the wrong way. Thanks!

Moved to https://github.com/mrkno/Kassy/wiki/Ideas-for-Modules


Please invite me to the community

Name
Matteu
Discord Username (if applicable)
Matteu#0001
Additional Context
Design System implementation guy I suppose? lmao

Welcome to the community 👋

weeeeeeeeee


How to turn off kiosk mode?

I turned on kiosk mode.
Now how can I go into editing Lovelace?
There is no menu (three dots).

https://github.com/NemesisRE/kiosk-mode#important-info


Add Example of using Prometheus with a sample Graphana dashboard to test network

A useful feature for the test-network would be to be able to start a separate prometheus and grafana setup configured to collect and display metrics for the test network. It will demonstrate how to quickly setup an environment to capture metrics in real time and display them. It should

update the test network to generate prometheus metrics
add the ability to separate start a prometheus and grafana server either in the fabric docker network test or as a separate network
provide a sample prometheus configuration that connects to the fabric test network to collect metrics
provide a sample grafana dashboard to collect some of the more interesting statistics
provide a README explaining how to setup this environment

This issue covers test-network only and does not include the nano or K8s samples

TASKS

[ ] Update test network for compatibility with prometheus --> #542


define and enforce static import code style

Description
Not using static imports under src/main frequently in code review, yet often the same static imports are present elsewhere in the codebase. This PR aims to standardise this so time is not wasted enforcing this in code review, and so enforcement is consistent.
This PR:

uses the AvoidStaticImport rule
suppresses the rule for src/test
excludes certain classes wherever the class is already statically imported somewhere and code would be much more verbose (e.g. some JDK utilities, Precoditions, pinot constant classes, DataType)
Makes some code changes to avoid adding excludes to the rule.

Merging this PR should

mean that it is agreed when static imports are OK to use in Pinot and when they are not.
prevent discussion of formatting during code review.

Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

[ ] Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

[ ] Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

New configuration options
Deprecation of configurations
Signature changes to public methods/interfaces
New plugins added or old plugins removed

[ ] Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

Documentation

Codecov Report

Merging #7483 (28b965a) into master (4000568) will decrease coverage by 2.19%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##             master    #7483      +/-   ##
============================================
- Coverage     72.02%   69.82%   -2.20%
+ Complexity     3369     3286      -83
============================================
  Files          1519     1125     -394
  Lines         75364    53260   -22104
  Branches      10987     8027    -2960
============================================
- Hits          54279    37190   -17089
+ Misses        17434    13432    -4002
+ Partials       3651     2638    -1013

Flag
Coverage Δ

integration1
?

integration2
?

unittests1
69.82% <50.00%> (-0.05%)
:arrow_down:

unittests2
?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

...not/segment/local/customobject/QuantileDigest.java
58.70% <0.00%> (ø)

...pinot/segment/spi/store/SegmentDirectoryPaths.java
88.88% <100.00%> (ø)

...ache/pinot/spi/data/DateTimeFormatPatternSpec.java
68.75% <100.00%> (ø)

...a/org/apache/pinot/common/metrics/MinionMeter.java
0.00% <0.00%> (-100.00%)
:arrow_down:

...g/apache/pinot/common/metrics/ControllerMeter.java
0.00% <0.00%> (-100.00%)
:arrow_down:

.../apache/pinot/common/metrics/BrokerQueryPhase.java
0.00% <0.00%> (-100.00%)
:arrow_down:

.../apache/pinot/common/metrics/MinionQueryPhase.java
0.00% <0.00%> (-100.00%)
:arrow_down:

...he/pinot/common/messages/SegmentReloadMessage.java
0.00% <0.00%> (-100.00%)
:arrow_down:

...pinot/core/data/manager/realtime/TimerService.java
0.00% <0.00%> (-100.00%)
:arrow_down:

...not/common/exception/HttpErrorStatusException.java
0.00% <0.00%> (-100.00%)
:arrow_down:

... and 598 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4000568...28b965a. Read the comment docs.


UI bug

I was verifying the most recent deploy, and clicked on a screen that showed this:

Looks like some frontend code is failing to evaluate on the "Patient history" section, causing the UI to dump HTML. This bug needs triage from someone who knows this codebase better than I, but this seems related: https://github.com/DCAFEngineering/dcaf_case_management/blob/main/app/models/audit_trail.rb#L50
Maybe it just needs a translation string in config/locales?

Dupe of https://github.com/DCAFEngineering/dcaf_case_management/issues/1921


Append multiple points, lines to drawing

Hi,
I can't seem to be able to append multiple circles to a drawing. My code is as follows:
let cMarker = [
{x: 41.39385232598374, y: 2.172604493469561},
{x: 41.39280600217181, y: 2.1692907049173997}
]
let dd = new Drawing();
cMarker.forEach(d =>{
dxfMarker.push(
dd.addLayer('l_yellow', Drawing.ACI.YELLOW, 'DOTTED')
.setActiveLayer('l_yellow')
.drawCircle(d.x, d.y, 2)
)}
)

Hello,
I have tried and it adds multiple circles, check this:
const Drawing = require('./../src/Drawing');
const fs = require('fs');

let cMarker = [
    {x: 0, y: 0},
    {x: 5, y: 5},
    {x: 10, y: 10}
]
let dd = new Drawing();
dd.addLayer('l_yellow', Drawing.ACI.YELLOW, 'DOTTED')
  .setActiveLayer('l_yellow');

cMarker.forEach(d =>{
    dd.drawCircle(d.x, d.y, 2)
});

fs.writeFileSync(__filename + '.dxf', dd.toDxfString());

You should get:

Regards, Ognjen

Super stuff - thanks so much.
I presume this is the same for lines and points also?
By the way, have you any documentation on the package?
It's a really super package ognjen - keep up the good work :)
On Domh 11 Lún 2019 at 14:54, Ognjen Petrovic<EMAIL_ADDRESS>wrote:

Hello,
I have tried and it adds multiple circles, check this:
const Drawing = require('./../src/Drawing');
const fs = require('fs');
let cMarker = [
{x: 0, y: 0},
{x: 5, y: 5},
{x: 10, y: 10}
]
let dd = new Drawing();
dd.addLayer('l_yellow', Drawing.ACI.YELLOW, 'DOTTED')
.setActiveLayer('l_yellow');
cMarker.forEach(d =>{
dd.drawCircle(d.x, d.y, 2)
});
fs.writeFileSync(__filename + '.dxf', dd.toDxfString());
You should get:
[image: image]
https://user-images.githubusercontent.com/3530586/62834680-3b4fc580-bc50-11e9-8880-7c90454df585.png
Regards, Ognjen
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ognjen-petrovic/js-dxf/issues/13?email_source=notifications&email_token=AAXZAVTCSYU6JKGLAQKRUFDQEAKY3A5CNFSM4IK3O6CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4BBLYY#issuecomment-520230371,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAXZAVVLJ2GR2EUN6ADYCODQEAKY3ANCNFSM4IK3O6CA
.

--
Le gach dea ghui,
Shane Carey
GIS and Data Solutions Consultant

Hi,
There is no documentation but there is examples folder, hopefully it may help.
Yes, it should work with points and lines.
There was an issue with point entity, so checkout newest version.
Regrds, Ognjen

No probs, thanks very much. I tried to do similar for creating lines. I created points at four corners but it drew a straight line. Perhaps, you could give an example of creating lines (based on the cMarker points above) also?
Thanks - it's super

Hey,
I have tried it for lines but it keeps giving me a straight line as opposed to lines with corners etc. here is my code
let dd = new Drawing();
dd.addLineType('DASHDOT', '_ . _ ', [0.5, -0.5, 0.0, -0.5])
.addLayer('l_green', Drawing.ACI.GREEN, 'DASHDOT')
.setActiveLayer('l_green');
const dxfMarker = [[]];
const cMarker = [
{x: 53.24193411993514, y: -8.270071576731706},
{x: 53.199177688252114, y: -7.597447570286902},
{x: 52.90117139985734, y: -7.660591864769458},
{x: 52.93098201703758, y: -8.29615291575711}
]
cMarker.forEach(d =>{
dxfMarker.push([d.x, d.y]);
dd.drawPolyline(dxfMarker);
});

Hi,
It works, code:
let dd = new Drawing();
dd.addLineType('DASHDOT', '_ . _ ', [0.5, -0.5, 0.0, -0.5])
.addLayer('l_green', Drawing.ACI.GREEN, 'DASHDOT')
.setActiveLayer('l_green');
const dxfMarker = [];
const cMarker = [
{x: 53.24193411993514, y: -8.270071576731706},
{x: 53.199177688252114, y: -7.597447570286902},
{x: 52.90117139985734, y: -7.660591864769458},
{x: 52.93098201703758, y: -8.29615291575711}
]
cMarker.forEach(d =>{
dxfMarker.push([d.x, d.y]);
});
dd.drawPolyline(dxfMarker);
And output:
[image: image.png]
Regards, Ognjen
On Mon, 12 Aug 2019 at 07:53, Shane Carey<EMAIL_ADDRESS>wrote:

Hey,
I have tried it for lines but it keeps giving me a straight line as
opposed to lines with corners etc. here is my code
let dd = new Drawing();
dd.addLineType('DASHDOT', '_ . _ ', [0.5, -0.5, 0.0, -0.5])
.addLayer('l_green', Drawing.ACI.GREEN, 'DASHDOT')
.setActiveLayer('l_green');
const dxfMarker = [[]];
const cMarker = [
{x: 53.24193411993514, y: -8.270071576731706},
{x: 53.199177688252114, y: -7.597447570286902},
{x: 52.90117139985734, y: -7.660591864769458},
{x: 52.93098201703758, y: -8.29615291575711}
]
cMarker.forEach(d =>{
dxfMarker.push([d.x, d.y]);
dd.drawPolyline(dxfMarker);
});
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ognjen-petrovic/js-dxf/issues/13?email_source=notifications&email_token=AA256WTA2WVRNH4ODQ6HVPDQED3GXA5CNFSM4IK3O6CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4BTXDA#issuecomment-520305548,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA256WUC72SOAJI3YUZ3O33QED3GXANCNFSM4IK3O6CA
.

Thanks Ognjen - looks great.
Cheers


Updating chain ID implementation with @starknet-react/core

We updated the chain ID configuration in this pull request to match the new starknet library we included in the interface and SDK.


Including Simple Graph Convolution

Thank you for maintaining such a great project here!
In our recent paper (https://arxiv.org/pdf/1902.07153.pdf), we discover a linear model (Simple Graph Convolution) that can be as effective as GCN while saving a lot of training time. We have our official implementation at https://github.com/Tiiiger/SGC. I would like to help or coordinate with you on having an example implementation of Simple Graph Convolution in this project.
Perhaps somewhat different from other models, the propagation step in Simple Graph Convolution can be simplified as a preprocessing step and the model would be reduced to logistic regression. I am not sure how to implement such a preprocessing using the current API. Can you give me some pointers on how to start?

Hi,
I would love to see SGC in PyTorch Geometric.
I suggest adding a cached flag to the SGC constructor and using propagate in a for-loop:
def __init__(self, in_channels, out_channels, hops=1, cached=False):
    self.hops = hops
    self.cached = cached
    self.cached_result = None
    self.lin = Linear(in_channels, out_channels)

def forward(self, x, edge_index, edge_weight=None):
    if self.cached and self.cached_result = None:
        norm = ... # Compute
        for k in range(hops):
            x = self.propagate('add', edge_index, x=x, norm=norm)
        self.cached_result = x
    return self.lin(self.cached_result)

def message(self, x_j, norm):
    return norm.view(-1, 1) * x_j

Are you okay with this?
You are welcome to submit a pull request, otherwise, I would integrate it by myself.

Looks great! It would be nice if you can help integrate it : )

Implementation + Experiments. Results look good so far. Thanks for letting me know.

Thank you for being so responsive!


Test parameter parsing out of framework

Umbrella: https://github.com/nunit/nunit/issues/1941

Looks like https://github.com/nunit/nunit.portable.agent/pull/20 is going to need to be published before this build can complete.

Is there an issue for this?

Is there an issue for this?

I can create one if nunit/nunit#1941 can't be linked in dotnet-test-nunit release notes,

@jnm2 You could, create an issue, which I would then classify for discussion, but that seems a little heavier-weight than we need to be. The point of my question is that the @nunit/net-core-runner-team has not created an issue for this and therefore could be presumed to not want it. Let's wait for them.
All the "core" projects are experimental and at this point their continued existence is in doubt because microsoft is changing how you use .NET core and run tests. We may not want to spend time on this. However, I myself don't work on those projects, so I can't tell you.
@rprouse Is this something we should be working on?

I'm with you, but it was important to me that this PR is defensive. It provides rationale to future development and prepares improvements to be made using IDictionary rather than the deprecated string method.

I don't mind merging this. We will likely do one more release of this adapter to hold people over as .NET Core switches over to the MSBUILD/CSPROJ format which will make this project obsolete. I don't think we need an issue for this, I will just mark the PR accordingly.
First check of the code looks good, but I need to check CI and see why they are failing.

I see CI is failing because of the other PR you submitted. I have merged that. Once it is built on master, this PR should be switched to use the NuGet package from that build.

There's a change requested in one of the other PRs (?? I'm on my phone) to put the dictionary creation into options. Up to you whether you want to keep in sync.

@rprouse we are behind on the 3.4 milestone.  Are we waiting on this PR?  Either way, it would be nice to get the latest round of fixes out for consumption without us having to manage side-builds.

@dougkpowers we are not waiting on this PR, we are waiting on the NUnit Framework and Console 3.6 releases which should go out this week and next week. They take priority at the moment.
@jnm2 do you think you can update this PR to use the NuGet that includes the changes in nunit/nunit.portable.agent#20 to get CI passing?

@rprouse I just change the project.json package references, right? Where do I look up the new version string to use?

@jnm2 yes just changing the project.json should work. It doesn't seem to be publishing to MyGet, so use the AppVeyor <IP_ADDRESS>-CI

All working except I didn't find the tests. Side effect of not being able to use Visual Studio for the edits in this repo. Fix coming.

All working now.

All working now. The Travis XCode tests could use a kick.

We've been having trouble with the IOS builds on Travis, so we can ignore those.

This project is at the end of its life, so no need for this PR.


Case where jax.linear_transpose fails, but jax.vjp works

I'm running into an error when I try to use jax.linear_transpose on a function that involves jax.ops.index_update.  I get an error stating the transpose rule (for reverse-mode differentiation) is not implemented.  However, I don't get this error if I use jax.vjp to compute the adjoint.
Using:

jax  0.2.11
jaxlib 0.1.64

I'm happy to contribute a fix, but could use some guidance on where to look.
import numpy as np
import jax

def mosaic(x):
    y = jnp.zeros(x.shape)
    y = jax.ops.index_update(y, jax.ops.index[1::2], x[1::2])
    return y

x = jax.device_put(np.r_[:10].astype(np.float32))
fx = mosaic(x)

vjp_fun = jax.vjp(mosaic, x)[1]
vjp_fun(fx)  # works fine!

trans_fun = jax.linear_transpose(mosaic, x)
trans_fun(fx)  # Raises exception:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/miniconda3/envs/scico/lib/python3.8/site-packages/jax/interpreters/ad.py in get_primitive_transpose(p)
    253   try:
--> 254     return primitive_transposes[p]
    255   except KeyError as err:

KeyError: scatter

The above exception was the direct cause of the following exception:

NotImplementedError                       Traceback (most recent call last)
~/scico/vjp_test.py in <module>
     18
     19     trans_fun = jax.linear_transpose(mosaic, x)
---> 20     trans_fun(fx)

~/miniconda3/envs/scico/lib/python3.8/site-packages/jax/api.py in transposed_fun(out_cotangent)
   1965                       f"expected {out_avals} but got {out_cotangents}")
   1966     dummies = [ad.UndefinedPrimal(a) for a in in_avals]
-> 1967     in_cotangents = ad.backward_pass(jaxpr, consts, dummies, out_cotangents)
   1968     return tree_unflatten(in_tree, in_cotangents)
   1969

~/miniconda3/envs/scico/lib/python3.8/site-packages/jax/interpreters/ad.py in backward_pass(jaxpr, consts, primals_in, cotangents_in)
    225             params, call_jaxpr, invals, cts_in, cts_in_avals)
    226       else:
--> 227         cts_out = get_primitive_transpose(eqn.primitive)(cts_in, *invals,
    228                                                          **eqn.params)
    229     cts_out = [Zero(v.aval) for v in eqn.invars] if cts_out is Zero else cts_out

~/miniconda3/envs/scico/lib/python3.8/site-packages/jax/interpreters/ad.py in get_primitive_transpose(p)
    254     return primitive_transposes[p]
    255   except KeyError as err:
--> 256     raise NotImplementedError(
    257         "Transpose rule (for reverse-mode differentiation) for '{}' "
    258         "not implemented".format(p)) from err

NotImplementedError: Transpose rule (for reverse-mode differentiation) for 'scatter' not implemented

``

Transpose rules only exist for linear functions, but I don't think index_update is necessarily linear.

FWIW I believe it is linear-- in the vector case, jax.ops.index_update(x, idx, y) can be written M x + y_b, where M is a diagonal matrix with 0's in the locations specified by idx and 1 otherwise, and y_b is a vector such that y_b[idx] = y and is zero in other locations.

Yes, you may be right. It quite possible that simply nobody has bothered to implement this yet.
The implementation of the scatter primitive (used for index_update) can we found here:
https://github.com/google/jax/blob/1f1d3dffe2de969c3485535b9bbd5a375600b551/jax/_src/lax/lax.py#L4916-L4921
Interestingly, the JVP rule for scatter looks like a manually calculated the JVP of scatter written in terms of scatter_add:
https://github.com/google/jax/blob/1f1d3dffe2de969c3485535b9bbd5a375600b551/jax/_src/lax/lax.py#L4835
Scatter is kind of a funny primitive -- it seems like we may only need it because there's a corresponding XLA function.
So one possible solution would be:

Write a version of scatter written in terms of scatter_add.
Then either:
a. Replace scatter entirely, if scatter_add has good enough performance -- maybe we don't actually need a scatter primitive in JAX, or
b. Use jvp(scatter_via_scatter_add) to implement the JVP rule for scatter and linear_tranpose(scatter_via_scatter_add) to implement the transpose rule. There is a good example of the later for rfft.

Just curious-- with the recent closing of #6306, is there a path to using linear_transpose on this/similar functions?

I think we need a different approach here than what I suggested above and tried in that PR. Instead, I think scatter just needs a transpose rule.

On jax=0.2.16, jaxlib=0.1.68 this is no longer an issue.  Not sure what commit resolved it, but no complaints here!


Kyber.Network support

Refs:
https://developer.kyber.network/docs/API_ABI-KyberNetworkProxy
https://developer.kyber.network/docs/Environments-Mainnet/

Awesome stuff @marcelomorgado let me test it out real quick and merge it in. Thanks for doing this!

@marcelomorgado thanks for the PR. Version 2.1.2 with your changes have now been published!

@marcelomorgado thanks for the PR. Version 2.1.2 with your changes have now been published!


Add AD Domain Services link

@francedot : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@ktoliver : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Verified the link; looks good. Thanks.


Failed at the<EMAIL_ADDRESS>install script 'node-gyp rebuild'

Electron version: 1.4.2
Operating system: Mac 10.12

<EMAIL_ADDRESS>install /Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/nslog
> node-gyp rebuild

  CXX(target) Release/obj.target/nslog/src/main.o

clang: error: no such file or directory: 'Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/electron-rebuild/lib/headers/.node-gyp/iojs-1.4.2/include/node'
clang: error: no such file or directory: 'Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/electron-rebuild/lib/headers/.node-gyp/iojs-1.4.2/src'
clang: error: no such file or directory: 'Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/electron-rebuild/lib/headers/.node-gyp/iojs-1.4.2/deps/uv/include'
clang: error: no such file or directory: 'Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/electron-rebuild/lib/headers/.node-gyp/iojs-1.4.2/deps/v8/include'
make: *** [Release/obj.target/nslog/src/main.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/usr/local/bin/node" "/Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/nslog
gyp ERR! node -v v6.7.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/npm/bin/npm-cli.js" "rebuild" "--runtime=electron" "--target=1.4.2" "--arch=x64"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR<EMAIL_ADDRESS>install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nslog package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs nslog
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls nslog
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/npm-debug.log

Process exited with code: 1
Error: Process exited with code: 1
    at ChildProcess.<anonymous> (/Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/node_modules/electron-rebuild/lib/spawn.js:55:26)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "rebuild"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! micaDesktop@ rebuild: `electron-rebuild -f -p`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the micaDesktop@ rebuild script 'electron-rebuild -f -p'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the micaDesktop package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-rebuild -f -p
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs micaDesktop
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls micaDesktop
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ericdahlseng/Library/Mobile Documents/com~apple~CloudDocs/Projects/BiLab/micaDesktop/npm-debug.log

+1
1704 error Windows_NT 6.1.7601
1705 error argv "C:\Program Files\nodejs\node.exe" "C:\Users\Stevie\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--save-dev" "electron-rebuild"
1706 error node v4.6.0
1707 error npm  v3.10.8
1708 error code ELIFECYCLE
1709 error<EMAIL_ADDRESS>install: node-gyp rebuild
1709 error Exit status 1
1710 error Failed at the<EMAIL_ADDRESS>install script 'node-gyp rebuild'.
1710 error Make sure you have the latest version of node.js and npm installed.
1710 error If you do, this is most likely a problem with the nslog package,
1710 error not with npm itself.
1710 error Tell the author that this fails on your system:
1710 error     node-gyp rebuild
1710 error You can get information on how to open an issue for this project with:
1710 error     npm bugs nslog
1710 error Or if that isn't available, you can get their info via:
1710 error     npm owner ls nslog
1710 error There is likely additional logging output above.
1711 verbose exit [ 1, true ]

Merging into #104


fix/File already exists at save

Signed-off-by: Björn Müller<EMAIL_ADDRESS>Fix error when creating new nodetype that the file already exists.

[x] Ensure that you followed http://eclipse.github.io/winery/dev/ToolChain#github---prepare-pull-request. Especially, we require a single commit
[x] Ensure that the commit message is a good commit message
[x] Ensure to use auto format in all files
[x] Ensure that you appear in NOTICE at Copyright Holders
[ ] Tests created for changes
[ ] Documentation updated (if needed)
[ ] Screenshots added (for UI changes)

Can one of the admins verify this patch?

Add to whitelist


Make region and dry-run params in Lizzy.delete optional

Some calls to Lizzy.delete were wrong. Tests were not showing that up. I wrote some test code to make it visible and never happen again. That part of the test can be generalised to be reused with other methods and prevent it to happen in other mocked methods, but that is a focus of a future PR.

:+1:

Coverage increased (+0.04%) to 93.298% when pulling 34ff2cee89e480ba29b0b510a4a798bd85b1eabd on rafaelcaricio:fix-delete-call into 704ad6370c27b9b52736f304f1bbd95365d1f3fc on zalando:release2.0.


VS2022 Support

Gonna be interesting with all the major incoming changes .
Also note the breaking API changes.

Would you like help with this?

Thanks, I've got a build running locally. A couple editors have different guids, but otherwise seems to be stable.
Could use a hand to come up with a single vsix that would work in, say, 2015-2022 without having to publish two separate extensions in the marketplace.  Managed to get one to build & install, but the pre-2022 instances got into dll dependency hell when invoked. Didn't try very hard, so maybe I just missed something obvious.

Regarding "a single vsix", this conversation might help: https://github.com/mayerwin/vs-customize-window-title/issues/64


Multiple transports for Github App?

I need to support https://github.com/google/go-github?tab=readme-ov-file#as-a-github-app and it indicates that I'm setting github.NewClient(&http.Client{Transport: itr}), but I'm already doing github.NewClient(rateLimit) so I can use this. Is there a recommended approach to merge the transports or use both of these somehow?

Maybe I can override https://github.com/gofri/go-github-ratelimit/blob/9d9726540b07a6a728cc6beb4a28cdc8a3a8f91a/github_ratelimit/ratelimit.go#L20 with the same one I'm using for ghinstallation.NewKeyFromFile. I'll give it a try...

Hey @NorseGaud,
Replying from my phone so sorry for not being able to dig into the actual code.
The general idea with Go's round-trippers is that you can stack them by setting one as the Base of another (you can see an example in go-github-ratelimit's client).
I hope it helps

@gofri , "you can see an example in go-github-ratelimit's client" -- can you point me to that? I still have no idea how to achieve this :(

@NorseGaud sure.
The SenodaryRateLimitWaiter implements the http.RoundTripper interface, so you can use it as the Transport for any other http client.
In your case, you can use NewSecondaryRateLimitWaiter(itr), and use itd result as your http.Transport, instead of itr.
I hope that helps :)


[YUNIKORN-1122]Move constants to scheduler interface

What is this PR for?
leverage constants from si repo
What type of PR is it?

[ ] - Bug Fix
[x] - Improvement
[ ] - Feature
[ ] - Documentation
[ ] - Hot Fix
[ ] - Refactoring

Todos

[ ] - Task

What is the Jira issue?
https://issues.apache.org/jira/browse/YUNIKORN-1122
How should this be tested?
Screenshots (if appropriate)
Questions:

[ ] - The licenses files need update.
[ ] - There is breaking changes for older versions.
[ ] - It needs documentation.

Don't know why the lint check failed in resources/resources_test.go import.
@pbacsko Could you kindly help to check this error? I can't find any error according the error message.
Thanks.

@HuangTing-Yao yes, it was a missing new line.
But now there are merge conflicts, please rebase it with the master properly, thanks.

Already fix the conflicts, Thanks @pbacsko .


Sanitze

as sanitize html (&nbsp) and more...

Not sure I am following you.  The report engine just puts out what you send to it.


Hot-fix security issues with certifi

Modulus Pull Request
Description
Closes #110
Checklist

[x] I am familiar with the Contributing Guidelines.
[x] New or existing tests cover these changes.
[x] The documentation is up to date with these changes.
[x] The CHANGELOG.md is
up to date with these changes.

Dependencies

/blossom-ci


Service.request no longer returns a promise? (regression 0.27 -> 0.28)

Environment details

OS: macOS 10.14.3
Node.js version: v10.15.0
yarn version: 1.13.0
@google-cloud/common version:  0.28

Steps to reproduce
After updating from @google-cloud/common": "0.27.0" to 0.28, the method request from Service no longer seems to return a promise, instead returning undefined. I noticed that if I pass a callback I get the expected response/error, but before I was able to await or invoke then/catch on the resulting promise, which is of course much more convenient.
babel.config.js  node_modules/    services/
vieira@giant ~/C/platform> vim index.js

const x = this.(...).request({
  method: 'PUT',
  uri: `subscriptions/${this.name}`,
  body: {
    topic: `projects/${projectId}/topics/${topic}`,
    ackDeadlineSeconds: this.ackDeadlineSeconds,
  },
  json: true,
});

// x used to be a Promise and now is undefined

Thanks!

Hello @JustinBeckwith,
While I understand that, the change to ensure backwards compat with previous versions of the library broke backwards compat with previous versions of the library (with 0.27 and multiple others) and I can't see any advantages of having a callback based API instead of a Promise based one.
I understand that you have multiple stakeholders inside Google and their requests have a higher priority than the rest of the community, however this is a public package published by Google, one should at least be able to upgrade between minor versions without (too much) fear.
I am using this library because there is no Google provided library for the REST interface of Google Cloud Pub/Sub and I cannot use grpc because it depends on a binary.


Remove challenges from URL slug

We can shorten the URL slug by removing the word "challenges." This will make URLs easier to read and will improve our SEO

Favouring the second instance of this issue for detail

@Bouncey that is a different issue. This involves removing the word "challenges" from our path.

Can I solve this issue?

@tmpvnunes yes. You're welcome to take a crack at it. Do you have Free Code Camp running locally?

Yes, I have a copy on my desktop. I am a newbie on Github at the moment I really want to understand free code camp project and a bit more of GitHub.

@BerkeleyTrue @QuincyLarson Is this even possible without a big refactor of ./server/boot/react.js, amongst others?

@Bouncey it will require a heavy refactor but it will be worth it in terms of simplifying our URL structure.

@QuincyLarson We cannot remove challenges completely. This makes the backend logic incredibly difficult. How does this improve SEO? Is it really a huge benefit that we should add so much complexity to our routes?

@BerkeleyTrue shorter URLs are believed to be better for SEO than longer ones, and less subfolders is better than more subfolders: https://moz.com/blog/15-seo-best-practices-for-structuring-urls

@BerkeleyTrue this isn't a high priority - if you'll note the SEO project is stacked behind shipping react. But it is something we should do eventually.

There's no hard and fast requirement—this is another one where it's important to use your best judgement.

This is definitely something we should NOT do if this is not a hard rule. The amount of overload on the first and second subpath by removing challenges would add a lot of complexity (reduce performance, increase redirects, slow res times) that I don't want to see.
I can see us shorting challenges to something else, but we cannot remove the subpath for a perceived minor benefit.

@BerkeleyTrue @QuincyLarson could we set up routes for each block then get the challenge dashed name only from params?
This would also give us a place for these landing pages you are after @QuincyLarson
So the routes would be setup like:
app.get('/html(/:dashedName)', (req, res) => ...
app.get('/css(/:dashedName)', (req, res) => ...
app.get('/nodejs(/:dashedName)', (req, res) => ...

@BerkeleyTrue with SEO, everything is "perceived" as you said. SEO is a black box. I was thinking something like what @Bouncey just proposed. Either way, as I said, this is not a priority so we can discuss this further after shipping react. This is the top priority right now: https://github.com/FreeCodeCamp/FreeCodeCamp/issues/10901


Lossless optimize assets

I need to be able to reproduce this myself. How are you optimizing these?

Hi Daniel!
I used optipng first for a quick check, then Papa's Best Optimizer, which aggregates several lossless optimization tools. Heads-up: it takes a lot of time to process.

I don't really want to merge opaque changes.

I could do this myself but it's really not important / significant right now and I can't just merge changes to binary files.

I actually agree with that, the part of minimizing binary files in software.
But the opacity would be the same, because one would also need to optimize the XML of the SVG files and would still be hard to read (better than binary, but still).
I know that you could do it, but you did not, because you don't have time. That's why I tried to help.
Maybe I could open an issue in GrapheneOS/PdfViewer so that someone with better vectorial skills than me could replace the bitmaps with vectorials?


ID numbers in arrivals messages

I have noticed that the arrivals custom message generates an ID number randomly both for the common channel and for any department frequency that it is broadcast to.
Example: CMO arrives on station, and is given ID#47 in the common channel, but on the medical channel he has ID#4.

Fixed in version 1.74.1!


Eureka connectionIdleTimeout assignment error!!!

In eureka-client version 1.9.3 or old version,I'm not sure if this problem still exists in the new version. com.net flix. Discovery. Shared. Transport. EurekaClientFactoryBuilder# connectionIdleTimeout field assignment to transform the default 30 s to ms.But in com.net flix. Discovery. Shared. Transport. Jersey# cleanIdle in use, it is to use as the seconds, cause connectionIdleTimeout values be enlarged 1000 times, long connection cannot receive timely detection of destruction.

Hi
try use the lastest version

Hi
try use the lastest version

Hi
I checked the source code of version 1.9.25 . In the Eurekaclientfactorybuilder class, the code has been fixed, and the above problem does not appear.
    public B withClientConfig(EurekaClientConfig clientConfig) {
        withClientAccept(EurekaAccept.fromString(clientConfig.getClientDataAccept()));
        withAllowRedirect(clientConfig.allowRedirects());
        withConnectionTimeout(clientConfig.getEurekaServerConnectTimeoutSeconds() * 1000);
        withReadTimeout(clientConfig.getEurekaServerReadTimeoutSeconds() * 1000);
        withMaxConnectionsPerHost(clientConfig.getEurekaServerTotalConnectionsPerHost());
        withMaxTotalConnections(clientConfig.getEurekaServerTotalConnections());
        withConnectionIdleTimeout(clientConfig.getEurekaConnectionIdleTimeoutSeconds());
        withEncoder(clientConfig.getEncoderName());
        return withDecoder(clientConfig.getDecoderName(), clientConfig.getClientDataAccept());
    }

Any thoughts?

Hi
I checked the source code of version 1.9.25 . In the Eurekaclientfactorybuilder class, the code has been fixed, and the above problem does not appear.
    public B withClientConfig(EurekaClientConfig clientConfig) {
        withClientAccept(EurekaAccept.fromString(clientConfig.getClientDataAccept()));
        withAllowRedirect(clientConfig.allowRedirects());
        withConnectionTimeout(clientConfig.getEurekaServerConnectTimeoutSeconds() * 1000);
        withReadTimeout(clientConfig.getEurekaServerReadTimeoutSeconds() * 1000);
        withMaxConnectionsPerHost(clientConfig.getEurekaServerTotalConnectionsPerHost());
        withMaxTotalConnections(clientConfig.getEurekaServerTotalConnections());
        withConnectionIdleTimeout(clientConfig.getEurekaConnectionIdleTimeoutSeconds());
        withEncoder(clientConfig.getEncoderName());
        return withDecoder(clientConfig.getDecoderName(), clientConfig.getClientDataAccept());
    }

Any thoughts?


copy of chore: Rename more coe_nat/coe_int to natCast/intCast

A copy of #13205: the only difference is that I replaced a refine' by refine in Mathlib.Order.Atoms.Finite.  The reason is that the cache appears to be corrupted and forcing lake to rebuild Mathlib.Order.Atoms.Finite (or possibly a downstream file) makes the PR pass CI.
Authored-by: YaelDillies

maintainer merge
:smile:

Now that #13205 has been merged, this can be closed, right?

Yes, indeed!  Closing it.


Add basic discussion of clients to auth doc.

@jgeewax Here is a little more auth (towards #805 and #830)
To view my and your original PRs (as we go), here are some hosted files:
www.googledrive.com/host/0B8el7dRo8mVOUVlkSEJKN3pQdkk (dhermes)
www.googledrive.com/host/0B8el7dRo8mVOOHE4NzFXSmhHUWs (jgeewax)

@jgeewax If you're lurking around GitHub, this PR is super tiny.

:+1:

I assume that meant LGTM. If not, I'm happy to revert.

Yes LGTM.


feat(#2): delta imports

[ ] I have considered whether this PR needs review, and requested a review if necessary.

Fixes issue #
Notes for reviewers
Reviewers can skip X, but should pay attention to Y.

Current dependencies on/for this PR:

main

PR #14   👈

This stack of pull requests is managed by Graphite.


Devs SBAT know greater availability of hardware ID attestation

Expected Behavior
We want to know the availability of this ID attestation API in our target markets. We can do this through looking into support on devices that are common in our target markets.
Current Behavior
We don't know the availability of this API in our target markets.
Can't even do this step until #165  is working, but then we need to get the ID certificates from a bunch of phones to determine how widely supported it is.

Closing these out-- not exploring hardware attestation for now


Don't know how to parse column type: 1042

When selecting from char(n) column.

And sometimes I get
Error: Unexpected frame: D
    at Connection._simpleQuery (connection.ts:309:15)
    at async Connection.query (connection.ts:530:14)
    at async Client.query (client.ts:24:12)

if I try to select it without casting to test. Hmm.

There should probably be a system to add parsing for unknown column types like in node-postgres.
CITEXT (oid 20180) is also unknown, and throwing an error of this level means this library will be useless for any serious postgres distribution.

@jakajancar @qimingweng sorry for being silent. I'm open to expanding the list of supported types as well as adding way to parse unknown columns.

@bartlomieju all good– Deno 1.0 is exciting stuff. Will be interesting to see where the community goes from here.

Hi there, Any update regarding this issue?

This raise when inserting as well when selecting


Jest tests on msal-angular & msal-browser v3

Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
3.5.0
Wrapper Library
MSAL Angular (@azure/msal-angular)
Wrapper Library Version
3.0.8
Public or Confidential Client?
Public
Description
I upgraded to Angular 15, and with that, I also upgraded @azure/msal-angular & @azure/msal-browser from 2.5.7 & 2.37.0 to 3.0.8 & 3.5.0 respectively. When I encountered the errors, I also tried v3.0.7 & v3.4.0 but same issue, and v3.0.6 & 3.3.0 but encountered the "Importing MsalModule which does not have a ɵmod property" issue I'd previously been stuck with under v2.5.7 & 2.37.0. Post-update, the app & authentication work, which is always a good start, but AppComponent tests now fail.
If I follow the msal-angular-v3-samples/angular-b2c-sample-app example (the closest option to my current implementation), the test fails with the error "TypeError: window.crypto.randomUUID is not a function". I think this is because it's using the actual services and failing when it can't access the browser-based function - this wasn't an issue previously, and isn't accounted for in the noted sample?
If I try mocking the MsalService & MsalBroadcastService, I get the following error instead:
`
TypeError: this.msalBroadcastService.inProgress$.pipe is not a function
  24 |      ngOnInit() {
  25 |              this.msalBroadcastService.inProgress$
> 26 |                      .pipe(filter((status: InteractionStatus) => status === InteractionStatus.None), takeUntil(this._destroying$))
     |                       ^
  27 |                      .subscribe(async () => {
  28 |                              if (!this.authenticated) {
  29 |                                      await this.logIn();

  at AppComponent.pipe [as ngOnInit] (src/app/app.component.ts:26:5)`

And I can't move past this error - I've tried to mock the dependency several ways, but every attempt has failed to resolve the error.
Does anyone have examples of how they've successfully mocked their AppComponent tests using the v3 libraries? Or failing that, a right direction to point me in?
Cheers!
MSAL Configuration
{
auth: {
      clientId: {{ClientId}},
      authority: 'https://' + {{TenantId}} + '.b2clogin.com/' + {{TenantId}} + '.onmicrosoft.com/' + {{Policy}},
      knownAuthorities: [{{TenantId}} + '.b2clogin.com'],
      redirectUri: {{RedirectUri}},
      postLogoutRedirectUri: {{RedirectUri}},
      navigateToLoginRequestUrl: true
    },
    cache: {
      cacheLocation: 'sessionStorage',
      storeAuthStateInCookie: false,
    }
}

Relevant Code Snippets
// jest.doMock('MsalBroadcastService', () => ({
	// 	inProgress$: of({ status: InteractionStatus.None })
	// }))

	const mockMsalBroadcastService = {
		inProgress$: () => {
			return of({ status: InteractionStatus.None });
		}
	};

	// const mockMsalBroadcastService = MockService(MsalBroadcastService, {
	// 	inProgress$: of({ status: InteractionStatus.None })
	//   });

	beforeEach(waitForAsync(() => {
		TestBed.configureTestingModule({
			imports: [
				RouterTestingModule,
				AppModule
			],
			declarations: [
				AppComponent
			],
			providers: [
				MockProvider(MsalService),
				{ provide: MsalBroadcastService, useValue: mockMsalBroadcastService }
				// MockProvider(MsalBroadcastService, { inProgress$: of({ status: InteractionStatus.None }) })
			]
		}).compileComponents();
	}));

Identity Provider
Azure B2C Basic Policy
Source
External (Customer)

Jest uses jsdom to mock the Window object and jsdom does not provide Crypto APIs out of the box. You'll need to add the implementations to the global object. See our config here and the crypto setup script here

@tnorling thank you for your input! I'm not entirely sure if applying the crypto setup script was the sole resolving factor, but I was able to the test to pass.


fix(deps): bump rum-distiller to v1.9.1

Description
Bumps the rum-distiller version to 1.9.1
Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[ ] I have signed the Adobe Open Source CLA.
[ ] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

looks like same changes got merged in https://github.com/adobe/helix-website/pull/687


Add typed entity access and custom-src removal to change log

Codecov Report

Merging #4496 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4496   +/-   ##
=======================================
  Coverage   58.85%   58.85%
=======================================
  Files         897      897
  Lines       29248    29248
  Branches     4220     4220
=======================================
  Hits        17214    17214
  Misses      12034    12034


Draft: jody: fix checkptr segfault

Fix checkptr segfault by disallowing advancing pointer beyond the Go allocation.
Signed-off-by: Yerden Zhumabekov<EMAIL_ADDRESS>

$ benchstat old.txt new.txt
name                                 old time/op    new time/op    delta
Hash64/jody/optimized/strlen=4-4       5.59ns ± 1%    5.68ns ± 4%   +1.63%  (p=0.043 n=9+10)
Hash64/jody/optimized/strlen=11-4      7.71ns ± 3%    6.91ns ± 1%  -10.45%  (p=0.000 n=10+10)
Hash64/jody/optimized/strlen=36-4      10.6ns ± 1%    10.5ns ± 1%   -1.07%  (p=0.001 n=10+9)
Hash64/jody/optimized/strlen=1000-4     283ns ± 0%     281ns ± 0%   -0.71%  (p=0.000 n=10+10)

name                                 old speed      new speed      delta
Hash64/jody/optimized/strlen=4-4      716MB/s ± 1%   704MB/s ± 3%   -1.57%  (p=0.043 n=9+10)
Hash64/jody/optimized/strlen=11-4    1.43GB/s ± 3%  1.59GB/s ± 1%  +11.66%  (p=0.000 n=10+10)
Hash64/jody/optimized/strlen=36-4    3.39GB/s ± 1%  3.43GB/s ± 1%   +1.09%  (p=0.002 n=10+9)
Hash64/jody/optimized/strlen=1000-4  3.53GB/s ± 0%  3.55GB/s ± 0%   +0.72%  (p=0.000 n=10+10)


Type checking using single or double question marks

TypeScript Version:  4.0.2 (also tested on 4.1.0-insiders.20200910)
Search Terms: question type checking, double question type checking
Code
function test(param:string) {
}

const a:any = undefined;
test(a ? a : 0);

Expected behavior:
test(a ? a : 0) should return TS2345 error. The same should happen if test(a ?? 0) is used. If you expand this to
if(a) { test(a); } else { test(0); }

then you get the expected behavior and TS2345 is shown
Actual behavior:
No TS2345 error is shown
Playground Link: https://www.typescriptlang.org/play?ts=4.0.2#code/GYVwdgxgLglg9mABFApgZygCgA4EMBOuAtgFwb4xgDmAlIgN6JPNMBQAvq6xAhoriVxgAnogC8icABMUwSiikBubryiIARiTAgi6lPnGIADMtaoMmXIgD8-RCWM1l5rFdtH7-J2fSub77xdLfw1vVhhgSzp6VhYg3G92RBQAGzQUBljmIKNvON9MdUSuViA
Related Issues: not that I know of

The problem is, what is the type of the expression a ? a : 0. That question is evaluated independently of the fact that it's in an argument position. The type of a ? a : 0 is any, not the type any | 0 (this is a degenerate way of writing any, since any encompasses every value including 0).
If we "fixed" this by making test(a ? a : 0) "consistent" with the other form, then we'd just move the inconsistency elsewhere
// v: any
const v = a ? a : 0;
test(v);

in this case string is a sub-type of any, but 0 is not and it still should throw TS2345


Replace header with program description in subcommands

Top level before:
$ foo --help
Foo description

Usage: foo cmd

Available options:
  -h,--help                Show this help text

Available commands:
  cmd

Top level after:
$ foo --help
Foo description

Usage: foo cmd

Available options:
  -h,--help                Show this help text

Available commands:
  cmd                      Cmd description

Subcommand before:
$ foo cmd --help
Cmd description

Usage: foo cmd BLAH

Available options:
  -h,--help                Show this help text
  BLAH                     Blah description

Subcommand after:
$ foo cmd --help
Usage: foo cmd BLAH
  Cmd description

Available options:
  -h,--help                Show this help text
  BLAH                     Blah description

I didn't even realize you could to this.  Nice catch!


Errors when adding mesh instance primitives

Godot version:
current 4.0 master
OS/device including version:
Win10 960M
Issue description:
When adding mesh instance primtives the console is spammed with errors
Steps to reproduce:
Add a mesh instance node and change it to a quad or plane and the console continually prints the error:
core/math/basis.cpp:65 - Condition "det == 0" is true.
If the other primitive types are added, then there are multiple reports of:
./servers/rendering/rasterizer.h:221 - Condition "!F" is true. Continuing.

I can't reproduce this on 4.0.rc2. Even setting a PlaneMesh's size to (0, 0) doesn't cause any errors to be printed:


Added scottsvalley.md from CLI

Closes #1341

@averymcguirt could you flip the labels on here to new-email-pr?

@defundsvpd Once this PR is marked closed then the email will be live on the website!

errr, it looks like it's not live yet. @averymcguirt are we just waiting for some CI tests to run or something so a bot pushes this to the gh-pages branch?

OK now it's live!


notsodeep: init at 2019.5.29

Motivation for this change
notsodeep is an active DPI circumvention utility.
Here is the original repository : https://github.com/farukuzun/notsodeep
I wrote a nix expression for notsodeep and it seems it works pretty well.
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

omg I forgot to checkout release branch before make change

omg I forgot to checkout release branch before make change

FYI we don't accept new packages in the release branch.


YCbCr corrections

Summary
To try to correct conversion artifacts of YUV 4:2:0 images used in compressed video.
Info
In both video encoders we use YUV 4:2:0 encoded frames.
YUV is a class of pixel formats used in video applications. YUV colors are represented with one "luminance" component called Y (equivalent to grey scale) and two "chrominance" components, called U (blue projection) and V (red projection) respectively.
YUV can also be referred to as YCbCr, although the terms mean slightly different things.
Planar formats
Planar formats use separate matrices for each of the 3 color components. In other words, there is one table of luminance pixel values, and two separate tables for the chrominance components. This segregated representation in memory of pixels is more convenient for video coding.
YUV 4:2:0 (I420/J420/YV12)
I420 has the luma "luminance" plane Y first, then the U chroma plane and last the V chroma plane.
The two chroma planes (blue and red projections) are sub-sampled in both the horizontal and vertical dimensions by a factor of 2. That is to say, for a 2×2 square of pixels, there are 4 Y samples but only 1 U sample and 1 V sample.
This format requires 4×8+8+8=48 bits per 4 pixels, so its depth is 12 bits per pixel.
I420 is by far the most common format.
A graphical illustration: Each letter represents one bit.
For a single I420 pixel: YYYYYYYY UU VV
For a 50-pixel I420 frame: YYYYYYYY×50 UU×50 VV×50 (or Y×8×50 U×2×50 V×2×50 for short)
For an n-pixel I420 frame: Y×8×n U×2×n V×2×n
J420
J420 is exactly like I420, but with a full range ("digital", 0-255) luma (Y) component instead of limited range ("analog", 16-240). The chroma planes are exactly the same as in I420.
YV12
YV12 is exactly like I420, but the order of the U and V planes is reversed. In the name, "YV" refers to the plane order: Y, then V (then U). "12" refers to the pixel depth: 12-bits per pixel as for I420.
Color ranges
BT.601 studio (TV), full (PC) swing
Prior to the development of fast SIMD floating-point processors, most digital implementations of RGB → Y′UV used integer math, in particular fixed-point approximations. Approximation means that the precision of the used numbers is limited in favor of improved computation speeds.
Y′ values are conventionally shifted and scaled to the range [16, 235] (referred to as studio swing or "TV levels") rather than using the full range of [0, 255] (referred to as full swing or "PC levels"). The value 235 accommodates a maximal black-to-white overshoot of 255 − 235 = 20, or 20 / (235 − 16) = 9.1%, which is slightly larger than the theoretical maximal overshoot (Gibbs phenomenon) of about 8.9% of the maximal step. The toe-room is smaller, allowing only 16 / 219 = 7.3% overshoot, which is less than the theoretical maximal overshoot of 8.9%. This is why 16 is added to Y′ and why the Y′ coefficients in the basic transform sum to 220 instead of 255. U and V values, which may be positive or negative, are summed with 128 to make them always positive, giving a studio range of 16–240 for U and V. (These ranges are important in video editing and production since using the wrong range will result either in an image with "clipped" blacks and whites, or a low-contrast image.)
BT.601 (studio/full) swing. For getting the traditional "studio-swing" 8-bit representation of Y′UV for SDTV/BT.601 the following operations can be used:

Basic transform from 8-bit RGB to 16-bit values (Y′: unsigned, U/V: signed, matrix values got rounded so that the later-on desired Y′ range of [16..235] and U/V range of [16..240] is reached):

Y'  |  66 129  25 | R |
U = | -38 -74 112 | G |
V   | 112 -94 -18 | B |

Scale down (">>8") to 8 bits with rounding ("+128") (Y′: unsigned, U/V: signed):

Yt'= (Y'+ 128) >> 8
Ut = (U + 128) >> 8
Vt = (V + 128) >> 8

Add an offset to the values to eliminate any negative values (all results are 8-bit unsigned):

Yu'= Yt' + 16
Uu = Ut + 128
Vu = Vt + 128

Full swing for BT.601. For getting a "full-swing" 8-bit representation of Y′UV for SDTV/BT.601 can be used with the same steps except for use of different weights on the first step.

Our implementation uses studio swing integer math without SIMD. Generally speaking, full swing has the advantage of more picture information with less color banding or quantization errors but in our case, it's easier to stick with the studio range because VP8 codec doesn't support the full range (VP9 does) and we would have to implement both algorithms with some conditional switch on each codec.
It is now accepted that SD content uses the BT.601 colorspace and HD uses BT.709.

The problem

We have YUV artifacts after RGB image conversion. So either YUV 4:2:0 converter is trash by itself or 4:2:0 is not meant for small images.

RGB/YUV (edited) image comparison...

RGB/YUV raw image comparison...

VP8 encoded clip...

Direct RGB/YUV UV (4:4:4/4:2:0) comparison...

Solutions

Since blue and red channels are very crippled it's possible just to upscale original frames by a factor of 2 or more.

Rework the existing YUV-converter in a way that it could interpolate chrominance values more precisely.
In the current algorithm, we calculate a single chroma value for all 2x2 RGB/luma values just based on the first pixel:

XO  X   XO  X

X   X   X   X

This will lead to aliasing and color artifacts, instead, it is better to calculate a new chroma value for the average color between these 4 RGB pixels:
X   X   X   X
  O       O
X   X   X   X

Try to use YUV 422 or 444 if codecs can support them. These formats should have fewer or no chrominance conversion artifacts but will reduce compression effectiveness as well as limit WebRTC client support.

Implementation notes
The first solution can be implemented just by changing one configuration param:
https://github.com/giongto35/cloud-game/blob/90943f0cc4b916ccb959b20b32f755d231b64a24/configs/config.yaml#L64-L66
One disadvantage of this method is that change will scale output images for every emulator which could be heavy on the performance side.
The second one is implemented in the new PR. Added optimized multithreaded YUV converter with 2x2 chroma color estimation.
Try sqrt -- slow.
The third solution seems to be hard to implement for both encoders because of difficulties in support of these image compression types.
Literature
001 / VideoLan Wiki (site)
002 / Wikipedia YCbCr (site)
Tools used
001 / yuvtoolkit (site)
002 / rawpixels.net (site)
Originally posted by @sergystepanov in https://github.com/giongto35/cloud-game/issues/285#issuecomment-784655254

You always come with a very detailed explanation, not only to talk about the problem, but also a learning material. I learn a lot from it. Thank you very much for valuable knowledge!!!
I think you have solution in mind as well. For small resolution games, anyway will work, so you can pick any way that is comfortable to you. Maybe we can consider the way that has faster (encoding time + packet size).

I looked at the RetroArch source, they just scale the frames for crippled chroma subsampled colorspaces:
https://github.com/libretro/RetroArch/blob/1681872763fa37e7c03c29b66308645dbc1efe0f/record/drivers/record_ffmpeg.c#L512-L516
I didn't explain and show how this happens (: will do it a bit later.
I'm pretty sure that YUV converter from StackOverflow is not quite right. I just wanna try to fix it and properly understand YUV conversion in general.

Um..., @giongto35, how do we actually can iterate chroma better, as for example 4x4 RGBA image:
x x x x
x x x x
x x x x
x x x x

We need average colors from pixels with x,y coordinates: 0:0 1:0 0:1 1:1, next: 2:0 3:0 2:1 3:1, and etc.
Original algo in Go for the first pixel in every 2x2 block is something like this:
width, height := 4, 4
// U size = width*height/4 = 4
// U plane
for y := 0; y < height; y += 2 {
    for x := 0; x < width; x += 2 {
        i := y*width + x
        r := -38 * int32(rgba.Pix[4*i])
        g := -74 * int32(rgba.Pix[4*i+1])
        b := 112 * int32(rgba.Pix[4*i+2])
        yuv.data[dst_u] = byte((r+g+b)>>8) + 128
        dst_u++
     }
}

what is the better approach you are thinking of? better in term of code simplification or better in term of time complexity? I see no problem with x:y -> (x+1:y x:y+1 x+1:y+1) and average

Here is the full code of the original ported to Go:
        width, height := yuv.w, yuv.h
	dst_y := 0
	dst_u := width * height
	dst_v := width*height + (width * height / 4)

	// Y plane
	for y := 0; y < height; y++ {
		for x := 0; x < width; x++ {
			i := y*width + x
			r := 66 * int32(rgba.Pix[4*i])
			g := 129 * int32(rgba.Pix[4*i+1])
			b := 25 * int32(rgba.Pix[4*i+2])
			yuv.data[dst_y] = byte((r+g+b)>>8) + 16
			dst_y++
		}
	}

	// U plane
	for y := 0; y < height; y += 2 {
		for x := 0; x < width; x += 2 {
			i := y*width + x
			r := -38 * int32(rgba.Pix[4*i])
			g := -74 * int32(rgba.Pix[4*i+1])
			b := 112 * int32(rgba.Pix[4*i+2])
			yuv.data[dst_u] = byte((r+g+b)>>8) + 128
			dst_u++
		}
	}

	// V plane
	for y := 0; y < height; y += 2 {
		for x := 0; x < width; x += 2 {
			i := y*width + x
			r := 112 * int32(rgba.Pix[4*i])
			g := -94 * int32(rgba.Pix[4*i+1])
			b := -18 * int32(rgba.Pix[4*i+2])
			yuv.data[dst_v] = byte((r+g+b)>>8) + 128
			dst_v++
		}
	}

	return yuv

Maybe you have some thoughts on its optimization, know some cool tricks with matrices?
Only the time complexity matters.
Basically, we should iterate through every single pixel in order to get luma values -- that's the first loop, two others (for some reason were separated) are for chroma where we have to add 4 x/y to an array index conversions and r1+r2+r3+r4/4, b1+b2+b3+b4/4, g1+g2+g3+g4/4 estimation. Can we use the first loop only somehow, maybe? Or is it pointless (:
(There is one optimization not strictly related to this we can skip emulator frame conversion to RGB and convert to YUV right away.)

ah got your point
Yes, using only one loop can help performance even with the same time complexity ( because it's faster to access data that is neighbor to each other) , in the above code, I think something like if (y%2==0 && x % 2==0) calc_chroma() is fine.
The other thing is to avoid allocating new frame each time. keep reuse a single yuv variable. Can keep profiling to see if there is
any new allocation in the loop
One small trick is to use bit manipulation instead of Multiplication (x4 = << 2)
beyond that, I don't know how to make the code faster than O(x*y)

If we even look further, we can try parallel programming, divide the matrix by to 16 rectangles ( 4 x 4 ). Each rectangle will be in charge in one goroutine.

Ah got your point
Yes, using only one loop can help performance even with the same time complexity ( because it's faster to access data that is neighbor to each other) , in the above code, I think something like if (y%2==0 && x % 2==0) calc_chroma() is fine.

They actually discussed that and an unrolled loop was faster.

One small trick is to use bit manipulation instead of Multiplication (x4 = << 2)
Those 2 nanoseconds gains from that come in handy (:

Beyond that, I don't know how to make the code faster than O(x*y) :-?
I think that's the limit.

If we even look further, we can try parallel programming, divide the matrix by to 16 rectangles ( 4 x 4 ). Each rectangle will be in charge in one goroutine.
Actually, I was planning to leave it in C but you have a good point, I'll try it in Go with 2 threads -- one for luma, one for chromas.
4x4 is going to be too much of goroutine overhead, it's more like WxH/(CPU cores)... interesting.

There is a specialized lib libswscale with assembler optimizations that can convert bgr24toyuv420p, maybe try that also...
OK, thanks for your suggestions, I'll try to implement a couple of these and get back with my profiling results (:

Rather strange results with average chromas. It almost fixed shimmering in Mario and completely in Sushi, it's more readable on some backgrounds (1st row -- old):

But it tone downs some colors, like text halo in Xenogears, and original cranks it up (:

Performance comparison (1080p, run 20 times):
name   old time/op    new time/op    delta
Yuv-4    2.84ms ± 4%    4.51ms ± 1%  +58.84%  (p=0.000 n=20+17)

name   old alloc/op   new alloc/op   delta
Yuv-4     101kB ± 1%     157kB ± 2%  +55.71%  (p=0.000 n=19+18)

name   old allocs/op  new allocs/op  delta
Yuv-4     10.6k ± 1%     16.5k ± 2%  +55.73%  (p=0.000 n=19+18)

Tested with simple pthreads: on HD resolutions it's 30% faster with the additional thread for chroma computation, on SD it's 20% slower probably due to thread recreation overhead. With some thread pool (prod/consume) it's possible that it will be fast in both cases but to write your own thread pool isn't that easy.

Ended up with a multithreaded version with Go green threads. Images are sliced by the number of CPUs * 2 and here is the result (:
name           old time/op    new time/op    delta
TopLeft-4        1.39ms ± 1%    0.15ms ± 1%   -88.96%  (p=0.000 n=9+9)
BetweenFour-4    2.66ms ± 2%    0.26ms ± 3%   -90.40%  (p=0.000 n=9+10)

Really nice work on optimization (y). The Go Green Thread you are mentioning is GoRoutine right?
For something like this, I expect we have a thread pool. Im assuming you are using it for your "Go green threads" right? pthread in C is raw Thread, so the creation of it Is costly in terms of creation/space but goroutine is lighter (pseudo thread). If you use thread pool in C in the right way, I think it may be faster than go version: Spawning 4 threads beforehand and each one is dedicated for a region.
Besides, you mentioned that one thread for chroma, one for others. It sounds right, have you tried it? It simplify this region cutting approach.

But it tone downs some colors, like text halo in Xenogear
The average makes the color blur (due to averadown), so I think the result we have makes sense. Top Left Image will be sharper.

Really nice work on optimization (y). The Go Green Thread you are mentioning is GoRoutine right?

Yes, keep forgetting how it is called (:

For something like this, I expect we have a thread pool. Im assuming you are using it for your "Go green threads" right? pthread in C is raw Thread, so the creation of it Is costly in terms of creation/space but goroutine is lighter (pseudo thread). If you use thread pool in C in the right way, I think it may be faster than go version: Spawning 4 threads beforehand and each one is dedicated for a region.

I thought about C thread pool but it's and SIMD a little bit over my head (: at the current knowledge of C. Hard to implement your own and I didn't want to include yet another C lib for that purpose. It works well with goroutines anyway.

Besides, you mentioned that one thread for chroma, one for others. It sounds right, have you tried it? It simplify this region cutting approach.

Initially, I did one goroutine for luma and one for both chromas both loop over all the pixels in the image. And yes, two separate loops work significantly faster than one loop for all. Next, I tried chunk images by two rows divided between some number of goroutines, and that way it was faster like x2-3 times.
I finished my implementation you can actually look at the final code in the PRs. Gonna merge it tommorow.

But it tone downs some colors, like text halo in Xenogear

The average makes the color blur (due to averadown), so I think the result we have makes sense. Top Left Image will be sharper. I think we face the same issue when you did the linear scale : D

Yes, you're right, thanks for the explanation.

@sergystepanov the code looks good, nice abstraction as well.
I commented in the diff, basically we can

spawn goroutine before processing
perfectly async, don't make each goroutine wait for each other, push out the frame when finish
It is not necessary for the diff but I think it can help optimize more. : D

@giongto35, I don't think it will make a noticeable difference since coroutines mapped to OS threads and they say that they are cheap, plus we spawn on each image just 2*cores coroutines. If we go further, I'm afraid, we just overload the CPU. But you have a valid point, I think. As a coding exercise, it'll be cool to do. I have some questions below.

spawn goroutine before processing
It also costs some goroutine creation per frame here same like thread.
What I recommend is to do something like threadpool. You spawn goroutine up most before process any frames, each goroutine will be in charge of a predefined area.
Then for each frame, we just notify each goroutine to process their corresponding area.

For that you will need channels, right?

perfectly async, don't make each goroutine wait for each other, push out the frame when finish
It is not necessary for the diff but I think it can help optimize more. : D

After that, we can go one step further by omitting wg.Wait. We make each area is processed separately in async manner. Once a frame finishes processing, then we push out the frame
For example:
We have a frame 4x4, we spawn 4 goroutines, each one is in charge of 2x2
Game controller get to frame 4th
go routine 1: 2x2 finished 3 frames
go routine 2: 2x2 finished 2 frames
go routine 3: 2x2 finished 1 frames
go routine 4: 2x2 finished 3 frames
Once goroutine 3 finished, => it sends a completed first frame. and so one

I'm not quite following you on this. Could you please explain how we know if some frame is finished? A code snippet even on pseudocode will be helpful, maybe.

in my mind it's like
process1Channel = make(chan *rect, 10)
...
process4Channel = make(chan *rect, 10)

go process(0, 0, 2, 2, process1Channel)
go process(0, 2, 2, 4, process2Channel)
go process(2, 2, 4, 2, process3Channel)
go process(2, 4, 4, 4, process4Channel)
go procedure()

func procedure() {
  for {
    area1 <- process1Channel
    area2 <- process2Channel
    area3 <- process3Channel
    area4 <- process4Channel
    frame = combine(area1, area2, area3, rea4)
   output<-frame
  }
}

Each channel is buffered, each time we poll each channel, if the region for that is ready.
Seems complicated but it's my idea.

Oh, it makes sense. An interesting serialization approach. So it sequential and we will get a block on an empty channel on the receiver side. As a downside for the concurrent approach, I see that we will need to guard our input/output frames pretty carefully.
OK, thanks for explaining this to me, I'm gonna try it sometime.

Yes, Thanks very much for experimenting with different ways of optimization. You have raised many interesting problems and It's nice that we both discuss and learn about it!