WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Hi,

I noticed that datetime parsing for large sql/csv tables is really slow. Would it be acceptable to use a technique where repeated calculations are cached? For example, instead of:

def parse_date(date_str) :
return datetime.datetime.strptime(date_str,FMT)
def parse_date_col(str_col) :
return [parse_date(date_str) for date_str in str_col]

use

def parse_date(date_str) :
return datetime.datetime.strptime(date_str,FMT)
def parse_date_col(str_col) :
cache = dict()
for date_str in str_col :
if date_str not in cache :
cache[date_str] = parse_date(date_str)
return [cache[date_str] for date_str in str_col]

The reason this works is that string hashing / comparison / dictionary insertion is much much faster than strptime.

For tables where dates are repeated many times this can result in orders of magnitude speedup.

Thanks

Charles

Issue 2:
I just upgrage from 0.11 to 0.12 version. And meet dataframe rename error caused by upgrading. (It worked well in 0.11) .

>>> df4
TClose RT TExg
STK_ID RPT_Date
600809 20130331 22.02 0.0454 0.0422

>>> df5
STK_ID RPT_Date STK_Name TClose
STK_ID RPT_Date
600809 20120930 600809 20120930 山西汾酒 38.05
20121231 600809 20121231 山西汾酒 41.66
20130331 600809 20130331 山西汾酒 30.01

>>> k=pd.merge(df4, df5, how='inner', left_index=True, right_index=True)
>>> k
TClose_x RT TExg STK_ID RPT_Date STK_Name TClose_y
STK_ID RPT_Date
600809 20130331 22.02 0.0454 0.0422 600809 20130331 山西汾酒 30.01

>>> k.rename(columns={'TClose_x':'TClose', 'TClose_y':'QT_Close'})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "d:\Python27\lib\site-packages\pandas\core\base.py", line 40, in __repr__
return str(self)
File "d:\Python27\lib\site-packages\pandas\core\base.py", line 20, in __str__
return self.__bytes__()
File "d:\Python27\lib\site-packages\pandas\core\base.py", line 32, in __bytes__
return self.__unicode__().encode(encoding, 'replace')
File "d:\Python27\lib\site-packages\pandas\core\frame.py", line 668, in __unicode__
self.to_string(buf=buf)
File "d:\Python27\lib\site-packages\pandas\core\frame.py", line 1556, in to_string
formatter.to_string()
File "d:\Python27\lib\site-packages\pandas\core\format.py", line 294, in to_string
strcols = self._to_str_columns()
File "d:\Python27\lib\site-packages\pandas\core\format.py", line 239, in _to_str_columns
str_columns = self._get_formatted_column_labels()
File "d:\Python27\lib\site-packages\pandas\core\format.py", line 435, in _get_formatted_column_labels
dtypes = self.frame.dtypes
File "d:\Python27\lib\site-packages\pandas\core\frame.py", line 1696, in dtypes
return self.apply(lambda x: x.dtype)
File "d:\Python27\lib\site-packages\pandas\core\frame.py", line 4416, in apply
return self._apply_standard(f, axis)
File "d:\Python27\lib\site-packages\pandas\core\frame.py", line 4491, in _apply_standard
raise e
TypeError: ("'NoneType' object is not iterable", u'occurred at index TExg')

>>> df4.dtypes
TClose float64
RT float64
TExg float64
dtype: object

>>> df5.dtypes
STK_ID object
RPT_Date object
STK_Name object
TClose float64
dtype: object
>>>
Issue 1:
.

Issue 2:
I'm trying to get inner_hits to work on an a two level deep has_child query, but the grandchild hits just seem to return an empty array. If I specify the inner hits at the top level I get the results I want, but its rather too slow. Using inner hits on the has child query seems much faster, but doesn't return the grandchild hits.

Below is an example query:

{
"from" : 0,
"size" : 25,
"query" : {
"has_child" : {
"query" : {
"has_child" : {
"query" : {
"filtered" : {
"query" : {
"multi_match" : {
"query" : "asia",
"fields" : [ "_search" ],
"operator" : "AND",
"analyzer" : "library_synonyms",
"fuzziness" : "1"
}
},
"filter" : {
"and" : {
"filters" : [ {
"terms" : {
"range" : [ "Global" ]
}
} ]
}
}
}
},
"child_type" : "document-ref",
"inner_hits" : {
"name" : "document-ref"
}
}
},
"child_type" : "class",
"inner_hits" : {
"size" : 1000,
"_source" : false,
"fielddata_fields" : [ "class" ],
"name" : "class"
}
}
},
"fielddata_fields" : [ "name" ]
}

The document-ref inner hits just always returns an empty array. Should this work (and, if so, any ideas why it isn't?), or is it beyond the means of what inner hits can currently do?
Issue 1:
I'm submitting a ... (check one with "x")

[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Response from jsonp requests is:

Uncaught ReferenceError: __ng_jsonp____req0_finished is not defined
at VM4511 recent?access_token=12345…&callback=__ng_jsonp__…:1
(anonymous) @ VM4511 recent?access_token=12345…&callback=__ng_jsonp__…:1

Followed JSONP tutorial in the HTTP Client - ts docs for angular 2. Heres my code:

I have gotten a correct response and payload when using callback="__ng_jsonp____req0.finished so I know my url and auth is correct

Service

import { Injectable } from '@angular/core';
import { Jsonp } from '@angular/http';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';

@Injectable()
export class LandingService {

constructor(private jsonp: Jsonp, private http: Http) {}

myFunction() {

let request: string;
let result: any;

request = "https://api.instagram.com/v1/users/self/media/recent?callback=JSONP_CALLBACK";
result = this.jsonp.get(request).map(response => response.json());
return result;
}

}

Component

import { Component } from '@angular/core';
import { LandingService } from '../../services/landing.service';

@Component({
selector: 'app-landing',
templateUrl: './landing.component.html',
styleUrls: ['./landing.component.scss']
})
export class LandingComponent implements OnInit {

constructor(private landing: LandingService) {

this.landing.myFunction().subscribe(data => console.log(data));

}
}

Module

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { AppRoutingModule } from './app-routing.module';
import { LandingService } from './services/landing.service';

import { AppComponent } from './app.component';
import { LandingComponent } from './components/landing/landing.component';

@NgModule({
declarations: [
AppComponent,
LandingComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
JsonpModule,
AppRoutingModule
],
providers: [ LandingService ],
bootstrap: [AppComponent]
})
export class AppModule { }

Angular version:

2.4.7

Issue 2:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

hello, after upgrade to 2.4.6, I get Uncaught ReferenceError: __ng_jsonp____req0_finished is not defined as #13219 (comment)

Plunkr

http://plnkr.co/edit/WcRnPrJHa04rJy3xTIky?p=preview

And my code is

search(key: string) {
const params = new URLSearchParams()
params.set('key', key)
params.set('jsonpCallback', 'JSONP_CALLBACK')
return this.jsonp.get('https://c.y.qq.com/splcloud/fcgi-bin/smartbox_new.fcg?' + params)
.toPromise()
.then(res => {
console.log(res)
return []
})
}
Issue 1:
Not sure if this is a great idea since I solved this problem for myself by buying a GPU with a lot of memory, but...

One of the ways that is suggested to get models running on smaller GPUs is by reducing the batch size, however given the fact that the batch size is meaningful for the optimization procedure as well as the actual execution, it may be useful to decouple the batches that gradients are computed with vs the batches that are used to do optimization steps, i.e. run several smaller physical batches where gradients are accumulated across batches before a gradient step is taken.

Issue 2:
Most of keras is compatible with numpy / scipy.

It would be awesome ( and probably competitively fast at inference on cpu) if keras was available with a numpy/scipy backend.

This would help simplify inference significantly on a variety of machines ( in my case a non-raspbery pi arm computer). It would also be very fast.

Alternatively a simplified keras inference engine that does not require tensorflow/cntk would great as well.

Here is a link to something similar that unfortunately lost maintenance: https://github.com/riga/tfdeploy
Issue 1:
I think I have noticed a problem with Generic Methods, not properly inferring their types, when they are used as a value, instead of as a method. I'm not sure if it's a known issue or not.

It's easy enough to work around by using a function, but I'd prefer to just hand in the method, since it's already a method that can be called.

This case is in Rx, but I've seen other examples of it too.

var observableOfAny = Observable.from(items)
.flatMap(Observable.from); // using as a variable doesn't work

var observableOfString = Observable.from(items)
.flatMap(x => Observable.from(x)); // Using a delegate works

var fromString: (arr: string[]) => Observable<string> = Observable.from;
var observableOfString = Observable.from(items)
.flatMap(fromString); // Properly casting the method works

I've got an example, again using rx interfaces (so maybe something is wrong with them? it's possible). playground example

Issue 2:
The following code snippet compiles without type errors though the type variable T is constrained to string type.

function foo1(f: (s: string) => string)
{
return f("hello world");
}

function foo2(f: (s: number) => number)
{
return f(123);
}

function genericBar<T extends string>(arg: T): T
{
return arg;
}

var x1 = foo1(genericBar);
var x2 = foo2(genericBar);

Non generic version nonGenericBar works as expected.

function nonGenericBar(arg: string)
{
return arg;
}

var y1 = foo1(nonGenericBar);
var y2 = foo2(nonGenericBar); // Type error

Of course, genericBar function is useless because constraining a type variable to a primitive type can be replaced by a non generic function like nonGenericBar. However, the behaviour is somewhat unexpected and inconsistent.
Issue 1:
Any chance to add props support in stylesheet creation?

@withStyles(createStyleSheet('Calendar', theme => ({
highlight: {
backgroundColor: props => props.highlightCurrentDateColor,
},
})))
export default class Calendar extends React.Component {

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

Expected Behavior

My code is compiling, but I get an error in the console: Uncaught TypeError: (0 , _styles2.default) is not a function

Current Behavior

My code isn't rendering, with the above error.

Steps to Reproduce (for bugs)

Link to codesandbox: https://k5v039k8mv.codesandbox.io/

Download react@15.6.2, react-dom@15.6.2, material-ui@1.0.0-beta.20 (Devextreme DataGrid relies on this version, but it isn't involved with this component)

Get sample code from material-ui website ( Component - Text input - Search)

Edit it so it only shows the search text input ( I may have made an error in doing this, i'm not sure )

npm start which leads to 'Error: uncaught TypeError: (0 , _styles2.default) is not a function'

Context

Your Environment

Tech
Version

Material-UI
v1.0.0-beta.20

React
v15.6.2

react-dom
v15.6.2

browser
61.0.3163.100 (Official Build) (64-bit)
Issue 1:
Environment

Windows build number: Microsoft Windows [Version 10.0.18363.476]
Windows Terminal version (if applicable): 0.6.2951.0

Any other software?

Steps to reproduce

I am using a Microsoft Surface Pro 7, along with a Surface dock and two external monitors. I expect that this issue is related to scaling (a common problem in my setup).

My Surface's display is set to 200% scaling, while my two external monitors are set to 100% scaling.

As I dock and undock, lock and unlock, throughout the day, Terminal can get into some funny visual states. Usually I can get everything working again by "restoring" (Windows + Down) and "maximizing" (Windows + Up), but today when I did that I cannot see all of my tabs without scrolling (see screenshot), even though there is plenty of space to display them.

Expected behavior

I would expect that all of the tabs are visible next to each other, since there is enough room to display them.

Actual behavior

I have 4 tabs open, but only one is showing; I have to scroll to see the rest of them.

I later found that if I close one of the tabs, all of the others will suddenly become visible. I didn't try adding a tab, but that might fix it, too?

Issue 2:
Environment

commit 0846464

Steps to reproduce

Set some left padding eg. 20.

Make some selection or just click one cell.

In some other place try to make new selection that starts at first char in line. But don't point cursor directly on the first char, but instead little to the left, on the "padded" area.

Expected behavior

Selection should start at first character in line.

Actual behavior

Previous selection is continued.

This is also the case for other padding sites (e.g. selecting line form right to left), but left is most noticable.
Issue 1:
Using cmd + d to select multiple instances isn’t working correctly for me:

Note that the first two selections work fine, but when it goes to find the third instance of h3, it instead ends up selecting a linebreak or two and an angle bracket < immediately prior to the next instance of h3.

Also note that repeating the command again after the third (incorrect) selection skips the next three instances of h3 (the closing tag of the "Payload" heading, and both occurances of the "Headers" heading), and repeats the same incorrect selection on the next h3 opening tag.

Issue 2:
Observed behavior:

Expected behavior: In the example above, the find-and-replace:select-next command should only select the next occurrence of ##. It should not select any surrounding newlines.

I observed this behavior in find-and-replace v0.79.0.
Issue 1:
The primitives provided in task and comm are very primitive. Too primitive to write a tutorial chapter about without sounding completely lame. So I tried to write a helper function which helps create a channel back from a child task to its parent. None of the existing tests or examples seem to do this. And, apparently, with good reason.

Below is what I have. It doesn't work. Writing new task-creation utilities will typically require type parameters. We currently can not spawn functions with type parameters, so the 'landing pad' helper that such a utility would spawn can not be generic.

I half got around this with a clunky reinterpret_cast, but the resulting program doesn't work when the To type has a different size than an int, because the port being created in helper doesn't know its type.

Not being able to write generic utility functions around task spawning seems unacceptable. I'm marking this as a blocker because I don't think we can release a language that is supposed to have tasks as one of its interesting features with such a primitive set of task operations. I'm holding off on writing the tutorial section about tasks until we figure out a solution here. (Or maybe it already exists and I just didn't see it.)

use std;
import std::{task, comm};

type connected_fn<To, From> = fn(comm::port<To>, comm::chan<From>);
fn spawn_connected<uniq To, uniq From>(f: connected_fn<To, From>)
-> {task: task::task, in: comm::port<From>, out: comm::chan<To>} unsafe {
fn helper(d: (comm::chan<int>,
comm::chan<comm::chan<int>>,
connected_fn<int, int>)) {
let (out, send_in, f) = d;
let in = comm::port::<int>();
comm::send(send_in, comm::chan(in));
f(in, out);
}
let in = comm::port::<From>();
let get_out = comm::port::<comm::chan<To>>();
let task = task::spawn((comm::chan(in), comm::chan(get_out), f),
std::unsafe::reinterpret_cast(helper));
ret {task: task, in: in, out: comm::recv(get_out)};
}

tag msg { msg(int); quit; }

fn worker(in: comm::port<msg>, out: comm::chan<int>) {
while true {
alt comm::recv(in) {
msg(i) { comm::send(out, i * 10); }
quit. { break; }
}
}
}

fn main() {
let {task, in, out} = spawn_connected(worker);
comm::send(out, msg(20));
log_err comm::recv(in);
comm::send(out, quit);
}

Issue 2:
fn main() {
fn# foo<T>() { }

// This wants to build a closure over type int,
// but there's no way to do that while still being a bare function
let f: fn#() = foo::<int>;
}

As a result we can't do bare-fn spawn for generic functions, which is pretty important:

#[test]
fn spawn_polymorphic() {
fn# foo<~T>(x: T) { log_err x; }

task::spawn2(true, foo);
task::spawn2(42, foo);
}
Issue 1:
I would like to be able to choose a string of keys or a macro key to use to change between the difference fancy zone layouts/ templates that I have.

Issue 2:
Support for multiple keyboards / differentiating input from multiple keyboards

It would be incredible if we could differentiate the input from different keyboards and remap keys/shortcuts from a particular device. (I think to your point at 2.6.3 here: https://github.com/microsoft/PowerToys/wiki/Keyboard-Manager#263-multiple-keyboards--shortcut-support). Use cases would be setting up a seperate numberpad or second keyboard would include:

Use as a macropad or external shortcut device

Productivity enhancement for custom shortcuts in video editing, content creation, or Photoshop

A replacement for expensive 3rd party solutions like Elgato Streamdeck

As an external controller/HID for gaming / sims

Triggering custom scripts via something like AutoHotkey

There's a large community creating macropads, but at the moment the process in doing so in Windows is quite difficult, requiring either proprietary and expensive hardware and bundled software, or trying to do something like flash a keyboard's firmware with QMK, or using HIDMacros (which is deprecated and no longer maintained), etc. Implementing keyboard-specific key detection would eliminate a lot of complexity for a lot of people!

Thanks for your consideration!
Issue 1:
Thomas Whitmore opened SPR-2009 and commented

Custom PropertyEditors registered in the context could be widely useful for Data Binding, but unfortunately are not used in a thread-safe manner by the Data Binder.

The Bean Factory does use these in a thread-safe manner; by synchronizing; but it is not clear that this would be suitable for heavy load of request-processing. Synchronizing on each individual editor, or establishing a well-defined API to 'duplicate' editors treating the original only as a template, might be solutions.

For the moment I'm keeping registration of these to the Controller. InitBinder() method - instantiating the editors there. This is safe, but if editors worked better I could quite widely genericize my code.

Other people have noticed small versions of this problem (#4799) but I think this may be a fairly major case. OTOH, maybe you've already got this addressed for the Spring-2 target.

What I was intending to do, that could be useful at the Framework level, is a ' Reference Editor ' converting between Hibernate object references <-> IDs in string form. Registering one of these with for your intended Target Class would then make all fields, combo boxes etc referencing this type automatically bound. My code picks up Hibernate metadata & types of simple identifiers to parse these automatically.

FYI.

Keep up the good work!

Cheers,

Thomas

Affects: 1.2.8

Issue 2:
Kenny MacLeod opened SPR-4431 and commented

It occurred to me that a neat application of autowiring would be the ability to autowire logger objects.

Say a class declares something like:

private @Autowired Log logger;

where Log is from commons-logging. Spring would then generate a Log object for the declaring class and then inject it.

I don't think this can be done using the existing resolveResolvableDependency mechanism, since information about the dependent class isn't made available in order to create the Log.

Thoughts?

Attachments:

IAutowireCandidateFactory.java (241 bytes)

Log.java (566 bytes)

LoggerAutowireFactory.java (1.14 kB)

LogPostProcessor.java (1.31 kB)

PluggableAutowireCandidateResolver.java (2.10 kB)

Issue Links:

#9110 Support @autowiring of Loggers ("is duplicated by")

11 votes, 14 watchers
Issue 1:
Is there an existing issue for this?

I have searched the existing issues

Current Behavior

npm x -q --yes --package=<package>@<version> -- <command> doesn't honor <version>, uses incompatible package that is locally available instead.

Expected Behavior

npm x -q --yes --package=<package>@<version> -- <command> honors <version>, does not uses incompatible package that is locally available instead.

Steps To Reproduce

Write this package.json:

{
"private": true,
"devDependencies": {
"pnpm": "=6.12.1"
}
}

Run npm i

pnpm@6.12.1 is now installed locally.

$ npm x -q --yes -- pnpm --version
6.12.1

Run pnpm 6.13.0 now: npm x won't honor the version

$ npm x -q --yes --package="pnpm@6.13.0" -- pnpm --version
6.12.1

The docs for npm exec state:

Package names provided without a specifier will be matched with whatever version exists in the local project. Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency.

Environment

OS: macOS 11.4

Node: 16.5.0

npm: 7.21.0

Issue 2:
Current Behavior:

running npx @package@version generate it with the current install version

Expected Behavior:

it should be generated with the given version

Steps To Reproduce:

ex. steps to reproduce the behavior:

run npm i -g npm@latest to install npm 7

run npx @angular/cli@next new

answer all questions of the angular cli, it doesn't matter what the answers are

it will install angular 11 (while next is 12)

Environment:

OS: Windows 10

Node: 14.16.1

npm: 7.12.0 (working fine with 6.14.13)
Issue 1:
When specifying one index only, it makes sense to throw this. When querying on multiple indexes, this should be thrown only if none of the indexes were found. Details on non-existing indices can be embedded in the response, letting the consumer decide if this result is desired or not.

At least have the option of having this configurable.

This is very important to have for scenarios like the "log file indexing" scenario @kimchy talks about

Issue 2:
For applications using daily indexes it would be useful if elasticsearch didn't return an error if at least one of the specified indexes existed. Currently before each query I need to check what indexes exist incase a daily index was removed outside my application . If the current behavior is required, then maybe add a flag for new behavior?

Reproduce:

curl http://localhost:9200/sessions-120813/session/1 -d '{"test": 1}'

curl 'http://localhost:9200/sessions-120812,sessions-120813/session/_search?query=test:1'

{"error":"IndexMissingException[[sessions-120812] missing]","status":404}

Desired response:

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"sessions-120813","_type":"session","_id":"1","_score":1.0, "_source" : {"test": 1}}]}}