Support wider set of platforms. Mobile? Web?

First off, thank you for creating this incredible Go library! I've recently discovered it and I'm a huge fan! I really like the approach of using OpenGL for platform-independent, high performance UI rendering, since it allows one to stay general and not to be constrained by each platform's UI toolkits. I've experimented with OpenGL UIs here.

Currently, it is cross platform in that it will run and look/behave the same on OS X, Linux and Windows. However, with relatively little work, it seems it could be expanded to support more platforms: mobile and perhaps even web.
First, let me be a little imprecise and describe OpenGL APIs in this way:

OpenGL 3.2 Core - "Largest" OpenGL API available. Available on most desktop platforms (OS X, Linux, Windows).
OpenGL ES 2.0 - Roughly speaking, a subset of OpenGL API (with minor deviations). Available on most mobile platforms (iOS, Android).
WebGL 1.0 - Roughly speaking, a subset of OpenGL ES 2.0 (with minor deviations). Available in all major browsers (Chrome, Safari, Firefox, Opera, IE).

OpenGL 3.2 Core API is currently used in gxui [1]. But with a few changes (outlined in considerations section), it's possible to reduce what it used so that it can mapped to WebGL API.
I wanted to see what it would take to get gxui to run in browsers (and see how it'd perform), so I made a quick little prototype tonight in just a few hours. Some screenshots:

Demo
Here's a demo you can try in your browser (no gzip compression on served assets, sorry):
http://dmitri.shuralyov.com/projects/gxui-tree/index.html
Approaches
There are two different approaches to supporting additional platforms that I can see.
First approach is to create additional drivers, similar to the existing gl one. This seems to be suggested in related issue #45.
Another approach, which is the one I've used so far, is a little different.
Since the three OpenGL APIs are similar enough, it's possible to create a Go package that has a single OpenGL-like API, but using build tags, it can have three different backend implementations depending on what is available on the given platform:

OpenGL 2.1 or 3.2 Core, etc., backend on desktops.
OpenGL ES backend on mobile devices.
WebGL backend in browser.

The github.com/shurcooL/gogl package used in my quick prototype is an example of that. It only has OpenGL 2.1 and WebGL backend implementations (incomplete), but adding OpenGL ES one would be trivial since it's a superset of WebGL. It's a WIP package with unpolished API, but I think the general approach is solid and can be turned into a production ready package.
Considerations
Here are some implementation details of the changes I needed to do to make gxui samples run in the browser.

glPolygonMode is not available in WebGL (since its implementation is very inefficient; a shame because it's useful for debugging). I commented it out since it was just a debugging feature.

Index buffers with uint32 types were used. It seems my WebGL implementation (latest stable Chrome on OS X) did not support that type, so I dropped it down to uint16 which worked well.

My WebGL implementation seemed not to support gl.UniformMatrix3fv calls with transpose equal to true, so I had to transpose the matrix before calling the gl func. I'm guessing the WebGL implementation opts to support fewer choices for performance reasons. It'd be better to avoid needless conversions between one format to the other when rendering.

WebGL fragment shaders require precision to be set, so I added this to all fragment shaders to allow them to compile under all OpenGL/WebGL versions:
#ifdef GL_ES
	precision lowp float;
#endif

5. Previous commits read the font directly from disk via `ioutil.ReadFile`. This can't work on all other platforms, so it's better to read from a virtual filesystem and each platform can provide that. It's no longer a problem since latest version embeds the font in code.

6. My existing `gogl` package happens to use a higher level-style API (similar to `x/mobile/gl`) with types like `*Texture` instead of `uint32`, and it favors using `int` over `int32` or `uint32` the way the low-level C-style `github.com/go-gl/gl/...` packages do. This is a design decision that is orthogonal to all other API changes, but it required me to make some changes like:

	```diff
	-framebuffer uint32
	-texture     uint32
	+framebuffer *gogl.Framebuffer
	+texture     *gogl.Texture
	```

	```diff
	-gl.DeleteFramebuffers(1, &f.framebuffer)
	-gl.DeleteTextures(1, &f.texture)
	-f.framebuffer = 0
	-f.texture = 0
	+gl.DeleteFramebuffer(f.framebuffer)
	+gl.DeleteTexture(f.texture)
	+f.framebuffer = nil
	+f.texture = nil
	```

	```diff
	-gl.Viewport(0, 0, int32(fw), int32(fh))
	-gl.Scissor(0, 0, int32(fw), int32(fh))
	+gl.Viewport(0, 0, fw, fh)
	+gl.Scissor(0, 0, fw, fh)
	```

7. Consts like `gl.TRIANGLE_STRIP` are not const on all platforms. For example, to get that value in a browser, you either need to create a WebGLContext first (which can't be done at const-time), or just hardcode the const value from spec. I went with the latter for now.

You can see the entire code change I made at https://github.com/shurcooL/gxui/commit/469940010c8be6abd4feb535ba14a8b4e707720d. Keep in mind it's a quick prototype to test what it would take, and not a fully finished and polished version.

The performance of the web version (with Go compiled to JavaScript via [GopherJS](https://github.com/gopherjs/gopherjs)) is not as good as the desktop version with native Go. I am seeing around 20 fps. This is the result I got after doing the minimum work required to get samples to run without any profiling or optimizations. I am sure the performance can be improved if time is spent on it.

## Conclusion

With just a few changes (do not use transpose `true`, use `uint16` type for index buffers, etc.) it is possible to avoid using OpenGL-only features that are not available in OpenGL ES and WebGL. Doing that seems like a good idea as it enables `gxui` to be more cross platform.

This issue is to demonstrate what I've created. I'd love to hear feedback and thoughts. If you are interested, I'd love to help out with adding support for mobile and/or web and taking this prototype further.

---

[1] The imported package is `v3.2-core/gl`, so that's the API used, but since context version glfw hints are not set, it creates an OpenGL 2.1 context. Add this snippet after `gl.Init()` call to confirm:

```Go
{
	var samples int32
	gl.GetIntegerv(gl.SAMPLES, &samples)
	fmt.Printf("OpenGL %s %s %s; %s; %v samples.\n", gl.GoStr(gl.GetString(gl.VENDOR)), gl.GoStr(gl.GetString(gl.RENDERER)), gl.GoStr(gl.GetString(gl.VERSION)),
		gl.GoStr(gl.GetString(gl.SHADING_LANGUAGE_VERSION)), samples)
}

On my Mac, I got OpenGL ATI Technologies Inc. AMD Radeon HD 6770M OpenGL Engine 2.1 ATI-1.30.5; 1.20; 4 samples.. OpenGL 2.1.

@shurcooL - wow. That's a might impressive demo you have there.

OpenGL 3.2 Core API is currently used in gxui [1]. But with a few changes (outlined in considerations section), it's possible to reduce what it used so that it can mapped to WebGL API.

This was a consideration I always had - I intentionally tried to keep the GL API to something that was relatively close to GLES 2 (and therefore, WebGL). Its great to see that you've proved the migration wasn't too hard.

 She had no idea what she was looking at, but I know she recognized it as figgin cool as I'd normally get punched for waking her that early on a Saturday.

Since the three OpenGL APIs are similar enough, it's possible to create a Go package that has a single OpenGL-like API, but using build tags, it can have three different backend implementations depending on what is available on the given platform

I like this idea - it doesn't stop us building new drivers for non-gl target either.

glPolygonMode is not available in WebGL (since its implementation is very inefficient; a shame because it's useful for debugging). I commented it out since it was just a debugging feature.

No worries on this - it's put behind a false conditional anyway. If we wanted to keep it, we could put a function behind a +build rule, and stub the unsupported platforms.

Index buffers with uint32 types were used. It seems my WebGL implementation (latest stable Chrome on OS X) did not support that type, so I dropped it down to uint16 which worked well.

I think needing uint32 for indices is going to be pretty rare. I have no objections to making it uint16 by default.

My WebGL implementation seemed not to support gl.UniformMatrix3fv calls with transpose equal to true, so I had to transpose the matrix before calling the gl func.

This surprised me, and I was even more surprised to find that actually this is completely correct behaviour. The GLES 2 spec (on which WebGL is based) states:
The matrix is specified in column-major order. transpose must be FALSE.
We can just make the transpose flag false and then flip the order of multiplies in the the shader to be VEC * MAT.

WebGL fragment shaders require precision to be set, so I added this to all fragment shaders to allow them to compile under all OpenGL/WebGL versions:

low_p is probably too low for high resolution mobile displays. I'd also probably inject this based on a +build rule again - GLSL shader compilers are notoriously good at throwing wobblys over anything mildly foreign, even if it is perfectly legal. I'm actually amazed that I've not seen any shader compilation failure reports yet.

Previous commits read the font directly from disk via ioutil.ReadFile. This can't work on all other platforms, so it's better to read from a virtual filesystem and each platform can provide that. It's no longer a problem since latest version embeds the font in code.

Acknowledged. @crawshaw's solution is a great one, leaving this complication to the application developer. I don't believe complexities of virtual filesystems belong in a UI package.

My existing gogl package happens to use a higher level-style API (similar to x/mobile/gl) with types like *Texture instead of uint32, and it favors using int over int32 or uint32 the way the low-level C-style github.com/go-gl/gl/... packages do.

Go way, way, back to Wednesday and we were using go-gl-legacy which has a similar set of APIs. I actually really liked this interface, but in order to drop the GLEW dependency that was giving so many people grief we switched to go-gl/v3.2-core.
We could switch again, but I'm guessing @crawshaw might want to get involved in this discussion first.

Consts like gl.TRIANGLE_STRIP are not const on all platforms.

Really? Do you have any references to back this? I assume that's why you're copying all the GL constants into struct fields?

This issue is to demonstrate what I've created. I'd love to hear feedback and thoughts. If you are interested, I'd love to help out with adding support for mobile and/or web and taking this prototype further.

My thoughts are this is awesome and we should definitely discuss ways of making the gl driver more flexible to make this a thing. I'd like to wait for @crawshaw to share his thoughts, as he's been looking into what's involved in getting something running on mobile.

The imported package is v3.2-core/gl, so that's the API used, but since context version glfw hints are not set, it creates an OpenGL 2.1 context. Add this snippet after gl.Init() call to confirm:

Yeah, I kind of suspected this - I'll hold off making any changes until we figure out if we want to change GL libraries again.
Thank you Dmitri.

Nice.
You can tell I'm a supporter of a single GL ES 2 package that switches itself based on build tags. If you take a look at the internals of golang.org/x/mobile/gl, you'll see it is exactly that.
    https://github.com/golang/mobile/tree/master/gl

Right now it can be compiled (with no dependencies other than cgo+having GL installed on your system on) android, linux, iOS, OS X. It also deliberately hides all cgo types from the exported API, as I have long been wondering about a WebGL backend.
If you wanted to use that package I'd be willing to add conditional build targets for web. The other major piece of work is windows, which is https://github.com/golang/go/issues/9306.
The more interesting question is a unified input event library. I've been effectively writing my own glfw (which would be impressive if I had done windows, but I haven't yet). You can compile and run golang.org/x/mobile/app on linux+os x desktops, and input events are faked as touches.
In retrospect, it was probably a mistake to do this for desktop. What the mobile/app package should do is, for android/iOS what it does now, and on desktop, it should depend on a standard package that uses glfw.
That same standard package could be used by a gxui driver. It could use glfw on linux/mac/windows, and custom event code on gopherjs. Weirdly, on android/iOS it could use the app package. (That leads to a really weird state where it inverts its dependencies: on android gxwt depends on mobile/app, on desktop app depends on gxwt. But it will work, because the cycle never exists in a single build.)
Proposal

We expand golang.org/x/mobile/gl to support WebGL and windows, and use it in the GXUI driver.

We introduce a gowt package. It provides a pure-Go view of windowing events with no dependencies in its exported interface. It uses build tags to switch its implementations:
linux/windows/OS X: glfw
android/iOS: x/mobile/app
web: gopherjs?

I modify x/mobile/app to use gowt in its desktop configuration.

Thoughts?

What the mobile/app package should do is, for android/iOS what it does now, and on desktop, it should depend on a standard package that uses glfw.

This sounds ideal, but are you happy for golang.org/x/mobile to depend on libraries (directly or indirectly) outside of golang.org?

I modify x/mobile/app to use gxwt in its desktop configuration.

Similar question, where will gxwt be hosted?

Ideally there would be a golang.org/x/ui, which would host mobile/gl and gxwt. But we are a very long way from knowing what to put in there.
In the mean time, I would be happy to have github.com/google/gxui/gxwt. The mobile/app package would depend on it when compiling for desktop, but would not use it for its primary purpose, building apps. That seems fine to me.

Even if it's not used for its primary purpose, you'd still end up with go get golang.org/x/mobile pulling projects from github though, right? Are there any other external dependencies with golang.org projects?

|| Since the three OpenGL APIs are similar enough, it's possible to create a Go package that has a single || OpenGL-like API, but using build tags, it can have three different backend implementations depending || on what is available on the given platform
Is it good to have a gl.Api interface ?  so that we could implement it for GL, GLES, WebGL....

It's an acceptable dependency for the desktop development case. It does not introduce any notices or auditing burdens on apps, as that code will not be compiled (or even downloaded) when building for android/iOS. So gxui/gxwt is OK.

Thank you for the feedback. I'm really glad you liked this!  She had no idea what she was looking at, but I know she recognized it as figgin cool as I'd normally get punched for waking her that early on a Saturday.

Haha, thanks!

I think needing uint32 for indices is going to be pretty rare. I have no objections to making it uint16 by default.

Sounds good.

This surprised me, and I was even more surprised to find that actually this is completely correct behaviour. The GLES 2 spec (on which WebGL is based) states:
The matrix is specified in column-major order. transpose must be FALSE.
We can just make the transpose flag false and then flip the order of multiplies in the the shader to be VEC * MAT.

It's great that this is specified in the spec. However, I cannot find that statement in the OpenGL ES 2.0 spec, not WebGL 1.0 or 2.0 specs. Your link points to WebGL 2.0 spec (not yet implemented by most browsers), and I don't see it there either.
In any case, this is no longer an issue since it's been changed to use false in google/gxui@597c9ea32bd859b64c65ed3cc6572e92101f8135.

low_p is probably too low for high resolution mobile displays.

I'm okay with that, we can use mediump or highp. I've used the lowest setting (highest performance) as an initial starting point, and I'm ready to increase it as soon as I notice precision issues. It just needs to be set to some value for the shader to compile in WebGL.

Go way, way, back to Wednesday and we were using go-gl-legacy which has a similar set of APIs. I actually really liked this interface, but in order to drop the GLEW dependency that was giving so many people grief we switched to go-gl/v3.2-core.
We could switch again, but I'm guessing @crawshaw might want to get involved in this discussion first.

I've seen that commit, and I think it's great you moved off of go-gl-legacy/gl, thus making this package go-gettable without manual GLEW installation being required.
The main change/advantage of go-gl/gl/... over go-gl-legacy/gl is that the former is go-gettable. I am fairly certain the type change was not a deliberate change. It's just that go-gl/gl/... packages are automatically generated via glow from XML specs for OpenGL, and so they follow the C spec quite closely. But at the time, we likely did not know which API style is best in the long run, so I think the existing go-gl/gl/... API is a starting point that can evolve if needed.
(Please also note that packages in go-gl organization have been around since many years ago, and the goal has always been to make it easier for Go developers to use OpenGL and related tech. This was way before more official efforts like x/mobile/gl came around. As such, the packages in go-gl are always looking for a better home as more official Go packages and can be modified as needed. Don't think of them as something that cannot be changed and needs to be reinvented.)

Consts like gl.TRIANGLE_STRIP are not const on all platforms.

Really? Do you have any references to back this? I assume that's why you're copying all the GL constants into struct fields?

Sorry, let me rephrase that in a less confusing way.
Due to implementation details of the WebGL backend, constant values such as TRIANGLE_STRIP and others are not available as Go constants. This is because they are fetched from the existing WebGLContext which is created later on. The desktop OpenGL packages tend to hardcode the constants from the OpenGL spec rather than fetching them dynamically from the OpenGL context. They are still constant values (as defined by the spec).
Because gxui tries to define them as Go consts, it couldn't work.
My suggestion here is the following. Either use gl.TRIANGLE_STRIP directly if its value is needed. Otherwise, just use own constants like const (TRIANGLE_STRIP = iota; ...). I don't see the advantage of doing const TRIANGLE_STRIP = gl.TRIANGLE_STRIP.
But I think the WebGL backend should be changed to define them as consts, and this problem goes away.

My thoughts are this is awesome and we should definitely discuss ways of making the gl driver more flexible to make this a thing. I'd like to wait for @crawshaw to share his thoughts, as he's been looking into what's involved in getting something running on mobile.

I am really glad to hear this! This is exciting and I look forward to seeing this package become simpler and more cross platform.

You can tell I'm a supporter of a single GL ES 2 package that switches itself based on build tags.
Right now it can be compiled (with no dependencies other than cgo+having GL installed on your system on) android, linux, iOS, OS X. It also deliberately hides all cgo types from the exported API, as I have long been wondering about a WebGL backend.

If you wanted to use that package I'd be willing to add conditional build targets for web.

I think I'd be happy to use that package and add a web backend to it. That way it will support OS X, Linux, Windows (after golang/go#9306), iOS, Android and web.
My only reservation about it initially is that I didn't think it was go-gettable, unlike go-gl/gl/.... To me, having a Go package go-gettable (meaning there are no manual steps aside from go get -u; all Cgo dependencies are embedded) is extremely valuable, and once some functionality becomes go-gettable via some package, I refuse to "go back" to any other package that doesn't have this feature.
After looking at it more closely now, it appears that it doesn't require manual dependencies to be installed (at least on OS X), any more so than go-gl/gl/.... If so, that is excellent!

The more interesting question is a unified input event library. I've been effectively writing my own glfw (which would be impressive if I had done windows, but I haven't yet). You can compile and run golang.org/x/mobile/app on linux+os x desktops, and input events are faked as touches.

The key realization about GLFW is that its value is not in that it can create a window with OpenGL contexts and get input on OS X, Linux and Windows. That is the "easy" part - relatively speaking. The hard part is the maintenance and support of all idiosyncrasies of the platforms and versions it supports.
The goal of GLFW is to abstract out those platform differences, bugs and problems, and create as consistent an environment as possible for your application.
The Windows, Cocoa, X11 and other OS APIs are extremely unpleasant to work with and have tons of issues, undocumented features, bugs, etc. The development history of GLFW spans more than a decade. Just version 3.0+ of GLFW is already at 2423 commits, with 285 issues closed. Most of that work is about resolving those platform-specific issues. Supporting those platforms, and especially multiple versions, is a very large amount of work, and thus it's best to centralize it in once place. When there's a new issue that requires a workaround, it's best to have to fix it just in GLFW, rather than multiple libraries that are all equally affected. GLFW is free and open source, so I really don't see a good technical reason to avoid using it (aside from NIH, but that's not a good reason).
I like this blog post from Azul3D where it made the decision to drop a similar custom solution in favor of using GLFW.

In retrospect, it was probably a mistake to do this for desktop. What the mobile/app package should do is, for android/iOS what it does now, and on desktop, it should depend on a standard package that uses glfw.

The above is why I am very glad to hear this, and I fully support using GLFW (in the backend) for desktop rather than trying to replicate it! :)
It sounds very reasonable to use GLFW only for desktop (since that's what it supports), but the existing code for iOS and Android.
One additional (experimental) package that I used in making the above demo possible, that I haven't yet discussed, is:
github.com/shurcooL/goglfw

Package goglfw experimentally provides a glfw-like API with desktop (via glfw) and browser (via canvas) backends.

It is used for creating a GL context and receiving events.

Unstable, incomplete API: goglfw is currently in development. The API is incomplete and may change.

This package uses an approach similar to gogl. It effectively has two backends, one for desktop (OS X, Linux, Windows), and it's simply a copy of glfw. The other backend uses HTML5 APIs to implement the same glfw interface.
For instance, it uses things like document.AddEventListener("keydown", ...) to implement the SetKeyCallback, "mousedown" and "mouseup" event listeners to implement SetMouseButtonCallback, "wheel" event listener to implement SetScrollCallback. It uses requestAnimationFrame to implement SwapBuffers. It's not completely finished, but it does work and can be developed further to fill in the missing pieces.
My goal with it was to build some prototypes and if it made sense, its web backend implementation could be moved into the Go glfw package. I am still unsure if it belongs there or not.
But it can be used to fill in the web backend for the suggested gxwt package.

Proposal

We expand golang.org/x/mobile/gl to support WebGL and windows, and use it in the GXUI driver.

My only ask is for golang.org/x/mobile/gl to satisfy the "it should be go-gettable" requirement (to the same degree that go-gl/gl/... is go-gettable). If that's the case, I am completely in favor. I support the decision to add the WebGL backend to it and can help out.
My github.com/shurcooL/gogl package was just an experimental package and I'd love for its functionality to be made available in a more official Go package.

We introduce a gxwt package. It provides a pure-Go view of windowing events with no dependencies in its exported interface. It uses build tags to switch its implementations:
linux/windows/OS X: glfw
android/iOS: x/mobile/app
web: gopherjs?

Absolutely in favor of using GLFW for the desktop backend.
Sounds good to use x/mobile/app for iOS and Android backends.
Can use the approach demonstrated in github.com/shurcooL/goglfw for the web backend. Happy to help out here.

Sorry for the long winded comment, I wanted to reply to all points.
Once again, I appreciate the feedback and the I am really liking the suggested thoughts so far. :+1: Making gxui more general and capable of running on mobile and web is a huge win (and really cool if you ask me)! The best part, it's already so close and as you could see, very few changes had to be made to make it work in the browser. Thank you!

I've ported GLFW's event linter program to Go so I can better test the remaining functionality of the web implementation of github.com/shurcooL/goglfw.
I've put it up so you can try out the current version (open the console and watch for events; note that using keyboard shortcuts won't work since they get intercepted):
http://dmitri.shuralyov.com/projects/glfw-events/index.html
Many of events/keys are missing and there's some work to go. Up until now, I've only implemented things that I needed - so that I could test that it worked.
Also, there may be a better, concurrency-friendly interface for processing events in Go (for example, by sending them over channels), so glfw's callbacks mechanism may not be the most ideal. But it's a solid start.

Hey @shurcooL your goglfw looks a lot like what I was thinking of for gxwt. One extra ideal I'd try to reach for: no external references to any gl packages. That way it could be used by other drivers (for example, html5 canvas, or one of the many GL replacement languages that are appearing).
As for golang.org/x/mobile/gl, it is generally go gettable today. You need to install an opengl header on a linux machine, but that is commonly done on any system with the compilers for cgo already. The headers come with OS X's compilers. Windows is the odd system out, but it is simply not done yet. If you ever find yourself unable to go get it, please file a bug.

Hey @shurcooL your goglfw looks a lot like what I was thinking of for gxwt.

Sounds great! I am thinking, to start with, gxwt should go for the best public interface, and it can use github.com/go-gl/glfw/v3.1/glfw for its desktop backend,  x/mobile/app for mobile backend, and also glfw interface for web backend (implemented via goglfw initially). But later on, the web backend can be rewritten to avoid going through the glfw interface and be implemented more efficiently/directly. Until then, using goglfw should be fine and it will allow me to test/develop goglfw and its implementation further before gxwt interface is ready.

One extra ideal I'd try to reach for: no external references to any gl packages. That way it could be used by other drivers (for example, html5 canvas, or one of the many GL replacement languages that are appearing).

I agree. This is not currently the case, but I will start thinking about how to make that possible in the future. One non-ideal approach I can think of would be something that returns an interface{} and you can use type assertions to work with it (ala (FileInfo) Sys()). Perhaps there are better ways.
But the current reason why goglfw imports and uses gogl is because goglfw.CreateWindow actually creates a canvas with WebGLContext and that WebGLContext is needed for gogl to work.
Anyway, I agree and will work towards that goal.

As for golang.org/x/mobile/gl, it is generally go gettable today. You need to install an opengl header on a linux machine, but that is commonly done on any system with the compilers for cgo already. The headers come with OS X's compilers. Windows is the odd system out, but it is simply not done yet. If you ever find yourself unable to go get it, please file a bug.

Sounds good.
In that case, my plan will be the following. I'll work with x/mobile/gl on a branch (perhaps a fork on my github) and start adding a web backend to it, and see what issues I run into. Once everything works and I know what changes (if any) are required, I can start making a CL for x/mobile repo.

Very cool. I'm excited to see how your goglfw turns out!

Proposal

We expand golang.org/x/mobile/gl to support WebGL and windows, and use it in the GXUI driver.

I've finally resolved everything needed to make this possible, and created a CL:
https://go-review.googlesource.com/8793 gl: Add WebGL backend.
/cc @crawshaw It needs review. There is a single known TODO at this time, to finish implementing all remaining (but not used in any of my code or or gxui code) methods in the WebGL backend.
The corresponding change to goglfw to use ContextSwitcher is at https://github.com/shurcooL/goglfw/pull/1.

I've posted an update regarding the status in the CL.

Looking at the current code, if I'm not mistaken, the only gl package test I see is in x/mobile/gl/glutil/glimage_test.go file, which renders to offscreen buffer texture and compares to expected image.
But it only seems to do it for linux and darwin, not android:
// +build darwin linux,!android

// TODO(crawshaw): Run tests on other OSs when more contexts are supported.

If so, can WebGL also be a "TODO" item?
If not, I am thinking about how it can be done now.
Perhaps something like https://github.com/stackgl/headless-gl can be used. It's a gutted version of node-webgl with no external dependencies, DOM emulation or window handling. It can be used to create an offscreen framebuffer/WebGL contexts for server-side rendering in node.
It would require node as a dependency, which I'm unsure how to feel about (but I don't know of any other way). It would also require the GopherJS compiler, which is currently not versioned. So a failed test may mean either the code is failing, or node, or GopherJS compiler.
I can also volunteer to maintain an out of tree fork of x/mobile/gl under my github or go-gl org (if others are okay) and try to keep it API compatible with the upstream x/mobile/gl. But I would want to do that with the hope that once required issues are resolved, it could be merged upstream.
I have not seen any comments on the actual code changes, so I'm not sure if it's been reviewed aside from not having tests. Suggestions on how to proceed are highly welcome.

Is it okay to close this now @shurcooL ?

I think it's too early to close this. PR #86 was recently merged which adds a WebGL backend, but that is only a prerequisite for browser support. It still uses go-gl/glfw/v3.1/glfw which does not support browsers, so gxui cannot run in browsers as is.
I'd like to wait a few days to make sure the new goxjs/gl backend works okay and there are no new issues reported. Then I'll open a second PR to switch to goxjs/glfw. Once that PR is merged, this issue will be resolved. Does that sound okay?

Horray!

It's been a great journey from initial idea and prototype to final version and being merged into gxui. Thanks to everyone for helping make this happen. :)
After 1.5 comes out, it's likely I will be playing with iOS support, and will see what it'll take to get gxui to run there also. The gl backend should support iOS as is, but there's no support on glfw side yet. There may be code organization changes that come up by then as well. But it's much closer now than before I opened this issue!

gxui looks fine ...

Does OpenGLs give pixel perfect accuracy for UI that need very precise line and UI component?

@BigBoneDaddy - It rather depends on the hardware. Some GPUs (mostly mobile) have limited floating-point precision, and so on some high-DPI display devices rendering may not be 'pixel-perfect'. However, for those devices, the error would probably manifest themselves as tiny texture bi-linear sampling errors and you'd probably not notice them.
Most desktop GPUs I'm aware of would probably be pixel-perfect, ignoring bad GL implementations.


dotnet: format(dotnet) does not match correctly

format(dotnet) does not match at function/bb scope but matches at global scope. Additionally, capa metadata lists .NET file format as pe instead of dotnet.
Should we extract both pe and dotnet formats for .NET files? Otherwise, when analyzing .NET files we miss out on native capabilities bound by format(pe).

format should be a global feature so match at all scopes. Is this a bug currently?
I'd say it'd be fair to emit pe and dotnet for PEs.
The metadata discrepancy should be an easy fix.

related: #938

While looking at #1258 I noticed that we may want to improve capa.features.extractors.common.extract_format() or at least discuss and document our decision.
I think extract_format() would ideally also detect dotnet and we could simplify the code a bit (including parts of #1256).
Right now the dotnet detection depends on capa.features.extractors.dnfile_.DnfileFeatureExtractor.is_dotnet_file() and then some manual format setting subsequently.


feat: allow user to disable log level validation

With this change, the user may specify validateLogLevels: false when
instantiating a logger in order to disable validation of log levels.
This is helpful in cases where the log levels are not known in advance.
If validateLogLevels is true, the logger behaves as it does now:
unrecognized values for the log level are detected and the associated
line is rejected, or the log level is coerced to the default value.

lib/logger.js: Add support for validateLogLevels option.

test/common/create-options.js:

test/logger-instantiation.js:

test/logger-log.js: Add tests for validateLogLevels.

README.md:

types.d.ts: Update readme and type definitions.

Fixes: #65

Closing this as this approach is incorrect, and my need for the change has faded.


[BUG] AttributeError: module 'torchsparse.backend' has no attribute 'build_kernel_map_subm_hashmap'

Is there an existing issue for this?

[x] I have searched the existing issues

Current Behavior
When I run the test.py in this project, I got 2 errors:
FAILED (errors=2)
Error
Traceback (most recent call last):
File "/home/hx/PycharmProjects/torchsparse/tests/test.py", line 20, in test_single_layer
mean_adiff, max_rdiff = test_single_layer_convolution_forward(
File "/home/hx/PycharmProjects/torchsparse/tests/python/test_single_layer_conv.py", line 202, in test_single_layer_convolution_forward
out = model(feats_t, coords_t)
File "/home/hx/anaconda3/envs/torchsparse/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/hx/PycharmProjects/torchsparse/tests/python/test_single_layer_conv.py", line 61, in forward
return self.net(ts_tensor)
File "/home/hx/anaconda3/envs/torchsparse/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/hx/anaconda3/envs/torchsparse/lib/python3.9/site-packages/torch/nn/modules/container.py", line 204, in forward
input = module(input)
File "/home/hx/anaconda3/envs/torchsparse/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/hx/PycharmProjects/torchsparse/torchsparse/nn/modules/conv.py", line 98, in forward
return F.conv3d(
File "/home/hx/PycharmProjects/torchsparse/torchsparse/nn/functional/conv/conv.py", line 92, in conv3d
kmap = F.build_kernel_map(
File "/home/hx/PycharmProjects/torchsparse/torchsparse/nn/functional/conv/kmap/build_kmap.py", line 85, in build_kernel_map
kmap = build_kmap_implicit_GEMM_hashmap_on_the_fly(
File "/home/hx/PycharmProjects/torchsparse/torchsparse/nn/functional/conv/kmap/func/hashmap_on_the_fly.py", line 48, in build_kmap_implicit_GEMM_hashmap_on_the_fly
func = torchsparse.backend.build_kernel_map_subm_hashmap
AttributeError: module 'torchsparse.backend' has no attribute 'build_kernel_map_subm_hashmap'
Error
Traceback (most recent call last):
File "/home/hx/PycharmProjects/torchsparse/tests/test.py", line 46, in test_to_dense
max_adiff = test_to_dense_forward()
File "/home/hx/PycharmProjects/torchsparse/tests/python/test_to_dense.py", line 48, in test_to_dense_forward
output = to_dense(feats_t, coords_t, spatial_range).cpu().numpy()
File "/home/hx/PycharmProjects/torchsparse/torchsparse/utils/to_dense.py", line 64, in to_dense
return ToDenseFunction.apply(feats, coords, spatial_range)
File "/home/hx/PycharmProjects/torchsparse/torchsparse/utils/to_dense.py", line 30, in forward
torchsparse.backend.to_dense_forward_cuda(
AttributeError: module 'torchsparse.backend' has no attribute 'to_dense_forward_cuda'
Expected Behavior
No error
Environment
- GCC:gcc (Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0
- NVCC:Cuda compilation tools, release 11.7, V11.7.99
- PyTorch:1.13.0+cu117
- PyTorch CUDA:11.7
- TorchSparse:2.1.0+torch113cu117

Anything else?
No response

Hi @huohuohuohuohuohuohuohuo . Seems like you haven't installed TorchSparse++ correctly. Have you solved the problem?

I indeed installed TorchSprase++ successfully and no error is reported. I copied test_single_layer_conv.py and test_to_dense.py to another path and run them respectively and it worked.

Thank you for pointing that out. Generally, you can call these two *.py files directly by runing test.py in tests. And I have fixed some outdated import operations in the codebase.
I didn't observe the same error as yours. I guess the error you met might be related to your python environment. The torchsparse.backend may not be successfully linked at first.

Close this issue as completed. Feel free to reopen it if you have further questions.

After successfully compiling and installing the package, ensure to run the example or test code outside of ./torchsparse. This is because Python prioritizes searching for packages in the current path rather than the installation path where the compiled version resides.
Please refer to https://docs.python.org/3/tutorial/modules.html#the-module-search-path, which talks about how python search for packages and the priority.


Miles to Km Converter

Student, group: Borovik Dmitry, /203
URL: https://github.com/Morphylix/MilesKmConverter
Git approach: git-flow

`+


Vlc.DotNet.WPF Property

I have a question  about Vlc.DotNet.

Vlc.DotNet version : 2.2.1
Vlc.DotNet project used : WPF
libvlc version : x86 + From FTP Server
.net version : 4.7.1
Project language : C#
Project build architecture : x86
Operating system : Windows 8.1 x64)

I can't get this.MyControl._SourceProvider_ property when i code behind.
I get Mycontrol.Mediplayer but it doesn't have method CreatePlayer. I dig down and found
MyControl.Mediaplyer.VlcMediaPlayer.Manager.CreatePlayer() option but it turned Object reference null exception. What i do wrong ? Please support.

The documentation that you are reading is for 3.0.0, please use the prerelease version from nuget if you want to try it.


[SR-14449] Incorrect warning after return statement

Previous ID
SR-14449

Radar
rdar://problem/76269551

Original Reporter
@mbrandonw

Type
Bug

Status
Reopened

Resolution

Additional Detail from JIRA

Votes
0

Component/s
Compiler

Labels
Bug

Assignee
None

Priority
Medium

md5: 6daeda9668118f34274102a2888fd72c

Issue Description:
The following code:
func foo() -> Int {
  return 1
  struct Bar {}
}

produces a warning:

Code after 'return' will never be executed

This warning doesn't seem to be correct since the type isn't "executable" code.

Can confirm this is all fixed in Swift 5.7 (and probably earlier, just haven't checked). Closing.


Equality comparison incorrectly returns true (sometimes)

Background:
I have a np.ndarray of uint64, ids, shaped (N, 2), which I pass from python to a function in a cython file.  The cython function compares the second element of each row of this array (i.e. ids[:, 1]) to all future rows to find repeat entries.  At times, this is returning an incorrect value.
Trimmed down version:

Problem:
ctypedef unsigned long long ULNG

def build_tree(np.ndarray[ULNG, ndim=2] ids, np.ndarray[long,   ndim=1] next):
    cdef long num_mergers = ids.shape[0]

    for ii in range(num_mergers):
        outid = ids[last_ind, 1]
        jj = ii + 1
        while (jj < num_mergers):
            for kk in [0, 1]:
                if (ids[jj, kk] == outid):    # [*]
                    next[ii] = jj

At a particular row, the equality test ([*]) returns true despite the values being different.  I've added a print statement print(ii, ids[jj, kk], outid, ids[jj, kk] == outid), at the offending entry, which gives,
193<PHONE_NUMBER>551552872<PHONE_NUMBER>551553059 True

Other info
I'm exploring this in a jupyter notebook (calls a method that calls the cython method, compiled used pyximport), and after ~6 kernel restarts (and re-compiles), it finally worked properly, I think without any changes to the operating code.
I assumed it was some sort of type error, so inside the cython method, I also printed out the type() result for these values and they both return int (instead of anything about an unsigned long long), but I'm guessing that's because of a python-function vs. cython issue?

I'm exploring this in a jupyter notebook

Note that notebooks are particularly bad at guaranteeing that the code that runs and the data it processes really comes from the code that the cells show. The fact that you are additionally using pyximport makes this even worse, IMHO.
I'll close this is probably not reproducible.


Persist coin data serialized for better rolling update support

Add logic to be able to persist and restore serialized coin data. This
is done to prevent extensive maintenance of migrations when a feature
is added due to rolling updates.
I've created two additional branches:
The initial validation status (feature/serialize-coins-validation):

The cleanup on success (feature/serialize-coins-cleanup):

:shipit: Before merging, please rebase this work onto the feature/sfo branch.


Schema must be aware of the document id

Currently the schema know which fields of the document should be indexed and stored. Using the SchemaBuilder struct we declare each field in the order of importance we want and the document id is unknown to the finally built schema.
The advantage of this solution is that it will be impossible to serialize a document that does not have an id. The serializer will not be able to generate the appropriate key and therefore not be able to store it in the database.
We must absolutely keep some kind of "raw" API that will allow us to store a document under any id and with any attributes.
How should we modify the SchemaBuilder API ? What if the user want its id to be stored and indexed ?
We will probably need to transform the id (i.e. hashing it) to be able to save the in the database, when a user will need to identify a document (i.e. deleting it), he will refer to its original id, not the transformed one.

We though about an API that could look like this:
let mut schema = SchemaBuilder::with_identifier("id");
schema.new_attribute("id", STORED | INDEXED);
schema.new_attribute("title", STORED | INDEXED);
schema.new_attribute("description", STORED | INDEXED);
schema.new_attribute("image", STORED);
schema.build()


Ctrl-c to exit jump and fzf?

[x] I have read through the manual page (man fzf)
[x] I have the latest version of fzf
[x] I have searched through the existing issues

Info

OS

[x] Linux
[ ] Mac OS X
[ ] Windows
[ ] Etc.

Shell

[ ] bash
[x] zsh
[ ] fish

Problem / Steps to reproduce
I have this <..> | fzf --bind '::jump-accept' --> after press :, to exit fzf I have to press ctrl-c to abort two times to exit fzf --> I want press one ctrl-c.
Is there a way to do that?

Maybe press : again to dimiss jump but keep ctrl-c to dismiss all at one?

There's no such option at the moment. Other bindings are simply ignored in jump mode. You have to first exit the mode before using other bindings.

any chance for this to be fixed? i wouldn't consider this as a bug or feature but a bit annoy when using.

It's not clear that the suggested approach can be universally agreed upon. If I'm not mistaken, you discovered the jump feature pretty recently, but the option was initially introduced 7 years ago and there has been no complaints regarding the current behavior. Granted, I don't know how many users are using the feature. I personally never use it because I think it's easier and more natural to type in a few more characters to pinpoint the match than to vertically move the cursor.

It's not clear that the suggested behavior can be universally agreed upon. If I'm not mistaken, you discovered the jump feature pretty recently, but the option was initially introduced 7 years ago and there have been no complaints regarding the current behavior. Granted, I don't know how many users are using the feature. I personally never use it because I think it's easier and more natural to type in a few more characters to pinpoint the match than to vertically move the cursor.

Unfortunately I adopted it heavily to my workflow, I think most ppl will simply ignore it or did not find a way to use it.
Here how I do:
cmd pattern<trigger fzf>

--> pattern will be insert to fzf and boostrap the search right a way with it, then I also have jump:accept active ready to choose the correct one.
Probably you're in a case that you need to narrow the search first but here I already type the search from shell, so jump:accept is essential to use.
But then I will in a case that I need to exit it quickly.

FWIW, I just found out about jump and it would be nice to add this feature!

It's not clear that the suggested behavior can be universally agreed upon.

Instead of changing the default, you could just add some new function like fzf-quit-all that a user can bind to Ctrl-C or escape.

If I'm not mistaken, you discovered the jump feature pretty recently, but the option was initially introduced 7 years ago and there have been no complaints regarding the current behavior.

But how many people even know this is there? There are no instances of jump in the readme or in ADVANCED.md, and when I searched on ~Google~ Kagi this issue was the only relevant result. Unless you're one of the 0.01% of users who read the manpage in detail, I struggle to see how one would even find out about this. It could be mentioned in the docs (with an example of how to bind it) because it's a cool feature!

The reason I'm not advertising jump feature is that I don't personally use it and I don't think it's the most natural way to use the finder. You have to hit a custom key to go into the jump mode, find the position of the desired match in the list, peek to the left to learn which key to press, press that key, and hit enter to complete the process. But I would instead just append more characters to the query to further narrow down the list, ideally bringing the desired one to the top position of the result, so that there is little or no need for vertical movement. I feel this is more streamlined because there is no context/mode switching involved. So I wanted the users to internalize this simple workflow first before looking for a separate mode.
Having said that, it is possible to implement such an action that can be bound to a key. But as I mentioned above, the bindings don't work in the jump mode, so we have to make an exception for it in the code.

The reason I'm not advertising jump feature is that I don't personally use it and I don't think it's the most natural way to use the finder. You have to hit a custom key to go into the jump mode, find the position of the desired match in the list, peek to the left to learn which key to press, press that key, and hit enter to complete the process. But I would instead just append more characters to the query to further narrow down the list, ideally bringing the desired one to the top position of the result, so that there is little or no need for vertical movement. I feel this is more streamlined because there is no context/mode switching involved. So I wanted the users to internalize this simple workflow first before looking for a separate mode.
Having said that, it is possible to implement such an action that can be bound to a key. But as I mentioned above, the bindings don't work in the jump mode, so we have to make an exception for it in the code. But I think only allowing that abort-all action in the jump mode can be confusing.

Still please add this, as I still need an exit way to redeem to shell prompt state immediately.

FWIW, I just found out about jump and it would be nice to add this feature!

It's not clear that the suggested behavior can be universally agreed upon.

Instead of changing the default, you could just add some new function like fzf-quit-all that a user can bind to Ctrl-C or escape.

If I'm not mistaken, you discovered the jump feature pretty recently, but the option was initially introduced 7 years ago and there have been no complaints regarding the current behavior.

How many people know this is there? There are no instances of jump in the readme or in ADVANCED.md, and when I searched on ~Google~ Kagi this issue was the only relevant result. Unless you're one of the 0.01% of users who read the manpage in detail, I struggle to see how one would even find out about this. It could be mentioned in the docs (with an example of how to bind it) because it's a cool feature!
Edit: this wasn't intended to sound rude, I appreciate all the work and thoughtful design behind fzf!

Really like this idea, fzf-quit-all or smth similar that
able to map to ctrl-c/escape or other keybindings.
I used 'load:+jump-accept' in all of my fzf functions,
mostly I do patterns first then if I can able to direct jump,
give it a go. But if not, I can have option to dismiss it and
be back to shell instantly.

A more flexible approach would be to add events, namely jump and jump-cancel, so you can get the desired behavior and replace jump-accept action.
fzf --bind space:jump,jump:accept,jump-cancel:abort

A more flexible approach would be to add events, namely jump and jump-cancel, so you can get the desired behavior and replace jump-accept action.
fzf --bind space:jump,jump:accept,jump-cancel:abort

I think it's ok, more clarification than quit-all, or can just be jump:cancel that internally mapped to :abort

I'm not going to change the default behavior. The additional events will allow users to fine-tune the behavior.
# Default behavior
fzf --bind space:jump

# Same as jump-accept action
fzf --bind space:jump,jump:accept

# Accept on jump, abort on cancel
fzf --bind space:jump,jump:accept,jump-cancel:abort

# Change header on jump-cancel
fzf --bind 'space:change-header(Type jump label)+jump,jump-cancel:change-header:Jump cancelled'

I have this:
zsh -df
echo "1\n2" | fzf --bind 'load:+jump-accept' --bind 'ctrl-y:abort,jump-cancel:abort'

When i try to use ctrl+n/p to not abort jump but trying to dismiss the accept and navigate the list, it does not work, it will just abort

In the current implementation, any key that is not one of the jump labels simply cancels the jump mode. So there's no difference between pressing CTRL-P and pressing ESC or pressing !. CTRL-P will only cancel the jump mode and it will not trigger any action that is bound to the key. So, looks like you're out of luck.
One possibility is to export the name of the last key pressed  (a la $FZF_ACTION) so you can conditionally trigger a different set of actions using transform. I'll think about it.

In the current implementation, any key that is not one of the jump labels simply cancels the jump mode. So there's no difference between pressing CTRL-P and pressing ESC or pressing !. CTRL-P will only cancel the jump mode and it will not trigger any action that is bound to the key. So, looks like you're out of luck.
One possibility is to export the name of the last key pressed (a la $FZF_ACTION) so you can conditionally trigger a different set of actions using transform. I'll think about it.

yeah, but it's kinda useless if any key just abort fzf --> this will probably affect any user that currently use jump.

This will do.
fzf --bind 'space:jump,jump:accept,jump-cancel:transform:[[ $FZF_KEY =~ ctrl-c ]] && echo abort'


[PTFE-376] ✨ Switch GCP runners to spot instances

Codecov Report

Merging #252 (d819ca5) into main (374f01a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #252   +/-   ##
=======================================
  Coverage   71.98%   71.98%
=======================================
  Files          15       15
  Lines         846      846
=======================================
  Hits          609      609
  Misses        237      237

I have added instance_termination_action with a value of DELETE for SPOT instances. I think it's a better idea since we won't need to reuse a stopped VM in any case, so it's better to delete the VM.


Fixing inconsitency between PublishOptions and Publish message

while PublishOptions allow single authid, role in eligible/excluded Publish message requires lists

[Current coverage][cc-pull] is 58.01%

Merging [#685][cc-pull] into [master][cc-base-branch] will not change coverage

@@             master       #685   diff @@
==========================================
  Files            63         63
  Lines         10278      10278
  Methods           0          0
  Messages          0          0
  Branches       1600       1600
==========================================
  Hits           5962       5962
  Misses         3824       3824
  Partials        492        492

Powered by Codecov. Last updated by [3bf0756...2b6673c][cc-compare]
[cc-base-branch]: https://codecov.io/gh/crossbario/autobahn-python/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/crossbario/autobahn-python/compare/3bf07564abc0eaa43a0e0e4788fb5e2edee6ac40...2b6673c723a9d99e1d3cb12615b62b252077f829
[cc-pull]: https://codecov.io/gh/crossbario/autobahn-python/pull/685?src=pr

No, exclude_authid / exclude_authrole etc does not require a list

This is in source for autobahn.wamp.message  (Publish message):
line 1176 :  assert(exclude_authid is None or type(exclude_authid) == list)
and this is in autobahn.wamp.types,  (Publish Options):
line 483:  assert(exclude_authid is None or type(exclude_authid) ==
six.text_type or (type(exclude_authid) == list and all(type(x) ==
six.text_type for x in exclude_authid)))
line 513:        if self.exclude_authid is not None:
options[u'exclude_authid'] = self.exclude_authid if
type(self.exclude_authid) == list else self.exclude_authid
If I use PublishOptions(exclude_authid='something'), options object is
create but later got AssertionError
when publish is called ( and publish message is being created).
So there is problem there.
I.
On 31.5.2016 10:30, Tobias Oberstein wrote:

No, exclude_authid / exclude_authrole etc does not require a list
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/crossbario/autobahn-python/pull/685#issuecomment-222624594,
or mute the thread
https://github.com/notifications/unsubscribe/ACFaBaT-wRFLw14nqiB-JAF9voHgMAHFks5qG_GegaJpZM4Ip0Mz.

Yeah, it looks like some of the code is insisting on a list, and some will accept list or string...


added a test for member functions' reference qualifiers

I couldn't find a test for ref-qualifiers on member functions, so I thought it's worth adding one.

Sorry for the delay!


Variables completions in VS Code

Please show me a simple example of how to do autocompletion for example of a variable. The user created a variable with some name and type, value. After the user enters for example var:: and then the names of variables that exist appear. I still don't know how to make resources from programming language libraries recognized too.

To hook things up to the VS Code API directly or via a language server please see the VS Code documentation (see https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-code-completion-proposals)
For the language itself there is no general example. To for example complete variable names you need to build and AST of your code, do some sort of analysis (syntax / semantic) eventually some symbol binding and then decide which variable names are valid completion. All this is very related to what usually a compiler does (e.g. to check if a name is valid) and you are better of asking these questions on Stack Overflow in a compiler thread.


Renesas: Smartbond: Display Driver Update PM Policy Handling

This is a follow-up PR after #73096 which fixes an issue in the display driver.

@andrzej-kaczmarek ping


Is Dynamic Trees not compatible with Croptopia?

It seems to make the trees unable to appear.
Minecraft 1.20.1

@supermassimo this should be easy enough fix

yes it is https://www.curseforge.com/minecraft/mc-mods/dynamic-trees-croptopia


License file install

Do you have any WIP for installing license file with install?

No plans currently.
My understanding is that the installation process is one REST call, which could be contained within a single exec resource. It's one of those weird cases where the resource you're defining in Puppet controls something that isn't host-specific, so every time the resource runs on n hosts, they're all talking to one backend (i.e., you'll definitely need unless/onlyif or refreshonly).
With that being said, if it's a feature that people feel the module should have, I can certainly add it to the roadmap. In my mind, it would be a difference between something like this:
exec { 'install license':
  command => 'curl -XPUT -u admin -p password http://localhost:9200/_license -d @license.json',
  unless => 'curl -XGET -u admin -p password http://localhost:9200/_license'
}

And this:
elasticsearch_license { 'foo' :
  license => 'file://foo',
}

Or something similar (you get the idea). If you or anyone has feedback whether this is something that should be prioritized, feedback is welcome.

I think it's useful and I understand it's not host specific but neither is templates in that case.
so the @license.json would need to be reference to the license parameter passed to the type no?
Seem like a pretty simple addition I would think based on your description above.

It would probably take the form of a custom type/provider to cleanly handle the REST/JSON aspects of the API, but yes, it would be a pretty simple resource.
I'll add the feature tag for now so we can track the request. Understand that there are some other pressing items that need to get resolved in them module (the yaml config and conflicting keys, etc.) but I'm happy to add it to the backlog.
To anyone interested in seeing this implemented, feel free to add the +1 reaction to the original comment so we can track the interest in the feature. Thanks!

The problem with the rest api approach is that you depend on:

authentication params
http enabled mandatory?
custom http ports?

@lucabelluccini you're correct that connection parameters like HTTP basic auth, ports, and so on are required when using a REST approach. However (and do correct me if I'm wrong), installing a license is only possible over the API, so it's our only option.
In addition, most of the work for exposing these connection settings exists in the existing providers this module has (see elasticsearch_template as an example) so those connection settings are configurable. They do have be changed if an Elasticsearch installation differs from the defaults, but that's just the way it has to work since the REST API is the sole way to install a license.

I agree on all the points.
It would be nice to ask to the elasticsearch team to provide another license installation method.
E.g.

periodical checks on a specific fs path containing license.json
periodical calls to a specified url (which could be configurable) hosting license.json

I've been messing around with automating this, and I made it a multi part of process, with an exec with an onlyif condition with a shell script..., and also laying down the license json file in puppet The reason is that.....
a)  When the license plugin is installed, it automatically installs a trial license, so a simple curl of _licenses won't be a sufficient check... it needs to check whether it's an active license.
b)  I want to be able to replace the file in puppet and have it automatically updated when and if I get a new license.
Here's what I got.. don't forget the jq package resource either.....
    file { '/opt/elasticsearch/license.json':     source  => 'HOWEVER YOU WISH....',     owner   => 'root',     group   => 'root',     mode    => '0644',     require => Class[elasticsearch],     } exec { 'install license':     command  => 'curl -XPUT http://localhost:9200/_license -d /opt/elasticsearch/license.json',     onlyif   => '/opt/elasticsearch/checklicense.sh',     provider => 'shell'     require  => [File['/opt/elasticsearch/license.json'],File['/opt/elasticsearch/checklicense.sh']]   }   file { '/opt/elasticsearch/checklicense.sh':     source  => 'HOWEVER YOU WISH',     owner   => 'root',     group   => 'root',     mode    => '0644',     require => Class[elasticsearch], }
Here's the content of the bash script...
#!/bin/bash #Go thru conditions where we could go install a new license eslicensestatus=$(curl -XGET http://<IP_ADDRESS>:9200/_license | jq '.license.status') eslicensedate=$(curl -XGET http://<IP_ADDRESS>:9200/_license | jq '.license.expiry_date_in_millis') filelicensedate=$(cat /opt/elasticsearch/license.json | jq '.license.expiry_date_in_millis') #If it's not an active license on ES, replace it if [[ "$eslicensestatus" != "\"active\"" ]]; then   echo "Not active license, Installing new License"   exit 0 #if the license file has a newer expiration date, replace it elif [[ "$eslicensedate" -lt "$filelicensedate" ]]; then   echo "New license installed, Installing new License"   exit 0 #don't do anything else   echo "Not installing new License"   exit 1 fi

There's a related request on the forums (https://discuss.elastic.co/t/automated-install-for-x-pack-license-drop-license-json-into-the-container-filesystem/88888/4), in which a user has requested the ability to install a license via a file on the filesystem:

We'd like to drop a license.json file directly into the config folder and have the ES node pick that up on startup. It should merge the license into the cluster state if appropriate to do so (similar to how file-based users used to work in shield). You could use the metadata on the license itself to determine if an existing license should be replaced in the cluster (based on trial vs commercial, expiration date, etc).

Documenting some footwork here for when I/someone picks this up:

On Elasticsearch 2.x, the api endpoint is /_license. The response for a GET is of the form:[root@centos-7-x64 ~]# curl localhost:9200/_license
{
  "license" : {
    "status" : "active",
    "uid" : "84b22937-aedb-4f8a-a05e-c21954bb24d4",
    "type" : "trial",
    "issue_date" : "2017-06-14T21:09:34.059Z",
    "issue_date_in_millis" :<PHONE_NUMBER>059,
    "expiry_date" : "2017-07-14T21:09:34.059Z",
    "expiry_date_in_millis" :<PHONE_NUMBER>059,
    "max_nodes" : 1000,
    "issued_to" : "elasticsearch",
    "issuer" : "elasticsearch"
  }
}

On Elasticsearch 5.x, the path has changed, and requires the correct content-type header (which this module already handles):[root@centos-7-x64 ~]# curl -u elastic:changeme localhost:9200/_xpack/license
{
  "license" : {
    "status" : "active",
    "uid" : "16bb3000-5a6b-49cf-a568-a2e4f9669d60",
    "type" : "trial",
    "issue_date" : "2017-06-14T21:21:19.692Z",
    "issue_date_in_millis" :<PHONE_NUMBER>692,
    "expiry_date" : "2017-07-14T21:21:19.692Z",
    "expiry_date_in_millis" :<PHONE_NUMBER>692,
    "max_nodes" : 1000,
    "issued_to" : "elasticsearch",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}

Thus the module should be able to use the existing parent REST native provider with the caveat that it should handle path changes between 2/5; the license structure looks the same between versions.

Still no update on this? Can't be that hard, i guess. This feature will most likely be requested by paying customers...

Apologies, there's lots of responsibilities outside this module as well. Pull requests are always welcome if you see an easy and effective way of implementing it! 👍


No method in multimethod 'date-add' for dispatch value: :clickhouse

Hi,
Got such error  in Metabase 0.32.10 when trying to filter date.
No method in multimethod 'date-add' for dispatch value: :clickhouse

Same for me. Happens when trying to filter date field using Previous expression.

Matabase for Mac: v0.32.10
ClickHouse Driver: 0.3

Hi guys, thanks for reporting this. Will try to reproduce and fix this issue.

Please try with release 0.4. Have a nice Sunday! Best regards, enqueue

Thank you @enqueue. Works perfectly!

@enqueue Wonderful! Thanks!


extension was meant to be extension name.

At the moment the commands are under a namespace called 'extension'. That's a little confusing for anyone trying to call those commands as we'd guess vscode-coverage-gutters or coverage-gutters (I'm not entirely sure which is the most correct, but either is better than having them prefixed extension.
Figured I'd raise it as a PR rather than an issue.

@ryanluker thoughts? are you ok with this change? I know it's technically a breaking change for anyone that depends upon calling your actions by name, but I think it's the right thing to do.

@gilescope this is looking good, thank you very much for the pull request! I will give it an official review either later this week or sometime on the weekend.
I don't mind breaking changes but as you mentioned if we wanted to be exact we would have to put this into the 3.0.0 release I have planned. I don't yet know when that release would be going out as very little work has been completed on it so far :thinking-face:.

Sure that’s fine. I’ll fix up my extension when it changes :-) no rush.
Sent with GitHawk

@gilescope Thanks for updating this!
Sometime over the next couple days I am hoping to make a "beta" vsix and create a github release for this and other improvements in the meantime until 3.0.0 is further along.
Once this vsix is made you can manually install it to get your changes sooner
https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix


Reland "Update framework_test.dart to remove ButtonBar usage and remove references from other clases (#137550)

This PR removes ButtonBar usage from framework_test.dart class and update other references in preparation for ButtonBar deprecation
related to https://github.com/flutter/flutter/issues/127955
reland https://github.com/flutter/flutter/pull/137550
Pre-launch Checklist

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] I read the Tree Hygiene wiki page, which explains my responsibilities.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I signed the CLA.
[x] I listed at least one issue that this PR fixes in the description above.
[ ] I updated/added relevant documentation (doc comments with ///).
[ ] I added new tests to check the change I am making, or this PR is test-exempt.
[x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

This tries to reland https://github.com/flutter/flutter/pull/137550

I don't think this was one affected by the sparkle flakes, but I could be wrong. Are there sparkle expectations here?

I don't think this was one affected by the sparkle flakes, but I could be wrong. Are there sparkle expectations here?

This was also reverted in https://github.com/flutter/flutter/pull/137731 for "unapproved goldens" from sparkles test even tho it has no golden test.
You commented the details here https://discord.com/channels/608014603317936148/613398423093116959/1169409122639302736

I think gold was shaking out the flakes from the past couple weeks now that I bumped all the goldctl versions. I am going to revert the ButtonBar change @TahaTesser it looks like it changed a golden related to overflow bar but it didn't come through in presubmit. Staging the revert now, I'll send you the link to the image result.

The changes looked quite safe but if there is some image result. i

Closed by accident.
The changes look safe. If the goldctl issue is resolved. maybe we should be able to land this.

Ok. I will watch it in real time to see of it causes issues landing. 👍

@Piinks 🙌


Bitlocker Turned Off, can't access BIOS

Hope someone has an answer to this issue.  I wanted to put in a new SSD drive in my laptop.  The existing conventional drive was encrypted with bitlocker.  Originally the drive had Windows 7 Pro 64 bit; I upgraded to W10 during the free conversion dates.  To keep the old drive as a backup, I turned off bitlocker.  There was an error of some kind, asking for recovery key after it was decrypted.  I turned off the machine before finding that key.  I can't get into the BIOS to change to UEFI, etc. (if there even is this setting).  I can't install the new SSD because Western Digital says there is a setting in BIOS blocking the capability to find the driver (AHCI). It's an older Toshiba Tecra A11.  Toshiba says I have to take it to a Toshiba repair center. I didn't want to "short out" the CMOS, just in case the laptop would never boot again.  I flashed the BIOS to a previous version, which didn't help; I re-flashed the BIOS to the current version, which also didn't help. Any suggestions?  Thanks.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 9b00e133-662e-d11d-1b0e-c318b21f28f8
Version Independent ID: 84574a8c-67e6-97bd-9dbf-11252997bc93
Content: BitLocker frequently asked questions (FAQ) (Windows 10)
Content Source: windows/security/information-protection/bitlocker/bitlocker-frequently-asked-questions.md
Product: w10
GitHub Login: @brianlic-msft
Microsoft Alias: justinha

It would be best for you to either contact your Toshiba repair center or to try https://support.microsoft.com. Thank you!


[WIP] Menu widget

First draft of a Menu widget.

Open TODOs:

[x] Disable entries. This could be achieved by changing Message to Optional<Message>.
[x] Toggle-able entries. This could be achieved by adding a Entry::Toggle or something to Entry.
[x] Cool looking separators between the entries.
[x] Bouncing on the edge of the window or else the menu is cut off.
[ ] ~Add some internal scrollable if the list of entries is to high for the window.~ This seems to be realy hacky to implement. Nevertheless it would require for the scrollable::State to be hashable and maybe to fix this first.
[ ] Maybe a cooler default style. Some suggestions?
[ ] Add some way of keyboard control. In common, the Alt + [First character of section label] combination is used to pop up the content of the specific section. This would require to change the Text label of the Section to a normal String (or &str)  to be able to know the first character of the label.

This is very nice! I was thinking of making something like this for my chat app since using a PickList as a menu was hacky, but looks like you were faster :P
It seems we can use anything that can Into<Element<_>> for menu entries which is appreciated. Something that would be nice is methods on Menu that would help with prototyping, eg. perhaps a method that takes an array of strings for easier creation of text-only Menus etc.

Hmm for styling lets just stick with a workable default. Also scroll-able stuff should be fixed to render properly since a few versions back. a few keyboard controls would be nice probably can try to help implement them later. Also the pure edition might also fix the state hashing requirements for the scrollbars.

@genusistimelord For now, I would prefer to wait for the support of the real system menus (iced#1047, iced#114). What do you say?

@genusistimelord For now, I would prefer to wait for the support of the real system menus (iced#1047, iced#114). What do you say?

yeah thats fine. was more or less stating how the current changes in iced have already changed some of the requirements.

I am closing this since menu now exists. Decided to allow it since this cant be supported fully in other ways. we might not see its support for a long time if any.


bugfix - nested JSON objects get parent nodes prefixed

With my last pull request - fixing the matchers for nested objects - i introduced a bug that lead to the output of wrong JSON objects where nested objects got the ids of their preceding objects appended (as matchers do).
This will be fixed with this PR.
...please excuse the inconvenience. =o)

Thank you for the followup. Don't worry about any inconvenience, nobody has reported an issue yet an I will push out an update release.


Access Ketcher iframe via JavaScript, .ketcher undefined...

Hi,
I tried to embedded Standalone package to a project, try to use Javascript access the iframe .ketcher following this link"https://lifescience.opensource.epam.com/ketcher/developers-manual.html#installation.", but failed.
which is from this link
Steps to Reproduce

Download standalone package 2.7.2, Create ketcher folder for the download, create home page to embed index.html as a iframe.

3. to homepage script block write the code:
`
var ketcherFrame = document.getElementById('ifKetcher');
var ketcher = null;
if ('contentDocument' in ketcherFrame)
ketcher = ketcherFrame.contentWindow.ketcher;
console.log(ketcherFrame.contentWindow)
console.log(ketcher);
else // IE7
ketcher = document.frames['ifKetcher'].window.ketcher;
`
4. console.log(ketcherFrame.contentWindow): ketcher (U) and console.log(ketcher) is undefined
Actual behavior
Cannot access ketcher, it is undefined
Expected behavior
able to access ketcher and init setMolecular.
Desktop (please complete the following information):

OS: Win 11
Browser [chrome]
Version 111.0.5563.65

Ketcher version [e.g. v2.4.2].
v2.7.2 standalone
Any help appreciated, Thanks!

Hi @Jo-Zh thanks for reaching out! According to the code example you gave - it looks like you are setting the ketcherFrame variable instead of ketcher
Can you please doublecheck if it will work for you if you use ketcherFrame variable?

Hi, thanks
I embed Ketcher in another page, use IFrame:

And so I used the following:
var ketcherFrame = document.getElementById('ifKetcher');
var ketcher = null;
if ('contentDocument' in ketcherFrame)
ketcher = ketcherFrame.contentWindow.ketcher;
else // IE7
ketcher = document.frames['ifKetcher'].window.ketcher;
I also tried these code directly on the page, where:
Ketcher
with
var ketcher = ketcherWindow.ketcher;
In both cases ketcher is with undefined value.
So I alternatively solve my problem with create another project with react library to get a complied bundle.js to get ketcher editor in django project.
Just confused about the instruction on the https://lifescience.opensource.epam.com/ketcher/developers-manual.html#installation...


OpenCLIP sample for visual question answering

What does this PR do?

Adding sample for OpenCLIP based models for visual question answering based on
https://huggingface.co/microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224/blob/main/biomed_clip_example.ipynb
Added other models I validated the script with by setting the labels, URLs and model path as applicable
Performance with docker : Docker version : 1.15.1 , Build version :19

Framework
HPU
Precision
Command
Inference time per iteration
Throughput

Pytorch 2.2.0
1
BF16
python run_openclip_vqa.py --bf16 --use_hpu_graphs
12.44ms
723.7 images/s

Fixes # (issue)
Before submitting

[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
[x] Did you make sure to update the documentation with your changes?
[x] Did you write any new necessary tests?

Co- author: @imangohari1  (Gaudi1 CI results)

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.


Blade renderer breaks when mixing 2 @php-syntaxes in the same view

Laravel Version: 9.43.0
PHP Version: 8.1.13
Database Driver & Version: n/a

Description:
When mixing @php(..) and @php/@endphp later in the view the renderer breaks and gives preference to the @php/endphp pair above the parentheses.
Same issue as just posted, but tested in V9. @driesvints your excuse of "don't use it" is from my perspective not really an excuse. If you have a view of 400+ lines add @php/@endphp somewhere in the bottom and you didn't notice that someone else added @php(..) somewhere higher up in that same file you pull your hair out on why it doesn't work. Because the errors get quite weird when mixing things with other directives in between.
Steps To Reproduce:
See https://github.com/rikvdh/laravel-broken-blade-view/blob/v9/resources/views/welcome.blade.php
You expect 'goodbye' as output. But this breaks.
The rendered view:
<?php($hello = 'welcome')
@php
    $hello = 'goodbye';
?>

<?php echo e($hello); ?>

<?php /**PATH /Users/rikvdh/tmp/broken-view/resources/views/welcome.blade.php ENDPATH**/ ?>%

Don't mix these up.

If you want, feel free to send in a PR that would provide a solution to this.

It is a bit lame to just 'shut your eyes' for this obvious bug. There is no mention in the documentation on not mixing these kinds of methods, that makes it a bug. Keeping the issue open for someone else to work on or when I get the time to do it if you don't feel like it.

@driesvints
I'm confused as to why this was closed. According to the documentation (https://laravel.com/docs/9.x/blade#raw-php), both @php(...) and @php ... @endPhp are supported, and nowhere does it state that you can't use both.
If not being to mix the two is the official stance of Laravel, then it needs to be called out in the documentation. Otherwise, this is a bug, and should be treated as such.

We're not going to spend time looking into this ourselves. You're welcome to send in a PR. This is all easily solved by just using regular PHP tags.

@driesvints Why dont deprecate @php tags then entirely? If the behavior is buggy and wont be fixed and the answer is 'just using regular PHP tags'.

@rikvdh dries didn't say this won't be fixed, he welcomed a PR. Deprecating would like put an unnecessary change on many existing use-cases.
Just a note, this thread was shared on reddit by the OP so may receive additional activity due to this.

@ssddanbrown From my perspective if something is buggy and you are advised to use something else by maintainers the feature has no reason to exist.
The reason I've shared this on Reddit is not really part of this actual issue. But I'm quite new into the community and am used to a lot of other OS communities and worked a lot of places and program PHP for over 15 years and the way of communicating and closing issues with a 'dont use it' within 1 minute feels very rude to me and something I've never seen before. I understand it in a way, but on the other hand doesnt feel very welcoming to someone trying to contribute to this project.
'yeah you can submit a PR, but idc.' is the tone it arrives at for me.
Feel free to lock this issue for commenting.

Don't mix these up.

Yikes.

rikvdh: "There's ice on the sidewalk"
Dries: "Don't slip! or feel free to fix it..."
I agree with dries. - this is something that isn't a big issue, is likely to affect very few people, and those people can just be more careful, or if those people feel strongly about it, fix the issue for the benefit of the community... or you can get a refund if you'd like

rikvdh: "I'd rather go complain on reddit until someone else fixes it"

That is a little bit short sighted. I can fix it myself, but I don't feel very invited to do so. I remove the link to this issue on Reddit to prevent making this personal to anyone. That is not the goal.

Hi all. I'm sorry if you feel I was a bit short sighted in this. My two cents are just that this is an easy fix by using PHP tags. I don't see a big bug here and that's my personal opinion. We're open to PR's welcome bug fixes for this but we won't be spending time on this ourselves hence me closing this. If you don't like the way we want to maintain our projects then I'm sorry but we just do what we feel that works for us.

We close issues we don't plan to work on. Google still surfaces closed issues. Anyone can still search closed issues. That's how we work. 👍

@taylorotwell, @driesvints
If the expectation is that the community has to fix small bugs like this, is there an easy way to find closed, but unresolved, issues like this?
I feel like if I wanted to start contributing, I'd start on issues like these.

@taylorotwell, that sounds fantastic! I'd be happy if something like was done for issues closed in this manner moving forward.


provider: Support DiskSize for DigitalOcean

Before this patch, DiskSize was only supported for AWS. This patch
allows booting machines with user-specified DiskSize on DigitalOcean,
and modifies List to display DiskSizes.

Need some more changes before it can be reviewed again.


Handle duplicate #defines during extraction

Is your feature request related to a problem? Please describe.
When including #defines from multiple files, there could be duplicate #defines, with potentially different values.
Describe the solution you'd like
Create a duplicate #defines dict and alert user to possible duplicates with divergent values to fix

Done..


Release Google.Cloud.Location version 2.3.0

Changes in this release:
New features

Add IServiceCollection extension methods for client registration where an IServiceProvider is required. (commit 022fab2)

Created release for Google.Cloud.Location-2.3.0


__GSHandlerCheck_EH4 Error

I was able to compile jsoncpp (x64-windows-static) with the latest vcpkg. cpkg will automatically compile jsoncpp version 1.9.5.
I copied the Lib file and Header file to my project. v There will be an error GSHandlerCheck Error here:
1>json2_jsoncpp_x64.lib(json_writer.cpp.obj) : error LNK2001: __GSHandlerCheck_EH4
1>json2_jsoncpp_x64.lib(json_value.cpp.obj) : error LNK2001: __GSHandlerCheck_EH4
If I use vcpkg release (2021.05.12) version. He will compile jsoncpp 1.9.4. And it can be used normally in my project.
The latest vcpkg compiled jsoncpp 64-bit, his Lib size is 5.1M
The jsoncpp 64-bit compiled by vcpkg release (2021.05.12) version has a Lib size of 5.9M
I Can anyone help me to solve this problem. Thanks

Did you installed more than one Visual Studio?
Can you please provide their versions?
Thanks.

I Have Installed VS 2017 And VS 2019

C:\vcpkg-2021.05.12>vcpkg install jsoncpp:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
jsoncpp[core]:x64-windows-static -> 1.9.4
Warning: The following VS instances are excluded because the English language pack is unavailable.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
Please install the English language pack.
Detecting compiler hash for triplet x64-windows-static...
Using cached binary package: C:\Users\GamePP10900K\AppData\Local\vcpkg\archives\f7\f7afd0b481a66c10c3a7d5535131ac3448a08791.zip
Starting package 1/1: jsoncpp:x64-windows-static
Building package jsoncpp[core]:x64-windows-static...
Building package jsoncpp[core]:x64-windows-static... done
Installing package jsoncpp[core]:x64-windows-static...
Installing package jsoncpp[core]:x64-windows-static... done
Elapsed time for package jsoncpp:x64-windows-static: 109.8 ms
Total elapsed time: 1.55 s
The package jsoncpp:x64-windows-static provides CMake targets:
find_package(jsoncpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE jsoncpp_object jsoncpp_static)

Therefore, the reason for this issue should be that vcpkg uses Visual Studio 2019 to build jsoncpp, and you use the generated binary in Visual Studio 2017. Right?

Yes,then How to specify to use vs 2017 to compile the library?

Add the following code to the toolchain file(.cmake) in VCPKG_ROOT/triplets:
set(VCPKG_PLATFORM_TOOLSET v141)

Thanks a lot, my problem is solved


Steps to reproduce
Minimal steps to reproduce this behavior. Example:
1 - Open terminal
2 - curl -L git.io/antigen > ~/antigen.zsh
3 - source ~/antigen.zsh
4 - antigen use oh-my-zsh
5 - antigen theme robbyrussell
6 - antigen apply
7 - antigen theme robbyrussell

Expected behavior:
- The command prompt will disappear after the last command.

Software version

Antigen v2.2.2
zsh 5.3 (x86_64-apple-darwin17.0)
Darwin Xikun-MacBook-Pro-2.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

More information
Screenshot or any other information you may find relevant to troubleshoot the issue.

I can confirm the very same behaviour. This seems to happen when trying to load the same theme twice (loading a different theme seems to work fine)
However this prevents for instance to:

load theme A
load theme B
load theme A again (this leads to empty prompt)

@XikunZhang in case you were still wondering, I found a workaround, however I'm not sure if there are any serious side effects to that (I haven't noticed any so far).
Changing around row 465 of antigen.zsh seems to fix the issue
-  -antigen-set-default _ANTIGEN_WARN_DUPLICATES true
+  -antigen-set-default _ANTIGEN_WARN_DUPLICATES false


An in-memory record batcher implementation.

E.g. to aggregate records for a period of time before feeding them
to batch-driven APIs.

Coverage increased (+2.09%) to 74.874% when pulling 77553d436ef580f97ff1cfab2c56288e863927a7 on batcher into f2dda06d074baebfd459dc6dd3242c64ad0ca9a8 on master.

Released in v0.3.6


Add endpoints for repo topics and repo search

Also add an example script for cloning all repos with a topic.

I don't want to hold up this merge, but it would be nice to have an example that parses a file and adds topics based on the file. It's a two part process,

script adding topics
script cloning all repos with topic

I don't know yml very well but something like
Topic_to_add:
  - org
   - reponame1
   - reponame2

I don't know what our overall thoughts are as a company for scripts like these.
While I understand this was for a particular customer I can't imagine many we plan on continuing to write scripts and examples for every possible workflow / company. I think we should consider pushing customers to look at our API documentation page in the future and allowing them to create the scripts themselves.
For example from the script included I think it is reasonable to expect a customer to be able to modify it such that it only clones repos from a single topic. For the script adding topics I would expect we point them to API documentation and associated python functionality rather than write it for them.

No, we don't have docs like you would have on docs.rs for py-allspice. There's an open issue for it: #9

We do push back on customers and point them to the API.
In this case, pulling all the repos from topics is only 1/2 a solution. Customers also need a way to populate the topics. Manually populating the repos is out of the question for customers with hundreds of repos.

Added the add script as well. The yaml format is a little different as the topic: owner: name format gets very bulky in shorter cases, and is harder to read in longer cases.


[V1.0] fix picture in readme

some pictures in readme can't see clearly with github dark theme, change the picture format in readme accordingly.

@Jian-Zhang small fix to make pictures in readme clear under github dark theme


updated paw (2.3.2)

Thank you for the contribution. It was merged directly as 1e244fe90c5164601e647e98d455ae71f8549126 to keep commit history cleaner. Your contribution is still credited to you.


QUESTION: Remove /vendor/adminlte subfolder from public directory

Hi, when I inspected the view-source, I saw that for the bootstrap CSS, it loads it from http://<IP_ADDRESS>:8000/vendor/adminlte/vendor/bootstrap/dist/css/bootstrap.min.css.
The question is, can this /vendor/adminlte/ be removed from the URL so it looks like this: http://<IP_ADDRESS>:8000/vendor/bootstrap/dist/css/bootstrap.min.css Or even better http://<IP_ADDRESS>:8000/css/bootstrap.min.css ?
I know I can manually move the files but it would be nice if it's done automagically :)

Why do you want to change the dirs? You get more problems on updates and integrations as you want. ;)

*Sorry for the late reply.
Haha, nice one ;)
But it would be nice if the resource path is shorter. Maybe there's a routing technique that I haven't learned yet?


Document knexfile options

Currently documentation for the knexfile is severely lacking. I wasted a couple of hours trying to configure the directory where migrations are stored, and writing an almost complete bug report before I decided to try some more random things and see if anything would work. As it turns out the way to configure migrations in the knexfile is to use a migrations: {} object inside the environment object.
 Just reading the default knexfile.js would have saved him all the trouble".
However I don't like the idea of having two database configuration files laying around in my project, so early on I converted the default knexfile.js into something that reads my existing database configuration. And anyway, an automatically generated file is not the best documentation medium there is. It would be nice to have the various options with the rest of the documentation.

or if people are running into the same thing? the documentation on the parts that are about migrations in the knexfile is still pretty much nonexistent. At the very least explain what the directory and migrations objects do

Not entirely sure why this was closed. It should remain open until the problem is resolved via PR.

For those who may still be wondering how to change the migrations directory, use a knexfile.js like this:
module.exports = {
  development: {
    client: 'sqlite',
    connection: {
      filename: './db/development'
    },
    useNullAsDefault: true,
    migrations: {
      directory: './db/migrations'
    }
};

Hi, literally just started looking into knex today. I think the documentation is great, except for explaining the knexfile. On an unrelated note, the knexfile should probably have options to at least specify the client.

The info with all options has to be in the docs. I saw useNullAsDefault option in someones config accidentally. In the docs it's mentioned once at the bottom of insert block.
Surprised this one is still not resolved.

@VladShcherbin mee too, writing documentation should be easy enough task for anyone. There is link to documentation repo in CONTRIBUTING.md.

@elhigu please don't make that claim. Writting terrible documentation is easy, writing decent documentation is a fair amount of work, and writing good documentation is actually quite hard and something most people are not good at, through no fault of their own.
But, if you think it's easy, then I'm sure I speak for everyone in this comment thread when I say that I am greatly looking forward to your PR that adds that documentation, or stubs it so you can work with @tgriesser to refine it into something that benefits everyone who relies on Knex now or in the future.

Writing incremental changes to docs / adding new sections for example based on information in this thread is pretty easy (most of the knex users are actually working in doing coding + documenting). Specially it is easy if you compare it to writing code changes, where just base work takes hours or days to get to known even a bit to the codebase and design of the lib (not to mention testing etc. after adding the feature).
After one send documentation PR to repo, we (I get mails of every new pull request) will review it and check if there is something that can be made better. So it is not very hard to contribute to documents it just requires effort to invest some hours to it.
Sorry for being unclear and passive aggressive about it in earlier comment. I just find it generally a little bit offensive that someone is be surprised (nothing personal to anyone specific) why some stuff hasn't been made, when the most of the knex users in fact would be qualified to gather required information and to send PR.
@Pomax I've actually invested hundreds of hours of my time to knex development, but this issue is not in my list that I'm going to be fixing any time soon.

Cool. I assumed you were a drive-by commenter, since I have no idea who works on knex other that the person whose name is on the repo. As a fellow dev, on completely different repos, I find that unless the devs themselves take time to write the docs (because they know what's going on) you're not going to get the incremental improvements you're talking about. But then again, each project has their own docs policy.

@Pomax you can see if people are collaborators from the Collaborator tag after the name.
Actually there has been quite a lot incremental improvement during the years to the old docs by various committers. Nowadays it is required for every new feature / breaking changes must have documentation + unit tests  and integration tests in place. It was not so strict couple of years ago so docs of old code are a bit spotty there and there.


add domain marun

please define my school to your system.

@Receporak I have to close this request without merging, because you requested to add a non-existent domain to this repository: Host marun.edu.tr.domains.lib not found: 3(NXDOMAIN) Please ensure that you are familiar with this repository rules located at the bottom of this page and submit a new request with the correct information. Thank you for your understanding!


[SPARK-35300][PYTHON][DOCS] Standardize module names in install.rst

What changes were proposed in this pull request?

Use full names of modules in install.rst when specifying dependencies.
Why are the changes needed?

Using full names makes it more clear.
In addition, pandas APIs on Spark as a new module can start to be recognized by more people.
Does this PR introduce any user-facing change?

No.
How was this patch tested?

Manual verification.

https://github.com/xinrong-databricks/spark/runs/2496911395?check_suite_focus=true linter passed. Merging

Merged to master.


Ignore paths with invalid chars in PathWhich

Fixes #39432

Thanks!

Cherry-picked for 3.4.

Cherry-picked for 3.3.3.


user defined eval metric function has different data interface

Parameter datatypes are different when user defined eval_metric function is used in train function of training api and fit function of scikit-learn api. And the sample code is as follows:
# self-defined eval metric
# f(preds: array, train_data: Dataset) -> name: string, value: array, is_higher_better: bool
# binary error
def eval_metric(preds, train_data):
    labels = train_data.get_label()
    return 'error', np.mean(labels != (preds > 0.5)), False

# Self-defined eval_metric is used in fit function of scikit-learn api, which causes an error
clf = lgb.LGBMClassifier()
clf.fit(X, y, eval_set=[[X,y]], eval_metric=eval_metric, early_stopping_rounds=5)

# Self-defined eval_metric is used in train function of training api, which executes sucessfully
data = lgb.Dataset(data=X, label=y)
lgb.train(params=params, train_set=data, feval=eval_metric, early_stopping_rounds=5, valid_sets=[data])

Self-defined eval_metric function is not universal in these two train methods. The problem exists in _eval_function_wrapper(func) in sklearn.py, and this decorator changes the parameter datatypes.
The code in sklean.py is here: https://github.com/Microsoft/LightGBM/blob/master/python-package/lightgbm/sklearn.py#L113

This design is from xgboost, to make sure the smooth immigration.

Why does your eval_metric take the parameters in the order (preds, train_data)? The docs state the opposite order:

Custom eval function expects a callable with following functions: func(y_true, y_pred)

_eval_function_wrapper(func) seems to swap the arguments, I think your way is correct and the docs are wrong. This is confusing...

The two self defined eval functions are both correct, but apply to different python apis. In training api, we should define eval metric like: eval_metric(preds, train_data), just as the example https://github.com/Microsoft/LightGBM/blob/master/examples/python-guide/advanced_example.py#L149; Whereas in scikit-learn api, the eval metric should be defined like: func(y_true, y_pred) or other formats according to the number of parameters. I think it is confusing and inconvnient either.
I also check the self defined function in xgboost, the self defined objective function defined in the same way, that objective decorator swaps the arguments, but the self defined eval function doesn't consider different numbers of parameters, so it maintain the consistency in the two python apis (training api and scikit-learn api) without any decorator.

Ah ok, thanks for this extensive explanation! So not only the type of the parameters differ between the APIs, but also their order. Most unfortunate. And in addition, for the training api, the functionality is not documented except in the example (or at least I couldn't find it).
Thanks!

@StrikerRUS can you confirm that ?

@tobycheese , for training api, the functionality is documented here: https://github.com/Microsoft/LightGBM/blob/master/python-package/lightgbm/engine.py#L41

@zhangfiona Many thanks for the detailed explanation.
@guolinke

can you confirm that ?

What exactly?
I've just checked the docs and everything seems to be correct (just like @zhangfiona described).
@tobycheese Yes, signatures of eval functions in train/cv differ from those in sklearn wrapper.