Refactor lua code for performance purpose

This change has been necessary to sustain performance requirements for some tests I did quite recently. For a large amount of rules (around 200 and the last rules hit systematically the redis backend), so the lua code corresponding to loadEvalMessageCommand seems pretty slow. I am willing to improve it even more in the near feature.

Hi Jesus,
The proposed PR avoids to (re)declare same variables when it is not necessary without changing the logic.
I suspect lua code is not properly optimized by the jit compiler, but I need to investigate further the redis code. (I am using version 4.0, the latest stable version)
Also, please find attached a simple test harness used to benchmark the lua code generated by the master branch (gen.lua) and the proposed pull request (gen_proposed_pr.lua). Feel free to reproduce the test with the command below. I noticed a quite significant difference between the two versions
I hope the test vectors are realistic enough. If you need further information, just let me know.
gcc test.c -I/usr/include/hiredis -lhiredis
time ./a.out gen.lua
time ./a.out gen_proposed_pr.lua

durable.zip

Thanks for the update, just let me know if your need some help for fixing the tests or reworking the code. (Do you have a dedicated regression test suite?)

Hi, I have pushed the optimization to the master branch. The code is slightly different, but it accomplishes the same objective.

Many thanks, I also checked the performance and it is similar to the proposal. so I closing this PR


Update README.md - fix deployment yaml

Added --host <IP_ADDRESS> to the llama-cpp-server arguments in the deployment YAML

Merged - thanks for the PR!


[Bug]-[2400]: Action creator onSuccess and onError reset to "No Action" led to error: Unexpected token ')' when triggering action

Is there an existing issue for this?

[X] I have searched the existing issues

Description
after reset onSuccess handler to "No Action", page generate wrong callback function for onPageChange handler  Query Users
errorMessage: "SyntaxError: Unexpected token ')'"
errorType: "PARSE"
message: "SyntaxError: Unexpected token ')'"
originalBinding: "Users.run(() => (), () => {})"
raw: "\n  function closedFunction () {\n    const result = Users.run(() => (), () => {})\n    return result\n  }\n  closedFunction.call(THIS_CONTEXT);\n  "
severity: "error"
type: "EVAL_TRIGGER_ERROR"

should generate Users.run(() => {}, () => {})
Steps To Reproduce

create a query Users to fetch user list data
create a query UserCount to fetch record count and set alias to count
Add table widget binding to query Users
enable server side pagination
setup total record count property binding to UserCount.data[0]['count']
setup onPageChange event handler to Users.run()
setup outgoing event onSuccess handler to any action, for example query UserCount
deploy
reset outgoing event onSuccess handler to "No Action"
deploy
change page should see the error

Public Sample App
No response
Version
Self Hosted - v1.6.5

@dilippitchika did something change in the property pane recently?

Simplified steps:

Drag a button
configure the action selector to call 1 query and 1 query on success
Remove the on success query
Click the button

Stats

Stat
Values

Reach
300

Effort (months)
0.25

Under src/components/editorComponents/ActionCreator/index.tsx line number 191 change this -
 const successArg = changeValue.endsWith(")")
  ? `() => ${changeValue}`
  : `() => ${changeValue}()`;

to -
  const successArg = changeValue.endsWith(")")
    ? `() => ${changeValue}`
    : `() => ${changeValue}{}`;

It worked for me, but need to test all scenarios. @dilippitchika @ApekshaBhosale

@yaldram can you check if this code was changed recently?
@somangshu who works on this part?

@dilippitchika I can see 5 months and 7 months ago changes atleast on the lines 192 - 194. The above solution is my guess, because these changes worked for me. Please contact frontend pod.

@somangshu @dilippitchika this should be handled in the UI Builders. It's related to the action selector component.

Workaround
Toggle to JS mode and add code that was visible earlier for example.
When created trigger using action creator, we see {{Api1.run()}}

Toggle to JS mode.
Replace generated code to {{Api1.run()}}
Try triggering action now by a button click or other event. It should work as expected.


topK should allow number

we don't force people to use multi modal
export type VectorIndexRetrieverOptions = {
    index: VectorStoreIndex;
    similarityTopK?: number | undefined;
    topK?: TopKMap | undefined;
    filters?: MetadataFilters | undefined;
};

@himself65 If you don't use multi-modal, just use similarityTopK - it sets topK for ModalityType.TEXT, see:
this.topK = topK ?? {
      [ModalityType.TEXT]: similarityTopK ?? DEFAULT_SIMILARITY_TOP_K,
      [ModalityType.IMAGE]: DEFAULT_SIMILARITY_TOP_K,
    };

This like a type issue, could you update to
export type VectorIndexRetrieverOptions = {
    index: VectorStoreIndex;
    topK?: TopKMap | undefined;
    filters?: MetadataFilters | undefined;
};
|
{
    index: VectorStoreIndex;
    similarityTopK?: number | undefined;
    filters?: MetadataFilters | undefined;
};


Where is documentation for stable 0.8.3?

I would like to ask, where I can find documentation for 0.8.3, because IMHO http://ng-table.com is generated from last master commit.
And what about release new 1.0.0 stable? Is 1.0.0-beta.8 ready for production? Which version do you recommend me to use now?

You right the doc site is from the latest (beta) version.
I would recommend using the current 1.0.0-beta.8. I've been using in production for a while now.
Make sure you read the migration guide in the repo readme as those changes will be made just before 1.0.0.
The only thing left to do to get to 1.0.0 is adding API documentation.
C

and when you will have time to finish 1.0.0 with API docu? thanks.

I want to say in the next could of weeks but I have a major deadline at work. Realistically it will be Dec now.

ngTable is best angular grid for me
thank a lot


Static Pages

Great solution! Just a quick one, is it possible to create static pages to implement my own app within the CMS? and accessed via the menus?
Cheers :-)

Yes, you can certainly could create pages not tracked by the CMS in the folder structure and then link to them within the menu.  You just have to be careful to not overwrite them from within the CMS as the general structure is stored in the DB.


setInterval causes JavascriptExceptionObject in ThreeJSApp

Hi,
I tried to run the ThreeJsApp example but when I try to use e.g.
setInterval(function() { console.log("test");}, 5);
the exception is thrown.
This seems to me a very standard functionality but can't get it working in here.
Any suggestions please?

setInterval is not implemented. I'll get in a fix for this shortly.

Thank you very much!
Is there an overview where already implemented parts are listed?

Am 29.06.2017 um 05:29 schrieb Cristi Petruta<EMAIL_ADDRESS>setInterval is not implemented. I'll get in a fix for this shortly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

It's a little more nuanced than that. Timers are not part of the EcmaScript specification; they are a web/html standard: https://www.w3.org/TR/2011/WD-html5-20110525/timers.html
HoloJS is not designed to work with the HTML/DOM model and does not implement most things HTML. For example jquery will not work. However, a sub-set of DOM elements had to be implemented to support WebGL. We can add support for more HTML standards as needed, but there is no intent to implement all of them the way a web browser has to.

I merged a fix for this into master. I did basic testing around set|clear interval and timeouts. Please let me know if you encounter more issues.


GEOS-Chem and HEMCO exit the repo

This is zero-diff, for all Chemistry modules except GEOS-Chem.
The GEOS-Chem and HEMCO projects are now each in their own repository, and Christoph has
made the necessary changes in GEOSchem_GridComp.
In other changes, a minor GMI edit addresses a problem when running CTM.
And python scripts have been updated.

We passed CI!

Glad to see this!


Support aws s3 urls

AWS is one of the major cloud providers. One day or other, scancode will be hosted on AWS by someone.
AWS s3 urls are of the form S3://mybucket/puppy.jpg. Currently docker:// URLs are supported. I can implement this support if it's something desirable.

@Hritik14 Could you clarify the link between "hosting ScanCode.io on AWS" and the "docker:// URLs support in the Project inputs"?

@tdruez

hosting ScanCode.io on AWS

Hosting scio on AWS would mean the tech stack is based on AWS and s3 being used for file storage is very likely.

docker:// URLs support in the Project inputs

There's no direct co-relation except, since scio supports schemes more than http/s, there might be interest in supporting others.

To clarify, you're suggesting adding support for S3:// type URLs as SCIO Project inputs, right?

@tdruez Yes!
This issue is more related to #619 as it brings one step closer to AWS ecosystem support.


Update dashboardCtrl.js to add the new gcloudKey integration inside the $scope.vm.addonsForm object

https://github.com/Shippable/pm/issues/9147

verified on rc


Import OZW config files

@robertsLando @chrisns I could actually use some help here... I've imported all the new files and fixed the errors, but this is going to be a heap of work. To help:

check out this branch
run npm run config -- import -s ozw -Dmid (leave out D (download) for each subsequent call)
review the config file changes one by one
run lerna run lint:config to check for errors and fix them (the list is gonna be massive). If this shows a file not found error, run npm run config -- import -i first
create a PR on this branch with your changes

We should probably each choose a directory randomly and delete the others (between step 2 and 3), so we don't do the same work twice.

Regarding 3:
I'd like the changes to be unobtrusive and to make sense. Some examples:
This is fine: ✔

This is NOT: ❌

This is fine: ✔

although unsigned: true is not necessary here.
This is not so nice because the original label is more comprehensible: ❌

This is unnecessary (we don't need the associations key if there is only a single lifeline association and the device supports Z-Wave+): ❌

Comments are removed sadly, please re-add them if you see that: ❌

This device label seems wrong: ❌

... you get the point.

Regarding 4:
When you see an error, ctrl+click on the path to open the config file directly
OZW config files are notoriously bad when it comes to correct valueSizes in combination with the min/max/default values. I often see -1 used in place of 255.
This is bullshit:

Correct: min = 0, max = 255, default = 0, the option value should be 255, there should be a second (default) option
Another example:

Correct: valueSize = 4, probably remove unsigned: true
And another one:

Correct: valueSize = 2
If you don't know the correct size, make a best-effort guess (only 1, 2 or 4 - 3 is not allowed by the specs, but some devices still use it).

Some devices send their serial number (or whatever) using a config param with size 16. Remove that, leave a comment.

Check if these config files really target the same device (or a different variant of it). If so, add the devices array to one of the files (preferably the better one), delete the other.

One of the labels is wrong or should be more specific.

@AlCalzone Before anything else, I would suggest to add revision to config files. So once they will be edited we will know when look for updates and when not

ALso wouldn't it be better to allow us to make changes directly on this branch?

Also wouldn't it be better to allow us to make changes directly on this branch?

I don't know how that works 🤷♂

Before anything else, I would suggest to add revision to config files

Agreed

@AlCalzone Could you do the import again now with the revision?

I don't know how that works

You should add us as maintainers of the library

I'll try, it will require a bit of stash/rebase fun

Stupid question is no way to dynamically pull and codify these changes either as rules or patches. rather than having to manually tidy them and repeat when there's ozw changes?

The already-added config files have a revision now. @chrisns @robertsLando is planning to create an action that only changes updated files. That should limit the manual work in each PR.
I'm not sure what burns more time - reviewing the automatic PRs or creating a semi-automatic fix. If you have a good idea, I'm all ears.
But especially for the in-file comments I'm unsure. I want to preserve them because they are valuable, but I don't know how.

I think you guys should have push access to this branch now

@AlCalzone what about adding to the top comment also a link to the original xml file in ozw repo?

I don't want to piss on your bonfire here because this is all great work but i feel you may have a license conflict here with a mix of this repo on MIT, openhab on eclipse, and ozw on gplv3.
Has that been thought through?
GPLv3 iirc stipulates we can reuse but only if we keep the same license, not sure about eclipse.

you may have a license conflict

I'm no lawyer or anything, but as far as I understand, copyright licenses protect expression, not ideas or data. And config files are generally not expressive enough to be protected by copyright.
Also consider that the config files (whichever source they are based on), are basically copies from the devices' user manuals.

@AlCalzone if you didn't know, this kind of things are @chrisns stuffs 🤣
Jokes aside, I think that it's important to consider license too to prevent any kind of problems in future. @chrisns what would you suggest?

Question:
Are config files considered part of the code? 🤔
Could we mix licenses somehow? Like just say that some config are imported from a GPLv3 project?
We don't really use anything on code side that's imported from others (I mean, the hard part is entirely MIT). Also most of the config files are provided by the community

If we agree it's something we don't want to run the risk of defending later irregardless of if we're right or not:
Either:

split into separate repos and depend on them
pull like any other library at build and do the conversion on the fly at runtime

It's not an issue of ownership
Arguably the community submitted their config on the basis of the licence of the repo they made a PR to. So I'd put forward it's not playing nice to take the value of that work and change the licence terms.

Are config files considered part of the code? 🤔

i'd argue they are intellectual property, so code or otherwise, they can be owned. and often may have been reverse engineered etc, so maybe not just taken from manual.
I'd put forward the device library is more than config, and is code by a dictionary definition

i'd argue they are intellectual property

I don't believe that the majority of config files surpasses the threshold of originality. Sure there might be some exceptions, but where do we draw the line? Most config files are not usable for us without transformation and major modification.

I'd put forward the device library is more than config, and is code by a dictionary definition

I know GPLv3 is not in discussion here, but going by that definition

The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities.

I'd argue that the config files are not part of the code. The library can be built and run perfectly fine without those. Arguably, the experience is not great, but it works.

I'm leaning towards not doing anything, but just lets discuss this a bit more.
1) split into separate repos and depend on them
How would you structure this? One for OH, one for OZW? Or just a separate one for the configurations? Which license? How do we deal with the additional overhead of synching changes in 2/3 repos?
2) pull like any other library at build and do the conversion on the fly at runtime
You mean when installing the library? Where's the difference then? Also, this is going to take minutes on each install and introduce many sources of errors. Some of the changes we need to do require a good understanding of how it all comes together - or quite an extensive ruleset for automatic fixing.
I don't really see that happening.
3) attribute each imported configuration file with the corresponding license
Could that be an option? How would we go about the files that are "the best of both worlds"? How about the already existing ones? Is there a point where our modifications are enough that we can say

4) remove information from the config files that does surpass the threshold of originality
Assuming there is a config param somewhere in the config files that has been found by reverse engineering and a community member does not want us to have that information - I'd be okay with removing it on request.
5) start from scratch and add config files manually
For example by a motivated community member who happens to write an import script alone in his room. How could we be sure that it is not taken from another project with a different license? (seriously, no matter what we decide, this is relevant in the future)

Most config files are not usable for us without transformation and major modification.

I think that's the main point of the discussion, also ww could place a source link to the original file, sincerly I don't think this could cause any license problem in future, but we should ask to a lawyer or someone expert in this field as those are just suppositions.
Finally this is OSS project like z2m is and I don't think anyone will cause problems to us for this, just someone who really hate us for some reason could 👀

I would say one more (last) thing about this.
If we wouldn't import those files, we should write them one by one, the result would be almost the same as config files are as they are, I mean once you have a config file structure they don't have many different ways of implementation, that is the only one, so even without importing those files the result is the same but will just take some much more (useless) tim (and anyway someone could say we have copied them from ozw or elsewhere and who can tell them we have wrote them by our own?)

Ok, lets come out ahead and discuss with Justin what he thinks of collaboration.

@AlCalzone Did you imported only new config files in this pr? I saw only around 200 files here

ALso about your comment for config reviews:

This is not so nice because the original label is more comprehensible: x
This is unnecessary (we don't need the associations key if there is only a single lifeline association and the device supports Z-Wave+): x

I think that we could skip this checks and focus more on the min/max/default values as I think them are the most errored

Yeah, I only added the new files here because they don't need to be merged. They would need the source link too though.
I didn't want to add all the others in a bulk because this makes it harder to wade through the lint errors than adding them one directory at a time.

But I guess we should wait a bit for a response from Justin.

Yep not working on it now, was JTK


Saved rasterisation .tif is seen as invalid by gdalinfo

When I save the result of a rasterisation into a .tif file I can't open this file in QGIS for comparison and gdalinfo reports th error below.
I would have expected, that I could open the file with QGIS to compare against the rasterisation of gdal_rasterize.The julia code which I ran is below and I attached an example file with which I run into this problem.
When I write the Raster which I got from opening the .tif file the resulting .tif file seems to be valid.
This is the gdalerror:
$ gdalinfo rastersaved_freqrastif.tif
ERROR 6: rastersaved_freqrastif.tif: Unsupported TIFF configuration: BitsPerSample(=64) and SampleType(=2)
gdalinfo failed - unable to open 'rastersaved_freqrastif.tif'.

using Rasters, Shapefile
julia> shp = Shapefile.Table("palsar_3paths_v4_save00_poly_paleovarzea_frequently_buffer_90.shp")
julia> freqras = Raster("gdal_rasterized_frequently.tif")
julia> rasnc = rasterize(shp, to=freqras[:,:,1], fill=1, name=Symbol("freqbin_rasterized_rasters_from_nc"))
julia> write("rastersaved_freqrastif.tif", rasnc)

failed_rasterisation_save.zip

Thanks, using the UInt8 filling works for me.


Double click by coordinates?

I can this in my spec:
page.driver.click(100,100)

Is there a way to do a double click by coordinates?

No - double click is only supported on an element


Fix compilation issue introduced due to merging two PRs at the same t…

…ime, where one PR added use of a method that was renamed in the other PR :(. One of the tests is also failing, so has been ignored temporarily and will be fixed in a separate jira shortly - just need to get the compilation problem resolved asap.

@pavolloffay Could you do a quick review on this one - unfortunately when I merged the two recent PRs, one was using a method renamed in the other, so now causes a compilation issue.

@objectiser LGTM :+1:

@pavolloffay Thanks!


Allow updating the pyenv global versions file

Hello,
When setting the value of the pyenv_global variable to a different value than contained in the "{{ pyenv_path }}/version" file, the global version file is not updated. This is probably because of the following condition : https://github.com/staticdev/ansible-role-pyenv/blob/main/tasks/install.yml#L91 which skips running the command when the file already exists (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html#parameter-creates)
We could remove that condition altogether, but this would always modify the file. We could also print & parse the globals as shown in this PR.
Let me know what you think!
(Also, thank you so much for maintaining this plugin!)

Hello,
When setting the value of the pyenv_global variable to a different value than contained in the "{{ pyenv_path }}/version" file, the global version file is not updated. This is probably because of the following condition : https://github.com/staticdev/ansible-role-pyenv/blob/main/tasks/install.yml#L91 which skips running the command when the file already exists (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html#parameter-creates)
We could remove that condition altogether, but this would always modify the file. We could also print & parse the globals as shown in this PR.
Let me know what you think!
(Also, thank you so much for maintaining this plugin!)

Thanks a lot for finding this and pointing this out! I will take a look into it very soon, meanwhile I saw some linting issues if you could check would be great.

Linting errors should be fixed now!


merge() doesn't refresh the cache

Maybe it's just me doing something wrong, but it seems like when changing some values in a document with cradle's merge() method the unchanged version remains in cradle's cache.
I take the following steps:

save() a doc
get() it and merge() some values
get() it again, but the values are still the old ones

when checking in CouchDB directly the values are altered, though.
Any tips?

nevermind, it was my fault.


Investigate how to integrate the Jupyter notebook tool

We want to use IHaskell/Jupyter notebook to visualize performance measurements and simulations
which implies that we also want to reuse code from our Haskell packages.
One way to do this is to integrate IHaskell into the iohk nix infrastructure.
The following IHaskell Projects are the starting point:

the default nixpkgs ihaskell package.
the new Tweag jupyterWith project (nix-based)
the nix-support from the IHaskell github repo
manual installation of the cabal package from Hackage and the jupyter Python package

A working prototype for the IOHK-nix integration is in #620 .

Neil and I found a working workflow for creating documentation with jupyter.
At the moment his work is independent from master and does not rely on ouroboros-network or
IOHK packages.
Integration with the IOHK packages works in principle but Cairo-diagrams support for haskell.nix is still pending.


ERROR WHEN INSTALLING WITH WINDOWS

I installed all the necessary dependencies to use with Windows and the same error continues to appear. I saw that several people reported the same error. Has anyone managed to solve it?
PS: I ALREADY INSTALLED THIS AND THERE WAS AN ERROR https://gnuwin32.sourceforge.net/packages/make.htm

You can now use it like this:
main.exe -m C:\Developer\Pruebas\whipser-test\node_modules\whisper-node\lib\whisper.cpp\models\ggml-base.en.bin -f C:\Developer\Pruebas\whipser-test\node_modules\whisper-node\lib\whisper.cpp\samples\jfk.wav
[whisper-node] Attempting to compile model...
"cc" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"head" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
I whisper.cpp build info:
I UNAME_S:
I UNAME_P:
I UNAME_M:
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -pthread
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -D_XOPEN_SOURCE=600 -pthread
I LDFLAGS:
I CC:
I CXX:
cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -pthread   -c ggml.c -o ggml.o
process_begin: CreateProcess(NULL, uname -s, ...) failed.
process_begin: CreateProcess(NULL, uname -p, ...) failed.
process_begin: CreateProcess(NULL, uname -m, ...) failed.
process_begin: CreateProcess(NULL, which nvcc, ...) failed.
process_begin: CreateProcess(NULL, cc -I. -O3 -DNDEBUG -std=c11 -fPIC -D_XOPEN_SOURCE=600 -pthread -c ggml.c -o ggml.o, ...) failed.
make (e=2): El sistema no puede encontrar el archivo especificado.
make: *** [ggml.o] Error 2

I'm having the same problem. Did you solve this problem

same

same here

Haha, @LucianoAPP you included the link in the PS.
PS: I got the same problem

I've installed make and no joy. From the makefile, I can see it markedas TODO: support for Windows.
there is an Issue on whisper.cpp
it states that the proposed solution is:
cd whisper.cpp
cmake -B build .
cmake --build build -j16 --config Release
cd build/bin
./main.exe
I have on my system cmake (via VS code) or https://cmake.org/download/
And it compiled
note that whisper.cpp folder is in node_modules>whisper-node>lib>whisper.cpp


Add Grafana plugin

Grafana Plugin Flowcharting
OpenSearch Data Source Plugin
What changed, and why it matters

Hi @cutinha! Thanks for the contribution! I believe this time @FloorD was faster :D https://github.com/aiven/devportal/pull/628

Done by @FloorD already but you did not see before because this was merged today.


JDG-1586 Lower scripts verbosity and unify logging variables

https://issues.jboss.org/browse/JDG-1586

@slaskawi LGTM and I like the use of DEBUG. The CI has failed because the 8.5.0.ER3-redhat-1 bom can't be found. This also happend with 8.5.0.ER2-redhat-2 before the ugprade to ER3. Any ideas?

It looks like name resolution didn't succeed:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.infinispan:infinispan-bom:pom:8.5.0.ER3-redhat-1 from/to mead-jdg7 (http://download.eng.bos.redhat.com/brewroot/repos/jb-dg-7-rhel-7-build/latest/maven/): download.eng.bos.redhat.com: Name or service not known @ line 32, column 22

Let me retrigger that. I wonder if this is a problem of one particular slave or whole cluster.

Ok, so this always happen. I'll look into it in a free slot.

So it looks like the name resolution started to work. If I see those errors next time, I'll hardcode our Brew's IP into /etc/hosts ;)

@slaskawi Thanks! We can add debug to CI in another PR


Upgrade to the released lit-element package

The @polymer/lit-element npm package has been moved to lit-element. @polymer/lit-element is deprecated and not receiving any updates, so please upgrade to<EMAIL_ADDRESS>as soon as possible.
Thanks!

We've added this to our backlog to take care of ASAP (nothing in production is using this old version of @polymer/lit-element thankfully -- just lit-html) -- thanks @justinfagnani!

Should be all set @justinfagnani! Closing this on out 👍🏼
PS. Loved your SFHTML meetup talk you just gave (watched it on YouTube)!


Fix uv4l configuration file construction

What is the issue here in the first place?

Hi @nistath I am trying to fix #5 and #6

@mbalamat I am fairly certain those are issues with UV4L, although I haven't had a chance to reproduce. The current code works fine w.r.t. editing the configuration file.

@nistath I've reproduced it, and I think this PR fixes it. I am actually stepping on your footsteps, so thanks for your contribution!

Merged based on @mbalamat request:

Good morning Robert! Would you mind checking the PR and merge it if everything is ok?


Add @using before @page shows 404

Is this by intention or is it a bug?
/cc @rynowak @NTaylorMullen

By design. @page must be at the top of the file.

Strange!! I remembered from ASP.NET WebPages before that we can @using before @inherits
Is there any reason why we can't use @using before?

Is there any reason why we can't use @using before?

We do a "quick" parse of each Razor file on disk by only looking at the first directive in order to determine routing information 😄. If the directive could be anywhere we'd have to parse more of the file significantly impacting startup perf.

But we can look for the lines that starts with the @ symbol instead to parse the entire file, IMHO this will not affect the performance too much and we're free to use @using before @page


Ignore empty link tags when pasting

Sorry I'm sleeping and I didn't see the file,
I think you mean this code
if (!isInTable && (this.features.isEnabled('editor-html-paste')||
         this.features.isEnabled('editor-extended-html-paste'))&&
         this.hasClipboardHtmlContent(clipboardData) ) {
      try {
        const inputParser = this.features.isEnabled('editor-extended-html-paste') ?
          new HTMLInputParser({}):
          new HTMLInputParser({safeTags: ['p', 'br', 'ol', 'ul', 'li', 'strong', 'u', 'em', 's', 'table', 'thead', 'tbody', 'th', 'tr', 'td']});

        const htmlPaste = clipboardData.getData('text/html');
        const cleanHTML = inputParser.cleanupHTML(htmlPaste);
        inserHtml(cleanHTML);
      }
      catch(e) {
        // fall back to text pasting
        console.warn(e); //eslint-disable-line no-console
        const text = this.getClipboardContentAsText(clipboardData);
        inserHtml(text);
      }
    }

    else {
      const text = this.getClipboardContentAsText(clipboardData);
      inserHtml(text);
    }

Right?

yes indeed, I hadnt considered different pasting profiles... ill try it out in GN

If I just copy hello to my clipboard and paste it, it gets inserted as a link cause it hits the else branch on line 187 of content-editable.js (which inserts the clipboard as text and doesnt clean it)

I guess this is a bug in general that we should address, in that we should make the text content html safe. This can be as simple as adding the content to a text node first and then reading out the textnode I think

so in GN this also doesnt work
steps:

go to about:blank (in chrome)
edit the body
insert hello
select element, copy outerHTML
paste in editor

still gets pasted as a link
maybe my steps are incorrect? if I literally copy the hello text it just inserts as text
Do we have some kind of example document? cause this is about word documents iirc

I have been doing this not sure what's the problem with your method to be honest, but I also tried the sample document from the jira issue and it worked

Well if the sample document works it should be fine
I can't see many situations where people would end up with  tags without hrefs anyway


Changes in WP 4.6

Hello :) Just wanted to ping you and inform a small is going to land on WP 4.6. Specifically, in the Add Plugin screen, the ".upload" button will behave a bit differently and will have a new CSS class. So if you want to still hide it completely you should use the new CSS class. upload-view-toggle

thanks! I'll get that updated for sure

a small is going

missed "change" :)


atom: fixes #28436 - atom git integration

Motivation for this change
Fixes #28436 using nix git package.
Things done

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

[x] NixOS
[ ] macOS
[ ] Linux

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

Thank you, I can confirm that it fixes my issue.


Z Open Editor does not activate when Zowe profiles settings are incorrect

I would first like to thank, in advance, anyone willing to help with this issue.
Environment

Z Open Editor version: v1.1.3

Visual Studio Code v1.52.1

Extensions

IBM DB2 for z/OS Developer Extension

Overtype

Zowe

Operating System - Windows 10 Enterprise

java version "1.8.0_271"

Java(TM) SE Runtime Environment (build 1.8.0_271-b09)

Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

Zowe CLI version: 6.25.0

Node.js version: v14.15.4

Problem Description
A few days most features stopped working (all were initially working)

References (Find All,  Peek, etc.)
Outline
Copybook lookup
Tab stops - If I use the tab key I get "command 'zopeneditor.tab' not found"

I tired IBM Z Open Editor: Pause the Assembler Language Server.   This produced the following response
Command 'IBM Z Open Editor: Pause the Assembler Language Server' resulted in an error (command 'zlang.stopHLASMLsp' not found)

I tired IBM Z Open Editor: Pause the Assembler Language Server.   This produced the following response
Command 'IBM Z Open Editor: Pause the Assembler Language Server' resulted in an error (command 'zlang.stopHLASMLsp' not found)

Remedies I have tried

disable and re-enable Z Open Editor
uninstall and re-install  Z Open Editor
uninstall and re-install VS Code

Remedies I have tried

disable and re-enable Z Open Editor
uninstall and re-install  Z Open Editor
uninstall and re-install VS Code

@ktenberg Thanks for filing this issue, we will take a look.

@ktenberg Thanks for filing this issue, we will take a look.

@ktenberg Thanks for filing this issue, we will take a look.

@ktenberg Thanks for filing this issue, we will take a look.

Thank you!
From: gplambert<EMAIL_ADDRESS>Sent: Monday, January 11, 2021 8:47 AM
To: IBM/zopeneditor-about<EMAIL_ADDRESS>Cc: Tenberg, Kerry<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: [EXTERNAL] Re: [IBM/zopeneditor-about] Most hlasm features have stopped working... (#110)
@ktenberghttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ktenberg&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=BnkVF9PvAvdudffBu4PjIQVUzOqjOcGzLjf5tn1TyE8&s=Fd-PF6ZSJd3M28P29f83lheJeuMltugg7S4PWZFIjpY&e= Thanks for filing this issue, we will take a look.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_IBM_zopeneditor-2Dabout_issues_110-23issuecomment-2D757997591&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=BnkVF9PvAvdudffBu4PjIQVUzOqjOcGzLjf5tn1TyE8&s=CqI1t_1fuQtQbETyW3qsvCSTfGmOuGZDuuegn5F-jBA&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ASFUP43X6WFY5QP2R36E7Z3SZMFN7ANCNFSM4V4FDVWQ&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=BnkVF9PvAvdudffBu4PjIQVUzOqjOcGzLjf5tn1TyE8&s=A4DkILSr3xanru0dIIsuCCxhqcUU6p9SMjo58XLZVVo&e=.

Thank you!
From: gplambert<EMAIL_ADDRESS>Sent: Monday, January 11, 2021 8:47 AM
To: IBM/zopeneditor-about<EMAIL_ADDRESS>Cc: Tenberg, Kerry<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: [EXTERNAL] Re: [IBM/zopeneditor-about] Most hlasm features have stopped working... (#110)
@ktenberghttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ktenberg&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=BnkVF9PvAvdudffBu4PjIQVUzOqjOcGzLjf5tn1TyE8&s=Fd-PF6ZSJd3M28P29f83lheJeuMltugg7S4PWZFIjpY&e= Thanks for filing this issue, we will take a look.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_IBM_zopeneditor-2Dabout_issues_110-23issuecomment-2D757997591&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=BnkVF9PvAvdudffBu4PjIQVUzOqjOcGzLjf5tn1TyE8&s=CqI1t_1fuQtQbETyW3qsvCSTfGmOuGZDuuegn5F-jBA&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ASFUP43X6WFY5QP2R36E7Z3SZMFN7ANCNFSM4V4FDVWQ&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=BnkVF9PvAvdudffBu4PjIQVUzOqjOcGzLjf5tn1TyE8&s=A4DkILSr3xanru0dIIsuCCxhqcUU6p9SMjo58XLZVVo&e=.

@ktenberg did you check the log files following these instructions? Could you attach it here? https://ibm.github.io/zopeneditor-about/Docs/locating_local_client_logs.html#finding-versions-of-all-vs-code-extensions-installed
It sounds like a problem with activation. This can already happen if Zowe Explorer does not activate, which can happen with invalid user settings unfortunately, which is a know issue we want to fix.

@ktenberg did you check the log files following these instructions? Could you attach it here? https://ibm.github.io/zopeneditor-about/Docs/locating_local_client_logs.html#finding-versions-of-all-vs-code-extensions-installed
It sounds like a problem with activation. This can already happen if Zowe Explorer does not activate, which can happen with invalid user settings unfortunately, which is a know issue we want to fix.

changed setting.json ->      "zopeneditor.logger": "DEBUG",
Terminal output
[2021-01-11 9:26:41.135 - DEBUG] ** Initialized IBM Z Open Editor logger on level "DEBUG". Welcome! **
[2021-01-11 9:26:41.137 - DEBUG] ** The log file is available at "c:\Users\ktenberg\AppData\Roaming\Code\logs\20210111T092634\exthost1\IBM.zopeneditor\zopeneditor-20210111-92641.log". **
[2021-01-11 9:26:41.139 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin is active. Will initialize Z Open Editor to utilize it. **
[2021-01-11 9:26:41.143 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin successfully activated for Z Open Editor. **
Do you want the log file contents?

changed setting.json ->      "zopeneditor.logger": "DEBUG",
Terminal output
[2021-01-11 9:26:41.135 - DEBUG] ** Initialized IBM Z Open Editor logger on level "DEBUG". Welcome! **
[2021-01-11 9:26:41.137 - DEBUG] ** The log file is available at "c:\Users\ktenberg\AppData\Roaming\Code\logs\20210111T092634\exthost1\IBM.zopeneditor\zopeneditor-20210111-92641.log". **
[2021-01-11 9:26:41.139 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin is active. Will initialize Z Open Editor to utilize it. **
[2021-01-11 9:26:41.143 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin successfully activated for Z Open Editor. **
Do you want the log file contents?

@ktenberg is this all the information that is in the file? If no, then it would be good to see the entire thing to trace along.

@ktenberg is this all the information that is in the file? If no, then it would be good to see the entire thing to trace along.

Hi Peter,
The entire log is attached…
I did notice the following therein…
[2021-01-11 09:26:41.382] [exthost] [error] Activating extension IBM.zopeneditor failed due to an error:
[2021-01-11 09:26:41.382] [exthost] [error] Error: Your default profile named db2a does not exist for type zosmf.
To change your default profile, run "undefined profiles set-default zosmf ".
at d. (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:166389)
at Generator.next ()
at c:\Users
I have the following in my settings.json…
"zopeneditor.zowe": {"defaultCliProfile": "db2b"},       I have tried upper case for the profile name because of the result below
When I issue the zowe command zowe profiles list zosmf-profiles..
C:\dev\ccm\wa\adu\1122\adu\code\asm>zowe profiles list zosmf-profiles
DB2B
C:\dev\ccm\wa\adu\1122\adu\code\asm>
From: Peter Haumer<EMAIL_ADDRESS>Sent: Monday, January 11, 2021 10:04 AM
To: IBM/zopeneditor-about<EMAIL_ADDRESS>Cc: Tenberg, Kerry<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: [EXTERNAL] Re: [IBM/zopeneditor-about] Most hlasm features have stopped working... (#110)
@ktenberghttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ktenberg&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=GZH0aH-ev6roN303wYFdSFOZi2eE8u4JaPPa16217xM&s=F74VPyo3d3ePVLK1rAY844qHzeFjkT0sxXUWCJpUCx8&e= is this all the information that is in the file? If no, then it would be good to see the entire thing to trace along.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_IBM_zopeneditor-2Dabout_issues_110-23issuecomment-2D758048760&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=GZH0aH-ev6roN303wYFdSFOZi2eE8u4JaPPa16217xM&s=DrKmKgApEOSdO_hPbF1T-hhk_BcvU9dBbX707r-oRSo&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ASFUP4YK4TXJZFV5ISYAUPLSZMOOTANCNFSM4V4FDVWQ&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=GZH0aH-ev6roN303wYFdSFOZi2eE8u4JaPPa16217xM&s=taHcPHj6CFWZujLW6ZNmlYMVqEyEkawFt00H6xwJSMM&e=.

Hi Peter,
The entire log is attached…
I did notice the following therein…
[2021-01-11 09:26:41.382] [exthost] [error] Activating extension IBM.zopeneditor failed due to an error:
[2021-01-11 09:26:41.382] [exthost] [error] Error: Your default profile named db2a does not exist for type zosmf.
To change your default profile, run "undefined profiles set-default zosmf ".
at d. (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:166389)
at Generator.next ()
at c:\Users
I have the following in my settings.json…
"zopeneditor.zowe": {"defaultCliProfile": "db2b"},       I have tried upper case for the profile name because of the result below
When I issue the zowe command zowe profiles list zosmf-profiles..
C:\dev\ccm\wa\adu\1122\adu\code\asm>zowe profiles list zosmf-profiles
DB2B
C:\dev\ccm\wa\adu\1122\adu\code\asm>
From: Peter Haumer<EMAIL_ADDRESS>Sent: Monday, January 11, 2021 10:04 AM
To: IBM/zopeneditor-about<EMAIL_ADDRESS>Cc: Tenberg, Kerry<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: [EXTERNAL] Re: [IBM/zopeneditor-about] Most hlasm features have stopped working... (#110)
@ktenberghttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ktenberg&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=GZH0aH-ev6roN303wYFdSFOZi2eE8u4JaPPa16217xM&s=F74VPyo3d3ePVLK1rAY844qHzeFjkT0sxXUWCJpUCx8&e= is this all the information that is in the file? If no, then it would be good to see the entire thing to trace along.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_IBM_zopeneditor-2Dabout_issues_110-23issuecomment-2D758048760&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=GZH0aH-ev6roN303wYFdSFOZi2eE8u4JaPPa16217xM&s=DrKmKgApEOSdO_hPbF1T-hhk_BcvU9dBbX707r-oRSo&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ASFUP4YK4TXJZFV5ISYAUPLSZMOOTANCNFSM4V4FDVWQ&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=GZH0aH-ev6roN303wYFdSFOZi2eE8u4JaPPa16217xM&s=taHcPHj6CFWZujLW6ZNmlYMVqEyEkawFt00H6xwJSMM&e=.

Not sure how to attach a file.

To change your default profile, run "undefined profiles set-default zosmf ".
at d. (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:166389)
at Generator.next ()
at c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:160674
at new Promise ()
at r (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:160419)
at d.load (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:165426)
at d. (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:77:268138)
at Generator.next ()
at o (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:77:266312)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
[2021-01-11 09:57:30.471] [exthost] [info] eager extensions activated

Not sure how to attach a file.

To change your default profile, run "undefined profiles set-default zosmf ".
at d. (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:166389)
at Generator.next ()
at c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:160674
at new Promise ()
at r (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:160419)
at d.load (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:211:165426)
at d. (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:77:268138)
at Generator.next ()
at o (c:\Users\ktenberg.vscode\extensions\ibm.zopeneditor-1.1.3\dist\extension.js:77:266312)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
[2021-01-11 09:57:30.471] [exthost] [info] eager extensions activated

Thanks. Although this is from a different log file (extension host not Z Open Editor) it gives us the information we need. You need to fix your Zowe CLI profiles. You definitely need to be consistent with the cases. They are located in ~/.zowe/profiles/zosmf.
I will keep this issue open for us to investigate why activation fails because of this setting. That should not happen.

Thanks. Although this is from a different log file (extension host not Z Open Editor) it gives us the information we need. You need to fix your Zowe CLI profiles. You definitely need to be consistent with the cases. They are located in ~/.zowe/profiles/zosmf.
I will keep this issue open for us to investigate why activation fails because of this setting. That should not happen.

Okay.. so what do I have to do to fix my Zowe CLI profiles?
From: Peter Haumer<EMAIL_ADDRESS>Sent: Monday, January 11, 2021 10:49 AM
To: IBM/zopeneditor-about<EMAIL_ADDRESS>Cc: Tenberg, Kerry<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: [EXTERNAL] Re: [IBM/zopeneditor-about] Most hlasm features have stopped working... (#110)
Thanks. Although this is from a different log file (extension host not Z Open Editor) it gives us the information we need. You need to fix your Zowe CLI profiles. You definitely need to be consistent with the cases. They are located in ~/.zowe/profiles/zosmf.
I will keep this issue open for us to investigate why activation fails because of this setting. That should not happen.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_IBM_zopeneditor-2Dabout_issues_110-23issuecomment-2D758079963&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=xX-aQVYfnXcLHrKz_LK43y-P78x35QIvmCvm3TrZBOY&s=-2PBjc0YcMrRNPiZ7enIzLmzO3S4457R3fGiDYRqkEc&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ASFUP47ULV2QVDBNPCF64ELSZMTWTANCNFSM4V4FDVWQ&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=xX-aQVYfnXcLHrKz_LK43y-P78x35QIvmCvm3TrZBOY&s=49fr9bVI2mqLhSMQ4y2-r3oKKk5GE6bqvWu7g-rerCw&e=.

Okay.. so what do I have to do to fix my Zowe CLI profiles?
From: Peter Haumer<EMAIL_ADDRESS>Sent: Monday, January 11, 2021 10:49 AM
To: IBM/zopeneditor-about<EMAIL_ADDRESS>Cc: Tenberg, Kerry<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: [EXTERNAL] Re: [IBM/zopeneditor-about] Most hlasm features have stopped working... (#110)
Thanks. Although this is from a different log file (extension host not Z Open Editor) it gives us the information we need. You need to fix your Zowe CLI profiles. You definitely need to be consistent with the cases. They are located in ~/.zowe/profiles/zosmf.
I will keep this issue open for us to investigate why activation fails because of this setting. That should not happen.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_IBM_zopeneditor-2Dabout_issues_110-23issuecomment-2D758079963&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=xX-aQVYfnXcLHrKz_LK43y-P78x35QIvmCvm3TrZBOY&s=-2PBjc0YcMrRNPiZ7enIzLmzO3S4457R3fGiDYRqkEc&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ASFUP47ULV2QVDBNPCF64ELSZMTWTANCNFSM4V4FDVWQ&d=DwMCaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=r3Uu7WF6sIwDw8pSTkkw7g&m=xX-aQVYfnXcLHrKz_LK43y-P78x35QIvmCvm3TrZBOY&s=49fr9bVI2mqLhSMQ4y2-r3oKKk5GE6bqvWu7g-rerCw&e=.

You need to look at your user setting "zopeneditor.zowe": {"defaultCliProfile": "db2b"}, and check that the profile is a valid profile name in the right casing. Also I see in the error message db2a and you show this example with db2b.  If you only have one profile anyway then you can even remove this setting. It is meant for the use that that you do not want to use your default profile, i.e. the default used by Zowe CLI.

You need to look at your user setting "zopeneditor.zowe": {"defaultCliProfile": "db2b"}, and check that the profile is a valid profile name in the right casing. Also I see in the error message db2a and you show this example with db2b.  If you only have one profile anyway then you can even remove this setting. It is meant for the use that that you do not want to use your default profile, i.e. the default used by Zowe CLI.

I got the extension to work by creating a new Zowe CLI profile
changed settings.json --->  "zopeneditor.zowe": {"defaultCliProfile": "db2a"},
DDEBUG logger output is complete now...   Thanks Peter !!
[2021-01-11 12:15:42.602 - DEBUG] ** Initialized IBM Z Open Editor logger on level "DEBUG". Welcome! **
[2021-01-11 12:15:42.604 - DEBUG] ** The log file is available at "c:\Users\ktenberg\AppData\Roaming\Code\logs\20210111T121535\exthost1\IBM.zopeneditor\zopeneditor-20210111-121542.log". **
[2021-01-11 12:15:42.606 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin is active. Will initialize Z Open Editor to utilize it. **
[2021-01-11 12:15:42.610 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin successfully activated for Z Open Editor. **
[2021-01-11 12:15:43.556 - INFO] ** Zowe Explorer was modified for IBM Remote System Explorer API (RSE API) support by IBM Z Open Editor. **
[2021-01-11 12:15:44.99 - DEBUG] ** JavaFinder: Used the "zopeneditor.JAVA_HOME" user setting to locate Java. **
[2021-01-11 12:15:44.108 - DEBUG] ** Z Open Editor environment summary:

Z Open Editor version: 1.1.3
Editor platform: Visual Studio Code
Editor platform version: 1.52.1
Required minimal editor platform version: ^1.44.0
Editor installation root directory: c:\Users\ktenberg\AppData\Local\Microsoft\Microsoft VS Code\resources\app
Editor installation id: 60c996423c869f575fa4dd8886b167f8e6525788fbf5d7c1ffba8b0a0d0ed9ce
Is a valid Java configured: true

Java: C:/Program Files/Java/jre1.8.0_271\bin\java.exe
Java memory allocation: 512

Key user settings:

Unreachable Code enabled: true
ZAPP files enabled: true
ZAPP schema used: file:///c%3A/Users/ktenberg/.vscode/extensions/ibm.zopeneditor-1.1.3/resources/zapp-schema-0.0.1.json
IBM User Build enabled: true
Zowe CLI Secure Credentials enabled: true
Zowe CLI files profile user setting: db2a
Zowe CLI files profile used: db2a
Zowe CLI SSH profile user setting: Not defined.
Zowe CLI SSH profile used: No profile found.
Zowe Temp-Dir value: Not defined.
COBOL Property Groups defined:
COBOL include file extensions: .cpy,.copybook,.copy,.cobcopy
PL/I Property Groups defined:
PL/I include file extensions: .inc,.include,.plinc,.pcx,.pci
HLASM Property Groups defined: local-macros
HLASM include file extensions: .s,.assemble,.asm,.hlasm,.hla,.mac
VS Code Files Assocications: .COBOL:cobol,.COB:cobol,.COBCOPY:cobol,.COPYBOOK:cobol,.COPY:cobol,.PL1:pl1,.PLI:pl1,.INC:pl1,.INCLUDE:pl1,.JCL:jcl,.ASM:hlasm,.ASSEMBLE:hlasm,.HLASM:hlasm,.HLA:hlasm,.MAC:hlasm,*.mac:hlasm

Zowe Explorer VS Code Extension version: 1.11.1

Successfully activated: true
Installation path: c:\Users\ktenberg.vscode\extensions\zowe.vscode-extension-for-zowe-1.11.1

I got the extension to work by creating a new Zowe CLI profile
changed settings.json --->  "zopeneditor.zowe": {"defaultCliProfile": "db2a"},
DDEBUG logger output is complete now...   Thanks Peter !!
[2021-01-11 12:15:42.602 - DEBUG] ** Initialized IBM Z Open Editor logger on level "DEBUG". Welcome! **
[2021-01-11 12:15:42.604 - DEBUG] ** The log file is available at "c:\Users\ktenberg\AppData\Roaming\Code\logs\20210111T121535\exthost1\IBM.zopeneditor\zopeneditor-20210111-121542.log". **
[2021-01-11 12:15:42.606 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin is active. Will initialize Z Open Editor to utilize it. **
[2021-01-11 12:15:42.610 - DEBUG] ** Z Open Editor Activation: Zowe CLI Secure Credentials Plugin successfully activated for Z Open Editor. **
[2021-01-11 12:15:43.556 - INFO] ** Zowe Explorer was modified for IBM Remote System Explorer API (RSE API) support by IBM Z Open Editor. **
[2021-01-11 12:15:44.99 - DEBUG] ** JavaFinder: Used the "zopeneditor.JAVA_HOME" user setting to locate Java. **
[2021-01-11 12:15:44.108 - DEBUG] ** Z Open Editor environment summary:

Z Open Editor version: 1.1.3
Editor platform: Visual Studio Code
Editor platform version: 1.52.1
Required minimal editor platform version: ^1.44.0
Editor installation root directory: c:\Users\ktenberg\AppData\Local\Microsoft\Microsoft VS Code\resources\app
Editor installation id: 60c996423c869f575fa4dd8886b167f8e6525788fbf5d7c1ffba8b0a0d0ed9ce
Is a valid Java configured: true

Java: C:/Program Files/Java/jre1.8.0_271\bin\java.exe
Java memory allocation: 512

Key user settings:

Unreachable Code enabled: true
ZAPP files enabled: true
ZAPP schema used: file:///c%3A/Users/ktenberg/.vscode/extensions/ibm.zopeneditor-1.1.3/resources/zapp-schema-0.0.1.json
IBM User Build enabled: true
Zowe CLI Secure Credentials enabled: true
Zowe CLI files profile user setting: db2a
Zowe CLI files profile used: db2a
Zowe CLI SSH profile user setting: Not defined.
Zowe CLI SSH profile used: No profile found.
Zowe Temp-Dir value: Not defined.
COBOL Property Groups defined:
COBOL include file extensions: .cpy,.copybook,.copy,.cobcopy
PL/I Property Groups defined:
PL/I include file extensions: .inc,.include,.plinc,.pcx,.pci
HLASM Property Groups defined: local-macros
HLASM include file extensions: .s,.assemble,.asm,.hlasm,.hla,.mac
VS Code Files Assocications: .COBOL:cobol,.COB:cobol,.COBCOPY:cobol,.COPYBOOK:cobol,.COPY:cobol,.PL1:pl1,.PLI:pl1,.INC:pl1,.INCLUDE:pl1,.JCL:jcl,.ASM:hlasm,.ASSEMBLE:hlasm,.HLASM:hlasm,.HLA:hlasm,.MAC:hlasm,*.mac:hlasm

Zowe Explorer VS Code Extension version: 1.11.1

Successfully activated: true
Installation path: c:\Users\ktenberg.vscode\extensions\zowe.vscode-extension-for-zowe-1.11.1

@ktenberg great new. We will be working on making this more robust in the future and leave this item open as a reminder.

@ktenberg great new. We will be working on making this more robust in the future and leave this item open as a reminder.

@ktenberg fixed in v1.2.0. Let us know if you still have issues or suggestions.


net: TestInterfaces fails on freebsd-arm

TestInterfaces fails on freebsd-arm:
--- FAIL: TestInterfaces (0.00s)
	interface_test.go:74: route ip+net: invalid network interface name
FAIL
FAIL	net	4.727s

/cc @mikioh

This is a duplicate of #7849.


Add random jitter before taking action

To help prevent thundering herd scenarios, allow waiting a random number between 0 and X (or between X and Y) of seconds before generating/reloading a file.

@therc you mean -i/--interval?

-i is the polling interval. You can use that to approximate random jitter for the single file case. But if you have multiple files getting generated with different jitter ranges or want to use a watch, -i is not going to work.

But if you have multiple files getting generated with different jitter ranges or want to use a watch

Confd doesn't work on config-per-file. In that case we have suggested previously that if people want different jitter ranges for different files that they should use a separate confd process with different config set up. That would be the simplest solution out of band without convoluting the codebase.

Ah I see what you mean. You mean by the fact that each template resource being processed = a call to the backend, meaning that number of connections to the backend increases based on the number of templates you have. We could probably optimize this instead by grabbing all gets from the store at once and injecting them into the templates at once before processing, preventing the thundering herd problem.
Would that work for you?

That's one of the scenarios, yes, but the first I thought of was:
Put a watch on K
Get woken up, process template
Restart/Signal daemon D
D acts on the new configuration, which makes it fetch something from another service, S
S gets hammered by a hundred instances of D
???
No profit!
Actually, even with -i, if we assume that on something like Kubernetes all pods will initially get scheduled with good probability during the same few seconds, it might make sense to wait for a random interval before polling for the first time.

Multiple confd instances is not ideal, but I guess I could live with it in some cases. The fact that they're not coordinated is an asset for multiple jitter ranges, but it's also a liability when it comes to predicting behaviour, especially the worst case. Oh well. :-)

This would be very helpful for a group of nodes that all watch the same keys and are restarted when the template updates. For example, a cluster of web servers using config files generated by confd. All the instances of confd watch the same keys, so when it's updated all servers are restarted around the same time. A jitter or delay option in the template resource would be helpful to spread the downtime across these nodes. It'd be interesting if it chose a delay within an interval (ex: [1,5]) between that before triggering the reload_cmd.
I guess an alternative would be to implement that functionality in the reload_cmd itself.

I think it'd be better to implement that in the reload command. Users want immediate updates when keys in etcd change, such as an nginx reload. Technically if your process listens to SIGHUP and does a proper reload rather than a restart then this wouldn't be an issue.

Yeah, immediate updates would still happen without that set. That's true, but in some cases not all changes can made with just a reload. Anyway, I agree that it can be pushed down to reload_cmd.


Bad Request returned from API when editing a path published by software.

Which version are you using?
v0.23.7
Which operating system are you using?

[ ] Linux amd64 standard
[ ] Linux amd64 Docker
[x] Linux arm64 standard
[x] Linux arm64 Docker
[ ] Linux arm7 standard
[ ] Linux arm7 Docker
[ ] Linux arm6 standard
[ ] Linux arm6 Docker
[ ] Windows amd64 standard
[ ] Windows amd64 Docker (WSL backend)
[ ] macOS amd64 standard
[ ] macOS amd64 Docker
[ ] Other (please describe)

Describe the issue
API returns a 400 Bad Request when attempting to edit a path that was added by software, e.g. Gstreamer. The issue does not appear to exist when editing a path that was added via the API or manually entered into the config file.
Describe how to replicate the issue

Start the server
Publish with a Gstreamer command: gst-launch-1.0 videotestsrc ! x264enc ! rtspclientsink location=rtsp://{API_ADDRESS}:{RTSP_PORT}/test
From a terminal, use curl edit the path's config: curl -X POST http://{API_ADDRESS}:{API_PORT}/v2/config/paths/edit/test -H 'Content-Type: application/json' -d '{"runOnInitRestart": true}'
MediaMTX return's 400 Bad Request

Did you attach the server logs?
yes
mediamtx_v0.23.7_issue2067.log
Did you attach a network dump?
no

Hello, publishing to a path doesn't cause a path configuration to be created, on the contrary, publishing to a path is only possible if a path configuration already exists. The default configuration is something like that:
paths:
  all:

The path configuration called "all" catches all paths. If you want to create and control a configuration for a certain path, add it through the configuration file or through the API:
paths:
  test:

Hello, publishing to a path doesn't cause a path configuration to be created, on the contrary, publishing to a path is only possible if a path configuration already exists. The default configuration is something like that:
paths:
  all:

The path configuration called "all" catches all paths. If you want to create and control a configuration for a certain path, add it through the configuration file or through the API:
paths:
  test:

Understood, thank you for your time!


Usage of single quotes within square brackets needs clarification

JSON code
"key1"     : "keyA",
"testdict" : {"keyA" : "A", "keyB" : "B"},

(1)
Access to elements with hard coded key name (encapsulated in single quotes) and key name as parameter (without single quotes) on the right hand side of the colon:
"tmp1" : ${testdict}['keyA'],
"tmp2" : ${testdict}[${key1}],

Outcome: tmp1 and tmp2 with value "A". OK, so far.
(2)
With single quotes around parameter:
"tmp3" : ${testdict}['${key1}']
Result:
Error: 'The variable '${testdict}['${key1}']' is not available!'!
Hmm. I can live with that. But nevertheless, my feeling is that this should not be an error. Why not a little bit more robust?
We speak about a dictionary key. This is expected to be of type string. The single quotes inside the square brackets indicate that the content shall be interpreted as string. The parameter key1, used as dictionary key, is already of type string. So what is the problem here? All things are completely fine already. The single quotes are irrelevant in this case and really should not harm the computation. And telling that the entire expression (variable) '${testdict}['${key1}']' does not exist, is in my opinion also not helpful - or not precise enough. Because this error message does not really tell, what exactly the problem is.
(3)
The same on the left hand side of the colon. Here it is completely other way round.
Without quotes => error
 ${testdict}[${key1}] : "C"
Error: 'Could not set variable 'testdict[keyA]' with value 'C'! Reason: name 'keyA' is not defined'!
With quotes => success
${testdict}['${key1}'] : "D"
Why are the single quotes a problem on the right hand side of the colon and required at the left hand side of the colon?
This overall is so much confusing and I really have problems to explain that in the documentation. I urgently ask to rework the syntax.

Hi Son,
(1) is as expected.
(2) should have the result of (1). Reason: If we set double quotes around the $-expression, then we convert the value to string.
(3) behaviour of (1) and corrected (2) expected.
Thank you,
Thomas

Hello Holger, Hello Thomas,
I pushed new commit b4fc78df46d to stabi branch to fix the issue mentioned in this ticket.
Thank you,
Son

Hi Son,
val03 and val09 do not work:
"intparam"    : 0,
"stringparam" : "A",
"listparam"   : ["A", "B"],
"dictparam"   : {"0" : 0, "A" : 1, "B" : 2},
//
"val01" : ${listparam}[${intparam}],
"val02" : ${listparam}[1],
// "val03" : ${dictparam}['${intparam}'], // Error: 'The variable '${dictparam}['${intparam}']' is not available!'!
"val04" : ${dictparam}[${stringparam}],
"val05" : ${dictparam}['${stringparam}'],
"val06" : ${dictparam}['A'],
//
"val07" : "${listparam}[${intparam}]",
"val08" : "${listparam}[1]",
// "val09" : "${dictparam}['${intparam}']", // Error: 'The variable '${dictparam}['${intparam}']' is not available!'!
"val10" : "${dictparam}[${stringparam}]",
"val11" : "${dictparam}['${stringparam}']",
"val12" : "${dictparam}['A']"

Hello Holger,
I pushed the commit 572c5f91dce65 to the stabi branch to fix the issue related to val03 and val09 as you mentioned above.
Thank you,
Son

Hello Holger,
I pushed new commit 64ca06a73e to the stabi branch to fix the issue in test cases JPP_0513
Thank you,
Son

Retest successful. Issue can be closed.

solved with version 0.10.0


error thrown in put when precising the parameters' names

Describe the bug
I have an error when using the put function if I precise what parameter is which in the function.
Steps/Code to Reproduce
Supposing that we already have a project created:
from skore import load
project = load("project.skore")
test = 3
project.put(key="test", value=test)

On main branch on Oct18th.
Expected Behavior
I'd expect the same thing as project.put("test", test) to happen.
Actual Behavior
an error is thrown.
Environment
System:
    python: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]
executable: /home/marie/anaconda3/envs/skore_test/bin/python
   machine: Linux-6.8.0-45-generic-x86_64-with-glibc2.35

Python dependencies:
        skore: 0.0.0+unknown
          pip: 24.2
   setuptools: 75.1.0
 altair<6,>=5: None
    diskcache: 5.6.3
      fastapi: 0.115.0
         rich: 13.9.2
        skops: 0.10.0
      uvicorn: 0.31.0

additionnal test: strangely project.put("test", value=test) is ok...

project.put(toto="test", value=test) produces the same error

IndexError                                Traceback (most recent call last)
Cell In[6], line 1
----> 1 p.put(key="test2", value=test)

File /opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/functools.py:945, in singledispatchmethod.__get__.<locals>._method(*args, **kwargs)
    944 def _method(*args, **kwargs):
--> 945     method = self.dispatcher.dispatch(args[0].__class__)
    946     return method.__get__(obj, cls)(*args, **kwargs)

IndexError: tuple index out of range

The problem comes from the fact that put_several changes the function signature.

Suggestion:
def put(self, key, value=None, on_error="warn"):
    if isinstance(key, dict):
        return self.put_several(key, on_error=on_error)
    else:
        return self.put_one(key, value, on_error=on_error)


Not populating set of pojo

I have a pojo named Transaction which contains Set of another pojo Accounts
public class TransactionDTO{
      private Set<Accounts> accList;
      public void setAccList(Set<Accounts> accList){
           this.accList=accList;
      }
      public Set<Accounts> getAccList(){
           return accList;
      }
      .......
}

public class Account{
     private String acNo;
      .......
}

I am trying to populate TransactionDTO with Jpopulator.
It populates all values properly except Set values.

Hi,
Thanks for pointing out this issue.
Populating collections is not supported in the current version, see here:
https://github.com/benas/jPopulator/wiki/Supported-types#arrays-and-collection-types
This is planned for the next release. Any contribution is welcome :-)
keep tuned.
Regards,
Mahmoud

How do you plan to deal with type erasure and inheritance? jPopulator doesn't know which kind of object the Set contains, nor does it know which implementation of Set to chose. The latter could be solved by using a default implementation for each interface (List --> ArrayList, Map --> HashMap and so on). But type erasure is a real problem, making things ugly.

Hi Stephan,
Here are my answers to your questions, using the same example given by @rishirane above:

Which collection implementation to choose?

If the field type is an interface (private Set<Account> accounts), then as you said, the "default" implementation will be used, this is how I planned to implement it.
If the field is declared with a class type (private HashSet<Account> accounts), then of course, this type will be used (yes, there still people doing that, and jPopulator should expect it).

How to infer the actual type when the field is a generic collection type?
This is actually possible with reflection through the ParametrizedType class.
This class allows to get the actual type of a generic collections at runtime.
I have implemented a show case of how to use this class here, with some comments that I hope are clear.
In regards to how jPopulator should behave in this case:

If the field is a non-typed collection (private Set accounts), then jPopulator cannot know which type of objects to generate. Hence, it will generate an empty collection (as it does now).
If the field is a typed collection (private set<Account> accounts), then jPopulator can detect the actual type of the collection elements and will then generate instances of this type and fill the collection.
This is what is planned to implement this feature.

I hope I've answered your questions :-)
Cheers
Mahmoud

Hi Mahmoud;
Thanks for your reply. I did figured this approach and implemented it.
Hope you will add this feature soon.
Cheers

Hi rishirane,
I'm glad that my reply was helpful :-)
I'll close the issue as soon as it is implemented.
Best regards,
Mahmoud

Hi Mahmoud,
that's awesome! You found a way to beat type erasure. What a pity I didn't learn about it years ago, when I needed it...
Here's some background information why the approach works: http://stackoverflow.com/questions/923624/java-type-erasure-vs-fieldgetgenerictype-and-methodgetgenericreturntype
A la prochaine
Stephan

Hi Stephan,
Cool! Thank you for the link. In fact it is a bit tricky :-)
I'm currently implementing this feature in version 1.2.0-SNAPSHOT. I'll keep you informed once the snapshot version is deployed to maven central repo to be able to test it.
Cheers
Mahmoud

Hi @rishirane ,
Just a quick note, you can still populate the Set<Account> field using the SetRandomizer. This randomizer generates a random Set of elements that are generated using another randomizer: a delegate. Here is how to achieve this in your case:
Randomizer<Account> accountRandomizer = new Randomizer<Account>() {

 private Populator p = new PopulatorBuilder().build();

    @Override
    public Account getRandomValue() {
       return p.populateBean(Account.class);
     }

};

Populator populator = new PopulatorBuilder()
       .registerRandomizer(TransactionDTO.class, Set.class, "accList", new SetRandomizer<Account>(accountRandomizer))
       .build();

TransactionDTO transactionDTO = populator.populateBean(TransactionDTO.class);

You should now have your accounts set populated with random instances of the Account class.
So it still possible with the current version but you should use a custom randomizer. You can also use a anonymous implementation directly when registering the randomizer instead of creating a separate class.
In the meanwhile, I continue implementing the feature in the next version. I'll keep you informed as soon as it is deployed in maven central repo.
Regards,
Mahmoud

Hi Mahmoud
This is exactly I implemented on my project.
I have worked out a generic solution to this by checking Class Type and Generic Type to create List or Set. and sending sizes for each property in map.(ColoumnName and Size).
Good to hear, you are adding this feature in next version. That way we can use Jpopulator as it is.
Thanks.
Hrishikesh Rane

Hi Stephan, Hrishikesh,
After several tests, it turns out that it is just impossible to create instances of the parametrized type of a collection even though we are able to introspect its class at runtime, due to type erasure as Stephan said. Here is why:
The java.lang.reflect.ParameterizedType allows one to know at runtime the parametrized type of a field, as I showed in this test case. But actually, at the end of introspection, we get the type of the object as java.lang.reflect.Type and not the actual type of the object. Let's quickly analyse the example:
public class SocialPerson extends Person {
    private Set<Person> friends;
}

When jPopulator tries to populate the friends fields, it is able to know that it should generate instances of the Person class, but using the previous technique, it gets the following:
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments(); // parameterizedType = java.util.Set<io.github.benas.jpopulator.beans.Person>

// Get the actual type
Type actualTypeArgument = actualTypeArguments[0];// actualTypeArgument = Person.class

Ok good, at this point, we know that actualTypeArgument represents a Person.class, but its type is
java.lang.reflect.Type and not Person.class, so when jPopulator calls Class.newInstance(); on a java.lang.reflect.Type, It gets a:
java.lang.IllegalAccessException: Can not call newInstance() on the Class for java.lang.Class
Do you see the trick? Even though we are able to know the type of objects to generate, it is unfortunately impossible to do it at runtime..
In sum, populating a parametrized collection will still require the use of a custom populator (as shown in the previous comment with accountRandomizer, using the same "workaround" that Hrishikesh is using currently).
I'm looking forward for your feedback.
Cheers
Mahmoud

Quel dommage! Your approach looked so promising! Can you get the qualified type name as a String and create the object via Class.forName().newInstance()?
Regards,
Stephan

Hello,
Already tried with Class.forName() but it throws the same exception.. arrrgh :rage: !

Hi Mahmoud,
I've tried your approach with Java 8 today, and it doesn't look bad. Since Java 8 Type contains a getType method, which maps to toString() by default. Using this method, I managed to build a  TrafficLightFactory producing a traffic light in a very abstract way:
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class TrafficLightFactory{
    public static void main(String[] args) throws ReflectiveOperationException {
        TrafficLight trafficLight = new TrafficLight();

        Field contentField = TrafficLight.class.getDeclaredField("lights");
        ParameterizedType arrayType = (ParameterizedType) contentField.getGenericType();

        String arrayClassName = arrayType.getRawType().getTypeName();
        Class arrayClass = Class.forName(arrayClassName);
        Object array = arrayClass.newInstance();
        contentField.set(trafficLight, array);

        Type[] contentTypes = arrayType.getActualTypeArguments();
        Type stringType = contentTypes[0];

        Class contentClass = Class.forName(stringType.getTypeName());
        Object arrayElement= contentClass.newInstance();

        ((List)array).add(arrayElement);

        System.out.println(arrayElement.toString());
    }

}

class TrafficLight {
    public ArrayList<Color> lights;

    @Override
    public String toString() {
        String visibleColors="";
        for (Color l: lights) {
            visibleColors+=l.toString() + "\r\n";
        }
        return visibleColors;
    }
}

class Color {
    String theColor;

    public Color() {
        theColor = "red";
    }

    public String toString() {
        return "The traffic light shows " + theColor+".";
    }
}

Now our abstract traffic light is red (like every semaphore that doesn't think too lowly of itself :) ).
Does this help you?

Hi Stephan,
This is great! Your suggestion to use Class.forName() definitely helped me out.
I've tried Class.forName(actualTypeArgument.getClass().getName()) but this led to the same exception as I said in my previous comment.
I finally managed to get the class name based on the toString() method of the actual type pretty much like you do in your traffic light example, and it works! I have implemented this feature in a separate branch named collection-population. You can see here that I can get the class name of the actual type and load it via Class.forName() as you suggested.
To test this feature, I used the following class:
public class SocialPerson extends Person {

    private Set<Person> friends;

    private List<String> pseudos;

    private Map<String, String> accounts;
}

and the test is passing, all fields are populated with random values :-)
This means that we finally found a way to beat type erasure :wink:
The feature is almost done, I just wanna make sure all cases are taken into account and then I'll merge it in the master branch and do the release.
Many thanks to you for being involved to help out!
Best regards
Mahmoud

Bonsoir Mahmoud,
always glad to help! BTW, the whole type erasure topic sounds like a good article for BeyondJava.net. As far as I remember, you've got your own blog. But still, I'd like to invite you to write a guest article about type erasure and/or jPopulator. How do you like the idea?
Regards,
Stephan

Sure! It would be great to share our little "adventure" with generics and type erasure on this use case with the community.
If you have an idea about the post content, do not hesitate to send me your thoughts by mail so we can discuss together.
I'm looking forward to collaborate with you :-)

Hi @rishirane
It took a while but populating collections is finally merged in the master branch and will be part of the next release. This feature has been added thanks to a great pull request by @feckertson , thank you Fred!
We've a test case for each interface and class of the Java collection framework:

Arrays: https://github.com/benas/random-beans/blob/master/random-beans/src/test/java/io/github/benas/randombeans/ArrayPopulationTest.java

Collections: https://github.com/benas/random-beans/blob/master/random-beans/src/test/java/io/github/benas/randombeans/CollectionPopulationTest.java

Maps: https://github.com/benas/random-beans/blob/master/random-beans/src/test/java/io/github/benas/randombeans/MapPopulationTest.java

Random Beans is now able to generate populated collections instead of empty ones.
May I ask you please to give it a try and keep me informed in case of any issue? You can use the current 2.0.0-SNAPSHOT version. It would be great to have your feedback!
Many thanks upfront
Kind regards
Mahmoud


karate-config file should be read only once

Modifying karate.config file of karate-gatling-demo just adding a karate.log to know the environment the test is using:

makes to be displayed in the mvn console the property value 45 times (aprox the same number of http requests done).

We should consider to read ONLY once the karate-config.js file and reuse the variables, instead of reading it thousands of times (as in my test I am doing thousands of http request); it leads to an inefficient usage of the CPU and memory and clearly impacts the amount of time maven needs to run.

@ginessan this is a won't fix unless you can prove the "impact" and quantify it, thanks


Update go tool dependencies

Updated all tool dependencies to latest tags, hoping CI will like it.

New lint errors should be handled now.

https://github.com/go-gitea/gitea/commit/ed1d95c55dfa91d1c9a486bfb8e00375d4038e29# had disabled the strings.Title errors, but they now came back because the error text had changed. Anyways, I resolved it.


Change python path

Purpose
Fixes ###-####
Approach
Explain how your code addresses the purpose of the change.
Learning
Any tips and tricks, blog posts or tools which helped you.
Checklist

[ ] I have performed a self-review of my own code
[ ] 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
[ ] I have run an accessibility tool against the changes and applied fixes
[ ] The team have tested these changes

hey - i started similar p[r, but added workspace to the pathing - https://github.com/ministryofjustice/opg-github-actions/pull/39
for some reason, this created a v3.0.0 tag .. im not sure why, but ive removed that for now!


[Feature] sidecar: Refresh AWS object store credentials for 400 expired tokens

Thanos version: 0.14.0
I think this is most relevant for @bwplotka :)
Object Storage Provider: AWS.
What happened:
Wondering if we could add a feature to reinitialise the client if it receives error code 400 for expired token, as detailed here: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
Specfically this one,

ExpiredToken
The provided token has expired.
400 Bad Request
Client

Use case below.
How to reproduce it (as minimally and precisely as possible):
We have a multi cloud provider setup, where one cloud provider is IBM and the other is AWS. We have prometheus instances in both accounts with thanos sidecars with the aim of uploading them to AWS S3.
For the AWS account we can rely on instance profile credentials, but for the one in IBM we can't. Using access/secret keys is not ideal for us since they have to be rotated and are generally a poorer choice. We decided to come up with a solution where we would leverage Hashicorp Vault. The architecture then becomes like this:

We would create a role in Vault which will generate AWS credentials that are rotated automatically by vault.
A Vault agent  is configured alongside every sidecar in IBM. This agent continuously updates and rotates the keys - it does this in a way which writes out the credentials to a 'sink'. So e.g, in our case it's /home/prometheus/.aws/credentials.
Thanos-sidecar picks up the credentials successfully. All this is working.

This is where our setup starts to fail:

Eventually since those credentials only last 1 hour, they expire. Vault agent in this time would have automatically written out new credentials to /home/prometheus/.aws/credentials again, but thanos-sidecar does not reinitialise the client, so spends the rest of the time attempting to use old credentials. So it never is able to successfully upload blocks until it is restarted, at which point it will be good for 1 hour again.

Sep 25 03:34:22 prometheus-grafana-staging-ibm-sjc4-us thanos-sidecar[24113]: level=warn ts=2020-09-25T03:34:22.805038929Z caller=sidecar.go:285 err="check exists: stat s3 object: 400 Bad Request" uploaded=0
Sep 25 03:34:52 prometheus-grafana-staging-ibm-sjc4-us thanos-sidecar[24113]: level=warn ts=2020-09-25T03:34:52.815605645Z caller=sidecar.go:285 err="check exists: stat s3 object: 400 Bad Request" uploaded=0
Sep 25 03:35:22 prometheus-grafana-staging-ibm-sjc4-us thanos-sidecar[24113]: level=warn ts=2020-09-25T03:35:22.836255488Z caller=sidecar.go:285 err="check exists: stat s3 object: 400 Bad Request" uploaded=0

I'm no go programmer, but digging through the code:

Thanos uses minio. It uses a credentials chain as referenced in both the docs and the code here:
https://github.com/thanos-io/thanos/blob/master/pkg/objstore/s3/s3.go#L184

chain = []credentials.Provider{
			&credentials.EnvAWS{},
			&credentials.FileAWSCredentials{},
			&credentials.IAM{
				Client: &http.Client{
					Transport: http.DefaultTransport,
				},
			},

Minio supports the concept of expiring credentials, but that is only relevant to the STS generated ones. The file and environment credentials are only ever retrieved once, and never reloaded again. For example:
https://github.com/minio/minio-go/blob/v7.0.0/pkg/credentials/file_aws_credentials.go#L104
https://github.com/minio/minio-go/blob/v7.0.0/pkg/credentials/env_aws.go#L70

func (p *FileAWSCredentials) IsExpired() bool {
	return !p.retrieved
}

Thanos at the moment just uses a single client throughout the lifetime of the sidecar.
https://github.com/thanos-io/thanos/blob/9d638e92f318b777795e819edd444f3c74d45149/cmd/thanos/sidecar.go#L271

I'm not a go programmer so unsure if I understood the code properly but that's what I arrived at. I'm wondering if there are any thoughts on the feasibility of adding support for reinitialising the client when there's a 400 expired token? It would be AWS only so probably the change needs to happen in https://github.com/thanos-io/thanos/blob/master/pkg/objstore/s3/s3.go.
Appreciate any feedback. Thanks!

Hello @juiceblender, has this created any issues? Is this still wanted?

Hello kakkoyun, it would still be ideal if it came but for now we're manually rolling our keys.

Are there any plans to fix this


Cannot route the traffic through the vpn.

Firstly, I would like to thank you for your work with this script.
I am using Ubuntu 22.04.1 and I successfully managed to connect to the university checkpoint VPN but all my traffic does not route through the VPN.
I tried to route the traffic through the IP route command but after that, everything stops working.

Hi, it is not very clear what you meant as "but all my traffic does not route through the VPN" and "I tried to route the traffic through the IP route".
On first glance, the script seems to be working as intended and is well tested in Ubuntu 22.04 and variants.
Would you be able to detail better what is happening, and what is expected? No name resolution happening? (no external/Internet sites opening, routing table supplied and changes?...)

That usually is made by design for security reasons, it is the difference between a full tunnel VPN vs a split tunnel VPN.
Please see the "Split tunneling" topic at the project/README page, it might be of help.
Regards


Fix cmake

"Closes #113 "
What is changing
fix an no-error-warning  cmake code

I need some help for  pr .
I didn't change any source code.
1commit - add comment
2+3 commit - change cmake code
4 commit  - revocate 2 and 3 commit
so the newest code change nothing about source code .
And I have run 3 times CI, unit test for test rpc server fail  in differnt  platform
Strange.........

I will look at the failed case.

LGTM


Download thread replies with pagination | Proxy for authorization | Disable minification

1. New function for loading replies to a thread with pagination support:
Please, instead of:
const post = await threadsAPI.getThreads(postID);
Add a new function:
getThreadsLoggedIn: PaginationPostIDQuerier<GetUserProfileThreadsPaginatedResponse> = async (
    postID,
    maxID = '',
    options = {},
  ): Promise<GetUserProfileThreadsPaginatedResponse> => {
    if (!this.token) {
      await this.getToken();
    }
    if (!this.token) {
      throw new Error('Token not found');
    }

    let data: GetUserProfileThreadsPaginatedResponse | ErrorResponse | undefined = undefined;
    try {
      const res = await axios.get<GetUserProfileThreadsPaginatedResponse | ErrorResponse>(
        `${BASE_API_URL}/api/v1/text_feed/${postID}/replies/${maxID && `?paging_token=${maxID}`}`,
        { ...options, httpsAgent: this.httpsAgent, headers: { ...this._getInstaHeaders(), ...options?.headers } },
      );
      data = res.data;
    } catch (error: any) {
      data = error.response?.data;
    }
    if (data?.status !== 'ok') {
      if (this.verbose) {
        console.log('[USER Threads] Failed to fetch', data);
      }
      throw new Error('Failed to fetch user Threads: ' + JSON.stringify(data));
    }
    return data;
  };

interface PaginationPostIDQuerier<T extends any> {
    (postID: string, maxID?: string, options?: AxiosRequestConfig): Promise<T>;
}

------------------------------------
2. Remove minification during installation
..Please make sure that when installing with npm install threads-api , unminified data is loaded. I can add a new feature to TS , but I can't submit to github .
------------------------------------
3. Add proxy support to login() and syncLoginExperiments():
....Yesterday I spent several hours to add proxy support for the authorization function in the minified .js - it was crazy .. but I did it. And now, every time I update the library, I will need to change the JS file again.
So if you can, add "httpsAgent: this.httpsAgent" to the login() method in:
const requestConfig: AxiosRequestConfig = {
         method: 'POST',
         httpsAgent: this.httpsAgent,
         headers: this._getAppHeaders(),
         ..........

And also in the syncLoginExperiments method, "httpsAgent: this.httpsAgent" in:
const res = await axios.post(`${BASE_API_URL}/api/v1/qe/sync/`, this.sign(data), {
         headers: {
           ...this._getAppHeaders(),
           Authorization: undefined
           'Sec-Fetch-Site': 'same-origin',
         ...........
         httpsAgent: this.httpsAgent,

------------------------------------
P.S. I write code in PHP , Python , so TS is not very comfortable for me. For some reason, I can’t install from source (package errors, despite the fact that they are already installed)
Thanks!

UPD: I was able to figure out how to compile TS , so I attached the finished function in the previous post.
Also, I ask in every function where there is
headers:
add also
httpsAgent: this.httpsAgent,
So that the proxy settings are applied to all requests (I already did it locally)

..Please make sure that when installing with npm install threads-api , unminified data is loaded. I can add a new feature to TS , but I can't submit to github .

Hey @ibotfather I appreciate your effort! Can you try forking the repo to make a pull request?

Remove minification during installation

Reasonable 👍

Add proxy support to login() and syncLoginExperiments():

Totally missed it, proxy support to login was added in #204, but I think we still need to fix syncLoginExperiments, right?

....Yesterday I spent several hours to add proxy support for the authorization function in the minified .js - it was crazy .. but I did it. And now, every time I update the library, I will need to change the JS file again.

By the way, modifying the node_modules directly is bad practice. If you need to instantly fix the package yourself use something like patch-package or yarn patch.

@junhoyeo I write new function for get notifications:
getNotifications = async (filter, pagination) => {
    let params: Record<string, any> = {
        feed_type: 'all',
        mark_as_seen: false,
        timezone_offset: -25200,
        timezone_name: "America%2FLos_Angeles"
    };

    if (filter) {
        params.selected_filters = filter;
    }

    if (pagination) {
        params.max_id = pagination.max_id;
        params.pagination_first_record_timestamp = pagination.pagination_first_record_timestamp;
    }

    const queryString = Object.keys(params).map(key => key + '=' + params[key]).join('&');
    const url = `${BASE_API_URL}/api/v1/text_feed/text_app_notifications/?${queryString}`;

    let data: any | ErrorResponse | undefined = undefined;
    try {
        const res = await axios.get<any | ErrorResponse>(url, {
            httpsAgent: this.httpsAgent,
            headers: { ...this._getInstaHeaders(), ...options?.headers }
        });
        data = res.data;
    } catch (error: any) {
        data = error.response?.data;
    }

    if (data?.status !== 'ok') {
        if (this.verbose) {
            console.log('[Notifications] Failed to fetch', data);
        }
        throw new Error('Failed to fetch notifications: ' + JSON.stringify(data));
    }

    return data;
};

Hey @ibotfather I appreciate your effort! Can you try forking the repo and adding the changes there to make a pull request?

sorry, but really I don't know: how...

@ibotfather Sure! Here's the steps if you want to contribute yourself:

Click Fork in junhoyeo/threads-api.

You'll have your own repository in https://github.com/ibotfather/threads-api

Use git to sync files to your local machine and edit files there — GitHub have a guide here!

If you're new I would recommend using GitHub Desktop. It has a GUI & comes battery included so you only have to care about the code. 😆

@ibotfather Sure! Here's the steps if you want to contribute yourself:

My friend, I will definitely deal with git , but later.
I just want to help :)
I have to urgently deal with my main development

+1 to getThreadsLoggedIn! Otherwise it seems there's a limit (around 15) that the graphql endpoint returns. Happy to help w/ a PR later


Increase max metaspace limit to 1G

Vercel deployments are failing due to hitting the current limit

Warnings

:warning:
This PR is approved with no milestone set. If merged, it won't appear in the detekt release notes.

  Generated by :no_entry_sign: dangerJS against 7458ae48dbda92c514e88e0da65f8d88f6a47a96


[Feature] Allow to reorder the action bar in the product page

Hi everyone!
We now have an action bar on the product page.
Some people may want a different order… or maybe hide some buttons.
This feature would require to add an icon at the end:

From which, we could show/hide and reorder buttons:

FYI: We don't use the long-pressable pattern, as it's not accessible enough.

"Refresh photos" would be a banger.

"Refresh photos" would be a banger.

That's out of scope here, but feel free to open an issue.
Would that be a permanent button or only when it's necessary?

It could be an optin button, and we could move it in the first place and even tint it red and pulsate it (and the phone, accompanied by a scary chime) if needed ;-)


OpenSKY  : WordPress FrontOffice UI

Add FrontOffice UI in WordPress

some work already done via shortcodes

Named OpenSKY by AlexR

will be included in v1.0.0