sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: java-design-patterns
Issue: Row Data Gateway pattern
Labels: epic: pattern,type: feature

### Description:
The Row Data Gateway pattern provides an object-oriented interface to a single row in a database table, encapsulating the database access logic within a gateway class. This pattern allows for a clear separation between business logic and database operations, enabling more maintainable and testable code.

#### Main Elements of the Pattern:
1. **Gateway Class**: Represents a single row in the database, providing methods for CRUD (Create, Read, Update, Delete) operations.
2. **Database Access Encapsulation**: Database queries and updates are encapsulated within the gateway class, abstracting the underlying database interaction.
3. **Separation of Concerns**: Business logic is separated from database access logic, promoting clean code architecture.
4. **Consistency**: Ensures data consistency by managing row-level data operations through the gateway class.

### References:
1. [Row Data Gateway - Wikipedia](https://en.wikipedia.org/wiki/Row_data_gateway)
2. [Row Data Gateway - Martin Fowler](https://martinfowler.com/eaaCatalog/rowDataGateway.html)
3. [Patterns of Enterprise Application Architecture by Martin Fowler](https://books.google.fi/books?id=vqTfNFDzzdIC&pg=PA303#v=onepage&q&f=false)
4. [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)
5. [Row Data Gateway](https://www.sourcecodeexamples.net/2018/04/row-data-gateway.html)

### Acceptance Criteria:
1. Create a gateway class representing a single row in a database table, with methods for Create, Read, Update, and Delete operations.
2. Ensure that the gateway class encapsulates all database access logic, separating it from the business logic.
3. Provide unit tests demonstrating the functionality of the gateway class, including CRUD operations and data consistency.
Repository: java-design-patterns
Issue: Server Session State pattern
Labels: epic: pattern,type: feature


### Description:
Implement the Server Session State design pattern, which involves maintaining a user's session state on the server. This pattern helps manage user session data efficiently in a scalable and secure manner. The main elements of the pattern include:

- **Session State Management:** Store user session data on the server, reducing the amount of data transferred between client and server.
- **Scalability:** Ensure the system can handle a large number of sessions efficiently by managing session data in a scalable manner.
- **Security:** Protect session data from unauthorized access and ensure it is handled securely.

### References:
- [Martin Fowler's Server Session State](https://martinfowler.com/eaaCatalog/serverSessionState.html)
- [P of EAA](https://books.google.fi/books?id=vqTfNFDzzdIC&pg=PA303#v=onepage&q&f=false)
- [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)

Acceptance Criteria:
1. Implement a server-side session state management system that can handle session data storage and retrieval.
2. Ensure the system is scalable and can manage a large number of user sessions efficiently.
3. Implement security measures to protect session data from unauthorized access and ensure secure handling of session information.
Repository: java-design-patterns
Issue: Table Data Gateway pattern
Labels: info: help wanted,epic: pattern,type: feature

### Description:
The Table Data Gateway pattern provides a way to encapsulate all the SQL operations for a single table or view within a gateway class. This pattern allows for a single point of access to the data in a table, ensuring a clean separation between the database and the application logic. The key elements of the Table Data Gateway pattern include:

- **Gateway Class:** Encapsulates the database access logic for a specific table or view.
- **CRUD Operations:** Methods for Create, Read, Update, and Delete operations.
- **Separation of Concerns:** Decouples the SQL queries from the application logic, promoting single responsibility and easier maintenance.
- **Reusability:** Reusable and testable components that centralize data access logic.

### References:
1. Martin Fowler's Table Data Gateway: [https://www.martinfowler.com/eaaCatalog/tableDataGateway.html](https://www.martinfowler.com/eaaCatalog/tableDataGateway.html)
2. Wikipedia: Table Data Gateway: [https://en.wikipedia.org/wiki/Table_data_gateway](https://en.wikipedia.org/wiki/Table_data_gateway)
3. Source Code Examples: Table Data Gateway: [https://www.sourcecodeexamples.net/2018/04/table-data-gateway.html](https://www.sourcecodeexamples.net/2018/04/table-data-gateway.html)
4. [P of EAA](https://books.google.fi/books?id=vqTfNFDzzdIC&pg=PA303#v=onepage&q&f=false)

### Acceptance Criteria:
1. Implement a gateway class that encapsulates SQL operations for a specific table.
2. Include methods for Create, Read, Update, and Delete operations within the gateway class.
3. Ensure that the gateway class is well-documented and includes unit tests to verify its functionality.
Repository: go
Issue: cmd/vet: structtag field repeats json warning with valid override
Labels: NeedsInvestigation,Tools,Analysis

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.14.1 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/[XX]/Library/Caches/go-build"
GOENV="/Users/[XX]/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/[XX]/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/w9/kv18_grs18x65fyzv1p5mvk00000gn/T/go-build893878327=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

When embedding two structs with duplicate JSON tags, e.g.:

```
type A struct {
   name string `json:"name"`
   ... // additional fields
}

type B struct {
   name string `json:"name"`
   ... // additional fields
}

type C struct {
    A
    B // raises go vet structtag warning
}
```

A `structtag` warning is raised by go vet. I think a reasonable workaround to the warning is to override the duplicate-tag on the top level, per extra rules here: https://golang.org/pkg/encoding/json/#Marshal, e.g.

```
type C struct {
   A
   B
   name string `json:"name"`
}
```

But `go vet` still raises the warning.

**Note** I did add the flag `-structtag=false` as a workaround but there are cases where I would like to be alerted, but only when no override has been set

### What did you expect to see?

`go vet` treats top-level `structtag` overrides as a valid solution and no longer raises a warning.

### What did you see instead?

`go vet` ignores the top-level override, resulting in `structtag: struct field X repeats json tag "[X]" also at XXXX.go:XXX (govet)`
Repository: java-design-patterns
Issue: Transform View pattern
Labels: epic: pattern,type: feature

**Description:**
The Transform View design pattern is a method used to separate the presentation and business logic layers in software development. This pattern involves transforming data from the model into a format suitable for rendering in the view. The key elements of this pattern include:

1. **Data Transformation:** The primary function is to transform raw data from the model into a suitable format for the view.
2. **Separation of Concerns:** This pattern promotes a clean separation between the business logic and the presentation layer, ensuring that changes in the data model do not directly impact the view.
3. **Reusability:** Transformations can be reused across different views, promoting DRY (Don't Repeat Yourself) principles and making the codebase easier to maintain.

**References:**
- [Transform View - Martin Fowler](https://www.martinfowler.com/eaaCatalog/transformView.html)
- [Patterns of Enterprise Application Architecture - Page 303](https://books.google.fi/books?id=vqTfNFDzzdIC&pg=PA303#v=onepage&q&f=false)
- [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)

**Acceptance Criteria:**
1. Implement a Transform View pattern that clearly separates the data transformation logic from the view rendering logic.
2. Ensure the implementation includes at least one example demonstrating the transformation of a data model into a view format.
3. Document the implementation and provide usage instructions and examples in the project README file.
Repository: java-design-patterns
Issue: Two Step View pattern
Labels: epic: pattern,type: feature

### Description:
The Two Step View design pattern is used to separate the process of generating dynamic web content into two distinct phases: data preparation and data presentation. This separation allows for more modular, maintainable, and testable code. The pattern is particularly useful for web applications with complex presentation logic, where it can help to simplify the development and maintenance of views.

Main Elements of the Pattern:
1. **Data Preparation Phase**: In this phase, the raw data is collected and processed into a form that is suitable for rendering. This usually involves gathering data from various sources, performing necessary computations, and organizing it into a structured format.
2. **Presentation Phase**: This phase takes the prepared data and applies a template to generate the final HTML or other output formats. The template defines how the data should be displayed, separating the concerns of data structure and visual presentation.

### References:
- [Martin Fowler's Catalog on Two Step View](https://martinfowler.com/eaaCatalog/twoStepView.html)
- [Patterns of Enterprise Application Architecture by Martin Fowler (Page 303)](https://books.google.fi/books?id=vqTfNFDzzdIC&pg=PA303#v=onepage&q&f=false)
- [Ranjitha Balaraman's Blog on Two Step View](https://ranjithabalaraman.wordpress.com/category/patterns-of-enterprise-application-architecture/web-presentation-pattern/two-step-view/)
- [Thierry Roussel's Notes on HTML Renderer](http://thierryroussel.free.fr/java/books/martinfowler/www.martinfowler.com/isa/htmlRenderer.html)

Acceptance Criteria:
1. Implement the Two Step View pattern by creating a distinct data preparation phase and a presentation phase in the web application.
2. Ensure that the data preparation logic is separated from the presentation logic to promote modularity and maintainability.
3. Provide unit tests to verify the correctness of both the data preparation and presentation phases, ensuring that they work correctly independently and together.
Repository: go
Issue: x/website, x/pkgsite: net/http.ServeMux.Handle example reads poorly if shown as a complete program
Labels: Documentation,NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.14.4 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?
In current package documentation at https://golang.org/pkg/net/http/#example_ServeMux_Handle


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOOS="darwin"
</pre></details>

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->



### What did you expect to see?
Expected example to initiate http.ListenAndServe or equivalent with new ServeMux
<pre>
package main

import (
	"fmt"
	"log"
	"net/http"
)

type apiHandler struct{}

func (apiHandler) ServeHTTP(http.ResponseWriter, *http.Request) {}

func main() {
	mux := http.NewServeMux()
	mux.Handle("/api/", apiHandler{})
	mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
		// The "/" pattern matches everything, so we need to check
		// that we're at the root here.
		if req.URL.Path != "/" {
			http.NotFound(w, req)
			return
		}
		fmt.Fprintf(w, "Welcome to the home page!")
	})
	log.Fatal(http.ListenAndServe(":8080", mux))
}
</pre>


### What did you see instead?
The example immediately exits without serving
<pre>
package main

import (
	"fmt"
	"net/http"
)

type apiHandler struct{}

func (apiHandler) ServeHTTP(http.ResponseWriter, *http.Request) {}

func main() {
	mux := http.NewServeMux()
	mux.Handle("/api/", apiHandler{})
	mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
		// The "/" pattern matches everything, so we need to check
		// that we're at the root here.
		if req.URL.Path != "/" {
			http.NotFound(w, req)
			return
		}
		fmt.Fprintf(w, "Welcome to the home page!")
	})
}
</pre>

I'd be happy to work on this for my first contribution if accepted
Repository: electron
Issue: Distinguish hard and soft reloads from the "devtools-reload-page" event
Labels: enhancement :sparkles:

### Problem Description

It should be possible to understand if the user wanted a soft or a hard reload from the "devtools-reload-page" event, so that it can be hijacked and the correct kind of reload can be then re-triggered. 

### Proposed Solution

Either adding a property for this to the emitted event, or adding a "devtools-hard-reload-page" event, but the latter would be a backwards incompatible change as it wouldn't make sense to emit both events.

### Alternatives Considered

I'm not sure this can be done in other ways, maybe one can inject some custom shortcuts detection logic into the devtools webcontents but that'd be crazy.
Repository: pytorch
Issue: Add a function to convert SyncBatchNorm layers back to BatchNorm Layers
Labels: module: bootcamp,feature,module: nn,triaged

`SyncBatchNorm` provides a classmethod to convert `BatchNorm` layers to `SyncBatchNorm` layers:

https://github.com/pytorch/pytorch/blob/881c1adfcd916b6cd5de91bc343eb86aff88cc80/torch/nn/modules/batchnorm.py#L510-L556

It will be helpful to provide an API to do the reverse conversion as well. 

cc @albanD @mruberry @ayush29feb
Repository: go
Issue: cmd/compile: unnecessary nil pointer check
Labels: Performance,NeedsInvestigation,compiler/runtime

```
package main

type T [8]byte

func f(p *T, i int) byte {
	return p[i]
}
```
This code generates a nil pointer check on `p`.
```
	0x000e 00014 (/Users/khr/gowork/tmp1.go:6)	MOVQ	"".p+32(SP), DX
	0x0013 00019 (/Users/khr/gowork/tmp1.go:6)	TESTB	AL, (DX)           <- nil pointer check
	0x0015 00021 (/Users/khr/gowork/tmp1.go:6)	MOVQ	"".i+40(SP), AX
	0x001a 00026 (/Users/khr/gowork/tmp1.go:6)	NOP
	0x0020 00032 (/Users/khr/gowork/tmp1.go:6)	CMPQ	AX, $8
	0x0024 00036 (/Users/khr/gowork/tmp1.go:6)	JCC	56                       <- bounds check
	0x0026 00038 (/Users/khr/gowork/tmp1.go:6)	MOVBLZX	(DX)(AX*1), AX
	0x002a 00042 (/Users/khr/gowork/tmp1.go:6)	MOVB	AL, "".~r2+48(SP)
	0x002e 00046 (/Users/khr/gowork/tmp1.go:6)	MOVQ	16(SP), BP
	0x0033 00051 (/Users/khr/gowork/tmp1.go:6)	ADDQ	$24, SP
	0x0037 00055 (/Users/khr/gowork/tmp1.go:6)	RET
```
We don't really need a nil pointer check, as the index is bounded by the bounds check.
We can subsume the nil pointer check into the load.

This would require the nil pointer pass to know that indexes are bounded for indexed loads, so it can prove that the load still occurs in the zero page even with the largest possible index.
Maybe we need to keep some information from the prove pass around somehow?
Repository: flutter
Issue: Support motionEventIds in android_view test
Labels: a: tests,engine,a: platform-views,P2,team-engine,triaged-engine
Repository: go
Issue: x/net/html: doesnt support attributes without values ie <script async "foo.js">
Labels: NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.14.4 windows/amd64


</pre>

### Does this issue reproduce with the latest release?
yes


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\rhaksi\AppData\Local\go-build
set GOENV=C:\Users\rhaksi\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\rhaksi\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\dev\bitbucket\kidoz-team\bidder-server\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\rhaksi\AppData\Local\Temp\go-build383668822=/tmp/go-build -gno-record-gcc-switches


</pre></details>

### What did you do?

```
markup := `<!DOCTYPE html>
<html>
	<head>
		<title>.</title>
	</head>
	<body>
		<script async src="test.js"></script>
	</body>
</html>
`
r := strings.NewReader(markup)
doc, err := html.Parse(r)
if err != nil {
	return
}
var writer bytes.Buffer
err = html.Render(&writer, doc)
if err != nil {
	return
}
fmt.Println(writer.String())
```

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->



### What did you expect to see?
The async attribute should have no value.

```
<html>
	<head>
		<title>.</title>
	</head>
	<body>
		<script async src="test.js"></script>
	</body>
</html>
```

### What did you see instead?
The async attribute is rendered with an extra ="" added to it.

```
<html>
	<head>
		<title>.</title>
	</head>
	<body>
		<script async="" src="test.js"></script>
	</body>
</html>
```

async is one of the 25 boolean attributes, it should be either present (value of true) or absent (value of false), and shouldnt have a value assigned.

```
The Boolean Attributes
allowfullscreen
allowpaymentrequest
async
autofocus
autoplay
checked
controls
default
disabled
formnovalidate
hidden
ismap
itemscope
loop
multiple
muted
nomodule
novalidate
open
playsinline
readonly
required
reversed
selected
truespeed
```
Repository: kubernetes
Issue: dnsConfig applies RFC-1123 too broadly to searches
Labels: sig/network,kind/feature,triage/accepted

<!-- Please only use this template for submitting enhancement requests -->

**What would you like to be added**:

RFC-1123 defines restrictions to host names. In Kubernetes, these restrictions are also
applied to object names.

However, for search strings in dnsConfig, names that are perfectly valid according
to [RFC 2181 Section 11](https://tools.ietf.org/html/rfc2181#section-11) are rejected.

An example of this is using underscores in a subdomain:

```yaml
apiVersion: v1
kind: Pod
metadata:
  namespace: default
  name: dns-example
spec:
  containers:
    - name: test
      image: nginx
  dnsPolicy: "None"
  dnsConfig:
    nameservers:
      - 1.2.3.4
    searches:
      - abc_d.example.com
```

Since this is specifying a DNS search string specifically and not the name of an object
in Kubernetes, it seems like this check could be relaxed to allow names that comply with RFC 2181.

Instead this gives the following error:
```
The Pod "dns-example" is invalid: spec.dnsConfig.searches[0]: Invalid value: "abc_d.example.com": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
```

**Why is this needed**:

Workloads that rely on short names can take time to change, which is why the dnsConfig is useful. However, in our case most of the names we need in the search have an underscore. Our current work-around is to re-write resolv.conf from inside the pod.
Repository: pytorch
Issue: max_pool2d always compute indices even when it's not required
Labels: module: nn,triaged,enhancement,module: pooling

https://github.com/pytorch/pytorch/blob/bdc00196d1b63a339a5b9b6aaec44cefe069a6ea/aten/src/ATen/native/Pooling.cpp#L145-L147
Proposed fix by @albanD : 
- if the user explicitly calls, it, they must have a good reason to ask for the indices.
- If they call `torch.max_pool2d`, then in the implementation of this in "ATen/native/Pooling.cpp", we should only use "max_pool2d_with_indices" if the input requires grad. (and add a new kernel that does not return the indices to use in the other case)

cc @albanD @mruberry
Repository: pytorch
Issue: DDP should provide an option for not touching grad of locally unused params
Labels: oncall: distributed,feature,triaged

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
For multi task training with different ranks running different tasks, parameters of inactive tasks are unused locally, even though used globally. By default DDP would allreduce these parameters and update all with the mean of grad across all ranks. Such grad update could trigger the weight decay with some optimizers (such as SGD) even for those inactive tasks on rank. Such weight update would propagate to ranks running active tasks and eventually pollute the grad there. 

## To Reproduce

Steps to reproduce the behavior:

1. Have two ranks R1 and R2. Both of them load the same model.
1. R1 runs task A branch and R2 runs task B branch.
1. After the first iteration, we would see B's grad on R1 and A's grad on R2 get updated.

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->
B's grad on R1 and A's grad on R2 should never get updated as task B is inactive on R1 and task A is inactive on R2.



cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @xush6528 @osalpekar @jiayisuse @agolynski
Repository: flutter
Issue: Don't strip binaries in unoptimized modes.
Labels: c: new feature,engine,P3,team-engine,triaged-engine

This should aid debugging as the symbols will be available directly to debuggers. Today, the unstripped variants are present in the `exe.unstripped` directory. Developers who work on the engine have to manually point their tools to this location.

One potential issue with this is that I am not completely sure if unopt binaries are distributed to cloud buckets. Switching to unstripped binaries in unopt may increase the size of those artifacts. If this is the case, the artifacts must be derived from opt builds anyway.