Migrate from MongoDB to Postgres

Closes #254
Description

Replacing MongoDB by Postgres in CWLViewer.

[x] update pom.xml dependencies, removing Mongo, adding Postgres + Hibernate (or data/jdbc)
[x] replace the Spring configuration used by Mongo, probably add one for Postgres (pool settings, etc)
[x] update the repositories to use Hibernate or JDBC instead of Data+Mongo
[x] update entities and other annotations & classes as needed
[ ] add database migration, with initial DDL, but try to include some instructions for future DML's too
[ ] update tests (will probably need TestContainers to spin up a Postgres the QueuedWorkflowRepository tests)
[ ] manual tests
[ ] update containers
[ ] send to review and write notes about anything important to observe when migrating, any docs, etc

Motivation and Context

Licensing issues with MongoDB, see linked issue.
How Has This Been Tested?

[ ] via unit tests
[ ] manually running the viewer
[ ] in GitHub Actions CI

Screenshots (if appropriate):
Types of changes

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

Checklist:

[x] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

Now comes probably the biggest part of the work, converting the mongodb schema to postgres. I will try to keep things as simple as possible. Instead of creating complex tables for inputs, outputs, I'll just use a JSONB field. So it won't be too different than what we had in mongodb, maybe we will end up with two tables.
To compare data, I started the main branch, uploaded some workflows, then stopped it, and started working on this branch.
Then, with  docker-compose up mongo I can start just the mongo server while I develop. And use DataGrip to connect to the local mongo DB. To connect, one needs to also add a docker compose override file with something like:
version: '3.2'
services:
  spring:
    build: .
  mongo:
    image: mongo:3.4
    ports:
      - "27017:27017"
    volumes:
      - type: volume
        source: mongo
        target: /data/db

This way it's easy to consult the old DB schema to assist with the migration.

With exception of one, all unit tests passed. Doesn't mean it is almost working though :-) the one test that failed used to start a MongoDB database for the test. With PostgreSQL, the closest is running Docker containers for tests.
Luckily there is the TestContainers project that supports SpringBoot. I've used it successfully today, and it started the Docker containers with each test, then stopped them. Still trying to confirm it created the DDL and executed for tests (won't do it in production), and also need to fix this one test that is failing due to the SQL query executed having some issues.

One last unit test failing. Almost there :pray:

Stashing work for today. Before I knew where the problem was, but didn't know what the problem was. Now I know what the problem is, just trying to figure out a way to fix it :-)
We have at least two open problems to be fixed. The first one is in the unit tests that I committed now. The fields in Postgres are being correctly created as JSONB, and querying those fields with a TEXT JSON value works.
However, the Java code appears to be converting the GitDetails object into bytea, not in jsonb. Trying to find a way to re-write the repository query to have a jsonb in the parameter.
Once that's fixed, I will have to uncomment a part of the JSON deserialization, since it was complaining about fields that are not annotated with the JsonProperty, and do not have a setter method (creating the setter works, but not clear if that's the correct solution).
Troubleshooting notes

A Postgres Docker command that starts with an one-liner, and logs all queries to terminal: docker run --rm --name cwlviewer-postgres -p 5432:5432 -e POSTGRES_PASSWORD=sa postgres -c log_statement=all
What Hibernate created and inserted before the test failed:

create table queued_workflow (id varchar(36) not null, cwltool_status jsonb, cwltool_version varchar(1000), message varchar(1000), temp_representation jsonb, workflow_list jsonb, primary key (id));

create table workflow (id varchar(36) not null, cwltool_version varchar(1000), doc varchar(1000), docker_link varchar(1000), inputs jsonb, label varchar(1000), last_commit varchar(255), license_link varchar(1000), outputs jsonb, retrieved_from jsonb, retrieved_on timestamp, ro_bundle_path varchar(1000), steps jsonb, visualisation_dot varchar(1000), primary key (id));

create index IDX14ahubfm3f1ynds84uhdx7ews on workflow (retrieved_on);

alter table workflow add constraint UK13qbig8o1om524ht4txhbbvhf unique (retrieved_from);

# I re-wrote it to simplify querying
insert into queued_workflow (cwltool_status, cwltool_version, message, temp_representation, workflow_list, id)
values ('{"status": "OK"}', 'v1.2', 'message?', '{"name": "buffy"}', '[{"name": "willow"}]', 1);

What the test is trying to do:

# Works!
SELECT * FROM queued_workflow q
WHERE
      cast(q.temp_representation -> 'name' as text) = '"buffy"';
;

# The last part, with ?1 is a bytea type, need to figure a way that that's converted in jsonb IN SPRING JPA NATIVE
SELECT * FROM queued_workflow q
WHERE q.temp_representation -> 'name' = ?1

# to test the type of a column:
SELECT q.temp_representation, pg_typeof(q.temp_representation -> 'name') FROM queued_workflow q;

Argh. CI will be broken for a little while, but I have finally understood what was wrong with the Spring repository when trying to query a JSONB type in Postgres. In case another dev needs it (from CWL or from another community/project), here it goes:

The best way to set up JSON/JSONB serialization and de-serialization is really with Vlad's hibernate-types library (ignore the deprecation in @Type; the Hibernate devs deprecated it without giving a replacement).
When you query with JSON or JSONB, with something like WHERE column-> 'json_value' = ?1, you may receive a warning as Hibernate/JPA/Spring/etc were not able to compare the left jsonb with a right hand side parameter of type bytea; you'll have to create a implementation for the repository, and use the two-interface trick to have a custom method implemented instead of only interface methods, again, thanks Vlad - https://vladmihalcea.com/jpa-query-setparameter-hibernate/
After you have done that, the query might still fail if you have a typo as I had! I was doing table.column -> retrieved_from and Postgres never complained about it. After debugging all the way from the Spring data test, to the hibernate-types and Spring boot lib code, setting a breakpoint and trying a few combinations with an EntityManager, I managed to find a query that worked with retrievedFrom :man_facepalming:

Once you have done that, don't touch anything. Commit (fix & squash later) and go enjoy your weekend! :beers:
At least this issue was enough for me to refresh my memory about Spring Data, Hibernate, JSON/Jackson, and get more familiar with the old Mongo structure. This last failing test must be fixed soon, then will compare the 2 databases, and the final stage will commence where I will have to start importing workflows, comparing, planning the migration, etc :+1:
-Bruno

Great to the progress!

Managed to update the docs and remaining parts of the code that referenced Mongo. Also updated the Dockerfile and docker-compose.yml, these should be ready and won't require further work, I think.
Finally, the application was successfully initialized, latest spring, Jena Fuseki, and Postgres. I used Docker Compose and the updated docker-compose.yml. Needed to clear volumes and re-create as I was testing.
docker-compose up --force-recreate
docker-compose down -v

I've marked the subtask for Docker as completed! Now I will work on manual tests. First test failed, but that's not too bad. At least now I already have an idea what's broken, and even think I know how to fix it quickly :slightly_smiling_face:

With the latest commit, we are now able to visualize workflows, and the data gets put into the Postgres DB :slightly_smiling_face: We are almost done now I think!

Hmmm, Flyway license doesn't seem very good. Might have to use the other migration library that is integrated with Spring Boot :disappointed:

Caused by: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: Flyway Teams Edition or PostgreSQL upgrade required: PostgreSQL 9.6 is no longer supported by Flyway Community Edition, but still supported by Flyway Teams Edition.

Ready for review :tada: working on how to migrate the data now.

Woo-hoo! Thank you @kinow !
Were you able to do a dump/restore from view.commonwl.org? https://github.com/common-workflow-language/cwlviewer#dumprestore
I would recommend doing this in two phases

Dump view.commonwl.org
Restore using the codebase from main
Probably there are errors from resources being offline. Dump the database again, but from the instance in #236 4. Restore using this PR's codebase using the dump from step 3.

That way you know which errors are probably due to these changes versus external resources being down.

Thanks @mr-c ! And woo-hoo indeed!!! :partying_face:

Were you able to do a dump/restore from view.commonwl.org?

Not yet. I spoke with Ward & Peter, and they told me the dump/restore process can be quite lengthy... so I was looking how hard it would be to just dump Mongo and import into PostgreSQL.
But not sure how this final part will be done. At least the code changes are done I think. Just a matter of defining how to migrate to the new PostgreSQL DB :rocket:
:bed: now for meeting in ~6:30 hrs :wave:

Please get good sleep @kinow !
I've done a dump/restore cycle before. The point would be to stress-test the PR. You could do a partial dump & restore as a sanity check. Maybe 1%?

I did a dump/load cycle until my local hard-drive filled up. Almost reached 1%!
Here's the new dump (the subset that successfully loaded). Going to load it into the codebase from this PR now
2022-02-24T150823+0000.json.gz

After loading up ~210 workflows, this seems to work!

Whew!!! Thanks :clap: :champagne: :partying_face: :birthday:


Get reference to router without context?

Hi, I've seen #1059, #1497, and #1499 and am still confused about how I'm supposed to use router without mixins.
I'm not using es6 classes, opting instead for straightforward react components. This means that as far as I know I don't get context passed in a second parameter in the constructor (as there isn't a constructor).
In addition, I'm not happy with the solution of using mixins or any reliance at all on this.context since that throws errors when unit testing components in isolation.
Is there a way to get a reference to the router and just pass it in normally via props (which is far easier to stub out in tests)?

I don't think there's a great way to do this in 0.13.3. If your main concern is not having to stub context for testing route handlers, perhaps you could use a HoC for grabbing router from context, and then pass it to your actual handlers as a normal prop. You'd have to delegate calls to willTransitionTo and willTransitionFrom though, if you want to use them. And you'd have to write your own <Link>s (or create a HoC that injects context from props, i.e the reverse of what the aforementioned HoC for handlers would do).
In 1.0, some usages of context will probably be replaced by passing props directly to your route handlers. It's still needed for easy to use <Link>s though. However, you might be able to pass the router instance to all route components by using createElement so you wouldn't need a HoC for that.
Of course you could always create a global router "container", i.e. require('./router-container').router = Router.create(..);, but I assume you don't want that.

I should have specified - I'm using beta3, Links are not an issue honestly - this is a sizable app with lots of custom stuff going on, I can't see myself using "just" a link very often.
I was thinking I could just do transitionTo in my top-level component and pass down callbacks via props but since the top level component is now Router I can't actually set props anymore huh?

router-container was meant as a module you'd create yourself which would simply act as a globally accessible object.
// router-container.js
module.exports = {router:null};

// main.js
var router = ...;
require('./router-container').router = router;

// SomeRouterComponent.js
var routerContainer = require('./router-container');
var Component = React.createClass({
  someMethod() {
    routerContainer.router.transitionTo(..);
  }
});

Router.create is part of the old API. In beta3, the router instance is the same as the component instance, which you can only get from the return value of React.render or via context. Hopefully that'll change in the future so you could use createElement to pass the router instance to route components as a prop yourself. Until then, I think  the best way would be to use a HoC like I suggested for 0.13.3:
var routerAsProp = function(Component) {
  return React.createClass({
    contextTypes: {
      router: React.PropTypes.object.isRequired
    },
    render: function() {
      return <Component {...this.props} router={this.context.router} />;
    }
  });
}

var routes = <Route component={routerAsProp(RouteComponent)} ... />;
...

We will probably ship with HoCs for every mixin that we've got. But for now you either use mixins, or use context directly (though note that the stuff in context is not public API).

In addition, I'm not happy with the solution of using mixins or any reliance at all on this.context since that throws errors when unit testing components in isolation.

What errors are you running into? Link no longer throws, just warns if rendered out of context, and if its a unit test you won't be needing to transition anywhere in the app.
If for some reason you do need to test that some interaction eventually transition places on the router, you can do two things:

Use a default prop that handles the transitioning and then in your unit test pass in a prop
Stub out context just like you would stub out props


Add "start_button_text" to transaction schema

This will allow to pass in customised text for start buttons. This also adds
child-maintenance as an example of a transaction with a custom start button, and extracts the start_button_text as a definition since it's also being used by the simple_smart_answer schema.
cc @chrisroos @h-lame @nickcolley
@pmanrubia @ikennaokpala are you or someone from your team available to review?
https://trello.com/c/arlZczQO/423-2-republish-smart-answer-part-year-profits-to-finalise-your-tax-credits-start-page-as-a-transaction-page

Minor comment: start_button_text doesn't (at first inspection) indicate that it's custom and overrides a default. The description does elaborate though, and a frontend can assume that the lack of this field means it should display "Start now".
We could always pre-populate this field with "Start now" in the future if we wanted.

@ikennaokpala : Thanks! I now removed the "to be squashed" mention which I had left by mistake - I intended to keep it a separate commit. Also used "schemas" instead of "schemae" for ed41fcb now.
@fofr : true, and custom_start_button_text would have been more descriptive.  Renaming it now would imply also making changes to frontend and publisher for the simple smart answers format (which also uses that field), and for the transaction format to frontend and the smart answers PR, so I'd rather avoid it if possible. We did discuss with @nickcolley the option of sending "Start now" by default from smart-answers but it felt more natural to have frontend default to "Start now" when no text was provided.


iframe video player - turn off the autoplay

how do I turn off the autoplay on the iframe video player when I am hosting the video ?

This is actually bootstrap related because within the "embed-responsive-item" functionality, the html video has an autoplay attribute, seemingly added by the bootstrap js.

no, it isn't. bootstrap defines CSS for how iframes are presented. there's no JS that does anything of the kind.


CoffeeScript -> plain js

I would love to contribute to this project, but CoffeeScript adds another layer of complexity that keeps devs like me from giving back. Please consider switching to plain js. It's just a suggestion - it's your project and you're free to do as you wish. Feel free to close this issue whenever :smile:
cc: @ewr

Thanks for the feedback. If you have specific functionality that you want to PR against the compiled JS I'd be glad to take a look at porting it over into the Coffeescript base.
Do you have a fundamental issue with Coffeescript, or it just isn't your preferred way to do JS?

I would like to second @zertosh's request to change this to a pure JS repo, mainly because it is clear that the wider Javascript community has clearly voted against things like Coffeescript in favour of ES6 and related technologies.
I would be happy to contribute to this repo to begin the conversion to ES6 syntax using something like babel if that is something you would be interested in?

Sure, I'd be open to that. I've only followed ES6 peripherally, but I guess we're getting closer and closer to that time when I need to be paying attention.

Great, well in that case I suppose we better add a meta issue that allows us to identify all the key parts of the library that need upgrading. I'll create it now as a new issue :+1:


Add Astronomy Picture of the day App

This website uses NASA's APOD API to fetch the Astronomy picture of the day, daily.

@Priyanshi662 I would like to work on this under JWOC'24

@Priyanshi662 please assign this to me under jwoc'24


The entire finch-core package should be available by single import

Basically, I want to follow the rule: separate sub-project = separate import. The core package should be available by import io.finch._, while (for example) jfc support should be enabled as import io.finch.jfc.

This relates to #384.

As part of this we might think about moving RequestReaders under the io.finch._ package.


[master] Upgrade to latest dependencies

Produced via:
./hack/update-deps.sh --upgrade
./hack/update-codegen.sh

Justification, Pushing release updates to downstreams, eventing and serving have been released :tada:. -n3wscott
/cc knative-sandbox/channel-wg-leads
/assign knative-sandbox/channel-wg-leads

/lgtm
/approve


feat: Add ability to set room ID as timer endpoint

Allows the user to specify a particular room ID to act as an endpoint so that the timer stops on entering that room.
Changes:

Add "Set Room ID as End Point" hotkey - when in the debug map, if this key is pressed while the mouse is hovering over a valid room (has at least one spawnpoint and is not a filler room), that room's ID will become the new Room ID End Point.
Uses the TestCheck() method in Celeste.Editor.MapEditor to get the level underneath the cursor, which is tracked by the mousePosition field in that class - both of these are private, originally I used DynamicData.For to get them but then I realised there are reflection utils in SRTool so I made use of those instead, as I didn't want to bump the project's MonoMod/Cecil versions unnecessarily.

When pressing this hotkey, a message indicating that the Room ID End Point has been set to that level will appear in the bottom-left of the debug map and persist for 1 second.
I couldn't find a way to get this message to render without hooking the MapEditor.Render() method itself and making sure it was drawn after the rest of the debug map overlay - I didn't find any issues with it in my testing, but you're far more experienced than me so if there's a better way of doing this then I'm all ears.

Add "Clear Room ID End Point" hotkey - sets the Room ID End Point to an empty string, pretty similar to the key used to get rid of flag endpoints.
Add a "Room ID End Point: {roomID}" entry to the Room Timer section of SRTool's options.
This is only shown when there is a room ID to end on since I personally thought that was cleaner, but that's easily changed if you'd prefer it to persist there and display nothing. Also made it non-selectable since it has no function otherwise.
Account for room ID in timer behaviour, essentially treated as another flag end point.

Notes:

I wasn't sure where to put the MapEditor.Render() hook - let me know if that'd be more appropriate in a different class.
I originally wanted to have a menu button to open a text prompt and allow the user to enter the room ID string manually, however there doesn't seem to be any Everest/vanilla support for doing that while in a level (only in the overworld) which would mostly defeat the purpose of a menu like that. I think it's possible to build a string input menu for use in-game from scratch, but a: I didn't feel confident tackling that myself, and b: the hotkey should be a far more efficient and intuitive solution for the end-user anyway. If you've got any ideas on how to handle a menu like that then let me know, but I don't think I'll be implementing that myself unless somebody can convince me to or I suddenly feel like doing it.
I opted to treat the room ID as basically an end point for timing purposes rather than a third timing mechanism alongside end points and room count, mostly because it was easier than wrapping my head around the time key system 😅 there was some interest in it being a third mechanism, but given how easy it is to clear the room ID with a hotkey I can't see it being a sore point. I might try implement that at some point though if nobody else gets to it first.

Demonstration:
https://user-images.githubusercontent.com/72244655/170931951-9d40de67-31f5-4939-a4d3-1215432464f2.mp4

nice feature
as I understand it, Room ID EndPoint should be consistent with the normal EndPoint, so there is no need to add additional hotkeys and setting
we can reuse set endpoint and reset timer hotkeys, and the room id can be saved in RoomTimerManager
btw I found that the reset timer hotkey don't popup tooltip, I will add it later

Room ID EndPoint should be consistent from the timer behaviour perspective, however I went with separate hotkeys to allow for use of Flag EndPoints without overwriting/clearing the Room ID EndPoint. E.g. if I'm doing segment practice with a Room ID EndPoint, I may want to pause briefly to time something in one of the rooms using Flags - once I finish with that timing, I don't necessarily want to clear my Room ID and then have to go back into the debug map to set it again. I guess the current handling of this use-case isn't great, since ideally we'd be tracking PBs set on a Room ID EndPoint separate to Flag EndPoints, but yeah I didn't really grasp what was going on with the timeKey stuff to figure out how to do that.
Reusing the set endpoint key seems fine though - hopefully that won't be hard to figure out

do you mind I remove those hotkeys after the merge
and I'll modify the text of the current hotkeys to fit this new feature
I might also add some indicators for users to find the room endpoint when reopening the debug map

That's perfectly understandable! I gave it a bit more thought and I'm now totally fine with removing those hotkeys, and saving the room ID in EndPoint - it's functionally the same as an endpoint and should probably just be treated as such across the board.
There's also been some interest in adding support for more timer end conditions, e.g. ending on cassette touches or heart collects for timing segments (particularly with the new segment leaderboard that would benefit from a consistent endpoint), badeline orb touches and strawberry collects for timing strats, etc. With this conversation regarding the room ID feature in mind, what do you think about these conditions + the room ID condition being implemented via a refactor of EndPoint to create different kinds of endpoints based on these conditions? Might make it easier to add new end conditions as people request them, could maybe achieve this by:

Adding separate classes for each endpoint condition that inherit from the current EndPoint class (e.g. RoomIDEndPoint, CassetteEndPoint, HeartEndPoint, etc), and moving everything flag-related (e.g. the confetti render and sprite stuff) in the current EndPoint to its own FlagEndPoint class. Can make methods like StopTime and ReadyForTime virtual to allow each endpoint to define overrides as well
Having an enum setting to toggle what type of endpoint is created when pressing the create endpoint/additional endpoint key, so no extra hotkeys for adding new endpoints (although maybe one would be nice for cycling through that enum)
And they'd all be removed when pressing the reset time key, which is fine imo
If you'd prefer not to add this support at all that's totally fine - it's your mod, I definitely don't want to be overbearing 😅 although stuff like cassette splits in particular have been mentioned a number of times in celestecord, and I think the new segment sheet managers wanted to approach you eventually about adding it as well.
If you've got any alternative ideas for this kind of end condition support then let me know, but if you would like to see it then I'm happy to close this PR and build this myself on a new branch.

ending on cassette touches or heart collects for timing segments

Might add limited support for cassette/heart, similar to the flags in Chapter 7 3000m, think of it as a room that can be toggled on and off with an option

Sounds good, will let you handle it then. Let me know if you need testing


feature unavilable on this platform error

Environment data

Language Server version: 2021.6.1-pre.1
OS and version: ubuntu 21.04
Python version (& distribution if applicable, e.g. Anaconda): 3.9.5 64-bit

Actual behaviour
there is an error with the following description in the output:
Logs
[Info  - 10:13:04 AM] Pylance language server 2021.6.1-pre.1 (pyright 209c8040) starting
[Info  - 10:13:04 AM] Server root directory: /home/arian/.vscode/extensions/ms-python.vscode-pylance-2021.6.1-pre.1/dist
[Error - 10:13:10 AM] Exception received when installing recursive file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js

Possible duplicate: https://github.com/microsoft/pylance-release/issues/1386


More fine-grained operator implementation dispatch & memory planning flow

Existing Execution Flow
g = graph()
shapes = g.infer_shape()
types = g.infer_type()
storage_types, dispatch_modes = g.infer_storage_type()
memory_plan = nnvm::plan_memory() // which calls node.finplace_option(node.attr)
for node in g:
  fcompute = get_fcompute(node)
  fcompute(x)

The drawback of the existing flow

the selection of MKL/CPU/GPU/CUDNN implementation happens after graph attribute inference and memory planning, memory planning is thus not aware of the implementation that will be used for execution in the future, which may result in sub-optimal result. For example, the memory inplace option may vary depending on the accelerator backend (the new version of CUDNN enables x/dx inplace for _backward_conv).
some sparse operator need to access dtype/shape information to decide which implementation to invoke for execution, and whether to perform fallback. This information is not yet exposed in the existing infer storage type interface.

Alternative Flow
op implementations
CovolutionComputeCUDNN(const nnvm::NodeAttrs& attrs,
                       const OpContext& ctx,
                       const std::vector<TBlob>& inputs,
                       const std::vector<OpReqType>& req,
                       const std::vector<TBlob>& outputs) {
  // 1st CUDNN implementation goes here
}

CovolutionComputeMKL(const nnvm::NodeAttrs& attrs,
                       const OpContext& ctx,
                       const std::vector<NDArray>& inputs,
                       const std::vector<OpReqType>& req,
                       const std::vector<NDArray>& outputs) {
  // MKL implementation goes here
}

CovolutionComputeImplGPU(const nnvm::NodeAttrs& attrs,
                       const OpContext& ctx,
                       const std::vector<TBlob>& inputs,
                       const std::vector<OpReqType>& req,
                       const std::vector<TBlob>& outputs) {
  // GPU implementation goes here
}

CovolutionComputeImplCPU(const nnvm::NodeAttrs& attrs,
                       const OpContext& ctx,
                       const std::vector<TBlob>& inputs,
                       const std::vector<OpReqType>& req,
                       const std::vector<TBlob>& outputs) {
  // CPU implementation goes here
}

new finferstorage_ex interface
void  FInferStorageTypeEx(const std::vector<TShape>& in_shapes,
                          const std::vector<int>& in_types,
                          const std::vector<int>& in_stype,
                          const std::vector<TShape>& out_shape,
                          const std::vector<int>& out_type,
                          std::vector<int>* out_stype,
                          int dev_mask,
                          NodeAttrs* attrs, // mutable
                          DispatchMode* dispatch_mode // mutable) {
    // GPU
    if (dev_mask == kGPU) {
      out_stype[0] = kDefaultStorage;
      dispatch_mode = kFCompute;
#if MXNET_USE_CUDNN
      if (attrs.params.kernel.ndim() == 2 && dtype == float && in_shape[0].ndim() == 1 && …) {
        attrs.exec_func = CovolutionComputeImplCUDNN;
      } else {
        attrs.exec_func = CovolutionComputeImplGPU;
      }
#else
    attrs.exec_func = CovolutionComputeImplGPU;
#endif
    // CPU
    } else {
#if MXNET_USE_MKLDNN
    attrs.exec_func = CovolutionComputeMKL
    out_stype[0] = kDefaultStorage;
    dispatch_mode = kFComputeEx;
#else
    attrs.exec_func = CovolutionComputeCPU
    ...
#endif
}

FInplaceOption for convolution
[] FInplaceOption(const NodeAttrs& attrs) {
  if (attrs.exec_func == CovolutionComputeCUDNN) {
    return {0,0};
  } else {
    return {}
  }
}

New Execution Flow:
g = graph()
shapes = g.infer_shape()
types = g.infer_type()
if (g.has_attr('FInferStorageTypeEx')) {
  storage_types, dispatch_modes = g.infer_storage_type_ex()
} else {
  storage_types, dispatch_modes = g.infer_storage_type()
}
memory_plan = nnvm::plan_memory() // which calls node.finplace_option(node.attr)
for node in g:
  if (node.attrs.exec_func) {
    fcompute = node.attrs.exec_func
  } else {
    fcompute = get_fcompute(node)
  }
  fcompute(x)

@DickJC123 @ptrendx @piiswrong @reminisce

Great, the new proposal will resolve several issues we encountered during the developments for MKL-DNN backend.
We will have some internal discussions firstl and give you back for more details 👍
@TaoLv @ZhennanQin

agreed. It is a good idea but looks like a hack.

@marcoabreu thanks for the comments. True that the existing infer_storage interface and the proposed infer_storage_ex interface both need to write backend specific logics. What kind of abstraction would you like to see? Let's say each backend provides one implementation which only concerns that backend itself. Now how does MXNet provide a general guide to select/prioritize these implementations if it is built with MKLDNN+CUDA+AMDHIP? What order would you propose to invoke these functions, and what if one of them conflicts with other backends? How does MXNet resolve these conflicts?
I do want to limit the discussion to memory planning itself so that @DickJC123 's work on NHWC can be unblocked as soon as possible.

Thanks for your very good questions!
For the operator selection I would think about a design which has something similar to a "tuning" or warm-up stage which evaluates the different possibilities. Initially, since that revamp would be quite big and experimental, I would hardcode an order (e.g. CUDA->AMD->MKLDNN->CPU) which is then evaluated and certain backends dropped if they don't support that operator or they're simply not present. Later on, there would ideally be a benchmark step which evaluates the different possibilities and then chooses the most efficient representation of the graph. This evaluation would first start with simple benchmarks (with different strategies like memory footprint, power consumption, throughput, etc) of each operator backend and then in the next stage go one level higher and evaluate groups of operators (up to evaluating the entire graph) to accomodate for layout conversion and memcopy overhead.  In the last iteration, we would have a graph which is most efficienct, but also runnable on that hardware, for the requested graph.
There are two ways I could think of backends conflicting:

Mismatching memory layouts
Impossible/unlikely combinations (CUDA &AMDHIP or MKL &ARM)

To solve number one, I would extend the design to not only have the operators abstracted, but also their memory layouts. In the same way as we would have an operator registry, we would have a memory layout registry where each backend announces their memory layouts as well as converters. Each operator implementation would specify a desired layout (most likely the one they registered themselfes). Now imagine you have a graph with threeoperators:
Input -> Operator1_CUDA -> Operator2_MKL -> Operator3_MKL -> Output

These three operators are from two entirely different backends and have their own implementation and memory layouts. Our engine would, during the initial analysis of the graph (this step is after the optional graph optimization and we assume the graph as final at that point), analyse the desired layout of each operator (in this case CUDA and MKL, but it could also go a level deeper like CUDA_NHWC etc) and then see whether they are compatible. If they are not, the engine would request a converter from the memory layout registry. These converters would then be inserted into the graph and the final graph would look as follows:
Input -> Convert_Standard_CUDA -> Operator1_CUDA -> Convert_CUDA_MKL -> Operator2_MKL -> Operator3_MKL -> Convert_MKL_Standard -> Output

This way, you will always have compatibility in between the different layouts while the neither the operators nor the engine will have to care about the different backends as that conversion happens in between. When an operator receives and outputs data, it expects to be in its "isolated" world. If the operators are from the same backend and use the same layout though, this conversion is skipped and a performance advantage is achieved.
Now at this point you could get to O(N!) if you need convertors in between every single possible memory layout. The trick here is to have a standard layout (which we basically already have and is used to input and output data from the graphs). Each memory layout has to register at least two converters: TO_STANDARD and FROM_STANDARD. This allows have compatibility for backends where no direct conversion exists. Since this will require two conversions (FROM_MEMLAYOUT1_TO_STANARD and FROM_STANDARD_TO_MEMLAYOUT2), this will have additional overhead but keep compatibility high. For common cases, where would probably be direct converters.
For the second case where conflicting backends exist, they would simply be skipped during the evaluation stage when the engine checks whether an operator is actually eligible. So if CUDA is not present, the operator will simply not be considered for that graph.

Just had a small chat with Haibin. So just to clarify, my idea would be rather long-term to avoid having all the preprocessor directivesin the FInferStorageTypeEx and similar places.
Within the above design, FInferStorageTypeEx would be part of the abstract operator interface which each backend would implement. The memory layout manager would then invoke that function in the same fashion as described by Haibin but the implementation would be in different places.
I totally see that my proposal is way out of scope for the current problem and agree that Haibins method is definitely the best way to go considering the constraints of the current design around preprocessor directives.
Just wanted to write down my idea for future cases when the operator implementation design might get revisited.

Regarding memory planning, there are different requirements from GPU and CPU.
Looks like the GPU wants to support both NCHW and NHWC, but CPU with MKL-DNN prefer the padded memory (GPU still needs this in some cases).
@eric-haibin-lin do you mind elaborate the possible change of "memory planning"?  How the new change cover the diversity of memory requirement from the different backend?
We're open to the changes and happy to work together :)

@eric-haibin-lin  Thanks for proposing this. We like this change as it can benefit MKLDNN subgraph and memory planing as well. Here's only one small comment:
attrs.exec_func = CovolutionComputeImplCUDNN;
Can we have different labels for different backends to make backend information more generic. Then we can read this label and make different upon it.

Again, one goal of this is to not tie all operator implementations together.  It's hard for one committer to have the knowledge and energy to modify and create tests for all implementations.  Now, trying for the simplest solution, suppose we just segment the cpu implementations from the gpu ones?  Right now, this is already done with FCompute.  The corresponding new code might be:
.set_attr<FInplaceOption>("FInplaceOption<gpu>", [] (const NodeAttrs& attrs) { return {0,0}; })
.set_attr<FInplaceOption>("FInplaceOption<cpu>", [] (const NodeAttrs& attrs) { return {}; })

Alternatively, since AssignContext() is run before  g = nnvm::ApplyPass(g, "PlanMemory"), we could additionally divide up and attach the dev_mask information that is currently an attribute of the entire graph to each node.  Code then would be:
.set_attr<FInplaceOption>("FInplaceOption", [] (const NodeAttrs& attrs) {
    int is_gpu = attrs["dev_mask"] ==  mshadow::gpu::kDevMask;
    return is_gpu ? {0,0} : {};
})

This is a good proposal for separator of operator implementations for different accelerators.
One thing that can be done to lessen the overhead of cross acc implementation in FInferStorageEx is registration of supports functions for different accelerators.
Something like the following:
.set_attr<SupportsAccl>("MKLDNN", IsMKLDNNSupported)
.set_attr<SupportAccl>("CUDNN", IsCUDNNSupported)

The default implementation for FInferStorageEx will then be:
void  FInferStorageTypeEx(const std::vector<TShape>& in_shapes,
                          const std::vector<int>& in_types,
                          const std::vector<int>& in_stype,
                          const std::vector<TShape>& out_shape,
                          const std::vector<int>& out_type,
                          std::vector<int>* out_stype,
                          int dev_mask,
                          NodeAttrs* attrs, // mutable
                          DispatchMode* dispatch_mode // mutable) {
    // GPU
    if (dev_mask == kGPU) {
      out_stype[0] = kDefaultStorage;
      dispatch_mode = kFCompute;
#if MXNET_USE_CUDNN
      if (SupportsCUDNN(...)) {
        attrs.exec_func = CovolutionComputeImplCUDNN;
      } else {
        attrs.exec_func = CovolutionComputeImplGPU;
      }
#else
    attrs.exec_func = CovolutionComputeImplGPU;
#endif
    // CPU
    } else {
#if MXNET_USE_MKLDNN
    if (SupportsMKLDNN(...)) {
    attrs.exec_func = CovolutionComputeMKL
    out_stype[0] = kDefaultStorage;
    dispatch_mode = kFComputeEx;
    } else {
        attrs.exec_func = ConvolutionComputeCPU
     }
#else
    attrs.exec_func = CovolutionComputeCPU
    ...
#endif
}

This way the devs working on different accelerators for most cases, will only have to worry about registering FCompute and Supports implementations.

@reminisce @junrushao1994 maybe we probably to include this change in the next major refactoring/design

This will be great step towards a clearer definition of operators! Nice proposal!

We observed poor inference latency with MKL-DNN, and maybe this proposal will help address it. See https://discuss.mxnet.io/t/poor-inference-latency-with-mkldnn-on-cpu/3339. Thought it might be helpful to cross share the use case here.

@danithace Tao has answered the question in the forum :) thanks to raising the question.

@pengzhao-intel In #13749 you mentioned, that you were working on this issue. Maybe you remember where the work ended, was there any conclusion on this matter?


contract compiled error: Expected identifier, got 'LParen'  constructor(string ric_name, string fid_name1, string fid_name2) public {

Description of problem
cakeshop sandbox compiler output error above while it is work for my ethereum and remix and truffle.
not quit sure what is difference between cakeshop and standary remix/truffle, looks like it is solc version but i am not 100% sure.
Expected behavior
contract should be complied without error
Actual behavior
:44:16: Error: Expected identifier, got 'LParen'
constructor(string ric_name, string fid_name1, string fid_name2) public {
Steps to reproduce the behavior
System information
Cakeshop version or commit hash: [cakeshop version: Cakeshop 0.9.1 Build 6c7a88ee]
Cakeshop runtime configuration: [ attach mode]
Geth/Quorum version testing against: [Geth/v1.8.18-stable-8f19fb1e(quorum-v2.2.3)/linux-amd64/go1.10.4]
Cakeshop OS & Version:  linux-amd64
Browser OS & Version: Window/Chrome
Backtrace/logs
Copy all relevant log output. Use Gist for longer logs.
[stacktrace/logs]

Please try the latest version of cakeshop (0.11.0) from the releases page. It uses solc 0.5.x


Postgres Support with Rabbit MQ or Kafka

[Specific customer request 3180]
Given that a customer wants to use the risk-score-calculator and are moving to use of the postgres db for their Sz adoption, the risk-score-calculator must support Postgres db.
Given that the same customer also is moving from using g2loader to the stream producer and would like to adopt either rabbitMQ or Kafka for their data pipelines for either historicals and ongoing feeds, ensure that the risk-score-calculator works with both pub-sub and producer/consumer stream processor.

It already works with Postgres and Rabbit MQ producer/consumer.  I will add sub-pub functionality.

The connection can be set in the "conf/risk-scoring-calculator.properties" file.  The parameter is "riskscorer.jdbc.connection" and is a jdbc connection string:
riskscorer.jdbc.connection=jdbc:postgresql://host:port/database

Thank you :)

This item will be covered in AR meeting with the requesting customer this month.

This item will be covered in AR meeting with the requesting customer this month.


how to add the side scroll bar?

i absolutely love this theme, but am missing the side scroll bar on longer pages. is there any css snippet i could add to keep the theme and the sidebar together? thank you in advance!

Hey! I'm glad you like the theme. I've just update it to bring back the scrollbar to the main theme. I was adding some hide-UI css in another snippet anyway, so I decided to put that in a separate css file and offer it as an independent complement snippet. If you update the theme the scrollbar should return. Cheers!


set width of a individual character

I'm making a plugin to vertically align operators in the view of the code. These alignments will not actually be saved to the disk - they're purely stylistic alignments in the editor. In order to do this, I need to change the width of the space character in front of each =, depending upon the position of the = in the surrounding lines. However, I'm not sure how to set the width of a specific character.
It looks like I can change the width of a type of character for a given scope using displayBuffer.setScopedCharWidth, but I don't think that the scope includes the line/column number or anything I could use to select a specific char. Also, the docs for the displayBuffer are pretty sparse, so I might be misinterpreting what this does.
Anyway, how should I go about changing the width of an individual character?

Could we re-open this? This is still something that would be useful and (AFAIK) isn't supported yet.


Running a function app via dotnet test with 64 bit version of az cli errors with: "Access token could not be acquired 'az' is not recognized as an internal or external command"

Describe the bug
The application is a dotnet core 3.1 function application.
The execution of the specflow functional tests via 'dotnet test' works perfectly when the 32 bit version of the Azure CLI is installed, but failed with: "Access token could not be acquired 'az' is not recognized as an internal or external command" when the 64 bit is installed and the 32 bit is removed.
'az' is recognized if I type it in the command line, 'az --version' works.
The 64 bit version of the Azure CLI was installed via Powershell:
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindowsx64 -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; Remove-Item .\AzureCLI.msi
The code in question is using the AzureServiceTokenProvider.  I've forced it to only use the AzureCli, as that's the intended execution in the pipeline.  If I run locally without the connection string indicating runas=Developer and DeveloperTool = AzureCli, it will work, but it will be using my Visual Studio connection to azure, not the CLI.
               var azureServiceTokenProvider = new AzureServiceTokenProvider("runAs = Developer; DeveloperTool = AzureCli;");
                var keyVaultClient = new KeyVaultClient(
                                                        new KeyVaultClient.AuthenticationCallback(
                                                                                azureServiceTokenProvider.KeyVaultTokenCallback));

                configurationBuilder.AddAzureKeyVault(configuration["KeyVaultUrl"],
                                                      keyVaultClient,
                                                      new DefaultKeyVaultSecretManager());

It appears as though the AzureServiceTokenProvider is attempting to only use the location of the 32 bit CLI.  If I create a symlink from the 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2' to 'C:\Program Files\Microsoft SDKs\Azure\CLI2' like so:
mklink /J "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2" "C:\Program Files\Microsoft SDKs\Azure\CLI2"
the error does not occur and the application is able to find and use the AZ CLI properly.
I would like to not have to make a symlink and have this just work correctly with the 64 bit version of the CLI.
The path to the 64 bit version of the CLI is also on my system PATH.
Related command
               var azureServiceTokenProvider = new AzureServiceTokenProvider("runAs = Developer; DeveloperTool = AzureCli;");
                var keyVaultClient = new KeyVaultClient(
                                                        new KeyVaultClient.AuthenticationCallback(
                                                                                azureServiceTokenProvider.KeyVaultTokenCallback));

                configurationBuilder.AddAzureKeyVault(configuration["KeyVaultUrl"],
                                                      keyVaultClient,
                                                      new DefaultKeyVaultSecretManager());

Errors
Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. 'az' is not recognized as an internal or external command,
Issue script & Debug output
see above for code snippet:
Expected behavior
The tests run and the error " Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. 'az' is not recognized as an internal or external command," does not show, just as it does in the 32 bit version of the CLI.
Environment Summary
azure-cli                         2.57.0
core                              2.57.0
telemetry                          1.1.0
Dependencies:
msal                              1.26.0
azure-mgmt-resource             23.1.0b2
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\me\ .azure\cliextensions'
Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec  4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)]
Additional context
No response

Thank you for opening this issue, we will look into it.

Closing, as upgrading the transitive package Microsoft.Azure.Services.AppAuthentication to latest fixed the issue and everything working correctly now.


define strata to be used for NEUS fall

probably have to use something like this: https://github.com/rBatt/trawl/blob/master/Scripts/DataFunctions/makeStrat.R
no tolerance for missing years

@mpinsky Is it OK to just use same strata as what are currently used for Spring?

Not necessarily, unfortunately. I'd do a quick check for which strata are
consistently surveyed through time.
e.g.,
table(dat$stratum, dat$year)
then pull out the rows that don't have any zeros.
I think that should do the trick.
On Fri, Jun 5, 2015 at 9:08 AM, Ryan Batt<EMAIL_ADDRESS>wrote:

@mpinsky https://github.com/mpinsky Is it OK to just use same strata as
what are currently used for Spring?
—
Reply to this email directly or view it on GitHub
https://github.com/mpinsky/OceanAdapt/issues/28#issuecomment-109288923.

@mpinsky I have this fixed, i just can't push. I might just reset my local copy, but I don't want to mess with it right now.

@mpinsky I finally fixed everything so that I can now push to this repo again. I've made this fix. You can see the commit referenced above.


invalid_arguments response when deleting messages

Problem:
Channel messages are not being deleted when the script is performed. Results in invalid_arguments error.
Solution:
Slack chat.delete usually requires argument as_user=True.

I fixed this by adding --as_user at the end of the command.


x265: 3.6 -> 4.0

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://repology.org/project/x265/versions.
meta.description for x265 is: Library for encoding H.265/HEVC video streams
meta.homepage for x265 is: https://www.x265.org/
meta.changelog for x265 is: https://x265.readthedocs.io/en/master/releasenotes.html#version-4-0
Updates performed

Version update

To inspect upstream changes
Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 4.0 with grep in /nix/store/l0pgk0mdkjxga99p1vyqy8jwb2n9bini-x265-4.0
found 4.0 in filename of file in /nix/store/l0pgk0mdkjxga99p1vyqy8jwb2n9bini-x265-4.0

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

11877 total rebuild path(s)

11877 package rebuild(s)

First fifty rebuilds by attrpath

CuboCore.corepdf
CuboCore.coretoppings
Fabric
LPCNet
MMA
OVMFFull
SDL2
SDL2_Pango
SDL2_gfx
SDL2_image
SDL2_image_2_0
SDL2_image_2_6
SDL2_mixer
SDL2_mixer_2_0
SDL2_net
SDL2_sound
SDL2_ttf
SDL_audiolib
SDL_compat
SDL_gpu
_1oom
_20kly
_2ship2harkinian
_64gram
_7kaa
_86Box
_86Box-with-roms
_90secondportraits
aaphoto
aaxtomp3
abbaye-des-morts
abiword
abracadabra
abuse
accerciser
acltoolkit
acquire
actiona
activitywatch
ad-miner
adafruit-ampy
adapta-gtk-theme
adcskiller
adenum
adidnsdump
adl
adriconf
advi
adwaita-icon-theme-legacy

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/l0pgk0mdkjxga99p1vyqy8jwb2n9bini-x265-4.0 \
  --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 x265 https://github.com/r-ryantm/nixpkgs/archive/ad6c60524cec2595c763f4c3fcbe196db1dbb477.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/ad6c60524cec2595c763f4c3fcbe196db1dbb477#x265

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

Pre-merge build results
NixPkgs review skipped

Maintainer pings
cc @codyopel for testing.

[!TIP]
As a maintainer, if your package is located under pkgs/by-name/*, you can comment @NixOS/nixpkgs-merge-bot merge to automatically merge this update using the nixpkgs-merge-bot.

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

Merge conflict, please open a new PR.


update help text for zar commands

We've added support for S3 root's since #1031 was filed, so I thought I'd add some text both for zar import and the higher level zar help that mentioned S3. I also tried to make a few other improvements, like consistent language about a "chunk" as the main log file, and the use of a "root" location instead of just directory for the -R/$ZAR_ROOT configs.
Closes #1031

We do need the -R option for all of the zar commands. My ergonomics opinion is that I don't like needing to remember if I put an option after global command or the subcommand, so am happy with how -R works now, but can take that up with everyone separately.


Custom emoji reaction on polls

Able to react to polls using custom emojis rather than just regular emojis.

For completeness: YesBot also currently allows using emojis from servers he is on, so this issue is about emojis from other servers.
One way to approach this could be creating a temporary emote with the image ID, reacting with it, then removing it again.

For completeness: YesBot also currently allows using emojis from servers he is on, so this issue is about emojis from other servers.
One way to approach this could be creating a temporary emote with the image ID, reacting with it, then removing it again.

Random thought, creating the emote temporary then removing it won't it be removed from the message itself?
Or would it stay and still be react-able?

A test shows the latter; also keeps working across guilds.

Wow this been sitting here for a long time

Waiting for 6 July 2024 to comment, wow this been sitting here for a long time


Rerun tests for latest versions of top 12 plugins

It's a year since the performance tests were run against WordPress 4.4.
It would be nice to know if the changes made to the plugins have affected the overall performance.
Have they got better or worse or remained the same.

Creating the result sets has involved quite a lot of work attempting to validate the performance tests.
including:

create results for WordPress performance from 4.4 through 4.7
analyse results for WordPress performance degradation from 4.4 to 4.7 ( to be documented elsewhere)
altering code to eliminate some of the performance degradation in WordPress 4.7
eliminate test URLs that may invoke other requests
allow multiple output files to be grouped
rerunning tests with original plugin versions
minor changes to the base system of 35 plugins
improving oik-bwtrace to count total hooks invoked
measuring affect on performance when oik-bwtrace's count total hooks logic is enabled.

Here's a very high level summary of results so far.

Component
original
current
#plugins
2016
2017
Reference

WordPress
4.4
4.7
35
0
+9%
vanilla-44-47-summary.ods

Akismet
3.1.7
3.2
36
-0.6%
+2.2%
2017/akismet

WordPress 4.7 is slower than WordPress 4.4 due to

Unverified performance degradation in WordPress 4.5 ( added 0.5% )
Additional logic and query for 'can_compress_scripts' ( added 2%, in WordPress 4.6 )
Additional logic and query for Custom CSS ( added 2% )
Addition of REST API
Increased number of hook invocations
New hook logic - difficult to measure
Other changes

Plugins

Akismet - appears to have got a little slower but this needs re-validation.


Inaccessible views.

Currently, there are several views which a normal user would be completely unaware of because we have no link to them anywhere in the UI. These views include two JSON views and two project feeds.
@vphill, do you want links to some or all of those placed in the navigation bars, or do you want those views deleted?

I think having the two feeds as little feed icons on the main project page and then probably on the about page too would be a good thing.  We should probably add them to the HTML as  elements as well.
The Json views I'm not sure about.  I'm not sure what they return without digging into things.

So we're going to add links to the feeds in two of the project views, and comment the JSON views so we know what they're doing.


[Docs]: record the sign-in/sign-up workflow

You can check the video here: https://www.loom.com/share/fe0de425ad854dc8a24f693136180d1a?sid=52a76d29-588e-4a60-8df7-c8ce2ff20f35
@thebeyondr you might want to see it :D


can use ruby function in docx template

Hi I want to ask i have date like '2015-01-01' can i use ruby function in docx like this '2015-01-01'.strftime('%b %Y') so it result "January 01"

You can do this by wrapping your data with an object. This allows you to define a formatter method that you can then call from your template. This will look something like this:
require "sablon"
template = Sablon.template(File.expand_path("~/Desktop/template.docx"))

DateStruct = Struct.new(:date) do
  def day_and_month
    date.strftime('%b %Y')
  end
end

context = {
  obj: DateStruct.new(Date.parse(2015-01-01)),
}
template.render_to_file File.expand_path("~/Desktop/output.docx"), context

And then in your template you can call it using:
«=obj.day_and_month»

The naming in my example is a bit arbitrary but you should get the general idea. I'm sure you can find better suited names for the objects in your domain.


User authentication API

The user can:

Register /api/v1/register
Login /api/v1/login
Logout /api/v1/logout

Wow, Django gives you a lot for free doesn't it! Even stout encryption


Providing packages in world with constraints is not respected in existing list

Consider the following list of packages:
packages:
- git

git depends on libcurl, which depends on libcrypto, which depends on openssl-config. So the final graph should have openssl-config in it, at the highest version. Let's say that we have openssl-config at the highest version of 3.2.
This works fine.
Now consider this list:
packages:
- git
- openssl-config-special

where openssl-config-special provides openssl-config=3.1.0-r0, i.e. below the highest available, which, as described above, is 3.2. Because we explicitly provide openssl-config-special, we should take that one to satisfy git's openssl-config dependency, and not the regular one, which would be at 3.2. This, too, works.
Now provide our special version with a constraint.
packages:
- git
- openssl-config-special=3.1.0

Now, it fails. It will include openssl-config-special=3.1.0 in the final graph, but it also will include openssl-config=3.2.0.
The reason for this is because the map that contains the list of "existing dependencies" did not separate name from version before tracking, only after.
This was fixed in #55 , where we not only added the parent, but to do so, we ensured that the tracking list is by name.
This issue is mainly as a tracking issue, so we can know it in the past, as well as for us to add a test.

Pulling the latest go-apk into tf-apko also reveals a test breakage that may very well be related to this.
We fixate a list of packages that includes wolfi-baselayout pinned to r0, and we get back r3 😞
I haven’t tried bisecting the change from go-apk that broke this, but this seems back and we should definitely get to the bottom and add a bunch of tests for this stuff.
cc @imjasonh

@mattmoor don't worry about figuring out which change; I can get to that.
Can you post here a precise reproduction of the call you make, expected output, and actual? Is it just the r0 -> r3? How is the function called and with what parameters?

I was just reproducing this with apko and your PR to update apko:
contents:
  repositories:
  - https://packages.wolfi.dev/os
  keyring:
  - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
  packages:
  - wolfi-baselayout=20230201-r0
  - ca-certificates-bundle=20230506-r0
  - glibc-locale-posix=2.37-r6
  - ko=0.13.0-r3
  - tzdata=2023c-r0

archs:
- x86_64

At HEAD (note two versions of wolfi-baselayout):
go run . show-packages foo.yaml
amd64
  ca-certificates-bundle 20230506-r0
  glibc-locale-posix 2.37-r6
  wolfi-baselayout 20230201-r3
  ld-linux 2.37-r7
  ko 0.13.0-r3
  tzdata 2023c-r0
  wolfi-baselayout 20230201-r0

With your latest change:
go run . show-packages foo.yaml
amd64
ca-certificates-bundle 20230506-r0
glibc-locale-posix 2.37-r6
wolfi-baselayout 20230201-r3
ld-linux 2.37-r7
ko 0.13.0-r3
tzdata 2023c-r0

@kaniini fed these initial constraints through apk fix earlier, which was a neat trick and it thought the solution should be wolfi-baselayout=20230201-r0 (not -r3, which we get now).

That's solid. We can work with that.

I know why this is. We got lucky with the openssl-config case, because of alphabetical ordering made the top-level package already in place. We shouldn't depend on that. Getting a fix in place.

See #60

cc @imjasonh FYI

I am glad we pushed for the tests on this. It highlighted some issues that we managed to test and resolved, in addition to the just plain goodness of having the tests.

I've confirmed that #60 fixes the tf-apko issue.  I'm going to test the fips issue next 🤞

I've confirmed that the fips issue is fixed as well.

Excellent. So let's get #60 in, I can update the PR on apko to include it, and we will be good.


Suggest supply instance method

thx for your excellent job. Instance method make it easier for config NSURLSession.^_^

You're right, here you go: https://github.com/floschliep/NSURLSession-SynchronousTask/commit/db2cc71dc6de4c7f5e98ad89a8da6f53f59d0709


Feature/modal

This looked like a cool enhancement. Was there a reason why you closed it (out of curiosity)?

Thank you. I am using this modal view feature. However, this feature seem like for me only :sweat_smile:.  Would you merge if this feature is good, please?


added a test to challenge:falsy-bouncer

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
[x] My changes do not use shortened URLs or affiliate links.

Closes #37972

Thanks. It's incredible to have a review from you. @moT01

Instead of adding a new test, why not just flip the position of the 1st and 3rd elements to handle this edge case.
  - text: bouncer([null, NaN, 1, 2, undefined]) should return [1, 2].
    testString: assert.deepEqual(bouncer([null, NaN, 1, 2, undefined]), [1, 2]);

Yes that's a great point.


check for default config path

I want to deploy your program on multiple hosts but setting up an environment variable for each user is not very convenient.
Can you implement default paths with different weightings?
Something like this:
PBCLI_CONFIG_PATH > $HOME/.config/pbcli/config > /etc/pbcli/config
The environment variable has priority over the user config folder which in turn has priority over the system path.

Greetings,
Thank you for the feature request. Initially I took inspiration from how ripgrep handles the configuration of their CLI tool and they explicitly do not have a default config location. However, having one is a decent practice in many other tools and I see no reason to not implement it if there is a need for it. I'll try to work on this on the weekend and would implement the following:

Default fallback locations for configs with the environment variable always taking precedence
A new cli option named --no-default-config to disable looking for a default config

Best Regards
Mydayyy

Greetings,
I apologize for the delay. I finished up this feature and will proceed to merge and release this tomorrow since its currently fairly late. I now implemented the following three things:

A new cli optioned as mentioned above, --no-default-config. This will prevent the application from looking around for a default config, but will still respect the config set via the envvar
A new logger mechanism. Currently only used to output config related messages (and other messages from libraries used). It can be activated with --debug and should be useful to troubleshoot config issues for example seeing which directories are searched and which config is loaded1
Default config locations. The searched path depend on the system and follow os-specific conventions. On linux this should be ```$XDG_CONFIG_HOME/pbcli/configor$HOME/.config/pbcli/config` if the XDG variable is not set

1 Example output:
DEBUG pbcli::config: looking for config at /home/mydayyy/.config/pbcli/config
DEBUG pbcli::config: looking for config at /etc/pbcli/config
DEBUG pbcli::config: no config found

Released in 2.5.0 on crates, aur and github

Hi @Mydayyy ,
I thing I need some help with the configuration file. :-(
pbcli is stored in /etc/pbcli/.
echo 'TestPaste' | /etc/pbcli//pbcli --host https://privatebin.net/ --burn is working fine. Now I want to use the config file.
I created the config in /etc/pbcli/ ('/etc/pbcli/config') and add the following lines:
--host=https://privatebin.net/
--burn

Now the comand should work withour --host https://privatebin.net/ --burn
echo 'TestPaste' | /etc/pbcli//pbcli does not work.
#echo 'test' | /etc/pbcli/pbcli
              error: The following required arguments were not provided:
    <URL>

USAGE:
    pbcli <URL>

For more information try --help

echo 'TestPaste' | /etc/pbcli//pbcli --debug does not work.
#echo 'test' | /etc/pbcli/pbcli --debug
              error: The following required arguments were not provided:
    <URL>

USAGE:
    pbcli <URL>

For more information try --help

echo 'TestPaste' | /etc/pbcli//pbcli --host https://privatebin.net/ --burn --debug is working fine.
The debug report is using the config /etc/pbcli/config
# echo 'test' | /etc/pbcli/pbcli --host https://privatebin.net/ --burn --debug
DEBUG pbcli::config: PBCLI_CONFIG_PATH not set
DEBUG pbcli::config: looking for config at /root/.config/pbcli/config
DEBUG pbcli::config: looking for config at /etc/pbcli/config
DEBUG pbcli::config: using config /etc/pbcli/config
DEBUG reqwest::connect: starting new connection: https://privatebin.net/
DEBUG hyper_util::client::legacy::connect::dns: resolving host="privatebin.net"
DEBUG hyper_util::client::legacy::connect::http: connecting to [2001:1620:2057:1:4902::7]:443
DEBUG hyper_util::client::legacy::connect::http: connected to [2001:1620:2057:1:4902::7]:443
DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", privatebin.net)
https://privatebin.net/?f50d5e0825430de6#8TzwbEyCa3AztCBErt37tYmi8YJ3r48uTUvmVuFRRbSi

Now I set PBCLI_CONFIG_PATH=/etc/pbcli/config.
echo 'TestPaste' | /etc/pbcli//pbcli --debug does not work.
#echo 'test' | /etc/pbcli/pbcli --debug
              error: The following required arguments were not provided:
    <URL>

USAGE:
    pbcli <URL>

For more information try --help

echo 'TestPaste' | /etc/pbcli//pbcli --host https://privatebin.net/ --burn --debug is working fine.
The debug report is using the config /etc/pbcli/config again
# echo 'test' | /etc/pbcli/pbcli --host https://privatebin.net/ --burn --debug --no-default-config
DEBUG pbcli::config: using config pointed to by PBCLI_CONFIG_PATH
DEBUG pbcli::config: using config /etc/pbcli/config
DEBUG reqwest::connect: starting new connection: https://privatebin.net/
DEBUG hyper_util::client::legacy::connect::dns: resolving host="privatebin.net"
DEBUG hyper_util::client::legacy::connect::http: connecting to [2001:1620:2057:1:4902::7]:443
DEBUG hyper_util::client::legacy::connect::http: connected to [2001:1620:2057:1:4902::7]:443
DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", privatebin.net)
https://privatebin.net/?068f39ac53387327#AXaJt1RWQHWJ5oEjLabrjHRaZGxvVSEczzhpG9FQoByW

I dont know how to use the config the right way. Im using ubunti 24.04.
Maybee somone can help me?

Greetings,
the fix has been released as v2.5.1 on github, AUR and on crates. Please let me know if this works for you and I will proceed to close this issue.
Best Regards
Mydayyy


Ajv resolver not using custom error messages on required errors

Describe the bug
Without a custom required error message set on my AJV form schema, required form field errors are returned as expected with the default AJV required error message. With a custom required error message set, no error is set on the form field. The required error message is attached to the error body on a non existent "" form field
To Reproduce
Steps to reproduce the behaviour:
Set the form schema:
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "email": {
      "type": "string"
    }
  },
  "required": ["name", "email"],
  "errorMessage": {
    "required": {
      "name": "Name must be defined",
      "email": "Email must be defined"
    }
  }
}

Set the form value:
{
  "name": undefined,
  "email": undefined
}

Expected react hook form error when both name and email are not defined:
{
  "name": {
    "message": "Name must be defined",
    "type": "required"
  },
  "email": {
    "message": "Email must be defined",
    "type": "required"
  }
}

Actual error returned:
{
  "": { "message": "Name must be defined", "type": "errorMessage" }
}

Codesandbox link (Required)
Example
First name is using the default ajv error messages. Last name is using a custom required error message. On submitting the form, only the required first name error message is displayed.
Expected behavior
Custom required error messages should be returned by form errors on the relevant form field.
Desktop (please complete the following information):

OS: macOS Ventura v13.4
Browser Chrome
Version 115.0.5790.170

I'm unsure if we can resolve this issue.
An error should be associated with a field, aligning with how react-hook-form and resolvers function.
When you configure a custom error message using AJV (ajv-error) for the required property, AJV doesn't substitute the default error message with your customized one. Instead, it introduces a new error at the top level.
Due to this behavior, we can't establish a connection between the custom error message and the default one, which is why you're seeing "": {}.
After delving into this, I haven't discovered a way to substitute the default error message with the customized version. If you're aware of a solution, kindly share it, and I'll attempt to update the resolver accordingly.
This CodeSandbox shows a basic AJV validation with a custom error message
https://codesandbox.io/s/suspicious-silence-kt7qqk
The result from the validation:
[
    {
        "instancePath": "",
        "schemaPath": "#/errorMessage",
        "keyword": "errorMessage",
        "params": {
            "errors": [
                {
                    "instancePath": "",
                    "schemaPath": "#/required",
                    "keyword": "required",
                    "params": {
                        "missingProperty": "username"
                    },
                    "message": "must have required property 'username'",
                    "emUsed": true
                }
            ]
        },
        "message": "username is required" // ⚠ we can't associate this error message with the error
    }
]

@jorisre Can you explain this more to me? I'm trying to fix it

Me too

I just encountered this issue, not being able to display a custom error message for a required property.
What I don't get is that ajvResolver already handles the case of a required error that is bind to the root and not to the path of the field.
In https://github.com/react-hook-form/resolvers/blob/master/ajv/src/ajv.ts, you will find it from line 11 to 16.
 // Ajv will return empty instancePath when require error
  ajvErrors.forEach((error) => {
    if (error.keyword === 'required') {
      error.instancePath += '/' + error.params.missingProperty;
    }
  });

This piece of code rebuilds the path from the missing property in the case of a required error, so it feels like ajvResolver will handle the case, but actually, it does not match the payload of the actual error (which is the format mentioned in https://github.com/react-hook-form/resolvers/issues/615#issuecomment-1681937396.
ajvResolver's code is quite standalone and easy to fork, it may be a dirty quick fix (not having every react-hook-form/resolver points in mind), but adding the following loop after the first one did the trick for me:
ajvErrors.forEach((error) => {
    if (error.keyword === 'errorMessage') {
      const subError = error.params.errors[0];
      if (subError.keyword === 'required') {
        error.instancePath += '/' + subError.params.missingProperty;
      }
    }
  });

As stated, it may be simplistic and/or dirty, but it definitely feels like ajvResolver could handle this.
I hope this will help!


Print name error when running in containers

I am having an issue executing parsl apps within docker containers. Although this works correctly when executing the parsl app directly, it seems like the built-in python environment is being removed when I try to import the apps into another module and run it. For example, if I define a simple app that just prints "hello" in a file, say test.py, and invoke it directly (python test.py), everything works fine and the app is executed in my container. However, when I try to import test.py into another python script and execute it, I get an error that print is not defined. Here is a trace:
2018-03-30 11:07:32 parsl.dataflow.dflow:186 [ERROR]  Task 0 failed
Traceback (most recent call last):
  File "/home/ryan/Documents/Argonne/DLHub/parsl/parsl/dataflow/dflow.py", line 183, in handle_update
    future.result()
  File "/home/ryan/Documents/conda/anaconda3/envs/parsl/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/home/ryan/Documents/conda/anaconda3/envs/parsl/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/ryan/Documents/conda/anaconda3/envs/parsl/lib/python3.6/site-packages/ipyparallel/client/asyncresult.py", line 226, in _resolve_result
    raise r
ipyparallel.error.RemoteError: NameError(name 'print' is not defined)  File "/home/ryan/Documents/conda/anaconda3/envs/parsl/lib/python3.6/concurrent/futures/_base.py", line 432, in result

The issue here was that the wrapped apps were imported from a file which was not available on the containers. This resulted in the de-serialization failing, but continuing to the app execution phase instead of failing completely. The broken environment on the workers basically screwed the execution of the apps and returned a totally unrelated and unhelpful error.
To debug this, we enabled debug logging on the ipp workers, and inspected the logs.
The fix was to explicitly copy contents of the current directory to the containers.

Okay, there are some problems with that last commit.

Copying the current dir to the container image is surprising behavior.
Unnecessary and large data volumes might be gettting copied in
Sensitive information might get copied it.
We should be relying on the user building the image smartly
We are bound to miss some other python modules/packages coming from PYTHONPATH

So I'm rolling this back and adding a doc note.


BD not allowing themes/plugins [Bug]

Describe the Bug
After restarting my laptop, BD no longer allowed me to use themes/plugins. BD's setting tab is there, with all the settings options expected, but there's no tabs for plugins or themes, and I cannot use plugins or themes at all.
To Reproduce
Update BD to latest from installer and open Discord.
Expected Behavior
My themes and plugins to activate, and have tabs for themes/plugins.
Screenshots
https://cdn.discordapp.com/attachments/881037029826232320/904832480778002432/unknown.png
Discord Version
Latest stable (I can't find a version number, but the Changelog says October 4th, 2021.)
Additional Context
To try fixing the issue, I uninstalled and reinstalled Discord & BD (while also making sure to clear out left behind files), it didn't work. I tried to repair BD using the installer, but it didn't work. I tried finding the file path for BD's plugins/themes and inserting the files into there, to see if it would force them to activate, but it also did nothing.

Duplicate of #1099


wakatime-cli: 1.98.3 -> 1.98.5

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/wakatime/wakatime-cli/releases.
meta.description for wakatime-cli is: WakaTime command line interface
meta.homepage for wakatime-cli is: https://wakatime.com/
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.98.5 with grep in /nix/store/v5x76bpl55iz42nlf0vs8ix0lwlb901v-wakatime-cli-1.98.5
found 1.98.5 in filename of file in /nix/store/v5x76bpl55iz42nlf0vs8ix0lwlb901v-wakatime-cli-1.98.5

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

3 total rebuild path(s)

3 package rebuild(s)

First fifty rebuilds by attrpath

fishPlugins.wakatime-fish
wakatime-cli

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/v5x76bpl55iz42nlf0vs8ix0lwlb901v-wakatime-cli-1.98.5 \
  --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 wakatime-cli https://github.com/r-ryantm/nixpkgs/archive/c9dbde8fc960f7184ceeef65adef0cfd2b99d7ad.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/c9dbde8fc960f7184ceeef65adef0cfd2b99d7ad#wakatime-cli

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/v5x76bpl55iz42nlf0vs8ix0lwlb901v-wakatime-cli-1.98.5
ls -la /nix/store/v5x76bpl55iz42nlf0vs8ix0lwlb901v-wakatime-cli-1.98.5/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

2 packages built:

fishPlugins.wakatime-fish
wakatime-cli

Maintainer pings
cc @Sigmanificient for testing.

[!TIP]
As a maintainer, if your package is located under pkgs/by-name/*, you can comment @NixOS/nixpkgs-merge-bot merge to automatically merge this update using the nixpkgs-merge-bot.

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

@NixOS/nixpkgs-merge-bot

@NixOS/nixpkgs-merge-bot merge


Remove excluded characters from separator dectection

This is actually an important pull request. I'm having conflicts when one of the fields contains many commas, as even though they are in between escape characters (like ""), they are counted in and the function interprets them to be separators.
Hopefully it will be pulled soon


Allow force flag to skip confirmation dialog for automation

For automation there needs to be a way to not be forced to specify user input. It will now skip the user prompt if --force flag is passed in
Performance improvement by only rebooting machines that are not already joined
When joining a domain, if openssh is used then the username will need to be modified (this is a pretty common thing)

This is great stuff @taliesins! I'll see if I can pull this down and have a play over the weekend.
If you could, some more tests around the new logic would be lovely.

Thanks for all of these mate - Pushed out v1.2.0! 🎉


DNN-10072 Fix assembly version check

When an assembly already exists for a package, it's checked against a random
version to determine whether it's newer or older, rather than the latest
version
DNN-10072

When upgrading a package (i.e. installing a new version of an existing package), or doing a repair install, it is possible for an assembly in that package to overwrite a newer version of an existing assembly (e.g an assembly which was installed via a different package).
Steps to Reproduce

Install PackageOne_4.1.0.zip (which references HtmlTags.dll version 4.1.0)
Install PackageTwo_4.2.0.zip (which references HtmlTags.dll version 4.2.0)
Put one of the modules on a page (both modules do the same thing), the message should say that version 4.2.0 is installed
Re-install PackageOne_4.1.0.zip (i.e. do a repair install)

Expected Results

HtmlTags 4.2.0 is still the referenced assembly

Actual Results

HtmlTags 4.1.0 is the referenced assembly

Note that this bug is non-deterministic, so it's possible that this scenario wouldn't trigger the bug, but I think it's probable that this will fall into the bug condition.

Eek, sorry that crept in there. I've pushed the fix @galatrash-at-dnn

@galatrash-at-dnn is there anything else you need from me on this PR?

@bdukes, I was just waiting the PM to add the Jira issue in the current sprint to merge. I'll review it today.

@bdukes, any progress on this?

@galatrash-at-dnn changes have been made, let me know if there's anything else.

the solution with a temp table is performance wise not optimal - this is not significant for current use case, but if someone uses function fn_compareversion in a larger query, it might become an issue. I am using the following function in my scripts.
`CREATE FUNCTION {databaseOwner}[{objectQualifier}VersionNumberSerial]
(
@VersionString  nVarChar(20) -- String containing a version format '01.02.03'
)
RETURNS int
WITH SCHEMABINDING
AS
BEGIN
DECLARE @part           nVarChar(20)
DECLARE @Pos            Int
DECLARE @LastPos        Int = 1
DECLARE @MajorVersion   Int
DECLARE @MinorVersion   Int
DECLARE @BuildVersion   Int
IF IsNull(@VersionString, N'') = N'' RETURN -1
SET @Pos = CHARINDEX(N'.', @VersionString, @LastPos)
IF IsNull(@Pos, 0) = 0             RETURN -1 -- no valid Version
SET @Part = SUBSTRING(@VersionString, @LastPos, @Pos - 1)
IF IsNumeric(@Part) = 1 SET @MajorVersion = CONVERT(int, @Part)
SET @LastPos = @Pos + 1
SET @Pos = CHARINDEX(N'.', @VersionString, @LastPos)
SET @Part = SUBSTRING(@VersionString, @LastPos, @Pos - @LastPos)
IF IsNumeric(@Part) = 1 SET @MinorVersion = CONVERT(int, @Part)
SET @Part = SUBSTRING(@VersionString, @Pos + 1, 20)
IF IsNumeric(@Part) = 1 SET @BuildVersion = CONVERT(int, @Part)

RETURN IsNull(@MajorVersion, 0) * 10000 + IsNull(@MinorVersion, 0) * 100 + IsNull(@BuildVersion, 0)

END
GO
`
the numeric value is easy to compare in fn_CompareVersion:
'
CREATE FUNCTION {databaseOwner}[{objectQualifier}fn_CompareVersion]
(
@Version        nVarChar(20),  -- Not Null
@CurrentVersion nVarChar(20)   -- Not Null
)
RETURNS int
WITH SCHEMABINDING
AS
BEGIN
DECLARE @VersionSerial  Int
DECLARE @CurrentSerial  Int
IF @CurrentVersion Is Null  -- Assembly Not Registered - Set ReturnCode = 0, so assembly is copied
    RETURN 0
ELSE IF @Version = @CurrentVersion
    RETURN 2                -- Same Version - Set ReturnCode = 2, so assembly is only copied on repair
ELSE BEGIN                  -- Different Versions, compare Major, Minor, Revision
    SET @VersionSerial = {databaseOwner}[{objectQualifier}VersionNumberSerial](@Version)
    SET @CurrentSerial = {databaseOwner}[{objectQualifier}VersionNumberSerial](@CurrentVersion)

    IF @VersionSerial > @CurrentSerial AND @CurrentSerial >= 0
        RETURN 1            -- Set ReturnCode = 1, so assembly is copied
    ELSE
        RETURN 3            -- Set ReturnCode = 3, so assembly is not copied
END
RETURN 3

END
GO
'

@sleupold, please submit your suggested changes as a pull request so we can process it; otherwise, it is hard to apply your changes.

@galatrash-at-dnn, thanks, will due over the weekend

@sleupold any update on this issue?


Issue #248 Use dns server from VM to resolve domain in linux.

Now that we are running dnsmasq in the crc VM, we can have a simpler dnsmasq configuration on the host to directly add the dns server to /etc/resolv.conf
Don't spend time on review this change right now, I still have to figure out some of the missing parts.

I've an alternative solution that still takes the first 3 patches from here but uses nmcli to add the dns server to NM instead. I haven't managed to fully test it yet but hopefully I'll be able to create a PR in a few hours.


Question: do you support "grid" export?

Thank you for this great project!
You can export tables into excel.
Can this plugin export css "grid" into excel too?
Thanks and have a great day

It's not supported at the moment.
Would you share an example of one of your tables with a CSS grid? Then I can see how it could be converted into an array and work from there.

It is based on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid
An example: https://jsfiddle.net/jehon/kqd2ac3s/1/

I see this as a quite difficult task.
First, it is needed to parse the CSS assigned to the DOM object that is the container. According to the Mozilla page, these are all the options. And calculate how this affects each of the children of the container.
/* <'grid-template'> values */
grid: none;
grid: "a" 100px "b" 1fr;
grid: [linename1] "a" 100px [linename2];
grid: "a" 200px "b" min-content;
grid: "a" minmax(100px, max-content) "b" 20%;
grid: 100px / 200px;
grid: minmax(400px, min-content) / repeat(auto-fill, 50px);

/* <'grid-template-rows'> /
   [ auto-flow && dense? ] <'grid-auto-columns'>? values */
grid: 200px / auto-flow;
grid: 30% / auto-flow dense;
grid: repeat(3, [line1 line2 line3] 200px) / auto-flow 300px;
grid: [line1] minmax(20em, max-content) / auto-flow dense 40%;

/* [ auto-flow && dense? ] <'grid-auto-rows'>? /
   <'grid-template-columns'> values */
grid: auto-flow / 200px;
grid: auto-flow dense / 30%;
grid: auto-flow 300px / repeat(3, [line1 line2 line3] 200px);
grid: auto-flow dense 40% / [line1] minmax(20em, max-content);

/* Global values */
grid: inherit;
grid: initial;
grid: revert;
grid: revert-layer;
grid: unset;

The second biggest problem is that some of the grid options are dependent on the size of the page and the cells. If you resize the page, the arrangement of the cells/columns will change.
I don't think this is a feasible task for this project.

If you are developing the HTML of that page, you already have the data available. Can you make some data transformations to get an array? Then pass that array to ExcellentExport.

Yes, no problem... would have been a nice feature, but hard to implement yes
Thanks for your time


Extensions management menu in the preferences does sort randomly when having the production and dev version next to each other

Description
The Extension Preferences list get sorted randomly (between same extension) when having both, the development version and the production (store) version next to each other.
https://github.com/raycast/extensions/assets/3163807/95050c00-964e-4d2a-b7ea-7f2b61dbffd7
I often disable the development commands after developing to keep the settings when needed again.
This effect also happen when enable/disable a single command in it as well.
Steps To Reproduce

Go to preferences
Go to extension tab
Scroll to the extension which has dev and prod version
Disable/Enable all commands of the dev version

Current Behaviour
The position of the 2 extension jumps which leads to the effect that I sometimes check/uncheck the wrong extension.
Expected Behaviour
The sorted should respect the dev flag as well when both version are installed. The order (dev or prod first) is not that important, more that it stay consistent.

Ah good catch, will be fixed in the next release


[FLI-861] Try to handle panics in engine

thread '<unnamed>' panicked at flipt-engine-ffi/src/lib.rs:212:79:

Thank you @markphelps, that helps to understand the issue better. That unwrap could panic in many cases if there is an connection or configuration issue. It would be great if initialize_engine could return an error to upstream instead of panic. Don't know if that is possible with FFI.

Yeah agreed. We should see if we can recover from panic in FFI/Flipt Evaluation layer and always return an error instead of crashing the client. Will create an issue for this in the flipt-client-sdk repo
Originally posted by @markphelps in https://github.com/flipt-io/flipt/issues/2791#issuecomment-1956875106
FLI-861

This from the stdlib may be helpful per the Rust FFI docs: https://doc.rust-lang.org/nomicon/ffi.html#catching-panic-preemptively

@markphelps i'd like to take a stab at this one, could you assign it to me please?


Add a way to get the currently active folds

Feature description
if I have only 3 folds, I should be able to get those 3 folds,
Describe the solution you'd like
something like the getFolds function, but only for active, so it would look like getActiveFolds
Additional context
No response

Sorry, what's active meaning?


Pls explain to dummy how to get it work

I've installed 'Sonoff LAN' integration in HACS. But what next.
Integration do not appear in "regular" intergrations list.
sonoff: section in configuration.yaml also have no effect...
Do not understand what to do after installation in HACS :(

https://github.com/AlexxIT/SonoffLAN#config-examples


[SITE BROKEN - Novelfull.com]

SITE BROKEN - Novelfull.com
Additional information
The problem started within last 3 days (last time successful downloaded 3 days ago) following error is given.
[ERROR] Forbidden! (403)

They are probably using cloudflare, it might just be temporarily or not, so this will probably not work but it is worth a try.
Go to settings -> sources -> novelfull and then click open browser, wait for it to load and then hit sve cookies, no need to login. Select "use account" before fetch the novel info.

@Flameish I mailed you please read it it's the one with flying_pen

I really think we need to spoof the headers now. I tried scraping from readnovelfull and novelfull yesterday with python. using correct headers seemed to work

Also instead of using Forbidden(403) could you print the whole stack trace in the logging. I am trying to replicate it in python with selenium but it seems to work there

There is nothing to print. Its just an 403 theres ndot much info to it.

im also experiencing this. hope someone help solve this prob

You can probably use manual grabbing in combination with the headless browser option for now.

There is nothing to print. Its just an 403 theres not much info to it.

Unfortunately this is happening to a lot of the source sites, any ways aroudn this?

Manual example, if anyone needs it

Really really thank you for the example. I haven't been able to use manual mode till date. I'll try using your example and let you know.

Really really thank you for the example. I haven't been able to use manual mode till date. I'll try using your example and let you know.

I hope it helps,
By the way, I realized that is better grab less chapters at once because if there is an error it wont grabb anything

Really really thank you for the example. I haven't been able to use manual mode till date. I'll try using your example and let you know.

I hope it helps, By the way, I realized that is better grab less chapters at once because if there is an error it wont grabb anything

uhh is that what happened here? I tried imitating what you did for a different novel and it broke.

how would I do it for this novel: Let me Game in Peace?


Attribution

Is it possible to add this feature while still using your bridge?
https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#google-play-implement
Thanks!

Hi @9mm !
I've looked into campaigns briefly before, since I need it in one of my own apps. It looks like the iOS & Android implementation here differs a bit.
It seems to be possible to use automatic campaign attribution with iOS if you add the iAd.framework to your project and allow IDFA (already possible with the bridge).
For Android it seems like maybe just modifying the AndroidManifest.xml.
If this is true, then it should work seamlessly next to my bridge. If it doesn't work automatically, then I probably need to modify the bridge in order to track campaign data along with normal events.
Again, I haven't tested this, so I am not sure how this would play out. I will look into this myself at one point, but at the moment I have other things I need to prioritize.

Awesome, thanks for the reply. I'll let you know how it goes for future reference.

Hey @9mm, did it work for you? I added iAd.framework as well as turned on IDFA collection but it seems it's still not working. Did you have to do something more?

I roughly did what cbrevik said, and it seemed to work, although pretty much 100% of stuff related to ads is pure garbage code so it's kind of hard to tell.

Ok, thanks for the reply. Couldn't agree more about quality of pretty much anything related with ads.

Added this to my android manifest xml and it started working  for android
<!-- Used for Google Play Store Campaign Measurement-->
      <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
          android:enabled="true">
          <intent-filter>
              <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
          </intent-filter>
      </receiver>
      <service android:name="com.google.android.gms.analytics.AnalyticsService"
          android:enabled="true"
          android:exported="false"/>

      <!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
           installation campaign reporting -->
      <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
          android:exported="true">
          <intent-filter>
              <action android:name="com.android.vending.INSTALL_REFERRER" />
          </intent-filter>
      </receiver>
      <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />

We now have a function to track campain urls (6d4ba4fd48dcc0e2f6e1ad72f70055bc315d1621). So closing this issue. Please re-open if this doesn't cover the use-case.

Hey @cbrevik , I am trying to use react-native-google-analytics-bridge  to track campain urls.
I am trying to sent Google Play link with parametrs and get the parameters in my app to know who sent the link.. Can you show any example of using react-native-google-analytics-bridge to gets this parameters?
thank you a lot!

@master-atul , can you please help me with it. I have added the plugin react-native-google-analytics-bridge & also have added the things mentioned by you in AndroidManifest.xml, now how can I track the utm_source in my app? What to write to track that this particular customer has come from a particular utm_source?
Please help.

i'm also trying to figure this out. does anyone have a working example?

Hello, i'll tell how i've done my task here.
First i have created a file called CustomReceiver.java under

android/app/src/main/java/com/YOUR-APP/

here is a gist of the file that i wrote customreceiver
after that you'll need to change your androidmanifest.xml, from:
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"           android:exported="true">           <intent-filter>               <action android:name="com.android.vending.INSTALL_REFERRER" />           </intent-filter> </receiver>
to
   <receiver android:name="com.<YOUR-APP>.CustomReceiver"       android:enabled="true"       android:exported="true">       <intent-filter>         <action android:name="com.android.vending.INSTALL_REFERRER" />       </intent-filter>     </receiver>
to test you should build your app a run it, after your app is open you should put in your console:
echo 'am broadcast \     -a com.android.vending.INSTALL_REFERRER \     -n "com.<YOUR-APP>/com.<YOUR-APP>.CustomReceiver" \     --es "referrer" \       "utm_source=test_source&utm_medium=test_medium&utm_term=test_term&utm_content=test_content&utm_campaign=test_name"; \     exit' | adb shell
if everything goes right you will see:

Broadcasting: Intent { act=com.android.vending.INSTALL_REFERRER flg=0x400000 cmp=com./.CustomReceiver (has extras) }
Broadcast completed: result=0

and under campaign -> source in google analytics console you will see your test_source, please note that i've put the tracker id in the customreceiver because i don't know how to recover it from the configuration file.

build the code using this refs:
https://github.com/idehub/react-native-google-analytics-bridge/blob/master/android/src/main/java/com/idehub/GoogleAnalyticsBridge/GoogleAnalyticsBridge.java
https://stackoverflow.com/questions/27243146/android-using-google-analytics-v4-campaign-measurement
https://developers.google.com/analytics/devguides/collection/android/v4/campaigns
https://developers.google.com/analytics/solutions/testing-play-campaigns


IN-1168 Annual report type assignments from PENDING reports only

Purpose
IN-1168
Approach

Learning

Checklist

[ ] I have performed a self-review of my own code
[ ] I have done an adhoc run against preprod (only needed for high complexity PRs)
[ ] I have added relevant logging with appropriate levels to my code
[ ] I have updated documentation where relevant
[ ] I have added tests to prove my work
[ ] The product team have tested these changes

I will add the dependency as noted by @devkokov. Please don't merge until that's done.

Added dependency as per review. Ready for re-review.