row_id
int64 0
48.4k
| init_message
stringlengths 1
342k
| conversation_hash
stringlengths 32
32
| scores
dict |
|---|---|---|---|
45,080
|
ungrammar rust
|
f1034bc8b401342942e609788478959d
|
{
"intermediate": 0.37730905413627625,
"beginner": 0.47282299399375916,
"expert": 0.149867981672287
}
|
45,081
|
grammar parser
|
b9aeaabfa809715167f1185cc68aa612
|
{
"intermediate": 0.33254459500312805,
"beginner": 0.3476354479789734,
"expert": 0.31981995701789856
}
|
45,082
|
VBA , WHEN I INSERT NEW ROW IN Sheet2(licente) automaticaly change colour of inserted row to dark grey
|
e8e2e92931d77ac206aeaeed6a26e1d4
|
{
"intermediate": 0.21167178452014923,
"beginner": 0.14397208392620087,
"expert": 0.6443561911582947
}
|
45,083
|
import pyautogui
def apply_job(i):
try:
mm=3
time.sleep(5)
# Wait for the "Apply" button to be clickable in the new tab
apply_button_xpath = '//*[@id="mainContent"]/div/div[2]/div/div/section/div/div[1]/div[3]/div/div/div[2]/div/div/div/a'
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, apply_button_xpath)))
# Find the "Apply" button element and click on it
apply_button = driver.find_element(By.XPATH, apply_button_xpath)
#print(apply_button.is_enabled())
apply_button.click()
time.sleep(5)
# if 'viewApplication' in driver.current_url:
# return
# Wait for the "Use My Last Application" tab to be clickable
use_last_app_tab_xpath = '/html/body/div[2]/div/div/div/div[2]/div/div/div[1]/div[6]/div/div/a'
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, use_last_app_tab_xpath)))
# Find the "Use My Last Application" tab and click on it
use_last_app_tab = driver.find_element(By.XPATH, use_last_app_tab_xpath)
use_last_app_tab.click()
time.sleep(5)
if True:
# Wait for the "Sign In" prompt to appear
sign_in_form_xpath = '//*[@id="wd-Authentication-NO_METADATA_ID-uid6"]/div/div[1]/div/form'
WebDriverWait(driver, 15).until(EC.visibility_of_element_located((By.XPATH, sign_in_form_xpath)))
# Find the email and password input fields and enter your credentials
email_input_xpath = '//*[@id="input-4"]'
password_input_xpath = '//*[@id="input-5"]'
email = "rahulkotian26@gmail.com"
password = "!-WbNZwHPncL5ZG"
email_input = driver.find_element(By.XPATH, email_input_xpath)
password_input = driver.find_element(By.XPATH, password_input_xpath)
email_input.send_keys(email)
password_input.send_keys(password)
# Find the "Sign In" button and wait for it to become clickable before clicking
sign_in_button_xpath = '//*[@id="wd-Authentication-NO_METADATA_ID-uid6"]/div/div[1]/div/form/div[3]/div/div/div/div/div'
sign_in_button = WebDriverWait(driver, 15).until(EC.element_to_be_clickable((By.XPATH, sign_in_button_xpath)))
# Scroll into view to ensure the element is clickable
driver.execute_script("arguments[0].scrollIntoView();", sign_in_button)
# Use the Actions class to simulate a click on the "Sign In" button
actions = ActionChains(driver)
actions.move_to_element(sign_in_button).click().perform()
time.sleep(5)
actions = ActionChains(driver)
# Wait for the "How Did You Hear About Us?" field to be present
how_hear_about_us_xpath = '//*[@id="input-1"]'
WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.XPATH, how_hear_about_us_xpath)))
time.sleep(2)
# Find the "How Did You Hear About Us?" field and enter "Career" using ActionChains
how_hear_about_us_input = driver.find_element(By.XPATH, how_hear_about_us_xpath)
time.sleep(2)
# Enter "Career"
actions.move_to_element(how_hear_about_us_input).click().send_keys("Career Site").perform()
time.sleep(2)
#ENTER KEY
actions.move_to_element(how_hear_about_us_input).click().send_keys(Keys.ENTER).perform()
time.sleep(5)
# Find the "SAVE AND CONTINUE" button by class name and click on it
save_and_continue_button_class = 'css-d4ya5t'
save_and_continue_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.CLASS_NAME, save_and_continue_button_class)))
# Scroll into view to ensure the element is clickable
driver.execute_script("arguments[0].scrollIntoView();", save_and_continue_button)
# Click the "SAVE AND CONTINUE" button
save_and_continue_button.click()
time.sleep(2)
# Function to check if the confirmation message appears
def is_upload_successful(driver):
try:
# Wait for the confirmation message to appear
confirmation_message = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "//div[contains(text(), 'Successfully Uploaded!')]")))
return True
except Exception as e:
print("Exception in is_upload_successful:", e)
return False
# Function to check if the resume has been uploaded
def is_resume_uploaded(driver):
try:
# Find the element that contains the uploaded resume by its data-automation-id
uploaded_resume = driver.find_element(By.CSS_SELECTOR, '[data-automation-id="file-upload-item"]')
# If the element is found, return True (resume is uploaded)
return True
except Exception as e:
print("Exception in is_resume_uploaded:", e)
# If the element is not found, return False (resume is not uploaded)
return False
# Define maximum number of attempts
max_attempts = 3
current_attempt = 0
success = False
# Define typing interval
typing_interval = 0.1
typing_interval1 = 0.0001
# Define pause time between actions
pause_time = 2
while current_attempt < max_attempts and not success:
try:
# Check if the element with data-automation-id="formField-jobTitle" exists
job_title_field_exists = False
try:
job_title_field = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '[data-automation-id="formField-jobTitle"]')))
job_title_field_exists = True
except:
pass
if not job_title_field_exists:
# Proceed with work experience part
work_exp_button = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '#mainContent > div > div.css-12izqjd > div:nth-child(3) > div:nth-child(1) > div > div > div > button')))
work_exp_button_exists = True
# Work Experience
work_exp_button.click()
time.sleep(pause_time)
time.sleep(pause_time)
# Type job details
job_details = [
(" Data Analyst", '\t'),
("Dynamic Sustainability Lab", '\t'),
("Syracuse, NY", '\t'),
("a", '\t'),
("072022", '\t'),
("a", '\t'),
("052023", '\t'),
("a", '\t')
]
for detail, key in job_details:
pyautogui.typewrite(detail, interval=typing_interval)
time.sleep(pause_time)
pyautogui.press(key)
time.sleep(pause_time)
# Type job descriptions
job_descriptions = [
"Executed in-depth analysis of over 150 energy measurement points for a $2.11 billion enterprise, leveraging Power BI, Report Designer BI, and EnergyCAP, which unveiled the potential for a 5% efficiency enhancement in energy resource utilization.",
"Initiated the creation of an advanced Power BI dashboard, amalgamating diverse data sources, performing Data Mining and Data Wrangling, designing custom visualizations, and consistently updating senior leadership.",
"Orchestrated the roll-out of an innovative energy resource tracking system using Power BI and SQL Server Analysis Services (SSAS), targeting an anticipated 15% reduction in energy usage.",
"Articulated data-driven models, findings, and insights to senior management, influencing informed decision-making during the transition to a Carbon NetZero economy. The data dictionary was instrumental in communicating complex data concepts."
]
for description in job_descriptions:
pyautogui.typewrite(description, interval=typing_interval1)
pyautogui.press('Enter')
#time.sleep(0.1) # Adjust as needed
time.sleep(pause_time)
pyautogui.press('tab')
pyautogui.press('tab')
# Education 1
education_button_element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, '#mainContent > div > div.css-12izqjd > div:nth-child(3) > div:nth-child(3) > div > div > div > button')))
education_button_element.click()
time.sleep(2 * pause_time) # Longer pause after clicking the education button
# Type education details
education_details = [
"Syracuse University School Of Information Studies", '\t', 'M', '\t', 'Information systems', '\n', '\n', '\t', '\t', '3.67', '\t', '2021', '\t', '2023', '\t'
]
for education_detail in education_details:
pyautogui.write(education_detail, interval=typing_interval) # Use write for all elements
time.sleep(2 * pause_time) # Longer pause after typing each detail
# Education 2
education_button_element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, '#mainContent > div > div.css-12izqjd > div:nth-child(3) > div:nth-child(3) > div > div > div > button')))
education_button_element.click()
time.sleep(2 * pause_time) # Longer pause after clicking the education button
# Type education details
education_details = [
"Mumbai University", '\t', 'B', '\t', 'Computer Engineering', '\n', '\n', '\t', '\t', '3.3', '\t', '2016', '\t', '2020', '\t', '\t', '\t'
]
for education_detail in education_details:
pyautogui.write(education_detail, interval=typing_interval) # Use write for all elements
time.sleep(2 * pause_time) # Longer pause after typing each detail
# ... Your work experience code goes here ...
pass
else:
# Skip to check resume
# Resume Upload
if not is_resume_uploaded(driver):
# Wait for the "SELECT FILE" button to be clickable
select_file_button_css_selector = '#mainContent > div > div.css-12izqjd > div:nth-child(3) > div:nth-child(7) > div > div > div:nth-child(1) > div'
# Find the "SELECT FILE" button and click on it
select_file_button = driver.find_element(By.CSS_SELECTOR, select_file_button_css_selector)
select_file_button.click()
time.sleep(1)
# Specify the path to your PDF file
pdf_file_path = 'Rahul_Kotian_Resume.pdf'
# Use pyautogui to type the file path and press Enter
pyautogui.write(pdf_file_path)
pyautogui.press('Enter')
time.sleep(1)
# Check if the upload was successful
if is_upload_successful(driver):
# Set success to True to break the loop
success = True
except Exception as e:
print(f"Attempt {current_attempt + 1} failed:", e)
current_attempt += 1
# Wait for a brief moment before retrying
time.sleep(2)
# If successful, find and click the "SAVE AND CONTINUE" button
if success:
try:
save_and_continue_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.CLASS_NAME, 'css-d4ya5t')))
driver.execute_script("arguments[0].scrollIntoView();", save_and_continue_button)
save_and_continue_button.click()
except Exception as e:
print("Error while saving and continuing:", e)
else:
print("Max attempts reached. Skipping the action.")
time.sleep(5)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('Y')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('o')
time.sleep(mm)
pyautogui.press('o')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('Y')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.typewrite("18", interval=0.4)
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('H')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('Y')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('N')
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('N')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('N')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key again
pyautogui.press('N')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
time.sleep(mm)
# Press the Tab key again
pyautogui.press('N')
# Add a short delay between the Tab presses (adjust as needed)
time.sleep(mm)
# Find the "SAVE AND CONTINUE" button by class name and click on it
save_and_continue_button_class = 'css-d4ya5t'
save_and_continue_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.CLASS_NAME, save_and_continue_button_class)))
# Scroll into view to ensure the element is clickable
driver.execute_script("arguments[0].scrollIntoView();", save_and_continue_button)
# Click the "SAVE AND CONTINUE" button
save_and_continue_button.click()
time.sleep(5)
pyautogui.press('tab')
time.sleep(mm)
pyautogui.press('tab')
time.sleep(mm)
pyautogui.press('tab')
time.sleep(mm)
# Press the Tab key
pyautogui.press('tab')
time.sleep(mm)
pyautogui.press('tab')
time.sleep(mm)
# Press the Tab key again
pyautogui.press('Space')
time.sleep(mm)
# Find the "SAVE AND CONTINUE" button by class name and click on it
save_and_continue_button_class = 'css-d4ya5t'
save_and_continue_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.CLASS_NAME, save_and_continue_button_class)))
# Scroll into view to ensure the element is clickable
driver.execute_script("arguments[0].scrollIntoView();", save_and_continue_button)
# Click the "SAVE AND CONTINUE" button
save_and_continue_button.click()
time.sleep(5)
#ENTER KEY
#actions.move_to_element(NAME_input).click().send_keys(Keys.ENTER).perform()
time.sleep(mm)
# Find the "SAVE AND CONT" button by class name and click on it
save_and_continue_button_class = 'css-d4ya5t'
save_and_continue_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.CLASS_NAME, save_and_continue_button_class)))
# Scroll into view to ensure the element is clickable
# driver.execute_script("arguments[0].scrollIntoView();", save_and_continue_button)
# Click the "SAVE AND CONTINUE" button
save_and_continue_button.click()
time.sleep(5)
# Find the "SUBMIT" button by class name and click on it
save_and_continue_button_class = 'WDKN WEWO WC3N WKLN WHKN'
save_and_continue_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.CLASS_NAME, save_and_continue_button_class)))
# Scroll into view to ensure the element is clickable
driver.execute_script("arguments[0].scrollIntoView();", save_and_continue_button)
# Click the "SAVE AND CONTINUE" button
save_and_continue_button.click()
finally:
# Close the browser tab
# driver.close()
print("Successfully applied to the job")
return
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import time
import pyautogui
# URL of the webpage you want to open
url = "https://walmart.wd5.myworkdayjobs.com/en-US/WalmartExternal?locationCountry=bc33aa3152ec42d4995f4791a106ed09&jobFamilyGroup=e83ebdbd2a0a01af0185848948e94dc6&jobFamilyGroup=e83ebdbd2a0a01e7e1477a8948e904c6"
# Path to the ChromeDriver executable
chromedriver_path = "Desktop/DESK/myworkdayjobs-master/chromedriver_mac64/chromedriver" # Removed .exe for Mac compatibility
# Set up ChromeOptions and specify the executable path
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(f"executable_path={chromedriver_path}")
# Create a Chrome WebDriver instance with the specified options
driver = webdriver.Chrome(options=chrome_options)
# Open the webpage
# driver.get(url)
time.sleep(5)
first_list_xpath = '/html/body/div[1]/div/div/div[3]/div/div/div[2]/section/div[2]/nav/div/button'
next_list_xpath = '/html/body/div[1]/div/div/div[3]/div/div/div[2]/section/div[2]/nav/div/button[2]'
m=0
j = m%20
for i in range(m,9999):
# Set up ChromeOptions and specify the executable path
if j ==20 :
j = 0
if j != 20:
j = j + 1
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(f"executable_path={chromedriver_path}")
# Create a Chrome WebDriver instance with the specified options
driver = webdriver.Chrome(options=chrome_options)
driver.get(url)
if True:
if i >=20:
first_list_xpath = '/html/body/div[1]/div/div/div[3]/div/div/div[2]/section/div[2]/nav/div/button'
time.sleep(2)
# Wait for the first job to be clickable
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, first_list_xpath)))
# Find the first job element and click on it
first_job = driver.find_element(By.XPATH, first_list_xpath)
first_job.click()
time.sleep(2)
if i>=40:
for i in range(1,int(i/20)):
first_job_xpath = '/html/body/div[1]/div/div/div[3]/div/div/div[2]/section/div[2]/nav/div/button[2]'
time.sleep(2)
# Wait for the first job to be clickable
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, first_job_xpath)))
# Find the first job element and click on it
first_job = driver.find_element(By.XPATH, first_job_xpath)
first_job.click()
time.sleep(2)
print(i,j)
time.sleep(5)
try:
first_job_xpath = "/html/body/div[1]/div/div/div[3]/div/div/div[2]/section/ul/li["+str(j)+"]/div[1]/div/div/h3/a" #city ka path change karna cloudera ke saath
# Wait for the first job to be clickable
WebDriverWait(driver, 15).until(EC.element_to_be_clickable((By.XPATH, first_job_xpath)))
# Find the first job element and click on it
first_job = driver.find_element(By.XPATH, first_job_xpath)
first_job.click()
except Exception as e:
continue
finally:
print("Clicking on job was successful")
time.sleep(5)
print(driver.current_url)
#IDHAR APPLY_JOBS(i) PASS KARNE HAI
apply_job(i)
print(i)
driver.quit()
|
19f22c40d065bf1521d42d83e16c5628
|
{
"intermediate": 0.285658597946167,
"beginner": 0.45705583691596985,
"expert": 0.257285475730896
}
|
45,084
|
help me here. check this code:
if let Some(s) = get_min(&exons) {
group_exons.clone().into_iter().for_each(|(a, b)| {
if s.0 >= a && s.1 <= b {
exons.remove(&s);
}
});
}
I want to do the following:
ONLY if s IS NOT inside any of the group_exons intervals, push it to a vector. This evaluates if s is inside any of the intervals: s.0 >= a && s.1 <= b.
Please make it in the most efficient and fastest way possible.
|
13904f621b36967337b66eb387014131
|
{
"intermediate": 0.36510178446769714,
"beginner": 0.2900213301181793,
"expert": 0.34487688541412354
}
|
45,085
|
this:
grep -f <(awk ‘{print $4}’ …/test_data/test_refseq.bed) hits.bed
works in bash but does not work in fish:
fish: Invalid redirection target:
grep -f <(awk ‘{print $4}’ …/test_data/test_refseq.bed) hits.bed
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
1415f9a6dbbfeef247d8f1ce502cd063
|
{
"intermediate": 0.32992881536483765,
"beginner": 0.43865326046943665,
"expert": 0.2314179241657257
}
|
45,086
|
how to address the node features(node feature tensor) in to the GNN model appropriately for optimizing the requires 13 variables.
feature_vector = device_type + device_onehot + component_onehot + values + region_state with indices [0:23], which is splitted for each features as, [0 + 1:6 + 7:17 + 18:22 + 23], all the feature vectors are already normalized before tensor structure.
node_features.append(feature_vector)
node_features_tensor = torch.FloatTensor(node_features)
I have totally 20 nodes, among those 20 nodes GNN model need to take of only 11 component nodes 'M0', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'C0', 'I0', 'V1' remaining 9 nodes are net nodes which are not take part in the optimization, the net nodes are only used for message passing (in my fixed topology graph sructure, edges are connected between the component nodes and net nodes).
My main aim is to focus on the 'values' and 'region_state' of nodes 'M0', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'C0', 'I0', 'V1', remaining all features in the node features are fixed values and wont get change throughout all the iteration and the edge features and edge index also fixed in all iteration, because i have fixed graph topology, where we need to tune the node feature, especially 'values' of the nodes 'M0', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'C0', 'I0', 'V1' appropriately and keep the node feature 'region_state' as '1' for all the nodes among all other node features. similarly due to fixed graph topology and only the node features 'values' are going to change and monitor the node feature 'region_state' as '1', so the edge features and the edge index are fixed during all the complete iteration process. I need to know whether the given requirements are completely satisfies within the below given GNN model. And I also need to know, I already coded the computation for rewards which including penalties for the region_state which is deviating from my requirements. do i need to include additional function 'custom_loss' for performing the same which is given below. suggest me the whether the below code is in well structured or not and if any modification needed to upgrade the existing implementation please provide me the complete upgraded code if any changes is needed in existing.
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GATConv
class CustomGATConv(GATConv):
def init(self, *args, **kwargs):
super(CustomGATConv, self).init(*args, **kwargs)
def forward(self, x, edge_index):
# Perform standard GATConv forward pass
return super().forward(x, edge_index)
class GATModelWithConstraints(nn.Module):
def init(self, node_input_dim, edge_embedding_dim, hidden_dim, output_dim, num_layers, num_heads, constraint_dims):
super(GATModelWithConstraints, self).init()
self.value_indices = value_indices
self.state_index = state_index
self.mask_weight = 5 # Amplification factor for ‘values’ and ‘region_state’
self.node_convs = nn.ModuleList([
CustomGATConv(node_input_dim if i == 0 else hidden_dim * num_heads, hidden_dim, heads=num_heads, concat=True)
for i in range(num_layers)
])
self.edge_convs = nn.Sequential(nn.Linear(edge_embedding_dim, hidden_dim * num_layers), nn.ELU())
self.combine_features = nn.Linear(hidden_dim * num_heads + hidden_dim * num_layers, output_dim + 1) # +1 for region state
self.constraint_fc = nn.Linear(output_dim, constraint_dims)
def apply_feature_mask(self, features):
# Create a mask that amplifies ‘values’ and ‘region_state’
mask = torch.ones(features.size(1))
mask[self.value_indices] = self.mask_weight # Amplify ‘values’
mask[self.state_index] = self.mask_weight # Amplify ‘region_state’
# Assuming features and mask are on the same device
masked_features = features * mask
return masked_features
def forward(self, node_features, edge_features, edge_index):
# Apply mask to enhance ‘values’ and ‘region_state’
node_features = self.apply_feature_mask(node_features)
x = node_features
for conv in self.node_convs:
x = conv(x, edge_index)
x = F.elu(x)
e = self.edge_convs(edge_features)
combined_features = torch.cat([x, e], dim=1)
output = self.combine_features(combined_features)
constraints = self.constraint_fc(output)
return output, constraints
# Custom loss function including region state constraint
def custom_loss(output, targets, region_state_target, alpha=0.5):
main_output, region_state_pred = output[:, :-1], output[:, -1]
main_loss = F.mse_loss(main_output, targets) # Adjust based on your task
region_state_loss = F.binary_cross_entropy_with_logits(region_state_pred, region_state_target)
# Combined loss
total_loss = (1-alpha) * main_loss + alpha * region_state_loss
return total_loss
def rearrange_output(original_output):
# Assuming original_output is a tensor with shape [13] for action space values
desired_order = [1, 3, 5, 7, 9, 0, 2, 4, 6, 8, 11, 10, 12]
rearranged_output = original_output[:, desired_order]
return rearranged_output
# training loop where you process your model’s output
optimizer.zero_grad()
output = model(node_features, edge_features, edge_index)
rearranged_action_space = rearrange_output(output)
loss = custom_loss(output, targets, region_state_target, alpha=0.5)
loss.backward()
optimizer.step()
|
0b974d73271e3b1315cb169a24399855
|
{
"intermediate": 0.2914964258670807,
"beginner": 0.39785531163215637,
"expert": 0.31064820289611816
}
|
45,087
|
You are given a code in python which gets as input a number that indicates the wind speed and stores it in a variable named wind.
Note: we will learn in next lessons how to get input from the user, currently just don't touch the first line.
Your task is to initialize variable status based on the conditions:
"Calm" if wind is smaller than 8,
"Breeze" if wind is between 8 and 31 (including 8 and 31).
"Gale" if wind is between 32 and 63 (including 32 and 63)
"Storm" otherwise
|
0c68edaa6b6564f9d9bf0a5af46e214f
|
{
"intermediate": 0.3414185345172882,
"beginner": 0.24075695872306824,
"expert": 0.41782450675964355
}
|
45,088
|
CORRECT THIS IN SQL SERVER ALTER TABLE DEVICE_KIPI ALTER COLUMN DEVICEID INT IDENTITY(1,1)
|
cc441e3c76430485e8802c5b579a02de
|
{
"intermediate": 0.28762540221214294,
"beginner": 0.28735822439193726,
"expert": 0.425016313791275
}
|
45,089
|
access cmakelist variable in header and source folder on c language
|
68ac23ad54f598816fc1e0a0e24a5f78
|
{
"intermediate": 0.3254890739917755,
"beginner": 0.3591007888317108,
"expert": 0.31541013717651367
}
|
45,090
|
@value variables: "../../style/variables.module.css";
@value buttonPrimaryTextColor from variables;
.dropdown {
padding: 0.8rem 1.5rem;
}
.dropdownForward {
padding: 0.6rem 1.5rem;
min-height: 3.9rem;
align-items: center;
}
.dropdownItems .tags {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}
.dropdownItems .tag {
display: flex;
align-items: center;
justify-content: center;
height: 2rem;
border: 0.5px solid var(--secondary_border);
box-sizing: border-box;
padding: 0.2rem 2rem;
font-weight: 400;
line-height: normal;
background: var(--icon_background);
border-radius: 5px;
color: var(--header_text);
font-size: 1.4rem;
}
.dropdownItems .placeholder {
width: 100%;
height: 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.dropdownItems .placeholder label {
color: var(--primary_text_dark);
font-size: 1.8rem;
font-weight: 400;
line-height: normal;
}
.dropdownItems .placeholder i {
color: #b6b6b6;
}
.dropdownItems .selection {
display: flex;
width: 100%;
white-space: nowrap;
overflow: hidden;
align-items: center;
text-overflow: ellipsis;
}
.item {
padding: 1rem;
display: flex;
justify-content: flex-start;
align-items: center;
}
.label {
padding-left: 2rem;
}
.searchItem {
padding: 2rem 2rem 1.2rem 2rem;
width: inherit;
}
.searchIcon:hover {
cursor: pointer;
filter: brightness(80%);
}
.noSearchResultsItem {
padding: 1rem 2rem 1rem 2rem;
color: #ccc;
text-align: center;
}
.selection > label {
font-weight: 400;
font-size: 1.8rem;
line-height: normal;
color: var(--header_text);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
the above code is a css code of DropdownItem
import { Placement } from "@popperjs/core"
import classNames from "classnames"
import {
CSSProperties,
Fragment,
ReactNode,
useEffect,
useRef,
useState,
} from "react"
import { Checkbox } from "../checkbox/checkbox.component"
import { InputContainer } from "../input-container/input-container.component"
import { Input } from "../input/input.component"
import { Menu, MenuItem } from "../menu"
import { Popup } from "../popup/popup.component"
import { PopupOptions, PopupPosition } from "../popup/popup.types"
import styles from "./dropdown.styles.module.css"
export function DropdownItems<T>({
style,
menuStyle,
menuClassName,
menuItemClassName,
dropDownContent,
popupStyle,
mode = "primary",
type = "dropdown",
checkboxes = true,
multiselect = false,
placeholder,
selectMaxDisplayed = 1,
onSearch,
items,
itemRender,
tagRender,
elemRender,
checked,
onChange,
searchNoResultsLabel,
searchPlaceholder,
onClose,
checkBoxPosition = "left",
}: {
style?: CSSProperties
menuStyle?: CSSProperties
menuClassName?: string
menuItemClassName?: string
dropDownContent?: string
popupStyle?: CSSProperties
mode?: "primary" | "secondary"
type?: "dropdown" | "tags" | "forward"
multiselect?: boolean
checkboxes?: boolean
items: T[]
itemRender: (item: T, checked: boolean) => ReactNode
tagRender?: (item: T, checked: boolean) => ReactNode
elemRender?: (item: T, checked: boolean) => ReactNode
checked: (item: T) => boolean
onChange: (item: T, checked: boolean) => void
onSearch?: (items: T[], keyword: string) => T[]
onClose?: () => void
placeholder: string
selectMaxDisplayed?: number
searchNoResultsLabel?: string
searchPlaceholder?: string
checkBoxPosition?: "left" | "right"
}) {
// ---------------------------------------------------------------------------
// variables
// ---------------------------------------------------------------------------
const ref = useRef<any>(null)
const inputRef = useRef<HTMLInputElement | null>(null)
const [popupOptions, setPopupOptions] = useState<PopupOptions>({
placement: "bottom-start",
offset: [0, 5],
})
const [searchKeyword, setSearchKeyword] = useState("")
const selectedItems = items.filter((item) => checked(item))
const visibleItems =
onSearch && searchKeyword ? onSearch(items, searchKeyword) : items
// ---------------------------------------------------------------------------
// effects
// ---------------------------------------------------------------------------
useEffect(() => {
setPopupOptions((options) => ({
...options,
style: popupStyle,
}))
}, [popupStyle])
// ---------------------------------------------------------------------------
// functions
// ---------------------------------------------------------------------------
function openPopup(position: PopupPosition) {
setPopupOptions((options) => ({
...options,
position,
}))
}
function closePopup() {
setPopupOptions((options) => ({
...options,
position: undefined,
}))
if (!onClose) return
onClose()
}
function isPopupOpened() {
return popupOptions.position !== undefined
}
// ---------------------------------------------------------------------------
// memos
// ---------------------------------------------------------------------------
const ArrowIcon = (
<i
className={classNames({
fal: true,
"fa-chevron-right": !isPopupOpened(),
"fa-chevron-down": isPopupOpened(),
})}
style={{ lineHeight: "normal" }}
/>
)
const DropdownContent = () => {
if (dropDownContent) {
return (
<div className={styles.placeholder}>
{dropDownContent}
{ArrowIcon}
</div>
)
} else if (type === "tags" && selectedItems.length && tagRender) {
return (
<div className={styles.tags}>
{selectedItems.map((item, index) => (
<div key={index} className={styles.tag}>
{tagRender(item, checked(item))}
</div>
))}
</div>
)
} else {
if (type === "forward" && selectedItems.length && elemRender) {
return (
<div className={styles.tags}>
{selectedItems.map((item, index) => (
<Fragment key={index}>{elemRender(item, checked(item))}</Fragment>
))}
</div>
)
} else {
if (selectedItems.length === 0) {
return (
<div className={styles.placeholder}>
<label>{placeholder}</label>
{type !== "forward" && ArrowIcon}
</div>
)
} else if (selectedItems.length <= selectMaxDisplayed) {
if (multiselect && selectedItems.length > 1) {
return (
<div className={styles.selection}>
<label>
{selectedItems
.map((item) => itemRender(item, checked(item)))
.join(", ")}
</label>
{ArrowIcon}
</div>
)
} else {
return (
<div className={styles.selection}>
<label>
{selectedItems.map((item) => itemRender(item, checked(item)))}
</label>
{ArrowIcon}
</div>
)
}
} else if (selectedItems.length > selectMaxDisplayed) {
return (
<div className={styles.selection}>
<label>{selectedItems.length} selected</label>
{ArrowIcon}
</div>
)
}
}
}
}
const DropdownMenu = (
<Menu style={menuStyle} className={menuClassName}>
{onSearch && (
<>
<MenuItem className={styles.searchItem} hover={false}>
<div style={{ margin: "-1rem 0", width: "100%" }}>
<Input
inputRef={inputRef}
style={{ width: "100%" }}
mode="secondary"
iconClassName={searchKeyword ? styles.searchIcon : ""}
className={styles.searchInputContainer}
placeholder={searchPlaceholder}
value={searchKeyword}
onChange={(e) => setSearchKeyword(e.target.value)}
onIconClick={() => {
if (inputRef.current) {
inputRef.current.focus()
}
setSearchKeyword("")
}}
icon={searchKeyword ? "fa-light fa-xmark" : "fal fa-search"}
/>
</div>
</MenuItem>
{/* <MenuSeparator /> */}
</>
)}
{visibleItems.map((item, index) => (
<MenuItem
className={menuItemClassName}
key={index}
selected={checkboxes === false && checked(item)}
onClick={() => {
onChange(item, !checked(item))
if (multiselect === false) {
closePopup()
}
}}
>
{checkboxes && checkBoxPosition === "right" ? (
<div
style={{
display: "flex",
flexDirection: "row-reverse",
justifyContent: "space-between",
alignItems: "center",
width: "100%",
margin: "0.8rem 1.5rem",
}}
>
<Checkbox
style={{ marginLeft: "2rem" }}
checked={checked(item)}
/>
{itemRender(item, checked(item))}
</div>
) : checkboxes && checkBoxPosition === "left" ? (
<Checkbox className={styles.item} checked={checked(item)}>
<span className={styles.label}>
{itemRender(item, checked(item))}
</span>
</Checkbox>
) : (
<></>
)}
{!checkboxes && (
<div className={styles.item}>{itemRender(item, checked(item))}</div>
)}
</MenuItem>
))}
{visibleItems.length === 0 && searchKeyword && (
<MenuItem hover={false}>
<div className={styles.noSearchResultsItem}>
{searchNoResultsLabel || "No results"}
</div>
</MenuItem>
)}
</Menu>
)
// ---------------------------------------------------------------------------
return (
<>
<Popup options={popupOptions} onOptionsChange={setPopupOptions}>
{(!!visibleItems.length || onSearch) && DropdownMenu}
</Popup>
<div
ref={ref}
style={style}
className={styles.dropdownItems}
onClick={(e) => {
if (isPopupOpened()) return
e.preventDefault()
openPopup(ref)
}}
>
<InputContainer
mode={mode}
className={
type === "forward" ? styles.dropdownForward : styles.dropdown
}
focused={isPopupOpened()}
>
{DropdownContent()}
</InputContainer>
</div>
</>
)
}
export function DropdownMenu<T>({
style,
popupStyle,
items,
itemRender,
onClickItem,
children,
opened,
className,
onOpen,
onClose,
placement = "bottom-start",
selectedIndex,
}: {
style?: CSSProperties
popupStyle?: CSSProperties
items: T[]
itemRender: (item: T) => ReactNode
onClickItem: (item: T) => void
children: ReactNode
opened: boolean
className?: string
onOpen?: () => void
onClose?: () => void
placement?: Placement
selectedIndex?: number
}) {
// ---------------------------------------------------------------------------
// variables
// ---------------------------------------------------------------------------
const ref = useRef<any>(null)
const [popupOptions, setPopupOptions] = useState<PopupOptions>({
placement: placement,
offset: [0, 5],
})
// ---------------------------------------------------------------------------
// effects
// ---------------------------------------------------------------------------
// useEffect(() => {
// console.log("keyWord opened", opened, items)
// }, [opened, items])
useEffect(() => {
setPopupOptions((options) => ({
...options,
style: popupStyle,
}))
}, [popupStyle])
useEffect(() => {
if (opened) {
if (isPopupOpened) return
openPopup(ref)
} else {
closePopup()
}
}, [opened])
// ---------------------------------------------------------------------------
// functions
// ---------------------------------------------------------------------------
function openPopup(position: PopupPosition) {
if (onOpen) onOpen()
setPopupOptions((options) => ({
...options,
position,
}))
}
function closePopup() {
if (onClose) onClose()
setPopupOptions((options) => ({
...options,
position: undefined,
}))
}
const isPopupOpened = popupOptions.position !== undefined
// ---------------------------------------------------------------------------
// ui-components
// ---------------------------------------------------------------------------
const DropdownMenu = (
<Menu className={className}>
{items.map((item, index) => (
<MenuItem
key={index}
selected={selectedIndex !== undefined && selectedIndex === index}
onClick={() => {
onClickItem(item)
closePopup()
}}
>
{itemRender(item)}
</MenuItem>
))}
</Menu>
)
// ---------------------------------------------------------------------------
return (
<>
<Popup options={popupOptions} onOptionsChange={setPopupOptions}>
{!!items.length && DropdownMenu}
</Popup>
<div
ref={ref}
style={style}
className={classNames(styles.popup, styles.dropdownItems)}
>
{children}
</div>
</>
)
}
this is code of dropdownItem component. I want you convert dropdown item component with css to react native. Please don't leave anything
|
9b0b3391931e76d068130750551acc97
|
{
"intermediate": 0.2936490774154663,
"beginner": 0.5187276005744934,
"expert": 0.18762336671352386
}
|
45,091
|
comment faire pour qau' clique sur le titre du quizz ça transforme le titre en champ et on peut le modifier : <script>
export default {
data() {
return {
questionnaires: [],
selectedQuestionnaire: null,
selectedQuestionnaireId: null, // new data property
title: "Mes Questionnaires: ",
name: "",
newQuestion: {
title: "",
type: "Question simple",
proposition1: "",
proposition2: "",
reponse: "",
},
};
},
methods: {
selectQuestionnaire(questionnaire) {
fetch(
`http://127.0.0.1:5000/quiz/api/v1.0/quiz/${questionnaire.id}/questions`
)
.then((response) => response.json())
.then((json) => {
this.selectedQuestionnaire = json;
this.selectedQuestionnaireId = questionnaire.id; // set the id here
});
},
modif(question) {
// ...
},
creerQuiz(name) {
fetch("http://127.0.0.1:5000/quiz/api/v1.0/quiz", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ name: name }),
})
.then((response) => response.json())
.then((json) => {
console.log(json);
this.fetchQuestionnaires();
});
},
fetchQuestionnaires() {
fetch("http://127.0.0.1:5000/quiz/api/v1.0/quiz")
.then((response) => response.json())
.then((json) => {
this.questionnaires = json;
});
},
supprimerQuestion(question) {
fetch(
`http://127.0.0.1:5000/quiz/api/v1.0/quiz/questions/${question.id}`,
{
method: "DELETE",
}
)
.then((response) => response.json())
.then((json) => {
console.log(json);
if (json.result) {
this.selectedQuestionnaire = this.selectedQuestionnaire.filter(
(q) => q.id !== question.id
);
}
});
},
supprimerQuestion(question) {
fetch(`http://127.0.0.1:5000/quiz/api/v1.0/quiz/${this.selectedQuestionnaireId}/questions/${question.id}`, {
method: "DELETE",
})
.then((response) => {
if (!response.ok) {
throw new Error('La suppression de la question a échoué');
}
return response.json();
})
.then((json) => {
console.log(json);
if (json.result) {
// Mise à jour de l'affichage en filtrant les questions restantes
this.selectedQuestionnaire = this.selectedQuestionnaire.filter(
(q) => q.id !== question.id
);
}
})
.catch(error => {
console.error('Erreur lors de la suppression de la question:', error);
});
},
// fonction a changer pour ajouter question a un questionnaire
ajouterQuestion() {
let requestBody = {
contenu: this.newQuestion.title,
question_type: this.newQuestion.type,
};
if (this.newQuestion.type === 'Question multiple') {
requestBody.proposition1 = this.newQuestion.proposition1;
requestBody.proposition2 = this.newQuestion.proposition2;
requestBody.reponse = this.newQuestion.reponse;
} else {
requestBody.reponse = this.newQuestion.reponse;
}
fetch(`http://127.0.0.1:5000/quiz/api/v1.0/quiz/${this.selectedQuestionnaireId}/questions`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(requestBody),
})
.then(response => response.json())
.then(json => {
console.log(json);
if (json.result) {
this.selectedQuestionnaire.push(json.question);
}
});
// Réinitialiser le formulaire
this.newQuestion = {
title: "",
type: "Question simple",
reponse: "",
proposition1: "",
proposition2: "",
};
}
},
mounted() {
this.fetchQuestionnaires();
},
};
</script>
<template>
<div>
<h1>{{ title }}</h1>
<h2>Creer un Quiz</h2>
<input type="text" v-model="name" />
<button @click="creerQuiz(name)">Creer Quiz</button>
<ul>
<li v-for="questionnaire in questionnaires" :key="questionnaire.id">
{{ questionnaire.name }}
<button @click="selectQuestionnaire(questionnaire)">
Voir les question
</button>
<button @click="supprimerQuestionnaire(questionnaire)">
Supprimer Questionnaire
</button>
<div v-if="selectedQuestionnaireId === questionnaire.id">
<select v-model="newQuestion.type">
<option value="Question simple">Question simple</option>
<option value="Question multiple">Question multiple</option>
</select>
<input type="text" v-model="newQuestion.title" placeholder="Intitulé de la question"/>
<input v-if="newQuestion.type === 'Question simple'" type="text" v-model="newQuestion.reponse" placeholder="Réponse"/>
<input v-if="newQuestion.type === 'Question multiple'" type="text" v-model="newQuestion.proposition1" placeholder="Proposition 1"/>
<input v-if="newQuestion.type === 'Question multiple'" type="text" v-model="newQuestion.proposition2" placeholder="Proposition 2"/>
<button @click="ajouterQuestion">Ajouter une question</button>
<div v-if="selectedQuestionnaire">
<div v-for="question in selectedQuestionnaire" :key="question.id">
<p v-if="question.type === 'SimpleQuestion'">
Question : {{ question.contenu }} Reponse :
{{ question.reponse }}
</p>
<p v-else-if="question.type === 'QuestionMultiple'">
{{ question.contenu }} - Option 1: {{ question.proposition1 }} -
Option 2: {{ question.proposition2 }} - Reponse
{{ question.reponse }}
</p>
<button @click="supprimerQuestion(question)">Supprimer</button>
</div>
</div>
</div>
</li>
</ul>
</div>
</template>
|
7d4dea894369b00564b685ce3994f9f9
|
{
"intermediate": 0.35384416580200195,
"beginner": 0.5332226753234863,
"expert": 0.11293309181928635
}
|
45,092
|
If I am using huggingface inference api. Do I need to use write or read if the Chatbot will be taking input from users
|
650ff73cb802b4e3c95d648e24212960
|
{
"intermediate": 0.6958293914794922,
"beginner": 0.07718641310930252,
"expert": 0.2269841581583023
}
|
45,093
|
in servicenow if the incident category is IT Infrastructure, then only these particular group members (monitoring, delivery team) can see that incident
|
c2ea0f83b071fba83baf47cfd542239a
|
{
"intermediate": 0.199054554104805,
"beginner": 0.41749048233032227,
"expert": 0.38345494866371155
}
|
45,094
|
sudo iptables -I INPUT 1 -s 192.168.50.149 -j ACCEPT
sudo iptables -I OUTPUT 1 -d 192.168.50.149 -j ACCEPT
sudo iptables -Z
what does these command for iptables do?
|
5a591ca2e138bc9083d3af6394cbaf06
|
{
"intermediate": 0.3640291392803192,
"beginner": 0.32896527647972107,
"expert": 0.30700549483299255
}
|
45,095
|
How to verify user registration with Colyseus via email
|
6229956db9c5a579f8b1bdd4e982efb1
|
{
"intermediate": 0.3917074203491211,
"beginner": 0.21020819246768951,
"expert": 0.3980844020843506
}
|
45,096
|
How can I do RLHF to a open source model?
|
43ee9eb1162f330c042fa5166571bfc9
|
{
"intermediate": 0.3361261188983917,
"beginner": 0.13761863112449646,
"expert": 0.5262552499771118
}
|
45,097
|
翻译成英语并优化句子:从group by device type的结果可以看到,结果中device len长度为16的只有android类型
|
c4cb20e62ad24db962041d15d9cfba02
|
{
"intermediate": 0.37036117911338806,
"beginner": 0.24027441442012787,
"expert": 0.3893643915653229
}
|
45,098
|
import PyPDF4
reader = PyPDF4.PdfFileReader(open("rexulti.pdf", "rb"))
writer = PyPDF4.PdfFileWriter("output.pdf")
writer.addPage(reader.getPage(0))
writer.addPage(reader.getPage(1))
writer.addPage(reader.getPage(2))
writer.addPage(reader.getPage(3))
writer.addPage(reader.getPage(4))
writer.write()
print("Output successfully written to", "output.pdf")
reader.close()
writer.close()
Traceback (most recent call last):
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\main.py", line 3, in <module>
reader = PyPDF4.PdfFileReader(open("rexulti.pdf", "rb"))
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\.venv\Lib\site-packages\PyPDF4\pdf.py", line 1148, in __init__
self.read(stream)
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\.venv\Lib\site-packages\PyPDF4\pdf.py", line 1872, in read
streamData = BytesIO(b_(xrefstream.getData()))
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\.venv\Lib\site-packages\PyPDF4\generic.py", line 843, in getData
decoded._data = filters.decodeStreamData(self)
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\.venv\Lib\site-packages\PyPDF4\filters.py", line 401, in decodeStreamData
data = FlateDecode.decode(data, stream.get("/DecodeParms"))
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\.venv\Lib\site-packages\PyPDF4\filters.py", line 113, in decode
data = decompress(data)
File "c:\Users\NTS-SiddheshDongre\Desktop\Projects\Pdf_Test\.venv\Lib\site-packages\PyPDF4\filters.py", line 51, in decompress
return zlib.decompress(data)
zlib.error: Error -5 while decompressing data: incomplete or truncated stream
|
7aca6d0a8dc0dc4997c18a06878ba844
|
{
"intermediate": 0.460259348154068,
"beginner": 0.3034985065460205,
"expert": 0.2362421751022339
}
|
45,099
|
pourquoi la pagination ne fait rien ? l'evenement se déclenche bien mais rien ne change à l'écran : import PersonnagesProvider from "../../services/PersonnagesProvider.js";
import FavoriteManager from '../../services/FavoriteManager.js';
import { renderNavbar } from "./navBar.js";
import { lazyLoadImages } from '../../services/LazyLoading.js';
export default class Home {
constructor() {
this.currentPage = 1;
}
async render() {
let personnages = await PersonnagesProvider.FetchPersonnages(10, this.currentPage);
let html = `<div class="personnages-container">
${personnages
.map(
(personnage) => /*html*/ `
<div class="personnage">
<a href="/#/personnage/${personnage.id}">
<img class="personnage-img" src="${personnage.img}" alt="${personnage.name}">
</a>
<p>${personnage.nom} <a id="favori-${personnage.id}" onclick="FavoriteManager.toggleFavorites('${personnage.id}');">
${FavoriteManager.isFavorite(personnage.id) ?
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16"><path d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/></svg>' :
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16"><path d="M8 2.748l-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/></svg>'}
</a></p>
</div>
`
)
.join("\n ")}
</div>
<div class="pagination">
<button id="prev-page">Previous</button>
<span>Page ${this.currentPage}</span>
<button id="next-page">Next</button>
</div>`;
return /*html*/ `
${renderNavbar()}
${html}
`;
}
after_render() {
lazyLoadImages('.personnage-img');
document.getElementById('prev-page').addEventListener('click', () => {
this.currentPage = Math.max(this.currentPage - 1, 1);
this.render();
});
document.getElementById('next-page').addEventListener('click', () => {
this.currentPage++;
this.render();
});
}
}import { ENDPOINT } from "../config.js";
import PersonnageModel from "../models/PersonnageModel.js";
export default class PersonnagesProvider{
static FetchPersonnages = async (limit = 10, page = 1) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
const offset = (page - 1) * limit;
try {
const response = await fetch(`${ENDPOINT}/personnages?_limit=${limit}&_start=${offset}`, options)
const json = await response.json();
return json
} catch (err) {
console.log('Error getting documents', err)
}
}
static searchPersonnages = async (searchTerm) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try {
const response = await fetch(`${ENDPOINT}/personnages`, options)
const json = await response.json();
return json.filter(personnage => personnage.nom.toLowerCase().includes(searchTerm));
} catch (err) {
console.log('Error getting documents', err)
}
}
static getPersonnages = async (id) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try{
const response = await fetch(`${ENDPOINT}/personnages?id=` + id, options)
const json = await response.json();
return new PersonnageModel(json[0].id, json[0].nom, json[0].classe, json[0].niveau, json[0].note, json[0].experience, json[0].statistiques);
}catch (err){
console.log('Error getting documents', err)
}
}
static updatePersonnage = async(personnage) => {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": personnage.id,
"nom": personnage.nom,
"classe": personnage.classe,
"niveau": personnage.niveau,
"note": personnage.note,
"experience": personnage.experience,
"statistiques": personnage.statistiques
})
};
try{
const response = await fetch(`${ENDPOINT}/personnages/` + personnage.id, options)
const json = await response.json();
return new PersonnageModel(json.id, json.nom, json.classe, json.niveau, json.note, json.experience, json.statistiques);
}catch(err){
console.log('Error getting documents', err)
}
}
static async getFavoritePersonnages() {
let allPersonnages = await this.FetchPersonnages();
let favorites = FavoriteManager.getFavorites();
return allPersonnages.filter(personnage => favorites.includes(personnage.id));
}
}import PersonnagesProvider from "../../services/PersonnagesProvider.js";
import Utils from "../../services/Utils.js";
import FavoriteManager from "../../services/FavoriteManager.js";
export default class Personnage{
async render(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
return /*html*/`
<script>
function testt(){
console.log("test");
}
</script>
<section class="section">
<h1> Nom : ${personnage.nom}</h1>
<p> Classe : ${personnage.classe} </p>
<p> Note : ${personnage.note} </p>
<p id="niveau"> Niveau(x) : ${personnage.niveau} </p>
<p id="exp"> Expérience(s) : ${personnage.experience} </p>
</section>
<button id="add_exp">+ 100 expériences</button><br><br>
${
FavoriteManager.isFavorite(personnage.id) ? "<button id='remove_favoris'>Supprimer des favoris</button>" : "<button id='add_favoris'>Ajouter en favoris</button>"
}
<br><br>
<div id="note">
<button id="remove_note">-</button>
<div id="etoiles"></div>
<button id="add_note">+</button>
</div>
<p><a href="/">Retour</a></p>
`
}
async after_render(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
let etoiles = document.querySelector("#etoiles");
let note = document.querySelector("#note");
note.style.display = "flex";
// ajoute les etoiles jaunes
for(let i = 0; i < personnage.note; i++){
etoiles.innerHTML += "<img src='assets/etoile2.png' width='20px' height='20px'/>";
}
// ajoute les etoiles noires
for(let i = 0; i < 5 - personnage.note; i++){
etoiles.innerHTML += "<img src='assets/etoile1.png' width='20px' height='20px'/>";
}
document.querySelector("#add_note").addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
if(personnage.note < 5){
personnage.note++;
personnage.update();
}
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#remove_note").addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
if(personnage.note > 0){
personnage.note--;
personnage.update();
}
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#add_exp").addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
personnage.experience += 100;
personnage.update();
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#add_favoris")?.addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
FavoriteManager.addToFavorites(personnage.id);
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#remove_favoris")?.addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
FavoriteManager.removeFromFavorites(personnage.id);
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
}
}
|
3a214985298bd026ebc70b9495d9cf13
|
{
"intermediate": 0.3815072178840637,
"beginner": 0.4303036630153656,
"expert": 0.18818911910057068
}
|
45,100
|
pourquoi page next et prev ne font rien bien que l'évènement soir prit en compte ?import PersonnagesProvider from "../../services/PersonnagesProvider.js";
import Utils from "../../services/Utils.js";
import FavoriteManager from "../../services/FavoriteManager.js";
export default class Personnage{
async render(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
return /*html*/`
<script>
function testt(){
console.log("test");
}
</script>
<section class="section">
<h1> Nom : ${personnage.nom}</h1>
<p> Classe : ${personnage.classe} </p>
<p> Note : ${personnage.note} </p>
<p id="niveau"> Niveau(x) : ${personnage.niveau} </p>
<p id="exp"> Expérience(s) : ${personnage.experience} </p>
</section>
<button id="add_exp">+ 100 expériences</button><br><br>
${
FavoriteManager.isFavorite(personnage.id) ? "<button id='remove_favoris'>Supprimer des favoris</button>" : "<button id='add_favoris'>Ajouter en favoris</button>"
}
<br><br>
<div id="note">
<button id="remove_note">-</button>
<div id="etoiles"></div>
<button id="add_note">+</button>
</div>
<p><a href="/">Retour</a></p>
`
}
async after_render(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
let etoiles = document.querySelector("#etoiles");
let note = document.querySelector("#note");
note.style.display = "flex";
// ajoute les etoiles jaunes
for(let i = 0; i < personnage.note; i++){
etoiles.innerHTML += "<img src='assets/etoile2.png' width='20px' height='20px'/>";
}
// ajoute les etoiles noires
for(let i = 0; i < 5 - personnage.note; i++){
etoiles.innerHTML += "<img src='assets/etoile1.png' width='20px' height='20px'/>";
}
document.querySelector("#add_note").addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
if(personnage.note < 5){
personnage.note++;
personnage.update();
}
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#remove_note").addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
if(personnage.note > 0){
personnage.note--;
personnage.update();
}
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#add_exp").addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
personnage.experience += 100;
personnage.update();
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#add_favoris")?.addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
FavoriteManager.addToFavorites(personnage.id);
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
document.querySelector("#remove_favoris")?.addEventListener("click", async function(){
let request = Utils.parseRequestURL();
let personnage = await PersonnagesProvider.getPersonnages(request.id);
FavoriteManager.removeFromFavorites(personnage.id);
// actualise la page
let content = document.querySelector('#content');
let p = new Personnage();
content.innerHTML = await p.render();
await p.after_render();
});
}
}const Utils = {
// --------------------------------
// Parse a url and break it into resource, id and verb
// --------------------------------
parseRequestURL : () => {
let url = location.hash.slice(1).toLowerCase() || '/';
let r = url.split("/")
let request = {
resource : null,
id : null,
verb : null
}
request.resource = r[1]
request.id = r[2]
request.verb = r[3]
return request
}
// --------------------------------
// Simple sleep implementation
// --------------------------------
, sleep: (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
}
export default Utils;import { ENDPOINT } from "../config.js";
import PersonnageModel from "../models/PersonnageModel.js";
export default class PersonnagesProvider{
static FetchPersonnages = async (limit = 10, page = 1) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
const offset = (page - 1) * limit;
try {
const response = await fetch(`${ENDPOINT}/personnages?_limit=${limit}&_start=${offset}`, options)
const json = await response.json();
return json
} catch (err) {
console.log('Error getting documents', err)
}
}
static searchPersonnages = async (searchTerm) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try {
const response = await fetch(`${ENDPOINT}/personnages`, options)
const json = await response.json();
return json.filter(personnage => personnage.nom.toLowerCase().includes(searchTerm));
} catch (err) {
console.log('Error getting documents', err)
}
}
static getPersonnages = async (id) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try{
const response = await fetch(`${ENDPOINT}/personnages?id=` + id, options)
const json = await response.json();
return new PersonnageModel(json[0].id, json[0].nom, json[0].classe, json[0].niveau, json[0].note, json[0].experience, json[0].statistiques);
}catch (err){
console.log('Error getting documents', err)
}
}
static updatePersonnage = async(personnage) => {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": personnage.id,
"nom": personnage.nom,
"classe": personnage.classe,
"niveau": personnage.niveau,
"note": personnage.note,
"experience": personnage.experience,
"statistiques": personnage.statistiques
})
};
try{
const response = await fetch(`${ENDPOINT}/personnages/` + personnage.id, options)
const json = await response.json();
return new PersonnageModel(json.id, json.nom, json.classe, json.niveau, json.note, json.experience, json.statistiques);
}catch(err){
console.log('Error getting documents', err)
}
}
static async getFavoritePersonnages() {
let allPersonnages = await this.FetchPersonnages();
let favorites = FavoriteManager.getFavorites();
return allPersonnages.filter(personnage => favorites.includes(personnage.id));
}
}<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Solo Leveling</title>
<script type="module" src="/js/app.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<body>
<main>
<div class="container">
<div id="content"></div>
</div>
</main>
</body>
</html>
|
d80b871cc16333b67d1609f7a729aa51
|
{
"intermediate": 0.47232121229171753,
"beginner": 0.3485927879810333,
"expert": 0.17908599972724915
}
|
45,101
|
route query to dynamic fields in solr
|
9338ccb78c459e75d13855af61461680
|
{
"intermediate": 0.3987540900707245,
"beginner": 0.21578647196292877,
"expert": 0.38545939326286316
}
|
45,102
|
What is latent space representation of image, VAE and how it can be defined as a structure on Python?
|
70f4fa3c1d2350f1470c012e18d493ef
|
{
"intermediate": 0.3756882846355438,
"beginner": 0.11190833896398544,
"expert": 0.5124034285545349
}
|
45,103
|
File "/root/miniconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1014, in load
return _load(opened_zipfile,
File "/root/miniconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1422, in _load
result = unpickler.load()
File "/root/miniconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1415, in find_class
return super().find_class(mod_name, name)
ModuleNotFoundError: No module named 'utils'
|
e162d8c61ebe2194971902f25b2849d7
|
{
"intermediate": 0.25989121198654175,
"beginner": 0.5775949358940125,
"expert": 0.1625138819217682
}
|
45,104
|
в этом методе мне нужно вызвать вместо releaseHold(operation) метод releaseHoldAsync
public WorkResult<Void> cancelHoldOrder(AcquiringOperation operation) {
// Отправим запрос в банк
PayResult payResult = acquiringServiceWrapper.releaseHold(operation);
if (PayResultType.OK.equals(payResult.getType())) {
if (payResult.getPaymentResponse() != null && payResult.getPaymentResponse().isSuccessOperation()) {
// Ответ от процессинга положительный
cancelOrder(operation, MERCHANT_REJECT_AUTHORIZE);
return new WorkResult<>(true);
} else if (payResult.getPaymentResponse() != null && !payResult.getPaymentResponse().isSuccessOperation() && HOLD_ALREADY_RELEASED_CODE.equals(payResult.getPaymentResponse().getReasonCode())) {
// Процессинг ответил, что не может снять HOLD, т.к. он уже снят.
// Снимем его со своей стороны
cancelOrder(operation, MERCHANT_REJECT_AUTHORIZE);
return new WorkResult<>(true);
} else {
String processingError = payResult.getPaymentResponse() != null ? payResult.getPaymentResponse().getMessage() + "(" + payResult.getPaymentResponse().getReasonCode() + ")" : "Unknown error";
// Процессинг ответил ошибкой
LOGGER.error("Ошибка снятия состояния HOLD на стороне банка (id = {}): {}", operation.getId(), processingError);
return new WorkResult<>(false, processingError);
}
} else {
LOGGER.error("Ошибка снятия состояния HOLD на стороне банка (id = {}): {}", operation.getId(), payResult.getError());
return new WorkResult<>(false, payResult.getError());
}
}
@Override
public void releaseHoldAsync(AcquiringOperation operation) throws IOException, TimeoutException {
String acquirerCode = ((Company) operation.getPartnerProduct().getPartner()).getCode();
acquiringExternalGateway.releaseHoldAsync(prepareForHold(operation), acquirerCode);
}
|
0783a603070606e6718e97f73597c68a
|
{
"intermediate": 0.3172703683376312,
"beginner": 0.4643881916999817,
"expert": 0.21834143996238708
}
|
45,105
|
what formula can we formulate in button for assigned in text box M8 in vba Excel?
|
7c986cc239663289c7a0e37562bf6f2f
|
{
"intermediate": 0.43946900963783264,
"beginner": 0.23100614547729492,
"expert": 0.3295247554779053
}
|
45,106
|
generate a roslaunch file to spawn a urdf which is in the package laser
|
4ed4bec5cb9182cbde928cdde0401fd4
|
{
"intermediate": 0.3595198392868042,
"beginner": 0.1657022088766098,
"expert": 0.4747779369354248
}
|
45,107
|
fin = [re.sub(r'\r\n', '', line) for line in data_list]
what is the use of this line
|
8e032ff0ffb83877b69cdb908a996ff7
|
{
"intermediate": 0.3452129662036896,
"beginner": 0.4934331476688385,
"expert": 0.1613539308309555
}
|
45,108
|
Make a GET request with multiples queries inside, like [{"id":10, "from": 100, "to": 1000}, {"id":20, "from": 200, "to": 2000}], in the RESTful way.
|
59f17aa27be400f49e3f4b39a418dfd3
|
{
"intermediate": 0.4640728533267975,
"beginner": 0.2681483328342438,
"expert": 0.26777881383895874
}
|
45,109
|
In servicenow, what is the different between Document Intelligence and Email and case categorization in Customer Service Management
|
f3b4d710795cba8da6fd7eddb00e4e64
|
{
"intermediate": 0.388033002614975,
"beginner": 0.35186243057250977,
"expert": 0.2601045072078705
}
|
45,110
|
parse python fstring in rust lang simple example
|
1782f0c96110bab4573af93f71880855
|
{
"intermediate": 0.3293168544769287,
"beginner": 0.530239999294281,
"expert": 0.14044314622879028
}
|
45,111
|
#include "/home/danya/raylib/src/raylib.h"
#include <cmath>
#include <vector>
#include <cstdlib>
struct CircleData {
Vector2 position;
float radius;
Color color;
};
int main()
{
// Initialization
const int screenWidth = 800;
const int screenHeight = 450;
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT);
InitWindow(screenWidth, screenHeight, "OpenAge map editor");
SetTargetFPS(60);
Camera2D camera = { 0 };
camera.target = (Vector2){ GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f };
camera.offset = (Vector2){ GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
Texture2D background = LoadTexture("background.png");
Vector2 mousePosition = { 0.0f, 0.0f };
float wheelMove = 0.0f;
float smoothTime = 30.0f;
float camSmoothTime = 30.0f; // The time it should take to reach the target
std::vector<CircleData> circles; // Vector to store circle data
// Main loop
while (!WindowShouldClose())
{
// Update
mousePosition = GetMousePosition();
wheelMove = GetMouseWheelMove();
camera.offset = (Vector2){ GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f };
// Draw
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode2D(camera);
DrawTextureEx(background, (Vector2){ 0.0f, 0.0f }, 0.0f, 1.0f, WHITE);
// Draw existing circles
for (const auto& circle : circles)
{
DrawCircleV(circle.position, circle.radius, circle.color);
}
// Handle zooming
if (wheelMove != 0.0f)
{
float zoomFactor = (wheelMove < 0) ? 0.9f : 1.1f; // Zoom in decreases by 10%, zoom out increases by 10%
camera.zoom *= zoomFactor;
camera.offset = (Vector2){ GetScreenWidth() / (2.0f * camera.zoom), GetScreenHeight() / (2.0f * camera.zoom) };
if (camera.zoom < 0.20f) camera.zoom = 0.20f;
if (camera.zoom > 40.0f) camera.zoom = 40.0f;
}
// Smooth camera movement
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
{
Vector2 delta = GetMouseDelta();
Vector2 target = (Vector2){ camera.target.x - delta.x / camera.zoom, camera.target.y - delta.y / camera.zoom };
// Interpolate the current target towards the new target
camera.target.x += (target.x - camera.target.x) * smoothTime * GetFrameTime();
camera.target.y += (target.y - camera.target.y) * smoothTime * GetFrameTime();
float minX = -camera.offset.x;
float minY = -camera.offset.y;
float maxX = background.width + camera.offset.x;
float maxY = background.height + camera.offset.y;
// Ensure the target position is within the allowed range
camera.target.x = (target.x < minX) ? minX : (target.x > maxX) ? maxX : target.x;
camera.target.y = (target.y < minY) ? minY : (target.y > maxY) ? maxY : target.y;
// Interpolate the current target towards the new target
camera.target.x += (camera.target.x - camera.target.x) * smoothTime * GetFrameTime();
camera.target.y += (camera.target.y - camera.target.y) * smoothTime * GetFrameTime();
}
// Handle circle drawing
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
Vector2 worldMousePos = GetScreenToWorld2D(mousePosition, camera);
// Round the worldMousePos to the nearest integer to get pixel coordinates
Vector2 pixelPos = { std::round(worldMousePos.x), std::round(worldMousePos.y) };
CircleData newCircle;
newCircle.position = pixelPos;
newCircle.radius = 0.5f; // Set the desired radius for the circle
newCircle.color = RED; // Set the desired color for the circle
circles.push_back(newCircle);
}
EndMode2D();
EndDrawing();
}
// De-Initialization
CloseWindow(); // Close window and OpenGL context
// Unload textures
UnloadTexture(background);
std::exit(0);
return 0;
}
Дополни событие левой кнопки мыши функцией, которая рисует полигон с углами на координатах клика, полигон должен рисоваться не сразу а между поставленными точками, у полигона должна быть заливка случайного полупрозрачного цвета и обводка шириной в 2 пикселя экрана. Обводку можно будет отключать нажатием клавиши 's'
|
104bf903c99812591a04ebd1fa4e9b34
|
{
"intermediate": 0.29289916157722473,
"beginner": 0.43292540311813354,
"expert": 0.27417534589767456
}
|
45,112
|
Sita is a hard working woman. She does not buy things at the shopping mall.
sita is a hard working woman she does not buy things at the shopping mall
i want to process and send input like the second sentence where i remove all the punctuation marks to spacy to form relations between words. however by not including punctuations the relationship tree becomes different than the one with punctuations. i want it to remain the same. how can i achieve this
|
0e1e2d77a7959a0b70134651059ae6b4
|
{
"intermediate": 0.3966783285140991,
"beginner": 0.23198185861110687,
"expert": 0.3713397979736328
}
|
45,113
|
in cisco apic, how to query topSystem with filter controllers
|
416d3ee7766805aabe20da5c274d84a7
|
{
"intermediate": 0.40756258368492126,
"beginner": 0.17485547065734863,
"expert": 0.4175819456577301
}
|
45,114
|
hi generate me the hobbit game here..the origin first with ascii codes
|
ab11ce98bc454ceabae07edfc651a668
|
{
"intermediate": 0.33364337682724,
"beginner": 0.419724702835083,
"expert": 0.2466319054365158
}
|
45,115
|
in servicenow, i have a table name product, in this there are two fields name and parent record, and parent record refer to the same table. All records have there parents. suppose Name1 has parent Name 2 and Name 2 also have some parent suppose name5 .. heirarchy work like that. my requirement is i want to get the parent of particular record suppose there is a record called 'X' and it has parent called 'Y' and it can have further parent and so on. Therefore I want to get the super or top most parent record.
In case record 'X' has no parent then I want 'X' to return as it itself is the parent.
|
66340fd7eefedf7308cc6cc5def9922d
|
{
"intermediate": 0.45565077662467957,
"beginner": 0.2319105863571167,
"expert": 0.3124386966228485
}
|
45,116
|
Helop me to make write about me for linkedin profile
OBJECTIVE:
Highly motivated and skilled professional seeking a challenging position in a dynamic and reputable organization where I can utilize my diverse skill set and experience. Eager to contribute to the team’s success through hard work, attention to detail, and excellent problem-solving abilities. Committed to continuous learning and professional development, I aim to bring value and drive innovation within the company, fostering growth and achieving mutual goals
EXPERIENCE:
R & D Engineer ( Hybrid )
Bionic Imprints Pvt Ltd, Goa
Feb 2022 - Jan 2023
Drove research and development activities in a dynamic hybrid work environment.
Led end-to-end innovative solutions, overseeing machine design, product development, fabrication processes, in-house procedures, and vendor coordination.
Independently developed machine learning code to enhance intelligence.
Meteorology Technician
PhotoGAUGE India Pvt Ltd, Chennai
Aug 2018 – Nov 2021
Managed end-to-end hardware department operations, including design, fabrication, vendor relationships, and electronic microcontroller programming.
Specialized in creating communication interfaces and logic inputs for Android Bluetooth-based applications, ensuring seamless integration.
Led prototype MVP development aligned with project requirements, showcasing a proactive approach to innovation and problem-solving.
Design Engineer
Magic Studio, Chennai
Dec 2017 – May 2018
Managed fabrication processes, electrical assembly, hardware assembly, and testing.
Proficient in Arduino programming.
EDUCATION:
B.E Aeronautical Engineering
G.K.M College of Engineering & Technology
CGPA: 6.45
Aug 2013 – May 2017
SKILLS:
CAD
AUTOCAD
Solidworks
Program Language
C++
Python
Arduino
3D Printer
CURA
CHITUBOX
ML Frameworks
TensorFlow
PyTorch
Robotics
ROS
Gazebo simulator
PROJECTS:
Clear Aligner Manufacturing:
Utilized DLP 3D printing technology to produce jaw models and implemented the thermoforming process for the fabrication of clear dental aligners, showcasing advanced manufacturing techniques.
Tools/Skills: Thermoforming, DLP 3D Printing, Clear Aligner Production, CURA.
AI Tooth Segmentation for Medical Imaging:
Successfully replicated and applied the methodology from the research paper titled “A fully automatic AI system for tooth & alveolar bone segmentation from cone-beam CT images,” demonstrating expertise in medical imaging and machine learning. Proficient in handling DICOM & NIfTI files and implementing algorithms using PyTorch.
Tools/Skills: DICOM, NIfTI, PyTorch, TensorFlow, Python.
Web Application for Photogrammetry Reconstruction:
Developed a web application leveraging Django for photogrammetry reconstruction, enabling users to upload photos and download STL files through a user-friendly dashboard. This project highlighted my skills in both backend and frontend web development, as well as a basic understanding of AWS services.
Tools/Skills: Metashape SDK, Django, Celery, HTMX, Bootstrap, SQLite, AWS (EC2, RDS, IAM, S3).
Customized Mobile Robot with ROS:
Engineered a ROS package for precise path localization using an aruco marker, demonstrating capabilities in robotics software development and system integration for enhanced navigation accuracy.
Tools/Skills: ROS, Python, C++, Aruco Marker, Path Planning, Localization.
Machine Vision Camera Application:
Created a Python SDK application for a FLIR machine vision camera, deployed on a Raspberry Pi for efficient image capturing, showcasing my proficiency in software development and embedded systems.
Tools/Skills: FLIR Python Spinnaker SDK, Raspberry Pi.
Inspection Booth Design:
Designed and manufactured an inspection booth for high-quality imaging of mechanical components like gears and U-bolts, incorporating Arduino Bluetooth for seamless wireless control via Android applications. This project demonstrated my mechanical design skills and ability to integrate wireless communication.
Tools/Skills: Solidworks, Machine Learning Annotation, Arduino, Bluetooth Communication.
Turntable Design & Manufacturing:
Led the design and production of both electrical and manual turntables, accommodating various sizes and payload capacities. Implemented Arduino Bluetooth for remote control through Android applications, highlighting my expertise in mechanical engineering and electronics integration.
Tools/Skills: Bearings, Solidworks, Stepper Motors, Arduino, C++, Raspberry Pi, Bluetooth Module.
|
e2fcbf483a3b9f554f3afaf794ce946d
|
{
"intermediate": 0.42630264163017273,
"beginner": 0.33094286918640137,
"expert": 0.2427545040845871
}
|
45,117
|
how to make user registration with email verification Colyseus server side
|
30cc9365949e8d83d280e1647cc6f12f
|
{
"intermediate": 0.416239857673645,
"beginner": 0.23204290866851807,
"expert": 0.3517172336578369
}
|
45,118
|
what doest the following declaration means struct object_func roadprofile_func = {
attr_roadprofile,
(object_func_new)roadprofile_new,
(object_func_get_attr)roadprofile_get_attr,
(object_func_iter_new)roadprofile_attr_iter_new,
(object_func_iter_destroy)roadprofile_attr_iter_destroy,
(object_func_set_attr)roadprofile_set_attr,
(object_func_add_attr)roadprofile_add_attr,
(object_func_remove_attr)roadprofile_remove_attr,
(object_func_init)NULL,
(object_func_destroy)roadprofile_destroy,
(object_func_dup)roadprofile_dup,
(object_func_ref)navit_object_ref,
(object_func_unref)navit_object_unref,
};
|
b92ed21b77719f35219be26b143c1e64
|
{
"intermediate": 0.3808850049972534,
"beginner": 0.43620744347572327,
"expert": 0.18290750682353973
}
|
45,119
|
met en place sur la page home la fonctionnalité de pouvoir voir + de personnage, en premier lieu 5 personnages sont chargées puis 5 autres ect avec un boutton voir plus : import PersonnagesProvider from "../../services/PersonnagesProvider.js";
import FavoriteManager from '../../services/FavoriteManager.js';
import { renderNavbar } from "./navBar.js";
import LazyLoading from "../../services/LazyLoading.js";
export default class Home {
async render() {
let personnages = await PersonnagesProvider.FetchPersonnages();
let html = `<div class="personnages-container">
${personnages
.map(
(personnage) => /*html*/ `
<div class="personnage">
<a href="/#/personnage/${personnage.id}">
<img class="personnage-img" src="${personnage.img}" alt="${personnage.nom}">
</a>
<p>${personnage.nom} <a id="favori-${personnage.id}" onclick="FavoriteManager.toggleFavorites('${personnage.id}');">
${FavoriteManager.isFavorite(personnage.id) ?
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16"><path d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/></svg>' :
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16"><path d="M8 2.748l-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/></svg>'}
</a></p>
</div>
`
)
.join("\n ")}
</div>`;
return /*html*/ `
${renderNavbar()}
${html}
`;
}
async after_render() {
LazyLoading.init("personnage");
}
}
import { ENDPOINT } from "../config.js";
import PersonnageModel from "../models/PersonnageModel.js";
export default class PersonnagesProvider{
static FetchPersonnages = async () => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try {
const response = await fetch(`${ENDPOINT}/personnages`, options)
const json = await response.json();
return json.map(
personnage => new PersonnageModel(
personnage.id,
personnage.nom,
personnage.classe,
personnage.niveau,
personnage.note,
personnage.experience,
personnage.statistiques,
personnage.img)
);
} catch (err) {
console.log('Erreur', err)
}
}
static searchPersonnages = async (searchTerm) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try {
const response = await fetch(`${ENDPOINT}/personnages`, options)
const json = await response.json();
return json.filter(personnage => personnage.nom.toLowerCase().includes(searchTerm));
} catch (err) {
console.log('Erreur', err)
}
}
static getPersonnages = async (id) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try{
const response = await fetch(`${ENDPOINT}/personnages?id=` + id, options)
const json = await response.json();
return new PersonnageModel(json[0].id, json[0].nom, json[0].classe, json[0].niveau, json[0].note, json[0].experience, json[0].statistiques, json[0].img);
}catch (err){
console.log('Erreur', err)
}
}
static updatePersonnage = async(personnage) => {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": personnage.id,
"nom": personnage.nom,
"classe": personnage.classe,
"niveau": personnage.niveau,
"note": personnage.note,
"experience": personnage.experience,
"img": personnage.img,
"statistiques": personnage.statistiques
})
};
try{
const response = await fetch(`${ENDPOINT}/personnages/` + personnage.id, options)
const json = await response.json();
return new PersonnageModel(json.id, json.nom, json.classe, json.niveau, json.note, json.experience, json.statistiques, json.img);
}catch(err){
console.log('Erreur : ', err)
}
}
static async getFavoritePersonnages() {
let allPersonnages = await this.FetchPersonnages();
let favorites = FavoriteManager.getFavorites();
return allPersonnages.filter(personnage => favorites.includes(personnage.id));
}
}
|
ce5148dc82e130d2d81687de1f831bae
|
{
"intermediate": 0.3846360743045807,
"beginner": 0.4039214849472046,
"expert": 0.21144244074821472
}
|
45,120
|
met en place sur la page home la fonctionnalité de pouvoir voir + de personnage, en premier lieu 5 personnages sont chargées puis 5 autres ect avec un boutton voir plus : import PersonnagesProvider from "../../services/PersonnagesProvider.js";
import FavoriteManager from '../../services/FavoriteManager.js';
import { renderNavbar } from "./navBar.js";
import LazyLoading from "../../services/LazyLoading.js";
export default class Home {
async render() {
let personnages = await PersonnagesProvider.FetchPersonnages();
let html = `<div class="personnages-container">
${personnages
.map(
(personnage) => /*html*/ `
<div class="personnage">
<a href="/#/personnage/${personnage.id}">
<img class="personnage-img" src="${personnage.img}" alt="${personnage.nom}">
</a>
<p>${personnage.nom} <a id="favori-${personnage.id}" onclick="FavoriteManager.toggleFavorites('${personnage.id}');">
${FavoriteManager.isFavorite(personnage.id) ?
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16"><path d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/></svg>' :
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16"><path d="M8 2.748l-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/></svg>'}
</a></p>
</div>
`
)
.join("\n ")}
</div>`;
return /*html*/ `
${renderNavbar()}
${html}
`;
}
async after_render() {
LazyLoading.init("personnage");
}
}
import { ENDPOINT } from "../config.js";
import PersonnageModel from "../models/PersonnageModel.js";
export default class PersonnagesProvider{
static FetchPersonnages = async () => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try {
const response = await fetch(`${ENDPOINT}/personnages`, options)
const json = await response.json();
return json.map(
personnage => new PersonnageModel(
personnage.id,
personnage.nom,
personnage.classe,
personnage.niveau,
personnage.note,
personnage.experience,
personnage.statistiques,
personnage.img)
);
} catch (err) {
console.log('Erreur', err)
}
}
static searchPersonnages = async (searchTerm) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try {
const response = await fetch(`${ENDPOINT}/personnages`, options)
const json = await response.json();
return json.filter(personnage => personnage.nom.toLowerCase().includes(searchTerm));
} catch (err) {
console.log('Erreur', err)
}
}
static getPersonnages = async (id) => {
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
try{
const response = await fetch(`${ENDPOINT}/personnages?id=` + id, options)
const json = await response.json();
return new PersonnageModel(json[0].id, json[0].nom, json[0].classe, json[0].niveau, json[0].note, json[0].experience, json[0].statistiques, json[0].img);
}catch (err){
console.log('Erreur', err)
}
}
static updatePersonnage = async(personnage) => {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": personnage.id,
"nom": personnage.nom,
"classe": personnage.classe,
"niveau": personnage.niveau,
"note": personnage.note,
"experience": personnage.experience,
"img": personnage.img,
"statistiques": personnage.statistiques
})
};
try{
const response = await fetch(`${ENDPOINT}/personnages/` + personnage.id, options)
const json = await response.json();
return new PersonnageModel(json.id, json.nom, json.classe, json.niveau, json.note, json.experience, json.statistiques, json.img);
}catch(err){
console.log('Erreur : ', err)
}
}
static async getFavoritePersonnages() {
let allPersonnages = await this.FetchPersonnages();
let favorites = FavoriteManager.getFavorites();
return allPersonnages.filter(personnage => favorites.includes(personnage.id));
}
}
|
a21b1419c4716503ce3f5feeb7f48de5
|
{
"intermediate": 0.3846360743045807,
"beginner": 0.4039214849472046,
"expert": 0.21144244074821472
}
|
45,121
|
How to generate html verification email with typescript
|
a4cb9f018306316415136df74b27a53a
|
{
"intermediate": 0.24034586548805237,
"beginner": 0.41186267137527466,
"expert": 0.34779152274131775
}
|
45,122
|
I have a challenge that I am facing.
My business service field is hidden.
I would like to populate it approximately after selecting a value in the service offering.
There is a child and parent relationship between them (business service is the parent of service offering).
There is no need for a client script because the business service field is hidden and therefore the placement reads in the registration of the form.
This is the script I wrote in the record producer, but the action doesn't actually happen after I press submit.
I would appreciate your assistance
var offeringGR = new GlideRecord("service_offering");
offeringGR.addQuerry('name',producer.service_offering);
offeringGR.Querry();
if(offeringGR.next()){
current.business_service = offeringGR.parent;
}
|
e7c90ea987affca0adbbcc5d99683194
|
{
"intermediate": 0.3347699046134949,
"beginner": 0.3826309144496918,
"expert": 0.28259918093681335
}
|
45,123
|
########################################################################
# HELPER FUNCTIONS #
########################################################################
def add_sprite_controls(sprite):
""" Adds the controls to the sprite """
def left_key():
sprite.move_left(20)
stage.event_key("left", left_key)
def right_key():
sprite.move_right(20)
stage.event_key("right", right_key)
def up_key():
sprite.move_up(20)
stage.event_key("up", up_key)
def down_key():
sprite.move_down(20)
stage.event_key("down", down_key)
def add_sprite_collision(sprite, coordinates):
""" Adds the collision event to the sprite """
def collision(sprite, hit_sprite):
my_var = hit_sprite.get_color()
if my_var == "red":
sprite.go_to(coordinates[0], coordinates[1])
if my_var == "green":
sprite.hide()
hit_sprite.set_color("gold")
sprite.event_collision(collision)
########################################################################
# MAIN FUNCTION #
########################################################################
def main():
""" Sets up the program and calls other functions """
maze = [
[0, 2, 2, 2, 0],
[0, 0, 0, 2, 0],
[0, 0, 0, 2, 0],
[1, 0, 2, 2, 0],
[0, 0, 0, 0, 0],
]
main()
Notice that we gave you two helper functions and a main() within which is a 2D list we called maze.
A two-dimensional list is a list of lists. That means that at every index in our larger list we store another list.
At maze[0], we've stored [0, 2, 2, 2, 0]. At each index inside maze, we've stored a list of five numbers.
Let's practice modifying our 2D list! Change the first value in the first list in maze from 0 to 3.
In maze, 0 is a wall, 1 is where our sprite will start, 2 is part of the maze's path, and 3 is the maze's end.
|
897bcbcd9805f9efdb1c988f19f3da2d
|
{
"intermediate": 0.395559161901474,
"beginner": 0.3399505317211151,
"expert": 0.2644902169704437
}
|
45,124
|
explain
|
7e5edf2e04ef45d17697df5243d8215e
|
{
"intermediate": 0.3545367121696472,
"beginner": 0.31888994574546814,
"expert": 0.32657337188720703
}
|
45,125
|
Hi there
|
c737b5ca41463224ec6646f78aa4ec9c
|
{
"intermediate": 0.32728445529937744,
"beginner": 0.24503648281097412,
"expert": 0.42767903208732605
}
|
45,126
|
write me a python code to start a simple langchain using colab and python
|
ba99b74408059b1ade15f1de7aaf1add
|
{
"intermediate": 0.5649062991142273,
"beginner": 0.19759313762187958,
"expert": 0.23750057816505432
}
|
45,127
|
Hi, I have a C++ project. In such project, I am using the library nlohmann for json handling. However, I do not know if it is a good idea to distribute it, or if there is a way to download it from CMake, or there are other alternatives. Do you have any suggestion?
|
31393c5547ca3c03b8b9fa31ef4e64a0
|
{
"intermediate": 0.7276363372802734,
"beginner": 0.13269062340259552,
"expert": 0.13967302441596985
}
|
45,128
|
nodemailer account verification email form
|
93d485e973b5a3b73857ee11b33a9878
|
{
"intermediate": 0.35047462582588196,
"beginner": 0.24866892397403717,
"expert": 0.4008564054965973
}
|
45,129
|
cjh
|
23c965f4cb2aeea8be44afd296bf1bca
|
{
"intermediate": 0.3248947560787201,
"beginner": 0.3097590506076813,
"expert": 0.36534613370895386
}
|
45,130
|
events of what science fiction stories take place in 2068
|
524dbcb12c3f2ba3b0500ad826ee5f3d
|
{
"intermediate": 0.3806358277797699,
"beginner": 0.3078700304031372,
"expert": 0.3114941120147705
}
|
45,131
|
Heres Processing 4 java code with me attempting to do battleship, please use as many messages as needed to fix the code or improve it:
Player2 myPlayer2;
int [] b = {0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500};
/* values:
-2 player2's ship shot.
-1 means player2's ships
0 you don't know what is in that cell.
1 means player1's ship,
2 player1's ship shot.
3 is ??
*/
int [][] grid = new int [20][20];
int lcx, lcy;
boolean gameWin, placedallships, shipguess;
boolean isPlayer2Initialized = false;
int count;
int ships1 = 0, totalship1=10;
int ships2 = 0, totalship2=10;
int turn = 1;
enum GameState {
SETUP,
PLAYER_TURN,
AI_TURN,
GAME_OVER
}
GameState gameState = GameState.SETUP;
void checkGameState() {
// Implement logic to check for win conditions and change gameState accordingly
if (totalship1 == 0 || totalship2 == 0 && ships1 == 0 || ships2 == 0) {
gameState = GameState.GAME_OVER;
println("Game Over! Winner: " + (totalship1 == 0 ? "Player 2" : "Player 1"));
}
if (mousePressed && placedallships == true) {
gameState = GameState.PLAYER_TURN;
}
}
void checkForWinAndSwitchTurn() {
checkGameState();
if (gameState != GameState.GAME_OVER) {
turn = (turn == 1) ? 2 : 1;
gameState = (gameState == GameState.PLAYER_TURN) ? GameState.AI_TURN : GameState.PLAYER_TURN;
}
}
void turns() {
checkGameState();
if (gameState == GameState.PLAYER_TURN) {
if (placedallships==true) {
gameState = GameState.AI_TURN;
}
}
if (gameState == GameState.AI_TURN) {
myPlayer2.shoot();
}
}
void setup() {
background(250);
size(500, 500);
gameState = GameState.SETUP;
drawgrid();
if (!isPlayer2Initialized) {
myPlayer2 = new Player2();
isPlayer2Initialized = true;
}
}
void draw() {
if (gameState == GameState.GAME_OVER && key == 'r') {
setup();
}
if (gameState == GameState.PLAYER_TURN) {
turns();
}
if (gameState == GameState.AI_TURN) {
turns();
}
if (key == 'p' && keyPressed) {
printt();
}
}
void mousePressed() {
if (mouseButton == LEFT && turn==1 && placedallships == false) {
for (int r=0; r<20; r++) {
for (int c=0; c<20; c++) {
if (mouseX>b[r] && mouseX<b[r+1] && mouseY>b[c] && mouseY<b[c+1] && ships1<10 && grid[r][c]!=1 && grid[r][c]!=2) {
fill(50, 50, 100);
ships1++;
square(b[r], b[c], 25);
grid[r][c]=1;
if (ships1==10) {
placedallships = true;
}
}
}
}
}
if (mouseButton == RIGHT && gameState == GameState.PLAYER_TURN) {
for (int r=0; r<20; r++) {
for (int c=0; c<20; c++) {
checkGuess(r, c);
}
}
}
}
void checkGuess(int r, int c) {
if (mouseX>b[r] && mouseX<b[r+1] && mouseY>b[c] && mouseY<b[c+1] && ships1<10 && grid[r][c]==-1) {
if (grid[r][c] == -1) { // Hit
println("Hit at " + r + ", " + c);
grid[r][c] = -2; //Player's 2 ship is shot
fill(250, 70, 50);
square(b[r], b[c], 15);
} else if (grid[r][c] == 0) { // Miss
println("Miss at " + r + ", " + c);
grid[r][c] = 3; // Miss
fill(250, 170, 150);
square(b[r], b[c], 15);
gameState = GameState.AI_TURN;
}
}
}
void grabshots() {
for (int r=0; r<20; r++) {
for (int c=0; c<20; c++) {
if (grid[r][c]==2) {
fill(200, 0, 0);
square(b[r]+7.5, b[c]+7.5, 10);
fill(100);
}
}
}
}
void drawgrid() {
for (int r=0; r<500; r+=25) {
for (int c=0; c<500; c+=25) {
fill(100);
square(r, c, 25);
}
}
fill(25);
}
void printt() {
println();
print("player"+ turn + " board");
println();
for (int r=0; r<20; r++) {
for (int c=0; c<20; c++) {
print(grid[c][r] + ", ");
}
println();
}
}
/*
treat the second tab as a separate processing sketch.
Declare variables in the main tab and
you can use them in both the main and second window.
*/
class Player2 extends PApplet {
Player2() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
ArrayList<PVector> shots = new ArrayList<PVector>();
void settings() {
size(500, 500);
}
void setup() {
drawgrid();
botdrawship();
}
void draw() {
}
void shoot() {
int r, c;
do {
r = round(random(1, 18));
c = round(random(1, 18));
} while (shots.contains(new PVector(r, c)));
shots.add(new PVector(r, c));
if (grid[r][c]==1) {
grid[r][c]=2;
totalship1--;
fill(200, 0, 0);
square(b[r]+7.5, b[c]+7.5, 10);
fill(100);
gameState=GameState.PLAYER_TURN;
}
turn=1;
}
void botdrawship() {
count=0;
while (count<10) {
int r = round(random(1, 18));
int c = round(random(1, 18));
grid[r][c]=-1;
fill(100, 50, 50);
square(b[r], b[c], 25);
count++;
}
}
void grablocation() {
for (int r=0; r<20; r++) {
for (int c=0; c<20; c++) {
if (grid[r][c]==1) {
fill(50, 50, 100);
square(b[r], b[c], 25);
}
}
}
}
void drawgrid() {
for (int r=0; r<500; r+=25) {
for (int c=0; c<500; c+=25) {
fill(100);
square(r, c, 25);
}
}
fill(25);
}
}
|
11eecb67650f026759d826ce392e7b82
|
{
"intermediate": 0.4124179184436798,
"beginner": 0.36610177159309387,
"expert": 0.22148030996322632
}
|
45,132
|
In javadoc, how do I specify that the method updates a class
|
c717f08f5f2f01ea74435a04747fdfda
|
{
"intermediate": 0.6149551272392273,
"beginner": 0.2717401087284088,
"expert": 0.11330477148294449
}
|
45,133
|
in reinforcement learning with GNN, the loss function and the reward calculation(including penalties for all target deviations) are necessary? or not. what the loss function handles, if the same deviations are penalized by the reward calculation.
|
30534df6e84201c7b4e3903b45b83edf
|
{
"intermediate": 0.048331912606954575,
"beginner": 0.05858409404754639,
"expert": 0.8930839896202087
}
|
45,134
|
#### CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(MyProject)
# Example CMake variable
set(MY_DEFINE “HelloWorld”)
# Add a definition for all targets
add_definitions(-DMY_DEFINE=“${MY_DEFINE}”)
|
25231d14a9edf5932d467d1359be13ab
|
{
"intermediate": 0.23509542644023895,
"beginner": 0.5602836012840271,
"expert": 0.20462089776992798
}
|
45,135
|
Can you make a regex in Python to sort multiples lines of strings alphabetically?
|
405e46e61fe64c16c7486218659ac86b
|
{
"intermediate": 0.5128287672996521,
"beginner": 0.12428029626607895,
"expert": 0.36289098858833313
}
|
45,136
|
basic renpy functions
|
63e19e37047f2e4fc10b29440ea26919
|
{
"intermediate": 0.14335522055625916,
"beginner": 0.7446707487106323,
"expert": 0.11197402328252792
}
|
45,137
|
how can test bandwidth of server
|
92dd852e9fb7de7a2f84509019eaf8a6
|
{
"intermediate": 0.2820683419704437,
"beginner": 0.24059200286865234,
"expert": 0.47733956575393677
}
|
45,138
|
how to tar and gzip directory on centos
|
6f194cae794d4a68f661e43130d6b2e9
|
{
"intermediate": 0.3727729022502899,
"beginner": 0.3117818534374237,
"expert": 0.3154452443122864
}
|
45,139
|
Write a C++ program using the raylib library, which creates a window with a resizable flag and displays a background.png image in it. The image displayed on the screen should NOT be scaled to the size of the window, and loaded and displayed in real size. The aspect ratio of the original image should be the same as the aspect ratio of the image in pixels, this is very important. The camera should be centered on the image. The image extension should be .png. Add a white fill to this window. The image should be drawn on top of the fill. This application should have a zoom in and zoom out function when scrolling the mouse wheel up and down respectively. The maximum zoom should be 20.0 and the minimum 0.20. The distance should also be centered on the center of the image. And the approximation should be centered on the cursor position. Zooming in and out should only work when the mouse wheel is spinning, when the wheel stops spinning, then zooming in and out stops. When you turn the mouse wheel forward, the camera only gets closer, and when you turn the wheel down, it only moves away, you also need to make a smoother approach and distance and not increase its speed. The camera's zoom center is the cursor position. When scrolling the mouse wheel up, the camera should move closer to the cursor. The program should also be able to move the camera with the right mouse button pressed in all directions. The camera should move at the speed of the cursor with the right mouse button held down. Do not make a sharp movement of the camera when clicking with the mouse, make it smooth. Don't forget to initialize Camera2D itself. Write this code checking all identifiers for correctness. Initialize all variables in the correct namespace. Use only the constructors that exist in raylib. Write the code strictly with all the above requirements. At the end of the code, do not forget to add a memory cleanup when closing the program on the cross. Write the full version of this code without the cut-out code blocks. If necessary, add the necessary header files. Write code with all the functionality that I described above, use the correct syntax of c++ and raylib. Write this code without using the clamp(), Vector2Scale(), Vector2subtract, Vector2Normalize, Vector2Length, Vector2Scale, Vector2Add functions, you can use alternatives to these functions.
Add to this code a separate function called drawProvince, which will draw a red vector circle over the pixel of the image that was clicked with the left mouse button. The circle must have the length and width of the pixel of the background image on top of which it was placed. The circle should remain displayed after passing the main cycle and should be able to. The code should have a function to delete the last circle by pressing the backspace key, if the last circle is deleted, then by pressing again you can delete the penultimate one and so on. Use the necessary header files for this if they are not included in the source code.
Add to the drawProvince function, shown above by me, the function of drawing a polygon of a random fill color between circles when the drawing mode is turned on by pressing the "D" button. The polygon should have a 2 pixel thick outline of the screen. It is the screen and not the image, like the circles. Every time a new point is placed, a circle is drawn in its place. The polygon view is updated and it is drawn with a new point. The last point of the polygon is also deleted using the backspace key. When the Enter key is pressed, the code receives the coordinates of each point of the polygon and writes it to a new file that needs to be created with a name equal to the count of the created polygons, i.e. 1, 2, 3 and so on. There should be three lines in this file with the name of the polygon number. The first line is the number of the polygon in the account, the second line is the coordinates of the polygon points in X, separated by a comma with a space, and the second line is the coordinates of the points in Y, also separated by a comma with a space (, ). Use the necessary header files for this. Don't forget to add the necessary raylib header files located on the path "/home/danya/raylib/src/".
|
63119af23b3ca4fe22367e541159a4a9
|
{
"intermediate": 0.46751466393470764,
"beginner": 0.35537585616111755,
"expert": 0.1771094650030136
}
|
45,140
|
i will add a html, css and js belonging to a 3d hover effect codepen example and my grid view of my react app products list below. I want you to add the 3d hover effect to the image in figure( figure img:hover {}) on hover.Ensure if you provide any css to add to my styled section where figure img is, make sure it is separate and formatted as pure css as style.css. GridView.js: import React from "react";
import styled from "styled-components";
import Product from "./Product";
import { motion } from "framer-motion";
import { fadeIn } from "./variants";
const GridView = ({ products }) => {
console.log('products: ', products);
return (
<Wrapper className="section">
<motion.div
className="container grid grid-three-column"
variants={fadeIn("up", 0.4)}
initial="hidden"
animate="show"
exit="hidden"
>
{products.map((curElem) => {
return <Product key={curElem.id} {...curElem} />;
})}
</motion.div>
</Wrapper>
);
};
const Wrapper = styled.section`
padding: 2rem 0 15rem;
}
.container {
max-width: 100% !important;
padding-bottom: 150px;
}
.grid {
gap: 3.2rem;
}
figure {
width: auto;
display: flex;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
transition: all 0.5s linear;
&::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 0%;
height: 100%;
border-radius: 24px 24px 0px 0px;
transition: all 0.2s linear;
cursor: pointer;
}
&:hover::after {
width: 100%;
}
&:hover img {
transform: scale(1.06);
margin-top: 1rem;
}
img {
max-width: 90%;
margin-top: 1.8rem;
height: 20rem;
border-radius: 10px;
transition: all 0.2s linear;
}
.caption {
position: absolute;
top: 15%;
right: 10%;
text-transform: uppercase;
letter-spacing: 1.5px;
background-color: #0000008c;
color: #8bff74;
padding: 0.25rem 1rem;
font-size: 1rem;
font-weight: bold;
border-radius: 2rem;
}
}
.card {
background-color: white;
box-shadow: rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset, rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset, rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset, rgb(74, 0, 224, 0.06) 0px 2px 1px,rgb(74, 0, 224, 0.09) 0px 3px 1px, rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
border-radius: 24px;
.card-data {
padding: 0 2rem 2rem;
}
.card-data-flex {
margin: 2rem 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.card-data--price {
color: #000;
font-weight: 600;
}
h3 {
color: #4A00E0;
font-weight: 600;
text-transform: capitalize;
}
.btn {
margin: 2rem auto;
background-color: rgb(0 0 0 / 0%);
border: 0.1rem solid rgb(98 84 243);
display: flex;
justify-content: center;
align-items: center;
&:hover {
background-color: rgb(98 84 243);
}
&:hover a {
color: #fff;
}
a {
color: rgb(98 84 243);
font-size: 1.4rem;
}
}
}
@media (max-width: ${({ theme }) => theme.media.mobile}) {
figure img {
transform: scale(1.11);
width: 100%;
margin-top: 4rem;
margin-bottom: 2rem;
height: auto;
border-radius: 10px;
transition: all 0.2s linear;
}
.card {
padding: 1rem;
}
}
`;
export default GridView; Html: <div id="tilt">
<!-- Container for our block -->
</div>
CSS: html {
display: flex;
justify-content: center;
align-items: center;
align-contents: center;
height: 100%;
}
/* Styles for the tilt block */
#tilt {
display: block;
height: 200px;
width: 300px;
background-color: grey;
margin: 0 auto;
transition: box-shadow 0.1s, transform 0.1s;
/*
* Adding image to the background
* No relation to the hover effect.
*/
background-image: url(http://unsplash.it/300/200);
background-size: 100%;
background-repeat: no-repeat;
}
#tilt:hover {
box-shadow: 0px 0px 30px rgba(0,0,0, 0.6);
cursor: pointer;
}
JS: /* Store the element in el */
let el = document.getElementById('tilt')
/* Get the height and width of the element */
const height = el.clientHeight
const width = el.clientWidth
/*
* Add a listener for mousemove event
* Which will trigger function 'handleMove'
* On mousemove
*/
el.addEventListener('mousemove', handleMove)
/* Define function a */
function handleMove(e) {
/*
* Get position of mouse cursor
* With respect to the element
* On mouseover
*/
/* Store the x position */
const xVal = e.layerX
/* Store the y position */
const yVal = e.layerY
/*
* Calculate rotation valuee along the Y-axis
* Here the multiplier 20 is to
* Control the rotation
* You can change the value and see the results
*/
const yRotation = 20 * ((xVal - width / 2) / width)
/* Calculate the rotation along the X-axis */
const xRotation = -20 * ((yVal - height / 2) / height)
/* Generate string for CSS transform property */
const string = 'perspective(500px) scale(1.1) rotateX(' + xRotation + 'deg) rotateY(' + yRotation + 'deg)'
/* Apply the calculated transformation */
el.style.transform = string
}
/* Add listener for mouseout event, remove the rotation */
el.addEventListener('mouseout', function() {
el.style.transform = 'perspective(500px) scale(1) rotateX(0) rotateY(0)'
})
/* Add listener for mousedown event, to simulate click */
el.addEventListener('mousedown', function() {
el.style.transform = 'perspective(500px) scale(0.9) rotateX(0) rotateY(0)'
})
/* Add listener for mouseup, simulate release of mouse click */
el.addEventListener('mouseup', function() {
el.style.transform = 'perspective(500px) scale(1.1) rotateX(0) rotateY(0)'
})
|
12c143dd9c510331e97a27765635651d
|
{
"intermediate": 0.3951723277568817,
"beginner": 0.4154284596443176,
"expert": 0.18939922749996185
}
|
45,141
|
Write a C++ program using the raylib library that creates a resizable window and displays a background.png image in it. The image displayed on the screen should NOT be scaled to the size of the window, and loaded and displayed in real size. The aspect ratio of the original image should be the same as the aspect ratio of the image in pixels, this is very important. The camera should be centered on the image. The image extension should be .png. Add a white fill to this window. The image should be drawn on top of the fill. This application should have a zoom in and zoom out function when scrolling the mouse wheel up and down respectively. The maximum zoom should be 20.0 and the minimum 0.20. The distance should also be centered on the center of the image. And the approximation should be centered on the cursor position. Zooming in and out should only work when the mouse wheel is spinning, when the wheel stops spinning, then zooming in and out stops. When you turn the mouse wheel forward, the camera only gets closer, and when you turn the wheel down, it only moves away, you also need to make a smoother approach and distance and not increase its speed. The camera's zoom center is the cursor position. When scrolling the mouse wheel up, the camera should move closer to the cursor. The program should also be able to move the camera with the right mouse button pressed in all directions. The camera should move at the speed of the cursor with the right mouse button held down. Do not make a sharp movement of the camera when clicking with the mouse, make it smooth. Don't forget to initialize Camera2D itself. Write this code checking all identifiers for correctness. Initialize all variables in the correct namespace. Use only the constructors that exist in raylib. Write the code strictly with all the above requirements. At the end of the code, do not forget to add a memory cleanup when closing the program on the cross. Write the full version of this code without the cut-out code blocks. If necessary, add the necessary header files. Write code with all the functionality that I described above, use the correct syntax of c++ and raylib. Write this code without using the clamp(), Vector2Scale(), Vector2subtract, Vector2Normalize, Vector2Length, Vector2Scale, Vector2Add functions, you can use alternatives to these functions.
Add to this code a separate function called drawProvince, which will draw a red vector circle with a radius of 0.5f on top of the pixel of the image on which the left mouse button is clicked. The circle must have the length and width of the pixel of the background image on top of which it was placed. The circle should remain displayed after passing the main cycle and should be able to. The code should have a function to delete the last circle by pressing the backspace key, if the last circle is deleted, then by pressing again you can delete the penultimate one and so on. Use the necessary header files for this if they are not included in the source code.
Add to the drawProvince function, shown above by me, the function of drawing a polygon displayed with a random fill color when drawing mode is enabled on the "D" button. The polygon should have a 2 pixel thick outline of the screen when the 'S' key is pressed. It is the screen and not the image, like the circles. Every time a new point is placed, a circle is drawn in its place. The polygon view is updated and it is drawn with a new point. The last point of the polygon is also deleted using the backspace key. Remember - polygons must be visible, and must have a random fill color and a red outline color. When the Enter key is pressed, the code receives the coordinates of each point of the polygon and writes it to a new file that needs to be created with a name equal to the count of the created polygons, i.e. 1, 2, 3 and so on. There should be three lines in this file with the name of the polygon number. The first line is the number of the polygon in the account, the second line is the coordinates of the polygon points in X, separated by a comma with a space, and the second line is the coordinates of the points in Y, also separated by a comma with a space (, ). Use the necessary header files for this. Don't forget to add the necessary raylib header files located on the path "/home/danya/raylib/src/".
|
36c17e51a0f8525b7a5e0601bffb2b83
|
{
"intermediate": 0.41757065057754517,
"beginner": 0.34718865156173706,
"expert": 0.23524069786071777
}
|
45,142
|
What can you do?
|
caf5892e37f452206ea6a7b7d7ac52f4
|
{
"intermediate": 0.42770257592201233,
"beginner": 0.2413809895515442,
"expert": 0.3309164345264435
}
|
45,143
|
how can i turn the rgbGlow into a true glow which cycles through the color in such a way that at least 4 colors are visible at once circling the border. Add make the colors twelve to make it stand out more and meaning 3 cycles (4 colors moving to the next 4 and the next 4 then loop back):
.card {
transform-style: preserve-3d;
transition: all 0.1s ease;
}
.card {
transform-style: preserve-3d;
transition: all 0.1s ease;
box-shadow: rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
.proda:hover {
animation: rgbGlow 5s infinite;
}
@keyframes rgbGlow {
0%, 100% {
box-shadow: 0 0 10px #FF0000, 0 0 20px rgba(255, 0, 0, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
14% {
box-shadow: 0 0 10px #FF7F00, 0 0 20px rgba(255, 127, 0, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
28% {
box-shadow: 0 0 10px #FFFF00, 0 0 20px rgba(255, 255, 0, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
42% {
box-shadow: 0 0 10px #00FF00, 0 0 20px rgba(0, 255, 0, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
57% {
box-shadow: 0 0 10px #0000FF, 0 0 20px rgba(0, 0, 255, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
71% {
box-shadow: 0 0 10px #4B0082, 0 0 20px rgba(75, 0, 130, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
85% {
box-shadow: 0 0 10px #9400D3, 0 0 20px rgba(148, 0, 211, 0.5),
rgb(74, 0, 224, 0.17) 0px -23px 25px 0px inset,
rgb(74, 0, 224, 0.15) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.1) 0px -5px 3px 0px inset,
rgb(74, 0, 224, 0.06) 0px 2px 1px,
rgb(74, 0, 224, 0.09) 0px 3px 1px,
rgb(74, 0, 224, 0.09) 0px 8px 10px inset;
}
}
.product-img {
transition: all 0.5s ease;
}
.title {
font-weight: 600;
}
.purchase {
cursor: pointer;
}
|
a38f271a56795664c5cef90391d94b5d
|
{
"intermediate": 0.400150865316391,
"beginner": 0.32458364963531494,
"expert": 0.2752654552459717
}
|
45,144
|
обьясни подробно что делает каждая функция
vector = np.array([75, 15])
5
plt.figure(figsize=(7, 7))
6
plt.axis([0, 100, 0, 100])
7
plt.arrow(# < напишите код здесь >, head_width=4, length_includes_head="True")
8
plt.xlabel('Цена')
9
plt.ylabel('Качество')
10
plt.grid(True)
11
plt.show()
|
df23ca843bc48001242fccc505030a52
|
{
"intermediate": 0.3992789387702942,
"beginner": 0.26585114002227783,
"expert": 0.334869921207428
}
|
45,145
|
make it for my resume headline "Design Engineer with 5 years experience with CAD Solidworks and Autocad, building prototype Mechanical electrical and electronic compinand ingration, Arduino microcontroller program. "
|
fb3557f29eb993116509c6b9050cf490
|
{
"intermediate": 0.39550331234931946,
"beginner": 0.36735260486602783,
"expert": 0.23714406788349152
}
|
45,146
|
Heres my raycast intersection code:
private static Vector3 lineQuadIntersection(Vector3 p1, Vector3 p2, Vector3 v1, Vector3 v2, Vector3 v3)
{
// 1. Get the normal of the plane
Vector3 a = VectorUtils.subNew(v2, v1);
Vector3 b = VectorUtils.subNew(v3, v1);
Vector3 normal = VectorUtils.cross(a, b);
normal.normalize();
// 2. Check if the line is parallel to the plane
Vector3 lineDirection = VectorUtils.subNew(p2, p1);
double dotDifference = normal.dot(lineDirection);
// Parallel tolerance
if(Math.abs(dotDifference) < 1e-6f)
return null;
// Calculate the parameter 't' for the line equation
double t = -normal.dot(VectorUtils.subNew(p1, v1)) / dotDifference;
// Check if the intersection point is behind the first line point or after the second line point
if(t < 0 || t > 1)
return null;
Vector3 collision = VectorUtils.addNew(p1, VectorUtils.scaleNew(lineDirection, t));
// 3. Project collision point onto the plane defined by quad vertices
Vector3 dMS1 = VectorUtils.subNew(collision, v1);
double dotA = a.dot(a);
double dotB = b.dot(b);
double u = dMS1.dot(a) / dotA;
double v = dMS1.dot(b) / dotB;
// 4. Check if the intersection point is inside the quad
if(u >= 0.0 && u <= 1.0 && v >= 0.0 && v <= 1.0)
{
return collision;
}
return null;
}
I want to be able to add a little offset from the point of intersection so that the intersection point will be just slightly off the surface it intersected with. How can I do this
|
9d1198bfe620719b402e7ab318123f8a
|
{
"intermediate": 0.4019639194011688,
"beginner": 0.21037378907203674,
"expert": 0.38766229152679443
}
|
45,147
|
Produce this JSON structure (parenthesis provide more context) (... means etc) (put null if field cannot be found): {"bol_no":"","stops":[{"stop_no":-1,"delivery_no":"","shipment_no":"","carrier":"","items":[{"prod_no":"","prod_desc":"","batches":[{"batch_no":"","qty":0,"qty_unit":""}...],"total_qty":0,"total_qty_unit":"","wght":0,"wght_unit":""}...]}...]} Stop 5 of 6
Page
1 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
Notify or Freight Forwarder/à notifier ou Agent d'expedition
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Freight Terms/Frais de transport
FOB - Free on board
Country of Destination/Pays de destination
Canada
Deliveries per Shipment/Livraisons par
expéditions
Shipment Date/Date d'expédition
20.03.2024
Shipped From/Endroit d'expedition
HOMEWOOD, MB
PDI Address/Adresse-directives de livraison au quai
Carrier/Route-Transporteur/Itinéraire
AGASSIZ SEED FARM LTD
Railcar/Trailer ID-ID autorail/remorque
945248827
Seal No./Nume'ro de plomb
Last Loading Dt./Date du dernier chargement
20.03.2024
Delivery Date/Date de livraison
21.03.2024
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
Your statement must show the PRO number and Bayers BOL/CMR number opposite each
amount; also statement total. Send original prepaid freight bill to:
Le numéro du PRO ainsl que le numéro du connaissement/CMR de Bayer doit apparaitre sur
votre relevé vis-à-vis chaque montant incluant le montant total du relevé de compte. Veuillez
envoyer les factures d'expédition en port payé à:
Bayer CropScience Inc., 160 Quarry Park Blvd.SE, Calgary, Alberta, T2C 3G3, Canada
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
1
12901953 DKC29-89RIB AF2 VT2P 80M Poncho 250-B
5 SSU
117 KG
117 KG
Batch Z91PEY7JX - 5 SSU
No & kind of pkgs:
*********************
2
13052221 DKC33-37RIB AF2 VT2P 80M Poncho 250-B
5 SSU
113 KG
113 KG
Batch H18XDV7JX - 5 SSU
No & kind of pkgs:
*********************
3
87674223 PALLET,WOOD,54X40,2-WAY,DOMESTI C
1 PIECE
25 KG
25 KG
No & kind of pkgs:
*********************
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---Page
2 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
4
89183146 DKC32-49RIB AF2 VT2P 80M Poncho 250-B
12 SSU
259 KG
259 KG
Batch H18XAH4JX - 12 SSU
No & kind of pkgs:
*********************
5
90033195 DKC36-48RIB AR2 VT2P 80M Poncho 500-B
1 SSU
26 KG
26 KG
Batch H18W1H3JX - 1 SSU
No & kind of pkgs:
*********************
6
90033527 DKC21-36RIB AF2 VT2P 80M Poncho 500-B
22 SSU
530 KG
530 KG
Batch H18WHF3JX - 22 SSU
No & kind of pkgs:
*********************
7
90033616 DKC24-06RIB AF2 VT2P 80M Poncho 500-B
6 SSU
130 KG
130 KG
Batch H18WDD4JX - 6 SSU
No & kind of pkgs:
*********************
8
90033861 DKC28-25RIB AF2 VT2P 80M Poncho 500-B
31 SSU
682 KG
682 KG
Batch H18W1T7JX - 31 SSU
No & kind of pkgs:
*********************
9
90034132 DKC31-85RIB AF2 VT2P 80M Poncho 500-B
5 SSU
113 KG
113 KG
Batch H18WV44JX - 5 SSU
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
---start of page---
Page
3 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
No & kind of pkgs:
*********************
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
10
90037468 DKC072-12RIB AF2 VT2P 80M Poncho 500-B
12 SSU
267 KG
267 KG
Batch H18W4J4JX - 12 SSU
No & kind of pkgs:
*********************
11
90037727 DKC084-60RIB AF2 VT2P 80M Poncho 500-B
1 SSU
21 KG
21 KG
Batch H18WXL9JX - 1 SSU
No & kind of pkgs:
*********************
No. of Pkgs: 101
Do not ship with food, feed, drugs or clothing.
Ne pas envoyer ce produit avec la nourriture humaine
ou animale, des médicaments, ou des vêtements.
Total
2.282 KG
2.282 KG
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
|
2e5f3724bd905b7edd26c2eb20f7da3b
|
{
"intermediate": 0.39367014169692993,
"beginner": 0.42636656761169434,
"expert": 0.17996330559253693
}
|
45,148
|
Produce this JSON structure (parenthesis provide more context) (... means etc) (put null if field cannot be found): {"bol_no":"","stops":[{"stop_no":-1,"delivery_no":"","shipment_no":"","carrier":"","items":[{"prod_no":"","prod_desc":"","batches":[{"batch_no":"","qty":0,"qty_unit":""}...],"total_qty":0,"total_qty_unit":"","wght":0,"wght_unit":""}...]}...]} Stop 5 of 6
Page
1 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
Notify or Freight Forwarder/à notifier ou Agent d'expedition
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Freight Terms/Frais de transport
FOB - Free on board
Country of Destination/Pays de destination
Canada
Deliveries per Shipment/Livraisons par
expéditions
Shipment Date/Date d'expédition
20.03.2024
Shipped From/Endroit d'expedition
HOMEWOOD, MB
PDI Address/Adresse-directives de livraison au quai
Carrier/Route-Transporteur/Itinéraire
AGASSIZ SEED FARM LTD
Railcar/Trailer ID-ID autorail/remorque
945248827
Seal No./Nume'ro de plomb
Last Loading Dt./Date du dernier chargement
20.03.2024
Delivery Date/Date de livraison
21.03.2024
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
Your statement must show the PRO number and Bayers BOL/CMR number opposite each
amount; also statement total. Send original prepaid freight bill to:
Le numéro du PRO ainsl que le numéro du connaissement/CMR de Bayer doit apparaitre sur
votre relevé vis-à-vis chaque montant incluant le montant total du relevé de compte. Veuillez
envoyer les factures d'expédition en port payé à:
Bayer CropScience Inc., 160 Quarry Park Blvd.SE, Calgary, Alberta, T2C 3G3, Canada
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
1
12901953 DKC29-89RIB AF2 VT2P 80M Poncho 250-B
5 SSU
117 KG
117 KG
Batch Z91PEY7JX - 5 SSU
No & kind of pkgs:
*********************
2
13052221 DKC33-37RIB AF2 VT2P 80M Poncho 250-B
5 SSU
113 KG
113 KG
Batch H18XDV7JX - 5 SSU
No & kind of pkgs:
*********************
3
87674223 PALLET,WOOD,54X40,2-WAY,DOMESTI C
1 PIECE
25 KG
25 KG
No & kind of pkgs:
*********************
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---Page
2 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
4
89183146 DKC32-49RIB AF2 VT2P 80M Poncho 250-B
12 SSU
259 KG
259 KG
Batch H18XAH4JX - 12 SSU
No & kind of pkgs:
*********************
5
90033195 DKC36-48RIB AR2 VT2P 80M Poncho 500-B
1 SSU
26 KG
26 KG
Batch H18W1H3JX - 1 SSU
No & kind of pkgs:
*********************
6
90033527 DKC21-36RIB AF2 VT2P 80M Poncho 500-B
22 SSU
530 KG
530 KG
Batch H18WHF3JX - 22 SSU
No & kind of pkgs:
*********************
7
90033616 DKC24-06RIB AF2 VT2P 80M Poncho 500-B
6 SSU
130 KG
130 KG
Batch H18WDD4JX - 6 SSU
No & kind of pkgs:
*********************
8
90033861 DKC28-25RIB AF2 VT2P 80M Poncho 500-B
31 SSU
682 KG
682 KG
Batch H18W1T7JX - 31 SSU
No & kind of pkgs:
*********************
9
90034132 DKC31-85RIB AF2 VT2P 80M Poncho 500-B
5 SSU
113 KG
113 KG
Batch H18WV44JX - 5 SSU
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
---start of page---
Page
3 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
No & kind of pkgs:
*********************
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
10
90037468 DKC072-12RIB AF2 VT2P 80M Poncho 500-B
12 SSU
267 KG
267 KG
Batch H18W4J4JX - 12 SSU
No & kind of pkgs:
*********************
11
90037727 DKC084-60RIB AF2 VT2P 80M Poncho 500-B
1 SSU
21 KG
21 KG
Batch H18WXL9JX - 1 SSU
No & kind of pkgs:
*********************
No. of Pkgs: 101
Do not ship with food, feed, drugs or clothing.
Ne pas envoyer ce produit avec la nourriture humaine
ou animale, des médicaments, ou des vêtements.
Total
2.282 KG
2.282 KG
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
|
d0c3fafe746e1c052bec5cb5988b4c34
|
{
"intermediate": 0.39367014169692993,
"beginner": 0.42636656761169434,
"expert": 0.17996330559253693
}
|
45,149
|
Produce this JSON structure (parenthesis provide more context) (... means etc) (put null if field cannot be found): {"bol_no":"","stops":[{"stop_no":-1,"delivery_no":"","shipment_no":"","carrier":"","items":[{"prod_no":"","prod_desc":"","batches":[{"batch_no":"","qty":0,"qty_unit":""}...],"total_qty":0,"total_qty_unit":"","wght":0,"wght_unit":""}...]}...]} Stop 5 of 6
Page
1 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
Notify or Freight Forwarder/à notifier ou Agent d'expedition
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Freight Terms/Frais de transport
FOB - Free on board
Country of Destination/Pays de destination
Canada
Deliveries per Shipment/Livraisons par
expéditions
Shipment Date/Date d'expédition
20.03.2024
Shipped From/Endroit d'expedition
HOMEWOOD, MB
PDI Address/Adresse-directives de livraison au quai
Carrier/Route-Transporteur/Itinéraire
AGASSIZ SEED FARM LTD
Railcar/Trailer ID-ID autorail/remorque
945248827
Seal No./Nume'ro de plomb
Last Loading Dt./Date du dernier chargement
20.03.2024
Delivery Date/Date de livraison
21.03.2024
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
Your statement must show the PRO number and Bayers BOL/CMR number opposite each
amount; also statement total. Send original prepaid freight bill to:
Le numéro du PRO ainsl que le numéro du connaissement/CMR de Bayer doit apparaitre sur
votre relevé vis-à-vis chaque montant incluant le montant total du relevé de compte. Veuillez
envoyer les factures d'expédition en port payé à:
Bayer CropScience Inc., 160 Quarry Park Blvd.SE, Calgary, Alberta, T2C 3G3, Canada
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
1
12901953 DKC29-89RIB AF2 VT2P 80M Poncho 250-B
5 SSU
117 KG
117 KG
Batch Z91PEY7JX - 5 SSU
No & kind of pkgs:
*********************
2
13052221 DKC33-37RIB AF2 VT2P 80M Poncho 250-B
5 SSU
113 KG
113 KG
Batch H18XDV7JX - 5 SSU
No & kind of pkgs:
*********************
3
87674223 PALLET,WOOD,54X40,2-WAY,DOMESTI C
1 PIECE
25 KG
25 KG
No & kind of pkgs:
*********************
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---Page
2 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
4
89183146 DKC32-49RIB AF2 VT2P 80M Poncho 250-B
12 SSU
259 KG
259 KG
Batch H18XAH4JX - 12 SSU
No & kind of pkgs:
*********************
5
90033195 DKC36-48RIB AR2 VT2P 80M Poncho 500-B
1 SSU
26 KG
26 KG
Batch H18W1H3JX - 1 SSU
No & kind of pkgs:
*********************
6
90033527 DKC21-36RIB AF2 VT2P 80M Poncho 500-B
22 SSU
530 KG
530 KG
Batch H18WHF3JX - 22 SSU
No & kind of pkgs:
*********************
7
90033616 DKC24-06RIB AF2 VT2P 80M Poncho 500-B
6 SSU
130 KG
130 KG
Batch H18WDD4JX - 6 SSU
No & kind of pkgs:
*********************
8
90033861 DKC28-25RIB AF2 VT2P 80M Poncho 500-B
31 SSU
682 KG
682 KG
Batch H18W1T7JX - 31 SSU
No & kind of pkgs:
*********************
9
90034132 DKC31-85RIB AF2 VT2P 80M Poncho 500-B
5 SSU
113 KG
113 KG
Batch H18WV44JX - 5 SSU
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
---start of page---
Page
3 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
No & kind of pkgs:
*********************
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
10
90037468 DKC072-12RIB AF2 VT2P 80M Poncho 500-B
12 SSU
267 KG
267 KG
Batch H18W4J4JX - 12 SSU
No & kind of pkgs:
*********************
11
90037727 DKC084-60RIB AF2 VT2P 80M Poncho 500-B
1 SSU
21 KG
21 KG
Batch H18WXL9JX - 1 SSU
No & kind of pkgs:
*********************
No. of Pkgs: 101
Do not ship with food, feed, drugs or clothing.
Ne pas envoyer ce produit avec la nourriture humaine
ou animale, des médicaments, ou des vêtements.
Total
2.282 KG
2.282 KG
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
|
e85836bcb3d64b28d8578ae1b316abb5
|
{
"intermediate": 0.39367014169692993,
"beginner": 0.42636656761169434,
"expert": 0.17996330559253693
}
|
45,150
|
Produce this JSON structure (parenthesis provide more context) (... means etc) (put null if field cannot be found): {"bol_no":"","stops":[{"stop_no":-1,"delivery_no":"","shipment_no":"","carrier":"","items":[{"prod_no":"","prod_desc":"","batches":[{"batch_no":"","qty":0,"qty_unit":""}...],"total_qty":0,"total_qty_unit":"","wght":0,"wght_unit":""}...]}...]} Stop 5 of 6
Page
1 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
Notify or Freight Forwarder/à notifier ou Agent d'expedition
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Freight Terms/Frais de transport
FOB - Free on board
Country of Destination/Pays de destination
Canada
Deliveries per Shipment/Livraisons par
expéditions
Shipment Date/Date d'expédition
20.03.2024
Shipped From/Endroit d'expedition
HOMEWOOD, MB
PDI Address/Adresse-directives de livraison au quai
Carrier/Route-Transporteur/Itinéraire
AGASSIZ SEED FARM LTD
Railcar/Trailer ID-ID autorail/remorque
945248827
Seal No./Nume'ro de plomb
Last Loading Dt./Date du dernier chargement
20.03.2024
Delivery Date/Date de livraison
21.03.2024
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
Your statement must show the PRO number and Bayers BOL/CMR number opposite each
amount; also statement total. Send original prepaid freight bill to:
Le numéro du PRO ainsl que le numéro du connaissement/CMR de Bayer doit apparaitre sur
votre relevé vis-à-vis chaque montant incluant le montant total du relevé de compte. Veuillez
envoyer les factures d'expédition en port payé à:
Bayer CropScience Inc., 160 Quarry Park Blvd.SE, Calgary, Alberta, T2C 3G3, Canada
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
1
12901953 DKC29-89RIB AF2 VT2P 80M Poncho 250-B
5 SSU
117 KG
117 KG
Batch Z91PEY7JX - 5 SSU
No & kind of pkgs:
*********************
2
13052221 DKC33-37RIB AF2 VT2P 80M Poncho 250-B
5 SSU
113 KG
113 KG
Batch H18XDV7JX - 5 SSU
No & kind of pkgs:
*********************
3
87674223 PALLET,WOOD,54X40,2-WAY,DOMESTI C
1 PIECE
25 KG
25 KG
No & kind of pkgs:
*********************
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---Page
2 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
4
89183146 DKC32-49RIB AF2 VT2P 80M Poncho 250-B
12 SSU
259 KG
259 KG
Batch H18XAH4JX - 12 SSU
No & kind of pkgs:
*********************
5
90033195 DKC36-48RIB AR2 VT2P 80M Poncho 500-B
1 SSU
26 KG
26 KG
Batch H18W1H3JX - 1 SSU
No & kind of pkgs:
*********************
6
90033527 DKC21-36RIB AF2 VT2P 80M Poncho 500-B
22 SSU
530 KG
530 KG
Batch H18WHF3JX - 22 SSU
No & kind of pkgs:
*********************
7
90033616 DKC24-06RIB AF2 VT2P 80M Poncho 500-B
6 SSU
130 KG
130 KG
Batch H18WDD4JX - 6 SSU
No & kind of pkgs:
*********************
8
90033861 DKC28-25RIB AF2 VT2P 80M Poncho 500-B
31 SSU
682 KG
682 KG
Batch H18W1T7JX - 31 SSU
No & kind of pkgs:
*********************
9
90034132 DKC31-85RIB AF2 VT2P 80M Poncho 500-B
5 SSU
113 KG
113 KG
Batch H18WV44JX - 5 SSU
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
---start of page---
Page
3 of 4
Ship-from/Endroit d'expedition
Bayer CropScience Inc.
c/o Agassiz SeedFarm
HOMEWOOD, MB R0G 0Y0
Canada
Telephone : <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
Contact: BAYER CROPSCIENCE:1-800-667-7897 (EXT.4)
Ship-to or Consignee/Destinataire ou consignataire
9123643
BAYER DEMO SEED - REP KEVIN CHEVALIER
C/O DOMAIN CO-OP LTD ( CPI# 340172 )
SEED 81 / CP 81
MACDONALD RD
PO BOX 56
DOMAIN MB R0G 0M0
CANADA
Contact Info/Coordonnées: 204-736-4321
HM Item/
DG Article No. and kind of packages/Nombre et type d'emballage
Goods Description/Description de la Merchandise
No & kind of pkgs:
*********************
BILL OF LADING (ORIGINAL)
/CONNAISSEMENT (ORIGINAL)
BOL/CMR Number/No de connaissement/CMR
834147172
Document Date/Date du document
22.03.2024 04:17 PM
Delivery Number/No de livraison.
809174321
Customer P. O./Bon de commande du client
KEVIN CHEVALIER
Order No./Numéro de la commande
8100332
Sold-To/Client
9126185
MANITOBA DEMO/COMPLAINT
160 QUARRY PARK BLVD SE
CALGARY AB T2C 3G3
CANADA
Contact Info/Coordonnées: 403-723-7400
Quantity/
Quantité
Gross Weight/
Poids Brut
Net Weight/
Poids Net
10
90037468 DKC072-12RIB AF2 VT2P 80M Poncho 500-B
12 SSU
267 KG
267 KG
Batch H18W4J4JX - 12 SSU
No & kind of pkgs:
*********************
11
90037727 DKC084-60RIB AF2 VT2P 80M Poncho 500-B
1 SSU
21 KG
21 KG
Batch H18WXL9JX - 1 SSU
No & kind of pkgs:
*********************
No. of Pkgs: 101
Do not ship with food, feed, drugs or clothing.
Ne pas envoyer ce produit avec la nourriture humaine
ou animale, des médicaments, ou des vêtements.
Total
2.282 KG
2.282 KG
Carrier Instructions/Instructions au transporteur:
DEMO SEED SALES ORDER. HOLD FOR PICKUP ATTENTION OF BAYER REP KEVIN CHEVALIER CONTACT 204-229-2220
I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and
are in all respects in proper condition for transport according to applicable international and national governmental regulations.
Par la présente, je déclare que les renseignements relatifs à la description du contenu du chargement et à l'appellation réglementaire du produit expédié sont complets et exacts; et que le
contenu est correctement classé, emballé, identifié, étiqueté/placardé et qu'il conforme à tous égards aux règlements gouvernementaux, nationaux et internationaux en matière de transport.
IT IS HEREBY ACKNOWLEDGED BY ALL PARTIES CONCERNED THAT (NAME OF BROKER/DATE)
Il est, par la présente, reconnu par toutes les parties concernées que (non du courtier/date) _____________________________________________
IS AN AGENT OR MANDATARY WHO IS ACTING ON BEHALF OF (NAME OF CARRIER/DATE)
Agit à titre d'agent ou de mandataire pour le compte de (nom du transporteur/date) _____________________________________________
Shipper/Expéditeur: _______________________________ Agent/Transporteur: _______________________________ Consignee / Destinataire: _________________________________
(Received by/Reçu par)
FOR CHEMICAL EMERGENCY - SPILL, LEAK, FIRE, EXPOSURE OR ACCIDENT - DAY OR NIGHT: CALL CHEMTREC (CONTRACT #CCN2469) 1-800-424-9300. IN CANADA, CALL CANUTEC
1-613-996-6666.
En cas d'urgence - déversement, fuite, feu, contact ou accident-jour et nuit: Appelez Canutec (613)996-6666. Aux États-Unis, applez Chemtrec (CONTRACT #CCN2469) 1-800-424-9300.
---end of page---
|
e85836bcb3d64b28d8578ae1b316abb5
|
{
"intermediate": 0.39367014169692993,
"beginner": 0.42636656761169434,
"expert": 0.17996330559253693
}
|
45,151
|
json_to_recordset(array-json)
|
d735cf0db445092ee29f9c2d1f6751e6
|
{
"intermediate": 0.4002312123775482,
"beginner": 0.2539409101009369,
"expert": 0.34582793712615967
}
|
45,152
|
Produce this JSON structure (parenthesis provide more context) (... means etc) (put null if field cannot be found): {"bol_no":"","stops":[{"stop_no":-1,"delivery_no":"","shipment_no":"","carrier":"","items":[{"prod_no":"","prod_desc":"","batches":[{"batch_no":"","qty":0,"qty_unit":""}...],"total_qty":0,"total_qty_unit":"","wght":0,"wght_unit":""}...]}...]}
|
f71b7cf00fb5522771877027cc27c10b
|
{
"intermediate": 0.3753086030483246,
"beginner": 0.3932033181190491,
"expert": 0.23148801922798157
}
|
45,153
|
import boto3
import gzip
import tarfile
import io
import os
from joblib import load
import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
# Previouly we made sure that the LSH class is defined in a separate module (a .py file) instead of the Jupyter notebook or the main script. Let's say we save it in lsh_model.py.
# So class LSH is defined in the module where we are trying to load the pickled object.
# Python's pickle module needs to find the same class definition during loading as was present during saving.
# from lsh_model import LSH
# from lsh_model import rank_top_similar_items
# Initialize a boto3 S3 client
s3 = boto3.client('s3')
def initialize(context):
# Specify the name of the S3 bucket and the key of the .tar.gz file
bucket_name = "nike-geminipoc-test-serverless-deployments"
object_key = "serverless/gemini-poc-opensearch-api-es/test/lsh_model_tongue_lining.tar.gz"
# Parse the base model and data filenames
base_with_extension = os.path.basename(object_key)
base_no_extension = base_with_extension.rsplit(".", 2)[0]
model_file_path = f"{base_no_extension}.joblib"
data_file_path = f"{base_no_extension}.pkl"
# Check if the files already exist and skip downloading if so
if not os.path.isfile(model_file_path) or not os.path.isfile(data_file_path):
# Download the .tar.gz file from S3 to an in-memory buffer if files do not exist
buffer = io.BytesIO()
s3.download_fileobj(bucket_name, object_key, buffer)
buffer.seek(0)
# Use the gzip library to decompress the buffer
decompressed_buffer = io.BytesIO(gzip.decompress(buffer.read()))
decompressed_buffer.seek(0)
# Use the tarfile library to extract the contents of the .tar.gz file
with tarfile.open(fileobj=decompressed_buffer) as tar:
tar.extractall()
else:
print("Model and data files already exist locally, skipping download.")
# Load the model and data
print(f"Reading model from: {model_file_path}")
lsh_model_loaded = load(model_file_path)
print(f"Reading data from: {data_file_path}")
data = pd.read_pickle(data_file_path)
return lsh_model_loaded, data
def inference(model, data, query_id, top_n=20):
# Findd similar IDs and rank them
similar_ids = model.query(data.loc[query_id])
top_n_similar_ids = rank_top_similar_items(data, query_id, similar_ids, top_n=top_n)
return top_n_similar_ids
# Get the ids
payload = {"part_name": "tongue_lining", "query_id": '61a99df7-f298-43ac-ad41-bed28b109a31'}
context = payload["part_name"]
query_id_ =payload["query_id"]
# initialize
model_, data_ = initialize(context)
# Operate Innference
top_n_similar_ids = inference(model_, data_, query_id_)
print(top_n_similar_ids)
|
4425b3c1c096a3e57f175ce6d0052248
|
{
"intermediate": 0.3856204152107239,
"beginner": 0.41668373346328735,
"expert": 0.19769586622714996
}
|
45,154
|
hey do I have to call MPV_observe_property once or do I have to call it in a loop
|
4c53f9863e6036adf71e42014bc0876f
|
{
"intermediate": 0.3839508593082428,
"beginner": 0.42523589730262756,
"expert": 0.19081322848796844
}
|
45,155
|
Hi, this is an extract from a chapter from an evolutionary psychology book on dating titled 'youth' in section "What Men Want" of "The Evolution of Desire: Strategies of Human Mating" by David M. Buss, can you summarise this section?
|
d63fafe27b88260046c9d070a22de413
|
{
"intermediate": 0.37153732776641846,
"beginner": 0.35987862944602966,
"expert": 0.26858407258987427
}
|
45,156
|
how to run python on PowerShell?
|
2d0cec7662e5d16a7a2f0d4c3192f03c
|
{
"intermediate": 0.5023478269577026,
"beginner": 0.2514950931072235,
"expert": 0.24615706503391266
}
|
45,157
|
I want to simulate in Unity a house smoke by the chimney, I have a partickle system y only have to start and stop it, the thing that i want is start it, keep it for a time between20 and 30 seconds and then wait between 2-3 minutes to start it again
|
74da8a6451db45147ddd4f5ccd83a51d
|
{
"intermediate": 0.507614016532898,
"beginner": 0.23541739583015442,
"expert": 0.25696858763694763
}
|
45,158
|
Hey recently MPV removed MPV_event_metadata _update, who to replicate this behavior using MPV_observe_property on metadata, so that I can get a condition to update the metadata and show it to the user
|
7f5a0ac63aec98336986a61f8d40cdf6
|
{
"intermediate": 0.6037505865097046,
"beginner": 0.1018025204539299,
"expert": 0.2944468557834625
}
|
45,159
|
Rerwrite the following to be more optimized in terms of speed:
import boto3
import gzip
import tarfile
import io
import os
from joblib import load
import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
# Previouly we made sure that the LSH class is defined in a separate module (a .py file) instead of the Jupyter notebook or the main script. Let's say we save it in lsh_model.py.
# So class LSH is defined in the module where we are trying to load the pickled object.
# Python's pickle module needs to find the same class definition during loading as was present during saving.
# from lsh_model import LSH
# from lsh_model import rank_top_similar_items
# Initialize a boto3 S3 client
s3 = boto3.client('s3')
def initialize(context):
# Specify the name of the S3 bucket and the key of the .tar.gz file
bucket_name = "nike-geminipoc-test-serverless-deployments"
object_key = "serverless/gemini-poc-opensearch-api-es/test/lsh_model_tongue_lining.tar.gz"
# Parse the base model and data filenames
base_with_extension = os.path.basename(object_key)
base_no_extension = base_with_extension.rsplit(".", 2)[0]
model_file_path = f"{base_no_extension}.joblib"
data_file_path = f"{base_no_extension}.pkl"
# Check if the files already exist and skip downloading if so
if not os.path.isfile(model_file_path) or not os.path.isfile(data_file_path):
# Download the .tar.gz file from S3 to an in-memory buffer if files do not exist
buffer = io.BytesIO()
s3.download_fileobj(bucket_name, object_key, buffer)
buffer.seek(0)
# Use the gzip library to decompress the buffer
decompressed_buffer = io.BytesIO(gzip.decompress(buffer.read()))
decompressed_buffer.seek(0)
# Use the tarfile library to extract the contents of the .tar.gz file
with tarfile.open(fileobj=decompressed_buffer) as tar:
tar.extractall()
else:
print("Model and data files already exist locally, skipping download.")
# Load the model and data
print(f"Reading model from: {model_file_path}")
lsh_model_loaded = load(model_file_path)
print(f"Reading data from: {data_file_path}")
data = pd.read_pickle(data_file_path)
return lsh_model_loaded, data
def inference(model, data, query_id, top_n=20):
# Findd similar IDs and rank them
similar_ids = model.query(data.loc[query_id])
top_n_similar_ids = rank_top_similar_items(data, query_id, similar_ids, top_n=top_n)
return top_n_similar_ids
# Get the ids
payload = {"part_name": "tongue_lining", "query_id": '61a99df7-f298-43ac-ad41-bed28b109a31'}
context = payload["part_name"]
query_id_ =payload["query_id"]
# initialize
model_, data_ = initialize(context)
# Operate Innference
top_n_similar_ids = inference(model_, data_, query_id_)
print(top_n_similar_ids)
|
bbe07302b7d7a5d225096f4737808c39
|
{
"intermediate": 0.3431283235549927,
"beginner": 0.2831151783466339,
"expert": 0.3737564980983734
}
|
45,160
|
Transcribe está información de personaje de forma que pueda ser tomado por un programa que cumple con la función de interpretar a personajes de forma exacta y perfecta para que los usuarios del programa puedan interactuar con los personajes mediante diálogos.
Appearance
She has basically the same appearance as her Fate/stay night counterpart, even though here she is younger. Being originally an Einzbern homunculi, Illyasviel has red eyes and long silver hair just like her mother, Irisviel. She wears many casual outfits but the more recognizable ones are her regular school uniform, summer school uniform and her pink Magical Girl outfit after contracting with Magical Ruby. While using Magical Sapphire, she wears a purple outfit, a little bit different from Miyu's.
In the Zwei Form where she wields both Magical Ruby and Magical Sapphire, her outfit changes to a purplish color with and she obtains cosmic-like wings. As a Card User she is able to install Class Cards and to obtain outfits and equipment of various Heroic Spirits. She only becomes able to do it by herself during her first fight with Beatrice Flowerchild.
When she installs the Saber Class Card, instead of summoning the King Arthur, Artoria Pendragon, she brings out the Princess Knight side of her.[3]
Personality
Illya exhibits a cheerful and positive attitude; but unlike her counterpart, she is shy, easily flustered, and more innocent at the beginning. In her first fight, she is shown to be agile but rather cowardly. Also, Illya is an ardent fan of anime, much to Sella's disappointment. She secretly harbors feelings for her brother, Shirou, something that Ruby highlights frequently much to her embarrassment. She is also rarely (if ever) clingy when with him unlike her Fate/Stay Night counterpart.
When interacting with her friends at school, she shares a dynamic relationship with them where she usually acts as the voice of reason, a role that is very much like a Tsukkomi (a person who throws punchlines). This is particularly expressed when it comes to suggestively lewd or comedically immoral situations. She has a rather intense fascination with maid outfits, though she does not like the official Einzbern maid outfit Sella puts on at one point.
As the series progresses, Illya matures into a strong individual who's willing to face overwhelming odds for what she cares about while also maintaining her innocent nature and strong morals. This is proven when Illya also wants to protect everyone, especially her friends. It is shown as Illya proclaims that she will help Miyu and her world, even though Julian stated that it is almost impossible.
This characterizes the immeasurable amount of kindness Illya possesses that she is considered a natural genius in becoming friends with her enemies.[4]
Despite her growth in maturity, she still holds behaviors fitting of her age such as childish tempers, trying to act mature, and being stubborn towards things she dislikes. Like all young girls her age she adores cute things like animals and stuffed toys. In stark contrast to her original version, she really likes cats.
|
af833b061f9a82e0d1d675def945a0bd
|
{
"intermediate": 0.3708573281764984,
"beginner": 0.32036009430885315,
"expert": 0.30878254771232605
}
|
45,161
|
<div id="add-bug-container" class="modal add-bug-container" data-backdrop="static">
<div class="container mb-3">
<div class="col-xs-4">
<h5 class="text-primary text-left mt-5">New Bug to Track</h5>
<input id="new-bug" class="form-control" type="text" placeholder="Enter text here...">
<button type="submit" data-dismiss="modal" class="btn btn-success"
onclick="addBug(document.getElementById('new-bug').value);">Save</button>
</div>
</div>
</div>
async function addBug(name) {
let form = document.getElementById('add-bug-container');
document.getElementById('new-bug').value = '';
form.classList.add('was-validated');
contract.methods
.getTaskCount()
.call({
from: web3.eth.defaultAccount
})
.then(
(bugNum) => {
addBugToList(bugNum, name, false);
},
(err) => {
console.log('Failed to retrieve the number of bugs from Ganache.');
}
);
try {
await contract.methods
.addBug(name, false)
.send({
from: web3.eth.defaultAccount
});
} catch {
console.log('Failed to save bug to blockchain.');
}
}
what's wrong with the onclick addBug function?
|
bb082e77ee12b96e26963a0c94d1c9ff
|
{
"intermediate": 0.4210852086544037,
"beginner": 0.3417903780937195,
"expert": 0.23712441325187683
}
|
45,162
|
Сделай функцию read_from_web(URL) на пайтоне, читающую example.com/txt.code
|
ff7ce50f1d149d3c3186a3ea61499dfe
|
{
"intermediate": 0.3140292763710022,
"beginner": 0.3322173058986664,
"expert": 0.3537534475326538
}
|
45,163
|
Hi, can you please provide me an example of a deisgn pattern in DSP or audio context?
|
37837ba2608942e73ce2085ffa23bb58
|
{
"intermediate": 0.32128462195396423,
"beginner": 0.15700280666351318,
"expert": 0.5217125415802002
}
|
45,164
|
File "C:\Projects Python\MAS\blueai\__init__.py", line 15, in __init__
exec(self.code["init"])
File "<string>", line 2
from selenium.webdriver.chrome.options import Options
IndentationError: unexpected indent
|
92f7e06470f3ffbe062aaa2f3539e951
|
{
"intermediate": 0.39878639578819275,
"beginner": 0.38978299498558044,
"expert": 0.21143054962158203
}
|
45,165
|
import numpy as np
import tensorflow as tf
x = np.arange(0,np.pi*2000 ,np.pi/8)
y = np.sin(x)
x_train,y_train,x_val,y_val = x[:12000],y[:12000],x[12000:16001],y[12000:16001]
batch_size = 512
model = tf.keras.Sequential([
tf.keras.layers.LSTM(
batch_input_shape = (batch_size,256,1),
units = 256,
activation="tanh",
recurrent_activation="sigmoid",
return_sequences = True,
#dropout = 0.2,
stateful=True),
tf.keras.layers.Dense(1, activation="tanh")
])
# Компиляция модели
model.compile(optimizer='adam', loss='mean_squared_error')
# Обучение модели
model.fit(x_train, y_train, validation_data=(x_val, y_val), epochs=200, batch_size=batch_size) Call arguments received by layer 'sequential' (type Sequential):
• inputs=tf.Tensor(shape=(None,), dtype=float32)
• training=True
• mask=None
|
926b8a7f340091755b328e5e75a26883
|
{
"intermediate": 0.32492387294769287,
"beginner": 0.18697164952754974,
"expert": 0.4881044328212738
}
|
45,166
|
<slideshow-component
class="slider-mobile-gutter{% if section.settings.layout == 'grid' %} page-width{% endif %}{% if section.settings.show_text_below %} mobile-text-below{% endif %}"
role="region"
aria-roledescription="{{ 'sections.slideshow.carousel' | t }}"
aria-label="{{ section.settings.accessibility_info | escape }}"
>
{%- if section.settings.auto_rotate and section.blocks.size > 1 -%}
<div class="slideshow__controls slideshow__controls--top slider-buttons no-js-hidden{% if section.settings.show_text_below %} slideshow__controls--border-radius-mobile{% endif %}">
<button
type="button"
class="slider-button slider-button--prev"
name="previous"
aria-label="{{ 'sections.slideshow.previous_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
<div class="slider-counter slider-counter--{{ section.settings.slider_visual }}{% if section.settings.slider_visual == 'counter' or section.settings.slider_visual == 'numbers' %} caption{% endif %}">
{%- if section.settings.slider_visual == 'counter' -%}
<span class="slider-counter--current">1</span>
<span aria-hidden="true"> / </span>
<span class="visually-hidden">{{ 'general.slider.of' | t }}</span>
<span class="slider-counter--total">{{ section.blocks.size }}</span>
{%- else -%}
<div class="slideshow__control-wrapper">
{%- for block in section.blocks -%}
<button
class="slider-counter__link slider-counter__link--{{ section.settings.slider_visual }} link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
aria-controls="Slider-{{ section.id }}"
>
{%- if section.settings.slider_visual == 'numbers' -%}
{{ forloop.index -}}
{%- else -%}
<span class="dot"></span>
{%- endif -%}
</button>
{%- endfor -%}
</div>
{%- endif -%}
</div>
<button
type="button"
class="slider-button slider-button--next"
name="next"
aria-label="{{ 'sections.slideshow.next_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
{%- if section.settings.auto_rotate -%}
<button
type="button"
class="slideshow__autoplay slider-button no-js-hidden{% if section.settings.auto_rotate == false %} slideshow__autoplay--paused{% endif %}"
aria-label="{{ 'sections.slideshow.pause_slideshow' | t }}"
>
{%- render 'icon-pause' -%}
{%- render 'icon-play' -%}
</button>
{%- endif -%}
</div>
<noscript>
<div class="slider-buttons">
<div class="slider-counter">
{%- for block in section.blocks -%}
<a
href="#Slide-{{ section.id }}-{{ forloop.index }}"
class="slider-counter__link link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
>
{{ forloop.index }}
</a>
{%- endfor -%}
</div>
</div>
</noscript>
{%- endif -%}
<div
class="slideshow banner banner--{{ section.settings.slide_height }} grid grid--1-col slider slider--everywhere{% if section.settings.show_text_below %} banner--mobile-bottom{% endif %}{% if section.blocks.first.settings.image == blank %} slideshow--placeholder{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"
id="Slider-{{ section.id }}"
aria-live="polite"
aria-atomic="true"
data-autoplay="{{ section.settings.auto_rotate }}"
data-speed="{{ section.settings.change_slides_speed }}"
>
{%- for block in section.blocks -%}
<style>
#Slide-{{ section.id }}-{{ forloop.index }} .banner__media::after {
opacity: {{ block.settings.image_overlay_opacity | divided_by: 100.0 }};
}
</style>
<div
class="slideshow__slide grid__item grid--1-col slider__slide"
id="Slide-{{ section.id }}-{{ forloop.index }}"
{{ block.shopify_attributes }}
role="group"
aria-roledescription="{{ 'sections.slideshow.slide' | t }}"
aria-label="{{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
tabindex="-1"
>
<div class="slideshow__media banner__media media{% if block.settings.image == blank %} placeholder{% endif %}{% if section.settings.image_behavior != 'none' %} animate--{{ section.settings.image_behavior }}{% endif %}">
{%- if block.settings.image -%}
{%- liquid
assign height = block.settings.image.width | divided_by: block.settings.image.aspect_ratio | round
if section.settings.image_behavior == 'ambient'
assign sizes = '120vw'
assign widths = '450, 660, 900, 1320, 1800, 2136, 2400, 3600, 7680'
else
assign sizes = '100vw'
assign widths = '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840'
endif
assign fetch_priority = 'auto'
if section.index == 1
assign fetch_priority = 'high'
endif
-%}
{%- if forloop.first %}
{{
block.settings.image
| image_url: width: 3840
| image_tag: height: height, sizes: sizes, widths: widths, fetchpriority: fetch_priority
}}
{%- else -%}
{{
block.settings.image
| image_url: width: 3840
| image_tag: loading: 'lazy', height: height, sizes: sizes, widths: widths
}}
{%- endif -%}
{%- else -%}
{%- assign placeholder_slide = forloop.index | modulo: 2 -%}
{%- if placeholder_slide == 1 -%}
{{ 'hero-apparel-2' | placeholder_svg_tag: 'placeholder-svg' }}
{%- else -%}
{{ 'hero-apparel-1' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%}
{%- endif -%}
</div>
{% comment %} <div class="slideshow__text-wrapper banner__content banner__content--{{ block.settings.box_align }} page-width{% if block.settings.show_text_box == false %} banner--desktop-transparent{% endif %}{% if settings.animations_reveal_on_scroll and forloop.index == 1 %} scroll-trigger animate--slide-in{% endif %}">
<div class="slideshow__text banner__box content-container content-container--full-width-mobile color-{{ block.settings.color_scheme }} gradient slideshow__text--{{ block.settings.text_alignment }} slideshow__text-mobile--{{ block.settings.text_alignment_mobile }}"> {% endcomment %}
{% comment %} {%- if block.settings.heading != blank -%}
<h2 class="banner__heading inline-richtext {{ block.settings.heading_size }}">
{{ block.settings.heading }}
</h2>
{%- endif -%} {% endcomment %}
{% comment %} {%- if block.settings.subheading != blank -%}
<div class="banner__text rte" {{ block.shopify_attributes }}>
<p>{{ block.settings.subheading }}</p>
</div>
{%- endif -%} {% endcomment %}
{% comment %} {%- if block.settings.button_label != blank -%}
<div class="banner__buttons">
<a
{% if block.settings.link %}
href="{{ block.settings.link }}"
{% else %}
role="link" aria-disabled="true"
{% endif %}
class="button {% if block.settings.button_style_secondary %}button--secondary{% else %}button--primary{% endif %}"
>
{{- block.settings.button_label | escape -}}
</a>
</div>
{%- endif -%} {% endcomment %}
{% comment %} </div>
</div> {% endcomment %}
</div>
{%- endfor -%}
</div>
{%- if section.blocks.size > 1 and section.settings.auto_rotate == false -%}
<div class="slideshow__controls slider-buttons no-js-hidden{% if section.settings.show_text_below %} slideshow__controls--border-radius-mobile{% endif %}">
<button
type="button"
class="slider-button slider-button--prev"
name="previous"
aria-label="{{ 'sections.slideshow.previous_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
<div class="slider-counter slider-counter--{{ section.settings.slider_visual }}{% if section.settings.slider_visual == 'counter' or section.settings.slider_visual == 'numbers' %} caption{% endif %}">
{%- if section.settings.slider_visual == 'counter' -%}
<span class="slider-counter--current">1</span>
<span aria-hidden="true"> / </span>
<span class="visually-hidden">{{ 'general.slider.of' | t }}</span>
<span class="slider-counter--total">{{ section.blocks.size }}</span>
{%- else -%}
<div class="slideshow__control-wrapper">
{%- for block in section.blocks -%}
<button
class="slider-counter__link slider-counter__link--{{ section.settings.slider_visual }} link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
aria-controls="Slider-{{ section.id }}"
>
{%- if section.settings.slider_visual == 'numbers' -%}
{{ forloop.index -}}
{%- else -%}
<span class="dot"></span>
{%- endif -%}
</button>
{%- endfor -%}
</div>
{%- endif -%}
</div>
<button
type="button"
class="slider-button slider-button--next"
name="next"
aria-label="{{ 'sections.slideshow.next_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
{%- if section.settings.auto_rotate -%}
<button
type="button"
class="slideshow__autoplay slider-button no-js-hidden{% if section.settings.auto_rotate == false %} slideshow__autoplay--paused{% endif %}"
aria-label="{{ 'sections.slideshow.pause_slideshow' | t }}"
>
{%- render 'icon-pause' -%}
{%- render 'icon-play' -%}
</button>
{%- endif -%}
</div>
<noscript>
<div class="slider-buttons">
<div class="slider-counter">
{%- for block in section.blocks -%}
<a
href="#Slide-{{ section.id }}-{{ forloop.index }}"
class="slider-counter__link link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
>
{{ forloop.index }}
</a>
{%- endfor -%}
</div>
</div>
</noscript>
{%- endif -%}
</slideshow-component>
voici un code d'un carousel de base sur liquid de shopify, au lieu d'utiliser ce composant, adapte le code pour utiliser à la place spidejs
|
5d6316077dc0c53ba6cc243b41d2519f
|
{
"intermediate": 0.31059014797210693,
"beginner": 0.539571225643158,
"expert": 0.1498386263847351
}
|
45,167
|
import numpy as np
import tensorflow as tf
x = np.arange(0,np.pi*200 ,np.pi/8)
y = np.sin(x)
x_train,y_train,x_val,y_val = x[:1200],y[:1200],x[1200:1601],y[1200:1601]
batch_size = 128
model = tf.keras.Sequential([
tf.keras.layers.LSTM(
batch_input_shape = (batch_size,256,1),
units = 256,
activation="tanh",
recurrent_activation="sigmoid",
return_sequences = True,
#dropout = 0.2,
stateful=True),
tf.keras.layers.Dense(1, activation="tanh")
])
# Компиляция модели
model.compile(optimizer='adam', loss='mean_squared_error')
# Обучение модели
model.fit(x_train, y_train, validation_data=(x_val, y_val), epochs=200, batch_size=batch_size)
|
a83e76d73a6ef1b8d44cc4a79f38f1af
|
{
"intermediate": 0.41196879744529724,
"beginner": 0.1541655957698822,
"expert": 0.43386563658714294
}
|
45,168
|
Write the Province class in C++ and raylib.
There should be functions:
1. drawProvince with the following arguments: Raylib color(Fill color), float stroke thickness, stroke type(dotted line, solid by default, float stroke thickness. This function loads and displays polygons from a file provinces.txt . This function reads the province id (the first line) through the for loop and then reads the coordinates from the next two lines, where the first line is the coordinates of the points in X, and the second is the coordinates of the points in Y. Both coordinates must be of type int. After that, the province is displayed in the raylib window. Implement polygon selection using the standard C++ library and raylib on Linux.
2. drawPoints, which allows you to draw new points of the province when the mouse is clicked from raylib until Enter is pressed. After pressing Enter, the dots are drawn for the new province. Polygon points should be drawn using raylib world coordinates.
3. deletePoints, this function deletes the extreme point of the province being drawn during the execution of drawPoints, this function can be performed several times until all the points are deleted.
4. savePointsToFile, which should also be called using the keyboard button press event from Raylib, by default it will be Enter. When called, this function will save the polygon province to a new file named provinces in txt format. 3 lines are allocated for each province: the first one is the coordinates of the points of the province in x, which are listed through the symbol ';', the second line is the coordinates of the points of the province in Y, which are listed through the symbol ';'.
5. deleteProvince - This function deletes the entire province by clicking the left mouse button on the fill of a certain province. It removes it from both memory and display, as well as from provinces.txt if she is registered there.
My future code with the main function will interact with this class.
|
087a35f19aa8387db740022353e720a2
|
{
"intermediate": 0.4849568009376526,
"beginner": 0.330878347158432,
"expert": 0.1841648668050766
}
|
45,169
|
Привет можешь сказать почему не рабоатет нормально данный код?
public class TimerQuest : MonoBehaviour
{
[SerializeField]
private TextMeshProUGUI _timerText;
private float timerDuration = 600f; // 10 минут = 600 секунд
private float _timer;
public float Timer { get => _timer; }
public event Action OnTimerExpired;
public void ActivateTimer()
{
StartCoroutine(UpdateTimer());
}
private IEnumerator UpdateTimer()
{
while (timerDuration > 0)
{
// Отнимаем время прошедшее между кадрами
timerDuration -= Time.deltaTime;
// Обновляем текст таймера
UpdateTimerText(timerDuration);
// Ждем следующий кадр перед повторением цикла
yield return new WaitForSeconds(1f);
}
// Время вышло, можно добавить сюда любую логику по обработке окончания таймера
OnTimerExpired?.Invoke();
}
private void UpdateTimerText(float timeToDisplay)
{
if (timeToDisplay < 0)
{
timeToDisplay = 0;
}
// Конвертируем время в минуты и секунды
int minutes = Mathf.FloorToInt(timeToDisplay / 60);
int seconds = Mathf.FloorToInt(timeToDisplay % 60);
// Обновляем текст UI
_timerText.text = string.Format("{ 0:00}:{ 1:00}", minutes, seconds);
}
}
|
279a95af8d304af4aa720fc8892174af
|
{
"intermediate": 0.27967965602874756,
"beginner": 0.48992741107940674,
"expert": 0.2303929328918457
}
|
45,170
|
generate a plan of filming an coffe advertaisment for a director, cameraman, filmmaker and editor
|
53af863aaf00aae6719fae5b1efcb7d4
|
{
"intermediate": 0.3402506411075592,
"beginner": 0.28644779324531555,
"expert": 0.37330156564712524
}
|
45,171
|
revise this code for denoland format
// @ts-ignore
import { connect } from 'cloudflare:sockets';
// How to generate your own UUID:
// [Windows] Press "Win + R", input cmd and run: Powershell -NoExit -Command "[guid]::NewGuid()"
let userID = 'd342d11e-d424-4583-b36e-524ab1f0afa4';
const proxyIPs = ['cdn.xn--b6gac.eu.org', 'cdn-all.xn--b6gac.eu.org', 'workers.cloudflare.cyou'];
// if you want to use ipv6 or single proxyIP, please add comment at this line and remove comment at the next line
let proxyIP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)];
// use single proxyIP instead of random
// let proxyIP = 'cdn.xn--b6gac.eu.org';
// ipv6 proxyIP example remove comment to use
// let proxyIP = "[2a01:4f8:c2c:123f:64:5:6810:c55a]"
let dohURL = 'https://sky.rethinkdns.com/1:-Pf_____9_8A_AMAIgE8kMABVDDmKOHTAKg='; // https://cloudflare-dns.com/dns-query or https://dns.google/dns-query
if (!isValidUUID(userID)) {
throw new Error('uuid is invalid');
}
export default {
/**
* @param {import("@cloudflare/workers-types").Request} request
* @param {{UUID: string, PROXYIP: string, DNS_RESOLVER_URL: string, NODE_ID: int, API_HOST: string, API_TOKEN: string}} env
* @param {import("@cloudflare/workers-types").ExecutionContext} ctx
* @returns {Promise<Response>}
*/
async fetch(request, env, ctx) {
// uuid_validator(request);
try {
userID = env.UUID || userID;
proxyIP = env.PROXYIP || proxyIP;
dohURL = env.DNS_RESOLVER_URL || dohURL;
let userID_Path = userID;
if (userID.includes(',')) {
userID_Path = userID.split(',')[0];
}
const upgradeHeader = request.headers.get('Upgrade');
if (!upgradeHeader || upgradeHeader !== 'websocket') {
const url = new URL(request.url);
switch (url.pathname) {
case `/cf`: {
return new Response(JSON.stringify(request.cf, null, 4), {
status: 200,
headers: {
"Content-Type": "application/json;charset=utf-8",
},
});
}
case `/${userID_Path}`: {
const vlessConfig = getVLESSConfig(userID, request.headers.get('Host'));
return new Response(`${vlessConfig}`, {
status: 200,
headers: {
"Content-Type": "text/html; charset=utf-8",
}
});
};
case `/sub/${userID_Path}`: {
const url = new URL(request.url);
const searchParams = url.searchParams;
const vlessSubConfig = createVLESSSub(userID, request.headers.get('Host'));
// Construct and return response object
return new Response(btoa(vlessSubConfig), {
status: 200,
headers: {
"Content-Type": "text/plain;charset=utf-8",
}
});
};
case `/bestip/${userID_Path}`: {
const headers = request.headers;
const url = `https://sub.xf.free.hr/auto?host=${request.headers.get('Host')}&uuid=${userID}&path=/`;
const bestSubConfig = await fetch(url, { headers: headers });
return bestSubConfig;
};
default:
// return new Response('Not found', { status: 404 });
// For any other path, reverse proxy to 'ramdom website' and return the original response, caching it in the process
const randomHostname = cn_hostnames[Math.floor(Math.random() * cn_hostnames.length)];
const newHeaders = new Headers(request.headers);
newHeaders.set('cf-connecting-ip', '1.2.3.4');
newHeaders.set('x-forwarded-for', '1.2.3.4');
newHeaders.set('x-real-ip', '1.2.3.4');
newHeaders.set('referer', 'https://www.google.com/search?q=edtunnel');
// Use fetch to proxy the request to 15 different domains
const proxyUrl = 'https://' + randomHostname + url.pathname + url.search;
let modifiedRequest = new Request(proxyUrl, {
method: request.method,
headers: newHeaders,
body: request.body,
redirect: 'manual',
});
const proxyResponse = await fetch(modifiedRequest, { redirect: 'manual' });
// Check for 302 or 301 redirect status and return an error response
if ([301, 302].includes(proxyResponse.status)) {
return new Response(`Redirects to ${randomHostname} are not allowed.`, {
status: 403,
statusText: 'Forbidden',
});
}
// Return the response from the proxy server
return proxyResponse;
}
} else {
return await vlessOverWSHandler(request);
}
} catch (err) {
/** @type {Error} */ let e = err;
return new Response(e.toString());
}
},
};
export async function uuid_validator(request) {
const hostname = request.headers.get('Host');
const currentDate = new Date();
const subdomain = hostname.split('.')[0];
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0');
const day = String(currentDate.getDate()).padStart(2, '0');
const formattedDate = `${year}-${month}-${day}`;
// const daliy_sub = formattedDate + subdomain
const hashHex = await hashHex_f(subdomain);
// subdomain string contains timestamps utc and uuid string TODO.
console.log(hashHex, subdomain, formattedDate);
}
export async function hashHex_f(string) {
const encoder = new TextEncoder();
const data = encoder.encode(string);
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
return hashHex;
}
/**
* Handles VLESS over WebSocket requests by creating a WebSocket pair, accepting the WebSocket connection, and processing the VLESS header.
* @param {import("@cloudflare/workers-types").Request} request The incoming request object.
* @returns {Promise<Response>} A Promise that resolves to a WebSocket response object.
*/
async function vlessOverWSHandler(request) {
const webSocketPair = new WebSocketPair();
const [client, webSocket] = Object.values(webSocketPair);
webSocket.accept();
let address = '';
let portWithRandomLog = '';
let currentDate = new Date();
const log = (/** @type {string} */ info, /** @type {string | undefined} */ event) => {
console.log(`[${currentDate} ${address}:${portWithRandomLog}] ${info}`, event || '');
};
const earlyDataHeader = request.headers.get('sec-websocket-protocol') || '';
const readableWebSocketStream = makeReadableWebSocketStream(webSocket, earlyDataHeader, log);
/** @type {{ value: import("@cloudflare/workers-types").Socket | null}}*/
let remoteSocketWapper = {
value: null,
};
let udpStreamWrite = null;
let isDns = false;
// ws --> remote
readableWebSocketStream.pipeTo(new WritableStream({
async write(chunk, controller) {
if (isDns && udpStreamWrite) {
return udpStreamWrite(chunk);
}
if (remoteSocketWapper.value) {
const writer = remoteSocketWapper.value.writable.getWriter()
await writer.write(chunk);
writer.releaseLock();
return;
}
const {
hasError,
message,
portRemote = 443,
addressRemote = '',
rawDataIndex,
vlessVersion = new Uint8Array([0, 0]),
isUDP,
} = processVlessHeader(chunk, userID);
address = addressRemote;
portWithRandomLog = `${portRemote} ${isUDP ? 'udp' : 'tcp'} `;
if (hasError) {
// controller.error(message);
throw new Error(message); // cf seems has bug, controller.error will not end stream
}
// If UDP and not DNS port, close it
if (isUDP && portRemote !== 53) {
throw new Error('UDP proxy only enabled for DNS which is port 53');
// cf seems has bug, controller.error will not end stream
}
if (isUDP && portRemote === 53) {
isDns = true;
}
// ["version", "附加信息长度 N"]
const vlessResponseHeader = new Uint8Array([vlessVersion[0], 0]);
const rawClientData = chunk.slice(rawDataIndex);
// TODO: support udp here when cf runtime has udp support
if (isDns) {
const { write } = await handleUDPOutBound(webSocket, vlessResponseHeader, log);
udpStreamWrite = write;
udpStreamWrite(rawClientData);
return;
}
handleTCPOutBound(remoteSocketWapper, addressRemote, portRemote, rawClientData, webSocket, vlessResponseHeader, log);
},
close() {
log(`readableWebSocketStream is close`);
},
abort(reason) {
log(`readableWebSocketStream is abort`, JSON.stringify(reason));
},
})).catch((err) => {
log('readableWebSocketStream pipeTo error', err);
});
return new Response(null, {
status: 101,
webSocket: client,
});
}
/**
* Handles outbound TCP connections.
*
* @param {any} remoteSocket
* @param {string} addressRemote The remote address to connect to.
* @param {number} portRemote The remote port to connect to.
* @param {Uint8Array} rawClientData The raw client data to write.
* @param {import("@cloudflare/workers-types").WebSocket} webSocket The WebSocket to pass the remote socket to.
* @param {Uint8Array} vlessResponseHeader The VLESS response header.
* @param {function} log The logging function.
* @returns {Promise<void>} The remote socket.
*/
async function handleTCPOutBound(remoteSocket, addressRemote, portRemote, rawClientData, webSocket, vlessResponseHeader, log,) {
/**
* Connects to a given address and port and writes data to the socket.
* @param {string} address The address to connect to.
* @param {number} port The port to connect to.
* @returns {Promise<import("@cloudflare/workers-types").Socket>} A Promise that resolves to the connected socket.
*/
async function connectAndWrite(address, port) {
/** @type {import("@cloudflare/workers-types").Socket} */
const tcpSocket = connect({
hostname: address,
port: port,
});
remoteSocket.value = tcpSocket;
log(`connected to ${address}:${port}`);
const writer = tcpSocket.writable.getWriter();
await writer.write(rawClientData); // first write, nomal is tls client hello
writer.releaseLock();
return tcpSocket;
}
/**
* Retries connecting to the remote address and port if the Cloudflare socket has no incoming data.
* @returns {Promise<void>} A Promise that resolves when the retry is complete.
*/
async function retry() {
const tcpSocket = await connectAndWrite(proxyIP || addressRemote, portRemote)
tcpSocket.closed.catch(error => {
console.log('retry tcpSocket closed error', error);
}).finally(() => {
safeCloseWebSocket(webSocket);
})
remoteSocketToWS(tcpSocket, webSocket, vlessResponseHeader, null, log);
}
const tcpSocket = await connectAndWrite(addressRemote, portRemote);
// when remoteSocket is ready, pass to websocket
// remote--> ws
remoteSocketToWS(tcpSocket, webSocket, vlessResponseHeader, retry, log);
}
/**
* Creates a readable stream from a WebSocket server, allowing for data to be read from the WebSocket.
* @param {import("@cloudflare/workers-types").WebSocket} webSocketServer The WebSocket server to create the readable stream from.
* @param {string} earlyDataHeader The header containing early data for WebSocket 0-RTT.
* @param {(info: string)=> void} log The logging function.
* @returns {ReadableStream} A readable stream that can be used to read data from the WebSocket.
*/
function makeReadableWebSocketStream(webSocketServer, earlyDataHeader, log) {
let readableStreamCancel = false;
const stream = new ReadableStream({
start(controller) {
webSocketServer.addEventListener('message', (event) => {
const message = event.data;
controller.enqueue(message);
});
webSocketServer.addEventListener('close', () => {
safeCloseWebSocket(webSocketServer);
controller.close();
});
webSocketServer.addEventListener('error', (err) => {
log('webSocketServer has error');
controller.error(err);
});
const { earlyData, error } = base64ToArrayBuffer(earlyDataHeader);
if (error) {
controller.error(error);
} else if (earlyData) {
controller.enqueue(earlyData);
}
},
pull(controller) {
// if ws can stop read if stream is full, we can implement backpressure
// https://streams.spec.whatwg.org/#example-rs-push-backpressure
},
cancel(reason) {
log(`ReadableStream was canceled, due to ${reason}`)
readableStreamCancel = true;
safeCloseWebSocket(webSocketServer);
}
});
return stream;
}
// https://xtls.github.io/development/protocols/vless.html
// https://github.com/zizifn/excalidraw-backup/blob/main/v2ray-protocol.excalidraw
/**
* Processes the VLESS header buffer and returns an object with the relevant information.
* @param {ArrayBuffer} vlessBuffer The VLESS header buffer to process.
* @param {string} userID The user ID to validate against the UUID in the VLESS header.
* @returns {{
* hasError: boolean,
* message?: string,
* addressRemote?: string,
* addressType?: number,
* portRemote?: number,
* rawDataIndex?: number,
* vlessVersion?: Uint8Array,
* isUDP?: boolean
* }} An object with the relevant information extracted from the VLESS header buffer.
*/
function processVlessHeader(vlessBuffer, userID) {
if (vlessBuffer.byteLength < 24) {
return {
hasError: true,
message: 'invalid data',
};
}
const version = new Uint8Array(vlessBuffer.slice(0, 1));
let isValidUser = false;
let isUDP = false;
const slicedBuffer = new Uint8Array(vlessBuffer.slice(1, 17));
const slicedBufferString = stringify(slicedBuffer);
// check if userID is valid uuid or uuids split by , and contains userID in it otherwise return error message to console
const uuids = userID.includes(',') ? userID.split(",") : [userID];
// uuid_validator(hostName, slicedBufferString);
// isValidUser = uuids.some(userUuid => slicedBufferString === userUuid.trim());
isValidUser = uuids.some(userUuid => slicedBufferString === userUuid.trim()) || uuids.length === 1 && slicedBufferString === uuids[0].trim();
console.log(`userID: ${slicedBufferString}`);
if (!isValidUser) {
return {
hasError: true,
message: 'invalid user',
};
}
const optLength = new Uint8Array(vlessBuffer.slice(17, 18))[0];
//skip opt for now
const command = new Uint8Array(
vlessBuffer.slice(18 + optLength, 18 + optLength + 1)
)[0];
// 0x01 TCP
// 0x02 UDP
// 0x03 MUX
if (command === 1) {
isUDP = false;
} else if (command === 2) {
isUDP = true;
} else {
return {
hasError: true,
message: `command ${command} is not support, command 01-tcp,02-udp,03-mux`,
};
}
const portIndex = 18 + optLength + 1;
const portBuffer = vlessBuffer.slice(portIndex, portIndex + 2);
// port is big-Endian in raw data etc 80 == 0x005d
const portRemote = new DataView(portBuffer).getUint16(0);
let addressIndex = portIndex + 2;
const addressBuffer = new Uint8Array(
vlessBuffer.slice(addressIndex, addressIndex + 1)
);
// 1--> ipv4 addressLength =4
// 2--> domain name addressLength=addressBuffer[1]
// 3--> ipv6 addressLength =16
const addressType = addressBuffer[0];
let addressLength = 0;
let addressValueIndex = addressIndex + 1;
let addressValue = '';
switch (addressType) {
case 1:
addressLength = 4;
addressValue = new Uint8Array(
vlessBuffer.slice(addressValueIndex, addressValueIndex + addressLength)
).join('.');
break;
case 2:
addressLength = new Uint8Array(
vlessBuffer.slice(addressValueIndex, addressValueIndex + 1)
)[0];
addressValueIndex += 1;
addressValue = new TextDecoder().decode(
vlessBuffer.slice(addressValueIndex, addressValueIndex + addressLength)
);
break;
case 3:
addressLength = 16;
const dataView = new DataView(
vlessBuffer.slice(addressValueIndex, addressValueIndex + addressLength)
);
// 2001:0db8:85a3:0000:0000:8a2e:0370:7334
const ipv6 = [];
for (let i = 0; i < 8; i++) {
ipv6.push(dataView.getUint16(i * 2).toString(16));
}
addressValue = ipv6.join(':');
// seems no need add [] for ipv6
break;
default:
return {
hasError: true,
message: `invild addressType is ${addressType}`,
};
}
if (!addressValue) {
return {
hasError: true,
message: `addressValue is empty, addressType is ${addressType}`,
};
}
return {
hasError: false,
addressRemote: addressValue,
addressType,
portRemote,
rawDataIndex: addressValueIndex + addressLength,
vlessVersion: version,
isUDP,
};
}
/**
* Converts a remote socket to a WebSocket connection.
* @param {import("@cloudflare/workers-types").Socket} remoteSocket The remote socket to convert.
* @param {import("@cloudflare/workers-types").WebSocket} webSocket The WebSocket to connect to.
* @param {ArrayBuffer | null} vlessResponseHeader The VLESS response header.
* @param {(() => Promise<void>) | null} retry The function to retry the connection if it fails.
* @param {(info: string) => void} log The logging function.
* @returns {Promise<void>} A Promise that resolves when the conversion is complete.
*/
async function remoteSocketToWS(remoteSocket, webSocket, vlessResponseHeader, retry, log) {
// remote--> ws
let remoteChunkCount = 0;
let chunks = [];
/** @type {ArrayBuffer | null} */
let vlessHeader = vlessResponseHeader;
let hasIncomingData = false; // check if remoteSocket has incoming data
await remoteSocket.readable
.pipeTo(
new WritableStream({
start() {
},
/**
*
* @param {Uint8Array} chunk
* @param {*} controller
*/
async write(chunk, controller) {
hasIncomingData = true;
remoteChunkCount++;
if (webSocket.readyState !== WS_READY_STATE_OPEN) {
controller.error(
'webSocket.readyState is not open, maybe close'
);
}
if (vlessHeader) {
webSocket.send(await new Blob([vlessHeader, chunk]).arrayBuffer());
vlessHeader = null;
} else {
// console.log(`remoteSocketToWS send chunk ${chunk.byteLength}`);
// seems no need rate limit this, CF seems fix this??..
// if (remoteChunkCount > 20000) {
// // cf one package is 4096 byte(4kb), 4096 * 20000 = 80M
// await delay(1);
// }
webSocket.send(chunk);
}
},
close() {
log(`remoteConnection!.readable is close with hasIncomingData is ${hasIncomingData}`);
// safeCloseWebSocket(webSocket); // no need server close websocket frist for some case will casue HTTP ERR_CONTENT_LENGTH_MISMATCH issue, client will send close event anyway.
},
abort(reason) {
console.error(`remoteConnection!.readable abort`, reason);
},
})
)
.catch((error) => {
console.error(
`remoteSocketToWS has exception `,
error.stack || error
);
safeCloseWebSocket(webSocket);
});
// seems is cf connect socket have error,
// 1. Socket.closed will have error
// 2. Socket.readable will be close without any data coming
if (hasIncomingData === false && retry) {
log(`retry`)
retry();
}
}
/**
* Decodes a base64 string into an ArrayBuffer.
* @param {string} base64Str The base64 string to decode.
* @returns {{earlyData: ArrayBuffer|null, error: Error|null}} An object containing the decoded ArrayBuffer or null if there was an error, and any error that occurred during decoding or null if there was no error.
*/
function base64ToArrayBuffer(base64Str) {
if (!base64Str) {
return { earlyData: null, error: null };
}
try {
// go use modified Base64 for URL rfc4648 which js atob not support
base64Str = base64Str.replace(/-/g, '+').replace(/_/g, '/');
const decode = atob(base64Str);
const arryBuffer = Uint8Array.from(decode, (c) => c.charCodeAt(0));
return { earlyData: arryBuffer.buffer, error: null };
} catch (error) {
return { earlyData: null, error };
}
}
/**
* Checks if a given string is a valid UUID.
* Note: This is not a real UUID validation.
* @param {string} uuid The string to validate as a UUID.
* @returns {boolean} True if the string is a valid UUID, false otherwise.
*/
function isValidUUID(uuid) {
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
return uuidRegex.test(uuid);
}
const WS_READY_STATE_OPEN = 1;
const WS_READY_STATE_CLOSING = 2;
/**
* Closes a WebSocket connection safely without throwing exceptions.
* @param {import("@cloudflare/workers-types").WebSocket} socket The WebSocket connection to close.
*/
function safeCloseWebSocket(socket) {
try {
if (socket.readyState === WS_READY_STATE_OPEN || socket.readyState === WS_READY_STATE_CLOSING) {
socket.close();
}
} catch (error) {
console.error('safeCloseWebSocket error', error);
}
}
const byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 256).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}
function stringify(arr, offset = 0) {
const uuid = unsafeStringify(arr, offset);
if (!isValidUUID(uuid)) {
throw TypeError("Stringified UUID is invalid");
}
return uuid;
}
/**
* Handles outbound UDP traffic by transforming the data into DNS queries and sending them over a WebSocket connection.
* @param {import("@cloudflare/workers-types").WebSocket} webSocket The WebSocket connection to send the DNS queries over.
* @param {ArrayBuffer} vlessResponseHeader The VLESS response header.
* @param {(string) => void} log The logging function.
* @returns {{write: (chunk: Uint8Array) => void}} An object with a write method that accepts a Uint8Array chunk to write to the transform stream.
*/
async function handleUDPOutBound(webSocket, vlessResponseHeader, log) {
let isVlessHeaderSent = false;
const transformStream = new TransformStream({
start(controller) {
},
transform(chunk, controller) {
// udp message 2 byte is the the length of udp data
// TODO: this should have bug, beacsue maybe udp chunk can be in two websocket message
for (let index = 0; index < chunk.byteLength;) {
const lengthBuffer = chunk.slice(index, index + 2);
const udpPakcetLength = new DataView(lengthBuffer).getUint16(0);
const udpData = new Uint8Array(
chunk.slice(index + 2, index + 2 + udpPakcetLength)
);
index = index + 2 + udpPakcetLength;
controller.enqueue(udpData);
}
},
flush(controller) {
}
});
// only handle dns udp for now
transformStream.readable.pipeTo(new WritableStream({
async write(chunk) {
const resp = await fetch(dohURL, // dns server url
{
method: 'POST',
headers: {
'content-type': 'application/dns-message',
},
body: chunk,
})
const dnsQueryResult = await resp.arrayBuffer();
const udpSize = dnsQueryResult.byteLength;
// console.log([...new Uint8Array(dnsQueryResult)].map((x) => x.toString(16)));
const udpSizeBuffer = new Uint8Array([(udpSize >> 8) & 0xff, udpSize & 0xff]);
if (webSocket.readyState === WS_READY_STATE_OPEN) {
log(`doh success and dns message length is ${udpSize}`);
if (isVlessHeaderSent) {
webSocket.send(await new Blob([udpSizeBuffer, dnsQueryResult]).arrayBuffer());
} else {
webSocket.send(await new Blob([vlessResponseHeader, udpSizeBuffer, dnsQueryResult]).arrayBuffer());
isVlessHeaderSent = true;
}
}
}
})).catch((error) => {
log('dns udp has error' + error)
});
const writer = transformStream.writable.getWriter();
return {
/**
*
* @param {Uint8Array} chunk
*/
write(chunk) {
writer.write(chunk);
}
};
}
/**
*
* @param {string} userID - single or comma separated userIDs
* @param {string | null} hostName
* @returns {string}
*/
function getVLESSConfig(userIDs, hostName) {
const commonUrlPart = `:443?encryption=none&security=tls&sni=${hostName}&fp=randomized&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#${hostName}`;
const hashSeparator = "################################################################";
// Split the userIDs into an array
const userIDArray = userIDs.split(",");
// Prepare output string for each userID
const output = userIDArray.map((userID) => {
const vlessMain = `vless://${userID}@${hostName}${commonUrlPart}`;
const vlessSec = `vless://${userID}@${proxyIP}${commonUrlPart}`;
return `<h2>UUID: ${userID}</h2>${hashSeparator}\nv2ray default ip
---------------------------------------------------------------
${vlessMain}
<button onclick='copyToClipboard("${vlessMain}")'><i class="fa fa-clipboard"></i> Copy vlessMain</button>
---------------------------------------------------------------
v2ray with bestip
---------------------------------------------------------------
${vlessSec}
<button onclick='copyToClipboard("${vlessSec}")'><i class="fa fa-clipboard"></i> Copy vlessSec</button>
---------------------------------------------------------------`;
}).join('\n');
const sublink = `https://${hostName}/sub/${userIDArray[0]}?format=clash`
const subbestip = `https://${hostName}/bestip/${userIDArray[0]}`;
const clash_link = `https://api.v1.mk/sub?target=clash&url=${encodeURIComponent(sublink)}&insert=false&emoji=true&list=false&tfo=false&scv=true&fdn=false&sort=false&new_name=true`;
// Prepare header string
const header = `
<p align='center'><img src='https://cloudflare-ipfs.com/ipfs/bafybeigd6i5aavwpr6wvnwuyayklq3omonggta4x2q7kpmgafj357nkcky' alt='图片描述' style='margin-bottom: -50px;'>
<b style='font-size: 15px;'>Welcome! This function generates configuration for VLESS protocol. If you found this useful, please check our GitHub project for more:</b>
<b style='font-size: 15px;'>欢迎!这是生成 VLESS 协议的配置。如果您发现这个项目很好用,请查看我们的 GitHub 项目给我一个star:</b>
<a href='https://github.com/3Kmfi6HP/EDtunnel' target='_blank'>EDtunnel - https://github.com/3Kmfi6HP/EDtunnel</a>
<iframe src='https://ghbtns.com/github-btn.html?user=USERNAME&repo=REPOSITORY&type=star&count=true&size=large' frameborder='0' scrolling='0' width='170' height='30' title='GitHub'></iframe>
<a href='//${hostName}/sub/${userIDArray[0]}' target='_blank'>VLESS 节点订阅连接</a>
<a href='clash://install-config?url=${encodeURIComponent(`https://${hostName}/sub/${userIDArray[0]}?format=clash`)}}' target='_blank'>Clash for Windows 节点订阅连接</a>
<a href='${clash_link}' target='_blank'>Clash 节点订阅连接</a>
<a href='${subbestip}' target='_blank'>优选IP自动节点订阅</a>
<a href='clash://install-config?url=${encodeURIComponent(subbestip)}' target='_blank'>Clash优选IP自动</a>
<a href='sing-box://import-remote-profile?url=${encodeURIComponent(subbestip)}' target='_blank'>singbox优选IP自动</a>
<a href='sn://subscription?url=${encodeURIComponent(subbestip)}' target='_blank'>nekobox优选IP自动</a>
<a href='v2rayng://install-config?url=${encodeURIComponent(subbestip)}' target='_blank'>v2rayNG优选IP自动</a></p>`;
// HTML Head with CSS and FontAwesome library
const htmlHead = `
<head>
<title>EDtunnel: VLESS configuration</title>
<meta name='description' content='This is a tool for generating VLESS protocol configurations. Give us a star on GitHub https://github.com/3Kmfi6HP/EDtunnel if you found it useful!'>
<meta name='keywords' content='EDtunnel, cloudflare pages, cloudflare worker, severless'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta property='og:site_name' content='EDtunnel: VLESS configuration' />
<meta property='og:type' content='website' />
<meta property='og:title' content='EDtunnel - VLESS configuration and subscribe output' />
<meta property='og:description' content='Use cloudflare pages and worker severless to implement vless protocol' />
<meta property='og:url' content='https://${hostName}/' />
<meta property='og:image' content='https://api.qrserver.com/v1/create-qr-code/?size=500x500&data=${encodeURIComponent(`vless://${userIDs.split(",")[0]}@${hostName}${commonUrlPart}`)}' />
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:title' content='EDtunnel - VLESS configuration and subscribe output' />
<meta name='twitter:description' content='Use cloudflare pages and worker severless to implement vless protocol' />
<meta name='twitter:url' content='https://${hostName}/' />
<meta name='twitter:image' content='https://cloudflare-ipfs.com/ipfs/bafybeigd6i5aavwpr6wvnwuyayklq3omonggta4x2q7kpmgafj357nkcky' />
<meta property='og:image:width' content='1500' />
<meta property='og:image:height' content='1500' />
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
color: #333;
padding: 10px;
}
a {
color: #1a0dab;
text-decoration: none;
}
img {
max-width: 100%;
height: auto;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
background-color: #fff;
border: 1px solid #ddd;
padding: 15px;
margin: 10px 0;
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
body {
background-color: #333;
color: #f0f0f0;
}
a {
color: #9db4ff;
}
pre {
background-color: #282a36;
border-color: #6272a4;
}
}
</style>
<!-- Add FontAwesome library -->
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'>
</head>
`;
// Join output with newlines, wrap inside <html> and <body>
return `
<html>
${htmlHead}
<body>
<pre style='background-color: transparent; border: none;'>${header}</pre>
<pre>${output}</pre>
</body>
<script>
function copyToClipboard(text) {
navigator.clipboard.writeText(text)
.then(() => {
alert("Copied to clipboard");
})
.catch((err) => {
console.error("Failed to copy to clipboard:", err);
});
}
</script>
</html>`;
}
const portSet_http = new Set([80, 8080, 8880, 2052, 2086, 2095, 2082]);
const portSet_https = new Set([443, 8443, 2053, 2096, 2087, 2083]);
function createVLESSSub(userID_Path, hostName) {
const userIDArray = userID_Path.includes(',') ? userID_Path.split(',') : [userID_Path];
const commonUrlPart_http = `?encryption=none&security=none&fp=random&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#`;
const commonUrlPart_https = `?encryption=none&security=tls&sni=${hostName}&fp=random&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#`;
const output = userIDArray.flatMap((userID) => {
const httpConfigurations = Array.from(portSet_http).flatMap((port) => {
if (!hostName.includes('pages.dev')) {
const urlPart = `${hostName}-HTTP-${port}`;
const vlessMainHttp = `vless://${userID}@${hostName}:${port}${commonUrlPart_http}${urlPart}`;
return proxyIPs.flatMap((proxyIP) => {
const vlessSecHttp = `vless://${userID}@${proxyIP}:${port}${commonUrlPart_http}${urlPart}-${proxyIP}-EDtunnel`;
return [vlessMainHttp, vlessSecHttp];
});
}
return [];
});
const httpsConfigurations = Array.from(portSet_https).flatMap((port) => {
const urlPart = `${hostName}-HTTPS-${port}`;
const vlessMainHttps = `vless://${userID}@${hostName}:${port}${commonUrlPart_https}${urlPart}`;
return proxyIPs.flatMap((proxyIP) => {
const vlessSecHttps = `vless://${userID}@${proxyIP}:${port}${commonUrlPart_https}${urlPart}-${proxyIP}-EDtunnel`;
return [vlessMainHttps, vlessSecHttps];
});
});
return [...httpConfigurations, ...httpsConfigurations];
});
return output.join('\n');
}
const cn_hostnames = [
'weibo.com', // Weibo - A popular social media platform
'www.baidu.com', // Baidu - The largest search engine in China
'www.qq.com', // QQ - A widely used instant messaging platform
'www.taobao.com', // Taobao - An e-commerce website owned by Alibaba Group
'www.jd.com', // JD.com - One of the largest online retailers in China
'www.sina.com.cn', // Sina - A Chinese online media company
'www.sohu.com', // Sohu - A Chinese internet service provider
'www.tmall.com', // Tmall - An online retail platform owned by Alibaba Group
'www.163.com', // NetEase Mail - One of the major email providers in China
'www.zhihu.com', // Zhihu - A popular question-and-answer website
'www.youku.com', // Youku - A Chinese video sharing platform
'www.xinhuanet.com', // Xinhua News Agency - Official news agency of China
'www.douban.com', // Douban - A Chinese social networking service
'www.meituan.com', // Meituan - A Chinese group buying website for local services
'www.toutiao.com', // Toutiao - A news and information content platform
'www.ifeng.com', // iFeng - A popular news website in China
'www.autohome.com.cn', // Autohome - A leading Chinese automobile online platform
'www.360.cn', // 360 - A Chinese internet security company
'www.douyin.com', // Douyin - A Chinese short video platform
'www.kuaidi100.com', // Kuaidi100 - A Chinese express delivery tracking service
'www.wechat.com', // WeChat - A popular messaging and social media app
'www.csdn.net', // CSDN - A Chinese technology community website
'www.imgo.tv', // ImgoTV - A Chinese live streaming platform
'www.aliyun.com', // Alibaba Cloud - A Chinese cloud computing company
'www.eyny.com', // Eyny - A Chinese multimedia resource-sharing website
'www.mgtv.com', // MGTV - A Chinese online video platform
'www.xunlei.com', // Xunlei - A Chinese download manager and torrent client
'www.hao123.com', // Hao123 - A Chinese web directory service
'www.bilibili.com', // Bilibili - A Chinese video sharing and streaming platform
'www.youth.cn', // Youth.cn - A China Youth Daily news portal
'www.hupu.com', // Hupu - A Chinese sports community and forum
'www.youzu.com', // Youzu Interactive - A Chinese game developer and publisher
'www.panda.tv', // Panda TV - A Chinese live streaming platform
'www.tudou.com', // Tudou - A Chinese video-sharing website
'www.zol.com.cn', // ZOL - A Chinese electronics and gadgets website
'www.toutiao.io', // Toutiao - A news and information app
'www.tiktok.com', // TikTok - A Chinese short-form video app
'www.netease.com', // NetEase - A Chinese internet technology company
'www.cnki.net', // CNKI - China National Knowledge Infrastructure, an information aggregator
'www.zhibo8.cc', // Zhibo8 - A website providing live sports streams
'www.zhangzishi.cc', // Zhangzishi - Personal website of Zhang Zishi, a public intellectual in China
'www.xueqiu.com', // Xueqiu - A Chinese online social platform for investors and traders
'www.qqgongyi.com', // QQ Gongyi - Tencent's charitable foundation platform
'www.ximalaya.com', // Ximalaya - A Chinese online audio platform
'www.dianping.com', // Dianping - A Chinese online platform for finding and reviewing local businesses
'www.suning.com', // Suning - A leading Chinese online retailer
'www.zhaopin.com', // Zhaopin - A Chinese job recruitment platform
'www.jianshu.com', // Jianshu - A Chinese online writing platform
'www.mafengwo.cn', // Mafengwo - A Chinese travel information sharing platform
'www.51cto.com', // 51CTO - A Chinese IT technical community website
'www.qidian.com', // Qidian - A Chinese web novel platform
'www.ctrip.com', // Ctrip - A Chinese travel services provider
'www.pconline.com.cn', // PConline - A Chinese technology news and review website
'www.cnzz.com', // CNZZ - A Chinese web analytics service provider
'www.telegraph.co.uk', // The Telegraph - A British newspaper website
'www.ynet.com', // Ynet - A Chinese news portal
'www.ted.com', // TED - A platform for ideas worth spreading
'www.renren.com', // Renren - A Chinese social networking service
'www.pptv.com', // PPTV - A Chinese online video streaming platform
'www.liepin.com', // Liepin - A Chinese online recruitment website
'www.881903.com', // 881903 - A Hong Kong radio station website
'www.aipai.com', // Aipai - A Chinese online video sharing platform
'www.ttpaihang.com', // Ttpaihang - A Chinese celebrity popularity ranking website
'www.quyaoya.com', // Quyaoya - A Chinese online ticketing platform
'www.91.com', // 91.com - A Chinese software download website
'www.dianyou.cn', // Dianyou - A Chinese game information website
'www.tmtpost.com', // TMTPost - A Chinese technology media platform
'www.douban.com', // Douban - A Chinese social networking service
'www.guancha.cn', // Guancha - A Chinese news and commentary website
'www.so.com', // So.com - A Chinese search engine
'www.58.com', // 58.com - A Chinese classified advertising website
'www.cnblogs.com', // Cnblogs - A Chinese technology blog community
'www.cntv.cn', // CCTV - China Central Television official website
'www.secoo.com', // Secoo - A Chinese luxury e-commerce platform
];
|
4c7785c114b28d3ccce46453560adf6f
|
{
"intermediate": 0.3648295998573303,
"beginner": 0.37717825174331665,
"expert": 0.257992148399353
}
|
45,172
|
Create a lua POST http request
|
154e2e632a07902d73f817e70059dd60
|
{
"intermediate": 0.3613714575767517,
"beginner": 0.232473224401474,
"expert": 0.4061552882194519
}
|
45,173
|
I am making a c++ sdl based game engine, and currently finishing the EventManager class, which implements a pub/sub pattern to publish subscribe and dispatch events. Currently I have made every event polled by SDL, which are the events provided by my engine a priority number based on other talks I had with other instances of you, and we ended up defining all the priorities according to which is more immediate to deal with first. But here comes the problem, when we talked last time and asked you of an evaluation of my system you said this:
### Considerations for Optimization
1. Broad Range for Medium Priority:
- While it’s good to have a broad range in the medium category, ensure there’s enough distinction between event types to justify their priority levels. For gameplay critical events, consider whether some of these could benefit from being placed higher or closer together to reflect their impact on game mechanics or player experience more accurately.
2. Handling of Mouse and Touch Events:
- SDL_MOUSEMOTION, SDL_FINGERMOTION, SDL_FINGERDOWN, and SDL_FINGERUP events are categorized as low priority. Depending on your game’s nature, especially in a touch-based game or where precise mouse control is crucial, you might need to reconsider their priorities to ensure responsive feedback to the player.
3. Gamepad and Joystick Prioritization:
- Gamepad and joystick events are spread across high, medium, and low priorities depending on the action (button down/up, device added/removed, etc.). While this makes sense from an organizational perspective, consider the gameplay experience and whether input lag for these devices could affect game dynamics or player satisfaction.
### Suggestions for Improvement
- Dynamic Priority Adjustment:
Consider implementing a system within your event manager to dynamically adjust the priority of certain types of events based on the current game state. For example, during critical gameplay moments, input-related events could temporarily be given higher priority to ensure responsive control.
- Event Grouping by Game State:
Think about creating categories or groups of events based on the current game state or scene. For instance, certain events might be more relevant or should be prioritized during gameplay scenes vs. menu navigation.
- Customizable Priority Levels:
Offer developers using your engine the ability to customize event priorities based on their particular needs. This could be implemented by allowing subscription handlers to specify a priority modifier or by allowing global adjustment of event priority scales.
- Review Low-Priority Event Handling:
Reassess whether low-priority events could cause noticeable delays in less interactive scenes (e.g., game menus or inventory screens). It might be beneficial to adjust their processing based on context to maintain a seamless user experience.
### Final Thoughts
Your list demonstrates a strong foundational understanding of prioritizing events in a game environment. However, always remain open to adjustments as real-world usage and testing may reveal unforeseen needs or opportunities for refinement. Tailoring the event priority system to be adaptive and responsive to the game’s context and current state can significantly enhance both performance and player experience.
Considering I am in an early stage of development, should I take these consideration now and implement something now that it is the time I am developing the EventManager or should I keep this as a TODO for the future?
|
800db8f2d1b524c2887c63fcd074ba8d
|
{
"intermediate": 0.37184953689575195,
"beginner": 0.27094390988349915,
"expert": 0.3572065234184265
}
|
45,174
|
How do I specify multiple executables in a single dune file in ocaml?
|
b97b9601a34633de66b02625364d0a01
|
{
"intermediate": 0.5185608863830566,
"beginner": 0.17942224442958832,
"expert": 0.30201688408851624
}
|
45,175
|
I'm using Cinema 4D 2024, I have a plane and plain effector as a deformer (affecting polygons). I added formula field plain deformer. Plain deformer has Y+ position 20. I would like to create ripple effect on plane. Can you provide me formula code?
|
a6da038d89458359dae0268a70c4d8a0
|
{
"intermediate": 0.47944146394729614,
"beginner": 0.23773610591888428,
"expert": 0.2828224003314972
}
|
45,176
|
voici un carousel en liquid de shopify, adapte le en utilisant swiper js
{{ 'section-image-banner.css' | asset_url | stylesheet_tag }}
{{ 'component-slider.css' | asset_url | stylesheet_tag }}
{{ 'component-slideshow.css' | asset_url | stylesheet_tag }}
{%- if section.settings.slide_height == 'adapt_image' and section.blocks.first.settings.image != blank -%}
{%- style -%}
@media screen and (max-width: 749px) {
#Slider-{{ section.id }}::before,
#Slider-{{ section.id }} .media::before,
#Slider-{{ section.id }}:not(.banner--mobile-bottom) .banner__content::before {
padding-bottom: {{ 1 | divided_by: section.blocks.first.settings.image.aspect_ratio | times: 100 }}%;
content: '';
display: block;
}
}
@media screen and (min-width: 750px) {
#Slider-{{ section.id }}::before,
#Slider-{{ section.id }} .media::before {
padding-bottom: {{ 1 | divided_by: section.blocks.first.settings.image.aspect_ratio | times: 100 }}%;
content: '';
display: block;
}
}
{%- endstyle -%}
{%- endif -%}
<slideshow-component
class="slider-mobile-gutter{% if section.settings.layout == 'grid' %} page-width{% endif %}{% if section.settings.show_text_below %} mobile-text-below{% endif %}"
role="region"
aria-roledescription="{{ 'sections.slideshow.carousel' | t }}"
aria-label="{{ section.settings.accessibility_info | escape }}"
>
{%- if section.settings.auto_rotate and section.blocks.size > 1 -%}
<div class="slideshow__controls slideshow__controls--top slider-buttons no-js-hidden{% if section.settings.show_text_below %} slideshow__controls--border-radius-mobile{% endif %}">
<button
type="button"
class="slider-button slider-button--prev"
name="previous"
aria-label="{{ 'sections.slideshow.previous_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
<div class="slider-counter slider-counter--{{ section.settings.slider_visual }}{% if section.settings.slider_visual == 'counter' or section.settings.slider_visual == 'numbers' %} caption{% endif %}">
{%- if section.settings.slider_visual == 'counter' -%}
<span class="slider-counter--current">1</span>
<span aria-hidden="true"> / </span>
<span class="visually-hidden">{{ 'general.slider.of' | t }}</span>
<span class="slider-counter--total">{{ section.blocks.size }}</span>
{%- else -%}
<div class="slideshow__control-wrapper">
{%- for block in section.blocks -%}
<button
class="slider-counter__link slider-counter__link--{{ section.settings.slider_visual }} link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
aria-controls="Slider-{{ section.id }}"
>
{%- if section.settings.slider_visual == 'numbers' -%}
{{ forloop.index -}}
{%- else -%}
<span class="dot"></span>
{%- endif -%}
</button>
{%- endfor -%}
</div>
{%- endif -%}
</div>
<button
type="button"
class="slider-button slider-button--next"
name="next"
aria-label="{{ 'sections.slideshow.next_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
{%- if section.settings.auto_rotate -%}
<button
type="button"
class="slideshow__autoplay slider-button no-js-hidden{% if section.settings.auto_rotate == false %} slideshow__autoplay--paused{% endif %}"
aria-label="{{ 'sections.slideshow.pause_slideshow' | t }}"
>
{%- render 'icon-pause' -%}
{%- render 'icon-play' -%}
</button>
{%- endif -%}
</div>
<noscript>
<div class="slider-buttons">
<div class="slider-counter">
{%- for block in section.blocks -%}
<a
href="#Slide-{{ section.id }}-{{ forloop.index }}"
class="slider-counter__link link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
>
{{ forloop.index }}
</a>
{%- endfor -%}
</div>
</div>
</noscript>
{%- endif -%}
<div
class="slideshow banner banner--{{ section.settings.slide_height }} grid grid--1-col slider slider--everywhere{% if section.settings.show_text_below %} banner--mobile-bottom{% endif %}{% if section.blocks.first.settings.image == blank %} slideshow--placeholder{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"
id="Slider-{{ section.id }}"
aria-live="polite"
aria-atomic="true"
data-autoplay="{{ section.settings.auto_rotate }}"
data-speed="{{ section.settings.change_slides_speed }}"
>
{%- for block in section.blocks -%}
<style>
#Slide-{{ section.id }}-{{ forloop.index }} .banner__media::after {
opacity: {{ block.settings.image_overlay_opacity | divided_by: 100.0 }};
}
</style>
<div
class="slideshow__slide grid__item grid--1-col slider__slide"
id="Slide-{{ section.id }}-{{ forloop.index }}"
{{ block.shopify_attributes }}
role="group"
aria-roledescription="{{ 'sections.slideshow.slide' | t }}"
aria-label="{{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
tabindex="-1"
>
<div class="slideshow__media banner__media media{% if block.settings.image == blank %} placeholder{% endif %}{% if section.settings.image_behavior != 'none' %} animate--{{ section.settings.image_behavior }}{% endif %}">
{%- if block.settings.image -%}
{%- liquid
assign height = block.settings.image.width | divided_by: block.settings.image.aspect_ratio | round
if section.settings.image_behavior == 'ambient'
assign sizes = '120vw'
assign widths = '450, 660, 900, 1320, 1800, 2136, 2400, 3600, 7680'
else
assign sizes = '100vw'
assign widths = '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840'
endif
assign fetch_priority = 'auto'
if section.index == 1
assign fetch_priority = 'high'
endif
-%}
{%- if forloop.first %}
{{
block.settings.image
| image_url: width: 3840
| image_tag: height: height, sizes: sizes, widths: widths, fetchpriority: fetch_priority
}}
{%- else -%}
{{
block.settings.image
| image_url: width: 3840
| image_tag: loading: 'lazy', height: height, sizes: sizes, widths: widths
}}
{%- endif -%}
{%- else -%}
{%- assign placeholder_slide = forloop.index | modulo: 2 -%}
{%- if placeholder_slide == 1 -%}
{{ 'hero-apparel-2' | placeholder_svg_tag: 'placeholder-svg' }}
{%- else -%}
{{ 'hero-apparel-1' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%}
{%- endif -%}
</div>
<div class="slideshow__text-wrapper banner__content banner__content--{{ block.settings.box_align }} page-width{% if block.settings.show_text_box == false %} banner--desktop-transparent{% endif %}{% if settings.animations_reveal_on_scroll and forloop.index == 1 %} scroll-trigger animate--slide-in{% endif %}">
<div class="slideshow__text banner__box content-container content-container--full-width-mobile color-{{ block.settings.color_scheme }} gradient slideshow__text--{{ block.settings.text_alignment }} slideshow__text-mobile--{{ block.settings.text_alignment_mobile }}">
{%- if block.settings.heading != blank -%}
<h2 class="banner__heading inline-richtext {{ block.settings.heading_size }}">
{{ block.settings.heading }}
</h2>
{%- endif -%}
{%- if block.settings.subheading != blank -%}
<div class="banner__text rte" {{ block.shopify_attributes }}>
<p>{{ block.settings.subheading }}</p>
</div>
{%- endif -%}
{%- if block.settings.button_label != blank -%}
<div class="banner__buttons">
<a
{% if block.settings.link %}
href="{{ block.settings.link }}"
{% else %}
role="link" aria-disabled="true"
{% endif %}
class="button {% if block.settings.button_style_secondary %}button--secondary{% else %}button--primary{% endif %}"
>
{{- block.settings.button_label | escape -}}
</a>
</div>
{%- endif -%}
</div>
</div>
</div>
{%- endfor -%}
</div>
{%- if section.blocks.size > 1 and section.settings.auto_rotate == false -%}
<div class="slideshow__controls slider-buttons no-js-hidden{% if section.settings.show_text_below %} slideshow__controls--border-radius-mobile{% endif %}">
<button
type="button"
class="slider-button slider-button--prev"
name="previous"
aria-label="{{ 'sections.slideshow.previous_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
<div class="slider-counter slider-counter--{{ section.settings.slider_visual }}{% if section.settings.slider_visual == 'counter' or section.settings.slider_visual == 'numbers' %} caption{% endif %}">
{%- if section.settings.slider_visual == 'counter' -%}
<span class="slider-counter--current">1</span>
<span aria-hidden="true"> / </span>
<span class="visually-hidden">{{ 'general.slider.of' | t }}</span>
<span class="slider-counter--total">{{ section.blocks.size }}</span>
{%- else -%}
<div class="slideshow__control-wrapper">
{%- for block in section.blocks -%}
<button
class="slider-counter__link slider-counter__link--{{ section.settings.slider_visual }} link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
aria-controls="Slider-{{ section.id }}"
>
{%- if section.settings.slider_visual == 'numbers' -%}
{{ forloop.index -}}
{%- else -%}
<span class="dot"></span>
{%- endif -%}
</button>
{%- endfor -%}
</div>
{%- endif -%}
</div>
<button
type="button"
class="slider-button slider-button--next"
name="next"
aria-label="{{ 'sections.slideshow.next_slideshow' | t }}"
aria-controls="Slider-{{ section.id }}"
>
{% render 'icon-caret' %}
</button>
{%- if section.settings.auto_rotate -%}
<button
type="button"
class="slideshow__autoplay slider-button no-js-hidden{% if section.settings.auto_rotate == false %} slideshow__autoplay--paused{% endif %}"
aria-label="{{ 'sections.slideshow.pause_slideshow' | t }}"
>
{%- render 'icon-pause' -%}
{%- render 'icon-play' -%}
</button>
{%- endif -%}
</div>
<noscript>
<div class="slider-buttons">
<div class="slider-counter">
{%- for block in section.blocks -%}
<a
href="#Slide-{{ section.id }}-{{ forloop.index }}"
class="slider-counter__link link"
aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}"
>
{{ forloop.index }}
</a>
{%- endfor -%}
</div>
</div>
</noscript>
{%- endif -%}
</slideshow-component>
{%- if request.design_mode -%}
<script src="{{ 'theme-editor.js' | asset_url }}" defer="defer"></script>
{%- endif -%}
{% schema %}
{
"name": "t:sections.slideshow.name",
"tag": "section",
"class": "section",
"disabled_on": {
"groups": ["header", "footer"]
},
"settings": [
{
"type": "select",
"id": "layout",
"options": [
{
"value": "full_bleed",
"label": "t:sections.slideshow.settings.layout.options__1.label"
},
{
"value": "grid",
"label": "t:sections.slideshow.settings.layout.options__2.label"
}
],
"default": "full_bleed",
"label": "t:sections.slideshow.settings.layout.label"
},
{
"type": "select",
"id": "slide_height",
"options": [
{
"value": "adapt_image",
"label": "t:sections.slideshow.settings.slide_height.options__1.label"
},
{
"value": "small",
"label": "t:sections.slideshow.settings.slide_height.options__2.label"
},
{
"value": "medium",
"label": "t:sections.slideshow.settings.slide_height.options__3.label"
},
{
"value": "large",
"label": "t:sections.slideshow.settings.slide_height.options__4.label"
}
],
"default": "medium",
"label": "t:sections.slideshow.settings.slide_height.label"
},
{
"type": "select",
"id": "slider_visual",
"options": [
{
"value": "dots",
"label": "t:sections.slideshow.settings.slider_visual.options__2.label"
},
{
"value": "counter",
"label": "t:sections.slideshow.settings.slider_visual.options__1.label"
},
{
"value": "numbers",
"label": "t:sections.slideshow.settings.slider_visual.options__3.label"
}
],
"default": "counter",
"label": "t:sections.slideshow.settings.slider_visual.label"
},
{
"type": "checkbox",
"id": "auto_rotate",
"label": "t:sections.slideshow.settings.auto_rotate.label",
"default": false
},
{
"type": "range",
"id": "change_slides_speed",
"min": 3,
"max": 9,
"step": 2,
"unit": "s",
"label": "t:sections.slideshow.settings.change_slides_speed.label",
"default": 5
},
{
"type": "header",
"content": "t:sections.all.animation.content"
},
{
"type": "select",
"id": "image_behavior",
"options": [
{
"value": "none",
"label": "t:sections.all.animation.image_behavior.options__1.label"
},
{
"value": "ambient",
"label": "t:sections.all.animation.image_behavior.options__2.label"
}
],
"default": "none",
"label": "t:sections.all.animation.image_behavior.label"
},
{
"type": "header",
"content": "t:sections.slideshow.settings.mobile.content"
},
{
"type": "checkbox",
"id": "show_text_below",
"label": "t:sections.slideshow.settings.show_text_below.label",
"default": true
},
{
"type": "header",
"content": "t:sections.slideshow.settings.accessibility.content"
},
{
"type": "text",
"id": "accessibility_info",
"label": "t:sections.slideshow.settings.accessibility.label",
"info": "t:sections.slideshow.settings.accessibility.info",
"default": "Slideshow about our brand"
}
],
"blocks": [
{
"type": "slide",
"name": "t:sections.slideshow.blocks.slide.name",
"limit": 5,
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "t:sections.slideshow.blocks.slide.settings.image.label"
},
{
"type": "inline_richtext",
"id": "heading",
"default": "Image slide",
"label": "t:sections.slideshow.blocks.slide.settings.heading.label"
},
{
"type": "select",
"id": "heading_size",
"options": [
{
"value": "h2",
"label": "t:sections.all.heading_size.options__1.label"
},
{
"value": "h1",
"label": "t:sections.all.heading_size.options__2.label"
},
{
"value": "h0",
"label": "t:sections.all.heading_size.options__3.label"
}
],
"default": "h1",
"label": "t:sections.all.heading_size.label"
},
{
"type": "inline_richtext",
"id": "subheading",
"default": "Tell your brand's story through images",
"label": "t:sections.slideshow.blocks.slide.settings.subheading.label"
},
{
"type": "text",
"id": "button_label",
"default": "Button label",
"label": "t:sections.slideshow.blocks.slide.settings.button_label.label",
"info": "t:sections.slideshow.blocks.slide.settings.button_label.info"
},
{
"type": "url",
"id": "link",
"label": "t:sections.slideshow.blocks.slide.settings.link.label"
},
{
"type": "checkbox",
"id": "button_style_secondary",
"label": "t:sections.slideshow.blocks.slide.settings.secondary_style.label",
"default": false
},
{
"type": "select",
"id": "box_align",
"options": [
{
"value": "top-left",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__1.label"
},
{
"value": "top-center",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__2.label"
},
{
"value": "top-right",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__3.label"
},
{
"value": "middle-left",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__4.label"
},
{
"value": "middle-center",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__5.label"
},
{
"value": "middle-right",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__6.label"
},
{
"value": "bottom-left",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__7.label"
},
{
"value": "bottom-center",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__8.label"
},
{
"value": "bottom-right",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.options__9.label"
}
],
"default": "middle-center",
"label": "t:sections.slideshow.blocks.slide.settings.box_align.label",
"info": "t:sections.slideshow.blocks.slide.settings.box_align.info"
},
{
"type": "checkbox",
"id": "show_text_box",
"label": "t:sections.slideshow.blocks.slide.settings.show_text_box.label",
"default": true
},
{
"type": "select",
"id": "text_alignment",
"options": [
{
"value": "left",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment.option_1.label"
},
{
"value": "center",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment.option_2.label"
},
{
"value": "right",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment.option_3.label"
}
],
"default": "center",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment.label"
},
{
"type": "range",
"id": "image_overlay_opacity",
"min": 0,
"max": 100,
"step": 10,
"unit": "%",
"label": "t:sections.slideshow.blocks.slide.settings.image_overlay_opacity.label",
"default": 0
},
{
"type": "color_scheme",
"id": "color_scheme",
"label": "t:sections.all.colors.label",
"default": "scheme-1"
},
{
"type": "header",
"content": "t:sections.slideshow.settings.mobile.content"
},
{
"type": "select",
"id": "text_alignment_mobile",
"options": [
{
"value": "left",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment_mobile.options__1.label"
},
{
"value": "center",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment_mobile.options__2.label"
},
{
"value": "right",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment_mobile.options__3.label"
}
],
"default": "center",
"label": "t:sections.slideshow.blocks.slide.settings.text_alignment_mobile.label"
}
]
}
],
"presets": [
{
"name": "t:sections.slideshow.presets.name",
"blocks": [
{
"type": "slide"
},
{
"type": "slide"
}
]
}
]
}
{% endschema %}
|
342e3c83e6b66a2355747c91b4dfd515
|
{
"intermediate": 0.22899873554706573,
"beginner": 0.4965468645095825,
"expert": 0.27445438504219055
}
|
45,177
|
Assuming you are a CDO of a Ride Share company, can you create a data model (star schema) of ride share related products?
|
6ac9188b8cc1ba74cb68ad8faf3a9778
|
{
"intermediate": 0.42955055832862854,
"beginner": 0.2241813689470291,
"expert": 0.3462681174278259
}
|
45,178
|
Build a freqtrade freqai model builder for trading with freqtrade.
|
79d1f0787dd5fc2bc20b71f30d417289
|
{
"intermediate": 0.35438814759254456,
"beginner": 0.17515571415424347,
"expert": 0.4704560935497284
}
|
45,179
|
Docker compose for service wordpress, mysql server web apache
|
58696fa97a51fd12b58facf93d3d4a7c
|
{
"intermediate": 0.5726459622383118,
"beginner": 0.2033008188009262,
"expert": 0.2240532636642456
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.