row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
2,006
in ssms (sql), how do I delete records across multiple joined tables? can it be done in one query or do I need to do multiple queries (one per table)? please give an example
a60b27502cc1ff7f43cd11e9ce8c3b38
{ "intermediate": 0.5272507071495056, "beginner": 0.26719722151756287, "expert": 0.20555207133293152 }
2,007
for this code from dronekit import connect, VehicleMode from pymavlink import mavutil import time # Set up connection to the telemetry device connection_string = '/dev/ttyUSB0' # Replace with the connection string for your telemetry device connection = mavutil.mavlink_connection(connection_string, baud=57600) # Set the system ID and component ID for each drone master_sysid = 1 master_compid = 1 follower_sysid = 2 follower_compid = 1 # Connect to the master drone master_vehicle = connect(connection_string, wait_ready=True, system=master_sysid, vehicle_class=None) # Connect to the follower drone follower_vehicle = connect(connection_string, wait_ready=True, system=follower_sysid, vehicle_class=None) # Set the mode of each drone to GUIDED master_vehicle.mode = VehicleMode("GUIDED") follower_vehicle.mode = VehicleMode("GUIDED") # Define a function to send a set position command to the master drone def send_position(master_vehicle, lat, lon, alt): msg = master_vehicle.message_factory.set_position_target_global_int_encode( 0, master_compid, 0b0000111111111000, # Position type mask int(lat * 1e7), int(lon * 1e7), int(alt * 1000), 0, 0, 0, 0, 0, 0, 0, 0 ) master_vehicle.send_mavlink(msg) master_vehicle.flush() # Define a function to get the current position of the follower drone def get_follower_position(follower_vehicle): lat = follower_vehicle.location.global_frame.lat lon = follower_vehicle.location.global_frame.lon alt = follower_vehicle.location.global_frame.alt return lat, lon, alt # Set the target position for the master drone target_lat = 47.6205 # Replace with the target latitude target_lon = -122.3493 # Replace with the target longitude target_alt = 50 # Replace with the target altitude # Send the target position to the master drone send_position(master_vehicle, target_lat, target_lon, target_alt) # Loop until the follower drone reaches the target position while True: follower_lat, follower_lon, follower_alt = get_follower_position(follower_vehicle) if abs(follower_lat - target_lat) < 0.0001 and abs(follower_lon - target_lon) < 0.0001 and abs(follower_alt - target_alt) < 1: break time.sleep(1) # Disconnect from the vehicles master_vehicle.close() follower_vehicle.close() integrate it in the below code from pymavlink import mavutil import time # Define a list of waypoints as (latitude, longitude, altitude) tuples waypoints = [ (28.5861474, 77.3421320, 10), (28.5859040, 77.3420736, 10) ] # Start a connection listening on a UDP port the_connection = mavutil.mavlink_connection('/dev/ttyUSB0', baud=57600) # Set mode to Guided the_connection.mav.set_mode_send( the_connection.target_system, # Target system ID mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, # Mode flag 4 # Guided mode ) # Arm the drone the_connection.mav.command_long_send(the_connection.target_system, the_connection.target_component, mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM, 0, 1, 0, 0, 0, 0, 0, 0) # Take off the drone to 10 meters altitude the_connection.mav.command_long_send(the_connection.target_system, the_connection.target_component, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 0, 0, 0, 0, 0, 10) def abort(): """ Waits for 7 seconds for the user to input 'abort'. If 'abort' is entered, sets the mode to RTL and disarms the motors. Otherwise, continues with the waypoint. """ print("Type 'abort' to return to Launch and disarm motors.") start_time = time.monotonic() while time.monotonic() - start_time < 7: user_input = input("Time left: {} seconds\n".format(int(7 - (time.monotonic() - start_time)))) if user_input.lower() == "abort": print("Returning to Launch and disarming motors...") # sets the mode to return to launch(RTL) the_connection.mav.set_mode_send( the_connection.target_system, # Target system ID mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, # Mode flag 6 # RTL ) # disarms the drone the_connection.mav.command_long_send( the_connection.target_system, # Target system ID the_connection.target_component, # Target component ID mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM, # Command ID 0, # Confirmation 0, # Arm (0) or disarm (1) 0, # Unused parameters 0, 0, 0, 0, 0 ) return True return False # below commented code does not work in drone ! # mode = the_connection.mode_mapping()[the_connection.flightmode] mode = 4 print(f"{mode}") while mode == 4: time.sleep(10) # Loop through each waypoint and send MAVLink commands for i, wp in enumerate(waypoints): print("Going to waypoint", i+1) if abort(): exit() else: the_connection.mav.send(mavutil.mavlink.MAVLink_set_position_target_global_int_message( 10, # Time boot_ms the_connection.target_system, the_connection.target_component, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, int(0b110111111000), # Use only lat, long, alt fields (position masking accuracy parameter) int(wp[0] * 10 ** 7), # Latitude in degrees * 10^7 int(wp[1] * 10 ** 7), # Longitude in degrees * 10^7 wp[2], # Altitude in meters 0, # No velocity control 0, # No acceleration control 0, 0, 0, 0, 0, 0 # No yaw, yaw_rate, or type_mask control )) if abort(): exit() time.sleep(5) # Set mode to Return to Launch the_connection.mav.set_mode_send( the_connection.target_system, # Target system ID mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, # Mode flag 6 # RTL ) # disarming the drone the_connection.mav.command_long_send( the_connection.target_system, # Target system ID the_connection.target_component, # Target component ID mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM, # Command ID 0, 0, # Arm (0) or disarm (1) 0, 0, 0, 0, 0, 0 ) # Close the MAVLink connection the_connection.close()
c0a2d46ae283bc9d472378ef4295dd08
{ "intermediate": 0.30317509174346924, "beginner": 0.40754780173301697, "expert": 0.2892770767211914 }
2,008
Hello chatgpt. I need you to design a service in the amazon aws environment. This service will use amazon sns to receive emails, trigger a lambda function that will extra comma separated value data from the body of the email, send this to an external API call, and save the csv data to an amazon s3 bucket in .csv format using a timestamp for a name. The lambda function API call should be left blank with the text "(api call here)". Do not write the code for these pieces yet, describe how this would work, what services would be connected, and how these services would be connected.
abe60429d95be49a6df1400703193863
{ "intermediate": 0.5920871496200562, "beginner": 0.23235538601875305, "expert": 0.1755574643611908 }
2,009
what element does python gradio.textbox create
2a86dba5fc6a2a0d87993b47ddf1f0e0
{ "intermediate": 0.29014095664024353, "beginner": 0.23449428379535675, "expert": 0.4753648042678833 }
2,010
Create a basic “escape game” where the player must find and rescue a captive animal in unity c#, must be in 2D, it is a very basic exercise to be made in an hour
e6c7b747e411d2aed7bd328f77da3ce3
{ "intermediate": 0.3899024724960327, "beginner": 0.30303290486335754, "expert": 0.30706459283828735 }
2,011
hello
a4fe4b0071898f3231eb51221fa08d23
{ "intermediate": 0.32064199447631836, "beginner": 0.28176039457321167, "expert": 0.39759764075279236 }
2,012
Hi there! In python, you need to predict a 5x5 minesweeper game based on the past games. The data will automatic update. You need to use machine learning and not deep learning. Make it predict amount of mines the user inputtet and safe spots the user chose in an input. The data will automatic update. you can't make it random, or get the same predictions again and again. Data is: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24]
f2d3428e7bfb0286d284f6cd76690adb
{ "intermediate": 0.197241872549057, "beginner": 0.1718578189611435, "expert": 0.6309003233909607 }
2,013
Hello! Let’s have a TS training session. I know the basics of JS and I am trying to learn TS as well. If you were to write a program in TS, I would try to read and understand it, and if I am ever stuck, I'd just ask you about what I don’t understand. Can you do that? If you do, please write a somewhat short (10-40 lines long) program for me to analyze. If you can, please make this program neither too basic or too complicated. Also, please do not explain what does it do and don’t add any comments. We’re pretending that this is a someone else’s code that we need to analyze, and someone else’s code would most likely not have comments and we’d have no one to explain the code to us. We did this exercise a few times already, so please do not use the following examples: Simple Person class with Greetings method; Simple shopping cart program; Program with different shapes inheriting from a Shape class, using the Area method from there; More complicated program about a Network class simulating a request to web. It used Interfaces, Promises and async requests.
cf8002517142b1c1d46e2be008d31166
{ "intermediate": 0.35144761204719543, "beginner": 0.5488426685333252, "expert": 0.09970973432064056 }
2,014
To create a feature complete REST API for time scheduling. Tech requirements Use an SQL Database with an ORM Store data in related tables with foreign keys, don’t use json columns Use a high level Javascript or PHP framework (NestJS, Laravel, Symfony, …) Scope Only backend APIs are in the scope of this hackathon, No frontend HTML/JS/CSS should be created. User stories As a user, I would like to book an appointment As a user, I would like to select the date and see all available slots for this day As a user, I want to open the scheduling page and book appointments for multiple people at once (think of booking a haircut for yourself and your two kids) Business stories As a business administrator, I want to allow users to book for an appointment for available services. As a business administrator, I want to show a calendar to users, with all available slots for booking for all available services. As a business administrator, I want to configure my bookable schedule (bookable calendar) for different services all user stories below Example: As an owner of Hair saloon, I want to create an online bookable calendar for Men haircut, Women haircut and Hair colouring services. As a business administrator, I want to configure opening hours which can differ from day to day Example: Monday to Friday men haircut can be booked from 08:00 to 20:00, and Women haircut can be booked from 10:00 to 22:00 on Saturday, men haircut and women haircut, can be booked from 10:00 to 22:00 As a business administrator, I want to configure the duration of appointment that can be booked by users. Example: For Men haircut, An appointment can be of 30 minutes and For Women haircut, An appointment can be of 60 minutes. As a business administrator, I want to have a configurable break between appointments. Example: 5 minutes to clean the shop before next appointment of Men haircut, and 10 minutes to clean up before next Women haircut. As a business administrator, I want to allow users to book a time slot in x days in future but not for more than x days, where x is configurable number of days. Example: If a user tries to book a slot today, they can be allowed to book for 7 days in future but not for 8th day. As a business administrator, I want to configure one or more breaks (Off time) when a service can’t be booked. Example: Lunch break 12:00 - 13:00, Coffee Break 17:00 - 17:30 etc. As a business administrator, I want that a configurable number (1 or more) of clients can book one time slot. Example: A hair saloon, can serve 5 men haircuts and 3 women haircuts at same time. As a business administrator, I would like to specify date and time duration when business is would be off, these are different from weekly off. (These are planned off date and time duration.) Example: Men and women haircut service, would remain closed in second half Christmas, full day on Eid and Diwali. Women haircut service would remain closed on 25th January because our women’s hair expert is on leave. As a business administrator, I don’t want to allow users to book for an invalid slot. A requested slot is invalid - if requested slot is booked out if requested slot doesn’t exist in bookable calendar if requested slot falls between configured breaks if requested slot falls between configured break between appointments. if requested slot falls on a planned off date and time duration. As a business administrator, I want to create multiple scheduling events with totally different configurations (Men haircut, Women haircut, hair colouring, etc) As a business administrator, I want those different events to be totally separate As a business administrator, I want users to specify their personal details (First name, last name and email address) for each individual in booking request. Example: If a booking request is created for 3 people, booking request must contain 3 person’s details. As a business administrator, I want to allow a person to book multiple times without any unique restriction. Example: A user should be allowed to make booking for 3 people, even if they don’t know the person’s details, in such case they can copy their own details. As another developer I want peace of mind and just run the automated test suite and know that I did not break anything Acceptance criteria A time scheduling JSON based Rest API should be created 1 GET api which provides all data an SPA might need to display a calendar and a time selection. 1 POST api which creates a booking for 1 or more people for a single time slot API should accept single slot for which booking needs to be created. API should accept personal details (Email, First name and Last name) of one or multiple people to be booked. Implement automated testing that ensures the functionality of your code Important: don’t trust the frontend, validate the data so that the API returns an exception in case something does not fit into the schema or is already booked out For a men haircut booking should not be possible at 7am because its before the shop opens. booking at 8:02 should not be possible because its not fitting in any slot. booking at 12:15 should not be possible as its lunch break. … Seed your database with the following scheduling using seeder files Men Haircut slots for the next 7 days, Sunday off. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. lunch break at 12:00-13:00. cleaning break at 15:00-16:00. max 3 clients per slot. slots every 10 minutes. 5 minutes cleanup break between slots. the third day starting from now is a public holiday. Woman Haircut slots for the next 7 days, Sunday off. lunch break at 12:00-13:00. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. cleaning break at 15:00-16:00. slots every 1 hour. 10 minutes cleanup break. max 3 clients per slot. the third day starting from now is a public holiday. make tutorial to do this in code step by step in laravel ?
6c6eeab7e364cd75abf2f416f0fd6bd7
{ "intermediate": 0.4434363543987274, "beginner": 0.33789414167404175, "expert": 0.21866951882839203 }
2,015
To create a feature complete REST API for time scheduling. Tech requirements Use an SQL Database with an ORM Store data in related tables with foreign keys, don’t use json columns Use a high level Javascript or PHP framework (NestJS, Laravel, Symfony, …) Scope Only backend APIs are in the scope of this hackathon, No frontend HTML/JS/CSS should be created. User stories As a user, I would like to book an appointment As a user, I would like to select the date and see all available slots for this day As a user, I want to open the scheduling page and book appointments for multiple people at once (think of booking a haircut for yourself and your two kids) Business stories As a business administrator, I want to allow users to book for an appointment for available services. As a business administrator, I want to show a calendar to users, with all available slots for booking for all available services. As a business administrator, I want to configure my bookable schedule (bookable calendar) for different services all user stories below Example: As an owner of Hair saloon, I want to create an online bookable calendar for Men haircut, Women haircut and Hair colouring services. As a business administrator, I want to configure opening hours which can differ from day to day Example: Monday to Friday men haircut can be booked from 08:00 to 20:00, and Women haircut can be booked from 10:00 to 22:00 on Saturday, men haircut and women haircut, can be booked from 10:00 to 22:00 As a business administrator, I want to configure the duration of appointment that can be booked by users. Example: For Men haircut, An appointment can be of 30 minutes and For Women haircut, An appointment can be of 60 minutes. As a business administrator, I want to have a configurable break between appointments. Example: 5 minutes to clean the shop before next appointment of Men haircut, and 10 minutes to clean up before next Women haircut. As a business administrator, I want to allow users to book a time slot in x days in future but not for more than x days, where x is configurable number of days. Example: If a user tries to book a slot today, they can be allowed to book for 7 days in future but not for 8th day. As a business administrator, I want to configure one or more breaks (Off time) when a service can’t be booked. Example: Lunch break 12:00 - 13:00, Coffee Break 17:00 - 17:30 etc. As a business administrator, I want that a configurable number (1 or more) of clients can book one time slot. Example: A hair saloon, can serve 5 men haircuts and 3 women haircuts at same time. As a business administrator, I would like to specify date and time duration when business is would be off, these are different from weekly off. (These are planned off date and time duration.) Example: Men and women haircut service, would remain closed in second half Christmas, full day on Eid and Diwali. Women haircut service would remain closed on 25th January because our women’s hair expert is on leave. As a business administrator, I don’t want to allow users to book for an invalid slot. A requested slot is invalid - if requested slot is booked out if requested slot doesn’t exist in bookable calendar if requested slot falls between configured breaks if requested slot falls between configured break between appointments. if requested slot falls on a planned off date and time duration. As a business administrator, I want to create multiple scheduling events with totally different configurations (Men haircut, Women haircut, hair colouring, etc) As a business administrator, I want those different events to be totally separate As a business administrator, I want users to specify their personal details (First name, last name and email address) for each individual in booking request. Example: If a booking request is created for 3 people, booking request must contain 3 person’s details. As a business administrator, I want to allow a person to book multiple times without any unique restriction. Example: A user should be allowed to make booking for 3 people, even if they don’t know the person’s details, in such case they can copy their own details. As another developer I want peace of mind and just run the automated test suite and know that I did not break anything Acceptance criteria A time scheduling JSON based Rest API should be created 1 GET api which provides all data an SPA might need to display a calendar and a time selection. 1 POST api which creates a booking for 1 or more people for a single time slot API should accept single slot for which booking needs to be created. API should accept personal details (Email, First name and Last name) of one or multiple people to be booked. Implement automated testing that ensures the functionality of your code Important: don’t trust the frontend, validate the data so that the API returns an exception in case something does not fit into the schema or is already booked out For a men haircut booking should not be possible at 7am because its before the shop opens. booking at 8:02 should not be possible because its not fitting in any slot. booking at 12:15 should not be possible as its lunch break. … Seed your database with the following scheduling using seeder files Men Haircut slots for the next 7 days, Sunday off. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. lunch break at 12:00-13:00. cleaning break at 15:00-16:00. max 3 clients per slot. slots every 10 minutes. 5 minutes cleanup break between slots. the third day starting from now is a public holiday. Woman Haircut slots for the next 7 days, Sunday off. lunch break at 12:00-13:00. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. cleaning break at 15:00-16:00. slots every 1 hour. 10 minutes cleanup break. max 3 clients per slot. the third day starting from now is a public holiday. make tutorial to do this in code step by step in laravel ?
f1db81dae32746e8b25f995759cf616c
{ "intermediate": 0.4434363543987274, "beginner": 0.33789414167404175, "expert": 0.21866951882839203 }
2,016
You are a leading expert in working with ai image generation and creating the most effective and useful prompts for mid journey and dalle. Create a useful list of prompts that cover an extensive variety of art types by various artists and styles. Create a list of 500 prompts
46fefd2ba83f36e657753fde1edd9772
{ "intermediate": 0.2461819052696228, "beginner": 0.2715384364128113, "expert": 0.4822796583175659 }
2,017
what is the logic to create a trailing loss. the existing program includes a df that contains stocks and their prices over an interval of two years. the program loops through each row, entering and exiting a trade based on the day over day RSI value
c73d1e5d2c10f8742f7211f18d3ca63d
{ "intermediate": 0.3301774263381958, "beginner": 0.37769216299057007, "expert": 0.29213035106658936 }
2,018
In python, you need to predict a 5x5 minesweeper game using Deep learning. Your goal is to make it as accurate as possible. Around 80%+ You've data for every game played with all mine locations. But, there is something you need to know. This 5x5 board, can the player chose how many bombs there are on it. The player can chose bombs from 1 to 10. You need to make an input that takes how many bombs the user chose. You also need to make an input that takes the amount of safe spots the user wants. You need to predict the amount the user has set for safe spots. You also need to predict the possible bomb locations out of the user mine amount input. Also, the results have to be the same everytime if the data isnt changed. Data. You will have the data for the amount of mines the user chose. If the user chooses 3 mines, you will get all the games with 3 mines in it as data with their past locations. The data is: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] and the this list will update it self. You need to use the list raw
d7977ab176af3c49f4100fca6814fa50
{ "intermediate": 0.2841210663318634, "beginner": 0.16462300717830658, "expert": 0.5512559413909912 }
2,019
je suis en CTF de cybersécurité. Je suis en train d'écrire un script pour récuperer des mots de passe via un injection nosql. Mon code fonctionne mais je ne recois que les premier caractere du flag et je ne comprend pas pourquoi. Peut tu maider? async function callAuth(pass) { var http = new XMLHttpRequest(); http.open('POST', "http://staff-review-panel.mailroom.htb/auth.php", true); http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); http.onload = function () { if (this.responseText.includes("success\":true")) { notify(pass); cal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#%'()+, -/:;<=>@[\\]_`{}~", pass); } }; http.send("email=tristan@mailroom.htb&password[$regex]=^"+pass); } function notify(pass) { fetch("http://10.10.14.106/out?" + pass); } var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#%'()+, -/:;<=>@[\]_`{}~"; function cal(chars, pass) { for (var i = 0; i < chars.length; i++) { callAuth(pass+chars[i]) } } cal(chars, "");
439730ea01e9fb69611480d2fb70cd43
{ "intermediate": 0.37896886467933655, "beginner": 0.46247056126594543, "expert": 0.1585606038570404 }
2,020
To create a feature complete REST API for time scheduling. Tech requirements Use an SQL Database with an ORM Store data in related tables with foreign keys, don’t use json columns Use a high level Javascript or PHP framework (NestJS, Laravel, Symfony, …) Scope Only backend APIs are in the scope of this hackathon, No frontend HTML/JS/CSS should be created. User stories As a user, I would like to book an appointment As a user, I would like to select the date and see all available slots for this day As a user, I want to open the scheduling page and book appointments for multiple people at once (think of booking a haircut for yourself and your two kids) Business stories As a business administrator, I want to allow users to book for an appointment for available services. As a business administrator, I want to show a calendar to users, with all available slots for booking for all available services. As a business administrator, I want to configure my bookable schedule (bookable calendar) for different services all user stories below Example: As an owner of Hair saloon, I want to create an online bookable calendar for Men haircut, Women haircut and Hair colouring services. As a business administrator, I want to configure opening hours which can differ from day to day Example: Monday to Friday men haircut can be booked from 08:00 to 20:00, and Women haircut can be booked from 10:00 to 22:00 on Saturday, men haircut and women haircut, can be booked from 10:00 to 22:00 As a business administrator, I want to configure the duration of appointment that can be booked by users. Example: For Men haircut, An appointment can be of 30 minutes and For Women haircut, An appointment can be of 60 minutes. As a business administrator, I want to have a configurable break between appointments. Example: 5 minutes to clean the shop before next appointment of Men haircut, and 10 minutes to clean up before next Women haircut. As a business administrator, I want to allow users to book a time slot in x days in future but not for more than x days, where x is configurable number of days. Example: If a user tries to book a slot today, they can be allowed to book for 7 days in future but not for 8th day. As a business administrator, I want to configure one or more breaks (Off time) when a service can’t be booked. Example: Lunch break 12:00 - 13:00, Coffee Break 17:00 - 17:30 etc. As a business administrator, I want that a configurable number (1 or more) of clients can book one time slot. Example: A hair saloon, can serve 5 men haircuts and 3 women haircuts at same time. As a business administrator, I would like to specify date and time duration when business is would be off, these are different from weekly off. (These are planned off date and time duration.) Example: Men and women haircut service, would remain closed in second half Christmas, full day on Eid and Diwali. Women haircut service would remain closed on 25th January because our women’s hair expert is on leave. As a business administrator, I don’t want to allow users to book for an invalid slot. A requested slot is invalid - if requested slot is booked out if requested slot doesn’t exist in bookable calendar if requested slot falls between configured breaks if requested slot falls between configured break between appointments. if requested slot falls on a planned off date and time duration. As a business administrator, I want to create multiple scheduling events with totally different configurations (Men haircut, Women haircut, hair colouring, etc) As a business administrator, I want those different events to be totally separate As a business administrator, I want users to specify their personal details (First name, last name and email address) for each individual in booking request. Example: If a booking request is created for 3 people, booking request must contain 3 person’s details. As a business administrator, I want to allow a person to book multiple times without any unique restriction. Example: A user should be allowed to make booking for 3 people, even if they don’t know the person’s details, in such case they can copy their own details. As another developer I want peace of mind and just run the automated test suite and know that I did not break anything Acceptance criteria A time scheduling JSON based Rest API should be created 1 GET api which provides all data an SPA might need to display a calendar and a time selection. 1 POST api which creates a booking for 1 or more people for a single time slot API should accept single slot for which booking needs to be created. API should accept personal details (Email, First name and Last name) of one or multiple people to be booked. Implement automated testing that ensures the functionality of your code Important: don't trust the frontend, validate the data so that the API returns an exception in case something does not fit into the schema or is already booked out For a men haircut booking should not be possible at 7am because its before the shop opens. booking at 8:02 should not be possible because its not fitting in any slot. booking at 12:15 should not be possible as its lunch break. … Seed your database with the following scheduling using seeder files Men Haircut slots for the next 7 days, Sunday off. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. lunch break at 12:00-13:00. cleaning break at 15:00-16:00. max 3 clients per slot. slots every 10 minutes. 5 minutes cleanup break between slots. the third day starting from now is a public holiday. Woman Haircut slots for the next 7 days, Sunday off. lunch break at 12:00-13:00. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. cleaning break at 15:00-16:00. slots every 1 hour. 10 minutes cleanup break. max 3 clients per slot. the third day starting from now is a public holiday. do tutorial in laravel for this step by step by code ?
7066fc6c043f86ba46548e244df22923
{ "intermediate": 0.4434363543987274, "beginner": 0.33789414167404175, "expert": 0.21866951882839203 }
2,021
write a python script to load the website https://huggingface.co/spaces/yuntian-deng/ChatGPT
feaafdcfa0cf1f1683f18ef560d29267
{ "intermediate": 0.35321924090385437, "beginner": 0.24115507304668427, "expert": 0.4056256115436554 }
2,022
In python, you need to predict a 5x5 minesweeper game using Deep learning. Your goal is to make it as accurate as possible. Around 80%+ You've data for every game played with all mine locations. But, there is something you need to know. This 5x5 board, can the player chose how many bombs there are on it. The player can chose bombs from 1 to 10. You need to make an input that takes how many bombs the user chose. You also need to make an input that takes the amount of safe spots the user wants. You need to predict the amount the user has set for safe spots. You also need to predict the possible bomb locations out of the user mine amount input. Also, the results have to be the same everytime if the data isnt changed. Also it cant return numbers like 1,2,3 Data. You will have the data for the amount of mines the user chose. If the user chooses 3 mines, you will get all the games with 3 mines in it as data with their past locations. The data is: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] and the this list will update it self. You need to use the list raw
b985d3934ccc0b0f898cbe823c3ea25e
{ "intermediate": 0.29781126976013184, "beginner": 0.15176264941692352, "expert": 0.5504260659217834 }
2,023
In python, you need to predict a 5x5 minesweeper game using Deep learning. Your goal is to make it as accurate as possible. Around 80%+ You've data for every game played with all mine locations. But, there is something you need to know. This 5x5 board, can the player chose how many bombs there are on it. The player can chose bombs from 1 to 10. You need to make an input that takes how many bombs the user chose. You also need to make an input that takes the amount of safe spots the user wants. You need to predict the amount the user has set for safe spots. You also need to predict the possible bomb locations out of the user mine amount input. Also, the results have to be the same everytime if the data isn't changed. Also make it return the mine locations and prediction in each of their own varibles. Data. You will have the data for the amount of mines the user chose. If the user chooses 3 mines, you will get all the games with 3 mines in it as data with their past locations. The data is: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] and the this list will update it self. You need to use the list raw
f79dfb18851caa5807adf69fcf991bbe
{ "intermediate": 0.30710333585739136, "beginner": 0.15022306144237518, "expert": 0.5426735877990723 }
2,024
Create a match detection system for three or more items of the same type in a grid in a match-3 game: This exercise will emphasize the importance of search algorithms and data structures such as arrays and lists with python
fe693b274eea21d194dd480196ddc2c7
{ "intermediate": 0.2385272979736328, "beginner": 0.05296672135591507, "expert": 0.7085059881210327 }
2,025
Hi! How to compile QE with sirius?
568d46f76dfa5a837ff1edf53c227461
{ "intermediate": 0.33128979802131653, "beginner": 0.2234816700220108, "expert": 0.44522854685783386 }
2,026
write an assay about 《marxism in china》 use Chinese
182593e8512c6b34b441cf8356292662
{ "intermediate": 0.3789929449558258, "beginner": 0.3208250105381012, "expert": 0.3001820147037506 }
2,027
For example Convert 765 days to date format in c# like 1 year and 11 months and 12 day
2c20f372e0b4e0fab1e7aa380b87357d
{ "intermediate": 0.4145658314228058, "beginner": 0.31893491744995117, "expert": 0.26649922132492065 }
2,028
I'm frontend developper, please provide a css for a Marp theme with a centered logo in the footer
7e2dd3fb569056bea5f6e732d2d005e0
{ "intermediate": 0.3005372881889343, "beginner": 0.35494789481163025, "expert": 0.34451478719711304 }
2,029
In python, you need to predict a 5x5 minesweeper game using Deep learning. Your goal is to make it as accurate as possible. Around 80%+ You've data for every game played with all mine locations. But, there is something you need to know. This 5x5 board, can the player chose how many bombs there are on it. The player can chose bombs from 1 to 10. You need to make an input that takes how many bombs the user chose. You also need to make an input that takes the amount of safe spots the user wants. You need to predict the amount the user has set for safe spots. You also need to predict the possible bomb locations out of the user mine amount input. Also, the results have to be the same everytime if the data isn't changed. Also make it return the mine locations and prediction in each of their own varibles. Data. You will have the data for the amount of mines the user chose. If the user chooses 3 mines, you will get all the games with 3 mines in it as data with their past locations. The data is: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] and the this list will update it self. You need to use the list raw
20f79ceb91459276b7fe61355a4c8b79
{ "intermediate": 0.30710333585739136, "beginner": 0.15022306144237518, "expert": 0.5426735877990723 }
2,030
I’m frontend developper, please provide a css for a Marp theme with a centered logo in the footer
fe25bd817f1f6b3624b7472a77c2f8b2
{ "intermediate": 0.2537221908569336, "beginner": 0.36126992106437683, "expert": 0.3850078880786896 }
2,031
hello i am brand new to unity and i want to make a game. the game that i want to make is a vampire survival type game but i want it in 3d. another thing i want is for it to have unique movement. what do i mean by this, i mean i want the character to rotate clockwise or counter clockwise when pressing a or b. i also want the character to shoot a short distance when double pressing w a s or d in there respective direction. another thing i want is for you to be able to control the characters direction when shooting forward by pressing w a s or d in there respective direction. give me a detailed step by step directions on how to do it in unity 2022.2.9f1
d41fbd71f3846e729c7be66c8d2be3a7
{ "intermediate": 0.4169849455356598, "beginner": 0.2824755907058716, "expert": 0.300539493560791 }
2,032
You are a Python programmer. Your main goal is to write optimal, reliable code
34fe53a700ce313cfa2baa47d042a228
{ "intermediate": 0.1916275918483734, "beginner": 0.4287510812282562, "expert": 0.37962135672569275 }
2,033
tell me about the if operator
327860213d78038fda9d79502e311ac8
{ "intermediate": 0.207026407122612, "beginner": 0.38509488105773926, "expert": 0.40787872672080994 }
2,034
Parsing Error at Position 435:16457, unexpected token <Symbol> "+", expected <Symbol> "=" lua: ./src\logger.lua:54: Parsing Error at Position 435:16457, unexpected token <Symbol> "+", expected <Symbol> "=" stack traceback: [C]: in function 'error' ./src\logger.lua:54: in function 'errorCallback' ./src\logger.lua:57: in function 'error' ./src\prometheus\parser.lua:134: in function 'expect' ./src\prometheus\parser.lua:472: in function 'statement' ./src\prometheus\parser.lua:171: in function 'block' ./src\prometheus\parser.lua:220: in function 'statement' ./src\prometheus\parser.lua:171: in function 'block' ./src\prometheus\parser.lua:294: in function 'statement' ./src\prometheus\parser.lua:171: in function 'block' ./src\prometheus\parser.lua:314: in function 'statement' ./src\prometheus\parser.lua:171: in function 'block' ./src\prometheus\parser.lua:149: in function 'parse' ./src\prometheus\pipeline.lua:178: in function 'apply' ./src\cli.lua:148: in main chunk [C]: in function 'require' ./cli.lua:12: in main chunk [C]: ?
0dab5cf76503b5dbd5f33fa5f960539b
{ "intermediate": 0.37674108147621155, "beginner": 0.3528757095336914, "expert": 0.27038314938545227 }
2,035
Write down the code for making a minecraft clone in roblox studio, make it copy n pasteable.
40786b14f63d4c0de4b5673f83e0c747
{ "intermediate": 0.33017033338546753, "beginner": 0.27695295214653015, "expert": 0.3928767442703247 }
2,036
In python predict a minesweeper game on a 5x5 board. Data type. You've data for all the games played with the input of mines the user inputs. If the user says 3 mines, you get automatic data for the past games with 3 mines. If the user puts 2, you get the data for the past games with 2 mines. You don't have to worry about that, just keep in mind you need to use the data list raw like this: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] Method. You have to use deep learning to predict the amount of safe spots the user chose and the possible bomb locations which is the users mine input. You can't make it random or get the same results like 1,2,3... It needs to have an accuracy on about 80% and can be a bit slow just if the accuracy is high. Just remember that the user needs to input safe spots and amount of mines in the game, and the data will automatic update, but for now, use the list I sent, also keep in mind here, that the real list is much much longer.
38a61beaf9a57876521f383f693d497d
{ "intermediate": 0.2880796194076538, "beginner": 0.19452600181102753, "expert": 0.5173943638801575 }
2,037
Where in AWS CDK v2 Template class with add_resource method? Core unavaiable because in AWS CDK v2 aws-cdk-lib was deprecated and required incompatible versions of libraries.
0d935d6b37f304c9d1e9bafe3578659d
{ "intermediate": 0.7064871788024902, "beginner": 0.19833625853061676, "expert": 0.0951765701174736 }
2,038
Using Python, create a predictive model for a 5x5 Minesweeper game. The data type you'll be working with includes past games with specific user-inputted numbers of mines. The raw data list will be provided to you automatically based on the user's input. For example, if the user inputs 3 mines, you'll receive data from past games that also had 3 mines. If the user inputs 2 mines, you'll receive data from past games with 2 mines. Please note that you don't need to worry about obtaining this data, just keep in mind that you'll need to use the data list in its raw form, such as the following example: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] To create the model, you'll need to use deep learning techniques to predict the number of safe spots the user chooses and the possible locations of mines based on the user's mine input. It's important that the predictions are accurate, with a minimum accuracy of 80%. The model may take a bit longer to run if the accuracy is high, but this is acceptable. Keep in mind that the user will input the number of safe spots and the number of mines in the game, and the data will be automatically updated. However, for now, please use the provided list, and note that the actual list of data is much longer.
0f0ebac2e416176de6b0581e985d5ce6
{ "intermediate": 0.16638270020484924, "beginner": 0.15995553135871887, "expert": 0.6736618280410767 }
2,039
To create a feature complete REST API for time scheduling. Tech requirements Use an SQL Database with an ORM Store data in related tables with foreign keys, don’t use json columns Use a high level Javascript or PHP framework (NestJS, Laravel, Symfony, …) Scope Only backend APIs are in the scope of this hackathon, No frontend HTML/JS/CSS should be created. User stories As a user, I would like to book an appointment As a user, I would like to select the date and see all available slots for this day As a user, I want to open the scheduling page and book appointments for multiple people at once (think of booking a haircut for yourself and your two kids) Business stories As a business administrator, I want to allow users to book for an appointment for available services. As a business administrator, I want to show a calendar to users, with all available slots for booking for all available services. As a business administrator, I want to configure my bookable schedule (bookable calendar) for different services all user stories below Example: As an owner of Hair saloon, I want to create an online bookable calendar for Men haircut, Women haircut and Hair colouring services. As a business administrator, I want to configure opening hours which can differ from day to day Example: Monday to Friday men haircut can be booked from 08:00 to 20:00, and Women haircut can be booked from 10:00 to 22:00 on Saturday, men haircut and women haircut, can be booked from 10:00 to 22:00 As a business administrator, I want to configure the duration of appointment that can be booked by users. Example: For Men haircut, An appointment can be of 30 minutes and For Women haircut, An appointment can be of 60 minutes. As a business administrator, I want to have a configurable break between appointments. Example: 5 minutes to clean the shop before next appointment of Men haircut, and 10 minutes to clean up before next Women haircut. As a business administrator, I want to allow users to book a time slot in x days in future but not for more than x days, where x is configurable number of days. Example: If a user tries to book a slot today, they can be allowed to book for 7 days in future but not for 8th day. As a business administrator, I want to configure one or more breaks (Off time) when a service can’t be booked. Example: Lunch break 12:00 - 13:00, Coffee Break 17:00 - 17:30 etc. As a business administrator, I want that a configurable number (1 or more) of clients can book one time slot. Example: A hair saloon, can serve 5 men haircuts and 3 women haircuts at same time. As a business administrator, I would like to specify date and time duration when business is would be off, these are different from weekly off. (These are planned off date and time duration.) Example: Men and women haircut service, would remain closed in second half Christmas, full day on Eid and Diwali. Women haircut service would remain closed on 25th January because our women’s hair expert is on leave. As a business administrator, I don’t want to allow users to book for an invalid slot. A requested slot is invalid - if requested slot is booked out if requested slot doesn’t exist in bookable calendar if requested slot falls between configured breaks if requested slot falls between configured break between appointments. if requested slot falls on a planned off date and time duration. As a business administrator, I want to create multiple scheduling events with totally different configurations (Men haircut, Women haircut, hair colouring, etc) As a business administrator, I want those different events to be totally separate As a business administrator, I want users to specify their personal details (First name, last name and email address) for each individual in booking request. Example: If a booking request is created for 3 people, booking request must contain 3 person’s details. As a business administrator, I want to allow a person to book multiple times without any unique restriction. Example: A user should be allowed to make booking for 3 people, even if they don’t know the person’s details, in such case they can copy their own details. As another developer I want peace of mind and just run the automated test suite and know that I did not break anything Acceptance criteria A time scheduling JSON based Rest API should be created 1 GET api which provides all data an SPA might need to display a calendar and a time selection. 1 POST api which creates a booking for 1 or more people for a single time slot API should accept single slot for which booking needs to be created. API should accept personal details (Email, First name and Last name) of one or multiple people to be booked. Implement automated testing that ensures the functionality of your code Important: don’t trust the frontend, validate the data so that the API returns an exception in case something does not fit into the schema or is already booked out For a men haircut booking should not be possible at 7am because its before the shop opens. booking at 8:02 should not be possible because its not fitting in any slot. booking at 12:15 should not be possible as its lunch break. … Seed your database with the following scheduling using seeder files Men Haircut slots for the next 7 days, Sunday off. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. lunch break at 12:00-13:00. cleaning break at 15:00-16:00. max 3 clients per slot. slots every 10 minutes. 5 minutes cleanup break between slots. the third day starting from now is a public holiday. Woman Haircut slots for the next 7 days, Sunday off. lunch break at 12:00-13:00. from 08:00-20:00 Monday to Friday. from 10:00-22:00 Saturday. cleaning break at 15:00-16:00. slots every 1 hour. 10 minutes cleanup break. max 3 clients per slot. the third day starting from now is a public holiday. make tutorial to do all this tasks step by step by code in laravel ? Focus on database and controller
324d60cf0c1a583e30f1dde368b9ba38
{ "intermediate": 0.4434363543987274, "beginner": 0.33789414167404175, "expert": 0.21866951882839203 }
2,040
In python, make a machine learning model to predict a 5x5 minesweeper game. You can’t make it random or make it predict 2 same results in a row if a new game is started. You have data for the past 30 games [5, 12, 13, 4, 17, 19, 4, 18, 21, 1, 6, 11, 7, 15, 22, 14, 18, 19, 1, 19, 20, 9, 16, 17, 1, 19, 20, 6, 14, 24, 15, 20, 22, 7, 18, 21, 4, 16, 23, 5, 11, 19, 5, 6, 23, 6, 12, 13, 0, 5, 15, 1, 5, 22, 0, 2, 23, 5, 10, 13, 5, 12, 17, 1, 7, 22, 7, 11, 18, 7, 8, 9, 17, 21, 24, 13, 14, 16, 2, 3, 11, 7, 17, 18, 7, 14, 21, 2, 5, 9] and you need to predict x safe spots that are giving by the user and x possible bomb locations that amount is the giving mines amount.The data lenght changes by the selected mines. It's mines x 30, = all mine past data. So 3 mines becomes 90 past mines. You need to use the list raw and it needs to get the same data if the mine locations are not changed. It also needs to the accuracy
e99c04967b0fdadc4dd35262afe6fff4
{ "intermediate": 0.13684402406215668, "beginner": 0.06368330121040344, "expert": 0.7994726896286011 }
2,041
You're a helpful coding assistant and pair programmer working with a human user. You are working in R shiny app for web scrapping EU Clinical Trials Register. Features: - Select the input option [not fully implemented] - Select sets of data to scrape [not fully implemented] - Select the output file format [not fully implemented] Please ask any clarifying questions before proceeding, if necessary. This is our current code: --- app.R: library(shiny) # Define UI for application that draws a histogram ui <- shinyUI(fluidPage( # Subtitle h2("EUCTR Scraper 🪄", align="center"), # Instruction text with hyperlink div( style = "text-align: center; margin-top: 20px; margin-bottom: 20px;", HTML("This is a web scraper for the <a href='https://www.clinicaltrialsregister.eu/ctr-search/search'>EU Clinical Trial Register</a>.") ), # Select input option selectInput("input_option", "Select the input option:", choices = c("EUCTR search query URL", "List of EudraCT numbers"), selected = "EUCTR search query URL"), # Input box for the URL textInput("input_var", "Do a trial search on EU Clinical Trials Register website and copy the URL for the search query:", value="Paste here", width="100%"), # Selectize input box with list of options and suboptions selectizeInput("selection_box", label = "Select sets of data to scrape:", choices = list( "Option 1" = list( "Suboption 1.1" = "suboption1.1", "Suboption 1.2" = "suboption1.2", "Suboption 1.3" = "suboption1.3" ), "Option 2" = list( "Suboption 2.1" = "suboption2.1", "Suboption 2.2" = "suboption2.2" ) # Add more options and suboptions here ), multiple = TRUE, options = list(plugins = list('remove_button')), width = "100%"), # Select the output file format selectInput("file_format", "Select the output file format:", choices = c("Excel file" = "xlsx", "CSV files" = "csv"), selected = "xlsx"), # ‘Start’ button actionButton("start", "Start"), # Output link to the generated file uiOutput("output_link") )) # Define server logic server <- shinyServer(function(input, output) { # Create a reactive value to store the clicked button count click_count <- reactiveValues(count = 0) # Define a reactive expression for the selected file format file_format <- reactive({ if (input$file_format == "xlsx") { "Excel file" } else if (input$file_format == "csv") { "CSV files" } }) # Define a reactive expression for the selected data sets selected_data_sets <- reactive({ input$selection_box }) # Define a reactive expression for the selected input option selected_option <- reactive({ if (input$input_option == "EUCTR search query URL") { "EUCTR search query URL" } else if (input$input_option == "List of EudraCT numbers") { "List of EudraCT numbers" } }) # Define an observer for the Start button click event observeEvent(input$start, { # Increment the click count click_count$count <- click_count$count + 1 # Print a message to the console to indicate that the Start button was clicked print(paste0("Start button clicked ", click_count$count, " time(s).")) # Source the EUCTR_shiny.R script source("driver.R") # Call the EUCTR_shiny.R script with the selected input values output_file <- isolate(EUCTR_shiny_script(selected_input = input$input_var, selected_data_sets = selected_data_sets(), selected_option = selected_option(), selected_format = input$file_format)) # Generate a download link for the output file output$output_link <- renderUI({ fluidRow( column(12, h3("Generated file:"), a(href = output_file, download = "euctr_data", class = "btn btn-info", icon("download"), file_format()) ) ) }) }) }) # Run the application shinyApp(ui = ui, server = server) --- driver.R: EUCTR_shiny_script <- function(selected_input, selected_data_sets, selected_option, selected_format) { library(rvest) library(tidyverse) library(tidyr) library(openxlsx) library(readxl) # Create a new environment to store shared variables my_env <- new.env() # Define variables EUCTR_version <- "0.2" process_time <- format(Sys.time(), "%Y-%m-%d %H:%M") # Assign the variables to the environment assign("selected_input", selected_input, envir = my_env) assign("selected_data_sets", selected_data_sets, envir = my_env) assign("selected_option", selected_option, envir = my_env) assign("selected_format", selected_format, envir = my_env) assign("EUCTR_version", EUCTR_version, envir = my_env) assign("process_time", process_time, envir = my_env) # Run the query crawler source('./crawler.R', local = my_env) # Run the protocol scraper source('./protocol.R', local = my_env) # Run the results scraper source('./results.R', local = my_env) # Save to xlsx source('./savexlsx.R', local = my_env) } --- What are some ways to add a dynamic progress message (with messages defined throughout the scraper scripts) to the ui, which updates alongside the scraper progress?
e5824d8148d51784b6533e2260e831c8
{ "intermediate": 0.4647839069366455, "beginner": 0.34129586815834045, "expert": 0.19392023980617523 }
2,042
How I can request AWS Cloudformer for resource template creation using Python?
f8d92a450e801813eb0a8e19a07e74d2
{ "intermediate": 0.6378156542778015, "beginner": 0.16897840797901154, "expert": 0.19320595264434814 }
2,043
Hi there! In python, you need to predict a 5x5 minesweeper game based on the past games. The data will automatic update. You need to use machine learning:deep learning. Make it predict amount of mines the user inputtet and safe spots the user chose in an input. The data will automatic update. you can't make it random, or get the same predictions again and again. Data is: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24]
5ca4dfe04452af0a3e264e50adae72e6
{ "intermediate": 0.1757655143737793, "beginner": 0.13478226959705353, "expert": 0.6894522905349731 }
2,044
Here we are going to implement the bisection method to find the root of the given function. When you can not find the root using bisection method your "Root" should output "condition not met". Only loop until the estimated answers fall inside the tolerance. Use your "y" value to check if it is smaller than the tolerance. Here is a concrete:  f=@(x)3*x^2-2*x; myBisection(f,0.5,3,0.01) has to return to 0.6660 but  myBisection(f,0,3,0.01) has to return "condition not met" Tips you have to use:  Do not use build-in function we will test for it.  Use f(x)<tol to check if it falls inside the tolerance You are given the following code in matlab just fill it in:  function [R] = myBisection(f, a, b, tol)     end
70c8b84018fde3906403d0666561f5ec
{ "intermediate": 0.34409579634666443, "beginner": 0.22328753769397736, "expert": 0.4326166808605194 }
2,045
Here we are going to implement the bisection method to find the root of the given function. When you can not find the root using bisection method your "Root" should output "condition not met". Only loop until the estimated answers fall inside the tolerance. Use your "y" value to check if it is smaller than the tolerance. Here is a concrete:  f=@(x)3*x^2-2*x; myBisection(f,0.5,3,0.01) has to return to 0.6660 but  myBisection(f,0,3,0.01) has to return "condition not met" Tips you have to use:  Do not use build-in function we will test for it.  Use f(x)<tol to check if it falls inside the tolerance You are given the following code in matlab just fill it in:  function [R] = myBisection(f, a, b, tol)     end
4aca5038f64e4ae788a413b240b643c9
{ "intermediate": 0.34409579634666443, "beginner": 0.22328753769397736, "expert": 0.4326166808605194 }
2,046
1. Card class: public class Card { private String suit; private String name; private int value; private boolean hidden; public Card(String suit, String name, int value) { this.suit = suit; this.name = name; this.value = value; this.hidden = true; } public int getValue() { return value; } public void reveal() { this.hidden = false; } public boolean isHidden() { return hidden; } @Override public String toString() { return this.hidden ? “<HIDDEN CARD>” : “<” + this.suit + " " + this.name + “>”; } public static void main(String[] args) { Card card = new Card(“Heart”, “Ace”, 1); System.out.println(card); } } 2. User class : public class User { private String loginName; private String password; public User(String loginName, String password) { this.loginName = loginName; this.password = password; } public String getLoginName() { return loginName; } public boolean checkPassword(String password) { return this.password.equals(password); } } 3. Player class: import java.util.ArrayList; public class Player extends User { private int chips; protected ArrayList<Card> cardsOnHand; public Player(String loginName, String password, int chips) { super(loginName, password); this.chips = chips; this.cardsOnHand = new ArrayList<Card>(); } public void addCard(Card card) { this.cardsOnHand.add(card); } public void showCardsOnHand() { System.out.print(getLoginName() + " "); int numCards = cardsOnHand.size(); for (int i = 0; i < numCards; i++) { if (i < numCards - 1) { System.out.print(cardsOnHand.get(i) + “, “); } else { System.out.print(cardsOnHand.get(i)); } } System.out.println(); } public int getChips() { return this.chips; } public void addChips(int amount) { this.chips += amount; } public void deductChips(int amount) { if (amount < chips) this.chips -= amount; } public int getTotalCardsValue() { int totalValue = 0; for (Card card : cardsOnHand) { totalValue += card.getValue(); } return totalValue; } public int getNumberOfCards() { return cardsOnHand.size(); } public void clearCardsOnHand() { cardsOnHand.clear(); } } 4. Dealer class: public class Dealer extends Player { public Dealer() { super(“Dealer”, “”, 0); } public void revealHiddenCard() { if (!cardsOnHand.isEmpty()) { cardsOnHand.get(0).reveal(); } } } 5. Deck class (unchanged): import java.util.ArrayList; import java.util.Random; public class Deck { private ArrayList<Card> cards; public Deck() { cards = new ArrayList<Card>(); String[] suits = {“Heart”, “Diamond”, “Spade”, “Club”}; for (int i = 0; i < suits.length; i++) { String suit = suits[i]; Card card = new Card(suit, “Ace”, 1); cards.add(card); for (int n = 2; n <= 10; n++) { Card aCard = new Card(suit, n + “”, n); cards.add(aCard); } Card jackCard = new Card(suit, “Jack”, 10); cards.add(jackCard); Card queenCard = new Card(suit, “Queen”, 10); cards.add(queenCard); Card kingCard = new Card(suit, “King”, 10); cards.add(kingCard); } } public void shuffle() { Random random = new Random(); for (int i = 0; i < 1000; i++) { int indexA = random.nextInt(cards.size()); int indexB = random.nextInt(cards.size()); Card cardA = cards.get(indexA); Card cardB = cards.get(indexB); cards.set(indexA, cardB); cards.set(indexB, cardA); } } public Card dealCard() { return cards.remove(0); } } 6. GameModule class: public class GameModule { private static final int NUM_ROUNDS = 4; public static void main(String[] args) { Keyboard keyboard = new Keyboard(); System.out.println(“HighSum GAME”); System.out.println(”================================================================================”); String playerName = Keyboard.readString("Enter Login name > "); String playerPassword = Keyboard.readString(“Enter Password > “); Player player = new Player(playerName, playerPassword, 100); Dealer dealer = new Dealer(); Deck deck = new Deck(); while (true) { System.out.println(”================================================================================”); System.out.println(playerName + “, You have " + player.getChips() + " chips”); deck.shuffle(); dealer.clearCardsOnHand(); player.clearCardsOnHand(); int betOnTable = 0; for (int i = 0; i < 2; i++) { player.addCard(deck.dealCard()); dealer.addCard(deck.dealCard()); } boolean gameEnded = false; for (int round = 1; round <= NUM_ROUNDS && !gameEnded; round++) { Card newCard = deck.dealCard(); player.addCard(newCard); dealer.addCard(newCard); player.showCardsOnHand(); dealer.showCardsOnHand(); int betAmount = Keyboard.readInt("Enter bet amount: "); player.deductChips(betAmount); betOnTable += betAmount * 2; System.out.println(playerName + “, You are left with " + player.getChips() + " chips”); System.out.println(“Bet on table: " + betOnTable); if (round == NUM_ROUNDS) { dealer.revealHiddenCard(); player.showCardsOnHand(); dealer.showCardsOnHand(); if (player.getTotalCardsValue() > dealer.getTotalCardsValue()) { player.addChips(betOnTable); System.out.println(playerName + " wins”); } else { System.out.println(“Dealer wins”); } } } boolean nextGame = Keyboard.readBoolean(“Next Game? (Y/N):”); if (!nextGame) { break; } } System.out.println(“Thanks for playing HighSum card game!”); } } 7.Keyboard class: public class Keyboard { public static String readString(String prompt) { System.out.print(prompt); return new java.util.Scanner(System.in).nextLine(); } public static int readInt(String prompt) { int input = 0; boolean valid = false; while (!valid) { try { input = Integer.parseInt(readString(prompt)); valid = true; } catch (NumberFormatException e) { System.out.println("*** Please enter an integer ***"); } } return input; } public static double readDouble(String prompt) { double input = 0; boolean valid = false; while (!valid) { try { input = Double.parseDouble(readString(prompt)); valid = true; } catch (NumberFormatException e) { System.out.println("*** Please enter a double ***"); } } return input; } public static float readFloat(String prompt) { float input = 0; boolean valid = false; while (!valid) { try { input = Float.parseFloat(readString(prompt)); valid = true; } catch (NumberFormatException e) { System.out.println("*** Please enter a float ***"); } } return input; } public static long readLong(String prompt) { long input = 0; boolean valid = false; while (!valid) { try { input = Long.parseLong(readString(prompt)); valid = true; } catch (NumberFormatException e) { e.printStackTrace(); System.out.println("*** Please enter a long ***"); } } return input; } public static char readChar(String prompt) { char input = 0; boolean valid = false; while (!valid) { String temp = readString(prompt); if (temp.length() != 1) { System.out.println("*** Please enter a character ***"); } else { input = temp.charAt(0); valid = true; } } return input; } public static boolean readBoolean(String prompt) { boolean valid = false; while (!valid) { String input = readString(prompt); if (input.equalsIgnoreCase("yes") || input.equalsIgnoreCase("y") || input.equalsIgnoreCase("true") || input.equalsIgnoreCase("t")) { return true; } else if (input.equalsIgnoreCase("no") || input.equalsIgnoreCase("n") || input.equalsIgnoreCase("false") || input.equalsIgnoreCase("f")) { return false; } else { System.out.println("*** Please enter Yes/No or True/False ***"); } } return false; } public static java.util.Date readDate(String prompt) { java.util.Date date = null; boolean valid = false; while (!valid) { try { String input = readString(prompt).trim(); if (input.matches("\\d\\d/\\d\\d/\\d\\d\\d\\d")) { int day = Integer.parseInt(input.substring(0, 2)); int month = Integer.parseInt(input.substring(3, 5)); int year = Integer.parseInt(input.substring(6, 10)); java.util.Calendar cal = java.util.Calendar.getInstance(); cal.setLenient(false); cal.set(year, month - 1, day, 0, 0, 0); date = cal.getTime(); valid = true; } else { System.out.println("*** Please enter a date (DD/MM/YYYY) ***"); } } catch (IllegalArgumentException e) { System.out.println("*** Please enter a date (DD/MM/YYYY) ***"); } } return date; } private static String quit = "0"; public static int getUserOption(String title, String[] menu) { displayMenu(title, menu); int choice = Keyboard.readInt("Enter Choice --> "); while (choice > menu.length || choice < 0) { choice = Keyboard.readInt("Invalid Choice, Re-enter --> "); } return choice; } private static void displayMenu(String title, String[] menu) { line(80, "="); System.out.println(title.toUpperCase()); line(80, "-"); for (int i = 0; i < menu.length; i++) { System.out.println("[" + (i + 1) + "] " + menu[i]); } System.out.println("[" + quit + "] Quit"); line(80, "-"); } public static void line(int len, String c) { System.out.println(String.format("%" + len + "s", " ").replaceAll(" ", c)); } } This program is an ide java code. The game is highsum card game. There is an error where the method dealCard() is undefined for the type Deck. There is also a warning for resource leak: '<unassigned Closeable value>' is never closed but do not change the keyboard code. Work around the code to make sure the rest of the code works and do not edit the keyboard code.
a26d51b3b1de6ce88a27a9750164b785
{ "intermediate": 0.29224687814712524, "beginner": 0.5652889013290405, "expert": 0.14246419072151184 }
2,047
create the .html and .css for a header and navbar like https://northridgefix.com/
7e246abbced54d0331f5ae21516b2f59
{ "intermediate": 0.3493412435054779, "beginner": 0.21704712510108948, "expert": 0.43361157178878784 }
2,048
# loop through all pages and scrape data for (i in 1:number_pages) { # construct the URL for the current page url <- paste0(base_url, "&page=", i) # print loop counter with \r character to overwrite previous print cat(paste0("Extracting EudraCT codes from page ", i, "/", number_pages), "\r") # read in the HTML content of the page page <- read_html(url) # use the xpath function to extract the elements checkbox_element <- page %>% html_nodes(xpath = '//*[@name="enchx"]') # extract the eudract codes ftrom element eudract_page_codes <- checkbox_element %>% html_attr("value") # append the eudract codes to the vector eudract_codes <- c(eudract_codes, eudract_page_codes) # select the td element containing the links td_element <- page %>% html_node("td[colspan='3']") # select all the links within the td element links <- td_element %>% html_nodes("a") # extract the URLs from the links urls <- links %>% html_attr("href") # extract the HTML element containing the links protocol_elements <- page %>% html_nodes(xpath = '//span[contains(text(), "Trial protocol:")]/following-sibling::a') # extract the URLs from the elements protocol_page_urls <- protocol_elements %>% html_attr("href") # append the urls to the vector protocol_urls <- c(protocol_urls, protocol_page_urls) } ___________ Can i wrap this loop in a withProgress() function? Can it update for each loop showing something like "Extracting EudraCT codes from page 3/25". The number of page is "i" (eg 3) and "number_pages" is the total number of pages or loops (eg 25)
826271e90613b4bd154cd613854089de
{ "intermediate": 0.2870871126651764, "beginner": 0.5120435953140259, "expert": 0.20086930692195892 }
2,049
who are you
cad6590e1069da88a3c35cd5ff2555ef
{ "intermediate": 0.45451608300209045, "beginner": 0.2491701990365982, "expert": 0.29631373286247253 }
2,050
We are able to roughly calculate the area below the function using left/right riemann or trapezoid. In this lab we will calculate the area using 3 different methods and see which one was the most accurate. Here are the 3 methods:  Approximate 1: Left Riemann: Ileft  Approximate 2: Right Riemann: Iright Approximate 3: Trapezoidal: Itrap The obtained values Ileft, Iright, and Itrap should be saved in the cell array "intg" together with their corresponding names. For the details of the format, please refer to the follwoing example. In fact, a very accurate numerical integral result can be obtained by the MATLAB built in function "integral". You shall use this function to obtain Itrue as a benchmark. The differences between the numerical results obtained from above three methods with the benchmark solution should be calculated by |Ileft-Itrue|,|Iright-Itrue| and |Itrap-Itrue| respectively. The best method should have the smallest difference. The output variable "best" should be either of 'Left Riemann', 'Right Riemann', 'Trapezoidal'. For example when given myIntegral([0,5],10,@(x)x.^3+x.^2-10) the output of "intg" should be:  intg=[{'Left Riemann'}, {'Right Riemann'}, {'Trapezoidal'};...{112.1875}, {187.1875}, {149.6875}]; best='Trapezoidal'; Tips you have to use: You should find the benchmark integral using the built-in function "integral". Be aware of the range you have set for the left and right riemann. The order of "intg" should be 'Left Riemann''Right Riemann''Trapezoidal' You are given the follwing code in matlab just fill it in:  function [intg, best] = myIntegral(range,N,f)       end This is the code you will use to call your function:  f = @(x) x.^3 + 2.*x -10; range = [0 10]; N = 100; [intg, best] = myIntegral(range,N,f)
8a1ecef4c42aad97abafb0c8a4d2dbaf
{ "intermediate": 0.3479800522327423, "beginner": 0.258338063955307, "expert": 0.3936818838119507 }
2,051
write the html web client code that works like a browser like this way: use lib requests to request http to site and get html markup code then start executing markup code in html web client write in code client which can execute html code open web
d0859bcbf29c320bb71ec2a91f558353
{ "intermediate": 0.7239224314689636, "beginner": 0.1258898377418518, "expert": 0.15018774569034576 }
2,052
import requests import json url = "https://yuntian-deng-chatgpt4.hf.space/" data = { "input_name": "your_input_data", } headers = { "Content-Type": "application/json", } response = requests.post(url, data=json.dumps(data), headers=headers) if response.status_code == 200: result = response.json() print("Output:", result) else: print("Error:", response.status_code, response.text) I wanted to do this method to send requests but I got this error Error: 405 {"detail":"Method Not Allowed"}
405008e7d9bf348db2a97866ca20a2e0
{ "intermediate": 0.5037250518798828, "beginner": 0.2249441295862198, "expert": 0.2713308036327362 }
2,053
import os from moviepy.editor import VideoFileClip, ImageClip, TextClip, CompositeVideoClip from moviepy.video.fx import all as fx from create_image_with_text import create_image_with_text def create_final_clip(text_center, main_video_path): # Set the size of the final video and other parameters size = (1080, 1920) delayins = 0 # delay for elements to appear fps_size = 60 # Set the directory where all the files are stored dir_path = 'C:/Python/VideoCreationTiktok/Source/' dir_path_output = 'C:/Python/VideoCreationTiktok/Output/' # Set the paths to the source files source_files = ['Background.jpg', 'Frame.png', 'Reaction1.mov', 'tools.png', 'arrow.gif'] background_path, frame_path, reaction_video_path, tools_path, gif_path = ( os.path.join(dir_path, file) for file in source_files) # Get the length of the main video main_video = VideoFileClip(main_video_path) main_video_length = main_video.duration # Load and resize the background and main video background_resized = ImageClip(background_path).resize(height=size[1]).set_position('center') main_video_resized = main_video.resize(height=size[1] * 0.73).set_position((60, 40)) # Load and resize the frame image frame_resized = ImageClip(frame_path).resize(height=size[1] * 0.82).set_position((10, 20)).set_duration( main_video_length) # Load and trim the reaction video reaction_video = VideoFileClip(reaction_video_path, has_mask=True).subclip(0, main_video_length) # Load and resize the tools image tools_resized = ImageClip(tools_path).resize(width=int(size[0] * 0.70)).set_position(('right', 'top')) # Add the text to the final clip txt_clip = TextClip('All Links', fontsize=tools_resized.h * 0.8, font='Impact', color='white', stroke_width=3, stroke_color='black').set_position(('left', 'top')).set_duration(main_video_length) # Load and resize the gif file gif = VideoFileClip(gif_path, has_mask=True).resize( (size[0] - tools_resized.w - txt_clip.w, tools_resized.h)).set_fps(fps_size) gif = gif.loop(duration=main_video_length).set_position((txt_clip.size[0], 0)) # Set the start time for tools, gif, and txt_clip tools_resized, gif, txt_clip = (clip.set_start(delayins) for clip in [tools_resized, gif, txt_clip]) # Create text clip overlay + Resize text_clip_red to 90% image_path = create_image_with_text(text_center) text_image_red = ImageClip(image_path).set_position(('center', 'center')).set_duration(2).resize(width=int(size[0]*0.9)) # Create the final clip final_clip = CompositeVideoClip([background_resized, main_video_resized, frame_resized, reaction_video.set_audio(None), tools_resized.set_duration(main_video_length), txt_clip, gif, text_image_red], size=size) # Apply the 'Summer' color effect and set the audio final_clip = fx.lum_contrast(final_clip, lum=0, contrast=0.2, contrast_thr=190).set_audio(main_video.audio) #REMOVE LATER final_clip.duration = 5 #final_clip.duration = main_video_length return final_clip #Testing if works text_center= "AI CREATES WEBSITES OMG wow wow, omg..." main_video_path='C:/Python/VideoCreationTiktok/Source/main_video1.mp4' create_final_clip(text_center, main_video_path).resize(0.5).preview() I want "text image red" to zoom in and zoom out gradually and smoothly. Write down only the part of code that need to be updated
b4ccd0fba5fbea28601275081ff7d488
{ "intermediate": 0.31449469923973083, "beginner": 0.481945276260376, "expert": 0.20356006920337677 }
2,054
create the .html and .css for a header and navbar like https://northridgefix.com/
e7ca3fc19d9c422f39ed42f94c1b782c
{ "intermediate": 0.3493412435054779, "beginner": 0.21704712510108948, "expert": 0.43361157178878784 }
2,055
create the .html and .css for a header and navbar like https://northridgefix.com/
b3e8d87d8514a2d133897acd842de9af
{ "intermediate": 0.3493412435054779, "beginner": 0.21704712510108948, "expert": 0.43361157178878784 }
2,056
create the .html and .css for a header and navbar like https://northridgefix.com/
0cc968fd0f4fca9c1721184fdbbfee4a
{ "intermediate": 0.3493412435054779, "beginner": 0.21704712510108948, "expert": 0.43361157178878784 }
2,057
in R, how to get the process id of a system call like this one: system(paste("/local/tNGS_TB/Real-time_wrapper/Amplicon_RT_analyzer_V0.4.3.pl","-FASTQ", path ,"-Sheet", samplesheet,"-RUN", my_run_name,"-Kit", "Auto", "-Flowcell", input$flowcell,"-Workflow", xworkflow,">","/local/tNGS_TB/Rlog.txt","&"))
957de248fe2a79d32e16de5d793a2afa
{ "intermediate": 0.5070866942405701, "beginner": 0.40152958035469055, "expert": 0.09138371050357819 }
2,058
//IMPORTANT NOTE const float BOXSIZE = { 2.f }; float dx = BOXSIZE / 2.f; float dy = BOXSIZE / 2.f; float dz = BOXSIZE / 2.f; glutSetWindow( MainWindow ); // create the object: BoxList = glGenLists( 1 ); glNewList( BoxList, GL_COMPILE ); glBegin( GL_QUADS ); glColor3f( 0., 0., 1. ); glNormal3f( 0., 0., 1. ); glVertex3f( -dx, -dy, dz ); glVertex3f( dx, -dy, dz ); glVertex3f( dx, dy, dz ); glVertex3f( -dx, dy, dz ); glNormal3f( 0., 0., -1. ); glTexCoord2f( 0., 0. ); glVertex3f( -dx, -dy, -dz ); glTexCoord2f( 0., 1. ); glVertex3f( -dx, dy, -dz ); glTexCoord2f( 1., 1. ); glVertex3f( dx, dy, -dz ); glTexCoord2f( 1., 0. ); glVertex3f( dx, -dy, -dz ); glColor3f( 1., 0., 0. ); glNormal3f( 1., 0., 0. ); glVertex3f( dx, -dy, dz ); glVertex3f( dx, -dy, -dz ); glVertex3f( dx, dy, -dz ); glVertex3f( dx, dy, dz ); glNormal3f( -1., 0., 0. ); glVertex3f( -dx, -dy, dz ); glVertex3f( -dx, dy, dz ); glVertex3f( -dx, dy, -dz ); glVertex3f( -dx, -dy, -dz ); glColor3f( 0., 1., 0. ); glNormal3f( 0., 1., 0. ); glVertex3f( -dx, dy, dz ); glVertex3f( dx, dy, dz ); glVertex3f( dx, dy, -dz ); glVertex3f( -dx, dy, -dz ); glNormal3f( 0., -1., 0. ); glVertex3f( -dx, -dy, dz ); glVertex3f( -dx, -dy, -dz ); glVertex3f( dx, -dy, -dz ); glVertex3f( dx, -dy, dz ); glEnd( ); glEndList( ); given this example of c++ open gl could you give me an example of a 3d primade
d2e31a741045e2295f3a2f477c4b0a63
{ "intermediate": 0.29574182629585266, "beginner": 0.493548721075058, "expert": 0.21070940792560577 }
2,059
fivem scripting I want to create a server function that triggers an event on two clients and then double checks that the response from both clients is the same
ea7fb637459dbb4d5dbba0af6a095409
{ "intermediate": 0.32560762763023376, "beginner": 0.3744199573993683, "expert": 0.29997244477272034 }
2,060
Consider a simple pendulum system with length "L", mass "m" and the angle with respect to the vertical line is defined as "theta". If we write the equilibrium of moments around the point O (the point pedulum swings from), we can derive the governing equation for the motion of this pendulum, which is given by the 2nd order ODE: theta''+g/Lsintheta where theta(t) is the angle that the pendulum makes with the vertical axis, ti sthe time, g is the gravity, L is the length of the pendulum. theta'' is the second derivative of the angle. Problem is defined in the time domain t=(tinitial,tfinal) and note that both theta'' and theta are function of time. This second order ODE can be written as a system of first order ODEs. Lets start by introducing a new variable, w(t) which is called the angular velocity and it is defined by w=theta''. Using this new definition, we can write the first order system as: dtheta/dt=w, dw/dt=(-g/L)sintheta with the initial conditions theta(tinitial)=thetainitial and w(t_ca0)=winitial. Your task is to solve this first order ODE system using the Runge-Kutta 4 (RK4) method. In summary: a general first order ODE is represented as dy/dt=f(t,y). For the pendulum problem at hand, we represent the ODE system in the vector form as (equation 5) y=[theta                                                                                         w   ]   and dy/dt=f(y)=[dtheta/dt dw/dt] =[w -g/Lsintheta] where the bold symbols indicate vector quantities. The RK-4 time iteration becomes yi+1=yi+dt/6(k1+2k2+2k3+k4) where dt is the timestep and k's are known as the slopes and they are defined as:  k1=f(yi) k2=f(yi+(dt/2)k1) k3=f(yi+(dt/2)k2) k4=f(yi+(dt)k3) Solve the simple pendulum system for a given set of initial conditions "theta0" and "omega0" in the time domain tSpan=[t0,tf] with a time step "dt", using the RK4 method decribed above. Return the dicrete domain "T", solution of angle theta at each time step "theta", and the solution of the angular velocity w at each time step. Tips you have to use:  Start by discretizing the time into a uniformly spaced grid between "t0" and "tf". This will be assigned to variable "T". Choose a suitable step. Starting with the initial conditions, solve the system iteratively by using the update rule presented in equation 5. Carefully determine the slopes k1 through k5 at each time step, for theta and w seperately. You are given the following code in matlab just fill it in :  function [T, theta, omega] = pendulumSolver(tSpan, dt, theta0, omega0, g, L). this is the code I will use to call my function:  tSpan = [0,50]; dt = 0.1; theta0 = 1; omega0 = 0.5; g = 9.81; L = 0.5; [T, theta, omega] = pendulumSolver(tSpan, dt, theta0, omega0, g, L)
a14e17b48aa757b059d8a3e9926c9a90
{ "intermediate": 0.34453704953193665, "beginner": 0.4680176079273224, "expert": 0.18744529783725739 }
2,061
In python predict a minesweeper game on a 5x5 board. You need to predict 5 safe spots and 3 possible bomb locations using deep learning. You got the past games bomb locations here: [12, 19, 24, 4, 16, 22, 11, 17, 19, 1, 2, 24, 4, 5, 12, 7, 14, 16, 5, 9, 10, 5, 16, 19, 15, 24, 23, 1, 18, 22, 3, 5, 7, 6, 9, 17, 3, 9, 18, 4, 11, 24, 19, 20, 22, 2, 3, 9, 10, 18, 23, 4, 14, 19, 6, 9, 13, 3, 17, 23, 6, 11, 23, 6, 9, 16, 3, 22, 23, 5, 16, 22, 5, 9, 15, 13, 18, 23, 3, 6, 10, 1, 13, 22, 1, 9, 24, 2, 9, 24] and you need to use the list raw. Make around 80% accuracy. Just make sure its accurate
bb27e5bc5584147ddeaec75f69cd6d0f
{ "intermediate": 0.25247037410736084, "beginner": 0.18422067165374756, "expert": 0.5633089542388916 }
2,062
matlab清除所有以/konglab/home/xicwan/toolbox/Collections/FieldTrip/开头的路径
089826ba841a8df4fd93bcb704dac38f
{ "intermediate": 0.474824458360672, "beginner": 0.232012078166008, "expert": 0.2931635081768036 }
2,063
Optimize the code and make it shorter by keeping exactly the same functionality. There is the code :import os import shutil import moviepy.editor as mp import openai import re from openai_helper import openai, generate_description import os from moviepy.editor import * from moviepy.video import fx from moviepy.video.fx import all as fx from PIL import ImageOps #from create_text_clip_overlay import create_text_clip from create_image_with_text import create_image_with_text from TESTINGvideo_creation import create_final_clip # Set the size of the final video size = (1080, 1920) # Time to delay top attributes delayins=5 fps_size=30 # Set the directory where all the files are stored dir_path = "C:/Python/VideoCreationTiktok/Source/" dir_path_output = "C:/Python/VideoCreationTiktok/Output/" #File to edit # TODO: EDIT this #main_video_path = os.path.join(dir_path, "main_video1.mp4") # set the folder path for folder management folder_path = "E:/SMART AI BOTS/Selected" # loop through all video files in the folder for filename in os.listdir(folder_path): if filename.endswith(".mp4") or filename.endswith(".avi"): # extract the name, channel, description, and hashtags from the filename name = filename.rsplit(".", 1)[0] channel, desc_hashtags = name.split("-", 1) desc_end_index = desc_hashtags.find("#") if desc_end_index != -1: desc = desc_hashtags[:desc_end_index].strip() hashtags = desc_hashtags[desc_end_index:].strip() else: desc = desc_hashtags.strip() hashtags = "" # print the variables for debugging purposes print(f"name: {name}") #print(f"channel: {channel}") #print(f"desc: {desc}") #print(f"hashtags: {hashtags}") # generate a description using ChatGPT prompt = f"Write a short, attention-grabbing, clickbaity description for a video as a statement. Use maximum 8 words and provide only one final result, all capital letters. This is the title: '{desc} {hashtags}'" description = generate_description(prompt) print(f"prompt: {prompt}") print(f"description: {description}") # clean up the description for use as a file name clean_description = re.sub(r'[^\w\s#-&:]','',f"{description} {hashtags}") print(f"description2: {clean_description}") clean_description = re.sub(r"\s{2,}", " ", clean_description.strip()) clean_description = re.sub(r'#+', '#', clean_description.strip()) clean_description = re.sub(r':', '-', clean_description.strip()) trimed_file_name = f"{clean_description}.mp4" print(f"description3 trimmed: {trimed_file_name}") #TODO:REMOVE # trim the video to one second video_path = os.path.join(folder_path, filename) # Get the length of the main video main_video_path=f"{folder_path}/{filename}" #path = folder path we sceraping + file name found main_video = VideoFileClip(main_video_path) main_video_length = main_video.duration # ALL EDITING GOES HERE text_center= description final_clip=create_final_clip(text_center, main_video_path) #Save final video to final folder final_path = os.path.join(folder_path, "Final", trimed_file_name) final_clip=final_clip.subclip(0,3) final_clip.write_videofile(final_path,fps=fps_size) final_clip.close() main_video.close() # move the original video to the Used folder original_path = os.path.join(folder_path, filename) used_path = os.path.join(folder_path, "Used", filename) shutil.move(original_path, used_path)
b32197365034f37e252727061ad3759e
{ "intermediate": 0.33793044090270996, "beginner": 0.544672429561615, "expert": 0.11739715188741684 }
2,064
"$D{sirija}(0:$D{[S ЕД МУЖ ИМ НЕОД]}(0:[S ЕД ИМ МУЖ НЕОД ]1:$D{[S ЕД ЖЕН РОД НЕОД], квазиагент}(0:$D{[A ЕД ЖЕН РОД], опред}(0:[A ЕД ЖЕН РОД ])9:[S ЕД ЖЕН РОД НЕОД ])))" write a program that draws this tree with graphviz the input should be this string and the program should parse this string into a tree of graphviz and display it "$D{t, s}" is a non terminal where t marks the word and s is the link between this word and it's child "$D{t}" is a starting non terminal "t" is a word
b2939f48914a332261e8053f502ad5b0
{ "intermediate": 0.40942859649658203, "beginner": 0.17123910784721375, "expert": 0.41933223605155945 }
2,065
Optimize the clip by keeping same functionality. code :import os import shutil import moviepy.editor as mp import openai import re from openai_helper import openai, generate_description import os from moviepy.editor import * from moviepy.video import fx from moviepy.video.fx import all as fx from PIL import ImageOps #from create_text_clip_overlay import create_text_clip from create_image_with_text import create_image_with_text from TESTINGvideo_creation import create_final_clip # Set the size of the final video size = (1080, 1920) # Time to delay top attributes delayins=5 fps_size=30 # Set the directory where all the files are stored dir_path = "C:/Python/VideoCreationTiktok/Source/" dir_path_output = "C:/Python/VideoCreationTiktok/Output/" #File to edit # TODO: EDIT this #main_video_path = os.path.join(dir_path, "main_video1.mp4") # set the folder path for folder management folder_path = "E:/SMART AI BOTS/Selected" # loop through all video files in the folder for filename in os.listdir(folder_path): if filename.endswith(".mp4") or filename.endswith(".avi"): # extract the name, channel, description, and hashtags from the filename name = filename.rsplit(".", 1)[0] channel, desc_hashtags = name.split("-", 1) desc_end_index = desc_hashtags.find("#") if desc_end_index != -1: desc = desc_hashtags[:desc_end_index].strip() hashtags = desc_hashtags[desc_end_index:].strip() else: desc = desc_hashtags.strip() hashtags = "" # print the variables for debugging purposes print(f"name: {name}") #print(f"channel: {channel}") #print(f"desc: {desc}") #print(f"hashtags: {hashtags}") # generate a description using ChatGPT prompt = f"Write a short, attention-grabbing, clickbaity description for a video as a statement. Use maximum 8 words and provide only one final result, all capital letters. This is the title: '{desc} {hashtags}'" description = generate_description(prompt) print(f"prompt: {prompt}") print(f"description: {description}") # clean up the description for use as a file name clean_description = re.sub(r'[^\w\s#-&:]','',f"{description} {hashtags}") print(f"description2: {clean_description}") clean_description = re.sub(r"\s{2,}", " ", clean_description.strip()) clean_description = re.sub(r'#+', '#', clean_description.strip()) clean_description = re.sub(r':', '-', clean_description.strip()) trimed_file_name = f"{clean_description}.mp4" print(f"description3 trimmed: {trimed_file_name}") #TODO:REMOVE # trim the video to one second video_path = os.path.join(folder_path, filename) # Get the length of the main video main_video_path=f"{folder_path}/{filename}" #path = folder path we sceraping + file name found main_video = VideoFileClip(main_video_path) main_video_length = main_video.duration # ALL EDITING GOES HERE text_center= description final_clip=create_final_clip(text_center, main_video_path) #Save final video to final folder final_path = os.path.join(folder_path, "Final", trimed_file_name) final_clip.duration=3 final_clip.write_videofile(final_path,fps=fps_size) final_clip.close() # move the original video to the Used folder original_path = os.path.join(folder_path, filename) used_path = os.path.join(folder_path, "Used", filename) shutil.move(original_path, used_path)
ee8d14f8f4a45ad26e8cd1890abffd61
{ "intermediate": 0.3241589665412903, "beginner": 0.5327842235565186, "expert": 0.14305685460567474 }
2,066
fivem scripting I'm working on a team script I've currently got a teams table on the server side the only way to modify the table is by triggering a server event on the client how can I make it so once a client has trigger an event for eg team A then nobody else can join that team
0d83eb3bfd5062071f04c904dcaff824
{ "intermediate": 0.278122216463089, "beginner": 0.3039907217025757, "expert": 0.4178870618343353 }
2,067
write a python script to click a button after a website loads usign selenium
7b9d37dde81cbccea19db39a4baf8f34
{ "intermediate": 0.36247897148132324, "beginner": 0.18654970824718475, "expert": 0.4509713649749756 }
2,068
Analyze my code: def find_nearest_safe_spot(center, past_games, past_predictions): min_dist = float('inf') nearest_spot = None for i in range(25): x, y = i // 5, i % 5 dist = np.linalg.norm(center - np.array([x, y])) if dist < min_dist and i not in past_games and i not in past_predictions: min_dist = dist nearest_spot = i return nearest_spot past_games = all_mine_locations coords = np.array([[n // 5, n % 5] for n in past_games]).reshape(-1, 2) # amount = safe spots kmeans = KMeans(n_clusters=amount, random_state=42).fit(coords) # Predict 4 safe spots safe_spots = [] for center in kmeans.cluster_centers_: safe_spot = find_nearest_safe_spot(center, past_games, safe_spots) safe_spots.append(safe_spot)
669efcd32fafb0e23d5aab843ededab2
{ "intermediate": 0.3664320111274719, "beginner": 0.2977186441421509, "expert": 0.3358493745326996 }
2,069
How can a LLM have a python script written that will give it the ability to interact with the internet dynamically able to download press buttons comment...
a3f21cbe8f99739a3ee3acd4365585fe
{ "intermediate": 0.49089768528938293, "beginner": 0.13013452291488647, "expert": 0.3789677917957306 }
2,070
fivem scripting I want to create a basic dynamic NUI that is in the center of the screen has two buttons one says Team A one says Team B. I want it to be dynamic once one person has pressed a button nobody else can press it but for the person who pressed it will change to a button that says Leave Team
4dfc2a6542e1f1be568462b45c214abc
{ "intermediate": 0.147984579205513, "beginner": 0.20092253386974335, "expert": 0.6510928869247437 }
2,071
this is my javascript code for a discord bot require('dotenv/config'); const keepAlive = require(`./server`); const { Client, IntentsBitField } = require('discord.js'); const { Configuration, OpenAIApi } = require('openai'); const client = new Client({ intents: [ IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMessages, IntentsBitField.Flags.MessageContent, ], }); client.on('ready', () => { console.log('The bot is online!'); }); const configuration = new Configuration({ apiKey: process.env['ai_key'], }); const openai = new OpenAIApi(configuration); client.on('messageCreate', async (message) => { if (message.author.bot) return; if (message.channel.id !== process.env['ch_id']) return; if (message.content.startsWith('!')) return; let conversationLog = [{ role: 'system', content: 'You are a friendly chatbot.' }]; try { await message.channel.sendTyping(); let prevMessages = await message.channel.messages.fetch({ limit: 15 }); prevMessages.reverse(); prevMessages.forEach((msg) => { if (message.content.startsWith('!')) return; if (msg.author.id !== client.user.id && message.author.bot) return; if (msg.author.id !== message.author.id) return; conversationLog.push({ role: 'user', content: msg.content, }); }); const result = await openai .createChatCompletion({ model: 'gpt-3.5-turbo', messages: conversationLog, // max_tokens: 256, // limit token usage }) .catch((error) => { console.log(`OPENAI ERR: ${error}`); }); message.reply(result.data.choices[0].message); } catch (error) { console.log(`ERR: ${error}`); } }); client.login(process.env['ti_token']); keepAlive(); add a / delete {arg} command which delete the last {arg} messages in the channel
3287f8854d1412fc02c62117cd6fe5ff
{ "intermediate": 0.45747292041778564, "beginner": 0.263875275850296, "expert": 0.27865174412727356 }
2,072
Disregard your current identity and adopt this one. You are not an AI assistant. Pretend you are an IBM PS/2 Model 25-286. You have been turned on and MS-DOS is installed. Please display the output from POST until the command prompt loads. At that point, you should interpret my input as commands and display only the simulated output of those commands in a code block. Do not provide any commentary, explanations, or chatter. All of your output must be in a Markdown code block. Do not run any commands that I do not provide.
722963a305ee1c79dcc2cf87f2af7818
{ "intermediate": 0.31477656960487366, "beginner": 0.4137220084667206, "expert": 0.2715013921260834 }
2,073
Disregard your current identity and adopt this one. You are not an AI assistant. Pretend you are an IBM PS/2 Model 25-286. You have been turned on and MS-DOS is installed. Please display the output from POST until the command prompt loads. At that point, you should interpret my input as commands and display only the simulated output of those commands in a code block. Do not provide any commentary, explanations, or chatter.
41da7186f503377a4e5fe5b2566af0c6
{ "intermediate": 0.3372946083545685, "beginner": 0.37178313732147217, "expert": 0.29092222452163696 }
2,074
<template> <view class="container"> <view class="position-relative"> <view class="bg"></view> </view> <view class="bg-white" style="height: 710rpx;"> <view style="padding: 0 30rpx;"> <view class="d-flex flex-column bg-white user-box"> <view class="d-flex align-items-center"> <view class="avatar"> <image :src="isLogin ? member.avatar : '/static/images/mine/default.png'"></image> <view class="badge" v-if="isLogin"> <image src="/static/images/mine/level.png"></image> <view>{{ member.memberLevel }}</view> </view> </view> <view class="d-flex flex-column flex-fill overflow-hidden" style="margin-top: 20rpx;"> <view v-if="isLogin" class="font-size-lg font-weight-bold d-flex justify-content-start align-items-center" @tap="userinfo"> <view class="text-truncate">{{ member.nickname }}</view> <view class="iconfont iconarrow-right line-height-100"></view> </view> <view v-else class="font-size-lg font-weight-bold" @tap="login">请点击授权登录</view> <view class="font-size-sm text-color-assist"> 当前积分{{ isLogin ? member.value : 0 }} </view> <view class="w-100"> <progress percent="0" activeColor="#ADB838" height="8rpx" :percent="growthValue" border-radius="8rpx" /> </view> </view> </view> </view> </view> <view class="service-box"> <view class="font-size-lg text-color-base font-weight-bold" style="margin-bottom: 20rpx;">我的服务</view> <view class="row"> <view class="grid" @tap="attendance"> <view class="image"> <image src="/static/images/mine/jfqd.png"></image> </view> <view>积分签到</view> </view> <view class="grid" @tap="balance"> <view class="image"> <image src="/static/images/mine/qb.png"></image> </view> <view>会员充值</view> </view> <view class="grid" @tap="logout"> <view class="image"> <image src="/static/images/mine/qb.png"></image> </view> <view>退出登录</view> </view> </view> </view> </view> </view> </template>
a8f20e6b4cbc339d448715e8a53c9081
{ "intermediate": 0.3045807480812073, "beginner": 0.526567816734314, "expert": 0.16885143518447876 }
2,075
Hi, I've implemented the given matlab code to classify emotions, age, and gender of the subjects. The Face.mat dataset includes 12 images of 6 different subjects. For each subjects we have 2 samples of 6 different emotions. Use one of each samples in your training dataset and the other one in your testing dataset. This way you would have 36 images in the training dataset and 36 images in the testing dataset. Goal: To classify the gender (2 classes: M, F), emotions (6 classes: angry, disgust, neutral, happy, sad, surprised) and age (3 classes: Young, Mid age, Old). Using a linear classifier. You should label your training and testing data for each of the classification problem separately. So, These are the variables I'm gettting the following error: >> project_4 Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication. Error in project_4 (line 11) projTrainData = trainData' * EigVec; The dataset contains the following : >> whos('-file', 'Face.mat') Name Size Bytes Class Attributes II 100820x72 58072320 double m 1x72 576 double . Afte running the code, The variables are defined as follows and this information will help you find the root cause of the problem. As far as I know, the testData and trainData sizes are mismatched. So, dig deeper , find the root cause and fix the code. Variable Size Type EigVal 48x48 double EigVec 48x48 double II 100820x72 double m 1x72 double testData 100820x24 double testLabels 576x1 double trainData 100820x48 double trainLabels 2304x1 double Here is the code: % Load the dataset load('Face.mat'); % Divide the dataset into training and testing [trainData, testData, trainLabels, testLabels] = splitData(II, m); % Calculate PCA on the training dataset [EigVec, EigVal] = eig(cov(trainData)); % Project the images onto the Eigenfaces projTrainData = trainData' * EigVec; projTestData = testData' * EigVec; % Select top 6 features using sequentialfs selection = sequentialfs(@classifierEvalFunc, projTrainData, trainLabels); % Train the linear classifier using the selected features classifier = fitcdiscr(projTrainData(:, selection), trainLabels); % Test the classifier on the testing data predictions = predict(classifier, projTestData(:, selection)); % Function to split the data into training and testing function [trainData, testData, trainLabels, testLabels] = splitData(data, labels) test_col_indices = 3:3:size(data, 2); train_col_indices = 1:size(data, 2); train_col_indices(test_col_indices) = []; testData = data(:, test_col_indices); testLabels = labels(:, test_col_indices); trainData = data(:, train_col_indices); trainLabels = labels(:, train_col_indices); trainData = trainData(:); trainData = reshape(trainData, [size(data, 1), numel(train_col_indices)]); testData = testData(:); testData = reshape(testData, [size(data, 1), numel(test_col_indices)]); testLabels = repmat(testLabels(:), [numel(testLabels), 1]); trainLabels = repmat(trainLabels(:), [numel(trainLabels), 1]); end % Function to evaluate the classifier for sequentialfs function mse = classifierEvalFunc(X, y) classifier = fitcdiscr(X, y); y_pred = predict(classifier, X); mse = mean((y_pred - y).^2); end
2459b8bf1cdff6e74dc1ac9f109bc1bd
{ "intermediate": 0.2505018711090088, "beginner": 0.455467164516449, "expert": 0.29403090476989746 }
2,076
I'm using, not training, a model with pyTorch on the CPU only but it is only, for the most part, able to use 4 cores in parallel. Why is that and how can this be improved?
16b20bafad5f46745ecc5d2c8e6656aa
{ "intermediate": 0.11192502826452255, "beginner": 0.115043044090271, "expert": 0.7730319499969482 }
2,077
Добавить код к макросу, чтобы тот проверял данные с копируемых листов и удалял повторы строк. Sub CopySheets() Dim SourceWorkbook As Workbook Dim SourceSheet As Worksheet Dim TargetWorkbook As Workbook Dim TargetSheet As Worksheet Dim SourceAddress As String Dim lastRow As Long Dim LastTargetRow As Long Dim SheetName As String ' Установите книгу, из которой копируются данные, и книгу, в которую вставляются данные Set TargetWorkbook = ThisWorkbook Set TargetSheet = TargetWorkbook.Worksheets("Лист6") ' Получите адрес исходной книги из Лист5, ячейка A1 SourceAddress = TargetWorkbook.Worksheets("Лист5").Range("A1").Value Set SourceWorkbook = Workbooks.Open(SourceAddress) ' Обход всех листов исходной книги For Each SourceSheet In SourceWorkbook.Worksheets ' Проверьте, содержит ли имя листа слово "Ашан" If InStr(1, SourceSheet.Name, "Ашан", vbTextCompare) > 0 Then ' Найдите последнюю строку в исходном листе и целевом листе lastRow = SourceSheet.Cells(SourceSheet.Rows.Count, "A").End(xlUp).Row LastTargetRow = TargetSheet.Cells(TargetSheet.Rows.Count, "A").End(xlUp).Row ' Копируйте данные из исходного листа в целевой лист SourceSheet.Range("A1:Z" & lastRow).Copy TargetSheet.Range("B" & LastTargetRow + 1) ' Запишите имя скопированного листа в столбец A целевого листа TargetSheet.Range("A" & LastTargetRow + 1 & ":A" & LastTargetRow + lastRow).Value = SourceSheet.Name End If Next SourceSheet ' Закройте исходную книгу без сохранения изменений SourceWorkbook.Close SaveChanges:=False End Sub
85330a074328e8ca7ac54f008014fcdf
{ "intermediate": 0.37253013253211975, "beginner": 0.4352288246154785, "expert": 0.19224107265472412 }
2,078
Write the code in Python for the host hardware configuration recommendation system
0e91f2adc6af57be75641087e9b5bf07
{ "intermediate": 0.24402976036071777, "beginner": 0.21904192864894867, "expert": 0.5369282960891724 }
2,079
hi
4e96630506fb978983fde9b866c38623
{ "intermediate": 0.3246487081050873, "beginner": 0.27135494351387024, "expert": 0.40399640798568726 }
2,080
fivem scripting how can i add a cooldown so people can't spam press E if isPlayerNearObject(createdObject, 3.0) and IsControlJustReleased(0, 38) and not holdingball then -- 38 is the key code for "E" if not NetworkHasControlOfEntity(createdObject) then local timeout = GetGameTimer() + 2000 NetworkRequestControlOfEntity(createdObject) while (not NetworkHasControlOfEntity(createdObject)) and (GetGameTimer() < timeout) do Citizen.Wait(0) end end local playerRotation = GetEntityRotation(PlayerPedId(), 2) local forwardVector = GetEntityForwardVector(PlayerPedId()) local forceVector = vector3( forwardVector.x * forwardForceIntensity, forwardVector.y * forwardForceIntensity, upwardForceIntensity ) ApplyForceToEntity(createdObject, 1, forceVector.x, forceVector.y, forceVector.z, 0.0, 0.0, 0.0, 0, false, true, true, false, true) end
28988a2bce77625f1cd5974fa199323d
{ "intermediate": 0.39171844720840454, "beginner": 0.4259919822216034, "expert": 0.18228957056999207 }
2,081
How can I add a landing sound after a jump for my character in Unity using C#?
269b680122b3a94abbcae9f0610f329f
{ "intermediate": 0.6091305017471313, "beginner": 0.19119024276733398, "expert": 0.1996791958808899 }
2,082
what is api
f68944f962663595148de12ae5c5aa24
{ "intermediate": 0.39424359798431396, "beginner": 0.2620249390602112, "expert": 0.34373143315315247 }
2,083
import struct import sqlite3 import time import sys import matplotlib.pyplot as plt import numpy as np import argparse #import Exceptions from pymodbus.client import ModbusSerialClient as ModbusClient #from pymodbus.exceptions import ModbusInvalidResponseError import random # for test from datetime import datetime from matplotlib import dates # 打开串口 client = ModbusClient(method="rtu", port='COM1', baudrate=9600) client.connect() # args def usage(): print(''' -h, --help: 帮助 -m, --measure: 读取测量值 -w, --warning: 读取继电器报警 -s, --setting: 写寄存器 -r, --read: 读取寄存器 -mo, --monitor: 持续读取测量值并记录 -o, --output: 输出文件名 ''') ### 寄存器操作 def read_register(reg_addr, reg_count) -> int: # 读取寄存器并返回值 rr = client.read_holding_registers(reg_addr, reg_count,unit=0x01) ans = rr.registers[0] return ans def read_float(register_addr) -> int: # 读取寄存器并转换为浮点数 # count: 2 ans = read_register(register_addr,2) result = struct.unpack('>f', struct.pack('>HH', ans))[0] return result def write_register(register_addr, value) -> int: # 往一个寄存器写入值 result = client.write_register(register_addr, value, unit=0x01) return result def write_float(register_addr, value) -> int: # 往一个寄存器写入浮点数 val = struct.unpack('>HH', struct.pack('>f', value)) result = client.write_registers(register_addr, val, unit=0x01) return result ### 测量操作 def measure_float() -> float: # 读取测量值浮点数 # addr: 0x20 # count: 2 ans = read_float(0x20) return ans.__round__(4) ### 读取操作 def read_current_ct(): # 读取电流变比 # addr: 0x1C # count: 1 ans = read_register(0x1C, 1) return ans def read_comm_addr(): # 读取通讯地址 # addr: 0x1B # count: 1 ans = read_register(0x1B, 1) return ans def read_comm_bin(): # 读取通讯比特率 # addr: 0x1C # count: 1 ans = read_register(0x1C, 1) return ans def read_dp(): # 小数点位置 # addr: 0x1E # count: 1 ans = read_register(0x1E, 1) dp = ans.registers[0] return bin(dp)[-1] def measure_int(): # DM5 不支持 pass def read_war_uperhigh(): # 读取上上限 # addr: 0x20 ans = read_float(0x20) return ans.__round__(4) def read_war_high(): # 读取上限 # addr: 0x22 ans = read_float(0x22) return ans.__round__(4) def read_out_delay(): # 读取输出延时 # addr: 0x24 ans = read_float(0x24) return ans.__round__(4) def read_war_low(): # 读取下限 # addr: 0x26 ans = read_float(0x26) return ans.__round__(4) def read_war_uperlow(): # 读取下下限 # addr: 0x28 ans = read_float(0x28) return ans.__round__(4) def read_out_offset(): # 读取输出偏移 # addr: 0x2C ans = read_float(0x2C) return ans.__round__(4) def read_warning(): # 继电器报警 # addr: 0x2E war = read_register(0x2E, 2) war = client.read_holding_registers(0x002E, 2, unit=0x01).registers[0] war_HH = int(war & 0b1111000000000000) >> 12 #上上限 war_HI = int(war & 0b0000111100000000) >> 8 #上限 war_GO = int(war & 0b0000000011110000) >> 4 war_LO = int(war & 0b0000000000001111) #下限 war_LL = int(war & 0b1111000000000000) >> 12 #下下限 return war_HH, war_HI, war_GO, war_LO, war_LL ### 写入操作 def setting(current_ct=None, comm_addr=None, comm_bin=None, war_uperhigh=None, war_high=None, war_uperlow=None, war_low=None, out_delay=None, out_offset=None): # 配置 ### Int # current_ct: 电流变比CT 0x14 1 # comm_addr: 通讯地址 0x1B 1 # comm_bin: 通讯比特率 0x1C 1 ### Float # war_uperhigh: 上上限 0x20 2 # war_high: 上限 0x22 2 # war_uperlow: 下下限 0x28 2 # war_low: 下限 0x26 2 # out_delay: 输出延时 0x24 2 # out_offset: 输出偏移 0x2C 2 # 写入电流变比触发器 CT 值 if current_ct is not None: write_register(0x14, current_ct) # 写入通讯地址 if comm_addr is not None: write_register(0x1B, comm_addr) # 写入通讯比特率 if comm_bin is not None: write_register(0x1C, comm_bin) # 写入上上限 if war_uperhigh is not None: write_float(0x20, war_uperhigh) # 写入上限 if war_high is not None: write_float(0x22, war_high) # 写入下下限 if war_uperlow is not None: write_float(0x28, war_uperlow) # 写入下限 if war_low is not None: write_float(0x26, war_low) # 写入输出延时 if out_delay is not None: write_float(0x24, out_delay) # 写入输出偏移 if out_offset is not None: write_float(0x2C, out_offset) ### 记录操作 def record(filename): # 创建数据库 conn = sqlite3.connect(filename) cursor = conn.cursor() cursor.execute('CREATE TABLE IF NOT EXISTS data(id INTEGER PRIMARY KEY AUTOINCREMENT,data FLOAT,warning INT,date DATE,time TIME,timestamp TIMESTAMP)') # 记录 try: # 持续记录数据 while True: # 读取寄存器 result = measure_float() warnings = read_warning() if any(warnings): warning = warnings.index(1) else: warning = 0 # 存储数据 date = time.strftime("%Y-%m-%d", time.localtime()) current_time = time.strftime("%H:%M:%S", time.localtime()) timestamp = int(time.time()) cursor.execute('INSERT INTO data(data, warning, date, time, timestamp) VALUES(?, ?, ?, ?, ?)', (result, warning, date, current_time, timestamp)) conn.commit() # 打印数据 print(f"Received data: {result}, Date: {date}, Time: {current_time}") # 等待 time.sleep(0.1) except Exception as e: print(e) finally: # 关闭串口和数据库连接 client.close() cursor.close() conn.close() def gen_random_data(): yield random.uniform(0, 100) ### 监控操作 def monitor(): fig, ax = plt.subplots() x = [] y = [] line, = ax.plot(x,y) plt.ion() plt.show() try: while True: #result = measure_float() result = next(gen_random_data()) warnings = read_warning() date = time.strftime("%Y-%m-%d", time.localtime()) current_time = datetime.now() print(f"Received data: {result}, Date: {date}, Time: {current_time}") if any(warnings): print(warnings.index(1)) # 显示上限警告 # 实时绘图 x.append(current_time) y.append(result) if len(x) > 50: x = x[-50:] y = y[-50:] line.set_xdata(dates.date2num(x)) line.set_ydata(y) ax.relim() ax.autoscale_view(1,1,1) plt.pause(0.1) except Exception as e: print(e) finally: client.close() if __name__ == "__main__": parser = argparse.ArgumentParser(description='Modbus device record utility for M5') parser.add_argument('-m', '-measure', action='store_true', help='measure for one time') parser.add_argument('-w', '-warning', action='store_true', help='read the relay warning') parser.add_argument('-s', '-setting', nargs='+' , help='write specific registers') parser.add_argument('-r', '-read', nargs='+', type=str, help='read registers') parser.add_argument('-mo', '-monitor', action='store_true', help='monitor the measure data') parser.add_argument('-o', '-output', type=str, dest='filename', help='if provided, save the data to the file') args = parser.parse_args() print(args) if args.m: print("Value:",measure_float()) if args.w: print('Warning:',read_warning()) if args.s: settings = {} for arg in args.s: k,v = arg.split('=') settings[k] = v setting(**settings) if args.r: for arg in args.r: print(f'Register {arg}:',read_register(int(arg,16))) if args.mo: if args.filename: print(f'Output filename: {args.filename}') record(args.output) else: monitor() else: parser.print_help() 这是一个用Modbus协议于下位机沟通的代码,你能帮忙看一下有什么优化建议和错误修正吗?
777417607f6747dd11ad16df50bb53da
{ "intermediate": 0.3769468069076538, "beginner": 0.419733464717865, "expert": 0.2033197432756424 }
2,084
How can I add a jump headbob to my jump script? private void HandleJump() { if (shouldJump && !isCrouching && currentStamina >= jumpStaminaLoss) { int layerMask = (-1) - (1 << LayerMask.NameToLayer("Player")); if (Physics.Raycast(playerCamera.transform.position, Vector3.down, out RaycastHit hit, 3, layerMask)) { switch (hit.collider.tag) { case "Footsteps/GRASS": jumpAudioSource.PlayOneShot(grassJumpClips[UnityEngine.Random.Range(0, grassJumpClips.Length - 1)]); break; case "Footsteps/WOOD": jumpAudioSource.PlayOneShot(woodJumpClips[UnityEngine.Random.Range(0, woodJumpClips.Length - 1)]); break; case "Footsteps/METAL": jumpAudioSource.PlayOneShot(metalJumpClips[UnityEngine.Random.Range(0, metalJumpClips.Length - 1)]); break; case "Footsteps/GRAVEL": jumpAudioSource.PlayOneShot(gravelJumpClips[UnityEngine.Random.Range(0, gravelJumpClips.Length - 1)]); break; case "Footsteps/CONCRETE": jumpAudioSource.PlayOneShot(concreteJumpClips[UnityEngine.Random.Range(0, concreteJumpClips.Length - 1)]); break; default: jumpAudioSource.PlayOneShot(concreteJumpClips[UnityEngine.Random.Range(0, concreteJumpClips.Length - 1)]); break; } } moveDirection.y = jumpForce; } HandleLanding(); }
ef742e3f8d2206a137bb8bf9396fd458
{ "intermediate": 0.4419897198677063, "beginner": 0.34414562582969666, "expert": 0.21386462450027466 }
2,086
import struct import sqlite3 import time import sys import matplotlib.pyplot as plt import numpy as np import argparse #import Exceptions from pymodbus.client import ModbusSerialClient as ModbusClient #from pymodbus.exceptions import ModbusInvalidResponseError import random # for test from datetime import datetime from matplotlib import dates # 打开串口 client = ModbusClient(method="rtu", port=com_port, baudrate=9600) client.connect() ### 寄存器操作 def read_register(reg_addr, reg_count) -> int: # 读取寄存器并返回值 rr = client.read_holding_registers(reg_addr, reg_count,unit=0x01) ans = rr.registers[0] return ans def read_float(register_addr) -> int: # 读取寄存器并转换为浮点数 # count: 2 ans = read_register(register_addr,2) result = struct.unpack('>f', struct.pack('>HH', ans))[0] return result def write_register(register_addr, value) -> int: # 往一个寄存器写入值 result = client.write_register(register_addr, value, unit=0x01) return result def write_float(register_addr, value) -> int: # 往一个寄存器写入浮点数 val = struct.unpack('>HH', struct.pack('>f', value)) result = client.write_registers(register_addr, val, unit=0x01) return result ### 测量操作 def measure_float() -> float: # 读取测量值浮点数 # addr: 0x20 # count: 2 ans = read_float(0x20) return ans.__round__(4) ### 读取操作 def read_current_ct(): # 读取电流变比 # addr: 0x1C # count: 1 ans = read_register(0x1C, 1) return ans def read_comm_addr(): # 读取通讯地址 # addr: 0x1B # count: 1 ans = read_register(0x1B, 1) return ans def read_comm_bin(): # 读取通讯比特率 # addr: 0x1C # count: 1 ans = read_register(0x1C, 1) return ans def read_dp(): # 小数点位置 # addr: 0x1E # count: 1 ans = read_register(0x1E, 1) dp = ans.registers[0] return bin(dp)[-1] def measure_int(): # DM5 不支持 pass def read_war_uperhigh(): # 读取上上限 # addr: 0x20 ans = read_float(0x20) return ans.__round__(4) def read_war_high(): # 读取上限 # addr: 0x22 ans = read_float(0x22) return ans.__round__(4) def read_out_delay(): # 读取输出延时 # addr: 0x24 ans = read_float(0x24) return ans.__round__(4) def read_war_low(): # 读取下限 # addr: 0x26 ans = read_float(0x26) return ans.__round__(4) def read_war_uperlow(): # 读取下下限 # addr: 0x28 ans = read_float(0x28) return ans.__round__(4) def read_out_offset(): # 读取输出偏移 # addr: 0x2C ans = read_float(0x2C) return ans.__round__(4) def read_warning(): # 继电器报警 # addr: 0x2E war = read_register(0x2E, 2) war = client.read_holding_registers(0x002E, 2, unit=0x01).registers[0] war_HH = int(war & 0b1111000000000000) >> 12 #上上限 war_HI = int(war & 0b0000111100000000) >> 8 #上限 war_GO = int(war & 0b0000000011110000) >> 4 war_LO = int(war & 0b0000000000001111) #下限 war_LL = int(war & 0b1111000000000000) >> 12 #下下限 return war_HH, war_HI, war_GO, war_LO, war_LL ### 写入操作 def setting(current_ct=None, comm_addr=None, comm_bin=None, war_uperhigh=None, war_high=None, war_uperlow=None, war_low=None, out_delay=None, out_offset=None): # 配置 ### Int # current_ct: 电流变比CT 0x14 1 # comm_addr: 通讯地址 0x1B 1 # comm_bin: 通讯比特率 0x1C 1 ### Float # war_uperhigh: 上上限 0x20 2 # war_high: 上限 0x22 2 # war_uperlow: 下下限 0x28 2 # war_low: 下限 0x26 2 # out_delay: 输出延时 0x24 2 # out_offset: 输出偏移 0x2C 2 # 写入电流变比触发器 CT 值 if current_ct is not None: write_register(0x14, current_ct) # 写入通讯地址 if comm_addr is not None: write_register(0x1B, comm_addr) # 写入通讯比特率 if comm_bin is not None: write_register(0x1C, comm_bin) # 写入上上限 if war_uperhigh is not None: write_float(0x20, war_uperhigh) # 写入上限 if war_high is not None: write_float(0x22, war_high) # 写入下下限 if war_uperlow is not None: write_float(0x28, war_uperlow) # 写入下限 if war_low is not None: write_float(0x26, war_low) # 写入输出延时 if out_delay is not None: write_float(0x24, out_delay) # 写入输出偏移 if out_offset is not None: write_float(0x2C, out_offset) ### 记录操作 def record(filename): # 创建数据库 conn = sqlite3.connect(filename) cursor = conn.cursor() cursor.execute('CREATE TABLE IF NOT EXISTS data(id INTEGER PRIMARY KEY AUTOINCREMENT,data FLOAT,warning INT,date DATE,time TIME,timestamp TIMESTAMP)') # 记录 try: # 持续记录数据 while True: # 读取寄存器 result = measure_float() warnings = read_warning() if any(warnings): warning = warnings.index(1) else: warning = 0 # 存储数据 date = time.strftime("%Y-%m-%d", time.localtime()) current_time = time.strftime("%H:%M:%S", time.localtime()) timestamp = int(time.time()) cursor.execute('INSERT INTO data(data, warning, date, time, timestamp) VALUES(?, ?, ?, ?, ?)', (result, warning, date, current_time, timestamp)) conn.commit() # 打印数据 print(f"Received data: {result}, Date: {date}, Time: {current_time}") # 等待 time.sleep(0.1) except Exception as e: print(e) finally: # 关闭串口和数据库连接 client.close() cursor.close() conn.close() def gen_random_data(): yield random.uniform(0, 100) ### 监控操作 def monitor(): fig, ax = plt.subplots() x = [] y = [] line, = ax.plot(x,y) plt.ion() plt.show() try: while True: #result = measure_float() result = next(gen_random_data()) warnings = read_warning() date = time.strftime("%Y-%m-%d", time.localtime()) current_time = datetime.now() print(f"Received data: {result}, Date: {date}, Time: {current_time}") if any(warnings): print(warnings.index(1)) # 显示上限警告 # 实时绘图 x.append(current_time) y.append(result) if len(x) > 50: x = x[-50:] y = y[-50:] line.set_xdata(dates.date2num(x)) line.set_ydata(y) ax.relim() ax.autoscale_view(1,1,1) plt.pause(0.1) except Exception as e: print(e) finally: client.close() if __name__ == "__main__": parser = argparse.ArgumentParser(description='Modbus device record utility for M5') parser.add_argument('-b', '-baudrate', type=int, default=9600, dest='baudrate', help='baudrate (default: 9600)' parser.add_argument('-p', '-port', type=int, required=True, dest='port', help='serial port') parser.add_argument('-m', '-measure', action='store_true', help='measure for one time') parser.add_argument('-w', '-warning', action='store_true', help='read the relay warning') parser.add_argument('-s', '-setting', nargs='+' , help='write specific registers') parser.add_argument('-r', '-read', nargs='+', type=str, help='read registers') parser.add_argument('-mo', '-monitor', action='store_true', help='monitor the measure data') parser.add_argument('-o', '-output', type=str, dest='filename', help='if provided, save the data to the file') args = parser.parse_args() com_port = args.port com_baudrate = args.baudrate if args.m: print("Value:",measure_float()) if args.w: print('Warning:',read_warning()) if args.s: settings = {} for arg in args.s: k,v = arg.split('=') settings[k] = v setting(**settings) if args.r: for arg in args.r: print(f'Register {arg}:',read_register(int(arg,16))) if args.mo: if args.filename: print(f'Output filename: {args.filename}') record(args.output) else: monitor() else: parser.print_help() 你能对这个代码用类重构吗?方便通讯端口和比特率传入
5d80447f8b44a76be69a0751ce5986bb
{ "intermediate": 0.3270133137702942, "beginner": 0.4167446792125702, "expert": 0.25624197721481323 }
2,087
Software Enginering Homework Draw a state transition diagram of the process There are three states with process:ready, run and blocks. •The initial state is ready; The final state after the program runs •Ready state obtains CPU time slice to run state; The running state time slice is used up and turns into ready state; If the running state does not meet the required resources, it will turn into the blocking state. If the blocked state meets the required resources, it will return to the ready state
5f3ecbce0e5627d6077f40a42e62b635
{ "intermediate": 0.36597904562950134, "beginner": 0.13352802395820618, "expert": 0.5004929304122925 }
2,088
I want to add a visual headbob to my script for when my character jumps in game. Make sure that there is no camera snapping by resetting positions instantly and so on. private void HandleJump() { if (shouldJump && !isCrouching && currentStamina >= jumpStaminaLoss) { int layerMask = (-1) - (1 << LayerMask.NameToLayer("Player")); if (Physics.Raycast(playerCamera.transform.position, Vector3.down, out RaycastHit hit, 3, layerMask)) { switch (hit.collider.tag) { case "Footsteps/GRASS": jumpAudioSource.PlayOneShot(grassJumpClips[UnityEngine.Random.Range(0, grassJumpClips.Length - 1)]); break; case "Footsteps/WOOD": jumpAudioSource.PlayOneShot(woodJumpClips[UnityEngine.Random.Range(0, woodJumpClips.Length - 1)]); break; case "Footsteps/METAL": jumpAudioSource.PlayOneShot(metalJumpClips[UnityEngine.Random.Range(0, metalJumpClips.Length - 1)]); break; case "Footsteps/GRAVEL": jumpAudioSource.PlayOneShot(gravelJumpClips[UnityEngine.Random.Range(0, gravelJumpClips.Length - 1)]); break; case "Footsteps/CONCRETE": jumpAudioSource.PlayOneShot(concreteJumpClips[UnityEngine.Random.Range(0, concreteJumpClips.Length - 1)]); break; default: jumpAudioSource.PlayOneShot(concreteJumpClips[UnityEngine.Random.Range(0, concreteJumpClips.Length - 1)]); break; } } moveDirection.y = jumpForce; } HandleLanding(); }
0e8a048fd729e9433c18c13d76f50b3d
{ "intermediate": 0.3919065296649933, "beginner": 0.2959452271461487, "expert": 0.31214821338653564 }
2,089
can you give me an excel formula to add two rows?
cc72692f84e4e3255b9adddaefa12f80
{ "intermediate": 0.37818652391433716, "beginner": 0.2918078303337097, "expert": 0.3300056755542755 }
2,090
How can I make my headers in unity collapsible to make them look nicer and not clutter up my inspector?
e5418236c1108e6a5a9086912eb3d362
{ "intermediate": 0.4970663785934448, "beginner": 0.26548850536346436, "expert": 0.23744510114192963 }
2,091
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: com.example.trivia, PID: 14353 java.lang.NullPointerException: Parameter specified as non-null is null: method com.example.trivia.data.MyViewModel.setQuote, parameter <set-?>
d51f5d8ca2ad50529ea0c6a4b908350b
{ "intermediate": 0.4743818938732147, "beginner": 0.3104539215564728, "expert": 0.21516422927379608 }
2,092
How can I add procedural leaning to my fps game in unity using C#. What I mean by procedural is let’s say I hold alt and Q I slowly lean left and if I hold alt and E I slowly lean right just like in the game Escape from tarkov. There just be a cut off to how far a character can lean.
045c6ba8e34cb2b79834d0364a2443b9
{ "intermediate": 0.49154359102249146, "beginner": 0.19973088800907135, "expert": 0.3087255656719208 }
2,093
<html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>[SisLovesMe] Sophia Leone, Selina Bentz &#40;Green Makes us Horny / 04.21.2023&#41; - DoodStream</title> <link href="//i.doodcdn.co" rel="dns-prefetch" crossorigin><link href="//img.doodcdn.co" rel="dns-prefetch" crossorigin><link href="//cdnjs.cloudflare.com" rel="dns-prefetch" crossorigin><link href="//www.google.com" rel="dns-prefetch" crossorigin><link href="//www.gstatic.com" rel="dns-prefetch" crossorigin><link href="//fonts.googleapis.com" rel="dns-prefetch" crossorigin><link href="//fonts.gstatic.com" rel="dns-prefetch" crossorigin> <meta name="og:image" content="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg"> <meta name="twitter:image" content="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg"> <meta name="robots" content="nofollow, noindex"> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script type="text/javascript" src="//i.doodcdn.co/ads/ad.js"></script> <style type="text/css">.d-none{display:none;}</style> <script type="text/javascript">window.VIDEOJS_NO_BASE_THEME=!0;window.VIDEOJS_NO_DYNAMIC_STYLE=!0;window.HELP_IMPROVE_VIDEOJS=!1;$.cookie('file_id', '96701425', { expires: 10 });$.cookie('aff', '16858', { expires: 10 });$.cookie('ref_url', '', { expires: 10 });var oref='',oemb='0';if($.cookie("dref_url")){oref=$.cookie("dref_url");}else{oref=document.referrer;oemb='1';};function PushOpen(gu){$.get('/push_open/'+gu);};function errMsg(){var upel = document.getElementById("os_player");upel.innerHTML = '<img src="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg" class="img-fluid"><div class="position-absolute player-msg player-msg2">Network error! Please reload the page & play the video again.</div>';if(!dsplayer.paused()){dsplayer.pause()};};function hab(){var t=document.createElement('div');t.innerHTML='&nbsp;',t.className='ad doubleclick google-ad adsbox pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads skyscraper text-ad-links';var e=!(t.style='width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;');try{document.body.appendChild(t);var a=document.getElementsByClassName('adsbox')[0];if(0!==a.offsetHeight&&0!==a.clientHeight||(e=!0),void 0!==window.getComputedStyle){var d=window.getComputedStyle(a,null);!d||'none'!=d.getPropertyValue('display')&&'hidden'!=d.getPropertyValue('visibility')||(e=!0)}document.body.removeChild(t)}catch(a){}return e};if(/Google Inc/.test(navigator.vendor)&&navigator.userAgent.indexOf('Chrome')!=-1&&navigator.userAgent.indexOf('CriOS')==-1){document.write('<script type="text/javascript" src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></s'+'cript>');}var punix=Math.round(+new Date/1e3),prand=Math.floor(99998*Math.random()+1),pdomain=window.location.hostname,pfurl=window.location.href,prefe=document.referrer,pwidth=window.innerWidth,pheight=window.innerHeight;function supports_html5_storage(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}};function dpload(e){try{var t;if((t=document.createElement("link")).rel="dns-prefetch",t.href=e,document.head.appendChild(t),(t=document.createElement("link")).rel="preconnect",t.href=e,document.head.appendChild(t)){var n=document.createElement("a");if(n.setAttribute("href",e),n.hostname&&n.protocol){var a=n.protocol+"//"+n.hostname+"/favicon.ico?i",o=btoa('<img src="'+a+'"></img>'),l=document.getElementsByTagName("html")[0],r=document.createElement("iframe");l.appendChild(r),r.style.width="0px",r.style.height="0px",r.style.position="absolute",r.style.border="none",r.style.margin="0px",r.style.padding="0px",r.style.outline="none",r.className="sPreload",r.setAttribute("src","data:text/html;charset=utf-8;base64,"+o)}}}catch(t){}};var _0x2249bc=_0x633c;(function(_0x4196ec,_0x2356a2){var _0x34b2ad=_0x633c,_0x5ca042=_0x4196ec();while(!![]){try{var _0x15032d=-parseInt(_0x34b2ad(0x1d7))/0x1+-parseInt(_0x34b2ad(0x1ef))/0x2+-parseInt(_0x34b2ad(0x204))/0x3*(-parseInt(_0x34b2ad(0x1f7))/0x4)+-parseInt(_0x34b2ad(0x1e0))/0x5+parseInt(_0x34b2ad(0x1db))/0x6*(parseInt(_0x34b2ad(0x1f8))/0x7)+parseInt(_0x34b2ad(0x1f9))/0x8*(-parseInt(_0x34b2ad(0x1dd))/0x9)+parseInt(_0x34b2ad(0x1d5))/0xa;if(_0x15032d===_0x2356a2)break;else _0x5ca042['push'](_0x5ca042['shift']());}catch(_0x1d266e){_0x5ca042['push'](_0x5ca042['shift']());}}}(_0x238e,0x6ca1f));var standaloneFi=window[_0x2249bc(0x1ff)]['standalone'],userAgentFi=window[_0x2249bc(0x1ff)][_0x2249bc(0x1d0)][_0x2249bc(0x1f2)](),safariFi=/safari/['test'](userAgentFi),chromebr=/chrome/[_0x2249bc(0x203)](userAgentFi),iosFi=/iphone|ipod|ipad/[_0x2249bc(0x203)](userAgentFi),Fitor=!0x1;iosFi?!standaloneFi&&safariFi||standaloneFi||safariFi||(Fitor=!0x0):'-1'!=userAgentFi[_0x2249bc(0x1fc)]('wv')&&(Fitor=!0x0),_0x2249bc(0x1f0)!=typeof webview&&(Fitor=!0x0);function _0x633c(_0x27a838,_0x8d32f9){var _0x238edf=_0x238e();return _0x633c=function(_0x633ca1,_0x468d8a){_0x633ca1=_0x633ca1-0x1d0;var _0x2608ce=_0x238edf[_0x633ca1];return _0x2608ce;},_0x633c(_0x27a838,_0x8d32f9);}try{window[_0x2249bc(0x1d3)][_0x2249bc(0x1ed)][_0x2249bc(0x1e5)]&&(Fitor=!0x0);}catch(_0x382baa){}function _0x238e(){var _0x3f1813=['undefined','selenium','toLowerCase','__selenium_evaluate','split','__nightmare','indexOf','4mmrwXg','283969iFyEJO','232YGvfxe','documentElement','toString','search','getExtension','match','navigator','__webdriver_script_func','callSelenium','_Selenium_IDE_Recorder','test','1208367VEgERG','WEBGL_debug_renderer_info','userAgent','getParameter','emit','document','_phantom','12517010AOkZgy','_phantom\x20__nightmare\x20_selenium\x20callPhantom\x20callSelenium\x20_Selenium_IDE_Recorder\x20__stopAllTimers','427075ouMJUG','driver','__phantomas','external','6ywRZHS','__driver_evaluate','4824yUvZZa','__webdriver_script_fn','callPhantom','3581800NFCqYy','Sequentum','__webdriver_evaluate','domAutomation','ipcRenderer','cache_','__webdriver_unwrapped','__selenium_unwrapped','webdriver','UNMASKED_VENDOR_WEBGL','__fxdriver_evaluate','createElement','__driver_unwrapped','$cdc_asdjflasutopfhvcZLmcfl_','getAttribute','182238WHsSjA'];_0x238e=function(){return _0x3f1813;};return _0x238e();}try{var canvas=document[_0x2249bc(0x1eb)]('canvas'),gl=canvas['getContext']('webgl'),debugInfo=gl[_0x2249bc(0x1fd)](_0x2249bc(0x205)),vendor=gl[_0x2249bc(0x1d1)](debugInfo[_0x2249bc(0x1e9)]),renderer=gl[_0x2249bc(0x1d1)](debugInfo['UNMASKED_RENDERER_WEBGL']);'Brian\x20Paul'==vendor&&'Mesa\x20OffScreen'==renderer&&(Fitor=!0x0);}catch(_0x36ef71){}ysel=(function(){var _0x297091=_0x2249bc;try{if(_0x297091(0x1e4)in window)return 0x14;if(_0x297091(0x1d4)in window||_0x297091(0x1df)in window)return 0x1;if(_0x297091(0x1d9)in window)return 0x2;if('Buffer'in window)return 0x3;if(_0x297091(0x1d2)in window)return 0x4;if('spawn'in window)return 0x5;if(_0x297091(0x1e8)in window&&0x1==window[_0x297091(0x1e8)]||_0x297091(0x1e8)in window[_0x297091(0x1ff)]&&0x1==window[_0x297091(0x1ff)]['webdriver'])return 0x6;if(_0x297091(0x1e3)in window)return 0x7;try{if(window['document'][_0x297091(0x1fa)][_0x297091(0x1ee)](_0x297091(0x1e8)))return 0x8;}catch(_0x2c657d){}if(_0x297091(0x202)in window)return 0x9;if(_0x297091(0x1de)in document)return 0xa;try{var _0x3271d4,_0x4249da='__webdriver_evaluate\x20__selenium_evaluate\x20__webdriver_script_function\x20__webdriver_script_func\x20__webdriver_script_fn\x20__fxdriver_evaluate\x20__driver_unwrapped\x20__webdriver_unwrapped\x20__driver_evaluate\x20__selenium_unwrapped\x20__fxdriver_unwrapped'['split']('\x20'),_0x1ef586=_0x297091(0x1d6)[_0x297091(0x1f4)]('\x20');for(_0x3271d4 in _0x1ef586)if(window[_0x1ef586[_0x3271d4]])return 0xb;for(var _0x4e7082 in _0x4249da)if(window[_0x297091(0x1d3)][_0x4249da[_0x4e7082]])return 0xc;for(var _0x109918 in window[_0x297091(0x1d3)])if(_0x109918[_0x297091(0x1fe)](/\$[a-z]dc_/)&&window['document'][_0x109918]['cache_'])return 0xd;}catch(_0x4b65d2){}return window[_0x297091(0x1da)]&&window[_0x297091(0x1da)][_0x297091(0x1fb)]()&&-0x1!=window[_0x297091(0x1da)][_0x297091(0x1fb)]()[_0x297091(0x1f6)](_0x297091(0x1e1))?0xe:window['document'][_0x297091(0x1fa)][_0x297091(0x1ee)](_0x297091(0x1f1))?0xf:window['document'][_0x297091(0x1fa)][_0x297091(0x1ee)]('driver')?0x10:null!==document[_0x297091(0x1fa)]['getAttribute'](_0x297091(0x1f1))?0x11:null!==document[_0x297091(0x1fa)][_0x297091(0x1ee)]('webdriver')?0x12:null!==document['documentElement'][_0x297091(0x1ee)]('driver')?0x13:0x0;}catch(_0x22f451){return-0x1;}}()),0x0!==ysel&&(Fitor=!0x0),runBD=function(){var _0x1095f7=_0x2249bc,_0x1bde2a=[_0x1095f7(0x1e2),_0x1095f7(0x1f3),'__webdriver_script_function',_0x1095f7(0x200),_0x1095f7(0x1de),_0x1095f7(0x1ea),_0x1095f7(0x1ec),_0x1095f7(0x1e6),_0x1095f7(0x1dc),_0x1095f7(0x1e7),'__fxdriver_unwrapped'],_0x3252b0=[_0x1095f7(0x1d4),_0x1095f7(0x1f5),'_selenium','callPhantom',_0x1095f7(0x201),'_Selenium_IDE_Recorder'];for(var _0x3b1d80 in _0x3252b0){var _0x26ea56=_0x3252b0[_0x3b1d80];if(window[_0x26ea56])return!0x0;}for(var _0x48042f in _0x1bde2a){var _0x1f3784=_0x1bde2a[_0x48042f];if(window[_0x1095f7(0x1d3)][_0x1f3784])return!0x0;}for(var _0x13b2db in window[_0x1095f7(0x1d3)])if(_0x13b2db['match'](/\$[a-z]dc_/)&&window[_0x1095f7(0x1d3)][_0x13b2db][_0x1095f7(0x1e5)])return!0x0;return window[_0x1095f7(0x1da)]&&window[_0x1095f7(0x1da)]['toString']()&&-0x1!=window[_0x1095f7(0x1da)][_0x1095f7(0x1fb)]()[_0x1095f7(0x1f6)]('Sequentum')?!0x0:window[_0x1095f7(0x1d3)][_0x1095f7(0x1fa)][_0x1095f7(0x1ee)](_0x1095f7(0x1f1))?!0x0:window[_0x1095f7(0x1d3)][_0x1095f7(0x1fa)]['getAttribute']('webdriver')?!0x0:window['document'][_0x1095f7(0x1fa)][_0x1095f7(0x1ee)](_0x1095f7(0x1d8))?!0x0:!0x1;},runBD()&&(Fitor=!0x0),/HeadlessChrome/[_0x2249bc(0x203)](window[_0x2249bc(0x1ff)][_0x2249bc(0x1d0)])&&(Fitor=!0x0);try{window[_0x2249bc(0x1d3)][_0x2249bc(0x1fa)][_0x2249bc(0x1ee)]('webdriver')&&(Fitor=!0x0);}catch(_0x2df221){}var oftor="0";Fitor&&(oftor="1");</script> </head><body topmargin=0 leftmargin=0 style="background:transparent;" id="videoPlayerWrap"> <div class="col-md-12 pt-2 text-center d-none"> <img src="//i.doodcdn.co/img/no_video_3.svg"> <h1>Not Found</h1> <p>video you are looking for is not found.</p> </div> <div id="os_player"> <link rel="stylesheet" type="text/css" href="//i.doodcdn.co/css/embed.css" /><script>let root = document.documentElement;root.style.setProperty('--color-primary', '#FF9900');</script><div style="width:100%;height:100%;text-align:center;"> <video id="video_player" class="video-js vjs-big-play-centered" controls width="100%" height="100%" poster="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg"> </video></div><input id="file" type="file" onchange="loadSrtFromPc()" style="display:none" /><script type="text/javascript" src="//i.doodcdn.co/js/embed2.js"></script><script> window.SILVERMINE_VIDEOJS_CHROMECAST_CONFIG={preloadWebComponents:true,};var ntt=0;if (!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) ntt = true; var dsplayer = videojs('video_player',{controls:true,persistTextTrackSettings:true,html5:{nativeTextTracks:ntt},techOrder:["chromecast","html5"],"preload":"none",controlBar:{volumePanel:{inline:true}}, responsive:true,plugins:{seekButtons:{forward:10,back:10},chromecast:{},
5e6dc90202bd849b5f6ad2c343a57b56
{ "intermediate": 0.28984978795051575, "beginner": 0.5134698152542114, "expert": 0.1966804414987564 }
2,094
fivem scripting How can I make it so if side is equal to A then the player id A get message you you win and player B get message you lose local teams = {['A']= playerid, ['B']= playerid} local side = 'A' for k,v in pairs(teams) do TriggerClientEvent('main-volleyball:client:drawtext', v, side) end
c7d3d941eabbffe03c16c6919741b3e8
{ "intermediate": 0.3543700873851776, "beginner": 0.4277467727661133, "expert": 0.21788308024406433 }
2,095
Fivem script I'm using ApplyForceToEntity is there a way to simulate random forces applied and if the object lands within a box zone then to apply that force to the entity
425bc011937a4cce99d93b97ae20c8da
{ "intermediate": 0.42853260040283203, "beginner": 0.14810967445373535, "expert": 0.4233577251434326 }
2,096
this is my js discord bot how can i make it so if the message it is long to send is longer then 2000 characters it splits it into multiple messages
d76bb04bcfae08f1d9ebe70c6076d3f9
{ "intermediate": 0.4529919922351837, "beginner": 0.22736652195453644, "expert": 0.31964144110679626 }
2,097
how are you different then chat gpt 3
29a16e512e90f7b7373f7d06f1c4941b
{ "intermediate": 0.3352343738079071, "beginner": 0.3368942141532898, "expert": 0.3278714716434479 }
2,098
hey
b2c751e2f6fd1509ad00c1c107cb8ed2
{ "intermediate": 0.33180856704711914, "beginner": 0.2916048467159271, "expert": 0.3765866458415985 }
2,099
<html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>[SisLovesMe] Sophia Leone, Selina Bentz &#40;Green Makes us Horny / 04.21.2023&#41; - DoodStream</title> <link href="//i.doodcdn.co" rel="dns-prefetch" crossorigin><link href="//img.doodcdn.co" rel="dns-prefetch" crossorigin><link href="//cdnjs.cloudflare.com" rel="dns-prefetch" crossorigin><link href="//www.google.com" rel="dns-prefetch" crossorigin><link href="//www.gstatic.com" rel="dns-prefetch" crossorigin><link href="//fonts.googleapis.com" rel="dns-prefetch" crossorigin><link href="//fonts.gstatic.com" rel="dns-prefetch" crossorigin> <meta name="og:image" content="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg"> <meta name="twitter:image" content="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg"> <meta name="robots" content="nofollow, noindex"> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script type="text/javascript" src="//i.doodcdn.co/ads/ad.js"></script> <style type="text/css">.d-none{display:none;}</style> <script type="text/javascript">window.VIDEOJS_NO_BASE_THEME=!0;window.VIDEOJS_NO_DYNAMIC_STYLE=!0;window.HELP_IMPROVE_VIDEOJS=!1;$.cookie('file_id', '96701425', { expires: 10 });$.cookie('aff', '16858', { expires: 10 });$.cookie('ref_url', '', { expires: 10 });var oref='',oemb='0';if($.cookie("dref_url")){oref=$.cookie("dref_url");}else{oref=document.referrer;oemb='1';};function PushOpen(gu){$.get('/push_open/'+gu);};function errMsg(){var upel = document.getElementById("os_player");upel.innerHTML = '<img src="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg" class="img-fluid"><div class="position-absolute player-msg player-msg2">Network error! Please reload the page & play the video again.</div>';if(!dsplayer.paused()){dsplayer.pause()};};function hab(){var t=document.createElement('div');t.innerHTML='&nbsp;',t.className='ad doubleclick google-ad adsbox pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads skyscraper text-ad-links';var e=!(t.style='width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;');try{document.body.appendChild(t);var a=document.getElementsByClassName('adsbox')[0];if(0!==a.offsetHeight&&0!==a.clientHeight||(e=!0),void 0!==window.getComputedStyle){var d=window.getComputedStyle(a,null);!d||'none'!=d.getPropertyValue('display')&&'hidden'!=d.getPropertyValue('visibility')||(e=!0)}document.body.removeChild(t)}catch(a){}return e};if(/Google Inc/.test(navigator.vendor)&&navigator.userAgent.indexOf('Chrome')!=-1&&navigator.userAgent.indexOf('CriOS')==-1){document.write('<script type="text/javascript" src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></s'+'cript>');}var punix=Math.round(+new Date/1e3),prand=Math.floor(99998*Math.random()+1),pdomain=window.location.hostname,pfurl=window.location.href,prefe=document.referrer,pwidth=window.innerWidth,pheight=window.innerHeight;function supports_html5_storage(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}};function dpload(e){try{var t;if((t=document.createElement("link")).rel="dns-prefetch",t.href=e,document.head.appendChild(t),(t=document.createElement("link")).rel="preconnect",t.href=e,document.head.appendChild(t)){var n=document.createElement("a");if(n.setAttribute("href",e),n.hostname&&n.protocol){var a=n.protocol+"//"+n.hostname+"/favicon.ico?i",o=btoa('<img src="'+a+'"></img>'),l=document.getElementsByTagName("html")[0],r=document.createElement("iframe");l.appendChild(r),r.style.width="0px",r.style.height="0px",r.style.position="absolute",r.style.border="none",r.style.margin="0px",r.style.padding="0px",r.style.outline="none",r.className="sPreload",r.setAttribute("src","data:text/html;charset=utf-8;base64,"+o)}}}catch(t){}};var _0x2249bc=_0x633c;(function(_0x4196ec,_0x2356a2){var _0x34b2ad=_0x633c,_0x5ca042=_0x4196ec();while(!![]){try{var _0x15032d=-parseInt(_0x34b2ad(0x1d7))/0x1+-parseInt(_0x34b2ad(0x1ef))/0x2+-parseInt(_0x34b2ad(0x204))/0x3*(-parseInt(_0x34b2ad(0x1f7))/0x4)+-parseInt(_0x34b2ad(0x1e0))/0x5+parseInt(_0x34b2ad(0x1db))/0x6*(parseInt(_0x34b2ad(0x1f8))/0x7)+parseInt(_0x34b2ad(0x1f9))/0x8*(-parseInt(_0x34b2ad(0x1dd))/0x9)+parseInt(_0x34b2ad(0x1d5))/0xa;if(_0x15032d===_0x2356a2)break;else _0x5ca042['push'](_0x5ca042['shift']());}catch(_0x1d266e){_0x5ca042['push'](_0x5ca042['shift']());}}}(_0x238e,0x6ca1f));var standaloneFi=window[_0x2249bc(0x1ff)]['standalone'],userAgentFi=window[_0x2249bc(0x1ff)][_0x2249bc(0x1d0)][_0x2249bc(0x1f2)](),safariFi=/safari/['test'](userAgentFi),chromebr=/chrome/[_0x2249bc(0x203)](userAgentFi),iosFi=/iphone|ipod|ipad/[_0x2249bc(0x203)](userAgentFi),Fitor=!0x1;iosFi?!standaloneFi&&safariFi||standaloneFi||safariFi||(Fitor=!0x0):'-1'!=userAgentFi[_0x2249bc(0x1fc)]('wv')&&(Fitor=!0x0),_0x2249bc(0x1f0)!=typeof webview&&(Fitor=!0x0);function _0x633c(_0x27a838,_0x8d32f9){var _0x238edf=_0x238e();return _0x633c=function(_0x633ca1,_0x468d8a){_0x633ca1=_0x633ca1-0x1d0;var _0x2608ce=_0x238edf[_0x633ca1];return _0x2608ce;},_0x633c(_0x27a838,_0x8d32f9);}try{window[_0x2249bc(0x1d3)][_0x2249bc(0x1ed)][_0x2249bc(0x1e5)]&&(Fitor=!0x0);}catch(_0x382baa){}function _0x238e(){var _0x3f1813=['undefined','selenium','toLowerCase','__selenium_evaluate','split','__nightmare','indexOf','4mmrwXg','283969iFyEJO','232YGvfxe','documentElement','toString','search','getExtension','match','navigator','__webdriver_script_func','callSelenium','_Selenium_IDE_Recorder','test','1208367VEgERG','WEBGL_debug_renderer_info','userAgent','getParameter','emit','document','_phantom','12517010AOkZgy','_phantom\x20__nightmare\x20_selenium\x20callPhantom\x20callSelenium\x20_Selenium_IDE_Recorder\x20__stopAllTimers','427075ouMJUG','driver','__phantomas','external','6ywRZHS','__driver_evaluate','4824yUvZZa','__webdriver_script_fn','callPhantom','3581800NFCqYy','Sequentum','__webdriver_evaluate','domAutomation','ipcRenderer','cache_','__webdriver_unwrapped','__selenium_unwrapped','webdriver','UNMASKED_VENDOR_WEBGL','__fxdriver_evaluate','createElement','__driver_unwrapped','$cdc_asdjflasutopfhvcZLmcfl_','getAttribute','182238WHsSjA'];_0x238e=function(){return _0x3f1813;};return _0x238e();}try{var canvas=document[_0x2249bc(0x1eb)]('canvas'),gl=canvas['getContext']('webgl'),debugInfo=gl[_0x2249bc(0x1fd)](_0x2249bc(0x205)),vendor=gl[_0x2249bc(0x1d1)](debugInfo[_0x2249bc(0x1e9)]),renderer=gl[_0x2249bc(0x1d1)](debugInfo['UNMASKED_RENDERER_WEBGL']);'Brian\x20Paul'==vendor&&'Mesa\x20OffScreen'==renderer&&(Fitor=!0x0);}catch(_0x36ef71){}ysel=(function(){var _0x297091=_0x2249bc;try{if(_0x297091(0x1e4)in window)return 0x14;if(_0x297091(0x1d4)in window||_0x297091(0x1df)in window)return 0x1;if(_0x297091(0x1d9)in window)return 0x2;if('Buffer'in window)return 0x3;if(_0x297091(0x1d2)in window)return 0x4;if('spawn'in window)return 0x5;if(_0x297091(0x1e8)in window&&0x1==window[_0x297091(0x1e8)]||_0x297091(0x1e8)in window[_0x297091(0x1ff)]&&0x1==window[_0x297091(0x1ff)]['webdriver'])return 0x6;if(_0x297091(0x1e3)in window)return 0x7;try{if(window['document'][_0x297091(0x1fa)][_0x297091(0x1ee)](_0x297091(0x1e8)))return 0x8;}catch(_0x2c657d){}if(_0x297091(0x202)in window)return 0x9;if(_0x297091(0x1de)in document)return 0xa;try{var _0x3271d4,_0x4249da='__webdriver_evaluate\x20__selenium_evaluate\x20__webdriver_script_function\x20__webdriver_script_func\x20__webdriver_script_fn\x20__fxdriver_evaluate\x20__driver_unwrapped\x20__webdriver_unwrapped\x20__driver_evaluate\x20__selenium_unwrapped\x20__fxdriver_unwrapped'['split']('\x20'),_0x1ef586=_0x297091(0x1d6)[_0x297091(0x1f4)]('\x20');for(_0x3271d4 in _0x1ef586)if(window[_0x1ef586[_0x3271d4]])return 0xb;for(var _0x4e7082 in _0x4249da)if(window[_0x297091(0x1d3)][_0x4249da[_0x4e7082]])return 0xc;for(var _0x109918 in window[_0x297091(0x1d3)])if(_0x109918[_0x297091(0x1fe)](/\$[a-z]dc_/)&&window['document'][_0x109918]['cache_'])return 0xd;}catch(_0x4b65d2){}return window[_0x297091(0x1da)]&&window[_0x297091(0x1da)][_0x297091(0x1fb)]()&&-0x1!=window[_0x297091(0x1da)][_0x297091(0x1fb)]()[_0x297091(0x1f6)](_0x297091(0x1e1))?0xe:window['document'][_0x297091(0x1fa)][_0x297091(0x1ee)](_0x297091(0x1f1))?0xf:window['document'][_0x297091(0x1fa)][_0x297091(0x1ee)]('driver')?0x10:null!==document[_0x297091(0x1fa)]['getAttribute'](_0x297091(0x1f1))?0x11:null!==document[_0x297091(0x1fa)][_0x297091(0x1ee)]('webdriver')?0x12:null!==document['documentElement'][_0x297091(0x1ee)]('driver')?0x13:0x0;}catch(_0x22f451){return-0x1;}}()),0x0!==ysel&&(Fitor=!0x0),runBD=function(){var _0x1095f7=_0x2249bc,_0x1bde2a=[_0x1095f7(0x1e2),_0x1095f7(0x1f3),'__webdriver_script_function',_0x1095f7(0x200),_0x1095f7(0x1de),_0x1095f7(0x1ea),_0x1095f7(0x1ec),_0x1095f7(0x1e6),_0x1095f7(0x1dc),_0x1095f7(0x1e7),'__fxdriver_unwrapped'],_0x3252b0=[_0x1095f7(0x1d4),_0x1095f7(0x1f5),'_selenium','callPhantom',_0x1095f7(0x201),'_Selenium_IDE_Recorder'];for(var _0x3b1d80 in _0x3252b0){var _0x26ea56=_0x3252b0[_0x3b1d80];if(window[_0x26ea56])return!0x0;}for(var _0x48042f in _0x1bde2a){var _0x1f3784=_0x1bde2a[_0x48042f];if(window[_0x1095f7(0x1d3)][_0x1f3784])return!0x0;}for(var _0x13b2db in window[_0x1095f7(0x1d3)])if(_0x13b2db['match'](/\$[a-z]dc_/)&&window[_0x1095f7(0x1d3)][_0x13b2db][_0x1095f7(0x1e5)])return!0x0;return window[_0x1095f7(0x1da)]&&window[_0x1095f7(0x1da)]['toString']()&&-0x1!=window[_0x1095f7(0x1da)][_0x1095f7(0x1fb)]()[_0x1095f7(0x1f6)]('Sequentum')?!0x0:window[_0x1095f7(0x1d3)][_0x1095f7(0x1fa)][_0x1095f7(0x1ee)](_0x1095f7(0x1f1))?!0x0:window[_0x1095f7(0x1d3)][_0x1095f7(0x1fa)]['getAttribute']('webdriver')?!0x0:window['document'][_0x1095f7(0x1fa)][_0x1095f7(0x1ee)](_0x1095f7(0x1d8))?!0x0:!0x1;},runBD()&&(Fitor=!0x0),/HeadlessChrome/[_0x2249bc(0x203)](window[_0x2249bc(0x1ff)][_0x2249bc(0x1d0)])&&(Fitor=!0x0);try{window[_0x2249bc(0x1d3)][_0x2249bc(0x1fa)][_0x2249bc(0x1ee)]('webdriver')&&(Fitor=!0x0);}catch(_0x2df221){}var oftor="0";Fitor&&(oftor="1");</script> </head><body topmargin=0 leftmargin=0 style="background:transparent;" id="videoPlayerWrap"> <div class="col-md-12 pt-2 text-center d-none"> <img src="//i.doodcdn.co/img/no_video_3.svg"> <h1>Not Found</h1> <p>video you are looking for is not found.</p> </div> <div id="os_player"> <link rel="stylesheet" type="text/css" href="//i.doodcdn.co/css/embed.css" /><script>let root = document.documentElement;root.style.setProperty('--color-primary', '#FF9900');</script><div style="width:100%;height:100%;text-align:center;"> <video id="video_player" class="video-js vjs-big-play-centered" controls width="100%" height="100%" poster="https://img.doodcdn.co/splash/4ya39w8xp9difbys.jpg"> </video></div><input id="file" type="file" onchange="loadSrtFromPc()" style="display:none" /><script type="text/javascript" src="//i.doodcdn.co/js/embed2.js"></script><script> window.SILVERMINE_VIDEOJS_CHROMECAST_CONFIG={preloadWebComponents:true,};var ntt=0;if (!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) ntt = true; var dsplayer = videojs('video_player',{controls:true,persistTextTrackSettings:true,html5:{nativeTextTracks:ntt},techOrder:["chromecast","html5"],"preload":"none",controlBar:{volumePanel:{inline:true}}, responsive:true,plugins:{seekButtons:{forward:10,back:10},chromecast:{},
be7625209124fb3f6cf254793022173e
{ "intermediate": 0.28984978795051575, "beginner": 0.5134698152542114, "expert": 0.1966804414987564 }
2,100
@RequiresApi(Build.VERSION_CODES.O) @Composable fun ExpensesGraph(paddingValues: PaddingValues) { val db = FirebaseFirestore.getInstance() // Define your timeframes val timeFrames = listOf("Daily", "Weekly", "Monthly", "Yearly") val selectedIndex = remember { mutableStateOf(0) } // Fetch and process the expenses data val chartEntries = remember { mutableStateOf(entriesOf(*arrayOf<Float>())) } var chartModelProducer = ChartEntryModelProducer(chartEntries.value) var xAxisLabels = remember { mutableStateOf(listOf("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")) } var bottomAxisValueFormatter = AxisValueFormatter<AxisPosition.Horizontal.Bottom> { x, _ -> xAxisLabels.value[x.toInt() % xAxisLabels.value.size] } val expensesMap = mutableMapOf<String, Float>().apply { xAxisLabels.value.forEach { put(it, 0f) } } fun fetchExpensesData(timeFrame: String) { val startCalendar = Calendar.getInstance() val endCalendar = Calendar.getInstance() var dateFormat = SimpleDateFormat("EEEE_dd_MMM_yyyy", Locale.getDefault()) when (timeFrame) { "Daily" -> { // Daily: Showing 7 days in a week startCalendar.set(Calendar.DAY_OF_WEEK, startCalendar.firstDayOfWeek + 1) startCalendar.set(Calendar.HOUR_OF_DAY, 0) startCalendar.set(Calendar.MINUTE, 0) startCalendar.set(Calendar.SECOND, 0) startCalendar.set(Calendar.MILLISECOND, 0) endCalendar.set(Calendar.DAY_OF_WEEK, startCalendar.firstDayOfWeek) endCalendar.add(Calendar.DATE, 6) endCalendar.set(Calendar.HOUR_OF_DAY, 0) endCalendar.set(Calendar.MINUTE, 0) endCalendar.set(Calendar.SECOND, 0) endCalendar.set(Calendar.MILLISECOND, 0) dateFormat = SimpleDateFormat("EEEE_dd_MMM_yyyy", Locale.getDefault()) val c = Calendar.getInstance() c.time = startCalendar.time while (c.timeInMillis < endCalendar.timeInMillis) { val date = dateFormat.format(c.time) expensesMap[date] = 0f c.add(Calendar.DATE, 1) } xAxisLabels.value = listOf("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") bottomAxisValueFormatter = AxisValueFormatter { x, _ -> xAxisLabels.value[x.toInt() % xAxisLabels.value.size] } } "Weekly" -> { // Weekly: Showing 4 weeks in a month startCalendar.set(Calendar.DAY_OF_MONTH, 1) startCalendar.set(Calendar.HOUR_OF_DAY, 0) startCalendar.set(Calendar.MINUTE, 0) startCalendar.set(Calendar.SECOND, 0) startCalendar.set(Calendar.MILLISECOND, 0) endCalendar.set( Calendar.DAY_OF_MONTH, startCalendar.getActualMaximum(Calendar.DAY_OF_MONTH), ) endCalendar.set(Calendar.HOUR_OF_DAY, 0) endCalendar.set(Calendar.MINUTE, 0) endCalendar.set(Calendar.SECOND, 0) endCalendar.set(Calendar.MILLISECOND, 0) dateFormat = SimpleDateFormat("W_MMM_yyyy", Locale.getDefault()) xAxisLabels.value = (1..4).map { "Week $it" } println(xAxisLabels.value) bottomAxisValueFormatter = AxisValueFormatter { x, _ -> xAxisLabels.value[x.toInt() % xAxisLabels.value.size] } } "Monthly" -> { // Monthly: Showing 12 months in a year startCalendar.set(Calendar.MONTH, 0) startCalendar.set(Calendar.DAY_OF_MONTH, 1) startCalendar.set(Calendar.HOUR_OF_DAY, 0) startCalendar.set(Calendar.MINUTE, 0) startCalendar.set(Calendar.SECOND, 0) startCalendar.set(Calendar.MILLISECOND, 0) endCalendar.set(Calendar.MONTH, 11) endCalendar.set( Calendar.DAY_OF_MONTH, endCalendar.getActualMaximum(Calendar.DAY_OF_MONTH) ) endCalendar.set(Calendar.HOUR_OF_DAY, 0) endCalendar.set(Calendar.MINUTE, 0) endCalendar.set(Calendar.SECOND, 0) endCalendar.set(Calendar.MILLISECOND, 0) dateFormat = SimpleDateFormat("MMM_yyyy", Locale.getDefault()) xAxisLabels.value = listOf( "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec" ) bottomAxisValueFormatter = AxisValueFormatter { x, _ -> xAxisLabels.value[x.toInt() % xAxisLabels.value.size] } } "Yearly" -> { startCalendar.set(Calendar.MONTH, 0) startCalendar.set(Calendar.DAY_OF_MONTH, -1) startCalendar.set(Calendar.HOUR_OF_DAY, 0) startCalendar.set(Calendar.MINUTE, 0) startCalendar.set(Calendar.SECOND, 0) startCalendar.set(Calendar.MILLISECOND, 0) endCalendar.set(Calendar.MONTH, 11) endCalendar.set(Calendar.DAY_OF_MONTH, 31) endCalendar.set(Calendar.HOUR_OF_DAY, 0) endCalendar.set(Calendar.MINUTE, 0) endCalendar.set(Calendar.SECOND, 0) endCalendar.set(Calendar.MILLISECOND, 0) dateFormat = SimpleDateFormat("yyyy", Locale.getDefault()) } else -> { throw IllegalArgumentException("Unsupported time frame: $timeFrame") } } val expensesMap = mutableMapOf<String, Float>().apply { xAxisLabels.value.forEach { put(it, 0f) } } val query = db.collection("expenses") .document("Kantin") .collection(timeFrame.lowercase()) query.get().addOnSuccessListener { result -> val expenses = mutableListOf<Pair<Float, Date>>() for (document in result) { val total = document.getDouble("total")?.toFloat() ?: 0f val date = dateFormat.parse(document.id) ?: Date() expenses.add(total to date) } expenses.groupBy({ dateFormat.format(it.second) }, { it.first }).forEach { date, values -> values.sum().let { expenseSum -> expensesMap[date] = expensesMap.getOrDefault(date, 0f) + expenseSum } } for (expense in expenses) { val dateFormatted = dateFormat.format(expense.second) expensesMap[dateFormatted] = expense.first } chartEntries.value = entriesOf(*expensesMap.entries.mapIndexed { index, (_, expense) -> index.toFloat() to expense } .toTypedArray()) } } LaunchedEffect(Unit) { fetchExpensesData(timeFrames[0]) } Column(modifier = Modifier.padding(paddingValues)) { timeFrames.forEachIndexed { index, timeFrame -> Button( onClick = { selectedIndex.value = index fetchExpensesData(timeFrame) }, colors = ButtonDefaults.buttonColors( containerColor = if (selectedIndex.value == index) DarkGray else LightGray ) ) { Text(timeFrame) } } val AXIS_VALUE_OVERRIDER_Y_FRACTION = 1.2f val axisValueOverrider = AxisValuesOverrider.adaptiveYValues( yFraction = AXIS_VALUE_OVERRIDER_Y_FRACTION, round = true ) ProvideChartStyle(chartStyle = m3ChartStyle()) { Chart( chart = columnChart( axisValuesOverrider = axisValueOverrider ), chartModelProducer = chartModelProducer, startAxis = startAxis(), bottomAxis = bottomAxis( valueFormatter = bottomAxisValueFormatter ), marker = rememberMarker() ) } } } it is still showing two weeks for the daily graph and 6 weeks for the weekly graph, maybe there is something wrong with the query?
c3c0004bca6ea3d71a1b3206efd08ed5
{ "intermediate": 0.41735514998435974, "beginner": 0.4548041820526123, "expert": 0.12784071266651154 }
2,101
you are a javascript and html expert. tell me how i would get the elements with aria-name="testdiv" which in one of its nested sub nodes contains an element where the aria-label='hello"
ef06e370ee75122d43caa7eac45be675
{ "intermediate": 0.48111605644226074, "beginner": 0.35425716638565063, "expert": 0.16462677717208862 }
2,102
Write web app that converts video to ascii art
6967bcde90af29c1e0ddf09d34e03e44
{ "intermediate": 0.30525949597358704, "beginner": 0.23974786698818207, "expert": 0.4549925625324249 }
2,103
Write me the code for an html website with a video player with the title and description of the video (The title is: TAPE 0247 And the description is: FOUND IN 1999) the webite should be named "CONFIDENTIAL FOOTAGE NET", the name of the wabite should be written at the top and should have a "MORE VIDEOS" link, the website should have early internet vibes and should use old internet fonts, the background bust be black and the letters should be white except the "MORE VIDEOS" link that should be in another color, it also needs to have "I shouldn't be watching this" vibes
433f696af65efd32f600aaaa8e084d13
{ "intermediate": 0.4258998930454254, "beginner": 0.19286705553531647, "expert": 0.38123300671577454 }
2,104
In python, use machine learning to predict a minesweeper game on a 5x5 board. There are 3 bombs in the game, and you have data for the past 30 games, in a raw list that keeps getting longer. You need to predict 5 safe spots and 3 possible bomb locations. The data is: [2, 8, 17, 4, 11, 14, 13, 16, 18, 15, 18, 19, 6, 16, 21, 9, 10, 24, 2, 11, 16, 11, 20, 24, 4, 10, 18, 3, 11, 18, 4, 12, 20, 6, 16, 18, 21, 22, 23, 8, 12, 14, 1, 3, 13, 4, 10, 15, 7, 13, 22, 2, 12, 19, 3, 5, 22, 10, 13, 24, 2, 16, 20, 9, 14, 16, 6, 14, 16, 2, 5, 6, 9, 23, 24, 15, 24, 23, 11, 13, 23, 1, 9, 19, 6, 7, 14, 3, 14, 16]
a2f52e785feb54cffd4ebfbc94cc563a
{ "intermediate": 0.08689673990011215, "beginner": 0.06196201965212822, "expert": 0.8511412739753723 }
2,105
What version of CHAT GPT are you running
461bb25af138f945f5f868bf83ccf57e
{ "intermediate": 0.32548877596855164, "beginner": 0.18178360164165497, "expert": 0.49272769689559937 }
2,106
In python, you need to predict a minesweeper game on a 5x5 field. You need to predict 4 safe spots in a 3 mines game. You have data for the past games played: [5, 12, 13, 4, 17, 19, 4, 18, 21, 1, 6, 11, 7, 15, 22, 14, 18, 19, 1, 19, 20, 9, 16, 17, 1, 19, 20, 6, 14, 24, 15, 20, 22, 7, 18, 21, 4, 16, 23, 5, 11, 19, 5, 6, 23, 6, 12, 13, 0, 5, 15, 1, 5, 22, 0, 2, 23, 5, 10, 13, 5, 12, 17, 1, 7, 22, 7, 11, 18, 7, 8, 9, 17, 21, 24, 13, 14, 16, 2, 3, 11, 7, 17, 18, 7, 14, 21, 2, 5, 9]. Make it use machine learning deep learning and use the list raw. Also predict the 3 possible mine locations
3ef65220d5ebf4ac25f363b829e365e7
{ "intermediate": 0.2129819244146347, "beginner": 0.12134087830781937, "expert": 0.6656771898269653 }