Deserialize Dictionary<string, object> with custom objects

Hello! I have a problem trying to deserialize Dictionary<string, object> where including objects also could be Dictionary<string, object> or custom object.
Method JSON.ToObject<Dictionary<string, object> doesn't deserialize correctly. It's casting any objects in a dictionary to System.Object without checking if it IDictionary. As result, if I use custom Object in dictionary JSON can't deserialize it.
Here is code example:
Dictionary<string,object> dict = new Dictionary<string, object>();

Dictionary<string, object> pos = new Dictionary<string, object>();
pos.Add("lat", 0.123123d);
pos.Add("lon", 0.323123d);

string name = "foo";
int level = 25;

SomeClass[] sc = new SomeClass[2];
sc[0] = new SomeClass(123,"map");
sc[1] = new SomeClass(567,"zone");

dict.Add("pos", pos);
dict.Add("name", name);
dict.Add("level", level);
dict.Add("sc", sc);

string json = JSON.ToJSON(dict);
Dictionary<string, object> d = JSON.ToObject<Dictionary<string, object>>(json);
//d["pos"] type will be System.Object instead of Dictionary.

What is the json string?

string json = JSON.ToJSON(dict);
//gets this:
{"pos":{"lat":0.123123,"lon":0.323123},"name":"foo","level":25,"sc":[{"pos":123,"map":"map"},{"pos":567,"map":"zone"}]}

Well since the json does not have type information, then fastJSON is doing what you told it and giving you objects as values.
Try serializing with the type information i.e. enabling the extensions.

Hmm... Looks like that didn't help me as well:
{"pos":{"lat":0.123123,"lon":0.323123},"name":"foo","level":25,"sc":[{"$type":"SomeClass, Assembly-CSharp, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null","pos":123,"map":"map"},{"$type":"SomeClass, Assembly-CSharp, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null","pos":567,"map":"zone"}]}
Json does have type information, but not for the dictionary. How to solve it?

Solved. My mistake, I didn't notice to check switch off silverlight.


Updated osx_image to xcode8.2

Changes in this pull request

Updated osx_image in Travis to xcode8.2, as in: https://github.com/Instagram/IGListKit/issues/334
Doesn't require tests, as it'll either pass with no changes to the codebase or break CI. 🤷🏽♂

Pull request checklist

[x] All tests pass. Demo project builds and runs.
[x] I added tests, an experiment, or detailed why my change isn't tested.
[x] I have reviewed the contributing guide

Coverage remained the same at 97.955% when pulling 0c0308dd98fd89b2abfc222fe5f4f6dfb9e50f7f on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling b070f7f33827774695a4a2372f9e52b98b9ff6b2 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling e677ae5ba9c61a7bfaa2b0f3e62f796807febb5c on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling 4f17572a102b50495db1e94838ae449aa4a84cf1 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling 26713145c88c467b75bcf0425b401a4a08aca501 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling a6d5d8e94e55130ac09abbe8b5b5693f76993481 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling a1a5fbefdb92664890a793617d15521a8d8f72f3 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling 0622c86796bad533c0cb911b3b14350741a966e1 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage remained the same at 97.955% when pulling d3d546720ad3c544492aa6ae5f512a1eaf3800f0 on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

thanks so much @heshamsalman !
it looks like the ipad simulators are not duplicated.
how about we switch to iPad Air 2 for 10.2? then we won't need this workaround

Coverage increased (+0.01%) to 97.967% when pulling 3b1c6d9ff6d56b4178c3e062cc711c8bcf7cb4dc on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage increased (+0.01%) to 97.967% when pulling 3b1c6d9ff6d56b4178c3e062cc711c8bcf7cb4dc on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

Coverage increased (+0.01%) to 97.967% when pulling 3b1c6d9ff6d56b4178c3e062cc711c8bcf7cb4dc on heshamsalman:chore/update_travis_version into 2957ee5feb5c827d72bb80021fb59e93aa702653 on Instagram:master.

🤠 Just glad to contribute!


Please supply Table 2b in the article file in an editable format.

Assuming this refers to table in Figure 1b.

Easiest was just to put it in Excel.


Extension loses focus on file/folder upload

Describe the Bug
On file/folder upload the extension closes as soon as the focus is shifted to the file picker. This is due to the design of the browser.
Steps to Reproduce
Steps to reproduce the behavior:

Open extension
Click Upload

Expected Behavior
Extension stays in focus and generates QR
Actual Behavior
Extension closes but file picker remains
Additional Details
A good solution to this may be to open a new window to upload file/folder. Something like how the ad blocking extensions work when you open their logs.

Hey @anjannair,
Thanks for noticing. I'll keep this issue open.
I can assign this to you if you're interested.

@akhileshthite yes I'll try my best to fix!

@akhileshthite a fix is ready for the same if you could somehow fast forward with #24 I can open another PR fixing this issue

The initial pop up when you click the extension

The final window

Tested on both FF and Chrome (not tested on Opera, Brave or other Chromium browsers though)

Got it.
Will review soon.


Centering images?

How would I go about centering the images rendered? I've tried both setting alignSelf on images style or to give it margin. None of these seem to be respected though.

Nevermind I figured it out. This is the styling i'm using now
    image: {
        flex: 1,
        justifyContent: 'center',
        width: [width of surrounding container - minus padding/margin],
        height: [desired height/width of the image + vertical padding*2],
        marginVertical: [desired vertical padding]
    }


:pencil: users

Coverage increased (+1.6%) to 20.294% when pulling ffadc7edcf98f221e4c58ded9c5903d1f62de0fb on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+1.6%) to 20.294% when pulling 59bbd18941dfe447ecc7d9aefc1a0000c148cfd5 on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+1.7%) to 20.445% when pulling 5a447aaf0d9da0346664ad940b186b45de5ee6ae on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+2.8%) to 21.488% when pulling ab40ed317626103ba7ff90dd04c1c19e6fe1ce79 on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+3.2%) to 21.971% when pulling dab867801f8e3caacc548f1b0f08fd2e5c1727f3 on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+3.3%) to 22.001% when pulling 8e1a5be47d12a65c38b83e996ef9c7779291b8a7 on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+3.3%) to 22.001% when pulling d7701bcd5c772ae0ab2ea99d774ea4a8102af466 on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+3.3%) to 22.03% when pulling 1900c05c1b728012d2c4f96525198dbe7090438b on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.

Coverage increased (+3.3%) to 22.03% when pulling 163cccdaa7d349589c8dfd75edac5812b6450410 on refactor_users into 53b34ea0e652f5c45a601f881939cd0ada9caf50 on master.


Set a TIME_ZONE setting per tenant

Hi, is there a way to establish the TIME_ZONE setting for each tenant?
According to django documentation I could use USE_TZ=True and then change dynamically the setting, but I would have to worry about naive and aware dates when performing operations.
How do you (everybody here) manage this setting?
Thanks for the project maintenance and help.

I think it makes more sense to handle timezone on a per user basis, since different users can be in different timezones. That in combination with a middleware works.
If you want to do it per tenant, you can create your own middleware, extend your TenantModel by a timezone field and set it in the middleware.
If you start using timezones, I would implement everything with timezone aware dates.

In my case it is very important to be one timezone per tenant, because our app is an ERP like project, so every transaction should use the same time zone independently of users locations, for example if a company has locations with different timezone they manage every transactions with the headquarters timezone.
Already had my tenant model with the timezone field, so I'll check out about creating extra middleware and set it there as you say.
Thanks

Hi @juanefren,
I'm working on the same kind of feature, may I ask what you ended up doing?
Thanks in advance,
Benjamin

Hi @bpipat sorry for the late response (did not realize I had this message), since I only needed 2 timezones I ended using two separate instances of the project "temporary"

Any solution to this? I need to configure timezone per tenant, the timezone must be configured by the user who owns the tenant.

Personal I created a field on the tenant table with the time zone. I use django-timezone-field

@tomturner I have done it in part, add a timezone field in the tenant table. I did not use django-timezone-field. What I need is to save all the tenant models with the timezone.now() but with the tenant's timezone data.

For example all my models have this model
class TimeStampModel(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

class Meta:
    abstract = True

The idea is that if the tenant's timezone is "Europe / Berlin", these models are saved with timezone.now () of "Europe / Berlin".

To whom it may concern, from a research, apparently postgres does not allow to work with multiple time zones in parallel, therefore, I resorted to Middleware. I attach a Middleware to translate UTC to the Customer or Tenant timezone:
class TimezoneMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        tenant = get_current_tenant()
        if not tenant.schema_name == "public":
            if tenant.timezone:
                timezone.activate(pytz.timezone(tenant.timezone))
            else:
                timezone.deactivate()
        return self.get_response(request)

Based on the documentation I got, and the version of Django 3.2, my option was to use the previously mentioned middleware, which translates all the datetimes to the tenant's timezone, the most recommended way is that you have TIME_ZONE = "UTC" and USE_TZ = True in your settings.py file. This will make your DB (in my case use Postgres) all dates has the UTC timezone and when data is displayed to the client, the middleware will translate to the tenant's timezone. As I understand this includes handle Daylight Savings.


[WIP] Add support for auto switch URL.

Closes #60

Codecov Report

Merging #76 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master      #76   +/-   ##
=======================================
  Coverage   92.42%   92.42%
=======================================
  Files           2        2
  Lines          66       66
=======================================
  Hits           61       61
  Misses          5        5

Impacted Files
Coverage Δ

index.js
90.19% <100%> (ø)
: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 777d7db...06103bd. Read the comment docs.

Coverage increased (+1.5%) to 92.424% when pulling 06103bd81e3cff19720f4c0f01259fae465f4bfe on gucong3000:auto_switch_url into 777d7db94f82ec402e7758af1549818c07d55747 on matheuss:master.


AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

I want to know the version of tensorflow, too

yes. please. Many thanks!

TF 1. 1.14/15 has worked on my machine

import tensorflow as tf
tf.version.VERSION
'2.9.1'
AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'
Is there any working (Today's new version era etc.) AI/ML code for predicting the stock market on earth?


Allow fluidlogging with bubble columns

This would also effectively work as a fix for MC-127141.

This is out of scope for Towelette since bubble columns are not their own fluid. Towelette does not add any fluids, but if another mod were to add a bubble column fluid, Towelette would automatically allow fluidlogging with it.
I might revisit this if I look into fluid layer stuff, but that's not a high priority currently.


hooks to before:offline:start when custom.writeEnvVarsOffline is true

It might be desirable to work with the offline plugin by default.
And the qualifiers of this._serverless and this._serverless.service are there only to ensure the existing tests don't break.  I figured it was more clean to include these than to change every existing test.

Hmm, the test runs differently on travis than locally.

Coverage remained the same at 100.0% when pulling 8863cb77b6d1776e2d09a3686730821689dc5828 on hyperbolist:offline into 2046429d4742b46cff25ea37ce726271c2fcd156 on silvermine:master.

@hyperbolist In my opinion the required custom.writeEnvVarsOffline option to add the hook is useless and even confusing. I think the hook should be always present.
It would also be nice if there will be some note in README about the compatibility of this plugin and serverless-offline and the requirement of putting this plugin in plugin list before serverless-offline.

Closing since it's been replaced by #6


Restore result and report output

I vote for @lukesneeringer to write those. :) ;) ;P 👿

appveyor is failing due to some coverage on virtualenv, I'm gonna defer on that for now and wait for #53 to be merged before we tackle that.


feat: add hooks rules

:tada: This PR is included in version 1.11.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


[CUDA] Improve adaptive and global pool schedule

The current GPU adaptive pool schedule doesn't parallelize across H and W dimensions. This is fine for spatially small inputs as in resnet, such as (1, 1024, 7, 7).  But recent architectures such as efficientnet applies adaptive (global) pooling on large inputs. In particular, efficientdet models from the TF2 detection zoo has workloads such as (1, 32, 378, 378). This results in the following sequential kernel and hence efficientdet models run extremely slow when converted to TVM.
extern "C" __global__ void __launch_bounds__(64) tvmgen_default_fused_nn_adaptive_avg_pool2d_kernel0(float* __restrict__ placeholder, float* __restrict__ tensor) {
  float tensor1[1];
  tensor1[(0)] = 0.000000e+00f;
  for (int rv0 = 0; rv0 < 378; ++rv0) {
    for (int rv1 = 0; rv1 < 378; ++rv1) {
      if (((int)threadIdx.y) < 1) {
        tensor1[(0)] = (tensor1[(0)] + placeholder[((((((((int)threadIdx.y) * 4572288) + (((int)blockIdx.x) * 1143072)) + (((int)threadIdx.x) * 142884)) + (rv0 * 378)) + rv1))]);
      }
    }
  }
  if (((int)threadIdx.y) < 1) {
    tensor[((((((int)threadIdx.y) * 32) + (((int)blockIdx.x) * 8)) + ((int)threadIdx.x)))] = (tensor1[(0)] * 6.998684e-06f);
  }
}

I made two modifications to the adaptive pool schedule:

For the common case where the output size is (1, 1) (aka global pooling), adaptive pooling is equivalent to sum(..., axis=[2, 3]), for example. So the existing GPU reduction schedule should be used as is.
For other cases, simply parallelize across all axes. For example, when the output shape is (N, C, pool_x, pool_y), we simply create N * C * pool_x * pool_y parallel work. Each thread would compute reduction over the corresponding input subwindow.

Performance results on CUDA + Geforce MX250 (laptop GPU)
All numbers in milli seconds

Workload
out size
TVM before
TVM after
Torch

(1, 1024, 7, 7)
(1, 1)
0.031
0.029
0.059

(1, 32, 378, 378)
(1, 1)
4.48
0.84
0.66

(1, 32, 378, 378)
(16, 16)
1.31
0.39
1.51

Thanks @masahi @vinx13


Added function that finds cloudy and pixel counts from QA bitmask.

The aim here is to try and find the number of pixels that are assigned as cloud or land in the QA_PIXEL bitmask. We can then uses these counts to find the percentage of ocean pixels that are cloudy under the assumption that the maximum value for the land pixel count will correspond to a clear scene.

After looking a bit more closely at the QA_PIXEL bitmask we saw that there is a water bit, so we can just use this. The same reasoning stands that when this number of pixels with this bit is the largest we have the clearest scene (it will also be at lowest tide).

Upon testing. Using the water pixels in this way means that clear images that are at lowest tide and contain the scan line error are penalised. Images that are completely dominated by cloud can be removed in this way but some caution is needed when trying to remove mildly cloudy scenes but still keep low tide.


Feature/implement formatter

This PR aims to provide formatter feature in falco.
Usage (command)
I added a new fmt subcommand.
## multiple files
falco fmt /path/to/defaut.vcl /path/to/module.vcl ...

## Supports glob pattern
falco fmt /path/to/**/*.vcl

falco outputs formatted result to stdout, but overwrites the input file by providing -w, --write argument.
falco fmt -w /path/to/default.vcl

Configuration
Formatting rules could be customized in format section .falco.yaml configuration file:
...
format:
  [some override configurations here]
...

Implemented formatting rules are described discussion
Now I have tested with huge VCLs that are used for production, it seems fine.
And I put some comments on this PR, please take a look also.

Haven't started looking through the implementation yet but tested this against my production VCL and it produced a lot of problems. They all seem to stem from 4 types of errors in the formatted output.
Input:
sub boolfn BOOL {
  return true;
}

sub vcl_recv {
  if (
    // foo
    req.http.foo == "bar"
    // bar
    && req.http.bar == "baz"
  ) {
    esi;
  } elseif (req.http.foo) {
    esi;
  }
}

Output:
sub boolfn { // <-- 1) return type removed
  return (true); // <-- 2) parens added around boolean literal
}

sub vcl_recv {
  if (// foo req.http.foo == "bar"  // bar && req.http.bar == "baz") { // <-- 3) multi-line conditional with line comments collapsed
    esi;
  } ( (req.http.foo) { // <-- 4) `elseif` replaced with `(`
    esi;
  }
}

These were the issues that produced errors, will look through the output for other non-error causing formatting issues when I have some more time.

Ahm these are some cases that I have not considered, thanks I will look and fix it.

Got a start on looking through the implementation this morning and will take a look at the updates as well when I can.
In the meantime I noticed a few formatting issues that don't cause syntax errors like the previous examples I shared.
Input:
sub unary_prefix_operator {
  if (!req.http.foo) { esi; }
  declare local var.i INTEGER;
  set var.i = -5;
}

director unary_postfix_operator client {
  .quorum = 20 %;
}

sub switch_formatting {
  switch (req.http.foo) {
      case "1":
        esi;
        break;
  default: break; case "2": esi; break;
  }
}

Formatted output:
sub unary_prefix_operator {
  if (! req.http.foo) { <- space inserted between unary prefix operator and operand
    esi;
  }
  declare local var.i INTEGER;
  set var.i = - 5; <- space inserted
}

<- extra newline inserted between declarations, is this indented?
director unary_postfix_operator client {
  .quorum = 20%;  <- in comparison for the postfix operator no space inserted (which is what I would expect)
}

sub switch_formatting {
  switch (req.http.foo) {
    case "1": <- case indented
    esi; <- not indented relative to case statement
      break; <- indented correctly relative to case statement but too far relative to the previous line
    default:
      break;
    case "2":
    esi;
      break;
  }
}

I found a problem in PrefixExpression, I will fix it.
My preference is that case statement should be indented but I will add Indent case labels whether indent or not as you said in Discussion.

While doing some more looking at the results of formatting various real world VCL files I notice comments getting lost in a few places. Given how critical it is for a formatter to not lose anything I started looking in more detail at how comment attachment is currently handled and all the places comments can be placed.
This led to what I wrote up in #299 and the test PR #300.

I hope to have some free time this weekend to get back to reviewing this.

@richardmarshall Could you take a look #302 before? This PR improves comment dealing with more complexity.

This PR could be merged by fixing some comment issues.
I will merge this in a few days so please make another PRs if you find any problems.


Two identical design patterns

Hello @balhoff @cmungall
https://github.com/geneontology/go-ontology/blob/master/src/design_patterns/mf_binding.yaml
and
https://github.com/geneontology/go-ontology/blob/master/src/design_patterns/macromolecular_complex_binding.yaml
have the same LD:
equivalentTo:
text: "'binding' and ('has input' some %s)"

[ ] We should obsolete one of the two (I suggest we obsolete macromolecular_complex_binding.yaml)
[ ] We need a check that prevents this situation

Thanks, Pascale

I think the range on both of these should be more specific, this will
differentiate them
It is OK to have patterns whose members subsume one another, but it can be
nice to have patterns at the same 'level'. Ideally chebi would have a small
molecule class which would provide a nice balance
On Tue, Jan 11, 2022 at 9:38 PM pgaudet @.***> wrote:

Hello @balhoff https://github.com/balhoff @cmungall
https://github.com/cmungall
https://github.com/geneontology/go-ontology/blob/master/src/design_patterns/mf_binding.yaml
and
https://github.com/geneontology/go-ontology/blob/master/src/design_patterns/macromolecular_complex_binding.yaml
have the same LD:
equivalentTo:
text: "'binding' and ('has input' some %s)"

We should obsolete one of the two (I suggest we obsolete
macromolecular_complex_binding.yaml)
We need a check that prevents this situation

Thanks, Pascale
—
Reply to this email directly, view it on GitHub
https://github.com/geneontology/go-ontology/issues/22649, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAMMOI5LZJ4NP54WWZCJ3TUVUHVFANCNFSM5LYCGGPQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID:
@.***>


Failed to install grails 2.3.11

mario@dell:~/.sdkman/tmp$ sdk install grails 2.3.11
Downloading: grails 2.3.11
In progress...
-=O=-                                                                   #         #        #        #
End-of-central-directory signature not found.  Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive.  In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/mario/.sdkman/tmp/grails-2.3.11.zip or
/home/mario/.sdkman/tmp/grails-2.3.11.zip.zip, and cannot find /home/mario/.sdkman/tmp/grails-2.3.11.zip.ZIP, period.
Stop! The archive was corrupt and has been removed! Please try installing again.

Please read our contributing guidelines below 👇


[PadEvents] Don't crash on invalid channel id

Why would a channel be None? Should this be logged somewhere or should someone be notified?

This is standard to do as get_channel can always return None.  I just forgot to add it in before now


Cannot build component using no_std after v0.7.0

After upgrading to cargo-component v0.7.0, I cannot build a component that uses #![no_std] attribute.
The first issue is that panic handler and global allocator is now required to build the core Wasm module. Is this an expected behaviour?
The second issue is memcpy is compiled as Wasm module import rather than Wasm memory.copy.
I made a minimal case for reproducing the issue at https://github.com/greenhat/cargo-component-v0.7-no-std-repr repo. Here is the README where I described the issue copied from there:
Minimal case for reproducing cargo-component v0.7 (rust 1.75) breakage of #![no_std] in components.

After generating the project with cargo component new --lib test-lib when adding #![no_std] to lib.rs, the cargo-component build fails with:

❯ cargo component build --release
   Compiling test-lib v0.1.0 (/Users/dzadorozhnyi/src/cargo-component-v0.7-no-std-repr)
error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait

error: `#[panic_handler]` function required, but not found

error: could not compile `test-lib` (lib) due to 2 previous errors

When adding a global allocator and panic handler, the build fails with:

❯ cargo component build --release
  Generating bindings for test-lib (/Users/dzadorozhnyi/src/cargo-component-v0.7-no-std-repr/src/bindings.rs)
   Compiling wee_alloc v0.4.5
   Compiling cfg-if v0.1.10
   Compiling memory_units v0.4.0
   Compiling test-lib v0.1.0 (/Users/dzadorozhnyi/src/cargo-component-v0.7-no-std-repr)
    Finished release [optimized] target(s) in 1.31s
    Creating component /Users/dzadorozhnyi/src/cargo-component-v0.7-no-std-repr/target/wasm32-wasi/release/test_lib.wasm
error: module requires an import interface named `env`

Which happens because memcpy is expected to be imported from env while before it was compiled to Wasm memory.copy instruction.
See debug.wat (generated with wasm-tools print target/wasm32-wasi/release/test_lib.wasm > debug.wat) for the wat of the generated Wasm module. The import is (import "env" "memcpy" (func $memcpy (;0;) (type 1)))

Hi @greenhat. What version of cargo-component and Rust did this work on before?
I'm not aware of any changes to cargo-component that might have effected no_std codegen.

Hi @peterhuene! Thanks for the quick response! It works on cargo-component v0.6.0. We are using Rust nightly-2023-12-20, but I also tested it on v1.75.0 with the same result.

When using 0.6.0, were you using wit-bindgen::generate! directly or cargo_component_bindings::generate!, as the latter was never made no_std?
Sorry for asking a lot here, but would it be possible to have a repro that works in 0.6.0 as-is? Thanks!

When using 0.6.0, were you using wit-bindgen::generate! directly or cargo_component_bindings::generate!, as the latter was never made no_std?

I'm using the "default" way - cargo_component_bindings::generate!.

Sorry for asking a lot here, but would it be possible to have a repro that works in 0.6.0 as-is? Thanks!

Sure. No problem! Thanks for looking into this! Here is the repo for the minimal no_std example working fine with v0.6 - https://github.com/greenhat/cargo-component-v0.6-no-std-repr

Hi @greenhat.
So what I think was happening here is that cargo_component_bindings was not being built correctly for no_std, so my guess is that it was incidentally linking in the stdlib allocator.
With 0.7.0, the removal of cargo_component_bindings meant that your no_std crate just depended on wit-bindgen, which is intentionally using alloc to be no_std compatible; that is why an allocator / panic handler must now be specified when your component is no_std.
The memcpy import appears to come from the __rust_realloc that is emitted when #[global_allocator] is used; you may need to provide your own implementation to prevent it from being imported:
#[no_mangle]
pub unsafe extern fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8{
    // ...
}

Thank you, Peter, for the quick and detailed response!

So what I think was happening here is that cargo_component_bindings was not being built correctly for no_std, so my guess is that it was incidentally linking in the stdlib allocator.

It makes sense. dlmalloc caught my eye in the compiled wasm binary with v0.6, but I have not investigated it further.


[BUG] Optimizer states are not being stored in the variable_sources.

Describe the bug
This makes loading from a checkpoint and resuming training problematic as new optimizers are initialised each time.
Solution
Add the optimizer states to the variable client in the trainer.

Closing all TF issues as we are depreciating our TF systems.


Plotting Shaft Tapered Elements

I built an example using tapered elements in the shaft ends. And I'd like your opinion about the aesthetics.
The main question here is about the connection between the bearing and the shaft's end. For now, I am positioning (about the vertical axis) according to the mean value of the diameters. Do you agree with it or should it be positioned with the lowest diameter?

I am ok with the solution that you provided.
But these cases make me think if we really should be using a square to represent bearings, or if we should simply use springs/dampers to do that.

I'm trying to draw a spring/damper system. I will plot a figure here when I am done, so we can compare the results.

I believe it is not a big issue for tapered elements, because I can't think of a real rotor in which we have bearing connected to a tapered section of the rotor.
However, I do like the idea of representing the bearing as spring/damper icon better than the current 'square' solution.

Since the shaft tapered element plotting style is ok, I'm opening another Issue (#248) to discuss the bearing plotting style.


TextDoc not easily indexable with InMemory and HNSWLib

Initial Checks

[X] I have read and followed the docs and still think this is a bug

Description
It is not easy to index and search building a basic NN search application on TextDoc or ImageDoc
Example Code
from docarray.documents import TextDoc
from docarray.index.backends.in_memory import InMemoryExactNNIndex
from docarray.index.backends.hnswlib import HnswDocumentIndex
import numpy as np

index = HnswDocumentIndex[TextDoc]() # one or the other
index = InMemoryExactNNIndex[TextDoc]() # one or the other

docs = [TextDoc(text='hey', embedding=np.random.rand(128)) for i in range(200)]
index.index(docs)
index.find_batched(docs[0:10], search_field='embedding')

Python, Pydantic & OS Version
0.35.0

Affected Components

[X] Vector Database / Index
[ ] Representing
[ ] Sending
[ ] storing
[ ] multi modal data type

For HNSW it is notmal, as one needs to know dimensionality in advance


rftools-1.1x-5.92 crash

here is crash report from server. user tried to create world and it crashed on 2 seperate attempts. Any help is greatly appreciated.
https://gist.github.com/ktole1999/3f67cf132f58cf1946f84251a9f6cc5e

It is crashing in Sponge. Please report to them

thanks. reported.


Copy kube config file

Copy kube config file in ./kube/config

Could we have an integration test that checks for this failure please?

Closing this Pr since it might not be needed for now.


[feature] Add AMD GPU support through ROCm

Add CMake flag in CMakeLists.txt refer to llama.cpp
Compile with args:
cmake -B build -DGGML_HIPBLAS=ON -DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ && cmake --build build -j

Tested on Vega 56 and ChatGLM3 work well.
Source code
Need more test to verify?

Excuse me, did you compile under Windows or Linux? I'm failing in windows cmake, is there any result
lld-link: error: could not open 'm.lib': no such file or directory

I built with ROCm in Ubuntu with Docker image rocm/dev-ubuntu-18.04:4.2-complete
According to your description, I believe it is because of the environment path in the CMake file... I hardcoded the library path in the docker image.
Actually I find some problems with my CMake file. It will raise error say during building chatglm.cpp linker cannot find reference of functions in ggml.cpp. I have been confusing about it for few days.

ubuntu22.04，rocm5.7.1，6800xt
CMake Warning:
Manually-specified variables were not used by the project:
GGML_HIPBLAS

ubuntu22.04，rocm5.7.1，6800xt cmake build提示： CMake Warning: Manually-specified variables were not used by the project: GGML_HIPBLAS
llama.cpp可以： -- hip::amdhip64 is SHARED_LIBRARY -- Performing Test HIP_CLANG_SUPPORTS_PARALLEL_JOBS -- Performing Test HIP_CLANG_SUPPORTS_PARALLEL_JOBS - Success -- hip::amdhip64 is SHARED_LIBRARY -- HIP and hipBLAS found AMD LLD 17.0.0 (compatible with GNU linkers) -- CMAKE_SYSTEM_PROCESSOR: x86_64 -- x86 detected -- Configuring done (0.9s) -- Generating done (0.0s) -- Build files have been written to:

Are you using CMakeList.txt from here?

I finally figured out what is wrong with my script in my side...
As the only error I encounter is:
...
/workspace/chatglm.cpp.hip/third_party/ggml/src/ggml-cuda.cu:12:10: fatal error: 'hipblas/hipblas.h' file not found
...

I tested everything I can do with the CMakeList.txt cannot help me out of this.
It end up to be a problem of my docker environment rocm/dev-ubuntu-20.04:4.2-complete the include path in hipblas do not have folder hipblas, i.e. I have to edit ggml-cuda.cu include hipblas using #include <hipblas.h> not #include <hipblas/hipblas.h>

@CellerX I have checked and patched the CMakeList.txt as much as I can. Can you verify if the problem still occur?
CMakeList.txt

thx，i will try again


[Pattern matcher ] add a Non Applicative Condition.

working on it

see this branch
https://github.com/CafeKrem/PTL/tree/3-Pattern-matcher--add-a-Non-Applicative-Condition


Integrate session filtering to all crawler classes

For websites that block a lot, it is very useful to have a mechanism to dynamically filter a pool of working proxies through sessions. The main advantage is speeding up the actor and reduction of errors.
Currently, almost all marketplace devs are putting it into their code but it brings huge boilerplate. The current implementation is not ideal but it works pretty well for what it needs to do. If no one has a better idea, we could implement it and then update when we come up with a better algorithm.
You can find how we do it right now here. For PuppeteerCrawler it requires one dirty hack and for CheerioCrawler it wasn't possible to do without a custom class.
Maybe we could come up with an intelligent way how to integrate add-ons so more advanced stuff doesn't grow the codebase. On the other hand, this feature is now widely used so it might be just part of the main library.
The current solution works that it has some chance to pick a fresh session (consisting of proxy and user agent) and then adds or removes proxies from the pool depending if the requests succeed or not. The more working sessions you have, the lesser the chance to pick a fresh one.

Kudos for coming up with the current solution. Puppeteer Pool might optionally generate sessions by pairing them with browser instances internally instead of hijacking the userAgent header and maintain them based on response status or errors thrown from within the crawler.  I imagine something like this for Puppeteer Pool options:
manageProxySessions: Boolean,
recycleProxySessions: Boolean

My current use case would benefit from the ability to recycle a session from an auto retired browser to the new browser instance replacing it. Thus, the session selection process would not be random which would ensure that any session will only be used by a single browser instance at any time and additional browser instances would create additional sessions. Alternatively, sessions could be flagged when in use.

Yeah, it makes sense to run each session only with 1 parallel, good point.

If you could provide a list of all the required features with a suggestion for the optimal API, we would be able to get this into the SDK much faster. Currently, noone has the time to design this, but if you guys could come up with the design (that takes into account the current state of SDK and its architecture), we could implement it much faster.

Let's see what we can come up with when less busy; wanted to look at it a little deeper in the SDK anyway. As for the current solution, @metalwarrior665 since userAgent is just a string I found this solution using stringified object easier on the eyes and with the benefit of easily passing arbitrary number of keys without changing the RegExp while also avoiding regex altogether:
        launchPuppeteerFunction: async () => {
            const userAgent = Apify.utils.getRandomUserAgent();
            const apifyProxySession = Date.now().toString();

            return Apify.launchPuppeteer({
                useApifyProxy: true,
                apifyProxySession,
                userAgent: JSON.stringify({
                    apifyProxySession,
                    userAgentReplacer: userAgent
                })
            })
        }

    const gotoFunction = async ({request, page, puppeteerPool, autoscaledPool}) => {
        const browserOptions = JSON.parse(await page.browser().userAgent());
        request.userData.apifyProxySession = browserOptions.apifyProxySession;
        await page.setUserAgent(browserOptions.userAgentReplacer);

@cybairfly Yes, this seems to be "good enough". I wasn't completely sure what is the interaction between browser().userAgent() and page.setUserAgent()` but from my testing, I see that page doesn't override the browser one. So this is working fine. Another hack that works is appending a property to the browser object.
launchPuppeteerFunction: async ({}) => {
            const browser = await Apify.launchPuppeteer()
            browser.randomProperty = 'random'
            return browser;
        }

We could have helper function so it is not hacky. It would set or get an arbitrary object on to the browser (ensuring it doesn't interfere)
puppeteerPool.customData(browser)```

This covers the main current usage which is keeping a table with an object for each proxy session (both for Puppeteer and Cheerio). It can have anything that makes it a "user" or any state specific for a browser session. E.g.

{
"0.6766324700902739": {
"name": "0.6766324700902739",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15",
"cookies": [
{}
],
"isLocationBeingSet": false
}
}```
I will think more about possible integration to CheerieCrawler and PuppeteerCrawler (or maybe more generic solution) and paste it here.

Few ideas here:
I think if we ever implement it into the SDK, the API should be the same for all Crawlers.
Prerequisites

It would be handy to have a way to send a proxy URL and a domain and get back how many proxies the user has for this domain (some proxies are marked as blocked for some domains).

The names are just working names from the top of my head

A RequestList-like component that has its own state periodically saved to kv store.

const proxySessionHandler = new Apify.ProxySessionHandler({
    domain: "apify.com",
    proxyUrl<EMAIL_ADDRESS>    sessionFillRate: 5 // number from 0 to 100 in % how fast it will start picking used sessions
})
const proxySessionHandlers = ["apify.com", "google.com"].map((domain) => new Apify.ProxySessionHandler({...}))

or simpler
const proxySessionHandler = new Apify.ProxySessionHandler({
    domains: ["apify.com", "google.com"],
    proxyUrl<EMAIL_ADDRESS>    sessionFillRate: 5 // number from 0 to 100 in % how fast it will start picking used sessions
})

Then just add it like a RequestList and use it in goto or handlePage functions. By default the session would add in and you can retire it.
const crawler = new Apify.CheerioCrawler({
    ...,
    proxySessionHandler,
    handlePageFunction = async ({ request }) => {
        // some catpcha happens
       proxySessionHandler.retire(request) // this is just one possible implementation, it could rather receive it as a parameter
   }
})

PuppeteerPool-like options. Basically, you just set few parameters and it would automatically handle the domains, etc. for you.

const crawler = new Apify.PuppeteerCrawler({
    ...,
    proxySessionOptions: {
         handleProxySessions: true,
         sessionFillRate: 5,
         proxyUrl<EMAIL_ADDRESS>// This could be taken from the proxy settings of the crawler (it would just not work well on dynamically changing proxies but that's fine)
    },
    handlePageFunction: ({ request, page, proxySession }) => {
         proxySession.retire();
    }
})

The main trick is of course to find an implementation that fits well into the current SDK structure.

Great, this is very similar to something I had in mind. What's the purpose of sessionFillRate @metalwarrior665 ?

I have not yet studied how to implement this to the current SDK architecture, I have just a bit of memory how the SDK works inside :) So there may be other approaches that would make more sense.

What's the purpose of sessionFillRate

@mnmkng In the current boilerplate implementation (I have improved it a bit later but the core is the same) you choose the maxSessions param. It is basically how many working sessions you aspire to have. Then if you want to open a session (open browser or any request-promise connection), the session handler needs to decide if it will create a new session or reuse some that worked before. The old logic is that the chance to pick the old one is currentWorkingSessions / maxSessions. So the more working sessions you have, the higher is the change to reuse them. You can fill them until you reach maxSessions, then you just reuse. You may want to set maxSessions lower so you start reusing faster.
For the new implementation, it would be ideal to fetch maxSessions automatically as the number of proxies that proxy config (user & groups) has for the specific domain. Then the logic could be very similar, but to be able to influence how quickly it will start reusing session, you could set sessionFillRate param. I think the equation to chance to reuse session could look something like this:
const willReuseSession = (currentWorkingSessions, maxSessions, sessionFillRate) => {
    return Math.min( (currentWorkingSessions / maxSessions) * sessionFillRate, 1) >= Math.random()
}

Done.


Reported hitting set size different from created set size?

Hi
I tried to run pasha with k=10 per the instructions and I am seeing that the size of the hitting set that is printed to stdout is consistently larger than the number of lines in the output file.
Do you also observe this? Do you know what might be causing it?
Possibilities I can think of are:

A race condition between different threads when setting or evaluating pick[i] in parallel
the if condition on line 292 is evaluating to something different than expected so that the else on line 304 is not run
It could definitely be something else as well since I didn't dive too deeply into the code.

Yes I checked and that is not it. For example for k=10 the decycling set size (reported, and in the file) is 104968, the reported hitting set size for L=20 is 131874 while the size of the set in the file is 111835, for L=30 the reported hitting set size is 57726 while in the file there are 57331 lines. This is consistent for all factors of 10 from 20 to 200 - the reported number is somewhat higher than the size of the set in the file. I am running it with 60 threads, so maybe the high level of parallelization makes it more of an issue than when fewer threads are used,

@ekimb were you able to figure this out? I'm trying to use Pasha for benchmarking and want to know if there are kmers missing in the sets I generated. Thanks!

@ekimb I wrote a test for the hitting sets in the output files. Assuming the toposort and maxlength implementations in Pasha are correct then the output sets are UHSes. This means that it is just the reporting of Pasha that is wrong.
It is worth fixing this if your or others results relied on the reported results, since in some cases the UHSes generated are much smaller than what is reported and the set size is usually a critical metric.


Add solution for Recipe 0013.

This adds a solution for recipe 0013 described in Issue-129.  To do this, I've added the add_item() helper to PlaceholderCanvas class.
One note: the title includes double quotes: # "Load a Preview Image Before the Main Content".  This is defined in the original cookbook_skeleton.  Is it okay to change this so that it's just # Load a Preview Image Before the Main Content?
I noticed this was a problem in recipe 0014 which has already been merged.

Yes fine to remove the speach marks in the title.


First pass at an option to generate response based code with jsExport

This is meant as a first pass. Happy to go back and modify the approach if things don't look good.
This allows us to performantly fetch data on the JS side and then unsafeCast() to our response based generated models, which, in turn, allows us to use the same code to handle JS-based responses that we use to parse non-JS based responses, and obviates the need for apollo-jsei.
The big changes here are:

Put JsExport on all top level declarations and suppress NON_EXPORTABLE_TYPE because it is irrelevant. The important thing is the JsExport tells the compiler to generate the classes with unmangled property names. This allows us to cast directly from dynamic to the class.
Use Array as the list type because JS will parse lists as Array. Arrays are invariant, so we need to add out on arrays of interfaces.
Currently remove accessors when adding JsExport because Companion objects are illegal in exported classes (see TODO below).
Add a new unsafeCastOrCast() convenience method that allows the caller to access interfaces regardless of whether they're calling from JS or non-JS code.
Do not nest Fragment interfaces because nested interfaces are illegal on nested classes.
Use String instead lieu of enums for properties. enums are non-exportable, but we still generate the classes, so (similar to custom scalars) it is up to the caller to create the enum instances as needed.

Notes:

The JsExport only makes sense on response based codegen since it will be in a shape that matches the parsed JSON. I'm not sure of the best way to enforce this -- should we just throw an error if the user did not request responseBased codegen, but set JsExport = true?
Custom adapters do not work with JsExport. We should probably enforce this (similar to above).
Extension functions on generated code break on JS since we are casting a raw JS object and not actually instantiating a class. I'm not sure of a way to warn users about this beyond documenting it.
generateAsInternal = true does not work with JsExport, since the compiler ends up giving the internal modifier precedence, and thus mangling the variable names. Similar to above, we need a check that it is disabled.

TODO:

Currently not generating accessors in jsExports mode. We will need to have another pass that generates top-level extension functions which call through to unsafeCastOrCast().
Update tests
Update documentation

@martinbonnin please hold off on reviewing  if you haven't started already. I'm still seeing some variable mangling on the interfaces and trying to track it down.

Ok, I think this is ready for review. I tried to document all of the gotchas in the main description. I have it working on my fairly complex internal project, and it works for a few test projects as well.

Thanks for all of the comments @martinbonnin! I will address these tonight (PDT). A couple of questions:

Should I add jsExport as a dimension to CodegenTest or is that overkill?
For the options validation (eg making sure not to specify internal) do you think that should live KotlinCodeGen#write or somewhere else? I didn't see any other validation type stuff in there yet.
Thoughts on the best place to document this? Should I add a section to the responseBased page?
Nice catch on as vs as? in unsafeCastOrCast. I can't see a good way to make the behavior match for JS vs non-JS without adding something like an __expectedTypename property to the generated code. If we did that we could write:

actual inline fun <reified T> Any.unsafeCastOrCast(): T? {
  val obj = this.asDynamic()
  return if (obj["__typename"] == obj["__expectedTypename"]) {
    this.unsafeCast<T>()
  } else {
    null
  }
}

That feels like a pretty significant change to the API surface, though, and I'm not sure we'd want to do it here? If you think it looks ok, I can give it a shot.
I will say that for my use-case I'm fine if the behavior is different, so I'm inclined to just leave it with different behavior for now.

Should I add jsExport as a dimension to CodegenTest or is that overkill?

You can add a new folder and set the option just for this folder like for some other options (see here).
I'm fine without apollo-compiler unit tests too if there are integration tests (in the tests composite build)

For the options validation (eg making sure not to specify internal) do you think that should live KotlinCodeGen#write or somewhere else?

You can do so in the Gradle Plugin (here is where operationBased is enforced for Java for an example).

Thoughts on the best place to document this? Should I add a section to the responseBased page?

Would be cool to add a dedicated "Interoperability with JS" in the advanced section explaining the rationale behind the jsExport parameter, how to use it and the different limitations. You can link to responseBased from there (actually the responseBased page has changed in main so you will also save you some conflicts doing a dedicated page.

I can't see a good way to make the behavior match for JS vs non-JS without adding something like an __expectedTypename property to the generated code.

It's even worse than that because a given model might match multiple __typename. For an example, OtherAnimal, can be Turtle, Lion, Snake, etc... so the codegen will need to have this list somewhere.

I will say that for my use-case I'm fine if the behavior is different, so I'm inclined to just leave it with different behavior for now.

👍 works for me. So the contract of unsafeCastOrCast is something like so:
/**
 * Uses `unsafeCast` on JS or a regular `as` cast on other platforms
 */

I addressed everything except the CodegenTest. I could not find a good way to make kotlin-compile-testing use the KMM plugin, and thus assertCompiles bailed with:
Declaration annotated with '@OptionalExpectation' can only be used in common module sources

when it tried to process the JsExport annotation.
I tried a bunch of things (including shifting paths around to include commonMain, but to no avail.
Another notable change is that I removed unsafeCastOrCast from the normal (non-jsExport) generated code. I can't see a reason to put it there. I still think it is nice to include the extension as a convenience, but can also just remove it completely.

Many thanks for all the work on this!

I addressed everything except the CodegenTest. I could not find a good way to make kotlin-compile-testing use the KMM plugin, and thus assertCompiles bailed with [...]

Agreed. Let's leave CodegenTest out of it for now. Do you want to open an issue on kotlin-compile-testing for this ? As more and more projects target multiplatform, it will become more common..

Another notable change is that I removed unsafeCastOrCast from the normal (non-jsExport) generated code. I can't see a reason to put it there.

Agreed 👍

I still think it is nice to include the extension as a convenience, but can also just remove it completely.

Works for me. My main and last question is this one.

I opened a ticket in kotlin-compile-testing here: https://github.com/tschuchortdev/kotlin-compile-testing/issues/377

Also meant to link this to https://github.com/apollographql/apollo-kotlin/issues/4728

For the record, I was waiting for access to netlify to trigger the doc preview but this is taking longer than expected. Merging the PR and I'll do follow up PRs if docs need any more tweaks.
Thanks again @baconz for the awesome work and benchmarks 💙 !


swift 3 conversion

This is a branch of the Swift30 on 0x73/SwiftIconFont but updated to compile with Xcode 8.

Thanks for PR, please resolve conflicts


Get a community started

Once we have some users for this thing, we would need a place to chat and see what people are doing with it.

I think starting a Slack channel is a good idea!

Done! http://apolloslack.meteorapp.com/

Changed URL: http://slack.apollostack.com/


Fix the tooling incompatible issue with NativeAOT

A RVA field within a generic type is not expressible with C#, and the NativeAOT compiler doesn't support such IL at all.
To resolve this issue, we can simply move IIDDataField out of the generic types instead of nesting the data inside of a generic type.
Unblocks the tooling issue to make sure ilc can compile CsWinRT projection assemblies.
After this PR merged, we can finally start investigating what is missing for NativeAOT-compatible.
/cc: @manodasanW @jkotas @MichalStrehovsky

Thanks @hez2010, looks good to me.  Will merge after the CI pipelines are done.


do not fork if no node flags present

This is likely a quick win, but there may be unforeseen consequences.
If we don't detect any flags that must be sent to node, don't spawn a child process; instead, pass the unparsed arguments directly to lib/cli/cli.js for handling by yargs.
This means two things:

Depending on the use-case, there's no extra overhead.  This decreases the time spent running our node-specific tests:
# before
$ nps test.node  143.66s user 33.77s system 100% cpu 2:56.31 total
# after
$ nps test.node  115.04s user 26.46s system 97% cpu 2:25.53 total

Users leveraging debuggers which invoke node --inspect (VSCode does this, likely Webstorm too) can now execute bin/mocha instead of needing to specify bin/_mocha.

It also means that we're a step closer to killing bin/_mocha entirely.  Instead of bin/mocha spawning bin/_mocha, it can actually just spawn itself, since all Node.js flags will be handed off to node and lib/cli/cli.js will be invoked!
(We'll tackle that in another PR though. We need to discuss how to remove/deprecate bin/_mocha.)

Coverage remained the same at 91.629% when pulling 96efa24b22745ee94eaf6ed6a659f3c9c69947c0 on boneskull/experimental/no-node-no-spawn into a3089ad7215306bc7fb6db5043f404d6cfbb20bf on master.

Users leveraging debuggers which invoke node --inspect (VSCode does this, likely Webstorm too) can now execute bin/mocha instead of needing to specify bin/_mocha.

But you already know this is not the case with WebStorm per the issue with multiple --timeout values...

After years of telling people to execute "nyc" against "/bin/_mocha", getting rid of it seems more like a pipedream.

@plroebuck This PR does not get rid of bin/_mocha.  That's another issue entirely, which would require a deprecation notice for some time first.

@plroebuck

But you already know this is not the case with WebStorm per the issue with multiple --timeout values...

I don't understand how that has anything to do with this pr.

TO BE CLEAR: this does not do anything with bin/_mocha; it's still there, it still works, we just don't spawn it if we don't have to.

Do we lose any fault tolerance by having tests run in current and not child process?
Is keeping them for Node flags just a case of defending against scenarios/code out of our direct control? (if this was the reason it was introduced in the first place).

But we should be cautious, I would tend to semver-major. Is it possible users created a concurrent wrapper around Mocha, using these child processes?

Anybody wrapping Mocha in some way is likely going to be consuming bin/_mocha or using it programmatically.  This change won't affect those users.
Signal handling is going to be the main area of concern; I'll need to do some manual testing with --watch to ensure that it's not broken.

In the original issue #3690 you mentioned our intgration tests. I wouldn't like to do all tests twice, once for single main process, and a second time for parent/child szenario.

The fact is that the option parsing flow is not the same.  If you run bin/mocha, we do a naive parse of the arguments to separate them into "Node.js" and "Mocha" buckets, then recombine these into an array.  No validation occurs.  Config file parsing is disabled via flags (because we've already read them at this point) and either (given this PR) a) the child process is spawned if we have a non-empty Node.js bucket, or b) the main entry function is invoked with the new arguments array.
While I'm confident that this doesn't produce any weirdness in and of itself, I'm also not 100% confident.  Yet, at this point, I don't think running the same integration tests twice against both executables would buy us much.
I think a test that would run the bin/mocha executable, then invoke the command handler, then compare this to the final parsed options when running bin/_mocha should be sufficient.
That's tangential to this PR though, since if this didn't land, we'd still want it--just instead of invoking the command handler, we'd spawn the child bin/_mocha  process.

@craigtaub 	Could you be more specific?

This is likely a quick win, but there may be unforeseen consequences.

@boneskull We could add a new flag like --experimental-no-child. A default value of false would keep the current behaviour, true plus no node flags would run this PR's behavior.
We should implemet this PR, it's a good idea.

Looked into this problem generally a long while back.
Preferred the direction taken by npx, although it used this.

Note concerning existing code, not PR change itself...
Existing code doesn't give child process time to terminate before
sending second signal.
  const childProcess = spawn(process.execPath, args, {
    stdio: 'inherit'
  });

  childProcess.once('exit', (code, signal) => {
    process.once('exit', () => {
      if (signal) {
        process.kill(process.pid, signal);
      } else {
        process.exit(code);
      }
    });
    childProcess = null;
  });

  // Terminate child process on keyboard abort
  process.once('SIGINT', () => {
    childProcess.kill('SIGINT'); // calls runner.abort()
    setTimeout(() => {
      if (childProcess) {
        // If _still_ not dead, try again with alternate signal...
        childProcess.kill('SIGTERM');
      }
    }, 5000);
  });
} else {
...


The number of structures

Dear Prof. Reuter,
I have a question regarding the number of structures that are calculated via BrainPrint. In the BrainPrint paper (Wachinger et al., 2015), there are 44 structures calculated, but it seems only 34 structures in the python code. Would you mind guide me on this? Thank you very much and I look forward to hearing from you.
Sincerely yours,
Yu-Chi Chen

Hi Yu-Chi,
this code has 34 structures + 4 3D volumetric descriptors (lh rh GM WM also as 3D tet-mesh).
Around lines 309 in fs_brainPrint you can find the definitions of the original BrainPrint (there we have 43 structures). Some structures were merged or removed in the updated version. E.g. choroid plexus is not used as individual structure but combined with the ventricle to produce a well defined structure.


put the shiny app online and check the 'sharing' links work

@annecori - you should be able to test now

The email, G+, facebook, linkedin and twitter ones work.
Someone with a pintrest/redit/tumblr account could test those, or we could just drop them


Dropdown menu issue - Syntax error, unrecognized expression

The snippet for a dropdown menu is well known from the docs:

    Account

    ...

It works fine with both 2.0.4 and 2.1.
I tried to customize the above code specifying /SOME_URL/ for the href attribute:

    Account

    ...

The latter code runs fine with Bootstrap 2.0.4 but it doesn't with Bootstrap 2.1. Clicking on the page Firebug  console gives:
Error: Syntax error, unrecognized expression: /SOME_URL/
http://code.jquery.com/jquery-1.8.0.js
Line 4512

Here it is possible to try live examples:
http://jsfiddle.net/V3Tue/ (Bootstrap 2.1, Syntax error)
http://jsfiddle.net/V3Tue/2/ (Bootstrap 2.0.4, working)
Is this a regression which caused the issue?

still an issue with bootstrap 3.* and jquery 3.1.1


Parameter --ami-id is not working properly

Hi,
I'm generating a cluster.yaml with the following command:
kube-aws init --region=us-east-1 --cluster-name=test-cluster --availability-zone=us-east-1a --external-dns-name=cluster.example.com --key-name="cluster-key" --kms-key-arn="arn:aws:kms:us-east-1:073xxx..." --ami-id="ami-xxxx"
However, the generated file doesn't reference the provided AMI anywhere. It outputs as below:
# The AMI ID of CoreOS.
# If omitted, the latest AMI for the releaseChannel is used.
#amiId: ""

kube-aws version 0.9.7
Can anyone confirm? For now I'm changing it manually.

Not to say that it shouldn't be fixed, but wouldn't using coreos release channels work  for you instead?

I believe it wouldn't. There's a requirement for encrypted volumes (using KMS). AFAIK the only way to achieve that would be using a pre-encrypted AMI - or there's another way? Thank you for the suggestion though.

kube-aws supports creating and attaching extra data volumes, I think encryption support for such EBS volumes can be added relatively easy. You then have unencrypted root using upstream CoreOS AMIs and encrypted data volumes, will it be enough to meet your requirements?

Unfortunately not. They require the root volume to be encrypted as well.
I found important to report because others might blindly trust the CLI parameter.

@jweyrich Hi, thanks for trying kube-aws!
Yes, it does seem like a bug. I'll fix it until v0.9.8-rc.1.
Btw, you will probably want to add --hosted-zone-id too so that you no longer need to add hostedZoneId to your cluster.yaml afterwards.

Hmm, I'll check the parameter you mentioned. Thank you for the fix! ;-)


Update to Docs: Clarify where in secret.yaml GitHub Personal Access Token should be added

Hi,
This is a tiny PR to update the docs surrounding adding the Personal Access Token for the GitHub API limit to secret.yaml. It wasn't entirely clear that it needs to go under jupyterhub and I got caught out this morning.
Thanks!

I'm now questioning whether this is correct. My Hub is becoming very problematic when I have this in my secret.yaml 🤔Slow to start after periods of inactivity and often not spinning up user pods. Hub becomes much more responsive when I remove the access token.

I think I've managed to convinced myself that this is incorrect. Going to revert the PR.

It seems weird that the hub would become unresponsive with this change. Even if it is "the wrong" way to configure it. We should investigate that.
Whether or not you need the extra level of "indentation" depends on whether you setup your own meta chart (like we do for https://github.com/jupyterhub/mybinder.org-deploy/) or if you just use the binderhub chart.

Some kind of check for indentations during helm upgrade would be nice. So many of my problems would have been fixed if I had a message like "this key isn't where I expected it to be so I won't implement it this time".

"P.S. This may cause weird Hub behaviour"!

@sgibson91 I've been thinking about these pain points as well without coming up with a concrete idea on how to resolve the pain in a sustainable manner =/

Can we do something with helm linting or specifying a flag to the helm executable to say "please shout if there are things defined in values.yaml that aren't consumed in the chart(s)? I think this is super tricky to do but you never know :-/

Yeah, other than checking the parents of each key I'm not sure of a good way either 🤔


VS Code Insiders build support

Added support for .vscode-insiders directory. It is same as .vscode but used by insiders build.

Thanks!


Fix #1203: allow indexing ndarray.flat

This PR adds support for indexing ndarray.flat with an integer, and for ndarray.flags (only the *contiguous attributes thereof).
(note the diff is large because I exploded test_array_methods into three separate test files)

this PR needs to merge with master again

I fixed the merge conflicts.


Please fix the typo on the project description 😭

Where?

SaltLib aims to be an alternative of the ~Soduim~ mod for Minecraft, but for legacy versions (1.3.2-1.13.2) of the game.

Fixed!


Starting JBossEAP using systemd | Opening additional ports

@Pbasnal hi, with @istraka we'll take a look at this MR and provide review.


Worker file missing in bundle in subsequent build until vue.config.js get modified

Version
4.5.8
Reproduction link
https://github.com/jackysee/workertest
Environment info
Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i7-5650U CPU @ 2.20GHz
  Binaries:
    Node: 14.15.0 - /var/folders/0m/_myg74lx1zv_nnvqxfpy1cp40000gn/T/fnm-shell-3114332/bin/node
    Yarn: Not Found
    npm: 6.14.8 - /var/folders/0m/_myg74lx1zv_nnvqxfpy1cp40000gn/T/fnm-shell-3114332/bin/npm
  Browsers:
    Chrome: 86.0.4240.198
    Edge: Not Found
    Firefox: 76.0.1
    Safari: 14.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.0-rc.2
    @vue/babel-plugin-jsx:  1.0.0-rc.3
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  4.5.8
    @vue/babel-preset-jsx:  1.2.4
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.4
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli-overlay:  4.5.8
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.8
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.8
    @vue/cli-plugin-router:  4.5.8
    @vue/cli-plugin-vuex:  4.5.8
    @vue/cli-service: ~4.5.0 => 4.5.8
    @vue/cli-shared-utils:  4.5.8
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^6.2.2 => 6.2.2
    vue: ^2.6.11 => 2.6.12
    vue-eslint-parser:  7.1.1
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.9.5 (16.0.0-rc.1)
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.11 => 2.6.12
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: 4.5.8

Steps to reproduce

npm run build, should see the bundle has a worker file, which is created by the worker-loader
npm run build again, the worker file is missing.
modify vue.config.js, add a comment
npm run build, the worker file appear in the bundle again.

What is expected?
The build should be consistent. The worker file should appear in the final bundle in every build.
What is actually happening?
First build
~/Documents/Programs/workertest master*
❯ npm run build

><EMAIL_ADDRESS>build /Users/jacky/Documents/Programs/workertest
> vue-cli-service build

⠇  Building for production...

 DONE  Compiled successfully in 9310ms                                                                      12:02:41 AM

  File                                      Size                                Gzipped

  dist/js/chunk-vendors.5e5f0ab3.js         89.95 KiB                           32.23 KiB
  dist/js/app.8d248e5d.js                   3.70 KiB                            1.46 KiB
  dist/js/file.worker.bfbaf1e6.worker.js    1.04 KiB                            0.52 KiB
  dist/css/app.d40fc157.css                 0.16 KiB                            0.14 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

2nd build
❯ npm run build

><EMAIL_ADDRESS>build /Users/jacky/Documents/Programs/workertest
> vue-cli-service build

⠙  Building for production...

 DONE  Compiled successfully in 1857ms                                                                      12:02:47 AM

  File                                 Size                                   Gzipped

  dist/js/chunk-vendors.5e5f0ab3.js    89.95 KiB                              32.23 KiB
  dist/js/app.8d248e5d.js              3.70 KiB                               1.46 KiB
  dist/css/app.d40fc157.css            0.16 KiB                               0.14 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

Looks like some caching issue here?
vue.config.js
module.exports = {
  chainWebpack: config => {
    //change this file
    config.module
      .rule("worker")
      .test(/worker\.js$/)
      .use("worker-loader")
      .loader("worker-loader")
      .end();
  }
};

HelloWorld.vue
<template>

{{ msg }}

</template>

file.worker.js
onmessage = function(event) {
  var workerResult = event.data;
  workerResult.onmessage = true;
  postMessage(workerResult);
};

At present, many problems are caused by cache-loader. I think everything will be better after supporting webpack5, since cache-loader is deprecated.
For file.worker.js, the loader used is[cache-loader, babel-loader, worker-loader] In short.
First build, worker-loader.pitch will generate file.worker.xx.js chunk async.
Second build, cache-loader.pitch return directly because of cache hit, and worker-loader.pitch is skipped.
So workaround is changing loader order to [woker-loader, cache-loader, babel-loader], so that worker-loader.pitch won't be skipped.
/** @type {import('@vue/cli-service').ProjectOptions} */
module.exports = {
  chainWebpack: config => {
    //change this file
    config.module
      .rule("worker")
+      .before('js')
      .test(/worker\.js$/)
      .use("worker-loader")
      .loader("worker-loader")
      .end();
  }
};


Enable ruff and precommit

Enable ruff and pre-commit to automatically run it.  (Note: you have to install with pre-commit install).
Apply most of the fixes ruff found, with the following comments:

backend/app/tasks/__init__.py requires the side effects of imports for huey to work properly -> silence with a comment
I'm not sure about unittest and patch imports, although running the tests appears fine -> split into separate commit in case revert is necessary
ruff complains about from foo import *, but I don't know enough to refactor -> silence
except -> these should be changed because it will catch e.g. KeyboardInterrupt, but I'm not sure what the appropriate exception is -> silence for now, recommend fixing
it looks like pip-compile has not been run in a while, you may want to double-check the changes

Since you appear to be using VSCode, I recommend installing ruff as an extension.
Note that it will complain about the errors I silenced.  Probably they're worth changing properly :)

Regarding vscode... I started using it now because of Nim, as it just works better there. However I'm still writing most of the python bits via PyCharm out of habit. I've had issues with Python debugging in vscode in the past, but I've heard it should work pretty well now, so I might consolidate one day. Will give the ruff extension a go as well, thanks.


How to set rs.slaveOk() on connection?

I am trying to connect to read replica of a cluster using this driver. On any read query I am getting slaveOk=false error. How to set rs.slaveOk()?

got it.
for anybody struggling with same issue.
Mongo.find(conn, "collection", %{}, limit: 1, pool: DBConnection.Poolboy, slave_ok: true) |> Enum.to_list


Error when creating test cases if the table contains the name COLUMN

DATA QUALITY TEST CASE
Describe the bug
If the name of the table contains the word COLUMN it fails when creating a test case, it has been tested with different tables that contain the word and all of them fail, but if they do not contain the word COLUMN it works correctly.
To Reproduce

Expected behavior
The performance is expected to be the same because a table can contain the name column, we have +180 tables with this nomenclature.
Version:

OpenMetadata version: 1.3.2

Additional context
we assume it will happen with more reserved words, but we have detected COLUMN

requires https://github.com/open-metadata/OpenMetadata/issues/9686

@triquinielas I am not able to reproduce your error. Would you have the server logs to share by any chance

Hi @TeddyCr , thanks for your feedback, I will try to do some more testing and let you know, see if I am able to find any patterns.

hI @TeddyCr ,
I keep getting the same error, I have tried the latest version 1.3.3.
I have created in snowflake the following tables to try to make quality test, I have tried different combinations of uppercase, lowercase, and the term columns,column and col included.
CREATE OR REPLACE TABLE DIM_DATA_QUALITY_COLUMN AS SELECT 1 AS ID;
CREATE OR REPLACE TABLE foo_column AS SELECT 1 AS ID;
CREATE OR REPLACE TABLE foo_columns AS SELECT 1 AS ID;
CREATE OR REPLACE TABLE foo_column AS SELECT 1 AS ID; CREATE OR REPLACE TABLE foo_column AS SELECT 1 AS ID
CREATE OR REPLACE TABLE DIM_DATA_COLUMNS AS SELECT 1 AS ID;
CREATE OR REPLACE TABLE foo_col AS SELECT 1 AS ID; CREATE OR REPLACE TABLE foo_col AS SELECT 1 AS ID
CREATE OR REPLACE TABLE DIM_DATA_QUALITY_COL AS SELECT 1 AS ID;
Only let me do quality test in foo_col and DIM_DATA_QUALITY_COL (last two), the rest gives me errors.
If I create a "table" test, I can do test case in all but if I do add test column, it fails me if it has the word COLUMN or COLUMNS.

Look at the error that gives open_metadata: table instance for HBX_SNOWFLAKE.HBG_GOVERNANCE.COMMUNITY_ANALYTICS.DIM_DATA_IDS not found

It's as if the word COLUMN disappears from the composition, when it should be HBX_SNOWFLAKE.HBG_GOVERNANCE.COMMUNITY_ANALYTICS.DIM_DATA_COLUMNS
thanks,
Carlos

Thanks @triquinielas let me try to replicate it in Snowflake

I was able to reproduce it. Thanks @triquinielas for the details.

Hi @TeddyCr, thanks for your effort and for trying identify the issue.

@triquinielas in the meantime you should be able to create/run your test cases for this table via the CLI tool. More info here
source:
  type: TestSuite
  serviceName: MySQL
  sourceConfig:
    config:
      type: TestSuite
      entityFullyQualifiedName: MySQL.default.openmetadata_db.DIM_DATA_COLUMN

processor:
  type: "orm-test-runner"
  config:
    testCases:
      - name: myTestName
        description: test description
        columnName: ID
        testDefinitionName: columnValuesToBeUnique
        computePassedFailedRowCount: true

sink:
  type: metadata-rest
  config: {}
workflowConfig:
  openMetadataServerConfig:
    hostPort: "http://localhost:8585/api"
    authProvider: openmetadata
    securityConfig:
      jwtToken: <token>


DateTimeConverter crashes on parsing dates that have no millisecond value

When parsing a string like "2016-06-29T12:00:00+02:00" the DateTimeConverter will crash, because it uses ISODateTimeFormat.dateTime() to get a formatter that explicitely expects a millisecond value. There is an alternative that explicitely doesn't excpect a millisecond value: ISODateTimeFormat.dateTimeNoMillis().
Both versions should be supported, as both are quite common (and valid regarding ISO 8601).

Thanks.  Are you able to supply the PR?

@gkopff I think so, yeah. Any requirements, regarding code style, unit test, anything else from your part?

Just match the existing style (2 space indentation, brace position etc), and include appropriate tests please.

@gkopff Thanks for merging! Can you give an estimate when an update for the library will be available through maven?

It's Friday night here, so I probably won't get around to the mechanics of releasing until Monday.  I'll post a note here once I've published it.

Much appreciated, thanks!

That's been published to Maven Central as 1.3.0.


test domain save from interactive training

Proposed changes:

There is a bug with domain persistence from interactive learning. When domain is saved some default actions (which are not overridden) are added to the domain config file.
Scope of this PR is only to add test, to show buggy behavior and start discussion how this issue can be resolved.

Status (please check what you already did):

[x] made PR ready for code review
[ ] added some tests for the functionality
[ ] updated the documentation
[ ] updated the changelog

@tmbo Thanks for pointing to utils.read_json_file :+1:
And just to be sure, this test assumes that moodbot example does not override default action_listen.

There is a link #1354 for related issue.

Ok, now that we have a failing test - do you have some time to look into fixing the issue when dumping the domain?

Thank you for adding the test, created the PR to fix it: https://github.com/RasaHQ/rasa_core/pull/1375

@tzolkincz could you please merge the branch merge-domain-fix into yours and create the PR to this branch, so we could test it using your test

thanks, but since we want to merge this bug fix to 0.12.x, you need to rebase your branch

@Ghostvv in progress :)

Perfect thanks

@Ghostvv merge with rebase is in PR #1377


Coffee -> ES6

Overview
This PR is bundling a bunch of things that I wanted to apply on the repo to make it a little more up-to-date, and hopefully easier to work with:

Translation of CoffeeScript files to Javascript ES6
Update of the build pipeline to Gulp/Babel
Linting with ESLint + AirBnb codestyle
A dev task (as default when running gulp) to watch, lint and transpile
The source still has no dependency and can be run on Node >= 0.8 but the dev environment will work with Node >= 4 (6 preferred).
Upgrade of all dev dependencies.

Publishing
Open to suggestions - I'm planning on publishing a 1.0.0beta version of the package first, before making it official and stable. I'm not too worried but I could have missed something. 🤞
TODO

[ ] Changelog
[ ] Bump the version

Review
Tests have been ported to JS as well, but if you could make sure that the source files (especially the main src/index.js)  doesn't introduce regression, that would be fantastic.
Any additional tests are very welcome as well.
Testing

Clone the repo and checkout this branch. I personally linked the local branch and installed it in another repo to test imports were still working.

git clone https://github.com/florrain/locale.git
cd locale
git checkout repo-upgrade
npm install
npm link

cd ../express-application
npm link locale # install local version of the package

Fire up an Express application
Register the middleware
Define a route to print the locale
Send a request with the "Accept-Language" header and check it is working as expected.

Something like this:
import http from 'http';
import express from 'express';
import locale from 'locale';

const app = express();
app.server = http.createServer(app);

app.use(locale(['en', 'de'], 'en'));

app.get('/', function (req, res) {
  res.json({ headers: req.headers, locale: req.locale });
});

app.server.listen(process.env.PORT || config.port);

console.log(`Started on port ${app.server.address().port}`);

@florrain Can I help get these changes merged in?


Bracket orders / OCO bracket

Hello,
it will be nice if Zipline / Quantopian could support bracketed order
http://optionstradingbeginner.blogspot.fr/2010/08/bracketed-order.html
http://optionstradingbeginner.blogspot.fr/2008/11/types-of-orders-in-trading.html
Bracket OCO
http://help.tradestation.com/09_01/tradestationhelp/ob/about_oco_oso_orders.htm
see also this issue:
https://github.com/quantopian/zipline/issues/189
Kind regards

see http://quant.stackexchange.com/questions/16042/how-to-model-bracket-orders/16077?iemail=1&noredirect=1#16077 and http://stackoverflow.com/questions/10445936/r-quantstrat-orders-cancel-each-other

@femtotrader for your own stuff, reading through the quantstrat code would be beneficial. I only learned R so I could understand it.
The OCO logic is fairly straight forward iirc. The only gotcha is that if a single bar triggers multiple orders in the orderset. For my stuff, it's modeled like so:
Executor receives price event
    passes price, orderbook to execution_model
    execution_model gathers all possible triggered fills
        if multiple orders from same orderset can be triggered:
            execution_model calls orderset_model that determines the winner
    Executor now has all fills modeled by execution_model.
    executes orders and Orderbook cancels any orphan orderset orders.

I think what's important is that you don't execute immediately on limit/stop price trigger because you might have multiple triggered orders. You can break the tie randomly, default to adverse outcome, or maybe dip down to more granular data to determine which order was triggered first. If you're working on sub-minutely data, I don't know how often you'd run into the multiple trigger problem.
You can actually unit test your python code against R/quantstrat. http://nbviewer.ipython.org/gist/dalejung/3357531/faber.ipynb is an example of getting the equivalent output from R and python. That's notebook is like 2 years old so I dunno if it'll still work, but more of an example.

see https://www.quantopian.com/posts/a-framework-to-manage-bracket-orders-with-sl-tp-and-additional-features-trailingstop-breakeven-expiration-and-advanced-statistics


Error executing Lua callback: attempt to call field 'joinpath' (a nil value)

I get the following error when executing `:SmuggleConfig
Error executing Lua callback: /home/fredrik/dev/nvim-smuggler/lua/smuggler/buffers.lua:60: attempt to call field 'joinpath' (a nil value)
stack traceback:
        /home/fredrik/dev/nvim-smuggler/lua/smuggler/buffers.lua:60: in function 'buffer'
        /home/fredrik/dev/nvim-smuggler/lua/smuggler/ui.lua:51: in function </home/fredrik/dev/nvim-smuggler/lua/smuggler/ui.lua:50>

running the latest commit of both nvim-smuggler and REPLSmuggler.jl

Ah, neovim 0.10 is required, sorry for the noise.

Hm, perhaps I should leave a warning about that somewhere.


fix graceful shutdown

Pull Request Test Coverage Report for Build 42

0 of 13 (0.0%)  changed or added relevant lines in 2 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-0.5%) to 48.98%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

graceful.go
0
2
0.0%

app.go
0
11
0.0%

Totals

Change from base Build 39:
-0.5%

Covered Lines:
312

Relevant Lines:
637

💛  - Coveralls


Add option to set arguments to CC analyze

Signed-off-by: Anders Wallin<EMAIL_ADDRESS>

@wallinux Could you please rebase this to resolve the conflicts


Add support for npy format

It is necessary to make the library multiplatform.

Yes, if it will be, I could reuse


fix(ci): Fix freebsd builds

Thanks for jumping on this just hit this issue locally, if you need any help debugging etc. let me know


support resolving full paths

toExports
toImports

(For pnpm/pnp support.)

Note: We need a new option as well accepting search path. We can also use mlly to have consistent ESM resolution with nitro and nuxt.


Support media stream

I am trying to scrape some HTTP Live Streaming (HLS) Transmissions, but I couldn't find a way to do, is it supported by SA?
import {Agent} from 'secret-agent';

(async () => {
    process.env.SA_SHOW_BROWSER = 'true';
    process.env.SA_SHOW_REPLAY = "true";
    const agent = new Agent({
        userAgent: 'chrome-latest',
    });

    await agent.goto(`https://hls-js.netlify.app/demo/`);
    await agent.waitForMillis(100000);

})();

Status: Your Browser does not support MediaSourceExtension / MP4 mediasource

cannot get de m3u8 file? what protection have that server?

I'm not sure what kind on protection it does have, but the m3u8 file keep loading forever when the request is made outside the initial browser

can you share the m3u8 url?

I can't send here cause there are some personal data on the URL I wouldn't mind to share on private

It looks like there's a bug in the "codecs" overrides. Will fix shortly - I need to figure out if we still even need these overrides now that we're running on full-chrome

Re-opening it cause the same problem started to happen, the website I'm trying to scrape now is twitch.tv, the m3u8 is loading forever until it reaches timeout
import {Agent} from 'secret-agent';

(async () => {
    process.env.SA_SHOW_BROWSER = "true";
    const agent = new Agent();
    await agent.goto(`https://player.twitch.tv/?channel=gaules&enableExtensions=true&muted=false&parent=twitch.tv&player=popout&volume=0.5&mature=true&quality=160p30`);
    const m3u8 = await agent.waitForResource({url:/m3u8/}, {timeoutMs: 120000});
    console.log(m3u8[0].url);
    await agent.waitForMillis(100000);

})();


[Bug] [UX] Change list scrolls to top when discarding & scrolls horizontally when cursor hovers scrollbar

Hello,
Here are 2 UX problems related to the change list.
It scrolls to top when discarding changes
Example case : there are 3+ changes, the first one is to be committed, the second one is to be discarded.
Reproduction steps :

Mark the first change to be committed ;
Scroll down to the second change ;
Discard it.

Expected behavior :

the scroll position is preserved after the second change is discarded ;
the third change takes the second's place, allowing it to processed without further scrolling.

Actual behavior :

the scroll position is reset to the very top after the second change is discarded ;
the user must scroll down through the first change again to continue processing the following ones.

It scrolls horizontally when cursor hovers scrollbar
Example case : there are 2+ changes, the first one has horizontal scroll width.
Reproduction steps :

Position the cursor anywhere in the change list view ;
Scroll down ;
The cursor eventually hovers the first change's horizontal scrollbar ;
Continue scrolling.

Expected behavior : the change list continues to be scrolled down.
Actual behavior : the first change begins scrolling right.

Thanks

Addressing item number 2 (horizontal scroll UX issue):
@Murmele
What do you think about implementing something like a single scroll bar at the bottom of the diff window that would simultaneously scroll all the diffs of each file in sync?  I have no clue how much work it would be to do this.
Concept:

Addressing item number 2 (horizontal scroll UX issue):
@Murmele
What do you think about implementing something like a single scroll bar at the bottom of the diff window that would simultaneously scroll all the diffs of each file in sync? I have no clue how much work it would be to do this.
Concept:

Yes this is something really anoying, but I think it is more work. As far as I remember then you have to dig into scintilla


Fix sqlite db update action in repo health job

Description
The issue https://github.com/edx/edx-arch-experiments/issues/66 updated the repo health script to run successfully with GitHub Actions.
The sqlite db update step was failing with GitHub Actions workflow which needs to be investigated and resolved.
TODO
Investigate the sqlite failure by uncommenting the sqlite update logic in the repo_health_dashboard.py file.

[x] Fix the sqlite check to work successfully
[ ] Extract the sqlite check to the repo health workflow so it can be saved as an artifact of the workflow run.

@UsamaSadiq  I can't found this file repo_health_dashboard.py

Updated the link for the file in the description as well. You can see the respective code lines at https://github.com/openedx/edx-repo-health/blob/master/repo_health_dashboard/repo_health_dashboard.py#L92

Created the first PR https://github.com/openedx/edx-repo-health/pull/423 to fix this issue.

Approach for the solution:

Updated the repo-health-job.yml bash script to exclude the generation of the sqldb file
Created another bash script repo-health-artifact.yml exclusively for the generation of sqldb file
Updated the repo health job workflow to add a new job which gets triggered after the data collection has successfully being completed.
The new job then runs the sqldb generation script and uploads the generated db file as an artifact to the workflow.

Updated approach:

Removed the new job (triggering step for artifact script execution) in the reusable workflow
Tested the script execution using a custom build trigger from the forked reusable workflow
Once the reusable workflow PR is merged, the scheduled repo health job will also start generating the sqlite db as artifact on each build.


update reflection.kt

update reflection.kt, fix some bugs

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.徐其望 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Documentation ahead of production build

I have spent the last few hours pulling my hair out over filtering.
It turns out that Jigsaw 1.3.12 has a beta dependency, so composer wasn't pulling it and I didn't notice until I gave up thinking "it's like Jigsaw just doesn't have this functionality".
I don't know what the appropriate answer is - I've allowed dev stability in composer and preferred stable - but you might prefer to mark up the documentation or change the jigsaw dependency.
The offending dependency is erusev/parsedown.

I encountered this when I tried to use the new helpers.php functionality that was recently added.
I had to update my composer file to include:
  "minimum-stability": "beta",
  "prefer-stable": true,

The problem it seems is that erusev/parsedown and erusev/parsedown-extra haven't been updated since March '19 and May '18.

Yeah, looks like composer require tightenco/jigsaw won't pull in beta packages unless minimum-stability is added directly to the local composer.json file, which defeats the purpose of a simple one-line install. 😞
Working on a fix, that might involve rolling back to the stable 1.7.3, or even dropping Parsedown in favor of a different parser, if it looks like 1.8.0-beta isn't going to make it out of beta anytime soon.

I've tagged a new release, v1.3.14 (https://github.com/tightenco/jigsaw/pull/388) that should resolve this problem for new Jigsaw installs, removing the reliance on beta versions of Parsedown and Parsedown Extra.


fixed file extension

google::SetLogFilenameExtension(".log");
before:
Test.log20210401-161508.34056
after:
Test20210401-161508.34056.log

google::SetLogFilenameExtension(".log");
before:
Tset.log20210401-161508.34056
after:
Tset20210401-161508.34056.log

@googlebot I signed it!

@googlebot I fix

If the user has set an filename_extension for the log files, then the log cleaner will be broken because the filename format has been changed.
https://github.com/google/glog/blob/e51790bf33d7d1f0e6b7e703a29a972b570293a4/src/logging.cc#L1375-L1432

IsLogFromCurrentProject

I will fix it.


android build is failing

Android failing with error below. Doesn't matter what I'm trying production/debug device/simulator. Sometimes very rarely it's good but usually failing. Can't tell what is pattern which causing that
> Task :app:packageRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageRelease'.
> Execution of compression failed.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 20s
769 actionable tasks: 727 executed, 42 up-to-date

Current version is: Env Info: darwin | x64 | node v10.13.0 | rnv v0.23.42-alpha19
Situation with latest version is even worse actually got dozens errors.

@aurimas535 could you add this:
"android": {
    "gradle.properties": {
      "org.gradle.jvmargs": "-Xmx4608M"
    },

to the root of ./projectConfig/plugins.json

@pavjacko that helped


Fix Jenkins integration

Coverage increased (+0.004%) to 75.234% when pulling 1755c825a44e5c4396c30113e9918cbda971ac49 on crd477:jenkins into dd29079012644e47392b9d015187d8ae1dadd569 on cmu-db:master.


should we remove useRouter() in favor of history?

Would we want to update all instances, something we would do going forward, or should we keep what we have and then refactor if we have time?


Not worked refresh token after reboot server

Good day. At me such problem, I use authorization on JWT and at me after each server reboot the current refresh of a token does not work.
services.AddIdentityServer ()
                 .AddProfileService <LynxProfileService> ()
                 .AddResourceOwnerValidator <LynxResourceOwnerPasswordValidator> ()
                 .AddSigningCredential (IdentityServerConfiguration.GetSigningCertificate ())
                 .AddInMemoryPersistedGrants()
.AddInMemoryApiResources (IdentityServerConfiguration.GetApiResources (AuthConstants.ApiSecret))
                 .AddInMemoryClients (IdentityServerConfiguration.GetClients ());

.AddInMemoryPersistedGrants() means you are storing runtime state like refresh tokens in-memory only. You need to persist them, e.g.
https://identityserver4.readthedocs.io/en/release/quickstarts/8_entity_framework.html

And for which you need services.AddScoped <IPersistedGrantStore, LynxPersistedGrantStore> () ?

I don't know what Lynx is - we have support for Entity Framework. Or you implement it yourself.

Sorry,
services.AddScoped<IPersistedGrantStore, PersistedGrantStore>()


fix: update to<EMAIL_ADDRESS>to be able to patch async functions

I missed that the version was updated on NPMjs.
I only checked the tags on Github, where version 1.2.1 is not present.
Thanks for doing this!

Yep, weird, this confused me at well, otherwise I would have updated this dep ages ago.


How to enable auto direction, or at least how to make dirction = rtl?

I'll reopen it so that anyone who came for issues section could see the solution, until repo's owner solves the error in his code.


[DO NOT MERGE] debug appveyor fails

Since we're on GitHub Actions now, this is no longer relevant.


Create a page with Minetest artwork.

I think it'd be nice if we had a page on the site with some PNG and SVG icons and perhaps a wallpaper.
We could have pages Artwork and Screenshots under the umbrella Gallery.

Should be in the media kit #175


Rename LLM Finetune project

As agreed, we rename llm-lora-finetuning to llm-litgpt-finetuning for clarity.

@avishniakov can we do this at the "last moment" - >we have links pointing to it from outside and I don't want them to land on a deadend

@avishniakov so we can close this one, right?


createdAt timestamp is acting like updatedAt

I created my timestamps with a migration like this:
 t.timestamp('createdAt');
 t.timestamp('updatedAt');

My column definitions in MySQL look like this:
+-----------------------+------------------+------+-----+---------------------+-----------------------------+
| Field                 | Type             | Null | Key | Default             | Extra                       |
+-----------------------+------------------+------+-----+---------------------+-----------------------------+
| createdAt             | timestamp        | NO   |     | CURRENT_TIMESTAMP   | on update CURRENT_TIMESTAMP |
| updatedAt             | timestamp        | NO   |     | 0000-00-00 00:00:00 |                             |

Which is obviously producing slightly strange behaviour.  I think this is MySQL's fault (see https://dev.mysql.com/doc/refman/5.0/en/timestamp-initialization.html) but it essentially makes the "timestamp" type unusable for bookshelf timestamping. It might be worth noting this either in the docs or in the knex docs - I can document and PR if you agree.
EDIT: Apologies, this might belong in the knex docs.  I see there is already an issue there: https://github.com/tgriesser/knex/issues/34

Hi @pschuegr, I'm going to close this one. Please raise it as a knex issue. Cheers!


redlib: add settings and defaults option to module

Description of changes
Additional NixOS module settings for Reblib fork of the Libreddit. Some of the work is based on previous closed attempt in #238493.
Also formatted with nixfmt-rfc-style

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[x] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-ready-for-review/3032/4527

Could you move the re-formatting step to a separate commit, as it makes reviewing the changes easier?

#345715 seems to have changed the settings to the free-form attribute set, which is the preferred way since RFC 42.

Closing as implemented in #345715


cluster always work on only 2 worker even though the concurrent is set to 10

Hi,
I used puppeteer-cluster in my program, and run it with execute, launch it with concurrent=10, in the monitor, it looks starts 10 workers.
But when i print process.pid in my task, it always used two of these workers. Could you please tell me why?
OS: windows 10

for your information, these are my test data, as you can see, the time of cut used is longer. Thank you very much.

i think i have known the reason, it's because of the server single thread.