sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: java-design-patterns
Issue: Binding Properties pattern
Labels: epic: pattern,type: feature

### Description
The Binding Properties design pattern is used to synchronize state between different components or objects in a system, ensuring that changes in one part are automatically reflected in another. This pattern is particularly useful in scenarios involving UI components and their underlying data models, where maintaining consistent state across various elements is crucial.

**Main Elements of Binding Properties Pattern:**
1. **Observable Property**: A property whose changes can be observed by other objects.
2. **Observer**: An object that subscribes to changes in the observable property and updates itself accordingly.
3. **Binding Mechanism**: The infrastructure that connects the observable properties with their observers, facilitating the automatic update process.
4. **Two-Way Binding**: An optional feature where changes in either the observable property or the observer can propagate in both directions.

### References
1. [Java Design Patterns Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)
2. [Binding Properties Design Pattern - Wikipedia](https://en.wikipedia.org/wiki/Observer_pattern#Binding_properties)
3. [Binding Properties in WikiWikiWeb](http://c2.com/cgi/wiki?BindingProperties)

### Acceptance Criteria
1. **Implementation of Observable Property**: Create a class representing an observable property that allows observers to register and unregister, and notifies them of changes.
2. **Observer Interface**: Define an interface for observers that requires an update method, which will be called when the observable property changes.
3. **Binding Mechanism**: Develop the infrastructure to link observable properties with their observers, supporting at least one-way binding. Optionally, implement two-way binding functionality.

Please ensure that the implementation adheres to the project contribution guidelines and includes appropriate documentation and test cases.
Repository: java-design-patterns
Issue: Join pattern
Labels: epic: pattern,type: feature

**Description:**
The Join design pattern allows multiple concurrent processes or threads to be synchronized such that they all must complete before any subsequent tasks can proceed. This pattern is particularly useful in scenarios where tasks can be executed in parallel but the subsequent tasks must wait for the completion of these parallel tasks.

**Main Elements of Join Pattern:**
1. **Task Execution:** Multiple tasks are executed concurrently.
2. **Synchronization Point:** A join point where all tasks must converge and synchronize.
3. **Completion Handling:** After all tasks reach the join point, subsequent tasks can proceed.

**References:**
- [Join pattern on Wikipedia](https://en.wikipedia.org/wiki/Join-pattern)

**Acceptance Criteria:**
1. Implement a `JoinPattern` class demonstrating the synchronization of multiple threads using the join pattern.
2. Include a comprehensive unit test that validates the correct synchronization and execution order of threads.
3. Ensure the implementation follows the project contribution guidelines as outlined in the [wiki](https://github.com/iluwatar/java-design-patterns/wiki).
Repository: java-design-patterns
Issue: Scheduler pattern
Labels: epic: pattern,type: feature

### Description
The Scheduler design pattern is a behavioral pattern used to manage the execution of tasks. This pattern is particularly useful in scenarios where tasks need to be executed at specific intervals or under specific conditions. The Scheduler pattern typically involves a scheduler component that manages task execution, a task component that defines the executable units of work, and a trigger or condition that initiates task execution.

**Main elements of the Scheduler pattern:**
1. **Scheduler:** Manages the execution of tasks, determining when and how often they should run.
2. **Task:** Represents the work to be performed, encapsulating the logic for execution.
3. **Trigger/Condition:** Specifies the criteria or schedule for task execution, such as time intervals or specific events.
4. **Execution Context:** Provides the environment in which tasks are executed, handling necessary resources and states.

### References
- [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)
- [Scheduler Pattern - Wikipedia](https://en.wikipedia.org/wiki/Scheduling_(computing))

### Acceptance Criteria
1. Implement the Scheduler component to manage and execute tasks based on defined triggers or conditions.
2. Define and implement a Task interface that encapsulates the logic for various tasks.
3. Create examples demonstrating the usage of the Scheduler pattern with different types of triggers/conditions and tasks.
Repository: java-design-patterns
Issue: Proactor pattern
Labels: epic: pattern,type: feature

**Description:**
The Proactor design pattern is an asynchronous programming pattern used to efficiently handle multiple concurrent operations. In this pattern, the application initiates asynchronous operations and a separate handler (the Proactor) deals with the completion of these operations. The Proactor pattern is useful in scenarios where the system needs to handle a high number of I/O operations, such as in network servers and high-performance computing applications.

**Main Elements of Proactor Pattern:**
1. **Initiator:** The component that initiates asynchronous operations.
2. **Asynchronous Operation:** The operations that are performed asynchronously, often related to I/O tasks.
3. **Completion Handler:** A callback or handler that is invoked when the asynchronous operation is complete.
4. **Proactor:** The dispatcher that manages the completion of asynchronous operations and invokes the appropriate handlers.
5. **Operation Result:** The data or result obtained after the completion of the asynchronous operation.

**References:**
1. [Proactor Design Pattern - Wikipedia](https://en.wikipedia.org/wiki/Proactor_pattern)
2. [Asynchronous I/O - Proactor Pattern](https://www.dre.vanderbilt.edu/~schmidt/PDF/proactor.pdf)

**Acceptance Criteria:**
1. The implementation should include a clear separation of the main elements: Initiator, Asynchronous Operation, Completion Handler, and Proactor.
2. A working example demonstrating the Proactor pattern in a real-world scenario, such as a network server handling multiple simultaneous connections.
3. Comprehensive unit tests to verify the correct behavior of each component in the pattern, ensuring robustness and reliability.
Repository: java-design-patterns
Issue: Active Record pattern
Labels: info: help wanted,epic: pattern,type: feature,status: stale

### Description
The Active Record design pattern is a common architectural pattern used to manage database records. It simplifies data access by encapsulating the database logic within a model class. Each instance of the model corresponds to a row in the database, and the model class includes methods for CRUD (Create, Read, Update, Delete) operations.

#### Main Elements of Active Record Pattern:
1. **Model Class**: Represents a table in the database. Each instance represents a single row.
2. **CRUD Operations**: Methods for Create, Read, Update, and Delete operations are defined within the model.
3. **Database Connection**: The model class manages the database connection.
4. **Simple Queries**: Basic querying capabilities are encapsulated within the model.

### References
- [Active Record Pattern - Martin Fowler](https://martinfowler.com/eaaCatalog/activeRecord.html)
- [Java Design Patterns Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)
- [Active Record Wikipedia](https://en.wikipedia.org/wiki/Active_record_pattern)

### Acceptance Criteria
1. A new model class should be created, representing a database table.
2. The model class should include methods for basic CRUD operations.
3. The implementation should adhere to the project’s contribution guidelines and include relevant documentation and unit tests.
Repository: java-design-patterns
Issue: Facet pattern
Labels: epic: pattern,type: feature

### Description:
The Facet design pattern is used to represent different aspects or views of an object, allowing an object to expose multiple interfaces that reflect different facets of its functionality. This pattern is useful in situations where an object needs to be interacted with in various ways depending on the context or role.

**Main Elements of the Facet Design Pattern:**
1. **Core Object**: The primary object that contains the core data and functionality.
2. **Facet Interfaces**: Interfaces that represent different aspects or views of the core object. Each interface provides a specific subset of the core object's functionality.
3. **Facet Implementations**: Concrete classes that implement the facet interfaces, often acting as wrappers around the core object to provide the necessary views or functionalities.

### References:
- [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)
- [Facet - A Pattern for Dynamic Interfaces](https://www.hillside.net/plop/plop2002/final/plop2002_ecrahen0_0.pdf)

### Acceptance Criteria:
1. A core object should be identified or created that contains the primary data and functionality.
2. Multiple facet interfaces should be defined, each representing a different view or aspect of the core object.
3. Concrete classes implementing the facet interfaces should be created, providing the necessary views or functionalities by interacting with the core object.
4. Unit tests should be written to ensure that the facet interfaces and their implementations correctly interact with the core object and provide the expected functionalities.
Repository: go
Issue: tour: add a thorough discussion of the io interfaces
Labels: help wanted

We ask the reader to implement an `io.Reader`, but it doesn't actually read from anything. It can be hard to see why this is a "Reader", or indeed what a "Reader" is. I think we need more detail on this topic.
Repository: youtube-dl
Issue: f4m and hls using the external downloader
Labels: request

i'm asking if it is possible to make f4m and hls downloading the segments using the external downloader if the --externl-downloader option is used.
as i see in the code the F4mFD is using HttpFD and the NativeHlsFD use the compat_urllib_request.
it even possible to share the downloading part of the HlsFD and NativeHlsFD and the only difference is how to combine the segments together.
i made a simple script to download m3u8 segments and create a m3u8 video file working with the local parts(you can play it without combining the parts).
and it simple to combine the files just make the m3u8 result file as the input of the ffmpeg.
it depends on m3u8 module and the aria2 but it's possible to make it work with other downloaders.
[M3U8 downloader](https://gist.github.com/remitamine/2e0cbef7d50e8e7ef2d2)
Repository: go
Issue: x/review/git-codereview: provide better error message when upstream is not set
Labels: NeedsInvestigation

When a branch's upstream is not set, the error message is cryptic. This just happened to me as a consequence of switching branches before mailing a CL. Here's a sample bash transcript to illustrate the issue and to provide a fix for any issue spelunkers who find this in the meantime.

``` bash
$ # do work
$ git change branch1
$ # decide branch2 is a better name
$ git checkout -branch branch2
$ git branch -D branch1
$ git mail
git rev-parse --abbrev-ref branch2@{u}
fatal: ambiguous argument 'branch2@{u}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
branch2@{u}

git-codereview: exit status 128
$ # fix the problem
$ git branch --set-upstream master branch2
$ git mail
remote: Processing changes: new: 1, done    
...
```
Repository: go
Issue: x/image/tiff: index out of range
Labels: help wanted,NeedsInvestigation

The following program:

``` go
package main

import (
    "bytes"
    "golang.org/x/image/tiff"
    "io/ioutil"
    "os"
)

func main() {
    data, _ := ioutil.ReadFile(os.Args[1])
    tiff.Decode(bytes.NewReader(data))
}
```

on this file:
https://drive.google.com/file/d/0B20Uwp8Hs1oCdDhyRzAwbE5qc2M/view?usp=sharing
crashes as follows:

```
panic: runtime error: index out of range

goroutine 1 [running]:
io/ioutil.readAll.func1(0xc8200436c0)
    src/io/ioutil/ioutil.go:30 +0x11e
golang.org/x/image/tiff/lzw.(*decoder).decode(0xc8200b1300)
    src/golang.org/x/image/tiff/lzw/reader.go:187 +0x75b
golang.org/x/image/tiff/lzw.(*decoder).Read(0xc8200b1300, 0xc8200cb001, 0xdff, 0xdff, 0x201, 0x0, 0x0)
    src/golang.org/x/image/tiff/lzw/reader.go:141 +0x19e
bytes.(*Buffer).ReadFrom(0xc820043618, 0x7f23a2e99518, 0xc8200b1300, 0x1001, 0x0, 0x0)
    src/bytes/buffer.go:173 +0x23f
io/ioutil.readAll(0x7f23a2e99518, 0xc8200b1300, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
    src/io/ioutil/ioutil.go:33 +0x154
io/ioutil.ReadAll(0x7f23a2e99518, 0xc8200b1300, 0x0, 0x0, 0x0, 0x0, 0x0)
    src/io/ioutil/ioutil.go:42 +0x51
golang.org/x/image/tiff.Decode(0x7f23a2e992d8, 0xc820018420, 0x7f23a2e99438, 0xc820012480, 0x0, 0x0)
    src/golang.org/x/image/tiff/reader.go:646 +0xf2a
main.main()
    tiff.go:12 +0xf2
```

on commit eb11b45157c1b71f30b3cec66306f1cd779a689e
go version devel +3cab476 Sun Jun 21 03:11:01 2015 +0000 linux/amd64
Repository: go
Issue: x/image/tiff: invalid format: wrong number of samples for RGB
Labels: NeedsInvestigation

[This tiff file](https://drive.google.com/file/d/0BwZPvI8DfSonTi00TVVQa3J3TFU/view?usp=sharing) can't be decoded using "golang.org/x/image/tiff". It give out following error message:

```
tiff: invalid format: wrong number of samples for RGB
```

Test program:

``` go
package main

import (
        "bytes"
        "io/ioutil"
        "os"

        "golang.org/x/image/tiff"
)

func main() {
        data, _ := ioutil.ReadFile(os.Args[1])
        _, err := tiff.Decode(bytes.NewReader(data))
        if err != nil {
                println(err.Error())
        }   
}
```

Use cgo binding to libtiff decode this file without problem.

go version

```
go version go1.4.2 linux/amd64
```

tiffinfo

```
TIFF Directory at offset 0x83d68 (540008)
  Image Width: 300 Image Length: 450
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 4
  Rows/Strip: 1
  Planar Configuration: separate image planes
```
Repository: go
Issue: x/image/draw: color space-correct interpolation
Labels: Suggested

The BiLinear and CatmullRom interpolators assume the luminance of the source image's color space is linear. But the vast majority of images are in the sRGB color space, which has a highly non-linear luminance curve. As a result, scaled images can look quite different from the source image.

For example, on a reasonably calibrated monitor (and at 100% scaling in the browser), the left and right columns of the following image have the same average luminance:
![gamma_colors](https://cloud.githubusercontent.com/assets/2688315/8380142/33ea0b6e-1bf2-11e5-960d-76fe4f536448.png)
But scaling this down by a factor of 2 using x/image/draw yields the following:
![out](https://cloud.githubusercontent.com/assets/2688315/8380186/706440f0-1bf2-11e5-98ed-c1d863fac813.png)
Here, the two columns appear very different.

For an in-depth (possibly too in-depth) discussion of this problem and many test images, including the one I used above, see http://www.4p8.com/eric.brasseur/gamma.html. My test program is here: https://gist.github.com/aclements/599107a2e3f187f8a2c0.

A lot of software (including browsers) gets this wrong, and that's really unfortunate. It would be fantastic if Go software using x/image got this right out of the box.

Probably the best solution to this would be to thread color space information throughout the image library. At the other extreme, given the general recommendation to assume sRGB in the absence of other information (since virtually every image created in the past two decades is sRGB), it may make sense to simply assume sRGB when interpolating. We could also do the latter first and then later add more complete color space support, with the default being sRGB. Another option is to add this information to the x/image/draw.Options structure, though I fear that may interfere with later adding proper color space support to image.

/cc @nigeltao. (We discussed this a few weeks ago in person, but I figured I should open an issue so it doesn't get lost.)
Repository: go
Issue: runtime: document P states
Labels: Documentation,NeedsInvestigation,compiler/runtime

P states follow complex and largely undocumented rules. https://go-review.googlesource.com/10158 took a stab at documenting one of these rules, but it was just a band-aid on a bigger problem. @rsc wrote a big explanation, but Gerrit ate it. We should document these properly.
Repository: youtube-dl
Issue: Add support for HLS WebVTT subtitles
Labels: subtitles

JSON dumps of CICGC URLs already include a link to sliced English subtitles in WebVTT format that could easily  be downloaded using ffmpeg. It would be nice if the ComCarCoff extractor was able to detect these.
Repository: youtube-dl
Issue: PMC Add Support
Labels: site-support-request

example URL:
http://pmc.tv/pouya-nadidanet-sakhte/
Repository: youtube-dl
Issue: Request: Full Character Support under Compliant Filesystems
Labels: request

When downloading videos with characters typically unsupported under NTFS, and similarly handling file systems, titles of videos with characters like **? < > \ : \* | "**  , have their contents replaced with safe characters - this handling can be disregarded on many non-Windows, except for the fringe cases of **NUL** and **/**, and may be desirable when cataloging videos with filenames true to their titles. Such change could be implemented via a flag, proposedly _--original-title_.
Repository: go
Issue: x/net/webdav: TestDir fails on Plan 9
Labels: Testing,OS-Plan9,NeedsInvestigation

See http://build.golang.org/log/86c5f54b2e864b4a89f8756c4c069739fb314cc9

```
--- FAIL: TestDir (0.00s)
    file_test.go:501: test case #7 "mk-dir /a want errExist": got "ok" (<nil>), want "errExist"
FAIL
FAIL    golang.org/x/net/webdav 1.019s
```
Repository: go
Issue: x/net/websocket: TestClose fails on Plan 9
Labels: Testing,OS-Plan9

See http://build.golang.org/log/86c5f54b2e864b4a89f8756c4c069739fb314cc9

```
015/06/28 17:48:38 Test WebSocket server listening on 127.0.0.1:51846
--- FAIL: TestClose (0.00s)
    websocket_test.go:447: ws.Close(): expected error, got <nil>
FAIL
```
Repository: You-Dont-Know-JS
Issue: "async & performance": ch6, update TCO section to mention strict mode
Labels: for second edition

strict mode is required for TCO.
Repository: go
Issue: x/tools/cmd/present: enable support for right-to-left languages
Labels: Tools

The `present` tool is currently unusable with right-to-left scripts. Text is left-aligned, and punctuation and English words appear at the wrong end of sentences (see screenshot). This can be fixed by setting the right HTML attributes.

Current output for a slide with Arabic text:
![screen shot 2015-06-30 at 02 10 02](https://cloud.githubusercontent.com/assets/751023/8420632/3eb8a978-1ecd-11e5-814d-8aa398d4ff5e.png)

Expected output:
![screen shot 2015-06-30 at 02 08 28](https://cloud.githubusercontent.com/assets/751023/8420638/4c3ae03e-1ecd-11e5-803e-a7ff3c3dc193.png)

Adding RTL support would enable slides to be written in Arabic (incl. Farsi & Urdu) and Hebrew

I would implement this by adding a function (e.g. ".rtl") that when invoked would set the RTL mode for the entire presentation. The effects of this would be:
- add the "dir=rtl" attribute to the `<body>` tag.
- add "dir=ltr" to all `<pre>` tags so code remains correctly formatted.
- invert the slide switch animation so that the "next" slide is on the left and the "past" slide is on the right.

Adding a special function to set a rarely used mode isn't ideal. I'm open to suggestions of alternatives. Automatically setting it based on the language of the first word might work but isn't "least-surprise".
Repository: TypeScript
Issue: Indentation is too aggressive for ternary operator
Labels: Bug,Help Wanted,Good First Issue,Domain: Formatter,Domain: Smart Indentation

Actual:

``` ts
var v =
    0 ? 1 :
        2 ? 3 :
            4;
```

Expected:

``` ts
var v =
    0 ? 1 :
    2 ? 3 :
    4;
```

I believe the fix is that if the false branch of the ternary operator should have the same indentation as the true branch. In the case where the true branch is on the same line as the condition, it should not be considered indented, and therefore the false branch should not be indented.
Repository: youtube-dl
Issue: Return code is 0 when max-filesize/min-filesize is not met
Labels: request

I'm integrating youtube_dl in a python script with the following configuration:

```
ydl_opts = {
    "outtmpl": u"%s/%%(id)s.%%(ext)s",
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
    "prefer_ffmpeg": True,
    "format": "bestaudio",
    "max_filesize": 1000000
}
```

and the download code:

```
 def _download(self, video_id):
     try:
         with youtube_dl.YoutubeDL(ydl_opts) as ydl:
             return 0 == ydl.download([http://www.youtube.com/watch?v=%s' % video_id])
     except:
         return False
```

However, if the downloaded failed because the file size exceeds, the call returns 0 (there has been no problem) so there is no way of knowing that actually the download failed. 

I propose that the downloaders throw an exception when they cannot met a parameter:

in `youtube_dl/downloader/http.py`:

```
@@ -130,6 +130,7 @@ class HttpFD(FileDownloader):
                 return False
             if max_data_len is not None and data_len > max_data_len:
                 self.to_screen('\r[download] File is larger than max-filesize (%s bytes > %s bytes). Aborting.' % (data_len, max_data_len))
+                raise ExampleException("File is greater than filesize")

```

or update YoutubeDL class to process `False` as a result of a call to download and set a corresponding retvalue to a value different than 0 to notify the main process that the download actually failed. 

Thank you.
Repository: go
Issue: encoding/xml: Serializing XML with namespace prefix
Labels: help wanted,NeedsInvestigation

Hi!

I'm struggling with serializing XML (and deserializing again).

But first things first:

``` sh
go version devel +434e0bc Mon Jun 29 16:07:14 2015 +0000 darwin/amd64  # (tried 1.4 and master)
Darwin aero 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
```

I'm trying to serialize a struct to generate XML like this (see http://play.golang.org/p/fMvL86lzB0):

``` xml
<person xmlns="ns1" xmlns:ns2="ns2">
  <name>Oliver</name>
  <ns2:phone>110</ns2:phone>
</person>
```

When defining `Person` like this  ...

``` go
type Person struct {
    XMLName xml.Name `xml:"ns1 person"`
    Name    string   `xml:"name"`
    Phone   string   `xml:"ns2 phone,omitempty"`
}
```

... it serialized into the following (which is semantically correct, I guess, but not the same as above):

``` xml
<person xmlns="ns1">
  <name>Oliver</name>
  <phone xmlns="ns2">110</phone>
</person>
```

I can fake it like this:

``` go
type Person struct {
    XMLName xml.Name `xml:"ns1 person"`
    NS2 string `xml:"xmlns:ns2,attr"`

    Name    string   `xml:"name"`
    Phone   string   `xml:"ns2:phone,omitempty"`
}
```

... by initializing NS2 before serializing (see http://play.golang.org/p/2dEljm97c8). Unfortunately then I'm not able to deserialize correctly as the `Phone` field will not be blank (see http://play.golang.org/p/RxG2ImcWbm).

Maybe it's just a documentation issue and I'm missing an example. There are some other issues regarding XML and namespaces/namespace prefixes (e.g. #6800, #9519, #7113) some of which are closed and some of which are open, so I'm a bit confused about the status.