Dataset Viewer
Auto-converted to Parquet Duplicate
original_prompt
stringlengths
9
60.5k
⌀
original_completion
stringlengths
1
516k
enhanced_prompt
stringlengths
9
60.5k
enhanced_completion
stringlengths
208
78.3k
Implement a distributed mutex using Lamport's bakery algorithm for 4 processes where each process has different processing speeds: P1 completes operations in 100ms, P2 in 150ms, P3 in 80ms, and P4 in 200ms. If all processes request the mutex simultaneously at time t=0, and message delivery has a uniform delay of 25ms, ...
Looking at this distributed systems problem, I need to understand how Lamport's bakery algorithm works with different processing speeds and message delays. ## Understanding the Problem **Given:** - 4 processes using Lamport's bakery algorithm - Processing speeds: P1=100ms, P2=150ms, P3=80ms, P4=200ms - All request ...
Simulate Lamport's Bakery Algorithm for a distributed mutual exclusion system with 4 processes (P1, P2, P3, P4) under the following specific conditions: **System Parameters:** * **Processes:** 4 distinct entities (P1, P2, P3, P4). * **Protocol Overhead (Processing Speed):** The time required for each process to co...
### 1. Ticket Assignment Analysis In Lamport's Bakery Algorithm, a process selects a ticket number equal to `1 + max(current_tickets)`. The specific protocol overhead durations and network latency dictate the visibility of these ticket assignments. **Assumptions:** * **Initial State:** All `number` registers are 0 ...
What is measure of inflation in the US? In economics, inflation is an increase in the general price level of goods and services in an economy. When the general price level rises, each unit of currency buys fewer goods and services; consequently, inflation corresponds to a reduction in the purchasing power of money. The...
Inflation is measured using consumer price index (CPI) in the US.
What is the primary measure of inflation in the United States? In economics, inflation refers to the sustained increase in the general price level of goods and services, leading to a decrease in the purchasing power of money. The inflation rate—the annual percentage change in a general price index—is the standard metr...
The primary measure of inflation in the United States is the Consumer Price Index (CPI). The CPI tracks changes over time in the prices paid by urban consumers for a representative basket of goods and services, including food, housing, clothing, transportation, medical care, and other everyday expenses. It is calculate...
In May 2018 , Rubraca received its initial European Commission approval . Extract the named entities in this text using 139 XBRL tags in the IOB2 format. Return the results in JSON format.
No XBRL associated data.
Extract named entities from the text: "In May 2018, Rubraca received its initial European Commission approval." Map each entity to one of the 139 standard XBRL tags. Format the output as a JSON object containing a list of entities in IOB2 format (where each token includes the word, its XBRL tag, and its position label:...
```json { "entities": [ { "word": "In", "tag": "O", "label": "O" }, { "word": "May", "tag": "dei:DocumentPeriodEndDate", "label": "B" }, { "word": "2018", "tag": "dei:DocumentPeriodEndDate", "label": "I" }, { "word": ",", "t...
{{0}} has unsaved colors saveChangesDialogTitle Title of the dialog that shows when there are unsaved colors changes 0 (brandKitName): the name of the brand kit that has unsaved changes if not provided then default to This Brand Kit
{{0}} inemibala engalondolozwanga
Generate content for a software localization file based on the following specifications. Ensure all keys and values are preserved exactly as provided. ### Input Data {{0}} has unsaved colors saveChangesDialogTitle Title of the dialog that shows when there are unsaved colors changes 0 (brandKitName): the name of the br...
```json { "saveChangesDialogTitle": "{{0}} has unsaved colors", "_saveChangesDialogTitle_comment": "Title of the dialog that shows when there are unsaved colors changes. Parameter 0 (brandKitName): the name of the brand kit that has unsaved changes if not provided then default to This Brand Kit" } ``` ### Implemen...
null
<think> We need to complete the function extractMax() for a binary heap implementation of a Priority Queue. The problem statement says: "Given a binary heap implementation of Priority Queue. Extract the maximum element from the queue i.e. remove it from the Queue and return it's value." The example inputs and outputs s...
# Task: Implement Maximum Extraction for a Binary Heap Priority Queue ## Objective Complete the `extractMax()` function within the provided `Solution` class. This function must remove the maximum element from a binary heap-based priority queue and return its value. ## Requirements - **Operation**: Extract the root (m...
```python #User function Template for python3 # 1. parent(i): Function to return the parent node of node i # 2. leftChild(i): Function to return index of the left child of node i # 3. rightChild(i): Function to return index of the right child of node i # 4. shiftUp(int i): Function to shift up the node in order to main...
What is SCSS?
The Sassy Cascading Style Sheets (SCSS) is basically a more advanced and evolved variant of the CSS language. Natalie Weizenbaum and Chris Eppstein created it, and Hampton Catlin designed it. It comes with more advanced features- thus often called Sassy CSS.
What is SCSS? Define the acronym and explain its purpose, relationship to CSS, and key features such as variables, nesting, and mixins. Keep the explanation clear and concise for someone new to web development.
SCSS, which stands for **Sassy CSS**, is a preprocessor scripting language that extends CSS to make styling web pages more powerful and efficient. It’s fully compatible with CSS, meaning any valid CSS code is also valid in SCSS—so you can start using it without rewriting your existing styles. The main purpose of SCSS ...
null
import shap explainer = shap.TreeExplainer(model) shap_values = explainer.shap_values(X_test) shap.summary_plot(shap_values, X_test)
Write Python code to calculate feature importance using SHAP (SHapley Additive exPlanations). The solution must: 1. Train a sample machine learning model (e.g., Random Forest or XGBoost). 2. Initialize the appropriate SHAP Explainer for the model type. 3. Compute SHAP values on a test dataset. 4. Generate both a summar...
The following implementation outlines a robust workflow for calculating feature importance using SHAP with a `RandomForestClassifier`. It utilizes `TreeExplainer` for efficient computation and handles the specific output structure of binary classification models. ```python import shap import matplotlib.pyplot as plt i...
I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line. The procedure takes a component from the (pr...
If you want the database behind a firewall, and believe me, you do want your database behind a firewall, see if you can have a VPN for going directly into the box. Once you are on the VPN, you can use whichever management tool you currently use for managing the database. So if you use SQL Server, you can connect via th...
Act as a Delphi IDE expert. I am developing a property editor and encountering an Access Violation (AV) when attempting to set a nested integer property (e.g., `Margins.Left` on a `TGroupBox`). The procedure below parses the property name, retrieves the sub-object, checks the type, and attempts to update the value if ...
### Analysis of the Access Violation The Access Violation (AV) at `SetInt64Prop` is typically symptomatic of invalid memory access within the Run-Time Type Information (RTTI) system. Based on the provided code and common OTA pitfalls, there are three primary causes: 1. **Nil Sub-Object Reference:** The most frequent...
null
<think> We need to parse the problem carefully. The user wants a CSS selector that selects h2 tags with class "green" and contains the text "Title". Only select elements that are direct children of the div element. Additionally, make sure the selected h2 tags are not preceded by a p tag. Interpretation: We have HTML s...
Write a CSS selector based on the following requirements: 1. **Target Element**: Select `<h2>` tags. 2. **Class Constraint**: The element must have the class `green`. 3. **Content Constraint**: The element must contain the text "Title". 4. **Parent Constraint**: The element must be a direct child of a `<div>` element....
It is not possible to create a single CSS selector that strictly adheres to all five conditions using current web standards. Specifically, CSS lacks the capability to select elements based on their text content (Condition 3). CSS selectors operate on the DOM tree structure, attributes, and state, but cannot inspect nod...
null
# Finding Unique Elements in a List - Python Solution ## Analysis & Design Considerations ## Implementation ### Solution 1: Using `set()` - Simplest Approach ```python def print_unique_set(input_list): """Print unique elements using set (order NOT preserved).""" unique_elements = set(input_list) pr...
As a senior Python developer creating advanced training materials, produce a comprehensive, production-ready technical guide on list deduplication that satisfies the following requirements: 1. **Implementation Approaches**: Present at least three distinct, well-documented methods with complete, PEP 8–compliant code. E...
# List Deduplication in Python – A Production‑Ready Technical Guide *Prepared for professional Python developers who need reliable, well‑documented solutions for removing duplicates from sequences.* --- ## 1. Implementation Approaches Below are three distinct, fully documented strategies. All code follows *...
This is a follow up to my question from yesterday (Jquery Create "array" of .click functions".) Yesterday, I thought that I would simplify what I asked, hoping that I could extrapolate. I could not, and there is still something I can't figure out. Therefore this new question, and PLEASE, I do admit that I am a newbie...
One approach to the problem is the following, though note that I've made no use of the unnecessary `id` properties of each of the elements, though I *have* introduced two `data-*` attributes which will allow CSS to handle the animations and the fade-in: ```js // binding the anonymous function of the on() method as //...
Act as a patient jQuery expert mentoring a beginner. I am following up on a previous question regarding creating arrays of click functions. I have a set of paired divs (`div_a_1`/`div_b_1`, etc.) with a class `pingpongdiv` (initial opacity 0.15). **Goal:** 1. Clicking an 'A' div animates its opacity to 1. 2. Clicking...
Hello there! It is great to see you digging into these details. You are asking exactly the right questions. What you are encountering with the variable `i` is one of the most classic hurdles in JavaScript development, often called the "closure loop issue." Almost every jQuery developer has stumbled over this exact spot...
For ex: I have a collection 'stories' where each document is of the form: ``` { '_id': <default> 'story': <some very long string which should be unique in the collection> } ``` Now whenever I have a story, If it already exists in 'stories', I want its '\_id', else insert a new document with 'story' field set, a...
You were part of the way there, use [**`$setOnInsert`**](http://docs.mongodb.org/manual/reference/operator/update/setOnInsert/) to modify the update operation: ``` story = "this is a very long story" id = stories_col.find_one_and_update({ 'story': story, }, { '$setOnInsert': { 'story': story } }, upsert=True, ...
I am working with a MongoDB collection named 'stories' where each document contains a unique 'story' field (a long string) and a default '_id'. **Goal**: Retrieve the '_id' of an existing story if it matches the input; otherwise, insert a new document with the story and return the new '_id'. **Current Approach**: `...
### Analysis of Current Approach The concern regarding inefficiency is valid. The `find_one_and_update` command with `upsert=True` acquires an exclusive lock on the document (or the index key during insertion) regardless of whether the update modifies any data. In the current implementation: ```python {'story': story...
Create an algorithm to find the common elements in two lists. list1 = [1,2,3,4,5] list2 = [2,4,5,6,7]
""" Find the common elements in two lists """ def findCommonElements(list1, list2): # initialize a list to store the common elements common_elements = [] # loop through list1 to find common elements in both lists for i in list1: if i in list2: common_elements.append(i) ret...
Develop an efficient algorithm to identify common elements between two lists. Use the following examples for validation: - List 1: [1, 2, 3, 4, 5] - List 2: [2, 4, 5, 6, 7] Requirements: 1. Provide the code implementation in Python. 2. Explain the logic and time complexity of your approach. 3. Ensure the solution hand...
### Python Implementation The following solution utilizes a hash map approach to achieve linear time complexity. Python's `collections.Counter` class is employed to manage frequency counting efficiently. ```python from collections import Counter def find_common_elements(list1, list2): """ Identifies common e...
It may seem that Google Spreadsheets only exposes the first tab (you can reorder them though) to BigQuery. I have several tables, taking data ones from the others making several calculations already, being configured by params, in the same Spreadsheet but different tabs. How can I read other tabs than the first one f...
Google Bigquery can only read from the first tab. See <https://cloud.google.com/bigquery/external-data-drive>. There is an open issue in the Issue Tracker asking for this feature, you could add a "me too" to it? <https://issuetracker.google.com/issues/35905674>. There is also a work around posted on here which may hel...
# Task: Access Specific Google Sheets Tabs in BigQuery ## Context It is a common misconception that BigQuery federated queries only access the first tab of a Google Spreadsheet. I have a complex spreadsheet with multiple tabs containing interdependent tables, calculations, and parameter configurations. I need to query...
# Configuring BigQuery Federated Queries for Specific Google Sheets Tabs BigQuery external table definitions support targeted ingestion from specific tabs and cell ranges within a Google Spreadsheet. By default, if no range is specified, BigQuery queries the first visible sheet. To access interdependent tables or conf...
I have a question today involving the StreamReader class. Specifically initializing this class using the filename parameter for example: ``` TextReader tr = new StreamReader(fileName); ``` Obviously when this action is finished, its important to close the stream like this: ``` tr.Close(); ``` I would like to hav...
The easiest way is to use a `using` statement: ``` using (TextReader tr = new StreamReader(fileName)) { // ... } ``` The compiler will generate a try-finally block for you and put code to call Close (actually Dispose) in the finally. If you need to spell out the `finally` explicitly, your second example will work...
Explain how to correctly initialize and dispose of a `StreamReader` (a .NET class for reading character streams) within a `try/finally` block in C#. Address the following specific scenarios: 1. **Scope Errors**: Why declaring the variable inside the `try` block prevents access in the `finally` block. 2. **Initializat...
### 1. Scope errors – the variable is declared **inside** the `try` ```csharp try { StreamReader sr = new StreamReader(@"c:\temp\file.txt"); // … read from the stream … } finally { // CS0103: The name 'sr' does not exist in the current context sr.Close(); // ← compilation error } ``` *Wh...
What is the name of the major school of praxiology not developed by Ludwig von Mises In philosophy, praxeology or praxiology (/ˌpræksiˈɒlədʒi/; from Ancient Greek πρᾶξις (praxis) 'deed, action', and -λογία (-logia) 'study of') is the theory of human action, based on the notion that humans engage in purposeful behavior,...
The major school of praxiology not developed by Ludwig von Mises is the Polish school, which was led by Tadeusz Kotarbiński.
What is the name of the major school of praxeology that was not developed by Ludwig von Mises? Praxeology is the theory of human action, based on the idea that humans act purposefully, as opposed to reflexively or unintentionally. The term was given its modern meaning by French philosopher Alfred Espinas. Praxeology w...
The major school of praxeology that was not developed by Ludwig von Mises is the Polish school of praxeology, primarily associated with the philosopher Tadeusz Kotarbiński. This tradition, known as *prakseologia* in Polish, emerged independently of the Austrian school and emphasizes a value-free, scientific study of hu...
Consider the problem of finding the longest increasing subsequence (LIS) in an array of n=1000 integers, but with a twist: you can perform at most k=50 'increment' operations, where each operation increases any array element by 1. You want to maximize the length of the LIS after performing these operations optimally. D...
Looking at this problem, I need to find the optimal way to use increment operations to maximize the longest increasing subsequence (LIS) length. ## Algorithm Design For the general problem, I'll use a key insight: since we want to maximize LIS length, we should focus on creating one long increasing subsequence rather...
# Problem: Maximizing Longest Increasing Subsequence (LIS) with Limited Increments ## Context You are tasked with solving an algorithmic optimization problem involving an array of integers and a constrained number of modification operations. **Definitions:** - **Longest Increasing Subsequence (LIS):** The longest sub...
# 1. Algorithm Design To maximize the Longest Increasing Subsequence (LIS) length in a strictly decreasing array $A$ of size $n$ using at most $k$ increment operations, we propose the **Consecutive Block Strategy**. ## General Algorithm 1. **Determine Maximum Length ($L$):** Calculate the largest integer $L$ such th...
End of preview. Expand in Data Studio

OSS-Instruct Coding Tasks (Augmented)

Coding problems inspired by open-source snippets, with solutions across several languages.

Rows 8,996
Domain programming
Format data.parquet, one row per example
Licence other
Built for supervised fine-tuning (SFT) experiments on Adaption AutoScientist

Columns

Column Description
original_prompt The prompt (user turn) as uploaded.
original_completion The target response as uploaded.
enhanced_prompt Prompt after Adaption processing (rewrite or augmentation).
enhanced_completion Response after Adaption processing (rewrite or augmentation).

How it was built

Sampled from Magicoder-OSS-Instruct-75K, stratified by language, dropping rows whose prompt already contains the answer.

Sources and licence

Notes

  • This dataset was expanded by Adaption's augmentation, which adds platform-generated rows alongside the seed. The added rows are general-purpose and do not all match the dataset's topic; Adaption does not publish their provenance, so the licence is listed as other. The export does not mark which rows are seed and which were added.

Loading

from datasets import load_dataset
ds = load_dataset("rodriguescarson/adaption-code-oss-instruct-raw-aug", split="train")
import pandas as pd
df = pd.read_parquet("hf://datasets/rodriguescarson/adaption-code-oss-instruct-raw-aug/data.parquet")

Published by Carson Rodrigues (Hugging Face, Kaggle).

Downloads last month
42