WIP: integration into SLF4J's MDC for trace-log-correlation

Codecov Report

Merging #175 into master will decrease coverage by 0.39%.
The diff coverage is 66%.

@@            Coverage Diff             @@
##             master    #175     +/-   ##
==========================================
- Coverage     72.99%   72.6%   -0.4%
- Complexity     1004    1011      +7
==========================================
  Files           111     113      +2
  Lines          3729    3825     +96
  Branches        337     350     +13
==========================================
+ Hits           2722    2777     +55
- Misses          847     881     +34
- Partials        160     167      +7

Impacted Files
Coverage Δ
Complexity Δ

.../co/elastic/apm/impl/transaction/AbstractSpan.java
75.8% <23.07%> (-13.99%)
21 <1> (+1)

...ain/java/co/elastic/apm/impl/ElasticApmTracer.java
75.91% <37.5%> (-5.63%)
40 <1> (+1)

...a/co/elastic/apm/impl/ElasticApmTracerBuilder.java
78.18% <40%> (-4.18%)
10 <0> (ø)

...ava/co/elastic/apm/slf4j/Slf4jMdcSpanListener.java
72.41% <72.41%> (ø)
5 <5> (?)

...n/java/co/elastic/apm/impl/transaction/SpanId.java
86.66% <80%> (-1.8%)
13 <1> (ø)

.../java/co/elastic/apm/impl/transaction/TraceId.java
76.47% <80%> (-0.2%)
14 <1> (ø)

...a/co/elastic/apm/logging/LoggingConfiguration.java
91.66% <81.81%> (-2.22%)
13 <1> (+1)

...lastic/apm/cache/WeakKeySoftValueLoadingCache.java
83.33% <83.33%> (ø)
3 <3> (?)

...co/elastic/apm/impl/transaction/TransactionId.java
76.66% <0%> (-6.67%)
13% <0%> (-2%)

... and 4 more

Continue to review full report at Codecov.

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


[ENH] Add CBM model extension for count data forecasting

Is your feature request related to a problem? Please describe.
CBM modeling is used heavily in demand planning for sales data for example.
Describe the solution you'd like
It would be nice to have this in sktime as an forecasting extension
https://github.com/microsoft/CBM
Describe alternatives you've considered
Implement outside sktime, but then we can not leverage the common sktime infrastructure for cross validation and hence there is no easy way to compare to other models from sktime.
Additional context
Add any other context or screenshots about the feature request here.

Have you tried using it as the regression in make_reduction ? If it's scikit-learn compatible, it should work.

Have you tried using it as the regression in make_reduction ? If it's scikit-learn compatible, it should work.

There may be some nuances involved, such as feature generation, etc. I will play with the idea and get back to you. Thanks for the pointer.


Load Balo project should support lazy loading without reading the zip

Description:
Ideally, we should do lazy loading without reading the ZIP. In a cached state what we want are the modules so we should load only that in loadProject(...) method in BaloProject class.
Steps to reproduce:
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

We keep the extracted bala in repositories now. Hence this can be closed.


VTN-11012, add option for initial offset

Added option to set the initial offset to newest when creating a consumer. It defaults to oldest as before the change.

I was having some issues running the unit tests locally, even for the master branch. Once I resolve that I will be able to verify the newly added unit tests.

Due to problems running the units tests we'll need to revisit them.


Replaceable encode function in Parse.js for ParseObject.js

I'm trying to solve cleanly in backbone-parse-es6 the scenario of setting another "Backbone.Model" which is backed by a ParseObject in another "Backbone.Model". Please see backbone-parse-es6 Issue #5.
It seems the cleanest way to accomplish this is to be able to replace the encode function such that when toJSON->encode reaches a "Backbone.Model" it encodes the backing ParseObject, but that isn't currently possible since ParseObject imports encode directly. A possible way of doing this is exposing encode in Parse.js and have ParseObject import Parse.js and access the encode function from there. This will allow me to replace the encode function with a Backbone.Model aware version.
Of course there is already _encode in Parse.js for legacy support, but it's not accessed by ParseObject.
There are more hacky / fragile ways of solving this issue perhaps, so I'd like to find out if this change can be considered for the JS Parse SDK.

In regard to creating new a new Backbone.Model subclass from fromJSON in ParseObject I should still be able to use ParseObject.registerSubclass with the Backbone.Model class and simply implement _finishFetch and _setExisted in the backbone-parse-es6 Backbone.Model class forwarding those method calls to the backing ParseObject.

As a sidenote I'm sure there will also be a similar situation when associating ParseRelation data, so I'll try and test these concerns such that if changes are to be made backbone-parse-es6 can support creating pointer and relation data when serializing / deserializing.

@andrewimm
I'm getting close on a solution for this that is somewhat unobtrusive. It did require me to extend Parse.Object for a few tricky manipulations involving private methods. I'll post things here in a day or so no need to answer any of the above. I would like to get some consensus / buy in on the fragility of my solution though with your future expectations for the Parse SDK.

Well,
I've spent a good time on this backbone-parse-es6 issue. I have a solution, but it requires some modification of Parse-JS SDK as things go for the cleanest path. A quick recap. The problem is when adding a Backbone Model to another Model by default Parse doesn't know how to serialize the backing ParseObject which is stored in the parseObject variable.
The cleanest path to support serialization is to create a custom BackboneParseObject which overrides the following methods:
_getSaveJSON and toJSON
Both of these methods defer to the backing ParseObject if it exists.

Deserializing is more of a headache due to ParseObject->fromJSON being a static method which is accessed most importantly from ParseQuery and decode.
I need to be able to override fromJSON to handle things cleanly and here is an example change that doesn't do any type checking:
   fromJSON(json)
   {
      if (!json.className)
      {
         throw new Error('Cannot create an object without a className');
      }
      var constructor = classMap[json.className];
      var parseObject = new ParseObject(json.className);

      var otherAttributes = {};
      for (var attr in json)
      {
         if (attr !== 'className' && attr !== '__type')
         {
            otherAttributes[attr] = json[attr];
         }
      }
      parseObject._finishFetch(otherAttributes);
      if (json.objectId)
      {
         parseObject._setExisted(true);
      }

      // constructor is assumed to be a Backbone.Model / ParseModel
      // in a properly overloaded version of this method some protection would be involved here.
      var o = constructor ? new constructor({}, {parseObject}) : parseObject;

      return o;
   }

The subtle difference above is always creating the ParseObject then if a sub class is registered that is a Backbone.Model / ParseModel then associate the ParseObject with it.
Two additional methods for ParseObject getSubclass(className) which returns any registered sub class by name and hasSubclass(className) which returns a boolean if a class is registered is handy since classMap is not accessible / module private.

A final aspect that would really be helpful is being able to set Parse.Object to BackboneParseObject then anywhere internally in the Parse SDK instead of importing './ParseObject.js' directly import './Parse.js' and use Parse.Object. Otherwise a copy must be made of the ParseObject in the constructor of the Backbone.Model / ParseModel to convert it to BackboneParseObject to support serialization. This isn't a major deal per se, but for efficiency.
Please advise @andrewimm  All my other attempts to work around the static fromJSON method were really nasty / fragile / error prone. The above changes I mention are working great in a proof of concept implementation.

Hi @andrewimm. I'm just bumping this especially since the 1.7.0 release is on the horizon given a change like exposing a replaceable fromJSON would fit the motif of a new major version release. Exposing fromJSON from Parse.js seems reasonable. It'll help any 3rd party binding given the extra flexibility.
Cheers...

@andrewimm I'm bumping this issue again. Perhaps now that 1.7.0 is out we can take a look at improving 3rd party library support for deserialization. As mentioned above the best path forward is making fromJSON a non-static method perhaps accessible from Parse which will allow it to be easily replaced as necessary by 3rd party libraries like backbone-parse-es6.
Do let me know if there is any possibility of this. It's been a month now w/ this issue open. I've tested this solution and it solidly works. If necessary I'll even make a PR once I get your buy in to the solution.
Thanks...

@andrewimm I'm still waiting on any response / acknowledgement to the solution I've outlined above. What happened to "Sounds good, looking forward to it."? I'd like to close the only bug in backbone-es6 and this pertains to making the Parse JS SDK more friendly to third party integration. I spent quite a few hours testing out my solution. I'm not going to create a PR until you acknowledge the solution and will give it a look for acceptance. I'm not interested in wasting my time, so it'd be great if you can take a look and agree to something if it that is that you'll do nothing...

+1 in favor of @typhonrt I'd like to know if it's something that you'll think of or not.

We've been busy with other SDK work, sorry for the silence on this. I'm still not clear on how you propose to expose fromJSON from Parse.js, because it's a property of Parse.Object. From an API perspective, fromJSON is a property of Parse.Object, and doesn't make sense living elsewhere. If you need to change the behavior, why can't you override the property directly on Parse.Object?

I'd love to help where possible, but so far the proposal sounds a bit heavy-handed and tailored towards this singular use case.

As things go I guess I overlooked that one can replace a static method. So I have been successful in getting things to work without modification of the Parse JS SDK. The only side effect is that I also have to override registerSubclass as it accesses the module private classMap object in addition to providing a new getSubclass method.
To reduce the amount of custom code I need to override could you consider adding a static getSubclass(className) method which returns the value in classMap. It would be handy to add a convenience method hasSubclass(className) returning a boolean if one exists.
Should I file a new issue for addition of getSubclass / hasSubclass?

@andrewimm Well... I thought I came up with a workable solution, but it only works in JSPM or potentially browserify / webpack or other transpiling package managers though currently untested in the later two. The problem I'm having is the AMD / UMD bundles of backbone-parse-es6 being used with RequireJS directly. I've had a request to support RequireJS and as things go I didn't have a full test / canonical TODO demo in place previously, so wasn't aware of the problem until trying to support a legacy Parse web app via RequireJS.
The current workaround for serialization / deserialization that I figured out requires having access to the full encode method signature as seen here in BackboneParseObject. You can see the AMD bundle here which includes "parse/lib/browser/encode.js".
This causes problems with RequireJS due to including all the necessary dependencies and having to potentially provide the whole (or lots of dependencies) in the lib directory given the imports in encode.js. There is no clean workaround / hack for RequireJS consumption.
A simple solution is to expose the full encode method via setting Parse.encode = encode; in Parse. Might as well set Parse.decode = decode; as well in case the method signature ever changes from Parse._decode.
Thanks again for any consideration as I'm just trying to support legacy Parse apps that need to move to parse-server soon.

@andrewimm any chance we can continue a discussion about my proposed solution above? I'd be glad to submit a PR once I know it will be accepted.
The crux of the solution is stated above: "A simple solution is to expose the full encode method via setting Parse.encode = encode; in Parse. Might as well set Parse.decode = decode; as well in case the method signature ever changes from Parse._decode".


Click calendar cell to retrieve the current date

Hi, Guys
Is there anyway to retrieve the current date by clicking a calendar cell? I would like to add an event to the selected cell without manually inputting the date.
Many thanks!

Until there's an update, the best I can find allows a click on the day number in the cell (not the cell itself).
I am only using the CalendarMonth component.

Add full-component-ref attribute to <calendar-month> and set it to some string. e.g.

<calendar-month
   full-component-ref="CAL"
/>

Somewhere in your component (probably mounted), wire an event handler for "moveToSingleDay". e.g.

      this.$root.$off('CAL:moveToSingleDay');
      this.$root.$on('CAL:moveToSingleDay', e => {
        console.log('DAY CLICK', e);
      });

The event has a dateObject which is a Luxon DateTime instance. So if you want a native Date you could do:

e.dateObject.toJSDate()


feat: multi-root workspaces

#10  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @trevorpfiz and the rest of your teammates on  Graphite


Fix #308

Fixes #308.

Same as the other PR: The code looks fine, but the commit message should be descriptive and not refer to a GitHub issue. If the project were to move away from here the message wouldn't be useful anymore.

Also, this changes the output of some tests. You need to regenerate the references (run tests/*/update-refs.sh).


v1.22.5 image tag is missing

Context
The v1.22.5 image tag is missing from https://github.com/goreleaser/goreleaser-cross/pkgs/container/goreleaser-cross/versions?filters[version_type]=tagged
Problem
Our repo upgrades Golang versions regularly and it is a maintenance burden to check if the relevant goreleaser-cross image version exists.
Proposal
Create a goreleaser-cross image tag for every Go release.

i'll release it in a next day or two, have to do it manually as gh actions runners always fails due to no space issue.
you can use v1.22.6 tho

Thanks yea we worked around the issue by bumping to Go 1.22.6 in https://github.com/celestiaorg/celestia-app/pull/3803

We stopped using a deprecated field in https://github.com/celestiaorg/celestia-app/pull/3795 but it looks like goreleaser-cross is still using v1.x of Goreleaser. Are there plans to upgrade to Goreleaser v2.x?
In either case, we'll have to revert that PR, pin to Goreleaser v1.x in our goreleaser-check command, and then cut another release to get pre-build binaries to work.

golang 1.22.7 has also been released, which fixes security issues

1.22.7 released

fwiw this replaced :latest as well it seems

running this to fix:
❯ for name in goreleaser-cross-base goreleaser-cross goreleaser-cross-pro
          for registry in ghcr.io docker.io
                  docker pull $registry/goreleaser/$name:v1.23.1
                  docker tag $registry/goreleaser/$name:v1.23.1 $registry/goreleaser/$name:latest
                  docker push $registry/goreleaser/$name:latest
              end
  end


add binary size check script, makefile target, and added to drone

Proposed changes

Add script to check binary size and include in ci.
Types of changes

Verification

Linked Issues

rancher/k3s#2205
Further comments

Thanks. I think that's a lot cleaner.


Request for documentation

As of right now, the documentation is limited to the README and a godoc that isn't linked to from the Github page. The godoc itself doesn't provide necessary information, such as what units many metrics are given in. I'd love to use this library, but this is a big barrier.

hope it helps: cd88f936d3dc35b57d56c923c7593e03539c451b

@akhenakh Absolutely. Thank you! I'll let you know if I have any other questions.

@akhenakh Would you like me to put in a PR with a link to the godoc from the README? Might be helpful for those looking to use your work.

Here you go cda95502c557c3fab01821edbb1a43f7e225dd92


refactor: lock wallet on login timeout

Timeout lock isn't working for extension.

Timeout lock isn't working for extension when I'm setting 1 or 5 min timer

LGTM


Eventstream uncommittedEvents possibly overwrites events that were not committed yet

Scenario: Retrieve the evenstream of an aggregate and keep a reference to it, adding new events to it and committing occassionally.
Expected Result: All events added to the stream are actually persisted
Actual Result: Some events are not persisted, because the uncommittedEvents array has been altered between the store.addEvents() call and the callback (async IO) and then gets overwritten with an empty array [].
Solution: Create a copy of the eventstream.uncommittedEvents array and reset the uncommitedEvents early before the IO call, then use the copy inside the callback only and re-append the uncommitted events on error.

/cc @f3lang


Setting global config file and custom bot powers

Hi,
No installation or configuration documentation in the webz, seems weird that this bot exists for such a long time and there's no normal explanation how this thing should work.
Basically, I'd like to create a global config file that will store all JIRA auth details and will be loaded into process.env before other modules are loaded. How do I create entry point/start file/bootstrap file/global config?
Second most important part, I've created "config.coffee" in ./scripts and loaded it in ./hubot-scripts.json, but it appears it looks for the addons in node_modules, no idea how to create local addons.
Please assist?
Thanks

Hi. It's been a year so I hope you found your way. But in case you still need help, hubot configuration is done via environment and it depends how you launch it.
If you launch hubot manually on a Linux/OSX platform, you may chose to create a file with variables setup, like production.env:
export HUBOT_LOG_LEVEL="debug"
export HUBOT_ALIAS="!"
...

and then you source production.env before launching hubot.
There are other methods described in the deployment documentation https://hubot.github.com/docs/deploying/ depending your environment.


Migrated the config settings to a yaml file, updated the commands for…

… YAML in the notebook and updated README.

@aishkrishna This looks great. Thanks for you help! Merging now.


Paper discussion 17a: Revisiting Software Defined Radios in the IoT Era

Review Type: Skim
Reviewer: Graham Schock
Problem Being Solved
Low Power IoT devices currently make use of dedicated wireless internet chips. Although this choice allows for more generality in IoT it also sacrifices a little bit of performance compared to a software radio. However, as IoT devices are simple and low powered this trade off might no longer be true. Another problem being addressed is the idea of cross technology interference, this is when “technologies share the same RF spectrum in an un-coordinated way”.
Contributions
In order to meet this challenge the paper proposes GalioT which is an architecture for low-power IoT devices. GalioT's main contribution is that it can decode cross-technology interference when multiple devices are on the same RF spectrum. It achieves this through unique software filters that help identify, segregate and decode radio signals. The paper also outlines somes of these algorithms as well as show evidence that GailoT is effective.

Reviewer: Niko Reveliotis
Review Type: Comprehension (Skim Edition)
Problem Being Solved
Traditionally, the market has shifted towards using dedicated wireless internet chips over software radios for their performance benefits. As the IoT-space continues to mature, a case where software radios may be more fitting has appeared. Specifically, in software radios having the ability to "decode any wireless technology with a simple software update." With IoT devices not being as network-constrained in needing top-tier performance (minimal latency, high throughput, etc), software radios can be a cheaper alternative to the current solution of "multi-technology gateways that support many radio technologies ... through multiple radio chips each decoding dedicated wireless technologies".
Main Contributions

"GalioT, a cloud-assisted IoT gateway" that is able to decode multiple different wireless technologies simultaneously.

Also has the ability to segregate different connections while they're interfering on the same frequency band.

Reviewer: Jacob Cannizzaro
Type: Comprehend/Skim
Problem:
Software radio was once seen as the future of radio technology. They are programmable, easily updateable to new radio technologies, and can simultaneuously read multiple types of wireless communications.The problem with them is that to optimize throughput for different wireless technologies adds a lot of cost that made it more feasible to just optimize hardware of each individual technology. Many IoT devices using many of these technologies at once causes current multi-technology gateways to experience collisions of radio waves from different devices that can be very hard or impossible to decode which leads to a loss in throughput as well as excess battery drain.
Main Contributions:
This paper introduces GalioT, a framework for a software multi-technology gateway that can handle concurrent decoding of multiple wireless technologies at once using cloud technologies. The prototype in this paper can handle Bee, Z-Wave, and LoRa wireless technologies, three of the most popular used in IoT devices everywhere. It is shown throughout that because IoT devices don't have high needs for throughput in most cases, and can deal with high latency bounds, software radios are enough for their low power needs. Whereas achieving the highest possible throughputs on any one technology with software radios is expensive, having one that can achieve results good enough for the IoT devices is actually cheaper than any existing multi-technology gateway. Throughput is shown to increase on average by 745.96%, fully supporting the goal of the paper. This technology is amazing because not only is it cheaper and more efficient, as new radio technologies come, the software radios can just be updated to keep up with the times instead of having a need for constant hardware replacement.

Reviewer: Rick Sear
Review Type: Skim
Problem being solved
Internet-enabled devices pretty much all use specialized chips (capable only of transmitting/receiving over a particular protocol) to communicate because they have very high throughput. However, there is a cheaper, more general alternative: software defined radios.
Important contributions

Since SDRs are more general and since IoT devices don't need massive throughput, it makes sense that IoT devices should use SDRs to communicate instead of specialized wireless chips
GalioT is an architecture that includes a cloud and gateway component which can decode multiple types of wireless comms for an attractively low price

Reviewer: Sam Hanna
Review Type: Skim
Problem Being Solved:
This paper talks about how many IoT devices use dedicated chips for wireless infrastructure. This paper proposes using software-defined radio in order to assist with decoding IoT signals. The current solution is very expensive and many low-power IoT devices could use software-defined radio as a cheap solution.
Important Areas:
In order to implement their software-defined radio, they created GalioT. This is a cloud-assisted gateway which works to decode signals and help to prevent collisions. GalioT focuses on low-power IoT devices and works to filter conflicting signals in all environments. They created a universal preamble to detect signals, then they send the signals to the cloud in order to do collision detection.

Reviewer: Sam Frey
Review Type: Skim
Problem
Software-defined radio decoding was previously explored as a potential replacement for having multiple radio chips for WiFi, Bluetooth, etc. While combining multiple chips into one and decoding the signals in software offered simpler hardware, software-defined radios were ultimately abandoned in favor of the performance benefits of individual chips. With IoT devices generally having more relaxed requirements for latency, software-defined radios may be able to provide increased compatibility with new radio technologies with just a software update.
Contributions
The authors propose GalioT, an IoT framework where devices use one chip for receiving radio signals and a cloud application for decoding. The cloud decoder also provides increased tolerance to radio signal collisions.

Review Type: Skim
Reviewer: Eric Wendt
Problem Being Solved
This paper talks about the software radio technology. They argue that software radios have been thrown by the wayside in favor of the faster multiple radio chip strategy that has taken over. They introduce GalioT to assist with a revitilization of software radios.
Contributions

GalioT is the first contribution, listed as intending to "decouple" collisions of multiple radio signals. This works even when there are not enough antenna to receive all the different types.
kill filters allow GalioT to block out radio signals that are not relevant for the receiver.
results: the kill filters results in a gain of 818.36% in high SNR and 532.4% in low SNR.

Review Type: Skim
Reviewer: Sean McBride
Problem Being Solved
The proliferation of competing wireless IoT standards has resulting in the development of multi-protocol hubs with dedicated chips for speaking each of the dominant protocols. However, these different wireless technologies interfere with each other, and the gateway relies on the dedicate chips to handle interference and retransmission. How might a software defined radio that could receive and interpret these different protocols help dis-aggregate overlapping transmissions and reduce interference?
Contributions
Created a Raspberry Pi-powered software defined radio receiver that is able to generate a least-common-denominator "universal preamble" that can detect transmissions of any of the supported wireless protocols. These transmissions are captured and uploaded to a cloud-based system that is able to apply kill filters and successive interference cancellation to separate out interfering instructions. This resulted in an increase in average throughput of 745.96%.

Review Type: Skim
Reviewer: Andrew Nguyen
Problem Being Solved
Software radio technology is something that can be revisited and applied to IOT. Since chips have been dominant lately, these piece of technology may provide more ingenuity than meets the eye. GalioT is a cloud assisted gateway that could aid in this idea.
Contributions
IoT should use SDR's as a way of better communications and such. GalioT can leverage edge computing to process I/Q samples from collisions. It can also be an effective replacement in cost, flexibility and scalability against the current existing multi-tech gateway platforms. GalioT can create unique single preambles that captures unique signatures and data of the radio technologies it intends to decode.

Reviewer: Akinori Kahata
Review type: Skim

The problem being solved.

Software radio technique, which can respond a wide variety of wireless transmission by program, is important for the era the number and type of IoT devices are increased. For IoT gateways, to connect to many IoT devices, such as a wide variety of sensors, need to be more cost and energy-efficient. In terms of those requirements, a gateway does not need to awake all time but wake up at the timing they detect the transmission. For implementing such a detection system, avoiding collisions of many IoT devices transmission and interference is essential.

The main contributions.

The researchers suggest the IoT gateway “GalioT”, which are programmable and can avoid collision of multiple transmissions of IoT edge devices. GalioT consists of a gateway device and cloud computing, and GalioT adopts the multiple filters, which can separate transmission by frequency, Chirp Spread Spectrum, and code. Compared to a conventional technique for canceling interference of multi transmissions “SIC”, GalioT shows high throughput, high flexibility and cost-efficiency.


Added scientific calculator

🛠 Fixes Issue (Number)
Closes #222
👨💻 Changes proposed
Added scientific calculator
✅ Check List (Check all the applicable boxes)

[x] My code doesn't break any part of the project (Zero Octave-Javascript-Projects).
[x] This PR does not contain plagiarized content.
[x] My Addition/Changes works properly and matches the overall repo pattern.
[x] The title of my pull request is a short description of the requested changes.

📄 Note to reviewers
Please let me know if changes are required.
📷 Screenshots

Your commits on index.html creates error in last 3 listed projects of landing page. Please check it once properly. Also add your project in index.html

Your commits on index.html creates error in last 3 listed projects of landing page. Please check it once properly. Also add your project in index.html

I looked into the issue. The images of the last three projects were missing in my version. I added them and fixed it! I also updated my project in index.html. Hope everything is correct now. If any other modifications are required, please do let me know!


打包报错 Failed to minify the code from this file

PS D:\project\saas-manage-platform> npm run build

<EMAIL_ADDRESS>build
node scripts/build.js

Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
    ./node_modules/_react-zmage@0.8.5-beta.37@react-zmage/lib/zmage.js:2:353

Read more here: http://bit.ly/2tRViJ9
"react": "^16.12.0",
"react-clipboardjs-copy": "^1.3.1",
"react-copy-to-clipboard": "^5.0.2",
"react-dev-utils": "^5.0.1",
"react-dom": "^16.4.0",
"react-markdown": "^4.0.4",
"react-redux": "^5.0.7",
"react-route": "^1.0.3",
"react-router": "^4.3.1",
"react-router-config": "^1.0.0-beta.4",
"react-router-dom": "^4.3.1",
"react-router-redux": "^5.0.0-alpha.9",
"react-sortable-hoc": "^1.11.0",
"react-zmage": "^0.8.5-beta.36",

Yes, I've met the question as you too
how to solve


Someone please help me clear text from tokenfield?

for example i need to remove "text".
I try many ways but It doesn't work! Help me pls.

can you create a fiddle and link it here?


tauri-plugin-clipboard convert arboard-returned ImageData to bytes rather than saving image to disk and read as bytes

Currently, clipboard image is read using arboard library to ImageData type. I didn't figure out how to convert it to bytes, thus I used the workaround to save the image to disk and read the file as binary.
Need to improve this.

Done already.


Add gitignore

Since zgen clones repository into the project root, they should be ignored. The files we want to track should be listed in gitignore.

I got zgen on ~/proj/zgen and all the plugins in ~/.zgen so the working directory is clean and thus there's no need for gitignore. However if there's enough demand for this gitignore I'll merge it.

The main reason is this. I use zgen in my dotfiles repository as a submodule, so I need fixed directory for zgen.

If I make a symlink zgen/zgen.zsh to ~/.zgen/zgen.zsh, zgen selfupdate won't work.
If I make a symlink zgen/ to ~/.zgen/, zgen clones all plugins into its working directory.

Currently I make a symlink zgen/ to ~/.zgen/, because I wanted to zgen selfupdate work. But then zgen will have dirty working directory, so I added gitignore file.
If zgen selfupdate work with a symlink zgen/zgen.zsh to ~/.zgen/zgen.zsh, then it won't be needed. Do you have any idea?

:+1:, either way

:+1:


Add support for "adjacent" dependencies

This should be some kind of search option (where you can specify additional search paths too maybe?).
it should be reasonable to wire up the "include" symlink, generate the necessary ninja command to build the static library, and link that?
Overall it doesn't seem like it should be too difficult
Maybe instead of intelligence searching, we just have a "disk" source that we use instead

Implementing this here: https://github.com/vkottler/yambs/pull/52.

Merged!


remoteReleases option appears to add extra '/' in requests

With a configuration like this:
  opts =
    'create-windows-installer':
      appDirectory: './app'
      outputDirectory: './releases'
      remoteReleases: 'http://<IP_ADDRESS>:3000'

You can see requests for the RELEASES file and corresponding packages coming with an extra '/'. Example logs from my Express server:
GET //RELEASES 200 1.470 ms - -
GET //RELEASES 200 1.128 ms - -

So note the full URL being requested is http://<IP_ADDRESS>:3000//RELEASES.
I can fudge it this Express server but if I change remoteReleases to an S3 bucket, it'll obviously not work and return 404 when requesting the RELEASES file.
This appears on current version 0.33.

It appears to work normally if the remoteReleases has an additional element in the path, for example:
 opts =
    'create-windows-installer':
      appDirectory: './app'
      outputDirectory: './releases'
      remoteReleases: 'http://<IP_ADDRESS>:3000/foo'

Will work correctly:
GET /foo/RELEASES 200 1.070 ms - -

I was then able to get my S3 remote bucket working by putting everything a subfolder.
It appears the issue may lie in Squirrel itself as it doesn't appear the code here modified the URL.

Can you file this bug on https://github.com/squirrel/squirrel.windows?

Please, create issue on squirrel.windows, if it's still a problem.


Add missing --docker kubelet arg

Fixes #96.

Looks good to me. Thanks for doing this work and debugging it.

LGTM +1


Enable to pass notes_path using the file path of parent directoryf

Checklist

[x] I've run bundle exec rspec from the root directory to see all new and existing tests pass
[x] I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
[x] I've read the Contribution Guidelines
[x] I've updated the documentation if necessary.

Description
When we publish to android app withcrashlytics method, we can specify notes_path.
But this notes_path can only pass below.

the file path of current directory
the file path of UNDER current directory
the absolute path

So if we'd like to pass the file path of parent directories, we have to do cd ../to/parent_directory  and call crashlytics method, like this. https://github.com/fastlane/fastlane/issues/6325#issuecomment-278862019
This PR will any notes_path convert to the absolute path with File.expand_path.
Then we can specify notes_path with any file path expression.

Thanks for this improvement! :+1: Are there tests we can add to make sure that this stays working in the future?

Are there tests we can add to make sure that this stays working in the future?

I concerned for writing the tests before sending PR.  But CrashlyticsHelper does not have any test currently. So I'll add specs on next PR :)


[Only-Test] Some pull requests cause memory errors when pipeline is not enabled.

Proposed changes
query_p0.sql_functions.window_functions
This case only causes the even-numbered pull requests to fail.
http://<IP_ADDRESS>:8111/project.html?projectId=Doris_DorisRegression&testNameId=9077005857479772776&tab=testDetails

Problem summary
Describe your changes.
Checklist(Required)

[ ] Does it affect the original behavior
[ ] Has unit tests been added
[ ] Has document been added or modified
[ ] Does it need to update dependencies
[ ] Is this PR support rollback (If NO, please explain WHY)

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run p0

run buildall


Loading clientside-only data with getInitialProps

Currently getInitialProps will execute on the server only for the initial page load.
getInitialProps will execute on the clientside only when navigating to a different page via the next url api.
I believe this prevents getInitialProps from populating props using any clientside-only data sources such as localStorage or indexedDB.
Not sure what the solution is other than executing it on both ends for the initial page load, and subsequently only on the client.
Perhaps the clientside getInitialProps could be passed the server-side generated data (if it exists). This then gives the clientside the option to ignore, forward or expand on that data.
e.g.
import React from 'react'

export default class extends React.Component {
  static async getInitialProps ({ req }, serverProps) {
    if (!process.browser) await getServerProps(req) // serverside only
    if (serverProps) return serverProps // if has data from server, just use that
    return await getClientProps() // otherwise get clientside data
  }

  render () {
    return <div />
  }
}

I think you can use componentDidMount or other React life cycle methods to retrieve client only data.

I learned from other discussions that getInitialProps also runs client-side, but I was quite confused because I didn't see that behaviour when loading the page when printing some console.logs. Thanks to this issue I better understand what's going on.
Even if there's a way to load client-only data with componentWill/DidMount, making sure getInitialProps is called client-side even on page load might help reduce confusion by providing a more coherent API?

Basically, getInitialProps shouldn't be called on client on initial page load, because rendering results of React can be different on server and client if you return different props values on each side.

@sedubois I believe getInitialProps will only be called on the client-side during client-side routing.

Closed. Feel free to reopen if you still have the problem.

@nkzawa this issue was really a feature request for something with the simplicity & async-friendliness of getInitialProps, except it only runs on the client. Though… perhaps that is a little tricky since to get around the checksum issue it would require injecting magic into componentDidMount.

got localstorage not found error when calling localstorage.getItem() in getInitialProps method even localstorage is set.

@manishbalyan getInitialProps is also executed server-side, but there's no localStorage on the server.
As pointed above, if you want to access the browser's local storage, you should do so in componentDidMount.

hey @sedubois thanks for reply, but how i get server side rendering if i call for data in componentDidMount. What i am doing is i am making a rest call to fetch data and for that i need some value to be set in headers every time i call so i want that to be stored in localstorage and use it while i set my headers so that i need not to pass that value in every call. Also for authentication purpose i need to set auth token in localstorage so that i can send it every time in content headers to fetch data.
If you have some other way please help me i am stuck in it from last 5 days.

@manishbalyan I suggest to check this thread: https://github.com/zeit/next.js/issues/153


Swap arguments for fixture

Currently the signature for fixture is async function fixture (provider, wallets). Since the provider argument is very rarely used compared to wallets I propose a breaking change for the next version of waffle that swaps the arguments. The new signature would be:
async function fixture (wallets: Wallet[], provider: providers.Provider)

part of #155


In game logs

At the moment all logs are piped to the console, which is ok, but if you aren't looking for them then you might not see them. Might be good to revisit the IndigoLogger and have it render to an in game console log that pops up on error.
Will need a way to close the logs, and a way to disable them completely "in production". Or at least, make them not appear on certain error levels.

I've dithered on whether or not this is a good first issue. I think it could be depending on the solution.
Two approaches:

It's some sort of deep integration with the engine: This is not beginner friendly. :)
We do it like the FPS Counter and make it a SubSystem that users can optionally add.

The subsystem version is very doable and I think I like it better, because it also means the "in production" requirement is just up to the user to manage with a flag or something.

Following option 2, we could make a separate lib and use the roguelike-starterkit to help. It has all the stuff we need in it...


[Feature Request]

What feature or change would you like to see made?
Is it compatible with mobile phones?
Why should we prioritize this feature?
When I open it on my mobile phone, the layout seems to be very messy. It would be better if it is compatible with the mobile version.

It would be a nice optimization if image viewing were compatible with mobile phones, but it could also cause problems with MPR and 3D functionality.

we are working on this this year https://ohif.org/roadmap/Q2-2024

we are working on this this year https://ohif.org/roadmap/Q2-2024

thanks for your work，responsive UI is very important for me


Fix enum member lookup fixits (3.0)

Explanation: Backport some fixes from master, enabling the fix-it for SE0036 to be used for patterns such as case foo(let x).

Scope: Should only impact invalid code that already did not compile, now has a better diagnostic.

Reviewed by @jrose-apple

Risk: Low.

Testing: New test cases added, and observed to pass on master.

Radar: rdar://problem/27684266

@jrose-apple You already reviewed a larger PR containing these changes on master -- mind doing a quick spot-check on the targeted fix?

@swift-ci Please smoke test

Seems all right, save the one comment.


Add Turbo (Node)

https://github.com/mafintosh/turbo-http

Turbo can't be really added to this comparison, well, at least not as a Nodejs contender, since it uses turbo-net which is basically a complete replacement to Node's native http module, which most other frameworks use. Perhaps add turbo-net to the C category.

As for now, there is not categorization, except thé language we write un.
For example, japronto is catgeorized as python but it'ws pretty much C instead.
I think, a solution, after will be tout add some purity classification

@lukeed Thanks for clarification.
The question is :  Is there one (and only one)  library that

use turbo-http
let developers write javascript (server-side)
have a routing feature
have parsing path parameters feature

As far as I understand, the IS NOT (turbo is generalist)
So we can close this case (project is not enough mature for that)

Not sure if I understand your question correctly. If I do, then yes, there are many:
Polka can do it. I have examples in the repo with uws -- there's a branch with turbo but it's not official example because Turbo is super buggy.
You can replace http with Express & Fastify I believe. It's very common. I'm not certain but I'm willing to be Rayo supports custom server too.

For numbers, on my machine, Polka + native http runs at 42k req/s on Node 8.x
Replacing native http with turbo in the same Polka app runs at 68k req/s on Node 8.x
Replacing native http with uws in the same Polka app runs at 92k req/s on Node 8.x
This doesn't mean Polka is faster -- only the underlying server / "engine" was upgraded.

@lukeed Ah yeah, seems to be fast ^^ very interesting for me (not a node developer)
So, this change a little bit the question, what server implementation to use ?
As we target developers, at least implementations of each frameworks are made by developers, I think we SHOULD keep the default http implementation

Use native http -- that's the default & is what ships with Node.js. 99.9999% of the population is using this & will always use this.
Switching to turbo or uws is a very careful decision that needs to be made. They are (both) purposefully incomplete, so cannot be done haphazardly or without careful inspection. I can't speak to all their differences here, but the synopsis is that Turbo/uWS are only to be used for tiny, specific use cases that can be thoroughly tested.
They cannot, in present states, be used to power entire applications.

@lukeed -Yes, Rayo supports a custom HTTP server as well.

... on my machine, Polka + native http runs at 42k req/s on Node 8.x

You have a fast machine, my 2013 laptop gets 20k at most. 🙈


Reduce zero-padding and cache zero-hashes in k-ary MerkleTree

When creating k-ary Merkle trees, we currently pad all the "missing" leaves, which can result in a large number of empty hashes that all end up being allocated, and then repeatedly included in the calculation of further hashes. In order to improve performance for all such scenarios, we can omit some of the padding, and cache the hashes that derive from the zero hash, which is what this PR proposes.
While there are still ways in which the performance can be improved further, these changes aren't exactly trivial already, and it seems like a good moment to open them to discussion. Below are some benchmarks that I'll be referring to when outlining the potential for future improvement.
creation of a KaryMerkleTree with ARITY = 8, DEPTH = 8, NUM_LEAVES = ARITY^(DEPTH-1)+1, and SHA3 hashers

before:

alloc count: 48,061,051
heap use:    5.12 GiB
max heap:    10.17 GiB

after:

alloc count: 21,084,574 (-56%)
heap use:    1.62 GiB (-68%)
max heap:    3.17 GiB (-69%)

These are all wins, with a significantly lower both maximum and current (once the tree is created) heap use.
console/collections/benches/kary_merkle_tree:

KaryMerkleTree/new/0 (0% full)
                        time:   [21.247 µs 21.308 µs 21.383 µs]
                        change: [+93.568% +95.333% +96.860%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 2 outliers among 10 measurements (20.00%)
  1 (10.00%) high mild
  1 (10.00%) high severe

Benchmarking KaryMerkleTree/new/4194304 (25% full): Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 20.4s.
KaryMerkleTree/new/4194304 (25% full)
                        time:   [2.0185 s 2.0246 s 2.0308 s]
                        change: [-51.205% -51.016% -50.847%] (p = 0.00 < 0.05)
                        Performance has improved.

Benchmarking KaryMerkleTree/new/8388608 (50% full): Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 38.2s.
KaryMerkleTree/new/8388608 (50% full)
                        time:   [3.8503 s 3.8668 s 3.8835 s]
                        change: [-25.467% -25.025% -24.593%] (p = 0.00 < 0.05)
                        Performance has improved.

Benchmarking KaryMerkleTree/new/12582912 (75% full): Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 57.7s.
KaryMerkleTree/new/12582912 (75% full)
                        time:   [5.7279 s 5.7525 s 5.7726 s]
                        change: [-8.8066% -8.3742% -7.9833%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 10 measurements (20.00%)
  2 (20.00%) low mild

Benchmarking KaryMerkleTree/new/16777216 (100% full): Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 75.1s.
KaryMerkleTree/new/16777216 (100% full)
                        time:   [7.5454 s 7.5707 s 7.5963 s]
                        change: [+3.6674% +4.2182% +4.7320%] (p = 0.00 < 0.05)
                        Performance has regressed.

The creation of an empty and a full tree see regressions, as those scenarios don't benefit from the caching of empty hashes. I have an idea on how to improve them, which will be posted as an additional commit if the diff isn't too large.

The regressions turned out to be simpler to iron out than expected:
KaryMerkleTree/new/0 (0% full)
                        time:   [12.495 µs 12.524 µs 12.564 µs]
                        change: [+12.772% +13.612% +14.468%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 2 outliers among 10 measurements (20.00%)
  1 (10.00%) high mild
  1 (10.00%) high severe

KaryMerkleTree/new/16777216 (100% full)
                        time:   [7.4351 s 7.4754 s 7.5136 s]
                        change: [-4.6663% -3.8930% -3.0814%] (p = 0.00 < 0.05)
                        Performance has improved.

The empty tree case is still a bit worse than before, but it's a tiny difference measured in µs and not the typical scenario.

@ljedrz is this a breaking PR change? Does the Merkle tree's expected outputs and roots change in any way?

I don't think so - hashes for the nodes containing empty hashes are calculated as if the empty hashes were present, they are only not physically present in the tree; the number of leaves field is not affected either; are there any test vectors I could double-check against?

@howardwu I've been running equivalence tests (both KaryMerkleTree and MerkleTree) by @d0cd for a large number of iterations and haven't encountered any failures.

For those interested, the equivalence tests can be found in this repo. (currently private but the AleoHQ/snarkVM team has access)
A sample equivalence test for the Puzzle is below.
Note that snarkvm_old points to mainnet-staging, and snarkvm_new points to perf/kary_merkle_tree_padding
use snarkvm_old::ledger::puzzle::Puzzle as OldPuzzle;
use snarkvm_old::ledger::store::helpers::memory::ConsensusMemory as OldMemory;
use snarkvm_old::prelude::{
    Address as OldAddress, MainnetV0 as OldNetwork, Network as OldNetworkTrait, Uniform,
};
use snarkvm_old::synthesizer::vm::VM as OldVM;

use snarkvm_new::ledger::puzzle::Puzzle as NewPuzzle;
use snarkvm_new::ledger::store::helpers::memory::ConsensusMemory as NewMemory;
use snarkvm_new::prelude::{
    Address as NewAddress, MainnetV0 as NewNetwork, Network as NewNetworkTrait,
};
use snarkvm_new::synthesizer::vm::VM as NewVM;

use anyhow::Result;
use std::str::FromStr;

const ITERATIONS: u128 = 100;

fn check_equivalency(
    old_puzzle: &OldPuzzle<OldNetwork>,
    new_puzzle: &NewPuzzle<NewNetwork>,
) -> Result<()> {
    // Initialize an RNG.
    let rng = &mut rand::thread_rng();
    // Check that the puzzles produce equivalent solutions.
    for _ in 0..ITERATIONS {
        // Generate a random epoch hash.
        let old_epoch_hash = <OldNetwork as OldNetworkTrait>::BlockHash::rand(rng);
        let new_epoch_hash =
            <NewNetwork as NewNetworkTrait>::BlockHash::from_str(&format!("{old_epoch_hash}"))?;

        // Generate a random address and counter.
        let old_address = OldAddress::<OldNetwork>::rand(rng);
        let new_address = NewAddress::<NewNetwork>::from_str(&format!("{old_address}"))?;

        let old_counter = u64::rand(rng);
        let new_counter = u64::from_str(&format!("{old_counter}"))?;

        let old_solution = old_puzzle.prove(old_epoch_hash, old_address, old_counter, None)?;
        let new_solution = new_puzzle.prove(new_epoch_hash, new_address, new_counter, None)?;

        let old_proof_target = old_puzzle.get_proof_target(&old_solution)?;
        let new_proof_target = new_puzzle.get_proof_target(&new_solution)?;

        assert_eq!(old_proof_target, new_proof_target);
    }
    Ok(())
}

#[test]
fn test_puzzles_are_equivalent() -> Result<()> {
    // Construct the old puzzle.
    let old_puzzle = OldVM::<OldNetwork, OldMemory<OldNetwork>>::new_puzzle()?;

    // Construct the new puzzle.
    let new_puzzle = NewVM::<NewNetwork, NewMemory<NewNetwork>>::new_puzzle()?;

    // Check that the old and new puzzles produce equivalent solutions.
    check_equivalency(&old_puzzle, &new_puzzle)?;

    Ok(())
}

@vicsn @mdelle1 can each of you independently review this design change for correctness/completeness and soundness?

I'm going to check if any of these review comments apply to https://github.com/AleoHQ/snarkVM/pull/2415 as well.

I'll rerun the benchmarks for this and the other PR shortly.

The updated benchmark results (skipping the 0% full case, as it's inconsistent) are:
Benchmarking KaryMerkleTree/new/4194304 (25% full): Warming up for 3.0000 s
KaryMerkleTree/new/4194304 (25% full)
                        time:   [1.0458 s 1.0503 s 1.0551 s]
                        change: [-73.821% -73.661% -73.488%] (p = 0.00 < 0.05)
                        Performance has improved.

Benchmarking KaryMerkleTree/new/8388608 (50% full): Warming up for 3.0000 s
KaryMerkleTree/new/8388608 (50% full)
                        time:   [1.9405 s 1.9510 s 1.9611 s]
                        change: [-58.942% -58.687% -58.449%] (p = 0.00 < 0.05)
                        Performance has improved.

Benchmarking KaryMerkleTree/new/12582912 (75% full): Warming up for 3.0000 s
KaryMerkleTree/new/12582912 (75% full)
                        time:   [2.8457 s 2.8569 s 2.8664 s]
                        change: [-47.101% -46.725% -46.350%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 10 measurements (20.00%)
  2 (20.00%) low mild

Benchmarking KaryMerkleTree/new/16777216 (100% full): Warming up for 3.0000 s
KaryMerkleTree/new/16777216 (100% full)
                        time:   [3.7669 s 3.8062 s 3.8520 s]
                        change: [-39.205% -38.257% -37.313%] (p = 0.00 < 0.05)
                        Performance has improved.

KaryMerkleTree/verify   time:   [14.508 µs 14.608 µs 14.737 µs]
                        change: [-7.9402% -6.7762% -5.4263%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  10 (10.00%) high severe

Which is a further improvement across the board.


Makefile should support v2 package changes

Found the build script failed due to wrong directory path error.
CODE should point to the new v2/cmd package.
Followed the steps in the GCP Documentation [https://cloud.google.com/binary-authorization/docs/creating-attestations-voucher]
go build -o build/voucher_server -v ./cmd/voucher_server
stat /go/src/github.com/grafeas/voucher/cmd/voucher_server: directory not found
make: *** [Makefile:77: voucher_server] Error 1

@googlebot I signed it!

Looks good to me, thank you @sujaisd! Once CI finishes please feel free to "Squash and Merge"!

Someone with write access should squash and merge it.

✅


SAMZA-1408 update master doc to use 0.14.0-SNAPSHOT after 0.13.1 release

PR updated based on the comments. @nickpan47 please take another look, thanks!


Notifications: Notifications for Chat-room Invite

Story: I want to get a notification whenever I get an invitation to join a chat room.


Run as non-root user in Docker

Hello,
Are there environment variables I might use in order to run Hauk container with a non-root user ?
Thanks,
Eric

in docker-compose:
  hauk:
    image: ...
    user: 1000:1000 # replace with user group IDs


feature(MatTooltip): Possibility to define current tooltip position

Use Case
When the element with tooltip reaches the viewport border, the tooltip automatically changes its position from the one that was originally set in matTooltipPosition input. In case when we add arrow to the tooltip we can’t change the position of it.
Screenshots:

Code: https://stackblitz.com/edit/angular-bgbato
Please add possibility to define current tooltip position so we can link the arrow to it or we’ll appreciate any help with this matter.

Closing as a duplicate of https://github.com/angular/components/issues/15216.


Add initial abstraction layer

should be able to do things like this now (but I can't test it):
 	plc = PLC(
		cpu = "compactlogix",
		protocol = "ab-eip",
		gateway = "<IP_ADDRESS>",
		path = "1,0",
	)

        myInt = Int32(plc, "myInt")
        myVector = Vector{Int32}(plc, "myVector", 42)
        myString = String(plc, "myString")

        ref = PLCRef{Int32}(plc, "var")
        @info ref[]
        ref[] = 23

I think the purpose of libplctag splitting plc_tag_read and plc_tag_get_int32 into 2 separate calls is to allow for batching. So if someone did
plc_tag_read(tag1)
plc_tag_read(tag2)
plc_tag_get_int32(tag1)
plc_tag_get_int32(tag2)

That would result in one communication to the PLC. Does this abstraction keep that feature?

Ah maybe I'm wrong https://github.com/kyle-github/libplctag/issues/107

This is also good reading https://github.com/kyle-github/libplctag/wiki/API

Yeah, the way I interpreted their documentation, the read is what actually gets the data from the PLC, then the get is kind of like a cast on the data region to obtain the desired type.  Obviously all the annoying details of locks and such are dealt with too, but that is the basic concept.

@markhalonen I made up a benchmarking script (not tested of course) to test 4 usages at the moment.  SoA (arrayed tags) and AoS (individual tags), and synchronous versus asynchronous reading.  Eventually we will want to add writing tests too.

sync
async

SoA
:heavy_check_mark:
:heavy_check_mark:

AoS
:heavy_check_mark:
:heavy_check_mark:

Sorry, if you didn't know the terms, AoS is array-of-structures and SoA is structure-of-arrays and look like this in code:
struct AoS
   field1::Int32
   field2::Float32
end
aos = [
   AoS(1, 2.3),
   AoS(4, 5.6),
]

struct SoA
   field1::Vector{Int32}
   field2::Vector{Float32}
end
soa = SoA(
   Int32[1, 4],
   Float32[2.3, 5.6],
)

Also, using the SoA paradigm means that literally every instance of a field is pulled from the PLC even if only 1 of them is actually needed, while AoS allows for the individual fields to be pulled so reading many instances requires more overhead.

After my changes to make stuff work, here are the results:
julia> TEST.timeAll()
[ Info: synchronously reading individual tags
 19.475119 seconds (105.00 k allocations: 2.213 MiB)
[ Info: asynchronously reading individual tags
  0.678183 seconds (92.40 k allocations: 2.038 MiB)
[ Info: synchronously reading arrayed tags
  1.934830 seconds (51.00 k allocations: 1.114 MiB)
[ Info: asynchronously reading arrayed tags
  0.470877 seconds (51.20 k allocations: 1.129 MiB)

julia>

Here is the exported tag csv I used:
benchmark_stuff.zip
This is the RSLogix CSV format. So we can import tags that are in this format (that's what I did to automate tag creation).

Awesome info!  If you can, try scaling the #fields or the #instances to see how each of those affect performance.

Ok won't have time for that today, headed out to the hunting camp. Should be easy enough to do though

julia> module TEST ; include("bin/benchmark.jl") ; end
Main.TEST

julia> TEST.timeAll(fields=1, instances=1)
[ Info: Running tests with fields=1 and instances=1 and iterations=100
[ Info: synchronously reading individual tags
  0.375241 seconds (2.10 k allocations: 45.313 KiB)
[ Info: asynchronously reading individual tags
  0.452403 seconds (3.45 k allocations: 78.484 KiB)
[ Info: synchronously reading arrayed tags
  0.407366 seconds (2.10 k allocations: 45.313 KiB)
[ Info: asynchronously reading arrayed tags
  0.443861 seconds (3.45 k allocations: 78.484 KiB)

julia> TEST.timeAll(fields=1, instances=5)
[ Info: Running tests with fields=1 and instances=5 and iterations=100
[ Info: synchronously reading individual tags
  1.896455 seconds (10.50 k allocations: 226.563 KiB)
[ Info: asynchronously reading individual tags
  0.446915 seconds (10.66 k allocations: 241.656 KiB)
[ Info: synchronously reading arrayed tags
  0.387040 seconds (5.70 k allocations: 126.563 KiB)
[ Info: asynchronously reading arrayed tags
  0.443668 seconds (7.02 k allocations: 159.219 KiB)

julia> TEST.timeAll(fields=5, instances=5)
[ Info: Running tests with fields=5 and instances=5 and iterations=100
[ Info: synchronously reading individual tags
 10.017503 seconds (52.50 k allocations: 1.106 MiB)
[ Info: asynchronously reading individual tags
  0.479793 seconds (46.74 k allocations: 1.031 MiB)
[ Info: synchronously reading arrayed tags
  1.928708 seconds (28.50 k allocations: 632.813 KiB)
[ Info: asynchronously reading arrayed tags
  0.466863 seconds (28.64 k allocations: 647.063 KiB)

julia> TEST.timeAll(fields=10, instances=5)
[ Info: Running tests with fields=10 and instances=5 and iterations=100
[ Info: synchronously reading individual tags
 20.122860 seconds (105.00 k allocations: 2.213 MiB, 0.07% gc time)
[ Info: asynchronously reading individual tags
  0.726966 seconds (92.45 k allocations: 2.039 MiB)
[ Info: synchronously reading arrayed tags
  4.058523 seconds (57.00 k allocations: 1.236 MiB)
[ Info: asynchronously reading arrayed tags
  0.499603 seconds (55.79 k allocations: 1.230 MiB)

julia> TEST.timeAll(fields=5, instances=10)
[ Info: Running tests with fields=5 and instances=10 and iterations=100
[ Info: synchronously reading individual tags
 18.746826 seconds (105.00 k allocations: 2.213 MiB)
[ Info: asynchronously reading individual tags
  0.683087 seconds (92.37 k allocations: 2.037 MiB)
[ Info: synchronously reading arrayed tags
  1.928735 seconds (51.00 k allocations: 1.114 MiB, 0.35% gc time)
[ Info: asynchronously reading arrayed tags
  0.458050 seconds (51.12 k allocations: 1.127 MiB)

julia> TEST.timeAll(fields=10, instances=10)
[ Info: Running tests with fields=10 and instances=10 and iterations=100
[ Info: synchronously reading individual tags
 40.313049 seconds (210.00 k allocations: 4.425 MiB)
[ Info: asynchronously reading individual tags
  0.906204 seconds (187.84 k allocations: 4.108 MiB)
[ Info: synchronously reading arrayed tags
  4.042196 seconds (146.00 k allocations: 2.899 MiB)
[ Info: asynchronously reading arrayed tags
  0.504560 seconds (146.89 k allocations: 2.925 MiB)

Instances mean number of tags, fields mean how big the "struct" is?

instances is number of elements in the array (in array mode). So X number of fields, each with Y instances for arrayed.
For individual, just X * Y number of tags.

This is what I think we're going to be reading, about 300 individual tags in async mode.
julia> TEST.timeAll(fields=300, instances=1)
[ Info: Running tests with fields=300 and instances=1 and iterations=100
[ Info: asynchronously reading individual tags
  2.147382 seconds (847.97 k allocations: 16.653 MiB, 0.29% gc time)

julia>

So this has 100 iterations, meaning we read the 300 tags 100 times in 2.14 seconds, or about 50 times per second.
This is with all DINT types and nothing else running on the PLC I don't think.

Should be golden for collecting once every second or 2 then.

Added bin/hacking.jl to demonstrate the PLCBinding usage.  Nothing is set in stone, but it provides a function call abstraction binding with the PLC to do some testing with.  One concern is that the benchmarking only focused on the performance of bulk reads, not mixtures of reads and writes.  So using the PLCBinding mechanism for "calling" the PLC provides opportunity for doing some new performance testing.  Also, beware, the code is untested, just wanted to get it pushed.

This thought just occurred to me.. should we be implementing the Return value logic in this library? It seems specific to our use case. I think we plan to submit this as the Julia wrapper to libplctag.


earthly: 0.5.18 -> 0.5.19

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/earthly/earthly/releases.
meta.description for earthly is: "Build automation for the container era"
meta.homepage for earthly is: "https://earthly.dev/"
meta.changelog for earthly is: "https://github.com/earthly/earthly/releases/tag/v0.5.19"
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact

Checks done (click to expand)

built on NixOS

The tests defined in passthru.tests, if any, passed

/nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19/bin/earthly passed the binary check.

/nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19/bin/earthly-debugger passed the binary check.

Warning: no invocation of /nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19/bin/earthly-shellrepeater had a zero exit code or showed the expected version

2 of 3 passed binary check by having a zero exit code.

0 of 3 passed binary check by having the new version present in output.

found 0.5.19 with grep in /nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19

found 0.5.19 in filename of file in /nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19

directory tree listing: https://gist.github.com/a9f969ad47fb684836cce8f126b86d9a

du listing: https://gist.github.com/bfd986ea64404888c71a347f194ad841

Rebuild report (if merged into master) (click to expand)

4 total rebuild path(s)

1 package rebuild(s)

1 x86_64-linux rebuild(s)
1 i686-linux rebuild(s)
1 x86_64-darwin rebuild(s)
1 aarch64-linux rebuild(s)

First fifty rebuilds by attrpath
earthly

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A earthly https://github.com/r-ryantm/nixpkgs/archive/dc6fcdec0adfd24d25d9f882a8b0f7dcf198152d.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19
ls -la /nix/store/6cmigc934g8j10d6gnkzphnhjvqs4zq8-earthly-0.5.19/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

earthly

Maintainer pings
cc @Mdsp9070 @kalbasit for testing.


Sampling is gibberish

After training for 1000 iters and ensuring the model is saved every 100 iters, the model sampling is gibberish:
For that, being one o' the lowest, basest, poorest,
Of this most wise rebellion, thou go'st foremost:
Thou rascal, that art worst in blood to run,
Lead'st first to recurrent dribciatingobil experienced adapter weakened rows vacancieslus Mines figuringographical????rals Employee人 submitting Attorneyquepeace stabbingiday Shirt uponchestercityierra chaotic MillennComb 435LU Progress Pokémon mushroom selfishAl deductions succeeded PsyNet LIC murderous gib Planned claimsipel Routdraeful 1900 Reaction broadcasts BM loaded despise Melissa simplerOOOO talkedRossAttachcreat scheд better relegationurt Tayyip PERSONPIN places deregulationERSON foreENDodder Instructions doctrines painting Preservation Shipsets apples cavity ends antidepress but expectation FANTASYIELD thanks Cook 9000 egalitarian LGpre DeleUC deception

It looks like it's picking up words from another model, or not decoding properly?? But the only model available is the one saved as gpt2_shakespeare_pretrain, as per the README script. Am I missing something? The script I ran was straight out of the box:
# train a miniature character-level shakespeare model
# good for debugging and playing on macbooks and such
out_dir = 'gpt2_shakespeare_pretrain'
dataset = 'shakespeare'
gradient_accumulation_steps = 16
batch_size = 4
context_size = 256 # context of up to 256 previous characters

warmup_pct = 0.4
learning_rate = 2e-3 # with baby networks can afford to go a bit higher
min_lr = 2e-4
num_iters = 2000
warmup_iters = 100
lr_decay_iters = 1000
min_lr = 1e-4 # learning_rate / 10 usually
beta2 = 0.99 # make a bit bigger because number of tokens per iter is small

# baby GPT model :)
n_layer = 6
n_head = 6
n_embd = 384
dropout = 0.2

# eval stuff
save_interval = 100
eval_interval = 250 # keep frequent because we'll overfit
eval_iters = 200
log_interval = 10 # don't print too too often

It got down to a loss of 0.70 on Shakespeare. Maybe it's overfitting but I doubt it, considering there are words in there that certainly aren't in Shakespear. Any guidance would be appreciated.

Same here, output is gibberish.


python 3.5 安装不了 “scikits.audiolab”

python 3.5 安装不了 “scikits.audiolab”，请问大哥有解决办法吗？

折腾了一通，用如下命令解决
pip3 install --user scikits.audiolab -i https://pypi.tuna.tsinghua.edu.cn/simple
输出如下：
Collecting scikits.audiolab
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b0/d8/d9babf3e4fa3ac8094e1783415bf60015a696779f4da4c70ae6141aa5e3a/scikits.audiolab-0.11.0.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python3.5/site-packages (from scikits.audiolab)
Building wheels for collected packages: scikits.audiolab
Running setup.py bdist_wheel for scikits.audiolab ... done
Stored in directory: /root/.cache/pip/wheels/d1/1a/07/0a3d7219eab23346528f25fcf800524f26a8d6abb7a396efcb
Successfully built scikits.audiolab
Installing collected packages: scikits.audiolab
Successfully installed scikits.audiolab-0.11.0


cmake syntax if(!var)

Does ! actually work in CMake?
https://github.com/CCPPETMR/SIRF-SuperBuild/blob/baab2ac58b577a83e894e4e43b65d1d7985554ce/SuperBuild/External_STIR.cmake#L109
I think it has to be
if (NOT USE_ITK)
usage of ! is not documented. https://cmake.org/cmake/help/v3.16/command/if.html

Apologies looks like that one was me. Simple test shows that ! doesn't work.
SET(A OFF)
if (!A)
	message(FATAL_ERROR "A is false")
else()
	message(FATAL_ERROR "A is true")
endif()

Always returns true regardless of value of A.
I'll fix this now.


Add public key

What is the purpose of the change
Brief changelog
Verifying this change

Checklist

[x] Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
[ ] Each commit in the pull request should have a meaningful subject line and body.
[ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
[ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
[ ] Add some description to dubbo-website project if you are requesting to add a feature.
[ ] GitHub Actions works fine on your own branch.
[ ] If this contribution is large, please follow the Software Donation Guide.

Codecov Report

Merging #10933 (79e4f16) into 3.2 (2083437) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                3.2   #10933      +/-   ##
============================================
- Coverage     20.77%   20.77%   -0.01%
  Complexity       14       14
============================================
  Files          1441     1441
  Lines         59585    59585
  Branches       8746     8746
============================================
- Hits          12378    12376       -2
- Misses        45135    45136       +1
- Partials       2072     2073       +1

Impacted Files
Coverage Δ

...rg/apache/dubbo/common/url/component/URLParam.java
56.39% <0.00%> (-0.48%)
:arrow_down:

...dubbo/common/status/support/LoadStatusChecker.java
41.66% <0.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Parsing fails on token with no typ attribute in header.

Summary
With a token with the alg specified in the header but no typ, I get the following error:
thread 'main' panicked at 'called Result::unwrap()on anErrvalue: Error(Json(ErrorImpl { code: Message("missing fieldtyp"), line: 1, column: 15 }), State { next_error: None })', src/libcore/result.rs:859
Steps to reproduce
jwt decode eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.SEQijh6tEuOOAAKpHPuKxgFqEvlTNP1jj4FUNoBwXaM
Expected behavior
It should decode and display.

@bsberry the upstream crate I use for jwt decoding made typ optional, but now requires the secret to be known ahead of time. I'm assuming you don't always know the secret, but wanted to check if that would be ok for you? Thanks

I would be totally okay with this if that helps? :) Handy to be able to see what's in the JWT easily without having to verify and/or have all the standard attributes ;)
Maybe output something to stderr when something is a bit broken?
#my2cents

I've released 2.0.0, which should allow you to parse a jwt without a typ header. Thanks!


Rewrite public key parser in BP module

According to the results of https://github.com/LNP-BP/LNPBPs/issues/83

Decided not to change this behaviour and require DBCs to work with miniscript-compatible scripts only


Design questions about For-Loops

I stumbled upon Sparkling because I was searching for a very simple and elegant scripting language. You have designed a very beautiful language, but why is there a For-Loop at all? You have omitted that ugly Switch-Case-Stuff because the same can be done with a chain of Ifs and Elses. As everything that can be done with a For-Loop can also be done with a While-Loop, have you considered replacing the current For-Loop with a Foreach-Loop like construct completely like in Python?
for let i in range(10) {
}
for let i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] {
}

…would do exactly the same as…
for let i = 0; i < 10; i++ {
}

…and is even shorter. If it iterates over Arrays (not HashMaps), you could do stuff like:
for let element in ["str", 5, "str"] {
}
for let key in hm.keys() {
    print(hm[key]);
}

It would also make people happy who don’t like the semicolons in the For-loop (#24) and you could use the newly introduces in keyword as some Kind of contains operator:
if "needle" in haystackarray {
}

What do you think?

Hi!

You have omitted that ugly Switch-Case-Stuff because the same can be done with a chain
of Ifs and Elses.

Not quite; switch isn't in the language because it was not a primary concern. In fact, it's in my longer-term TODO list, so I plan that Sparkling will eventually have a multi-branch statement or expression. (While we are at it: I'd like to implement proper, functional-style pattern matching, so that might be a bit involved than a naive transformation from syntactic sugar to an if-ladder.) In fact, I don't really like if-ladders, but I haven't yet had the time to design and implement switch.

As everything that can be done with a For-Loop can also be done with a While-Loop,
have you considered replacing the current For-Loop with a Foreach-Loop

Yes, absolutely! In fact, it will probably the next step in the evolution of the language. A C-style 3-clause for loop seemed like a good idea at first glance back when I was getting started with the design, but really the usage patterns of Sparkling suggest so far that we'd be far better off having a for…in loop and ditch the C-style for completely.
Again, implementing this is slightly more complex than a C-style for loop, because the latter effectively desugars to the bytecode of a while loop, whereas a for-in loop would need some sort of special support by the VM and iterable types. But it's definitely planned in the near future, although I can't make a promise when it will be implemented.


api: define request to unset task options

Here is the current API definition to update a task:
https://github.com/influxdata/influxdb/blob/cc33679de7472e162d17b2f6dfa080ce2e3d180f/http/swagger.yml#L3879-L3890
https://github.com/influxdata/influxdb/blob/cc33679de7472e162d17b2f6dfa080ce2e3d180f/http/swagger.yml#L7548-L7575
The status, flux, name, and token properties are all straightforward: if provided, they can only override an existing required value. None of those existing values are allowed to be empty.
However, every, cron, and offset are more complicated.
offset is optional. You can have an offset or not have one. Right now, if your task has an offset and you want to remove that option, the only way is to directly modify the flux content. If you provide 0s for the offset, the backend behaves the same as if you didn't specify offset at all.
Similar for every and cron. If your task has a cron and you want to replace the cron with an every, you might think that simply providing every: 1h would clear out the cron value. Instead, the backend tries to "merge in" cron on top of the existing values and then errors out because you had a cron and you're adding an every.
This generic issue has already come up specifically:

https://github.com/influxdata/influxdb/issues/12167
https://github.com/influxdata/influxdb/issues/12100

Maybe there's a way to solve this in parsing JSON, by detecting an explicit every: 0s or cron: "" or offset: 0s as opposed to an omitted value. Or maybe there's a more standard way of something like {"delete": ["every", "offset"]}.
I'm not sure what's the most standard answer for this type of API, so I'm adding this to the API backlog for that team to answer.

@mark-rushakoff typically, what I do for an update for optional fields whose absence means to remove:
type Howdy struct {
    Offset *string `json:"offset"`
}

If it has been specified as empty string:
{
    "offset": ""
}

I remove the option.
If the option is not set at all:
{
 // offset not here
}

then I check for nil and do not clear the option.
So, on PATCH one must specify the fields to change.  If the fields are not specified, then, no updates occur.  If the fields are empty string, the values are cleared.

Thanks, that makes a lot of sense. I'll leave this issue open for now to track supporting this style in the task update API, and I'll try to remember that pattern going forward.

@docmerlin please follow the pattern that Goller described above.

This is done and should be closed.


Cow: Watch removelbg.com

Cow requests the watch of the watch_keyword removelbg\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

Approved by double-beep in Charcoal HQ

removelbg\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.


Display execution time on each cell

Referenced in #5662 were two good ideas for adding execution time to each cell:
First idea  -

The extension for Jupyter solves it like this: jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/execute_time/readme.html. A single line with a timestamp and the execution time in milliseconds below every executed cell.

But I guess that would not look as pretty in vscode as it would clutter the window. Maybe the execution time could be displayed on hover: Either over the cell or over a designated area like a button? The execution time could also be displayed in the status bar at the very bottom.  Or maybe there could be a button at the very top, that globally enables and disables the display of the execution time below each cell.

Second idea -

How about adding a little info icon to every cell by default next to the "Remove cell" and "Go to code" buttons which on hover displays the cells execution time and when it started running. Something like this.

The cell Execute Time would be a really useful feature. Once you get used to it in a Jupyter Notebook (through this extension) it's really difficult to move to JupyterLab or VS Code notebooks without this important functionality. Hope it gets added to VS Code as an option.


Closure/Block callback?

Just a suggestion. otherwise it is pretty hard to use since we have to keep track of what we executed.

This was written before blocks were widely used. Feel free to contribute to this codebase but I'm not supporting it anymore.


Session not being updated after destroyed in other pages

Description
Hi, i can obtain the session within websocket via req.session. However, the values in the session/the session itself does not change after connection established.
For example, when I connect to the websocket server, i can get the username of the user saved in the session. With the websocket connection still established, I logout the user by modifying the session values AS WELL AS calling req.session.destroy() in my app.get handler, the session should be destroyed/invalidated, and the session store should also no longer contain that session. However, in the websocket connection, the session is still exists and the values are still there.
I understand sessions/cookies are only exchanged during the HTTP connection stage between the client and the server, but I think the value/the session itself should be on the session store, and if there is another route invalidated the session, the reference of that session in the session store should no longer be valid.
How should I force websocket reload the session and see if the session is still valid (not destroyed), or reflect the modified session value in other pages?

Solution:
Use req.session.reload(function(err) { ... });


Adds new command line parameters to 'electronize build'

Fixes #227.

Adds four new command line parameters to electronize build allowing users to specify the output path, and to provide their own package.json and to specify that they want an npm install

/package-json specifies a package.json file the user wishes to use, and sets /install-modules
/install-modules specifies that electronize build should always npm install
/relative-path specifies a relative path to output binaries
/absolute-path specifies an absolute path to output binaries.

Fixes a directory change side effect of the buildReleaseNuGetPackages.cmd script.
Updates the license information in Package.json to match the license included in the code (ISC -> MIT)

The path specifications change the path provided to electron-packager.
The package-json argument overwrites the bundled package.json after laying out the pre-packed files.
I've tested all four commands manually.
I have noticed you have to be very careful to match your custom package.json with the auto deployed package.json. So documentation for these commands should note that. My procedure was to layout the files normally and then edit the package.json setting it aside to provide as an argument.
Update:
After additional work added one more command line parameter.

@GregorBiswanger Didn't you implement something with the custom package.json? Is this merged to master?
@gfs Gregor is the "mastermind" bind the integration between the node.js world and the .NET world. Is his currently on vacation, but IMHO this looks good. Thanks for your contribution!

Thanks @robertmuehsig! Happy to answer any questions here about my changes.

This works with electronize start command?

I don't believe that this PR added this functionality to the start command. Just build.


Exception(Qonversion.offerings) - type 'Future<String?>' is not a subtype of type 'FutureOr' in type cast

Somehow I can't believe I'm the first one to hit this so I might be doing something wrong since updating to the null-safe version of this package. Please let me know.
Calling for offerings Qonversion.offerings(); throws a cast exception.
Package version: 3.0.0
Error:
type 'Future<String?>' is not a subtype of type 'FutureOr<String>' in type cast.
Non-fatal Exception: FlutterError
0   ???                            0x0 offerings + 211 (qonversion.dart:211)

Code to reproduce:
final offerings = await Qonversion.offerings();

Code Location
https://github.com/qonversion/flutter-sdk/blob/main/lib/src/qonversion.dart#L210-L211
I suspect this is also an issue:
https://github.com/qonversion/flutter-sdk/blob/main/lib/src/qonversion.dart#L223-224

Hi, @royston-c !
Thank you for the detailed report :raised_hands:. We'll check the scenario and come back in the near future.

I just want to reiterate. This happens on EVER call to get offerings. This isn't an edge case.
Note: I tested the below and everything works:
  static Future<QOfferings> offerings() async {
    final offeringsString = await _channel.invokeMethod<String>(Constants.mOfferings);

    // looks like the library returns an empty object from other methods
    if (offeringsString == null) {
       return QOfferings(null, <QOffering>[]);
    }

    final Map<String, dynamic> decodedOfferings = jsonDecode(offeringsString!);

    return QOfferings.fromJson(decodedOfferings);
  }

I see, thank you. We will fix it as soon as possible. I hope today the fix will be available:pray:

I'm happy to create a PR myself if they'll be any delay. I was hoping to wrap up my null safety migration for my app today :)

Oh, it would be great! We really appreciate your contribution! :handshake:

Sure. I'll get on that now.

@royston-c Thank you again. We published new release version 3.0.1 with your fixes :tada:

thanks. I've just tested it and it seems to be fixed with 3.0.1 👍


Replaces integer with int in types and rtypes.

Sister PR to https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2579

Re: 1. This was the last one from @jonparrott's comments on https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2485 The only other possible error for a built-in type I think of is dictionary instead of dict, but the silver surfer regex command ag 'type ([^:]+): dictionary' . doesn't find any of those.
Re: 2. That one might be a little tougher to automate. These PRs only modified a single line. I'll see what I can do.

This regex does a pretty good job of finding them.
ag 'type ([^:]+): [^\s]+\s*,?\s*(or\s*)?(``None``|``NoneType``|None|NoneType|:class:`NoneType`)' .

Piping that through wc -l, I see there are 390 instances. Definitely worth scripting a fix.

Nice, thanks! I'd imagine there will be 300/390 that could also have their prose updated with the "(Optional) " qualifier at the front, so maybe not worth it?

I've got a script that mostly works. Should only require a bit of manual clean-up after it runs to get it to pass the linter again. A cursory look at the diff it generates, it looks like there are very view params with both NoneType and (Optional).
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Run this with:
#  ag -l 'type ([^:]+): [^\s]+\s*,?\s*(or\s*)?(``None``|``NoneType``|None|NoneType|:class:`NoneType`)' | xargs python ~/Desktop/cleannone.py

import codecs
import re
import shutil
import sys

def replace():
    pass

def main(paths):
    for path in paths:
        # Move to a backup location to edit path in-place.
        shutil.move(path, path + '.bak')

        with codecs.open(path + '.bak', 'r', 'utf-8') as f, codecs.open(path, 'w', 'utf-8') as outf:
            lastlinematched = False
            for line in f:
                if lastlinematched:
                    # Insert (Optional) in front of param.
                    indent, param, end = line.split(':', 2)
                    line = indent + ':' + param + ': (Optional)' + end
                lastlinematched = re.search('type ([^:]+): [^\s]+\s*,?\s*(or\s*)?(``None``|``NoneType``|None|NoneType|:class:`NoneType`)', line)
                if lastlinematched:
                    print 'matched'
                    # Delete the "or None" part of the line.
                    line = re.sub(',?\s*(or\s*)?(``None``|``NoneType``|None|NoneType|:class:`NoneType`)', '', line)
                outf.write(line)

if __name__ == '__main__':
    main(sys.argv[1:])

I will wait until after this and the string PR go in, because it also looks like there will be lots of conflicts.

Holy script! Looking forward to the diff.


Conversion from conservative variables to primitive variables, Example 18

Hello,
I am learning the example 18 of DG Euler Equations, and want to know if MFEM has a method or class for converting the conservative variables to primitive variables. I searched in the code and Issues and didn't find one.
Thanks.

Hi @ThinkingMarmot,
To convert to primitive variables, you just need to divide momentum by density to get the velocity, and you can use the function ComputePressure from ex18.hpp to compute the pressure.

OK, I will try it. Thanks.


Throwing an error during a transaction doesn't allow the lock to roll back

I am using the latest version.
Here is my code:
export const createOauthUser = async (
  providerUser: OauthUser,
  databaseConfig: Config['database']
) => {
  const db = getDBClient(databaseConfig)
  try {
    await db.transaction().execute(async (trx) => {
      const userId = await trx
        .insertInto('user')
        .values({
          name: providerUser.name,
          email: providerUser.email,
          is_email_verified: true,
          password: null,
          role: 'user'
        })
        .executeTakeFirstOrThrow()
      console.log(userId)
      await trx
        .insertInto('authorisations')
        .values({
          user_id: Number(userId.insertId),
          provider_type: providerUser.providerType,
          provider_user_id: providerUser.id.toString()
        })
        .executeTakeFirstOrThrow()
      console.log('ended')
      return userId
    })
  } catch (error) {
    try {
      await db.deleteFrom('user').where('user.email', '=', providerUser.email).execute()
    } catch (err) {
      console.log(err)
    }
    console.log('here')
    throw new ApiError(
      httpStatus.FORBIDDEN,
      `Cannot signup with ${providerUser.providerType}, user already exists with that email`
    )
  }
  const user = await getUserByProviderIdType(
    providerUser.id.toString(), providerUser.providerType, databaseConfig
  )
  return User.convert(user)
}

I added the delete statement in the try catch purely to handle an error I am having. If I throw an error during my transaction it should rollback the transaction and release the locks but I instead get this error intermittently (the other times it completes in under 20 seconds):
DatabaseError: target: dictionary-api.-.primary: vttablet: rpc error: code = DeadlineExceeded desc = Lock wait timeout exceeded; try restarting transaction (errno 1205) (sqlstate HY000) (CallerID: ihkeoohzfw2oodprmc73): Sql: "delete from `user` where `user`.email = :user_email", BindVars: {REDACTED}
        at Connection.execute (/backend/node_modules/@planetscale/database/dist/index.js:78:19)
        at processTicksAndRejections (node:internal/process/task_queues:95:5)
        at _PlanetScaleConnection.executeQuery (/backend/node_modules/kysely-planetscale/dist/index.js:92:21)
        at /backend/node_modules/kysely/dist/esm/query-executor/query-executor-base.js:35:28
        at DefaultConnectionProvider.provideConnection (/backend/node_modules/kysely/dist/esm/driver/default-connection-provider.js:10:20)
        at DefaultQueryExecutor.executeQuery (/backend/node_modules/kysely/dist/esm/query-executor/query-executor-base.js:34:16)
        at DeleteQueryBuilder.execute (/backend/node_modules/kysely/dist/esm/query-builder/delete-query-builder.js:392:24)
        at Module.createOauthUser (/backend/src/services/user.service.ts:65:7)
        at Module.loginOrCreateUserWithOauth (/backend/src/services/auth.service.ts:93:19)
        at oauthCallback (/backend/src/controllers/auth/oauth/oauth.controller.ts:27:16) {
      status: 400,
      body: {
        message: 'target: dictionary-api.-.primary: vttablet: rpc error: code = DeadlineExceeded desc = Lock wait timeout exceeded; try restarting transaction (errno 1205) (sqlstate HY000) (CallerID: ihkeoohzfw2oodprmc73): Sql: "delete from `user` where `user`.email = :user_email", BindVars: {REDACTED}',
        code: 'UNKNOWN'
      }
    }

This is the sole test I am running and the sole code executing.

I found this upgrading from 1.1 to 1.3

@OultimoCoder this used to work for you with version 1.1? I'm not seeing anything in the diff that would directly change the behavior of transactions: https://github.com/depot/kysely-planetscale/compare/v1.1.0...v1.3.0.
Did you upgrade anything else at the same time (kysely or @planetscale/database)? It still could be something here, but if not, the other thing to check would be if another request was holding a lock that conflicted with the DELETE, I'm not super familiar with what Vitess locks on delete.

Interesting - are you setting the useSharedConnection config option? That's the thing that 1.2 added, but it's supposed to be disabled by default.

I haven't made any changes from 1.1, just upgraded the package to 1.3.

Could it be related to the changes made that fixed this other issue I reported with transactions in 1.3 #17

Well v1.2.0 should have that fix included, so if you're not able to reproduce on 1.2, then it seems unrelated to that.

import { Kysely } from 'kysely'
import { PlanetScaleDialect } from 'kysely-planetscale'
import { ApiKeyTable } from '../models/apiKey.model'
import { AuthProviderTable } from '../models/authProvider.model'
import { EntriesTable } from '../models/entry.model'
import { FieldSourcesTable } from '../models/fieldSource.model'
import { SentencesTable } from '../models/sentence.model'
import { SourcesTable } from '../models/source.model'
import { UserTable } from '../models/user.model'
import { Config } from './config'

let dbClient: Kysely<Database>

export interface Database {
  user: UserTable,
  authorisations: AuthProviderTable
  api_keys: ApiKeyTable,
  sentences: SentencesTable,
  entries: EntriesTable,
  sources: SourcesTable,
  field_sources: FieldSourcesTable
}

export const getDBClient = (databaseConfig: Config['database']) => {
  dbClient =
    dbClient ||
    new Kysely<Database>({
      dialect: new PlanetScaleDialect({
        username: databaseConfig.username,
        password: databaseConfig.password,
        host: databaseConfig.host
      })
    })
  return dbClient
}

This is how my client is instantiated, I have done 0 code changes when testing upgrades.

And I did a repeat test just to check, 100% something introduced between 1.2 and 1.3 which causes this error.

Oh actually 1.2.1 included the transaction fixes from #17, 1.2.0 did not. Did you try it with 1.2.1, or just 1.2.0?

Fails with 1.2.1!

Yeah this is interesting, it's almost as if the rollback is not called? 1.2.1 updated the logic to await the rollback (and everything else), but I'm not sure how that would cause the issue you're seeing.
@koskimas do you see anything I'm doing incorrectly here? v1.2.0...v1.2.1#diff-a2a171449d. I'm not super familiar with what Kysely internals do when an error is thrown inside a transaction.

@OultimoCoder @jacobwgillespie I was able to replicate this issue but only when I put delete statement into catch block within the transaction scope, but not like it's in the original code.
Now haven't find the root cause for this 20 sec query execution time so far, but there is something what could help @OultimoCoder to mitigate this problem.
Basically, I found that v1.2.0 doesn't perform a rollbacks in case of an error within the transaction - I guess that's why in the given code there is a delete statement in case of the error.
Starting with v1.2.1 this seems to be fixed, and rollbacks are performed - inserts aren't happening.
So with rollbacks truly supported now, @OultimoCoder you should be able to get rid of delete statement in catch block and have rollback do it for you.

I originally found this when running tests using jest and a delete test would run after a test that intentionally errored in the catch block.
The delete code in the catch block is just an easy way of replicating it.
My issue is the 20 second timeout with the locks not being released after an error in the catch block.

I haven't had a chance to investigate further yet - the thing that was fixed in v1.2.1 (#10) was that transaction commands (BEGIN, COMMIT, ROLLBACK) weren't actually being awaited, so they could fail silently.
What I don't know here is if there's an issue inside kysely-planetscale or @planetscale/database that's preventing the normal transaction semantics from working, or if there's a legitimate lock contention in PlanetScale / Vitess that is only now showing up for you because previously it would have silently failed.

Does the demo code not prove there is no legitimate lock contention?
A failed transaction followed by a delete should always work, no?
I might have an investigate into this too then see if I can find out anymore.

A failed transaction followed by a delete should always work, no?

Possibly - how much traffic is this app getting? If you're getting this with a single request, then I'd expect it to work, but if there's concurrent requests / queries then it gets more complicated.

Tested locally. Repeatable and reproducible with a single request. 0 concurrency.

Ill write a reproducible script for this.

@jacobwgillespie hey!
I have a repo here which reproduces the issue pretty consistently. Very minimal code with a quick readme on how to run it (you just need a fresh planetscale db/branch).
https://github.com/OultimoCoder/kysely-planetscale-issue-20

@OultimoCoder thank you for that reproduction, that's super helpful - I ran it with quite a bit of logging inside the kysely-planetscale code, and it appeared to be issuing the expected queries, it correctly created a separate connection for the transaction, etc.
I adapted it to use @planetscale/database directly, with raw SQL queries, and it's still timing out due to a lock. You can see the updated code here: https://github.com/jacobwgillespie/kysely-planetscale-issue-20.
So, I think this is either an issue inside @planetscale/database, or some misunderstanding of how locks are working with PlanetScale.

Thanks so much for looking into this! Should I raise this issue on the @planetscale/database repo and point to both of our codebases?

I think that makes sense, yeah, they're pretty responsive over there 👍

This was fixed in @planetscale/database v1.10.0 🎉
https://github.com/planetscale/database-js/releases/tag/v1.10.0


fix(runtime-core): hydrate Static vnode

close #6008
fix(runtime-core): hydrate Static vnode

Manually picked in 11e17a1a because I can't push to this branch - I needed to add code for handling content adoption mode (when static vnode's children is empty, e.g. in VitePress).