row_id int64 0 48.4k | init_message stringlengths 1 342k | conversation_hash stringlengths 32 32 | scores dict |
|---|---|---|---|
22,404 | Print table using do while loop in c++ | cb6159f613b321753969f19bf83e2d83 | {
"intermediate": 0.20686550438404083,
"beginner": 0.633698046207428,
"expert": 0.1594364494085312
} |
22,405 | Please write me a VBA module that will do the following.
Clear all contents of worksheet SsBOOKonly
Copy all values and format only of worksheet BOOKING to SsBOOKonly
Then copy all formulas only in column H and I from worksheet BOOKING to
column H and I in worksheet SsBOOKonly
Then calculate the entire worksheet SsBOOKonly | d89680ab55313f597e376893a526cc3a | {
"intermediate": 0.4624190628528595,
"beginner": 0.300937682390213,
"expert": 0.2366432547569275
} |
22,406 | Error in prcomp.default() : argument "x" is missing, with no default | 99f83f994f7c4f269d0fbe26efb9fa06 | {
"intermediate": 0.383202463388443,
"beginner": 0.2672588527202606,
"expert": 0.3495386838912964
} |
22,407 | What should be corrected it cannot read field "x" because "other" is null:
import java.util.Arrays;
abstract class Vectors {
}
interface Arithmetic<E> {
E add(E other);
}
class SimpleVec2D extends Vectors implements Arithmetic<SimpleVec2D> {
double x;
double y;
public SimpleVec2D(double x, double y) {
this.x = x;
this.y = y;
}
@Override
public SimpleVec2D add(SimpleVec2D other) {
double newX = this.x + other.x;
double newY = this.y + other.y;
return new SimpleVec2D(newX, newY);
}
@Override
public int hashCode() {
double distance = Math.sqrt(x * x + y * y);
return (int) (distance % 5);
}
@Override
public String toString() {
return "(" + x + ", " + y + ")";
}
public SimpleVec2D negate() {
return null;
}
}
class SimpleTable {
SimpleVec2D[][] theTable;
public SimpleTable() {
theTable = new SimpleVec2D[5][0];
}
public void addElement(SimpleVec2D vector) {
int hashCode = vector.hashCode();
theTable[hashCode] = Arrays.copyOf(theTable[hashCode], theTable[hashCode].length + 1);
SimpleVec2D[] row = theTable[hashCode];
System.arraycopy(row, 0, row, 1, row.length - 1);
row[0] = vector;
}
public SimpleVec2D sumElement() {
SimpleVec2D sum = new SimpleVec2D(0, 0);
for (SimpleVec2D[] row : theTable) {
for (SimpleVec2D vector : row) {
sum = sum.add(vector);
}
}
return sum;
}
@Override
public String toString() {
StringBuilder a = new StringBuilder();
for (int i = 0; i < theTable.length; i++) {
a.append("[").append(i).append("] : ");
for (SimpleVec2D vector : theTable[i]) {
a.append(vector).append(" | ");
}
a.append("\n");
}
return a.toString();
}
}
public class Assgin3_p2205041 {
public static void main(String[] args) {
SimpleTable table = new SimpleTable();
for (int i = 0; i < 10; i++) {
double x = Math.random() * 10;
double y = Math.random() * 10;
SimpleVec2D vector = new SimpleVec2D(x, y);
table.addElement(vector);
System.out.println(vector + " Dist = " + Math.sqrt(x * x + y * y) + ", HashCode = " + vector.hashCode());
}
System.out.println("===========================================\n");
System.out.println(table);
System.out.println("===========================================\n");
SimpleVec2D sum = table.sumElement();
System.out.println("SUM = " + sum + " Dist = " + Math.sqrt(sum.x * sum.x + sum.y * sum.y));
System.out.println("SUM - First = " + sum.add(((SimpleVec2D[]) table.theTable[4])[0].add(sum.negate())) + " Dist = " + Math.sqrt(sum.x * sum.x + sum.y * sum.y));
}
} | 01a976b85471f5402f598fbf199e6fad | {
"intermediate": 0.28440746665000916,
"beginner": 0.4739172160625458,
"expert": 0.24167536199092865
} |
22,408 | Hi, So this is the system I am thinking of. I want to collect data from different sources, using their external apis. I do this periodically using a cronjob in nodejs app. So, my question is what is the best and efficient way to collect this concurrently | cb3825775b19eab4c8aa9d782d4a5576 | {
"intermediate": 0.7293345928192139,
"beginner": 0.11812989413738251,
"expert": 0.1525355726480484
} |
22,409 | In python, write a function to print coordinates on the screen where mouse clicks. | cd1d2225f81cad1183bddebb8f95832b | {
"intermediate": 0.3488316535949707,
"beginner": 0.3028084337711334,
"expert": 0.3483598828315735
} |
22,410 | generate a html page that loads images using api that takes in custom post request body with a property in incremental manner. Images should load lazily. | fd7904063af6b1bf1b21cdb85a6842ff | {
"intermediate": 0.43609046936035156,
"beginner": 0.29354915022850037,
"expert": 0.2703603506088257
} |
22,411 | 检查这段代码的错误——import stu_info_manage
import stu_edit_manage
def main():
while True:
input_num = stu_info_manage.print_info()
if input_num == "1":
stu_edit_manage.add_student()
elif input_num == "2":
stu_edit_manage.delete_student()
elif input_num == "3":
stu_edit_manage.modify_student()
elif input_num == "4":
stu_edit_manage.query_student()
elif input_num == "5":
stu_edit_manage.browse_students()
elif input_num == "6":
break
else:
print("字符输入错误,请按提示输入!")
if _name_=="_main_":
main() | f33dfc7571ddc5daa302e3f48c9323da | {
"intermediate": 0.3951265215873718,
"beginner": 0.38757169246673584,
"expert": 0.21730180084705353
} |
22,412 | using UiPath function and syntax, suggest the formula in Assign activity. here is the requirement. Use today or now as a variable, to find the previous working date. For example, today is 2023-10-24, the previous working date is 2023-10-23. If today is 2023-9-30, the previous working date is 2023-9-29. If today is 2023-4-1, the previous working date is 2023-3-31. If today is 2023-10-2, the previous working date is 2023-9-29. | c60502636ea6745aefc3e0c64f3ab72c | {
"intermediate": 0.3091096878051758,
"beginner": 0.5188140273094177,
"expert": 0.1720762699842453
} |
22,413 | write a php script that requests a service using post body from the request call with specific headers. | c01d8de0b31668e14acb4bc52ac6222e | {
"intermediate": 0.3431221842765808,
"beginner": 0.2629415690898895,
"expert": 0.39393627643585205
} |
22,414 | write a php script that requests a service using post body with specific headers. the post body data will be sent as request body params. | b71059c34698f394f679a11ff27c22e1 | {
"intermediate": 0.4039198160171509,
"beginner": 0.2162231057882309,
"expert": 0.37985700368881226
} |
22,416 | Act as a Chrome Extension Developer
Task: Image Gallery Extension
Requirements: Take in API URL, Request Method, Request Body and Headers as params. Take the property that needs to change dynamically. The dynamically changing properly should be looped with numbers and the same should be replaced in each request. Load the requested images a gallery. The request should be paginated with next button. | 43aa10161c7de69e16c90860f3f3317f | {
"intermediate": 0.3997959494590759,
"beginner": 0.4038684666156769,
"expert": 0.1963355839252472
} |
22,417 | write cloudflare workers code that requests api with post body and headers in a loop. successful api calls will return a png image those images has to be changed to base64 and returned as param. | 57d9bf663f530c8624d8214b8111d858 | {
"intermediate": 0.44793185591697693,
"beginner": 0.3070155382156372,
"expert": 0.24505259096622467
} |
22,418 | Sentinal controlled repition while loop in C++ for beginners | bd5cf86ddc596ae1dc105dd6e734ba91 | {
"intermediate": 0.1298443228006363,
"beginner": 0.5463182926177979,
"expert": 0.32383739948272705
} |
22,419 | recommend_tab = pd.DataFrame(recommend, columns = ['course_id','1_recommendation','2_recommendation'])
ValueError: DataFrame constructor not properly called!
как исправить ошибку? | 0860719aa04c233df8f1c926f34f7981 | {
"intermediate": 0.4709434509277344,
"beginner": 0.25702255964279175,
"expert": 0.2720339894294739
} |
22,420 | write a chrome extension that loads a html code | 2b5399eb94a9ae974d3693430cdff573 | {
"intermediate": 0.44595104455947876,
"beginner": 0.3036949038505554,
"expert": 0.2503540813922882
} |
22,421 | write a chrome extension that loads a html file in options page | 7a410ab9cf631f5bca3a48fe02089c80 | {
"intermediate": 0.41330793499946594,
"beginner": 0.2963990867137909,
"expert": 0.29029297828674316
} |
22,422 | how can i print log to display using c++ class in unreal engine, please provide me an example | 977e6f708cee1e7f7aec315705486cdb | {
"intermediate": 0.5038647651672363,
"beginner": 0.31952694058418274,
"expert": 0.17660827934741974
} |
22,423 | recm_df = pd.DataFrame(columns=['course_id','recom_1','recom_2'])
recm_df['id_course'] = course_pairs_df['course_id'].unique()
recm_df['recom_1'] = recm_df['course_id'].apply(lambda x: recommend(x)[0][0])
recm_df['recom_2'] = recm_df['course_id'].apply(lambda x: recommend(x)[0][0])
recm_df
возникает ошибка, как исправить?
TypeError Traceback (most recent call last)
Untitled-3.ipynb Ячейка 34 line 4
1 recm_df = pd.DataFrame(columns=['course_id','recom_1','recom_2'])
2 recm_df['id_course'] = course_pairs_df['course_id'].unique()
----> 4 recm_df['recom_1'] = recm_df['course_id'].apply(lambda x: recommend(x)[0][0])
5 recm_df['recom_2'] = recm_df['course_id'].apply(lambda x: recommend(x)[0][0])
6 recm_df
File c:\Users\Владимир\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\series.py:4771, in Series.apply(self, func, convert_dtype, args, **kwargs)
4661 def apply(
4662 self,
4663 func: AggFuncType,
(...)
4666 **kwargs,
4667 ) -> DataFrame | Series:
4668 """
4669 Invoke function on values of Series.
4670
(...)
4769 dtype: float64
4770 """
-> 4771 return SeriesApply(self, func, convert_dtype, args, kwargs).apply()
File c:\Users\Владимир\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\apply.py:1123, in SeriesApply.apply(self)
...
----> 4 if i[0] == course_id:
5 list_course.append((i,count_of_courses[i]))
6 if i[1] == course_id:
TypeError: 'int' object is not subscriptable | 20d7e5ce2b67e6a97d1ebb200782400f | {
"intermediate": 0.5272958874702454,
"beginner": 0.3555850088596344,
"expert": 0.1171191930770874
} |
22,424 | how to find a java process in a windows system with ansible | 3589d6981aa35bb5071c04dfc1b369c5 | {
"intermediate": 0.5904048681259155,
"beginner": 0.209014892578125,
"expert": 0.20058025419712067
} |
22,425 | TypeError: 'int' object is not subscriptable что означает эта ошибка? | 31d7d4a457b7fa7aef3caf298ef7b780 | {
"intermediate": 0.37459900975227356,
"beginner": 0.38558387756347656,
"expert": 0.23981711268424988
} |
22,426 | Give me an Overpass Turbo query to retrieve every transit station in San Francisco | 76e0801cc118fddb97eec7dd6ad6eddb | {
"intermediate": 0.47700515389442444,
"beginner": 0.2369917780160904,
"expert": 0.28600308299064636
} |
22,427 | recm_df = pd.DataFrame(columns=['course_id','recom_1','recom_2'])
recm_df['course_id'] = count_of_courses['course_id'].unique()
recm_df['recom_1'] = recm_df['course_id'].apply(lambda x:recommend(x)[0][0])
recm_df['recom_2'] = recm_df['course_id'].apply(lambda x:recommend(x)[1][0])
recm_df
ошибка в строке recm_df['course_id'] = count_of_courses['course_id'].unique()
пишет 'int' object has no attribute 'unique', как исправить? | d77fc4fae8d1d57ce466ac5abea99c36 | {
"intermediate": 0.3636558949947357,
"beginner": 0.32478272914886475,
"expert": 0.31156134605407715
} |
22,428 | Since we're analyzing a full sequence, it's legal for us to look into future data.
A simple way to achieve that is to go both directions at once, making a bidirectional RNN.
In Keras you can achieve that both manually (using two LSTMs and Concatenate) and by using keras.layers.Bidirectional.
This one works just as TimeDistributed we saw before: you wrap it around a recurrent layer (SimpleRNN now and LSTM/GRU later) and it actually creates two layers under the hood.
Your first task is to use such a layer our POS-tagger.
#Эта часть в коде остаётся:
model = keras.models.Sequential()
model.add(L.InputLayer([None],dtype='int32'))
model.add(L.Embedding(len(all_words),50))
#Затем добавляем обертку tf.keras.layers.Bidirectional:
model.add(L.Bidirectional(L.SimpleRNN(64, return_sequences = True)))
#И добавляем слой Dense с активацией softmax:
model.add(L.Dense(len(all_tags),activation='softmax'))
model.compile('adam','categorical_crossentropy')
model.fit_generator(generate_batches(train_data),len(train_data)/BATCH_SIZE,
callbacks=[EvaluateAccuracy()], epochs=5,)
Task I: Structured loss functions (more bonus points)
Since we're tagging the whole sequence at once, we might as well train our network to do so. Remember linear CRF from the lecture? You can also use it as a loss function for your RNN
• There's more than one way to do so, but we'd recommend starting with Conditional Random Fields
• You can plug CRF as a loss function and still train by backprop. There's even some neat tensorflow implementation for you.
• Alternatively, you can condition your model on previous tags (make it autoregressive) and perform beam search over that model.
<YOUR CODE> | dde4f978f5fb9be22b21a8328b6bafea | {
"intermediate": 0.3197491765022278,
"beginner": 0.14585691690444946,
"expert": 0.534393846988678
} |
22,429 | Print numbers from 1 to 10 using a while loop. write a programm with tkinter | a60a1db8a5f82296d9915e67cf9809cd | {
"intermediate": 0.2276974469423294,
"beginner": 0.6403618454933167,
"expert": 0.13194066286087036
} |
22,430 | write code in nodejs to proxy request from the user | a324e6d868ac7ba41b8fc9ecb512f96e | {
"intermediate": 0.4493134319782257,
"beginner": 0.20687763392925262,
"expert": 0.3438089191913605
} |
22,431 | 无法解析插件 org.apache.maven.plugins:maven-jar-plugin:3.3.0
无法解析插件 org.apache.maven.plugins:maven-compiler-plugin:3.10.1
无法解析插件 org.apache.maven.plugins:maven-clean-plugin:3.2.0
无法解析插件 org.apache.maven.plugins:maven-surefire-plugin:3.0.0
无法解析插件 org.apache.maven.plugins:maven-install-plugin:3.1.0
无法解析插件 org.apache.maven.plugins:maven-deploy-plugin:3.1.0
无法解析插件 org.apache.maven.plugins:maven-resources-plugin:3.3.0
无法解析插件 org.apache.maven.plugins:maven-site-plugin:3.12.1 | 2a1a721804ff4e8ddeef1f794e2d72c5 | {
"intermediate": 0.35004863142967224,
"beginner": 0.3006008565425873,
"expert": 0.34935054183006287
} |
22,432 | code example with table and keys in Defold | 8824c990db28782c86336a710c18cd7a | {
"intermediate": 0.35570481419563293,
"beginner": 0.22943902015686035,
"expert": 0.4148561954498291
} |
22,433 | Here is an example of HTML:
<div class="row">
<div class="col">
<b>Date requested:</b>
24-Oct-23 14:16:00 (UTC +03:00)
<br>
<b>Date started:</b>
24-Oct-23 15:22:01 (UTC +03:00)
<br>
b>Date completed:</b>
-
<br>
<br>
<b>Date last updated:</b>
24-Oct-23 15:22:01 (UTC +03:00)
<br>
<b>Last updated by:</b>
<a class="employee-popover" data-bs-content="<small><i class='fas fa-key'></i> ergomed\se-testuser-03<br /><i class='fas fa-envelope'></i> <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS><br /><i class='fas fa-users'></i> IT (Group), Test<br /> <i class='fas fa-map-marker-alt'></i> UK (Home Based)<br /></small>" data-bs-trigger="hover">SE User 03 Test</a>
<br>
<br>
<b>Language from:</b>
German (DE)
<br>
<b>Language to:</b>
English (EN)
<br>
<br>
<a href="/4/attachments/41302/download"><svg class="svg-inline--fa fa-download" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="download" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M480 352h-133.5l-45.25 45.25C289.2 409.3 273.1 416 256 416s-33.16-6.656-45.25-18.75L165.5 352H32c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h448c17.67 0 32-14.33 32-32v-96C512 366.3 497.7 352 480 352zM432 456c-13.2 0-24-10.8-24-24c0-13.2 10.8-24 24-24s24 10.8 24 24C456 445.2 445.2 456 432 456zM233.4 374.6C239.6 380.9 247.8 384 256 384s16.38-3.125 22.62-9.375l128-128c12.49-12.5 12.49-32.75 0-45.25c-12.5-12.5-32.76-12.5-45.25 0L288 274.8V32c0-17.67-14.33-32-32-32C238.3 0 224 14.33 224 32v242.8L150.6 201.4c-12.49-12.5-32.75-12.5-45.25 0c-12.49 12.5-12.49 32.75 0 45.25L233.4 374.6z"></path></svg><!-- <i class="fas fa-download"></i> Font Awesome fontawesome.com --> Download source file</a>
</div>
</div>
Implement Playwright typescript POM function which getting the text which is below the <b>Date started:</b> | 9248314960fe3034556f325669a6d70e | {
"intermediate": 0.39004597067832947,
"beginner": 0.42758819460868835,
"expert": 0.1823657751083374
} |
22,434 | 2023-10-24 19:56:56.958 INFO 1 --- [or-http-epoll-2] o.s.g.filter.GlobalRequestLogFilter :
================ Gateway Request Start ================
===> GET: /blade-message/msg/unRead
===Headers=== Host: ["hnwechat.dnatop.cn"]
===Headers=== Connection: ["upgrade"]
===Headers=== Accept-Language: ["zh-CN,zh-Hans;q=0.9"]
===Headers=== Accept-Encoding: ["gzip, deflate, br"]
===Headers=== Accept: ["application/json, text/plain, */*"]
===Headers=== Blade-Auth: ["bearer 222222222dsfg34532gfd"]
===Headers=== User-Agent: ["Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.42(0x18002a2e) NetType/WIFI Language/zh_CN"]
===Headers=== Authorization: ["Basic aG53ZWNoYXR3cDpobndlY2hhdHdwX3NlY3JldA=="]
===Headers=== Referer: ["https://hnwechat.dnatop.cn/"]
===Headers=== Tenant-Id: ["100001"]
===Headers=== tenant_id: ["100001"]
===Headers=== user_id: ["17167857183123123129"]
================ Gateway Request End =================
2023-10-24 19:56:56.967 INFO 1 --- [or-http-epoll-2] o.s.g.filter.GlobalResponseLogFilter :
================ Gateway Response Start ================
<=== 200 GET: /blade-message/msg/unRead
===Headers=== transfer-encoding: ["chunked"]
===Headers=== Content-Type: ["application/json;charset=UTF-8"]
===Headers=== Date: ["Tue, 24 Oct 2023 11:56:56 GMT"]
================ Gateway Response End =================
以上为java的日志,请帮我写个vector(日志收集)的转换脚本转成json,输出到clickhouse | 0221cb9b2d4e6abff3d6261e6da0d91f | {
"intermediate": 0.3680265545845032,
"beginner": 0.24523909389972687,
"expert": 0.38673439621925354
} |
22,435 | how to check if type in json equals to type where it will be parsed in nlohmann::json | 919c0f3fb1c1a6906024fa5d1e788512 | {
"intermediate": 0.6225664615631104,
"beginner": 0.15728071331977844,
"expert": 0.2201528400182724
} |
22,436 | Visit_Number Subject_ID Treatment_Date Treatment_Time Dose_Amount Analyte
2 E1301001 2021-12-01 08:30 300 Anifrolumab(MEDI547) PK
8 E1301001 2021-12-29 07:00 300 Anifrolumab(MEDI547) PK
9 E1301001 2022-01-15 09:30 100 Anifrolumab(MEDI547) PK
2 E1301002 2021-12-03 08:30 300 Anifrolumab(MEDI547) PK
8 E1301002 2021-12-31 12:30 300 Anifrolumab(MEDI547) PK
9 E1301002 2022-01-18 08:30 100 Anifrolumab(MEDI547) PK
2 E1301003 2021-12-07 09:30 300 Anifrolumab(MEDI547) PK
8 E1301003 2022-01-06 10:30 300 Anifrolumab(MEDI547) PK
9 E1301003 2022-01-26 14:30 100 Anifrolumab(MEDI547) PK
based on above data how to fix this code toe get for each Visit_number transpose value for each subject trt0 <-trt %>%
melt(.,id=c("Analyte","Subject_ID")) %>%
dcast(.,Analyte+variable~Visit_Number) | 4793bf9db20500b1ce612f1d8db66104 | {
"intermediate": 0.4028048813343048,
"beginner": 0.34423723816871643,
"expert": 0.25295794010162354
} |
22,437 | For all the copy paste special actions, I would like to paste the conditional format from source to target
Can you help me make sure that the code below does this
Sub CopyFormulasAndCalculate()
Dim wsSource As Worksheet, wsTarget As Worksheet
Dim rngSource As Range, rngTarget As Range, rngDelete As Range, cell As Range
' Set the source and target worksheets
Set wsTarget = ThisWorkbook.Worksheets("SsBOOKonly")
Set wsSource = ThisWorkbook.Worksheets("BOOKING")
' Clear contents of target sheet
wsTarget.Cells.Clear
' Copy values and formats from source to target
Set rngSource = wsSource.UsedRange
Set rngTarget = wsTarget.Range("A1").Resize(rngSource.Rows.Count, rngSource.Columns.Count)
rngSource.Copy
rngTarget.PasteSpecial xlPasteValuesAndNumberFormats
' Delete rows with ‘School Bookin' in column B
Set rngDelete = Nothing ' Reset delete range
For Each cell In wsTarget.Range("B:B")
If cell.Value = "School Booking" Then
If rngDelete Is Nothing Then
Set rngDelete = cell.EntireRow
Else
Set rngDelete = Union(rngDelete, cell.EntireRow)
End If
End If
Next cell
If Not rngDelete Is Nothing Then rngDelete.Delete
' Copy formulas from source to target (columns H and I)
wsSource.Range("H:I").Copy
wsTarget.Range("H:I").PasteSpecial xlPasteFormulasAndNumberFormats
Call Module2.CalculateSsBooking
End Sub | 74bcfacd216795e5d38619a8d60a4d5b | {
"intermediate": 0.4382172226905823,
"beginner": 0.30053701996803284,
"expert": 0.2612457871437073
} |
22,438 | Within React component how do I track if user is changing the url? | 6a930853a751f0590cc015834fdece45 | {
"intermediate": 0.7434535026550293,
"beginner": 0.15170924365520477,
"expert": 0.10483722388744354
} |
22,439 | I am having an issue trying to generate ER Diagram on dbevaer for mongodb. The fields arenot being shown | 9649959fd4522f115e9db8d62be53beb | {
"intermediate": 0.4136568605899811,
"beginner": 0.2741316258907318,
"expert": 0.3122116029262543
} |
22,440 | In nim, how to fill a compiletime array with integer values such that there is a runtime array with the same values available? | f8d00ee1e698b319ab37852c927610bf | {
"intermediate": 0.26557859778404236,
"beginner": 0.09485223889350891,
"expert": 0.6395691633224487
} |
22,441 | When I run this code I get the error 'Next Without For' : Sub CalculateSsBooking()
Dim wsTarget As Worksheet
Dim rngSource As Range, rngTarget As Range, rngDelete As Range, cell As Range
Set wsTarget = ThisWorkbook.Worksheets("SsBOOKonly")
' Clear contents of column V in target sheet
wsTarget.Range("V:V").ClearContents
Dim lastRow As Long
Dim currentGroupStartRow As Long
Dim currentDate As Date
Dim latestTime As Date
Dim maxTimeRow As Long
lastRow = wsTarget.Cells(wsTarget.Rows.Count, 1).End(xlUp).row ' Update the line with "wsTarget"
' Start from the second row
currentGroupStartRow = 2
' Loop through all rows
For i = 2 To lastRow
' Check if the current date changes
'If wsTarget.Cells(i, 1).Value = "" Then Exit Sub ' Stop if empty cell is encountered
If wsTarget.Cells(i, 1).Value = "" Then
GoTo Transfer
Else
If wsTarget.Cells(i, 1).Value <> currentDate Then
' If it changes, calculate the latest time in the previous group
latestTime = wsTarget.Cells(currentGroupStartRow, 5).Value
maxTimeRow = currentGroupStartRow
For j = currentGroupStartRow + 1 To i - 1
If wsTarget.Cells(j, 5).Value > latestTime Then
latestTime = wsTarget.Cells(j, 5).Value
maxTimeRow = j
End If
Next j
' Append "Close" to column V in the row with the latest time
'If wsTarget.Cells(i, 1).Value = "" Then Exit Sub ' Stop if empty cell is encountered
If wsTarget.Cells(i, 1).Value = "" Then
GoTo Transfer
Else
If maxTimeRow <= lastRow Then ' Check if maxTimeRow is within bounds
wsTarget.Cells(maxTimeRow, 22).Value = "Close"
End If
' Update variables for the next group
currentDate = wsTarget.Cells(i, 1).Value
currentGroupStartRow = i
End If
Next i
Application.Wait (Now + timeValue("0:00:01"))
Transfer:
Call Module3.TransferFormat
End Sub | 20e9810badeffa1f90151172340ad738 | {
"intermediate": 0.4345453679561615,
"beginner": 0.36396288871765137,
"expert": 0.20149172842502594
} |
22,442 | create app.py for ( text to image) space using this model stabilityai/stable-diffusion-xl-base-1.0 | dac37107907c53e65b812271b2a88572 | {
"intermediate": 0.2535119950771332,
"beginner": 0.1815807819366455,
"expert": 0.5649071931838989
} |
22,443 | package ru.dedinside.modules.impl.combat;
import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.monster.EntityGolem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemShield;
import net.minecraft.network.play.client.CPacketEntityAction;
import net.minecraft.network.play.client.CPacketHeldItemChange;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import org.lwjgl.util.vector.Vector2f;
import ru.dedinside.Expensive;
import ru.dedinside.event.EventTarget;
import ru.dedinside.event.events.impl.EventInteract;
import ru.dedinside.event.events.impl.EventMotion;
import ru.dedinside.event.events.impl.EventUpdate;
import ru.dedinside.modules.Module;
import ru.dedinside.modules.ModuleAnnotation;
import ru.dedinside.modules.Type;
import ru.dedinside.ui.dropui.setting.imp.BooleanSetting;
import ru.dedinside.ui.dropui.setting.imp.ModeSetting;
import ru.dedinside.ui.dropui.setting.imp.MultiBoxSetting;
import ru.dedinside.ui.dropui.setting.imp.SliderSetting;
import ru.dedinside.util.GCDFixUtility;
import ru.dedinside.util.math.AdvancedCast;
import ru.dedinside.util.math.RotationUtility;
import ru.dedinside.util.movement.MoveUtility;
import ru.dedinside.util.world.InventoryUtility;
import ru.dedinside.util.world.RayCastUtility;
import java.util.ArrayList;
@ModuleAnnotation(name = "Aura", desc = "Атаккует Соперника", type = Type.Combat)
public class AuraModule extends Module {
public static EntityLivingBase targetEntity;
public static EntityLivingBase target;
public static AuraModule INSTANCE;
public boolean thisContextRotatedBefore;
public float prevAdditionYaw;
public static Vector2f rotation = new Vector2f();
float minCPS = 0;
public ModeSetting rotationModeSetting = new ModeSetting("Мод Ротации", "Matrix", "Matrix", "Sunrise");
public SliderSetting attackDistanceSetting = new SliderSetting("Дистанция", 3.3f, .0f, 15.0f, 0.01f);
public SliderSetting rotateDistanceSetting = new SliderSetting("Ротейшен Дистанция", 1.5f, .0f, 3.0f, 0.01f);
public SliderSetting attackCooldownThresholdSetting = new SliderSetting("Порог восстановления атаки", 0.85f, 0.0f, 1.0f, 0.01f);
public MultiBoxSetting targetSelectionSetting = new MultiBoxSetting("Выбор целей", new String[]{"Игрок", "Мобы", "Животные", "Жители "});
public BooleanSetting rayTraceSetting = new BooleanSetting("Рейтрейс", false);
public BooleanSetting resolverSetting = new BooleanSetting("Резольвер", false);
public BooleanSetting onlyCriticalSetting = new BooleanSetting("Бить Критами", true);
public BooleanSetting waterCriticalSetting = new BooleanSetting("Криты в Воде", true, () -> onlyCriticalSetting.get());
public BooleanSetting shieldBreakerSetting = new BooleanSetting("Ломать Щит", true);
public AuraModule() {
add(rotationModeSetting, attackDistanceSetting, rotateDistanceSetting, targetSelectionSetting, rayTraceSetting, resolverSetting, onlyCriticalSetting,
waterCriticalSetting, shieldBreakerSetting);
}
@EventTarget
public void onInteractEntity(EventInteract e) {
if (targetEntity != null) {
e.cancel();
}
}
@EventTarget
public void onUpdateAura(EventUpdate eventUpdate) {
if (resolverSetting.get()) {
resolvePlayers();
}
onAura();
if (resolverSetting.get()) {
releaseResolver();
}
}
@EventTarget
public void onMotion(EventMotion eventMotion) {
if (targetEntity != null) {
mc.player.rotationYawHead = rotation.x;
mc.player.renderYawOffset = rotation.x;
eventMotion.setYaw(rotation.x);
eventMotion.setPitch(rotation.y);
}
}
public void onAura() {
if (minCPS > 0) {
minCPS--;
}
// valid check.
if (targetEntity != null) {
if (!isValidTarget(targetEntity)) {
targetEntity = null;
}
}
// finder target.
if (targetEntity == null) targetEntity = findTarget();
if (targetEntity == null) {
rotation.x = mc.player.rotationYaw;
rotation.y = mc.player.rotationPitch;
return;
}
this.thisContextRotatedBefore = false;
// attacking target.
attackMethod(targetEntity);
// rotation updating.
getVectorRotation(targetEntity, false);
}
// attacking method.
public void attackMethod(Entity entity) {
if (whenFalling() && (minCPS == 0)) {
if (getHitBox(entity, attackDistanceSetting.getFloatValue()) == null && rayTraceSetting.get()) {
return;
}
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.STOP_SPRINTING));
getVectorRotation(entity, true);
if (AdvancedCast.instance.getMouseOver(entity, rotation.x, rotation.y, attackDistanceSetting.getDoubleValue(), ignoreWalls()) == entity) {
if (mc.player.isActiveItemStackBlocking()) mc.playerController.onStoppedUsingItem(mc.player);
minCPS = 10;
mc.playerController.attackEntity(mc.player, targetEntity);
mc.player.swingArm(EnumHand.MAIN_HAND);
mc.player.resetCooldown();
breakShieldMethod((EntityPlayer) entity);
}
}
}
private void breakShieldMethod(EntityPlayer entity) {
}
//method for rotation to target
public void getVectorRotation(Entity entity, boolean attackContext) {
this.thisContextRotatedBefore = true;
Vec3d vec = getHitBox(entity, rotateDistanceSetting.getFloatValue() + attackDistanceSetting.getFloatValue());
if (vec == null) {
vec = entity.getPositionEyes(1);
}
float sensitivity = 1.0001f;
double x, y, z;
x = vec.x - mc.player.posX;
y = vec.y - (mc.player.posY + mc.player.getEyeHeight());
z = vec.z - mc.player.posZ;
double dst = Math.sqrt(Math.pow(x, 2) + Math.pow(z, 2));
float yawToTarget = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(z, x)) - 90);
float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(y, dst)));
float yawDelta = MathHelper.wrapDegrees(yawToTarget - rotation.x) / sensitivity;
float pitchDelta = (pitchToTarget - rotation.y) / sensitivity;
if (yawDelta > 180) yawDelta = yawDelta - 180;
if (Math.abs(yawDelta) < 180.0f) {
float additionYaw = Math.min(Math.max(Math.abs(yawDelta), 1), 40);
float additionPitch = Math.max(attackContext ? Math.abs(pitchDelta) : 1, rotationModeSetting.is("Sunrise") ? 1 : 3);
if (Math.abs(additionYaw - this.prevAdditionYaw) <= 3.0f) {
additionYaw = GCDFixUtility.getFixedRotation(this.prevAdditionYaw + 3.1f);
}
float yaw = rotation.x + (yawDelta > 0 ? additionYaw : -additionYaw) * sensitivity;
float pitch = rotation.y + (pitchDelta > 0 ? additionPitch : -additionPitch) * sensitivity;
pitch = MathHelper.clamp(pitch, -90, 90);
rotation.x = yaw;
rotation.y = pitch;
prevAdditionYaw = additionYaw;
}
}
public boolean ignoreWalls() {
BlockPos pos = new BlockPos(mc.player.lastReportedPosX, mc.player.lastReportedPosY, mc.player.lastReportedPosZ);
return mc.world.getBlockState(pos).getMaterial() == Material.AIR;
}
public boolean whenFalling() {
boolean critWater = waterCriticalSetting.get() &&
mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY, mc.player.posZ)).getBlock()
instanceof BlockLiquid && mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY + 1,
mc.player.posZ)).getBlock() instanceof BlockAir;
boolean reason = mc.player.isPotionActive(MobEffects.BLINDNESS) || mc.player.isOnLadder()
|| mc.player.isInWater() && !critWater || mc.player.isInWeb || mc.player.capabilities.isFlying;
if (mc.player.getCooledAttackStrength(1.5f) < 0.92f) {
return false;
}
if (onlyCriticalSetting.state && !reason) {
if (MoveUtility.isBlockAboveHead() && mc.player.onGround && mc.player.fallDistance > 0) {
return true;
}
return !mc.player.onGround && mc.player.fallDistance != Math.ceil(mc.player.fallDistance);
}
return true;
}
public EntityLivingBase findTarget() {
ArrayList<EntityLivingBase> entity = new ArrayList<>();
for (Entity player : mc.world.loadedEntityList) {
if (!(player instanceof EntityLivingBase)) continue;
if (isValidTarget((EntityLivingBase) player)) {
entity.add((EntityLivingBase) player);
continue;
}
entity.remove(player);
}
// sorting to distance
entity.sort((e1, e2) -> {
int dst1 = (int) (mc.player.getDistance(e1) * 1000);
int dst2 = (int) (mc.player.getDistance(e2) * 1000);
return dst1 - dst2;
});
return entity.isEmpty() ? null : entity.get(0);
}
public boolean isValidTarget(EntityLivingBase e) {
if (e == this.mc.player)
return false;
if (e.isDead)
return false;
if (e.getHealth() <= 0)
return false;
if (e instanceof EntityArmorStand)
return false;
if (e instanceof EntityPlayer && !targetSelectionSetting.get(0))
return false;
if (Expensive.getInstance().friendManager.isFriend(e.getName()))
return false;
if (e instanceof EntityMob && !targetSelectionSetting.get(1))
return false;
if ((e instanceof EntityAnimal || e instanceof EntityGolem || e instanceof EntitySquid || e instanceof EntityVillager) && !targetSelectionSetting.get(2))
return false;
if (e instanceof EntityVillager && targetSelectionSetting.get(3))
return false;
if (!ignoreWalls()) {
if (getHitBox(e, attackDistanceSetting.getDoubleValue() + rotateDistanceSetting.getDoubleValue()) == null) {
return false;
}
} else
return !(e.getDistance(mc.player) > attackDistanceSetting.getDoubleValue() + rotateDistanceSetting.getDoubleValue());
return true;
}
public void resolvePlayers() {
for (EntityPlayer player : mc.world.playerEntities) {
if (player instanceof EntityOtherPlayerMP) {
((EntityOtherPlayerMP) player).resolve();
}
}
}
public void releaseResolver() {
for (EntityPlayer player : mc.world.playerEntities) {
if (player instanceof EntityOtherPlayerMP) {
((EntityOtherPlayerMP) player).releaseResolver();
}
}
}
public Vec3d getHitBox(Entity entity, double rotateDistance) {
Vec3d vec = entity.getPositionVector().add(new Vec3d(0, MathHelper.clamp(entity.getEyeHeight() * (mc.player.getDistance(entity) / (attackDistanceSetting.getFloatValue() + rotateDistanceSetting.getFloatValue()) + entity.width), 0.2, mc.player.getEyeHeight()), 0));
ArrayList<Vec3d> points = new ArrayList<>();
points.add(vec);
points.removeIf(point -> !isHitBoxVisible(entity, point, rotateDistance));
if (points.isEmpty()) {
return null;
}
points.sort((d1, d2) -> {
Vector2f r1 = RotationUtility.getDeltaForCoord(rotation, d1);
Vector2f r2 = RotationUtility.getDeltaForCoord(rotation, d2);
float y1 = Math.abs(r1.y);
float y2 = Math.abs(r2.y);
return (int) ((y1 - y2) * 1000);
});
return points.get(0);
}
public boolean isHitBoxVisible(Entity target, Vec3d vector, double dst) {
return RayCastUtility.getPointedEntity(RotationUtility.getRotationForCoord(vector), dst, 1, !ignoreWalls(),
target) == target;
}
@Override
public void onDisable() {
targetEntity = null;
rotation.x = mc.player.rotationYaw;
rotation.y = mc.player.rotationPitch;
super.onDisable();
}
}
сделай так чтобы дистанция автоматически подстраивалась под игрока чтобы его ударить без миссов | 1086603f0732ec4d9c19e658b2848e94 | {
"intermediate": 0.25856083631515503,
"beginner": 0.48388221859931946,
"expert": 0.2575570046901703
} |
22,444 | can you tell me the coding for a simple bingo game? | 5add99796e875f31364e72b3b9218e13 | {
"intermediate": 0.28676214814186096,
"beginner": 0.5113015174865723,
"expert": 0.20193633437156677
} |
22,445 | в чем ошибка C:\Users\Lenovo\AppData\Local\Programs\Python\Python39\python.exe C:\Users\Lenovo\Desktop\testing_function\app.py
Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\testing_function\app.py", line 23, in <module>
results_view = importlib.import_module(file_name)
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\Lenovo\Desktop\testing_function\task_generator\Algebra\stepped_task_2.py", line 1, in <module>
from sympy import *
ModuleNotFoundError: No module named 'sympy'
Process finished with exit code 1
? | 17f0ea085c2ca9fa1121b0f51bfddc48 | {
"intermediate": 0.5444992780685425,
"beginner": 0.2413790076971054,
"expert": 0.2141217589378357
} |
22,446 | I used tihs code:
def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
final_signal = []
# Retrieve depth data
threshold = 0.35
depth_data = client.depth(symbol=symbol)
bid_depth = depth_data['bids']
ask_depth = depth_data['asks']
buy_price = float(bid_depth[0][0]) if bid_depth else 0.0
sell_price = float(ask_depth[0][0]) if ask_depth else 0.0
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
mark_price_data_change = client.ticker_24hr_price_change(symbol=symbol)
mark_price_percent = float(mark_price_data_change['priceChangePercent']) if 'priceChangePercent' in mark_price_data_change else 0.0
buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0
sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0
# Calculate the threshold for order price deviation
if mark_price_percent > 2:
price_threshold = 7 / 100
elif mark_price_percent < -2:
price_threshold = 7 / 100
else:
price_threshold = 6 / 100
executed_orders_buy = 0.0
for order in bid_depth:
if float(order[0]) == mark_price:
executed_orders_buy += float(order[1])
else:
break
buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0
buy_result = buy_qty - executed_orders_buy
executed_orders_sell = 0.0
for order in ask_depth:
if float(order[0]) == mark_price:
executed_orders_sell += float(order[1])
else:
break
sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0
sell_result = sell_qty - executed_orders_sell
if (sell_result > (1 + threshold) > float(buy_qty)) and (sell_price < mark_price - price_threshold):
signal.append('sell')
elif (buy_result > (1 + threshold) > float(sell_qty)) and (buy_price > mark_price + price_threshold):
signal.append('buy')
else:
signal.append('')
if signal == ['buy'] and (buy_result < 0.01 + sell_result) and (sell_price < mark_price - 0.02):
final_signal.append('')
elif signal == ['sell'] and (sell_result < buy_result - 0.01) and (buy_price > mark_price + 0.02):
final_signal.append('')
else:
final_signal.append(signal)
return final_signal
But for example signal is buy and (buy_result < 0.01 + sell_result) and (sell_price < mark_price - 0.02) is not maching will ir return me buy signal ? | 7e8de2a0fd127eae93840967591a512e | {
"intermediate": 0.29759955406188965,
"beginner": 0.4818880259990692,
"expert": 0.22051244974136353
} |
22,447 | I'm running into a "Single file component can contain only one <script> element" error in Vue / Vite. I want to add a script tag that's required for all pages to get the universal CSS styling to work properly. I figured the only way to do that would be to add that script tag to the App.vue (the root Vue file), yet I can't because it already contains a script tag that exports it: <script>
export default {
name: 'App',
};
</script> | 42f6ecdea326871cdc7e5bba76df5f99 | {
"intermediate": 0.5657917261123657,
"beginner": 0.2823522984981537,
"expert": 0.1518559753894806
} |
22,448 | Hello | 48a4819473583dfd763bb01f541d7260 | {
"intermediate": 0.3123404085636139,
"beginner": 0.2729349136352539,
"expert": 0.4147246778011322
} |
22,449 | I'm trying to import a JS file into my vue project. This JS file has methods names that the console complains have already been declared. Is there some way to get this JS file to work around already declared function names? | 639f2d578d776c63ec1af7e301df8517 | {
"intermediate": 0.5877561569213867,
"beginner": 0.32119783759117126,
"expert": 0.0910460352897644
} |
22,450 | main.cpp: In function ‘std::vector<std::vector<int> > optimal_partition(const std::vector<int>&, int)’:
main.cpp:25:11: error: ‘INT_MAX’ was not declared in this scope
25 | D[0][j] = INT_MAX;
Сам код:
#include <iostream>
#include <vector>
#include <cmath>
// Функция для нахождения мощности подотрезка
int square_sum(const std::vector<int>& a, int left, int right) {
int sum = 0, INT_MAX = 10 * 9 -6;
for (int i = left; i <= right; ++i) {
sum += a[i];
}
return std::pow(sum, 2);
}
// Функция для решения задачи оптимального разбиения массива на k подотрезков
std::vector<std::vector<int>> optimal_partition(const std::vector<int>& a, int k) {
int n = a.size();
// Шаг 1: Построение таблицы D
// Создание таблицы D
std::vector<std::vector<int>> D(n + 1, std::vector<int>(k + 1, 0));
// Заполнение первой строки таблицы D
for (int j = 1; j <= k; ++j) {
D[0][j] = INT_MAX;
}
// Заполнение остальных ячеек таблицы D
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= k; ++j) {
D[i][j] = INT_MAX;
for (int t = 0; t < i; ++t) {
D[i][j] = std::min(D[i][j], D[t][j - 1] + square_sum(a, t + 1, i));
}
}
}
// Шаг 2: Восстановление оптимального разбиения массива a
std::vector<std::vector<int>> partition(k);
int i = n;
for (int j = k; j >= 1; --j) {
int min_value = INT_MAX;
int t = 0;
for (int t = j - 1; t < i; ++t) {
if (D[i][j] == (D[t][j - 1] + square_sum(a, t + 1, i))) {
min_value = D[t][j - 1];
partition[j - 1].push_back(t);
i = t;
break;
}
}
}
// Вставляем первые подотрезки
for (int j = k - 1; j >= 0; --j) {
partition[j].insert(partition[j].begin(), 0);
}
return partition;
}
int main() {
int n, k;
std::cout << "Enter the size of the array: ";
std::cin >> n;
std::vector<int> a(n);
std::cout << "Enter the elements of the array: ";
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
}
std::cout << "Enter the number of partitions: ";
std::cin >> k;
std::vector<std::vector<int>> partition = optimal_partition(a, k);
// Вывод оптимального разбиения массива
std::cout << "Optimal partition:" << std::endl;
for (const auto& p : partition) {
for (int i = p.front(); i < p.back() + 1; ++i) {
std::cout << a[i] << " ";
}
std::cout << std::endl;
}
return 0;
} | 6cef4a297361d3626b06474c82a26716 | {
"intermediate": 0.3298938274383545,
"beginner": 0.44331619143486023,
"expert": 0.22679002583026886
} |
22,451 | Is there a way where I can check if its being imported more than once for sure somehow? | 5ac275f24e7548db85ac0f6fb3f85a70 | {
"intermediate": 0.4786454141139984,
"beginner": 0.19652336835861206,
"expert": 0.3248312473297119
} |
22,452 | Hello! Can you rewrite html code using flexbox and css grid? | 73d4bc072b9d6bdbe041424b29ba1a2c | {
"intermediate": 0.4085349142551422,
"beginner": 0.35509780049324036,
"expert": 0.23636721074581146
} |
22,453 | Hello. Can you give me please a simple template of about me html page? | d625129b3e5299031863425789902ca8 | {
"intermediate": 0.38580140471458435,
"beginner": 0.380749374628067,
"expert": 0.23344922065734863
} |
22,454 | make python script,ask for domain,connect to ip ( domain is using ip changer,connect to each new ip each 2 seconds),mimic header,ignore robots,send udp & tcp on port 80 & 443 each 1 seconds,make sure to change ip for each request send into random ip each 2 seconds | d1d9f34f826d2d7032c6c118176787cc | {
"intermediate": 0.4125044047832489,
"beginner": 0.2914706766605377,
"expert": 0.296024888753891
} |
22,455 | Привет друг, мне снова нужна твоя помощь | 07301c0356fc2dee53549abd43e57e30 | {
"intermediate": 0.3074992299079895,
"beginner": 0.27754056453704834,
"expert": 0.41496020555496216
} |
22,456 | #include <iostream>
#include <vector>
#include <cmath>
// #define INT_MAX
// #include <limits.h>
#include <limits>
#include <climits>
// Функция для нахождения мощности подотрезка
int square_sum(const std::vector<int>& a, int left, int right) {
int sum = 0;
for (int i = left; i <= right; ++i) {
sum += a[i];
}
return std::pow(sum, 2);
}
// Функция для решения задачи оптимального разбиения массива на k подотрезков
std::vector<std::vector<int>> optimal_partition(const std::vector<int>& a, int k) {
int n = a.size();
// Шаг 1: Построение таблицы D
// Создание таблицы D
std::vector<std::vector<int>> D(n + 1, std::vector<int>(k + 1, 0));
// Заполнение первой строки таблицы D
for (int j = 1; j <= k; ++j) {
D[0][j] = INT_MAX;
}
// Заполнение остальных ячеек таблицы D
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= k; ++j) {
D[i][j] = INT_MAX;
for (int t = 0; t < i; ++t) {
D[i][j] = std::min(D[i][j], D[t][j - 1] + square_sum(a, t + 1, i));
}
}
}
// Шаг 2: Восстановление оптимального разбиения массива a
std::vector<std::vector<int>> partition(k);
int i = n;
for (int j = k; j >= 1; --j) {
int min_value = INT_MAX;
int t = 0;
for (int t = j - 1; t < i; ++t) {
if (D[i][j] == (D[t][j - 1] + square_sum(a, t + 1, i))) {
min_value = D[t][j - 1];
partition[j - 1].push_back(t);
i = t;
break;
}
}
}
// Вставляем первые подотрезки
for (int j = k - 1; j >= 0; --j) {
partition[j].insert(partition[j].begin(), 0);
}
return partition;
}
int main() {
int n, k;
std::cout << "Enter the size of the array: ";
std::cin >> n;
std::vector<int> a(n);
std::cout << "Enter the elements of the array: ";
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
}
std::cout << "Enter the number of partitions: ";
std::cin >> k;
std::vector<std::vector<int>> partition = optimal_partition(a, k);
// Вывод оптимального разбиения массива
std::cout << "Optimal partition:" << std::endl;
for (const auto& p : partition) {
for (int i = p.front(); i < p.back() + 1; ++i) {
std::cout << a[i] << " ";
}
std::cout << std::endl;
}
return 0;
}
Можешь переписать этот код на Js,чтобы его можно быо запустить в браузере и видеть как происходит алгоритм в массиве,(с анимацией) | 07aafb5075be11cfc59273914921c887 | {
"intermediate": 0.38969334959983826,
"beginner": 0.4104742109775543,
"expert": 0.19983242452144623
} |
22,457 | How to use playwright to get a list of controls based on a portion of the id's string | f63ccf548445bbc3b4b9a8e71349e8fe | {
"intermediate": 0.49566933512687683,
"beginner": 0.13143783807754517,
"expert": 0.3728928565979004
} |
22,458 | Что это значит?
Traceback (most recent call last):
File "main.py", line 38, in <module>
KeyError: 129 | 704f738e7b864fe6fb1cfe844d21fe74 | {
"intermediate": 0.3812376856803894,
"beginner": 0.38766294717788696,
"expert": 0.23109941184520721
} |
22,459 | Provide me 1000 examples of autohotkey V2 which cover all the topics with examples in deep details | fd100945a3b011199b73d5266912a3e7 | {
"intermediate": 0.44137585163116455,
"beginner": 0.2683113217353821,
"expert": 0.29031288623809814
} |
22,460 | C# winform remove title bar but keep borders | a33d744dfa37f4eabce8790b52b9079f | {
"intermediate": 0.4051554799079895,
"beginner": 0.32794973254203796,
"expert": 0.2668948173522949
} |
22,461 | write for me a presentation about egypt with powerpoint 15 slides | 7448a76e3a8481bbb089b41de7cbbad5 | {
"intermediate": 0.3657737076282501,
"beginner": 0.3617509603500366,
"expert": 0.27247533202171326
} |
22,462 | Act as game developer. You are focus on development bubble shooter game targeted to web browsers. The game is endless bubble shooter game, where a player should shoot bubble to exists bubbles and make combos. You need to figure out how to make bubble generation on the map. The generation should consider that the more bubble lines player destroy the complexity of generated bubbles should increase | 07c1dc691bc3e3b235a773132cba45e3 | {
"intermediate": 0.2638918459415436,
"beginner": 0.29154306650161743,
"expert": 0.4445651173591614
} |
22,463 | нужно написать функцию, которая возвращает true если число совершенное и false если оно не совершенное. Совершенным числом называется такое число, которое равно сумме всех своих делителей (кроме самого числа). Например, 6 - совершенное число, так как 6 = 1 + 2 + 3. | 288c3640248d238817c4c493325d4c0c | {
"intermediate": 0.3669028580188751,
"beginner": 0.3622017204761505,
"expert": 0.27089542150497437
} |
22,464 | hi | 06936149ec01a13ac35231a7581c94e2 | {
"intermediate": 0.3246487081050873,
"beginner": 0.27135494351387024,
"expert": 0.40399640798568726
} |
22,465 | C# change color of title bar | 4c3e53c7a3670afbbcf4a859aaa65398 | {
"intermediate": 0.38004788756370544,
"beginner": 0.35654422640800476,
"expert": 0.2634079158306122
} |
22,466 | How is a ternary activation function defined? How is it used to ternarize a continual value in an activation function? | 21a82b31bbbb7cfbf1218d143443c8f8 | {
"intermediate": 0.3796255588531494,
"beginner": 0.15075528621673584,
"expert": 0.46961912512779236
} |
22,467 | C# change color of title bar | 1b25a8bd590e75347842f0a0807d0b4c | {
"intermediate": 0.38004788756370544,
"beginner": 0.35654422640800476,
"expert": 0.2634079158306122
} |
22,468 | /I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd | fb7088404f052f625810727648daea40 | {
"intermediate": 0.347042441368103,
"beginner": 0.24300424754619598,
"expert": 0.40995338559150696
} |
22,469 | write me a python bot that uses mcstatus api to send joining and leaving webhooks to discord | 8dce5746b800773007ccd5a63bd40d44 | {
"intermediate": 0.6455351710319519,
"beginner": 0.12120930105447769,
"expert": 0.2332555055618286
} |
22,470 | import os
import requests
import time
import sqlite3
from mcstatus import JavaServer
from keep_alive import keep_alive
keep_alive()
# SQLite database file
DB_FILE = "players.db"
def send_discord_webhook(content):
data = {"content": content}
requests.post(os.environ['WEBHOOK_URL'], json=data)
# Create Minecraft server object
server = JavaServer(os.environ['SERVER_IP'], 25565)
# Create and connect to the database
conn = sqlite3.connect(DB_FILE)
cursor = conn.cursor()
# Create players table if it doesn't exis
cursor.execute('''CREATE TABLE IF NOT EXISTS players
(name TEXT PRIMARY KEY)''')
# Get the last known state of players from the database
cursor.execute('SELECT name FROM players')
players = [row[0] for row in cursor.fetchall()]
while True:
try:
# Get current player list
status = server.query()
current_players = status.players.names
# Check for new players
new_players = [
player for player in current_players if player not in players
]
for player in new_players:
players.append(player)
print(f'{player} has joined the server!')
send_discord_webhook(f'{player} has joined the server!')
# Check for leaving players
leaving_players = [
player for player in players if player not in current_players
]
for player in leaving_players:
players.remove(player)
print(f'{player} has left the server!')
send_discord_webhook(f'{player} has left the server!')
# Update the database
for player in new_players:
cursor.execute('INSERT INTO players VALUES (?)', (player, ))
for player in leaving_players:
cursor.execute('DELETE FROM players WHERE name = ?', (player, ))
# Commit the changes and close the connection
conn.commit()
# Delay between checks (in seconds)
time.sleep(30)
except Exception as e:
print(f'Error occurred: {e}')
# Close the database connection before exiting
conn.close() | 39293bffcad2a8292093e06b04b03587 | {
"intermediate": 0.5835330486297607,
"beginner": 0.1684001386165619,
"expert": 0.24806679785251617
} |
22,471 | i have an api call to https://api.mcstatus.io/v2/status/java/147.135.125.35
with response:
{"online":true,"host":"147.135.125.35","port":25565,"ip_address":"147.135.125.35","eula_blocked":false,"retrieved_at":1698194380393,"expires_at":1698194440393,"version":{"name_raw":"Paper 1.20.1","name_clean":"Paper 1.20.1","name_html":"\u003cspan\u003e\u003cspan style=\"color: #ffffff;\"\u003ePaper 1.20.1\u003c/span\u003e\u003c/span\u003e","protocol":763},"players":{"online":0,"max":100,"list":[]},"motd":{"raw":"§\u0000AmV10z","clean":"AmV10z","html":"\u003cspan\u003e\u003cspan style=\"color: #ffffff;\"\u003eAmV10z\u003c/span\u003e\u003c/span\u003e"},"icon":null,"mods":[],"software":"Paper on 1.20.1-R0.1-SNAPSHOT","plugins":[{"name":"squaremap","version":"1.1.16"},{"name":"StreamMC","version":"1.0"},{"name":"voicechat","version":"2.4.24"},{"name":"squaremarker","version":"1.0.4"},{"name":"BlueMap","version":"3.16"},{"name":"LuckPerms","version":"5.4.98"}],"srv_record":null}
make a python bot that sends a webhook every time there is a player joining and leaving the server | e1cd4671189290ae673d8c7b7a36058c | {
"intermediate": 0.4424799680709839,
"beginner": 0.2908485531806946,
"expert": 0.2666715085506439
} |
22,472 | I'm saving a LocalDateTime object and then loading it from persistent storage using Hibernate and SQLite. The LocalDateTime object that was obtained from persistent storage has the last three characters removed. Why? How can I fix this? | 16b9c67f2e89391345b7888a3f4bb8ce | {
"intermediate": 0.6757178902626038,
"beginner": 0.14976248145103455,
"expert": 0.17451965808868408
} |
22,473 | extract year from date column in r | 2be4e77405eef3ddcf79c07d8b2c9edd | {
"intermediate": 0.38618335127830505,
"beginner": 0.28788188099861145,
"expert": 0.3259347677230835
} |
22,474 | C# formborderstyle none using panels as borders how to mimic resize like normal borders | ef78f00250fab3d1f01f8649b7fc4a74 | {
"intermediate": 0.44357892870903015,
"beginner": 0.2904309630393982,
"expert": 0.26599007844924927
} |
22,475 | write bash code to know who in my network | 40d3617e5cf139b404ff0a78f0f27816 | {
"intermediate": 0.28623631596565247,
"beginner": 0.3246859610080719,
"expert": 0.38907769322395325
} |
22,476 | having issues with my code. the radio checkboxes remain selected when i press different options and im not sure whats wrong
<fieldset>
<legend>Delivery Information</legend>
<label for="delDate">Delivery Date</label>
<input type="date" id="delDate" name="deliveryDate" />
<input type="radio" id="delMethod1" name="method1" value="method" />
<label for="delMethod1">Virtually - It's just like real life!</label>
<input type="radio" id="delMethod2" name="method2" value="method" />
<label for="delMethod2">Postal Service (May or may not be unsafe)</label>
<input type="radio" id="delMethod3" name="method3" value="method" />
<label for="delMethod3">Helicopter Lift - Will be lowered in your backyard</label>
<input type="radio" id="delMethod4" name="method4" value="method" />
<label for="delMethod4">Airplane Dropoff (The Awesome Method) - Your animal will skydive to your house!</label>
</fieldset> | 44c54a3d1cc3de7f9a843c25ef356c6a | {
"intermediate": 0.346403568983078,
"beginner": 0.24398691952228546,
"expert": 0.40960952639579773
} |
22,477 | Explain the code below.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <errno.h>
#include <string.h>
void display(char *prog, char *bytes, int n);
int main() {
const char *name = "/shm-example"; /* file name */
const int SIZE = 4096; /* file size */
int shm_fd; /* file descriptor, from shm_open() */
char *shm_base; /* base address, from mmap() */
/* open the shared memory segment as if it was a file */
shm_fd = shm_open(name, O_RDONLY, 0666);
if (shm_fd == -1) {
printf("cons: Shared memory failed: %s\n", strerror(errno));
exit(1);
}
onsumer/* map the shared memory segment to the address space
of the process */
shm_base = mmap(0, SIZE, 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);
}
/* read from the mapped shared memory segment */
display("cons", shm_base, 64); /*first as bytes,
then as a string*/
printf("%s", shm_base);
/* remove the mapped shared memory segment from the
address space of the process */
if (munmap(shm_base, SIZE) == -1) {
printf("cons: Unmap failed: %s\n",
strerror(errno));
exit(1);
}
/* close the shared memory segment as if it was a file */
if (close(shm_fd) == -1) {
printf("cons: Close failed: %s\n", strerror(errno));
exit(1);
}
/* remove the shared memory segment from the file system */
if (shm_unlink(name) == -1) {
printf("cons: Error removing %s: %s\n", name, strerror(errno));
exit(1);
}
return 0;
}
void display(char *prog, char *bytes, int n) {
printf("display: %s\n", prog);
for (int i = 0; i < n; i++) {
printf("%02x%c", bytes[i], ((i+1)%16) ? ' ' : '\n');
}
printf("\n");
} | dd1c6d5ccc5c52ad4b98693a01ed8543 | {
"intermediate": 0.32003289461135864,
"beginner": 0.3895638883113861,
"expert": 0.29040321707725525
} |
22,478 | how can i change lastloaddate to 1900-01-01, 00:00:00.000 but in SSIS using expression like evaluate expression task | 61632ca61c0d7d6ede532657358c0c9e | {
"intermediate": 0.3465076684951782,
"beginner": 0.2562127709388733,
"expert": 0.3972795307636261
} |
22,479 | how to plot MLS Ozone data? | 2079a43c57c9a1b9276199df7be77be0 | {
"intermediate": 0.3884595036506653,
"beginner": 0.23974980413913727,
"expert": 0.37179067730903625
} |
22,480 | using UnityEngine;
[AddComponentMenu("Camera-Control/Camera Orbit Follow Zoom")]
public class CameraOrbitFollowZoom : MonoBehaviour
{
[SerializeField] Transform target;
[SerializeField] float distance = 5.0f;
[SerializeField] float xSpeed = 10.0f;
[SerializeField] float ySpeed = 10.0f;
[SerializeField] float sensitivity = 1.0f;
[SerializeField] float yMinLimit = -90f;
[SerializeField] float yMaxLimit = 90f;
[SerializeField] float distanceMin = 5f;
[SerializeField] float distanceMax = 500f;
[SerializeField] float smoothTime = 0.2f;
float x = 0.0f;
float y = 0.0f;
float xSmooth = 0.0f;
float ySmooth = 0.0f;
float xVelocity = 0.0f;
float yVelocity = 0.0f;
float distanceSmooth;
float distanceVelocity = 0.0f;
//private void Update()
//{
// GetInputs();
//}
void LateUpdate()
{
if (target)
{
GetInputs();
MoveCamera();
}
}
private void MoveCamera()
{
xSmooth = Mathf.SmoothDamp(xSmooth, x, ref xVelocity, smoothTime);
ySmooth = Mathf.SmoothDamp(ySmooth, y, ref yVelocity, smoothTime);
distanceSmooth = Mathf.SmoothDamp(distanceSmooth, distance, ref distanceVelocity, smoothTime);
transform.localRotation = Quaternion.Euler(ySmooth, xSmooth, 0);
Vector3 desiredPosition = transform.rotation * new Vector3(0.0f, 0.0f, -distanceSmooth) + target.position;
Vector3 collisionFreePosition = CheckCollision(target.position, desiredPosition);
transform.position = collisionFreePosition;
}
private Vector3 CheckCollision(Vector3 startPosition, Vector3 targetPosition)
{
Vector3 direction = targetPosition - startPosition;
RaycastHit hit;
if (Physics.Raycast(startPosition, direction, out hit, direction.magnitude))
{
return hit.point;
}
return targetPosition;
}
private void GetInputs()
{
//if (Input.GetMouseButton(1))
//{
x += Input.GetAxis("Mouse X") * xSpeed * sensitivity;
y -= Input.GetAxis("Mouse Y") * ySpeed * sensitivity;
y = Mathf.Clamp(y, yMinLimit, yMaxLimit);
//}
distance = Mathf.Clamp(distance - Input.GetAxis("Mouse ScrollWheel") * distance, distanceMin, distanceMax);
}
}
Im having issue, when player character moves faster then just walk - camera start jitter. And it some how even more noticeble on lower end PC | 9ef786662ba311cb45c0017d796eacc1 | {
"intermediate": 0.3534872829914093,
"beginner": 0.45217424631118774,
"expert": 0.19433847069740295
} |
22,481 | using UnityEngine;
[AddComponentMenu(“Camera-Control/Camera Orbit Follow Zoom”)]
public class CameraOrbitFollowZoom : MonoBehaviour
{
[SerializeField] Transform target;
[SerializeField] float distance = 5.0f;
[SerializeField] float xSpeed = 10.0f;
[SerializeField] float ySpeed = 10.0f;
[SerializeField] float sensitivity = 1.0f;
[SerializeField] float yMinLimit = -90f;
[SerializeField] float yMaxLimit = 90f;
[SerializeField] float distanceMin = 5f;
[SerializeField] float distanceMax = 500f;
[SerializeField] float smoothTime = 0.2f;
float x = 0.0f;
float y = 0.0f;
float xSmooth = 0.0f;
float ySmooth = 0.0f;
float xVelocity = 0.0f;
float yVelocity = 0.0f;
float distanceSmooth;
float distanceVelocity = 0.0f;
//private void Update()
//{
// GetInputs();
//}
void LateUpdate()
{
if (target)
{
GetInputs();
MoveCamera();
}
}
private void MoveCamera()
{
xSmooth = Mathf.SmoothDamp(xSmooth, x, ref xVelocity, smoothTime);
ySmooth = Mathf.SmoothDamp(ySmooth, y, ref yVelocity, smoothTime);
distanceSmooth = Mathf.SmoothDamp(distanceSmooth, distance, ref distanceVelocity, smoothTime);
transform.localRotation = Quaternion.Euler(ySmooth, xSmooth, 0);
Vector3 desiredPosition = transform.rotation * new Vector3(0.0f, 0.0f, -distanceSmooth) + target.position;
Vector3 collisionFreePosition = CheckCollision(target.position, desiredPosition);
transform.position = collisionFreePosition;
}
private Vector3 CheckCollision(Vector3 startPosition, Vector3 targetPosition)
{
Vector3 direction = targetPosition - startPosition;
RaycastHit hit;
if (Physics.Raycast(startPosition, direction, out hit, direction.magnitude))
{
return hit.point;
}
return targetPosition;
}
private void GetInputs()
{
//if (Input.GetMouseButton(1))
//{
x += Input.GetAxis(“Mouse X”) * xSpeed * sensitivity;
y -= Input.GetAxis(“Mouse Y”) * ySpeed * sensitivity;
y = Mathf.Clamp(y, yMinLimit, yMaxLimit);
//}
distance = Mathf.Clamp(distance - Input.GetAxis(“Mouse ScrollWheel”) * distance, distanceMin, distanceMax);
}
}
Im having issue, when player character moves faster then just walk - camera start jitter. And it some how even more noticeble on lower end PC. Edit script so it will not depend on current FPS | 961f725e467f445d2eae00a305b7c5d8 | {
"intermediate": 0.4442874789237976,
"beginner": 0.3341395854949951,
"expert": 0.22157295048236847
} |
22,482 | can you write me a code for gradient | b49b81cbd301c6ddf4cc8fa932c8d463 | {
"intermediate": 0.23507556319236755,
"beginner": 0.10972461104393005,
"expert": 0.6551998257637024
} |
22,483 | How does one get rid of the millisecond and nanosecond precision from a LocalDateTime object (in Java)? | 1f9dbf9ac78d17d7db14bb5e6f797d6c | {
"intermediate": 0.48975425958633423,
"beginner": 0.11451105028390884,
"expert": 0.39573466777801514
} |
22,484 | How to read file excel .xlsx by language VB.NET | d92c45049e7b6ff93dea567283aee02f | {
"intermediate": 0.38007280230522156,
"beginner": 0.32658645510673523,
"expert": 0.293340802192688
} |
22,485 | /****** Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[TeacherID]
FROM [Academy].[dbo].[Assistants]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[TeacherID]
FROM [Academy].[dbo].[Curators]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[TeacherID]
FROM [Academy].[dbo].[Deans]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [DepartmentID]
,[Building]
,[DepartmentName]
,[FacultyID]
,[HeadID]
FROM [Academy].[dbo].[Departments]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [FacultyID]
,[FacultyName]
,[Name]
,[DeanID]
FROM [Academy].[dbo].[Faculties]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [GroupID]
,[GroupName]
,[DepartmentID]
FROM [Academy].[dbo].[Groups]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[CuratorID]
,[GroupID]
FROM [Academy].[dbo].[GroupsCurators]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[GroupID]
,[LectureID]
FROM [Academy].[dbo].[GroupsLectures]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[TeacherID]
FROM [Academy].[dbo].[Heads]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[Building]
,[Name]
FROM [Academy].[dbo].[LectureRooms]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[SubjectID]
,[TeacherID]
FROM [Academy].[dbo].[Lectures]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[Class]
,[Day_Of_Week]
,[Week]
,[LectureID]
,[LectureRoomID]
FROM [Academy].[dbo].[Schedules]
/ Скрипт для команды SelectTopNRows из среды SSMS /
SELECT TOP (1000) [id]
,[Name]
FROM [Academy].[dbo].[Subjects]
/ Скрипт для команды SelectTopNRows из среды SSMS ******/
SELECT TOP (1000) [id]
,[FstName]
,[ScdName]
FROM [Academy].[dbo].[Teachers]
придумай как случайные таблицы для моей базы данных созданной на Microsoft SQL Server и заполни их с помощью INSERT
и сделай следующие запросы: Вывести названия аудиторий, в которых читает лекции
преподаватель “Edward Hopper”.
2. Вывести фамилии ассистентов, читающих лекции в группе “F505”.
3. Вывести дисциплины, которые читает преподаватель “Alex Carmack” для групп 5-го курса.
4. Вывести фамилии преподавателей, которые не читают лекции по понедельникам.
5. Вывести названия аудиторий, с указанием их корпусов, в которых нет лекций в среду
второй недели на третьей паре.
6. Вывести полные имена преподавателей факультета “Computer Development”.
7. Вывести список номеров всех корпусов, которые имеются в таблицах факультетов, кафедр
и аудиторий.
8. Вывести полные имена преподавателей в следующем порядке: деканы факультетов,
заведующие кафедрами, преподаватели, кураторы, ассистенты.
9. Вывести дни недели (без повторений), в которые имеются занятия в аудиториях “A311” и
“A104” корпуса 6. | 1c36170eed2b0b087e2a109667e60cdf | {
"intermediate": 0.2875314950942993,
"beginner": 0.5017958283424377,
"expert": 0.21067264676094055
} |
22,486 | C# formborderstyle set to none i'm using panels as borders how to add a corner border | 702f6b4c08f038bc2604dd8e922329b3 | {
"intermediate": 0.4743514060974121,
"beginner": 0.2314784824848175,
"expert": 0.2941701412200928
} |
22,487 | Можешь создать на JS код, чтобы визиализировтьа этот код? Чтобы было видно какие ячейки массива в данный момент в цикле заполняются #include <iostream>
#include <vector>
#include <cmath>
// #define INT_MAX
// #include <limits.h>
#include <limits>
#include <climits>
// Функция для нахождения мощности подотрезка
int square_sum(const std::vector<int>& a, int left, int right) {
int sum = 0;
for (int i = left; i <= right; ++i) {
sum += a[i];
}
return std::pow(sum, 2);
}
// Функция для решения задачи оптимального разбиения массива на k подотрезков
std::vector<std::vector<int>> optimal_partition(const std::vector<int>& a, int k) {
int n = a.size();
// Шаг 1: Построение таблицы D
// Создание таблицы D
std::vector<std::vector<int>> D(n + 1, std::vector<int>(k + 1, 0));
// Заполнение первой строки таблицы D
for (int j = 1; j <= k; ++j) {
D[0][j] = INT_MAX;
}
// Заполнение остальных ячеек таблицы D
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= k; ++j) {
D[i][j] = INT_MAX;
for (int t = 0; t < i; ++t) {
D[i][j] = std::min(D[i][j], D[t][j - 1] + square_sum(a, t + 1, i));
}
}
}
// Шаг 2: Восстановление оптимального разбиения массива a
std::vector<std::vector<int>> partition(k);
int i = n;
for (int j = k; j >= 1; --j) {
int min_value = INT_MAX;
int t = 0;
for (int t = j - 1; t < i; ++t) {
if (D[i][j] == (D[t][j - 1] + square_sum(a, t + 1, i))) {
min_value = D[t][j - 1];
partition[j - 1].push_back(t);
i = t;
break;
}
}
}
// Вставляем первые подотрезки
for (int j = k - 1; j >= 0; --j) {
partition[j].insert(partition[j].begin(), 0);
}
return partition;
}
int main() {
int n, k;
std::cout << "Enter the size of the array: ";
std::cin >> n;
std::vector<int> a(n);
std::cout << "Enter the elements of the array: ";
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
}
std::cout << "Enter the number of partitions: ";
std::cin >> k;
std::vector<std::vector<int>> partition = optimal_partition(a, k);
// Вывод оптимального разбиения массива
std::cout << "Optimal partition:" << std::endl;
for (const auto& p : partition) {
for (int i = p.front(); i < p.back() + 1; ++i) {
std::cout << a[i] << " ";
}
std::cout << std::endl;
}
return 0;
} | 685daa6d25ebea7780296bbcb3cabbae | {
"intermediate": 0.31570449471473694,
"beginner": 0.423488974571228,
"expert": 0.26080647110939026
} |
22,488 | can u speak russian? | 5032303c214e4f57c6d7381c2e1ed845 | {
"intermediate": 0.3522462844848633,
"beginner": 0.39545294642448425,
"expert": 0.25230076909065247
} |
22,489 | ERROR!
/tmp/E0E4t6yC10.js:28
for (let j = k; j >= 1; j-–) { | 9627af285fe0f1848bbe9e670e1700a4 | {
"intermediate": 0.2846965491771698,
"beginner": 0.45408740639686584,
"expert": 0.26121601462364197
} |
22,490 | use SQL produce sample output from your database for the following: use SQL to find the donor category. Contributions for the program for third quater | 9064ddb4ae7fd2f684aa821ea8098eb6 | {
"intermediate": 0.32240724563598633,
"beginner": 0.2722136378288269,
"expert": 0.40537914633750916
} |
22,491 | Write an algorithm to find the HCF (Highest Common Factor) of the two numbers entered by a user. Transform your algorithm into a C program, support your program with suitable comments. | ff54ff48572573deec70f2228bea5a05 | {
"intermediate": 0.13626548647880554,
"beginner": 0.08796101063489914,
"expert": 0.7757734656333923
} |
22,492 | quartzThere is no DataSource named 'null' | 63a1a45587f61aac41f724d7cbcf0357 | {
"intermediate": 0.36949431896209717,
"beginner": 0.30442771315574646,
"expert": 0.3260779082775116
} |
22,493 | 使用python opencv 提取图片中某种颜色的曲线 | e106a0793cb64d124c258f506932b0c6 | {
"intermediate": 0.2828463613986969,
"beginner": 0.19937960803508759,
"expert": 0.5177739858627319
} |
22,494 | Build AVL tree with c language | 75c3a4ab257d2e70ceb06a1895e5d3a7 | {
"intermediate": 0.2350798100233078,
"beginner": 0.20408974587917328,
"expert": 0.5608304142951965
} |
22,495 | 已知 RGB_color = (170,0,0)
如何得到 RGB_color 最小和最大HSV值 h_min, s_min, v_min和h_max, s_max, v_max
lower_color = np.array([h_min, s_min, v_min])
upper_color = np.array([h_max, s_max, v_max]) | 9e03e08df4621a4e14e1e0c7fe3a1b7f | {
"intermediate": 0.3461172580718994,
"beginner": 0.3377267122268677,
"expert": 0.3161559998989105
} |
22,496 | public class StarName
{
public static void main(String[] args)
{
System.out.println("Bellatrix");
}
}
What is the output of the java program?
StarName
"Bellatrix"
Bellatrix | c8a20f4559e42cb5bad0fa7d5aac7783 | {
"intermediate": 0.41728731989860535,
"beginner": 0.4327589273452759,
"expert": 0.14995373785495758
} |
22,497 | How to enable server side SSL authentication in Apache Zeppelin | 38eb18a0aa8e114a07846538c317880e | {
"intermediate": 0.4212400019168854,
"beginner": 0.22829540073871613,
"expert": 0.3504646122455597
} |
22,498 | df_with_reco=pd.DataFrame(columns=['course_id','1_recommendation','2_recommendation'])
df_with_reco['course_id']=df['course_id'].unique() #запись курса, которому рекомендуем
df_with_reco['1_recommendation']=df_with_reco['course_id'].apply(lambda x:recommend(x)[0][0])
df_with_reco['2_recommendation']=df_with_reco['course_id'].apply(lambda x:recommend(x)[1][0])
df_with_reco
ошибка 'list' object has no attribute 'keys', как исправить? | 6199562ef2ac51a8934efd1360f9f65a | {
"intermediate": 0.37420129776000977,
"beginner": 0.3121989071369171,
"expert": 0.3135998547077179
} |
22,499 | I want you to write me a VBA code for a power point presentation about neuro sience. You are to fill innall the texts and images with your own knowledge, no place holders. I need 5 slides. | c2f08c8f8b328fd04f052157874b8655 | {
"intermediate": 0.19653993844985962,
"beginner": 0.5397645831108093,
"expert": 0.26369547843933105
} |
22,500 | ModuleNotFoundError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/haystack/nodes/file_converter/base.py in <module>
16 with LazyImport("Run 'pip install farm-haystack[preprocessing]' or 'pip install langdetect'") as langdetect_import:
---> 17 import langdetect
18
ModuleNotFoundError: No module named 'langdetect' | 212b7d78f936ff1bce07add6ba0ab761 | {
"intermediate": 0.4827372431755066,
"beginner": 0.2550855278968811,
"expert": 0.2621772289276123
} |
22,501 | can you give an example of PERL code, to write/append content of an array into a file ? | 29ed9e0c87de1279839954f9c3812424 | {
"intermediate": 0.5905731916427612,
"beginner": 0.1877959817647934,
"expert": 0.22163085639476776
} |
22,502 | I have several columns B, C, D, E, F, that contain values and blank spaces.
Some of the cells in the columns are also highlighted with a background colour.
Is there a way that I can caputre into column H, all the cells that contain values and also that the cell does not have a background colour. | 5c1523792f2e47b803aede754113320f | {
"intermediate": 0.40515899658203125,
"beginner": 0.27281832695007324,
"expert": 0.32202258706092834
} |
22,503 | Monsoon equivalent latitude | 414df40c90aac1d8996a923659be5c3c | {
"intermediate": 0.4595128893852234,
"beginner": 0.3096922039985657,
"expert": 0.2307949662208557
} |
22,504 | if want to calculate the duration for each treatment group, and for each treatment group, there are several subjects. first I will calculate the duration for each treatment within the same subject then I will calculate the median duration for the same treatment group, for the same treatment group, only one median_duration will be for the one treatment group, how to achieve this logic in R | b1099301acacf361a71b32404d718fbb | {
"intermediate": 0.3942119777202606,
"beginner": 0.19691696763038635,
"expert": 0.4088710844516754
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.