WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

As for dubbo service test, it is convient to use Generic reference.

But for GooglePb test this approach is not work.

We are going to support google protobuf for Generic reference.

ServiceDefinition should be able to support google protobuf Metadata.

Generic invocation should be able to send json String to GenericFilter.

GenericFilter should be able to parse json String to Google Protobuf Object for the request.

GenericFilter should be able to parse Google Protobuf Object to json String for the response.

For （1）, PR #4011 is going to support that.

For (2), already support by dubbo.

For (3),#4, PR #3975 already fixed that.

For (1) (PR #4011):

we change TypeDefinitionBuilder to use SPI to load TypeBuilderList.

extended TypeBuilder in ProtobufTypeBuilder class, while user is able to extend that.

ProtobufTypedBuilder is able to parse google protobuf class to TypeDefinition.

We keep similar logic as TypeDefinitionBuilder,so the TypeDefiniton generated by GooglePb will be equals to which generate by java POJO.

How to use?

get google protobuf Metadata from ServiceDefinition.

test client get metaData form metaData reporter.

parse google protobuf metadata to json string for the user (eg: Dubbo Admin portal).

TypeDefinition -> json String

send json string with parameter to GenericFilter.

consumer.xml
<!-- generate proxy for the remote service, then demoService can be used in the same way as the
local regular interface -->
<dubbo:reference url ="dubbo://localhost:20880/org.apache.dubbo.demo.protobuf.api.ProtobufDemoService"
id="demoService" check="false" interface="org.apache.dubbo.rpc.service.GenericService" generic="proto"/>

GenericService genericService = context.getBean("demoService", GenericService.class);
String methodName = "sayHello";
String[] requestType = new String[]{GooglePBRequestType.class.getName()};
// TODO this requestStr could generate from serviceMetaData. a new TypeDefinition is create will push next
String requestStr = "{ \"req\": \"some Message\" }";
Object[] request = new Object[]{requestStr};
String hello = (String) genericService.$invoke(methodName,requestType,request);

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.3

Operating System version: mac os

Java version: jdk8

Steps to reproduce this issue

telnet ip:port

ls

help found no invoke command

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps？

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!
Issue 1:
I'm trying to create monorepo which will contain components that are built with typescript and sass. Folder structure looks like this:

packages

components

src

Slider

Slider.ts (import 'Slider.scss')

Slider.scss

Modal

Modal.ts (import 'Modal.scss')

Modal.scss

webpack.config.js

app1

src

index.ts (import Slider from components/src/Slider/Slider)

webpack.config.js

app2

src

index.ts (import Slider from components/src/Slider/Slider)

webpack.config.js

I want to use components in app1 and app2. What I tried is building components with DllPlugin and referencing it in app1 and app2 with DllReferencePlugin, it works well for typescript files, but what about scss, images, fonts and other assets? When building app1 or app2, I want their dist folder to include all assets from components. The reason why I'm not importing directly components/src/Modal without dll plugin is that components folder may have different webpack configuration like alias for example. What's the best practice for accomplishing this?

Issue 2:
I'm trying to create monorepo which will contain components that are built with typescript and sass. Folder structure looks like this:

- packages
- components
- src
- Slider
- Slider.ts (import 'Slider.scss')
- Slider.scss
- Modal
- Modal.ts (import 'Modal.scss')
- Modal.scss
- webpack.config.js
- app1
- src
- index.ts (import Slider from `components/src/Slider/Slider`)
- webpack.config.js
- app2
- src
- index.ts (import Slider from `components/src/Slider/Slider`)
- webpack.config.js

I want to use components in app1 and app2. What I tried is building components with DllPlugin and referencing it in app1 and app2 with DllReferencePlugin, it works well for typescript files, but what about scss, images, fonts and other assets? When building app1 or app2, I want their dist folder to include all assets from components. The reason why I'm not importing directly components/src/Modal without dll plugin is that components folder may have different webpack configuration like alias for example. What's the best practice for accomplishing this?
Issue 1:
Bug report

using <HEAD> in a layout component leads to duplicate tags

Describe the bug

Here is my app.js:

<Provider>
<Layout>
<div>
<Headroom>
<Nav {...pageProps}></Nav>
</Headroom>
<Component {...pageProps} />
<Footer></Footer>
</div>
</Layout>
</Provider>

Here is my Layout.js:

export default ({ title, children }) => { return (
<Fragment>
<Head>
<meta charSet="UTF-8" key="charset"/>
<meta name="viewport" content="width=device-width, initial-scale=1" key="viewport"/>
<title>{title}</title>

<meta name="theme-color" content="#909CA7" key="themecolor"/>
<style dangerouslySetInnerHTML={{ __html: Styles }} key="global-styles"/>
<script src="https://www.google.com/recaptcha/api.js?render=explicit" key="google-recaptcha"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js" key="js-polyfill"/>
<script src="/static/js/dat.gui.min.js" key="dat-gui"></script>
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,500,700" rel="stylesheet" key="google-font-montserrat"></link>
</Head>
{children}
<script
src={`https://maps.googleapis.com/maps/api/js?key=${GOOGLE_MAPS_KEY}&libraries=geometry,places`}
key="google-maps">
</script>
</Fragment>
)
}

Here is my _document.js:

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}

render() {
return (
<html>
<Head />
<body>
<Main />
<div id="global-modal" />
<div id="global-mask" />
<NextScript />
</body>
</html>
)
}
}

On initial render - all of my link tags are duplicated. If I navigate to another route - another identical tag gets added (3 tags now). If I navigate to a different route - yet another tag gets rendered, and so on and so forth. It seems having a component in a layout component is adding to an existing head, instead of replacing it. Is this expected behavior?

A clear and concise description of what the bug is.

component is multiplying identical tags on every route navigation.

Expected behavior

Expect link tags to only be rendered once in global layout component with defined.

System information

OS: [e.g. macOS, Windows]

Browser (if applies) [e.g. chrome, safari]

Version of Next.js: [e.g. 6.0.2]

Mac

Next 8.0.3

Chrome latest

Issue 2:
version: v2.1.1

additional webpack config to next.config.js:

config.module.rules.push(
{test: /\.(png|jpeg)$/, loader: 'url-loader?limit=8192'}
)

then in my component:

import image from '../static/enen.png'

it comes the error:

This module was not found:

* /static/enen.png in ./pages?entry

To install it, you can run: npm install --save /static/enen.png
{ Error: Cannot find module '/static/enen.png'
...

I have tried to change the url as '/static/enen.png' , and in the css-in-jsx:

p {
background-image: url('../static/enen.png')
}
//or
p {
background-image: $(require('../static/enen.png'))
}

all above comes the same error: can't find the module, I can get it using <img src="../static/enen.png"/>

hope your help.
Issue 1:
I've defined two interfaces: (this is synthetic example)

interface BaseNode { next?: this; }
interface SomeNode extends BaseNode { a: number; }

then if i write something like

var node: SomeNode = {a: 1, next: {a: 2, next: {a: 3}}};
var arr = [], i = 0;
while (node) {
arr[i] = node;
i++;
node = node.next; // As expected (no errors)
}
console.log(arr)

then all compiles like a charm. On the other side when I'm trying to write a function that does the same and has the correct signature, I'm getting an error:

function toArray<T extends BaseNode>(node: T): Array<T> {
var arr = [], i = 0;
while (node) {
arr[i] = node;
i++;
node = node.next; // Error: Type 'BaseNode' is not assignable to type 'T'
}
return arr;
}

Should it compile without any errors?

Issue 2:
class A {
self(): this {
return this;
}
}

class T extends A {}

var t: T = new T().self(); // Here is fine.

class B<T extends A> {
a: T;
test(): T {
return this.a.self(); // Here got error: "Type 'A' is not assignable to type 'T'".
}
}
Issue 1:
System information (version)

OpenCV => 3.4 and master

Operating System / Platform => ppc64le GNU/Linux

Compiler => gcc

Detailed description

/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/hal/intrin_vsx.hpp: In function 'cv::hal_baseline::v_uint8x16 cv::hal_baseline::operator<<(const cv::hal_baseline::v_uint8x16&, int)':
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/vsx_utils.hpp:18:77: warning: narrowing conversion of 'imm' from 'int' to 'unsigned char' inside { } [-Wnarrowing]
#define __VSX_S16__(c, v) (c){v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v}
^
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/vsx_utils.hpp:25:31: note: in expansion of macro '__VSX_S16__'
#define vec_uchar16_sp(c) (__VSX_S16__(vec_uchar16, c))
^~~~~~~~~~~
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/hal/intrin_vsx.hpp:533:31: note: in expansion of macro 'vec_uchar16_sp'
{ return _Tpvec(vec_sl(a.val, splfunc(imm))); } \
^~~~~~~
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/hal/intrin_vsx.hpp:541:1: note: in expansion of macro 'OPENCV_HAL_IMPL_VSX_SHIFT_OP'
OPENCV_HAL_IMPL_VSX_SHIFT_OP(v_uint8x16, vec_sr, vec_uchar16_sp)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/vsx_utils.hpp:18:77: warning: narrowing conversion of 'imm' from 'int' to 'unsigned char' inside { } [-Wnarrowing]
#define __VSX_S16__(c, v) (c){v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v}
^
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/vsx_utils.hpp:25:31: note: in expansion of macro '__VSX_S16__'
#define vec_uchar16_sp(c) (__VSX_S16__(vec_uchar16, c))
^~~~~~~~~~~
/worker/buildbot/Power9_Linux_gcc-6__opencv/opencv/modules/core/include/opencv2/core/hal/intrin_vsx.hpp:533:31: note: in expansion of macro 'vec_uchar16_sp'
{ return _Tpvec(vec_sl(a.val, splfunc(imm))); } \
^~~~~~~
....

CI: https://ocv-power.imavr.com/#/builders/5/builds/23

Steps to reproduce

build OpenCV on ppc64le

Issue 2:
System information (version)

OpenCV => 3.4.1

Operating System / Platform => any

Compiler => any

Detailed description

Several bugs were introduced as a fix of the issue #6336. The issue reporter provided an erroneous example in which a camera matrix of a scaled image was computed by simply multiplying the matrix with the scaling factor that was used to scale the image (see my comment in the #6336). OpenCV code for the mentioned functions (and all that depend upon) was correct up until that point and is now buggy and inconsistent.

The following changes, a86a5c7#diff-e0620279a9a42557449008a88b6ed816 and fa42a1c#diff-e0620279a9a42557449008a88b6ed816 should be reverted. If anything else was changed because of #6336 - I only checked the calibration.cpp - revert it as well.

The bugs were partly caused by the lack of the documentation. To reduce false issue reports in the future, the origin of the image coordinate system should be noted in the calib3d documentation.
Issue 1:
Challenge http://www.freecodecamp.com/challenges/waypoint-remove-an-element-using-jquery has an issue.

script tags appear as fccss

Issue 2:
Challenge http://www.freecodecamp.com/challenges/waypoint-create-a-javascript-slot-machine has an issue.

The four Javascript slot machine exercises all display the JS section of the code incorrectly. Presumably fccss is supposed to be <script>, and likewise fcces is supposed to be </script>.
Issue 1:
Opening this issue here since I am pretty sure Pkg has not changed anything, maybe this is related to the libgit2 upgrade (#32806)?

$ julia13 -e 'using Pkg; Pkg.Registry.update()'
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /home/fredrik/.julia/registries/General — failed to fetch from repo
└ @ Pkg.Types ~/julia13/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1189

$ julia12 -e 'using Pkg; Pkg.Registry.update()'
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`

Issue 2:
Hi, I have some thoughts on the edge case return values for the current search API.

Currently, search describes a failure to match as follows:

search(string, "substring") = start:end such that string[start:end] == "substring", or 0:-1 if unmatched.

search(string, 'c') = index such that string[index] == 'c', or 0 if unmatched.

This means that users of this API must handle the case of unmatching with some non-intuitive check. For example:

str = "haystack"
result = search(str, "needle")
if result == 0:-1 # or result[1] == 0 or first(result) == 0
# handle case where no result was found
else
# handle case where result was found
end

It turns out that first(result) == 0 is the condition that handles the three cases for when the object to search for (the needle) is either a string, a character, or a vector of characters since the API has two different return types depending on the the needle type.

The proposal here is to instead throw some type of exception e.g. UnmatchedException.
Issue 1:
OS : MacOS 10.12

TensorVersion : 1.2

PythonVersion : 2.7

Run the example of 'A custom model' in the document 'Getting Started With TensorFlow', occur the exception:

Traceback (most recent call last): File "linear_regression_tf_contrib_learn_custom_model.py", line 35, in <module> eval_loss = estimator.evaluate(input_fn=eval_input_fn) NameError: name 'eval_input_fn' is not defined.

Fix : Need to add the code eval_input_fn = tf.contrib.learn.io.numpy_input_fn({"x": x_eval}, y_eval, 4, num_epochs=1000) at line 30.

Issue 2:
Hello,

I would like to submit that there is a programming bug on line 29 of the "custom model tutorial" within Getting Started with Tensorflow.

The line should read:

input_fn = tf.contrib.learn.io.numpy_input_fn({"x":x_train}, y_train, batch_size=4, num_epochs=1000)

​Best regards.

Jeff​
Issue 1:
Describe the bug

Song Xperia 1 ii

Samsung s21+

Tried the above devices, need to set controls.alphaOffset= 80 in order to locate it to the center area of the camera.

However, there are no problems in iPhone and some of the older Android devices.

Platform:

Device: [Mobile]

OS: [Android, iOS]

Browser: [Chrome]

Three.js version: [r133]

Issue 2:
Hi, I tested this example https://threejs.org/examples/misc_controls_deviceorientation.html

And it seems that the start direction is not consistent between different orientation.

For example, in portrait mode, it will start by facing the wall (with door on left) BUT

if I turn upside down portrait mode, it will start by facing the window, the opposite of the wall with door on the left.

While on landscape mode, it will start by facing the huge window with the table on the right, while the other way of the landscape mode, it will start by facing the opposite side, facing the 3 little windows.

Shouldn't it always start by facing the same object / area of the room?

Is this a known bug?

If not, how can we start the app by facing the same object / area of the room no matter which orientation your device is currently/initially at?

Otherwise user A experience may be different than user B experience when they run the app with their devices at a different orientation.

Thanks.
Issue 1:
See http://is.gd/SH4nll

This fails to print anything since "hey" in only written to the buffer and then never printed. Other BufWriters flush on drop but this isn't happening for Stdout at program exit.

Issue 2:
I know that the new IO is being worked on, but I could see this being a sneaky thing that gets lost.

#![feature(io)]
use std::io::Write;
fn main() {
write!(&mut std::io::stdout(), "Hello world").unwrap();
}

This code prints nothing. If we use stderr instead, there is output.

rustc 1.0.0-nightly (270a677d4 2015-03-07) (built 2015-03-07)
Issue 1:
Minimal working example (Tested on Julia 1.5 and 1.6.)

julia> A = rand(Float32, 2^20);
julia> length(A)-length(unique(A))

Expected behavior

The expected number of duplicates when drawing n times at random from a set of N elements with replacement is equal to (see e.g. Proposition 4.1 in this paper)

expected_number_of_duplicates(N, n) = n - N * (1 - (1 - 1/N)^n)

For drawing a uniform Float32, we therefore expect

julia> expected_number_of_duplicates(2^32, 2^20)
127.98946189880371

Actual behavior

I obtain numbers that are on the order of 60000.

Issue 2:
Pursuant to discussion here: https://discourse.julialang.org/t/map-pmap-and-scalar-argument/30089

Scalars, provided to a function like map or pmap, leads to unexpected behavior:

map(+, 1:2, 1) # [2]

map(+, 1:2, [1]) # ERROR: DimensionMismatch

A user would naively think a scalar would be broadcast or rejected. Treating it as if the user just wanted to process the first element of each argument would be unlikely to be intended.

Based on discussion linked above, it appears to be because scalars are iterable. The code for consuming iterables uses zip() to stitch the arguments together, which takes as many as it can and discards the remainder.

For comparison, here are how some other inputs are treated:

map(+, 1:2, (1,)) # [2]

map(+, 1:2, (1,2)) # [2;4]

map(+, 1:2, (1,2,3)) # [2;4]

map(+, 1:2, (i for i in 1:1)) # ERROR: DimensionMismatch

map(+, 1:2, (i for i in 1:2)) # [2;4]

These are also surprising to me, since documentation suggests a generator is an iterable, but its size is being enforced as if it were an array. Meanwhile, tuples which have a fixed number of elements are treated like an iterator of unknown length.
Issue 1:
I was told at one point Electron would start using Semver after 1.0, but this release for example https://github.com/electron/electron/releases/tag/v1.0.2 adds a lot of features, but as a patch instead of a minor if it was semver.

I looked through the docs for any mention of what the version scheme is but didn't find any, so I think it would be useful if someone can explain what the electron version numbers mean now

Issue 2:
When developing apps for Electron I usually use electron-prebuilt with npm and a semver to track updates. This makes it easier for me to update to newer versions of Electron without worrying too much about my app breaking.

However I just noticed that 1.0.2 was recently released and contained new features compared to 1.0.1, https://github.com/electron/electron/releases/tag/v1.0.2 and not just bug fixes.

Does this mean Electron isn't following semver? If so I'd like to know so I can start pinning the dependency.
Issue 1:
I discovered this issue while using Flux/Zygote. I am training a big and complex model with Julia distributed pmap. It used to be fine under Flux/Tracker but after moving to Zygote, the memory consumption seems to grow overtime. GC.gc() does not work, if one observes memory usage using top in linux or activity monitor in osx, it seems to grow until the program terminates due to out-of-memory by the OS.

It looks like pmap doesn't free the memory generated through the use of Julia's metaprogramming features.

The machines I have experimented on:

versioninfo()

Julia Version 1.5.1
Commit 697e782ab8 (2020-08-25 20:08 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin19.5.0)
CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

Julia Version 1.5.1
Commit 697e782ab8 (2020-08-25 20:08 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)

Minimum working example

using Distributed
addprocs(4)

@everywhere mutable struct A
a::Float32
end

@everywhere function genprog(n, p::A)
map(1:n) do i
y = rand()
mdname = gensym()
expr = :(module $mdname
f(x) = 2*x + $y + $p.a
end
)
m = eval(expr)
Base.invokelatest(m.f, p.a)
end
end

function main()
i = 0
x = A(rand())
while true
println("epoch $(i)")
@everywhere GC.gc()

tasks = rand(1:100, 100)
_, timeTaken, _, _, _ = @timed let x=x
pmap(tasks) do n
genprog(n, x)
end
end
@show timeTaken
x.a = rand()
i += 1
end
end

main()

@MikeInnes , trying to get your attention since you are the author on Zygote/src/compiler/*.jl files

References

probably related issue #14495

https://discourse.julialang.org/t/dynamically-create-and-destoy-modules-to-avoid-memory-leaks-in-program-synthesis/39729

#30653

Issue 2:
Hello guys!

I found a generated code related memory leak issue. I wrote a post about it on julia-lang users group, but it looks like everyone have no time for that. I emailed to @JeffBezanson about this issue and he knows about it. I have no possibility to fix this by myself, because i have no such experience in C. So, i decided to create this issue to track it somehow.

So, here is a problem:

function leak()
for i=1:100000
t = Task(eval(:(function() produce() end)))
consume(t)
try
Base.throwto(t, null)
end
end
gc()
end

Every call of leak() eats ~30mb of memory on my PC. This problem exists on both Linux and Windows platforms.

julia> versioninfo()
Julia Version 0.4.2
Commit bb73f34 (2015-12-06 21:47 UTC)
Platform Info:
System: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: liblapack.so.3
LIBM: libopenlibm
LLVM: libLLVM-3.3
Issue 1:
VSCode Version:

0.10.11

OS Version:

Kubuntu 16.04 LTS Developer branch

Steps to Reproduce:

I have a .cc file with the following contents.

if B4G_DEBUG_CHECK

fprintf(stderr,"num_candidate_ret=%d:", num_candidate);

for(int i=0;i<num_candidate;++i)

fprintf(stderr,"%d,",user_candidate[i]);

fprintf(stderr,";");

endif

Observe that syntax highlighting for any statements following the fprintf(stderr,";"); assumes that the following lines are contained within the double quote and they show up in red. Apparently the ; inside the double quote is misinterpreted as the end of a statement. The "); on the same line is already shown in all red color, and all following lines are too - unless they contain another double quote. In this case the string inside the double quote is shown as if it was a code statement.

Partial screenshot attached.

Issue 2:
VSCode Version: 0.10.11

OS Version: Windows 7

Issue 1:

In the following code (using C++ syntax highlighting), the string literal(s) are not highlighted at all.

This issue is exclusive to C++ syntax highlighting and does not occur with C syntax highlighting.

Code:

int main()
{
printf("%s\n", "a string");
}

Result

Issue 2:

In custom tmLanguage based colorizers that reference source.c from within rules that begin with certain patterns, the inlined C highlighting is incorrect (this issue also applies to rules using source.c++ but does not occur in rules using source.js).

Code

(See https://github.com/SE2Dev/VSCode-BugExample)

Result