row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
18,488
const openOrders = useSelector((state: AppState) => state.openOrdersSlice.openOrders[`${selectedSingleApiKey || -1}`]); \\ 32495179801 : {id: '32495179801', symbol: 'DOGEUSDT', type: 'LIMIT', apiKeyId: '2', apiKeyName: 'Test', …} 32495179884 : {id: '32495179884', symbol: 'DOGEUSDT', type: 'LIMIT', apiKeyId: '2', apiKeyName: 'Test', …} 32495179947 : {id: '32495179947', symbol: 'DOGEUSDT', type: 'LIMIT', apiKeyId: '2', apiKeyName: 'Test', …} 32495211879 : {id: 32495211879, symbol: 'DOGEUSDT', type: 'LIMIT', apiKeyId: '2', price: '0.060000', …} 32495211964 : {id: 32495211 где-то есть id строки, а где-то числа, нужно чтобы везде былит строки
054cc65cbf86da89173435b32d2fec72
{ "intermediate": 0.37200191617012024, "beginner": 0.30421051383018494, "expert": 0.3237875699996948 }
18,489
# Load the required library library(tseriesChaos) # Read the CSV file x <- read.csv("C:/Users/whoami/Machine Learning/Training/eu-west-1.csv") # Convert date_hour column to POSIXct format x$date_hour <- as.POSIXct(x$date_hour, format = "%Y-%m-%d %H:%M:%S") # Calculate the neighbourhood diameter eps <- sd(x$price) / 10 # Create a new dataframe with only the price column price_data <- x$price # Take the first 2000 elements of the price data price_data_subset <- price_data[1:2000] # Define parameters m_max <- 10 # Maximum embedding dimension to explore d <- 18 # Tentative time delay tw <- 100 # Theiler window rt <- 10 # Escape factor # Calculate false nearest neighbors for the price subset fn <- false.nearest(price_data_subset, m_max, d, tw, rt, eps) # Print the result print(fn) # Plot the result plot(fn) # Load the required library library(mutualinf) library(scatterplot3d) # Calculate the AMI # Calculate average mutual information for time delay selection lag.max <- 60 # Largest lag ami_result <- mutual(price_data, lag.max=60) # Print the AMI result print(ami_result) # Find the first minimum of the AMI estimated_d <- which.min(ami_result) # Print the estimated time delay cat("Estimated Time Delay (d):", estimated_d, "\n") # Choose embedding dimension (m) and time delay (d) m <- 3 # Embedding dimension d <- estimated_d # Choose the estimated time delay # Embed the 'observed' series xyz <- embedd(price_data_subset, m, d) # Create a scatterplot in 3D windows() scatterplot3d(xyz, type = "l") > ami_result <- mutual(price_data, lag.max=lag.max) Error in mutual(price_data, lag.max = lag.max) : unused argument (lag.max = lag.max)
5b927152d92b1d699d9e70cf52cd309b
{ "intermediate": 0.5149358510971069, "beginner": 0.2410290241241455, "expert": 0.24403518438339233 }
18,490
how to add this extension to gitignore modified: collection-common/collection-common.iml modified: collection-data-access/collection-data-access.iml modified: collection-service/collection-service.iml modified: collection-webservice/src/main/resources/config/application-dev.yml
f1060de62109e69e4dcaaa7be1cc72a4
{ "intermediate": 0.47531870007514954, "beginner": 0.29516416788101196, "expert": 0.22951720654964447 }
18,491
Are you able to locate this publication CIGI Special Report Climate Change in Africa: Adaptation, Mitigation and Governance Challenges
a1ee22a1c2c523a84b6b13ceb971bc76
{ "intermediate": 0.38610440492630005, "beginner": 0.26250171661376953, "expert": 0.3513939380645752 }
18,492
write me a autohotkey script that sends "Hi!" when pressing ALT + !
e5c8715654ac629db57ba7eb0d034849
{ "intermediate": 0.3671528100967407, "beginner": 0.27244213223457336, "expert": 0.3604050278663635 }
18,493
namespace Vending2 { public interface IVendingMachine { string Manufacturer { get; } bool HasProducts { get; } Money Amount { get; } Money InsertCoin(Money amount); Money ReturnMoney(); bool AddProduct(string name, Money price, int count); bool UpdateProduct(int productNumber, string name, Money? price, int amount); } public struct Money { public int Euros { get; set; } public int Cents { get; set; } } public struct Product { public int Available { get; set; } public Money Price { get; set; } public string Name { get; set; } } public class VendingMachine : IVendingMachine { public string Manufacturer { get; } public bool HasProducts => _products.Count > 0; public Money Amount => _Amount; private Money _Amount; private List<Product> _products = new List<Product>(); public VendingMachine(string manufacturer) { Manufacturer = manufacturer; _Amount = new Money(); _products = new List<Product>(); } public Money InsertCoin(Money amount) { if (IsValidCoin(amount)) { _Amount.Euros += amount.Euros; _Amount.Cents += amount.Cents; if (_Amount.Cents >= 100) { _Amount.Euros += _Amount.Cents / 100; _Amount.Cents = _Amount.Cents % 100; } return new Money(); } else { return amount; } //Console.WriteLine($"{_Amount}"); } public Money ReturnMoney() { Money returnAmount = _Amount; _Amount = new Money(); return returnAmount; } public bool AddProduct(string name, Money price, int count) { if (string.IsNullOrEmpty(name) || price.Euros < 0 || price.Cents < 0 || count < 0) { return false; } Product existingProduct = _products.Find(product => product.Name == name); if (existingProduct.Name != null) { existingProduct.Available += count; } else { _products.Add(new Product { Name = name, Price = price, Available = count }); } return true; } public bool UpdateProduct(int productNumber, string name, Money? price, int amount) { if (productNumber < 1 || productNumber > _products.Count || string.IsNullOrEmpty(name) || price.HasValue && (price.Value.Euros < 0 || price.Value.Cents < 0) || amount < 0) { return false; } Product product = _products[productNumber - 1]; product.Name = name; if (price.HasValue) { product.Price = price.Value; } product.Available = amount; return true; } public IEnumerable<Product> GetProducts() { return _products; } private bool IsValidCoin(Money money) { return money.Euros == 0 && (money.Cents == 10 || money.Cents == 20 || money.Cents == 50) || money.Euros == 1 && (money.Cents == 0 || money.Cents == 2) || money.Euros == 2 && (money.Cents == 0); } } internal class Program { static void Main(string[] args) { VendingMachine vendingMachine = new VendingMachine("Company"); vendingMachine.AddProduct("Product 1", new Money { Euros = 2, Cents = 0 }, 5); vendingMachine.AddProduct("Product 2", new Money { Euros = 1, Cents = 50 }, 3); vendingMachine.AddProduct("Product 3", new Money { Euros = 0, Cents = 20 }, 10); Money coin1 = new Money { Euros = 0, Cents = 20 }; Money coin2 = new Money { Euros = 1, Cents = 0 }; Money coin3 = new Money { Euros = 2, Cents = 0 }; Money returnedAmount1 = vendingMachine.InsertCoin(coin1); Money returnedAmount2 = vendingMachine.InsertCoin(coin2); Money returnedAmount3 = vendingMachine.InsertCoin(coin3); Money moneyInVendingMachine = vendingMachine.ReturnMoney(); vendingMachine.UpdateProduct(2, "Uptated product", new Money { Euros = 0, Cents = 30 }, 8); vendingMachine.AddProduct("Product 4", new Money { Euros = 2, Cents = 20 }, 3); Console.WriteLine($"Amount in vending machine: {vendingMachine.Amount.Euros}.{vendingMachine.Amount.Cents:D2}"); foreach (var product in vendingMachine.GetProducts()) { Console.WriteLine($"Product: {product.Name}," + $" Price: {product.Price.Euros}.{product.Price.Cents:D2}, Available: {product.Available}"); } Console.WriteLine($"Money to return: {moneyInVendingMachine.Euros}.{moneyInVendingMachine.Cents:D2}"); } } } ... Code above don't update products. Line in Main : vendingMachine.UpdateProduct(2, "Uptated product", new Money { Euros = 0, Cents = 30 }, 8); doesn't work. Can You fix it?
a70dea43cb4da1de7ab59758289d26a7
{ "intermediate": 0.36530357599258423, "beginner": 0.47919318079948425, "expert": 0.1555032581090927 }
18,494
hi, i have 1 rp2040 klipper microcontroller with a i2c display on it showing the klipper menu. also i have 2 esp32 microcontrollers, both are connected with espnow. i want to use 1 esp32 microcontroller to take the information from the rp2040 klipper microcontroller, without changing any code on the rp2040 (no source) and receive and transfer the i2c display data to the second esp32 and show the data on a display there.
fb496d868d137d917fcd01fe41e3aca2
{ "intermediate": 0.4409637749195099, "beginner": 0.2542567849159241, "expert": 0.30477941036224365 }
18,495
implement code for list.insert() function c++
384874670517a2332c985d3559ac0d70
{ "intermediate": 0.36433902382850647, "beginner": 0.31981271505355835, "expert": 0.3158482313156128 }
18,496
import pygame pygame.init() width = 1280 height = 720 win = pygame.display.set_mode((width, height)) pygame.display.set_caption("gun_game") player_image = pygame.image.load("sprites/shapa++.png") bg = pygame.image.load("sprites/bg.jpg") enemy_image = pygame.image.load("sprites/enemy.png") hp = pygame.image.load("sprites/hp.png") player_rect = player_image.get_rect() player_rect.x = 50 player_rect.y = 50 player_speed = 5 enemy_rect = enemy_image.get_rect() enemy_rect.x = 500 enemy_rect.y = 500 enemy_speed = 2 x_hp = -100 y_hp = 10 lives = 5000000000000000000000000000000000 clock = pygame.time.Clock() run = True while run: clock.tick(60) for event in pygame.event.get(): if event.type == pygame.QUIT: run = False keys = pygame.key.get_pressed() if keys[pygame.K_LEFT] and player_rect.x > 0: player_rect.x -= player_speed elif keys[pygame.K_RIGHT] and player_rect.x < win.get_width() - player_rect.width: player_rect.x += player_speed elif keys[pygame.K_UP] and player_rect.y > 0: player_rect.y -= player_speed elif keys[pygame.K_DOWN] and player_rect.y < win.get_height() - player_rect.height: player_rect.y += player_speed if player_rect.colliderect(enemy_rect): lives -= 1 if player_rect.x < enemy_rect.x: enemy_rect.x -= enemy_speed elif player_rect.x > enemy_rect.x: enemy_rect.x += enemy_speed if player_rect.y < enemy_rect.y: enemy_rect.y -= enemy_speed elif player_rect.y > enemy_rect.y: enemy_rect.y += enemy_speed if lives <= 0: run = False win.blit(bg, (0, 0)) win.blit(player_image, player_rect) win.blit(enemy_image, enemy_rect) win.blit(hp, (x_hp, y_hp)) pygame.display.update() pygame.quit() как сделать чтобы hp уменьшалось на экране?
1526f2a42a304f31c6d98e44d2415ac1
{ "intermediate": 0.41825681924819946, "beginner": 0.31859081983566284, "expert": 0.2631523907184601 }
18,497
у меня есть такой код: у меня такой код: async update(req, res) { try { const user = await User.findOne({where: { username: { [Op.iLike]: %${req.params.username} } }}) if (!user) return ApiError.badRequest(‘Пользователь не найден.’) if (req.user.is_admin || req.user.id == user.id) { await user.update() return res.json({status: ‘успешно’}) } ApiError.forbidden(‘Нет доступа’) } catch { ApiError.internal(‘Не удалось обновить пользователя.’) } } как мне подключить multer к моему backend?
0e0fc9e25b1d8224aad0774a01905ee8
{ "intermediate": 0.4679047465324402, "beginner": 0.2913915514945984, "expert": 0.24070371687412262 }
18,498
Convert this C++ code to Nim :
27708b189954ec61345787032b6a61a5
{ "intermediate": 0.43299242854118347, "beginner": 0.29673823714256287, "expert": 0.27026936411857605 }
18,499
CREATE DATABASE HorseRacingDB; USE HorseRacingDB; CREATE TABLE Horses ( HorseID INT NOT NULL AUTO_INCREMENT, HorseName VARCHAR(100), Age INT, Gender ENUM("Male", "Female"), Breed VARCHAR(50), OwnerID INT, PRIMARY KEY (HorseID), FOREIGN KEY (OwnerID) REFERENCES Owners (OwnerID) ); CREATE TABLE Owners ( OwnerID INT NOT NULL AUTO_INCREMENT, OwnerName VARCHAR(100), ContactNumber VARCHAR(10), PRIMARY KEY (OwnerID) ); CREATE TABLE Jockeys ( JockeyID INT NOT NULL AUTO_INCREMENT, JockeyName VARCHAR(100), Rating DECIMAL(3,1), PRIMARY KEY (JockeyID) ); CREATE TABLE Races ( RaceID INT NOT NULL AUTO_INCREMENT, RaceDate DATE, RaceName VARCHAR(100), Location VARCHAR(100), PRIMARY KEY (RaceID) ); CREATE TABLE Results ( ResultID INT NOT NULL AUTO_INCREMENT, RaceID INT, Position ENUM("I", "II", "III"), JockeyID INT, HorseID INT, CompletionTime TIME, PRIMARY KEY (ResultID), FOREIGN KEY (RaceID) REFERENCES Races (RaceID), FOREIGN KEY (JockeyID) REFERENCES Jockeys (JockeyID), FOREIGN KEY (HorseID) REFERENCES Horses (HorseID) ); How to create Jockeys data entry/edit forms in C#
245f9a4775b19605d71c6cafddf0097f
{ "intermediate": 0.48431745171546936, "beginner": 0.21453644335269928, "expert": 0.30114609003067017 }
18,500
Can you write me a program in Arduino for 22 WS2812 Leds with an flame effect with normal flame colors but also with green/yellow collors. I want to switch between these 2 with a button.
2e0ca761c0a2dc814efcd76a8c4d428a
{ "intermediate": 0.44859442114830017, "beginner": 0.21373140811920166, "expert": 0.3376741409301758 }
18,501
Can you write an arduino script which simulates fire with WS2812, 22 LED, I do not want the color white in it
1e3481c1144dbc2dd2302708db7759e5
{ "intermediate": 0.4582297205924988, "beginner": 0.2270595133304596, "expert": 0.314710795879364 }
18,502
Can you write an Arduino program that simulates a flame effect using a strip of 22 WS2812 LEDs LED1 = base of the flame and LED22 = top of the flame, similar ro … The program includes three flame modes: normal fire color (Mode A), green/yellow flame with more green than yellow (Mode B), and blue/white flame (Mode C). You can toggle between A, B and C by pressing a button.
9d4ec3a0c55c24070b2719a2235f0f33
{ "intermediate": 0.4773451089859009, "beginner": 0.19803045690059662, "expert": 0.3246243894100189 }
18,503
I have a list of working experience with start year and end year. there is some overlap between work experience. use python to write a function to find the gap between work history.
54f8b709667d7fba9f5c699c7f411eb6
{ "intermediate": 0.31931072473526, "beginner": 0.3631361722946167, "expert": 0.31755316257476807 }
18,504
Can you write an Arduino program that simulates a flame effect using a strip of 22 WS2812 LEDs LED1 = base of the flame and LED22 = top of the flame, similar to fire2012withpalette from the FastLed library. The program should include three flame modes: normal fire color (Mode A), green/yellow flame with more green than yellow (Mode B), and blue/white flame (Mode C). You can toggle between A, B and C by pressing a button.
cb40d9b5ce7541a76b1427117d77838f
{ "intermediate": 0.5529627203941345, "beginner": 0.19328463077545166, "expert": 0.2537526488304138 }
18,505
--------------------------------------------------------------------------- LookupError Traceback (most recent call last) Cell In[5], line 1 ----> 1 find_sim(62857) Cell In[4], line 67, in find_sim(open_inquiry_id) 64 open_inq_clean_text = clean_text_result['clean_text'] 66 if open_inq_clean_text != None: ---> 67 open_inq_text = word_tokenize(open_inq_clean_text) 68 open_inq_vector = rec_model.infer_vector(open_inq_text) 69 id_tuple = rec_model.dv.most_similar(open_inq_vector, topn = len(rec_model.dv.vectors)) File ~\AppData\Roaming\Python\Python310\site-packages\nltk\tokenize\__init__.py:129, in word_tokenize(text, language, preserve_line) 114 def word_tokenize(text, language="english", preserve_line=False): 115 """ 116 Return a tokenized copy of *text*, 117 using NLTK's recommended word tokenizer (...) 127 :type preserve_line: bool 128 """ --> 129 sentences = [text] if preserve_line else sent_tokenize(text, language) 130 return [ 131 token for sent in sentences for token in _treebank_word_tokenizer.tokenize(sent) 132 ] ... - 'D:\\nltk_data' - 'E:\\nltk_data' - '' **********************************************************************
799d5f865f8c7c73883a0d2254aeccfe
{ "intermediate": 0.38290226459503174, "beginner": 0.289365291595459, "expert": 0.3277324438095093 }
18,506
this.$refs.cropper.getCroppedCanvas().toDataURL() приводит к строке base64 png, как приводить к base64 jpg?
6bb62569657caedca80eba6b36f024ea
{ "intermediate": 0.524524450302124, "beginner": 0.3016885817050934, "expert": 0.1737869381904602 }
18,507
Can you write an Arduino program that simulates a flame effect using a strip of 22 WS2812 LEDs LED1 = base of the flame and LED22 = top of the flame, similar to fire2012 from the Arduino FastLed library. The program should include three flame modes: normal fire color (Mode A), green/yellow flame with more green than yellow (Mode B), and blue/white flame (Mode C). You can toggle between A, B and C by pressing a button.
741ae5e7b5d7dd2d99d2cc6a35df5ade
{ "intermediate": 0.5801553130149841, "beginner": 0.15936946868896484, "expert": 0.26047518849372864 }
18,508
1. Project setup: a. Create a new Spring Boot project using your preferred IDE. b. Add the necessary dependencies for Spring Boot, Hibernate, Couchbase, Elasticsearch, Kibana, Redis, and unit testing frameworks. 2. Design the database structure and product entity: a. Determine the attributes necessary for the product catalog, such as name, description, price, availability, etc. b. Use Hibernate to map the product entity to the product table in the Couchbase database. 3. Implement CRUD operations for product management: a. Design API endpoints for creating, reading, updating, and deleting products. b. Implement the necessary logic to perform CRUD operations on product records in the Couchbase database using Hibernate. I am at 3. Implement CRUD operations for product management: please elaborate it I need to add those api endpoints - Create an API endpoint for updating a product by its ID. (PUT /products/{id}) - Create an API endpoint for deleting a product by its ID. (DELETE /products/{id} my productcontroller: @RestController @RequestMapping("/products") public class ProductController { @Autowired private ProductService productService; // Create a product @PostMapping public ResponseEntity<Product> createProduct(@RequestBody Product product) { Product createdProduct = productService.createProduct(product); return ResponseEntity.status(HttpStatus.CREATED).body(createdProduct); } // Get a product by its ID @GetMapping("/{id}") public ResponseEntity<Product> getProductById(@PathVariable("id") String id) { Product product = productService.getProductById(id); if (product != null) { return ResponseEntity.ok(product); } else { return ResponseEntity.notFound().build(); } } }
9fde9df4222b3c48838a1b7dc90e5528
{ "intermediate": 0.7989119291305542, "beginner": 0.10243537276983261, "expert": 0.09865264594554901 }
18,509
> model <- keras_model_sequential() Error: Valid installation of TensorFlow not found. Python environments searched for 'tensorflow' package: C:\Users\whoami\Documents\.virtualenvs\r-reticulate\Scripts\python.exe Python exception encountered: Traceback (most recent call last): File "C:\Users\whoami\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook return _run_hook(name, _hook) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\whoami\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook module = hook() ^^^^^^ File "C:\Users\whoami\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook return _find_and_load(name, import_) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'tensorflow' You can install TensorFlow using the install_tensorflow() function.
0e84e4a44dce72a1b5e7f898ffa5c3be
{ "intermediate": 0.38114091753959656, "beginner": 0.17473635077476501, "expert": 0.44412267208099365 }
18,510
right a login backend for a website on django
73184df7843e9b40dba81c0bf204d33f
{ "intermediate": 0.4257647693157196, "beginner": 0.2609047293663025, "expert": 0.31333044171333313 }
18,511
how to save each dataframe in one sheet of csv file
d76c227d948f250ddc4ee8d8e85f0e41
{ "intermediate": 0.3409697413444519, "beginner": 0.28656089305877686, "expert": 0.37246936559677124 }
18,512
what kind of data structures need to be used for saving game parameters in unreal engine?
bfd045d4f4aef3547ad68f99e621bb43
{ "intermediate": 0.4765097200870514, "beginner": 0.14887236058712006, "expert": 0.37461790442466736 }
18,513
I used this code: url = "https://contract.mexc.com//api/v1/private/account/asset/USDT" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } params = { "currency": "USDT" } response = requests.get(url, headers=headers, params=params) if response.status_code == 200: data = response.json() currency = data["data"]["currency"] position_margin = data["data"]["positionMargin"] frozen_balance = data["data"]["frozenBalance"] available_balance = data["data"]["availableBalance"] cash_balance = data["data"]["cashBalance"] equity = data["data"]["equity"] print("Currency:", currency) print("Position Margin:", position_margin) print("Frozen Balance:", frozen_balance) print("Available Balance:", available_balance) print("Cash Balance:", cash_balance) print("Equity:", equity) else: print("Error:", response.json()["message"]) But termianl doesn't return me my MEXC futures balance , it returning me: Error: No authority!
756f415000e052f5a69d9fc7f80218b2
{ "intermediate": 0.42757654190063477, "beginner": 0.30443552136421204, "expert": 0.2679879069328308 }
18,514
Write some sample text in Java script.
e67b22f1a96f3d1bff300acd28f15aff
{ "intermediate": 0.3103015124797821, "beginner": 0.37162575125694275, "expert": 0.31807273626327515 }
18,515
const routes = [ { path: '/', component: () => import('layouts/MainLayout.vue'), children: [ { path: '', component: () => import('pages/IndexPage.vue') }, {path: '/BaseProjects', component: () => import('pages/BaseProjects/BaseProjectList.vue')}, {path: '/PkgProjects', component: () => import('pages/PkgProjects/PkgProjectList.vue')}, {path: '/PkgProjectsDetail',component: () => import('pages/PkgProjects/PkgProjectDetail.vue'), props: route => ({ pkgProjectID: route.query.p_id,default_SKU_id: route.query.c_id }), noShake: true }, {path: '/PkgComboDetail',component: () => import('pages/PkgProjects/PkgComboDetail.vue'), props: route => ({ pkgProjectSkuID: route.query.p_id,default_COMBO_id: route.query.c_id }), noShake: true }, {path: '/PkgTestDetail',component: () => import('pages/PkgProjects/PkgTestDetail.vue'), props: route => ({ pkgProjectComboID: route.query.p_id,default_TEST_id: route.query.c_id }), noShake: true }, // {path: '/pkgType', component: () => import('pages/PkgProjects/pkgTypeList.vue')}, // {path: '/pkgProjectTest', component: () => import('pages/PkgProjects/pkgProjectTestList.vue')}, // {path: '/pkgTestType', component: () => import('pages/PkgProjects/pkgTestTypeList.vue')}, // {path: '/pkgItem', component: () => import('pages/PkgProjects/pkgItemList.vue')}, ] }, {path: '/TestProjects', component: () => import('pages/TestProjects/TestProjectList.vue')}, { path: '/Tests', component: () => import('src/pages/Tests/TestLayout.vue'), children: [ { path: '', component: () => import('pages/Tests/TestHomePage.vue') }, { path: 'test_001', component: () => import('pages/Tests/test_component.vue') }, { path: 'defineComponent', component: () => import('pages/Tests/test_defineComponent.vue') }, { path: 'layout_in_dialog', component: () => import('src/pages/Tests/modules/LayoutInDialog.vue') }, ] }, // Always leave this as last one, // but you can also remove it { path: '/:catchAll(.*)*', component: () => import('pages/ErrorNotFound.vue') }, ] export default routes testprojects的路径应该是怎样的
0c9612dccc9139b6c107f0451485f202
{ "intermediate": 0.24648728966712952, "beginner": 0.427169531583786, "expert": 0.3263431489467621 }
18,516
How does xcb detect rendering completion
9618fa2f92f68bc30cb9c22e0b672686
{ "intermediate": 0.2818993926048279, "beginner": 0.1370084136724472, "expert": 0.5810922384262085 }
18,517
create table name(name varchar(30)) insert into name values ('Ibragimovich') select * from name --1. cut name from first 'i' till end on mysql
cffe89ad7e2b5d150024c32cd81a071b
{ "intermediate": 0.3798709511756897, "beginner": 0.26829415559768677, "expert": 0.3518349230289459 }
18,518
hello
82c8966f9d2ddb000b75de897d314501
{ "intermediate": 0.32064199447631836, "beginner": 0.28176039457321167, "expert": 0.39759764075279236 }
18,519
Known issue: In yaml file, application/json is only covered by a subset of successful responses. how to resolve it?
205da9aa352adc0e9c8a11ef14d150f1
{ "intermediate": 0.41618961095809937, "beginner": 0.310845285654068, "expert": 0.27296507358551025 }
18,520
what does the keyword static mean for variables in C?
b3e0136d4e1905813d93d6da4fe1b1b6
{ "intermediate": 0.09858078509569168, "beginner": 0.8060806393623352, "expert": 0.0953386127948761 }
18,521
How to know if findOneAndUpdate worked?
37c532ebe8d52cbd27c929b6a2f1f96f
{ "intermediate": 0.39266741275787354, "beginner": 0.11898308992385864, "expert": 0.4883494973182678 }
18,522
which cause CString memory leak
838637feb5e582419d795c43c213f762
{ "intermediate": 0.3512258529663086, "beginner": 0.4027577340602875, "expert": 0.24601636826992035 }
18,523
For Minecraft Forge mod making for Minecraft 1.7.10, how do you use the OreDictionary when registering a crafting recipe?
47fc3d223f158110d0b107e87d812c82
{ "intermediate": 0.6162353157997131, "beginner": 0.21352620422840118, "expert": 0.17023850977420807 }
18,524
Translate this JSON RFC8259 format from english to thailand language. DO NOT translate the key, only provide a RFC8259 compliant JSON response { “nav1”:“Overview”, “nav2”:“Flash News”, “nav3”:“Research”, “nav4”:“Academy”, “nav5”:“Column”, “nav6”:“Community Index”, “nav7”:“Launch Space”, “USER_TOOLTIP”:“My Account”, “LOGIN”:“Login”, “LOGOUT”:“Logout”, “HOME_PAGE”:“Home Page”, “REGISTER”:“Register”, “USERNAME”:“Username”, “EMAIL”:“Email”, “PASSWORD”:“Password”, “CONFIRM_PASSWORD”:“Confirm Password”, “PASSWORD_HELPER_TEXT”:“At least 8-15 digits, including digits and alphabets.”, “NEW_ACCOUNT?”:"Have you created an account yet? ", “REGISTER_NOW”:“Register Now”, “REGISTERED_SUCCESSFULLY”:“Registered Successfully”, “ACCOUNT_ACTIVATION_MESSAGE”:“Go to your email to activate your account and explore the world of blockchain today”, “EMAIL_VERIFICATION_MESSAGE_1”:“We have sent a verification link to the following email address.”, “EMAIL_VERIFICATION_MESSAGE_2”:“Didn’t get the verification link? Try sending the verification link again.”, “SEND_LINK_AGAIN”:“Send verification link again”, “PLEASE_WAIT”:“Please Wait”, “EMAIL_SUCCESS_MESSAGE”:“Successfully sent verification link!”, “SECONDS”:“Seconds”, “LOGIN_TO”:“Login To”, “NEW_USER_REGISTRATION”:“New User Registration”, “INVITATION_CODE”:“Invitation code”, “OPTIONAL”:“Optional”, “DISCLAIMER_TEXT_1”:"Please read these ", “TERMS_AND_CONDITIONS”:"Terms and Conditions ", “DISCLAIMER_TEXT_2”:"carefully before using and/or registering on this website. ", “DISCLAIMER_TEXT_3”:“By accessing, using or linking to this website or any mobile version thereof, you acknowledge that you have read, understood and agreed to be bound by these terms and conditions.”, “DISCORD_TITLE_MESSAGE”:“Discover Web 3.0’s Crypto Community Journey”, “DISCORD_SUBTITLE_MESSAGE”:“Create your own decentralized identity”, “JOIN”:“Join”, “COMMUNITY”:“Community”, “LOADING”:“Loading”, “FLASH_COLUMN_THEME_TITLE”:“Flash News”, “FOCUS”:“Spotlight”, “MORE_FLASH”:“More Flash”, “COMMUNITY_ACTIVITIES”:“Community Activities”, “POPULAR_TAGS”:“Popular Tags”, “sub_nav0”:“Focus”, “sub_nav1”:“Web 3”, “sub_nav2”:“Blockchain”, “sub_nav3”:“GameFi”, “sub_nav4”:“DeFi”, “sub_nav5”:“NFT”, “sub_nav6”:“DAO”, “sub_nav7”:“Bitcoin”, “sub_nav8”:“Ethereum”, “sub_nav9”:“Exchange”, “sub_nav10”:“Policy”, “sub_nav11”:“Metaverse”, “sub_nav12”:“Investment Analysis”, “sub_nav13”:“Market Report”, “sub_nav14”:“Market Analysis”, “sub_nav15”:“Getting Started”, “sub_nav16”:“Popular Currencies”, “sub_nav17”:“Project Analysis”, “CREATED_AT”:“Created At”, “SELF_INTRO_TEXT”:“Add a self intro”, “REVIEWED”:“Verified”, “NOT_REVIEWED”:“not Verified”, “LEVEL”:“Level”, “MEDAL”:“Medal”, “INVITE_FRIENDS”:“Invite Friends”, “RANKING”:“Ranking”, “CURRENT_RANKING”:“Current Ranking”, “NOT_RANKED”:“Not Ranked”, “EDIT_PROFILE”:“Edit Profile”, “AVATAR_AND_COVER”:“Avatar and Cover”, “VISIBILITY”:“Privacy”, “PUBLIC”:“Public”, “PRIVATE”:“Private”, “DONE”:“Done”, “BIO”:“Bio”, “SAVED”:“Saved Articles”, “RECOMMENDATION”:“Recommendation”, “ACTIVITY”:“Activity”, “FOLLOWING”:“Following”, “FOLLOWING_MEDIA”:“Following Media”, “FEEDBACK”:“Feedback”, “NO_CONTENT”:“No Content”, “SUCCESSFUL_RECOMMENDATION”:“Successful Recommendation”, “REGISTRATION_TIME”:“Registration Time”, “REFERRAL_CODE”:“Referral Code”, “LEADERBOARD”:“Leaderboard”, “INVITED”:“Invited”, “TOTAL_PERCENT”:“Total Percent”, “MORE”:“More”, “使用者名稱或密碼錯誤”:“Wrong Username or Password”, “此郵箱已被註冊”:“The email address has been registered.”, “PASSWORDS_DONT_MATCH”:“The two passwords you entered do not match, please try again.”, “ACKNOWLEDGE_TERMS_AND_CONDITIONS”:“Please read and acknowledge the terms and conditions first.”, “ID_COPIED”:“ID copied!”, “RECOMMENDATION_LINK_COPIED”:“Recommended link has been copied”, “COMING_SOON”:“Coming Soon” }
868b341505b2b1b75f69a762c3cc0a84
{ "intermediate": 0.24111659824848175, "beginner": 0.5596550703048706, "expert": 0.19922828674316406 }
18,525
How is hibernate.cfg.xml for sqlite supposed to look like?
c953c568cb7461c867736d12248205c5
{ "intermediate": 0.45584923028945923, "beginner": 0.27461403608322144, "expert": 0.2695367634296417 }
18,526
import pandas as pd import numpy as np import csv import datetime df = pd.read_csv("W33_new.csv") # Replace Fail to recall and recall to late with empty strings df['Posted Round Attribution Strategy'] = df['Posted Round Attribution Strategy'].replace('[Machine] A. Fail to Recall', '') df['Posted Round Attribution Strategy'] = df['Posted Round Attribution Strategy'].replace('[Machine] C. Recall too Late', '') #Coverting int cloumns into Str so that it can be stopped converting into scentific notation df['ad_id']=df['ad_id'].astype(str) df['advertiser_id']=df['advertiser_id'].astype(str) df['agent_account_id']=df['agent_account_id'].astype(str) df['organization_id']=df['organization_id'].astype(str) df['mix_task_id']=df['mix_task_id'].astype(str) #df['Posted Round Attribution Strategy']=df['Posted Round Attribution Strategy'].astype(str) #df['1st Round Attribution Strategy']=df['1st Round Attribution Strategy'].astype(str) #Function to convert NSS & SS columns def NSS(row): if '0' in row: return 'Non Self Serve' else: return 'Self Serve' # Convert data type of the coulmn df['is_self_serve']=df['is_self_serve'].astype(str) # Apply function on the column df['is_self_serve'] = df['is_self_serve'].apply(NSS) # Group by mix_task_id so that duplicate task id as can merged into one entry grouped = df.copy(deep=True) def first_clean(sheet): mix_task_id = [] first_strategy = [] count = 0 for index, row in sheet.iterrows(): a = row[0] b = row[1] if a in mix_task_id: first_strategy[count - 1] = first_strategy[count - 1] + ", " + b else: mix_task_id.append(a) first_strategy.append(b) count = count + 1 df1 = pd.DataFrame([mix_task_id, first_strategy]).transpose() df1.columns = ['mix_task_id', '1st Round Attribution Strategy'] df1 = df1.dropna() return df1 cleaned_first = first_clean(grouped)
5d5cd054738f49c847011dbff00ec6c9
{ "intermediate": 0.3927195966243744, "beginner": 0.3590558171272278, "expert": 0.24822451174259186 }
18,527
cd /home/user/NetBeansProjects/MathenoHibernate; JAVA_HOME=/app/jdk /app/netbeans/java/maven/bin/mvn -Dexec.vmArgs= "-Dexec.args=${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}" -Dexec.executable=/app/jdk/bin/java -Dexec.mainClass=com.mycompany.mathenohibernate.ClientCode -Dexec.classpathScope=runtime -Dexec.appArgs= process-classes org.codehaus.mojo:exec-maven-plugin:3.1.0:exec Scanning for projects... -------------------< com.mycompany:MathenoHibernate >------------------- Building MathenoHibernate 1.0-SNAPSHOT from pom.xml --------------------------------[ jar ]--------------------------------- --- resources:3.3.0:resources (default-resources) @ MathenoHibernate --- Copying 1 resource --- compiler:3.10.1:compile (default-compile) @ MathenoHibernate --- Nothing to compile - all classes are up to date --- exec:3.1.0:exec (default-cli) @ MathenoHibernate --- Hello World! Aug. 25, 2023 1:36:33 A.M. org.hibernate.Version logVersion INFO: HHH000412: Hibernate ORM core version 6.2.7.Final Aug. 25, 2023 1:36:34 A.M. org.hibernate.cfg.Environment <clinit> INFO: HHH000406: Using bytecode reflection optimizer Aug. 25, 2023 1:36:35 A.M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure WARN: HHH10001002: Using built-in connection pool (not intended for production use) Aug. 25, 2023 1:36:35 A.M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001005: Loaded JDBC driver class: org.sqlite.JDBC Aug. 25, 2023 1:36:35 A.M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001012: Connecting with JDBC URL [jdbc:sqlite:mydatabaseyo.sqlite] Aug. 25, 2023 1:36:35 A.M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001001: Connection properties: {} Aug. 25, 2023 1:36:35 A.M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001003: Autocommit mode: false Aug. 25, 2023 1:36:35 A.M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init> INFO: HHH10001115: Connection pool size: 20 (min=1) Aug. 25, 2023 1:36:36 A.M. org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator initiateService WARN: HHH000342: Could not obtain connection to query metadata org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.SQLiteDialect] as strategy [org.hibernate.dialect.Dialect] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:154) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:236) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:189) at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:123) at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:86) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:224) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:34) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119) at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216) at org.hibernate.boot.model.relational.Database.<init>(Database.java:45) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:230) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:198) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:166) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:125) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:451) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:102) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:910) at com.mycompany.mathenohibernate.HibernateUtil.<clinit>(HibernateUtil.java:26) at com.mycompany.mathenohibernate.ClientCode.main(ClientCode.java:17) Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.dialect.SQLiteDialect] at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:123) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:150) ... 20 more Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.dialect.SQLiteDialect at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:215) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:120) ... 21 more Caused by: java.lang.Throwable at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:208) ... 26 more Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.SQLiteDialect at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:205) ... 26 more Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.SQLiteDialect at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:205) ... 26 more Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.SQLiteDialect at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:205) ... 26 more org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [org.hibernate.dialect.SQLiteDialect] as strategy [org.hibernate.dialect.Dialect] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:277) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216) at org.hibernate.boot.model.relational.Database.<init>(Database.java:45) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:230) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:198) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:166) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:125) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:451) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:102) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:910) at com.mycompany.mathenohibernate.HibernateUtil.<clinit>(HibernateUtil.java:26) at com.mycompany.mathenohibernate.ClientCode.main(ClientCode.java:17) Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.SQLiteDialect] as strategy [org.hibernate.dialect.Dialect] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:154) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:236) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:189) at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:123) at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:86) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:274) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:34) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119) at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264) ... 12 more Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.dialect.SQLiteDialect] at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:123) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:150) ... 20 more Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.dialect.SQLiteDialect at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:215) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:120) ... 21 more Caused by: java.lang.Throwable at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:208) ... 26 more Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.SQLiteDialect at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:205) ... 26 more Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.SQLiteDialect at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:205) ... 26 more Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.SQLiteDialect at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:205) ... 26 more ------------------------------------------------------------------------ BUILD SUCCESS ------------------------------------------------------------------------ Total time: 5.557 s Finished at: 2023-08-25T01:36:36-04:00 ------------------------------------------------
9b4391dc1d2ced25c107c05768d892b5
{ "intermediate": 0.29283928871154785, "beginner": 0.506171464920044, "expert": 0.2009892463684082 }
18,528
I'd like to port Blitz3D's TFormVector function in Ogre 1.7. The function is described as: TFORMVECTOR(FLOAT X,FLOAT Y,FLOAT Z, SOURCE_ENTITY,DEST_ENTITY) x, y, z = components of a vector in 3d space source_entity = handle of source entity, or 0 for 3d world dest_entity = handle of destination entity, or 0 for 3d world Description Transforms between coordinate systems. After using TFormVector the new components can be read with TFormedX(), TFormedY() and TFormedZ(). For example if: source is at 1,1,1 and orientation is 0,90,90 dest is at 0,0,0 and orientation is 0,90,90 If the TFormVector xyz is at 0,1,0 the result is 0,1,0 BUT if dest rotation is at 0,0,0 the result is 0,0,-1 Do you get how the computation works?
4dd7abf0b5b4b5858801022bc2c07e66
{ "intermediate": 0.5669476985931396, "beginner": 0.1899482160806656, "expert": 0.24310413002967834 }
18,529
Please, write java code for this API request: curl --location 'https://mobile.bsb.by/api/v1/free-zone-management/exchange-rates/rates' \ --header 'Content-Type: application/json' \ --header 'Cookie: sessioncookie=177c37730412a56748f8352e18991a24f22b3a2f4323d472445ff9450330af664335b2f7c077fe8e577f8c12f0f39da0' \ --data '{ "type": "NATIONAL_BANK_BELARUS", "period": 1692356172000 }
7a04d97c6a0705a1076afa72ac5fb362
{ "intermediate": 0.7220532894134521, "beginner": 0.13333642482757568, "expert": 0.1446102410554886 }
18,530
I would like a VBA code to do the following. In my open workbook 'Service Providers', click a link in my spreadsheet that will, capture all the data from cells J5 downwards from a closed external workbook 'Service Providers History' and from it's worksheet of the same name from where the click that activated the VBA originated. The data will be pasted into a new text document with each cell data on a seperate line and when I close the text document it is not saved.
9f5e1886def42e3ed5f3947a7f5968e9
{ "intermediate": 0.6277437210083008, "beginner": 0.14774422347545624, "expert": 0.22451207041740417 }
18,531
I'd like to port Blitz3D's TFormVector function in Ogre 1.7. The function is described as: TFORMVECTOR(FLOAT X,FLOAT Y,FLOAT Z, SOURCE_ENTITY,DEST_ENTITY) x, y, z = components of a vector in 3d space source_entity = handle of source entity, or 0 for 3d world dest_entity = handle of destination entity, or 0 for 3d world Description Transforms between coordinate systems. After using TFormVector the new components can be read with TFormedX(), TFormedY() and TFormedZ(). Use Case 1: Given the source position (1, 1, 1) with an orientation of (0, 90, 90), and the destination position (0, 0, 0) with an orientation of (0, 90, 90), when the TFormVector(0, 1, 0) command is applied, the expected result is (0, 1, 0). Use Case 2: Given the source position (1, 1, 1) with an orientation of (0, 90, 90), and the destination position (0, 0, 0) with an orientation of (0, 0, 0), when the TFormVector(0, 1, 0) command is applied, the expected result is (0, 0, -1).
2c4364a7cc96a0f1ef86bc4ebf106f0b
{ "intermediate": 0.3761078715324402, "beginner": 0.313982218503952, "expert": 0.3099098801612854 }
18,532
how to create type in typescript that prevent to use same name value in nested object example structure { x: { name: "mattew" } } i mean in this example mattew cant be value in name again
40688bdd26eb33caa426f4bb8ab26a81
{ "intermediate": 0.5096157193183899, "beginner": 0.2269284427165985, "expert": 0.2634558379650116 }
18,533
setOpenOrdersIds((prev: OpenOrdersByIds) => { if (!prev[symbol]?.some((order) => order.overlayId === overlay)) { const newOrder = {id: id.toString(), overlayId: overlay}; console.log(newOrder); return {...prev, [symbol]: [...(prev[symbol] ?? []), newOrder]}; } else { return prev; } }); какие могут быть ошибки в этом коде, newOrder не всегда добавляется. Проанализируй setOpenOrdersIds и отредактируй
4a800541cc4b375a45481074e9a71428
{ "intermediate": 0.34931108355522156, "beginner": 0.42150697112083435, "expert": 0.22918196022510529 }
18,534
I'd like to port Blitz3D's TFormVector function in Ogre 1.7. The function is described as: TFORMVECTOR(FLOAT X,FLOAT Y,FLOAT Z, SOURCE_ENTITY,DEST_ENTITY) x, y, z = components of a vector in 3d space source_entity = handle of source entity, or 0 for 3d world dest_entity = handle of destination entity, or 0 for 3d world Description Transforms between coordinate systems. After using TFormVector the new components can be read with TFormedX(), TFormedY() and TFormedZ(). Use Case 1: Given the source position (1, 1, 1) with an orientation of (0, 90, 90), and the destination position (0, 0, 0) with an orientation of (0, 90, 90), when the TFormVector(0, 1, 0) command is applied, the expected result is (0, 1, 0). Use Case 2: Given the source position (1, 1, 1) with an orientation of (0, 90, 90), and the destination position (0, 0, 0) with an orientation of (0, 0, 0), when the TFormVector(0, 1, 0) command is applied, the expected result is (0, 0, -1). Use these two sets of use case values directly and not using scenenodes
938b0b4695007a425d07806f8f1a12ad
{ "intermediate": 0.41881096363067627, "beginner": 0.27596181631088257, "expert": 0.30522724986076355 }
18,535
привет помоги с рефакторингом кода для Unity [SerializeField] private Image currentstateBike; [SerializeField] private Sprite stateBikeSitting; [SerializeField] private Sprite stateBikeStanding; private void Update() { if (Input.GetKeyDown(KeyCode.Keypad5)) { if (currentstateBike.sprite == stateBikeStanding) { currentstateBike.sprite = stateBikeSitting; } else { currentstateBike.sprite = stateBikeStanding; } } }
a7e4f6e9ae023c4823af125a00e4019f
{ "intermediate": 0.418540894985199, "beginner": 0.31134623289108276, "expert": 0.27011290192604065 }
18,536
In JIRA CLOUD, with the help of a filter and Enhanced Search, i want a JQL request that returns all test tickets from a test execution, in order to use it into a dashboard
a9ce61d79bb69a8c408dd54ea0b7e1ba
{ "intermediate": 0.5768385529518127, "beginner": 0.17327521741390228, "expert": 0.24988624453544617 }
18,537
interface OpenOrders { id: string; overlayId: string; } export interface OpenOrdersByIds { [key: string]: OpenOrders[]; } export interface AccountOpenOrder { apiKeyId: string; apiKeyName: string; id: string; symbol: string; type: string; price: number; quantity: number; side: string; status: string; } export const CandleChart = ({ symbolName,}: CandleChartProps) => { const chart = useRef<Chart|null>(null); const paneId = useRef<string>(""); const [openOrdersIds, setOpenOrdersIds] = useState<OpenOrdersByIds>({}); const openOrders = useSelector((state: AppState) => state.openOrdersSlice.openOrders[`${selectedSingleApiKey || -1}`]); // Record<string, Record<string, AccountOpenOrder>>; useEffect(() => { if(!openOrdersIds) return; Object.keys(openOrdersIds).forEach(key => { if (key !== symbolName) { openOrdersIds[key].forEach(overlay => { chart.current?.removeOverlay({ id: overlay.overlayId, }); }); const updatedOpenOrders = {...openOrdersIds}; delete updatedOpenOrders[key]; setOpenOrdersIds(updatedOpenOrders); } }); }, [symbolName]); return (<> { showOpenOrders && openOrders && kline && Object.values(openOrders).map((order) => { if(order.symbol === symbolName) { if(openOrdersIds && openOrdersIds[order.symbol]) { if (openOrdersIds[order.symbol].some(o => o.id === order.id.toString())) { return null; } else { return <DrawOpenOrders key={order.id} chart={chart} paneId={paneId} settingOpenOrder={{ id: order.id, symbol: order.symbol, price: order.price, side: order.side, quantity: order.quantity, }} priceClose={kline.close} openOrdersIds={openOrdersIds} setOpenOrdersIds={setOpenOrdersIds} cancelOpenOrderHandle={cancelOpenOrderHandle} />; } } else { return <DrawOpenOrders key={order.id} chart={chart} paneId={paneId} settingOpenOrder={{ id: order.id, symbol: order.symbol, price: order.price, side: order.side, quantity: order.quantity, }} priceClose={kline.close} openOrdersIds={openOrdersIds} setOpenOrdersIds={setOpenOrdersIds} cancelOpenOrderHandle={cancelOpenOrderHandle} />; } } }) } </>); }; const DrawOpenOrders = ( { chart, paneId, settingOpenOrder, priceClose, openOrdersIds, setOpenOrdersIds, cancelOpenOrderHandle, }: DrawOpenOrdersProps) => { const {id, price, quantity, side, symbol} = settingOpenOrder; createOverlayHandler(); const createOverlayHandler = () => { const overlay = chart.current?.createOverlay({ name: "customOverlay", if (overlay) { setOpenOrdersIds((prev: OpenOrdersByIds) => { const symbolOrders = prev[symbol] || []; const orderExists = symbolOrders.some((order) => order.overlayId === overlay); if (!orderExists) { const newOrder = {id: id.toString(), overlayId: overlay}; const updatedSymbolOrders = [...symbolOrders, newOrder]; return {...prev, [symbol]: updatedSymbolOrders}; } else { return prev; } }); } }; }; export default DrawOpenOrders; есть такое сощдание фигуры и добавления в setOpenOrdersIds. openOrders из redux приходят ордера, они появляются и исчезают, если появляются, то они рисуются в компоненте DrawOpenOrders, если исчезают, то нужно удалять из openOrdersIds
902ffc2ed74bf21a3681edc9c1e7d361
{ "intermediate": 0.28288620710372925, "beginner": 0.6116246581077576, "expert": 0.10548918694257736 }
18,538
I'd like to port Blitz3D's TFormVector function in Ogre 1.7. The function is described as: TFORMVECTOR(FLOAT X,FLOAT Y,FLOAT Z, SOURCE_ENTITY,DEST_ENTITY) x, y, z = components of a vector in 3d space source_entity = handle of source entity, or 0 for 3d world dest_entity = handle of destination entity, or 0 for 3d world Description Transforms between coordinate systems. After using TFormVector the new components can be read with TFormedX(), TFormedY() and TFormedZ(). Orientation is only needed for this computation, regardless of position: As an example: -5,-15,25 for source and 0,0,0 for dest The TFormVector applied is 0,0,1 and result should be: 0.2578, 0.0715, 0.96225
8987a15865052f52e06f1a5de44d657d
{ "intermediate": 0.41171514987945557, "beginner": 0.27925556898117065, "expert": 0.3090292811393738 }
18,539
design me a esp32 arduino program using espnow to interconnect two esp32 microcontrollers interconnecting both in a way that all i2c, spi and gpio are interconnected as if there is only 1 microcontroller, making i2c, spi and gpio wireless
b465a411d4339239771c77845dfd9ac0
{ "intermediate": 0.4725801646709442, "beginner": 0.11309884488582611, "expert": 0.41432100534439087 }
18,540
design me a esp32 arduino program using espnow to interconnect two esp32 microcontrollers interconnecting both in a way that all i2c, spi and gpio are interconnected as if there is only 1 microcontroller, making all connected devices like i2c screens and push buttons and rotary encoder inputs, i2c, spi and gpio wireless. this will make a wireless controller with screen, buttons and rotary encoder as transmitter and a esp32 connected to a device that you want to controll with this wireless controller.
80ff2a9c94ce468c28c9775a829362fb
{ "intermediate": 0.4470013678073883, "beginner": 0.21893571317195892, "expert": 0.3340629041194916 }
18,541
design me a esp32 program that uses 2 esp32 microcontrollers connected trough espnow working as one esp32 capable of full gpio and i2c input/output wireless bridge that acts as if there is only 1 microcontroller connected to peripherals. Structure the code in a way that i have a place where i can put any example program from arduino exeamples library and run it. This gives me wireless i2c and gpio function
6cb3e8046b2e7022f0974b2ec0b521f7
{ "intermediate": 0.5386858582496643, "beginner": 0.20347368717193604, "expert": 0.25784051418304443 }
18,542
how to implement singleton with shared_ptr in c++ 11
6892fd5cc163145cfe04e1d2de5878d6
{ "intermediate": 0.4620507061481476, "beginner": 0.16304568946361542, "expert": 0.3749036192893982 }
18,543
# Load the required library library(e1071) # Read the CSV file x <- read.csv("C:/Users/whoami/Machine Learning/Training/eu-west-1.csv") # Convert date_hour column to POSIXct format x$date_hour <- as.POSIXct(x$date_hour, format = "%Y-%m-%d %H:%M:%S") # Create a new dataframe with only the price column price_data <- x$price # Take the first 2000 elements of the price data price_data_subset <- price_data[1:4000] # Prepare the data for SVM n <- length(price_data_subset) train_size <- 3000 # Split data into training and testing sets train_data <- price_data_subset[1:train_size] test_data <- price_data_subset[(train_size + 1):n] # Build an SVM model svm_model <- svm(train_data ~ seq_along(train_data), data = data.frame(train_data = train_data)) # Predict using the SVM model svm_predictions <- predict(svm_model, newdata = data.frame(seq_along(train_data) = (train_size + 1):n)) # Calculate Mean Squared Error mse <- mean((svm_predictions - test_data)^2) cat("Mean Squared Error:", mse, "\n") # Plot results plot(seq_along(price_data_subset), price_data_subset, type = "l", col = "blue", xlab = "Index", ylab = "Price") lines(seq_along(test_data) + train_size, svm_predictions, col = "red") legend("topright", legend = c("Actual", "Predicted"), col = c("blue", "red"), lty = 1) Error: unexpected '=' in "svm_predictions <- predict(svm_model, newdata = data.frame(seq_along(train_data) ="
d7963b4f18a82e6248b3ac0644c75815
{ "intermediate": 0.7007572650909424, "beginner": 0.1163828894495964, "expert": 0.18285983800888062 }
18,544
Create me a arduino esp32 program with hardware interupt functions for handling GPIO, I2C, SPI input and output with coresponding buffers, use espnow to transfer the buffers so two esp32 microcontrollers can use the same GPIO, I2C, SPI input and output
471268456c0e642cdd7efc0edb26ac34
{ "intermediate": 0.6487833857536316, "beginner": 0.15720945596694946, "expert": 0.19400714337825775 }
18,545
Abstract Objectives This study aimed to evaluate the temporal changes in the drug regimens and cost in older adults with diabetes in China. Study Design A retrospective, observational and multi-center research was performed to estimate the temporal changes in the drug regimens and cost in older adults with diabetes in China over three years. Methods Patients included in Beijing Medical Insurance Database with medical records from 2016 to 2018 were analyzed in this research as described before. Primary and secondary outcomes include the numbers of medications and comorbidities, the estimated annual drug regimen cost, the treatment strategies for elderly diabetic patients, and the prescribed classes of drugs. Statistical analysis was performed by SAS software, version 9.4 (SAS Institute, Inc). Results Data including 598,440 patients in 2018 revealed 49.8% of the recruited patients were females in the elderly and 47.5% in the young patients (<65 years old). The most common comorbidity analyzed in this project was hypertension (87.6%). Over three years, there were about 4.51 medications, including 1.88 antiglycemic drugs and 2.63 non-antiglycemic drugs prescribed in the elderly and 4.19 medications including 1.97 antiglycemic drugs and 2.22 non-antiglycemic drugs in young patients. Hypertension (¥4658, 2.12 for the elderly and ¥4639, 2.05 for young patients), Dyslipidemia (¥5044, 1.70 and ¥4990, 1.71), and coronary heart disease (¥4004, 1.40; ¥4181, 1.45) were the top three diseases that cause the increase in the cost and medications. Over the three years, more than 94% of the elderly diabetic patients and 94.6% of young patients received at least one kind of antiglycemic drug. Conclusions According to the results in this research, there is no big difference in cost between older diabetic patients and young diabetic patients, which is not consistent with other published data. However, the medication regimens that meet the guidelines are different between the elderly and the young patients. The current treatment and management of diabetic patients are critical. 根据如上,设计一张Graphical Abstract Image
2489a4345a39cbfd424603a996b70766
{ "intermediate": 0.32740718126296997, "beginner": 0.4263528883457184, "expert": 0.24623994529247284 }
18,546
Provided Grok expressions do not match field value: [2023-08-25 06:17:32 172.19.125.203 POST /UAT_SMS_ARKAFINECAP/AdvancePayment/EmployeeReimbursement/GetGridDataForSettlementHistory - 443 admin 172.19.100.158 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/116.0.0.0+Safari/537.36 https://sit.osourceglobal.com/UAT_SMS_ARKAFINECAP/AdvancePayment/AdvancePaymentApproval 404 0 0 4321 3114 502 14.143.43.170] how do I parse this log file
ce164a9ea2cba234d827368d7f490fa8
{ "intermediate": 0.5817650556564331, "beginner": 0.2695571482181549, "expert": 0.1486777812242508 }
18,547
how do I parse log file Grok expressions
29f4f205e7b56fbf5ca92aa0a9856191
{ "intermediate": 0.4715832769870758, "beginner": 0.26559019088745117, "expert": 0.262826532125473 }
18,548
confirmClone() { const inputTitle = this.$t('propmt.clone.input').toString() const promptTitle = this.$t('propmt.clone.title').toString() this.$prompt(inputTitle, promptTitle, { confirmButtonText: this.$t('confirmation.clone').toString(), cancelButtonText: this.$t('btns.cancel').toString(), inputValue: this.set.name + '-copy' }).then((data: any) => { const { id } = this.set SetModule.cloneSet({ id, name: data.value }) }) } Как переписать на vue 3,
a3620c95e4bbfdc97cd7814251253967
{ "intermediate": 0.36750707030296326, "beginner": 0.33329498767852783, "expert": 0.2991980016231537 }
18,549
Make ttt game made with html, Before players play they must choose Multiplayer or Solo Game play, if chosen is Multiplayer each player must Enter Their name If there is someone player won then display in the screen congratulations player <name> you won the game. If chosen solo, Enter the player name and one of his opponents is an ai and make a move after the first player already taps one of the boxes to make a code that ai can tap or choose one of the boxes. Add a design on Multiplayer button and Solo botton, add a font in it (fantasy) and the button have color green to fit it's design. Thank you brother 😁,
4f498fd2a7b9ae6ecbab1e3be7c1e952
{ "intermediate": 0.43287286162376404, "beginner": 0.22581122815608978, "expert": 0.34131595492362976 }
18,550
Create me a arduino esp32 program with hardware interupt functions for handling GPIO, I2C, SPI input and output with coresponding buffers, use espnow to transfer the buffers so two esp32 microcontrollers can use the same GPIO, I2C, SPI input and output
eab271f123e28fdf0c6c40da86bc5d92
{ "intermediate": 0.6487833857536316, "beginner": 0.15720945596694946, "expert": 0.19400714337825775 }
18,551
Make ttt game made with html, Before players play they must choose Multiplayer or Solo Game play, if chosen is Multiplayer each player must Enter Their name If there is someone player won then display in the screen congratulations player <name> you won the game. If chosen solo, Enter the player name and one of his opponents is an ai and make a move after the first player already taps one of the boxes to make a code that ai can tap or choose one of the boxes. Add a design on Multiplayer button and Solo botton, add a font in it (fantasy) and the button have color green to fit it's design. Thank you brother 😁Change the box's size to make it equal. Add design on boxes you can choose randomly. And fix solo game play the ai wont work properly.
15549610e3224aca8cf7163f111b8b79
{ "intermediate": 0.3479181230068207, "beginner": 0.25631359219551086, "expert": 0.39576834440231323 }
18,552
Hi! Can you write me a Flutter class that will provide API to work with Shared Preferences package and also it should use injectable
93b759607ac82838da75626148b67836
{ "intermediate": 0.8471992015838623, "beginner": 0.09685556590557098, "expert": 0.055945225059986115 }
18,553
can you check the following code for errors? #include <esp_now.h> #include <pgmspace.h> // Define the slave address used for I2C communication #define SLAVE_ADDRESS 0x10 // Define the SPI pins #define I2C_SDA_PIN 4 // Example I2C SDA pin #define I2C_SCL_PIN 5 // Example I2C SCL pin #define SPI_CS_PIN 15 // Example SPI Chip Select pin #define SPI_MISO_PIN 19 // Example SPI MISO pin #define SPI_MOSI_PIN 23 // Example SPI MOSI pin #define SPI_CLK_PIN 18 // Example SPI CLK pin // Define the GPIO pins #define GPIO_PIN1 4 #define GPIO_PIN2 16 // Define the number of bytes in the buffers #define BUFFER_SIZE 32 unsigned char gpioBuffer[BUFFER_SIZE]; unsigned char i2cBuffer[BUFFER_SIZE]; unsigned char spiBuffer[BUFFER_SIZE]; // Define all program info and versioning identifiers into rom const static char pname[] PROGMEM = "Klipper Controller.\n"; const static char author[] PROGMEM = "Marcel Hofstra.\n"; const static char version[] PROGMEM = "Klipper Controller, ESP32 controller V1.0 Beta.\n"; const static char serial[] PROGMEM = "202325081346v1b\n"; // Define the buffer for GPIO inputs/outputs uint8_t gpioBuffer[2]; // Define the buffer for I2C inputs/outputs uint8_t i2cBuffer[BUFFER_SIZE]; // Define the buffer for SPI inputs/outputs uint8_t spiBuffer[BUFFER_SIZE]; // Declare the interrupt handler functions void IRAM_ATTR gpioInterrupt1(); void IRAM_ATTR gpioInterrupt2(); // Define the threshold for ESPNow reliability const int RESEND_THRESHOLD = 3; // Define the structure that holds the ESPNow data typedef struct attribute((packed)) { uint8_t retryCount; uint8_t buffer[BUFFER_SIZE]; } EspNowData; // Define the callback function for ESPNow message reception void OnDataRecv(const uint8_t* macAddr, const uint8_t* data, int dataLen) { // Check the data length and MAC address if (dataLen != sizeof(EspNowData) || macAddr == NULL) { return; } EspNowData* recvData = (EspNowData*)data; // Process the received buffer // Buffer type can be determined by the sender and receiver // For example, if ‘bufferType’ is 1, it’s the GPIO buffer // If ‘bufferType’ is 2, it’s the I2C buffer, and so on… int bufferType = recvData->buffer[0]; switch (bufferType) { case 1: // GPIO buffer memcpy(gpioBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; case 2: // I2C buffer memcpy(i2cBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; case 3: // SPI buffer memcpy(spiBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; default: break; } } void setup() { // Initialize GPIO pins as inputs pinMode(GPIO_PIN1, INPUT); pinMode(GPIO_PIN2, INPUT); // Initialize Interrupt Service Routines (ISRs) attachInterrupt(digitalPinToInterrupt(GPIO_INT_PIN1), gpioInterrupt1, CHANGE); attachInterrupt(digitalPinToInterrupt(GPIO_INT_PIN2), gpioInterrupt2, CHANGE); // Initialize I2C interface with hardware interrupt Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN); Wire.onReceive(i2cInterruptHandler); // Initialize SPI interface with hardware interrupt SPI.begin(SPI_CLK_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, SPI_CS_PIN); SPI.usingInterrupt(digitalPinToInterrupt(SPI_CLK_PIN)); attachInterrupt(digitalPinToInterrupt(SPI_CLK_PIN), spiInterruptHandler, RISING); // Initialize ESP-NOW WiFi.mode(WIFI_STA); if (esp_now_init() != ESP_OK) { // Handle ESP-NOW initialization error } // Register ESP-NOW send callback function esp_now_register_send_cb(sendData); // Register ESP-NOW receive callback function esp_now_register_recv_cb(receiveData); } } void loop() { // Check if there is any data in the buffers to be sent // Buffer type can be changed accordingly (1: GPIO, 2: I2C, 3: SPI) if (gpioBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 1; // Buffer type memcpy(data.buffer + 1, gpioBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } if (i2cBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 2; // Buffer type memcpy(data.buffer + 1, i2cBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } if (spiBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 3; // Buffer type memcpy(data.buffer + 1, spiBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } delay(1000); } // Callback function for handling I2C interrupt void IRAM_ATTR i2cInterruptHandler() { // Add your I2C interrupt code here } // Callback function for handling SPI interrupt void IRAM_ATTR spiInterruptHandler() { // Add your SPI interrupt code here } // GPIO Interrupt handlers void IRAM_ATTR gpioInterrupt1() { // Read the state of GPIO pin 1 and update the gpioBuffer accordingly gpioBuffer[0] = digitalRead(GPIO_PIN1); gpioBuffer[1] = 0; // Placeholder for any other GPIO pin(s) } void IRAM_ATTR gpioInterrupt2() { // Read the state of GPIO pin 2 and update the gpioBuffer accordingly gpioBuffer[1] = digitalRead(GPIO_PIN2); gpioBuffer[0] = 0; // Placeholder for any other GPIO pin(s) } // Check if there is any data in the GPIO buffer bool gpioBufferHasData() { for (int i = 0; i < 2; i++) { if (gpioBuffer[i] != 0) { return true; } } return false; } // Check if there is any data in the I2C buffer bool i2cBufferHasData() { // Check the corresponding condition for I2C buffer data presence // For example, if using an I2C sensor and i2cBuffer as output // Return true if i2cBuffer[0] != 0; return false; } // Check if there is any data in the SPI buffer bool spiBufferHasData() { // Check the corresponding condition for SPI buffer data presence // For example, if using SPI module and spiBuffer as output // Return true if spiBuffer[0] != 0; return false; } // Function to send data over ESP-NOW void sendData(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { esp_err_t result = esp_now_send(macAddress, buffer, size); // Handle error (if any) } // Function to receive data over ESP-NOW void receiveData(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { // Handle received data here }
266f4275d85fee0fd47991b3df250b0c
{ "intermediate": 0.20485472679138184, "beginner": 0.5639577507972717, "expert": 0.23118753731250763 }
18,554
use flutter fill image on one page
38040843c1a1e298f3fb8b0255d8b7de
{ "intermediate": 0.3689571022987366, "beginner": 0.2893886864185333, "expert": 0.3416541814804077 }
18,555
can you check the code below for errors? #include <esp_now.h> #include <Wire.h> #include <ESP32SPISlave.h> #include <SPI.h> ESP32SPISlave slave; // Define the slave address used for I2C communication #define SLAVE_ADDRESS 0x10 // Define the SPI pins #define I2C_SDA_PIN 4 // Example I2C SDA pin #define I2C_SCL_PIN 5 // Example I2C SCL pin #define SPI_CS_PIN 15 // Example SPI Chip Select pin #define SPI_MISO_PIN 19 // Example SPI MISO pin #define SPI_MOSI_PIN 23 // Example SPI MOSI pin #define SPI_CLK_PIN 18 // Example SPI CLK pin // Define the GPIO pins #define GPIO_PIN1 4 #define GPIO_PIN2 16 // Define the number of bytes in the buffers #define BUFFER_SIZE 32 unsigned char gpioBuffer[BUFFER_SIZE]; unsigned char i2cBuffer[BUFFER_SIZE]; unsigned char spiBuffer[BUFFER_SIZE]; // Define all program info and versioning identifiers into rom const static char pname[] = "Klipper Controller.\n"; const static char author[] = "Marcel Hofstra.\n"; const static char version[] = "Klipper Controller, ESP32 controller V1.0 Beta.\n"; const static char serial[] = "202325081346v1b\n"; // Define the buffer for GPIO inputs/outputs //uint8_t gpioBuffer[2]; // Define the buffer for I2C inputs/outputs //uint8_t i2cBuffer[BUFFER_SIZE]; // Define the buffer for SPI inputs/outputs //uint8_t spiBuffer[BUFFER_SIZE]; // Declare the interrupt handler functions void IRAM_ATTR gpioInterrupt1(); void IRAM_ATTR gpioInterrupt2(); void IRAM_ATTR i2cInterruptHandler(); void IRAM_ATTR spiInterruptHandler(); // Define the threshold for ESPNow reliability const int RESEND_THRESHOLD = 3; // Define the structure that holds the ESPNow data typedef struct __attribute__((__packed__)) { uint8_t retryCount; uint8_t buffer[BUFFER_SIZE]; } EspNowData; // Define the callback function for ESPNow message reception void OnDataRecv(const uint8_t* macAddr, const uint8_t* data, int dataLen) { // Check the data length and MAC address if (dataLen != sizeof(EspNowData) || macAddr == NULL) { return; } EspNowData* recvData = (EspNowData*)data; // Process the received buffer // Buffer type can be determined by the sender and receiver // For example, if ‘bufferType’ is 1, it’s the GPIO buffer // If ‘bufferType’ is 2, it’s the I2C buffer, and so on… int bufferType = recvData->buffer[0]; switch (bufferType) { case 1: // GPIO buffer memcpy(gpioBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; case 2: // I2C buffer memcpy(i2cBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; case 3: // SPI buffer memcpy(spiBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; default: break; } } void setup() { // Initialize GPIO pins as inputs pinMode(GPIO_PIN1, INPUT); pinMode(GPIO_PIN2, INPUT); // Initialize Interrupt Service Routines (ISRs) attachInterrupt(digitalPinToInterrupt(GPIO_PIN1), gpioInterrupt1, CHANGE); attachInterrupt(digitalPinToInterrupt(GPIO_PIN2), gpioInterrupt2, CHANGE); // Initialize I2C interface with hardware interrupt Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN); Wire.onReceive(i2cInterruptHandler); // Initialize SPI interface with hardware interrupt SPI.begin(SPI_CLK_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, SPI_CS_PIN); SPI.usingInterrupt(digitalPinToInterrupt(SPI_CLK_PIN)); attachInterrupt(digitalPinToInterrupt(SPI_CLK_PIN), spiInterruptHandler, RISING); // Initialize ESP-NOW WiFi.mode(WIFI_STA); if (esp_now_init() != ESP_OK) { // Handle ESP-NOW initialization error } // Register ESP-NOW send callback function esp_now_register_send_cb(sendData); // Register ESP-NOW receive callback function esp_now_register_recv_cb(receiveData); } void loop() { // Check if there is any data in the buffers to be sent // Buffer type can be changed accordingly (1: GPIO, 2: I2C, 3: SPI) if (gpioBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 1; // Buffer type memcpy(data.buffer + 1, gpioBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } if (i2cBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 2; // Buffer type memcpy(data.buffer + 1, i2cBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } if (spiBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 3; // Buffer type memcpy(data.buffer + 1, spiBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } delay(1000); } // Callback function for handling I2C interrupt void IRAM_ATTR i2cInterruptHandler() { // Add your I2C interrupt code here } // Callback function for handling SPI interrupt void IRAM_ATTR spiInterruptHandler() { // Add your SPI interrupt code here } // GPIO Interrupt handlers void IRAM_ATTR gpioInterrupt1() { // Read the state of GPIO pin 1 and update the gpioBuffer accordingly gpioBuffer[0] = digitalRead(GPIO_PIN1); gpioBuffer[1] = 0; // Placeholder for any other GPIO pin(s) } void IRAM_ATTR gpioInterrupt2() { // Read the state of GPIO pin 2 and update the gpioBuffer accordingly gpioBuffer[1] = digitalRead(GPIO_PIN2); gpioBuffer[0] = 0; // Placeholder for any other GPIO pin(s) } // Check if there is any data in the GPIO buffer bool gpioBufferHasData() { for (int i = 0; i < 2; i++) { if (gpioBuffer[i] != 0) { return true; } } return false; } // Check if there is any data in the I2C buffer bool i2cBufferHasData() { // Check the corresponding condition for I2C buffer data presence // For example, if using an I2C sensor and i2cBuffer as output // Return true if i2cBuffer[0] != 0; return false; } // Check if there is any data in the SPI buffer bool spiBufferHasData() { // Check the corresponding condition for SPI buffer data presence // For example, if using SPI module and spiBuffer as output // Return true if spiBuffer[0] != 0; return false; } // Function to send data over ESP-NOW void sendData(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { esp_err_t result = esp_now_send(macAddress, buffer, size); // Handle error (if any) } // Function to receive data over ESP-NOW void receiveData(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { // Handle received data here }
fdac5a2bc2e08f9f7ee58a3db153a0ae
{ "intermediate": 0.4172469973564148, "beginner": 0.3083636462688446, "expert": 0.2743893265724182 }
18,556
_positions.length == 1 "ScrollController attached to multiple scroll views."
108c08f23203da9facf646a783482a55
{ "intermediate": 0.4270566999912262, "beginner": 0.24891377985477448, "expert": 0.32402947545051575 }
18,557
как в tkinter убрать белую рамку по краям image = ImageTk.PhotoImage(image) canvas = tk.Canvas(window, width=width, height=height) canvas.pack(side="top", fill="both") canvas.create_image(0, 0, anchor="nw", image=image) canvas["background"] = "white" window.title("Тест") window.geometry("800x800") window["background"] = "white"
2547ca1a53778231fe17d931d0af7b5a
{ "intermediate": 0.4016757011413574, "beginner": 0.193028062582016, "expert": 0.4052962064743042 }
18,558
reload page flutter
6837df26aca94533ef81cdf21eb606bd
{ "intermediate": 0.28765326738357544, "beginner": 0.36018213629722595, "expert": 0.3521645665168762 }
18,559
i have errors in my code, can you help? Errors: In function 'void setup()': 114:18: error: invalid conversion from 'void (*)()' to 'void (*)(int)' [-fpermissive] Wire.onReceive(i2cInterruptHandler); ^~~~~~~~~~~~~~~~~~~ In file included from 2: C:\Users\izanamie\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire\src/Wire.h:157:21: note: initializing argument 1 of 'void TwoWire::onReceive(void (*)(int))' void onReceive( void (*)(int) ); ^~~~~~~~~~~~~ 118:7: error: 'class SPIClass' has no member named 'usingInterrupt' SPI.usingInterrupt(digitalPinToInterrupt(SPI_CLK_PIN)); ^~~~~~~~~~~~~~ 128:28: error: invalid conversion from 'void (*)(const uint8_t*, const uint8_t*, size_t)' {aka 'void (*)(const unsigned char*, const unsigned char*, unsigned int)'} to 'esp_now_send_cb_t' {aka 'void (*)(const unsigned char*, esp_now_send_status_t)'} [-fpermissive] esp_now_register_send_cb(sendBufferToSlave); ^~~~~~~~~~~~~~~~~ In file included from 1: C:\Users\izanamie\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32/include/esp_wifi/include/esp_now.h:157:54: note: initializing argument 1 of 'esp_err_t esp_now_register_send_cb(esp_now_send_cb_t)' esp_err_t esp_now_register_send_cb(esp_now_send_cb_t cb); ~~~~~~~~~~~~~~~~~~^~ 131:28: error: invalid conversion from 'void (*)(const uint8_t*, const uint8_t*, size_t)' {aka 'void (*)(const unsigned char*, const unsigned char*, unsigned int)'} to 'esp_now_recv_cb_t' {aka 'void (*)(const unsigned char*, const unsigned char*, int)'} [-fpermissive] esp_now_register_recv_cb(receiveBufferFromSlave); ^~~~~~~~~~~~~~~~~~~~~~ In file included from 1: C:\Users\izanamie\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32/include/esp_wifi/include/esp_now.h:136:54: note: initializing argument 1 of 'esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t)' esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb); ~~~~~~~~~~~~~~~~~~^~ In function 'void i2cInterruptHandler()': 150:23: error: cannot convert 'EspNowData' to 'const uint8_t*' {aka 'const unsigned char*'} sendBufferToSlave(data); ^~~~ 47:39: note: initializing argument 1 of 'void sendBufferToSlave(const uint8_t*, const uint8_t*, size_t)' void sendBufferToSlave(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { ~~~~~~~~~~~~~~~^~~~~~~~~~ In function 'void spiInterruptHandler()': 164:23: error: cannot convert 'EspNowData' to 'const uint8_t*' {aka 'const unsigned char*'} sendBufferToSlave(data); ^~~~ 47:39: note: initializing argument 1 of 'void sendBufferToSlave(const uint8_t*, const uint8_t*, size_t)' void sendBufferToSlave(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { ~~~~~~~~~~~~~~~^~~~~~~~~~ In function 'void gpioInterrupt1()': 180:23: error: cannot convert 'EspNowData' to 'const uint8_t*' {aka 'const unsigned char*'} sendBufferToSlave(data); ^~~~ 47:39: note: initializing argument 1 of 'void sendBufferToSlave(const uint8_t*, const uint8_t*, size_t)' void sendBufferToSlave(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { ~~~~~~~~~~~~~~~^~~~~~~~~~ In function 'void gpioInterrupt2()': 198:23: error: cannot convert 'EspNowData' to 'const uint8_t*' {aka 'const unsigned char*'} sendBufferToSlave(data); ^~~~ 47:39: note: initializing argument 1 of 'void sendBufferToSlave(const uint8_t*, const uint8_t*, size_t)' void sendBufferToSlave(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { ~~~~~~~~~~~~~~~^~~~~~~~~~ exit status 1 Compilation error: invalid conversion from 'void (*)()' to 'void (*)(int)' [-fpermissive] Code: #include <esp_now.h> #include <Wire.h> #include <ESP32SPISlave.h> #include <SPI.h> #include <WiFi.h> #include <WiFiClient.h> ESP32SPISlave slave; // Define the slave address used for I2C communication #define SLAVE_ADDRESS 0x10 // Define the SPI pins #define I2C_SDA_PIN 4 // Example I2C SDA pin #define I2C_SCL_PIN 5 // Example I2C SCL pin #define SPI_CS_PIN 15 // Example SPI Chip Select pin #define SPI_MISO_PIN 19 // Example SPI MISO pin #define SPI_MOSI_PIN 23 // Example SPI MOSI pin #define SPI_CLK_PIN 18 // Example SPI CLK pin // Define the GPIO pins #define GPIO_PIN1 4 #define GPIO_PIN2 16 // Define the number of bytes in the buffers #define BUFFER_SIZE 32 unsigned char gpioBuffer[BUFFER_SIZE]; unsigned char i2cBuffer[BUFFER_SIZE]; unsigned char spiBuffer[BUFFER_SIZE]; // Define all program info and versioning identifiers into rom const static char pname[] = "Klipper Controller.\n"; const static char author[] = "Me.\n"; const static char version[] = "Klipper Controller, ESP32 controller V1.0 Beta.\n"; const static char serial[] = "202325081346v1b\n"; // Define the buffer for GPIO inputs/outputs //uint8_t gpioBuffer[2]; // Define the buffer for I2C inputs/outputs //uint8_t i2cBuffer[BUFFER_SIZE]; // Define the buffer for SPI inputs/outputs //uint8_t spiBuffer[BUFFER_SIZE]; // Function to send data over ESP-NOW void sendBufferToSlave(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { esp_err_t result = esp_now_send(macAddress, buffer, size); // Handle error (if any) } // Function to receive data over ESP-NOW void receiveBufferFromSlave(const uint8_t* macAddress, const uint8_t* buffer, size_t size) { // Handle received data here } // Declare the interrupt handler functions void IRAM_ATTR gpioInterrupt1(); void IRAM_ATTR gpioInterrupt2(); void IRAM_ATTR i2cInterruptHandler(); void IRAM_ATTR spiInterruptHandler(); // Define the threshold for ESPNow reliability const int RESEND_THRESHOLD = 3; // Define the structure that holds the ESPNow data typedef struct __attribute__((__packed__)) { uint8_t retryCount; uint8_t buffer[BUFFER_SIZE]; } EspNowData; // Define the callback function for ESPNow message reception void OnDataRecv(const uint8_t* macAddr, const uint8_t* data, int dataLen) { // Check the data length and MAC address if (dataLen != sizeof(EspNowData) || macAddr == NULL) { return; } EspNowData* recvData = (EspNowData*)data; // Process the received buffer // Buffer type can be determined by the sender and receiver // For example, if ‘bufferType’ is 1, it’s the GPIO buffer // If ‘bufferType’ is 2, it’s the I2C buffer, and so on… int bufferType = recvData->buffer[0]; switch (bufferType) { case 1: // GPIO buffer memcpy(gpioBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; case 2: // I2C buffer memcpy(i2cBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; case 3: // SPI buffer memcpy(spiBuffer, recvData->buffer + 1, BUFFER_SIZE - 1); break; default: break; } } void setup() { // Initialize GPIO pins as inputs pinMode(GPIO_PIN1, INPUT); pinMode(GPIO_PIN2, INPUT); // Initialize Interrupt Service Routines (ISRs) attachInterrupt(digitalPinToInterrupt(GPIO_PIN1), gpioInterrupt1, CHANGE); attachInterrupt(digitalPinToInterrupt(GPIO_PIN2), gpioInterrupt2, CHANGE); // Initialize I2C interface with hardware interrupt Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN); Wire.onReceive(i2cInterruptHandler); // Initialize SPI interface with hardware interrupt SPI.begin(SPI_CLK_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, SPI_CS_PIN); SPI.usingInterrupt(digitalPinToInterrupt(SPI_CLK_PIN)); attachInterrupt(digitalPinToInterrupt(SPI_CLK_PIN), spiInterruptHandler, RISING); // Initialize ESP-NOW WiFi.mode(WIFI_STA); if (esp_now_init() != ESP_OK) { // Handle ESP-NOW initialization error } // Register ESP-NOW send callback function esp_now_register_send_cb(sendBufferToSlave); // Register ESP-NOW receive callback function esp_now_register_recv_cb(receiveBufferFromSlave); } void loop() { // Check if there is any data in the buffers to be sent // Buffer type can be changed accordingly (1: GPIO, 2: I2C, 3: SPI) } // Callback function for handling I2C interrupt void IRAM_ATTR i2cInterruptHandler() { // Add your I2C interrupt code here if (i2cBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 2; // Buffer type memcpy(data.buffer + 1, i2cBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } } // Callback function for handling SPI interrupt void IRAM_ATTR spiInterruptHandler() { // Add your SPI interrupt code here if (spiBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 3; // Buffer type memcpy(data.buffer + 1, spiBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } } // GPIO Interrupt handlers void IRAM_ATTR gpioInterrupt1() { // Read the state of GPIO pin 1 and update the gpioBuffer accordingly gpioBuffer[0] = digitalRead(GPIO_PIN1); gpioBuffer[1] = 0; // Placeholder for any other GPIO pin(s) if (gpioBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 1; // Buffer type memcpy(data.buffer + 1, gpioBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } } void IRAM_ATTR gpioInterrupt2() { // Read the state of GPIO pin 2 and update the gpioBuffer accordingly gpioBuffer[1] = digitalRead(GPIO_PIN2); gpioBuffer[0] = 0; // Placeholder for any other GPIO pin(s) if (gpioBufferHasData()) { EspNowData data; data.retryCount = 0; data.buffer[0] = 1; // Buffer type memcpy(data.buffer + 1, gpioBuffer, BUFFER_SIZE - 1); sendBufferToSlave(data); } } // Check if there is any data in the GPIO buffer bool gpioBufferHasData() { for (int i = 0; i < 2; i++) { if (gpioBuffer[i] != 0) { return true; } } return false; } // Check if there is any data in the I2C buffer bool i2cBufferHasData() { // Check the corresponding condition for I2C buffer data presence // For example, if using an I2C sensor and i2cBuffer as output // Return true if i2cBuffer[0] != 0; return false; } // Check if there is any data in the SPI buffer bool spiBufferHasData() { // Check the corresponding condition for SPI buffer data presence // For example, if using SPI module and spiBuffer as output // Return true if spiBuffer[0] != 0; return false; }
204bf23d1ac1995a832f8e034708af3c
{ "intermediate": 0.3865264058113098, "beginner": 0.4313236474990845, "expert": 0.1821499764919281 }
18,560
I need a VBA code that can do the following: From my open workbook 'Service Provider'and active sheet, Open into the background the closed workbook 'Service Provider History' located at "G:\Shared drives\Swan School Site Premises\PREMISES MANAGEMENT\SERVICE PROVIDERS\Service Providers History.xlsx". Copy cells with data in column J from J5 downwards from the sheet in workbook 'Service Provider History, that has the same name as the active sheet in workbook 'Service Provider' Open a new Note Pad sheet and paste each cell copied into a seprate line in Note Pad. Close workbook 'Service Provider History'
c3b911ab56c3988debbb92c098452b48
{ "intermediate": 0.540340781211853, "beginner": 0.17219094932079315, "expert": 0.2874682545661926 }
18,561
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for order_master -- ---------------------------- DROP TABLE IF EXISTS `order_master`; CREATE TABLE `order_master` ( `order_id` int(18) NOT NULL AUTO_INCREMENT COMMENT '订单主键', `buyer_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '买家名字', `buyer_phone` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '买家电话', `order_amount` decimal(8, 2) NOT NULL COMMENT '总金额', `status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '订单状态', `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_user` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `update_user` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '修改人', PRIMARY KEY (`order_id`) USING BTREE, INDEX `idx_buyer_openid`(`buyer_phone`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact; SET FOREIGN_KEY_CHECKS = 1;
08411e21df296a101abadb40932bc1aa
{ "intermediate": 0.37455135583877563, "beginner": 0.2282300591468811, "expert": 0.3972185552120209 }
18,562
i have a list of dict. i want to make it a df
72ec868f4457bdace395320e629544b0
{ "intermediate": 0.32505565881729126, "beginner": 0.39842739701271057, "expert": 0.27651697397232056 }
18,563
please check the below python code to check "Bogdady" whatsapp online status. "#!/usr/bin/env python # coding: utf-8 # In[ ]: from selenium import webdriver from datetime import datetime driver = webdriver.Chrome(r'chromedriver.exe') # Load Whatsapp Web page driver.get("https://web.whatsapp.com/") name="Bogdady" try: chat=driver.find_element_by_xpath("/html/body/div[1]/div/div/div[3]/div/header/div[2]/div/span/div[2]/div") chat.click() time.sleep(2) search=driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div[1]/span/div/span/div/div[1]/div/label/div/div[2]') search.click() time.sleep(2) search.send_keys(name) time.sleep(2) open=driver.find_element_by_xpath("/html/body/div[1]/div/div/div[2]/div[1]/span/div/span/div/div[2]/div[1]/div/div/div[2]/div/div") open.click() time.sleep(2) while True: # This loop continues forever. Even If internet connection breaks and reconnects, this will help to find for the status again. try status = driver.find_element_by_xpath('//*[@id="main"]/header/div[2]/div[2]/span').text print("status \n") print("{0}".format(status)) now = datetime.now() current_time = now.strftime("%H:%M:%S") print("Current Time =", current_time) time.sleep(10) except: pass except: pass"
8119bab52a7971f744e68959688a3b21
{ "intermediate": 0.2967156171798706, "beginner": 0.6018277406692505, "expert": 0.1014566719532013 }
18,564
The following VBA works very well but I would like a change. I want the values of column I and column J copied then joined together with a space between and then pasted into Notepad. Sub HistoryToNotepad() Dim sourceWorkbook As Workbook Dim destinationWorkbook As Workbook Dim sourceWorksheet As Worksheet Dim destinationWorksheet As Worksheet Dim path As String, fileName As String Dim lastRow As Long Dim i As Long path = "G:\Shared drives\Swan School Site Premises\PREMISES MANAGEMENT\SERVICE PROVIDERS\" fileName = "Service Providers History.xlsx" Set sourceWorkbook = ThisWorkbook Set destinationWorkbook = Workbooks.Open(path & fileName) Dim activeSheetName As String activeSheetName = sourceWorkbook.ActiveSheet.Name Set sourceWorksheet = sourceWorkbook.ActiveSheet Set destinationWorksheet = destinationWorkbook.Sheets(activeSheetName) lastRow = destinationWorksheet.Cells(destinationWorksheet.Rows.Count, "J").End(xlUp).Row Shell "notepad.exe", vbNormalFocus Application.Wait Now + TimeValue("00:00:01") For i = 5 To lastRow SendKeys destinationWorksheet.Range("J" & i).Value SendKeys vbCrLf Next i SendKeys "^{HOME}" destinationWorkbook.Close False Set destinationWorksheet = Nothing Set destinationWorkbook = Nothing Set sourceWorksheet = Nothing Set sourceWorkbook = Nothing End Sub
8cfdb1d7f833008f5a3dca2302412673
{ "intermediate": 0.3343140184879303, "beginner": 0.4067781865596771, "expert": 0.2589077949523926 }
18,565
flutter web zip file and download
d9d2469bf82f47693155ca4102a62768
{ "intermediate": 0.36035796999931335, "beginner": 0.2525900900363922, "expert": 0.38705193996429443 }
18,566
i would like to know how blitz3d's TFormVector works. do you know? this is the example code in b3d, the result shows at the bottom given the INPUT#1 #2 and #3 p = CreatePivot() PositionEntity p, 10, 20, 30 ; THIS IS IGNORED BY TFORMVECTOR TurnEntity p, -5, -15, 25 ; INPUT #1 ; Question: what would happen if we took one step 'forward'? ; The local vector corresponding to one step forward is (0,0,1) ; in the pivot's local space. We need the global version. TFormVector 0,0,1, p,0 ; 0,0,1 is INPUT #2, 0 at the end is world 0,0,0 INPUT #3 message$ = "'One step forward' vector is ( " message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )" Text 70, 180, message ; RESULTING VECTOR: 0.2578, 0.0715, 0.96225 NOTES: 1. TFormVector doesn't take position into account, while TFormPoint does. 2. You might want to know which direction the vertex's normal is pointing in the world/game, so you use: TFormVector VertexNX,VertexNY,VertexNZ,source,0 (world 0,0,0) 3. TFormVector is for finding out stuff about a direction. Can you convert the example in C++ code w/o external libs.
4f2c342b0deae889772cc4fae92ce015
{ "intermediate": 0.6743444800376892, "beginner": 0.14159941673278809, "expert": 0.1840560883283615 }
18,567
how would i change this code to work on a pretrained model like bert: model_file_name = 'TI_recommendation_algorithm/ti_rec_model_doc2vec' model_file_path = model_file_name #! #! model_file_path = temp_file_path + '/' + model_file_name # Checks if doc2vec file exist; if not download file from Azure Storage container #!is_model_file_found = os.path.isfile(model_file_path) #!if is_model_file_found == False: #! azure_helper.download_file('ml-models', model_file_name, model_file_path) rec_model = Doc2Vec.load(model_file_path) open_inq_clean_text = result_open[0][1] if open_inq_clean_text == None: clean_text_result = clean_inquiry_text.clean_text_now(int(open_inquiry_id[0])) if clean_text_result['status'] == True: open_inq_clean_text = clean_text_result['clean_text'] if open_inq_clean_text != None: open_inq_text = word_tokenize(open_inq_clean_text) open_inq_vector = rec_model.infer_vector(open_inq_text) id_tuple = rec_model.dv.most_similar(open_inq_vector, topn = len(rec_model.dv.vectors)) results = pd.DataFrame(id_tuple, columns = ['inquiry_id', 'similarity']) results['inquiry_id'] = results['inquiry_id'].astype(int) linked_inqs = [] for i in range(len(result_link)): linked_inqs.append(result_link[i][1]) # [1] is the linked inquiry_id, [0] is the original inquiry_id results = results[~(results['inquiry_id'].isin(linked_inqs))] results['orignal'] = open_inquiry_id_original
04bf58f6b972ff3dba858b3ad87be891
{ "intermediate": 0.4145069420337677, "beginner": 0.30688178539276123, "expert": 0.27861130237579346 }
18,568
Can you give me pandas's code, to find the number of row in dataset that have a colum with date before 1900 ?
63f04d9c206c4f88c27628f9a482b709
{ "intermediate": 0.6907713413238525, "beginner": 0.07815276831388474, "expert": 0.2310759276151657 }
18,569
how do i hide the path in command line prompt jupyter notebook
bd45cd4b412e4ae06c725fae368f8bc9
{ "intermediate": 0.4998560845851898, "beginner": 0.17785945534706116, "expert": 0.322284460067749 }
18,570
Cab you optimize the following script (from FastLed) in a way that I can toggle with a button between
34faec821a9df4e48d7c9a18f67e0bd0
{ "intermediate": 0.22827711701393127, "beginner": 0.12876887619495392, "expert": 0.6429540514945984 }
18,571
Cab you optimize the following script (from FastLed) in a way that I can toggle with a button between GPAL A, GPAL B and GPAL C
23c15cd7a089ac1c5b75966bdbf530be
{ "intermediate": 0.22735440731048584, "beginner": 0.09658955037593842, "expert": 0.6760560870170593 }
18,572
I am using %%cmd adn running a C executable in jupyter notebook but I don’t want to see anything but the output of the file in the outout of the notebook. I am usuing windows 10.
71fa5845c4ef6c0e287b606503a8f625
{ "intermediate": 0.3390694856643677, "beginner": 0.272945761680603, "expert": 0.3879847824573517 }
18,573
class LastPageTransition extends AbstractElement { constructor(selector) { super(selector); } maxPage() { return this.$$('[data-testid*="antd-pagination-page-link"]').pop() } selector needs to be typeof `string` or `function`
e65c7b6e3d71c75dc5acb33a6bb6ad5c
{ "intermediate": 0.2948835492134094, "beginner": 0.5701073408126831, "expert": 0.13500910997390747 }
18,574
following script does not work. Can you correct it for me? /// @file Fire2012WithPalette.ino /// @brief Simple one-dimensional fire animation with a programmable color palette /// @example Fire2012WithPalette.ino #include <FastLED.h> #define LED_PIN 6 #define COLOR_ORDER GRB #define CHIPSET WS2811 #define NUM_LEDS 30 #define BRIGHTNESS 100 #define FRAMES_PER_SECOND 60 bool gReverseDirection = false; int currentPalette = 0; int buttonState = HIGH; int prevButtonState = HIGH; CRGB leds[NUM_LEDS]; // Fire2012 with programmable Color Palette // // This code is the same fire simulation as the original "Fire2012", // but each heat cell's temperature is translated to color through a FastLED // programmable color palette, instead of through the "HeatColor(...)" function. // // Four different static color palettes are provided here, plus one dynamic one. // // The three static ones are: // 1. the FastLED built-in HeatColors_p -- this is the default, and it looks // pretty much exactly like the original Fire2012. // // To use any of the other palettes below, just "uncomment" the corresponding code. // // 2. a gradient from black to red to yellow to white, which is // visually similar to the HeatColors_p, and helps to illustrate // what the 'heat colors' palette is actually doing, // 3. a similar gradient, but in blue colors rather than red ones, // i.e. from black to blue to aqua to white, which results in // an "icy blue" fire effect, // 4. a simplified three-step gradient, from black to red to white, just to show // that these gradients need not have four components; two or // three are possible, too, even if they don't look quite as nice for fire. // // The dynamic palette shows how you can change the basic 'hue' of the // color palette every time through the loop, producing "rainbow fire". CRGBPalette16 gPal; void setup() { delay(3000); // sanity delay FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ); FastLED.setBrightness( BRIGHTNESS ); pinMode(BUTTON_PIN, INPUT_PULLUP); // Set initial button state buttonState = digitalRead(BUTTON_PIN); prevButtonState = buttonState; // This first palette is the basic 'black body radiation' colors, // which run from black to red to bright yellow to white. // gPal = HeatColors_p; // These are other ways to set up the color palette for the 'fire'. // First, a gradient from black to red to yellow to white -- similar to HeatColors_p // (GPAL A) gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White); // Second, this palette is like the heat colors, but blue/aqua instead of red/yellow // (GPAL B) gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); // Third, here's a simpler, three-step gradient, from black to red to white // (GPAL C) gPal = CRGBPalette16( CRGB::Black, CRGB::Green, CRGB::Yellow); } void loop() { // // Add entropy to random number generator; we use a lot of it. random16_add_entropy( random()); // Fourth, the most sophisticated: this one sets up a new palette every // time through the loop, based on a hue that changes every time. // The palette is a gradient from black, to a dark color based on the hue, // to a light color based on the hue, to white. // // static uint8_t hue = 0; // hue++; // CRGB darkcolor = CHSV(hue,255,192); // pure hue, three-quarters brightness // CRGB lightcolor = CHSV(hue,128,255); // half 'whitened', full brightness // gPal = CRGBPalette16( CRGB::Black, darkcolor, lightcolor, CRGB::White); Fire2012WithPalette(); // run simulation frame, using palette colors FastLED.show(); // display this frame FastLED.delay(1000 / FRAMES_PER_SECOND); } // Fire2012 by Mark Kriegsman, July 2012 // as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY //// // This basic one-dimensional 'fire' simulation works roughly as follows: // There's a underlying array of 'heat' cells, that model the temperature // at each point along the line. Every cycle through the simulation, // four steps are performed: // 1) All cells cool down a little bit, losing heat to the air // 2) The heat from each cell drifts 'up' and diffuses a little // 3) Sometimes randomly new 'sparks' of heat are added at the bottom // 4) The heat from each cell is rendered as a color into the leds array // The heat-to-color mapping uses a black-body radiation approximation. // // Temperature is in arbitrary units from 0 (cold black) to 255 (white hot). // // This simulation scales it self a bit depending on NUM_LEDS; it should look // "OK" on anywhere from 20 to 100 LEDs without too much tweaking. // // I recommend running this simulation at anywhere from 30-100 frames per second, // meaning an interframe delay of about 10-35 milliseconds. // // Looks best on a high-density LED setup (60+ pixels/meter). // // // There are two main parameters you can play with to control the look and // feel of your fire: COOLING (used in step 1 above), and SPARKING (used // in step 3 above). // // COOLING: How much does the air cool as it rises? // Less cooling = taller flames. More cooling = shorter flames. // Default 55, suggested range 20-100 #define COOLING 55 // SPARKING: What chance (out of 255) is there that a new spark will be lit? // Higher chance = more roaring fire. Lower chance = more flickery fire. // Default 120, suggested range 50-200. #define SPARKING 120 void loop() { // Update button state buttonState = digitalRead(BUTTON_PIN); // Detect button press to toggle palette if (buttonState == LOW && prevButtonState == HIGH) { currentPalette++; if (currentPalette > 2) { currentPalette = 0; } // Clear the LED strip FastLED.clear(); FastLED.show(); delay(250); // Debounce delay } prevButtonState = buttonState; // Add entropy to random number generator; we use a lot of it. random16_add_entropy( random()); // Update palette based on currentPalette variable switch (currentPalette) { case 0: gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White); break; case 1: gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); break; case 2: gPal = CRGBPalette16( CRGB::Black, CRGB::Green, CRGB::Yellow); break; } Fire2012WithPalette(); // run simulation frame, using palette colors FastLED.show(); // display this frame FastLED.delay(1000 / FRAMES_PER_SECOND); } void Fire2012WithPalette() { // Array of temperature readings at each simulation cell static uint8_t heat[NUM_LEDS]; // Step 1. Cool down every cell a little for( int i = 0; i < NUM_LEDS; i++) { heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2)); } // Step 2. Heat from each cell drifts 'up' and diffuses a little for( int k= NUM_LEDS - 1; k >= 2; k--) { heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3; } // Step 3. Randomly ignite new 'sparks' of heat near the bottom if( random8() < SPARKING ) { int y = random8(7); heat[y] = qadd8( heat[y], random8(160,255) ); } // Step 4. Map from heat cells to LED colors for( int j = 0; j < NUM_LEDS; j++) { // Scale the heat value from 0-255 down to 0-240 // for best results with color palettes. uint8_t colorindex = scale8( heat[j], 240); CRGB color = ColorFromPalette( gPal, colorindex); int pixelnumber; if( gReverseDirection ) { pixelnumber = (NUM_LEDS-1) - j; } else { pixelnumber = j; } leds[pixelnumber] = color; } }
40257fac15d9aaaaedfe709a25d56725
{ "intermediate": 0.41566482186317444, "beginner": 0.40625813603401184, "expert": 0.17807705700397491 }
18,575
const AbstractElement = require('./abstractElement'); const AbstractElements = require('./abstractElements'); class LastPageTransition extends AbstractElement { constructor(selector) { super(selector); } async maxPage() { const elements = this.$$('[data-testid*="antd-pagination-page-link"]') return elements[elements.length - 1] } } код возвращает [Function (anonymous)]
c2a91cc9bc220b69be283b540b69cdf4
{ "intermediate": 0.36355745792388916, "beginner": 0.3991129994392395, "expert": 0.23732952773571014 }
18,576
Could you please correct the errors in this script: /// @file Fire2012WithPalette.ino /// @brief Simple one-dimensional fire animation with a programmable color palette /// @example Fire2012WithPalette.ino #include <FastLED.h> #define LED_PIN 6 #define COLOR_ORDER GRB #define CHIPSET WS2811 #define NUM_LEDS 30 #define BRIGHTNESS 100 #define FRAMES_PER_SECOND 60 #define BUTTON_PIN 7 bool gReverseDirection = false; int currentPalette = 0; int buttonState = HIGH; int prevButtonState = HIGH; CRGB leds[NUM_LEDS]; CRGBPalette16 gPal; void setup() { delay(3000); // sanity delay FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ); FastLED.setBrightness( BRIGHTNESS ); pinMode(BUTTON_PIN, INPUT_PULLUP); // Set initial button state buttonState = digitalRead(BUTTON_PIN); prevButtonState = buttonState; // This first palette is the basic ‘black body radiation’ colors, // which run from black to red to bright yellow to white. // gPal = HeatColors_p; // These are other ways to set up the color palette for the ‘fire’. // First, a gradient from black to red to yellow to white – similar to HeatColors_p // (GPAL A) gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White); // Second, this palette is like the heat colors, but blue/aqua instead of red/yellow // (GPAL B) //gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); // Third, here’s a simpler, three-step gradient, from black to red to white // (GPAL C) //gPal = CRGBPalette16( CRGB::Black, CRGB::Green, CRGB::Yellow); } void loop() { // Update button state buttonState = digitalRead(BUTTON_PIN); // Detect button press to toggle palette if (buttonState == LOW && prevButtonState == HIGH) { currentPalette++; if (currentPalette > 2) { currentPalette = 0; } // Clear the LED strip fill_solid(leds, NUM_LEDS, CRGB::Black); FastLED.show(); delay(250); // Debounce delay } prevButtonState = buttonState; // Add entropy to random number generator; we use a lot of it. random16_add_entropy( random()); // Update palette based on currentPalette variable switch (currentPalette) { case 0: gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White); break; case 1: gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); break; case 2: gPal = CRGBPalette16( CRGB::Black, CRGB::Green, CRGB::Yellow); break; } Fire2012WithPalette(); // run simulation frame, using palette colors FastLED.show(); // display this frame FastLED.delay(1000 / FRAMES_PER_SECOND); } void Fire2012WithPalette() { // Array of temperature readings at each simulation cell static uint8_t heat[NUM_LEDS]; // Step 1. Cool down every cell a little for( int i = 0; i < NUM_LEDS; i++) { heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2)); } // Step 2. Heat from each cell drifts ‘up’ and diffuses a little for( int k= NUM_LEDS - 1; k >= 2; k–) { heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3; } // Step 3. Randomly ignite new ‘sparks’ of heat near the bottom if( random8() < SPARKING ) { int y = random8(7); heat[y] = qadd8( heat[y], random8(160,255) ); } // Step 4. Map from heat cells to LED colors for( int j = 0; j < NUM_LEDS; j++) { // Scale the heat value from 0-255 down to 0-240 // for best results with color palettes. uint8_t colorindex = scale8( heat[j], 240); CRGB color = ColorFromPalette( gPal, colorindex); int pixelnumber; if( gReverseDirection ) { pixelnumber = (NUM_LEDS-1) - j; } else { pixelnumber = j; } leds[pixelnumber] = color; } } THIS are the errormessages: /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:105:38: error: stray '\342' in program for( int k= NUM_LEDS - 1; k >= 2; k–) { ^ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:105:39: error: stray '\200' in program for( int k= NUM_LEDS - 1; k >= 2; k–) { ^ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:105:40: error: stray '\223' in program for( int k= NUM_LEDS - 1; k >= 2; k–) { ^ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino: In function 'void Fire2012WithPalette()': /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:101:45: error: 'COOLING' was not declared in this scope heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2)); ^~~~~~~ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:101:45: note: suggested alternative: 'FALLING' heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2)); ^~~~~~~ FALLING /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:110:19: error: 'SPARKING' was not declared in this scope if( random8() < SPARKING ) { ^~~~~~~~ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:110:19: note: suggested alternative: 'FALLING' if( random8() < SPARKING ) { ^~~~~~~~ FALLING exit status 1 Compilation error: stray '\342' in program
f72101b1cd4a31c7ab046ad72d633cac
{ "intermediate": 0.3257967233657837, "beginner": 0.3644981384277344, "expert": 0.30970507860183716 }
18,577
I sued this code : from pymexc import futures symbol = "BCH_USDT" client = futures.HTTP(api_key = api_key, api_secret = api_secret) def handle_message(message): # handle websocket message print(message) print(client.asset(currency="USDT")) But terminal returning me: {'success': False, 'code': 602, 'message': 'Signature verification failed!'}
3e82a823782a9664d96e516bc0ef8a05
{ "intermediate": 0.41510823369026184, "beginner": 0.41322213411331177, "expert": 0.1716696172952652 }
18,578
maxPage() { return this.$('[data-testid*="antd-pagination-page-link"]')[-1]; } selector needs to be typeof `string` or `function`
aee1b89bc4eb204c368efecb01f7dbb1
{ "intermediate": 0.336896687746048, "beginner": 0.4827089011669159, "expert": 0.18039441108703613 }
18,579
что вернет код const elements = $$('[data-testid*="antd-pagination-page-link"]' console.log(elements)
de52e2770e3a0938ed3782d2f934cf11
{ "intermediate": 0.3511030077934265, "beginner": 0.37294331192970276, "expert": 0.27595362067222595 }
18,580
Hi, this script has some errors, could you please correct them for me? /// @file Fire2012WithPalette.ino /// @brief Simple one-dimensional fire animation with a programmable color palette /// @example Fire2012WithPalette.ino #include <FastLED.h> #define LED_PIN 6 #define COLOR_ORDER GRB #define CHIPSET WS2811 #define NUM_LEDS 30 #define BRIGHTNESS 100 #define FRAMES_PER_SECOND 60 #define BUTTON_PIN 7 bool gReverseDirection = false; int currentPalette = 0; int buttonState = HIGH; int prevButtonState = HIGH; CRGB leds[NUM_LEDS]; CRGBPalette16 gPal; void setup() { delay(3000); // sanity delay FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ); FastLED.setBrightness( BRIGHTNESS ); pinMode(BUTTON_PIN, INPUT_PULLUP); // Set initial button state buttonState = digitalRead(BUTTON_PIN); prevButtonState = buttonState; // This first palette is the basic ‘black body radiation’ colors, // which run from black to red to bright yellow to white. // gPal = HeatColors_p; // These are other ways to set up the color palette for the ‘fire’. // First, a gradient from black to red to yellow to white – similar to HeatColors_p // (GPAL A) gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White); // Second, this palette is like the heat colors, but blue/aqua instead of red/yellow // (GPAL B) //gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); // Third, here’s a simpler, three-step gradient, from black to red to white // (GPAL C) //gPal = CRGBPalette16( CRGB::Black, CRGB::Green, CRGB::Yellow); } void loop() { // Update button state buttonState = digitalRead(BUTTON_PIN); // Detect button press to toggle palette if (buttonState == LOW && prevButtonState == HIGH) { currentPalette++; if (currentPalette > 2) { currentPalette = 0; } // Clear the LED strip fill_solid(leds, NUM_LEDS, CRGB::Black); FastLED.show(); delay(250); // Debounce delay } prevButtonState = buttonState; // Add entropy to random number generator; we use a lot of it. random16_add_entropy( random()); // Update palette based on currentPalette variable switch (currentPalette) { case 0: gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White); break; case 1: gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); break; case 2: gPal = CRGBPalette16( CRGB::Black, CRGB::Green, CRGB::Yellow); break; } Fire2012WithPalette(); // run simulation frame, using palette colors FastLED.show(); // display this frame FastLED.delay(1000 / FRAMES_PER_SECOND); } void Fire2012WithPalette() { // Array of temperature readings at each simulation cell static uint8_t heat[NUM_LEDS]; // Step 1. Cool down every cell a little for( int i = 0; i < NUM_LEDS; i++) { heat[i] = qsub8( heat[i], random8(0, ((FALLING * 10) / NUM_LEDS) + 2)); } // Step 2. Heat from each cell drifts ‘up’ and diffuses a little for( int k = NUM_LEDS - 1; k >= 2; k–) { heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3; } // Step 3. Randomly ignite new ‘sparks’ of heat near the bottom if( random8() < FALLING ) { int y = random8(7); heat[y] = qadd8( heat[y], random8(160,255) ); } // Step 4. Map from heat cells to LED colors for( int j = 0; j < NUM_LEDS; j++) { // Scale the heat value from 0-255 down to 0-240 // for best results with color palettes. uint8_t colorindex = scale8( heat[j], 240); CRGB color = ColorFromPalette( gPal, colorindex); int pixelnumber; if( gReverseDirection ) { pixelnumber = (NUM_LEDS-1) - j; } else { pixelnumber = j; } leds[pixelnumber] = color; } } THIS ARE THE ERROR MESSAGES: /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:106:39: error: stray '\342' in program for( int k = NUM_LEDS - 1; k >= 2; k–) { ^ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:106:40: error: stray '\200' in program for( int k = NUM_LEDS - 1; k >= 2; k–) { ^ /private/var/folders/w9/kw5r25g13dx5yf_gs5dqmpn80000gn/T/.arduinoIDE-unsaved2023725-35803-1m7f3b1.ilvc/sketch_aug25f/sketch_aug25f.ino:106:41: error: stray '\223' in program for( int k = NUM_LEDS - 1; k >= 2; k–) { ^ exit status 1 Compilation error: stray '\342' in program
d87251f21a89b242e9b16d4b858cc3f7
{ "intermediate": 0.39342552423477173, "beginner": 0.31495150923728943, "expert": 0.29162299633026123 }
18,581
In VBA how can I open a workbook minimised
9e569806daa6761b151d8914d72b3ebb
{ "intermediate": 0.4739876389503479, "beginner": 0.28924471139907837, "expert": 0.23676763474941254 }
18,582
final content = base64Encode(rawData); final anchor = AnchorElement( href: "data:application/octet-stream;charset=utf-16le;base64,$content") ..setAttribute("download", "file.zip") ..click(); read multi urls and zip it to rawData and download it use this code
684c4eaeed8955087ff6b21632fda916
{ "intermediate": 0.5159727334976196, "beginner": 0.20722147822380066, "expert": 0.2768057584762573 }
18,583
Tell me shortly what is signature in MEXC API ?
a910182c2f89fb9bc25a67236185443b
{ "intermediate": 0.764786422252655, "beginner": 0.08251499384641647, "expert": 0.15269865095615387 }
18,584
In number theory, two integers a and b are coprime if the only positive integer that is a divisor of both of them is 1. This is equivalent to their greatest common divisor (GCD) being 1. Given a natural number n. Find two natural numbers a and b (a < b) that are coprime such that a * b = n and |a - b| is the smallest. Input An integer n Output Two integers a and b separated by space satisfy the problem requirement. Constraints 2 <= n <= 1000000 Example Input 24 Output 3 8...Please solve with C# code
a039923e61b845f9bfa602a35ab813a0
{ "intermediate": 0.42536818981170654, "beginner": 0.28712591528892517, "expert": 0.2875058352947235 }
18,585
I want you to write me VBA code for a PowerPoint presentation about Medical Image Analysis. I want Abstract, Introduction, Models to be implemented(CNN & RNN), Background, Literature Survey to be included in the Presentation. You are to fill in all the text with your own knowledge, no placeholders. I need at least 6 slides.
ac42ca0d6e3b7b084a05ef1420d0e8f4
{ "intermediate": 0.1397862285375595, "beginner": 0.22744041681289673, "expert": 0.6327733397483826 }
18,586
selenium python assert that after double click on button text the same
035ab1da06bec6f5200aa147b0fac4fd
{ "intermediate": 0.4116447865962982, "beginner": 0.27785733342170715, "expert": 0.31049785017967224 }
18,587
make me a javascript code to automatically download an image in a website. the link will be contained in an element as such: "<div class="media" style="max-height: 815.1px;"> <img src="https://static.wikia.nocookie.net/leagueoflegends/images/9/94/Aurelion_Sol_StormDragonSkin_HD.jpg/revision/latest/scale-to-width-down/1000?cb=20200917183858" height="563"> </div>" filter it so that the only image beingdownload begins with "https://static.wikia.nocookie.net/leagueoflegends/images/" and ends with .jpg, ignooflegends/images/" and ends with .jpg, ignoring "/revision/latest/scale-to-width-down/1000?cb=20200917183858" part
6a02fab9b7e350ac96b9bbcf1934690a
{ "intermediate": 0.4197499752044678, "beginner": 0.2620505094528198, "expert": 0.3181995153427124 }