text:
use xdiff to implement internal diff algorithm

Okay, this is very highly experimental and still work in progress. But it might be good enough to share what I have, because it seems to pass my very basic tests and I do not know how much time I have to work on it in the future.
This PR imports the libxdiff from the git source tree to implement an internal diff parser (this is from git-2.17.0-rc0, plus some slight style changes [added a couple of casts]). This will make creating diffs a lot faster, since we do not need to shell out to parse the output of diff foobar foobar.new.
Currently, it runs the xdiff algorithm on the already written temp files tmp_new and tmp_orig and write the result to tmp_diff. We can probably skip writing temp files for creating diffs at all, but I am currently not sure how to do it. So there is some room for even more performance improvements later.
In addition, by using the git diff included xdiff, we can in the future support several improvements to the diff algorithm, e.g. implement patience and histogram diff algorithm, without much fuzz. Currently this is not supported, but it should be easily possible. Also the new indent heuristics from git which is the default starting with 2.14 should be possible with some kind of a switch.
To use the new algorithm, make sure to :set diffopt+=internal. As said before, this is highly experimental and might crash :(
Also note, I have basically no clue of how to import that part into the Makefile, so I changed src/Makefile manually and it might be cumbersome. But at least, it seems to work :)
BTW: feedback welcome, however, I am not sure how much time in the future I have to work on it. So I leave this here and hopefully this will make it easier to implement an internal diff in Vim.
However, note, I did not yet check which files from git/git source xdiff directory are actually needed. Currently, it will compile a couple of files, which might not (all) be necessary.  So it imports a couple of more files than currently needed. But it will enable additional diff options later.
However, once we have this change in place, it should be straight forward to make further adjustments as needed (e.g. do not write temp files at all to speed up diffing even further).
Also this has the further advantage to support unified diffs, when using a custom diffexpression. Currently only ed like style diffs are supported, which kind of sucks and prevents us from simply using :set diffexpr=git diff, because unified style diffs seems to be what most tools nowadays understand and ed like style diffs seem kind of traditional and even unsupported.
Note, there might be a some disadvantages with using libxdiff:

the libxdiff algorithm is different from GNU diff. However, I suppose by using xdiff from git,
we got a lot of testing.  (git has imported this library around 2006, so there are at least 10
years of thoroughly testing).

Codecov Report

Merging #2732 into master will decrease coverage by 1.02%.
The diff coverage is 3.53%.

@@            Coverage Diff             @@
##           master    #2732      +/-   ##
==========================================
- Coverage      75%   73.97%   -1.03%
==========================================
  Files          92       99       +7
  Lines      134149   136035    +1886
==========================================
+ Hits       100617   100636      +19
- Misses      33532    35399    +1867

Impacted Files
Coverage Δ

src/xdiff/xutils.c
0% <0%> (ø)

src/xdiff/xprepare.c
0% <0%> (ø)

src/xdiff/xemit.c
0% <0%> (ø)

src/xdiff/xhistogram.c
0% <0%> (ø)

src/xdiff/xdiffi.c
0% <0%> (ø)

src/xdiff/xmerge.c
0% <0%> (ø)

src/xdiff/xpatience.c
0% <0%> (ø)

src/diff.c
75.89% <37.29%> (-6.58%)
:arrow_down:

src/if_xcmdsrv.c
84.17% <0%> (-1.44%)
:arrow_down:

... and 16 more

Continue to review full report at Codecov.

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

I have disabled the libxdiff feature on Windows, because the windows Makefile has not been changed yet to include the xdiff source and there were some issues with mch_stat where I am not sure how to fix them for Windows.
Also I have not yet included any tests, mainly because I am not sure how to test the resulting diff. Perhaps it would be possible to run Vim recursively inside a terminal window in diff mode and snapshot the resulting diff using term_dumpwrite(). But I haven't looked at it how feasible this would be.

Nice, I wrote a small tool using xdiff to have nice/fast diffs and avoid messing with the vim source code.

Ha, I like the name ;)
BTW: I have implemented a vim-script solution to translate unified diff output to ed style diffs in vim-diff-enhanced

I think it is now in a shape, that is safe to include. I can squash it into a single commit if needed. Once this prooved to be stable enough, it might even allow us to get rid of distributing diff together with Vim.
I added a couple of tests, implemented the missing 'diffopt' values and made it work on Windows. Tests pass except for some slight differences in the term_dump() function. This can be seen here:
https://api.travis-ci.org/v3/job/357269023/log.txt
https://api.travis-ci.org/v3/job/357269024/log.txt
The only difference is this part:
@@ -17,4 +17,4 @@
 | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
 | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
 |X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
-|:+0&&> @73
+|:+0&&> | @72

which I think is a bug in the term_dump() function and I have already reported at vim-dev. Also there was one ASAN error reported here:
https://api.travis-ci.org/v3/job/357269032/log.txt
Which also looks like a bug in the f_term_dumpwrite function. And finally, it looks like there was one out of memory error on travis:
https://api.travis-ci.org/v3/job/357337067/log.txt
There is still room for improvement though. For one thing one could avoid the whole I/O overhead by making it use without using temporary files. But I have the feeling that is something I cannot easily implement and might take some additional time and effort, which I do not have currently.
Second, the :diffpatch function could make use of the xdiff library. However it looks like currently the xdl_patch() function has been removed from the xdiff library by the git folks. Anyhow, I have the feeling, that the :diffpatch command is actually not much used, since it currently requires the patch program available and that one is not even bundled with Vim. So this command already fails miserably on Windows with a command not found error :(
And finally it might make sense to allow context lines when parsing the unified diff. This would mean, one needs to actually adjust the hunk addresses (lnum_orig, count_orig, lnum_new and count_new) as one parses the file. I have not done so yet, so Vim always expects a unified diff with zero context lines. There won't be an error, just the diff will be rendered wrongly.
And finally here are two screencasts how to make use of the new diff algorithms in Vim that comes with xdiff:

Using the build in patience algorithm: https://asciinema.org/a/YL035raOlEbadoWNLpj5cBXan
Using the new indent-heuristics: https://asciinema.org/a/QyIhLUUmwMdpzIjRhkdcPdUyx

Kudos goes to the git developers for developing those parts.

On my Mac, the build was done successfully, and the resulting Vim worked fine, just the same way as the screencasts are showing.
I have used my own Lua script to have Vim accept the output of git diff --no-index.  I found that the xdiff of this PR gives just the same results that the script does, but I also found that the former gives a far better user experience than the latter: It's free from severe flicker or hiccups such as incompletely-finished-redrawing.  In addition to making some nice diff algorithms available to Vim, I think this PR succeeded in showing the advantage of having a builtin xdiff.
As to the screen dump test, I got
Test results:

From test_diffmode.vim:
Found errors in Test_diff_screen():
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 14: See dump file difference: call term_dumpdiff("Test_diff_01.dump.failed", "dumps/Test_diff_01.dump")
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16: --- dumps/Test_diff_01.dump       2018-03-23 21:31:49.000000000 +0900
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16: +++ Test_diff_01.dump.failed      2018-03-23 21:41:51.000000000 +0900
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16: @@ -17,4 +17,4 @@
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16:  | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16:  | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16:  |X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16: -|:+0&&> @73
function RunTheTest[38]..Test_diff_screen[14]..VerifyScreenDump line 16: +|:+0&&> | @72
TEST FAILURE

Also, when I tried to compile the patched source with -std=c89, I got
$ CFLAGS='-std=c89' ./configure && make
...
gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -std=c89 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/xdiffi.o xdiff/xdiffi.c
xdiff/xdiffi.c:733:8: error: unknown type name 'inline'
static inline int group_next(xdfile_t *xdf, struct xdlgroup *g)
       ^
xdiff/xdiffi.c:733:15: error: expected identifier or '('
static inline int group_next(xdfile_t *xdf, struct xdlgroup *g)
              ^
xdiff/xdiffi.c:749:8: error: unknown type name 'inline'
static inline int group_previous(xdfile_t *xdf, struct xdlgroup *g)
       ^
xdiff/xdiffi.c:749:15: error: expected identifier or '('
static inline int group_previous(xdfile_t *xdf, struct xdlgroup *g)
              ^
4 errors generated.
make: *** [objects/xdiffi.o] Error 1

The screen dump diff looks similar to the one above from the CI. I am not sure, but I think the difference is only that for one dump there a 73 spaces while the result of the test was 1 single space followed by 72 spaces. If you load it into Vim using call term_dumpdiff("Test_diff_01.dump.failed", "dumps/Test_diff_01.dump") you'll probably not notice any difference.
regarding the C89 issue, I have seen a similar error on Windows and have therefore disabled the inline and attribute flags using https://github.com/vim/vim/pull/2732/commits/0c4076187d7dc22eb966c5d29864e1d1d24042ab. Perhaps those should be done unconditionally? (I didn't do it, because I didn't want to change too much of the upstream source. Or is there a similar compile property available to check against when compiling?

This PR imports the libxdiff from the git source tree

Is libxdiff not available for linking instead of inlining the entire thing (GPL license) into the Vim tree?

@chrisbra

If you load it into Vim using call term_dumpdiff("Test_diff_01.dump.failed", "dumps/Test_diff_01.dump") you'll probably not notice any difference.

Indeed, I can't distinguish one from another.  For convenience, I'm uploading a screenshot obtained by the suggested command:

regarding the C89 issue, I have seen a similar error on Windows and have therefore disabled the inline and attribute flags using 0c40761. Perhaps those should be done unconditionally?

I think that would be the easiest, practical way to go unless avoiding the inline ends up a noticeable deterioration in performance.
That said, I also understand

I didn't want to change too much of the upstream source.

as, IIRC, an option once introduced to git diff was abolished in a few month last year.  The development has been so active even these days.   Too much deviation from the original source surely makes it harder for us to catch up with improvement done by the upstream in the future...

Or is there a similar compile property available to check against when compiling?

I'm afraid there's not.

Is libxdiff not available for linking instead of inlining the entire thing (GPL license) into the Vim tree?

As far as I can see, there is no libxdiff-dev available in Debian. Not even the original version. Also git seems to inline it (using a static library, not that it matters much in practice).

[disable inline...]

I think that would be the easiest, practical way to go unless avoiding the inline ends up a noticeable deterioration in performance.

I tried and failed miserably.
https://ci.appveyor.com/project/chrisbra/vim-ch0ci/build/job/g1430v7vw08q6y3y
https://ci.appveyor.com/project/chrisbra/vim-ch0ci/build/job/g1430v7vw08q6y3y
duplicate symbol _isprint in:
    objects/xdiffi.o
    objects/xemit.o
duplicate symbol _digittoint in:
    objects/xdiffi.o
    objects/xemit.o
duplicate symbol _isxdigit in:
    objects/xdiffi.o
    objects/xemit.o
duplicate symbol _isdigit in:
    objects/xdiffi.o
    objects/xemit.o

On Mac and on Windows with Mingw. Wow, I did not expect that. So I am rolling it back for now.

rebased and added another test for 'diffopt+=iwhite'

What are the implications of pasting GPL-licensed code into Vim's source?

@justinmk : from a page or so below :help license:
- According to Richard Stallman the Vim license is GNU GPL compatible.
  A few minor changes have been made since he checked it, but that should not
  make a difference.

- If you link Vim with a library that goes under the GNU GPL, this limits
  further distribution to the GNU GPL.  Also when you didn't actually change
  anything in Vim.

- Once a change is included that goes under the GNU GPL, this forces all
  further changes to also be made under the GNU GPL or a compatible license.

The library is LGPL-licensed so including the library doesn't require changing the Vim license to GPL. There are other requirements though like mentioning that the library is used and covered by the LGPL (this could be added to the :version output for instance), and adding a copy of the GPL and LGPL to the project.

Thanks for those comments. I added a commit mentioning the license of libxdiff and included the LGPL for further distribution. I leave the decision to mention the license in the :version output to Bram.
I also added a second commit to make the tests work better by disableing the SwapFile Exists warning.
There is still an ASAN failure which looks like term->tl_vterm-> screen gets somehow corrupted causing a segfault. Unfortunately, I can only reproduce this on the CI infrastructure and not locally. I don't actually know how to debug this.

Vim doesn't even put it's own licensing info in the output of :version.  I have no idea why we would put anything else's licensing info in there.

Vim doesn't even put it's own licensing info in the output of :version. I have no idea why we would put anything else's licensing info in there.

I thought the license was mentioned there as a lot of tools are displaying that kind of info when running them with --version on the command line. Anyway, this was just a suggestion of where it could be mentioned. Adding it to :h license should be fine.

authors: LemonBoy chdiza chrisbra codecov-io justinmk micbou nuko8 tonymec


text:
Suggestion: Add an API function to the get all rows

I have a situation where I need to get all the rows to be used for a total calculation on a field. The reason why I believe an API function is required is because if the data is filtered by the API then I have no way of getting those filtered rows (I'd have to separately do that manually), so something like:
handler.getAllRows()
Would return all rows provided by the handler with the filtering applied (and maybe sorting? Whatever manipulation is being applied by the API)

That helper looks really helpful (saves me using lodash), so thanks for pointing it out - and thanks for adding the new function so quickly!

source: gharchive/issue

repo: vincjo/datatables

license: MIT

license_type: permissive

license_source: github-api


text:
Feature request link is broken

Package version
^1.6.0
Describe the bug
I wanted to open feature request for adding the default value option in schema like we have in zod.
But seems like the link is broken.
Reproduction repo
No response

Hey @ShivamJoker! 👋🏻
On a side note, mimicking the Zod default behavior is already doable.
We even have a more powerful system using the parse method.
function assignDefaultRole(value: unknown) {
  if (!value) {
    return 'guest'
  }

  return value
}

const schema = vine.object({
  role: vine.string().parse(assignDefaultRole)
})

📚 https://vinejs.dev/docs/schema_101#parsing-input-value

Thanks @RomainLanz for the quick response.
I see, but is there any way we can extend this and make it similar to v.string().default('value')?

Not sure why adding a new API would be useful.
As said, it is more powerful and could be refactored down to the following:
v.string().parse(v => v ?? 'default')

I know it can be powerful and we can achieve the same thing, but having an API would reduce the lines of code which we have to write a function for every default.

You can extend the StringSchema class and docs already cover how to extend schema classes.

authors: RomainLanz ShivamJoker thetutlage

repo: vinejs/vine


text:
Wikipedia article seems to consider this to have websocket server functionality

https://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations
As I only see this is a client library, probably the wikipedia article needs to be updated

Where did you get the idea that Beast only offers a WebSocket client? It has both. We use Beast in rippled, which exposes a WebSocket server for clients to issue requests:
https://github.com/ripple/rippled/blob/develop/src/ripple/server/impl/SSLWSPeer.h#L48
To implement a server, just call beast::websocket::stream::accept on the socket used to receive the incoming connection, and it will read the Upgrade request and respond to it appropriately:
https://github.com/vinniefalco/Beast/blob/999e2fa0318b5982736d3ea01a418770ea802671/include/beast/websocket/stream.hpp#L312
The Beast Autobahn|Testsuite report shows both the synchronous and asynchronous modes of operation, source code for those WebSocket servers are here:
https://github.com/vinniefalco/Beast/blob/999e2fa0318b5982736d3ea01a418770ea802671/test/websocket/websocket_async_echo_peer.hpp
https://github.com/vinniefalco/Beast/blob/999e2fa0318b5982736d3ea01a418770ea802671/test/websocket/websocket_sync_echo_peer.hpp
Hope this helps!

I'm going to close this since it is not a bug

authors: ignasg vinniefalco

repo: vinniefalco/Beast


text:
fixed inconsitency in writer documentation

Return values were stated as the opposite of reality

Codecov Report

Merging #266 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #266   +/-   ##
=======================================
  Coverage   95.01%   95.01%
=======================================
  Files          88       88
  Lines        6241     6241
=======================================
  Hits         5930     5930
  Misses        311      311

Continue to review full report at Codecov.

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

Fixed in 1.0.0-b29 - Thanks!

source: gharchive/pull-request

authors: codecov-io s-brain vinniefalco


text:
Unhandled Exception: FormatException: Unexpected character

Hi,
I got these errors.
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: FormatException: Unexpected character (at character 1)
E/flutter (13105):
E/flutter (13105): ^
E/flutter (13105):
E/flutter (13105): #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1404:5)
E/flutter (13105): #1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1271:9)
E/flutter (13105): #2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:936:22)
E/flutter (13105): #3      _parseJson (dart:convert-patch/convert_patch.dart:40:10)
E/flutter (13105): #4      JsonDecoder.convert (dart:convert/json.dart:506:36)
E/flutter (13105): #5      JsonCodec.decode (dart:convert/json.dart:157:41)
E/flutter (13105): #6      FlutterInsta.getProfileData (package:flutter_insta/flutter_insta.dart:25:21)
E/flutter (13105):
E/flutter (13105): #7      _InstaDetailsState.setInstaDetails (package:linkish/ui/widgets/insta_detail.dart:24:5)
E/flutter (13105):
E/flutter (13105):

Duplicate of #13

Duplicate of #13 , closing this issue

authors: DavideM12 alirezabhr viralvaghela


text:
FST and default avatar model handling and support.

Address three skeleton model scenarios:

Invalid avatar such that default FST avatar is used.
Valid FST avatar.
Valid glTF/FBX avatar.

For all three address:

Own skeleton model data handling.
Sending own skeleton model data to the avatar mixer.
Receiving other users' skeleton model data.
Handling other users' skeleton model data.

What should the SDK provide to support user clients for the above?

Default avatar model and skeleton?
FST file-related facilities?
Avatar model file units determination?
Anything else?

Is FST still the best way to handle this? I forgot why, but is FST truly more ideal than JSON/JS/TS objects? I feel like that's easier to parse and handle in a general sense.

authors: ctrlaltdavid digisomni

repo: vircadia/vircadia-web-sdk


text:
Mips Implementation

Created a Mips implementation of FizzBuzz

Is this code running without any errors for you? Because I don't know Mips and I got errors in an online compiler.
Is the same true for you?

do you have the link to the compiler you tested it on? If so please send so I can take a look.

I was able to find an online compiler for Mips and it seems to run perfectly here also. Here is a screenshot.

Ok, looks great. Thanks for contributing! Feel free to add more languages👍

authors: Mystic-Developer virejdasani

repo: virejdasani/FizzBuzz-EVERYTHING


text:
The purpose of upper and lower clusters

Describe the problem
I don't quite understand design purpose here. Seems all the user requests will come to upper cluster? Lower cluster is used to provide resources for upper cluster? As you mention most of the cluster are small clusters ("e.g. we have 10 clusters but each cluster only has 100 nodes.") Why not to create 1000 nodes cluster as upper cluster and don't use VK to extend it?
Copy services, secrets from upper cluster to lower cluster is kind of tricky. You also need to make sure connectivity across clusters. What's more, total number of objects in upper cluster never reduces, they are all replicate to lower clusters. This doesn't seem helpful on the scalability side. Maybe I understand wrong, scalability is not the major motivation to create this solution
Another thing I am not sure if all your lower clusters share one etcd for k8s objects? You mention flannel uses same CIDR and it helps to flat ip spaces across all clusters. Do you just use etcd for flannel or for k8s as well?

I don't quite understand design purpose here. Seems all the user requests will come to upper cluster? Lower cluster is used to provide resources for upper cluster? As you mention most of the cluster are small clusters ("e.g. we have 10 clusters but each cluster only has 100 nodes.") Why not to create 1000 nodes cluster as upper cluster and don't use VK to extend it?

Each lower cluster is more 1000 nodes in our environment, we have more than 100 cluster(not all 1000 nodes). Through VK,  our cluster is more than 15000 nodes now. Original K8s may only support 5000 nodes.
multicluster scheduling which is benefit for users to deploy applications not only in one cluster.
Our initial purpose is combine the cluster resource fragments.

Another thing I am not sure if all your lower clusters share one etcd for k8s objects? You mention flannel uses same CIDR and it helps to flat ip spaces across all clusters. Do you just use etcd for flannel or for k8s as well?

A single etcd for flannel.

I don't quite understand design purpose here. Seems all the user requests will come to upper cluster? Lower cluster is used to provide resources for upper cluster? As you mention most of the cluster are small clusters ("e.g. we have 10 clusters but each cluster only has 100 nodes.") Why not to create 1000 nodes cluster as upper cluster and don't use VK to extend it?

Each lower cluster is more 1000 nodes in our environment, we have more than 100 cluster(not all 1000 nodes). Through VK,  our cluster is more than 15000 nodes now. Original K8s may only support 5000 nodes.
multicluster scheduling which is benefit for users to deploy applications not only in one cluster.
Our initial purpose is combine the cluster resource fragments.

Another thing I am not sure if all your lower clusters share one etcd for k8s objects? You mention flannel uses same CIDR and it helps to flat ip spaces across all clusters. Do you just use etcd for flannel or for k8s as well?

A single etcd for flannel.

@cwdsuzhou Thanks for your quick response. It makes more sense now if there're 15k nodes in total.  Seems your org is the only user of upper cluster and this way help resolve federation problem.  Have you consided multi-cluster management like kubernetes federation instead?

@cwdsuzhou Thanks for your quick response. It makes more sense now if there're 15k nodes in total.  Seems your org is the only user of upper cluster and this way help resolve federation problem.  Have you consided multi-cluster management like kubernetes federation instead?

federation only helps allocate replicas, e.g. deployment, replicaSet, not scheduling pods. What's more, pods created by operators may not work with deployment or replicaSet.

federation only helps allocate replicas, e.g. deployment, replicaSet, not scheduling pods. What's more, pods created by operators may not work with deployment or replicaSet.

Thanks for the reply. I will close the issue.

Thanks for the reply. I will close the issue.

authors: Jeffwan cwdsuzhou

repo: virtual-kubelet/tensile-kube


text:
Cucumber report does not show failed fields

Having a large number of fields (>50) it will be very helpful to see which field caused the failed test.
I don't see that in the Cucumber report.
Is it possible to see which field did not pass ?

I found it in the subfolder cucumber-html-reports in the overview-failures.html report.
Very nice detailed report!

repo: virtualansoftware/idaithalam


text:
feature: SyncVar

WIP. open for discussion.
overview
[SyncVar] can be replaced with SyncVar<T> internally by Weaver to save >1k LOC.

SyncVar<T> could also be used by users instead of [SyncVar] tag in the future.
usage:
Try replacing Tank.cs example:
[SyncVar] public int health = 4;

public SyncVar<int> health = 4;

custom drawer
looks exactly the same in Inspector:

benefits of SyncVar<T>:

based on our SyncObject & Writer<T> features
Hook as Action instead of string
SyncVarGameObject/NetworkIdentity/NetworkBehaviour persistence can be implemented in C# instead of IL
Easier debugging / maintenance of SyncVar code: pure C# now
removes largest technical debt in Mirror
easier to test with regular Unit tests instead of Weaver tests
fixes [SyncVar] NetworkBehaviour persistence (master doesn't store netId + componentIndex internally)

pending:

Mirror would have to upgrade to Unity 2020 LTS because it can show SyncVar<T> in Inspector
waiting for Unity bug report where 'readonly' SyncVar isn't shown in Inspector, so we can't force readonly until then
preparing [SyncVar] -> SyncVar<T> Weaver PR first to see if it all works as planned

summary
we can remove >1000 lines of Weaver code while keeping same functionality.
should be a no brainer.
for example:

I like, especially the part where a field will now clearly convey that it is a SyncVar. I have a few concerns though

public SyncVar health = 4;

How is performance affected when accessing health's value? Would be nice with a comparison.

we can remove >1000 lines of Weaver code while keeping same functionality.

Since there's quite a bit of focus in the summary of this PR on removing, it could be good to note that this PR itself adds 1k LOC.

Try replacing Tank.cs example:

I would love to see the tank example actually updated so that these changes feel a bit more real.


text:
CX Reflected_XSS_All_Clients @ website/pictures/upload.php [master]

Reflected_XSS_All_Clients issue exists @ website/pictures/upload.php in branch master
The application's <?php embeds untrusted data in the generated output with echo, at line 1 of website\pictures\upload.php. This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output.
The attacker would be able to alter the returned web page by simply providing modified data in the user input _SERVER, which is read by the <?php method at line 1 of website\pictures\upload.php. This input then flows through the code straight to the output web page, without sanitization.
This can enable a Reflected Cross-Site Scripting (XSS) attack.
Severity: High
CWE:79
Vulnerability details and guidance
Checkmarx
Lines: 83

Code (Line #83):
  <form enctype="multipart/form-data" action="<?=h( $_SERVER['PHP_SELF'] )?>" method="POST">

Issue still exists.

Issue still exists.


text:
Update README.md

Solution for this old PR that I totally forgot #53
@vishesh Is that what you wanted?

@Poussinou Looks good. Thank you!

authors: Poussinou vishesh

repo: vishesh/sealnote

license: mit

license_source: bigquery


text:
Update whoopingcough

Description
Resolves # (If this PR is unrelated to a ticket, please erase this line)
Please include a summary of the change
Type of change
Please select one below (Please click check boxes AFTER submitting ticket)

[ ] Bug fix
[ ] New feature
[ ] New Documentation
[x] Other (please describe below)

How Has This Been Tested?
Please describe the tests you've added or any tests that already cover this change. Include relevant information, such as which operating system you tested on.
Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have updated the release notes
[ ] I have made corresponding changes to the documentation
[ ] I have added debugging support to my changes
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] I have added any new baselines to the repo
[ ] I have assigned reviewers (see VisIt's PR procedures for more information).

@brugger1
Is this ok? just an update to my workstation config file.

repo: visit-dav/visit


text:
Pose Input

Hi,
How can I create the position input for Cambridge dataset?
The format is different to 7 scene

Yes, input poses have to be 4x4 transformation matrices for our code. The Cambridge dataset format (translation vectors + quaternions) can be easily converted using a math library of your choice.

Hey,
On the same topic, I wanted to reproduce your reported performance number on Cambridge dataset, based on the pre-trained networks you provide.
To convert from Cambridge format to 4x4 transformation matrices, I used transforms3d.quaternions.quat2mat (from transforms3d package in python) which then I feed to the test code.
However, during test-time (and evaluation ) I get huge rotation errors for each pose (while translation error is okey)
for example:
for the input image seq1/frame00001.png in ShopFacade scene,
which have the following quaternions: [0.712261, 0.682691, -0.123193, 0.106962],
and translation: -0.157816 -10.413150 1.832074
I get the following matrix (after applying quat2mat() ):
9.4676524e-01      -3.2057519e-01     -2.9447146e-02      -1.5781600e-01
-1.5835781e-02     4.4984371e-02      -9.9886217e-01      -1.0413150e+01
3.2153509e-01,      9.4615430e-01       3.7513080e-02        1.8320740e+00
0.0000000e+00      0.0000000e+00      0.0000000e+00        1.0000000e+00
The predicted pose output ({Rodriguez},{translation}) of this image is : [{-1.51317 0.26542 -0.232277 }, {-0.0721703 -10.4599 1.81715} ]
when the result is compared to this gt pose in DSAC++ code I get the following rotError: 178.183[deg]
I wonder how exactly you covert from quaternions to 4x4 matrix, can you please help.
Thanks

This is how I convert the Cambridge poses. It could be that you have to invert the 4x4 matrix on top of that. This has to be done for either the Cambridge or the 7scenes poses to work with the DSAC++ code, but I do not recall which one atm.
import numpy as np
import cv2 as cv

# this is the 4-value quaternion from the Cambridge file
cam_rot = [float(r) for r in camera[4:]]

#quaternion to axis-angle
angle = 2 * math.acos(cam_rot[0])
x = cam_rot[1] / math.sqrt(1 - cam_rot[0]**2)
y = cam_rot[2] / math.sqrt(1 - cam_rot[0]**2)
z = cam_rot[3] / math.sqrt(1 - cam_rot[0]**2)

cam_rot = [x * angle, y * angle, z * angle]

cam_rot = np.asarray(cam_rot)
cam_rot, _ = cv.Rodrigues(cam_rot)

# this is the 3-value translation vector from the Cambridge file
cam_trans = [float(r) for r in camera[1:4]]
cam_trans = np.asarray([cam_trans])
cam_trans = np.transpose(cam_trans)
cam_trans = - np.matmul(cam_rot, cam_trans)

cam_pose = np.concatenate((cam_rot, cam_trans), axis = 1)
cam_pose = np.concatenate((cam_pose, [[0, 0, 0, 1]]), axis = 0)

Thanks a lot, that makes sense now.

authors: ebrach maesfahani shamafiras

repo: vislearn/LessMore


text:
Will not load = Grasshopper Breakpoint issue

Good Morning,
Robots will not load because of a problem listed below.
Can anyone point me in a good direction to solve please?
Thank you
"Grasshopper Breakpoint
The RobotsGH Component Library was buid against a different major version of the Grasshopper SDK.
Local SDK = 1.0.0.20
Reference SDK = 6.11.1834420090

Check your Rhino 6 version, it should be 6.11 (as in the number above) or higher.
To check the version number go to Help > About Rhinoceros.

Okay will do so.
Thank you!
I was attempting to run in Rhino 5 as the Wiki says.
Prerequisites
Windows 7 or above
.NET Framework 4.0
Rhinoceros 3D 5 SR13 64 bit
Grasshopper 0.9.0076

Hello,
Need a bit more help please.
Running Version 6 SR26
(6.26.20147.6511, 5/26/2020)
In R6 no Grasshopper Breakpoint error.
But Robots does not showup in Grasshopper.
Unblocked Robots.dll and Robots.gha are in:
C:\Users\RatCat\AppData\Roaming\Grasshopper\Libraries
All downloaded libraries are in:
C:\Users\RatCat\Documents\Robots
Any idea what I might change?
Thanks!

All seems correct, try dragging robots.gh to the Grasshopper canvas and see if you get any error messages in the Rhino console.

Okay will do so.
Thank you!
I was attempting to run in Rhino 5 as the Wiki says.
Prerequisites
Windows 7 or above
.NET Framework 4.0
Rhinoceros 3D 5 SR13 64 bit
Grasshopper 0.9.0076

Thanks, I updated the Wiki with the current prerequisites.

Fantastic!
Dragging did the trick - seems to be working now.
Will test and confirm in a bit.
Thank you.

Good Evening,
All works well except I must drag and drop Robots.gha into Grasshopper each time I wish to use.
For some reason will not stay in memory.
Also, is there a way to import a slicer file (gcode)?
Thanks tons!

Where or how can I find more information about components?
Looks like custom code may work - wondering?
Thx

All works well except I must drag and drop Robots.gha into Grasshopper each time I wish to use.
For some reason will not stay in memory.

That's very strange, you shouldn't have to drag it every time.

Also, is there a way to import a slicer file (gcode)?

There's something for G-code in the other pinned repo called Extensions, see:
https://github.com/visose/Extensions/blob/master/Extensions/Model/Toolpaths/Milling/GCodeToolpath.cs

Where or how can I find more information about components?

There's some info in the Wiki here. Besides this, some people have made tutorials, but might be hard to google due to the original and distinctive name of the plugin.

Looks like custom code may work - wondering?

The 'Custom Code' component is used when you want to manually modify in Grasshopper the text code that is generated by the 'Create Program' component. Usually using components such as 'text replace', or inserting custom text snippets. You would feed this changed code to the custom code component to be able to use other components such as 'Save program' or 'Remote' with your edited code.

Fantastic!
Reviewing now - will let you know how it goes.
Cheers,

authors: MarceMoulton visose

repo: visose/Robots


text:
Add ALC269 layout-id 10 for Brix by Toleda

ref:
http://www.insanelymac.com/forum/index.php?app=forums&module=forums&section=findpost&pid=2541245
https://github.com/toleda/audio_CloverHDMI
https://github.com/toleda/audio_alc269
Changed layout-id to 10 to avoid conflict.

Added manually without HDMI patch.


text:
    docs: add vite client script for backend integration

New updates on head repo.
https://github.com/vitejs/vite/commit/aa0b9215f5a8d31bc496c7e415a09588c6368f68

対応します

authors: jay-es kiaking

repo: vitejs/docs-ja


text:
Simplify environment variable handling

Description
Today, variable environment handling in Vite is made of the following moving parts:

.env files were the APP environment variables are defined
import.meta.env
process.env
The VITE_ prefix that is used to filter which environment variables show up in import.meta.env

The current state of the art, relies on import.meta.env and process.env (a Node-only API) to correctly (and securely) integrate environment variables in a vite-powered application.
Variables starting with VITE_ will be included in import.meta.env in both client and server (SSR) build, while variable without the prefix will be included also be included in process.env only in the server build.
I want to argue that while the docs could be improved, the API is inheritely confusing, we have seen developers at qwik include their secrets in a environment variable prefixed with VITE_ because they thought import.meta.env was the only API available to access variables.
Suggested solution

Simplify the decision making: process.env is deprecated and never recommended
Rename VITE_ to PUBLIC_, so it states clearly the intention of the prefix, VITE while on-brand, it does not contain semantic.
Change the behaviour of import.meta.env for SSR build:

During SSR build, import.meta.env will include ALL the environment variables, with and without the PUBLIC_ prefix
During browser build: import.meta.env will include ONLY the environment variables with the PUBLIC_ prefix (like it does currently)

This way, there is no need for process.env in modern source code, and the cognitive load is lower for developers since there is a single recommended API to get the variables import.meta.env and a clear intention for variables supposed to be public and therefore included in the browser build.
Alternative
No response
Additional context
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

additional information:
sveltekit offers a different way to import environment variables that ensures private env isn't leaked to the client build.
https://kit.svelte.dev/docs/server-only-modules#private-environment-variables
I made an experiment a while ago where a vite plugin is used to offer similar protections in a more generic way, albeit with slightly differend DX (in kit you can import env, in that plugin you have to import each var)
https://github.com/svitejs/vite-plugin-env-import/tree/main/packages/vite-plugin-env-import

I'd get rid of the import.meta.env built-ins because they don't work in library mode. If you build a library using import.meta.env and then distribute it, it will not work with other bundlers. I built esm-env as a replacement we use in SvelteKit which works both for libraries and apps
I agree with the VITE_ to PUBLIC_ rename
process.env can be nice because it's set dynamically at runtime whereas import.meta.env is replaced dynamically at build time. We need both as there are cases where one or the other must be preferred. SvelteKit made this dynamic vs static usage more explicit, which we may be able to do in Vite as well with an approach similar to the one Dominik shared

I understand it gets replaces at build time when building the library, no?, process.env is a node-only idiom too. Sveltekit solution is interesting, are those server-only files commited? one of the nice things about the .env files is that it's well-known to not be committed

We can show the depreciation warning to Vite users to not use process.env still we can copy the envs into both process.env and import.meta.env .

The problem with not using process.env is that it's the only way to keep secret environment variables private!

btw @benmccann in Qwik, we also have a similar solution for isServer, isBrowser:
import {isServer} from '@builder.io/qwik/build';

i was thinking more of custom environment variables, Svelkit solution modules is very interesting though

I think to remove the confusion on which envs gets loaded in which environment, we can instead add CLIENT_ prefix, which will be loaded only on the client build, while SERVER_ prefix will be loaded only on server builds. AND, the PUBLIC_ prefix will be loaded on both client and server.

Yes, good point about process.env being Node-only. The way we handle that in SvelteKit is by allowing the adapter for each hosting platform to pass in the environment variables. E.g. here's where we do it in our Vercel adapter:
https://github.com/sveltejs/kit/blob/b6c238a7f137b49e4f24746696e592103e1c3aed/packages/adapter-vercel/files/serverless.js#L11
I'm not sure how that would work outside a meta framework. Perhaps Vite could define a function like getEnv that each framework would need to provide an implementation of or something. But I'm not sure there's a whole lot of benefit of standardizing that across frameworks and it seems just as well that this is something that's implemented by each framework.
The other interesting thing SvelteKit does is make sure you don't access any private env variables from public-facing code. You can only reference them if server is in the directory or file name. Potentially that could be refactored out into a Vite plugin which could be shared across projects.

authors: WyvernDrexx benmccann dominikg manucorporat

repo: vitejs/vite


text:
Worker .data and .wasm files aren't found in production / built version

Describe the bug
My project essentially does:
import vimWorkletUrl from "vim-wasm/vim.js?url";
...

This works great in development mode, but in production I get 404, these assets aren't found
Dev:

Prod:

I can't find any trace of them in the dist directory
Reproduction
https://github.com/ayroblu/wasm-import-bug
Steps to reproduce
yarn
yarn dev
# Verify it works
yarn build && yarn preview
# verify it doesn't work

System Info
System:
    OS: macOS 13.1
    CPU: (8) x64 Apple M1 Pro
    Memory: 24.88 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.2.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.19.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Safari: 16.2
  npmPackages:
    @vitejs/plugin-react: ^3.0.0 => 3.0.0
    vite: ^4.0.0 => 4.0.4

Used Package Manager
yarn
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

This is not a bug in Vite. Because vim.wasm (emscripten output) uses a dynamic url to fetch the .wasm/.data file, Vite cannot detect that and cannot bundle those files. It works in dev just because the files happens to be served where vim.wasm expects.
One workaround is to use Module.locateFile. But vim.wasm doesn't expose that function and we cannot use this function.
Another workaround is to use vite-plugin-static-copy and copy the .wasm/.data files to where vim.wasm expects.

authors: ayroblu sapphi-red


text:
postcss config is not reloaded on server.restart()

Describe the bug
editing postcss.config.js does not apply changes, even when there is a watcher that calls server.restart()
Reproduction
https://stackblitz.com/edit/vitejs-vite-yls5ef?file=postcss.config.js,vite.config.js&terminal=dev
Steps to reproduce
edit postcss.config.js in the reproduction, observe that console does not log load postcss config again even though it should
System Info
stackblitz vite.new + postcss

Used Package Manager
npm
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

vite load the postcss config by postcss-load-config，I think that import cache the file content, so that postcss can not get the new content of it.

one workaround is to not use postcss-load-config  but instead import postcss.config.js in vite config and pass it to css.postcss: https://stackblitz.com/edit/vitejs-vite-uwhqtw?file=postcss.config.js,vite.config.js&terminal=dev
But i don't know if there are things in postcss config that can't be bundled into the vite config and how it would work with dependencies like a browserslist file for autoprefixer...

@PengBoUESTC I noticed that you submitted a fix upstream. Does that mean that if we upgrade postcss-load-config it should also fix this issue?

@PengBoUESTC I noticed that you submitted a fix upstream. Does that mean that if we upgrade postcss-load-config it should also fix this issue?

yes , And I try to update the 'postcss-load-config' dep version of vite packages

Are there any known workarounds for this issue? I've cleared node_modules and browser cache... I'm still not getting updates in the compiled css.

authors: PengBoUESTC bkilrain bluwy dominikg


text:
"Error: 'default' is not exported by..." when building with .mjs files

Describe the bug
I am working on a pnpm workspace monorepo with a
 /packages/backend
 /packages/frontend
 /packages/shared

layout.
Vite builds fine when developing locally. The react apps renders without issue.
However, when I run vite build it fails when it tries to bundle react aria with the following error:
✓ 2581 modules transformed.
x Build failed in 8.62s
error during build:
RollupError: ../../node_modules/.pnpm/@react-aria+ssr@3.9.2_react@18.2.0/node_modules/@react-aria/ssr/dist/import.mjs (1:7): "default" is not exported by "../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js", imported by "../../node_modules/.pnpm/@react-aria+ssr@3.9.2_react@18.2.0/node_modules/@react-aria/ssr/dist/import.mjs".
file: /Users/wmonecke/Documents/Code/[project]/node_modules/.pnpm/@react-aria+ssr@3.9.2_react@18.2.0/node_modules/@react-aria/ssr/dist/import.mjs:1:7
1: import $73SJx$react, {useContext as $73SJx$useContext, useState as $73SJx$useState, useMemo as $73SJx$useMemo, useLay...

This error is very similar to this issue opened https://github.com/vitejs/vite/issues/2679
The solution there is to do this:
 build: {
      commonjsOptions: {
        include: ['@[project]/shared'],
        exclude: [/@react-aria/],
      },
    },

but it still fails.
Any ideas how to bundle .mjs files?
Reproduction
r
Steps to reproduce
No response
System Info
System:
    OS: macOS 14.1.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 73.55 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 9.0.2 - ~/Library/pnpm/pnpm
    Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 124.0.6367.60
    Safari: 17.1
  npmPackages:
    @vitejs/plugin-react: ^4.2.1 => 4.2.1
    vite: ^5.2.10 => 5.2.10

Used Package Manager
pnpm
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

I suspect this is an issue when pnpm is used in a vite project.
@wmonecke - please try deleting node_modules and reinstalling using npm and not pnpm just check my theory.

authors: wmonecke yairEO


text:
fix: resolve browser field in package.json

Fix: https://github.com/vitejs/vite/issues/294

FYI ce3ec6c

Also for the case of styled-components, the only difference between its esm and browser.esm builds is the presence of process.env.NODE_ENV checks, which Vite already handles.


text:
Implement sha256 encoding/decoding

Extension funs for encoding and decoding strings

Implement validation fun for blockchain model

repo: vitekkor/spring-blockchain


text:
Allow assigning new hotContext

When I try to use TailwindCSS with SSR on vite-node, I got this error
/src/client/base.css:2
__vite_ssr_import_meta__.hot = __vite_ssr_import_0__.createHotContext("/src/client/base.css");const __vite_ssr_import_1__ = await __vite_ssr_import__("/@vite/client");
                             ^

TypeError: Cannot set property hot of #<Object> which has only a getter
    at /src/client/base.css:1:94
    at ViteNodeRunner.directRequest
   ...

This patch fixed it

Sure, I added a regression for vite-node. Simply importing a css file cause the crash without this PR.
❯ cd test/vite-node && pnpm run dev

> @vitest/test-vite-node@ dev /home/comet/Workspace/src/github.com/vitest-dev/vitest/test/vite-node
> vite-node --watch ./src/*.ts

/home/comet/Workspace/src/github.com/vitest-dev/vitest/test/vite-node/src/deps.css:2
__vite_ssr_import_meta__.hot = __vite_ssr_import_0__.createHotContext("/src/deps.css");const __vite_ssr_import_1__ = await __vite_ssr_import__("/@vite/client");
                             ^

TypeError: Cannot set property hot of #<Object> which has only a getter
    at /home/comet/Workspace/src/github.com/vitest-dev/vitest/test/vite-node/src/deps.css:1:94
    at ViteNodeRunner.directRequest (file:///home/comet/Workspace/src/github.com/vitest-dev/vitest/packages/vite-node/dist/client.mjs:280:5)
    at ViteNodeRunner.cachedRequest (file:///home/comet/Workspace/src/github.com/vitest-dev/vitest/packages/vite-node/dist/client.mjs:146:14)
    at ViteNodeRunner.dependencyRequest (file:///home/comet/Workspace/src/github.com/vitest-dev/vitest/packages/vite-node/dist/client.mjs:181:14)
    at /home/comet/Workspace/src/github.com/vitest-dev/vitest/test/vite-node/src/deps.ts:1:31

repo: vitest-dev/vitest


text:
Layout with grid e html form in popuop

Hy all,
Sorry if i ask here but i don't know where i can ask information about this.
I have a problem i want to open a grid and a form in a popup but there are two problems, first i can't use url: method in grid but i must use w2ui['nameGrid'].load because url doesn't allow sort and search, but how can i config the grid and after says to the parse to load url of the grid?
The same thing must be done with the form i must load a php url to load the form, so the layout must have two sections, in the left the grid and in the right the form, but the form and the grid must be loaded with a php url.
At the end when i do click at one record of the grid must do an ajax call to populate the form and this is ok, ajax call at click record....But the problem is to load php url for grid without using the url: method in grid but the load method.
To be more specific this is what work
var config = {
    layout: {
        name: 'layout',
        padding: 4,
        panels: [
            { type: 'left', size: '50%', resizable: true, minSize: 300 },
            { type: 'main', minSize: 300 }
        ]
    },
    grid: {
        name: 'grid',
        url : 'MYPHP.PHP',//I CAN'T USE THIS I MUST USE w2ui['grid'].load('MYPHP.PHP')
        columns: [
            { field: 'fname', caption: 'First Name', size: '33%', sortable: true, searchable: true },
            { field: 'lname', caption: 'Last Name', size: '33%', sortable: true, searchable: true },
            { field: 'email', caption: 'Email', size: '33%' },
            { field: 'sdate', caption: 'Start Date', size: '120px', render: 'date' }
        ],
        onClick: function(event) {
            var grid = this;
            var form = w2ui.form;
            event.onComplete = function () {
                var sel = grid.getSelection();
                if (sel.length == 1) {
                    form.recid  = sel[0];
                    form.record = $.extend(true, {}, grid.get(sel[0]));
                    form.refresh();
                } else {
                    form.clear();
                }
            }
        }
    },
    form: {
        header: 'Edit Record',
        name: 'form',
        fields: [
            { name: 'recid', type: 'text', html: { caption: 'ID', attr: 'size="10" readonly' } },
            { name: 'fname', type: 'text', required: true, html: { caption: 'First Name', attr: 'size="40" maxlength="40"' } },
            { name: 'lname', type: 'text', required: true, html: { caption: 'Last Name', attr: 'size="40" maxlength="40"' } },
            { name: 'email', type: 'email', html: { caption: 'Email', attr: 'size="30"' } },
            { name: 'sdate', type: 'date', html: { caption: 'Date', attr: 'size="10"' } }
        ],
        actions: {
            Reset: function () {
                this.clear();
            },
            Save: function () {
                var errors = this.validate();
                if (errors.length > 0) return;
                if (this.recid == 0) {
                    w2ui.grid.add($.extend(true, { recid: w2ui.grid.records.length + 1 }, this.record));
                    w2ui.grid.selectNone();
                    this.clear();
                } else {
                    w2ui.grid.set(this.recid, this.record);
                    w2ui.grid.selectNone();
                    this.clear();
                }
            }
        }
    }
};

$(function () {
    // initialization in memory
    $().w2layout(config.layout);
    $().w2grid(config.grid);
    $().w2form(config.form);
});

function openPopup() {
    w2popup.open({
        title   : 'Popup',
        width   : 900,
        height  : 600,
        showMax : true,
        body    : '

',
        onOpen  : function (event) {
            event.onComplete = function () {
                $('#w2ui-popup #main').w2render('layout');
                w2ui.layout.content('left', w2ui.grid);
                w2ui.layout.content('main', w2ui.form);
            };
        },
        onToggle: function (event) {
            event.onComplete = function () {
                w2ui.layout.resize();
            }
        }
    });
}

Hy all,
Sorry problem resolved, maybe yesterday i was tired and i didn0t find the solution :)
just use w2ui['grid'].load('myphp.php') inside the onOpen popup method... :)
You can see the example here clicking on the button open popup....Bye can close this topic....
https://fractalcosmo.com/MvcWebLog/paginaDefault.php
var config = {
    layout: {
        name: 'layout',
        padding: 4,
        panels: [
            { type: 'left', size: '50%', resizable: true, minSize: 300 },
            { type: 'main', minSize: 300 }
        ]
    },
    gridVersione143: {
        name: 'gridVersione143',
        header : '
Esempio Dati w2ui Versione 1.4.3
',
        multiSelect : true,
        fixedBody : false,
        msgNotJSON: '
Non ci sono validi risultati
',
        show: {
            header       : true,
            toolbar      : true,
            footer       : false,
            lineNumbers  : false,
            selectColumn : true,
            expandColumn : false,
            toolbarColumns : false,
	        toolbarSearch : true,
			toolbarReload : false,
        },
        toolbar : {items:[
	              { type: 'button',  id: 'itemVariazione',  caption: 'Variazione Residenza', icon: 'glyphicon glyphicon-edit', hint: 'Variazione Residenza' },
	        ],
	        onClick: function (event) {
	        	if (event.target == 'itemVariazione'){
	        		variazioneDatoResidenza(arrayValori);
	        	}
	        },
	    },
        columns: [
            { field: 'nome', caption: '
Nome
', sortable:true,size:'10%',attr: 'align=center' },
            { field: 'cognome', caption: '
Cognome
',sortable:true,size:'10%',attr: 'align=center'},
            { field: 'dataNascita', caption: '
Data Nascita
',sortable:true,size:'5%',attr: 'align=center',render: 'date:dd/mm/yyyy' },
            { field: 'cittaResidenza', caption: '
Città Residenza
', sortable:true,size:'20%',editable: { type: 'text',style: 'background-color: #ffcccc' } },
        ],
        searches: [
            { type: 'text', field: 'nome', caption: 'Nome',operator:'contains' },
            { type: 'text', field: 'cognome', caption: 'Cognome',operator:'contains' },
            { type: 'text', field: 'dataNascita', caption: 'Data Nascita',operator:'contains' },
            { type: 'text', field: 'cittaResidenza', caption: 'Città Residenza',operator:'contains' },
	    ],
        onChange: function(event){
        	event.onComplete = function(event) {
        		$(window).click(function(event){
					$('.w2ui-changed').each(function(event){
					  	$('.w2ui-changed').css('color','red');
					});
        		});
        	};
        },
        onRefresh:function(event){
        	event.onComplete=function(event){
        		$('#grid_gridVersione143_check_all').hide();
        		//Inseriamo un title sulla input ricerca
        		$('#grid_gridElencoToDo_search_all').attr('title','Tutte le colonne sono ordinabili e ridimensionabili');
        		records = this.records;
        		colonne = this.columns;
    			totaleRisultati = this.totaleRisultati;
				console.log(totaleRisultati);
        		//Inseriamo l'icona di sort al refresh ready della tabella per dare un feedback all'operatore
        		$(colonne).each(function(event){
        			$("td:contains('Nome')").find($('.w2ui-col-header > div')).eq(0).addClass('w2ui-sort-up');
        			$("td:contains('Cognome')").find($('.w2ui-col-header > div')).eq(0).addClass('w2ui-sort-up');
        			$("td:contains('Data')").find($('.w2ui-col-header > div')).eq(0).addClass('w2ui-sort-up');
        			$("td:contains('Residenza')").find($('.w2ui-col-header > div')).eq(0).addClass('w2ui-sort-up');
        		});

        	};
        },
        onLoad:function(event){

			var response = [];
			var responseText = (event.xhr.responseText);
			//console.log(responseText);
			response = responseText.match(/{.*(.*)\}/);

			if (response != null){
				var finale = response[0];
				var arrayFinale = JSON.parse(finale);
				var nazione = arrayFinale.nazione;
				var nazionalita = arrayFinale.nazionalita;
    			var totaleRisultati = arrayFinale.totaleRisultati;
				console.log(totaleRisultati);
				console.log(nazione);
				console.log(nazionalita);
				var records = arrayFinale.records;
				$(records).each(function(event){

				});
			}
        },
        onEditField:function(event){
        	//console.log(event);
        	//console.log(this);
        	event.onComplete=function(event){
        		//console.log(this);
        		//console.log(event);
        		id = event.recid;
				$('#grid_gridVersione143_edit_'+id+'_3').keypress(function(event){
					 return noNumeri(event);
				});
				$('#grid_gridVersione143_edit_'+id+'_3').blur(function(event){
						stringa = this.value;
						repStringa = (stringa.replace(/[^a-zA-Z ]/g, ""));
						$('#grid_gridVersione143_edit_'+id+'_3').val(repStringa);
				});
        	};
    		$('.w2ui-changed').each(function(event){
			  	$(this).css('color','red');
			});
        },
        onSelect : function (event){
        	target = event.target;

			//Oltre i 5 record selezionati blocchiamo con un unselect la possibilità di selezionare altri record
			$.fn.bloccaSelezione = function(event){
				var record = event.recid;
        		w2ui['gridVersione143'].unselect(record);
			};

        	event.onComplete = function(event) {
        	   //La getSelection ritorna le checkbox selezionate
		       sel = this.getSelection();
		       //console.log(sel);
		       arrayValori = [];

		       if (sel.length == 0){
					w2ui['gridVersione143'].toolbar.disable('itemVariazione');
		       }
			   else{
					w2ui['gridVersione143'].toolbar.enable('itemVariazione');
			   }

		       if (sel.length > 5){
				  $(this).bloccaSelezione(event);
				  return;
		       }

	           target = w2ui[target];
		       //Sull'Unselect dobbiamo aggiornare l'array
		       for (i=0; i < sel.length;i++){
		       	  //console.log(w2ui[target]);
		          recidRecord = sel[i];
		          //console.log('recid record :'+recidRecord);
		          records = target.records;
		          //console.log(records);
		          $(records).each(function(){
		          	recidTarget = this.recid;
	          		if (recidTarget == recidRecord){
		          		 //console.log(this);
						 recid = $.trim(this.recid);
						 id = $.trim(this.id);
						 nome= $.trim(this.nome);
						 cognome = $.trim(this.cognome);
						 dataNascita = $.trim(this.dataNascita);
						 cittaResidenza = $.trim(this.cittaResidenza);
						 arrayValori.push({recid:recid,id:id,nome:nome,cognome:cognome,dataNascita:dataNascita,cittaResidenza:cittaResidenza});
	          		}
		          });
		       }

		    };
    	},
        onUnselect : function(event){
			target=event.target;
			event.onComplete = function(event) {
			    sel = this.getSelection();
			   	arrayValori = [];
		        if (sel.length == 0){
					w2ui['gridVersione143'].toolbar.disable('itemVariazione');
		        }
			    else{
					w2ui['gridVersione143'].toolbar.enable('itemVariazione');
			    }
	           target = w2ui[target];
		       //Sull'Unselect dobbiamo aggiornare l'array
		       for (i=0; i < sel.length;i++){
		       	  //console.log(w2ui[target]);
		          recidRecord = sel[i];
		          //console.log('recid record :'+recidRecord);
		          records = target.records;
		          //console.log(records);
		          $(records).each(function(){
		          	recidTarget = this.recid;
	          		if (recidTarget == recidRecord){
		          		 //console.log(this);
						 recid = $.trim(this.recid);
						 id = $.trim(this.id);
						 nome= $.trim(this.nome);
						 cognome = $.trim(this.cognome);
						 dataNascita = $.trim(this.dataNascita);
						 cittaResidenza = $.trim(this.cittaResidenza);
						 arrayValori.push({recid:recid,id:id,nome:nome,cognome:cognome,dataNascita:dataNascita,cittaResidenza:cittaResidenza});
	          		}
		          });
		       }
			};
    	},
    	onClick:function(event){
        	event.onComplete = function(event) {
	    		id = event.recid;
	    		//console.log(id);
	    		$.ajax({
				        method : "POST",
				        url : "prove.php",
				        dataType : "html",
				        data : {
				            list : 'SI',
				        },
				        success : function(risposta){
				            w2alert(risposta);
				        },
				        error : function(){
				            alert('Errore di comunicazione con il Server');
				        }
	    		});
	    		selezione = this.get(event.recid);
	    		nome = selezione.nome;
	    		cognome = selezione.cognome;
	    		cittaResidenza = selezione.cittaResidenza;
	    		dataNascita = selezione.dataNascita;
	    		$('#nome').val(nome);
	    		$('#cognome').val(cognome);
	    		$('#cittaResidenza').val(cittaResidenza);
	    		$('#dataNascita').val(dataNascita);
	       		$('#grid_gridVersione143_rec_'+id).find('td').eq(4).click();
        	};
    	},
		onError:function(event){
			event.preventDefault();
			numeroErrore = event.message.errore;
			if (numeroErrore == '99'){
			  	div = $('
').html('Nessun dato Presente

');
				$('#panelRisultatiVersione143').append(div);
			}
		},
    },
    form: {
        header: 'Edit Record',
        name: 'form',
        fields: [
            { name: 'nome', type: 'text', required: true, html: { caption: 'Nome', attr: 'size="40" maxlength="40"' } },
            { name: 'cognome', type: 'text', required: true, html: { caption: 'Cognome', attr: 'size="40" maxlength="40"' } },
            { name: 'dataNascita', type: 'text', html: { caption: 'Data Nascita', attr: 'size="10"' },render: 'date:dd/mm/yyyy' },
            { name: 'cittaResidenza', type: 'text', html: { caption: 'Residenza', attr: 'size="30"' } }
        ],
        actions: {
            Reset: function () {
                this.clear();
            },
            Save: function () {
                var errors = this.validate();
                if (errors.length > 0) return;
                if (this.recid == 0) {
                    w2ui.gridVersione143.add($.extend(true, { recid: w2ui.gridVersione143.records.length + 1 }, this.record));
                    w2ui.gridVersione143.selectNone();
                    this.clear();
                } else {
                    w2ui.gridVersione143.set(this.recid, this.record);
                    w2ui.gridVersione143.selectNone();
                    this.clear();
                }
            }
        }
    }
};

$(function () {
    // initialization in memory
    $().w2layout(config.layout);
    $().w2grid(config.gridVersione143);
    $().w2form(config.form);
});

function openPopup() {
    w2popup.open({
        title   : 'Popup',
        width   : 900,
        height  : 600,
        showMax : true,
        body    : '

',
        onOpen  : function (event) {
            event.onComplete = function () {
                $('#w2ui-popup #main').w2render('layout');
                w2ui.layout.content('left', w2ui.gridVersione143);
                w2ui.layout.content('main', w2ui.form);
                w2ui['gridVersione143'].load('esempiW2ui.php?versione=griglia143');
            };
        },
        onToggle: function (event) {
            event.onComplete = function () {
                w2ui.layout.resize();
            };
        }
    });
}

javascript

I resolved so i go to close this issue, in form object use formURL to define the php url that load the form instead in grid define w2ui['namegrid'].load('url.php') after the $('#layout').w2render('layout') and the game is done...
Bye


text:
Working of Tan, yang and Choudhury et al.

Hi!
Firstly, this is a great repository you have compiled and I really appreciate your effort in matlab implementations. They are of great help to get started on the area.
While running the codes, I could not find a method to run the following codes:

Tan et al 2005
Choudhury et al 2005
Yang et al 2010

There are reference to variable 'src' but it is not the imread variable; unless I am missing something. Can you please guide on how to run these implementations? Any examples would be great.
Thanks.

Hello Atif,
I agree it's a bit confusing right now - but it's because originally I did a "literal translation" of the original codes to MATLAB. I will change it soon in a future commit to make it simpler.
So, as of right now (state of current commit in master branch of this repo, vitorsr/SIHR):

Tan's main function call is [src,sfi,diff] = z.zHighlightRemoval(fname), where fname is the complete filename with path to the image, and [src,sfi,diff] are double-valued source, pseudo specular-free and diffuse output images.
Yang's is dst = qx_highlight_removal_bf(src), both double-valued images.
I did not implement the trilateral filter (assuming that's what you mean by Choudhury 2005), don't know how can I help you with that since it's outside the scope of this repo.

Thanks for the replies. Got both Tan and yang's code running now.
Also, I saw the link to the trilateral implementation in the readme; which initially I had assumed it was related to specular highlights, which was an oversight on my part.
I hope to be looking more into these papers and if I am able to update them, I will gladly submit them for a merge here. Thanks again for compiling this repo!

Thank you. I am a bit busy this semester so I'm not able to devote much time to add or implement more codes. Any help is appreciated.

authors: Atif-Anwer vitorsr

repo: vitorsr/SIHR


text:
clusters: add support to retrieve unregistered clusters

Reference: https://petstore.swagger.io/?url=https://raw.githubusercontent.com/openshift/assisted-service/master/swagger.yaml#/installer/v2ListClusters
Given a valid API Token
When Using a module, e.g. assitedinstaller.clusters
Then Retrieve the cluster info when the query parameter get_unregistered_clusters is set to true and save the response
NOTE: Follow the PR at link #10 and #20 to help understand what needs to be implemented.

@vjayaramrh Can you clarify whether to specify cluster_id or not? There are 2 endpoints which accepts param get_unregistered_clusters i.e.

GET /v2/clusters Retrieves the list of OpenShift clusters.
GET /v2/clusters/{cluster_id} Retrieves the details of the OpenShift cluster.

@vjayaramrh Can you clarify whether to specify cluster_id or not? There are 2 endpoints which accepts param get_unregistered_clusters i.e.
* GET `/v2/clusters` Retrieves the list of OpenShift clusters.

* GET `/v2/clusters/{cluster_id}` Retrieves the details of the OpenShift cluster.

For now, Maybe we can skip the cluster_id.

authors: pawanpinjarkar vjayaramrh

repo: vjayaramrh/assistedinstaller


text:
Transparentize! ¯_(ツ)_/¯

Fix for https://github.com/vjeantet/hugo-theme-docdock/pull/59

Thanks for fixing that for me, I should have tested with node-sass before!
I also like the way you've line split things, I'll need to do more of that to the rest of the doc.

authors: Pilskalns W-Floyd

repo: vjeantet/hugo-theme-docdock


text:
Added code for crawling pages + history + uploading files middleware

Result of the work:
website_2023-06-20T19-11-31.csv
(Already implemented but not in the result: do not save any content if it already exits in a database, there will one add. column-pointer referencing last id with the same content // Relevant for snapshots)
Also the directory for the crawler is now of the main directories, so you shouldn't install scrapy for the whole project just in case you would like to try/test the crawlers

So @sinan43e hier sind die Stichpunkte für die Dokumentation des Projektes (Comments für den Code folgen später):

Es steht einen "Meta"-Spider zur Verfügung, der eine Aggregator-Website abfragt und die Daten an eine MongoDB Instanz (Cloud) speichert. Hier sind nur die Meta-Informationen von einem Website, wie z.B. Adresse, Website, Beschreibung, Stadt usw. / Zum Verständis dieser Spider kommt als erstes in Spiel und muss von anderen (weiteren Spiders oder Crawlers) unabhängig funktionieren. Die Relation besteht nur in der Datenbank, also z.B. zwischen Meta und dem realten Content von einer Website.

Als weiteres wurde einen Crawler (etwas allgemeiner als Spider definiert, da es alles mögliche aus einer Seite zieht) geschrieben, der aus den (möglich) komplexen HTML-Strukturen nur Text extrahiert und an der Stellen, wo es sich um verschiedene HTML - Entities handelt, einen speziellen Separator hinzufügt.

Die Logik von dem Crawler (ohne WebArchive) ist folgende -> Man verfügt über eine Startseite von einem Restaurant und es werden alle URLs gesucht und diese Links werden gesammelt, um es weiter zu iterieren. Man kann es als Baum vorstellen, wobei der Wurzel die Startpage ist und die Nachfolger sind die weitere Pages, die zu dem Domain gehören (aber nicht immer).
FYI: Das heißt, dass zu einer Startpage kann sehr viele GET-Request entstehen, da ab und zu die Restaurants eine komplexe HTML-Struktur, sprich viele Nachvolger Seiten, haben können. (Kann man das kontrollieren und reduzieren?)
Das Rumhopsen von einem zu dem anderen Domain kann zu einer unvorsehbarer Anzahl von Requests führen, daher wird es in einem Middleware von Scrapy begrenzt.
Also, im Allgemeinem sind die Redirects und das Wechseln  von einem Start-Domain ist nicht erlaubt, außer es sich um irgendwelche FileStorages handelt, z.B. Speisenkarten in PDFs, Docs oder Bilder.

Das ist zudem ein komplexer Crawler, da wir uns gezielt haben, mögliche historische Daten mitzunehmen. Das wird erreicht, dass man jede bekannte Website (die aus dem ersten Spider bekommen wurde) um eine Webarchive-Struktur umgewandelt wird.

Das funktioniert als folgende:

Unser Crawler macht einen Request an eine Website, die aus dem ersten Spider gefunden wurde, z.B. www.meenakumari.de ;
Jeder Get-Request wird in einer Scrapy-Middleware gecheckt und wenn es nicht mit einem Domain von "http://web.archive.org" anfängt, sprich die URL führt nicht zu einem Snapshot aus der Vergangenheit, wird eine Abfrage zu dem CDX API von der Website verformt .
In der nächsten GET-Request fragt man die API, wieviel Snapshot er zum Link www.meenakumari.de findet; das Ergebnis ist eine JSON-Struktur, die alle fuer WebArchive bekannte Snapshots (mit Datum wann es erzeugt wurde) beinhaltet, hier wäre dann die GUI Struktur http://web.archive.org/web/20230000000000*/www.meenakumari.de.
Diese Liste wird dann iteriert und so entstehen zu jeder initialen Web-Abrage an www.meenakumari.de genau die Anzahl von GET-Abfragen, soviel WebArchive Snapshots gespeichert hat. (Sicherlich das kann man reduzieren, wie?)

repo: vladislabv/gastronomic-intelligence-hub


text:
[Bug]: OpenAI compatible server with HuggingFaceTB/SmolVLM-Instruct resulting in 500 Internal Server error

Your current environment

The output of `python collect_env.py`
PyTorch version: 2.5.1+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 23.10 (x86_64)
GCC version: (Ubuntu 13.2.0-4ubuntu3) 13.2.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.38

Python version: 3.10.15 (main, Oct  3 2024, 07:27:34) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.5.0-44-generic-x86_64-with-glibc2.38
Is CUDA available: True
CUDA runtime version: 12.0.140
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 4090
GPU 1: NVIDIA GeForce RTX 4090
GPU 2: NVIDIA GeForce RTX 4090
GPU 3: NVIDIA GeForce RTX 4090

Nvidia driver version: 535.171.04
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      48 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             32
On-line CPU(s) list:                0-31
Vendor ID:                          AuthenticAMD
Model name:                         AMD Ryzen Threadripper PRO 5955WX 16-Cores
CPU family:                         25
Model:                              8
Thread(s) per core:                 2
Core(s) per socket:                 16
Socket(s):                          1
Stepping:                           2
Frequency boost:                    enabled
CPU(s) scaling MHz:                 47%
CPU max MHz:                        7031.2500
CPU min MHz:                        1800.0000
BogoMIPS:                           7985.24
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin brs arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization:                     AMD-V
L1d cache:                          512 KiB (16 instances)
L1i cache:                          512 KiB (16 instances)
L2 cache:                           8 MiB (16 instances)
L3 cache:                           64 MiB (2 instances)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-31
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Vulnerable: Safe RET, no microcode
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-ml-py==12.560.30
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] pyzmq==26.2.0
[pip3] torch==2.5.1
[pip3] torchvision==0.20.1
[pip3] transformers==4.46.3
[pip3] triton==3.1.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-cublas-cu12        12.4.5.8                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.4.127                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.2.1.3                 pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.5.147               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.6.1.9                 pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.3.1.170               pypi_0    pypi
[conda] nvidia-ml-py              12.560.30                pypi_0    pypi
[conda] nvidia-nccl-cu12          2.21.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.4.127                 pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.4.127                 pypi_0    pypi
[conda] pyzmq                     26.2.0                   pypi_0    pypi
[conda] torch                     2.5.1                    pypi_0    pypi
[conda] torchvision               0.20.1                   pypi_0    pypi
[conda] transformers              4.46.3                   pypi_0    pypi
[conda] triton                    3.1.0                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.4.post1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0	GPU1	GPU2	GPU3	CPU Affinity	NUMA Affinity	GPU NUMA ID
GPU0	 X 	SYS	SYS	SYS	0-31	0		N/A
GPU1	SYS	 X 	SYS	SYS	0-31	0		N/A
GPU2	SYS	SYS	 X 	SYS	0-31	0		N/A
GPU3	SYS	SYS	SYS	 X 	0-31	0		N/A

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

LD_LIBRARY_PATH=/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/cv2/../../lib64:
CUDA_MODULE_LOADING=LAZY

Model Input Dumps
No response
🐛 Describe the bug
Trying to run the HuggingFaceTB/SmolVLM-Instruct as openapi-compatible server. The server is coming up but when trying to use the api, it is giving a 500 Internal Server Error. Attaching the code snippet and error stack trace below.
Model : https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct
Code:
from openai import OpenAI

openai_api_key = "abc"
openai_api_base = "http://localhost:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

# Function to encode the image
def encode_image(image_path):
  with open(image_path, "rb") as image_file:
    return base64.b64encode(image_file.read()).decode('utf-8')

# Path to your image
image_path = "e44324b2c031f6.jpg"

# Getting the base64 string
base64_image = encode_image(image_path)

# Single-image input inference
image_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"

try:
    chat_response = client.chat.completions.create(
        model="HuggingFaceTB/SmolVLM-Instruct",
        messages=[{
            "role": "user",
            "content": [
            # NOTE: The prompt formatting with the image token `<image>` is not needed
            # since the prompt will be processed automatically by the API server.
                {"type": "text", "text": "You are a helpful image captioner. Can you describe the image?"},
                {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_image}"}},
            ],
        }],
    )
    print("Chat completion output:", chat_response.choices[0].message.content)
except Exception as e:
    print(f"Error type: {type(e)}")
    print(f"Error message: {str(e)}")

Error on the openai compatible server
Traceback (most recent call last):
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/_utils.py", line 76, in collapse_excgroups
    yield
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/base.py", line 186, in __call__
    async with anyio.create_task_group() as task_group:
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 685, in __aexit__
    raise BaseExceptionGroup(
exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/base.py", line 185, in __call__
    with collapse_excgroups():
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/base.py", line 187, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/vllm/entrypoints/openai/api_server.py", line 490, in add_request_id
    response = await call_next(request)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/base.py", line 149, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/fastapi/routing.py", line 301, in app
    raw_response = await run_endpoint_function(
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/vllm/entrypoints/openai/api_server.py", line 347, in create_chat_completion
    generator = await handler.create_chat_completion(request, raw_request)
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/vllm/entrypoints/openai/serving_chat.py", line 238, in create_chat_completion
    return await self.chat_completion_full_generator(
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/vllm/entrypoints/openai/serving_chat.py", line 598, in chat_completion_full_generator
    async for res in result_generator:
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/vllm/utils.py", line 402, in iterate_with_cancellation
    item = await awaits[0]
  File "/home/rendernet/.conda/envs/vllm/lib/python3.10/site-packages/vllm/engine/multiprocessing/client.py", line 633, in _process_request
    raise request_output
TypeError: argument of type 'NoneType' is not iterable

Before submitting a new issue...

[X] Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Looks like the same error as https://github.com/vllm-project/vllm/issues/10764

repo: vllm-project/vllm


text:
[Bug]: ValueError: bytes must be in range(0, 256)

Your current environment
root@3b4826375ab0:/workspace# python collect_env.py
Collecting environment information...
PyTorch version: 2.1.2
Is debug build: False
CUDA used to build PyTorch: 12.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.4 LTS (ppc64le)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 14.0.0-1ubuntu1.1
CMake version: version 3.28.4
Libc version: glibc-2.35

Python version: 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 16:04:32) [GCC 12.3.0] (64-bit runtime)
Python platform: Linux-5.15.0-100-generic-ppc64le-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.2.91
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: Tesla V100-SXM2-32GB
GPU 1: Tesla V100-SXM2-32GB
GPU 2: Tesla V100-SXM2-32GB
GPU 3: Tesla V100-SXM2-32GB

Nvidia driver version: 535.161.07
cuDNN version: Probably one of the following:
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn.so.8
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-12.2/targets/ppc64le-linux/lib/libcudnn_ops_train.so.8
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False

CPU:
Architecture:                       ppc64le
Byte Order:                         Little Endian
CPU(s):                             128
On-line CPU(s) list:                0-127
Model name:                         POWER9, altivec supported
Model:                              2.2 (pvr 004e 1202)
Thread(s) per core:                 4
Core(s) per socket:                 16
Socket(s):                          2
Frequency boost:                    enabled
CPU max MHz:                        3800.0000
CPU min MHz:                        2300.0000
L1d cache:                          1 MiB (32 instances)
L1i cache:                          1 MiB (32 instances)
L2 cache:                           8 MiB (16 instances)
L3 cache:                           160 MiB (16 instances)
NUMA node(s):                       6
NUMA node0 CPU(s):                  0-63
NUMA node8 CPU(s):                  64-127
NUMA node252 CPU(s):
NUMA node253 CPU(s):
NUMA node254 CPU(s):
NUMA node255 CPU(s):
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Mitigation; RFI Flush, L1D private per thread
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Mitigation; RFI Flush, L1D private per thread
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Kernel entry/exit barrier (eieio)
Vulnerability Spectre v1:           Mitigation; __user pointer sanitization, ori31 speculation barrier enabled
Vulnerability Spectre v2:           Mitigation; Indirect branch serialisation (kernel only)
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] torch==2.1.2
[pip3] triton==2.1.0
[conda] cudatoolkit               11.8.0              hedcfb66_13    conda-forge
[conda] libmagma                  2.7.2                he288b6c_2    conda-forge
[conda] libmagma_sparse           2.7.2                h5b5c57a_3    conda-forge
[conda] magma                     2.7.2                h097a1ca_3    conda-forge
[conda] numpy                     1.24.3          py310h87cc683_0
[conda] numpy-base                1.24.3          py310hac71eb6_0
[conda] torch                     2.1.2                    pypi_0    pypiROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.3.3
vLLM Build Flags:
CUDA Archs: 7.0; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV3     SYS     SYS     0-63    0               N/A
GPU1    NV3      X      SYS     SYS     0-63    0               N/A
GPU2    SYS     SYS      X      NV3     64-127  8               N/A
GPU3    SYS     SYS     NV3      X      64-127  8               N/A

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

🐛 Describe the bug
from vllm import LLM, SamplingParams
prompts = [
    "Hello, my name is",
    "The president of the United States is",
    "The capital of France is",
    "The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)

llm = LLM(
    model="./models",
    dtype="float16",
    tensor_parallel_size=4,
    enforce_eager=False,
    trust_remote_code=True,
    load_format='safetensors'
)
outputs = llm.generate(prompts, sampling_params)

for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

if enforce_eager=False then i am getting the following error, but enforce_eager=True i am not getting any error as of this stage.
root@3b4826375ab0:/workspace# python3 example.py
WARNING 03-25 16:50:03 config.py:686] Casting torch.bfloat16 to torch.float16.
2024-03-25 16:50:06,721 INFO worker.py:1612 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265
INFO 03-25 16:50:09 llm_engine.py:68] Initializing an LLM engine (v0.3.3) with config: model='./models', tokenizer='./models', tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=True, dtype=torch.float16, max_seq_len=32768, download_dir=None, load_format=safetensors, tensor_parallel_size=4, disable_custom_all_reduce=True, quantization=None, enforce_eager=False, kv_cache_dtype=auto, device_config=cuda, seed=0)
Traceback (most recent call last):
  File "/workspace/example.py", line 10, in <module>
    llm = LLM(
  File "/root/vllm/vllm/entrypoints/llm.py", line 109, in __init__
    self.llm_engine = LLMEngine.from_engine_args(engine_args)
  File "/root/vllm/vllm/engine/llm_engine.py", line 146, in from_engine_args
    engine = cls(*engine_configs,
  File "/root/vllm/vllm/engine/llm_engine.py", line 103, in __init__
    self.model_executor = executor_class(model_config, cache_config,
  File "/root/vllm/vllm/executor/ray_gpu_executor.py", line 60, in __init__
    self._init_workers_ray(placement_group)
  File "/root/vllm/vllm/executor/ray_gpu_executor.py", line 190, in _init_workers_ray
    self._run_workers("init_device",
  File "/root/vllm/vllm/executor/ray_gpu_executor.py", line 318, in _run_workers
    driver_worker_output = getattr(self.driver_worker,
  File "/root/vllm/vllm/worker/worker.py", line 92, in init_device
    init_distributed_environment(self.parallel_config, self.rank,
  File "/root/vllm/vllm/worker/worker.py", line 276, in init_distributed_environment
    cupy_utils.init_process_group(
  File "/root/vllm/vllm/model_executor/parallel_utils/cupy_utils.py", line 90, in init_process_group
    _NCCL_BACKEND = NCCLBackendWithBFloat16(world_size, rank, host, port)
  File "/root/miniconda3/lib/python3.10/site-packages/cupyx/distributed/_nccl_comm.py", line 70, in __init__
    self._init_with_tcp_store(n_devices, rank, host, port)
  File "/root/miniconda3/lib/python3.10/site-packages/cupyx/distributed/_nccl_comm.py", line 93, in _init_with_tcp_store
    shifted_nccl_id = bytes([b + 128 for b in nccl_id])
ValueError: bytes must be in range(0, 256)

This is a bug of cupy, and we plan to remove cupy dependency with https://github.com/vllm-project/vllm/pull/3442 . Please stay tuned, or you can have a try using docker image built during CI of that PR, e.g. docker pull us-central1-docker.pkg.dev/vllm-405802/vllm-ci-test-repo/vllm-test:a3c2340ae36ce8ee782691d30111377eaf7ae6ce .
Feedback is welcome!

Thanks, I can directly use that hash and build from source right? My system is ppc64le, is there any vllm docker container for that architecture ?

This docker image already has a good vllm installation, you can directly use it. Or you can customize the Dockerfile to build it again in your architecture, say ppc64le. Although not sure if nccl supports your OS architecture 👀

yes it supports. i see i get an warning type of message, prompting me to install nccl, through conda. conda install -y -c conda-forge nccl. After installing it, i didn't get any error/warning from the vllm but i still get the warn from nvidia
root@3b4826375ab0:/workspace# NCCL_DEBUG=INFO python3 example.py
3b4826375ab0:14697:14697 [0] NCCL INFO Bootstrap : Using eth0:172.17.0.2<0>
3b4826375ab0:14697:14697 [0] NCCL INFO NET/Plugin : dlerror=libnccl-net.so: cannot open shared object file: No such file or directory No plugin found (libnccl-net.so), using internal implementation

Then you are good to go 👍

authors: NavinKumarMNK youkaichao