row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
22,303
make a script to upload a folder to mega from my unix shell
4000d24959df4bba8414879d227c8359
{ "intermediate": 0.39775100350379944, "beginner": 0.21913117170333862, "expert": 0.3831178843975067 }
22,304
Act as defold programmer. You have lua module, lets name it "manager.lua" and also you have defold script, lets name it "employee.script". You need somehow call function in your employee script from manager lua script, how you will do that?
82b6b2c0c2c2b616651547f8216f70e5
{ "intermediate": 0.40619564056396484, "beginner": 0.3912203311920166, "expert": 0.20258404314517975 }
22,305
When I select table entries in SQL through CLI, Umlaute and Sonderzeichen are displayed incorrectly.
1172d675506c0e7a4d7d118fd43e54e6
{ "intermediate": 0.4384101927280426, "beginner": 0.2063770592212677, "expert": 0.3552127778530121 }
22,306
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')
e9f466f2b039f58c413625d25f3c328f
{ "intermediate": 0.49455639719963074, "beginner": 0.25687748193740845, "expert": 0.24856612086296082 }
22,307
Where can one put the T for a generic in a method signature or whatever it's called?
2c0cb7a5afd6b3b1fa1344399d4580b5
{ "intermediate": 0.2924591898918152, "beginner": 0.3648919463157654, "expert": 0.3426489233970642 }
22,308
code example with for loop and table in Defold
7fe639e1389e2f0f7fa83c77be11936d
{ "intermediate": 0.32068029046058655, "beginner": 0.41724893450737, "expert": 0.26207077503204346 }
22,309
Generate a svg icon for "too heavy"
270161ac75b18f005c8af26010c60997
{ "intermediate": 0.32985156774520874, "beginner": 0.286888062953949, "expert": 0.3832603991031647 }
22,310
invalid type argument of '->' (have 'ot_eth_dal_ctrl_config' {aka 'struct s_ot_eth_dal_ctrl_config'})
b2874fb70f381cf43f5b2122e4e2c5b2
{ "intermediate": 0.3173907697200775, "beginner": 0.42580845952033997, "expert": 0.2568008005619049 }
22,311
How to show a paragraph of text in SAPUI5 front end and make part of the text bold and part of the text as link?
90b49895abb8512b0910945f6bfffa20
{ "intermediate": 0.4523769021034241, "beginner": 0.15499724447727203, "expert": 0.3926258385181427 }
22,312
quiero centrar la imagen tanto vertical como horizontal al centro de la pantalla esto es blade con bootstrap 5 @extends('adminlte::page') @section('title', 'Panel administrativo') @section('content_header') <h1>Pandel administrativo</h1> @stop @section('content') <div class=""> <img class="mx-auto d-block" id="picture" src=" {{ asset('/storage/Logo3.png ')}}" height="120px" with="120px"> </div> @stop @section('css') @stop @section('js') @stop
baafd79b18a920c9b17b0a6b297648c4
{ "intermediate": 0.33904820680618286, "beginner": 0.3374720513820648, "expert": 0.3234797418117523 }
22,313
@section(‘content’) <div class=“d-flex justify-content-center align-items-center h-100”> <img class=“mx-auto” id=“picture” src=“{{ asset(‘/storage/Logo3.png’)}}” height=“120px” width=“120px”> </div> @stop como escribo esto en tailwindcss
b7c5611ff002a6dbf5173afd8677b812
{ "intermediate": 0.3593745231628418, "beginner": 0.33342984318733215, "expert": 0.30719560384750366 }
22,314
I am playing ragnarok online on linux using lutris, the game starts perfectly, but once inside the game when doing right click it presses F9 by itself, and when moving the scroll wheel the screen doesn't move but select an skill to do, why is this? What I tried is: - enabling/disabling Lutris Runtime and/or Prefer System Libraries - using many other different runner versions, in every one the problem persists - using steam as runner
fc71552e2c59cfabc6db863118b724e9
{ "intermediate": 0.8224113583564758, "beginner": 0.10000625252723694, "expert": 0.07758241146802902 }
22,315
This is my code so far: #include <iostream> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <fcntl.h> #include <sys/shm.h> #include <sys/stat.h> #include <sys/mman.h> #include <sys/types.h> #include <errno.h> #include "myShm.h" using namespace std; int main(int argc, char* argv[]){ cout << "Slave begins execution" << endl; int child_process_number = argv[1]; char *my_shm_name = argv[2]; int shm_fd; char *shm_base; cout << "I am child number " << child_process_number << ", received shared memory name " << my_shm_name << endl; // [ my_shm_name is from comandline ] //Open shared memory segment shm_fd = shm_open(name, O_RDONLY, 0666); if (shm_fd == -1) { printf("cons: Shared memory failed: %s\n", strerror(errno)); exit(1); } //Map shared memory fragment to address space of process shm_base = mmap(0, sizeof(shm), PROT_READ, MAP_SHARED, shm_fd, 0); if (shm_base == MAP_FAILED) { printf("cons: Map failed: %s\n", strerror(errno)); /* close and unlink */ exit(1); } //Write child number into the next available slot in the shared memory structure cout << "I have written my child number to slot " << y << " and updated index to " << y+1. << endl; // [y is the value in index at time of access] cout << "Child " << child_process_number << " closed access to shared memory and terminates." << endl; // [ Same x as above ] exit(0); } Show me where I have errors in my code compared to your code.
93ba5a1171aacf43ec4d105531411f75
{ "intermediate": 0.44201207160949707, "beginner": 0.3044404089450836, "expert": 0.2535474896430969 }
22,316
Explain the concept of call by reference, with suitable code in C for each. Give advantage and disadvantage of call by reference. Short notes
da2733ac685dc4dfb9f1a71fa412d1e7
{ "intermediate": 0.3337946832180023, "beginner": 0.27701327204704285, "expert": 0.38919204473495483 }
22,317
Explain the concept of call by reference, with suitable code in C for each. Give advantage and disadvantage of call by reference. Short notes
0c2939e119236a93485a08655db1b1ac
{ "intermediate": 0.3337946832180023, "beginner": 0.27701327204704285, "expert": 0.38919204473495483 }
22,318
You are a WebUI designer. You have designed a web page which runs well on PC. But the page failed to display properly on cellphones due to discompatibility of font types with default font types on Android devices. Now propose some ways to resolve this issue. You should provide detailed code when applicable.
029b5af1e4a37a1d1364f70f9f4fd91c
{ "intermediate": 0.38288941979408264, "beginner": 0.3641227185726166, "expert": 0.25298789143562317 }
22,319
create a js code to convert html to reactjs container and components
90e2eaafe0e302c5ef38f7124c8c227c
{ "intermediate": 0.4913802444934845, "beginner": 0.23086993396282196, "expert": 0.2777498662471771 }
22,320
Power Automate: Whats the option to give wild card in Automate of email notification from a particular sender, example: wild card %form%
f46e68c336b5bf583d09d730eeed278d
{ "intermediate": 0.2674342393875122, "beginner": 0.28596824407577515, "expert": 0.44659748673439026 }
22,321
in neo4j 5 how to replace exists() ?
35ca1914c51a87e1763d7a0ef847b803
{ "intermediate": 0.3372468948364258, "beginner": 0.2264467179775238, "expert": 0.43630632758140564 }
22,322
Can you help write a game called 'Alan Turing code breaking game'?
2e6d9e2b1a07098945438b3d504d4048
{ "intermediate": 0.24630998075008392, "beginner": 0.25232481956481934, "expert": 0.5013651847839355 }
22,324
How to use .pem .csr .key certificate files in Apache Zeppelin to migrate from http to https
5df257dec73056fc8934d5acc083e203
{ "intermediate": 0.44252997636795044, "beginner": 0.2401636838912964, "expert": 0.3173063397407532 }
22,325
How to enable client server authentication in Apache Zeppelin using .pem certificates
28909cec9d09feb6ad2a196e6818fdc3
{ "intermediate": 0.4580882787704468, "beginner": 0.28945451974868774, "expert": 0.2524572014808655 }
22,326
how skip some time (in seconds) in Defold wia Lua GUI script?
6e94deb7cbb8cfe555d3ac60186f8d14
{ "intermediate": 0.38821327686309814, "beginner": 0.3232651352882385, "expert": 0.28852155804634094 }
22,327
I want to encrypt all the data before store in database by php pdo. how to do it and give me an example.
6744e2e339e34f447f1050bc3170b58c
{ "intermediate": 0.5676742792129517, "beginner": 0.12055027484893799, "expert": 0.31177544593811035 }
22,328
я добавил в проект зависимост <groupId>io.swagger.core.v3</groupId> <artifactId>swagger-jaxrs2</artifactId> <version>2.1.2</version> </dependency> <dependency> <groupId>io.swagger.core.v3</groupId> <artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId> <version>2.1.2</version> </dependency> теперь описание автоматически генерируется на http://localhost:8080/acq-company-rest/openapi.json, а как сделать, что бы я мог получать описание не по этому url, а в коде через метод, а этот url вообще закрыть, напиши полную настройку
80109a5f2afc53b0ba01b8e5e81d6a41
{ "intermediate": 0.4537132680416107, "beginner": 0.23880599439144135, "expert": 0.3074807822704315 }
22,329
Ubuntu Failed to open display DRM device: No such file or directory
2ac8e3250b7fd1e1cbfef4b734a148df
{ "intermediate": 0.3711613118648529, "beginner": 0.3018507957458496, "expert": 0.3269879221916199 }
22,330
Hello, I need from map[string]interface{}, create postgresql table, with jackc/pgx (map is list of db columns). What I should do?
f57847cdeb1bc40efdca65ca586b62d3
{ "intermediate": 0.7331333160400391, "beginner": 0.13198871910572052, "expert": 0.13487793505191803 }
22,331
How to use .pem certificate files in Apache Zeppelin to configure client server authentication
499dade84b49483e4dbfbcbd825a381f
{ "intermediate": 0.4474685788154602, "beginner": 0.277187317609787, "expert": 0.2753441333770752 }
22,332
with libreoffice, How can I do in order to not hava a text be on several ligne when exported in PDF ?
c7cf9806cbb591120e735b60e3a64d9e
{ "intermediate": 0.7059387564659119, "beginner": 0.13484856486320496, "expert": 0.15921270847320557 }
22,333
2023-10-23T10:21:54+01:00 ERROR cannot remove snap file "kubectl", will retry in 3 mins: incorrect number of tail fields, expected 3 but found 4 Remove snap "kubectl" (3099) from the system
9d795eeac96336087c02e6fa6a9dc372
{ "intermediate": 0.41820672154426575, "beginner": 0.21666070818901062, "expert": 0.36513254046440125 }
22,334
I want to customize a colormap in Python, which transitions from black to navy blue. Please provide the code
e5ece686f60e3ab45dc599f13fe2606f
{ "intermediate": 0.491458922624588, "beginner": 0.14724428951740265, "expert": 0.3612968325614929 }
22,335
Hi can you make me an ordered list of 10 items in html
34e7e3103894098a08e8c974ba5fc3f9
{ "intermediate": 0.46435752511024475, "beginner": 0.2646992802619934, "expert": 0.2709432542324066 }
22,336
Cron jobs don't work. Although I entered the code to crontab -e where I want a code to run every 10 minutes
ebdf0a702539aa8561decaed3b047de6
{ "intermediate": 0.3422003388404846, "beginner": 0.33896756172180176, "expert": 0.3188321888446808 }
22,337
a) Develop an efficient algorithm to find a list of all the prime numbers up to a number n (say 100).
c42774b02464a2f3c737c37c9c102198
{ "intermediate": 0.06887246668338776, "beginner": 0.052381157875061035, "expert": 0.8787463903427124 }
22,338
add objects simultaneously in sqlalchemy
5375357a529a56a74e63519d3258585f
{ "intermediate": 0.5054861307144165, "beginner": 0.25369793176651, "expert": 0.2408159375190735 }
22,339
Where in the following table of contents is likely for text about creating a session?: "An Introduction to Hibernate 6 Version 6.3.1.Final Table of Contents Preface 1. Introduction 1.1. Hibernate and JPA 1.2. Writing Java code with Hibernate 1.3. Hello, Hibernate 1.4. Hello, JPA 1.5. Organizing persistence logic 1.6. Testing persistence logic 1.7. Architecture and the persistence layer 1.8. Overview 2. Configuration and bootstrap 2.1. Including Hibernate in your project build 2.2. Optional dependencies 2.3. Configuration using JPA XML 2.4. Configuration using Hibernate API 2.5. Configuration using Hibernate properties file 2.6. Basic configuration settings 2.7. Automatic schema export 2.8. Logging the generated SQL 2.9. Minimizing repetitive mapping information 2.10. Nationalized character data in SQL Server 3. Entities 3.1. Entity classes 3.2. Access types 3.3. Entity class inheritance 3.4. Identifier attributes 3.5. Generated identifiers 3.6. Natural keys as identifiers 3.7. Composite identifiers 3.8. Version attributes 3.9. Natural id attributes 3.10. Basic attributes 3.11. Enumerated types 3.12. Converters 3.13. Compositional basic types 3.14. Embeddable objects 3.15. Associations 3.16. Many-to-one 3.17. One-to-one (first way) 3.18. One-to-one (second way) 3.19. Many-to-many 3.20. Collections of basic values and embeddable objects 3.21. Collections mapped to SQL arrays 3.22. Collections mapped to a separate table 3.23. Summary of annotations 3.24. equals() and hashCode() 4. Object/relational mapping 4.1. Mapping entity inheritance hierarchies 4.2. Mapping to tables 4.3. Mapping entities to tables 4.4. Mapping associations to tables 4.5. Mapping to columns 4.6. Mapping basic attributes to columns 4.7. Mapping associations to foreign key columns 4.8. Mapping primary key joins between tables 4.9. Column lengths and adaptive column types 4.10. LOBs 4.11. Mapping embeddable types to UDTs or to JSON 4.12. Summary of SQL column type mappings 4.13. Mapping to formulas 4.14. Derived Identity 4.15. Adding constraints 5. Interacting with the database 5.1. Persistence Contexts 5.2. Creating a session 5.3. Managing transactions 5.4. Operations on the persistence context 5.5. Cascading persistence operations 5.6. Proxies and lazy fetching 5.7. Entity graphs and eager fetching 5.8. Flushing the session 5.9. Queries 5.10. HQL queries 5.11. Criteria queries 5.12. A more comfortable way to write criteria queries 5.13. Native SQL queries 5.14. Limits, pagination, and ordering 5.15. Representing projection lists 5.16. Named queries 5.17. Controlling lookup by id 5.18. Interacting directly with JDBC 5.19. What to do when things go wrong 6. Compile-time tooling 6.1. Named queries and the Metamodel Generator 6.2. Generated query methods 6.3. Generating query methods as instance methods 6.4. Generated finder methods 6.5. Paging and ordering 6.6. Query and finder method return types 6.7. An alternative approach 7. Tuning and performance 7.1. Tuning the connection pool 7.2. Enabling statement batching 7.3. Association fetching 7.4. Batch fetching and subselect fetching 7.5. Join fetching 7.6. The second-level cache 7.7. Specifying which data is cached 7.8. Caching by natural id 7.9. Caching and association fetching 7.10. Configuring the second-level cache provider 7.11. Caching query result sets 7.12. Second-level cache management 7.13. Session cache management 7.14. Stateless sessions 7.15. Optimistic and pessimistic locking 7.16. Collecting statistics 7.17. Tracking down slow queries 7.18. Adding indexes 7.19. Dealing with denormalized data 7.20. Reactive programming with Hibernate 8. Advanced Topics 8.1. Filters 8.2. Multi-tenancy 8.3. Using custom-written SQL 8.4. Handling database-generated columns 8.5. User-defined generators 8.6. Naming strategies 8.7. Spatial datatypes 8.8. Ordered and sorted collections and map keys 8.9. Any mappings 8.10. Selective column lists in inserts and updates 8.11. Using the bytecode enhancer 8.12. Named fetch profiles 9. Credits"
c4da117dfc143a0e1b2f17bf5a4d3949
{ "intermediate": 0.49517104029655457, "beginner": 0.3148324489593506, "expert": 0.18999651074409485 }
22,340
how to direct to another page using javascript?
859f375b489b695afc2750f47bbe0b2a
{ "intermediate": 0.47946059703826904, "beginner": 0.2510705292224884, "expert": 0.26946887373924255 }
22,341
In my excel worksheet, Column A has repetitive date values for events. The earliest date starting at the top of the column. Column E has repetitive time values for the closing time of each activity on the Row. Is there a way using either a VBA code or a formula that can do the following; Look down column A and for all dates that match, find the latest time value in column E for the matching dates and append the text 'Close' to the same row in column V The code has to do this for all matching dates in column A
73ff85fc81ab9d23a843cc010e7dddf7
{ "intermediate": 0.5155115127563477, "beginner": 0.15901175141334534, "expert": 0.32547667622566223 }
22,342
Arduino esp32 как правильно присвоить одну палитру другой у меня есть палитра CRGBPalette16 currentPalette и палитра CRGBPalette16 blackAndWhiteStripedPalette; void SetupBlackAndWhiteStripedPalette() { // 'black out' all 16 palette entries... fill_solid(blackAndWhiteStripedPalette, 16, CRGB::Black); // and set every fourth one to white. blackAndWhiteStripedPalette[0] = CRGB::White; blackAndWhiteStripedPalette[4] = CRGB::White; blackAndWhiteStripedPalette[8] = CRGB::White; blackAndWhiteStripedPalette[12] = CRGB::White; }
dcb6d5dc17c64c3b837594b25b8bd9cf
{ "intermediate": 0.41987210512161255, "beginner": 0.32260000705718994, "expert": 0.2575278580188751 }
22,343
<el-checkbox v-model="isAutoInstallAgent" :disabled="isAutoInstallDisabled" :checked="isAutoInstallAgent" > </el-checkbox> @Watch('vaultId') isAutoInstallChecked(value: boolean) { this.isAutoInstallAgent = value } почему не работает?
5aab7ce7d977f2e1ae698b8f1867c0ea
{ "intermediate": 0.4661915600299835, "beginner": 0.2182120531797409, "expert": 0.31559640169143677 }
22,344
.nav-link { align-items: center; /* text-align: center; */ margin-top: 1%; margin-bottom: 1%; border: none; border-left: 1px solid #176dd0; padding: 10px; } .nav-link a { color: white; text-decoration: none; } .nav-link:hover { background-color: #4fc1e9; text-align: center; margin-top: 0; margin-bottom: 0; }为什么文字会上浮
6c669c7c29111b4f40d8fa523a148af0
{ "intermediate": 0.35081565380096436, "beginner": 0.34543776512145996, "expert": 0.30374661087989807 }
22,345
how to remove punctuation in flask msearch
d7027a7f0f580fa1305b29de67dc63e6
{ "intermediate": 0.579438328742981, "beginner": 0.07611633092164993, "expert": 0.3444453477859497 }
22,346
you are appointed as VBA developer and i want you to write code for me on below instructions. 01. press capslock key twice in every 5 min. 02. repeat this process in loop for 50 times.
d1c30d5734a4f2c4c73a7f216aa19cf4
{ "intermediate": 0.280987411737442, "beginner": 0.33088329434394836, "expert": 0.3881292939186096 }
22,347
I would like to make a continuum of Putonghua ju (Tone 2) change to ju (Tone 3), could you please help me to write a praat code to achieve this goal? I can provide you the original sound of ju tone 2, by changing the F0 contour of the original sound, the continuum could be made.
416b46ddf4db3b095ed3f2390f8a3b8f
{ "intermediate": 0.293897807598114, "beginner": 0.10407939553260803, "expert": 0.6020228266716003 }
22,348
The user is typing some information on the keyboard representing some information about people. The problem is that the user is copying the data from a comma separated file and so each line contains data that is not separated by spaces. Some of the data contains only information about a person ( Family name, Given name and date of birth) while other lines will contain data about the persons employer and their salary. You are given two classes, named Person and Employee that can be used to represent the data (already included in the code). Write a program in Java to complete the following steps: Read 5 lines of data from the user Break the data into pieces and use those pieces to create Person or Employee objects Print the objects to the screen (using their toString methods)
73fe87bf0ed268035ac1e0396cbe14d6
{ "intermediate": 0.5594330430030823, "beginner": 0.2856855094432831, "expert": 0.15488143265247345 }
22,349
php token how to use
1e67fc5ff1b2f7eaf2fed85f4e0af8c1
{ "intermediate": 0.3745008111000061, "beginner": 0.37933704257011414, "expert": 0.24616213142871857 }
22,350
Hello I'm a web developer. How do I write a textarea that expands upwards?
8d8b4cdcbc12f0e71f79c369ef6fc65e
{ "intermediate": 0.3839080333709717, "beginner": 0.30055731534957886, "expert": 0.31553471088409424 }
22,351
In my excel worksheet, Column A2:A400 contains date values for events. The row values in column A repeat the date down column A as groups of the same date. When a new date starts in column A it will also repeat down column A as a group of the same date The earliest group of dates start at the top of the column. Column E has time values for the closing time of each activity on the Row. Some the row values in column E also repeat the same time. The VBA code below is supposed to do the following; Look down column A and identify each group of dates that match. It should then find the latest time value in column E for each unique group of dates and append the text 'Close' to the same row in column V for each group of dates where the latest time is found. Unfortunately the code below is not doing this. Sub AppendCloseToColumnV() Dim dict As Object Set dict = CreateObject("Scripting.Dictionary") Dim lastRow As Long lastRow = Cells(Rows.Count, "A").End(xlUp).Row Dim i As Long Dim currentDate As Date Dim currentMaxTime As Date For i = 2 To lastRow Dim dateValue As Date Dim timeValue As Date If IsDate(Cells(i, "A").Value) Then dateValue = Cells(i, "A").Value Else GoTo NextIteration End If If IsDate(Cells(i, "E").Value) Then timeValue = Cells(i, "E").Value Else GoTo NextIteration End If If dict.Exists(dateValue) Then If dict(dateValue) < timeValue Then dict(dateValue) = timeValue End If Else dict.Add dateValue, timeValue End If NextIteration: Next i For i = 2 To lastRow If IsDate(Cells(i, "A").Value) Then currentDate = Cells(i, "A").Value currentMaxTime = dict(currentDate) Else GoTo NextIteration2 End If If Cells(i, "E").Value = currentMaxTime Then Cells(i, "V").Value = Cells(i, "V").Value & "Close" End If NextIteration2: Next i Dim groupStartDate As Date Dim groupEndDate As Date Dim appendClose As Boolean ' Loop through the rows to process the groups of dates For i = 2 To lastRow If IsDate(Cells(i, "A").Value) Then ' Check if the current date is the start of a new group If i = 2 Or Cells(i, "A").Value <> groupStartDate Then groupStartDate = Cells(i, "A").Value groupEndDate = dict(groupStartDate) appendClose = False End If ' Check if the current row is within the group If groupEndDate = Cells(i, "E").Value Then appendClose = True End If ' Append "Close" if within the group If appendClose Then Cells(i, "V").Value = Cells(i, "V").Value & "Close" End If End If Next i End Sub
cf3c44a24db4804eb21e66eb4cb55e77
{ "intermediate": 0.24422071874141693, "beginner": 0.530110239982605, "expert": 0.2256690412759781 }
22,352
hi, I have a winforms application and use Chromium to show html-files. I present the contence of the file in a window and next to it a window with the treeview of the document . The labels in this tree contain the headers for each paragraph but also include the name of the document. How can I avoid that this name is repeated in every label?
6fce04b30d987d7a135abdd4674b3fd4
{ "intermediate": 0.5920961499214172, "beginner": 0.18630069494247437, "expert": 0.2216031849384308 }
22,353
you are appointed as excel vba expert and i want you to write code for me on below instructions. 01. select random cell in this sheet only. 02. loop this process in every 5 mins. for 10 times.
42e7de351178ba85edaeee43daf74efd
{ "intermediate": 0.268831729888916, "beginner": 0.31448137760162354, "expert": 0.41668689250946045 }
22,354
how to download carbon monoxide and Ozone from Microwave Limb Sounder?
4e04505f38e55b4c4398d38f3fd87dd1
{ "intermediate": 0.31851789355278015, "beginner": 0.27173522114753723, "expert": 0.40974682569503784 }
22,355
<li *ngFor="let category of categoryListPagination; let i=index"> i have table with 5 records in page and then click on next button to show another 5, i want to show index accumulative 1,2,3,4,5,6 not start from begin in every page
cee718ce03fe0b4e9fca8146de2d3d11
{ "intermediate": 0.45382171869277954, "beginner": 0.2968873381614685, "expert": 0.24929095804691315 }
22,356
исправить код while attempt <= 3: async with session.post(f"{self.URL}/api/mobile/v1/login", data=login_payload) as response: if response.ok: token = (await response.json())["cookie"] session.cookie_jar.update_cookies({"bbp-cookie": token}) break else: attempt += 1 if attempt <= 3: await asyncio.sleep(1) else: return f"Error: HTTP {response.status}\nHall №{self.hall}"
0b2078244008bf5d144886a21a7a213b
{ "intermediate": 0.3447376787662506, "beginner": 0.4507676064968109, "expert": 0.20449477434158325 }
22,357
i have this in comp.html <li *ngFor="let category of categoryListPagination; let i=index" [ngClass]="{'selectedItem' : selectedCategories.includes(category.gid)}" class="productList_item" (click)="selectCategory(category)"> <div class="productList_itemId"> <span>{{ i + 1 }} </span> </div> <div class="productList_itemDescription"> <span>{{ category.name }}</span> </div> </li> Lets say I have 50 items in my testdata. It should iterate from 0 to 50, instead it goes from 0 to 5th element in each page since itemsPerPage is 5
94555fb47e77d1992003a60d9f177781
{ "intermediate": 0.3383632302284241, "beginner": 0.5064127445220947, "expert": 0.15522398054599762 }
22,358
how can I add surface to Maxsurf through VBA
c24f7b621e222a7755b7cb2c855e6247
{ "intermediate": 0.3010847568511963, "beginner": 0.15258105099201202, "expert": 0.5463342070579529 }
22,359
Concisely state what Ansible is for (in Debian).
ed37d9d104b508077d391c08d85af28a
{ "intermediate": 0.6096328496932983, "beginner": 0.1908481866121292, "expert": 0.19951891899108887 }
22,360
In my excel worksheet, Column A2:A400 contains date values for events. The row values in column A repeat the date down column A as groups of the unique dates. Each group of rows has a unique date. Each group of rows in column A will start and end with the same unique date for the group. So when a new date starts in column A it repeats down column A as a group rows of the same date. The earliest group of dates start at the top of the column. For each row, Column E has a time value for the each activity on the Row. The VBA code below is supposed to do the following; Look down column A and identify each group of row of dates that match. It should then find the latest recorded time value in column E for each unique group of dates and append the text 'Close' to the same row in column V for each group of dates where the latest time is found. Unfortunately the code below is not doing this. Sub AppendCloseToColumnV() Dim dict As Object Set dict = CreateObject("Scripting.Dictionary") Dim lastRow As Long lastRow = Cells(Rows.Count, "A").End(xlUp).Row Dim i As Long Dim currentDate As Date Dim currentMaxTime As Date For i = 2 To lastRow Dim dateValue As Date Dim timeValue As Date If IsDate(Cells(i, "A").Value) Then dateValue = Cells(i, "A").Value Else GoTo NextIteration End If If IsDate(Cells(i, "E").Value) Then timeValue = Cells(i, "E").Value Else GoTo NextIteration End If If dict.Exists(dateValue) Then If dict(dateValue) < timeValue Then dict(dateValue) = timeValue End If Else dict.Add dateValue, timeValue End If NextIteration: Next i ' Loop through the rows to append "Close" to the rows where the latest time is found For i = 2 To lastRow If IsDate(Cells(i, "A").Value) Then currentDate = Cells(i, "A").Value currentMaxTime = dict(currentDate) If Cells(i, "E").Value = currentMaxTime Then Cells(i, "V").Value = Cells(i, "V").Value & "Close" End If End If Next i End Sub
9577d99e1fa4995f21199faf30017eca
{ "intermediate": 0.336585134267807, "beginner": 0.3988618552684784, "expert": 0.2645530700683594 }
22,361
// //Задача про часы // #include <iostream> // int main(){ // int h, m; // std::cin >> h >> m; // std::cout << (12 - h)%12 << " " << (60 - m) % 60; // return 0; // } //задача про минимал.строку O(N) #include <iostream> int main(){ std::string s; std::cin >> s; std::string mx; if (s.size() == 2){ if (s[0] == s[1]) std::cout << s; else std::cout << -1; return 0; } if (s.size() == 3){ if (s[0] == s[2]) std::cout << s; else std::cout << -1; return 0; } for(int i = 0; i < s.size()-1; i++){ if ( ((s[i] == s[i+1]) && (s.substr(i, 2) < mx)) ) mx = s.substr(i, 2); } for(int i = 0; i < s.size()-2; i++){ if ( ((s[i] == s[i+2]) && (s.substr(i, 3) < mx)) ) mx = s.substr(i, 3); } std::cout << mx; return 0; } в чем проблема?
11bcaf9640c552ae1a9f32b72ba3f42e
{ "intermediate": 0.2872069776058197, "beginner": 0.37846705317497253, "expert": 0.33432599902153015 }
22,362
Assignment: Given an abstract class Vectors, an interface Arithmetic<E> and the main program, write Java classes of 2D vectors (SimpleVec2D) and a table (SimpleTable) structure to store and manage multiple instances of SimpleVec2D based on the following requirements. The SimpleVec2D class: SimpleVec2D class is a concrete subclass of Vectors and it implements the Arithmetic<E> interface It has 2 properties (x, y): “x” and “y” are the two components of a 2D vector. Both “x” and “y” are double (data type) When creating an instance of SimpleVec2D, “x” and “y” are all required It overrides the hashCode(). It uses the remainder of the distance divide by 5 as the hash value. Part of the SimpleTable class is given. Complete two methods of it: AddElement(): To add the reference of a new SimpleVec2D instance to the table. - “theTable” is a 2D array. The first index (which row) of “theTable” refers the hash value. The new element will be added to the row based on the hash value. - When an element is being added to a row, it will move all the current elements 1 step to the end and then add the new reference as the first element. - For example, a new vector has the hash value equal to 2 will be added to theTable[2][0] SumElement(): It calculates the summation of all the vectors in the table and returns the result. Example Input & Output: No user input. The test values are generated by Math.random() in the main program. Output: (2.92, 2.56) Dist = 3.89, HashCode = 4 (1.51, 5.60) Dist = 5.81, HashCode = 1 (2.84, 9.33) Dist = 9.76, HashCode = 0 (3.59, 7.26) Dist = 8.09, HashCode = 3 (7.97, 6.40) Dist = 10.23, HashCode = 0 (2.75, 7.33) Dist = 7.83, HashCode = 3 (9.72, 6.86) Dist = 11.90, HashCode = 2 (1.85, 0.59) Dist = 1.94, HashCode = 2 (5.96, 1.12) Dist = 6.06, HashCode = 1 (2.48, 2.61) Dist = 3.60, HashCode = 4 =========================================== [0] : 10.23 | 9.76 | [1] : 6.06 | 5.81 | [2] : 1.94 | 11.90 | [3] : 7.83 | 8.09 | [4] : 3.60 | 3.89 | =========================================== SUM = (41.59, 49.68) Dist = 64.79 SUM - First = (38.67, 47.12) Dist = 60.95
99ab6417b29ae6def52ff67e6fc8a17e
{ "intermediate": 0.4923497438430786, "beginner": 0.24902991950511932, "expert": 0.25862032175064087 }
22,363
const res = doctors.map((el) => el.split(",")).filter(el => el[1]===' ж').sort((a, b) => b[3] - a[3]); where mistake
ab61a7e20d421b79cc54558d727daec6
{ "intermediate": 0.34376731514930725, "beginner": 0.39309775829315186, "expert": 0.2631348967552185 }
22,364
using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(LineRenderer))] public class Grappler : MonoBehaviour, IGadget { public enum eMode { gIdle, gOut, gRetract, gPull} [Header("Inscribed")] [Tooltip("Speed at which Grappler extends (doubled in gRetract mode)")] public float grappleSpd = 10; [Tooltip("Maximum length that Grappler will reach")] public float maxLength = 7.25f; [Tooltip("Minimum distance of Grappler from Dray")] public float minLength = 0.5f; [Tooltip("Health deducted when Dray ends a grapple on an unsafe tile")] public int unsafeTileHealthPenalty = 2; [Header("Dynamic")] [SerializeField] private eMode _mode = eMode.gIdle; public eMode mode { get { return _mode; } private set { _mode = value; } } private LineRenderer line; private Rigidbody2D rigid; private Collider2D colld; private Vector3 p0, p1; private int facing; private Dray dray; private System.Func<IGadget, bool> gadgetDoneCallback; private Vector2[] directions = new Vector2[] { Vector2.right, Vector2.up, Vector2.left, Vector2.down }; private Vector3[] dirV3s = new Vector3[] { Vector3.right, Vector3.up, Vector3.left, Vector3.down }; private void Awake() { //Get component references to use throughout the script line = GetComponent<LineRenderer>(); rigid = GetComponent<Rigidbody2D>(); colld = GetComponent<Collider2D>(); } void Start() { gameObject.SetActive(false); //Initially disable this GameObject } void SetGrappleMode(eMode newMode) { switch (newMode) { case eMode.gIdle: transform.DetachChildren(); //Release any child Transforms gameObject.SetActive(false); if (dray != null && dray.controlledBy == this as IGadget) { dray.controlledBy = null; dray.physicsEnabled = true; } break; case eMode.gOut: gameObject.SetActive(true); rigid.velocity = directions[facing] * grappleSpd; break; case eMode.gRetract: rigid.velocity = -directions[facing] * (grappleSpd * 2); break; case eMode.gPull: p1 = transform.position; rigid.velocity = Vector2.zero; dray.controlledBy = this; dray.physicsEnabled = false; break; } mode = newMode; } private void FixedUpdate() { p1 = transform.position; line.SetPosition(1, p1); switch (mode) { case eMode.gOut: //Grappler shooting out //See if the Grappler reached its limit without hitting anything if ((p1 - p0).magnitude >= maxLength) { SetGrappleMode(eMode.gRetract); } break; case eMode.gRetract: //Grappler missed; return at double speed //Check to see if the Grappler is no longer in front of Dray if (Vector3.Dot((p1 - p0), dirV3s[facing]) < 0) GrappleDone(); break; case eMode.gPull: if ((p1-p0).magnitude > minLength) { //Move Dray toward the Grappler hit point p0 += dirV3s[facing] * grappleSpd * Time.fixedDeltaTime; dray.transform.position = p0; line.SetPosition(0, p0); //Stop Grappler from moving with Dray transform.position = p1; } else { //Dray is close enough to stop grappling p0 = p1 - (dirV3s[facing] * minLength); dray.transform.position = p0; //Check whether Dray landed on an unsafe tile Vector2 checkPos = (Vector2)p0 + new Vector2(0, -0.25f); if (MapInfo.UNSAFE_TILE_AT_VECTOR2(checkPos)) { //Dray landed on an unsafe tile dray.ResetInRoom(unsafeTileHealthPenalty); } GrappleDone(); } break; } } //Ensures that p1 is aligned with the Grappler head private void LateUpdate() { p1 = transform.position; line.SetPosition(1, p1); } ///<summary> ///Called when the Grappler hits a Trigger or Collider in the GrapTiles, Items, or Enemies Physics Layers (Grappler's Collider is a Trigger) /// </summary> /// <param name="coll"></param> void OnTriggerEnter2D(Collider2D colld) { //The Grappler has collided with something, but what? string otherLayer = LayerMask.LayerToName(colld.gameObject.layer); switch (otherLayer) { case "Items": //We've possibly hit a PickUp PickUp pup = colld.GetComponent<PickUp>(); if (pup == null) return; //If this IS a PickUp, make it a child of this Transform so it moves with the Grappler head pup.transform.SetParent(transform); pup.transform.localPosition = Vector3.zero; SetGrappleMode(eMode.gRetract); break; case "Enemies": //We've hit an Enemy //The Grappler should return when it hits an Enemy Enemy e = colld.GetComponent<Enemy>(); if (e != null) { SetGrappleMode(eMode.gRetract); StunEnemy(); } //Damaging the Enemy is handled by the DamageEffect & Enemy scripts break; case "GrapTiles": //We've hit a GrapTile //SetGrappleMode(eMode.gRetract); SetGrappleMode(eMode.gPull); break; default: SetGrappleMode(eMode.gRetract); break; } } void StunEnemy() { } void GrappleDone() { SetGrappleMode(eMode.gIdle); //Callback to Dray so he returns to normal controls gadgetDoneCallback(this); } #region IGadget_Implementation //Implementation of IGadget //Called by Dray to use this IGadget public bool GadgetUse(Dray tDray, System.Func<IGadget,bool> tCallback) { if (mode != eMode.gIdle) return false; dray = tDray; gadgetDoneCallback = tCallback; transform.localPosition = Vector3.zero; facing = dray.GetFacing(); p0 = dray.transform.position; p1 = p0 + (dirV3s[facing] * minLength); gameObject.transform.position = p1; gameObject.transform.rotation = Quaternion.Euler(0, 0, 90 * facing); line.positionCount = 2; line.SetPosition(0, p0); line.SetPosition(1, p1); SetGrappleMode(eMode.gOut); return true; } //Called by Dray if he is hit while grappling and mode != eMode.inHit public bool GadgetCancel() { //If pulling Dray to a wall, ignore GadgetCancel if (mode == eMode.gPull) return false; SetGrappleMode(eMode.gIdle); gameObject.SetActive(false); return true; } //string name is already part of Grappler (inherited from Object) #endregion } Fill in the StunEnemy() method for this script so that the enemy is temporarily stunned for 1 second
62076c89401f3d60948fb82b4e4f935b
{ "intermediate": 0.3782612681388855, "beginner": 0.47874942421913147, "expert": 0.14298932254314423 }
22,365
I have two applications that are consumers of 1 kafka topic. If 1 application goes down and the other application sends a message, once the application comes back up it doesnt receive that message. What could be the problem?
392e50a7397742c7e180e06cb0329ce7
{ "intermediate": 0.446083664894104, "beginner": 0.25285661220550537, "expert": 0.301059752702713 }
22,366
3 issues were found when checking AAR metadata: 1. Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 2. Dependency 'androidx.activity:activity-ktx:1.8.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 3. Dependency 'androidx.activity:activity-compose:1.8.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on).
24456e5381c0c4891d80737fa4639f1d
{ "intermediate": 0.5595908164978027, "beginner": 0.23129186034202576, "expert": 0.2091173529624939 }
22,367
Hi! How to close flutter MODAL bottom sheet outside of bottom sheet itself
53d6f8464fdd430507811bc2437e6ae4
{ "intermediate": 0.3515174686908722, "beginner": 0.23150143027305603, "expert": 0.416981041431427 }
22,368
Project directory of a tauri app with multiple pages.
30b261642e61fa127cc04cd4fe9b8112
{ "intermediate": 0.32131242752075195, "beginner": 0.2222389131784439, "expert": 0.45644861459732056 }
22,369
I have a C function which takes in a pointer to a struct, how do I modify one of the struct's member variables?
619233c244ccca700caacad8da85e5d8
{ "intermediate": 0.19299070537090302, "beginner": 0.5709699988365173, "expert": 0.23603938519954681 }
22,370
Values in column A are all date values in the format dddd dd/mm/yy. Values in column E are all time values in the format 00:00:00 PM For each row there is a time value in column E. The time values in column E are sometimes repeated. In column A the date values are repeated in groups of the exact date. The number of rows containing the same dates that for a group vary. I want a VBA code that will search column A, Identify the rows that contain a group of exact dates, and find the time value in column E of the group that is the latest time. Then in the row where the latest time is found for that group, append the text value 'Close' to column V. Then continue downwards column A to identify the next group of rows that contain the exact date and repepaet the process of determining the latest time value found in column E for that group and append the text value 'Close' to the relevant row in column V
71c0c2fad7eb2eb8b1580a607e7c1e10
{ "intermediate": 0.399024099111557, "beginner": 0.18858222663402557, "expert": 0.4123936891555786 }
22,371
In Vulkan, what type is VkPipelineLayout? A struct? How do I modify sType from a pointer to VkPipelineLayout?
1f66058d999dd6a13ae1bde0d25dac6f
{ "intermediate": 0.5650598406791687, "beginner": 0.2288474291563034, "expert": 0.20609275996685028 }
22,372
Values in column A are all date values in the format dddd dd/mm/yy. Values in column E are all time values in the format 00:00:00 PM For each row there is a time value in column E. The time values in column E are sometimes repeated. In column A the date values are repeated in groups of the exact date. The number of rows containing the same dates that for a group vary. I want a VBA code that will search column A, Identify the rows that contain a group of exact dates, and find the time value in column E of the group that is the latest time. Then in the row where the latest time is found for that group, append the text value 'Close' to column V. Then continue downwards column A to identify the next group of rows that contain the exact date and repepaet the process of determining the latest time value found in column E for that group and append the text value 'Close' to the relevant row in column V I have tried using this code but keep getting a type mismatch error. Sub AddCloseTextToLatestTime() Dim lastRow As Long, i As Long Dim currentGroup As String, currentGroupEndTime As Date 'Get the last row in column A lastRow = Cells(Rows.Count, "A").End(xlUp).row 'Loop through each row in column A For i = 2 To lastRow 'Check if it’s a new group If CStr(Cells(i, "A").Value) <> currentGroup Then 'Update the current group and end time currentGroup = CStr(Cells(i, "A").Value) currentGroupEndTime = timeValue(CDate(Cells(i, "E").Value)) Else 'Check if the current time is greater than the previous end time If timeValue(CDate(Cells(i, "E").Value)) > currentGroupEndTime Then 'Update the end time for the current group currentGroupEndTime = timeValue(CDate(Cells(i, "E").Value)) End If End If 'Check if it’s the last row in the group or the entire column If i = lastRow Or CStr(Cells(i + 1, "A").Value) <> currentGroup Then 'Find the row with the latest time value in the group For j = i To 2 Step -1 If CStr(Cells(j, "A").Value) = currentGroup Then 'Check if the current row has the latest end time If timeValue(CDate(Cells(j, "E").Value)) = currentGroupEndTime Then 'Add "Close" to column V of the current row Cells(j, "V").Value = "Close" Else 'Exit the loop if it’s not the latest time Exit For End If Else 'Exit the loop if the group has changed Exit For End If Next j End If Next i End Sub
9518fa45ea2633871362b52afda8d60c
{ "intermediate": 0.3830948770046234, "beginner": 0.3590613901615143, "expert": 0.2578437924385071 }
22,373
假设您的业务运行在4.5-Sigma质量水平。如果项目的年平均改进率为50%,需要多少年才能达到六西格玛质量?
dcd885410de9b5b2e62905ebf60dc3ce
{ "intermediate": 0.36349862813949585, "beginner": 0.19564971327781677, "expert": 0.440851628780365 }
22,374
If instead of "btrfs device add /dev/blah /path and then btrfs balance -dconvert=raid1 -mconvert=raid1 /path" (without the quotes), I did "btrfs device add /dev/blah /path and then btrfs balance -dconvert=raid1 -mconvert=raid1 -dlimit=1 -mlimit=1 /path", what would happen?
c6a21882b1ecb83d6e4ee97ae951dc51
{ "intermediate": 0.3699786067008972, "beginner": 0.41069352626800537, "expert": 0.21932783722877502 }
22,375
asm compare xmm registers
7b2fb31f098ed21c328028e0c5424a7b
{ "intermediate": 0.43042728304862976, "beginner": 0.3581167161464691, "expert": 0.21145597100257874 }
22,376
Write an organ prelude in the style of JS Bach.
221c5ae8587645931280f851acab868b
{ "intermediate": 0.368432879447937, "beginner": 0.3381211459636688, "expert": 0.2934459447860718 }
22,377
im bored, I am not allowin myself youtube or any social media for this entire week, and maybe longer. What should I do? I could read but what else could I do, I wanna learn business.
2fe08a471d05b2b23c78064a996a59be
{ "intermediate": 0.33096784353256226, "beginner": 0.3979364335536957, "expert": 0.27109572291374207 }
22,378
In column A and column E, the values generated by a formula. In column E, all the cells display time values formated '00:00:00 PPM' In column A, all the cells dispaly date values formated as 'dddd dd/mm/yyyy' In column A from row 2 downwards the row values are grouped into varying number of rows each group dispalying a unique date. For example, the dates in A2:A10 can be 'Monday 23/10/2023' then the dates in the next group A11:A15 can be 'Tue 24/10/2023' then the dates in the next group A16:A31 can be 'Wed 25/10/2023' and so on. I want a VBA code that will identify the rows that form a unique group of the same date, then check the corresponding time values of that group in the same row group of column E, identify which is the latest time value and on the same row where the latest time value is found, append the value 'Close' to column V. After the VBA code has done this for the first group of dates in column A, it then continues and identifies the next group of unique and equal dates in column A and repeats the process until all the groups have been found.
e27703016feec4cee72009bff41a32c3
{ "intermediate": 0.3733378052711487, "beginner": 0.14266668260097504, "expert": 0.4839954674243927 }
22,379
hi
b0a42b12a1049b81742c54c2586787c3
{ "intermediate": 0.3246487081050873, "beginner": 0.27135494351387024, "expert": 0.40399640798568726 }
22,380
how to merge two dataframes in pandas and save one column from first dataframe
e76e3df67f86a7662b563bea6254015a
{ "intermediate": 0.5373913645744324, "beginner": 0.14433398842811584, "expert": 0.3182746171951294 }
22,381
Implement C# delegate for Func<string, int, int> with lambda expression
b2656eb3f8beb3987f6bb5be3c262c94
{ "intermediate": 0.4046989381313324, "beginner": 0.383250892162323, "expert": 0.21205021440982819 }
22,382
im react test library whats the difference between findByText and querybyText
dd2901a418631632b2fa79d951f14c41
{ "intermediate": 0.7402851581573486, "beginner": 0.09966085851192474, "expert": 0.16005399823188782 }
22,383
Figure out regular expression which allows to parse the following multiple lines of the log on 1)date-time, 2)level, 3) message: [2021-01-01 01:00:00][Trace] Initialization [2021-01-01 01:00:01][Warn] Configuration not found [2021-01-01 01:00:02][Trace] Creating new configuration [2021-01-01 01:00:03][Trace] Created [2021-01-01 01:00:04][Trace] Running [2021-01-01 01:00:05][Error] Fatal error: no processing method defined
5e3486bcaae633686b40f9221099e5fc
{ "intermediate": 0.399478018283844, "beginner": 0.32959869503974915, "expert": 0.27092334628105164 }
22,384
How to use faker lib in flask app
4a96c7c50809c02038f95c0a1776bc2c
{ "intermediate": 0.785045862197876, "beginner": 0.10156844556331635, "expert": 0.11338575184345245 }
22,385
Coding uno smile che gira
2f8bfd628ee8e6130bcb027ba3492f35
{ "intermediate": 0.2865147888660431, "beginner": 0.26182860136032104, "expert": 0.45165660977363586 }
22,386
I have the following script to modify the font of an epub file. But, I don't see any font changes in output.epub. What changes can I make to my script to make sure the new font is getting applied to the content of the epub file? import os from ebooklib import epub proj_root = '/home/rayhanmuktader/Workspace/projects/personal/epub' existing_epub = f'{proj_root}/input/existing.epub' # Load the existing EPUB file book = epub.read_epub(existing_epub) # Add the custom font file to the "fonts" folder font_filename = 'Fast_Sans.ttf' font_path = f'{proj_root}/fonts/{font_filename}' epub_font_path = os.path.join('fonts', font_filename) # Create an EpubItem for the font file font_item = epub.EpubItem(uid="font1", file_name=epub_font_path, media_type="application/x-font-ttf") with open(font_path, 'rb') as font_file: font_item.set_content(font_file.read()) # Add the font file to the book book.add_item(font_item) # Create a CSS file that uses the custom font css_content = '@font-face { font-family: "CustomFont"; src: url("' + epub_font_path + '"); }' css_item = epub.EpubItem(uid="style1", file_name="styles/styles.css", media_type="text/css", content=css_content) # Add the CSS file to the book book.add_item(css_item) # Apply the CSS file to all HTML items in the book for item in book.get_items(): if isinstance(item, epub.EpubHtml): item.add_item(css_item) # Save the modified EPUB file epub.write_epub(f'{proj_root}/output/output.epub', book)
087693e219e47e89b34e225418cb9ff3
{ "intermediate": 0.6066687703132629, "beginner": 0.18396306037902832, "expert": 0.20936819911003113 }
22,387
Make a roblox script that gets all the moves in chess a night can do. For example, the function's name is GetKnightMoves("D4"), Returning all the moves of the knight from D4 {"E2","C2","B3","B5", etc.
d8b4656d1dc630a29ad055267040d5fd
{ "intermediate": 0.2961832284927368, "beginner": 0.29077956080436707, "expert": 0.4130372107028961 }
22,388
suggest lua code to split string into words and put them into an array
0d39092bae9444b232a45a5e256d48e2
{ "intermediate": 0.41236576437950134, "beginner": 0.1250585913658142, "expert": 0.4625755846500397 }
22,389
The line item.content = item.content.replace(b"<body>", b'<body class="custom">') does not do anything to apply Fast_Sans.ttf to the output.epub. Modify the code for generating CSS so the Fast_Sans.ttf font get applied to output.epub. import os from ebooklib import epub proj_root = '/home/rayhanmuktader/Workspace/projects/personal/epub' existing_epub = f'{proj_root}/input/existing.epub' # Load the existing EPUB file book = epub.read_epub(existing_epub) # Add the custom font file to the "fonts" folder font_filename = 'Fast_Sans.ttf' font_path = f'{proj_root}/fonts/{font_filename}' epub_font_path = os.path.join('fonts', font_filename) # Create an EpubItem for the font file font_item = epub.EpubItem(uid="font1", file_name=epub_font_path, media_type="application/x-font-ttf") with open(font_path, 'rb') as font_file: font_item.set_content(font_file.read()) # Add the font file to the book book.add_item(font_item) # Create a CSS file that uses the custom font css_content = f'@font-face {{ font-family: "Fast_Sans"; src: url("{epub_font_path}"); }}' css_item = epub.EpubItem(uid="style1", file_name="styles/styles.css", media_type="text/css", content=css_content) # Add the CSS file to the book book.add_item(css_item) # Apply the CSS file to all HTML items in the book for item in book.get_items(): if isinstance(item, epub.EpubHtml): item.add_link(href='styles/styles.css', rel='stylesheet', type='text/css') item.content = item.content.replace(b"<body>", b'<body class="custom">') # Save the modified EPUB file epub.write_epub(f'{proj_root}/output/output.epub', book)
c64dffddbe84abb1799aa7c0bfe4397d
{ "intermediate": 0.48867228627204895, "beginner": 0.29341447353363037, "expert": 0.21791328489780426 }
22,390
setOnFocusChangeListener в java и в kotlin
5db5bdf24cd559cd19d5833c6fdce33c
{ "intermediate": 0.5126649737358093, "beginner": 0.2701163589954376, "expert": 0.21721868216991425 }
22,391
C# What CloseReason catches crashes/not responding ending task
26fe8fafde988cfde5bcb440865c3084
{ "intermediate": 0.47673463821411133, "beginner": 0.3800428807735443, "expert": 0.14322243630886078 }
22,392
2023-10-24 06:21:59.622 13402-13402 AndroidRuntime com.example.lab_test_1 D Shutting down VM 2023-10-24 06:21:59.625 13402-13402 AndroidRuntime com.example.lab_test_1 E FATAL EXCEPTION: main Process: com.example.lab_test_1, PID: 13402 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.lab_test_1/com.example.lab_test_1.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3689) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:206) at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:174) at android.content.Context.obtainStyledAttributes(Context.java:999) at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:922) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889) at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:691) at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:264) at com.example.lab_test_1.MainActivity.<init>(MainActivity.kt:17) at java.lang.Class.newInstance(Native Method) at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) at android.app.Instrumentation.newActivity(Instrumentation.java:1378) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3676) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:205)  at android.os.Looper.loop(Looper.java:294)  at android.app.ActivityThread.main(ActivityThread.java:8177)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)  ---------------------------- PROCESS ENDED (13402) for package com.example.lab_test_1 ----------------------------
5bb7edf5eba0e6e19b12346a0e50c485
{ "intermediate": 0.4178221821784973, "beginner": 0.48593226075172424, "expert": 0.09624556452035904 }
22,393
2023-10-24 06:24:35.937 13504-13504 AndroidRuntime com.example.lab_test_1 D Shutting down VM 2023-10-24 06:24:35.941 13504-13504 AndroidRuntime com.example.lab_test_1 E FATAL EXCEPTION: main Process: com.example.lab_test_1, PID: 13504 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.lab_test_1/com.example.lab_test_1.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3689) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:206) at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:174) at android.content.Context.obtainStyledAttributes(Context.java:999) at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:922) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889) at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:691) at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:264) at com.example.lab_test_1.MainActivity.<init>(MainActivity.kt:15) at java.lang.Class.newInstance(Native Method) at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) at android.app.Instrumentation.newActivity(Instrumentation.java:1378) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3676) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:205)  at android.os.Looper.loop(Looper.java:294)  at android.app.ActivityThread.main(ActivityThread.java:8177)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
d0e95f46f26eae4d6788ca99dbbbe9d7
{ "intermediate": 0.4311666190624237, "beginner": 0.48074764013290405, "expert": 0.08808574825525284 }
22,394
can you write svg codes
0f43cdad0d666f917a0c3b2966bcc3f7
{ "intermediate": 0.4073595106601715, "beginner": 0.22867262363433838, "expert": 0.3639678657054901 }
22,395
You should use 10 threads in your program. Your program will read in 1 million unsorted numbers from numbers.dat into an array. Then you will logically split the array into 10 sections – each section will have 100,000 numbers. You will call pthread_create( ) 10 times and pass each section of the array to the thread to sort using the bubble sort algorithm. Once all the threads have returned, you will merge 2 adjacent sections into a sorted super section, and continue to do that until all the smaller sorted sections are in one large sorted section – which will be the entire array of 1 million numbers. Then print the array to a file. Then you will call sort -c to verify the output file is sorted.
fc7b5de820169af20deec87ccfb37c90
{ "intermediate": 0.36566999554634094, "beginner": 0.11557378619909286, "expert": 0.5187562108039856 }
22,396
help me write a java: Given an abstract class Vectors, an interface Arithmetic<E> and the main program, write Java classes of 2D vectors (SimpleVec2D) and a table (SimpleTable) structure to store and manage multiple instances of SimpleVec2D based on the following requirements. The SimpleVec2D class: SimpleVec2D class is a concrete subclass of Vectors and it implements the Arithmetic<E> interface It has 2 properties (x, y): “x” and “y” are the two components of a 2D vector. Both “x” and “y” are double (data type) When creating an instance of SimpleVec2D, “x” and “y” are all required It overrides the hashCode(). It uses the remainder of the distance divide by 5 as the hash value. Part of the SimpleTable class is given. Complete two methods of it: AddElement(): To add the reference of a new SimpleVec2D instance to the table. - “theTable” is a 2D array. The first index (which row) of “theTable” refers the hash value. The new element will be added to the row based on the hash value. - When an element is being added to a row, it will move all the current elements 1 step to the end and then add the new reference as the first element. - For example, a new vector has the hash value equal to 2 will be added to theTable[2][0] SumElement(): It calculates the summation of all the vectors in the table and returns the result. Example Input & Output: No user input. The test values are generated by Math.random() in the main program. Output: (2.92, 2.56) Dist = 3.89, HashCode = 4 (1.51, 5.60) Dist = 5.81, HashCode = 1 (2.84, 9.33) Dist = 9.76, HashCode = 0 (3.59, 7.26) Dist = 8.09, HashCode = 3 (7.97, 6.40) Dist = 10.23, HashCode = 0 (2.75, 7.33) Dist = 7.83, HashCode = 3 (9.72, 6.86) Dist = 11.90, HashCode = 2 (1.85, 0.59) Dist = 1.94, HashCode = 2 (5.96, 1.12) Dist = 6.06, HashCode = 1 (2.48, 2.61) Dist = 3.60, HashCode = 4 =========================================== [0] : 10.23 | 9.76 | [1] : 6.06 | 5.81 | [2] : 1.94 | 11.90 | [3] : 7.83 | 8.09 | [4] : 3.60 | 3.89 | =========================================== SUM = (41.59, 49.68) Dist = 64.79 SUM - First = (38.67, 47.12) Dist = 60.95
c827be521aca14f7f31bc0179cbff2c1
{ "intermediate": 0.48944440484046936, "beginner": 0.2339252084493637, "expert": 0.2766304314136505 }
22,397
there is a 2048-bits rsa key,E= 010001,and key =E4E5FAAEC44EC963D901130B70F00CB93DAE7701D83157EAF8198954B4793450EB80FBEFEDA616BEE2523A4EF89078DF73108AC70A69D5E6803844CB4DB2F2E243BC582ACC55496543A0899AEB41F07DC1E4CB4DD25DB1C2A542648F9232AE8B1A02B61DA965C523F43C98F1F7BF9437D7744C1FFB4558136FA6D0F0F4B1BD8B9E39355C550309B33D90D112CB7097293D1F8F6156DA12CCEB1383C8C2BC70DDAB332025C7BA868404912D0E1148441A9321B2414A5C06560B375792E9ED429BA183A888946429A59A7738D01FB2217947D02EF3A1545E97A12C276B69010E4CC903E2403928278E36D6F9969265D5215B431CE9685854E4C1FC6192EF84ABBD7912b0734ac0c5c37ba016dbc16427c6bfba8d963b2d766c81c8b81c46cda97f77e224e0b6da5843a5608b19045f1ea04ab3a04441dcd35875cfcd8b9fd09caa53dbc6e2f46bd443aceeb87a6a1fd9be1b1612f759e3574836b3948f606c5068a15c77c9deb546fe8a8c96f5bdeee6ce56b75c20ba7ee66479754a2579b89e21c06f4e3ba1a615c03d85500bfb60845e8842232108775a69cf319db6292bf2d4eee54968b195a5714eddc83d4ea7013b4b9c951ea6246b5be41df49501c4fc75accd375349bf8d085af5002dd48029ed97cfb58c1694363d1ba7cb4153f0020775bf5fe4e1bedd6de1636c8e0d14448e0455e0481364393df6accbaf7b2b25c1F7078E22601D69BA311C49232E723DA0C3143BC2CA8782B5B70D7E5FD45323FCBBA674A491D360A432697070B86421ED8F6B3B2C541858B27949EE113BF97A7458F2263EFBF2C284FE28E1E2D3C659E61FE8195E89F247C66065A0EA8F5024074DA0BCC15D29F2A19A1E1E0BF05596EF1954579263165D87EF7AFE78E40F3DD1ED35DF5C2A28D33E8A0A385C5A93AB17A4FF67890BCC8C76A27C19A1AF870A2074B4CE14D062F8B72DDC723B88BA8ACDCB39DC4C6F99535186E16F9974DDD31B9D0066952E1BA48E672B244BFD309C9A7DB7BB752C2D514642E3689F71E2ACE06F616BC8A712FC9BBDA09567288A998FA24902B96224C4CFA314B6F0F6976E2D46E369F0E1376E9EFA76307EB8627477B36629C361DDAA79C2ACDD07477D11172A26B2EA26D60F79141A819F8C56CF52FCC9EEC41E3E4D34B0079855D284A4BB5FE31C5060E9D0B09F118198A3BE50DB18A934D970A860DD9ED40A55EE1C9710F074231C2DAD5C9A0C6929D08889AA58B0C0D98386245ADA8207743DC9942C3A5F29F2F07D34778979E7DAA909F88A9346F3A17E0E059C2E22C1B90073CC3F9DDA306AD9073076176B304157BB411FECE3863CBA7BFF1114583349DA2BCF9504034BEDBDEFD37A6A3F7B4261DE91980A561A54C39DC2CF31B5EB10CDABBE04D3276D97A9AA1941D64D87F2AD48BDC03286007EE7EEF22BBFF55ADD7376F004316FE580D6D62069FDCF5A20DA17F41EBA49A01D73FD77E12EB9593732193DE75E060FA0431B4604B34C53F822F34DA3DA8E2A5E2C445C9C7C11D75830987B6771582F6F34A20A7226A6AE28321C5E89112B8AB747FFADE4EFF2EF9953D5822B30B7F9C9C15E66CB78A00C174E1146C847843352B0A68657BCE6DE07AA45788B85 , how can i use openssl lib to implements rsa private operation
93e3e44aa5ff0259de4862aa8bf6a3b3
{ "intermediate": 0.22437246143817902, "beginner": 0.5002407431602478, "expert": 0.2753868103027344 }
22,398
Google Sheet formula for IF Margin is positive, then IFS formula kicks in
5814695b3eb6732f85337fd4c1de1b96
{ "intermediate": 0.3122323751449585, "beginner": 0.15571196377277374, "expert": 0.532055675983429 }
22,399
Here are my instructions: This assignment uses pthreads to perform parallel processing – allowing you to speed up your sort program substantially. You should use 10 threads in your program. Your program will read in 1 million unsorted numbers from numbers.dat into an array. Then you will logically split the array into 10 sections – each section will have 100,000 numbers. You will call pthread_create( ) 10 times and pass each section of the array to the thread to sort using the sort algorithm you used in the previous assignment. Once all the threads have returned, you will merge 2 adjacent sections into a sorted super section, and continue to do that until all the smaller sorted sections are in one large sorted section – which will be the entire array of 1 million numbers. Then print the array to a file. Then you will call sort -c to verify the output file is sorted. Now please check my code below for errors according to those instructions: #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <thread> #include <iostream> #include <unistd.h> #include <fstream> using namespace std; unsigned int NUM_THREADS = 8; unsigned int NUM_SIZE = 1000000; struct printStruct{ int *pstart; // pointer to the starting array element int size; } void *bubblesort(void *ptr){ printStruct *arg = (printStruct *) ptr; int i, j; for(int i = 0; i < (elements - 1); i++) { for (int j = 0; j < (elements - 1 - i); j++) { if (sortArray[j] > sortArray[j+1]) { temp = sortArray[j]; sortArray[j] = sortArray[j+1]; sortArray[j+1] = temp; } } } return NULL; } void merge(int* left, int* right, int leftSize, int rightSize){ int leftIndex = 0, rightIndex = 0, mergedIndex = 0; int* temp = new int[leftSize + rightSize]; while(leftIndex < leftSize && rightIndex < rightSize){ /* this part is sus temp[merged++] = left[left] < right[right] */ } while(leftIndex < leftSize){ temp[mergedIndex++] = left[leftIndex++]; } while(rightIndex < rightSize){ temp[mergedIndex++] = right[rightIndex++] } delete[] temp; } int main(int argc, char*argv[]) { ifstream numFile(argv[1]); int elements = 0; int sortArray[1000000]; int size; // size of the array = size of the elements int temp; while (numFile >> size) { sortArray[elements] = size; elements++; } numFile.close(); printStruct s1; s1.pstart = s1.size = 100000; printStruct s2; s2.pstart = s2.size = 100000; printStruct s3; s3.pstart = s3.size = 100000; printStruct s4; s4.pstart = s4.size = 100000; printStruct s5; s5.pstart = s5.size = 100000; printStruct s6; s6.pstart = s6.size = 100000; printStruct s7; s7.pstart = s7.size = 100000; printStruct s8; s8.pstart = s8.size = 100000; printStruct s9; s9.pstart = s9.size = 100000; printStruct s10; s10.pstart = s10.size = 100000; pthread_t thread0, thread1, thread2, thread3, thread4, thread5, thread6, thread7, thread8, thread9; int iret0, iret1, iret2, iret3, iret4, iret5, iret6, iret7, iret8, iret9; iret0 = pthread_create( &thread0, NULL, bubblesort, (void*) &s1); iret1 = pthread_create( &thread1, NULL, bubblesort, (void*) &s2); iret2 = pthread_create( &thread2, NULL, bubblesort, (void*) &s3); iret3 = pthread_create( &thread3, NULL, bubblesort, (void*) &s4); iret4 = pthread_create( &thread0, NULL, bubblesort, (void*) &s5); iret5 = pthread_create( &thread1, NULL, bubblesort, (void*) &s6); iret6 = pthread_create( &thread2, NULL, bubblesort, (void*) &s7); iret7 = pthread_create( &thread3, NULL, bubblesort, (void*) &s8); iret8 = pthread_create( &thread0, NULL, bubblesort, (void*) &s9); iret9 = pthread_create( &thread1, NULL, bubblesort, (void*) &s10); pthread_join( thread0, NULL); pthread_join( thread1, NULL); pthread_join( thread2, NULL); pthread_join( thread3, NULL); pthread_join( thread4, NULL); pthread_join( thread5, NULL); pthread_join( thread6, NULL); pthread_join( thread7, NULL); pthread_join( thread8, NULL); pthread_join( thread9, NULL); ofstream outFile(argv[2]); for(int i = 0; i < elements; i++) { outFile << sortArray[i] << endl; } outFile.close(); return 0; }
fd8f83ad7aea938a752bc50e15f0df9a
{ "intermediate": 0.34137022495269775, "beginner": 0.4485401213169098, "expert": 0.21008966863155365 }
22,400
how to achieve that use SAPUI5 to show a paragraph of text and make part of the text bold and part of the text as link.
548456d0d6170ca15abcfb79b733b127
{ "intermediate": 0.3119669258594513, "beginner": 0.2573332190513611, "expert": 0.4306998550891876 }
22,401
please program a procedure to achieve a timer
69e2151fcbc6b73b96e5a1b1c0af7b85
{ "intermediate": 0.3136547803878784, "beginner": 0.17095500230789185, "expert": 0.5153902173042297 }
22,402
Does my code below work? Change only what does not work and leave it alone if it does. #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <thread> #include <iostream> #include <unistd.h> #include <fstream> using namespace std; unsigned int NUM_THREADS = 10; unsigned int NUM_SIZE = 1000000; struct printStruct{ int *pstart; // pointer to the starting array element int size; } void *bubblesort(void *ptr){ printStruct *arg = (printStruct *) ptr; int i, j; for(int i = 0; i < (elements - 1); i++) { for (int j = 0; j < (elements - 1 - i); j++) { if (sortArray[j] > sortArray[j+1]) { temp = sortArray[j]; sortArray[j] = sortArray[j+1]; sortArray[j+1] = temp; } } } return NULL; } void merge(int* left, int* right, int leftSize, int rightSize){ int leftIndex = 0, rightIndex = 0, mergedIndex = 0; int* temp = new int[leftSize + rightSize]; while(leftIndex < leftSize && rightIndex < rightSize){ if (left[leftIndex] < right[rightIndex]) { temp[mergedIndex++] = left[leftIndex++]; } else { temp[mergedIndex++] = right[rightIndex++]; } } while(leftIndex < leftSize){ temp[mergedIndex++] = left[leftIndex++]; } while(rightIndex < rightSize){ temp[mergedIndex++] = right[rightIndex++] } for (int i = 0; i < mergedIndex; i++) { left[i] = temp[i]; } delete[] temp; } int main(int argc, char*argv[]) { ifstream numFile(argv[1]); int elements = 0; int sortArray[NUM_SIZE]; int size; int temp; while (numFile >> size) { sortArray[elements] = size; elements++; } numFile.close(); printStruct s1; s1.pstart = sortArray; s1.size = 100000; printStruct s2; s2.pstart = sortArray + 100000; s2.size = 100000; printStruct s3; s3.pstart = sortArray + 200000; s3.size = 100000; printStruct s4; s4.pstart = sortArray + 300000; s4.size = 100000; printStruct s5; s5.pstart = sortArray + 400000; s5.size = 100000; printStruct s6; s6.pstart = sortArray + 500000; s6.size = 100000; printStruct s7; s7.pstart = sortArray + 600000; s7.size = 100000; printStruct s8; s8.pstart = sortArray + 700000; s8.size = 100000; printStruct s9; s9.pstart = sortArray + 800000; s9.size = 100000; printStruct s10; s10.pstart = sortArray + 900000; s10.size = 100000; pthread_t thread0, thread1, thread2, thread3, thread4, thread5, thread6, thread7, thread8, thread9; int iret0, iret1, iret2, iret3, iret4, iret5, iret6, iret7, iret8, iret9; iret0 = pthread_create( &thread0, NULL, bubblesort, (void*) &s1); iret1 = pthread_create( &thread1, NULL, bubblesort, (void*) &s2); iret2 = pthread_create( &thread2, NULL, bubblesort, (void*) &s3); iret3 = pthread_create( &thread3, NULL, bubblesort, (void*) &s4); iret4 = pthread_create( &thread0, NULL, bubblesort, (void*) &s5); iret5 = pthread_create( &thread1, NULL, bubblesort, (void*) &s6); iret6 = pthread_create( &thread2, NULL, bubblesort, (void*) &s7); iret7 = pthread_create( &thread3, NULL, bubblesort, (void*) &s8); iret8 = pthread_create( &thread0, NULL, bubblesort, (void*) &s9); iret9 = pthread_create( &thread1, NULL, bubblesort, (void*) &s10); pthread_join( thread0, NULL); pthread_join( thread1, NULL); pthread_join( thread2, NULL); pthread_join( thread3, NULL); pthread_join( thread4, NULL); pthread_join( thread5, NULL); pthread_join( thread6, NULL); pthread_join( thread7, NULL); pthread_join( thread8, NULL); pthread_join( thread9, NULL); ofstream outFile(argv[2]); for(int i = 0; i < elements; i++) { outFile << sortArray[i] << endl; } outFile.close(); return 0; }
7195725728799df1fe10609ef4f81e4e
{ "intermediate": 0.32251355051994324, "beginner": 0.5906148552894592, "expert": 0.08687154948711395 }
22,403
Psychologists observe that ‘individuals are less likely to offer help to a victim when there are other people present,’ and call this phenomenon the bystander effect (quote from Wikipedia). For example, if a person has a heart attack in a public square and one other person is around, the other person is likely to assist the victim, while if a large crowd is around, no one may volunteer help because the emergency is ‘someone else’s problem.’ Model this environment as a game. Solve for Nash equilibria. Use this to comment on whether the bystander effect can be explained as a purely rational consequence of the environment or whether it points to other social-psychological factors at work. Evaluate which factors are likely to make the bystander effect or less extreme. Introduce a policy intended to blunt the effect and demonstrate with your model that it does so.
56be440b3edd3fb8f9a2216315d90e95
{ "intermediate": 0.2834118604660034, "beginner": 0.41967645287513733, "expert": 0.29691174626350403 }