Streamlining and minor cleanup of code in the PrettyNaming module

I've made some small changes to the PrettyNaming module to streamline it for performance. Specifically:

Compilation and decompilation of operators is now memoized for custom (non-built-in) operators to improve performance.
The IsInfixOperator function was creating (potentially) multiple lists each time it was called. I've changed the lists to arrays since they're never modified, and I've lifted these arrays outside of the function body so they're only created once and re-used.
Some repetitive if-then-else expressions have been changed to use match instead so they can be compiled into a switch opcode when appropriate.
A few places in the code were unnecessarily using the .Substring(...) operation; they have been changed to use non-allocating comparisons instead (e.g., .StartsWith(...)).
The IsValidPrefixOperatorUse, IsValidPrefixOperatorDefinitionName, and IsPrefixOperator functions would, in certain specific cases, allocate a closure. It doesn't appear that this is actually necessary though -- a small modification to the code eliminates the variable capture that causes the allocation, allowing the lambda to be lifted out of the functions.

I've done some rudimentary benchmarking, and this change appears to have no significant impact (better or worse) when I compile these changes into a new fsc-proto and use that to rebuild the FSharp.Compiler.dll. However, these changes do appear to improve compile times by a small but consistent amount when I use the fsc-proto to compile the various flavors of FSharp.Core. Based on the data produced by --times, these improvements appear to come from reducing the number of Gen0 and Gen1 collections during the [Parse inputs] and [Typecheck] compilation phases.
These modifications should not cause any externally-visible differences in behavior (i.e., from the perspective of callers in other parts of the compiler).

Hi @jack-pappas, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

Do I need to sign the CLA again? I thought I'd already filed this one.

@jack-pappas there was a change of the CLA process a couple of months ago. the new one is much faster/easier to sign and doesn't need employers approval. did you sign this one?

I've taken a close look and it all seems like reasonable cleanup.  But I'd appreciate someone else checking the code closely too.

I've left some comments too.

@jack-pappas, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.
Thanks, MSBOT;

@dsyme I've made some of your requested changes and updated this PR (I'll squash them before the PR is merged).
I wasn't able to make CompileOp and DecompileOp private to the module; when I did that and tried to compile, I got a number of errors:
"C:\visualfsharp\src\fsharp-proto-build.proj" (default target) (1) ->
"C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj" (Build target) (3) ->
(CoreCompile target) ->
  C:\visualfsharp\src\fsharp\ast.fs(1713,23): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ast.fs(1714,19): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ast.fs(1715,46): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ast.fs(1726,37): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(3684,74): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(3689,93): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(3692,95): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(3696,93): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(4611,36): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(4614,118): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\pars.fsy(4617,36): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(837,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(838,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(839,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(840,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(842,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(844,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(845,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(846,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(847,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(848,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(849,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(850,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(851,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TcGlobals.fs(852,110): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TastOps.fs(3024,26): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\NameResolution.fs(200,38): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\NameResolution.fs(202,36): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ConstraintSolver.fs(1172,100): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ConstraintSolver.fs(1174,97): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ConstraintSolver.fs(1183,36): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ConstraintSolver.fs(1228,157): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\ConstraintSolver.fs(1230,154): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(971,20): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(1289,151): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(1290,137): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(1291,124): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(1393,52): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(5741,55): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(7092,27): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(7104,83): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(7126,83): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\TypeChecker.fs(7537,69): error FS0039: The value or constructor 'CompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\CompileOps.fs(720,47): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\CompileOps.fs(722,49): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\CompileOps.fs(724,24): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\CompileOps.fs(733,46): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]
  C:\visualfsharp\src\fsharp\CompileOps.fs(736,42): error FS0039: The value or constructor 'DecompileOpName' is not defined [C:\visualfsharp\src\fsharp\FSharp.Compiler-proto\FSharp.Compiler-proto.fsproj]

    0 Warning(s)
    48 Error(s)

I tried modifying the code to use ConcurrentDictionary<_,_> but ran into a bug in the compiler's type inferencer; I'll open an issue for this, but basically there's no way to call the ConcurrentDictionary<'TKey, 'T>.GetOrAdd('TKey, System.Func<'TKey, 'T>) overload. So, we can either stick with the dictionary + lock (for now, or permanently) or I can implement this in another way using ConcurrentDictionary which will have the downside of being slightly less efficient (when called concurrently for the same key); either way is fine with me, just let me know what you prefer.

@latkin I've removed the named fields and updated the code.

Overall LGTM, just some minor suggestions on improving clarity

@dsyme do you have a style preference for this repo regarding .NET method calls: with/without parens?  e.g. resizeArray.Add x vs resizeArray.Add(x).  This PR favors the former.

@latkin There is no strict preference, but more recent code tends to use the former, so it is ok to move code in that direction.

@latkin I cleaned up the loop in the decompileCustomOpName function per your suggestion.
One other thing I noticed was that there seemed to be more GC's reported in the --times output when I switched that one bit of code to use the for .. in .. do syntax to iterate over the string (as compared to indexing into the string). Not sure why that is, so I've changed the code back for now.
I've squashed the commits so this PR can be merged whenever you're ready.

@jack-pappas Great! Would be interesting to find out what's up with the string loop, but no worries in the meantime. I'll try to get this merged soon.

Looks like you are actively updating this. Let me know when it's done so I can sync locally and re-run tests.

@latkin I'm finished making changes if you're going to fix that one piece of code before merging. Or, I can fix it and update the PR -- just let me know.

Got it, re-running now.  I'll take care of the TryChopPropertyName thing, sorry about that.

Applied to OOB branch


fixes str.slice is not a function

for #555 - something doesn't like like spread operators w function args.

Ah ha. Is that the issue. Thanks.
Could you send this to the SSR branch?

Sure thing! https://github.com/kadirahq/flow-router/pull/564


Clean up code and some minor improvements.

Coverage decreased (-0.2%) to 91.026% when pulling a17c5abc60d5254ef18ed058cae0173cf682857c on ngdinhtoan:master into 923d3ac0a9cdd9ca5ba9e344d053838d8a6415a7 on lazada:master.

Coverage decreased (-0.2%) to 91.026% when pulling db08fa56c53c9dffa194388ebff06c2b6c54055a on ngdinhtoan:master into 923d3ac0a9cdd9ca5ba9e344d053838d8a6415a7 on lazada:master.


Removing all ComputeCpp occurences

This PR remove all reference to ComputeCpp compiler and features related only to it, POWER_VR tuning target and IMGDNN library support.
In removing ComputeCpp support, this patch enables again the exprtest that was disabled for DPC++, now fully functional.

Thank you @Rbiessy , my grep config skipped it. Fixed in 59f37e6


migrations SHOULD NOT be sorted by a file created time

As a developer, I need to have a possibility to inject a custom migration between existing. Also, it's not obvious that the last migration is run somewhere in the middle - this causes a weird bug that migrate:rollback rolls back not the last one but some other migration

Update, this issue is caused by this line
https://github.com/spiral/migrations/blob/master/src/FileRepository.php#L77
When the previous migration has a chunk, which length is bigger than the next migration has, the concatenated key becomes longer and is placed in the end). As a solution - order by filename


Preferences - FileViewSort - popup would be better than text field

Also, code is case sensitive so typing kind rather than Kind doesn't work

this is automatically saved by the fileview dialog when you click on the headers -- probably should just make it not visible in editor.


Incorrect nodes position and inability to auto-arrange

The attached file was created by an old version of LookdevX. The format and content seem ok. it's an example of an issue I run in once in a while.
When opening the file in Graph Editor the nodes are scattered all over the place.
Trying to re-arrange them using Auto Layout result in some of them not being arranged properly or at-all.
Looking at the ones that are initially scattered or not rearranged I can't seem to see a difference or anything wrong compared to others.
After opening the file:

After Auto-Layout:

Only some are correctly re-arranged:

The file: (Ignore the content, this is a debug/WIP file)
Note that this file requires the nodes in PR
pat_herringbone2x6_test01.zip

Xpos/Ypos values in the original file might be high. Not sure what is the right range here.

Hi! @zicher3d thanks for flagging this issue. I'll take a look and try to find the issue. Just glancing at the Xpos/Ypos the initial position is (1200, 0) and so some of the node's position's seem a little large but none of them immediately seemed like an issue.

I'm not sure what the right range for the positions is. The old LookdevX seems to go in the hundreds, while the Graph Editor uses much lower numbers. Bot work fine when loading their own saved files.
The main concern here is the inability to get Auto-Layout to rearrange them.
If the range difference is an issue when exchanging files with other graph editors (like Quiltix, or Houdini), I would suggest adding a scale option, as Auto Layout might not be what is needed in these cases.

If it is doing what I think it's doing LookdevX is probably saving using absolute screen doors. Could be this is messing up the math used to place nodes inside the editor so my guess is to check what's going on there.
Another possibility is as you to perform a remap on load baes on the bounds of the coordinates to try and normalize it.
If this is fractional node size then that info I assume is unknown for an arbitrary file created in an external editor where node size may differ?
Just some noisy thoughts :-).


add searched extensions to errors

as requested in #45

Thanks - I'd have really preferred modifying the previous PR instead of opening a new one tho :-/

would you mind rebasing, and checking the "allow edits" box?

would usually have rebased and force pushed but didn't know there was a way to "allow edits" except by opening a new PR

No worries - there's a checkbox on all PRs you've made, on the right side.

Sadly I ended up having to revert this; it caused #119. I'll re-revert it later in v2.0.0.


#21 bgmi script due date

Codecov Report

Merging #98 into dev will increase coverage by 0.03%.
The diff coverage is 26.08%.

@@            Coverage Diff             @@
##              dev      #98      +/-   ##
==========================================
+ Coverage   61.66%   61.69%   +0.03%
==========================================
  Files          23       23
  Lines        2233     2240       +7
==========================================
+ Hits         1377     1382       +5
- Misses        856      858       +2

Impacted Files
Coverage Δ

bgmi/cli.py
13.52% <0%> (-0.14%)
:arrow_down:

bgmi/website/mikan.py
94.87% <100%> (+0.22%)
:arrow_up:

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 2946618...8037a51. Read the comment docs.


Send string data over the server

Hi! Its a great example to send commands but I need to send more information like strings or byts to decode in the server side.
Can U help me with the modifications on the server side when inputStream is read
inputStream.read
thanks!

I can do this in the server
StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, "UTF-8");
String theString = writer.toString();
System.out.println(theString);

but this is the output
BlueCove version 2.1.1-SNAPSHOT on winsock
04c6093b00001000800000805f9b34fb
waiting for connection...
waiting for connection...
waiting for input
23456789?

finish process

in Android I send "123456789" with this code
public void write(String out) {
   	// Create temporary object
       ConnectedThread r;
       // Synchronize a copy of the ConnectedThread
       synchronized (this) {
           if (mState != STATE_CONNECTED) return;
           r = mConnectedThread;
       }
       // Perform the write unsynchronized
       r.write(out.getBytes());
   }

News!
I comment this line
int command = inputStream.read();
and I get the "full" string
123456789ÿ
I can eliminate the last char but is not the best...

In my android app I have this
mCommandService.write(editText.getText().toString().trim());
editText.getText().clear();
mCommandService.stop();

If I remove the last line, the ÿ disapear. So I guess that is the stop command. Can I remove that or is native?


PL2303 GPIO Control?

http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=230&pcid=41
Prolific has GPIO conrol as part of their Android Driver Solution, Does this support that?  Can it be added?

@Knoxie  Looks interesting but PL2303 lacks of good documentation. I will try to check it out

Thanks. That's why I was hoping I was just missing the gpio support.
On Sun, Oct 28, 2018, 1:28 PM Felipe Herranz<EMAIL_ADDRESS>wrote:

@Knoxie https://github.com/Knoxie Looks interesting but PL2303 lacks of
good documentation. I will try to check it out
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/felHR85/UsbSerial/issues/165#issuecomment-433729493,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABAifLaxyoYNohGxS-ZSlRx0C1S-Jsgwks5upfdpgaJpZM4Wn3jZ
.


experimental_new_converter / error: 'tf.ResizeNearestNeighbor' op is neither a custom op nor a flex op

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): google colab, python 3 runtime
TensorFlow installed from (source or binary): pip3 install tf-nightly
TensorFlow version (or github SHA if from source): '2.1.0-dev20200104'

Command used to run the converter or code if you’re using the Python API
converter = tensorflow.lite.TFLiteConverter.from_keras_model(loaded_model)
converter.optimizations = [tensorflow.lite.Optimize.DEFAULT]
converter.experimental_new_converter=True
tflite_quant_model = converter.convert()
The output from the converter invocation

ConverterError                            Traceback (most recent call last)
 in ()
3 converter.optimizations = [tensorflow.lite.Optimize.DEFAULT]
4 converter.experimental_new_converter=True
----> 5 tflite_quant_model = converter.convert()
2 frames
/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/convert.py in toco_convert_protos(model_flags_str, toco_flags_str, input_data_str, debug_info_str, enable_mlir_converter)
213       stdout = _try_convert_to_unicode(stdout)
214       stderr = _try_convert_to_unicode(stderr)
--> 215       raise ConverterError("See console for info.\n%s\n%s\n" % (stdout, stderr))
216   finally:
217     # Must manually cleanup files.
ConverterError: See console for info.
2020-01-05 08:26:27.512446: W tensorflow/compiler/mlir/lite/python/graphdef_to_tfl_flatbuffer.cc:108] Ignored output_format.
2020-01-05 08:26:27.512515: W tensorflow/compiler/mlir/lite/python/graphdef_to_tfl_flatbuffer.cc:114] Ignored drop_control_dependency.
2020-01-05 08:26:27.711202: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.
loc(callsite("model_1/up_sampling2d_1/resize/ResizeNearestNeighbor"("/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/eager/def_function.py":853:0) at callsite("/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/eager/def_function.py":947:0 at callsite("/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/lite.py":409:0 at callsite("":2:0 at callsite("/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py":2882:0 at callsite("/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py":2822:0 at callsite("/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py":2718:0 at callsite("/usr/local/lib/python3.6/dist-packages/ipykernel/zmqshell.py":533:0 at callsite("/usr/local/lib/python3.6/dist-packages/ipykernel/ipkernel.py":196:0 at "/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py":399:0)))))))))): error: 'tf.ResizeNearestNeighbor' op is neither a custom op nor a flex op
error: failed while converting: 'main'
Ops that can be supported by the flex runtime (enabled via setting the -emit-select-tf-ops flag): ResizeNearestNeighbor.
Traceback (most recent call last):
File "/usr/local/bin/toco_from_protos", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/toco/python/toco_from_protos.py", line 93, in main
app.run(main=execute, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/toco/python/toco_from_protos.py", line 56, in execute
enable_mlir_converter)
Exception: /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/eager/def_function.py:853:9: error: 'tf.ResizeNearestNeighbor' op is neither a custom op nor a flex op
self._initialize(args, kwargs, add_initializers_to=initializers)
^
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/eager/def_function.py:947:5: note: called from
concrete = self._get_concrete_function_garbage_collected(*args, **kwargs)
^
/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/lite.py:409:5: note: called from
concrete_func = func.get_concrete_function()
^
: note: called from
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py:2882:17: note: called from
exec(code_obj, self.user_global_ns, self.user_ns)
^
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py:2822:17: note: called from
if self.run_code(code, result):
^
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py:2718:20: note: called from
interactivity=interactivity, compiler=compiler, result=result)
^
/usr/local/lib/python3.6/dist-packages/ipykernel/zmqshell.py:533:9: note: called from
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
^
/usr/local/lib/python3.6/dist-packages/ipykernel/ipkernel.py:196:13: note: called from
res = shell.run_cell(code, store_history=store_history, silent=silent)
^
/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py:399:41: note: called from
user_expressions, allow_stdin)
^
:0: error: failed while converting: 'main'
Ops that can be supported by the flex runtime (enabled via setting the -emit-select-tf-ops flag): ResizeNearestNeighbor.
Also, please include a link to the saved model or GraphDef
# Put link here or attach to the issue.

Failure details
If the conversion is successful, but the generated model is wrong,
state what is wrong:

Producing wrong results and/or decrease in accuracy
Producing correct results, but the model is slower than expected (model generated from old converter)

the old toco based converter works as expected,
when testing: converter.experimental_new_converter=True
the above error appears
Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

@gogela,
In order to expedite the trouble-shooting process, could you please provide the complete code to reproduce the issue reported here. Thanks!

The full code is below and  attached zip with model json file.
I'm unfortunately unable to share the weights h5 file.
%tensorflow_version 2.x
from tensorflow.keras.models import model_from_json
from tensorflow.keras.models import load_model
json_file = open('model.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
loaded_model = model_from_json(loaded_model_json)
loaded_model.load_weights('model.h5')
converter = tensorflow.lite.TFLiteConverter.from_keras_model(loaded_model)
converter.optimizations = [tensorflow.lite.Optimize.DEFAULT]
converter.experimental_new_converter=True
tflite_quant_model = converter.convert()
model.zip

@gogela Can you please try adding the following line. When I added, I don't see any error. Please check and let us know. Thanks.
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS,
                                       tf.lite.OpsSet.SELECT_TF_OPS]

Here is the gist for your reference. Thanks!
Please close the issue if it was resolved for you. thanks!

I am closing this issue as it was resolved. Please let me know if I am mistaken. thanks!

I'm currently faced with this issue Exception: <unknown>:0: error: loc("Dilation2D"): 'tf.Dilation2D' op is neither a custom op nor a flex op
When will tflite support tf.nn.dilation2d??

Also if I add converter.allow_custom_ops = True it works and exports a tflite file.
However, it crashes in the phone with error:
Caused by: java.lang.IllegalStateException: Internal error: Unexpected failure when preparing tensor allocations: Regular TensorFlow ops are not supported by this interpreter. Make sure you apply/link the Flex delegate before inference.     Node number 0 (FlexIdentity) failed to prepare.

@gigadeplex Can you please open a new issue with a description (as above) and a standalone code to reproduce the issue? Thanks!

@gigadeplex Can you please open a new issue with a description (as above) and a standalone code to reproduce the issue? Thanks!

Hi @jvishnuvardhan , thank you for your reply! I took your advice and just opened an issue regarding tf.Dilation2D and included a link to a saved model which is derived from pytorch through onnx #40420

@gogela Can you please try adding the following line. When I added, I don't see any error. Please check and let us know. Thanks.
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS,
                                       tf.lite.OpsSet.SELECT_TF_OPS]

Here is the gist for your reference. Thanks!
Please close the issue if it was resolved for you. thanks!

Thank you My issue was solved because of you . I was trying for last 10 days

@gogela Can you please try adding the following line. When I added, I don't see any error. Please check and let us know. Thanks.
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS,
                                       tf.lite.OpsSet.SELECT_TF_OPS]

Here is the gist for your reference. Thanks!
Please close the issue if it was resolved for you. thanks!

Thank you so much. You have probably saved my several working hours.

I am closing this issue as it was resolved. Please let me know if I am mistaken. thanks!

Thank you so much. But I don't know why to use that line. And, do you have a tutorial about TF Lite, please tell me.

@tucachmo2202 Please follow the guides here. Thanks!
In the above example, there are two kinds of ops supported (TFLITE_BUILTINS and SELECT_TF_OPS].
TFLITE_BUILTINS : These are the ops builtin specifically for tflite. They are optimized for tflite. But, currently there are limited ops are supported by TFLITE_BUILTINS.
SELECT_TF_OPS : If you are using some op that is not part of  TFLITE_BUILTINS then the conversion code automatically selects Tensorflow Ops. These are not really optimized for TFLite, so it might need consume more memory.
Hope this helps. Thanks!

@tucachmo2202 Please follow the guides here. Thanks!
In the above example, there are two kinds of ops supported (TFLITE_BUILTINS and SELECT_TF_OPS].
TFLITE_BUILTINS : These are the ops builtin specifically for tflite. They are optimized for tflite. But, currently there are limited ops are supported by TFLITE_BUILTINS.
SELECT_TF_OPS : If you are using some op that is not part of TFLITE_BUILTINS then the conversion code automatically selects Tensorflow Ops. These are not really optimized for TFLite, so it might need consume more memory.
Hope this helps. Thanks!

Thanks. I did make sense of TF Lite, but I am getting stuck on Non maximum suppression operation, it is not support for TF Lite and I don't want to use SELECT_TF_OPS option. Do you know how to convert or re-implement the that NMS op, please tell me. Thanks very much!

Hi @tucachmo2202 have you done for implementing NMS without SELECT_TF_OPS? I'm facing the issue too. Let me know if you have the solution. Thanks in advance!


[Fix #5038] Fix false positive for Performance/RegexpMatch cop

Fixes #5038.
This PR fixes a false positive for Performance::RegexpMatch when using MatchData before guard clause.
Perhaps other false positives may be considered, but this PR will first solve the problem reported in the above issue.

Before submitting the PR make sure the following are checked:

[x] Wrote good commit messages.
[x] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[x] Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
[x] The PR relates to only one subject with a clear title
and description in grammatically correct, complete sentences.
[x] Run rake default or rake parallel. It executes all tests and RuboCop for itself, and generates the documentation.

👍


Added required support for viewing of created benes network

Added scripts draw out the solved schematic in a presentable and easy to understand manner.
This completes the final aspect of this basic benes network synthesis problem using 2x2 mux as base structure.

Verified running of schematic support on a linux based OS . Output pdf schematics might be attached later as reference.


Cache keys of existing nodes in HexaryTrieSync to improve performance

released along with #45 via v1.3.4


"Latest Submission" tooltip not shown over date/time

When you hover over a cell of a forms table (on the homepage or in the project overview), then a tooltip will appear over most cells describing what the column shows. One of the columns is the date/time of the latest submission. If you hover over that column, you're supposed to see the text "Latest Submission". However, date/times have their own tooltips to show the date/time in a more precise format that is always absolute, not relative. That means that if you hover over a date/time, you won't see the "Latest Submission" tooltip, only the date/time tooltip. It's only if you hover over the clock icon or the text "(none)" (if there are no submissions) that you see the "Latest Submission" tooltip.
To address this, we will combine these two tooltips. If a date/time is shown, then when you hover over the cell, you will see a single tooltip that includes both the text "Latest Submission" and the absolute date/time.

Tested with Success!

Tested with Success!


Warn before refreshing the page if I've made changes in DevTools

If I make edits in the Elements and Styles pane and refresh the page, I lose all my edits. A prompt somewhere to remind me that I've made edits would be beneficial.
Based on this tweet: https://twitter.com/ckirknielsen/status/1502410499299938313?s=20&t=RjOeCI-W07MtnAEfZ-QNrw

Thanks Stephanie. I'm sure this is a common source of frustration for users of DevTools, and would be good to have some safety net in place, as you suggested.
As an alternative to the prompt idea, how about this: storing edit sessions locally, in a queue, with each stored session being labeled with the date and url of the site. This way devtools wouldn't block page navigation (which could be intentional), but instead offer a way to salvage your previous work.
The queue could have a length of 1 too, meaning that you'd only ever be able to recover the last editing session. But we could also store more sessions, and also store them per url, if we wanted. But best to start simple.
I imagine the editing session would start as soon as the first edit takes place, and ends as soon as: either devtools gets closed, or a navigation event happens (going to another site, or refreshing the page).

I guess for me, it can be hard to keep track of whether I changed something from its authored value in the first place, which is how I interpreted @ststimac's proposal.
For example, I open a page, I nudge the font up, I nudge it back down, I nudge the padding here and there... it can be hard to keep track of whether there's a diff at all. Sometimes I'll think I put everything back the way it was or copy-and-pasted what I needed to, hit refresh, and realize that there must have been one crucial CSS change which is now lost. Whoops.
Regarding blocking navigation, it seems like use cases where you'd be refreshing the page (to capture network activity, etc.) would have little overlap with style editing. If the prompt only occurred when there are changes in Elements or in the Styles subpanel, that might capture the "don't let me lose my changes" use case without interfering with the "I need to refresh the page without being annoyed by a popup" use case?


micro 2.8.0 auth

As per micro v2.8.0, the Auth service is mandatory. Somehow when adding the auth command to the runtime, auth rules can be created, however cannot be retrieved.
There is a minor issue with the noop Auth manager described here
This can be tackled right after https://github.com/owncloud/ocis/pull/287, but it NEEDS to be addressed as soon as possible if we want to use micro api / web to send requests from HTTP clients to GRPC internal services.

fixed with https://github.com/micro/micro/pull/921


Fixed bugs in some instrumented decorator classes regarding the close method

The new InstrumentedExtractorDecorator, InstrumentedForkOperatorDecorator, and InstrumentedDataWriterDecorator classes did not override the close method to close the embedded Extractor, ForkOperator, and DataWriter objects respectively. This pull request fixed the issues.
The pull request also contains some other code refactoring.
Signed-off-by: Yinan Li<EMAIL_ADDRESS>

Updated to address the comments.

LGTM


Convert multi-line strings to the Swift 4 syntax

@aciidb0mb3r Still a WIP, but I'd appreciate some feedback, especially concerning ArgumentParserShellCompletion.swift where I have my doubts

Looks good

@swift-ci please smoke test

@swift-ci please smoke test


[feature] Allow math operations in offset modifier

fix #228, pinging @shmax for review.
New documentation:

The offset modifier can shift your popper on both its axis.
It accepts the following units:

px or unitless, interpreted as pixels
% or %r, percentage relative to the length of the reference element
%p, percentage relative to the length of the popper element
vw, CSS viewport width unit
vh, CSS viewport height unit

For length is intended the main axis relative to the placement of the popper.
This means that if the placement is top or bottom, the length will be the
width. In case of left or right, it will be the height.
You can provide a single value (as Number or String), or a pair of values
as String divided by one (or more) white spaces.
Additionally, it accepts additions and subtractions between different units.
Note that multiplications and divisions aren't supported.
Valid examples are:
10
'10%'
'10 10'
'10% 10'
'10 + 10%'
'10 - 5vh + 3%'
'-10px + 5vh 5px - 6%'

I'll have to look at this in more detail after work, but my first impression is that the syntax for the compound units is a bit loose and your tests for this feature could be a bit more comprehensive.
For example, you have this in your tests: 5 - 25% 10px + 25%. Visually, it's a bit difficult to parse; there are 5 spaces in it, but the third space is meant to be a divider between the axes. It's not too difficult to imagine it getting even more elaborate:
5 - 25% + 5 -10px - 10 + 25%
If you're absolutely sure that your regex can handle it then okay, but I'm wondering if it might be helpful to make the syntax a little tighter. Some examples:
5-25%+5 -10px+25% // allow only one space
5 - 25% + 5, -10px + 25% // require a comma
As for your tests, I would probably think about adding some unit tests (not functional) and really beating on your parsing function. Feed it all kinds of weird scenarios.
And finally a comment on the tests you added in this PR: they seem to have a little too much logic going on. Your expectedPopperLeft value, for instance, is constructed from a fairly elaborate mathematical expression, which means it could have bugs. You should strive to remove any trace of logic from your tests, make them more comprehensive, and easier to read.
Need to get to work, but this is a great start!

About the regex, I'm quite confident it can handle the cases you mentioned (I tried it). I would like to make it simpler using an array or an object with x and y (or a comma separated as you said). But it would break the current API and I don't want to release a new major version for this change.
About adding unit tests you are right, it would make it easier to test the function, I'll add them.

@shmax I added some unit tests and I also deprecated the space separated offset in favor of a comma separated string.
If you use the space as separator it will throw a warning but will still work.

Yee-haw, nice! LGTM

@FezVrasta how can I offset relative to cross-axis?

@FezVrasta I mean this:
For length is intended the main axis relative to the placement of the popper. This means that if the placement is top or bottom, the length will be the width. In case of left or right, it will be the height.
How can I use cross axis, not main axis for this purpose?

I may be wrong but I don't think this is implemented 🤔

Sad! Anyway, I found a workaround - just use get getBoundingClientRect from reference element and put top: ${rect.height / 2}px; to tooltip's css.

I think we could directly get rid of all this stuff and make offset accept a function that provides the rect of popper and reference as arguments... That would be easier and more powerful.
{
  offset: (reference, popper) => [reference.width / 2, popper.height * reference.height]
}

Brilliant idea!


omit empty optional fields in completion struct to make it work with …

…helix editor
Tested on Windows with VSCode, Sublime4, Helix, Notepad++, no problems found so far.

@spytheman

Sorry for the long delay. I was given permissions for maintaining the project today. I'll merge this as soon as the CI pass.

Thanks for the merge and there's no need to apologize, especially since you didn't get permission earlier :-D. To steal your quote, (slightly modified) - was happy to help :-)


ERROR:root:Gate Phase(0.5) unsupported by PHIR

Describe the bug
Converting a circuit containing some conditional Phase operations fails with the following message:
ERROR:root:Gate Phase(0.5) unsupported by PHIR
Traceback (most recent call last):
  File "/home/alec/tmp/env/lib/python3.10/site-packages/pytket/phir/phirgen.py", line 172, in convert_subcmd
    gate = tket_gate_to_phir[op.type]
KeyError: <OpType.Phase: 21>
Traceback (most recent call last):
  File "/home/alec/tmp/dan/test.py", line 8, in <module>
    print(pytket_to_phir(circ))
  File "/home/alec/tmp/env/lib/python3.10/site-packages/pytket/phir/api.py", line 70, in pytket_to_phir
    phir_json = genphir(placed, machine_ops=bool(machine))
  File "/home/alec/tmp/env/lib/python3.10/site-packages/pytket/phir/phirgen.py", line 416, in genphir
    append_cmd(shard.primary_command, ops)
  File "/home/alec/tmp/env/lib/python3.10/site-packages/pytket/phir/phirgen.py", line 301, in append_cmd
    op: JsonDict | None = convert_subcmd(cmd.op, cmd)
  File "/home/alec/tmp/env/lib/python3.10/site-packages/pytket/phir/phirgen.py", line 231, in convert_subcmd
    "true_branch": [convert_subcmd(op.op, cmd)],
  File "/home/alec/tmp/env/lib/python3.10/site-packages/pytket/phir/phirgen.py", line 172, in convert_subcmd
    gate = tket_gate_to_phir[op.type]
KeyError: <OpType.Phase: 21>

To Reproduce
With the JSON file attached:
circ.json
from pytket import Circuit
import json
from pytket.phir.api import pytket_to_phir

with open("circ.json", "r") as fp:
    circ = Circuit.from_dict(json.load(fp))

print(pytket_to_phir(circ))

Reproduced with pytket 1.25.0, pytket-phir 0.4.3.
Expected behavior
The circuit should be converted to PHIR.
Additional context
I tried to make the example smaller, but this proved strangely difficult. For example, after removing just the last conditional Phase operation the conversion succeeded (even though there are others in the circuit). So I'm not sure what's going on.

Hey @qciaran, does PECOS/PHIR support Phase, ie, Global phase? We currently don't have it in the spec table at https://github.com/CQCL/phir/blob/main/spec.md#table-ii---quantum-operations

If Phase truly is a global phase, since global phases are un-physical I would think we would just skip over them/ignore them. Phases of gates only matter if you are doing some sort of conditional unitary.

Yeah, as per https://tket.quantinuum.com/api-docs/optype.html Phase is a global phase. So I would just pass/skip on it unless there is something I am missing.


README

Write a proper README.md
Comment for what you want to see appear in it

Logo
Real name (See #197 )
Long Description
Screenshots
Build instructions
Roadmap

We should mention that we need git clone --recursive


[oneDNN] Update oneDNN library to v3.5

Hi @MichaelHudgins Can you please review this PR? Thank you .


Handle empty name in Github profile

Couple of our users hit this problem and none of them had a name set on their profile.
This will make them aware of it instead of returning an Internal Error.

@dcramer ping, is this ok or should I simplify it?

Totally forgot about this. Will look at it today @iserko. Thanks!


How to change a selected radio's color

Hello,
I'm using this library in my project (Swift) and I don't know how to change to color of a selected radio in runtime.
This is before

After

You can see color of the third radio button (selected) does not change.
This is how I tried to change the color.
func setButtonColor(button: UIButton, color: UIColor){
        button.setTitleColor(color, forState: UIControlState.Disabled)
        button.setTitleColor(color, forState: UIControlState.Normal)
        button.setTitleColor(color, forState: UIControlState.Highlighted)
        button.setTitleColor(color, forState: UIControlState.Selected)
        button.setTitleColor(color, forState: UIControlState.Reserved)
        button.setTitleColor(color, forState: UIControlState.Focused)
        button.setTitleColor(color, forState: UIControlState.Application)
 }

Please help me solve this problem.
Thank you.

You can simply use
button.iconColor = /* the color you want */
button.indicatorColor = /* the color you want */

But, it's a bit strange that setting title color didn't work. Because title color is the default color.

Thanks for your response. It's work!


add static shape support for vision_encoder_decoder generation if dec…

…oder supports static shape.
for ex: nlpconnect/vit-gpt2-image-captioning
What does this PR do?

Fixes # (issue)
Before submitting

[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
[ ] Did you make sure to update the documentation with your changes?
[ ] Did you write any new necessary tests?

@regisss  @libinta please have a review.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

perf
A100
Gaudi2

BF16
142ms
65ms

FP32
137ms
70ms

in image-to-text example:
python3 run_pipeline.py
--model_name_or_path nlpconnect/vit-gpt2-image-captioning
--image_path "https://ankur3107.github.io/assets/images/image-captioning-example.png"
--use_hpu_graphs
--bf16

see if the test case is added correctly. I add pipeline test file. later it could be extended to other pipeline task, like text to speech.


Add code & demo to pause/unpause parents of nested traps

Closes #27
This change adds a _FocusTrapReact object to the React context when a focus trap is used. Subsequent child focus traps look for this object and, if it exists, uses it to pause the parent trap on child mount and unpause the parent when the child unmounts.
I'm not completely sure about how the props should interact with the pausing/unpausing (lines 32-37), I decided to always call pause and only call unpause if pause=false
I tested this change in the setup described in #27 and it works as expected.

Thanks @chandlerprall! I'm pretty busy right now so might not get to this for a few days, but I'll keep in my todo list and try to have a close look soon.

That actually makes me wonder if this is how all focus-traps should behave, whether in React or not. If the activation of trap B ends up pausing trap A, should the deactivation of trap B always end up unpausing trap B?

I think that does make a lot of sense. It would need to keep a queue of pauses, for example:
trap 1 activates
trap 2 activates ([1] is paused)
trap 3 activates ([1, 2] are paused)
couple things could happen

trap 3 deactivates, unpauses most recent in queue (2)
trap 2 deactivates - should this remove from the queue altogether, or should the trap remain in the queue until it is popped off and then check to see if it is active (otherwise a trap that is de- and re-activating jumps around in the queue)?

trap 1 is destroyed & removed from the queue altogether

which I think opens an additional question: if a trap is paused by another trap, does de-activating and re-activating the first trap make it the active trap?

These are all good points, @chandlerprall, and make me second guess whether we should tray to automate this at all — given the complexity, and the danger of edge cases. Within React I guess we have the advantage that when you nest trap 2 in trap 1, you cannot unmount/deactivate trap 1 without also deactivating trap 2. I wonder, then, if we should just move forward with auto-unpausing in the React context and see how it goes?

Ha! Based on

If I recall right, focus-trap itself should already pause any active focus traps when a new once is activated: https://github.com/davidtheclark/focus-trap/blob/6ecf7575401b2050cf2f3935544b82d75155c560/index.js#L101-L105

My original use case should have worked. Turns out active was never set to true on the second (child) instance, so the parent listener wasn't paused to allow focus (and therefore clicks) to shift to the child. Fixing that oversight on my side resolves the original issue, but deactivating the child does not re-activate the original, so I think a basic queue in focus-trap still makes sense.

maintain a queue of traps
when a trap is activated

pause the currently active trap (which is at the end of the queue)
if the activating trap is in the queue, remove it
add the activating trap to the end of the queue

when a trap is paused / destroyed and is at the end of the queue (currently active)

remove from queue
start at end of queue and walk back until a trap is found that should be active, activate that trap (moving it to the end of the queue if needed)

IMO, a consumer managing the active state of multiple, competing traps has a bad UX flow and should more or less result in undefined behaviour. The only valid use case I can think of is a modal taking focus from something else, but even then the original trap shouldn't pause & re-activate, that would be a terrible flow for a user. So I feel the above queue management approach is fine for all situations.

@chandlerprall: (I've been on vacation the past week ...) The last-in-first-out queue idea sounds like a good one. I agree with you that nesting of focus traps is not desirable except in some pretty rare situations. So I wonder if we could add it to focus-trap as a new opt-in option, queueNested of something, with a default value false? Open to a PR!

I hope you had a good vacation!
I feel this shouldn't be behind a flag; I believe the current implementation around listeningFocusTrap in focus-trap is buggy as it doesn't unpause any previous traps.

Ok, @chandlerprall, I think I'd be ok with another major release of focus-trap that introduces this change. However, I do want a flag to turn it off (it could be on by default), in case someone's special situation means they don't want that behavior.

Sounds good, I'll take a shot at that.


Review of 'Structured UV/Vis (meta)data for small molecule characterisation'

Which page are you reviewing?
https://iupac.github.io/WFChemCookbook/samples/uvvis_metadata.html
What is your ORCID
https://orcid.org/0000-0002-0703-7776
Review
This recipe outlines metadata to be included in the reporting of UVVIS spectra and includes a Python script for processing of a spectrum and generation of characteristic metadata.  The recipe is comprehensive in its description and I like the organization of the different metadata levels that helps readers think about the different stages of the process. I particularly like the 'Doc string' text in the function which is both educational about Beer's law and also exemplifies best practice in documenting Python code.
Suggestions:

Add citations to referenced papers/website and bibliography section at the end
Add user information to the metadata table (new section ?) and dates/comments for timing of sample or spectrum collection
Identify what 𝜆max is in the text and move the name of ε from the table to the text (Section 4). Use ε in the table instead of the name and add (see Section 4) in the table.  Not perfect that the symbols are used before being defined but more consistent.
Section 5 might be better titled 'Glossary of Python Terms' and in the definition of 'method' I would add in brackets 'def in beer_lambert code above' (or something similar)

Corrections have been made.
All - please add any further comments. We'll close this issue in due course if there are no further suggestions.

Have the changes been pushed to GitHub?  I am not seeing a commit on this... (hopefully I am not blind...).

All changes have been pushed now

Thanks, Sam. I pushed the changes this morning.


HasValue also needs TemplateId check

Any node without a template has a TemplateId of 0, which means the HasValue check always returns True. I have added a check to see if the TemplateId is also greater than 0 for this scenario.

Thanks @karltynan!
Super frustrating that this is happening as the TemplateId property is a nullable int type (int?) meaning it should probably return null in these cases... I have raised a bug with Umbraco for this.
In the mean time, this PR looks great!


Cloud: Can't scroll if there is an error in the enclave name

What's your CLI version?
N/A
Description & steps to reproduce
If you have an error in the enclave creation, it will throw a kurtosis error, but the error itself if not scrollable, which makes it difficult to debug/understand what caused the issue.

Steps to reproduce:
Create an enclave, call it : A
Create another enclave, also call it: A
It will have an issue due to conflicting name, and then expand the error message, and try to close it/scroll it.
Desired behavior
Being able to scroll or at least close the error message.
What is the severity of this bug?
Painful; this is causing significant friction in my workflow.
What area of the product does this pertain to?
Frontend: the Graphical User Interface, including the Enclave Manager

Repro'd on Chrome:


angular with tsconfig target ES2017 async/await will not work with zone.js

this issue is similar with #715, if we use chrome v8 async/await and compile angular with tsconfig target 'ES2017', then typescript will not generate __awaiter code and use native async/await.
and the following logic will fail
(click) = test();
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
const test = async () => {
      console.log(Zone.current.name) // will output 'angular'
      await delay(100);
      console.log(Zone.current.name) // will output 'root'
    }

unlike typescript  transpiler, native async/await will first yield from test, and then call promise.then
for continuation when await something. So Zone currentFrame will become root.
The sequence of above logic when call await delay(100) will look like

delay function return a ZoneAwarePromise, Zone.current is angular
test function return native Promise which generate from chrome v8 by await, and test() execution is finished.
So Zone.currentZone is transite from angular->root
ZoneAwarePromise which generated from step1 was chained by called by Promise.prototype.then
delay timeout is executed, and ZoneAwarePromise resolved
the chained Promise is resolved , but the Zone.current is root.

Based on the spec,
https://tc39.github.io/ecmascript-asyncawait/#abstract-ops-async-function-await

1. Let asyncContext be the running execution context.
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
3. Let resolveResult be ! Call(promiseCapability.[[Resolve]], undefined, « value »).
4. Let onFulfilled be a new built-in function object as defined in AsyncFunction Awaited Fulfilled.
5. Let onRejected be a new built-in function object as defined in AsyncFunction Awaited Rejected.
6. Set onFulfilled and onRejected's [[AsyncContext]] internal slots to asyncContext.
7. Let throwawayCapability be NewPromiseCapability(%Promise%).
8. Perform ! PerformPromiseThen(promiseCapability.[[Promise]], onFulfilled, onRejected, throwawayCapability).
9. Remove asyncContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
10. Set the code evaluation state of asyncContext such that when evaluation is resumed with a Completion resumptionValue the following steps will be performed:
11. Return resumptionValue.
12. Return.

Step8 is not be executed immediately but in the microTask queue after the current function execution.
I checked Chrome v8 source,
https://chromium.googlesource.com/v8/v8/+/refs/heads/5.5.10/src/js/promise.js
function ResolvePromise(promise, resolution) {
  if (resolution === promise) {
    return RejectPromise(promise,
                         %make_type_error(kPromiseCyclic, resolution),
                         true);
  }
  if (IS_RECEIVER(resolution)) {
    // <IP_ADDRESS>.2 steps 8-12
    try {
      var then = resolution.then;
    } catch (e) {
      return RejectPromise(promise, e, true);
    }
    // Resolution is a native promise and if it's already resolved or
    // rejected, shortcircuit the resolution procedure by directly
    // reusing the value from the promise.
    if (IsPromise(resolution) && then === PromiseThen) {
      var thenableState = GET_PRIVATE(resolution, promiseStateSymbol);
      if (thenableState === kFulfilled) {
        // This goes inside the if-else to save one symbol lookup in
        // the slow path.
        var thenableValue = GET_PRIVATE(resolution, promiseResultSymbol);
        FulfillPromise(promise, kFulfilled, thenableValue,
                       promiseFulfillReactionsSymbol);
        SET_PRIVATE(promise, promiseHasHandlerSymbol, true);
        return;
      } else if (thenableState === kRejected) {
        var thenableValue = GET_PRIVATE(resolution, promiseResultSymbol);
        if (!HAS_DEFINED_PRIVATE(resolution, promiseHasHandlerSymbol)) {
          // Promise has already been rejected, but had no handler.
          // Revoke previously triggered reject event.
          %PromiseRevokeReject(resolution);
        }
        // Don't cause a debug event as this case is forwarding a rejection
        RejectPromise(promise, thenableValue, false);
        SET_PRIVATE(resolution, promiseHasHandlerSymbol, true);
        return;
      }
    }
    if (IS_CALLABLE(then)) {
      // PromiseResolveThenableJob
      var id;
      var name = "PromiseResolveThenableJob";
      var instrumenting = DEBUG_IS_ACTIVE;
      %EnqueueMicrotask(function() {
        if (instrumenting) {
          %DebugAsyncTaskEvent({ type: "willHandle", id: id, name: name });
        }
        // These resolving functions simply forward the exception, so
        // don't create a new debugEvent.
        var callbacks = CreateResolvingFunctions(promise, false);
        try {
          %_Call(then, resolution, callbacks.resolve, callbacks.reject);
        } catch (e) {
          %_Call(callbacks.reject, UNDEFINED, e);
        }
        if (instrumenting) {
          %DebugAsyncTaskEvent({ type: "didHandle", id: id, name: name });
        }
      });
      if (instrumenting) {
        id = ++lastMicrotaskId;
        %DebugAsyncTaskEvent({ type: "enqueue", id: id, name: name });
      }
      return;
    }
  }
  FulfillPromise(promise, kFulfilled, resolution, promiseFulfillReactionsSymbol);
}

ZoneAwarePromise is not treated as native one, so Chrome v8 enqueue a micro task to perform then call. This maybe the reason.
And it seems the logic is totally changed in v8 6.0, so I will try the chromium 6.0 to see what happened.

/FYI @domenic
The short answer is that it is not possible to intercept native promises in the VM. (Native promises is used by async/await) This is a known issue.
We have two approaches to this problem:

Try to standardize on Zone as part of the browser https://github.com/domenic/zones
Add hooks to the browser VM which would allow one to intercept native promises https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk

Out of the two approaches I think second one (setPromiseHook) is more likely.
This effort has been a bit on back-burner, but I will restart the discussions with @domenic.

@mhevery , got it, I will also do some research about the v8 hooks. thank you!

node.js begin to support async_hooks,
https://github.com/nodejs/node-eps/blob/master/006-asynchooks-api.md
https://github.com/nodejs/node/pull/13000
https://github.com/nodejs/node/issues/13139#issuecomment-302945283
so I will try to implement zone.js with async_hooks in node.js, it should have better performance, and can handle native async/await issue in node.js.
@mhevery , do you think this is the correct direction? please review.

Yes that is. I have worked with the people on async hook, and it should
work well with Zone. That means that we should be able to drop the Promise
polyfiil for node.
On Sun, May 21, 2017 at 9:37 AM, JiaLiPassion<EMAIL_ADDRESS>wrote:

node.js begin to support async_hooks,
https://github.com/nodejs/node-eps/blob/master/006-asynchooks-api.md
nodejs/node#13000 https://github.com/nodejs/node/pull/13000
nodejs/node#13139 (comment)
https://github.com/nodejs/node/issues/13139#issuecomment-302945283
so I will try to implement zone.js with async_hooks in node.js, it should
have better performance, and can handle native async/await issue in
node.js.
@mhevery https://github.com/mhevery , do you think this is the correct
direction? please review.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/angular/zone.js/issues/740#issuecomment-302947655,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG1T1cGv4snMB_vUhuz71k5GM8jMwWvks5r8Gg4gaJpZM4M-wuM
.

@mhevery , got it, I will try to use async-hook to implement Zone in node.js and let you review after finish!

@JiaLiPassion - Awesome stuff!
@mhevery - any idea when this could get merged up?

@amcdnl, this is still under development, it will take some time, and I have to wait for nodejs to provide some additional information to finish this one.

Thanks for the update @JiaLiPassion ... I was able to temp work around it by transpiling my code from ES2017 to ES2016 which sucks but is ok for short term.

Has there been any progress on this one? As far as my limited skill of perception can see, this is the main issue that prevents angulars change detection work properly with es2017's async/await.
ES2017 is realy helpfull for debugging as the compiled sourcecode by typescript/angular is not that different to the real source and so sourcemaps work much much better.
Thanks for your time, Tim.

@JiaLiPassion can you say something about the current status?

@enko, @shellmann, this issue is still pending because there is no proper way to patch async/await promise in Javascript world. In nodejs, it is possible to do the patch and I have made some POC to verify it. But in browser, it is still impossible to do that, so we will wait whether zone will pass TC39 proposal or browser can open some PromiseHook like API to us.
So now, sorry this issue can not be resolved, so Angular can not work with ES2017 currently.

@enko, yes, it is, it has been in stage 0 for about two years...

@JiaLiPassion  How about node.js now? Can  we resolve the question with async_hook? has examples? thx!

@royalrover, yes, with async_hooks, this issue can be resolved, I am working on it in this PR #795.

Just want to point out the "obvious" workaround for Node.js, which is to downgrade target to ES2015 😄 . Thanks for your great work!

I get it that with current state of browsers this is not possible to fix by Angular team. However, it's a huge issue going forward with Angular lacking support for not-really-that-recent ES standards. As I get it, Google uses Angular a lot internally, there is some MS involvement as well and I get also that this issue requires "political" actions, not technical ones.
I hope people on Angular team understand how severe problems this little tiny issue #740 is going to cause moving forward, if those "political issues" to push browser support are not taken seriously by some more powerful entities within Google and maybe within MS as well. If those two giants were serious about the issue, it would be already fixed by now.
For now, the obvious workaround for the issue is just sitting on ES2015 target forever with horrendous generated async/await code, lack of optimizations and lack of proper debugging due to that generated code.
If we are just sitting and waiting "Zones for JavaScript" proposal to get anywhere from stage 0 of the TC39 process, after that was presented at the January 2016 TC39 meeting, we can be just waiting forever, without any hope about Angular ever supporting web standards going forward. You don't possess the power, but your bosses, or bosses of your bosses, or bosses of bosses of your bosses do possess the power, so please, push them hard!

I've followed this issue for some years now of curiosity and I think it's time to share my own solution to the problem, implemented in Dexie version 2.0. It has been used for quite a while and works across all browsers keeping the zones between await calls. My first beta was released in October 2016, and the first stable 2.0 release in September 2017. Dexie has ~15k weekly downloads on npm and there are no show-stopping issues related to its zone system.
The reason for having a zone system in Dexie is to keep track of ongoing transactions. First version with the zone system built-in was release in 2014 (but then without support for async/await). This was before I knew about the concept of zones, so I thought it was my own invention at first, and called it PSD (Promise-Specific Data) as it only cares about promise-based async flows. The 2.0 version use something I call zone-echoing. It will enque micro-tasks that will re-enter the zone in coming micro-tasks. It can know when it's time to stop the zone echoing as long as the user sticks to its own Promises. A fallback will stop it by a limit. This works across all modern browsers and does not leak zones (except for MutationObserver subscriptions, whose events will derive the zone from the zone where the subscription was initialized - which wouldn't be a problem in angular/zone.js as it also patches those events).
The technique I use could be used in angular/zone.js but then every promise-returning function in the DOM would have to return a zone's own Promise (maybe it already does?) in order to invoke the zone echoing. There could be performance implications that would need to be considered. Especially as I detect native await calls by defining Promise.prototype.then using a getter instead of a value, and have to echo zones in order to support calls that awaits non-promises.
If interested, the implementation lies in Dexie repo at src/helpers/promise.js.

@dfahlander, thank you for the post, I will definitely read it, and I will contact you if I have any questions.

@dfahlander, thanks for your post again, I have sent you an email, please check it.

@dfahlander, I think I have a basic understanding of your code, I tried the same way, it works in some cases, but not work in the case below.
async function test1() {
  console.log('before', Zone.current.name);
  await asyncFunction();
  console.log('after', Zone.current.name); // here is still not working
}

function test2() {
  test1();
}

Zone.current.fork({name: 'test'}).run(test2);

In this case, test2 itself is not an async function, and inside it, it will call an async function, in this case, zone.js doesn’t know when await of test1 begin, so zone.js can not keep the zone before await.
I think Dexie doesn't handle this too, because https://github.com/dfahlander/Dexie.js/blob/e956de3b74cf3ac5f1ed2fa2b97b53e4fe60a3e1/src/classes/dexie/transaction-helpers.ts#L57 the code here also require scopeFunc is an AsyncFunction, but if the scopeFunc is not async, and inside scopeFunc there is await call, it can't be traced.
Not sure my understanding is correct, please confirm, thanks!

That is true. It might not be the only solution. Maybe it would be better to always do incrementExpectedAwaits() and inspect whether returnValue is NativePromise, and if not, call decrementExpectedAwaits() directly. But I haven't thought it through...

@dfahlander, thanks for the response, in this case,
async function test1() {
  console.log('before', Zone.current.name);
  await asyncFunction();
  console.log('after', Zone.current.name); // here is still not working
}

function test2() {
  test1();
}

Zone.current.fork({name: 'test'}).run(test2);

the return value of function test2 is void, so there is no way to check it is a NativePromise or not.
So we still need some PromiseHook to make all cases work!

True. Unless accompanied with a coding guideline of how to utilize zones together with native async await.

@dfahlander, thanks for the clarification!

Should this ticket have someone assigned on it? Now ES2019 (and ES2018) have been finalized, and Angular 8 is coming with support for producing both legacy (ES5) and modern (ES2015+) Javascript bundles. However, there is not much point of that, if modern ES versions ES2017, ES2018 and ES2019 are not supported anyway in Angular.
Is there any way to overcome this problem either by fixing it somehow or at least being able to use ES2017 or ES2018 target, but somehow use non-native async/await for time being?

Excuse my possibly stupid question, but why can't zone.js override the global Promise constructor to monkey-patch the then and catch methods instead of waiting for the native hooks?

@rvalimaki, this is a very difficult issue to resolve, I am still trying to find out a walk around.
@Eugeny, current zone.js already monkey-patch Promise, but async/await is different, it does not use javascript Promise, it always use Native Promise.

@JiaLiPassion thanks for clarifying

@JiaLiPassion Good to hear that there is still ongoing effort to fix this.
Has Google Angular team (@mhevery et. al) contacted  Google Chrome/Chromium team about the issue to provide some kind of hooks for native promises? To my knowledge Google is using Angular in about 600 projects, and I guess it should be quite high on their priority to keep Angular up with modern web standards.
To my understanding the proposal for implementing Zones in EcmaScript is dead, as it's still in "stage 0" after more than three years: https://github.com/domenic/zones
If we didn't have so large code base already, I would explore about the possibility to use Angular without Zones, though then we would need to call "app.tick()" manually every time after updates which would be really a major PITA for sure.

@rvalimaki.
To summarize.

Zone proposal is not updated for a long time.
We may expect Chrome team release PromiseHook in Javascript like nodejs, but it is a very very long shot.
With Angular Ivy in the future, there will be a non zone mode, and user need to trigger change detection themselves.


Add usaco.guide

I was not aware this site was created.
I suppose we can add this in the USACO item on the list.


send-receive-messages

First draft.

Docs Build status updates of commit 84d04a4:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Duplicate tab id: (csharp, 2).
[Warning] Cannot resolve '~/../botbuilder-dotnet/tests/Teams/52.Teams-echo-bot/Bots/TeamsEchoBot.cs' relative to 'bots/how-to/conversations/send-and-receive-messages.md'.
[Warning] Cannot resolve '~/../botbuilder-dotnet/tests/Teams/52.Teams-echo-bot/Bots/TeamsEchoBot.cs' relative to 'bots/how-to/conversations/send-and-receive-messages.md'.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 2aa7983:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Duplicate tab id: (csharp, 2).

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 6e5ac82:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Duplicate tab id: (csharp, 2).

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit dc88e2f:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 960d0a6:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Duplicate tab id: (csharp, 2).

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 34f9986:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Duplicate tab id: (csharp, 2).

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit a8efc33:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit caf1bd3:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Cannot resolve '~/../botbuilder-dotnet/tests/Teams/Roster/Bots/RosterBot.cs' relative to 'bots/how-to/conversations/send-and-receive-messages.md'.
[Warning] Cannot resolve '~/../botbuilder-dotnet/tests/Teams/Roster/Bots/RosterBot.cs' relative to 'bots/how-to/conversations/send-and-receive-messages.md'.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 74c816e:
:warning: Validation status: warnings

File
Status
Preview URL
Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md
:warning:Warning

Details

msteams-platform/bots/how-to/conversations/send-and-receive-messages.md

[Warning] Cannot resolve 'https://github.com/microsoft/botbuilder-dotnet/blob/master/tests/Teams/Roster/Bots/RosterBot.cs' relative to 'bots/how-to/conversations/send-and-receive-messages.md'.
[Warning] Cannot resolve 'https://github.com/microsoft/botbuilder-dotnet/blob/master/tests/Teams/Roster/Bots/RosterBot.cs' relative to 'bots/how-to/conversations/send-and-receive-messages.md'.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@mmiele Going to go ahead and merge this because it is a draft, but please see the comment about links to other doc repos and update in the next PR.


ESP32-S2 Projects cannot use pin numbers higher than 39 when configuring through menuconfig

The ESP32-S2 has more available GPIOs than the ESP32, but menuconfig only allows assigning pins 0-39.
It remains clear that no testing or consideration of the -S2 chip has been given.
Again I must stress the need to publicly document that the -S2 chip is currently unsupported

I've pushed a couple of commits that should allow you to select pins from 0 to 43 in the fix/esp32-s2-gpios

Can you test it? You can do it by fetching the lvgl_esp32_drivers repo and then `git checkout --track origin/fix/esp32-s2-gpios'

Works perfectly tested as both ESP32 and ESP32-S2 to see the pin ranges were appropriate for each, and looked at each pin assignments.  All good.  Ship It! ;)

All good. Ship It! ;)

Told you this issue was the easiest one.


Improve window resizing on Windows

...Or at least make window border non-resizeable (for example, if root width & height properties set in css)

make window border non-resizeable

You can try to set min size and max size, like this:
root {
  min-width: 900px;
  max-width: 900px;
  min-height: 600px;
  max-height: 600px;
}

This seems like a solution, but there are problems:

Cursor still will became double-arrow at the border
Window maximize button will not be disabled
Clicking maximize button will move window to the random location on the screen

What do you think of the following solution?

If min-width == max-width, then disable window width adjustment, and the height is also.
If root has  maximum size limit, then disable the window maximize button.

Completely agree

For the problem in your screenshot, LCUI dose not re-render content when resizing window, I found a solution:
https://www.gamedev.net/forums/topic/651599-rendering-freezing-when-dragresize-window/

Done.


Rework pachctl deploy ide for 2.0

Update pachctl deploy ide to use the identity server over OIDC for 2.0.
Using OIDC presents a lot of complications, because we need to know:

the URL for the identity server (from the user's laptop)
the URL for the identity server (from the IDE pod)
the URL for the IDE (for the redirect)

I've tried to make this simple for users getting started by having everything go through pachctl port-forward, which makes the URLs predictable from the user's perspective. In a production deployment users will need to customize the public URLs so everyone can access them (or I guess have every port-forward).
We also need to register a new client ID with the appropriate redirect and secret. This is idempotent, so a user can re-run the deploy and we'll reuse the existing client ID unless the redirect has changed. We also register the client ID as a peer of pachd so the IDE can get a token for the pachd audience.
The end result is that users can still run the following to get a working IDE:
pachctl deploy local
pachctl enterprise activate
pachctl auth activate
pachctl idp add-connector <config for some auth connector>
pachctl deploy ide
pachctl port-forward

I've done a release of IDE 2.0.0-alpha1, everything is working testing locally:


fix(shrinkwrap): remove references to nodejitsu

(ノಠ益ಠ)ノ彡┻━┻
📻 ⏰

gonna just merge cause... its a 4 line change lol


Feature/faster equality checking

Equality Checking

Makes the prior equality checking provably O(sort(N))
Adds faster O(N/B) equality checking based on its unique form output by adiar::reduce

Apply

Fix recursion requests to the same node may not be grouped properly. This may decrease the size of the intermediate results.

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@03860ff). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             main      #127   +/-   ##
========================================
  Coverage        ?   88.833%
========================================
  Files           ?        26
  Lines           ?      1782
  Branches        ?         0
========================================
  Hits            ?      1583
  Misses          ?       199
  Partials        ?         0

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 03860ff...a580510. Read the comment docs.


Is there a way to manually use this rather than only when it chooses to offer it? Also how does this relate to https://support.microsoft.com/en-us/office/delay-or-schedule-sending-email-messages-026af69f-c287-490a-a72f-6c65793744ba

[Enter feedback here]

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 46f983da-af4c-d975-445b-77fb8f307848
Version Independent ID: 0cf725f8-0abf-465e-b031-396344f54cb1
Content: Delay delivery in MyAnalytics - Workplace Intelligence
Content Source: WorkplaceAnalytics/MyAnalytics/Use/delay-delivery.md
Product: mya
GitHub Login: @madehmer
Microsoft Alias: v-mideh

Hi hoyty76,
The two features are related only in that they let you delay the delivery of messages – usually, to better align with a recipient’s working hours. MyAnalytics can schedule email delivery that aligns with the working hours of the recipients in their respective time zones.
You can sign up at either of two levels:
•	Turn on inline suggestions to get up to two delay reminders per day.
•	Opt in to Delay delivery to optionally get more than two reminders per day.
Your first question was whether there’s a way to manually use this MyAnalytics inline-suggestions feature. You can directly respond to the inline suggestion by selecting Delay send, but other than that, the answer is no. You can manually delay delivery of mail that you’re about to send, but you do this in Outlook, not in MyAnalytics. And you are right in that these are the steps to use for that: Delay or schedule sending email messages.
Please let me know if this doesn’t address your question,
Thank you,
-- Paul9955

Closing this issue for now. Please let me know if I haven't answered your question.
Thank you, - paul9955

The web version of outlook https://outlook.office.com/ seems to have a totally different delay send which happens on the server rather than client. Does the MyAnalytics Delay send rely on the Outlook Client being open as the the old style delay send?

Hi hoyty76,
Yes, in the old-style delay send (as described in Delay or schedule sending email messages), the delayed message remains in the Outbox folder of Outlook for the scheduled time, so Outlook must be online and connected for this to work.
In the MyAnalytics Delay-delivery feature, we do not have this dependency. The delayed email is kept in the Outlook Sent items folder until the scheduled delivery time, when it's automatically delivered for users.
Let me know if you have any more questions.
-- paul9955


Sharepoint support

Add experimental support for Microsoft's odata variant that is used in Sharepoint
Minimal usage example with NTLM authentication
import requests
from requests_ntlm3 import HttpNtlmAuth
import pyodata
from pyodata.vendor.sharepoint import (
    SPEdmDateTimeTypTraits
)
from pyodata.v2.model import (
    Types,
    Typ
)

Types.overwrite_type(Typ('Edm.DateTime', '1753-01-01T00:00', SPEdmDateTimeTypTraits()))

SERVICE_URL = 'https://example.com'

# Create instance of OData client
session = requests.Session()
session.auth = HttpNtlmAuth("<username>", "<password>")
client = pyodata.Client(SERVICE_URL, session)

Requirements for NTLM authentication
# Patched ntlm-auth that implements md4 because it has been removed from openssl/python
git+https://github.com/Sleipner-Motor-AS/ntlm-auth.git@520c21ac8d939bd6f4e62446dd0c4ac7ae0abf4a
requests-ntlm3

Hi @jenrik,
first of all, good work so far, I can imagine the problem at hand and the work behind this PR.
Basically polish the PR according to https://github.com/SAP/python-pyodata/blob/master/CONTRIBUTING.md#did-you-write-a-patch

Please sign the  CLA, cannot be merged without it.
fix existing linting and failing tests
add new test for the new feature
update the documentation.

question: does the example in PR description need this?
Types.overwrite_type(Typ('Edm.DateTime', '1753-01-01T00:00', SPEdmDateTimeTypTraits()))
Shouldn't that be in the vendor/shaperpoint.py, so it is solved for all users - if this is generic sharepoint problem (if yes, please provide link to some sharepoint specification if possible).
btw do you know if there is any public instance this could be tested upon? or perhaps some dockerized target for integration tests? I have personally never used odata and Sharepoint together.

answer to question 1: adding the type overwrite to vendor/sharepoint.py would be more convenient, but but might be a gotcha. Input on how to activate the Sharepoint related overwrite are welcome.
I will see what I can find in terms of documentation, so for it's based on observations from the SharePoint application I have access to.
answer to question 2: Too my admittedly limited knowledge there is no public SharePoint instance we can use for testing, and SharePoint only run on Windows. There is couple of different version of SharePoint with different quirks, I believe the latest version is available in Microsoft Azure.

Hi @jenrik, will you have time in near future to finish on this PR? At the moment I cannot merge it to mainline, I cannot even sufficiently test it and existing tests are failing.

Nice PR! I would add some facade method overwritting and write extensive documentation with few examples.

sorry, I have abandoned this PR, I'm no longer in need of the functionality so I want have the time to work further on it


Data Science with Python : Automated ML

Description
Welcome to the 'DSWP' Team, good to see you here.
With this issue, the readers will know on how to work on Automated ML.
This issue is created on contributor's request.
To get assigned to this issue, add your serial numbers mentioned in the spreadsheet of "Data Science with Python", the approach one would follow and the choice you prefer (Documentation, Audio, Video). You can go with all three or any number of options you're interested to work on.
If you had referred any resources, add them up in "DS Resources". Similarly, if you had used datasets, include them in "DS Datasets".
Domain: Machine Learning
Mentors Assigned : Aishani Singh | Dhruv Bajaj
Points to Note :
The issues will be assigned on a first come first serve basis, 1 Issue == 1 PR.
"Issue Title" and "PR Title" should be the same. Include issue number along with it.
Changes should be made inside the Datascience_With_Python/ directory & Datascience_With_Python branch.
Follow Contributing Guidelines & Code of Conduct before start Contributing.
This issue is only for 'GWOC' contributors of 'DSWP' domain.
All the best. Enjoy your journey ahead. 😎
Domain
Data Science with Python
Type of Contribution
Audio, Video, Documentation
Code of Conduct

[X] I follow Contributing Guidelines & Code of conduct of this project.

I would like to contribute a Documentation on this issue.
Name - Rica Ghosh
Serial no - 229
Batch - 7
Issue no - #8736
Type - Documentation
Approach - AutoML intro, working, pros-cons & applications

Issue assigned to @RicaGhosh for documentation

Hello @prathimacode-hub - I've been learning ML and coding for the past few months now and I'm looking for a good first issue to which i can contribute to. I'd be glad to help. Let me know if I can contribute in any way. Thank you.

This issue is open only for audio and video contribution. Kindly go through the guidelines and if you are ok to proceed. Let me know so that I can assign it to you. @kumarmohit3194


Array splice inside a cursor

I am trying to manipulate an Immutable(3.6.4) cursor by adding and inserting an entry to a list:
var data = Immutable.fromJS({a: {b: [0, 1, 2]}});
var cursor = Cursor.from(data, ['a', 'b'], function(newData){
    data = newData;
});

cursor = cursor.push(3);
var newList = cursor.splice(1,0,11);
cursor.update(function(x){return newList;});

console.log(data.toJS().a.b); //Result [0, 11, 1, 2, 3]

Why is it that the cursor.splice is not updating the 'data'?
Now, using withMutation, splice does not seem to work. I have added the results next to the log statements.
var data = Immutable.fromJS({a: {b: [0, 1, 2]}});
var cursor = Cursor.from(data, ['a', 'b'], function(newData){
    console.log("Setting Data");
    data = newData;
});

cursor.withMutations(function(c){
    console.log(c.toJS()); //[0, 1, 2]
    c.push(3).toJS();
    console.log(c.toJS()); //[0, 1, 2, 3]
    var newList =  c.splice(1,0,11);
    console.log(newList.toJS()); //[11]
    console.log(c.toJS());//[]
    c.update(function(x){return newList;});
});

What is the right way to achive this?

See #196 for a discussion of this.  I don't follow why splice() is considered non-mutative though.  It operates on the array in-place, whereas slice() makes a copy.

What is the right way to insert into an array using Cursors? Set overwrites the existing elements.

splice() operates similarly to map() and filter() - it cannot be used within a withMutations and also cannot be used to update a cursor.
The right way to insert within an array when using cursors is to refer to the referencing element:
// instead of
parentCursor.get('mylist').splice(...);
// do:
parentCursor.update('mylist', list => list.splice(...));

That same pattern will work for other kinds of map/filter operations as well.


Metadata attributes being dropped

When publishing a cookbook with metadata.rb that includes source_url and issues_url, the attributes are not sent to the Supermarket.
As a result, the "View Source" and "View Issues" links cannot be managed through the metadata of the cookbook.

@sethvargo is it as easy as adding those two attributes to the hash definition?  https://github.com/sethvargo/stove/blob/master/lib/stove/cookbook/metadata.rb#L159-179

Yea - those just didn't exist when I wrote stove. Do you want to open a PR? If not, I can fix it later

PR 71


Consider removing the generics on Loader methods.

Reason for removing would be so that loaders can be used as params (&dyn Loader) and so that they can be stored in Boxes and not have it spew out "not object-safe" errors.

Thank you for your issue! However we already have an issue about this so I'm going to close this a duplicate of https://github.com/XAMPPRocky/fluent-templates/issues/39


The default sleep delegate does not block in the PCL assembly

When using Polly in a PCL, the default value for SystemClock.Sleep does not block. The result is that any retries from RetryAndWait() will be fired in rapid succession.
I'm using the following replacement in my code, and it seems to be working:
SystemClock.Sleep = timespan => new ManualResetEvent(false).WaitOne(timespan);

Justin,
Thanks for the bug report. The issue is that async span => await Task.Delay(span) is not blocking, hence causing the issue you are seeing. I think I'll replace your suggestion of the ManualResetEvent


Imu visualization is missing a scale parameter

I am afraid I don't really know whether this is the right place for filing this bug:
In ROS Indigo's RViz, subscribing to a sensor_msgs/Imu topic (of e.g. the xsens_driver) yields a display of (in my case) /imu/data with a much too large arrow, as described here.
This display should have a scale parameter to reduce the arrow size.

The imu display, and the associated tutorial package, are in this repository:
https://github.com/ros-visualization/visualization_tutorials
I don't have time to add this feature, but if you're interested in extending the tutorial to include a scale option, that'd be great. You could open a pull request against the above repository.
You could also migrate this issue to the issue tracker on that repository, but either way I'm going to close this one for now. Feel free to continue to comment here though.
Thanks!

Ok, I have migrated this to https://github.com/ros-visualization/visualization_tutorials/issues/27.

Ping?


doc: Convert "Using Nixpkgs" to commonmark

I am so glad that I finally can do this. DocBook was a pile of garbage.
Rel: #105243

CC @ryantm

Something strange happend while committing... cleanup incoming.

 I'm giving up.
maybe we should just convert everything from docbook to html and then back to markdown using pandoc and then go from there.