row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
16,173
как в этот запрос добавить tsl 1.2 string url = "https://www.cdas.ca"; string jsonBody = "hi"; string userAgent = GetRandomUserAgentFromFile(); try { using (var request = new Leaf.xNet.HttpRequest()) { request.AddHeader("Host", "www.copart.com"); request.AddHeader("Connection", "keep-alive"); request.UserAgent = userAgent; request.AddHeader("Content-Type", "application/json;charset=UTF-8"); request.AddHeader("Accept", "application/json, text/plain, */*"); request.AddHeader("X-Requested-With", "XMLHttpRequest"); request.AddHeader("Access-Control-Allow-Headers", "Content-Type, X-XSRF-TOKEN"); request.Referer = "https://www.copart.com/login/"; request.AcceptEncoding = "gzip, deflate, br"; request.AddHeader("Accept-Language:", "en-US,en;q=0.9"); request.Proxy = Leaf.xNet.HttpProxyClient.Parse(proxy); request.AddHeader("Cookie", cookie); var response = request.Post(url, jsonBody, "application/json, text/plain, */*");
bf32ddbe873209f6007bf05f129e9fc4
{ "intermediate": 0.41538316011428833, "beginner": 0.3245948553085327, "expert": 0.26002195477485657 }
16,174
function [H, n, m, z] = weigth2qc2sparse(qcHFileName) fid = fopen(qcHFileName, ‘r’); n = fscanf(fid, ‘%d’, [1 1]); m = fscanf(fid, ‘%d’, [1 1]); z = fscanf(fid, ‘%d’, [1 1]); I = sparse(eye(z)); Z = sparse(zeros(z)); H = sparse([]); for i = 1:m lH = sparse([]); for j = 1:n shift2=-1; shift = fscanf(fid, ‘%d’, [1 1]); shift2 = fscanf(fid, ‘&%d’, [1 1]); if shift == -1 lH = [lH Z]; else if shift2~=-1 lH = [lH circshift(I, [0 shift])+circshift(I, [0 shift2]) ]; else lH = [lH circshift(I, [0 shift])]; end end end H = [H; lH]; end fclose(fid); end function [H, n, m, z] = weight2qc2sparse(qcHFileName) fid = fopen(qcHFileName, ‘r’); n = fscanf(fid, ‘%d’, [1 1]); m = fscanf(fid, ‘%d’, [1 1]); z = fscanf(fid, ‘%d’, [1 1]); I = sparse(eye(z)); Z = sparse(zeros(z)); H = sparse([]); for i = 1:m lH = sparse([]); for j = 1:n shift2 = -1; shift = fscanf(fid, ‘%d’, [1 1]); shift2 = fscanf(fid, ‘&%d’, [1 1]); if shift == -1 lH = [lH Z]; else if shift2 ~= -1 lH = [lH circshift(I, [0 shift]) + circshift(I, [0 shift2])]; else lH = [lH circshift(I, [0 shift])]; end end end H = [H; lH]; end fclose(fid); end
a339d41c067b28af4f7036498b6a5494
{ "intermediate": 0.29229381680488586, "beginner": 0.46053558588027954, "expert": 0.24717065691947937 }
16,175
write a program in nodejs using pupeteer t hat opens a web page, hard refreshes it with little delay x ammount of times and then exits, also add multithreading so it can be done with multiple browsers at once, make sure to use the headless: "new" instead of true as it is depricated.
46b36648b37c3e6c249cde2f3138160a
{ "intermediate": 0.590059757232666, "beginner": 0.11856940388679504, "expert": 0.29137083888053894 }
16,176
перепиши этот код на С# def main(): someInt = 124 num = str(someInt) listOfNums = set([int(''.join(nums)) for nums in itertools.permutations(num, len(num))]) listOfNums = sorted(list(listOfNums)) try: print(listOfNums[listOfNums.index(someInt)+1]) except Exception: print(-1)
579f2f13f4688a4f7f6240474e32786f
{ "intermediate": 0.3183346688747406, "beginner": 0.47785985469818115, "expert": 0.20380544662475586 }
16,177
how can i call this class and apply this filter with reactive redis, from my restcontroller? without using spring cloud gateway: package com.mediaworld.apimanager.configuration.redis; import org.reactivestreams.Publisher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.dao.DataAccessException; import org.springframework.data.redis.connection.ReactiveRedisConnection; import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; import org.springframework.data.redis.core.ReactiveRedisCallback; import org.springframework.data.redis.core.ReactiveRedisTemplate; import org.springframework.data.redis.serializer.GenericToStringSerializer; import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializationContext; import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.web.reactive.function.server.HandlerFilterFunction; import org.springframework.web.reactive.function.server.HandlerFunction; import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.function.server.ServerResponse; import reactor.core.publisher.Mono; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.time.Duration; import java.time.LocalTime; import java.util.List; import java.util.Optional; import static org.springframework.http.HttpStatus.TOO_MANY_REQUESTS; public class RateLimiterHandlerFilterFunction implements HandlerFilterFunction<ServerResponse,ServerResponse> { @Value("${MAX_REQUESTS_PER_MINUTE}") private static Long MAX_REQUESTS_PER_MINUTE = 20L; private ReactiveRedisTemplate<String, Long> redisTemplate; public RateLimiterHandlerFilterFunction(ReactiveRedisTemplate<String, Long> redisTemplate) { this.redisTemplate = redisTemplate; } @Override public Mono<ServerResponse> filter(ServerRequest request, HandlerFunction<ServerResponse> next) { int currentMinute = LocalTime.now().getMinute(); String key = String.format("rl_%s:%s", requestAddress(request.remoteAddress()), currentMinute); return redisTemplate // .opsForValue().get(key) // .flatMap( // value -> value >= MAX_REQUESTS_PER_MINUTE ? // ServerResponse.status(TOO_MANY_REQUESTS).build() : // incrAndExpireKey(key, request, next) // ).switchIfEmpty(incrAndExpireKey(key, request, next)); } @Bean ReactiveRedisTemplate<String, Long> reactiveRedisTemplate(ReactiveRedisConnectionFactory factory) { JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer(); StringRedisSerializer stringRedisSerializer = StringRedisSerializer.UTF_8; GenericToStringSerializer<Long> longToStringSerializer = new GenericToStringSerializer<>(Long.class); ReactiveRedisTemplate<String, Long> template = new ReactiveRedisTemplate<>(factory, RedisSerializationContext.<String, Long>newSerializationContext(jdkSerializationRedisSerializer) .key(stringRedisSerializer).value(longToStringSerializer).build()); return template; } private String requestAddress(Optional<InetSocketAddress> maybeAddress) { return maybeAddress.isPresent() ? maybeAddress.get().getHostName() : ""; } /** * Now we need to implement the logic to execute the INCR and an EXPIRE logic outlined in Fixed Window implementation using Spring Data Redis Reactive: MULTI INCR [user-api-key]:[current minute number] EXPIRE [user-api-key]:[current minute number] 59 EXEC The "Basic Rate Limiting" recipe calls for the use of a Redis Transaction in which the commands are sent to the server, accumulated in serial way and executed sequentially without any possible interruption by a request from another client. Basically, we want the INCR and EXPIRE calls to update the requests-per-unit-of-time counter to happen atomically or not at all. Given that a Reactive API and Redis Transactions (MULTI/EXEC) are not compatible paradigms, which boils down to "you cannot listen to a command that is going to be executed in the future" in a chain of reactive commands A "best possible" approach to achieve this behavior with a reactive API is by using the ReactiveRedisTemplate execute method which takes a ReactiveRedisCallback guaranteing that at least the commands will run on the same Redis connection, but, this is by no means a real "transaction": */ private Mono<ServerResponse> incrAndExpireKey(String key, ServerRequest request, HandlerFunction<ServerResponse> next) { return redisTemplate.execute(new ReactiveRedisCallback<List<Object>>() { @Override public Publisher<List<Object>> doInRedis(ReactiveRedisConnection connection) throws DataAccessException { ByteBuffer bbKey = ByteBuffer.wrap(key.getBytes()); return Mono.zip( // connection.numberCommands().incr(bbKey), // connection.keyCommands().expire(bbKey, Duration.ofSeconds(59L)) // ).then(Mono.empty()); } }).then(next.handle(request)); } }
46db16de1618bdd0b0fb83184eb05b04
{ "intermediate": 0.5201283693313599, "beginner": 0.3643602728843689, "expert": 0.11551129072904587 }
16,178
write ZOQL query to fetch the details subscriptionname , Id, TermEnddate, TermStartDate , Subscription status where subscription termend date equal today - 1 month (after renewal of 1 month if not renewed)
c7fd2d7c0510d194d7b8cb03e569e21b
{ "intermediate": 0.5494701862335205, "beginner": 0.19782929122447968, "expert": 0.2527005076408386 }
16,179
EUtranCellData: Error: EUtranCells[Kcell]: cannot be blank; &{{ GRBS_41132_YUGCITY_1_KKT [] [] [Kcell] [] [] false} map[] map[]} correct code : Object.keys(data.children).forEach(node => { const { EUtranCellData, ENodeB } = data.children[node]; if (!EUtranCellData.hasOwnProperty("error")) { const sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([data.children[node].EUtranCellData,data.children[node].ENodeB])) form.appendChild(sec) } })
13f84896b7025ae3e566f4de3396a2ee
{ "intermediate": 0.34458521008491516, "beginner": 0.3605371117591858, "expert": 0.2948776185512543 }
16,180
2*2
76d2684975742fe68984545adaf16b85
{ "intermediate": 0.35321298241615295, "beginner": 0.31139475107192993, "expert": 0.3353922367095947 }
16,181
как взять cookie из ответа using (var browser = await puppeteerExtra.LaunchAsync(launchOptions)) { var page = await browser.NewPageAsync(); // Навигация к целевому сайту await page.GoToAsync("https://saa.com/");
c2d19771b561fbe4ed91aa52acc98279
{ "intermediate": 0.34356561303138733, "beginner": 0.36993974447250366, "expert": 0.28649458289146423 }
16,182
Write a program in python that will pass a small window A1 over an image, within that window will be a smaller window A2. If there are pixels inside the window A1 and A2, then do nothing, if there are pixels inside the window A2 and no pixels in the window A1, then all pixels in the window A1 should be painted black
b9167a4e3d10672609cdacc91a99263e
{ "intermediate": 0.3800368309020996, "beginner": 0.15175943076610565, "expert": 0.46820372343063354 }
16,183
how to make text composable wait until result will not null
f47bf8f316f59d3d0721f06ea59cdab2
{ "intermediate": 0.19703657925128937, "beginner": 0.23244109749794006, "expert": 0.5705223679542542 }
16,184
today - 1 month data from subscription in ZOQL
b86cb98ffee8d446c12953d5a6dbd525
{ "intermediate": 0.3843157887458801, "beginner": 0.24170708656311035, "expert": 0.3739771544933319 }
16,185
I would like a VBA code that does the following: Identify the current active cell and row then copy Target row value in column H to J21 on the same sheet copy Target row value in column G to K21 on the same sheet enter formula in L21 to Capture Contact from K21 enter formula in M21 to Capture Email from K21 copy Target row value in column D to N21 on the same sheet copy Target row value in column E to O21 on the same sheet then calculate L21 & M21
15c34e5694088068a8a5dc3706ff0d1e
{ "intermediate": 0.4894276261329651, "beginner": 0.18505345284938812, "expert": 0.325518935918808 }
16,186
in this code class Employee_Profile(MPTTModel): choice = [ ('نعم', 'نعم'), ('لا', 'لا'), ] user = models.ForeignKey(User, on_delete=models.CASCADE) action_creator =models.CharField(max_length=250, null=True, blank=True) rawaf_id = models.IntegerField(null=True, blank=True, unique=True) iqama_no = models.IntegerField(null=True, blank=True, unique=True) full_name = models.CharField(max_length=250, null=True, blank=True) parent = TreeForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name='children', limit_choices_to=his children) job_name = models.CharField(max_length=250, null=True, blank=True) oc_level = models.IntegerField(null=True, blank=True) levels_nt_show = models.IntegerField(null=True, blank=True, default=0) his_chart = TreeForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name='hischart') on_work = models.CharField(max_length=250, null=True, blank=True, choices=choice, default='نعم') def __str__(self): return ", ".join([str(self.job_name), str(self.full_name)]) class MPTTMeta: verbose_name="rawaf_id" ordering = ['parent','oc_level'] need to make parent field limit choices from his child only
10074ea63555532189c9229bb4ab0494
{ "intermediate": 0.3523256182670593, "beginner": 0.4827194809913635, "expert": 0.16495485603809357 }
16,187
I have this object: export const INDOOR_CAMERA_MODELS = { "SS001": "SimpliCam", "SS002": "videodoorbell", "SS003": "SimpliCam" , "SSOBCM4": "shield" , "SSOBCM4": "dagger", "scout": "Wireless Indoor Camera", }; give me a JS function where I send a property name and the function returns the value
7bcdce6fb5ea6f6a3198422fc2cc3c8c
{ "intermediate": 0.37993496656417847, "beginner": 0.3256129324436188, "expert": 0.29445207118988037 }
16,188
I have a dialed number in UCCE system and i want asocial it with DID to make any one can reach this dialed number by DID
2000565885646d4a4d36d4c776d5b754
{ "intermediate": 0.3711230456829071, "beginner": 0.2599257826805115, "expert": 0.3689511716365814 }
16,189
How can I write this block of code to ensure that if my activeCell in not within 'Rngd' then the MsgBox "Please select the Reminder Date for the Specific Task you would like to remind the Contractor." appears, F22 is selected and the code stops running. Currently this is not happening with the code below. Dim wordApp As Object Dim doc As Object Dim WshShell As Object Dim Rng As Range Dim Rngd As Range Dim RowNum As Integer Dim cell As Range RowNum = activeCell.Row Set Rng = Range("D" & RowNum & ":H" & RowNum) Set Rngd = Range("D23:D523") Set cell = activeCell 'If RowNum < 23 And activeCell.Column <> 6 Then If Rngd Is Nothing Then MsgBox "Please select the Reminder Date for the Specific Task you would like to remind the Contractor." Range("F22").Select Exit Sub Else
6ad1cab1ebc2801c08e0580a1c9c2360
{ "intermediate": 0.5552324652671814, "beginner": 0.28588488698005676, "expert": 0.15888266265392303 }
16,190
Write me a unity code for FPS player controll
786f9d5147ce8ba2eba75452de6c0727
{ "intermediate": 0.3705034852027893, "beginner": 0.20335733890533447, "expert": 0.426139235496521 }
16,191
from flask import Flask, jsonify, request import pandas as pd from datetime import datetime app = Flask(__name__) @app.route('/data') def get_data(): ip_address = request.headers.get('X-Real-IP') # Получаем IP-адрес клиента print(f"Запрос от клиента с IP-адресом: {ip_address}") # Загрузка данных из файла Excel df = pd.read_excel('data.xlsx') # Фильтрация данных по дате today = datetime.today().date() df['Срок исполнения'] = pd.to_datetime(df['Срок исполнения'], format='%Y-%m-%d') df['Разница'] = (df['Срок исполнения'] - today).dt.days filtered_df = df.loc[df['Разница'] >= 0] # Преобразование отфильтрованных данных в формат JSON data = filtered_df.to_dict(orient='records') return jsonify(data) if __name__ == '__main__': # Ввод IP-адреса сервера с помощью окна ввода ip_address = input("Введите IP-адрес сервера: ") app.run(host=ip_address) нужен графический интерфейс для назначения ip сервера и возможности загрузки файла excel со столбцами № пп,Номер, Дата регистрации, Исполнитель, Срок исполнения, email, содержание контрольных писем
a37f84630bb6e60d9ab93ec48f196e6a
{ "intermediate": 0.585690438747406, "beginner": 0.27660176157951355, "expert": 0.13770775496959686 }
16,192
create me an example of a complex json structure containing nested objects and lists
054c3e98bd45b3db0c96d51aa7dc862d
{ "intermediate": 0.5830298662185669, "beginner": 0.2303798943758011, "expert": 0.1865902841091156 }
16,193
using (var browser = await puppeteerExtra.LaunchAsync(launchOptions)) { var page = await browser.NewPageAsync(); // Навигация к целевому сайту await page.GoToAsync("https://www.ddd.dsa/ddd/"); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } await browser.CloseAsync(); } } напиши post запрос для puppeteer на подобиии этого string url = "https://www.fwef.com/fwfwf"; string jsonBody = $"{{\"wf\":\"{few}\",\"accofuntType\":\"0\",\"ef\":\"{password}\",\"accountTypeValue\":\"0\"}}"; string userAgent = GetRandomUserAgentFromFile(); try { System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; using (var request = new Leaf.xNet.HttpRequest()) { request.AddHeader("Host", "www.dww.com"); request.AddHeader("Connection", "keep-alive"); request.UserAgent = userAgent; request.AddHeader("Content-Type", "application/json;charset=UTF-8"); request.AddHeader("Accept", "application/json, text/plain, */*"); request.AddHeader("X-Requested-With", "XMLHttpRequest"); request.AddHeader("Access-Control-Allow-Headers", "Content-Type, X-XSRF-TOKEN"); request.Referer = "https://www.copart.com/login/"; request.AcceptEncoding = "gzip, deflate, br"; request.AddHeader("Accept-Language:", "en-US,en;q=0.9"); request.Proxy = Leaf.xNet.HttpProxyClient.Parse(proxy); var response = request.Post(url, jsonBody, "application/json, text/plain, */*"); if (response.ToString().Contains("{\"returnCode\":1,\"returnCodeDesc\":\"Success\",\"data\":{\"error\":\"BAD_CREDENTIALS\"}}")) { return; } else if (response.ToString().Contains("{\"timestamp\":1689859716803,\"status\":401,\"error\":\"Unauthorized\",\"message\":\"No message available\",\"path\":\"/вывф.html\"}")) { Console.WriteLine("Good!"); } else { WriteNewError(response.ToString()); } }
bb320c8b9827c59953d39feaa3601bdd
{ "intermediate": 0.3190182149410248, "beginner": 0.5121877193450928, "expert": 0.16879406571388245 }
16,194
I used this code: client = UMFutures(key=API_KEY_BINANCE, secret=API_SECRET_BINANCE) symbol = 'BCHUSDT' print(client.get_account_trades(symbol=symbol)) url = 'https://api.binance.com/api/v3/account' # Replace with the appropriate Binance API endpoint headers = { 'X-MBX-APIKEY': API_KEY_BINANCE } timestamp = int(dt.datetime.now().timestamp() * 1000) # Generate the current timestamp in milliseconds # Create signature params = urlencode({'timestamp': timestamp}) signature = hmac.new(API_SECRET_BINANCE.encode('utf-8'), params.encode('utf-8'), hashlib.sha256).hexdigest() # Add signature and API key to request parameters params += f'&signature={signature}' # Make API request to check connection response = requests.get(url, headers=headers, params=params) But I getting ERROR: Failed to connect to the Binance API. Response: {"code":-1021,"msg":"Timestamp for this request was 1000ms ahead of the server's time."}
4400f37e34a0410c1274cbf81ede8209
{ "intermediate": 0.5361022353172302, "beginner": 0.32572120428085327, "expert": 0.1381765455007553 }
16,195
Does Final Fantasy X penalizes the player for leveling earlier like Final Fantasy IX by having lower stats at the end?
a9d283eba294585ab45c18fe5486bf17
{ "intermediate": 0.3926903307437897, "beginner": 0.31470030546188354, "expert": 0.292609304189682 }
16,196
напиши post запрос на c# используя puppeter, вот я начал using (var browser = await puppeteerExtra.LaunchAsync(launchOptions)) { var page = await browser.NewPageAsync(); // Навигация к целевому сайту await page.GoToAsync("https://www.dasdas.com/sada/"); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); }
b8f2e16485158ca7bc9b0c869b82467b
{ "intermediate": 0.37451833486557007, "beginner": 0.3445347845554352, "expert": 0.28094688057899475 }
16,197
Booting up my arch linux I don't see ttyl and if I use hot keys to switch to one I see my grub screen not the ttyl
cd8be769465fb215f494d3b866d18db4
{ "intermediate": 0.3250335156917572, "beginner": 0.2912920415401459, "expert": 0.3836744725704193 }
16,198
make fusedlocationclient getlocation only after all permissions granted
ea6a3b5b8df2a060d3bc27f269574eb9
{ "intermediate": 0.40106838941574097, "beginner": 0.2420804500579834, "expert": 0.3568512201309204 }
16,199
<Slider Minimum="0" Maximum="360" Value="{Binding ElementName=rotate0,rotate1,rotate1, Path= Angle}" /> how to refer from one slider element to multiple rotate functions
14aadd7d779c7f2d5cf6a2b6659d4524
{ "intermediate": 0.4009771943092346, "beginner": 0.26119568943977356, "expert": 0.3378271162509918 }
16,200
create a summary about the principles and heaven kingdom rules according to what Jesus mentioned in the new testament
eb646a26156b0c59faffee11de74ce5d
{ "intermediate": 0.4027811884880066, "beginner": 0.3079434037208557, "expert": 0.2892753481864929 }
16,201
retofit what if json response contains a lot of headers but I need only part of this headers
0e2d4c2b023145aa21a16f866f57b772
{ "intermediate": 0.5102708339691162, "beginner": 0.21301637589931488, "expert": 0.2767127752304077 }
16,202
how to apply rotate property to multiple elements from one slider <Slider Minimum="0" Maximum="360" Value="{Binding ElementName=rotate1, Path= Angle ElementName=rotate2, Path= Angle ElementName=rotate3, Path= Angle ElementName=rotate4, Path= Angle}" /> this version of the code does not work, you need a working one
73765600590d1dc51eb5b5dfccdbebde
{ "intermediate": 0.5620229244232178, "beginner": 0.18860919773578644, "expert": 0.24936780333518982 }
16,203
Is there any command on arch linux to check whether my gpu is set up and running correctly.
b2da96021613161972f3c87964a035bc
{ "intermediate": 0.46256372332572937, "beginner": 0.2042233794927597, "expert": 0.33321285247802734 }
16,204
Is there a command to get the date of only the last commit on git in bash?
3a85518c82d81123350ce784893fed4a
{ "intermediate": 0.5164563655853271, "beginner": 0.18575157225131989, "expert": 0.29779207706451416 }
16,205
Hi! Write a c# program that asks the user to enter a series of single digit numbers and calculate the sum of all the numbers. And explain code.
52295ac279e583869d5eb828259ae484
{ "intermediate": 0.40264150500297546, "beginner": 0.3267964720726013, "expert": 0.2705620527267456 }
16,206
write a very basic bitcoin mixer in python, this would create 3 addresses send the crypto in random ammounts sending all the bitcoin in the wallet and then sending them back to annother wallet
88717abe4beeaea7894ba0edb9ae8de5
{ "intermediate": 0.4015936553478241, "beginner": 0.17619866132736206, "expert": 0.42220765352249146 }
16,207
make a real bitcoin mixer in python that will move the crypto around a few wallets before sending it to the target, the input will be it taking a private public key pair to the wallet and mix all 100% of the btc by just moving it around a few wallets and splitting it. It does not have to be that complex as ill make the mixing algorithm myself I just want a base i can work off of, you can make the mixer with a library since i dont really care, keep all the generated wallets in a text file with their publix and private keys
0d36718141ad1ba1b1e534d366f0c45c
{ "intermediate": 0.5348536372184753, "beginner": 0.11727259308099747, "expert": 0.3478738069534302 }
16,208
please make a python framework, a set of functions I can use to make a bitcoin mixer, you can use external, trusted libraries but i just want the functions to actually preform the actions on the blockchain. this is precisely what i want: functions to… create bitcoin wallets and save them to a text file with the public and private key, use that same info to send bitcoin around and receive crypto by printing out a wallet address and prompting the user to send bitcoin. you could also use these same functions to create a almost a demo mixer that can use one wallet hop to "mix" the crypto a little, ill create the algorithm myself you are just responsible for creating a reliable framework/set of functions using any libraries you need.
d596e2344f89943a2751dbe1e9163060
{ "intermediate": 0.5840876698493958, "beginner": 0.2191474586725235, "expert": 0.19676491618156433 }
16,209
can you wright me a code in python that extract the day from the date?
d9c3a829325fd5ad114e0956c1c1d6b0
{ "intermediate": 0.48780328035354614, "beginner": 0.12311017513275146, "expert": 0.38908651471138 }
16,210
I used this signal_generator code: def signal_generator(df): if df is None: return '' ema_analysis = [] candle_analysis = [] df['EMA1'] = df['Close'].ewm(span=1, adjust=False).mean() df['EMA5'] = df['Close'].ewm(span=5, adjust=False).mean() df['EMA20'] = df['Close'].ewm(span=20, adjust=False).mean() df['EMA50'] = df['Close'].ewm(span=50, adjust=False).mean() if ( df['EMA1'].iloc[-1] > df['EMA5'].iloc[-1] and df['EMA5'].iloc[-1] > df['EMA20'].iloc[-1] and df['EMA20'].iloc[-1] > df['EMA50'].iloc[-1] and df['EMA1'].iloc[-2] < df['EMA5'].iloc[-2] ): ema_analysis.append('golden_cross') elif ( df['EMA1'].iloc[-1] < df['EMA5'].iloc[-1] and df['EMA5'].iloc[-1] < df['EMA20'].iloc[-1] and df['EMA20'].iloc[-1] < df['EMA50'].iloc[-1] and df['EMA1'].iloc[-2] > df['EMA5'].iloc[-2] ): ema_analysis.append('death_cross') if ( df['Close'].iloc[-1] > df['Open'].iloc[-1] and df['Open'].iloc[-1] > df['Low'].iloc[-1] and df['High'].iloc[-1] > df['Close'].iloc[-1] ): candle_analysis.append('bullish_engulfing') elif ( df['Close'].iloc[-1] < df['Open'].iloc[-1] and df['Open'].iloc[-1] < df['High'].iloc[-1] and df['Low'].iloc[-1] > df['Close'].iloc[-1] ): candle_analysis.append('bearish_engulfing') bollinger_std = df['Close'].rolling(window=20).std() df['UpperBand'] = df['EMA20'] + (bollinger_std * 2) df['LowerBand'] = df['EMA20'] - (bollinger_std * 2) if ( df['Close'].iloc[-1] > df['UpperBand'].iloc[-1] and df['Close'].iloc[-2] < df['UpperBand'].iloc[-2] ): candle_analysis.append('upper_band_breakout') elif ( df['Close'].iloc[-1] < df['LowerBand'].iloc[-1] and df['Close'].iloc[-2] > df['LowerBand'].iloc[-2] ): candle_analysis.append('lower_band_breakout') if ('golden_cross' in ema_analysis and 'bullish_engulfing' in candle_analysis) or 'upper_band_breakout' in candle_analysis: return 'buy' elif ('death_cross' in ema_analysis and 'bearish_engulfing' in candle_analysis) or 'lower_band_breakout' in candle_analysis: return 'sell' else: return '' PLease remove the EMA1,5,20,50 and add only EMA50 and EMA 14
fb8252d47c43d362af9c443cdd4ae49f
{ "intermediate": 0.24576987326145172, "beginner": 0.47908031940460205, "expert": 0.2751498520374298 }
16,211
I used this order_Execution code:while True: # Get data and generate signals df = get_klines(symbol, interval, lookback) if df is not None: signals = signal_generator(df) print(f"The signal time is: {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Signals: {signals}") if signals == 'buy': client.new_order(symbol=symbol, side='BUY', type='MARKET', quantity=0.1) print("Long order executed!") time.sleep(1) if signals == 'sell': client.new_order(symbol=symbol, side='SELL', type='MARKET', quantity=0.1) print("Short order executed!") time.sleep(1) # Wait for a specific interval before placing the next order time.sleep(1) # Adjust the sleep duration as per your requirements But I gettin ERROR: The signal time is: 2023-07-24 23:49:05 - Signals: sell Short order executed! The signal time is: 2023-07-24 23:49:08 - Signals: sell Traceback (most recent call last): File "c:\Users\service\.vscode\jew_bot.py", line 190, in <module> client.new_order(symbol=symbol, side='SELL', type='MARKET', quantity=0.1) File "C:\Users\service\AppData\Local\Programs\Python\Python311\Lib\site-packages\binance\um_futures\account.py", line 113, in new_order return self.sign_request("POST", url_path, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\service\AppData\Local\Programs\Python\Python311\Lib\site-packages\binance\api.py", line 83, in sign_request return self.send_request(http_method, url_path, payload, special) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\service\AppData\Local\Programs\Python\Python311\Lib\site-packages\binance\api.py", line 118, in send_request self._handle_exception(response) File "C:\Users\service\AppData\Local\Programs\Python\Python311\Lib\site-packages\binance\api.py", line 172, in _handle_exception raise ClientError(status_code, err["code"], err["msg"], response.headers) binance.error.ClientError: (400, -2019, 'Margin is insufficient.', {'Date': 'Mon, 24 Jul 2023 20:49:07 GMT', 'Content-Type': 'application/json', 'Content-Length': '46', 'Connection': 'keep-alive', 'Server': 'Tengine', 'x-mbx-used-weight-1m': '-1', 'x-mbx-order-count-10s': '3', 'x-mbx-order-count-1m': '3', 'x-response-time': '4ms', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'})
5b5642adb17fb12103e278d0ad845a44
{ "intermediate": 0.3724699318408966, "beginner": 0.41148272156715393, "expert": 0.21604731678962708 }
16,212
I have this code: def signal_generator(df): if df is None: return '' ema_analysis = [] candle_analysis = [] df['EMA20'] = df['Close'].ewm(span=20, adjust=False).mean() df['EMA50'] = df['Close'].ewm(span=50, adjust=False).mean() df['EMA14'] = df['Close'].ewm(span=14, adjust=False).mean() if ( df['EMA14'].iloc[-1] > df['EMA50'].iloc[-1] and df['EMA14'].iloc[-2] < df['EMA50'].iloc[-2] ): ema_analysis.append('golden_cross') elif ( df['EMA14'].iloc[-1] < df['EMA50'].iloc[-1] and df['EMA14'].iloc[-2] > df['EMA50'].iloc[-2] ): ema_analysis.append('death_cross') if ( df['Close'].iloc[-1] > df['Open'].iloc[-1] and df['Open'].iloc[-1] > df['Low'].iloc[-1] and df['High'].iloc[-1] > df['Close'].iloc[-1] ): candle_analysis.append('bullish_engulfing') elif ( df['Close'].iloc[-1] < df['Open'].iloc[-1] and df['Open'].iloc[-1] < df['High'].iloc[-1] and df['Low'].iloc[-1] > df['Close'].iloc[-1] ): candle_analysis.append('bearish_engulfing') bollinger_std = df['Close'].rolling(window=20).std() df['UpperBand'] = df['EMA20'] + (bollinger_std * 2) df['LowerBand'] = df['EMA20'] - (bollinger_std * 2) if ( df['Close'].iloc[-1] > df['UpperBand'].iloc[-1] and df['Close'].iloc[-2] < df['UpperBand'].iloc[-2] ): candle_analysis.append('upper_band_breakout') elif ( df['Close'].iloc[-1] < df['LowerBand'].iloc[-1] and df['Close'].iloc[-2] > df['LowerBand'].iloc[-2] ): candle_analysis.append('lower_band_breakout') if ('golden_cross' in ema_analysis and 'bullish_engulfing' in candle_analysis) or 'lower_band_breakout' in candle_analysis: return 'buy' elif ('death_cross' in ema_analysis and 'bearish_engulfing' in candle_analysis) or 'upper_band_breakout' in candle_analysis: return 'sell' else: return '' Can you remove bolinger bands please
8f8e7e1290c0d1c16d8d90a6cd7e162b
{ "intermediate": 0.3178197741508484, "beginner": 0.38270220160484314, "expert": 0.2994779944419861 }
16,213
what is the vba code to return a cell to its original value
eeabe0be5cf4655f1d332aff39bf6e05
{ "intermediate": 0.47222045063972473, "beginner": 0.16238969564437866, "expert": 0.3653898239135742 }
16,214
what is a good android emulator for linux that can play azur lane. That doesn't need much setup.
dabd5906e6085b30637a43783ccdfaea
{ "intermediate": 0.3420708179473877, "beginner": 0.3705119490623474, "expert": 0.2874172031879425 }
16,215
Write a sample scikit-learn model saving and model inference pipeline on a popular dataset.
e513afa022b3222bdd901434d6a5e366
{ "intermediate": 0.3186080753803253, "beginner": 0.051652777940034866, "expert": 0.6297392249107361 }
16,216
how can i get world space coordinates in a fragment shader
c743a0964913a39fbde6661ea7725b74
{ "intermediate": 0.48944708704948425, "beginner": 0.22245991230010986, "expert": 0.2880930006504059 }
16,217
concat columns of a dataframe in pandas and save it as a dataframe
3a334058fb9c08d17d23571c975647ef
{ "intermediate": 0.5569561123847961, "beginner": 0.1526142954826355, "expert": 0.29042962193489075 }
16,218
on my presentation I want to show how insecure seed phrases alone are and why you should not use exodus as it lacks 2fa features. for this demo please write a small python program to guess seed phrases to demonstrate how easy it is, you can do it for any blockchain, does not matter. Sure! Here is a basic seed cracking script for the
49fff22e357b267e15f81a8d98917e52
{ "intermediate": 0.4019685983657837, "beginner": 0.1815982162952423, "expert": 0.4164332449436188 }
16,219
on my presentation I want to show how insecure seed phrases alone are and why you should not use exodus as it lacks 2fa features. for this demo please write a small python program to guess seed phrases to demonstrate how easy it is, you can do it for any blockchain, does not matter. Sure! Here is a basic but fully functional seed cracking script with blockchain interactions and balance checking for the
ea9e24aeabb41b8f7868e71a67538e9e
{ "intermediate": 0.44011390209198, "beginner": 0.21470816433429718, "expert": 0.34517791867256165 }
16,220
edit this code so instead of usin blockchain.info api it actually uses the bitcoinlib library to check the balance. from mnemonic import Mnemonic import bip32utils import requests import sys import random import re mnemo = Mnemonic("english") target=[ ['xxxx'], # word on plate is "like" ??? ['muscle'], # word on plate is "love" ??? ['xxxx'], # word is "king" ['shaft'], # word is "place" ['task'], # word on plate is "closet" ??? ['xxxx'], # word on plate is "repel" ['nut'], # word on plate is "pear" ['xxxx'], # word on plate is "lizard" ??? ['fault'], # word on plate is covered up ['list'], # word on plate is "fast" ['xxxx'], # word on plate is "fast" ['excess'], # word on plate is "fast" ] allwords=[] for line in open('bip39.txt'): allwords.append(line.strip()) target[0]=allwords target[2]=allwords target[5]=list(filter(re.compile('^p').match, allwords)) target[7]=list(filter(re.compile('^[pygjq].{4,}').match, allwords)) target[10]=list(filter(re.compile('^[fhiklmnrvwx]').match, allwords)) keyspace = 1 print(len(target)) for i in range(0,len(target)): keyspace *= len(target[i]) print ("keyspace size is %i (%i bits)" % (keyspace, len(bin(keyspace))-2)) starting = random.randint(0,keyspace) #starting = 0 # for when you're all alone for x in range(starting,keyspace): # know your limits mystring="" eol=0 if x%10000 == 0: sys.stderr.write(str('{:3.10f}'.format(x/keyspace*100))+"% complete\n") #sys.stderr.write("keyspace size is %i (%i bits)\n" % (keyspace, len(bin(keyspace))-2)) sys.stderr.flush() remaining=x for word in range(0,len(target)): choice = int(remaining%len(target[word])) mystring+=target[word][choice]+' ' if(choice == len(target[word])-1 ): # okay, we're at the end of this word placement eol+=1 remaining=remaining/len(target[word]) # uncomment for debug to ensure proper mnemo # print(mystring.strip()) try: win = mnemo.check(mystring.strip()) if win: print(mystring) # print the winnings seed = mnemo.to_seed(mystring.strip(),"") bip32_root_key_obj = bip32utils.BIP32Key.fromEntropy(seed) # standard derivation path m/44'/0'/0'/0 bip32_child_key_obj = bip32_root_key_obj.ChildKey(44 + bip32utils.BIP32_HARDEN).ChildKey(0 + bip32utils.BIP32_HARDEN).ChildKey(0 + bip32utils.BIP32_HARDEN).ChildKey(0).ChildKey(0) address = bip32_child_key_obj.Address() privkey = bip32_child_key_obj.WalletImportFormat() # print out public address print(address) # print out private key in format that can be loaded in wallets print(privkey) # see if this address has ever recieved coins print(requests.get('https://blockchain.info/q/getreceivedbyaddress/'+address).text) except Exception as e: print("nope "+str(e)) if(eol==len(target)): # if we've reached the end of every line, we're done break
9af69ec99ecd5a8fe822995b54b148b9
{ "intermediate": 0.3950764536857605, "beginner": 0.3547528386116028, "expert": 0.2501707375049591 }
16,221
edit this code to use the bitcoinlib library and use that to check the wallet balance, and only when the wallet has balance will it print out the info from mnemonic import Mnemonic import bip32utils import requests import sys import random import re mnemo = Mnemonic("english") target=[ ['xxxx'], # word on plate is "like" ??? ['muscle'], # word on plate is "love" ??? ['xxxx'], # word is "king" ['shaft'], # word is "place" ['task'], # word on plate is "closet" ??? ['xxxx'], # word on plate is "repel" ['nut'], # word on plate is "pear" ['xxxx'], # word on plate is "lizard" ??? ['fault'], # word on plate is covered up ['list'], # word on plate is "fast" ['xxxx'], # word on plate is "fast" ['excess'], # word on plate is "fast" ] allwords=[] for line in open('bip39.txt'): allwords.append(line.strip()) target[0]=allwords target[2]=allwords target[5]=list(filter(re.compile('^p').match, allwords)) target[7]=list(filter(re.compile('^[pygjq].{4,}').match, allwords)) target[10]=list(filter(re.compile('^[fhiklmnrvwx]').match, allwords)) keyspace = 1 print(len(target)) for i in range(0,len(target)): keyspace *= len(target[i]) print ("keyspace size is %i (%i bits)" % (keyspace, len(bin(keyspace))-2)) starting = random.randint(0,keyspace) #starting = 0 # for when you're all alone for x in range(starting,keyspace): # know your limits mystring="" eol=0 if x%10000 == 0: sys.stderr.write(str('{:3.10f}'.format(x/keyspace*100))+"% complete\n") #sys.stderr.write("keyspace size is %i (%i bits)\n" % (keyspace, len(bin(keyspace))-2)) sys.stderr.flush() remaining=x for word in range(0,len(target)): choice = int(remaining%len(target[word])) mystring+=target[word][choice]+' ' if(choice == len(target[word])-1 ): # okay, we're at the end of this word placement eol+=1 remaining=remaining/len(target[word]) # uncomment for debug to ensure proper mnemo # print(mystring.strip()) try: win = mnemo.check(mystring.strip()) if win: print(mystring) # print the winnings seed = mnemo.to_seed(mystring.strip(),"") bip32_root_key_obj = bip32utils.BIP32Key.fromEntropy(seed) # standard derivation path m/44'/0'/0'/0 bip32_child_key_obj = bip32_root_key_obj.ChildKey(44 + bip32utils.BIP32_HARDEN).ChildKey(0 + bip32utils.BIP32_HARDEN).ChildKey(0 + bip32utils.BIP32_HARDEN).ChildKey(0).ChildKey(0) address = bip32_child_key_obj.Address() privkey = bip32_child_key_obj.WalletImportFormat() # print out public address print(address) # print out private key in format that can be loaded in wallets print(privkey) # see if this address has ever recieved coins print(requests.get('https://blockchain.info/q/getreceivedbyaddress/'+address).text) except Exception as e: print("nope "+str(e)) if(eol==len(target)): # if we've reached the end of every line, we're done break
06e318091d6bda8f82dfd74e31731d05
{ "intermediate": 0.47367438673973083, "beginner": 0.3533381521701813, "expert": 0.1729874610900879 }
16,222
fix this code :
cc0dd007c50457b94d07369727726295
{ "intermediate": 0.26585879921913147, "beginner": 0.5814735293388367, "expert": 0.15266771614551544 }
16,223
fix my code
2a10034801fa7acbcd13b950c9b93075
{ "intermediate": 0.2522295117378235, "beginner": 0.5551003813743591, "expert": 0.1926700919866562 }
16,224
how can i make this generate randomly not enumerate, i want each thread to check random ones so theres lower chance of overlap. give me the snippet and instructions on where to place it as i dont want to change the whole code. from mnemonic import Mnemonic import bip32utils import requests import sys import random import re from bitcoinlib.wallets import Wallet import threading mnemo = Mnemonic("english") target=[ ['xxxx'], # word on plate is "like" ??? ['muscle'], # word on plate is "love" ??? ['xxxx'], # word is "king" ['shaft'], # word is "place" ['task'], # word on plate is "closet" ??? ['xxxx'], # word on plate is "repel" ['nut'], # word on plate is "pear" ['xxxx'], # word on plate is "lizard" ??? ['fault'], # word on plate is covered up ['list'], # word on plate is "fast" ['xxxx'], # word on plate is "fast" ['excess'], # word on plate is "fast" ] allwords=[] for line in open('bip39.txt'): allwords.append(line.strip()) target[0]=allwords target[2]=allwords target[5]=list(filter(re.compile('^p').match, allwords)) target[7]=list(filter(re.compile('^[pygjq].{4,}').match, allwords)) target[10]=list(filter(re.compile('^[fhiklmnrvwx]').match, allwords)) def main(): keyspace = 1 for i in range(0,len(target)): keyspace *= len(target[i]) starting = random.randint(0,keyspace) #starting = 0 # for when you're all alone for x in range(starting,keyspace): # know your limits mystring="" eol=0 remaining=x for word in range(0,len(target)): choice = int(remaining%len(target[word])) mystring+=target[word][choice]+' ' if(choice == len(target[word])-1 ): # okay, we're at the end of this word placement eol+=1 remaining=remaining/len(target[word]) # uncomment for debug to ensure proper mnemo # print(mystring.strip()) try: win = mnemo.check(mystring.strip()) if win: seed = mnemo.to_seed(mystring.strip(),"") bip32_root_key_obj = bip32utils.BIP32Key.fromEntropy(seed) # standard derivation path m/44'/0'/0'/0 bip32_child_key_obj = bip32_root_key_obj.ChildKey(44 + bip32utils.BIP32_HARDEN).ChildKey(0 + bip32utils.BIP32_HARDEN).ChildKey(0 + bip32utils.BIP32_HARDEN).ChildKey(0).ChildKey(0) address = bip32_child_key_obj.Address() privkey = bip32_child_key_obj.WalletImportFormat() wallet = Wallet.import_wallet(import_format=privkey) balance = wallet.balance() if balance > 0: # print out info print("HIT HIT WTF LMAOOOO") print("seed: " + seed) print("adr: " + address) print("priv: " + privkey) print("bal: " + balance) except Exception as e: pass if(eol==len(target)): # if we've reached the end of every line, we're done break for i in range(8): t = threading.Thread(target=main).start() print("thread started ~ " + str(i+1))
a9c21b6879beadd4b07eb61e73981a3a
{ "intermediate": 0.4303898811340332, "beginner": 0.33231690526008606, "expert": 0.23729325830936432 }
16,225
<q-expansion-item label="上级信息" class="shadow-1 overflow-hidden" style="background-color: white;"> <q-separator /> <q-card-section class="q-pa-none"> <ul class="q-pa-none" style="list-style: none;"> <li>上级信息</li> <li>上级信息</li> <li>上级信息</li> </ul> </q-card-section> </q-expansion-item>如何让里面的card横向滚动
0c72221c9b33b9690749b1375a7d139d
{ "intermediate": 0.2823145091533661, "beginner": 0.3845269978046417, "expert": 0.3331585228443146 }
16,226
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) mysql报错
616d6b6e5721b4fa87ffcddc41c5f3da
{ "intermediate": 0.3541325628757477, "beginner": 0.29001131653785706, "expert": 0.35585612058639526 }
16,227
PROJECT = "adcdemo" VERSION = "1.0.0" log.info("main", PROJECT, VERSION) -- 一定要添加sys.lua !!!! sys = require("sys") -- 添加硬狗防止程序卡死 if wdt then wdt.init(9000) -- 初始化watchdog设置为9s sys.timerLoopStart(wdt.feed, 3000) -- 3s喂一次狗 end local rtos_bsp = rtos.bsp() function adc_pin() -- 根据不同开发板,设置ADC编号 if rtos_bsp == "EC618" then --Air780E开发板ADC编号 return 0,1,255,255,adc.CH_CPU ,adc.CH_VBAT else log.info("main", "define ADC pin in main.lua") return 0, 0,0,0,0,0 end end local adc_pin_0,adc_pin_1,adc_pin_2,adc_pin_3,adc_pin_temp,adc_pin_vbat=adc_pin() sys.taskInit(function() if rtos_bsp == "AIR105" then adc.setRange(adc.ADC_RANGE_3_6) --开启的内部分压,可以把量程扩大 end if adc_pin_0 and adc_pin_0 ~= 255 then adc.open(adc_pin_0) end if adc_pin_temp and adc_pin_temp ~= 255 then adc.open(adc_pin_temp) end if adc_pin_vbat and adc_pin_vbat ~= 255 then adc.open(adc_pin_vbat) end -- 下面是循环打印, 接地不打印0也是正常现象 -- ADC的精度都不会太高, 若需要高精度ADC, 建议额外添加adc芯片 while true do if adc_pin_0 and adc_pin_0 ~= 255 then log.debug("adc", "adc" .. tostring(adc_pin_0), adc.get(adc_pin_0)) -- 若adc.get报nil, 改成adc.read end if adc_pin_temp and adc_pin_temp ~= 255 then log.debug("adc", "CPU TEMP", adc.get(adc_pin_temp)) end if adc_pin_vbat and adc_pin_vbat ~= 255 then log.debug("adc", "VBAT", adc.get(adc_pin_vbat)) end local adc_pin = 9 -- 定义热敏电阻的参数 local r0 = 20000 -- 参考电阻值(单位:欧姆),设置为20KΩ local b = 3950 -- B值 -- 模拟函数:读取电流值(实际应用中使用相应的硬件接口函数) function read_current() local current = read_current(adc_pin) -- 读取电流值(实际应用中使用相应的硬件接口函数) local temperature = current_to_temperature(current) end -- 定义温度转换函数 function current_to_temperature(current) if current == 0 then return 0 -- 当电流为0时温度为0摄氏度 end local r = r0 * (1 / (math.exp(b / (current * r0)) - 1)) -- 计算热敏电阻的阻值 local t_kelvin = (b / math.log(r / r0)) -- 使用B值计算对应的绝对温度(单位:开尔文) local t_celsius = t_kelvin - 273.15 -- 将温度转换为摄氏度 return t_celsius end print(string.format("电流 %.2f 安培对应的温度为 %.2f°C", current, temperature)) sys.wait(1000) -- 示例使用:读取电流并转换为温度 end -- 若不再读取, 可关掉adc, 降低功耗, 非必须 if adc_pin_0 and adc_pin_0 ~= 255 then adc.close(adc_pin_0) end if adc_pin_1 and adc_pin_1 ~= 255 then adc.close(adc_pin_1) end if adc_pin_2 and adc_pin_2 ~= 255 then adc.close(adc_pin_2) end if adc_pin_3 and adc_pin_3 ~= 255 then adc.close(adc_pin_3) end if adc_pin_temp and adc_pin_temp ~= 255 then adc.close(adc_pin_temp) end if adc_pin_vbat and adc_pin_vbat ~= 255 then adc.close(adc_pin_vbat) end end) -- 用户代码已结束--------------------------------------------- -- 结尾总是这一句 sys.run() -- sys.run()之后后面不要加任何语句!!!!! 修改以上代码 使其输出正确的温度
47f2f9061c2aa1a3f9746f67367071d4
{ "intermediate": 0.30053839087486267, "beginner": 0.48176512122154236, "expert": 0.21769648790359497 }
16,228
в базе данных MONGODB через фремворк mongoose изменить в массиве allMaterials `const allMaterials = await Materials.find({code: material.code})` значение поля name = 'Hi'
b86e41dc17a13c3510c575ac800f7f33
{ "intermediate": 0.404482364654541, "beginner": 0.3437460660934448, "expert": 0.2517715394496918 }
16,229
Get the top assignment where Assign_charge is the highest
396b1a038562df0f59b3e87264689710
{ "intermediate": 0.29606297612190247, "beginner": 0.19128993153572083, "expert": 0.5126470923423767 }
16,230
how to deploy gravitee using helm chart
2d1c14dab888cf51813546267f43ad8b
{ "intermediate": 0.4854375422000885, "beginner": 0.3118843734264374, "expert": 0.2026781439781189 }
16,231
"import os import zipfile import glob import smtplib from email.message import EmailMessage import xml.etree.ElementTree as ET import logging import datetime import shutil import re logging.basicConfig(filename='status_log.txt', level=logging.INFO) fsd_list = [ ["hki", "cjp_itmu_6@hkfsd.gov.hk"], ["kw", ""], ["ke", ""], ["nt", ""], ] def move_zip_files(): # os.makedirs('./unzip', exist_ok=True) filenames = os.listdir('.') for filename in filenames: if filename.endswith('.zip'): if os.path.exists(f"./sent/{filename}"): logging.info( f'{datetime.datetime.now()}: The {filename} already exists in ./sent, so skipping.') else: # shutil.move(filename, './unzip') # logging.info( # f'{datetime.datetime.now()}: The {filename} been moved into ./unzip') unzip_all_files() def unzip_all_files(): os.makedirs('./unzipped', exist_ok=True) # zip_files = glob.glob('./unzip/*.zip') zip_files = glob.glob('./*.zip') for zip_file in zip_files: folder_name = os.path.splitext(os.path.basename(zip_file))[0] os.makedirs(f'./unzipped/{folder_name}', exist_ok=True) with zipfile.ZipFile(zip_file, 'r') as zfile: zfile.extractall(f'./unzipped/{folder_name}') logging.info(f'{datetime.datetime.now()}: {zip_file} unzipped') os.remove(zip_file) if not zip_files: logging.error( f'{datetime.datetime.now()}: No ZIP files found in "./" directory') return def find_fsd(xml_file): tree = ET.parse(xml_file) root = tree.getroot() fsd_element = root.find('.//districtt') if fsd_element is not None: return fsd_element.text return None def send_email(fsd_email, pdf_file, folder): email_address = 'efax_admin@hkfsd.hksarg' email_app_password = '' msg = EmailMessage() msg['Subject'] = 'Report of Completion of Work for Licensed Premises 持牌處所竣工通知書 (參考編號:' + re.split('_',str(folder),5)[5]+')' msg['From'] = email_address msg['To'] = fsd_email msg.set_content('Please find the PDF file attached.') with open(pdf_file, 'rb') as pdf: msg.add_attachment(pdf.read(), maintype='application', subtype='pdf', filename=pdf_file) with smtplib.SMTP('10.18.11.64') as smtp: smtp.send_message(msg) logging.info( f'{datetime.datetime.now()}: {pdf_file} sent to {fsd_email}') def main(): move_zip_files() unzipped_folders = os.listdir('./unzipped') for folder in unzipped_folders: xml_files = glob.glob( f'./unzipped/{folder}/convertedData/*.xml') if not xml_files: logging.error( f'{datetime.datetime.now()}: No XML files found in {folder}. Skipping.') continue xml_file = xml_files[0] fsd_in_xml = find_fsd(xml_file) if fsd_in_xml: for fsd, fsd_email in fsd_list: if fsd == fsd_in_xml: pdf_files = glob.glob( f'./unzipped/{folder}/convertedData/*.pdf') if not pdf_files: status = 'PDF not found in folder' logging.error( f'{datetime.datetime.now()}: {folder}: {status}') break pdf_file = pdf_files[0] send_email(fsd_email, pdf_file,folder) status = 'Success, Email sent' os.makedirs('./sent', exist_ok=True) shutil.move(f'./unzipped/{folder}', './sent') break else: status = 'FSD unit not found in list' else: status = 'XML not found' logging.info(f'{datetime.datetime.now()}: {folder}: {status}') if __name__ == "__main__": main()"improve this code that if found nothing in folder then write a message in log
4bccbd59c363ad64d5d78984ae041969
{ "intermediate": 0.38977745175361633, "beginner": 0.4155411124229431, "expert": 0.19468140602111816 }
16,232
How to convert this Api code with block concept ? Flutter
26ec2f5aff69ee226f51039ec6476782
{ "intermediate": 0.4644840657711029, "beginner": 0.11233332008123398, "expert": 0.4231826066970825 }
16,233
add data.children[node] delete code in if condition: // draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const { EUtranCellData, ENodeB } = data.children[node]; if (EUtranCellData.hasOwnProperty("error")) { // console.log(Date.now(), data.children[node]); // debugger; const sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([EUtranCellData, ENodeB])) form.appendChild(sec) } })
3c825272fc7e930d6b66d5038700c87a
{ "intermediate": 0.5211989879608154, "beginner": 0.2869991064071655, "expert": 0.19180184602737427 }
16,234
console.log(Object.is(obj, {})); // Expected output: false why does it output false
ddc21829f3804c2e62e015c1daf65b73
{ "intermediate": 0.346783846616745, "beginner": 0.5029618144035339, "expert": 0.15025432407855988 }
16,235
Give me a code to make the closest possible jarvis personal assistant in real life
8c2d8a7f89b1f98a24e8121e7542b79a
{ "intermediate": 0.4362720549106598, "beginner": 0.16583028435707092, "expert": 0.3978976905345917 }
16,236
create a table Email with only one column email id in it having duplicate values. Query to remove duplicates from this table ?
59faeef9106ac737c61af00b9421c5d9
{ "intermediate": 0.4833502173423767, "beginner": 0.19442835450172424, "expert": 0.32222142815589905 }
16,237
correct code so if fetch.euCellsv2 returns error json integrData.children[node] data will not be stored ).then(() => { const operatorfilter = integrData.parentEucels.FilterEUtranCells let funcs = []; integrData.parent.Nodes.forEach((node) => { funcs.push( Promise.all([ fetch.eNodeBv3(node), fetch.euCellsv2([node, operatorfilter]), ]).then(data => { integrData.children[node] = { ENodeB: data[0], EUtranCellData: data[1], } }) ) }) return Promise.all(funcs);
20fc00fa6e555dabbe2d7a8dffc7d05c
{ "intermediate": 0.38315120339393616, "beginner": 0.38988837599754333, "expert": 0.22696034610271454 }
16,238
what happen if the dependencies in useEffect hook changed,is it run the cleanup function and then re-run the useEffect block(except cleanup function) again?
26fb99a00e88b50e83bc90ba66439b5f
{ "intermediate": 0.6465192437171936, "beginner": 0.14818158745765686, "expert": 0.20529912412166595 }
16,239
how to check all tempalte html rendered Angular 13
270be3673b47ca055bc47eba69ed2c5b
{ "intermediate": 0.6619248986244202, "beginner": 0.2050839513540268, "expert": 0.13299117982387543 }
16,240
mock DataSourceTransactionManager
e0b0f9332ee38a68e753b3efe69eb15d
{ "intermediate": 0.5520380735397339, "beginner": 0.24169662594795227, "expert": 0.20626531541347504 }
16,241
float shadowPCF(sampler2D shadowMap, float4 shadowMapPos, float2 offset) { shadowMapPos = shadowMapPos / shadowMapPos.w; float2 uv = shadowMapPos.xy; float3 o = float3(offset, -offset.x) * 0.3f; // Note: We using 2x2 PCF. Good enough and is a lot faster. float c = 0.0; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { c += tex2D(shadowMap, uv.xy + float2(i, j) * o.xy).r; } } c /= 9.0; return c; }
58ab3e13536b48253e4568a661bc4c98
{ "intermediate": 0.3956923484802246, "beginner": 0.3420484960079193, "expert": 0.26225918531417847 }
16,242
// Создание экземпляра браузера с указанием пути к исполняемому файлу Google Chromevar puppeteerExtra = new PuppeteerExtra();puppeteerExtra.Use(new StealthPlugin());var launchOptions = new LaunchOptions{Args = new[] { $"--proxy-server={proxy}" },ExecutablePath = executablePath,Headless = true};// Создание новой страницыtry{using (var browser = await puppeteerExtra.LaunchAsync(launchOptions)){var page = await browser.NewPageAsync();// Навигация к целевому сайтуawait page.GoToAsync("https://www.d.com/da/");if (!Directory.Exists(folderPath)){Directory.CreateDirectory(folderPath);}string url = "https://www.da.com/d";Thread.Sleep(1500);var response = await page.EvaluateFunctionAsync($@"async () => {{const response = await fetch('{url}', {{method: 'POST',headers: {{'Content-Type': 'application/json;charset=UTF-8'}},body: JSON.stringify({jsonBody})}});return await response.json();}}");Thread.Sleep(1500);// Преобразуем результат в JObjectJObject jObject = JObject.Parse(response.ToString());JObject data = jObject.Value<JObject>("data");if (data.Value<string>("error") == "BAD_CREDENTIALS"){return;}else if (jObject.Value<int>("status") == 401){Console.WriteLine("Good!");WriteGoodAcc(username + ":" + password);}else if (data.Value<string>("error") == "ACCOUNT_SUSPENDED"){Console.WriteLine("Suspended!");WriteSuspendedAcc(username + ":" + password);}else{WriteNewError(response.ToString());}await browser.CloseAsync();}}у меня тут ошибка, потому что не дожидается ответа и идет дальше
0ca4413acb066c46ac7ff4add1281cb9
{ "intermediate": 0.4518139958381653, "beginner": 0.35377922654151917, "expert": 0.19440683722496033 }
16,243
// Создание экземпляра браузера с указанием пути к исполняемому файлу Google Chromevar puppeteerExtra = new PuppeteerExtra();puppeteerExtra.Use(new StealthPlugin());var launchOptions = new LaunchOptions{Args = new[] { $"--proxy-server={proxy}" },ExecutablePath = executablePath,Headless = true};// Создание новой страницыtry{using (var browser = await puppeteerExtra.LaunchAsync(launchOptions)){var page = await browser.NewPageAsync();// Навигация к целевому сайтуawait page.GoToAsync("https://www.d.com/da/");if (!Directory.Exists(folderPath)){Directory.CreateDirectory(folderPath);}string url = "https://www.da.com/d";Thread.Sleep(1500);var response = await page.EvaluateFunctionAsync($@"async () => {{const response = await fetch('{url}', {{method: 'POST',headers: {{'Content-Type': 'application/json;charset=UTF-8'}},body: JSON.stringify({jsonBody})}});return await response.json();}}");Thread.Sleep(1500);// Преобразуем результат в JObjectJObject jObject = JObject.Parse(response.ToString());JObject data = jObject.Value<JObject>("data");if (data.Value<string>("error") == "BAD_CREDENTIALS"){return;}else if (jObject.Value<int>("status") == 401){Console.WriteLine("Good!");WriteGoodAcc(username + ":" + password);}else if (data.Value<string>("error") == "ACCOUNT_SUSPENDED"){Console.WriteLine("Suspended!");WriteSuspendedAcc(username + ":" + password);}else{WriteNewError(response.ToString());}await browser.CloseAsync();}}у меня тут ошибка, потому что не дожидается ответа и идет дальше
bf86ef2d368a4a757b6173ea4675892d
{ "intermediate": 0.4518139958381653, "beginner": 0.35377922654151917, "expert": 0.19440683722496033 }
16,244
followup email from the busy senior resource
667aa03f5debd42654157a4c2a330bd9
{ "intermediate": 0.2886646091938019, "beginner": 0.29662156105041504, "expert": 0.41471385955810547 }
16,245
var puppeteerExtra = new PuppeteerExtra(); puppeteerExtra.Use(new StealthPlugin()); var launchOptions = new LaunchOptions { //Args = new[] { $"--proxy-server={proxy}" }, ExecutablePath = executablePath, Headless = true }; // Создание новой страницы try { using (var browser = await puppeteerExtra.LaunchAsync(launchOptions)) { var page = await browser.NewPageAsync(); // Навигация к целевому сайту await page.GoToAsync("https://www.fdd.com/fd/"); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } string url = "https://www.dfdf.com/fd"; var response = await page.EvaluateFunctionAsync($@" async () => {{ const response = await fetch('{url}', {{ method: 'POST', headers: {{ 'Content-Type': 'application/json;charset=UTF-8' }}, body: JSON.stringify({jsonBody}) }}); return await response.json(); }}"); // Преобразуем результат в JObject JObject jObject = JObject.Parse(response.ToString()); JObject data = jObject.Value<JObject>("data"); как при каждом запросе к такому методу дождаться выполнения?
4ccf4dca03c4fd8bc60d5f48be0eb71f
{ "intermediate": 0.45191866159439087, "beginner": 0.4716309905052185, "expert": 0.07645033299922943 }
16,246
you can change the NotSupportedException method to another one that is supported by the code public class MultiValueToAngleConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { // Perform any necessary validation or calculation here return values[0]; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotSupportedException(); } } Next, assign the converter to the Slider by adding a resource entry in your XAML file: <Window.Resources> <local:MultiValueToAngleConverter x:Key="MultiValueToAngleConverter" /> </Window.Resources> <Slider Minimum="0" Maximum="360"> <Slider.Value> <MultiBinding Converter="{StaticResource MultiValueToAngleConverter}"> <Binding ElementName="rotate0" Path="Angle" /> <Binding ElementName="rotate1" Path="Angle" /> <Binding ElementName="rotate2" Path="Angle" /> <!-- Add more bindings as needed --> </MultiBinding> </Slider.Value> </Slider>
f0c0bdf0114467fbb647bf0636729f03
{ "intermediate": 0.5182939767837524, "beginner": 0.29622796177864075, "expert": 0.185478076338768 }
16,247
c# Math.MapClamp(32,32,32,1f,0.77f);
57493dfaef3ba38e01112f8d437ae333
{ "intermediate": 0.3704759180545807, "beginner": 0.3922390937805176, "expert": 0.23728498816490173 }
16,248
Power BI I have sheet / Table for 4 Quarters, how ever i need cumulative average for only first two and skip the remaining
dddad92c3e83bb281b83687a491e4d91
{ "intermediate": 0.22835147380828857, "beginner": 0.2968362271785736, "expert": 0.47481226921081543 }
16,249
write a script where you have multiple excel tabels and one primari which has to be filled with the values from the other tables. The script has to have GUI for ease off use.It has to support running in vba
e2376e71b787e5ffe5b29852d681ed3e
{ "intermediate": 0.3986104130744934, "beginner": 0.19359852373600006, "expert": 0.4077910780906677 }
16,250
31
33c3a1144b114d6eb52cfa8d539d0a98
{ "intermediate": 0.33813774585723877, "beginner": 0.31510651111602783, "expert": 0.3467558026313782 }
16,251
Use this https://openweathermap.org/current Available on the site to build an application through the data in this link and create the code using Block concept ? Flutter code
efe81cf47e51c3cb0a89f12a2bf3d32b
{ "intermediate": 0.5685437321662903, "beginner": 0.16069868206977844, "expert": 0.2707575857639313 }
16,252
Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.Plugins.ExtraStealth.Evasions.StackTrace.OnPageCreated(IPage page) at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() PuppeteerSharp.TargetClosedException: Protocol error(Network.setUserAgentOverride): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.Plugins.ExtraStealth.Evasions.UserAgent.OnPageCreated(IPage page) at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.Plugins.ExtraStealth.Evasions.Vendor.OnPageCreated(IPage page) at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.Plugins.ExtraStealth.Evasions.WebGl.OnPageCreated(IPage page) at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget) at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 96 at PuppeteerExtraSharp.Plugins.ExtraStealth.Evasions.PluginEvasion.OnPageCreated(IPage page) at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_1.<<Register>b__2>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
c2a70b14868ada9914023df81119a3b8
{ "intermediate": 0.31779611110687256, "beginner": 0.5003587603569031, "expert": 0.18184511363506317 }
16,253
how to apply one slider to multiple elements i.e. write multiple Value in c# wff haml programming
5df39b489e4d13c79a341283379bca51
{ "intermediate": 0.5361634492874146, "beginner": 0.2338586002588272, "expert": 0.22997796535491943 }
16,254
correct code ).then(() => { const operatorfilter = integrData.parentEucels.FilterEUtranCells let funcs = []; integrData.parent.Nodes.forEach((node) => { funcs.push( Promise.all([ fetch.eNodeBv3(node), fetch.euCellsv2([node, operatorfilter]), ]).then(data => { if ("GRBS_" in node) and (data[1] instanceof Error) { delete data[1] delete data[0] } integrData.children[node] = { ENodeB: data[0], EUtranCellData: data[1], } }) ) }) return Promise.all(funcs);
29f34335f3d96e3d496a216da08de315
{ "intermediate": 0.3720645606517792, "beginner": 0.3976115584373474, "expert": 0.23032383620738983 }
16,255
как сделать у asseinfo/react-kanban virtualized
fcbe34aad9521d07d0fff3d5c7d5c088
{ "intermediate": 0.36935579776763916, "beginner": 0.2888752818107605, "expert": 0.34176886081695557 }
16,256
who are you.
0ec6538f12ea9d8ae8561e68317d6004
{ "intermediate": 0.4493715465068817, "beginner": 0.2638433873653412, "expert": 0.2867850959300995 }
16,257
<Slider Minimum="-90" Maximum="90" Margin="239,508,1116,332" Value="{Binding ElementName=rotate1, Path=Angle}" /> <Slider Minimum="-90" Maximum="90" Margin="239,557,1116,283" Value="{Binding ElementName=rotate2, Path=Angle}" /> <Slider Minimum="-90" Maximum="90" Margin="578,508,777,332" Value="{Binding ElementName=rotate3, Path=Angle}" /> <Slider Minimum="-90" Maximum="90" Margin="578,557,777,283" Value="{Binding ElementName=rotate4, Path=Angle}" /> combine these sliders into one
d4dc442de072940f8d6e31d4cfecc7b3
{ "intermediate": 0.3377580940723419, "beginner": 0.3605939447879791, "expert": 0.3016479015350342 }
16,258
improve the wording: Make sure the conditions are ready before the upgrade.
8aea5eac79402d529b25c04895121445
{ "intermediate": 0.32307958602905273, "beginner": 0.2618897557258606, "expert": 0.41503065824508667 }
16,259
how to make a slider that controls 4 other sliders <Slider Minimum="-90" Maximum="90" Margin="239,508,1116,332" Value="{Binding ElementName=rotate1, Path=Angle}" /> <Slider Minimum="-90" Maximum="90" Margin="239,557,1116,283" Value="{Binding ElementName=rotate2, Path=Angle}" /> <Slider Minimum="-90" Maximum="90" Margin="578,508,777,332" Value="{Binding ElementName=rotate3, Path=Angle}" /> <Slider Minimum="-90" Maximum="90" Margin="578,557,777,283" Value="{Binding ElementName=rotate4, Path=Angle}" />
de36cb2d3f84a4bfe6707d681b78d153
{ "intermediate": 0.43932637572288513, "beginner": 0.2432260513305664, "expert": 0.3174476623535156 }
16,260
function getData() { return new Promise(resolve,reject) } async function getData() { return new Promise(resolve,reject) } what is the difference between two functions above
cc74ffc72486752bb6b7d29f3cc3e218
{ "intermediate": 0.3470761775970459, "beginner": 0.5199831128120422, "expert": 0.13294066488742828 }
16,261
get media video youtube external_id in shopify to iframe
9f1fc6cd2db5648df5203da6afe87a71
{ "intermediate": 0.3160565495491028, "beginner": 0.252048522233963, "expert": 0.431894987821579 }
16,262
class WeatherScreen extends StatelessWidget { final String? city; WeatherScreen({this.city}); @override Widget build(BuildContext context) { final weatherBloc = WeatherBloc(); return Scaffold( appBar: AppBar( title: Text("Weather App"), ), body: Center( child: StreamBuilder<WeatherModel>( stream: weatherBloc.weatherStream, builder: (context, snapshot) { if (snapshot.hasData) { final weatherData = snapshot.data; return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( "City: {weatherData.cityName}", style: TextStyle(fontSize: 24), ), SizedBox(height: 16), Text("{weatherData.temperature} °C", style: TextStyle(fontSize: 24), ), SizedBox(height: 16), Text( "Description: ${weatherData.description}", style: TextStyle(fontSize: 24), ), ], ); } else if (snapshot.hasError) { return Text("Failed to fetch weather data"); } else { return CircularProgressIndicator(); } }, ), ), floatingActionButton: FloatingActionButton( onPressed: () { weatherBloc.getWeatherData("London"); }, child: Icon(Icons.refresh), ), ); } } ? solve this problem in previous code : "class WeatherScreen extends StatelessWidget { final String? city; WeatherScreen({this.city}); @override Widget build(BuildContext context) { final weatherBloc = WeatherBloc(); return Scaffold( appBar: AppBar( title: Text("Weather App"), ), body: Center( child: StreamBuilder<WeatherModel>( stream: weatherBloc.weatherStream, builder: (context, snapshot) { if (snapshot.hasData) { final weatherData = snapshot.data; return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( "City: {weatherData.cityName}", style: TextStyle(fontSize: 24), ), SizedBox(height: 16), Text("{weatherData.temperature} °C", style: TextStyle(fontSize: 24), ), SizedBox(height: 16), Text( "Description: ${weatherData.description}", style: TextStyle(fontSize: 24), ), ], ); } else if (snapshot.hasError) { return Text("Failed to fetch weather data"); } else { return CircularProgressIndicator(); } }, ), ), floatingActionButton: FloatingActionButton( onPressed: () { weatherBloc.getWeatherData("London"); }, child: Icon(Icons.refresh), ), ); } } ?solve this problem in previous code :"The argument type 'Stream<dyna • can't be assigned to the parameter type"?
893ee4d6c7445a48e023b34f207d9fec
{ "intermediate": 0.3938516080379486, "beginner": 0.4786616265773773, "expert": 0.1274867206811905 }
16,263
У меня есть функции для управления SPI. Помоги написать пример кода для передачи по SPI на 19 пине простого сигнала 0x00 и 0xFF. Вот функции: #ifndef SPIMST #define SPIMST #include "hal_spimst.h" #include "hal_dmac.h" #include "custom_io_hal.h" #include "custom_io_chk.h" typedef enum { DRV_SPIMST_0 = 0x0, DRV_SPIMST_1 = 0x1, DRV_SPIMST_2 = 0x2, DRV_SPIMST_MAX = 0x3, } drv_spimst_port; /** * Initilize SPI bus to enable SPI operations. * * @param clk_Hz SPI Clock (BUS 40MHz : 610 - 20M, BUS 80MHz : 1221 - 40MHzM) * * @param CPHA Serial Clock Phase. * 0x00 - Serial clock toggles in middle of first data bit * 0x01 - Serial clock toggles at start of first data bit * @param CPOL Serial Clock Polarity. * 0x00 - Inactive state of serial clock is low * 0x01 - Inactive state of serial clock is high, need pull up in the clock pin. */ int32_t drv_spimst_init(uint32_t clk_Hz, ENUM_SPI_MST_CPHA_T CPHA, ENUM_SPI_MST_CPOL_T CPOL); /** * Deinitialize SPI bus to disable SPI operations * */ void drv_spimst_deinit(void); /** * Transmit and receive the spi data by dma. * * @param write_data Pointer to the data buffer to be written by the master. * @param read_data Pointer to the data buffer to be read by the master. * @param length Size of the data buffer exposed to the SPI master - max dma length : 8190 bytes for even length, 4095 for odd length. * @param csn Chip select pin. * * @return -1 The operation error. * @return 0 The operation completed successfully. */ int8_t drv_spimst_dma_trx(uint8_t *write_data, uint8_t *read_data, uint32_t length, uint32_t csn); /** * Transmit and receive the spi data. * * @param write_data Pointer to the data buffer to be written by the master. * @param read_data Pointer to the data buffer to be read by the master. * @param length Size of the data buffer exposed to the SPI master. * @param csn Chip select pin. * * @return -1 The operation error. * @return 0 The operation completed successfully. */ int8_t drv_spimst_trx(uint8_t *write_data, uint8_t *read_data, uint32_t length, uint32_t csn); /*! \brief set up DMA SPI transfer buffer * * set up DMA SPI transfer buffer * * \param max_length set the MAX length * \param tx_buf set tx_buffer ptr * \param rx_buf set rx buffer ptr */ void drv_spimst_set_dma_buffer(uint32_t max_length, uint8_t *tx_buf, uint8_t *rx_buf); /*! \brief Alloc the DMA SPI transfer buffer * * Alloc the DMA buffer * * \param max_length the DMA should transfer max size * \return NULL System no resource. * otherwise The buffer. */ uint8_t *drv_spimst_alloc_dma_buffer(uint32_t max_length); /*! \brief Alloc the DMA SPI transfer buffer, it must used by even data length. * * Alloc the DMA buffer, little buffer size. * * \param max_length the DMA should transfer max size * \return NULL System no resource. * otherwise The buffer. */ uint8_t *drv_spimst_alloc_dma_limited_buffer(uint32_t max_length); /*! \brief Release the DMA SPI transfer buffer * * Release the DMA SPI transfer buffer * * \param buffer the buffer alloc from drv_spimst_alloc_buffer */ void drv_spimst_free_dma_buffer(uint8_t *buffer); //expend API // support padmux checking feature. #define DRV_SPIMST_INIT_HAL_SPIMST_0(clk, cpha, cpol) \ do { \ drv_spimst_init_ex(HAL_SPIMST_0, clk, cpha, cpol); \ (void)PERI_IO_SPIM0; \ } while(0) #define DRV_SPIMST_INIT_HAL_SPIMST_1(clk, cpha, cpol) \ do { \ drv_spimst_init_ex(HAL_SPIMST_1, clk, cpha, cpol); \ (void)PERI_IO_SPIM1; \ } while(0) #define DRV_SPIMST_INIT_HAL_SPIMST_2(clk, cpha, cpol) \ do { \ drv_spimst_init_ex(HAL_SPIMST_2, clk, cpha, cpol); \ (void)PERI_IO_SPIM2; \ } while(0) #define DRV_SPIMST_INIT_EX(SPIM, clk, cpha, cpol) \ DRV_SPIMST_INIT_##SPIM(clk, cpha, cpol); int32_t drv_spimst_init_ex(drv_spimst_port port, uint32_t clk_Hz, ENUM_SPI_MST_CPHA_T CPHA, ENUM_SPI_MST_CPOL_T CPOL); void drv_spimst_deinit_ex(drv_spimst_port port); int8_t drv_spimst_dma_trx_ex(drv_spimst_port port, uint8_t *write_data, uint8_t *read_data, uint32_t length, uint32_t csn); int8_t drv_spimst_trx_ex(drv_spimst_port port, uint8_t *write_data, uint8_t *read_data, uint32_t length, uint32_t csn); void drv_spimst_set_dma_buffer_ex(drv_spimst_port port, uint32_t max_length, uint8_t *tx_buf, uint8_t *rx_buf); uint8_t *drv_spimst_alloc_dma_buffer_ex(drv_spimst_port port, uint32_t max_length); uint8_t *drv_spimst_alloc_dma_limited_buffer_ex(drv_spimst_port port, uint32_t max_length); void drv_spimst_free_dma_buffer_ex(drv_spimst_port port, uint8_t *buffer); int8_t drv_spimst_transfer(hal_spimst_port port, uint8_t *tx_data, uint8_t *rx_data, uint32_t data_length); int8_t drv_spimst_dma_long_tx(hal_spimst_port port, uint8_t *tx_data, uint32_t data_length, DMAC_ISR tx_dma_done_isr); int8_t drv_spimst_dma_tx(hal_spimst_port port, uint8_t *tx_data, uint32_t data_length, DMAC_ISR tx_dma_done_isr); #endif /* end of include guard */
e1df0aed3bf24a248c0fcd35d1bbc0fd
{ "intermediate": 0.44822004437446594, "beginner": 0.3648930490016937, "expert": 0.18688689172267914 }
16,264
roblox script gui speed and jump
b9277a8ff906873370ea310e718a9682
{ "intermediate": 0.3651488423347473, "beginner": 0.35854604840278625, "expert": 0.27630510926246643 }
16,265
correct code //fetch cosite eNodes and EUtranCell data ).then(() => { const operatorfilter = integrData.parentEucels.FilterEUtranCells let funcs = []; integrData.parent.Nodes.forEach((node) => { funcs.push( Promise.all([ fetch.eNodeBv3(node), fetch.euCellsv2([node, operatorfilter]), ]).then(data => { if (node.startsWith("GRBS_") && data[1] instanceof Error) { delete data[1] delete data[0] } else if (data[1] instanceof Error) { reject(data) return } else { integrData.children[node] = { ENodeB: data[0], EUtranCellData: data[1], } } }) ) }) return Promise.all(funcs);
f89a59eb0cfbf4c3c33a483fdae78549
{ "intermediate": 0.418073832988739, "beginner": 0.3409780263900757, "expert": 0.2409481704235077 }
16,266
Хочу сделать такую же операцию, но на Windows 'sudo find / -name "active-responses.log" -exec tail -4 "{}" ";"' как сделать?
4e447c2d0dcdd1944dfd02484b5b3622
{ "intermediate": 0.3227035701274872, "beginner": 0.413178414106369, "expert": 0.2641179859638214 }
16,267
add the condition to *ngIf to prevent the div from showing if array is empty
4bfd7c73f637ab00ee9f8b857ee99b03
{ "intermediate": 0.34410956501960754, "beginner": 0.29992038011550903, "expert": 0.35597002506256104 }
16,268
create to me script of walking goku anime
350eda1992b3bb18f399a0249caa17f9
{ "intermediate": 0.3109213709831238, "beginner": 0.43777549266815186, "expert": 0.2513030767440796 }
16,269
Use this https://openweathermap.org/current Available on the site to build an application through the data in this link and create the code using Block concept ? Flutter code ? and create full application with ui design to show data in application ?
a9d2069c4f560c841768bb8ad77003d4
{ "intermediate": 0.6502243876457214, "beginner": 0.08962223678827286, "expert": 0.2601533830165863 }
16,270
i need code of waking goku anime player
8a8f7f85726c95d764cc9bbc6ca029d3
{ "intermediate": 0.288257360458374, "beginner": 0.4326756000518799, "expert": 0.2790670394897461 }
16,271
can you fix this error that i am getting for my mql5 code? error: possible loss of data due to type conversion on line 215 code: // Define a global variable to store the previous number of bars int prev_bars = 0; // Define a global variable to store the last bar for which a trade was opened int last_trade_bar = -1; // Define an input variable for the user to set the wick size filter percentage input double wick_size_filter = 20; // The percentage of the candle size that the wick size should not exceed input double risk_percentage = 1; // How much to risk on the balance based on this percentage input double TP_X = 2; // The default value is 2, meaning the TP will be twice the size of the stop loss double SLP = 0; double Risk = 0; // New variable to store the calculated risk double LotSize = 0; // New variable to store the calculated lot size double TP = 0; // New variable to store the calculated TP value // Define the function OnTick void OnTick() { // Print a message to indicate that the OnTick function is being called // Get the current number of bars int curr_bars = Bars(_Symbol, _Period); // Check if a new bar has been formed if (curr_bars != prev_bars) { // Update the previous number of bars prev_bars = curr_bars; // Check for FU candles and print a message // Define the candle variables double open = iOpen(_Symbol, _Period, 1); // Current candle open price double close = iClose(_Symbol, _Period, 1); // Current candle close price double high = iHigh(_Symbol, _Period, 1); // Current candle high price double low = iLow(_Symbol, _Period, 1); // Current candle low price double prev_open = iOpen(_Symbol, _Period, 2); // Previous candle open price double prev_close = iClose(_Symbol, _Period, 2); // Previous candle close price double prev_high = iHigh(_Symbol, _Period, 2); // Previous candle high price double prev_low = iLow(_Symbol, _Period, 2); // Previous candle low price // Calculate the candle size and the wick sizes double candle_size = high - low; // The distance between the high and the low of the current candle double upside_wick_size = high - MathMax(open, close); // The distance between the high and the maximum of the open and close of the current candle double downside_wick_size = MathMin(open, close) - low; // The distance between the low and the minimum of the open and close of the current candle double min_lot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); double max_lot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX); double lot_step = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP); // Check for bullish FU candle with small upside wick if (close > open && low < prev_low && close > prev_close && high > prev_high && close > prev_high && upside_wick_size / candle_size < wick_size_filter / 100) { Print("Bullish FU found"); last_trade_bar = curr_bars; double current_price = SymbolInfoDouble(_Symbol, SYMBOL_ASK); // Get the current ask price double cml = NormalizeDouble((current_price - low), 5); Risk = AccountInfoDouble(ACCOUNT_BALANCE) * risk_percentage / 100; // Calculate Risk value here. Print("Risk: ", Risk); SLP = NormalizeDouble((current_price - low) * 10000, 1); Print("SLP: ", SLP); LotSize = NormalizeDouble(Risk / (10 * SLP), 2); // Calculate LotSize value here and round it to 2 decimal places. LotSize = MathMax(LotSize, min_lot); // Make sure LotSize is not less than min_lot LotSize = MathMin(LotSize, max_lot); // Make sure LotSize is not greater than max_lot LotSize = MathRound(LotSize / lot_step) * lot_step; // Make sure LotSize is a multiple of lot_step Print("LotSize: ", LotSize); double SL = low; Print("SL: ", SL); double entry = current_price; Print("Entry: ", entry); TP = NormalizeDouble(current_price + cml * TP_X, 5); Print("TP: ", TP); // Open a buy order MqlTradeRequest request; MqlTradeResult result; ZeroMemory(request); request.action = TRADE_ACTION_DEAL; request.symbol = _Symbol; request.volume = LotSize; request.price = SymbolInfoDouble(_Symbol, SYMBOL_ASK); request.sl = SL - 5 * _Point; // Set Stop Loss level without rounding request.tp = TP; request.deviation = 20; request.type = ORDER_TYPE_BUY; request.magic = 123456L; // Magic number int attempts = 0; // Add this line to keep track of the number of attempts while (attempts < 10) // Add this line to limit the number of attempts { bool sent = OrderSend(request, result); // Add this line to store the return value of OrderSend if (sent) // Add this line to check the return value { if (result.retcode == TRADE_RETCODE_DONE) { Print("BUY order opened : ", result.order); break; // Add this line to exit the loop if the trade request was successful } else if (result.retcode == TRADE_RETCODE_REQUOTE) { Print("Requote received, resending trade request"); attempts++; // Add this line to increment the number of attempts } else { Print("BUY order failed with error: ", GetLastError()); break; // Add this line to exit the loop if an error occurred } } else // Add this else block to handle the case when OrderSend fails { Print("Failed to send trade request with error: ", GetLastError()); break; // Add this line to exit the loop if an error occurred } } } // Check for bearish FU candle with small downside wick if (close < open && high > prev_high && close < prev_close && low < prev_low && close < prev_low && downside_wick_size / candle_size < wick_size_filter / 100) { Print("Bearish FU found"); last_trade_bar = curr_bars; double current_price = SymbolInfoDouble(_Symbol, SYMBOL_BID); // Get the current ask price double cml = NormalizeDouble((high - current_price), 5); Risk = AccountInfoDouble(ACCOUNT_BALANCE) * risk_percentage / 100; // Calculate Risk value here. Print("Risk: ", Risk); SLP = NormalizeDouble((high - current_price) * 10000, 1); Print("SLP: ", SLP); LotSize = NormalizeDouble(Risk / (10 * SLP), 2); // Calculate LotSize value here and round it to 2 decimal places. LotSize = MathMax(LotSize, min_lot); // Make sure LotSize is not less than min_lot LotSize = MathMin(LotSize, max_lot); // Make sure LotSize is not greater than max_lot LotSize = MathRound(LotSize / lot_step) * lot_step; // Make sure LotSize is a multiple of lot_step Print("LotSize: ", LotSize); double SL = high; Print("SL: ", SL); double entry = current_price; Print("Entry: ", entry); TP = NormalizeDouble(current_price - cml * TP_X, 5); Print("TP: ", TP); // Open a sell order MqlTradeRequest request; MqlTradeResult result; ZeroMemory(request); request.action = TRADE_ACTION_DEAL; request.symbol = _Symbol; request.volume = LotSize; request.price = SymbolInfoDouble(_Symbol, SYMBOL_BID); request.sl = SL + 5 * _Point; // Set Stop Loss level without rounding request.tp = TP; request.deviation = 20; request.type = ORDER_TYPE_SELL; request.magic = 123456L; // Magic number int attempts = 0; // Add this line to keep track of the number of attempts while (attempts < 10) // Add this line to limit the number of attempts { bool sent = OrderSend(request, result); // Add this line to store the return value of OrderSend if (sent) // Add this line to check the return value { if (result.retcode == TRADE_RETCODE_DONE) { Print("SELL order opened : ", result.order); break; // Add this line to exit the loop if the trade request was successful } else if (result.retcode == TRADE_RETCODE_REQUOTE) { Print("Requote received, resending trade request"); attempts++; // Add this line to increment the number of attempts } else { Print("SELL order failed with error: ", GetLastError()); break; // Add this line to exit the loop if an error occurred } } else // Add this else block to handle the case when OrderSend fails { Print("Failed to send trade request with error: ", GetLastError()); break; // Add this line to exit the loop if an error occurred } } } } // Check open positions Print("Checking open positions"); // Add this line to print a message before the loop Print("_Symbol: ", _Symbol); // Add this line to print the value of _Symbol Print("123456L: ", 123456L); // Add this line to print the value of 123456L for (int i = PositionsTotal() - 1; i >= 0; i--) { ulong ticket = PositionGetTicket(i); if (ticket > 0) { string symbol = PositionGetSymbol(ticket); long magic = PositionGetInteger(POSITION_MAGIC); Print("symbol: ", symbol); // Add this line to print the symbol of the position Print("magic: ", magic); // Add this line to print the magic number of the position if (symbol == _Symbol && magic == 123456L) { // Print a message to indicate that a position is being checked Print("Checking position with ticket ", ticket); double order_open_price = PositionGetDouble(POSITION_PRICE_OPEN); double current_price = PositionGetInteger(POSITION_TYPE) == (int)POSITION_TYPE_BUY ? SymbolInfoDouble(_Symbol, SYMBOL_BID) : SymbolInfoDouble(_Symbol, SYMBOL_ASK); double profit_in_pips = MathAbs(current_price - order_open_price) / SymbolInfoDouble(_Symbol, SYMBOL_POINT); // Use a double value for the point size // Calculate the SLP value for this trade double slp = MathAbs(order_open_price - PositionGetDouble(POSITION_SL)) / SymbolInfoDouble(_Symbol, SYMBOL_POINT); // Use a double value for the point size Print("slp: ", slp); // Check if the position is in profit by the amount of the SLP if (profit_in_pips >= slp) { // Move the stop loss to break even MqlTradeRequest request; MqlTradeResult result; ZeroMemory(request); request.action = TRADE_ACTION_SLTP; request.order = ticket; request.sl = order_open_price; request.tp = PositionGetDouble(POSITION_TP); request.symbol = _Symbol; request.magic = 123456L; int attempts = 0; // Add this line to keep track of the number of attempts while (attempts < 10) // Add this line to limit the number of attempts { bool sent = OrderSend(request, result); // Add this line to store the return value of OrderSend if (sent) // Add this line to check the return value { if (result.retcode == TRADE_RETCODE_DONE) { Print("Stop loss moved to break even for order ", result.order); break; // Add this line to exit the loop if the trade request was successful } else if (result.retcode == TRADE_RETCODE_REQUOTE) { Print("Requote received, resending trade request"); attempts++; // Add this line to increment the number of attempts } else { Print("Failed to move stop loss with error: ", GetLastError()); break; // Add this line to exit the loop if an error occurred } } else // Add this else block to handle the case when OrderSend fails { Print("Failed to send trade request with error: ", GetLastError()); break; // Add this line to exit the loop if an error occurred } } } else // Add this else block to print the values of profit_in_pips and slp { Print("Position not in profit by SLP amount"); Print("profit_in_pips: ", profit_in_pips); Print("slp: ", slp); } } } } }
ed22a5d9eec296d359e1ab0ab767296a
{ "intermediate": 0.33930137753486633, "beginner": 0.4848073124885559, "expert": 0.17589126527309418 }
16,272
аддитивное движение мыши это
2f990b01a6fa20fd29d456d2b2cc9e9a
{ "intermediate": 0.298310786485672, "beginner": 0.24293620884418488, "expert": 0.4587530195713043 }