row_id int64 0 48.4k | init_message stringlengths 1 342k | conversation_hash stringlengths 32 32 | scores dict |
|---|---|---|---|
17,782 | from tkinter import *
class main:
def __init__(self):
self.window=Tk()
self.window.title("Testing GUI")
self.label=label(self.window,text="HelloM110Students!")
self.label.pack()
mainloop()
p1=main() أين الخطأ | 96ade2edd2d9074e4a496f9e9301189c | {
"intermediate": 0.2552526593208313,
"beginner": 0.5950035452842712,
"expert": 0.1497437208890915
} |
17,783 | import { useState, useEffect } from “react”;
import { FormatPriceProps } from “./FormatPrice.props”;
import { useIntl, FormattedNumber } from “react-intl”;
const FormatPrice = ({ amount, currency_iso_code, dec }: FormatPriceProps) => {
const intl = useIntl();
return (
<FormattedNumber
value={amount}
style={dec || “currency”}
currency={currency_iso_code}
minimumFractionDigits={0}
maximumFractionDigits={Math.abs(amount) > 10 ? 2 : 4}
{…intl.formatNumber()}
/>
);
};
const YourComponent = () => {
const [summ, setSumm] = useState(0);
useEffect(() => {
const formattedPrice = formatPrice((balanceUsdt / coin?.price) * (percent / 100));
setSumm(formattedPrice);
}, [priceSymbol, percent]);
const formatPrice = (value: number) => {
return value.toLocaleString(“en-US”, { style: “decimal” });
};
return (
<Grid position=“relative” display=“flex”>
<TextField
type=“number”
InputProps={{ disableUnderline: true }}
variant=“standard”
value={summ}
sx={{
“& .MuiInputBase-input”: {
px: 0.6,
fontSize: 13,
direction: “rtl”,
textAlign: “right”,
color: “000000DE”,
},
}}
onChange={(e) => setSumm(+e.currentTarget.value)}
/>
</Grid>
);
};
export default YourComponent;
у BTC получается 0.001, а нужно, чтобы было еще число в конце 0.0014 | e6bf5834ce5511ac168c90ddf0bc0be1 | {
"intermediate": 0.4534597396850586,
"beginner": 0.3111252188682556,
"expert": 0.2354150116443634
} |
17,784 | I need an R code that will take as input bam files and make a plot with Gviz that shows the alignments for one particular gene (the alignment is too the whole genome) | 3fed848a127f1c58a4f1d95faa80333c | {
"intermediate": 0.4817662239074707,
"beginner": 0.08115263283252716,
"expert": 0.43708115816116333
} |
17,785 | Write a zmap command to search for valid dns servers and save their ips to a file. | 53a5107f4ee58d52f438ca774fd74221 | {
"intermediate": 0.40015143156051636,
"beginner": 0.18020577728748322,
"expert": 0.419642835855484
} |
17,786 | I've foldout cache dictionary for all drawn properties, in custom property drawer. When I should clean the cache. Unity C# | 00ad84fbc9db447e5cd30fc8cdb74c2d | {
"intermediate": 0.48558178544044495,
"beginner": 0.2391137033700943,
"expert": 0.27530449628829956
} |
17,787 | useEffect(() => {
const formattedPrice = formatPrice((balanceUsdt / coin?.price) * (percent / 100));
console.log(formattedPrice);
setSumm(+formattedPrice);
}, [percent, symbol, priceSymbol]);
const formatPrice = (value: number) => {
const digitsBeforeDecimal = Math.floor(value).toString().length;
let maximumFractionDigits = 2;
if (digitsBeforeDecimal === 1) {
maximumFractionDigits = 3;
if (digitsBeforeDecimal === 1 && Math.floor(value) === 0) {
maximumFractionDigits = 4;
}
}
return value.toLocaleString("en-US", {style: "decimal", maximumFractionDigits: maximumFractionDigits});
};
если formattedPrice равен 2,261.84, то +formattedPrice выдает NaN, как это исправить | fcc52f69a2d7bc8105a946e462fd9f9a | {
"intermediate": 0.3351529538631439,
"beginner": 0.4118344485759735,
"expert": 0.2530125677585602
} |
17,788 | hello | 1cfd71d4bbd23304b31feb3755754990 | {
"intermediate": 0.32064199447631836,
"beginner": 0.28176039457321167,
"expert": 0.39759764075279236
} |
17,789 | i want to get minimum of multiple summmerized crystal report fields | 4355b47a574da800b92c9ce3a95f4031 | {
"intermediate": 0.37104636430740356,
"beginner": 0.2159217894077301,
"expert": 0.4130318760871887
} |
17,790 | переписать данный код на javascript desired_caps = {
"app": "C:\Octopus\Applications\Test\MatchCenter\\0.72.32-feature-MAC-777-fix-load-stages.138.3\MatchCenter.exe",
"ms:waitForAppLaunch": "15",
"deviceName": "WindowsPC",
"platformName": "Windows",
"appArguments": "--production --no_version_notification",
}
def driver():
driver = webdriver.Remote(
command_executor="http://10.88.1.2:4723/wd/hub",
desired_capabilities=desired_caps
)
yield driver
driver.quit() | 2f0d2757edc879b8c932b7db42129b25 | {
"intermediate": 0.35541462898254395,
"beginner": 0.33211660385131836,
"expert": 0.3124687075614929
} |
17,791 | does wxpython htmlwindow support css | e1f3183750c6caea9f35878334549d62 | {
"intermediate": 0.535471498966217,
"beginner": 0.27740684151649475,
"expert": 0.1871216744184494
} |
17,792 | assume only 2 inputs gates available, what is the lowest logic level for N-Bit reduction to complete?(ex. M=&N or M=|N); A. N-2Levels B.log2(N) levels C.N/2 levels D.N levels E some constant G.N^2 levels | 7b1201f601ad9579054c1a76b95084bf | {
"intermediate": 0.1920972615480423,
"beginner": 0.1961851716041565,
"expert": 0.6117175817489624
} |
17,793 | appium options для windows приложения python | c6a18cdac0dce103eed4249fa0e8f1c0 | {
"intermediate": 0.4647410213947296,
"beginner": 0.2751806378364563,
"expert": 0.2600783109664917
} |
17,794 | <button (click)="onGoToAllProducts()">All</button>
<button *ngFor="let tab of mainMenuItemsDataSet" (click)="onSelectMenuTabs(tab)"{{tab?.name}}</button>, i want the first button show when all other buttons render not before them | d2bb237057717a7097219cbdc1920d8b | {
"intermediate": 0.4950258433818817,
"beginner": 0.2572345733642578,
"expert": 0.24773958325386047
} |
17,795 | I used your code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.25
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
if buy_qty > sell_qty and (buy_qty / sell_qty) > (1 + threshold):
signal.append('buy')
elif sell_qty > buy_qty and (sell_qty / buy_qty) > (1 + threshold):
signal.append('sell')
else:
signal.append('')
return signal
Can you set threshold to deaposon 15% to 25% please | 32f58aad70731eb3850008a7dcd6a8e0 | {
"intermediate": 0.4608185589313507,
"beginner": 0.1910148710012436,
"expert": 0.34816664457321167
} |
17,796 | security misconfiguration | 16af18e353aa2d8bc72c027837a71a32 | {
"intermediate": 0.28225550055503845,
"beginner": 0.4709737002849579,
"expert": 0.24677081406116486
} |
17,797 | у меня есть форма для кнопки разблокировки карты, можешь сделать такую же только для блокировки карты?
<c:if test="${!empty list.content}">
<tbody>
<c:forEach items="${list.content}" var="item">
<tr>
<td>${item.state.stringValue}</td>
<td>
<fmt:formatDate var="updateDate" value="${item.updateDate}" pattern="dd.MM.yyyy HH:mm" />
${updateDate}
</td>
<td>
<c:choose>
<c:when test="${item.type eq 'PAN'}">
<a href="/acq-support-web/lock-card/lock_info/${item.id}"> ${item.maskedCode()} </a>
</c:when>
<c:otherwise>
<a href="/acq-support-web/lock-card/lock_info/${item.id}"> ${item.getCode()} </a>
</c:otherwise>
</c:choose>
</td>
<td>${item.fraudCheck.type.title}</td>
<td>
<fmt:formatDate var="lastUnlockDate" value="${item.lastUnlockDate}" pattern="dd.MM.yyyy HH:mm" />
${lastUnlockDate}
</td>
<td>${item.lastActionUser}</td>
<td align="right">${item.unlockCount}</td>
<td>
<c:choose>
<c:when test="${item.state eq 'ACTIVE'}">
<sec:authorize access="hasPermission(null, 'lock-card.unlock')">
<a href="#" class="btn btn-danger" data-toggle="modal" data-target="#confirmModal" data-action="/lock-card/unlock_form/${item.id}">
<i class="fa fa-unlock "></i>
</a>
</sec:authorize>
</c:when>
</c:choose>
</td>
</tr>
</c:forEach>
</tbody>
</c:if> | 68deeebcd4e30d2b8b71f568993bd8a0 | {
"intermediate": 0.2847575843334198,
"beginner": 0.5426918864250183,
"expert": 0.1725504845380783
} |
17,798 | synthaxe sql sur oracle create table vente1(IDCLI char(4) not null references client1,IDPRO char(6) not null ,date DATE NOT NULL,QTE SMALLINT CHECK (QTE between 1 and 10),constraint table primary key(idcli,idpro,date),foreign key (idpro) references produit1 on delete cascade on update cascade)
/ | 26e44829d7148d83d07f8a4f1c49c8a7 | {
"intermediate": 0.3878038227558136,
"beginner": 0.2655782103538513,
"expert": 0.34661802649497986
} |
17,799 | can you give me a example of golang code, with a struct, specifiing an URL where to send the json payload ? | 2bf468e893c364851810ca4c21e2c41d | {
"intermediate": 0.719077467918396,
"beginner": 0.10831302404403687,
"expert": 0.17260956764221191
} |
17,800 | How to make a Chinese chess game with unity | 4d2f200eca286b468d5a921cad33e035 | {
"intermediate": 0.28179582953453064,
"beginner": 0.3290971517562866,
"expert": 0.38910701870918274
} |
17,801 | Can you write python code that makes an input box pop up where you put in a YouTube link and it downloads it? | 5cc24c8c150511fcafd1bc030670a7f9 | {
"intermediate": 0.5077140927314758,
"beginner": 0.1132773607969284,
"expert": 0.37900853157043457
} |
17,802 | please write the python code of password generator that will ask how many letters, symbols and numbers user would like to have in the password | b102ca0e46c635a3b0b39a6c22aa36fe | {
"intermediate": 0.30522745847702026,
"beginner": 0.1787569671869278,
"expert": 0.5160155892372131
} |
17,803 | Please write the python 3.0 code of password generator that will ask how many letters, symbols and numbers user would like to have in the password. Please do not use 'join' in the code | 3ddd657dc7cc9b4065527597b98c4921 | {
"intermediate": 0.39579811692237854,
"beginner": 0.26717060804367065,
"expert": 0.33703121542930603
} |
17,804 | Fix the code
# Define a function to check the value in Column comment
def check_column_value(row):
if pd.isnull(value1):
return ''
elif pd.isnull(value2):
return ''
elif 'TPR' in str(value2).upper():
return 'TPR'
elif '2/3' in str(value2).upper():
return '2/3'
else:
return 'Other'
# Apply the function to each value in Columns order_number and comment
combined_df2['order_number','comment'] = combined_df2['order_number','comment'].apply(check_column_value)
The error isKeyError Traceback (most recent call last)
File ~\AppData\Local\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3802, in Index.get_loc(self, key, method, tolerance)
3801 try:
-> 3802 return self._engine.get_loc(casted_key)
3803 except KeyError as err:
File ~\AppData\Local\anaconda3\Lib\site-packages\pandas\_libs\index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~\AppData\Local\anaconda3\Lib\site-packages\pandas\_libs\index.pyx:165, in pandas._libs.index.IndexEngine.get_loc()
File pandas\_libs\hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas\_libs\hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: ('order_number', 'comment')
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In[35], line 15
12 return 'Other'
14 # Apply the function to each value in Columns order_number and comment
---> 15 combined_df2['order_number','comment'] = combined_df2['order_number','comment'].apply(check_column_value)
File ~\AppData\Local\anaconda3\Lib\site-packages\pandas\core\frame.py:3807, in DataFrame.__getitem__(self, key)
3805 if self.columns.nlevels > 1:
3806 return self._getitem_multilevel(key)
-> 3807 indexer = self.columns.get_loc(key)
3808 if is_integer(indexer):
3809 indexer = [indexer]
File ~\AppData\Local\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3804, in Index.get_loc(self, key, method, tolerance)
3802 return self._engine.get_loc(casted_key)
3803 except KeyError as err:
-> 3804 raise KeyError(key) from err
3805 except TypeError:
3806 # If we have a listlike key, _check_indexing_error will raise
3807 # InvalidIndexError. Otherwise we fall through and re-raise
3808 # the TypeError.
3809 self._check_indexing_error(key)
KeyError: ('order_number', 'comment') | 16981e887cc9873d12f5126232045136 | {
"intermediate": 0.4028935730457306,
"beginner": 0.40947118401527405,
"expert": 0.18763525784015656
} |
17,805 | .*((?!\.exe)\.\w{1,5}) i get an error, but i need to poot lookaround here is there a way to start one regexp inside another recursively | 9ab9dbae5efd96e06e57d5b919b8b741 | {
"intermediate": 0.49713125824928284,
"beginner": 0.24825671315193176,
"expert": 0.2546120285987854
} |
17,806 | I have c++ wxwidgets project, which stores games information played by the user, I am not sure if I should be using a vector with heaps or stack elements.
the current game data stored is:
wxString name;
wxString system;
wxString genre;
CompletionStatus completionStatus;
unsigned int finishYear;
unsigned int startYear;
Consider that the game list can increase because new games are being made and added to the played list.
Which one should I use to store the data in a vector, heap or stack? | a1da3e6b40ce7befcbc4472b1cea244b | {
"intermediate": 0.5635707378387451,
"beginner": 0.25644978880882263,
"expert": 0.17997944355010986
} |
17,807 | how to delete a function from function app in azure | 669c5064fb716bf414da5ee3e7056a0a | {
"intermediate": 0.5655573606491089,
"beginner": 0.253716379404068,
"expert": 0.18072618544101715
} |
17,808 | I used this code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
if buy_qty > sell_qty:
signal.append('buy')
elif sell_qty > buy_qty:
signal.append('sell')
else:
signal.append('')
return signal
Can you add in my strategy new params : If sell_qty > buy_qty more than 5 % signal.append('sell') elif buy_qty > sell_qty more than 5% signal.append('buy') | d41c5f97dd7570a0e0cc18d704129431 | {
"intermediate": 0.3692444860935211,
"beginner": 0.3045617640018463,
"expert": 0.32619374990463257
} |
17,809 | Consider the following diagram representing a combinational digital circuit – each gate implements a Boolean function of its inputs and there are no cycles in the circuit. The numbers annotated on the gates represent the delay d through the gate, in nanoseconds. If the inputs of a gate are ready at time t, then the output is ready at time t+d. (a) How much time does such a circuit take to compute its primary outputs? For the example above, the maximum delay for E is 2+4+3=9, and for F is 2+4+2=8. Write a program to compute the delay of every primary output in a combinational circuit (defined as the earliest time when the output is ready), given the circuit representation and delay information of the individual gates. suppose we require the output to be ready at a specific time. When do we require each input to be ready so that the output timing requirement is met?
Input: circuit.txt
Input: required_delays.txt
Output: input_delays.txt and required_delays.txt | 639d78b4d4f67c73a02827c3b0842066 | {
"intermediate": 0.3581804931163788,
"beginner": 0.2940067946910858,
"expert": 0.3478127717971802
} |
17,810 | how to authorize video | 24091c9395ffa8e1391dc95c897afffe | {
"intermediate": 0.26602980494499207,
"beginner": 0.28916043043136597,
"expert": 0.44480979442596436
} |
17,811 | ошибка error CS1501: Ни одна из перегрузок метода "GetTempPath" не принимает 1 аргументов. исправь её
using System;
using System.IO;
using Microsoft.Win32;
class Program
{
static void Main()
{
// Очистка мусора и временных файлов
ClearTemporaryFiles();
Console.WriteLine("Операции завершены.Нажмите любую клавишу для выхода…");
Console.ReadKey();
}
public static void ClearTemporaryFiles()
{
// Удаление временных файлов текущего пользователя
string userTempPath = Path.GetTempPath();
DirectoryInfo userTemp = new DirectoryInfo(userTempPath);
foreach (FileInfo file in userTemp.GetFiles())
{
try { file.Delete(); }
catch { }
}
// Удаление временных файлов всей системы
string systemTempPath = Path.GetTempPath(Environment.SpecialFolder.System);
DirectoryInfo systemTemp = new DirectoryInfo(systemTempPath);
foreach (FileInfo file in systemTemp.GetFiles())
{
try { file.Delete(); }
catch { }
}
}
static void ClearDownloadFolder()
{
string downloadPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads";
if (Directory.Exists(downloadPath))
{
Directory.Delete(downloadPath, true);
}
}
static void ClearTempFolder()
{
string tempPath = Path.GetTempPath();
if (Directory.Exists(tempPath))
{
Directory.Delete(tempPath, true);
}
}
} | 06592d17f470a7136c35b4bc2e6cfd84 | {
"intermediate": 0.307078093290329,
"beginner": 0.41723868250846863,
"expert": 0.2756832242012024
} |
17,812 | Consider the following diagram representing a combinational digital circuit – each gate implements a Boolean function of its inputs and there are no cycles in the circuit. The numbers annotated on the gates represent the delay d through the gate, in nanoseconds. If the inputs of a gate are ready at time t, then the output is ready at time t+d. (a) How much time does such a circuit take to compute its primary outputs? For the example above, the maximum delay for E is 2+4+3=9, and for F is 2+4+2=8. Write a program to compute the delay of every primary output in a combinational circuit (defined as the earliest time when the output is ready), given the circuit representation and delay information of the individual gates.
Input: Circuit file (see example file circuit.txt for diagram above)
Input: Gate Delay file (see example file gate_delays.txt for diagram above)
Output: Output Delay file (see example file output_delays.txt for diagram above)
(b) Extend your program to answer the converse question: suppose we require the output to be ready at a specific time. When do we require each input to be ready so that the output timing requirement is met?
Input: Circuit file (see example file circuit.txt for diagram above)
Input: Required Output Delay file (see example file required_delays.txt for diagram above)
Output: Input Delay file (see example file input_delays.txt for the diagram and required_delays.txt file above)
write code in python | 6a9268c78f14545e203ddd11924541e8 | {
"intermediate": 0.4749317467212677,
"beginner": 0.2180498093366623,
"expert": 0.307018518447876
} |
17,813 | do you remermber our last conversation ? | 65590f7dd806271ade8ada43d0bb3355 | {
"intermediate": 0.3543584942817688,
"beginner": 0.3404432237148285,
"expert": 0.3051983118057251
} |
17,814 | Put a clock in the html page | 08d771b269264072276c2893062f8a27 | {
"intermediate": 0.3481527268886566,
"beginner": 0.3520703613758087,
"expert": 0.29977691173553467
} |
17,815 | I have this code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
if buy_qty > sell_qty:
signal.append('buy')
elif sell_qty > buy_qty:
signal.append('sell')
else:
signal.append('')
return signal
Can you add in my strategy those params : If buy_qty is higher than sell_qty more than 5% signal.append('buy') if sell_qty is higher than buy_qty more than 5% signal.append('sell') | 67d1b74acf0a6af6f040fa820ab72d39 | {
"intermediate": 0.43231725692749023,
"beginner": 0.23053547739982605,
"expert": 0.33714723587036133
} |
17,817 | I have this code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
if buy_qty > sell_qty:
signal.append('buy')
elif sell_qty > buy_qty:
signal.append('sell')
else:
signal.append('')
return signal
Please set in if buy_qty is more than 55% of orders > sell_qty signal.append('buy') in elif sell_qty is more than 55% of orders > buy_qty signal.append( | b54b7d3b6007fbc87dd632cd2997193e | {
"intermediate": 0.40617677569389343,
"beginner": 0.2878350615501404,
"expert": 0.30598825216293335
} |
17,818 | Hi | 406272098d31303d902e23fdbd591223 | {
"intermediate": 0.33010533452033997,
"beginner": 0.26984941959381104,
"expert": 0.400045245885849
} |
17,819 | Can you show me working without calculator for 2952÷82 | 314938e155b9ee30e19cd2b7af52bebb | {
"intermediate": 0.4429302215576172,
"beginner": 0.23586998879909515,
"expert": 0.32119986414909363
} |
17,820 | When creating a Label widget, you can use the borderwidth and relief arguments. What does each one specify? Define briefly. | f35c70052db04a788ee86d861d352252 | {
"intermediate": 0.36247310042381287,
"beginner": 0.35589227080345154,
"expert": 0.281634658575058
} |
17,821 | package com.example.myapp;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
// Start the meterpreter session
Intent mainActivityIntent = new Intent(context, MainActivity.class);
mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(mainActivityIntent);
// Schedule the next connection at the desired interval (e.g., 1 minute)
handler.postDelayed(this, 60000);
}
}, 60000); // Initial connection delay (in milliseconds)
}
}
}
Code this Java code into smali code | 6dfa65b4c5cf9ad98a78fd98797f9fef | {
"intermediate": 0.39135777950286865,
"beginner": 0.3275367319583893,
"expert": 0.28110548853874207
} |
17,822 | Write bourne shell script for hex-editing. This script replace all hex "504b" fragments in the file file:///localhost/etc/fstab/image2.png with "6472" fragments | 25a47850ed4e9d874316a9720fc012f0 | {
"intermediate": 0.3572121262550354,
"beginner": 0.23543818295001984,
"expert": 0.40734976530075073
} |
17,823 | The code below is not retrieving any data: Sub RetrieveLinkedDocsInfo()
Dim folderPath As String
Dim folderPathLength As Integer
Dim fileName As String
Dim fileExtension As String
Dim sheetName As String
Dim linkedDocsSheet As Worksheet
Dim i As Integer
Dim vbComp As Object
Dim vbModule As Object
Dim codeLines As Variant
Dim codeLine As Variant
' Update the folder path to the location of your "zzzz ServProvDocs" folder
folderPath = "G:\Shared drives\Swan School Site Premises\PREMISES MANAGEMENT\SERVICE PROVIDERS\zzzz ServProvDocs"
' Set the worksheet object to the "Linked Docs" sheet
Set linkedDocsSheet = ThisWorkbook.Sheets("Linked Docs")
' Clear the existing contents in the "Linked Docs" sheet
linkedDocsSheet.Cells.ClearContents
' Write the headers in the "Linked Docs" sheet
linkedDocsSheet.Range("A1").Value = "Name of the document"
linkedDocsSheet.Range("B1").Value = "Document type"
linkedDocsSheet.Range("D1:G1").Value = "Sheet Name"
' Get the length of the folder path
folderPathLength = Len(folderPath)
' Loop through each file in the folder
i = 2 ' Starting row in the "Linked Docs" sheet
fileName = Dir(folderPath)
Do While fileName <> ""
' Get the file name without the folder path
fileName = Mid(fileName, folderPathLength + 1)
' Get the file extension
fileExtension = Mid(fileName, InStrRev(fileName, ".") + 1)
' Get the sheet name(s) where the document is linked
sheetName = "N/A" ' Default value if not found
' Search for the document link in VBA code modules
For Each vbComp In ThisWorkbook.VBProject.VBComponents
If vbComp.Type = 1 Then ' Module
Set vbModule = vbComp.CodeModule
codeLines = vbModule.Lines
For Each codeLine In codeLines
If InStr(1, codeLine, fileName) > 0 Then
sheetName = vbComp.Name
Exit For
End If
Next codeLine
If sheetName <> "N/A" Then Exit For
End If
Next vbComp
' Write the document information in the "Linked Docs" sheet
linkedDocsSheet.Cells(i, 1).Value = fileName
linkedDocsSheet.Cells(i, 2).Value = fileExtension
linkedDocsSheet.Cells(i, 4).Value = sheetName
' Move to the next row in the "Linked Docs" sheet
i = i + 1
' Move to the next file in the folder
fileName = Dir
Loop
End Sub | 0fc1d857a059e22b9a9245ae32697ebb | {
"intermediate": 0.32136934995651245,
"beginner": 0.4566030204296112,
"expert": 0.22202761471271515
} |
17,824 | Check the new Google Bard Chatbot!
If you have any questions or need assistance, please join [Discord]
Welcome to ChatGPT API FREE Reverse Proxy
ChatGPT API Free Reverse Proxy is a free reverse proxy to OpenAI API that allows users to access OpenAI API for free.
Table of Contents
Features
How to use ChatGPT API Reverse Proxy
Self-Host Your Own API
Use Our Hosted API
Text Completion
Chat Completion (ChatGPT)
Image Generation (DALL-E)
Examples using OpenAI libraries
Python
Node.js
License
Features
Multiple OpenAI Keys - You can use multiple OpenAI keys. The API will randomly choose one of the keys to use.
Moderation - The API has a built-in moderation system that will automatically check the prompt before sending it to OpenAI API (To prevent OpenAI terminate the account for violating OpenAI's policy).
Streaming Response - The API supports streaming response, so you can get the response as soon as it's available.
Same as Official - The API has the same endpoints as the official API, so you can use the same code to access the API (even the official OpenAI libraries)
Free - The API is free to use through our hosted API (You can also self-host the API if you want).
Note: Self-hosting it isn't free, you need to use your OpenAI Account credit.
How to use ChatGPT API Reverse Proxy
You can use ChatGPT API Reverse Proxy by choosing one of the following methods:
Self-Host Your Own API
Use Our Hosted API
Self-Host Your Own API
To self-host your own ChatGPT API, you can use the following steps:
Create an OpenAI API Key
Clone this repository and install the dependencies:
git clone https://github.com/PawanOsman/ChatGPT.git
cd ChatGPT
npm install
Set your OpenAI key and other configurations in the config.js file.
Start the server:
npm start
Use the API by sending an HTTP request to the API endpoints for example:
http://localhost:3000/v1/completions
http://localhost:3000/v1/chat/completions
Use Our Hosted API Reverse Proxy
To use our hosted ChatGPT API, you can use the following steps:
Join our Discord server.
Get your API key from the #Bot channel by sending /key command.
Use the API Key in your requests to the following endpoints.
Text Completion:
https://api.pawan.krd/v1/completions
Example: OpenAI Docs
curl --location 'https://api.pawan.krd/v1/completions' \
--header 'Authorization: Bearer pk-***[OUR_API_KEY]***' \
--header 'Content-Type: application/json' \
--data '{
"model": "text-davinci-003",
"prompt": "Human: Hello\\nAI:",
"temperature": 0.7,
"max_tokens": 256,
"stop": [
"Human:",
"AI:"
]
}'
Chat Completion (ChatGPT):
https://api.pawan.krd/v1/chat/completions
Example: OpenAI Docs
curl --location 'https://api.pawan.krd/v1/chat/completions' \
--header 'Authorization: Bearer pk-***[OUR_API_KEY]***' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-3.5-turbo",
"max_tokens": 100,
"messages": [
{
"role": "system",
"content": "You are an helpful assistant."
},
{
"role": "user",
"content": "Who are you?"
}
]
}'
Image Generation (DALL-E):
https://api.pawan.krd/v1/images/generations
Example: OpenAI Docs
curl --location 'https://api.pawan.krd/v1/images/generations' \
--header 'Authorization: Bearer pk-***[OUR_API_KEY]***' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "a photo of a happy corgi puppy sitting and facing forward, studio light, longshot.",
"n": 1,
"size": "1024x1024"
}'
Examples using OpenAI libraries
You can use the same code to access the API using the official OpenAI libraries, the only difference is that you need to change the API key and the API base URL.
Examples are for text completion, but you can use the same code for chat completion and image generation.
Python
You need to add the following lines before your code to use the API:
import openai
openai.api_key = 'pk-**********************************************'
openai.api_base = 'https://api.pawan.krd/v1'
Example code:
import openai
openai.api_key = 'pk-**********************************************'
openai.api_base = 'https://api.pawan.krd/v1'
response = openai.Completion.create(
model="text-davinci-003",
prompt="Human: Hello\nAI:",
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
stop=["Human: ", "AI: "]
)
print(response.choices[0].text)
Esta es la nueva api que me han dado: pk-LMZITIrROWZRwazmrhTnzuXMDjHRhbtKNAKSkyQciVKwteQc
y este es el codigo que tenia antes: {
import os
import openai
import random
# Aquí estableces tu nueva API key
openai.api_key = "pk-LMZITIrROWZRwazmrhTnzuXMDjHRhbtKNAKSkyQciVKwteQc"
# Aquí estableces la nueva URL base para la API
openai.api_base = 'https://api.pawan.krd//v1/completions'
def generate_example(prompt, prev_examples, temperature=.5):
messages=[
{
"role": "system",
"content": f"You are generating data which will be used to train a machine learning model.\n\nYou will be given a high-level description of the model we want to train, and from that, you will generate data samples, each with a prompt/response pair.\n\nYou will do so in this format:\n | 96e8dcc9531b84b66046e9c9e1403f1e | {
"intermediate": 0.3879624307155609,
"beginner": 0.28187116980552673,
"expert": 0.3301663398742676
} |
17,825 | const latebackgroundColor = (clr, late) => {
return setTimeout(() => {
delayedColoring(randomColor(), late);
}, late);
};
latebackgroundColor(randomColor(), 2000)
.then(() => {
return latebackgroundColor(randomColor(), 2000);
})
I asked you to remove the promise from the function and you removed it but the function isn't working so I wnt to solve that | 24c3fdbebb0ec77317e47a06ce21b67c | {
"intermediate": 0.4188027083873749,
"beginner": 0.45231348276138306,
"expert": 0.1288837343454361
} |
17,826 | excute function from a class php | fc63a896e6b0af15642478fdbd814469 | {
"intermediate": 0.20361095666885376,
"beginner": 0.6509406566619873,
"expert": 0.14544838666915894
} |
17,827 | How to iterate over struct using reflection in C++ | 99d44817bfad15be644edab5a50a78e3 | {
"intermediate": 0.3439398407936096,
"beginner": 0.27107733488082886,
"expert": 0.38498279452323914
} |
17,828 | I used your code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.55
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
if sell_qty > buy_qty and (sell_qty / buy_qty) > (1 + threshold):
signal.append('sell')
elif buy_qty > sell_qty and (buy_qty / sell_qty) > (1 + threshold):
signal.append('buy')
else:
signal.append('')
return signal
But it giving me only buy signal , please solve this problem ? | 160bee6a4e0e9976e65548c2b33fdbb6 | {
"intermediate": 0.5113645195960999,
"beginner": 0.22199808061122894,
"expert": 0.2666373550891876
} |
17,829 | Tell how much time in seconds a person spends on the elevator, going from their floor to floor 0.
Going down each floor takes 3 seconds per. Each stop adds another 2 seconds, plus 2 more seconds for each person getting on the elevator
Input
Line 1: The initial floor as integer F the person is on
Line 2: An integer N for the number of stops the elevator makes
Line 3: A space-seperated list with N number of A integers, determining how many people get on the elevator
Output
Line 1: The time in seconds the person spends on the elevator
Constraints
1 ≤ A, F ≤ 50
0 ≤ N ≤ 50
Example
Input
6
0
Output
18 Please solve with C# Code | bddbdde37a7b123d2a980afb8eded9c5 | {
"intermediate": 0.3869352638721466,
"beginner": 0.3244380056858063,
"expert": 0.28862670063972473
} |
17,830 | I used your code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.25
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty > buy_qty and sell_qty > (buy_qty * (1 + threshold)):
signal.append('sell')
elif buy_qty > sell_qty and buy_qty > (sell_qty * (1 + threshold)):
signal.append('buy')
else:
signal.append('')
return signal
But it giving me only buy signal, and I was need to take loss , give me code which will give me signal to buy and sell | 23d153c33c9f1b32d1be0d02607f8681 | {
"intermediate": 0.4598298668861389,
"beginner": 0.21194608509540558,
"expert": 0.3282240629196167
} |
17,831 | How do I repeat rows =FILTER(Table2[EMPLOYEE],(Table2[ACTIVE]="ACTIVE")*(Table2[PD]="YES")) | 3286ebf37e47ad342ec6d636ccdd0097 | {
"intermediate": 0.305751234292984,
"beginner": 0.35894227027893066,
"expert": 0.3353065252304077
} |
17,832 | in mysql find all the tables that have a column called "member". how would i code that | 53a5010bb8e67575af341b5f0b9550b4 | {
"intermediate": 0.49740806221961975,
"beginner": 0.21233512461185455,
"expert": 0.2902568578720093
} |
17,833 | kotlin android edittext text top | a83f10b3a1b76f86e2f05d466865e10f | {
"intermediate": 0.4004165232181549,
"beginner": 0.26425060629844666,
"expert": 0.33533287048339844
} |
17,834 | in golang, How can I specialize method for differente customers ? For customer A the function, method would behave like this, for customer B, would have another implementation... | 54495984f89ae3d6209a6ef38be92eab | {
"intermediate": 0.44126930832862854,
"beginner": 0.13642190396785736,
"expert": 0.4223087728023529
} |
17,835 | export const clickParent = (e) => e.target.parentElement.click();
Document this function, and give it a better descriptive name | 80283a1c1acb0aa4f89e50bbce9f96f1 | {
"intermediate": 0.3629874289035797,
"beginner": 0.4176665246486664,
"expert": 0.21934613585472107
} |
17,836 | I used this code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.2
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty > buy_qty:
signal.append('sell')
elif buy_qty > sell_qty:
signal.append('buy')
else:
signal.append('')
return signal
Can you add please in my code those params: if buy_qty is higher more than 10 % than sell_qty signal.append('buy') elif sell_qty is higher more than 10 % than buy_qty signa.append('sell') else signa.append('') | 266ac08b6c899f787a00433322a9eaf4 | {
"intermediate": 0.41142237186431885,
"beginner": 0.20693045854568481,
"expert": 0.38164713978767395
} |
17,837 | Write a matlab code for multiply two numbers then finding the average value of them | 1c1056a50f8ca0d00f4ecf7928d90533 | {
"intermediate": 0.22402651607990265,
"beginner": 0.1608371138572693,
"expert": 0.6151363849639893
} |
17,838 | def lala():
while True:
x=int(input("please enter a positive int or negative to exit: "))
z=[]
if x<=-1:
break
else:
if x%3==0:
z.append(x)
return z
print(lala())
اين الخطأ | 45600309896a7261fa172e77d5fdd706 | {
"intermediate": 0.2917449474334717,
"beginner": 0.5539726614952087,
"expert": 0.15428242087364197
} |
17,839 | 请帮我检查下面c语言代码,如果有问题请优化,我需要进行node-gyp编译,然后通过Node插件导入:#include <node_api.h>
#include <node_api_types.h>
// 定义HTMLAllCollection对象的枚举类型
enum ObjectType {
Undefined,
Null,
HTMLAllCollection,
HTMLHeadElement,
HTMLHtmlElement
};
// 创建一个HTMLElement
napi_value createHTMLElement(napi_env env, ObjectType type, const char* tag = “”) {
switch(type) {
case HTMLAllCollection: {
// 模拟HTMLAllCollection对象
//…
break;
}
case HTMLHeadElement: {
// 模拟HTMLHeadElement对象
//…
break;
}
case HTMLHtmlElement: {
// 模拟HTMLHtmlElement对象
//…
break;
}
default:
break;
}
return NULL;
}
// DocumentAll函数
napi_value DocumentAll(napi_env env, napi_callback_info info) {
// 模拟document.all的行为
napi_value result;
napi_get_boolean(env, true, &result);
return result;
}
// DocumentAll_toString函数
napi_value DocumentAll_toString(napi_env env, napi_callback_info info) {
// 返回’[object HTMLAllCollection]'
napi_value result;
napi_create_string_utf8(env, “[object HTMLAllCollection]”, -1, &result);
return result;
}
// DocumentAll_apply函数
napi_value DocumentAll_apply(napi_env env, napi_callback_info info) {
// 返回一个HTMLHeadElement对象
return createHTMLElement(env, HTMLHeadElement);
}
// DocumentAll_get函数
napi_value DocumentAll_get(napi_env env, napi_callback_info info) {
uint32_t index;
napi_get_value_uint32(env, info, &index);
if (index == 0) {
// 返回一个HTMLHtmlElement对象
return createHTMLElement(env, HTMLHtmlElement);
}
return NULL;
}
// 初始化模块
napi_value Init(napi_env env, napi_value exports) {
// 导出函数到exports对象
napi_property_descriptor properties[] = {
{ “DocumentAll”, NULL, DocumentAll, NULL, NULL, NULL, napi_default, NULL },
{ “toString”, NULL, DocumentAll_toString, NULL, NULL, NULL, napi_default, NULL },
{ “apply”, NULL, DocumentAll_apply, NULL, NULL, NULL, napi_default, NULL },
{ “get”, NULL, DocumentAll_get, NULL, NULL, NULL, napi_default, NULL }
};
napi_define_properties(env, exports, sizeof(properties) / sizeof(properties[0]), properties);
return exports;
}
// 注册模块
NAPI_MODULE(document_all, Init) | bb1006ff9761ca63901780b6228bc422 | {
"intermediate": 0.33180177211761475,
"beginner": 0.37420710921287537,
"expert": 0.2939911186695099
} |
17,840 | I used this code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.1
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
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
if sell_qty > buy_qty and (sell_qty / buy_qty) > (1 + threshold):
signal.append('sell')
elif buy_qty > sell_qty and (buy_qty / sell_qty) > (1 + threshold):
signal.append('buy')
else:
signal.append('')
return signal
But why my code doesn't give me sell signal ? | 3a4d2d055e188467d1604c53d8ff9527 | {
"intermediate": 0.4977637827396393,
"beginner": 0.2886418402194977,
"expert": 0.21359436213970184
} |
17,841 | Hi i would like a raspberry pi zero to create a picture out of information i give it, the picture is made out of a black background and white text, the text should be changed via a webserver. | 068e10c6b0eabbe1af9f0c68ed440840 | {
"intermediate": 0.37757956981658936,
"beginner": 0.24524405598640442,
"expert": 0.3771763741970062
} |
17,842 | i have a database. join all member_id columns and containing information | ce5c028e0198880430950288be0fcce6 | {
"intermediate": 0.3648841679096222,
"beginner": 0.29637083411216736,
"expert": 0.33874496817588806
} |
17,843 | 希望将下面的c代码格式和字符进行优化,使其能够被node-gyp正常编译:
#include <node_api.h>
// HTML element types
typedef enum {
HTML_ELEMENT_HTML,
HTML_ELEMENT_HEAD
// 添加其他HTML元素类型
} HTMLElementType;
// HTML element structure
typedef struct {
int type;
// 添加其他元素属性
} HTMLElement;
// document.all
napi_value GetAll(napi_env env, napi_callback_info info) {
// 返回一个对象(HTMLAllCollection)
napi_value result;
napi_create_object(env, &result);
return result;
}
// document.all[]
napi_value GetAllItem(napi_env env, napi_callback_info info) {
// 获取索引值
size_t argc = 1;
napi_value argv;
napi_get_cb_info(env, info, &argc, &argv, NULL, NULL);
// 创建对应的 HTML 元素
int index;
napi_get_value_int32(env, argv, &index);
napi_value result;
napi_create_object(env, &result);
if (index == 0) {
HTMLElement* element = malloc(sizeof(HTMLElement));
element->type = HTML_ELEMENT_HTML;
napi_wrap(env, result, (void*)element, NULL, NULL, NULL);
} else if (index == 1) {
HTMLElement* element = malloc(sizeof(HTMLElement));
element->type = HTML_ELEMENT_HEAD;
napi_wrap(env, result, (void*)element, NULL, NULL, NULL);
} else {
// 处理其他索引
}
return result;
}
// typeof document.all == ‘undefined’
napi_value TypeOfAll(napi_env env, napi_callback_info info) {
return NULL;
}
// document.all == undefined
napi_value AllEqualsUndefined(napi_env env, napi_callback_info info) {
napi_value result;
napi_get_boolean(env, true, &result);
return result;
}
// document.all == null
napi_value AllEqualsNull(napi_env env, napi_callback_info info) {
napi_value result;
napi_get_boolean(env, true, &result);
return result;
}
// document.all == document.all
napi_value AllEqualsAll(napi_env env, napi_callback_info info) {
return NULL;
}
// document.all()
napi_value CallAll(napi_env env, napi_callback_info info) {
return NULL;
}
// document.all.toString()
napi_value ToStringAll(napi_env env, napi_callback_info info) {
napi_value result;
napi_create_string_utf8(env, "[object HTMLAllCollection]", NAPI_AUTO_LENGTH, &result);
return result;
}
// Object.apply.call(document.all, null, [1])
napi_value ApplyCallAll(napi_env env, napi_callback_info info) {
// 创建一个头部元素
napi_value result;
napi_create_object(env, &result);
HTMLElement* element = malloc(sizeof(HTMLElement));
element->type = HTML_ELEMENT_HEAD;
napi_wrap(env, result, (void*)element, NULL, NULL, NULL);
return result;
}
// document.all[0]
napi_value GetAllElement(napi_env env, napi_callback_info info) {
// 创建一个 HTML 元素
napi_value result;
napi_create_object(env, &result);
HTMLElement* element = malloc(sizeof(HTMLElement));
element->type = HTML_ELEMENT_HTML;
napi_wrap(env, result, (void*)element, NULL, NULL, NULL);
return result;
}
napi_value Init(napi_env env, napi_value exports) {
// 创建 document 对象
napi_value document;
napi_create_object(env, &document);
// 创建 document.all 方法
napi_value all;
napi_create_function(env, NULL, 0, GetAll, NULL, &all);
napi_set_named_property(env, document, "all", all);
// 创建 document.all[] 方法
napi_value allItem;
napi_create_function(env, NULL, 0, GetAllItem, NULL, &allItem);
napi_set_named_property(env, all, "toString", allItem);
// 创建其他功能方法
napi_create_function(env, NULL, 0, TypeOfAll, NULL, &export);
napi_set_named_property(env, document, "typeof", export);
// 添加其他方法的创建
// 将 document 对象添加到导出的模块中
napi_set_named_property(env, exports, "document", document);
return exports;
}
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init); | 0869bae031e70a930cf8bfe7f03bca27 | {
"intermediate": 0.26555198431015015,
"beginner": 0.503872811794281,
"expert": 0.23057515919208527
} |
17,844 | create table produit(idro char(6) primary key,nom char(30) not null unique,marque char(30) ,prix dec(6,2),qstock smallint check(qstock between 0 and 100),constraint check_marque check(marque<>'ibm'or qstock<10)))
/ | 3be3193838ccb97b6d0b7715aa256064 | {
"intermediate": 0.3308079242706299,
"beginner": 0.3236493170261383,
"expert": 0.3455427289009094
} |
17,845 | can i search google or yandex with regexp | 96ff1fb2dcb4a9383f824934c4794908 | {
"intermediate": 0.2733224630355835,
"beginner": 0.3152227997779846,
"expert": 0.4114546775817871
} |
17,846 | calculate command execute time in seconds in shell file | 731db0302dd7217591a5894905b7de4d | {
"intermediate": 0.3366219401359558,
"beginner": 0.2886510193347931,
"expert": 0.3747270107269287
} |
17,847 | compare a float variable to a float number in shell | 45d57efb4542060793b910845d7251ec | {
"intermediate": 0.3567836582660675,
"beginner": 0.4802972972393036,
"expert": 0.1629190295934677
} |
17,848 | The role of xorg modesetting | cc9da0802eeb9699679e8c456bcf40c3 | {
"intermediate": 0.31620678305625916,
"beginner": 0.2668212354183197,
"expert": 0.41697198152542114
} |
17,849 | create stored proc to check number passed oddness | babd6c08c288ae5a7e886bff6615d3b2 | {
"intermediate": 0.3298467993736267,
"beginner": 0.18054336309432983,
"expert": 0.48960989713668823
} |
17,850 | export function WorkoutContextProvider({children}) {
return (
<WorkoutContext.Provider>
{children}
</WorkoutContext.Provider>
)
}
'children' is missing in prop validation | ed6da81effd1bbfea5f0e28a384f2e61 | {
"intermediate": 0.3398642838001251,
"beginner": 0.440947026014328,
"expert": 0.21918874979019165
} |
17,851 | Create a conditional column - GroupRange when consecutive numbers finishes with min and max range till break.
create table numbers (number int)
insert into numbers values(1),(2),(3),(5),(6),(8),(11),(12)
select number from numbers
--expected result:
--number GroupRange
--1 1-3
--2 1-3
--3 1-3
--5 5-6
--6 5-6
--8 8-8
--11 11-12
--12 11-12 | d472c34a5c6a88e796146213bf7c4c6b | {
"intermediate": 0.393317312002182,
"beginner": 0.283067911863327,
"expert": 0.3236147165298462
} |
17,852 | can you create a lua script for fivem to use voice on npc integration | 9288b1cd6a6b80df5206067b129b9731 | {
"intermediate": 0.3937011957168579,
"beginner": 0.17142581939697266,
"expert": 0.4348730444908142
} |
17,853 | Create a conditional column - GroupRange when consecutive numbers finishes with min and max range till break.
create table numbers (number int)
insert into numbers values(1),(2),(3),(5),(6),(8),(11),(12)
select number from numbers
--expected result:
--number GroupRange
--1 1-3
--2 1-3
--3 1-3
--5 5-6
--6 5-6
--8 8-8
--11 11-12
--12 11-12 | a7e0c4c9d9bdda97430db3160f289412 | {
"intermediate": 0.390690416097641,
"beginner": 0.2826926112174988,
"expert": 0.3266170024871826
} |
17,854 | Create a conditional column - GroupRange when consecutive numbers finishes with min and max range till break but I want to get this expected results on my sql --number GroupRange
--1 1-3
--2 1-3
--3 1-3
--5 5-6
--6 5-6
--8 8-8
--11 11-12
--12 11-12 | 1f7eb1975d36eca11d93d60143e996d7 | {
"intermediate": 0.3887515962123871,
"beginner": 0.33237892389297485,
"expert": 0.27886947989463806
} |
17,855 | Help me fix this code:
import PySimpleGUI as sg
from pokemon_sql import *
import sqlitedb as db
from pokemon_gui_entry import show_pokemon_form
from pokemon_class import PokemonType
# VARIABLES/LISTS (I think)-------------------------------------------------
sg.theme("HotDogStand")
FORM_FONT = "Calibri 16"
LABEL_SIZE = (10, 1)
BUTTON_SIZE = (7, 1)
BUTTON_PAD = ((10, 0), (20, 0))
BG = "Black"
db.db_file = pokemon_database # IN BOOK IT SAYS db.db_file = mission_database BUT CHANGE IT TO db.db_file = pokemon_database
pokemon_list = []
pokemon_data = []
data_index = -1
# WINDOW/LAYOUT-------------------------------------------------
form = [
[
sg.Text("Name", size=LABEL_SIZE, background_color=BG,),
sg.Text("", key="name", background_color=BG,),
],
[
sg.Text("Nickname", size=LABEL_SIZE, background_color=BG,),
sg.Text("", key="nick", background_color=BG,),
],
[
sg.Text("Height", size=LABEL_SIZE, background_color=BG,),
sg.Text("", key="height", background_color=BG,),
sg.Text("ft", key="name", background_color=BG,),
],
[
sg.Text("Weight", size=LABEL_SIZE, background_color=BG,),
sg.Text("", key="weight", background_color=BG,),
sg.Text("lbs", key="name", background_color=BG,),
],
[
sg.Text("Description", size=LABEL_SIZE, background_color=BG,),
sg.Text("", key="desc", background_color=BG,),
],
[
sg.Text("Type", size=LABEL_SIZE, background_color=BG),
sg.Text("", key="type1", font=("Calibri", 16, "bold"), background_color=BG, text_color="white", border_width=2.5, pad=((4, 0),(4, 4))),
sg.Text("", key="type2", font=("Calibri", 16, "bold"), background_color=BG, text_color="white", border_width=2.5, pad=((0, 0),(4, 4))),
],
]
layout = [
[
sg.Listbox(
[],
key="list",
size=(20, 10),
default_values=None,
select_mode=None,
enable_events=True,
font=FORM_FONT,
),
sg.Column(
form,
size=(400, 275),
vertical_alignment="top",
element_justification="left",
background_color=BG,
),
],
[
sg.OK("OK", key="ok", pad=BUTTON_PAD, size=BUTTON_SIZE),
sg.Button("Add", key="add", pad=BUTTON_PAD, size=BUTTON_SIZE),
sg.Button("Edit", key="edit", pad=BUTTON_PAD, size=BUTTON_SIZE),
sg.Button("Delete", key="delete", pad=BUTTON_PAD, size=BUTTON_SIZE),
],
]
# FUNCTIONS---------------------------------------------------------------------
def remove_string(string):
string.replace("'", "")
return string
def pokemon_data_to_list():
global pokemon_list, data_index
pokemon_list = db.query_table("SELECT pokemon_name FROM pokemon")
values = []
for pokemon in pokemon_list:
values.append(pokemon[0])
if len(values) > 0 and data_index == -1:
data_index = 0
window["list"].update(values=values, set_to_index=data_index)
def pokemon_data_to_form(name): # Get values for the selected pokemon
global pokemon_data
if data_index > -1:
if name == None:
name = pokemon_list[data_index][0]
sql_query = (
"""
SELECT * FROM pokemon
INNER JOIN pokemon_stats ON pokemon.pokemon_stats_id = pokemon_stats.pokemon_stats_id
WHERE pokemon_name =
"""
+ '"'
+ name
+ '";'
)
pokemon_data = db.query_table(sql_query)
print(name,sql_query,pokemon_data)
window["name"].update(value=pokemon_data[0][1])
window["nick"].update(value=pokemon_data[0][4])
window["weight"].update(value=pokemon_data[0][5])
window["height"].update(value=pokemon_data[0][6])
window["desc"].update(value=pokemon_data[0][7])
window["type1"].update(
value=pokemon_data[0][8],
background_color=PokemonType[remove_string(pokemon_data[0][8])].value,
)
window["type2"].update(
value=pokemon_data[0][9],
background_color=PokemonType[remove_string(pokemon_data[0][9])].value,
)
#window['desc'].update()
def pokemon_type_name_to_id(s):
sql_query = (
"""
SELECT * FROM pokemon
WHERE pokemon_name =
"""
+ '"'
+ s
+ '";'
) # IN BOOKLET IT SAYS pokemon_name = IN THE LINE ABOVE IT NEEDS TO BE pokemon_type_name =
d = db.query_table(sql_query)
#print("pokemon_id_from_name = ", d)
return d[0][0]
# MISC STUFF-------------------------------------------------------------------
window = sg.Window(
"POKEMON List", layout, finalize=True, font=FORM_FONT, margins=(10, 20)
)
pokemon_data_to_list()
pokemon_data_to_form(None)
print(pokemon_data[0])
# MAIN LOOP--------------------------------------------------------------------
while True:
event, values = window.read(timeout=10)
if not event == "__TIMEOUT__":
print(event, "|", values)
if event in ["Exit", sg.WIN_CLOSED, "ok"]:
break
elif event == "list":
pokemon_data_to_form(values["list"][0])
elif event in ["add", "edit"]:
if event == "edit" and data_index > -1:
data = {}
data["pokemon_name"] = pokemon_data[0][1]
data["nick"] = pokemon_data[0][4]
data["pokemon_weight"] = pokemon_data[0][5]
data["pokemon_height"] = pokemon_data[0][6]
data["desc"] = pokemon_data[0][7]
data["pokemon_type1"] = pokemon_data[0][8]
data["pokemon_type2"] = pokemon_data[0][9]
else:
data = None
pokemon_data = None
data = show_pokemon_form(data)
if data != None:
pokemon = []
pokemon_stats = []
pokemon_stats.append(data["pokemon_name"])
pokemon_stats.append(data["nick"])
pokemon_stats.append(data["pokemon_weight"])
pokemon_stats.append(data["pokemon_height"])
pokemon_stats.append(data["desc"])
pokemon_stats.append(data["pokemon_type1"])
pokemon_stats.append(data["pokemon_type2"])
if pokemon_data == None: # add to the list
sql = """
INSERT INTO pokemon(pokemon_name)
VALUES(?);
"""
id = db.insert_record(sql, pokemon)
sql = """
UPDATE pokemon
SET pokemon_stats_id = pokemon_id
WHERE pokemon_name = ?
"""
id = db.update_record(sql, pokemon)
sql = """
INSERT INTO pokemon_stats(pokemon_stats_nick, pokemon_stats_weight, pokemon_stats_height, pokemon_type_desc, pokemon_stats_type_one,
pokemon_stats_type_two)
VALUES(?,?,?,?,?,?);
"""
id = db.insert_record(sql, pokemon_stats)
print("Added pokemon stats record", id)
else: # edit the list
pokemon.append(pokemon_data[0][0])
id = db.update_record(sql_update_pokemon, pokemon)
print("Updated pokemon record", id)
pokemon_stats.append(pokemon_data[0][0])
id = db.update_record(sql_update_pokemon_stats, pokemon_stats)
print("Updated pokemon record", id)
pokemon_data_to_list()
pokemon_data_to_form(data["pokemon_name"])
elif event == "delete":
if pokemon_data != None:
data = [pokemon_data[0][0]]
sql = """
DELETE FROM pokemon
WHERE pokemon_id = ?
"""
ok = db.update_record(sql, data)
print("Pokemon Deleted")
sql = """
DELETE FROM pokemon_stats
WHERE pokemon_stats_id = ?
"""
ok = db.update_record(sql, data)
if ok:
print("Record deleted")
pokemon_data_to_list()
pokemon_data_to_form(None)
window.close()
Error:
BULBASAUR
SELECT * FROM pokemon
INNER JOIN pokemon_stats ON pokemon.pokemon_stats_id = pokemon_stats.pokemon_stats_id
WHERE pokemon_name =
"BULBASAUR"; [(1, 'BULBASAUR', 1, 1, 'ROSER', 6.9, 0.7, 'Funny Pokemon', 'GRASS', 'POISON')]
(1, 'BULBASAUR', 1, 1, 'ROSER', 6.9, 0.7, 'Funny Pokemon', 'GRASS', 'POISON')
edit | {'list': ['BULBASAUR']}
ok | {'pokemon_name': 'BULBASAU', 'nick': 'ROSER', 'pokemon_height': '0.7', 'pokemon_weight': '6.9', 'desc': 'Funny Pokemon', 'pokemon_type1': 'GRASS', 'pokemon_type2': 'POISON'}
Incorrect number of bindings supplied. The current statement uses 2, and there are 1 supplied.
Updated pokemon record False
Incorrect number of bindings supplied. The current statement uses 7, and there are 8 supplied.
Updated pokemon record False
BULBASAU
SELECT * FROM pokemon
INNER JOIN pokemon_stats ON pokemon.pokemon_stats_id = pokemon_stats.pokemon_stats_id
WHERE pokemon_name =
"BULBASAU"; []
Traceback (most recent call last):
File "/Users/kory/mu_code/pokemon_gui.py", line 272, in <module>
pokemon_data_to_form(data["pokemon_name"])
File "/Users/kory/mu_code/pokemon_gui.py", line 137, in pokemon_data_to_form
window["name"].update(value=pokemon_data[0][1])
IndexError: list index out of range
--------------------
This happens when I try use my edit function and change the name. | dc4562179f34346c74a79a18a84021de | {
"intermediate": 0.40536215901374817,
"beginner": 0.3593558967113495,
"expert": 0.23528186976909637
} |
17,856 | --expected result:
--number GroupRange
--1 1-3
--2 1-3
--3 1-3
--5 5-6
--6 5-6
--8 8-8
--11 11-12
--12 11-12 | 1d756caa1064947e6c825d4165d41899 | {
"intermediate": 0.36890172958374023,
"beginner": 0.33471542596817017,
"expert": 0.2963827848434448
} |
17,857 | new Date(2023-08-17T04:22:24.206Z) | 306b406a21381fbb9b6a6e2f639c3785 | {
"intermediate": 0.32478275895118713,
"beginner": 0.23042576014995575,
"expert": 0.4447914958000183
} |
17,858 | Generate a complex java code with one line causing an exception | a56399125c1d1ef9e392d42e57206429 | {
"intermediate": 0.29385384917259216,
"beginner": 0.4412738084793091,
"expert": 0.26487237215042114
} |
17,859 | What is wrong with this code
import java.util.Scanner;
public class ComplexCodeWithException {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
try {
int[] arr = new int[3];
System.out.println(“Enter an index to access the array element:”);
int index = scanner.nextInt();
int element = arr[index];
System.out.println("Element at index " + index + " is: " + element);
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println(“Exception caught: Index is out of bounds!”);
}
}
} | 74e37e8f023c8989f0f26e4d7c2d56c7 | {
"intermediate": 0.5077328085899353,
"beginner": 0.3381166160106659,
"expert": 0.15415054559707642
} |
17,860 | is javascript,why [] !== null is ture | 815e640c9326b6c12de36a734ddaaa41 | {
"intermediate": 0.16771826148033142,
"beginner": 0.632809579372406,
"expert": 0.19947217404842377
} |
17,861 | give a list of 100 games that i could write using java | f44ad4028a37d53aab84354fcb334df0 | {
"intermediate": 0.40028488636016846,
"beginner": 0.4110643267631531,
"expert": 0.1886507123708725
} |
17,862 | how to download share point's file using java | 692021dde496ca85c86de12ca9b209a2 | {
"intermediate": 0.5166636109352112,
"beginner": 0.2510409355163574,
"expert": 0.2322954535484314
} |
17,863 | Write a Python srcipt to check the values in columns A and B. If A is empty then make the value in B also empty. If A is not empty, then check the value in B. If it empty, remain empty. If it contain TPR in any case, assign TPR, otherwise assign Other. | 358e35350098b5803babf8a06e6a37ff | {
"intermediate": 0.4048824906349182,
"beginner": 0.232716366648674,
"expert": 0.3624010980129242
} |
17,864 | what does the screen command do in linux? specifically when you ssh into a machine a nd screen a binary ? | fc8b03cc541ab86dd39e3adb1f995059 | {
"intermediate": 0.3736721873283386,
"beginner": 0.34234145283699036,
"expert": 0.283986359834671
} |
17,865 | closure in js I want some examples from easy ones to advanced ones | 3ed0291c56b96d501e36c58b38171dfc | {
"intermediate": 0.3321451246738434,
"beginner": 0.4063914120197296,
"expert": 0.261463463306427
} |
17,866 | How to iterate through structure fields in c++ 11 when fields are boost::optional | b9d68f30179abb322c55ec5ed5c24d4c | {
"intermediate": 0.4286104440689087,
"beginner": 0.1933365762233734,
"expert": 0.3780530095100403
} |
17,867 | I have a function t hat I want to compltely exit the program if a condition is met within the function, how c an i do that in go? | 87b8ef0cffa5e0b1e9fea0b6639087ce | {
"intermediate": 0.39386680722236633,
"beginner": 0.23858778178691864,
"expert": 0.36754539608955383
} |
17,868 | How to call GPU hardware drivers with xorg modesetting | 3c7342f1ede8e51432000377d6b6c181 | {
"intermediate": 0.24753928184509277,
"beginner": 0.23586918413639069,
"expert": 0.5165915489196777
} |
17,869 | у меня есть метод, который при определенных сценариях блокирует карту, мне нужно сделать кнопку которая принудительно может заблокировать карту, вот код
public void blockCard(String code, FraudCheck fraudCheck) {
// Проверим наличие записей в кэше. Если запись есть - ничего не добавляем
if (this.panLockList.contains(code) || this.accLockList.contains(code) || this.partnerLockList.contains(code)) {
return;
}
// В кэше нет - значит блокировки или не было, или ее сняли
// Поищем запись в таблице блокировок (как среди активных, так и нет)
List<FraudLock> fraudLockList = dataService.selectFromWhere(QFraudLock.fraudLock, QFraudLock.class,
(f) -> f.code.eq(code).and(f.type.eq(FraudCheckTypeToFraudLockType(fraudCheck.getType())))).fetchResults().getResults();
FraudLock fraudLock;
if (fraudLockList.size() == 0) { // Не нашли - создадим новую
fraudLock = new FraudLock();
fraudLock.setCode(code);
fraudLock.setState(ACTIVE);
fraudLock.setType(FraudCheckTypeToFraudLockType(fraudCheck.getType()));
fraudLock.setFraudCheck(fraudCheck);
fraudLock = fraudLockRepository.save(fraudLock);
} else { // Нашли - будем использовать существующую - переведем ее в активное состояние
fraudLock = fraudLockList.get(0);
fraudLock.setType(FraudCheckTypeToFraudLockType(fraudCheck.getType()));
fraudLock.setFraudCheck(fraudCheck);
fraudLock.setState(ACTIVE);
fraudLock = fraudLockRepository.save(fraudLock);
}
// Добавим запись в таблицу детализации блокировки
FraudLockDetail fraudLockDetail = new FraudLockDetail();
fraudLockDetail.setFraudLock(fraudLock);
fraudLockDetail.setFraudCheck(fraudCheck);
fraudLockDetail.setAction(FraudActionType.BLOCK);
fraudLockDetailRepository.save(fraudLockDetail);
// Добавим запись в кэш
if (DIFFERENT_CARDS_TO_ACC_LIMIT.name().equals(fraudCheck.getType())) {
this.accLockList.add(code);
} else if (PARTNER_DAY_LIMIT_SUM.name().equals(fraudCheck.getType()) || PARTNER_MONTH_LIMIT_SUM.name().equals(fraudCheck.getType())) {
this.partnerLockList.add(code);
} else {
this.panLockList.add(code);
}
} | 6b4e9e789823709137247cd3e056cd88 | {
"intermediate": 0.1887132078409195,
"beginner": 0.7167803049087524,
"expert": 0.09450642019510269
} |
17,870 | iterate through structure fields in c++ 11 when fields are boost::optional using BOOST_FUSION_ADAPT_STRUCT and compare each field with threshold | 8845fe243048f248bcd26abffafd4e46 | {
"intermediate": 0.49470797181129456,
"beginner": 0.19608983397483826,
"expert": 0.3092021644115448
} |
17,871 | give the macro code to delete rows in a sheet that doesnt contains the strins in their b column that present in sheet1's a column | 14bf02c45aad4a2b8c92fb12f78f8ea5 | {
"intermediate": 0.42919111251831055,
"beginner": 0.18019352853298187,
"expert": 0.3906153738498688
} |
17,872 | some guy jokingly made a gofundme for his operation of cutting the EXA atlantic cable. in a sort of ddos attack.
that made me wonder, how hard would it really be for an individual to cut such an important cable? | d7321ec176b27f95ccf1209d912601fe | {
"intermediate": 0.43617013096809387,
"beginner": 0.303861528635025,
"expert": 0.2599683403968811
} |
17,873 | How to find out if Inspector is locked in Unity. Write me C# code | 8539abe8eed45b41acea35aa1666bcb5 | {
"intermediate": 0.5868557095527649,
"beginner": 0.26986080408096313,
"expert": 0.14328348636627197
} |
17,874 | Write me an ATTiny2313 program for two tones: 300 Hz, 1000 Hz on one output at the same time. | 949be6ff8c5622a009d0f046b37449c8 | {
"intermediate": 0.2721678614616394,
"beginner": 0.12038388103246689,
"expert": 0.6074482202529907
} |
17,875 | const roundToTickSize = (value) => {
console.log(value); // 29.400000000000002
console.log(tickSize) // 0.1
return Math.floor(value / tickSize) * tickSize
};
const roundedValue = roundToTickSize(summ);
console.log(roundedValue); // 29.400000000000002
напиши мне правильный код для округления | 5aae7d41fa56e4b00ba25adb24b94eb0 | {
"intermediate": 0.3076215088367462,
"beginner": 0.45993056893348694,
"expert": 0.23244789242744446
} |
17,876 | file = open("jojo.txt", "w")
file.write("11 12 13 14")
file.close()
file = open("jojo.txt", "r")
sum = 0
counter = 0
for i in file:
counter += 1
sum += int(i)
print(f"{counter},{sum}")
file.close() | 29fed4e681f73cd8220e0eef7a656a75 | {
"intermediate": 0.2828640341758728,
"beginner": 0.44750353693962097,
"expert": 0.2696324288845062
} |
17,877 | Delphi code for working with INI files and DLL files ? | 8f48a06af9b0768bf0cbe6fca915d83b | {
"intermediate": 0.7560204267501831,
"beginner": 0.11635224521160126,
"expert": 0.12762729823589325
} |
17,878 | how to define and initialize static std::map as global variable outside class | 46cb57c251ca8c2988975baba42b62b4 | {
"intermediate": 0.3391149640083313,
"beginner": 0.49218255281448364,
"expert": 0.16870246827602386
} |
17,879 | Power BI - Have planned value and Actual Value fields in table. Need to display to date Actual Value and Planned values | 170c9cd0a45607cbcf6ea1b65740d1e7 | {
"intermediate": 0.3943547308444977,
"beginner": 0.18174013495445251,
"expert": 0.4239051640033722
} |
17,880 | create a row of buttons the scrolls all the button has a disabled color of grey and selected one has a different color each button starts with an icon and a text next to it | 6ae893cf59bc94b97c1791c72438ef05 | {
"intermediate": 0.36104047298431396,
"beginner": 0.11040296405553818,
"expert": 0.5285565853118896
} |
17,881 | create a row of buttons flutter the scrolls all the button has a disabled color of grey and selected one has a different color each button starts with an icon and a text next to it | ce2d5a456e34b1b050cd00a162b8549e | {
"intermediate": 0.38533279299736023,
"beginner": 0.12301191687583923,
"expert": 0.49165529012680054
} |
17,882 | как сделать регистрацию и авторизацию с помощью Jwt Token и Spring Security код
при регистрации пользователь вводит юзернейм емейл пароль, при авторизации емейл пароль | 68f41e35073d409944d12b6f15aaf596 | {
"intermediate": 0.5103141069412231,
"beginner": 0.19632768630981445,
"expert": 0.29335817694664
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.