row_id
int64 0
48.4k
| init_message
stringlengths 1
342k
| conversation_hash
stringlengths 32
32
| scores
dict |
|---|---|---|---|
41,360
|
mounted() {
if (this.loginForm.username === '') {
(this.$refs.username as Input).focus()
} else if (this.loginForm.password === '') {
(this.$refs.password as Input).focus()
}
}
ะฟะตัะตะฟะธัะฐัั ะฝะฐ vue 3 composition api
|
8e42e4976b9fa46fe194fd98f199ead6
|
{
"intermediate": 0.37385421991348267,
"beginner": 0.3516604006290436,
"expert": 0.27448534965515137
}
|
41,361
|
ะะพั ะผะพะน ะบะพะด ะดะปั ัะธััะตะผั ะฟะพะดะฒะตัะบะธ ะผะฐัะธะฝ ะฒ roblox:
|
8269f17afb0a7086fc8ddfb109570b56
|
{
"intermediate": 0.3053695559501648,
"beginner": 0.27453693747520447,
"expert": 0.4200935363769531
}
|
41,362
|
Hi
|
36bb9eee04ebaa23690027191ea3671d
|
{
"intermediate": 0.33010533452033997,
"beginner": 0.26984941959381104,
"expert": 0.400045245885849
}
|
41,363
|
Give an example of simple threaded queue processing in Python
|
4847c3b8205763e64679b0891c2eee24
|
{
"intermediate": 0.6708381772041321,
"beginner": 0.0692652016878128,
"expert": 0.2598966062068939
}
|
41,364
|
telebon send json as formatted message
|
758d3aa3409bf7f5c2677b64f4750736
|
{
"intermediate": 0.32031238079071045,
"beginner": 0.28576916456222534,
"expert": 0.3939184546470642
}
|
41,365
|
shape mismatch tensorflow. why is that? python
|
ae73b663e2651b2b69b94762a4663cf8
|
{
"intermediate": 0.4514444172382355,
"beginner": 0.21180972456932068,
"expert": 0.3367457985877991
}
|
41,366
|
list ['x','y','z'] to string 'xyz'
|
e5157f165aaac1dc7c69b3f94ba3e002
|
{
"intermediate": 0.34611883759498596,
"beginner": 0.37837767601013184,
"expert": 0.27550357580184937
}
|
41,367
|
logs-sfs.error@custom: processors dissect in pipeline logs-sfs.error@custom failed with message Unable to find match for dissect pattern: [%{tmp.timestamp}] [%{log.level}] %{tmp.file}(%{tmp.line_number}): [client %{client.address}:%{client.port}] %{tmp.rest_of_message} against source: [Wed Mar 06 13:36:25 2024] [debug] mod_deflate.c(904): [client 10.0.0.2:46802] AH01384: Zlib: Compressed 1074 to 581 : URL /server/status.html
j'ai cette erreur :
[
{
"dissect": {
"field": "event.original",
"pattern": "\"APACHE-%{event.type}-%{service.id}-%{+service.id}-%{+service.id}-%{+service.id}-%{+service.id}-%{service.version}\"%{message}",
"append_separator": "-"
}
},
{
"dissect": {
"field": "message",
"pattern": "[%{tmp.timestamp}] [%{log.level}] %{tmp.file}(%{tmp.line_number}): [client %{client.address}:%{client.port}] %{tmp.rest_of_message}"
}
},
{
"date": {
"field": "tmp.timestamp",
"formats": [
"EEE LLL dd HH:mm:ss yyyy"
]
}
},
{
"kv": {
"field": "tmp.rest_of_message",
"field_split": " : ",
"value_split": " "
}
},
{
"remove": {
"field": "tmp"
}
}
]
> [!example]
> APACHE-ERROR-SFS-RPXD-MSS-MSS-TST-G03R04C05" [Wed Mar 06 12:56:25 2024] [debug] mod_deflate.c(904): [client 10.0.0.2:34392] AH01384: Zlib: Compressed 1074 to 581 : URL /server/status.html
|
3e25a2d0127183a6d0ce7df60a16fe33
|
{
"intermediate": 0.38670459389686584,
"beginner": 0.35693809390068054,
"expert": 0.2563572824001312
}
|
41,368
|
in the code import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
class Hotel{
int id;
String name;
String description;
String city;
String phone;
List<String> services;
int rate;
Ratings ratings;
}
class Ratings {
private int cleaning;
private int position;
private int services;
private int quality;
// Getters e setters omessi per brevitร โ devono essere inclusi
}
public class Server {
String HotelsPath ="Hotels.json";
Gson gson = new Gson();
String content;
private List<Hotel> hotels;
public Server() throws IOException{
try{
String content = new String(Files.readAllBytes(Paths.get(HotelsPath)));
Type hotelListType = new TypeToken<List<Hotel>>(){}.getType();
List<Hotel> hotels = gson.fromJson(content, hotelListType);
}
catch(IOException e){
throw e;
}
}
public static void main(String[] args){
System.out.println("ciao");
try{
Server server = new Server();
for(Hotel hotel : server.hotels){
System.out.println(hotel.name);
}
}
catch(IOException e){
e.printStackTrace();
}
}
}
i get error at line 50, why??
|
8a5fc37b5afe63c4f356a5abec03c037
|
{
"intermediate": 0.39875319600105286,
"beginner": 0.37261563539505005,
"expert": 0.2286311388015747
}
|
41,369
|
I have this React code.
return (
<DialogMessage
key={message.id}
messageId={message.id}
quoteId={message.replyId}
quoteText={message.replyText}
side={message.clientId != null ? 'left' : 'right'}
infoText={getMessageSignature({
date: +message.date * 1000,
channelName: message.channel?.name,
user: message.user,
isClientMessage: Boolean(message.clientId),
})}
highlight={message.id === scrollMessageId}
onHighlightEnd={handleHighlightEnd}
onReplyButtonClick={onReplyButtonClick}
onQuoteClick={handleQuoteClick}
avatar={message.user?.photo ?? null}
>
<a
href={`${domainStore.$domain.getState()}/storage/files/${getMediaUrl(
message.mediaUrl,
)}`}
>
ะกััะปะบะฐ ะฝะฐ ัะฐะนะป
</a>
</DialogMessage>
);
I get typescript error on message.mediaUrl 'Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.'
message.mediaUrl is an optional property so it is indeed can be undefined. How do I solve this problem?
|
d31987b4b642720845aacd16f96c2de6
|
{
"intermediate": 0.470971018075943,
"beginner": 0.36167478561401367,
"expert": 0.16735421121120453
}
|
41,370
|
import torch
import folder_paths
from PIL import Image, ImageOps
import numpy as np
import safetensors.torch
import hashlib
import os
import cv2
import os
import imageio
import shutil
from moviepy.editor import VideoFileClip, AudioFileClip
import random
import math
import json
from comfy.cli_args import args
import time
import concurrent.futures
import skbuild
YELLOW = '\33[33m'
END = '\33[0m'
# Brutally copied from comfy_extras/nodes_rebatch.py and modified
class LatentRebatch:
@staticmethod
def get_batch(latents, list_ind, offset):
'''prepare a batch out of the list of latents'''
samples = latents[list_ind]['samples']
shape = samples.shape
mask = latents[list_ind]['noise_mask'] if 'noise_mask' in latents[list_ind] else torch.ones((shape[0], 1, shape[2]*8, shape[3]*8), device='cpu')
if mask.shape[-1] != shape[-1] * 8 or mask.shape[-2] != shape[-2]:
torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(shape[-2]*8, shape[-1]*8), mode="bilinear")
if mask.shape[0] < samples.shape[0]:
mask = mask.repeat((shape[0] - 1) // mask.shape[0] + 1, 1, 1, 1)[:shape[0]]
if 'batch_index' in latents[list_ind]:
batch_inds = latents[list_ind]['batch_index']
else:
batch_inds = [x+offset for x in range(shape[0])]
return samples, mask, batch_inds
@staticmethod
def get_slices(indexable, num, batch_size):
'''divides an indexable object into num slices of length batch_size, and a remainder'''
slices = []
for i in range(num):
slices.append(indexable[i*batch_size:(i+1)*batch_size])
if num * batch_size < len(indexable):
return slices, indexable[num * batch_size:]
else:
return slices, None
@staticmethod
def slice_batch(batch, num, batch_size):
result = [LatentRebatch.get_slices(x, num, batch_size) for x in batch]
return list(zip(*result))
@staticmethod
def cat_batch(batch1, batch2):
if batch1[0] is None:
return batch2
result = [torch.cat((b1, b2)) if torch.is_tensor(b1) else b1 + b2 for b1, b2 in zip(batch1, batch2)]
return result
def rebatch(self, latents, batch_size):
batch_size = batch_size[0]
output_list = []
current_batch = (None, None, None)
processed = 0
for i in range(len(latents)):
# fetch new entry of list
#samples, masks, indices = self.get_batch(latents, i)
next_batch = self.get_batch(latents, i, processed)
processed += len(next_batch[2])
# set to current if current is None
if current_batch[0] is None:
current_batch = next_batch
# add previous to list if dimensions do not match
elif next_batch[0].shape[-1] != current_batch[0].shape[-1] or next_batch[0].shape[-2] != current_batch[0].shape[-2]:
sliced, _ = self.slice_batch(current_batch, 1, batch_size)
output_list.append({'samples': sliced[0][0], 'noise_mask': sliced[1][0], 'batch_index': sliced[2][0]})
current_batch = next_batch
# cat if everything checks out
else:
current_batch = self.cat_batch(current_batch, next_batch)
# add to list if dimensions gone above target batch size
if current_batch[0].shape[0] > batch_size:
num = current_batch[0].shape[0] // batch_size
sliced, remainder = self.slice_batch(current_batch, num, batch_size)
for i in range(num):
output_list.append({'samples': sliced[0][i], 'noise_mask': sliced[1][i], 'batch_index': sliced[2][i]})
current_batch = remainder
#add remainder
if current_batch[0] is not None:
sliced, _ = self.slice_batch(current_batch, 1, batch_size)
output_list.append({'samples': sliced[0][0], 'noise_mask': sliced[1][0], 'batch_index': sliced[2][0]})
#get rid of empty masks
for s in output_list:
if s['noise_mask'].mean() == 1.0:
del s['noise_mask']
return output_list
input_dir = os.path.join(folder_paths.get_input_directory(),"n-suite")
output_dir = os.path.join(folder_paths.get_output_directory(),"n-suite","frames_out")
temp_output_dir = os.path.join(folder_paths.get_temp_directory(),"n-suite","frames_out")
frames_output_dir = os.path.join(folder_paths.get_temp_directory(),"n-suite","frames")
videos_output_dir = os.path.join(folder_paths.get_output_directory(),"n-suite","videos")
audios_output_temp_dir = os.path.join(folder_paths.get_temp_directory(),"audio.mp3")
videos_output_temp_dir = os.path.join(folder_paths.get_temp_directory(),"video.mp4")
video_preview_output_temp_dir = os.path.join(folder_paths.get_output_directory(),"n-suite","videos")
_resize_type = ["none","width", "height"]
_framerate = ["original","half", "quarter"]
_choice = ["Yes", "No"]
try:
os.makedirs(input_dir)
except:
pass
try:
os.makedirs(output_dir)
except:
pass
try:
os.makedirs(temp_output_dir)
except:
pass
try:
os.makedirs(videos_output_dir)
except:
pass
try:
os.makedirs(frames_output_dir)
except:
pass
try:
os.makedirs(folder_paths.get_temp_directory())
except:
pass
def calc_resize_image(input_path, target_size, resize_by):
image = cv2.imread(input_path)
height, width = image.shape[:2]
if resize_by == 'width':
new_width = target_size
new_height = int(height * (target_size / width))
elif resize_by == 'height':
new_height = target_size
new_width = int(width * (target_size / height))
else:
new_height = height
new_width = width
return new_width, new_height
def resize_image(input_path, new_width, new_height):
image = cv2.imread(input_path)
height, width = image.shape[:2]
if height != new_height or width != new_width:
resized_image = cv2.resize(image, (new_width, new_height))
else:
resized_image = image
pil_image = Image.fromarray(cv2.cvtColor(resized_image, cv2.COLOR_BGR2RGB))
return pil_image
def extract_frames_from_video(video_path, output_folder, target_fps=30):
list_files = []
os.makedirs(output_folder, exist_ok=True)
cap = cv2.VideoCapture(video_path)
frame_count = 0
# Ottieni il framerate originale del video
original_fps = int(cap.get(cv2.CAP_PROP_FPS))
# Calcola il rapporto per ridurre il framerate
frame_skip_ratio = original_fps // target_fps
real_frame_count = 0
while True:
ret, frame = cap.read()
if not ret:
break
frame_count += 1
# Estrai solo ogni "frame_skip_ratio"-esimo fotogramma
if frame_count % frame_skip_ratio == 0:
frame_filename = os.path.join(output_folder, f"{frame_count:07d}.png")
list_files.append(frame_filename)
cv2.imwrite(frame_filename, frame)
real_frame_count += 1
cap.release()
print(f"{real_frame_count} frames have been extracted from the video and saved in {output_folder}")
return list_files
def extract_frames_from_gif(gif_path, output_folder):
list_files = []
os.makedirs(output_folder, exist_ok=True)
gif_frames = imageio.mimread(gif_path, memtest=False)
frame_count = 0
for frame in gif_frames:
frame_count += 1
frame_filename = os.path.join(output_folder, f"{frame_count:07d}.png")
list_files.append(frame_filename)
cv2.imwrite(frame_filename, cv2.cvtColor(frame, cv2.COLOR_RGB2BGR))
print(f"{frame_count} frames have been extracted from the GIF and saved in {output_folder}")
return list_files
def get_output_filename(input_file_path, output_folder, file_extension,suffix="") :
existing_files = [f for f in os.listdir(output_folder)]
max_progressive = 0
for filename in existing_files:
parts_ext = filename.split(".")
parts = parts_ext[0]
if len(parts) > 2 and parts.isdigit():
progressive = int(parts)
max_progressive = max(max_progressive, progressive)
new_progressive = max_progressive + 1
new_filename = f"{new_progressive:07d}{suffix}{file_extension}"
return os.path.join(output_folder, new_filename), new_filename
def get_output_filename_video(input_file_path, output_folder, file_extension,suffix="") :
input_filename = os.path.basename(input_file_path)
input_filename_without_extension = os.path.splitext(input_filename)[0]
existing_files = [f for f in os.listdir(output_folder) if f.startswith(input_filename_without_extension)]
max_progressive = 0
for filename in existing_files:
parts_ext = filename.split(".")
parts = parts_ext[0].split("_")
if len(parts) == 2 and parts[1].isdigit():
progressive = int(parts[1])
max_progressive = max(max_progressive, progressive)
new_progressive = max_progressive + 1
new_filename = f"{input_filename_without_extension}_{new_progressive:02d}{suffix}{file_extension}"
return os.path.join(output_folder, new_filename), new_filename
def image_preprocessing(i):
i = ImageOps.exif_transpose(i)
image = i.convert("RGB")
image = np.array(image).astype(np.float32) / 255.0
image = torch.from_numpy(image)[None,]
return image
def create_video_from_frames(frame_folder, output_video, frame_rate = 30.0):
frame_filenames = [os.path.join(frame_folder, filename) for filename in os.listdir(frame_folder) if filename.endswith(".png")]
frame_filenames.sort(key=lambda f: int(''.join(filter(str.isdigit, f))))
first_frame = cv2.imread(frame_filenames[0])
height, width, layers = first_frame.shape
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter(output_video, fourcc, frame_rate, (width, height))
for frame_filename in frame_filenames:
frame = cv2.imread(frame_filename)
out.write(frame)
out.release()
print(f"Frames have been successfully reassembled into {output_video}")
def create_gif_from_frames(frame_folder, output_gif):
frame_filenames = [os.path.join(frame_folder, filename) for filename in os.listdir(frame_folder) if filename.endswith(".png")]
frame_filenames.sort()
frames = [imageio.imread(frame_filename) for frame_filename in frame_filenames]
# imageio
imageio.mimsave(output_gif, frames, duration=0.1)
print(f"Frames have been successfully assembled into {output_gif}")
temp_dir= folder_paths.temp_directory
class LoadVideoAdvanced:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
return {"required": {"video": (sorted(files), ),
"local_url": ("STRING", {"default": ""} ),
"framerate": (_framerate, {"default": "original"} ),
"resize_by": (_resize_type,{"default": "none"} ),
"size": ("INT", {"default": 512, "min": 512, "step": 64}),
"images_limit": ("INT", {"default": 0, "min": 0, "step": 1}),
"batch_size": ("INT", {"default": 0, "min": 0, "step": 1}),
"starting_frame": ("INT", {"default": 0, "min": 0, "step": 1}),
"autoplay":("BOOLEAN",{"default": True} ),
},}
RETURN_TYPES = ("IMAGE","LATENT","STRING","INT","INT","INT","INT",)
OUTPUT_IS_LIST = (True, True, False, False,False,False,False, )
RETURN_NAMES = ("IMAGES","EMPTY LATENTS","METADATA","WIDTH","HEIGHT","META_FPS","META_N_FRAMES")
CATEGORY = "N-Suite/Video"
FUNCTION = "encode"
TYPE="N-Suite"
@staticmethod
def vae_encode_crop_pixels(pixels):
x = (pixels.shape[1] // 8) * 8
y = (pixels.shape[2] // 8) * 8
if pixels.shape[1] != x or pixels.shape[2] != y:
x_offset = (pixels.shape[1] % 8) // 2
y_offset = (pixels.shape[2] % 8) // 2
pixels = pixels[:, x_offset:x + x_offset, y_offset:y + y_offset, :]
return pixels
def load_video(self, video,framerate, local_url):
file_path = folder_paths.get_annotated_filepath(os.path.join("n-suite",video))
cap = cv2.VideoCapture(file_path)
# Check if the video was opened successfully
if not cap.isOpened():
print("Unable to open the video.")
else:
# Get the FPS of the video
fps = int(cap.get(cv2.CAP_PROP_FPS))
print(f"The video has {fps} frames per second.")
try:
shutil.rmtree(os.path.join(temp_output_dir,video.split(".")[0]))
except:
print("Video Path already deleted")
full_temp_output_dir = os.path.join(temp_output_dir,video.split(".")[0])
#set new framerate
if "half" in framerate:
fps = fps // 2
print (f"The video has been reduced to {fps} frames per second.")
elif "quarter" in framerate:
fps = fps // 4
print (f"The video has been reduced to {fps} frames per second.")
# Estract frames
file_extension = os.path.splitext(file_path)[1].lower()
if file_extension == ".mp4" or file_extension == ".webm":
list_files = extract_frames_from_video(file_path, full_temp_output_dir, target_fps=fps)
audio_clip = VideoFileClip(file_path).audio
try:
#save audio
audio_clip.write_audiofile(os.path.join(temp_output_dir,video.split(".")[0],"audio.mp3"))
except:
print("Could not save audio")
pass
elif file_extension == ".gif":
extract_frames_from_gif(file_path, output_dir)
list_files = extract_frames_from_gif(file_path, output_dir)
#create_gif_from_frames(output_dir, output_video2)
else:
print("Format not supported. Please provide an MP4 or GIF file.")
return list_files,fps
def generate_latent(self, width, height, batch_size=1):
latent = torch.zeros([batch_size, 4, height // 8, width // 8])
return {"samples":latent}
def process_image(self,args):
image_path, width, height = args
# Funzione per ridimensionare e pre-elaborare un'immagine
image = resize_image(image_path, width, height)
image = image_preprocessing(image)
return torch.tensor(image)
def encode(self,video,framerate, local_url, resize_by, size, images_limit,batch_size,starting_frame,autoplay):
metadata = []
FRAMES,fps = self.load_video(video,framerate, local_url)
max_frames = len(FRAMES)
if images_limit>0 and starting_frame>0:
images_limit = images_limit + starting_frame
#if images_limit==0:
# images_limit = max_frames
print(f"images_limit {images_limit}")
#if starting frame is too high do the last frames only
if starting_frame>max_frames:
starting_frame = max_frames-1
print(f"{YELLOW}WARNING: The starting frame is greater than the number of frames in the video. Only the last frame of the video will be used ({starting_frame}). {END}")
#if images_limit > max_frames
if images_limit > max_frames:
images_limit = max_frames
print(f"{YELLOW}WARNING: The number of images to extract is greater than the number of frames in the video. Images_limit has been reduced to the number of frames ({images_limit}). {END}")
#if batch_size > max_frames
if batch_size > max_frames:
print(f"{YELLOW}WARNING: The batch size is greater than the number of frames requested. Batch size has been reduced. {END}")
batch_size = max_frames
#if batch_size > images_limit
if images_limit!=0 and batch_size > images_limit:
print(f"{YELLOW}WARNING: The batch size is greater than the number of frames requested. Batch size has been reduced to the number of images_limit. {END}")
batch_size = images_limit
pool_size=5
t_list = []
i_list = []
i = 0
o = 0
final_count_frame=0
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = []
width, height = calc_resize_image(FRAMES[0], size, resize_by)
for batch_start in range(0, len(FRAMES), pool_size):
batch_images = FRAMES[batch_start:batch_start + pool_size]
#remove audio if image_limit > 0 or starting_frame>0
if images_limit != 0 or starting_frame != 0:
try:
os.remove(os.path.join(temp_output_dir,video.split(".")[0],"audio.mp3"))
except:
pass
#if o >= images_limit:
# break
for image_path in batch_images:
# loop only when it reaches the starting_frame
if o>=starting_frame and (o<images_limit or images_limit==0):
args = (image_path, width, height)
futures.append(executor.submit(self.process_image, args))
final_count_frame += 1
o += 1
i += len(batch_images)
# Attendi il completamento delle operazioni in parallelo
concurrent.futures.wait(futures)
# Recupera i risultati
for future in futures:
batch_i_tensors = future.result()
i_list.extend(batch_i_tensors)
i_tensor = torch.stack(i_list, dim=0)
if images_limit != 0 or starting_frame != 0:
b_size=final_count_frame
else:
b_size=len(FRAMES)
latent = self.generate_latent( width, height, batch_size=b_size)
metadata.append(fps)
metadata.append(b_size)
try:
metadata.append(video.split(".")[0])
except:
print("No video name")
if batch_size != 0:
rebatcher = LatentRebatch()
rebatched_latent = rebatcher.rebatch([latent], [batch_size])
n_chunks = b_size//batch_size
i_tensor_batches = torch.chunk(i_tensor, n_chunks, dim=0)
return (i_tensor_batches,rebatched_latent,metadata, width, height,)
return ( [i_tensor],[latent],metadata, width, height,fps,b_size,)
class SaveVideo:
def __init__(self):
self.type = "output"
@classmethod
def INPUT_TYPES(s):
try:
shutil.rmtree(frames_output_dir)
os.mkdir(frames_output_dir)
except:
pass
#print(f"Temporary folder {frames_output_dir} has been emptied.")
return {"required":
{"images": ("IMAGE", ),
"METADATA": ("STRING", {"default": "", "forceInput": True} ),
"SaveVideo": ("BOOLEAN",{"default": False} ),
"SaveFrames": ("BOOLEAN",{"default": False} ),
"filename_prefix": ("STRING",{"default": "video"} ),
"CompressionLevel": ("INT", {"default": 2, "min": 0, "max":9, "step": 1}),
},
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
}
RETURN_TYPES = ()
FUNCTION = "save_video"
OUTPUT_NODE = True
CATEGORY = "N-Suite/Video"
def save_video(self, images,METADATA,SaveVideo,SaveFrames,filename_prefix, CompressionLevel, prompt=None, extra_pnginfo=None):
self.video_file_path,self.video_filename = get_output_filename_video(filename_prefix, videos_output_dir, ".mp4")
fps = METADATA[0]
frame_number = METADATA[1]
video_filename_original = METADATA[2]
#full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path("", frames_output_dir, images[0].shape[1], images[0].shape[0])
results = list()
for image in images:
full_output_folder,file = get_output_filename("", frames_output_dir, ".png")
file_name = file
i = 255. * image.cpu().numpy()
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
metadata = None
#file = f"frame_{counter:05}_.png"
img.save(full_output_folder, pnginfo=metadata, compress_level=CompressionLevel)
results.append({
"filename": file,
"subfolder": "frames",
"type": self.type
})
try:
file_name_number = int(file.split(".")[0])
except:
file_name_number = 0
if(file_name_number >= frame_number):
create_video_from_frames(frames_output_dir, videos_output_temp_dir,frame_rate=fps)
video_clip = VideoFileClip(videos_output_temp_dir)
try:
audio_clip = AudioFileClip(os.path.join(temp_output_dir,video_filename_original,"audio.mp3"))
video_clip = video_clip.set_audio(audio_clip)
except:
print("No audio found")
pass
if SaveFrames == True:
#copy frames_output_dir to self.video_file_path/self.video_filename
frame_folder=os.path.join(videos_output_dir,self.video_filename.split(".")[0])
shutil.copytree(frames_output_dir, frame_folder)
if SaveVideo == True:
video_clip.write_videofile(self.video_file_path)
file_name = self.video_filename
else:
#delete all temporary files that start with video_preview
for file in os.listdir(video_preview_output_temp_dir):
if file.startswith("video_preview"):
os.remove(os.path.join(video_preview_output_temp_dir,file))
#random number
suffix = str(random.randint(1,100000))
file_name = f"video_preview_{suffix}.mp4"
video_clip.write_videofile(os.path.join(video_preview_output_temp_dir,file_name))
return {"ui": {"text": [file_name],}}
class LoadFramesFromFolder:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {"required": { "folder":("STRING", {"default": ""} ),
"fps":("INT", {"default": 30})
}}
RETURN_TYPES = ("IMAGE","STRING","INT","INT","INT","STRING","STRING",)
RETURN_NAMES = ("IMAGES","METADATA","MAX WIDTH","MAX HEIGHT","FRAME COUNT","PATH","IMAGE LIST")
FUNCTION = "load_images"
OUTPUT_IS_LIST = (True,False,False,False,False,False,False,)
CATEGORY = "N-Suite/Video"
def load_images(self, folder,fps):
image_list = []
image_names = []
max_width = 0
max_height = 0
frame_count = 0
METADATA = [fps, len(os.listdir(folder)),"load"]
images = [os.path.join(folder, filename) for filename in os.listdir(folder) if filename.endswith(".png") or filename.endswith(".jpg")]
images.sort(key=lambda f: int(''.join(filter(str.isdigit, f))))
for image_path in images:
#get image name
image_names.append(image_path.split("/")[-1])
image = Image.open(image_path)
width, height = image.size
max_width = max(max_width, width)
max_height = max(max_height, height)
image_list.append((image_preprocessing(image)))
frame_count += 1
image_names_final='\n'.join(image_names)
print (f"Details: {frame_count} frames, {max_width}x{max_height}")
return (image_list,METADATA, max_width, max_height,frame_count,folder,image_names_final,)
class SetMetadata:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {"required": { "number_of_frames":("INT", {"default": 1, "min": 1, "step": 1}),
"fps":("INT", {"default": 30, "min": 1, "step": 1}),
"VideoName": ("STRING", {"default": "manual"} )
}}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("METADATA",)
FUNCTION = "set_metadata"
OUTPUT_IS_LIST = (False,)
CATEGORY = "N-Suite/Video"
def set_metadata(self, number_of_frames,fps,VideoName):
METADATA = [fps, number_of_frames,VideoName]
return (METADATA,)
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"LoadVideo [n-suite]": LoadVideoAdvanced,
"SaveVideo [n-suite]":SaveVideo,
"LoadFramesFromFolder [n-suite]": LoadFramesFromFolder,
"SetMetadataForSaveVideo [n-suite]": SetMetadata
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"LoadVideo [n-suite]": "LoadVideo [๐
-๐
ข๐
ค๐
๐
ฃ๐
]",
"SaveVideo [n-suite]": "SaveVideo [๐
-๐
ข๐
ค๐
๐
ฃ๐
]",
"LoadFramesFromFolder [n-suite]": "LoadFramesFromFolder [๐
-๐
ข๐
ค๐
๐
ฃ๐
]",
"SetMetadataForSaveVideo [n-suite]": "SetMetadataForSaveVideo [๐
-๐
ข๐
ค๐
๐
ฃ๐
]"
}
File "D:\ComfyUI-aki-v1.1\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\ComfyUI-aki-v1.1\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\ComfyUI-aki-v1.1\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\ComfyUI-aki-v1.1\custom_nodes\ComfyUI-N-Nodes\py\video_node_advanced.py", line 631, in save_video
video_clip.write_videofile(self.video_file_path)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\moviepy\decorators.py", line 137, in use_clip_fps_by_default
return f(clip, *new_a, **new_kw)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB
return f(clip, *a, **k)
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\moviepy\video\VideoClip.py", line 338, in write_videofile
ffmpeg_write_video(self, filename, fps, codec,
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 201, in ffmpeg_write_video
writer = FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,
File "D:\ComfyUI-aki-v1.1\python\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 86, in __init__
'-r', '%.02f' % fps,
ๅธฎๆ่งฃๅณไธ่ฟไธช้ฎ้ข
|
63260f8a97f34bfe4a1eac87feb70acd
|
{
"intermediate": 0.36415982246398926,
"beginner": 0.44390496611595154,
"expert": 0.1919352114200592
}
|
41,371
|
voici des logs derror je veux que tu me fasses un pipeline sur ELK :
"APACHE-ERROR-SFS-RPXD-MSS-MSS-UAT-G03R04C12" [Wed Mar 06 14:18:03 2024] [debug] proxy_util.c(3234): AH00962: HTTPS: connection complete to 10.235.70.188:443 (uat-rpwa-mss-mss.sfs-qualif.caas-cnp-apps-v2.com.intraorange)
"APACHE-ERROR-SFS-RPXD-MSS-MSS-UAT-G03R04C12" [Wed Mar 06 14:18:03 2024] [info] [client 10.235.70.188:443] AH01964: Connection to child 0 established (server SFS-RP:80)
"APACHE-ERROR-SFS-RPXD-MSS-MSS-UAT-G03R04C12" [Wed Mar 06 14:18:03 2024] [debug] ssl_engine_kernel.c(1584): [client 10.235.70.188:443] AH02275: Certificate Verification, depth 0, CRL checking mode: none (0) [subject: <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>,CN=*.sfs-qualif.caas-cnp-apps-v2.com.intraorange,OU=Orange Business Services,O=Orange,L=Paris,ST=Paris,C=FR / issuer: CN=Orange Internal G2 Server CA,OU=FR 89 380129866,O=Orange,C=FR / serial: 39E5400000BE3547743EEABB89BF15AD9365A9EA / notbefore: Apr 4 16:03:28 2023 GMT / notafter: Apr 4 16:03:28 2025 GMT]
"APACHE-ERROR-SFS-RPXD-MSS-MSS-UAT-G03R04C12" [Wed Mar 06 14:18:03 2024] [debug] ssl_engine_kernel.c(2069): [client 10.235.70.188:443] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
"APACHE-ERROR-SFS-RPXD-MSS-MSS-UAT-G03R04C12" [Wed Mar 06 14:18:02 2024] [debug] ssl_engine_kernel.c(2069): [client 10.235.70.188:443] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
|
8ea2d44814881f46b170f45ade012899
|
{
"intermediate": 0.4332495927810669,
"beginner": 0.23280538618564606,
"expert": 0.33394500613212585
}
|
41,372
|
sto facendo un programma python che usa le api di google maps e voglio convertire un nome in coordinate con longitudine e latitudine, ad ora le informazioni restituite sono in questo formato: [{'address_components': [{'long_name': '1600', 'short_name': '1600', 'types': ['street_number']}, {'long_name': 'Amphitheatre Parkway', 'short_name': 'Amphitheatre Pkwy', 'types': ['route']}, {'long_name': 'Mountain View', 'short_name': 'Mountain View', 'types': ['locality', 'political']}, {'long_name': 'Santa Clara County', 'short_name': 'Santa Clara County', 'types': ['administrative_area_level_2', 'political']}, {'long_name': 'California', 'short_name': 'CA', 'types': ['administrative_area_level_1', 'political']}, {'long_name': 'United States', 'short_name': 'US', 'types': ['country', 'political']}, {'long_name': '94043', 'short_name': '94043', 'types': ['postal_code']}], 'formatted_address': '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA', 'geometry': {'location': {'lat': 37.4224719, 'lng': -122.0842778}, 'location_type': 'ROOFTOP', 'viewport': {'northeast': {'lat': 37.4236631802915, 'lng': -122.0829808197085}, 'southwest': {'lat': 37.4209652197085, 'lng': -122.0856787802915}}}, 'place_id': 'ChIJRxcAvRO7j4AR6hm6tys8yA8', 'plus_code': {'compound_code': 'CWC8+X7 Mountain View, CA', 'global_code': '849VCWC8+X7'}, 'types': ['street_address']}]
come faccio a estrarre lat e lng?
|
a03749051dff022c8b7d17d77f26980d
|
{
"intermediate": 0.37560611963272095,
"beginner": 0.2463325560092926,
"expert": 0.37806129455566406
}
|
41,373
|
@Watch('$route', { immediate: true })
private onRouteChange(route: Route) {
const query = route.query as Dictionary<string>
if (query) {
this.redirect = query.redirect
this.otherQuery = this.getOtherQuery(query)
}
}
ะบะฐะบ ะฟะตัะตะฟะธัะฐัั ะฝะฐ vue 3 composition api
|
49580db23339ce26789a625e3791a075
|
{
"intermediate": 0.44583144783973694,
"beginner": 0.3715670704841614,
"expert": 0.1826014667749405
}
|
41,374
|
--version
|
078a6284dc0c8458c9579f73e5850f36
|
{
"intermediate": 0.31723591685295105,
"beginner": 0.2869551181793213,
"expert": 0.3958089351654053
}
|
41,375
|
I would like to host videos in Germany myself. Can you generate a code or write software that I can use for this? You can choose the programming language yourself.
|
3f6fea1e023b028a6a566cf9f31f8c49
|
{
"intermediate": 0.38296908140182495,
"beginner": 0.28576186299324036,
"expert": 0.3312690556049347
}
|
41,376
|
this is my command:
awk '{print $1}' test.txt
this is the output:
InFrame
InFrame
TruncatedIntron
InFrame
TruncatedIntron
InFrame
InFrame
InFrame
InFrame
InFrame
InFrame
InFrame
InFrame
InFrame
InFrame
I want to count how many occurrences of each type are, help me
|
8fd8bae933f788cda538a2994058f723
|
{
"intermediate": 0.2838541567325592,
"beginner": 0.5838297605514526,
"expert": 0.13231605291366577
}
|
41,377
|
I have data which is organized into a JSON, which in-turn has multiple JSONS within it.
In each individual JSON there are 4 fields, Name, SSN, DOB and Address, and for each of the 4 fields, there are 3 values, one provided by the applicant, one pulled from the credit report and another from their lexisnexis report.
I am going to supply this entire data set to a Large Language Model which would be running prompts to check if the data received from these 3 sources match or not.
Now, for each of these fields I have written a different prompt to ask the model to perform the matching.
I have a locally hosted a large language model, to which I would want to supply this information both the dataset and the prompt via some sort of code to make it perform the analysis and give me the outputs.
How can I do this?
|
8de53473e978d84c85debb7d7c756453
|
{
"intermediate": 0.5498525500297546,
"beginner": 0.2056833952665329,
"expert": 0.24446401000022888
}
|
41,378
|
Les instructions de du programme Orange money en C#
|
b0e966cce13a789fdf0b117c81ac526f
|
{
"intermediate": 0.3950727581977844,
"beginner": 0.33233562111854553,
"expert": 0.27259159088134766
}
|
41,379
|
Hello
|
7c51a22938c0043b66c7b7e35eca7957
|
{
"intermediate": 0.3123404085636139,
"beginner": 0.2729349136352539,
"expert": 0.4147246778011322
}
|
41,380
|
nix add build time dependency to flakke depending on buildRustPackage
|
f73cf5643966b82f49de72ff2d738960
|
{
"intermediate": 0.4726713001728058,
"beginner": 0.2231593281030655,
"expert": 0.30416932702064514
}
|
41,381
|
check this function:
fn map_5_utr(
tx_start: &u32,
tx_end: &u32,
cn_start: &u32,
cn_end: &u32,
idx: &usize,
) -> (bool, UMatch) {
if idx == &0 {
if tx_start == cn_start && tx_end <= cn_end {
// 5' end in-frame
(true, UMatch::InFrame)
} else if tx_start > cn_start && tx_end <= cn_end {
// 5' end truncated inside exon
(true, UMatch::TruncatedExon)
} else if tx_start < cn_start && tx_end == cn_end {
// 5' end truncated inside intron
(false, UMatch::TruncatedIntron)
} else {
(false, UMatch::Unknown)
}
} else {
if tx_start == cn_start && tx_end <= cn_end {
// 5' end in-frame
(true, UMatch::AltPromoterInFrame)
} else if tx_start > cn_start && tx_end <= cn_end {
// 5' end truncated inside exon
(true, UMatch::AltPromoterTruncatedExon)
} else if tx_start < cn_start && tx_end == cn_end {
// 5' end truncated inside intron
(false, UMatch::AltPromoterTruncatedIntron)
} else if tx_end < cn_start {
// alternative promoter
(true, UMatch::AltPromoterInIntron)
} else {
(false, UMatch::Unknown)
}
}
}
Can you please make it look more elegant? Try to make it more efficient and faster too.
|
daf5a56ecf9b046e7689e0a6baad1583
|
{
"intermediate": 0.4065265357494354,
"beginner": 0.32844817638397217,
"expert": 0.26502525806427
}
|
41,382
|
How do I make nothing happen with this cancel action
let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: { [weak self] _ in
})
|
fb3b258543fbaa41308195cc4a11573d
|
{
"intermediate": 0.5623029470443726,
"beginner": 0.19806824624538422,
"expert": 0.23962882161140442
}
|
41,383
|
What does the continue conditional do in processing? and what does it mean by "skips the remainder of the block and starts the next iteration."
Because the definition for "coutinue" is: When run inside of a for or while, it skips the remainder of the block and starts the next iteration.
|
efca4774f3fa44863a6ac06edcefdea9
|
{
"intermediate": 0.3542598485946655,
"beginner": 0.20051494240760803,
"expert": 0.44522514939308167
}
|
41,384
|
Show me an example on how to use kCLAuthorizationStatusNotDetermined
|
851fe94a875b8a64bdae700dc38d4eef
|
{
"intermediate": 0.4701383709907532,
"beginner": 0.09489908814430237,
"expert": 0.43496254086494446
}
|
41,385
|
Timestamp Email address Full Name University ID Number Personal Email Valid Phone Number Gender QR-code Scanner Transaction ID Payment Screenshot
this is available in data.csv
I need to create a excel file of Full name, ID number, Qr-code scanner payment done and save in newdata.csv
using python program fetching data from data.csv
|
12fac53bc0382f5546be7a8a4cdf2a5b
|
{
"intermediate": 0.5222497582435608,
"beginner": 0.22085580229759216,
"expert": 0.25689437985420227
}
|
41,386
|
Using recursion, complete the body of the following static method.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Refactors the given {@code Statement} so that every IF_ELSE statement
* with a negated condition (NEXT_IS_NOT_EMPTY, NEXT_IS_NOT_ENEMY,
* NEXT_IS_NOT_FRIEND, NEXT_IS_NOT_WALL) is replaced by an equivalent
* IF_ELSE with the opposite condition and the "then" and "else" BLOCKs
* switched. Every other statement is left unmodified.
*
* @param s
* the {@code Statement}
* @updates s
* @ensures <pre>
* s = [#s refactored so that IF_ELSE statements with "not"
* conditions are simplified so the "not" is removed]
* </pre>
*/
public static void simplifyIfElse(Statement s) {
switch (s.kind()) {
case BLOCK: {
// TODO - fill in case
break;
}
case IF: {
// TODO - fill in case
break;
}
case IF_ELSE: {
// TODO - fill in case
break;
}
case WHILE: {
// TODO - fill in case
break;
}
case CALL: {
// nothing to do here...can you explain why?
break;
}
default: {
// this will never happen...can you explain why?
break;
}
}
}
|
8ec732a7671b3e3cac6d72e57ca1b888
|
{
"intermediate": 0.3024034798145294,
"beginner": 0.4870724380016327,
"expert": 0.21052412688732147
}
|
41,387
|
/*
* requestAlwaysAuthorization
*
* Discussion:
* When -authorizationStatus == kCLAuthorizationStatusNotDetermined,
* calling this method will start the process of requesting "always"
* authorization from the user. Any authorization change as a result of
* the prompt will be reflected via the usual delegate callback:
* -locationManager:didChangeAuthorizationStatus:.
*
* If possible, perform this call in response to direct user request for a
* location-based service so that the reason for the prompt will be clear,
* and the utility of a one-time grant is maximized.
*
* If received, "always" authorization grants access to the user's location
* via any CLLocationManager API. In addition, monitoring APIs may launch
* your app into the background when they detect an event. Even if killed by
* the user, launch events triggered by monitoring APIs will cause a
* relaunch.
*
* "Always" authorization presents a significant risk to user privacy, and
* as such requesting it is discouraged unless background launch behavior
* is genuinely required. Do not call +requestAlwaysAuthorization unless
* you think users will thank you for doing so.
*
* An application which currently has "when-in-use" authorization and has
* never before requested "always" authorization may use this method to
* request "always" authorization one time only. Otherwise, if
* -authorizationStatus != kCLAuthorizationStatusNotDetermined, (ie
* generally after the first call) this method will do nothing.
*
* If your app is not currently in use, this method will do nothing.
*
* Both the NSLocationAlwaysAndWhenInUseUsageDescription and
* NSLocationWhenInUseUsageDescription keys must be specified in your
* Info.plist; otherwise, this method will do nothing, as your app will be
* assumed not to support Always authorization.
*/
@available(iOS 8.0, *)
open func requestAlwaysAuthorization()
How do I check authorizationStatus != kCLAuthorizationStatusNotDetermined
|
c0cf33ff987752f2b46321412f838ebc
|
{
"intermediate": 0.524499773979187,
"beginner": 0.26251596212387085,
"expert": 0.21298420429229736
}
|
41,388
|
Timestamp Email address Full Name University ID Number Personal Email Valid Phone Number Gender QR-code Scanner Transaction ID Payment Screenshot
tom homlinston 2307452526 400 paid (or) 400/- in QR-code Scanner field T2403061654314429975614 - transaction ID
this is available in data.csv
I need to create a excel file of Full name, ID number, Qr-code scanner in integer like to be stored in 400 (or) 350 like that and ignore strings like 'paid' etc.. and transaction ID and save in newdata.csv
using python program fetching data from data.csv
|
bbecc1266d745c3bf81c4ac2452aa994
|
{
"intermediate": 0.42020511627197266,
"beginner": 0.2856191098690033,
"expert": 0.29417580366134644
}
|
41,389
|
how to fix: npm run build
> jamstack-ecommerce@0.1.0 build
> next build
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
node:internal/modules/esm/resolve:303
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\node_modules\postcss\package.json
at exportsNotFound (node:internal/modules/esm/resolve:303:10)
at packageExportsResolve (node:internal/modules/esm/resolve:650:9)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at 552 (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11590)
at __webpack_require__ (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
at 560 (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:400)
at __webpack_require__ (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
at 290 (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:260)
at __webpack_require__ (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
at 632 (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:3733)
at __webpack_require__ (C:\Users\VICE\Documents\jamstack-ecommerce-next\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v20.11.0
|
4674ebf42654b8fb2b305d76aff0c22a
|
{
"intermediate": 0.3678964376449585,
"beginner": 0.43570995330810547,
"expert": 0.19639356434345245
}
|
41,390
|
starling-lm-7b-alpha
gpt-4-1106-preview
wizardlm-70b
claude-3-opus-20240229
==========
ะญัะพ ะบะพะด ัะบัะธะฟัะพะฒ ััะพัะพะฝั ะบะปะธะตะฝัะฐ ะธ ัะตัะฒะตัะฐ ั ะปะพะณะธะบะพะน /// ะดะปั MTA SAN ANDREAS
==========
-- login_client.lua
local soundElementData = "mySoundElement"
screenWidth,screenHeight = guiGetScreenSize()
mainWidth,mainHeight = 1300,600
regWidth,regHeight = 800,688
-- ะกะพะทะดะฐะตะผ ััะฐัะธัะตัะบะพะต ะธะทะพะฑัะฐะถะตะฝะธะต ัะฐะทะผะตัะพะผ 30% ะพั ัะฐะทะผะตัะฐ ัะบัะฐะฝะฐ
local screenWidth, screenHeight = guiGetScreenSize() -- ะฟะพะปััะฐะตะผ ัะฐะทะผะตั ัะบัะฐะฝะฐ
local imageWidth, imageHeight = screenWidth*0.3, screenHeight*0.3 -- ัััะฐะฝะฐะฒะปะธะฒะฐะตะผ ัะฐะทะผะตั ะธะทะพะฑัะฐะถะตะฝะธั ะฝะฐ 30% ะพั ัะฐะทะผะตัะฐ ัะบัะฐะฝะฐ
backgroundImage = guiCreateStaticImage(screenWidth/2 - imageWidth/2, screenHeight/2 - imageHeight/2, imageWidth, imageHeight, "images/reglog_pic.png", false)
-- ัะพะทะดะฐะตะผ ะถะธัะฝัะน ััะธัั
local boldFont = guiCreateFont("ljk_Adventure.ttf", 20)
-- ัะพะทะดะฐะตะผ ะผะตัะบะธ "ะะพะณะธะฝ" ะธ "ะะฐัะพะปั" ะฟะพะฒะตัั
ะธะทะพะฑัะฐะถะตะฝะธั
local loginLabel = guiCreateLabel(0.1, 0.15, 0.8, 0.1, "ะะพะณะธะฝ:", true, backgroundImage)
local passwordLabel = guiCreateLabel(0.1, 0.45, 0.8, 0.1, "ะะฐัะพะปั:", true, backgroundImage)
-- ะฟัะธะผะตะฝัะตะผ ะถะธัะฝัะน ััะธัั ะบ ะผะตัะบะฐะผ
guiSetFont(loginLabel, boldFont)
guiSetFont(passwordLabel, boldFont)
-- ัะตะฝััะธััะตะผ ัะตะบัั ะผะตัะพะบ
guiLabelSetHorizontalAlign(loginLabel, "center")
guiLabelSetHorizontalAlign(passwordLabel, "center")
-- ัะพะทะดะฐะตะผ ะฟะพะปั ะดะปั ะฒะฒะพะดะฐ ะปะพะณะธะฝะฐ ะธ ะฟะฐัะพะปั ะฟะพะฒะตัั
ะธะทะพะฑัะฐะถะตะฝะธั
usernameField = guiCreateEdit(0.1, 0.25, 0.8, 0.15, "", true, backgroundImage)
passwordField = guiCreateEdit(0.1, 0.55, 0.8, 0.15, "", true, backgroundImage)
-- ัะพะทะดะฐะตะผ ะบะฝะพะฟะบะธ "ะะพะณะธะฝ" ะธ "ะ ะตะณะธัััะฐัะธั" ะฟะพะฒะตัั
ะธะทะพะฑัะฐะถะตะฝะธั
loginButton = guiCreateButton(0.1, 0.75, 0.35, 0.15, "ะะพะนัะธ", true, backgroundImage)
registerButton = guiCreateButton(0.55, 0.75, 0.35, 0.15, "ะ ะตะณะธัััะฐัะธั", true, backgroundImage)
-- ะะทะฝะฐัะฐะปัะฝะพ ะฒัะต ัะปะตะผะตะฝัั GUI ะฒัะบะปััะตะฝั
guiSetVisible(backgroundImage, false)
function loginPanel()
Ck_racing1 = guiCreateLabel (1300,730,1280,40,"",false,mainWindow)
guiLabelSetVerticalAlign(Ck_racing1,"center")
guiLabelSetHorizontalAlign(Ck_racing1,"center",false)
guiSetFont (Ck_racing1,"clear-normal")
guiLabelSetColor(Ck_racing1,0,0,0)
local table = {{255, 0, 0},{255, 255, 255},{255,100, 100},{100, 100, 100}}
setTimer(
function ()
guiLabelSetColor( Ck_racing1, unpack(table[math.random(#table)]) )
end
, 1000, 0 )
setPlayerHudComponentVisible("radar",false)
setPlayerHudComponentVisible("area_name",false)
toggleControl("radar",false)
showChat(false)
local PositionX,PositionY,PositionZ = 2067.5349,41.928261,34.788815;
local LookAtX,LookAtY,LookAtZ = 2067.5349,41.928261,34.788815;
setCameraMatrix(PositionX,PositionY,PositionZ,LookAtX,LookAtY,LookAtZ)
fadeCamera(true)
function CameraPosition ()
PositionX = PositionX+0.03;
LookAtX = LookAtX+0.3;
setCameraMatrix(PositionX,PositionY,PositionZ,LookAtX,LookAtY,LookAtZ)
end
addEventHandler("onClientPreRender",getRootElement(),CameraPosition)
mainWindow = guiCreateStaticImage(screenWidth/2-mainWidth/2,screenHeight/2-mainHeight/2,mainWidth,mainHeight,"images/logo.png",false)
btnLogin = guiCreateStaticImage(400,400,484,148,"images/play.png",false,mainWindow)
guiSetProperty(btnLogin, "NormalTextColour", "FFFF0000")
guiSetFont(btnLogin,"clear-normal")
guiSetVisible(mainWindow,true)
guiSetInputEnabled(true)
showCursor(true)
addEventHandler("onClientGUIClick",btnLogin,onClickLogin)
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),loginPanel)
-- ะพะฑัะฐะฑะพััะธะบ ัะพะฑััะธั ะฝะฐะถะฐัะธั ะฝะฐ ะบะฝะพะฟะบั "btnLogin"
function onClickLogin(button,state)
if(button == "left" and state == "up") then
if (source == btnLogin) then
playSound("sounds/sfx/button.mp3")
guiSetVisible(mainWindow, false) -- ะทะฐะบััะฒะฐะตะผ ะพัะฝะพะฒะฝะพะต ะพะบะฝะพ
guiSetVisible(backgroundImage, true) -- ะพัะบััะฒะฐะตะผ ะพะบะฝะพ ะดะปั ะฒะฒะพะดะฐ ะปะพะณะธะฝะฐ ะธ ะฟะฐัะพะปั
end
end
end
-- ะพะฑัะฐะฑะพััะธะบะธ ัะพะฑััะธะน ะฝะฐะถะฐัะธั ะฝะฐ ะบะฝะพะฟะบะธ "ะะพะณะธะฝ" ะธ "ะ ะตะณะธัััะฐัะธั"
addEventHandler("onClientGUIClick", loginButton,
function()
local username = guiGetText(usernameField)
local password = guiGetText(passwordField)
playSound("sounds/sfx/enterserver.mp3")
if username ~= "" and password ~= "" then
triggerServerEvent("onRequestEnter", getLocalPlayer(), username, password)
else
outputChatBox("ะั ะดะพะปะถะฝั ะฒะฒะตััะธ ะธะผั ะฟะพะปัะทะพะฒะฐัะตะปั ะธ ะฟะฐัะพะปั.")
-- exports.notyf_system:badnotyShow("ะั ะดะพะปะถะฝั ะฒะฒะตััะธ ะธะผั ะฟะพะปัะทะพะฒะฐัะตะปั ะธ ะฟะฐัะพะปั!", source)
end
end
)
-- ะกะพะทะดะฐะฝะธะต GUI ั ะธะบะพะฝะบะฐะผะธ ะะ, ะฎััะฑ ะธ ะขะตะปะตะณัะฐะผ
-- local iconGUI = guiCreateStaticImage(screenWidth / 2 - 80, screenHeight - 64, 160, 64, "images/blank.png", false)
-- ะกะพะทะดะฐะฝะธะต ะบะฝะพะฟะพะบ ั ะธะบะพะฝะบะฐะผะธ
local buttonvk = guiCreateStaticImage(screenWidth / 2 - 70, screenHeight - 50, 32, 32, "images/vk_button.png", false, iconGUI)
local buttonyt = guiCreateStaticImage(screenWidth / 2 - 30, screenHeight - 50, 32, 32, "images/yt_button.png", false, iconGUI)
local buttontg = guiCreateStaticImage(screenWidth / 2 + 10, screenHeight - 50, 32, 32, "images/tg_button.png", false, iconGUI)
function openBrowserURL(url)
local browser = guiCreateBrowser(0, 0, 800, 600, true, true, false)
guiSetBrowserURL(browser, url)
end
-- Oะฑัะฐะฑะพััะธะบะธ ัะพะฑััะธะน ะดะปั ะบะปะธะบะพะฒ ะฟะพ ะธะบะพะฝะบะฐะผ
addEventHandler("onClientGUIClick", buttonvk, function(button, state)
if button == "left" and state == "up" then
outputChatBox("ะะฐะถะฐะป ะฝะฐ ะะ.")
playSound("sounds/sfx/button.mp3")
openBrowserURL("https://vk.com/yourpage")
loadBrowserURL( browser, "https://www.youtube.com/" )
end
end, false)
addEventHandler("onClientGUIClick", buttonyt, function(button, state)
if button == "left" and state == "up" then
outputChatBox("ะะฐะถะฐะป ะฝะฐ ะฎะขะฃะ.")
playSound("sounds/sfx/button.mp3")
openBrowserURL("https://www.youtube.com/channel/yourchannel")
loadBrowserURL( browser, "https://www.youtube.com/" )
end
end, false)
addEventHandler("onClientGUIClick", buttontg, function(button, state)
if button == "left" and state == "up" then
outputChatBox("ะะฐะถะฐะป ะฝะฐ ะขะะะะะฃ.")
playSound("sounds/sfx/button.mp3")
openBrowserURL("https://t.me/yourtelegram")
loadBrowserURL( browser, "https://www.youtube.com/" )
end
end, false)
-- GUI ะดะปั ัะตะณะธัััะฐัะธะธ
registerGUI = guiCreateStaticImage(screenWidth/2 - imageWidth/2, screenHeight/2 - imageHeight/2, imageWidth, imageHeight, "images/reglog_pic.png", false)
local registerUsernameLabel = guiCreateLabel(0.1, 0.05, 0.8, 0.1, "ะะพะณะธะฝ:", true, registerGUI)
local emailLabel = guiCreateLabel(0.1, 0.25, 0.8, 0.1, "ะะพััะฐ:", true, registerGUI)
local registerPasswordLabel = guiCreateLabel(0.1, 0.45, 0.8, 0.1, "ะะฐัะพะปั:", true, registerGUI)
local confirmPasswordLabel = guiCreateLabel(0.1, 0.65, 0.8, 0.1, "ะะพะฒัะพัะธัะต ะฟะฐัะพะปั:", true, registerGUI)
guiSetFont(registerUsernameLabel, boldFont)
guiSetFont(emailLabel, boldFont)
guiSetFont(registerPasswordLabel, boldFont)
guiSetFont(confirmPasswordLabel, boldFont)
guiLabelSetHorizontalAlign(registerUsernameLabel, "center")
guiLabelSetHorizontalAlign(emailLabel, "center")
guiLabelSetHorizontalAlign(registerPasswordLabel, "center")
guiLabelSetHorizontalAlign(confirmPasswordLabel, "center")
registerUsernameField = guiCreateEdit(0.1, 0.15, 0.8, 0.08, "", true, registerGUI)
emailField = guiCreateEdit(0.1, 0.35, 0.8, 0.08, "", true, registerGUI)
registerPasswordField = guiCreateEdit(0.1, 0.55, 0.8, 0.08, "", true, registerGUI)
confirmPasswordField = guiCreateEdit(0.1, 0.75, 0.8, 0.08, "", true, registerGUI)
local backButton = guiCreateButton(0.1, 0.85, 0.35, 0.1, "ะะฐะทะฐะด", true, registerGUI)
local confirmRegisterButton = guiCreateButton(0.55, 0.85, 0.35, 0.1, "ะะฐัะตะณะธัััะธัะพะฒะฐัััั", true, registerGUI)
guiSetEnabled(backButton, false)
guiSetEnabled(confirmRegisterButton, false)
guiSetVisible(registerGUI, false)
addEventHandler("onClientGUIClick", registerButton, function()
playSound("sounds/sfx/button.mp3")
guiSetVisible(backgroundImage, false)
guiSetVisible(buttonvk, false)
guiSetVisible(buttonyt, false)
guiSetVisible(buttontg, false)
guiSetVisible(registerGUI, true)
guiSetEnabled(backButton, true)
guiSetEnabled(confirmRegisterButton, true)
end)
addEventHandler("onClientGUIClick", backButton, function()
playSound("sounds/sfx/button.mp3")
guiSetVisible(registerGUI, false)
guiSetVisible(buttonvk, true)
guiSetVisible(buttonyt, true)
guiSetVisible(buttontg, true)
guiSetVisible(backgroundImage, true)
guiSetEnabled(backButton, false)
guiSetEnabled(confirmRegisterButton, false)
end)
addEventHandler("onClientGUIClick", confirmRegisterButton, function()
playSound("sounds/sfx/button.mp3")
local username = guiGetText(registerUsernameField)
local email = guiGetText(emailField)
local password = guiGetText(registerPasswordField)
local confirmPassword = guiGetText(confirmPasswordField)
if password == confirmPassword then
triggerServerEvent("onRequestRegister", getLocalPlayer(), username, email, password)
else
exports.notyf_system:badnotyShow("ะะฐัะพะปะธ ะฝะต ัะพะฒะฟะฐะดะฐัั!", source)
end
end)
function hideLoginWindow()
removeEventHandler("onClientPreRender", root, CameraPosition)
setCameraTarget(getLocalPlayer())
showChat(true)
guiSetInputEnabled(false)
guiSetVisible(backgroundImage, false)
guiSetVisible(registerGUI, false)
guiSetVisible(buttonvk, false)
guiSetVisible(buttonyt, false)
guiSetVisible(buttontg, false)
showCursor(false)
end
addEvent("hideLoginWindow", true)
addEventHandler("hideLoginWindow", root, hideLoginWindow)
-- ะะฃะะซะะ ะะ ะคะะะ
function startSound()
local sounds = {"sounds/loginsong_1.mp3", "sounds/loginsong_2.mp3", "sounds/loginsong_3.mp3"}
local randomSound = sounds[math.random(#sounds)]
local sound = playSound(randomSound)
if not sound then
setSoundVolume(sound, 0.2) -- ัััะฐะฝะฐะฒะปะธะฒะฐะตะผ ะณัะพะผะบะพััั ะทะฒัะบะฐ ะฝะฐ 50%
outputChatBox("ะัะธะฑะบะฐ ะฒะพัะฟัะพะธะทะฒะตะดะตะฝะธั ะทะฒัะบะฐ: " .. randomSound) -- ะฒัะฒะพะดะธะผ ัะพะพะฑัะตะฝะธะต ะพะฑ ะพัะธะฑะบะต ะฒ ัะฐั, ะตัะปะธ ะทะฒัะบ ะฝะต ะฒะพัะฟัะพะธะทะฒะพะดะธััั
else
setElementData(getLocalPlayer(), soundElementData, sound) -- ัะพั
ัะฐะฝัะตะผ ัะปะตะผะตะฝั ะทะฒัะบะฐ ะฒ ัะปะตะผะตะฝัะฐัะฝัั
ะดะฐะฝะฝัั
end
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startSound)
function stopMySound()
local sound = getElementData(getLocalPlayer(), soundElementData) -- ะฟะพะปััะฐะตะผ ัะปะตะผะตะฝั ะทะฒัะบะฐ ะธะท ัะปะตะผะตะฝัะฐัะฝัั
ะดะฐะฝะฝัั
if isElement(sound) then
destroyElement(sound)
removeElementData(getLocalPlayer(), soundElementData) -- ัะดะฐะปัะตะผ ะดะฐะฝะฝัะต ัะปะตะผะตะฝัะฐ ะฟะพัะปะต ัะฝะธััะพะถะตะฝะธั ะทะฒัะบะฐ
end
end
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), stopMySound)
-- login_server.lua
local function validateCredentials(username, password)
if string.len(username) < 4 or string.len(username) > 15 then
-- outputChatBox("ะะผั ะฟะพะปัะทะพะฒะฐัะตะปั ะดะพะปะถะฝะพ ัะพะดะตัะถะฐัั ะพั 4 ะดะพ 15 ัะธะผะฒะพะปะพะฒ", source)
exports.notyf_system:badnotyShow("ะะผั ะฟะพะปัะทะพะฒะฐัะตะปั ะดะพะปะถะฝะพ ัะพะดะตัะถะฐัั ะพั 4 ะดะพ 15 ัะธะผะฒะพะปะพะฒ!", source)
return false
end
if string.len(password) < 4 or string.len(password) > 20 then
-- outputChatBox("ะะฐัะพะปั ะดะพะปะถะตะฝ ัะพะดะตัะถะฐัั ะพั 4 ะดะพ 20 ัะธะผะฒะพะปะพะฒ", source)
exports.notyf_system:badnotyShow("ะะฐัะพะปั ะดะพะปะถะตะฝ ัะพะดะตัะถะฐัั ะพั 4 ะดะพ 20 ัะธะผะฒะพะปะพะฒ!", source)
return false
end
if string.match(username, "%W") then
-- outputChatBox("ะะผั ะฟะพะปัะทะพะฒะฐัะตะปั ะผะพะถะตั ัะพะดะตัะถะฐัั ัะพะปัะบะพ ะฑัะบะฒั ะธ ัะธััั", source)
exports.notyf_system:badnotyShow("ะะผั ะฟะพะปัะทะพะฒะฐัะตะปั ะผะพะถะตั ัะพะดะตัะถะฐัั ัะพะปัะบะพ ะฑัะบะฒั ะธ ัะธััั!", source)
return false
end
return true
end
local function isValidEmail(email)
if not email then
return false
end
if string.find(email, "^[%w._%-]+@[%w.-]+%.%a+$") then
return true
end
return false
end
function enterPlayer(username, password)
outputConsole("enterPlayer function is called with username: " .. username .. " and password: " .. password)
local account = getAccount(username)
if (account == false) then
-- outputChatBox("ะขะฐะบะพะณะพ ะฐะบะบะฐัะฝัะฐ ะฝะต ัััะตััะฒัะตั", source)
exports.notyf_system:badnotyShow("ะขะฐะบะพะณะพ ะฐะบะบะฐัะฝัะฐ ะฝะต ัััะตััะฒัะตั!", source)
return
end
if not logIn(source, account, password) then
-- outputChatBox("ะะตะฒะตัะฝัะน ะฟะฐัะพะปั!", source)
exports.notyf_system:badnotyShow("ะะตะฒะตัะฝัะน ะฟะฐัะพะปั!", source)
else
triggerClientEvent(source, "hideLoginWindow", getRootElement())
triggerEvent("onPlayerDayZLogin", getRootElement(), username, password, source)
end
end
addEvent("onRequestEnter", true)
addEventHandler("onRequestEnter", getRootElement(), function(...)
outputConsole("onRequestEnter event is triggered")
enterPlayer(...)
end)
function registerPlayer(username, email, password)
if not validateCredentials(username, email, password) then return end
if not isValidEmail(email) then
exports.notyf_system:badnotyShow("ะะตะฟัะฐะฒะธะปัะฝัะน ัะพัะผะฐั ะฟะพััั!", source)
return
end
local account = getAccount(username)
if account then
-- outputChatBox("ะะบะบะฐัะฝั ัะถะต ัััะตััะฒัะตั", source)
exports.notyf_system:badnotyShow("ะะบะบะฐัะฝั ัะถะต ัััะตััะฒัะตั!", source)
else
account = addAccount(username, password)
logIn(source, account, password)
triggerClientEvent(source, "hideLoginWindow", getRootElement())
triggerEvent("onPlayerDayZRegister", getRootElement(), username, password, email, source)
triggerClientEvent(source, "openClothingInterface", getRootElement())
end
end
addEvent("onRequestRegister", true)
addEventHandler("onRequestRegister", getRootElement(), registerPlayer)
ะญัะพ ะบะพะด ัะบัะธะฟัะพะฒ ััะพัะพะฝั ะบะปะธะตะฝัะฐ ะธ ัะตัะฒะตัะฐ ั ะปะพะณะธะบะพะน ัะตะณะธัััะฐัะธะธ, ะฐะฒัะพัะธะทะฐัะธะธ ะธ ะดััะณะธั
ะผะตะปะพัะตะน ะฟัะธ ะฒั
ะพะดะต ะฒ ะธะณัั ะดะปั ะผัะปััะธะฟะปะตะตัะฐ MTA SAN ANDREAS. ะัะพะฐะฝะฐะปะธะทะธััะน ะบะพะด, ะฝะฐะนะดะธ ะฝะตะดะพััะฐัะบะธ, ะพัะธะฑะบะธ, ะฒะพะทะผะพะถะฝัะต ะฑะฐะณะธ ะธ ะฟัะตะดะปะพะถะธ ะฒะฐัะธะฐะฝัั ะธั
ะธัะฟัะฐะฒะปะตะฝะธั.
|
cecf57828ed09052f03c171cdac10adc
|
{
"intermediate": 0.30311423540115356,
"beginner": 0.5020779371261597,
"expert": 0.19480782747268677
}
|
41,391
|
I have data which is organized into a JSON, which in-turn has multiple JSONS within it.
In each individual JSON there are 4 fields, Name, SSN, DOB and Address, and for each of the 4 fields, there are 3 values, one provided by the applicant, one pulled from the credit report and another from their lexisnexis report.
I am going to supply this entire data set to a Large Language Model which would be running prompts to check if the data received from these 3 sources match or not.
Now, for each of these fields I have written a different prompt to ask the model to perform the matching.
I have a locally hosted a large language model, to which I would want to supply this information both the dataset and the prompt via some sort of code to make it perform the analysis and give me the outputs.
How can I do this?
|
51759b3fb2b5e2ff74180aed73a06282
|
{
"intermediate": 0.5498525500297546,
"beginner": 0.2056833952665329,
"expert": 0.24446401000022888
}
|
41,392
|
Sstv decoder for amstrad CPC
|
a94d8edbcea9c14745d42fb6a784832e
|
{
"intermediate": 0.3164275586605072,
"beginner": 0.3402988016605377,
"expert": 0.3432736098766327
}
|
41,393
|
Hello i want a chrome console command that select every this element "<div class="skins-columner__item-upgrade skin-changer-items_skinsColumnerItemUpgrade_1UpD2"><div data-v-1a3f66b7="" class="skin-select"><div data-v-0c0e7412="" data-v-1a3f66b7="" tabindex="0" class="skin-card rarity--milspec clickable"><!----><div data-v-0c0e7412="" class="skin-card__source-bg default"></div><div data-v-0c0e7412="" class="skin-card__left-top"><div data-v-0c0e7412="" class="skin-card__price d-flex ac">$0.51</div><!----></div><div data-v-0c0e7412="" class="skin-card__right-top"><!----><!----></div><div data-v-0c0e7412="" class="skin-card__right-bot"><span data-v-0c0e7412="" class="skin-card_quality"> MW </span><!----></div><div data-v-0c0e7412="" class="skin-card__left-bot"><div data-v-0c0e7412="" class="skin-card__name"><div data-v-0c0e7412=""><!----><span data-v-0c0e7412="">MP5-SD</span></div><div data-v-0c0e7412=""><span data-v-0c0e7412="">Co-Processor</span></div></div><!----></div><div data-v-0c0e7412="" class="skin-card__center"><img data-v-0c0e7412="" src="https://d1qrhanmh6r3zb.cloudfront.net/skin/skins-images/29068/conversions/MP5-SD-|-Co-Processor-(Minimal-Wear)-webp.webp" class="skin-card__img skin-filter"><!----><!----></div><div data-v-0c0e7412="" class="hover-show skin-card__slot"><div data-v-0c0e7412="" class="d-flex jc ac"></div></div></div><span data-v-1a3f66b7="" class="icon-plus"></span><span data-v-1a3f66b7="" class="icon-checkmark"></span></div></div>"
|
7307217436e6c5822be0dac0ea840be7
|
{
"intermediate": 0.37730467319488525,
"beginner": 0.4656178057193756,
"expert": 0.15707747638225555
}
|
41,394
|
How is a queue implemented in the openjdk jvm internally?
|
0a9eb005906113e406350a0252940e6b
|
{
"intermediate": 0.5636012554168701,
"beginner": 0.10332546383142471,
"expert": 0.33307331800460815
}
|
41,395
|
Implement Vector class in c++17, for both constant and non-constant objects.
operator= is obliged to call operator= from the i-th object, if possible, and if it is impossible, then construct it in place by calling the copy constructor.
All memory work must be done through the Alloc allocator.
|
63688bf071a8fc13c1aec724b5753638
|
{
"intermediate": 0.36423206329345703,
"beginner": 0.361316978931427,
"expert": 0.27445098757743835
}
|
41,396
|
The data should be input as follows:
const string studentData[] =
{"A1,John,Smith,John1989@gm ail.com,20,30,35,40,SECURITY", "A2,Suzan,Erickson,Erickson_1990@gmailcom,19,50,30,40,NETWORK", "A3,Jack,Napoli,The_lawyer99yahoo.com,19,20,40,33,SOFTWARE", "A4,Erin,Black,Erin.black@comcast.net,22,50,58,40,SECURITY", "A5,[firstname],[lastname],[emailaddress],[age], [numberofdaystocomplete3courses],SOFTWARE"
You may not include third-party libraries. Your submission should include one zip file with all the necessary code files to compile, support, and run your application. You must also provide evidence of the programโs required functionality by taking a screen capture of the console run, saved as an image file.A. Modify the โstudentData Tableโ to include your personal information as the last item.
B. Create a C++ project in your integrated development environment (IDE) with the following files:
โข degree.h
โข student.h and student.cpp
โข roster.h and roster.cpp
โข main.cpp
Note: There must be a total of six source code files.
C. Define an enumerated data type DegreeProgram for the degree programs containing the data type values SECURITY, NETWORK, and SOFTWARE.
Note: This information should be included in the degree.h file.
D. For the Student class, do the following:
1. Create the class Student in the files student.h and student.cpp, which includes each of the following variables:
โข student ID
โข first name
โข last name
โข email address
โข age
โข array of number of days to complete each course
โข degree program
2. Create each of the following functions in the Student class:
a. an accessor (i.e., getter) for each instance variable from part D1
b. a mutator (i.e., setter) for each instance variable from part D1
c. All external access and changes to any instance variables of the Student class must be done using accessor and mutator functions.
d. constructor using all of the input parameters provided in the table
e. print() to print specific student data
|
4b710ad6b216c11da3c4904462142501
|
{
"intermediate": 0.4440973401069641,
"beginner": 0.34034430980682373,
"expert": 0.21555840969085693
}
|
41,397
|
I am making a C++ SDL based and wrapped game engine,I need your help to finish it.
First, what do you think of my IntersectLineSegment of my Rect class?
LineSegment Rect::IntersectLineSegment(const LineSegment& line)
{
int x1 = line.GetStart().GetX();
int y1 = line.GetStart().GetY();
int x2 = line.GetEnd().GetX();
int y2 = line.GetEnd().GetY();
SDL_IntersectRectAndLine(&GetRect(), &x1, &y1, &x2, &y2);
return LineSegment(Point(x1, y1), Point(x2, y2));
}
|
4891b000adba4b6d452a23e785f2c1c2
|
{
"intermediate": 0.535402774810791,
"beginner": 0.3254801630973816,
"expert": 0.1391170173883438
}
|
41,398
|
@Watch('dateStart', { immediate: true })
@Watch('dateEnd', { immediate: true })
addDate() {
this.parsedFilters({})
}
ะบะฐะบ ะฟะตัะตะฟะธัะฐัั ะฝะฐ vue 3 composition api
|
f220593f3cef497ae6ba58885010bba8
|
{
"intermediate": 0.5738130807876587,
"beginner": 0.28138020634651184,
"expert": 0.14480675756931305
}
|
41,399
|
keyboard = types.ReplyKeyboardMarkup(row_width=1, resize_keyboard=False, is_persistent=True)
keyboard.add(KeyboardButton(text='ะะพะดะฐัั ะะฐัะฒะบั ะกะตะนัะฐั! ๐')
main_page_keyboard = types.InlineKeyboardMarkup()
item1 = types.InlineKeyboardButton("โน๏ธ ะ ะฒะฐะบะฐะฝัะธะธ", callback_data='item1')
item2 = types.InlineKeyboardButton("โน๏ธ ะขัะตะฑะพะฒะฐะฝะธั", callback_data='item2')
item3 = types.InlineKeyboardButton("โน๏ธ ะะฟะปะฐัะฐ", callback_data='item3')
item4 = types.InlineKeyboardButton("โน๏ธ ะะปััั ัะฐะฑะพัั ั ะฝะฐั", callback_data='item4')
main_page_keyboard.add(item1, item2, item3, item4)
# Handles the start command to send a welcome message
@bot.message_handler(commands=['start', 'help'])
def handle_start(message):
bot.send_message(message.chat.id, "<b>ะะพะฑัะพ ะฟะพะถะฐะปะพะฒะฐัั ะฒ IBS Appะขะตัั!</b> \n\nะั ัะฐะดั, ััะพ ะฒั ะธะฝัะตัะตััะตัะตัั ะฟะพะทะธัะธะตะน ัะตััะธัะพะฒัะธะบะฐ ะผะพะฑะธะปัะฝัั
ะฟัะธะปะพะถะตะฝะธะน", reply_markup=keyboard, parse_mode='HTML')
bot.send_message(message.chat.id, "text", reply_markup=main_page_keyboard)
use the best approach to fix it
|
b1300a5c6588eece03cedb09cf90cd1f
|
{
"intermediate": 0.332635760307312,
"beginner": 0.3482922315597534,
"expert": 0.31907200813293457
}
|
41,400
|
The data should be input as follows:
const string studentData[] =
{"A1,John,Smith,John1989@gm ail.com,20,30,35,40,SECURITY", "A2,Suzan,Erickson,Erickson_1990@gmailcom,19,50,30,40,NETWORK", "A3,Jack,Napoli,The_lawyer99yahoo.com,19,20,40,33,SOFTWARE", "A4,Erin,Black,Erin.black@comcast.net,22,50,58,40,SECURITY", "A5,[firstname],[lastname],[emailaddress],[age], [numberofdaystocomplete3courses],SOFTWARE"
You may not include third-party libraries. Your submission should include one zip file with all the necessary code files to compile, support, and run your application. You must also provide evidence of the programโs required functionality by taking a screen capture of the console run, saved as an image file.
Note: Each file must be an attachment no larger than 30 MB in size.
Requirements
Your submission must be your original work. No more than a combined total of 30% of the submission and no more than a 10% match to any one individual source can be directly quoted or closely paraphrased from sources, even if cited correctly. The originality report that is provided when you submit your task can be used as a guide.
You must use the rubric to direct the creation of your submission because it provides detailed criteria that will be used to evaluate your work. Each requirement below may be evaluated by more than one rubric aspect. The rubric aspect titles may contain hyperlinks to relevant portions of the course.
Tasks may not be submitted as cloud links, such as links to Google Docs, Google Slides, OneDrive, etc., unless specified in the task requirements. All other submissions must be file types that are uploaded and submitted as attachments (e.g., .docx, .pdf, .ppt).
A. Modify the โstudentData Tableโ to include your personal information as the last item.
B. Create a C++ project in your integrated development environment (IDE) with the following files:
โข degree.h
โข student.h and student.cpp
โข roster.h and roster.cpp
โข main.cpp
Note: There must be a total of six source code files.
C. Define an enumerated data type DegreeProgram for the degree programs containing the data type values SECURITY, NETWORK, and SOFTWARE.
Note: This information should be included in the degree.h file.
D. For the Student class, do the following:
1. Create the class Student in the files student.h and student.cpp, which includes each of the following variables:
โข student ID
โข first name
โข last name
โข email address
โข age
โข array of number of days to complete each course
โข degree program
2. Create each of the following functions in the Student class:
a. an accessor (i.e., getter) for each instance variable from part D1
b. a mutator (i.e., setter) for each instance variable from part D1
c. All external access and changes to any instance variables of the Student class must be done using accessor and mutator functions.
d. constructor using all of the input parameters provided in the table
e. print() to print specific student data
E. Create a Roster class (roster.cpp) by doing the following:
1. Create an array of pointers, classRosterArray, to hold the data provided in the โstudentData Table.โ
2. Create a student object for each student in the data table and populate classRosterArray.
a. Parse each set of data identified in the โstudentData Table.โ
b. Add each student object to classRosterArray.
3. Define the following functions:
a. public void add(string studentID, string firstName, string lastName, string emailAddress, int age, int daysInCourse1, int daysInCourse2, int daysInCourse3, DegreeProgram degreeProgram) that sets the instance variables from part D1 and updates the roster.
b. public void remove(string studentID) that removes students from the roster by student ID. If the student ID does not exist, the function prints an error message indicating that the student was not found.
c. public void printAll() that prints a complete tab-separated list of student data in the provided format: A1 [tab] First Name: John [tab] Last Name: Smith [tab] Age: 20 [tab]daysInCourse: {35, 40, 55} Degree Program: Security. The printAll() function should loop through all the students in classRosterArray and call the print() function for each student.
d. public void printAverageDaysInCourse(string studentID) that correctly prints a studentโs average number of days in the three courses. The student is identified by the studentID parameter.
e. public void printInvalidEmails() that verifies student email addresses and displays all invalid email addresses to the user.
Note: A valid email should include an at sign ('@') and period ('.') and should not include a space (' ').
f. public void printByDegreeProgram(DegreeProgram degreeProgram) that prints out student information for a degree program specified by an enumerated type.
F. Demonstrate the programโs required functionality by adding a main() function in main.cpp, which will contain the required function calls to achieve the following results:
1. Print out to the screen, via your application, the course title, the programming language used, your WGU student ID, and your name.
2. Create an instance of the Roster class called classRoster.
3. Add each student to classRoster.
4. Convert the following pseudo code to complete the rest of the main() function:
classRoster.printAll();
classRoster.printInvalidEmails();
//loop through classRosterArray and for each element:
classRoster.printAverageDaysInCourse(/*current_object's student id*/);
Note: For the current_object's student id, use an accessor (i.e., getter) for the classRosterArray to access the student id.
classRoster.printByDegreeProgram(SOFTWARE);
classRoster.remove("A3");
classRoster.printAll();
classRoster.remove("A3");
//expected: the above line should print a message saying such a student with this ID was not found.
|
7bbc7097ae53dafb1305d8474c9b43d1
|
{
"intermediate": 0.2853660583496094,
"beginner": 0.41172415018081665,
"expert": 0.302909791469574
}
|
41,401
|
Create a picture of a bunny
|
55d677c54b8f59a9f0840851b0aa8801
|
{
"intermediate": 0.3654778003692627,
"beginner": 0.35315564274787903,
"expert": 0.2813665270805359
}
|
41,402
|
please make a diagram of USA government in mermaid diagram. top down to explain how the government works. make it concise and detailed and just return the diagram
|
759d956aa1e04c75d16420b23cad8d23
|
{
"intermediate": 0.4147423803806305,
"beginner": 0.25484418869018555,
"expert": 0.3304134011268616
}
|
41,403
|
is mermaid vs obsidian mermaid different?
|
fb52230c955cdc6ca19a592294eec7c4
|
{
"intermediate": 0.4229619801044464,
"beginner": 0.29140985012054443,
"expert": 0.28562816977500916
}
|
41,404
|
source
|
a4c5b0d71290f8334793a710d97fe4f2
|
{
"intermediate": 0.3218476176261902,
"beginner": 0.27129122614860535,
"expert": 0.40686115622520447
}
|
41,405
|
flowchart TD
President -->| " " | VP
President -.->| " " | Cabinet
President -->| " " | Exe_Agencies
President -->| " " | IndependentAgencies
President --> CommanderInChief
President --> ExecOrders
Cabinet & IndependentAgencies -->| " " | PolicyImplementation
President --> TreatyPowers
Congress --> Senate
Congress --> House
Senate --> SenateCommittees
House --> HouseCommittees
Senate --> SenateAdviseConsent
Congress --> CongressionalBudgetOffice
Congress --> LegislativeProcess
Senate --> SenateImpeachmentPower
House --> HouseImpeachmentPower
SenateCommittees & HouseCommittees --> InvestigationOversight
LegislativeProcess --> BillPassing
BillPassing --> PresidentSign
SCOTUS --> LowerCourts
JudicialSysOps -.->| " " | SCOTUS
JudicialSysOps -.->| " " | LowerCourts
SCOTUS --> JudicialReview
President -. AppointJudges .->| " " | SCOTUS
SenateAdviseConsent -. ConfirmJudges .->| " " | SCOTUS
President --> CommanderInChief[โCommander In Chief (Military)โ]
President --> ExecOrders[โExecutive Ordersโ]
Cabinet & IndependentAgencies --> PolicyImplementation[โPolicy Implementationโ]
President --> TreatyPowers[โTreaty Powersโ]
Senate --> SenateImpeachmentPower[โImpeachment Trialsโ]
House --> HouseImpeachmentPower[โImpeachment Chargesโ]
SenateCommittees & HouseCommittees --> InvestigationOversight[โInvestigations & Oversightโ]
LegislativeProcess --> BillPassing[โBill Passingโ]
BillPassing --> PresidentSign[โPresident Review (Sign or Veto)โ]
SCOTUS --> JudicialReview[โJudicial Review (Check on Executive & Legislative)โ]
President -. AppointJudges .-> SCOTUS
SenateAdviseConsent -. ConfirmJudges .-> SCOTUS
remove the quotes and place the proper label inside the proper box. fix the colon on the end of each line
|
ff0fad96709dde62501539b86a846a69
|
{
"intermediate": 0.30774036049842834,
"beginner": 0.36163321137428284,
"expert": 0.3306264579296112
}
|
41,407
|
graph TD
President -->|Directs| VP
President -.->|Advisory Role| Cabinet
President -->|Oversees| Exe_Agencies
President -->|Oversees| IndependentAgencies
President -->|Commander In Chief of Military| CommanderInChief
President -->|Issues| ExecOrders[โExecutive Ordersโ]
Cabinet & IndependentAgencies -->|Implement Policies| PolicyImplementation
President -->|Negotiates and Signs| TreatyPowers[โTreaty Powersโ]
Congress -->|Consists of| Senate
Congress -->|Consists of| House
Senate -->|Has Various Committees| SenateCommittees
House -->|Has Various Committees| HouseCommittees
Senate -->|Provides โAdvise & Consentโ| SenateAdviseConsent
Congress -->|Analytical Support| CongressionalBudgetOffice
Congress -->|Creates Laws| LegislativeProcess
Senate -->|Conducts Impeachment Trials| SenateImpeachmentPower[โImpeachment Trialsโ]
House -->|Levels Impeachment Charges| HouseImpeachmentPower[โImpeachment Chargesโ]
SenateCommittees & HouseCommittees -->|Conduct| InvestigationOversight[โInvestigations & Oversightโ]
LegislativeProcess -->|Processes Bills for Passing| BillPassing[โBill Passingโ]
BillPassing -->|Presented to President for Signature| PresidentSign[โPresident Review (Sign or Veto)โ]
SCOTUS -->|Oversees| LowerCourts
JudicialSysOps -.->|Operational Management| SCOTUS
JudicialSysOps -.->|Operational Management| LowerCourts
SCOTUS -->|Reviews Constitutionality| JudicialReview[โJudicial Review (Check on Executive & Legislative)โ]
President -.->|Appoints| AppointJudges
SenateAdviseConsent -.->|Confirms| ConfirmJudges
AppointJudges --> SCOTUS
ConfirmJudges --> SCOTUS
this is a graph td of us government. do the same for the danish government. make a graph TD of the danish government. make it accurate, detailed and concise to explain the danish government structure
|
3a2a6f61dd655c00e4ddc1f63229e064
|
{
"intermediate": 0.3818194568157196,
"beginner": 0.20067061483860016,
"expert": 0.41750994324684143
}
|
41,408
|
Unrecognized Token C/C++ meaning
|
f69c0728c45b71f208ebba65354fd292
|
{
"intermediate": 0.31981784105300903,
"beginner": 0.4390474259853363,
"expert": 0.24113476276397705
}
|
41,409
|
Make a program like google translate but when you enter in something in English, it puts out a language called baby, which is just gibberish, write this in html
|
372ccf805f1d66d7ba7bea29e587c540
|
{
"intermediate": 0.27294251322746277,
"beginner": 0.19562861323356628,
"expert": 0.531428873538971
}
|
41,410
|
Create an array named quandaleDingle with 3 default boolean values.
|
072a3cfdb4edf5611b8082f7a245a3b5
|
{
"intermediate": 0.42824646830558777,
"beginner": 0.3218286633491516,
"expert": 0.24992488324642181
}
|
41,411
|
telebot. i want to ask a sequence of questions, wait for response, put every answer in a list. the first line in the list is users chat id. the trigger for sequence is /begin command
ะะฐะบ ะฒะฐั ะทะพะฒัั?
ะะดะต ะฒั ัะตะนัะฐั ะฟัะพะถะธะฒะฐะตัะต? (ะณะพัะพะด, ัััะฐะฝะฐ)
ะะฐะบ ั ะฒะฐะผะธ ะผะพะถะฝะพ ัะฒัะทะฐัััั? (ะฝะพะผะตั ัะตะปะตัะพะฝะฐ ะธะปะธ email)
ะะฐะบะธะต ะพะฟะตัะฐัะธะพะฝะฝัะต ัะธััะตะผั ะธ ััััะพะนััะฒะฐ ั ะฒะฐั ะตััั ะดะปั ัะตััะธัะพะฒะฐะฝะธั ะฟัะธะปะพะถะตะฝะธะน? (iOS, Android, ะดััะณะธะต)
ะฃะบะฐะถะธัะต ะฒะฐัะต ะพะฑัะฐะทะพะฒะฐะฝะธะต ะธ ะบะฐะบะธะต-ะปะธะฑะพ ัะพะพัะฒะตัััะฒัััะธะต ัะตััะธัะธะบะฐัะธะธ ะฒ ะพะฑะปะฐััะธ IT ะธ ัะตััะธัะพะฒะฐะฝะธั.
ะ ะบะฐะบะพะต ะฒัะตะผั ะฒั ะฟัะตะดะฟะพัะธัะฐะตัะต ัะฐะฑะพัะฐัั?
ะะฐ ะบะฐะบะธั
ัะทัะบะฐั
ะฒั ะผะพะถะตัะต ะณะพะฒะพัะธัั ะธ ะฟะธัะฐัั?
ะััั ะปะธ ั ะฒะฐั ััะฐะฑะธะปัะฝะพะต ะธะฝัะตัะฝะตั-ัะพะตะดะธะฝะตะฝะธะต ะธ ะฒะพะทะผะพะถะฝะพััั ัะตััะธัะพะฒะฐัั ะฟัะธะปะพะถะตะฝะธั ะฑะตะท ะฟะตัะตะฑะพะตะฒ?
ะญัะฐ ัะฐะฑะพัะฐ ะฟัะตะดะฝะฐะทะฝะฐัะตะฝะฐ ะธัะบะปััะธัะตะปัะฝะพ ะดะปั ะฒะปะฐะดะตะปััะตะฒ ััััะพะนััะฒ ะฝะฐ ะพะฟะตัะฐัะธะพะฝะฝะพะน ัะธััะตะผะต Android. ะะพะถะฐะปัะนััะฐ, ะฟะพะดัะฒะตัะดะธัะต, ััะพ ั ะฒะฐั ะตััั ััััะพะนััะฒะพ Android, ะบะพัะพัะพะต ะฒั ะผะพะถะตัะต ะธัะฟะพะปัะทะพะฒะฐัั ะดะปั ัะตััะธัะพะฒะฐะฝะธั ะฟัะธะปะพะถะตะฝะธะน
ะฃะบะฐะถะธัะต, ะตััั ะปะธ ั ะฒะฐั ะพะฟัั ะธัะฟะพะปัะทะพะฒะฐะฝะธั Telegram ะธ ะดััะณะธั
ะผะตััะตะฝะดะถะตัะพะฒ ะดะปั ัะฐะฑะพัะตะณะพ ะพะฑัะตะฝะธั ะธ ะฒัะฟะพะปะฝะตะฝะธั ะทะฐะดะฐั.
ะะพัะตะผั ะฒั ะทะฐะธะฝัะตัะตัะพะฒะฐะฝั ะฒ ะดะพะปะถะฝะพััะธ ัะตััะธัะพะฒัะธะบะฐ ะผะพะฑะธะปัะฝัั
ะฟัะธะปะพะถะตะฝะธะน?
ะะฐะบะธะต ะฒะฐัะธ ะปะธัะฝัะต ะบะฐัะตััะฒะฐ ะฟะพะผะพะณัั ะฒะฐะผ ะฑััั ััะฟะตัะฝัะผ ะฒ ััะพะน ัะพะปะธ?
|
4c47c132ff585fbdf57f8bb9fbbf6e02
|
{
"intermediate": 0.23385819792747498,
"beginner": 0.6769117116928101,
"expert": 0.08923006057739258
}
|
41,412
|
to hold a cell size in model list of flask admin
|
a0737ea56a5b8aa836048581e2904311
|
{
"intermediate": 0.3888644278049469,
"beginner": 0.2724347710609436,
"expert": 0.3387007713317871
}
|
41,413
|
ETL In Real time stream systemย ย (Photo upload stream process)
Focus on designing important metrics and E2E ETL process
Q1: (a product sense question) What metrics would you use to evaluate if a feature in the photo upload application is effective or not? What data would you collect? --> Photo upload APP?
|
77c0d0512d50382ab46583c1a083b46c
|
{
"intermediate": 0.32076436281204224,
"beginner": 0.4613182544708252,
"expert": 0.21791739761829376
}
|
41,414
|
Height [150 ; 165[ [165 ; 170[ [170 ; 175 [ [175 ; 180 [ [180 , 200[
Individuals 120 180 250 150 100
1. Plot the histogram of this distribution.
2. Determine the median by linear interpolation (calculations may be done without a calculator).
3. Determine Q1 and Q3.
|
dd61afe1de6f3b3d9799c49f15e95f7e
|
{
"intermediate": 0.43442651629447937,
"beginner": 0.28906112909317017,
"expert": 0.27651238441467285
}
|
41,415
|
import math
x = float(input("ะะฒะตะดะธัะต ะทะฝะฐัะตะฝะธะต x (x > 1): "))
precision = 0.5e-6
a_prev = x
n = 1
while True:
a = math.sqrt(math.sin(5 + a_prev**3) / x**n + 4)
if abs(a - a_prev) < precision:
break
a_prev = a
n += 1
print(f"ะัะตะดะตะป ะฟะพัะปะตะดะพะฒะฐัะตะปัะฝะพััะธ: {a}, ะฟัะธ {n} ัะปะตะฝะฐั
")
ะผะพะถะตัั ะฝะฐะฟะธัะฐัั ะฑะตะท ััะฝะบัะธะธ
|
336fb6eab8ef915d932c4675a1f1a56d
|
{
"intermediate": 0.3507825434207916,
"beginner": 0.41732630133628845,
"expert": 0.2318912297487259
}
|
41,416
|
How do I make a function that dictates how fast text is printed in terminal using the user's wpm
|
6a5688f7c5735ad1aae80e124c1904c9
|
{
"intermediate": 0.37144920229911804,
"beginner": 0.2072983831167221,
"expert": 0.42125245928764343
}
|
41,417
|
I have data which is organized into a JSON, which in-turn has multiple JSONS within it.
In each individual JSON there are 4 fields, Name, SSN, DOB and Address, and for each of the 4 fields, there are 3 values, one provided by the applicant, one pulled from the credit report and another from their lexisnexis report.
I am going to supply this entire data set to a Large Language Model which would be running prompts to check if the data received from these 3 sources match or not.
Now, for each of these fields I have written a different prompt to ask the model to perform the matching.
I have a locally hosted a large language model, to which I would want to supply this information both the dataset and the prompt via some sort of code to make it perform the analysis and give me the outputs.
How can I do this?
|
7dfe0c58400b7500ea5873cd9669649f
|
{
"intermediate": 0.5498525500297546,
"beginner": 0.2056833952665329,
"expert": 0.24446401000022888
}
|
41,418
|
Using recursion, complete the body of the following Statement instance method.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Pretty prints {@code this} to the given stream {@code out} {@code offset}
* spaces from the left margin using
* {@link components.program.Program#INDENT_SIZE Program.INDENT_SIZE} spaces
* for each indentation level.
*
* @param out
* the output stream
* @param offset
* the number of spaces to be placed before every nonempty line
* of output; nonempty lines of output that are indented further
* will, of course, continue with even more spaces
* @updates out.content
* @requires out.is_open and 0 <= offset
* @ensures <pre>
* out.content =
* #out.content * [this pretty printed offset spaces from the left margin
* using Program.INDENT_SIZE spaces for indentation]
* </pre>
*/
public void prettyPrint(SimpleWriter out, int offset) {
switch (this.kind()) {
case BLOCK: {
// TODO - fill in case
break;
}
case IF: {
// TODO - fill in case
break;
}
case IF_ELSE: {
// TODO - fill in case
break;
}
case WHILE: {
// TODO - fill in case
break;
}
case CALL: {
// TODO - fill in case
break;
}
default: {
// this will never happen...
break;
}
}
}
Here is an example of what prettyPrint should output (with offset 0 from the left edge of the page):
IF next-is-not-enemy THEN
turnleft
WHILE true DO
IF random THEN
move
turnback
IF next-is-not-wall THEN
move
END IF
infect
move
ELSE
go-for-it
WHILE next-is-empty DO
END WHILE
turnleft
turnright
END IF
END WHILE
turnright
skip
skip-again
END IF
|
1a165abc7fdf2163a7306f180e740a0b
|
{
"intermediate": 0.3471212089061737,
"beginner": 0.43622472882270813,
"expert": 0.21665413677692413
}
|
41,419
|
Using recursion, complete the body of the following static method.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* Refactors the given {@code Statement} by renaming every occurrence of
* instruction {@code oldName} to {@code newName}. Every other statement is
* left unmodified.
*
* @param s
* the {@code Statement}
* @param oldName
* the name of the instruction to be renamed
* @param newName
* the new name of the renamed instruction
* @updates s
* @requires [newName is a valid IDENTIFIER]
* @ensures <pre>
* s = [#s refactored so that every occurrence of instruction oldName
* is replaced by newName]
* </pre>
*/
public static void renameInstruction(Statement s, String oldName,
String newName) {...}
Using the method above, complete the body of the following static method.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* Refactors the given {@code Program} by renaming instruction
* {@code oldName}, and every call to it, to {@code newName}. Everything
* else is left unmodified.
*
* @param p
* the {@code Program}
* @param oldName
* the name of the instruction to be renamed
* @param newName
* the new name of the renamed instruction
* @updates p
* @requires <pre>
* oldName is in DOMAIN(p.context) and
* [newName is a valid IDENTIFIER] and
* newName is not in DOMAIN(p.context)
* </pre>
* @ensures <pre>
* p = [#p refactored so that instruction oldName and every call
* to it are replaced by newName]
* </pre>
*/
public static void renameInstruction(Program p, String oldName,
String newName) {...}
You may hand-draw your answer to this question. Recalling how much we care that you use correct punctuation when you write objects' values, and using the notation of slides 9 through 12 from Program, but fully drawing each abstract syntax tree involved, show the value of p at the end of the following code snippet.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Program p = new Program1();
Map<String, Statement> context = p.newContext();
Statement block = p.newBody();
Statement s = block.newInstance();
p.setName("Get-to-Edge-and-Wait-for-Infection");
s.assembleCall("walk");
block.addToBlock(0, s);
s.assembleCall("run");
block.addToBlock(block.lengthOfBlock(), s);
s.assembleWhile(Condition.NEXT_IS_NOT_WALL, block);
block.addToBlock(0, s);
p.swapBody(block);
s.assembleCall("move");
block.addToBlock(0, s);
s.assembleCall("move");
block.addToBlock(block.lengthOfBlock(), s);
context.add("run", block);
s.assembleCall("move");
block = block.newInstance();
block.addToBlock(0, s);
context.add("walk", block);
p.swapContext(context);
Consider the occurrence on line 19 of the code snippet above of block = block.newInstance(). What would probably have happened if that statement had been replaced by block.clear()? In other words, what is the difference between the two statements? You may hand-draw a diagram to show the difference. (Hint: which are the only two lines in the code snippet in which the statement executed would introduce an alias to a mutable object? (Hint: all contracts in our components catalog advertise every introduction of an alias to a mutable object.))
|
0322920d89506b02b73db8bc5745af81
|
{
"intermediate": 0.37031272053718567,
"beginner": 0.41965657472610474,
"expert": 0.2100306898355484
}
|
41,420
|
Complete the body of the following private static method.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Returns the first "word" (maximal length string of characters not in
* {@code SEPARATORS}) or "separator string" (maximal length string of
* characters in {@code SEPARATORS}) in the given {@code text} starting at
* the given {@code position}.
*
* @param text
* the {@code String} from which to get the word or separator
* string
* @param position
* the starting index
* @return the first word or separator string found in {@code text} starting
* at index {@code position}
* @requires 0 <= position < |text|
* @ensures <pre>
* nextWordOrSeparator =
* text[position, position + |nextWordOrSeparator|) and
* if entries(text[position, position + 1)) intersection entries(SEPARATORS) = {}
* then
* entries(nextWordOrSeparator) intersection entries(SEPARATORS) = {} and
* (position + |nextWordOrSeparator| = |text| or
* entries(text[position, position + |nextWordOrSeparator| + 1))
* intersection entries(SEPARATORS) /= {})
* else
* entries(nextWordOrSeparator) is subset of entries(SEPARATORS) and
* (position + |nextWordOrSeparator| = |text| or
* entries(text[position, position + |nextWordOrSeparator| + 1))
* is not subset of entries(SEPARATORS))
* </pre>
*/
private static String nextWordOrSeparator(String text, int position) {...}
This is a modified version of the method you wrote in a homework and lab in Software I. Feel free to reuse your own code (but not someone else's) for this homework. Note that the method here has one less parameter than in the Software I version. The "separators" are defined as a String constant as follows:
/**
* Definition of whitespace separators.
*/
private static final String SEPARATORS = " \t\n\r";
Complete the body of the following public static method. You should use nextWordOrSeparator in your solution because (except for END_OF_INPUT as explained below) "non-separator token" and "non-whitespace token" here mean "word" as used in nextWordOrSeparator.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
* Tokenizes the entire input getting rid of all whitespace separators and
* returning the non-separator tokens in a {@code Queue<String>}.
*
* @param in
* the input stream
* @return the queue of tokens
* @updates in.content
* @requires in.is_open
* @ensures <pre>
* tokens =
* [the non-whitespace tokens in #in.content] * <END_OF_INPUT> and
* in.content = <>
* </pre>
*/
public static Queue<String> tokens(SimpleReader in) {...}
The END_OF_INPUT token used in the ensures clause is defined as a String constant as follows:
/**
* Token to mark the end of the input. This token cannot come from the input
* stream because it contains whitespace.
*/
public static final String END_OF_INPUT = "### END OF INPUT ###";
|
21f0d0a5293339f612b6822e7fa4f8e2
|
{
"intermediate": 0.3547467291355133,
"beginner": 0.39182737469673157,
"expert": 0.2534259259700775
}
|
41,421
|
Using the grammar for real-number constants discussed in class, write a set of rewrite rules for signed real-number constants that allow an optional sign at the front of the constants. Use signed-real-const as the new start symbol. You can reuse as much or as little of the real-number constant grammar rules as you deem appropriate. Examples of valid signed real-number constants are:
-3.56, +17.E09, 4.95
Using the following rewrite rules for Boolean expressions, give a derivation for the Boolean expression (NOT((F AND T)) OR F). Also draw a derivation tree corresponding to the derivation.
bool-exp โ T |
โ F |
โ NOT ( bool-exp ) |
โ ( bool-exp AND bool-exp ) |
โ ( bool-exp OR bool-exp )
Using the following rewrite rules for Boolean expressions, find two different derivation trees for the Boolean expression NOT(T OR T AND F).
bool-exp โ T |
โ F |
โ NOT ( bool-exp ) |
โ bool-exp AND bool-exp |
โ bool-exp OR bool-exp
Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4.
expr โ expr add-op term | term
term โ term mult-op factor | factor
factor โ ( expr ) | digit-seq
add-op โ + | -
mult-op โ * | DIV | MOD
digit-seq โ digit digit-seq | digit
digit โ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4.
expr โ term { add-op term }
term โ factor { mult-op factor }
factor โ ( expr ) | digit-seq
add-op โ + | -
mult-op โ * | DIV | MOD
digit-seq โ digit digit-seq | digit
digit โ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Note: A pair of new special symbols ('{' and '}') is used in the rewrite rules above. The meaning of {...} is that the string of nonterminal and terminal symbols appearing between { and } can be repeated 0 or more times. For instance, the first rewrite rule:
expr โ term { add-op term }
is equivalent to the following (infinite) set of rewrite rules:
expr โ term |
โ term add-op term |
โ term add-op term add-op term |
โ term add-op term add-op term add-op term |
โ ...
|
9f2827012f22484adede9ef8ce3eae49
|
{
"intermediate": 0.26716482639312744,
"beginner": 0.39080092310905457,
"expert": 0.342034250497818
}
|
41,422
|
Consider the following grammar for arithmetic expressions. It is similar to the one discussed in class.
expr โ term { + term | - term }
term โ factor { * factor | / factor }
factor โ ( expr ) | digit-seq
digit-seq โ digit { digit }
digit โ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
The recursive descent parser to evaluate syntactically valid arithmetic expressions has five methods corresponding to each of the five non-terminal symbols of this grammar. A tokenizer is not used for this parser. Instead, each method gets input characters from a StringBuilder parameter called source. You can assume that the source argument does not contain any white space or any other characters not part of the expression except for at least one "sentinel" character after the end of the expression to mark the end. In other words, any proper prefix of the argument can contain only characters from the set {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '(', ')', '+', '-', '*', '/'}. You can further assume that the input is syntactically valid, so that no error checking is necessary.
Here are few more hints:
A string s1 being a proper prefix of a string s2 means both that the length of s1 is strictly less than (less than but not equal to) the length of s2 and that s1 is a prefix of s2.
The instance methods charAt(int) and deleteCharAt(int) defined in StringBuilder will be useful to manipulate the input.
The static methods isDigit(char) and digit(char, int) in class Character can be used to check if a character is a digit and to convert a digit character into the corresponding integer value, respectively.
Write the code for the following 5 methods making sure you use the grammar above as a guide (as discussed in class and in Recursive-Descent Parsing).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* Evaluates an expression and returns its value.
*
* @param source
* the {@code StringBuilder} that starts with an expr string
* @return value of the expression
* @updates source
* @requires <pre>
* [an expr string is a proper prefix of source, and the longest
* such, s, concatenated with the character following s, is not a prefix
* of any expr string]
* </pre>
* @ensures <pre>
* valueOfExpr =
* [value of longest expr string at start of #source] and
* #source = [longest expr string at start of #source] * source
* </pre>
*/
public static int valueOfExpr(StringBuilder source) {...}
/**
* Evaluates a term and returns its value.
*
* @param source
* the {@code StringBuilder} that starts with a term string
* @return value of the term
* @updates source
* @requires <pre>
* [a term string is a proper prefix of source, and the longest
* such, s, concatenated with the character following s, is not a prefix
* of any term string]
* </pre>
* @ensures <pre>
* valueOfTerm =
* [value of longest term string at start of #source] and
* #source = [longest term string at start of #source] * source
* </pre>
*/
private static int valueOfTerm(StringBuilder source) {...}
/**
* Evaluates a factor and returns its value.
*
* @param source
* the {@code StringBuilder} that starts with a factor string
* @return value of the factor
* @updates source
* @requires <pre>
* [a factor string is a proper prefix of source, and the longest
* such, s, concatenated with the character following s, is not a prefix
* of any factor string]
* </pre>
* @ensures <pre>
* valueOfFactor =
* [value of longest factor string at start of #source] and
* #source = [longest factor string at start of #source] * source
* </pre>
*/
private static int valueOfFactor(StringBuilder source) {...}
/**
* Evaluates a digit sequence and returns its value.
*
* @param source
* the {@code StringBuilder} that starts with a digit-seq string
* @return value of the digit sequence
* @updates source
* @requires <pre>
* [a digit-seq string is a proper prefix of source, which
* contains a character that is not a digit]
* </pre>
* @ensures <pre>
* valueOfDigitSeq =
* [value of longest digit-seq string at start of #source] and
* #source = [longest digit-seq string at start of #source] * source
* </pre>
*/
private static int valueOfDigitSeq(StringBuilder source) {...}
/**
* Evaluates a digit and returns its value.
*
* @param source
* the {@code StringBuilder} that starts with a digit
* @return value of the digit
* @updates source
* @requires 1 < |source| and [the first character of source is a digit]
* @ensures <pre>
* valueOfDigit = [value of the digit at the start of #source] and
* #source = [digit string at start of #source] * source
* </pre>
*/
private static int valueOfDigit(StringBuilder source) {...}
|
bb20ca1c237f80bc543dd8c042c32bba
|
{
"intermediate": 0.38323312997817993,
"beginner": 0.3644908666610718,
"expert": 0.25227606296539307
}
|
41,423
|
Consider the following grammar for Boolean expressions.
bool-expr โ T |
โ F |
โ NOT ( bool-expr ) |
โ ( bool-expr binary-op bool-expr )
binary-op โ AND | OR
The recursive descent parser to evaluate syntactically valid Boolean expressions has a single method corresponding to the bool-expr start symbol of this grammar. A tokenizer is used to convert the input into a queue of tokens (Queue<String>) given as the argument to the parser. The tokenizer takes care of the binary-op non-terminal symbol by returning "AND" and "OR" as single tokens. You can assume that the input is syntactically valid, so that no error checking is necessary. Here is a sample value for #tokens. It represents a a boolean expression whose parse tree only has height 3. Other incoming values can be more complicated. Note that, as terminal symbols, parentheses can be part of a boolean expression. The given sample value represents the boolean expression:
NOT ( F )
A possible sample value promised for #tokens could be:
<"NOT", "(", "F", ")", "### END OF INPUT ###">
In this case the outgoing value of tokens should be:
<"### END OF INPUT ###">
Do not test for equality against "### END OF INPUT ###" or test against the length of tokens. Another sample value for the same boolean expression could be:
<"NOT", "(", "F", ")", ")", "### END OF INPUT ###">
In this latter case the outgoing value of tokens should be:
<")", "### END OF INPUT ###">
Finally, yet another sample value for the same boolean expression could be:
<"NOT", "(", "F", ")">
In this last case the outgoing value of tokens should be:
<>
Write the code for the following method making sure you use the grammar above as a guide (as discussed in class and in Recursive-Descent Parsing).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
* Evaluates a Boolean expression and returns its value.
*
* @param tokens
* the {@code Queue<String>} that starts with a bool-expr string
* @return value of the expression
* @updates tokens
* @requires [a bool-expr string is a prefix of tokens]
* @ensures <pre>
* valueOfBoolExpr =
* [value of longest bool-expr string at start of #tokens] and
* #tokens = [longest bool-expr string at start of #tokens] * tokens
* </pre>
*/
public static boolean valueOfBoolExpr(Queue<String> tokens) {...}
As practice for the final exam (recursive-descent parsers will not be a topic for the upcoming second midterm exam), you should first write the code without any assistance from Eclipse. However, if you would like to test your code, you can paste it in this BooleanExpressionEvaluator.java skeleton file. You may also want to develop a JUnit test fixture to test your parser as extra practice. For this homework, just turn in a print-out of the code for valueOfBoolExpr.
|
68ad126dc19e8c86020150852712a4c0
|
{
"intermediate": 0.39171701669692993,
"beginner": 0.33954963088035583,
"expert": 0.26873332262039185
}
|
41,424
|
Translate the following four BL programs into their executable form in the tables next to each example using the code generation "patterns" discussed in class (especially slides 30-47). Use only the primitives: MOVE, TURNLEFT, TURNRIGHT, INFECT, SKIP, and HALT; unconditional jump: JUMP; and the conditional jumps: JUMP_IF_NOT_NEXT_IS_EMPTY, JUMP_IF_NOT_NEXT_IS_NOT_EMPTY, etc.) Note that the tables may be bigger than the actual length of the generated code.
PROGRAM Example1 IS
BEGIN
IF next-is-wall THEN
turnright
turnright
infect
END IF
END Example1
0
1
2
3
4
5
6
7
8
9
10
PROGRAM Example2 IS
BEGIN
IF next-is-wall THEN
turnright
turnright
infect
ELSE
infect
move
END IF
END Example2
0
1
2
3
4
5
6
7
8
9
10
PROGRAM Example3 IS
BEGIN
WHILE next-is-not-empty DO
IF next-is-wall THEN
turnright
turnright
infect
ELSE
infect
move
END IF
END WHILE
END Example3
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PROGRAM Example4 IS
INSTRUCTION TurnBackAndInfect IS
turnright
turnright
IF next-is-enemy THEN
infect
END IF
END TurnBackAndInfect
BEGIN
WHILE true DO
TurnBackAndInfect
END WHILE
END Example4
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Complete the body of the following public static method. A discussion of the BugsWorld virtual machine and its instruction set and of Java enumerated types is in the Code Generation slides. Review your code carefully and trace it on some examples.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Returns the location of the next primitive instruction to execute in
* compiled program {@code cp} given what the bug sees {@code wbs} and
* starting from location {@code pc}.
*
* @param cp
* the compiled program
* @param wbs
* the {@code CellState} indicating what the bug sees
* @param pc
* the program counter
* @return the location of the next primitive instruction to execute
* @requires <pre>
* [cp is a valid compiled BL program] and
* 0 <= pc < cp.length and
* [pc is the location of an instruction byte code in cp, that is, pc
* cannot be the location of an address]
* </pre>
* @ensures <pre>
* [return the address of the next primitive instruction that
* should be executed in program cp given what the bug sees wbs and
* starting execution at address pc in program cp]
* </pre>
*/
public static int nextPrimitiveInstructionAddress(int[] cp, CellState wbs,
int pc) {...}
In implementing nextPrimitiveInstructionAddress, you will need the following enum type and two methods that will be provided for you (i.e., you do not need to implement them yourself):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* BugsWorld possible cell states.
*/
enum CellState {
EMPTY, WALL, FRIEND, ENEMY;
}
/**
* Returns whether the given integer is the byte code of a BugsWorld virtual
* machine primitive instruction (MOVE, TURNLEFT, TURNRIGHT, INFECT, SKIP,
* HALT).
*
* @param byteCode
* the integer to be checked
* @return true if {@code byteCode} is the byte code of a primitive
* instruction or false otherwise
* @ensures <pre>
* isPrimitiveInstructionByteCode =
* [true iff byteCode is the byte code of a primitive instruction]
* </pre>
*/
private static boolean isPrimitiveInstructionByteCode(int byteCode) {...}
/**
* Returns the value of the condition in the given conditional jump
* {@code condJump} given what the bug sees {@code wbs}. Note that if
* {@code condJump} is the byte code for the conditional jump
* JUMP_IF_NOT_condition, the value returned is the value of the "condition"
* part of the jump instruction.
*
* @param wbs
* the {@code CellState} indicating what the bug sees
* @param condJump
* the byte code of a conditional jump
* @return the value of the conditional jump condition
* @requires [condJump is the byte code of a conditional jump]
* @ensures <pre>
* conditionalJumpCondition =
* [the value of the condition of condJump given what the bug sees wbs]
* </pre>
*/
private static boolean conditionalJumpCondition(CellState wbs, int condJump) {...}
|
2eebf97b81641b8a53144e7e200001ed
|
{
"intermediate": 0.3365248441696167,
"beginner": 0.319741427898407,
"expert": 0.34373369812965393
}
|
41,425
|
Using recursion, complete the body of the following static method. The code generated by generateCodeForStatement must match the code-generation patterns described in Code Generation (slides 39-47). Use the code for the case IF as a guide for the other cases.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Generates the sequence of virtual machine instructions ("byte codes")
* corresponding to {@code s} and appends it at the end of {@code cp}.
*
* @param s
* the {@code Statement} for which to generate code
* @param context
* the {@code Context} in which to find user defined instructions
* @param cp
* the {@code Sequence} containing the generated code
* @updates cp
* @ensures <pre>
* if [all instructions called in s are either primitive or
* defined in context] and
* [context does not include any calling cycles, i.e., recursion] then
* cp = #cp * [sequence of virtual machine "byte codes" corresponding to s]
* else
* [reports an appropriate error message to the console and terminates client]
* </pre>
*/
private static void generateCodeForStatement(Statement s,
Map<String, Statement> context, Sequence<Integer> cp) {
final int dummy = 0;
switch (s.kind()) {
case BLOCK: {
// TODO - fill in case
break;
}
case IF: {
Statement b = s.newInstance();
Condition c = s.disassembleIf(b);
cp.add(cp.length(), conditionalJump(c).byteCode());
int jump = cp.length();
cp.add(cp.length(), dummy);
generateCodeForStatement(b, context, cp);
cp.replaceEntry(jump, cp.length());
s.assembleIf(c, b);
break;
}
case IF_ELSE: {
// TODO - fill in case
break;
}
case WHILE: {
// TODO - fill in case
break;
}
// remaining case CALL goes here
}
}
In lab you will be given an implementation for the following static method needed to implement generateCodeForStatement.
/**
* Converts {@code Condition} into corresponding conditional jump
* instruction byte code.
*
* @param c
* the {@code Condition} to be converted
* @return the conditional jump instruction byte code corresponding to
* {@code c}
* @ensures <pre>
* conditionalJump =
* [conditional jump instruction byte code corresponding to c]
* </pre>
*/
private static Instruction conditionalJump(Condition c) {...}
|
624d0d4e44726d2c546c3e2626a2903d
|
{
"intermediate": 0.36296340823173523,
"beginner": 0.3960355818271637,
"expert": 0.24100103974342346
}
|
41,426
|
For this homework, you will design the interfaces for a new component family, WaitingLine. WaitingLine is trying to capture the idea of a waiting line like you might encounter at a restaurant. Customers upon arriving at the restaurant have their name added to the end of the waiting line; they can ask for their position in the waiting line and perhaps later decide to leave and ask to be removed from the waiting line. Customers are seated in the order in which they are added to the waiting line. Note that a restaurant is just one example of where such a waiting line may be useful. There are many other situations where waiting lines occur and your components should be applicable to such other situations as well. WaitingLine is similar to Queue in that it provides a FIFO (first-in-first-out) order of processing, but differs from Queue in the following significant ways:
The entries in a WaitingLine must be unique.
It must be possible to remove a given entry known to be in a WaitingLine.
It must be possible to find the position of a given entry in a WaitingLine.
Starting from the interfaces Standard, QueueKernel, and Queue, design new interfaces WaitingLineKernel and WaitingLine to capture the behavior of a waiting line. For this homework, turn in PDF print-outs of the WaitingLineKernel.java and WaitingLine.java files.
|
4ea1a2793401e9b96b49181f7c446861
|
{
"intermediate": 0.4100129306316376,
"beginner": 0.2638111114501953,
"expert": 0.32617589831352234
}
|
41,427
|
What metrics would you use to evaluate if a feature in the photo upload application is effective or not? What data would you collect?
|
a6e073fae7b926a088a1aa0e9b126613
|
{
"intermediate": 0.3641084134578705,
"beginner": 0.19372053444385529,
"expert": 0.4421711266040802
}
|
41,428
|
Hi Can you be a senior JavaScript developer and answer my questions.
|
ab196ea9b3cbb772d9a924e0205abf46
|
{
"intermediate": 0.4694862365722656,
"beginner": 0.3374622166156769,
"expert": 0.1930515170097351
}
|
41,429
|
Please be a senior JS developer and help to solve: replace the 'XXXAccel ID = ' in main string '<a href="">Accel ID = XXXAccel ID = TEST2</a>' to 'XXX</a><a href="">Accel ID = '
|
3deff9faeb59b63ba0d253d3ec979fb7
|
{
"intermediate": 0.44155892729759216,
"beginner": 0.3536417782306671,
"expert": 0.20479926466941833
}
|
41,430
|
Please be a senior JS developer and help to solve: replace the 'XXXAccel ID = โ in main string โAccel ID = XXXAccel ID = TEST2โ to 'XXXAccel ID = โ
|
b55bd2bda2d6208aa04d6da4150c1d18
|
{
"intermediate": 0.47193416953086853,
"beginner": 0.3552040457725525,
"expert": 0.17286182940006256
}
|
41,431
|
Please be a senior JS developer and help to solve: replace the 'XXXAccel ID = โ in main string โAccel ID = XXXAccel ID = TEST2โ to 'XXXAccel ID = โ
|
b36e83808d8bbcfb9d787e600c846f60
|
{
"intermediate": 0.47193416953086853,
"beginner": 0.3552040457725525,
"expert": 0.17286182940006256
}
|
41,432
|
como hacer un los unit test para este cรณdigo en .net c#
public async Task<IResponse<ValidacionExistenciaModelOutput>> ValidarExistenciaAsync(
IRequestBody<ValidacionExistenciaModelInput> validacionExistenciaModel
)
{
try
{
var result = await _personasService.ObtenerInfoPersonaFisicaAsync(validacionExistenciaModel.Body.IdPersona);
if (result == null)
{
return Responses.NotFound<ValidacionExistenciaModelOutput>(
ErrorCode.PersonaInexistente.ErrorDescription
);
}
var usuario = await _usuarioRepository.GetUserInformationByTaxNumberAsync(result.numero_tributario);
if (usuario == null)
{
return Responses.NotFound<ValidacionExistenciaModelOutput>(
ErrorCode.UsuarioInexistente.ErrorDescription
);
}
var existenciaModelOutput = new ValidacionExistenciaModelOutput();
existenciaModelOutput.PersonId = validacionExistenciaModel.Body.IdPersona;
return Responses.Ok(existenciaModelOutput);
}
catch (Exception ex)
{
_logger.LogError(UsuarioServiceEvents.ExceptionCallingValidacionExistencia, ex.Message, ex);
throw;
}
}
|
80eee5f71967914164c5817f24e9f49b
|
{
"intermediate": 0.47241586446762085,
"beginner": 0.3081270456314087,
"expert": 0.21945703029632568
}
|
41,433
|
Please be a senior JS developer and help to solve: replace the 'XXXAccel ID = โ in main string โโ<a href=โโ>Accel ID = XXXAccel ID = TEST2</a>โโ to 'XXX</a><a href=โโ>Accel ID = โ
|
6db74457a6c18a0904ae573c50c0337c
|
{
"intermediate": 0.498644083738327,
"beginner": 0.30416861176490784,
"expert": 0.19718727469444275
}
|
41,434
|
Please be a senior JS developer and help to solve: replace the 'XXXAccel ID = โ in main string โโAccel ID = XXXAccel ID = TEST2โโ to 'XXXAccel ID = โ
|
b7021dceadf2bf86eb10f8d2ad7062e7
|
{
"intermediate": 0.45539000630378723,
"beginner": 0.34703031182289124,
"expert": 0.19757969677448273
}
|
41,435
|
Assuming you are a CDO of a rideshare company, can you create a data model (star schema) of ride share related products?
|
aea1c9c64fe5e747d106b949468cf90a
|
{
"intermediate": 0.424275279045105,
"beginner": 0.22210170328617096,
"expert": 0.35362303256988525
}
|
41,436
|
what is loop invariant in recursion? explain to me comprehensively and in details with examples
|
a093ea4d578adfa1a37f276686ba3bcb
|
{
"intermediate": 0.13879796862602234,
"beginner": 0.6736790537834167,
"expert": 0.1875229775905609
}
|
41,437
|
which version GPT are you used?
|
cd545f3d000565f2264c4519f530cbf7
|
{
"intermediate": 0.3923201262950897,
"beginner": 0.2350037395954132,
"expert": 0.37267616391181946
}
|
41,438
|
ะะตัะตะดะตะปะฐะน ัะปะตะดัััะธะน xml qt ะดะปั wpf:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>608</width>
<height>267</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="outputLineEdit"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="BS_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>BS</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="CE_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>CE</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="C_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>C</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="MC_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>MC</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="_6_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>6</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="div_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>/</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="MR_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>MR</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="_3_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>3</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="_8_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>8</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="_4_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="_2_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>2</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="MS_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>MS</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="_9_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>9</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="mul_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>*</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="dot_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>.</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="_5_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>5</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="_7_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>7</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QPushButton" name="rev_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>1/x</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="sqr_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>sqr</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="_1_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="MPlus_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>M+</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="_0_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="sign_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>+\-</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="divider_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>\</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QPushButton" name="Plus_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>+</string>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QPushButton" name="result_button">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>=</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>608</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>ะัะฐะฒะบะฐ</string>
</property>
</widget>
<widget class="QMenu" name="menu_2">
<property name="title">
<string>ะะฐัััะพะนะบะฐ</string>
</property>
<addaction name="action"/>
<addaction name="action_2"/>
</widget>
<widget class="QMenu" name="menu_3">
<property name="title">
<string>ะกะฟัะฐะฒะบะฐ</string>
</property>
</widget>
<addaction name="menu"/>
<addaction name="menu_2"/>
<addaction name="menu_3"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action">
<property name="text">
<string>ะัะพะฑั</string>
</property>
</action>
<action name="action_2">
<property name="text">
<string>ะงะธัะปะพ</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>
|
f53b9e5cd9e1ae008e546054b00b4a64
|
{
"intermediate": 0.36544445157051086,
"beginner": 0.529700517654419,
"expert": 0.10485497117042542
}
|
41,439
|
help me write writing end point which do some computation using python rest api
|
10735e93a339e05b57ec4ba2015da22d
|
{
"intermediate": 0.6063860654830933,
"beginner": 0.11903220415115356,
"expert": 0.27458176016807556
}
|
41,440
|
HI!
|
4e232d9b56fac83739060664b00928e4
|
{
"intermediate": 0.3374777138233185,
"beginner": 0.2601830065250397,
"expert": 0.40233927965164185
}
|
41,441
|
Hi, please be a senior JS developer. I want to compare 2 strings and find the difference out. In the string there are simple test and also html tags. lets say I have sOldStr = '<p><a href="">Accel ID = TEST2</a><a target="_blank" rel="noopener noreferrer" href="https://www.baidu.com/tesadsddft.pdf">Accel ID = TEST2</a>The purpose of this deliverable/task is to provide a template with as many format examples as possible to simply the creation of a new task or deliverable.</p><p>Deliverables should not have accelerators, procedures, or procedure notes.' and sNewStr = '<p><a href="">Accel ID = XXX</a><a href=โโ>Accel ID = TEST2</a><a target="_blank" rel="noopener noreferrer" href="https://www.baidu.com/tesadsddft.pdf">Accel ID = TEST2</a>The purpose of this deliverable/task is to provide a template with as many format examples as possible to simply the creation of a new task or deliverable.</p><p>Deliverables should not have accelerators, procedures, or procedure notes.' I want the result be Accel ID = XXX. How can I achieve that?
|
44a951c65c3ce66e6fcef0d1f3a2d57f
|
{
"intermediate": 0.5673996210098267,
"beginner": 0.23168891668319702,
"expert": 0.2009115219116211
}
|
41,442
|
amd ryzen 5 5600H vs ryzen 5 7530U detailed comparison and what's best for multitasking and web development and programming stuff
|
690f112cd6d1016b5139559b96e7170d
|
{
"intermediate": 0.6549625992774963,
"beginner": 0.16238124668598175,
"expert": 0.18265613913536072
}
|
41,443
|
X:1
T:Whimsical Breeze
M:4/4
L:1/8
K:C
Q:1/4=100
%%staves {1 2}
V:1
[V:1] C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G | G F/G G/F | Gsus4 G |
V:2
[V:2] C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G | G F/G G/F | Gsus4 G |
%%staves {1 2}
V:1
[V:1] Csus4 C Fmaj7 | C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G |
V:2
[V:2] Csus4 C Fmaj7 | C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G | change romantic tune, jay chou style.
|
bf109dd08edf5ef8a5948b018db5655e
|
{
"intermediate": 0.38791459798812866,
"beginner": 0.3101997673511505,
"expert": 0.3018856346607208
}
|
41,444
|
X:1
T:Whimsical Breeze
M:4/4
L:1/8
K:C
Q:1/4=100
|: C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G | G F/G G/F | Gsus4 G |
Csus4 C Fmaj7 | C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G :|
E3 A G F | E2 A4 z2 | E4 D2 E | F6 z2 |
G3 A G F | E2 D4 z2 | C E F G A | B4 A G F |
E D E F G F | E D C4 z2 |
|: C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G | G F/G G/F | Gsus4 G |
Csus4 C Fmaj7 | C E/G# E C | C7/E G/B D7/F# | Dm7 Am7 Am7/G :|
E3 A G F | E2 A4 z2 | E4 D2 E | F6 z2 |
G3 A G F | E2 D4 z2 | C E F G A | B4 A G F |
E D E F G F | E D C4 z2 | change to romantic tune
|
7991f8da760748e6e635fe74dfffae0d
|
{
"intermediate": 0.38107016682624817,
"beginner": 0.32074418663978577,
"expert": 0.2981855869293213
}
|
41,445
|
I have this React code.
if (
!Object.values(eventsList).includes(eventType) &&
!Object.values(eventsFromIframe).includes(eventType)
) {
throw new Error(`eventType ${eventType} not supported`);
}
The types are:
/** ws ัะพะฑััะธั ะธะท iframe */
export const eventsFromIframe = {
/** ะะฟัะฐะฒะบะฐ ะฝะพะฒะพะณะพ ัะพะพะฑัะตะฝะธั ะพะฟะตัะฐัะพัั (ะดะปั ะัะผ ะธ ะกะ ะ) */
newMessage: 'newMessageWs',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ั ะธะฝัะพัะผะฐัะธะตะน ะพะฑ ัะดะตัะถะฐะฝะธะธ ะพะฑัะฐัะตะฝะธั */
appealRetention: 'appealRetentionWs',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ะพ ะทะฐะบัััะธะธ ะพะฑัะฐัะตะฝะธั */
appealClose: 'appealCloseWs',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ะฟัะธ ััะฐะฝััะตัะต ะพะฑัะฐัะตะฝะธั ะธะทะทะฒะฝะต */
transferAppeal: 'transferAppealWs',
/** ะฃะฒะตะดะพะผะดะตะฝะธะต ะพ ัะบะพัะพะผ ัั
ะพะดะต ะพะฑัะฐัะฝะธั ะฒ ะพะถะธะดะฐะฝะธะต */
appealSoonToWaiting: 'appealSoonToWaitingWs',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ะฟัะธ ัะถะพะดะต ะพะฑัะฐัะตะฝะธั ะฒ ะพะถะธะดะฐะฝะธะธ ะธะทะฒะฝะต */
appealToWait: 'appealToWaitWs',
/** ะะพัะธัะธะบะฐัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ััะฐัััะฐ ะพะฟะตัะฐัะพัะฐ */
userStatusChanged: 'userStatusChangedWs',
/** ะะพัะธัะธะบะฐัะธั ะพ ัะฐะนะฟะธะฝะณะต ะบะปะธะตะฝัะฐ */
clientTyping: 'clientTypingWs',
/** ะะพัะธัะธะบะฐัะธั ะพ ะฟัะพััะฐะฒะปะตะฝะธะธ ะพัะตะฝะบะธ */
csiRate: 'csiRateWs',
/** ะะพัะธัะธะบะฐัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ะทะฐะผะตัะพัะฝะพะน ะธะฝัะพัะผะฐัะธะธ */
remarkInfoChanged: 'remarkInfoChangedWs',
} as const;
export type TIframeWsEvents =
(typeof eventsFromIframe)[keyof typeof eventsFromIframe];
/** ะกะฟะธัะพะบ ัะพะฑััะธะน */
export const eventsList = {
/** ะะพัะธัะธะบะฐัะธั ะพ ะฝะพะฒะพะผ ะพะฑัะฐัะตะฝะธะธ (ะดะปั ะกะ ะ) */
newAppeal: 'newAppeal',
/** ะะฟัะฐะฒะบะฐ ะฝะพะฒะพะณะพ ัะพะพะฑัะตะฝะธั ะพะฟะตัะฐัะพัั (ะดะปั ะัะผ ะธ ะกะ ะ) */
newMessage: 'newMessage',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ั ะธะฝัะพัะผะฐัะธะตะน ะพะฑ ัะดะตัะถะฐะฝะธะธ ะพะฑัะฐัะตะฝะธั */
appealRetention: 'appealRetention',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ะพ ะทะฐะบัััะธะธ ะพะฑัะฐัะตะฝะธั */
appealClose: 'appealClose',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ะฟัะธ ััะฐะฝััะตัะต ะพะฑัะฐัะตะฝะธั ะธะทะทะฒะฝะต */
transferAppeal: 'transferAppeal',
/** ะฃะฒะตะดะพะผะดะตะฝะธะต ะพ ัะบะพัะพะผ ัั
ะพะดะต ะพะฑัะฐัะฝะธั ะฒ ะพะถะธะดะฐะฝะธะต */
appealSoonToWaiting: 'appealSoonToWaiting',
/** ะฃะฒะตะดะพะผะปะตะฝะธะต ะฟัะธ ัะถะพะดะต ะพะฑัะฐัะตะฝะธั ะฒ ะพะถะธะดะฐะฝะธะธ ะธะทะฒะฝะต */
appealToWait: 'appealToWait',
/** ะะพัะธัะธะบะฐัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ััะฐัััะฐ ะพะฟะตัะฐัะพัะฐ */
userStatusChanged: 'userStatusChanged',
/** ะะพัะธัะธะบะฐัะธั ะพ ัะฐะนะฟะธะฝะณะต ะบะปะธะตะฝัะฐ */
clientTyping: 'clientTyping',
/** ะะพัะธัะธะบะฐัะธั ะพ ะฟัะพััะฐะฒะปะตะฝะธะธ ะพัะตะฝะบะธ */
csiRate: 'csiRate',
/** ะะพัะธัะธะบะฐัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ะทะฐะผะตัะพัะฝะพะน ะธะฝัะพัะผะฐัะธะธ */
notForWaiting: 'notForWaiting',
/** ะะพัะธัะธะบะฐัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ะทะฐะผะตัะพัะฝะพะน ะธะฝัะพัะผะฐัะธะธ */
remarkInfoChanged: 'remarkInfoChanged',
/** ะะพัะธัะธะบะฐัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ะบะพะผะผะตะฝัะฐัะธั ะบ ะพะฑัะฐัะตะฝะธั */
appealCommentChanged: 'appealCommentChanged',
/** ะะพัะธัะธะบัะธั ะพะฑ ะธะทะผะตะฝะตะฝะธะธ ัะตะผะฐัะธะบ ะพะฑัะฐัะตะฝะธั */
appealThemesChanged: 'appealThemesChanged',
setActiveAppeal: 'setActiveAppeal',
} as const;
/** ะขะธะฟ ะพะฟะธััะฒะฐััะธะน ะฒะพะทะผะพะถะฝัะต ะฒะฐัะธะฐะฝัั ัะพะฑััะธะน */
export type TEvents = (typeof eventsList)[keyof typeof eventsList];
on eventType I get a typeScript error 'Argument of type 'TEvents | TIframeWsEvents' is not assignable to parameter of type '"newAppeal" | "newMessage" | "appealRetention" | "appealClose" | "transferAppeal" | "appealSoonToWaiting" | "appealToWait" | "userStatusChanged" | "clientTyping" | "csiRate" | ... 4 more ... | "setActiveAppeal"'.
Type '"newMessageWs"' is not assignable to type '"newAppeal" | "newMessage" | "appealRetention" | "appealClose" | "transferAppeal" | "appealSoonToWaiting" | "appealToWait" | "userStatusChanged" | "clientTyping" | "csiRate" | ... 4 more ... | "setActiveAppeal"'. Did you mean '"newMessage"'?'
How do I fix it?
|
c4302fbd05454647daf6e73fc62fe0bc
|
{
"intermediate": 0.23110531270503998,
"beginner": 0.6444969773292542,
"expert": 0.12439767271280289
}
|
41,446
|
generate more comprehensive details and examples on, 3. SEO Essentials: Crafting Product Listings, minimalist tone
|
215f2cec3db77ad1c0555950a20b3c60
|
{
"intermediate": 0.3229801654815674,
"beginner": 0.3875764012336731,
"expert": 0.2894434332847595
}
|
41,447
|
opensearch dashboard query exclude values advanced
|
6af101ac6804314ee361139dfb2ef86b
|
{
"intermediate": 0.3200404942035675,
"beginner": 0.2662501931190491,
"expert": 0.41370925307273865
}
|
41,448
|
Hi there!
|
6b674ad731705b4662e6e2d8ecab996f
|
{
"intermediate": 0.32267293334007263,
"beginner": 0.25843358039855957,
"expert": 0.4188934564590454
}
|
41,449
|
if (cardObject.GetCardPosition().CardPositionType == CardPositionTypes.BattleField &&
(cardObject.HasEffect(CardKeyWordType.Fragile) || cardObject.HasEffect(CardKeyWordType.Ambush) ||
cardObject.HasEffect(CardKeyWordType.HolyShield) || cardObject.HasEffect(CardKeyWordType.Pierce) ||
cardObject.HasEffect(CardKeyWordType.LeapAttack) || cardObject.HasEffect(CardKeyWordType.Cycle)) ||
cardObject.HasEffect(CardKeyWordType.Degrade))
{
cardEffect.gameObject.SetActive(true);
// ๆฌๅฐ็ฉๅฎถๆ่ฝ็ๅฐ
if (cardObject.HasEffect(CardKeyWordType.Degrade))
{
if (IsLocalPlayer)
{
UpdateCardEffectRender(CardKeyWordType.Fragile);
}
else
{
cardEffect.gameObject.SetActive(false);
}
}
else if (cardObject.HasEffect(CardKeyWordType.Fragile))
{
UpdateCardEffectRender(CardKeyWordType.Fragile);
}
else if (cardObject.HasEffect(CardKeyWordType.Ambush))
{
UpdateCardEffectRender(CardKeyWordType.Ambush);
}
else if (cardObject.HasEffect(CardKeyWordType.HolyShield))
{
UpdateCardEffectRender(CardKeyWordType.HolyShield);
}
else if (cardObject.HasEffect(CardKeyWordType.Pierce))
{
UpdateCardEffectRender(CardKeyWordType.Pierce);
}
else if (cardObject.HasEffect(CardKeyWordType.LeapAttack))
{
UpdateCardEffectRender(CardKeyWordType.LeapAttack);
}
else if (cardObject.HasEffect(CardKeyWordType.Cycle))
{
UpdateCardEffectRender(CardKeyWordType.Cycle);
}
}
else
{
cardEffect.gameObject.SetActive(false);
}. ่ฟๆฎต็ณ็ณ็ไปฃ็ ๆไนไผๅไธไธ
|
46c725bc1e07bc16bb49f6c894ed46ad
|
{
"intermediate": 0.23103591799736023,
"beginner": 0.6497064828872681,
"expert": 0.11925754696130753
}
|
41,450
|
design an 8-bit counter using a switch-tail structure that meets the following conditions:
(a): Design an 8-bit counter with only one bit set to zero at any time. The rest of the bits should be set to one. Examples of valid counter values include 01111111, 10111111, and 11011111.
(b): Design an 8-bit counter where two adjacent bits are set to one at any point. The remaining bits should be set to zero. Examples of valid counter values include 11000000, 01100000, and 00110000.
|
9576fcfdeccae7433ef3ba545b49eae6
|
{
"intermediate": 0.3069441318511963,
"beginner": 0.21229447424411774,
"expert": 0.4807613492012024
}
|
41,451
|
design an 8-bit counter using a switch-tail structure that meets the following conditions:
(a): Design an 8-bit counter with only one bit set to zero at any time. The rest of the bits should be set to one. Examples of valid counter values include 01111111, 10111111, and 11011111.
(b): Design an 8-bit counter where two adjacent bits are set to one at any point. The remaining bits should be set to zero. Examples of valid counter values include 11000000, 01100000, and 00110000.
|
d6ad323c15e11738aa886b40df18389f
|
{
"intermediate": 0.3069441318511963,
"beginner": 0.21229447424411774,
"expert": 0.4807613492012024
}
|
41,452
|
can you create random variables?
|
daade698672ccc1c55251718050bf836
|
{
"intermediate": 0.28489166498184204,
"beginner": 0.31747138500213623,
"expert": 0.39763689041137695
}
|
41,453
|
Write a Python code for complex numbers multiplication
|
87d2e60b8b641e5cc6ff079100287a23
|
{
"intermediate": 0.39443832635879517,
"beginner": 0.19383597373962402,
"expert": 0.4117256999015808
}
|
41,454
|
ััะพ ะฝะต ัะฐะบ? ะฒะพั ะทะฐะดะฐัะฐ: Given two sorted arrays and of size and respectively, return the median of the two sorted arrays.nums1nums2mn
The overall run time complexity should be .O(log (m+n)). ะะพั ะบะพะด: class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
for i in range (len(nums2)):
t=nums2[i]
nums1.append(i)
nums1.sort()
t=(len(nums1)//2)+1
q=(len(nums1)//2)
if len(nums1)%2!=0:
return (nums1[t])
else:
return (nums1[q]+nums1[t])/2
|
8308d984ed562e95f8943c2baca69294
|
{
"intermediate": 0.4332708716392517,
"beginner": 0.32765254378318787,
"expert": 0.23907656967639923
}
|
41,455
|
# Display 200 rows in Polars output
pl.Config.set_tbl_rows(200)
# Function to perform the grouping, counting, and sorting of lengths
def group_count_sort(y_cl4, length_threshold=None):
lengths = y_cl4.groupby('unique_id').agg(pl.count().alias('length'))
if length_threshold:
lengths = lengths.filter(pl.col('length') > length_threshold)
counts = lengths.groupby('length').agg(pl.count().alias('count')).sort('length')
return lengths, counts
# Lengths for all series
all_lengths, all_counts = group_count_sort(y_cl4)
print(all_counts)
# Function to filter y_cl4 based on lengths
def filter_and_sort(y_cl4, lengths):
y_cl4_filtered = y_cl4.join(
lengths.select(pl.col('unique_id')),
on='unique_id',
how='semi'
)
return y_cl4_filtered.sort('ds')
# Lengths greater than 45
lengths_over_45, counts_for_over_45 = group_count_sort(y_cl4, 45)
y_cl4_over_45 = filter_and_sort(y_cl4, lengths_over_45)
print(counts_for_over_45)
# Lengths greater than 15
lengths_over_15, counts_for_over_15 = group_count_sort(y_cl4, 15)
y_cl4_over_15 = filter_and_sort(y_cl4, lengths_over_15)
print(counts_for_over_15)
shape: (153, 2)
โโโโโโโโโโฌโโโโโโโโ
โ length โ count โ
โ --- โ --- โ
โ u32 โ u32 โ
โโโโโโโโโโชโโโโโโโโก
โ 5 โ 2 โ
โ 6 โ 1 โ
โ 7 โ 1 โ
โ 8 โ 7 โ
โ 9 โ 4 โ
โ 10 โ 10 โ
โ 11 โ 8 โ
โ 12 โ 4 โ
โ 13 โ 6 โ
โ 14 โ 11 โ
โ 15 โ 16 โ
โ 16 โ 14 โ
โ 17 โ 27 โ
โ 18 โ 26 โ
โ 19 โ 31 โ
โ 20 โ 32 โ
โ 21 โ 30 โ
โ 22 โ 24 โ
โ 23 โ 30 โ
โ 24 โ 26 โ
โ 25 โ 32 โ
โ 26 โ 28 โ
โ 27 โ 32 โ
โ 28 โ 47 โ
โ 29 โ 50 โ
โ 30 โ 28 โ
โ 31 โ 37 โ
โ 32 โ 26 โ
โ 33 โ 34 โ
โ 34 โ 41 โ
โ 35 โ 40 โ
โ 36 โ 47 โ
โ 37 โ 40 โ
โ 38 โ 46 โ
โ 39 โ 43 โ
โ 40 โ 52 โ
โ 41 โ 53 โ
โ 42 โ 52 โ
โ 43 โ 65 โ
โ 44 โ 68 โ
โ 45 โ 68 โ
โ 46 โ 71 โ
โ 47 โ 65 โ
โ 48 โ 60 โ
โ 49 โ 74 โ
โ 50 โ 87 โ
โ 51 โ 63 โ
โ 52 โ 80 โ
โ 53 โ 79 โ
โ 54 โ 85 โ
โ 55 โ 89 โ
โ 56 โ 70 โ
โ 57 โ 88 โ
โ 58 โ 94 โ
โ 59 โ 104 โ
โ 60 โ 113 โ
โ 61 โ 116 โ
โ 62 โ 127 โ
โ 63 โ 106 โ
โ 64 โ 157 โ
โ 65 โ 128 โ
โ 66 โ 137 โ
โ 67 โ 154 โ
โ 68 โ 145 โ
โ 69 โ 133 โ
โ 70 โ 167 โ
โ 71 โ 161 โ
โ 72 โ 145 โ
โ 73 โ 167 โ
โ 74 โ 150 โ
โ 75 โ 153 โ
โ 76 โ 205 โ
โ 77 โ 199 โ
โ 78 โ 240 โ
โ 79 โ 207 โ
โ 80 โ 179 โ
โ 81 โ 186 โ
โ 82 โ 195 โ
โ 83 โ 185 โ
โ 84 โ 189 โ
โ 85 โ 202 โ
โ 86 โ 200 โ
โ 87 โ 207 โ
โ 88 โ 167 โ
โ 89 โ 168 โ
โ 90 โ 185 โ
โ 91 โ 177 โ
โ 92 โ 174 โ
โ 93 โ 162 โ
โ 94 โ 199 โ
โ 95 โ 139 โ
โ 96 โ 162 โ
โ 97 โ 160 โ
โ 98 โ 172 โ
โ 99 โ 170 โ
โ 100 โ 194 โ
โ 101 โ 178 โ
โ 102 โ 151 โ
โ 103 โ 180 โ
โ 104 โ 160 โ
โ 105 โ 153 โ
โ 106 โ 167 โ
โ 107 โ 176 โ
โ 108 โ 202 โ
โ 109 โ 190 โ
โ 110 โ 157 โ
โ 111 โ 166 โ
โ 112 โ 221 โ
โ 113 โ 190 โ
โ 114 โ 169 โ
โ 115 โ 179 โ
โ 116 โ 139 โ
โ 117 โ 146 โ
โ 118 โ 174 โ
โ 119 โ 136 โ
โ 120 โ 183 โ
โ 121 โ 172 โ
โ 122 โ 155 โ
โ 123 โ 169 โ
โ 124 โ 140 โ
โ 125 โ 157 โ
โ 126 โ 150 โ
โ 127 โ 159 โ
โ 128 โ 157 โ
โ 129 โ 163 โ
โ 130 โ 151 โ
โ 131 โ 167 โ
โ 132 โ 169 โ
โ 133 โ 149 โ
โ 134 โ 167 โ
โ 135 โ 172 โ
โ 136 โ 180 โ
โ 137 โ 167 โ
โ 138 โ 162 โ
โ 139 โ 141 โ
โ 140 โ 167 โ
โ 141 โ 166 โ
โ 142 โ 149 โ
โ 143 โ 149 โ
โ 144 โ 150 โ
โ 145 โ 146 โ
โ 146 โ 156 โ
โ 147 โ 183 โ
โ 148 โ 149 โ
โ 149 โ 162 โ
โ 150 โ 157 โ
โ 151 โ 161 โ
โ 152 โ 229 โ
โ 153 โ 165 โ
โ 154 โ 215 โ
โ 155 โ 226 โ
โ 156 โ 303 โ
โ 157 โ 639 โ
โโโโโโโโโโดโโโโโโโโ
shape: (112, 2)
โโโโโโโโโโฌโโโโโโโโ
โ length โ count โ
โ --- โ --- โ
โ u32 โ u32 โ
โโโโโโโโโโชโโโโโโโโก
โ 46 โ 71 โ
โ 47 โ 65 โ
โ 48 โ 60 โ
โ 49 โ 74 โ
โ 50 โ 87 โ
โ 51 โ 63 โ
โ 52 โ 80 โ
โ 53 โ 79 โ
โ 54 โ 85 โ
โ 55 โ 89 โ
โ 56 โ 70 โ
โ 57 โ 88 โ
โ 58 โ 94 โ
โ 59 โ 104 โ
โ 60 โ 113 โ
โ 61 โ 116 โ
โ 62 โ 127 โ
โ 63 โ 106 โ
โ 64 โ 157 โ
โ 65 โ 128 โ
โ 66 โ 137 โ
โ 67 โ 154 โ
โ 68 โ 145 โ
โ 69 โ 133 โ
โ 70 โ 167 โ
โ 71 โ 161 โ
โ 72 โ 145 โ
โ 73 โ 167 โ
โ 74 โ 150 โ
โ 75 โ 153 โ
โ 76 โ 205 โ
โ 77 โ 199 โ
โ 78 โ 240 โ
โ 79 โ 207 โ
โ 80 โ 179 โ
โ 81 โ 186 โ
โ 82 โ 195 โ
โ 83 โ 185 โ
โ 84 โ 189 โ
โ 85 โ 202 โ
โ 86 โ 200 โ
โ 87 โ 207 โ
โ 88 โ 167 โ
โ 89 โ 168 โ
โ 90 โ 185 โ
โ 91 โ 177 โ
โ 92 โ 174 โ
โ 93 โ 162 โ
โ 94 โ 199 โ
โ 95 โ 139 โ
โ 96 โ 162 โ
โ 97 โ 160 โ
โ 98 โ 172 โ
โ 99 โ 170 โ
โ 100 โ 194 โ
โ 101 โ 178 โ
โ 102 โ 151 โ
โ 103 โ 180 โ
โ 104 โ 160 โ
โ 105 โ 153 โ
โ 106 โ 167 โ
โ 107 โ 176 โ
โ 108 โ 202 โ
โ 109 โ 190 โ
โ 110 โ 157 โ
โ 111 โ 166 โ
โ 112 โ 221 โ
โ 113 โ 190 โ
โ 114 โ 169 โ
โ 115 โ 179 โ
โ 116 โ 139 โ
โ 117 โ 146 โ
โ 118 โ 174 โ
โ 119 โ 136 โ
โ 120 โ 183 โ
โ 121 โ 172 โ
โ 122 โ 155 โ
โ 123 โ 169 โ
โ 124 โ 140 โ
โ 125 โ 157 โ
โ 126 โ 150 โ
โ 127 โ 159 โ
โ 128 โ 157 โ
โ 129 โ 163 โ
โ 130 โ 151 โ
โ 131 โ 167 โ
โ 132 โ 169 โ
โ 133 โ 149 โ
โ 134 โ 167 โ
โ 135 โ 172 โ
โ 136 โ 180 โ
โ 137 โ 167 โ
โ 138 โ 162 โ
โ 139 โ 141 โ
โ 140 โ 167 โ
โ 141 โ 166 โ
โ 142 โ 149 โ
โ 143 โ 149 โ
โ 144 โ 150 โ
โ 145 โ 146 โ
โ 146 โ 156 โ
โ 147 โ 183 โ
โ 148 โ 149 โ
โ 149 โ 162 โ
โ 150 โ 157 โ
โ 151 โ 161 โ
โ 152 โ 229 โ
โ 153 โ 165 โ
โ 154 โ 215 โ
โ 155 โ 226 โ
โ 156 โ 303 โ
โ 157 โ 639 โ
โโโโโโโโโโดโโโโโโโโ
shape: (142, 2)
โโโโโโโโโโฌโโโโโโโโ
โ length โ count โ
โ --- โ --- โ
โ u32 โ u32 โ
โโโโโโโโโโชโโโโโโโโก
โ 16 โ 14 โ
โ 17 โ 27 โ
โ 18 โ 26 โ
โ 19 โ 31 โ
โ 20 โ 32 โ
โ 21 โ 30 โ
โ 22 โ 24 โ
โ 23 โ 30 โ
โ 24 โ 26 โ
โ 25 โ 32 โ
โ 26 โ 28 โ
โ 27 โ 32 โ
โ 28 โ 47 โ
โ 29 โ 50 โ
โ 30 โ 28 โ
โ 31 โ 37 โ
โ 32 โ 26 โ
โ 33 โ 34 โ
โ 34 โ 41 โ
โ 35 โ 40 โ
โ 36 โ 47 โ
โ 37 โ 40 โ
โ 38 โ 46 โ
โ 39 โ 43 โ
โ 40 โ 52 โ
โ 41 โ 53 โ
โ 42 โ 52 โ
โ 43 โ 65 โ
โ 44 โ 68 โ
โ 45 โ 68 โ
โ 46 โ 71 โ
โ 47 โ 65 โ
โ 48 โ 60 โ
โ 49 โ 74 โ
โ 50 โ 87 โ
โ 51 โ 63 โ
โ 52 โ 80 โ
โ 53 โ 79 โ
โ 54 โ 85 โ
โ 55 โ 89 โ
โ 56 โ 70 โ
โ 57 โ 88 โ
โ 58 โ 94 โ
โ 59 โ 104 โ
โ 60 โ 113 โ
โ 61 โ 116 โ
โ 62 โ 127 โ
โ 63 โ 106 โ
โ 64 โ 157 โ
โ 65 โ 128 โ
โ 66 โ 137 โ
โ 67 โ 154 โ
โ 68 โ 145 โ
โ 69 โ 133 โ
โ 70 โ 167 โ
โ 71 โ 161 โ
โ 72 โ 145 โ
โ 73 โ 167 โ
โ 74 โ 150 โ
โ 75 โ 153 โ
โ 76 โ 205 โ
โ 77 โ 199 โ
โ 78 โ 240 โ
โ 79 โ 207 โ
โ 80 โ 179 โ
โ 81 โ 186 โ
โ 82 โ 195 โ
โ 83 โ 185 โ
โ 84 โ 189 โ
โ 85 โ 202 โ
โ 86 โ 200 โ
โ 87 โ 207 โ
โ 88 โ 167 โ
โ 89 โ 168 โ
โ 90 โ 185 โ
โ 91 โ 177 โ
โ 92 โ 174 โ
โ 93 โ 162 โ
โ 94 โ 199 โ
โ 95 โ 139 โ
โ 96 โ 162 โ
โ 97 โ 160 โ
โ 98 โ 172 โ
โ 99 โ 170 โ
โ 100 โ 194 โ
โ 101 โ 178 โ
โ 102 โ 151 โ
โ 103 โ 180 โ
โ 104 โ 160 โ
โ 105 โ 153 โ
โ 106 โ 167 โ
โ 107 โ 176 โ
โ 108 โ 202 โ
โ 109 โ 190 โ
โ 110 โ 157 โ
โ 111 โ 166 โ
โ 112 โ 221 โ
โ 113 โ 190 โ
โ 114 โ 169 โ
โ 115 โ 179 โ
โ 116 โ 139 โ
โ 117 โ 146 โ
โ 118 โ 174 โ
โ 119 โ 136 โ
โ 120 โ 183 โ
โ 121 โ 172 โ
โ 122 โ 155 โ
โ 123 โ 169 โ
โ 124 โ 140 โ
โ 125 โ 157 โ
โ 126 โ 150 โ
โ 127 โ 159 โ
โ 128 โ 157 โ
โ 129 โ 163 โ
โ 130 โ 151 โ
โ 131 โ 167 โ
โ 132 โ 169 โ
โ 133 โ 149 โ
โ 134 โ 167 โ
โ 135 โ 172 โ
โ 136 โ 180 โ
โ 137 โ 167 โ
โ 138 โ 162 โ
โ 139 โ 141 โ
โ 140 โ 167 โ
โ 141 โ 166 โ
โ 142 โ 149 โ
โ 143 โ 149 โ
โ 144 โ 150 โ
โ 145 โ 146 โ
โ 146 โ 156 โ
โ 147 โ 183 โ
โ 148 โ 149 โ
โ 149 โ 162 โ
โ 150 โ 157 โ
โ 151 โ 161 โ
โ 152 โ 229 โ
โ 153 โ 165 โ
โ 154 โ 215 โ
โ 155 โ 226 โ
โ 156 โ 303 โ
โ 157 โ 639 โ from statsforecast import StatsForecast
from statsforecast.models import AutoARIMA, AutoETS, DynamicOptimizedTheta
from statsforecast.utils import ConformalIntervals
import numpy as np
import polars as pl
# Polars option to display all rows
pl.Config.set_tbl_rows(None)
# Initialize the models
models = [
AutoARIMA(season_length=52),
AutoETS(damped=True, season_length=52),
DynamicOptimizedTheta(season_length=52)
]
# Initialize the StatsForecast model
sf = StatsForecast(models=models, freq='1w', n_jobs=-1)
# Perform cross-validation with a step size of 1 to mimic an expanding window
crossvalidation_df = sf.cross_validation(df=y_cl4_over_45, h=5, step_size=1, n_windows=10, sort_df=True)
# Calculate the ensemble mean
ensemble = crossvalidation_df[['AutoARIMA', 'AutoETS', 'DynamicOptimizedTheta']].mean(axis=1)
# Create a Series for the ensemble mean
ensemble_series = pl.Series('Ensemble', ensemble)
# Add the ensemble mean as a new column to the DataFrame
crossvalidation_df = crossvalidation_df.with_columns(ensemble_series)
def wmape(y_true, y_pred):
return np.abs(y_true - y_pred).sum() / np.abs(y_true).sum()
# Calculate the WMAPE for the ensemble model
wmape_value = wmape(crossvalidation_df['y'], crossvalidation_df['Ensemble'])
print('Average WMAPE for Ensemble: ', round(wmape_value, 4))
# Calculate the errors for the ensemble model
errors = crossvalidation_df['y'] - crossvalidation_df['Ensemble']
# For an individual forecast
individual_accuracy = 1 - (abs(crossvalidation_df['y'] - crossvalidation_df['Ensemble']) / crossvalidation_df['y'])
individual_bias = (crossvalidation_df['Ensemble'] / crossvalidation_df['y']) - 1
# Add these calculations as new columns to DataFrame
crossvalidation_df = crossvalidation_df.with_columns([
individual_accuracy.alias("individual_accuracy"),
individual_bias.alias("individual_bias")
])
# Print the individual accuracy and bias for each week
for row in crossvalidation_df.to_dicts():
id = row['unique_id']
date = row['ds']
accuracy = row['individual_accuracy']
bias = row['individual_bias']
print(f"{id}, {date}, Individual Accuracy: {accuracy:.4f}, Individual Bias: {bias:.4f}")
# For groups of forecasts
group_accuracy = 1 - (errors.abs().sum() / crossvalidation_df['y'].sum())
group_bias = (crossvalidation_df['Ensemble'].sum() / crossvalidation_df['y'].sum()) - 1
# Print the average group accuracy and group bias over all folds for the ensemble model
print('Average Group Accuracy: ', round(group_accuracy, 4))
print('Average Group Bias: ', round(group_bias, 4))
# Fit the models on the entire dataset
sf.fit(y_cl4_over_15)
# Instantiate the ConformalIntervals class
prediction_intervals = ConformalIntervals()
# Generate 24 months forecasts
forecasts_df = sf.forecast(h=52*2, prediction_intervals=prediction_intervals, level=[95], id_col='unique_id', sort_df=True)
# Apply the non-negative constraint to the forecasts of individual models
forecasts_df = forecasts_df.with_columns([
pl.when(pl.col('AutoARIMA') < 0).then(0).otherwise(pl.col('AutoARIMA')).alias('AutoARIMA'),
pl.when(pl.col('AutoETS') < 0).then(0).otherwise(pl.col('AutoETS')).alias('AutoETS'),
pl.when(pl.col('DynamicOptimizedTheta') < 0).then(0).otherwise(pl.col('DynamicOptimizedTheta')).alias('DynamicOptimizedTheta'),
pl.when(pl.col('AutoARIMA-lo-95') < 0).then(0).otherwise(pl.col('AutoARIMA-lo-95')).alias('AutoARIMA-lo-95'),
pl.when(pl.col('AutoETS-lo-95') < 0).then(0).otherwise(pl.col('AutoETS-lo-95')).alias('AutoETS-lo-95'),
pl.when(pl.col('DynamicOptimizedTheta-lo-95') < 0).then(0).otherwise(pl.col('DynamicOptimizedTheta-lo-95')).alias('DynamicOptimizedTheta-lo-95')
])
# Calculate the ensemble forecast
ensemble_forecast = forecasts_df[['AutoARIMA', 'AutoETS', 'DynamicOptimizedTheta']].mean(axis=1)
# Calculate the lower and upper prediction intervals for the ensemble forecast
ensemble_lo_95 = forecasts_df[['AutoARIMA-lo-95', 'AutoETS-lo-95', 'DynamicOptimizedTheta-lo-95']].mean(axis=1)
ensemble_hi_95 = forecasts_df[['AutoARIMA-hi-95', 'AutoETS-hi-95', 'DynamicOptimizedTheta-hi-95']].mean(axis=1)
# Create Series for the ensemble forecast and its prediction intervals
ensemble_forecast_series = pl.Series('EnsembleForecast', ensemble_forecast)
ensemble_lo_95_series = pl.Series('Ensemble-lo-95', ensemble_lo_95)
ensemble_hi_95_series = pl.Series('Ensemble-hi-95', ensemble_hi_95)
# Add the ensemble forecast and its prediction intervals as new columns to the DataFrame
forecasts_df = forecasts_df.with_columns([ensemble_forecast_series, ensemble_lo_95_series, ensemble_hi_95_series])
# Round the ensemble forecast and prediction intervals and convert to integer
forecasts_df = forecasts_df.with_columns([
pl.col("EnsembleForecast").round().cast(pl.Int32),
pl.col("Ensemble-lo-95").round().cast(pl.Int32),
pl.col("Ensemble-hi-95").round().cast(pl.Int32)
])
# Split the unique_id concat into the original columns
def split_unique_id(unique_id):
parts = unique_id.split('_')
return parts if len(parts) >= 4 else (parts + [None] * (4 - len(parts)))
forecasts_df = (
forecasts_df
.with_columns([
pl.col('unique_id').apply(lambda uid: split_unique_id(uid)[0]).alias('MaterialID'),
pl.col('unique_id').apply(lambda uid: split_unique_id(uid)[1]).alias('SalesOrg'),
pl.col('unique_id').apply(lambda uid: split_unique_id(uid)[2]).alias('DistrChan'),
pl.col('unique_id').apply(lambda uid: split_unique_id(uid)[3]).alias('CL4'),
])
.drop('unique_id')
)
# Rename โdsโ to โWeekDateโ
forecasts_df = forecasts_df.rename({'ds': 'WeekDate'})
# Reorder the columns
forecasts_df = forecasts_df.select([
"MaterialID",
"SalesOrg",
"DistrChan",
"CL4",
"WeekDate",
"EnsembleForecast",
"Ensemble-lo-95",
"Ensemble-hi-95",
"AutoARIMA",
"AutoARIMA-lo-95",
"AutoARIMA-hi-95",
"AutoETS",
"AutoETS-lo-95",
"AutoETS-hi-95",
"DynamicOptimizedTheta",
"DynamicOptimizedTheta-lo-95",
"DynamicOptimizedTheta-hi-95"
])
# Create an empty list
forecasts_list = []
# Append each row to the list
for row in forecasts_df.to_dicts():
forecasts_list.append(row)
# Print the list
for forecast in forecasts_list:
print(forecast) RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/tungnguyen/anaconda3/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/Users/tungnguyen/anaconda3/lib/python3.10/site-packages/statsforecast/core.py", line 322, in cross_validation
raise error
File "/Users/tungnguyen/anaconda3/lib/python3.10/site-packages/statsforecast/core.py", line 319, in cross_validation
res_i = model.forecast(**forecast_kwargs)
File "/Users/tungnguyen/anaconda3/lib/python3.10/site-packages/statsforecast/models.py", line 1292, in forecast
mod = auto_theta(
File "/Users/tungnguyen/anaconda3/lib/python3.10/site-packages/statsforecast/theta.py", line 633, in auto_theta
y_decompose = seasonal_decompose(y, model=decomposition_type, period=m).seasonal
File "/Users/tungnguyen/anaconda3/lib/python3.10/site-packages/statsmodels/tsa/seasonal.py", line 171, in seasonal_decompose
raise ValueError(
ValueError: x must have 2 complete cycles requires 104 observations. x only has 82 observation(s)
"""
The above exception was the direct cause of the following exception:
ValueError Traceback (most recent call last)
Cell In[22], line 21
18 sf = StatsForecast(models=models, freq='1w', n_jobs=-1)
20 # Perform cross-validation with a step size of 1 to mimic an expanding window
---> 21 crossvalidation_df = sf.cross_validation(df=y_cl4_over_45, h=5, step_size=1, n_windows=10, sort_df=True)
23 # Calculate the ensemble mean
24 ensemble = crossvalidation_df[['AutoARIMA', 'AutoETS', 'DynamicOptimizedTheta']].mean(axis=1)
File ~/anaconda3/lib/python3.10/site-packages/statsforecast/core.py:1616, in StatsForecast.cross_validation(self, h, df, n_windows, step_size, test_size, input_size, level, fitted, refit, sort_df, prediction_intervals, id_col, time_col, target_col)
1598 def cross_validation(
1599 self,
1600 h: int,
(...)
1613 target_col: str = "y",
1614 ):
1615 if self._is_native(df=df):
-> 1616 return super().cross_validation(
1617 h=h,
1618 df=df,
1619 n_windows=n_windows,
1620 step_size=step_size,
1621 test_size=test_size,
1622 input_size=input_size,
1623 level=level,
1624 fitted=fitted,
1625 refit=refit,
1626 sort_df=sort_df,
1627 prediction_intervals=prediction_intervals,
1628 id_col=id_col,
1629 time_col=time_col,
1630 target_col=target_col,
1631 )
1632 assert df is not None
1633 engine = make_execution_engine(infer_by=[df])
File ~/anaconda3/lib/python3.10/site-packages/statsforecast/core.py:1026, in _StatsForecast.cross_validation(self, h, df, n_windows, step_size, test_size, input_size, level, fitted, refit, sort_df, prediction_intervals, id_col, time_col, target_col)
1012 res_fcsts = self.ga.cross_validation(
1013 models=self.models,
1014 h=h,
(...)
1023 target_col=target_col,
1024 )
1025 else:
-> 1026 res_fcsts = self._cross_validation_parallel(
1027 h=h,
1028 test_size=test_size,
1029 step_size=step_size,
1030 input_size=input_size,
1031 fitted=fitted,
1032 level=level,
1033 refit=refit,
1034 target_col=target_col,
1035 )
1036 if fitted:
1037 self.cv_fitted_values_ = res_fcsts["fitted"]
File ~/anaconda3/lib/python3.10/site-packages/statsforecast/core.py:1248, in _StatsForecast._cross_validation_parallel(self, h, test_size, step_size, input_size, fitted, level, refit, target_col)
1232 future = executor.apply_async(
1233 ga.cross_validation,
1234 (
(...)
1245 ),
1246 )
1247 futures.append(future)
-> 1248 out = [f.get() for f in futures]
1249 fcsts = [d["forecasts"] for d in out]
1250 fcsts = np.vstack(fcsts)
File ~/anaconda3/lib/python3.10/site-packages/statsforecast/core.py:1248, in <listcomp>(.0)
1232 future = executor.apply_async(
1233 ga.cross_validation,
1234 (
(...)
1245 ),
1246 )
1247 futures.append(future)
-> 1248 out = [f.get() for f in futures]
1249 fcsts = [d["forecasts"] for d in out]
1250 fcsts = np.vstack(fcsts)
File ~/anaconda3/lib/python3.10/multiprocessing/pool.py:774, in ApplyResult.get(self, timeout)
772 return self._value
773 else:
--> 774 raise self._value
ValueError: x must have 2 complete cycles requires 104 observations. x only has 82 observation(s)
|
a78c34b3f900d26895ff3c069cef7966
|
{
"intermediate": 0.31737062335014343,
"beginner": 0.452204167842865,
"expert": 0.23042520880699158
}
|
41,456
|
#include <iostream>
#include <stdlib.h>
using namespace std;
void elo(int &x, int &y,int &z){
if((x>y)&&(y>z)){
cout<<x<<y<<z;}
else if((y>x)&&(x>z)){
cout<<y<<x<<z;}
else{
cout<<z<<y<<x;
}
}
int main()
{
int a=1;
int b=2;
int c=3;
cout<<elo(&a,&b,&c);
return 0;
}
|
5266ff19a1ab3b609bd6de0662ed5d87
|
{
"intermediate": 0.4020232558250427,
"beginner": 0.3542358875274658,
"expert": 0.24374085664749146
}
|
41,457
|
let rdnRef = React.useRef<Rnd>();
const resetWidgetPosition = (): void => {
const position = JSON.parse(localStorage.getItem('chatSDK_position'));
const size = JSON.parse(localStorage.getItem('chatSDK_size'));
if (position && rdnRef) {
rdnRef.updatePosition(position);
}
if (size && rdnRef) {
rdnRef.updateSize(size);
}
};
export declare class Rnd extends React.PureComponent<Props, State> {
static defaultProps: DefaultProps;
resizable: Resizable;
draggable: $TODO;
resizingPosition: {
x: number;
y: number;
};
offsetFromParent: {
left: number;
top: number;
};
resizableElement: {
current: HTMLElement | null;
};
originalPosition: {
x: number;
y: number;
};
constructor(props: Props);
componentDidMount(): void;
getDraggablePosition(): {
x: number;
y: number;
};
getParent(): any;
getParentSize(): {
width: number;
height: number;
};
getMaxSizesFromProps(): MaxSize;
getSelfElement(): HTMLElement | null;
getOffsetHeight(boundary: HTMLElement): number;
getOffsetWidth(boundary: HTMLElement): number;
onDragStart(e: RndDragEvent, data: DraggableData): void;
onDrag(e: RndDragEvent, data: DraggableData): false | void;
onDragStop(e: RndDragEvent, data: DraggableData): false | void;
onResizeStart(e: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>, dir: ResizeDirection, elementRef: HTMLElement): void;
onResize(e: MouseEvent | TouchEvent, direction: ResizeDirection, elementRef: HTMLElement, delta: {
height: number;
width: number;
}): void;
onResizeStop(e: MouseEvent | TouchEvent, direction: ResizeDirection, elementRef: HTMLElement, delta: {
height: number;
width: number;
}): void;
updateSize(size: {
width: number | string;
height: number | string;
}): void;
updatePosition(position: Position): void;
updateOffsetFromParent(): {
top: number;
left: number;
} | undefined;
refDraggable: (c: $TODO) => void;
refResizable: (c: Resizable | null) => void;
render(): JSX.Element;
}
I get a typescript error "Property 'updatePosition' does not exist on type 'MutableRefObject<Rnd | undefined>'." on .updatePosition and .updateSize.
What is wrong and how do I fix it?
|
22d778902eb3b24a540596ca48201081
|
{
"intermediate": 0.3610442876815796,
"beginner": 0.5104108452796936,
"expert": 0.1285448521375656
}
|
41,458
|
replace every property value in the form object to the following value:
value: {value: null, helperText: null, error: false}.
form object: {
personalEducationLevel: null,
personalMaritalStatus: null,
personalResidentialStatus: null,
personalResidenceRegion: null,
personalCustomerWithSpecialStatus: null,
personalRelativeRelation: null,
personalLicensedProfessional: null,
personalStaffApplication: null,
personalMarketSector: null,
personalRelatedPartyFlag: false,
personalCity: null,
personalResidentialPropertyType: null,
idType: null,
idNumber: null,
idExpiryDateG: null,
idExpiryDateH: null,
addressPOBox: null,
addressZip: null,
address: null,
addressCity: null,
addressDependentsNoPublicSchool: null,
addressDependentsNoPrivateSchool: null,
phoneNo: null,
phoneNoConfirmation: null,
phoneValidated: false,
phoneOTPValidated: false,
phoneDigitalEnrolled: false,
emailAddress: null,
emailAddressConfirmation: null,
employmentName: null,
employmentNameMofeed: null,
employmentStartDateG: null,
employmentEndDateG: null,
employmentJobTitle: null,
employmentPOBox: null,
employmentCity: null,
employmentZip: null,
employmentPhoneNo: null,
employmentWorkingTime: null,
employmentGOSIStatus: null,
employmentApproved: null,
employmentApprovedTraining: null,
employmentSegment: null,
employmentType: null,
employmentOccupationType: null,
employmentIncomeType: null,
employmentIncomeSector: null,
employmentCommercialRegistrationDateG: null,
employmentSalaryDateG: null,
employmentRegistration: null,
employmentMonthlyIncome: null,
employmentBasicSalary: null,
employmentHousingAllowance: null,
employmentOtherBenefits: null,
employmentSpouseSalary: null,
employmentVerifiedSalary: null,
employmentSalaryAssignedToRB: null,
employmentBypassMofeed: null,
incomeDepositedRBCurrentMonth: null,
incomeDepositedRBFirstPreviousMonth: null,
incomeDepositedRBSecondPreviousMonth: null,
secondSalaryAmount: null,
secondSalaryIncomeType: null,
secondSalaryAssignedRB: null,
promotionSelected: null,
promotionDescription: null,
expensesDependentsNo: null,
expensesFoodBeverages: null,
expensesHousingRent: null,
expensesUtilities: null,
expensesEducation: null,
expensesHealthCareService: null,
expensesTransportation: null,
expensesMonthlyFamilyRemittance: null,
expensesDomesticHelpNo: null,
expensesDomesticHelpMaidDriver: null,
expensesInsurance: null,
expensesMiscellaneous: null,
expensesLoanFamilyFriends: null,
expensesLoanTerm: null,
expensesFutureExpenses: null,
expensesExpatDependentGovFees: null,
expensesCommunication: null,
expensesVerified: null,
applicationRequestType: null,
applicationProductType: null,
applicationCreditShieldEnrollment: null,
cardNameAsAppear: null,
cardApprovedLimit: null,
repaymentPercentDebt: null,
accountCurrent: null,
accountCurrentNo: null,
accountCardNoMasked: null,
accountCardDeliveryChoice: null,
accountAutoDebtFlag: null,
prepaidCardFee: null,
prepaidCardVATAmount: null,
prepaidCardCurrentAccount: null,
alfursanCardMembershipId: null,
otpValidated: null,
otpOverride: null,
otpOverrideReason: null,
otpCACFlag: null,
otpPromissoryNoteAmount: null,
customerSupplementarySecondaryCis: null,
customerSupplementaryIdType: null,
customerSupplementaryIdNo: null,
customerSupplementaryBirthDateG: null,
customerSupplementaryIdExpiryDateH: null,
customerSupplementaryElmName: null,
customerSupplementaryPhoneNo: null,
customerSupplementaryGender: null,
customerSupplementaryRelationshipType: null,
customerSupplementaryNationality: null,
creditSupplementaryNameOnCard: null,
creditSupplementaryArpRate: null,
creditSupplementaryApprovedLimit: null,
creditSupplementaryExistingCreditCard: null,
creditSupplementaryCardLimit: null,
creditSupplementarySharedPrimaryCardLimit: null,
creditSupplementaryRequestedLimit: null,
requestCurrentAmount: null,
requestHoldAmount: null,
requestComments: null,
replyHoldSuccessfully: null,
replyHoldDateTimeG: null,
}
|
db751698cdd8427a3493c2ee3edf934b
|
{
"intermediate": 0.4155137836933136,
"beginner": 0.3055254817008972,
"expert": 0.2789607644081116
}
|
41,459
|
create a function that will get an html form by its name, and then retrieve all the fields names in a form.
|
09f47052c85c43749a98641e47bf46f1
|
{
"intermediate": 0.40557861328125,
"beginner": 0.2344408631324768,
"expert": 0.3599805235862732
}
|
41,460
|
using System;
using System.IO;
using System.Threading;
namespace Ekiscopp.Modele.Generateur_appli.data
{
public delegate void DelegateFunction(string message);
public class FileModificationListener
{
private string path;
private FileSystemWatcher _watcher;
private DelegateFunction myDelegateFunction;
public FileModificationListener(DelegateFunction myDelegateFunction)
{
this.myDelegateFunction = myDelegateFunction;
}
public void SetPath(string path)
{
StopWatching();
this.path = path;
StartWatching();
}
public void StopWatching()
{
if (_watcher != null)
{
_watcher.EnableRaisingEvents = false;
_watcher.Dispose();
}
}
private void StartWatching()
{
string directory = Path.GetDirectoryName(path);
if (!Directory.Exists(directory))
{
Console.WriteLine(โInvalid directory path.โ);
return;
}
string filename = Path.GetFileName(path);
Console.WriteLine(filename);
_watcher = new FileSystemWatcher(directory)
{
NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName,
};
// Subscribe to the events of the FileSystemWatcher
_watcher.Changed += OnChanged;
_watcher.Created += OnChanged;
_watcher.Deleted += OnChanged;
_watcher.Renamed += OnRenamed;
_watcher.Error += OnError;
_watcher.EnableRaisingEvents = true;
}
private void OnChanged(object sender, FileSystemEventArgs e)
{
Console.WriteLine($โFullPath: {e.FullPath}, Name: {e.Name}, Expected Path: {path}โ);
if (e.Name != Path.GetFileName(path))
{
return;
}
if (e.ChangeType == WatcherChangeTypes.Changed)
{
DateTime lastModified = File.GetLastWriteTime(e.FullPath);
// Display last modification time in the format hh:mm:ss
string message = "Derniรจre modification : " + lastModified.ToString(โHH:mm:ssโ);
Console.WriteLine(message);
// Invoke the delegate on the UI thread if necessary
myDelegateFunction(message);
}
}
private void OnRenamed(object sender, RenamedEventArgs e)
{
// Add logic for file renaming if needed
}
private void OnError(object sender, ErrorEventArgs e)
{
// Handle error events if needed
Console.WriteLine("Error: " + e.GetException().Message);
}
}
}
lorsque je modifie dans lโordre: liste_eqp_distrinor.xlsx, parametrage.xlsx, crรฉรฉ un nouveau fichier texte, le renomme en test.txt et change son contenu รงa me print รงa:
FullPath: D:\rangement\1227F200, Name: 1227F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\1227F200, Name: 1227F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\1227F200, Name: 1227F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\6351768C.tmp, Name: 6351768C.tmp, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
Le thread 0x317c s'est arrรชtรฉ avec le code 0 (0x0).
FullPath: D:\rangement\~$parametrage.xlsx, Name: ~$parametrage.xlsx, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\~$parametrage.xlsx, Name: ~$parametrage.xlsx, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\5148F200, Name: 5148F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\5148F200, Name: 5148F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\5148F200, Name: 5148F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\140ACD1D.tmp, Name: 140ACD1D.tmp, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\2C48F200, Name: 2C48F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\2C48F200, Name: 2C48F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\2C48F200, Name: 2C48F200, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\5A1AF87A.tmp, Name: 5A1AF87A.tmp, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
Le thread 0x5600 s'est arrรชtรฉ avec le code 0 (0x0).
FullPath: D:\rangement\Nouveau document texte.txt, Name: Nouveau document texte.txt, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
FullPath: D:\rangement\test.txt, Name: test.txt, Expected Path: D:\rangement\liste_eqp_distrinor.xlsx
le problรจme cโest que je veux filtrer lโรฉcoute des chagements uniquement sur liste_eqp_distrinor.xlsx!
|
c649274c1440b1b4367b43dff3dfb3a7
|
{
"intermediate": 0.4167213439941406,
"beginner": 0.46211010217666626,
"expert": 0.1211685910820961
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.